text:
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

goog.provide('__crWeb.findInPage');

// Requires __crWeb.base

/**
 * Based on code from the Google iOS app.
 *
 * @fileoverview A find in page tool. It can:
 *   1. Search for given string in the DOM, and highlight them in yellow color;
 *   2. Allow users to navigate through all match results, and highlight the
 * selected one in orange color;
 */

(function() {
/**
 * Namespace for this file.
 */
__gCrWeb.findInPage = {};

 // Store findInPage namespace object in a global __gCrWeb object referenced by
 // a string, so it does not get renamed by closure compiler during the
 // minification.
__gCrWeb['findInPage'] = __gCrWeb.findInPage;

/**
 * A string made by concatenating textContent.toLowerCase() of all TEXT nodes
 * within current web page.
 * @type {string}
 */
let allText_ = '';

/**
 * A Section contains the info of one TEXT node in the |allText_|. The node's
 * textContent is [begin, end) of |allText_|.
 */
class Section {
  /**
   * @param {number} begin Beginning index of |node|.textContent in |allText_|.
   * @param {number} end Ending index of |node|.textContent in |allText_|.
   * @param {Node} node The TEXT Node of this section.
   */
  constructor(begin, end, node) {
    this.begin = begin;
    this.end = end;
    this.node = node;
  }
}

/**
 * All the sections_ in |allText_|.
 * @type {Array<Section>}
 */
let sections_ = [];

/**
 * The index of the Section where the last PartialMatch is found.
 */
let sectionsIndex_ = 0;

/**
 * Do binary search in |sections_|[sectionsIndex_, ...) to find the first
 * Section S which has S.end > |index|.
 * @param {number} index The search target. This should be a valid index of
 *     |allText_|.
 * @return {number} The index of the result in |sections_|.
 */
function findFirstSectionEndsAfter_(index) {
  let left = sectionsIndex_;
  let right = sections_.length;
  while (left < right) {
    let mid = Math.floor((left + right) / 2);
    if (sections_[mid].end <= index) {
      left = mid + 1;
    } else {
      right = mid;
    }
  }
  return left;
}

/**
 * A Match represents a match result in the document. |this.nodes| stores all
 * the <chrome_find> Nodes created for highlighting the matched text. If it
 * contains only one Node, it means the match is found within one HTML TEXT
 * Node, otherwise the match involves multiple HTML TEXT Nodes.
 */
class Match {
  constructor() {
    this.nodes = [];
  }

  /**
   * Returns if all <chrome_find> Nodes of this match are visible.
   * @return {Boolean} If the Match is visible.
   */
  visible() {
    for (let i = 0; i < this.nodes.length; ++i) {
      if (!isElementVisible_(this.nodes[i]))
        return false;
    }
    return true;
  }

  /**
   * Adds orange color highlight for "selected match result", over the yellow
   * color highlight for "normal match result".
   * @return {undefined}
   */
  addSelectHighlight() {
    for (let i = 0; i < this.nodes.length; ++i) {
      this.nodes[i].classList.add(CSS_CLASS_NAME_SELECT);
    }
  }

  /**
   * Clears the orange color highlight.
   * @return {undefined}
   */
  removeSelectHighlight() {
    for (let i = 0; i < this.nodes.length; ++i) {
      this.nodes[i].classList.remove(CSS_CLASS_NAME_SELECT);
    }
  }
}

/**
 * The list of all the matches in current page.
 * @type {Array<Match>}
 */
__gCrWeb.findInPage.matches = [];

/**
 * Index of the currently selected match relative to all visible matches
 * on the frame. -1 if there is no currently selected match.
 * @type {number}
 */
let selectedVisibleMatchIndex_ = -1;

/**
 * Index of the currently selected match relative to
 * __gCrWeb.findInPage.matches. -1 if there is no currently selected match.
 * @type {number}
 */
let selectedMatchIndex_ = -1;

/**
 * The ID for the next Match found in |allText_|. This ID is used for
 * identifying PartialMatches of the Match, so that when
 * |processPartialMatchesInCurrentSection| is called, the <chrome_find> Nodes
 * created for each PartialMatch can be recorded in the corresponding Match.
 */
let matchId_ = 0;

/**
 * A part of a Match, within a Section. A Match may cover multiple sections_ in
 * |allText_|, so it must be split into multiple PartialMatches and then
 * dispatched into the Sections they belong. The range of a PartialMatch in
 * |allText_| is [begin, end). Exactly one <chrome_find> will be created for
 * each PartialMatch.
 */
class PartialMatch {
  /**
   * @param {number} matchId ID of the Match to which this PartialMatch belongs.
   * @param {number} begin Beginning index of partial match text in |allText_|.
   * @param {number} end Ending index of partial match text in |allText_|.
   */
  constructor(matchId, begin, end) {
    this.matchId = matchId;
    this.begin = begin;
    this.end = end;
  }
}

/**
 * A temporary array used for storing all PartialMatches inside current Section.
 * @type {Array<PartialMatch>}
 */
let partialMatches_ = [];

/**
 * A Replacement represents a DOM operation that swaps |oldNode| with |newNodes|
 * under the parent of |oldNode| to highlight the match result inside |oldNode|.
 * |newNodes| may contain plain TEXT Nodes for unhighlighted parts and
 * <chrome_find> nodes for highlighted parts. This operation will be executed
 * reversely when clearing current highlights for next FindInPage action.
 */
class Replacement {
  /**
   * @param {Node} oldNode The HTML Node containing search result.
   * @param {Array<Node>} newNodes New HTML Nodes created for substitution of
   *     |oldNode|.
   */
  constructor(oldNode, newNodes) {
    this.oldNode = oldNode;
    this.newNodes = newNodes;
  }

  /**
   * Executes the replacement to highlight search result.
   * @return {undefined}
   */
  doSwap() {
    let parentNode = this.oldNode.parentNode;
    if (!parentNode)
      return;
    for (var i = 0; i < this.newNodes.length; ++i) {
      parentNode.insertBefore(this.newNodes[i], this.oldNode);
    }
    parentNode.removeChild(this.oldNode);
  }

  /**
   * Executes the replacement reversely to clear the highlight.
   * @return {undefined}
   */
  undoSwap() {
    let parentNode = this.newNodes[0].parentNode;
    if (!parentNode)
      return;
    parentNode.insertBefore(this.oldNode, this.newNodes[0]);
    for (var i = 0; i < this.newNodes.length; ++i) {
      parentNode.removeChild(this.newNodes[i]);
    }
  }
}

/**
 * The replacements of current FindInPage action.
 * @type {Array<Replacement>}
 */
let replacements_ = [];

/**
 * The index of the Replacement from which the highlight process continue when
 * pumpSearch is called.
 * @type {Number}
 */
let replacementsIndex_ = 0;

/**
 * The total number of visible matches found.
 * @type {Number}
 */
let visibleMatchCount_ = 0;

/**
 * The last index from which the match counting process left off.
 * This is necessary since the counting might be interrupted by pumping.
 */
let visibleMatchesCountIndexIterator_ = 0;

/**
 * Process all PartialMatches inside current Section. For current Section's
 * node.textContent, all texts that are match results will be wrapped in
 * <chrome_find>, and other texts will be put inside plain TEXT Nodes. All
 * created Nodes will be stored in the Replacement of current Section, and all
 * <chrome_find> Nodes will also be recorded in their belonging Matches.
 * |partialMatches_| will be cleared when processing ends.
 * @return {undefined}
 */
function processPartialMatchesInCurrentSection() {
  if (partialMatches_.length == 0)
    return;
  let section = sections_[sectionsIndex_];
  let oldNode = section.node;
  let newNodes = [];
  let previousEnd = section.begin;
  for (let i = 0; i < partialMatches_.length; ++i) {
    let partialMatch = partialMatches_[i];
    // Create the TEXT node for leading non-matching string piece. Notice that
    // substr must be taken from TEXT Node.textContent instead of |allText_|
    // since it's in lower case.
    if (partialMatch.begin > previousEnd) {
      newNodes.push(
          oldNode.ownerDocument.createTextNode(oldNode.textContent.substring(
              previousEnd - section.begin,
              partialMatch.begin - section.begin)));
    }
    // Create the <chrome_find> Node for matching text.
    let newNode = oldNode.ownerDocument.createElement('chrome_find');
    newNode.setAttribute('class', CSS_CLASS_NAME);
    newNode.innerHTML = escapeHTML_(oldNode.textContent.substring(
        partialMatch.begin - section.begin, partialMatch.end - section.begin));
    newNodes.push(newNode);
    previousEnd = partialMatch.end;

    // Record the <chrome_find> Node in corresponding Match.
    __gCrWeb.findInPage.matches[partialMatch.matchId].nodes.push(newNode);
  }
  // Create the TEXT node for trailing non-matching string piece.
  if (previousEnd != section.end) {
    newNodes.push(
        oldNode.ownerDocument.createTextNode(oldNode.textContent.substring(
            previousEnd - section.begin, section.end - section.begin)));
  }

  // Create the Replacement of current Section.
  replacements_.push(new Replacement(oldNode, newNodes));

  partialMatches_ = [];
}

/**
 * The style DOM element that we add.
 * @type {Element}
 */
let styleElement_ = null;

/**
 * Maximum number of visible elements to count
 * @type {number}
 */
const MAX_VISIBLE_ELEMENTS = 100;

/**
 * A search is in progress.
 * @type {boolean}
 */
let searchInProgress_ = false;

/**

 * Whether or not search state variables are in a clean empty state.
 * @type {boolean}
 */
 let searchStateIsClean_ = true;

/**
 * Node names that are not going to be processed.
 * @type {Object}
 */
const IGNORE_NODE_NAMES = new Set(['SCRIPT', 'STYLE', 'EMBED',
  'OBJECT', 'SELECT', 'TEXTAREA', 'IFRAME']);

/**
 * Class name of CSS element that highlights matches with yellow.
 * @type {string}
 */
const CSS_CLASS_NAME = 'find_in_page';

/**
 * Class name of CSS element that selects a highlighted match with orange.
 * @type {string}
 */
const CSS_CLASS_NAME_SELECT = 'find_selected';

/**
 * ID of CSS style.
 * @type {string}
 */
const CSS_STYLE_ID = '__gCrWeb.findInPageStyle';

/**
 * Result passed back to app to indicate pumpSearch has reached timeout.
 * @type {number}
 */
const TIMEOUT = -1;

/**
 * Regex to escape regex special characters in a string.
 * @type {RegExp}
 */
const REGEX_ESCAPER = /([.?*+^$[\]\\(){}|-])/g;

/**
 * @return {Match} The currently selected Match. Returns null if no
 * currently selected match.
 */
function getCurrentSelectedMatch_() {
   if (selectedMatchIndex_ < 0) {
    return null;
   }
  return __gCrWeb.findInPage.matches[selectedMatchIndex_];
};

/**
 * Creates the regex needed to find the text.
 * @param {string} findText Phrase to look for.
 * @return {RegExp} regex needed to find the text.
 */
function getRegex_(findText) {
  let regexString = '(' + escapeRegex_(findText) + ')';
  return new RegExp(regexString, 'ig');
};

/**
 * A timer that checks timeout for long tasks.
 */
class Timer {
  /**
   * @param {Number} timeoutMs Timeout in milliseconds.
   */
  constructor(timeoutMs) {
    this.beginTime = Date.now();
    this.timeoutMs = timeoutMs;
  }

  /**
   * @return {Boolean} Whether this timer has been reached.
   */
  overtime() {
    return Date.now() - this.beginTime > this.timeoutMs;
  }
}

 /**
  * Looks for a phrase in the DOM.
  * @param {string} string Phrase to look for like "ben franklin".
  * @param {number} timeout Maximum time to run.
  * @return {number} that represents the total matches found.
  */
__gCrWeb.findInPage.findString = function(string, timeout) {
  // Enable findInPage module if hasn't been done yet.
  if (!__gCrWeb.findInPage.hasInitialized) {
    enable_();
    __gCrWeb.findInPage.hasInitialized = true;
  }

  if (!searchStateIsClean_) {
    // Clean up a previous run.
    cleanUp_();
  }
  if (!string) {
    // No searching for emptyness.
    return 0;
  }

  // Holds what nodes we have not processed yet.
  __gCrWeb.findInPage.stack = [document.body];

  // Number of visible matches found.
  visibleMatchCount_ = 0;

  // Index tracking variables so search can be broken up into multiple calls.
  visibleMatchesCountIndexIterator_ = 0;

  __gCrWeb.findInPage.regex = getRegex_(string);

  searchInProgress_ = true;

  return __gCrWeb.findInPage.pumpSearch(timeout);
};

/**
 * Do following steps:
 *   1. Do a DFS in the page, concatenate all TEXT Nodes' content into
 *      |allText_|, and create |sections_| to record which part of |allText_|
 *      belongs to which Node;
 *   2. Do regex match in |allText_| to find all matches, create |replacements_|
 *      for highlighting all results and |matches_| for
 *      highlighting selected result;
 *   3. Execute |replacements_| to highlight all results;
 *   4. Check the visibility of each Match;
 *
 * If |timeout| has been reached, the function will return TIMEOUT, and the
 * caller need to call this function again to continue searching. This prevents
 * the Js thread from blocking the WebView's UI.
 *
 * @param {number} timeout Only run find in page until timeout.
 * @return {number} that represents the total matches found.
 */
__gCrWeb.findInPage.pumpSearch = function(timeout) {
  // TODO(crbug.com/895531): It would be better if this DCHECKed.
  if (searchInProgress_ == false) {
    return 0;
  }

  searchStateIsClean_ = false;

  let timer = new Timer(timeout);

  // Go through every node in DFS fashion.
  while (__gCrWeb.findInPage.stack.length) {
    let node = __gCrWeb.findInPage.stack.pop();
    let children = node.childNodes;
    if (children && children.length) {
      // add all (reasonable) children
      for (let i = children.length - 1; i >= 0; --i) {
        let child = children[i];
        if ((child.nodeType == 1 || child.nodeType == 3) &&
            !IGNORE_NODE_NAMES.has(child.nodeName)) {
          __gCrWeb.findInPage.stack.push(children[i]);
        }
      }
    }

    // Build up |allText_| and |sections_|.
    if (node.nodeType == 3 && node.parentNode) {
      sections_.push(new Section(allText_.length, allText_.length +
          node.textContent.length, node));
      allText_ += node.textContent.toLowerCase();
    }

    if (timer.overtime()) {
      return TIMEOUT;
    }
  }

  // Do regex match in |allText_|, create |matches| and |replacements|. The
  // regex is set on __gCrWeb, so its state is kept between continuous calls on
  // pumpSearch.
  let regex = __gCrWeb.findInPage.regex;
  if (regex) {
    for (let res; res = regex.exec(allText_);) {
      // The range of current Match in |allText_| is [begin, end).
      let begin = res.index;
      let end = begin + res[0].length;
      __gCrWeb.findInPage.matches.push(new Match());

      // Find the Section where current Match starts.
      let oldSectionIndex = sectionsIndex_;
      let newSectionIndex = findFirstSectionEndsAfter_(begin);
      // If current Match starts at a new Section, process current Section and
      // move to the new Section.
      if (newSectionIndex > oldSectionIndex) {
        processPartialMatchesInCurrentSection();
        sectionsIndex_ = newSectionIndex;
      }

      // Create all PartialMatches of current Match.
      while (true) {
        let section = sections_[sectionsIndex_];
        partialMatches_.push(new PartialMatch(matchId_, Math.max(
            section.begin, begin), Math.min(section.end, end)));
        // If current Match.end exceeds current Section.end, process current
        // Section and move to next Section.
        if (section.end < end) {
          processPartialMatchesInCurrentSection();
          ++sectionsIndex_;
        } else {
          // Current Match ends in current Section.
          break;
        }
      }
      ++matchId_;

      if (timer.overtime()) {
        return TIMEOUT;
      }
    }
    // Process remaining PartialMatches.
    processPartialMatchesInCurrentSection();
    __gCrWeb.findInPage.regex = undefined;
  }

  // Execute replacements to highlight search results.
  for (let i = replacementsIndex_; i < replacements_.length; ++i) {
    if (timer.overtime()) {
      replacementsIndex_ = i;
      return TIMEOUT;
    }
    replacements_[i].doSwap();
  }

  let visibleMatchCount = countVisibleMatches_(timer);

  searchInProgress_ = false;

  return visibleMatchCount;
};

/**
 * Counts the total number of visible matches.
 * @param {Timer} used to pause the counting if overall search
 * has taken too long.
 * @return {Number} of visible matches.
 */
function countVisibleMatches_(timer) {
  let max = __gCrWeb.findInPage.matches.length;
  let maxVisible = MAX_VISIBLE_ELEMENTS;
  var currentlyVisibleMatchCount = 0;
  for (let index = visibleMatchesCountIndexIterator_; index < max; index++) {
    let match = __gCrWeb.findInPage.matches[index];
    if (timer && timer.overtime()) {
      visibleMatchesCountIndexIterator_ = index;
      return TIMEOUT;
    }

    // Stop after |maxVisible| elements.
    if (currentlyVisibleMatchCount > maxVisible) {
      continue;
    }

    if (match.visible()) {
      currentlyVisibleMatchCount++;
    }
  }
  visibleMatchCount_ = currentlyVisibleMatchCount;
  visibleMatchesCountIndexIterator_ = 0;
  return currentlyVisibleMatchCount;
};

/**
 * Removes highlights of previous search and reset all global vars.
 * @return {undefined}
 */
function cleanUp_() {
  for (let i = 0; i < replacements_.length; ++i) {
    replacements_[i].undoSwap();
  }

  allText_ = '';
  sections_ = [];
  sectionsIndex_ = 0;

  __gCrWeb.findInPage.matches = [];
  selectedMatchIndex_ = -1;
  selectedVisibleMatchIndex_ = -1;
  matchId_ = 0;
  partialMatches_ = [];

  replacements_ = [];
  replacementsIndex_ = 0;

  searchStateIsClean_ = true;
};

/**
 * Selects the |index|-th visible matchand scrolls to that match. The total
 * visible matches count is also recalculated.
 * If there is no longer an |index|-th visible match, then the last visible
 * match will be selected if |index| is less than the currently selected
 * match or the first visible match will be selected if |index| is greater.
 * If there are currently no visible matches, sets
 * |selectedVisibleMatchIndex_| to -1.
 * No-op if invalid |index| is passed.
 * @param {Number} index of visible match to highlight.
 * @return {Dictionary} of currently visible matches and currently selected
 * match index.
 */
__gCrWeb.findInPage.selectAndScrollToVisibleMatch = function(index) {
  if (index >= visibleMatchCount_ || index < 0) {
    // Do nothing if invalid index is passed or if there are no matches.
    return {matches: visibleMatchCount_, index: selectedMatchIndex_};
  }

  // Remove previous highlight.
  let match = getCurrentSelectedMatch_();
  if (match) {
    match.removeSelectHighlight();
  }

  let previouslySelectedMatchIndex = selectedMatchIndex_;

  // Recalculate total visible matches in case it has changed.
  let visibleMatchCount = countVisibleMatches_(null);

  if (visibleMatchCount == 0) {
    selectedMatchIndex_ = -1;
    selectedVisibleMatchIndex_ = -1;
    return {matches: visibleMatchCount, index: -1};
  }

  if (index >= visibleMatchCount) {
    // There are no longer that many visible matches.
    // Select the last match if moving to previous match.
    // Select the first currently visible match if moving to next match.
    index = index > selectedVisibleMatchIndex_ ? 0 : visibleMatchCount-1;
  }

  let total_match_index = 0;
  var visible_match_count = index;
  // Select the |index|-th visible match.
  while (total_match_index < __gCrWeb.findInPage.matches.length) {
    if (__gCrWeb.findInPage.matches[total_match_index].visible()) {
      visible_match_count--;
      if (visible_match_count < 0) {
        break;
      }
    }
    total_match_index++;
  }

  selectedMatchIndex_ = total_match_index;
  selectedVisibleMatchIndex_ = index;

  match = getCurrentSelectedMatch_();
  match.addSelectHighlight();
  scrollToCurrentlySelectedMatch_();

  // Get string consisting of the text contents of the match nodes and the
  // nodes before and after them, if applicable.
  // This will be read out as an accessibility notification for the match.
  // The siblings's textContent are added into the node array, because the
  // nextSibling and previousSibling properties to the match nodes sometimes
  // are text nodes, not HTML nodes. This results in '[object Text]' string
  // being added to the array instead of the object.
  let nodes = match.nodes.slice();
  if (match.nodes[0].previousSibling) {
    nodes.unshift([match.nodes[0].previousSibling.textContent]);
  }
  if (match.nodes[match.nodes.length-1].nextSibling) {
    nodes.push([match.nodes[match.nodes.length-1].nextSibling.textContent]);
  }
  let contextString = nodes.map(function(node) {
    if (node.textContent) {
      return node.textContent;
    } else {
      return node;
    }
  }).join("");

  return {
    matches: visibleMatchCount,
    index: index,
    contextString: contextString
  };
};

/**
 * Scrolls to the position of the currently selected match.
 */
function scrollToCurrentlySelectedMatch_() {
  let match = getCurrentSelectedMatch_();
  if (!match) {
    return;
  }

  match.nodes[0].scrollIntoView({block: "center", inline: "center"});
};

/**
 * Enable the __gCrWeb.findInPage module.
 * Mainly just adds the style for the classes.
 */
function enable_() {
  if (styleElement_) {
    // Already enabled.
    return;
  }
  addDocumentStyle_(document);
};

/**
 * Gets the scale ratio between the application window and the web document.
 * @return {number} Scale.
 */
function getPageScale_() {
  return (pageWidth_ / getBodyWidth_());
};

/**
 * Adds the appropriate style element to the page.
 */
function addDocumentStyle_(thisDocument) {
  let styleContent = [];
  function addCSSRule(name, style) {
    styleContent.push(name, '{', style, '}');
  };
  let scale = getPageScale_();
  let zoom = (1.0 / scale);
  let left = ((1 - scale) / 2 * 100);
  addCSSRule(
      '.' + CSS_CLASS_NAME,
      'background-color:#ffff00 !important;' +
          'padding:0px;margin:0px;' +
          'overflow:visible !important;');
  addCSSRule(
      '.' + CSS_CLASS_NAME_SELECT,
      'background-color:#ff9632 !important;' +
          'padding:0px;margin:0px;' +
          'overflow:visible !important;');
  styleElement_ = thisDocument.createElement('style');
  styleElement_.id = CSS_STYLE_ID;
  styleElement_.setAttribute('type', 'text/css');
  styleElement_.appendChild(thisDocument.createTextNode(styleContent.join('')));
  thisDocument.body.appendChild(styleElement_);
};

/**
 * Removes the style element from the page.
 */
function removeStyle_() {
  if (styleElement_) {
    let style = document.getElementById(CSS_STYLE_ID);
    document.body.removeChild(style);
    styleElement_ = null;
  }
};

/**
 * Disables the __gCrWeb.findInPage module.
 * Removes any matches and the style and class names.
 */
__gCrWeb.findInPage.stop = function() {
  if (styleElement_) {
    removeStyle_();
    cleanUp_();
  }
  __gCrWeb.findInPage.hasInitialized = false;
};

/**
 * Returns the width of the document.body.  Sometimes though the body lies to
 * try to make the page not break rails, so attempt to find those as well.
 * An example: wikipedia pages for the ipad.
 * @return {number} Width of the document body.
 */
function getBodyWidth_() {
  let body = document.body;
  let documentElement = document.documentElement;
  return Math.max(
      body.scrollWidth, documentElement.scrollWidth, body.offsetWidth,
      documentElement.offsetWidth, body.clientWidth,
      documentElement.clientWidth);
};

/**
 * Returns the height of the document.body.  Sometimes though the body lies to
 * try to make the page not break rails, so attempt to find those as well.
 * An example: wikipedia pages for the ipad.
 * @return {number} Height of the document body.
 */
function getBodyHeight_() {
  let body = document.body;
  let documentElement = document.documentElement;
  return Math.max(
      body.scrollHeight, documentElement.scrollHeight, body.offsetHeight,
      documentElement.offsetHeight, body.clientHeight,
      documentElement.clientHeight);
};

/**
 * Helper function that determines if an element is visible.
 * @param {Element} elem Element to check.
 * @return {boolean} Whether elem is visible or not.
 */
function isElementVisible_(elem) {
  if (!elem) {
    return false;
  }
  let top = 0;
  let left = 0;
  let bottom = Infinity;
  let right = Infinity;

  let originalElement = elem;
  let nextOffsetParent = originalElement.offsetParent;

  // We are currently handling all scrolling through the app, which means we can
  // only scroll the window, not any scrollable containers in the DOM itself. So
  // for now this function returns false if the element is scrolled outside the
  // viewable area of its ancestors.
  // TODO(crbug.com/915357): handle scrolling within the DOM.
  let bodyHeight = getBodyHeight_();
  let bodyWidth = getBodyWidth_();

  while (elem && elem.nodeName.toUpperCase() != 'BODY') {
    let computedStyle =
        elem.ownerDocument.defaultView.getComputedStyle(elem, null);

    if (elem.style.display === 'none' || elem.style.visibility === 'hidden' ||
        elem.style.opacity === 0 || computedStyle.display === 'none' ||
        computedStyle.visibility === 'hidden' || computedStyle.opacity === 0) {
      return false;
    }

    // For the original element and all ancestor offsetParents, trim down the
    // visible area of the original element.
    if (elem.isSameNode(originalElement) || elem.isSameNode(nextOffsetParent)) {
      let visible = elem.getBoundingClientRect();
      if (elem.style.overflow === 'hidden' &&
          (visible.width === 0 || visible.height === 0))
        return false;

      top = Math.max(top, visible.top + window.pageYOffset);
      bottom = Math.min(bottom, visible.bottom + window.pageYOffset);
      left = Math.max(left, visible.left + window.pageXOffset);
      right = Math.min(right, visible.right + window.pageXOffset);

      // The element is not within the original viewport.
      let notWithinViewport = top < 0 || left < 0;

      // The element is flowing off the boundary of the page. Note this is
      // not comparing to the size of the window, but the calculated offset
      // size of the document body. This can happen if the element is within
      // a scrollable container in the page.
      let offPage = right > bodyWidth || bottom > bodyHeight;
      if (notWithinViewport || offPage) {
        return false;
      }
      nextOffsetParent = elem.offsetParent;
    }

    elem = elem.parentNode;
  }
  return true;
};

/**
 * Helper function to find the absolute position of an element on the page.
 * @param {Element} elem Element to check.
 * @return {Array<number>} [x, y] positions.
 */
function findAbsolutePosition_(elem) {
  let boundingRect = elem.getBoundingClientRect();
  return [
    boundingRect.left + window.pageXOffset,
    boundingRect.top + window.pageYOffset
  ];
};

/**
 * @param {string} text Text to escape.
 * @return {string} escaped text.
 */
function escapeHTML_(text) {
  let unusedDiv = document.createElement('div');
  unusedDiv.innerText = text;
  return unusedDiv.innerHTML;
};

/**
 * Escapes regexp special characters.
 * @param {string} text Text to escape.
 * @return {string} escaped text.
 */
function escapeRegex_(text) {
  return text.replace(REGEX_ESCAPER, '\\$1');
};

})();

redpajama_set_name: RedPajamaGithub


text:
Mourinho confirms Son to return from injury, avoids Kane speculation
Tottenham Hotspur coach Jose Mourinho announced on Friday that forward Son Heung-min has recovered from his injury ahead of the club's Premier League match against Newcastle United on Sunday, but he remained tight-lipped about Harry Kane's future at the club.
Son, who has 13 goals and nine assists in the Premier League this season, was forced to leave last month's derby defeat at Arsenal due to a thigh injury that stopped him from going on international duty.
"He was injured, trained with the team fully this morning," Mourinho told reporters.
"He did partial exercises with the team yesterday and last week didn't train at all. This time we have (Matt) Doherty and Ben Davies out. Sergio Reguilon is ready."
Kane has been linked with a number of clubs despite having a deal with Spurs until 2024.
Mourinho, on the other hand, declined to be drawn into a debate about England striker Harry Kane's latest remarks on international duty, in which he said leaving Spurs to win titles was a "tough question to address."
"I cannot play that game. I have to focus on what he is for us," Mourinho said.
"I can only focus on what he does for us and the effort he put in for us at (Aston) Villa, the effort he put in for England, and the match at Newcastle and whether playing well or not, he will be there for the team.
"I want Harry to be with us what he has been… the same commitment, desire and leadership."
Spurs are currently in sixth position in the Premier League, three points behind the top four and Champions League qualification.
Tottenham identify two potential Jose Mourinho replacements
Mourinho, on the other hand, dodged a query about whether Spurs would be considered a failure this season if they do not qualify for Europe.
"I don't want to speak about that possibility because I don't want to be pessimistic and try to anticipate scenarios and evaluate the season before it's finished," he said.
Related Topics:avoids kane speculationmourinho confirms son return from injury
Leicester City vs Manchester City match preview
Thomas Tuchel named as Premier League 'Manager of the Month'

redpajama_set_name: RedPajamaCommonCrawl


Roll tin lead solder wire.
Good solderability, insulation resistance, spatter and non-corrosive.
Widely used in the electrical and electronics welding parts such as circuit board, electronic devices and others.


"Town meeting. The people instituting the means of self-government for the protection of their natural rights" bronze relief by J.C. Markham in Saratoga Monument. Schuylerville, NY.
"Town meeting. The people instituting the means of self-government for the protection of their natural rights" bronze relief (1885) by J.C. Markham in Saratoga Monument. Schuylerville, NY.


But he like for coming back he's not coming back miles you read the note and even if he did we're not gonna be here where are we going as far as Jack will take us why do you call the car jack cuz it rhymes with Cadillac come on get in the car put on your seatbelts you're ready to.
Go on a trip really which way are we going north how far.
North the North Pole no not that far north.
Looks like no drop here either and then santa came and the family had the best Christmas ever talent for another 100.
Morrow honey I don't want to use them all today I miss her well we'll find.
A better one we never should have left no we shouldn't have stayed as long as you did mama I gotta go it'll be okay mama how do you know I said it.
Prayer a lot of good that'll do hey miles.
It couldn't hurt mommy you're strong thank you sweetheart remember.
What pastor Walter used to say what women are like tea bags you never know how strong they're until you put them in hot water no pets neither I can give you.
A better rate if you stay the whole week Oh what Christmas at all we don't get much traffic do.
You need any help around here yeah wife doesn't mama I gotta go I'm coming Trudy may be looking for a waitress to handle.
The graveyard that's what I hear hey Trudy Willis say she she owns the model a.
Cafe south into town okay thank you I can't afford to hire anyone right now please.
I've tried every town between here in the state line I've got to find something I'll work for half the wages you don't understand.
I can't afford to hire anyone do you have a restaurant she can use the shirts come here how about I work for whatever you can afford an tips how about that I can only afford minimum wage and we'll see how it goes till Christmas thank you thank you all this probably won't last long anyway what's that oh I said I I.
Can't wait that long I need you to start tonight tonight tonight Oh all right let me get the kids squared away then mac and cheese left over for lunch for the.
Children really thank you they'll need to wear this it's not chic but it's clean great.
Thank you you're a good person mrs. Willis well don't let that get around okay I'll see you soon thought you weren't hiring not well I think my is responsible enough for that now do I get paid to oh one thing at a time and miles I'm really counting on you you.
Are in the fifth grade and you're old enough should be in six we've been through all that I held you back so you could take better care of yourself and not get beat up by bullies smell less talk more eat.
Please okay I'm gonna give you the number of the cafe if you need me you go to the office and use the payphone okay you go mmm-hmm.
I love you you got changed yeah no story tonight I'll tell you two tomorrow come here sweetie she.
Might need mama trust you she's not my mom she is now no she just married my dad.
That's all Martha right yeah Lola hi welcome thank you oh and don't mind them the only thing they like looking at better than a new woman in town is a new tractor Oh Trudy likes all of us to wear those oh yeah all of us.
Yeah you me and me and you Yeah right you catch on quick that's a first around here an actual IQ thank you uh where can I put my stuff no just in back all right thank you you know what we need No and I don't want to.
A tree it's almost Christmas why won't be any good Christmas for us yes there we'll have it by the door how would we open it oh yeah.
By the bed forget the stupid tree and go to sleep it's not stupid and you go to sleep you're not the boss of me I am tonight then you have to tell a story I don't know.
Any Hugh must know one we finally broke down a.
Hide a regular how gene you don't talk like that nothing by.
It well that's me just broken down regular one listen.
To him he's local yeah I never seen anybody order enchiladas smothered and gravy you ain't live darling I don't know any stories Mel go to sleep not even a.
Christmas story no all right then I'll tell you it it was Christmas Eve a really long time ago so long ago and it wasn't even called Christmas it's always been called Christmas.
It's not the first one his name was Joe that's what people called him it short for Joseph oh and she was Mary and she was going to have a baby and all the animals they passed knew who she was and when Mary and Joe passed.
By them the sheep would go that and the docq and he huh and the dog woof no animal sound that was because the animals knew her baby was gonna be very special.
He was gonna be the most special baby ever born he was going to be a king.
But nobody knew it yet and he was going to save people good people bad people kids grown-ups everybody I thought my marriage was made in heaven well marriages are made.
In heaven but so is thunder and lightning Martha I haven't heard an old-fashioned name like that in a while it was my grandmother's name hmm it's a.
Derivation of Mary you know hmm mother Mary at Christmastime maybe the mother part so is Trudy having.
A hard time keeping this place open well when the economy tanks people don't eat out as much yeah it's a small town huh phone book has one page what about the regulars they keep the place going I meant the Karns I don't seem like really nice people Oh all our regulars are if you don't count less less mmm McCallum local cattlemen cranky babies are cranky les is miserable like.
An old hamburger patty fizzing and sputtering in his own.
Else should I look out for Joe Hawkins oh yeah he's miserable too no just the opposite ah you probably want coffee hot chocolate actually Oh.
Can I get you anything else he's a lemon meringue pie add a piece of Blenheim ring back coming right up how is it I have no idea can't get a fork oh Clark mrs. Evans Carol Ann Bullington from over at the motel Owens wife yeah what can I do for you there's been a little problem kind of an accident in your room I think it's okay kids are fine I best you come see for yourself um no I.
Gotta go something's come up who's gonna pay for this what is it what happened what happened I'll tell you what happened the toilet overflowed and you ruined my carpet oh it's worth probably yeah a hundred no it ain't you told me you was gonna rip it out next week not now Carol Ann are you trying to take advantage of this nice.


text:
Q: OpenGL ES2.0 glTexImage2D() returns GL_INVALID_VALUE I have a problem trying to generate a texture (for a font atlas) on one of my Android devices (Samsung N5100 tablet). The below code works fine on iOS and on my Samsung S4.
glTextImage2D() keeps returning GL_INVALID_VALUE.
At first I thought it was a power of 2 issue but I've tried hardcoding various power of 2 values and it continues to fail. GL_MAX_TEXTURE_SIZE returns a value of 4096 but I can't even get 16x16 to work.
  glActiveTexture( GL_TEXTURE0 );
  glGenTextures( 1, &m_TextureAtlasStrip );
  glBindTexture( GL_TEXTURE_2D, m_TextureAtlasStrip );
  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
  glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
  glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );

  if( CheckGLError() )
    LogDebugf( "FAIL(9)" );

  GLint f = 0;
  glGetIntegerv( GL_MAX_TEXTURE_SIZE, &f );
  LogDebugf( "GL_MAX_TEXTURE_SIZE: %d", f );

  if( CheckGLError() )
    LogDebugf( "FAIL(9F)" );

//nPow2RoundWidth = 2048;
//nPow2RoundWidth  = 1024;
//nPow2RoundWidth  = 512;
nPow2RoundWidth  = 16;
nPow2RoundHeight = 16;
LogDebugf( "nPow2RoundWidth: %d  nPow2RoundHeight: %d", nPow2RoundWidth, nPow2RoundHeight );

  glTexImage2D( GL_TEXTURE_2D, 0, GL_RED, nPow2RoundWidth, nPow2RoundHeight, 0, GL_RED, GL_UNSIGNED_BYTE, 0 );

  if( CheckGLError() )
  {
    LogDebugf( "AT FAIL(10)" );
    exit( 1 );
  }

  LogDebugf( "WORKED AT (10)" );
  exit( 1 );

What would cause this?
UPDATE:
If I change GL_RED to GL_RGB it works..
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, nPow2RoundWidth, nPow2RoundHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, 0 );

A: Table 3.8 of the spec defines the valid values for internalformat and format of glTexImage2D
They are, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB and GL_RGBA.
Depending on exactly what you're trying to achieve, you will probably find GL_LUMINANCE or GL_ALPHA can be suitable substitutes.
Alternatively, this extension does support a red (and a red-green) texture, I think it's quite common, but isn't everywhere.

redpajama_set_name: RedPajamaStackExchange


Thiruvananthapuram: The country's first liquefied natural gas (LNG)-fuelled bus was launched here on Tuesday by Minister of Petroleum & Natural Gas Dharmendra Pradhan.
In presence of Kerala Chief Minister Pinarayi Vijayan and top officials of oil and gas industry officials, the launch took place on the sidelines of the "Fourth Conference of State Transport Minister".
The project is a joint effort of Petronet LNG Limited (PLL), Indian Oil Corporation Ltd and Tata Motors Ltd.
While the gas was filled at PLL Kochi LNG Terminal, the LNG fuel tank was provided by Chart Industries, USA.
Pradhan said it is a pilot project and the LNG-driven bus will run on trial-basis before being certified for commercial operation.
The LNG-fuelled bus is being launched as part of a plan of the Ministry of Petroleum and Natural Gas to use LNG directly for mass transportation to reduce carbon emissions in the country and, at the same time, generating savings.
Kerala State Transport Minister A.K. Saseendran told reporters later that studies have shown that as compared to diesel, there will be a saving of 40 per cent in fuel costs if buses run on LNG.
"We are certainly going to take this forward. But, for this to become a reality, we should have LNG filling stations, and we will play our part to use this fuel in our state-owned transport corporation vehicles," said Saseendran.
A Kerala Motor Vehicles Department official said now that this has been launched, it is a formality to clear LNG as a fuel, and it would be done here at the earliest.
The Government of India has already announced that it is planning to use LNG, which is cheaper than diesel, as a fuel for the railways and long-haul transportation.
Himachal Pradesh Transport Minister G.S. Bali informed on the occasion that they have decided to look into all alternate forms of fuel as they are very particular about environment protection.
LNG is greener and an environmentally-friendly fuel with less number of NOx, SOx and particulate matters as compared to any other automotive fuel.
In LNG, CO2 emission is also lesser than diesel. Introduction of LNG in transport segment will also help India meet its COP21 commitment.
The Union Ministry of Road Transport & Highways (MORTH) has already released draft notifcation for use of LNG as an automotive fuel.
The Petroleum and Explosives Safety Organisation (PESO) has formed an expert committee to form regulations for installation of LNG Fuel tank and dispensing stations, which is expected to be released soon.
Petronet LNG Limited, one of the fastest growing world-class companies in the Indian energy sector, has set up the country's first LNG receiving and regasification terminal at Dahej, Gujarat, and another terminal at Kochi.
Formed as a joint venture by the Government of India to import LNG and set up its terminals in the country, it involves India's leading oil and natural gas industry players.
The promoters are Bharat Petroleum Corporation Ltd (BPCL), GAIL (India) Ltd (GAIL), Indian Oil Corporation Ltd (IOCL) and Oil & Natural Gas Corporation Limited (ONGC). The authorised capital is Rs 1,200 crore.


"Whole" is the latest buzzword in diet and nutrition. Wholegrain, wholemeal, wholewheat, wholefoods. But what does it all mean?
Well, I guess the easiest way to describe it is going back to basics. You won't find any fancy packaging or difficult to pronounce additives. Just basic ingredients, brimming with goodness. The type of foods that would have nourished our ancestors, long before sliced bread, boil-in-the-bag or microwave cookery. Think grains, nuts, seeds, fruits, honey. Unlike our ancestors, we don't have to go foraging in the wilderness to find wholefoods - they are all readily available in supermarkets everywhere!
Figs – can be bought either fresh or dried and are packed with fibre. Naturally sweet, they can be used in baking to reduce amounts of added sugar. Fresh and dry figs are high in pectin, a soluble fibre that may help to reduce blood cholesterol. The fruit is also believed to have a laxative effect and can aid those who suffer from chronic constipation.
Pomegranates - bursting with vitamins A, C, E and folic acid, pomegranates have three times more antioxidant power than green tea or red wine. A single pomegranate alone contains 40% of an adult's recommended daily allowance of vitamin C. Recent studies have boosted sales of pomegranate juice, showing that it may help reduce bad cholesterol levels and the risk of developing heart disease, osteoarthritis and some cancers.
Beans – not just baked beans, but kidney beans, aduki beans, butter beans, chickpeas to name but a few, all fall into this category. Like pulses, beans are low Gi, low in fat, rich in soluble fibre and good sources of B vitamins, iron, calcium, zinc and potassium. Beans can make a very healthy addition to any diet, especially for vegetarians. Click here to read more about their benefits.
Brown Rice – unlike white rice, brown rice is not processed therefore it retains its abundance of B vitamins and fibre. Brown rice is also low in fat making it an ideal complex carbohydrate, especially for anyone with a gluten or wheat intolerance, or anyone following a low Gi diet.
Manuka Honey – the healing properties of honey have long been recognised. Recently a scientist in New Zealand has shown that honey made from the flowers of the manuka bush, a native of New Zealand, has antibacterial properties over and above those of other honeys. It can even be incorporated into wound dressings, so great is its anti-bacterial and anti-fungal powers! Eating honey can also help build up resistance to pollen and beat hay fever. Use to sweeten smoothies and porridge, or have a small amount on wholegrain toast.
Quinoa - an ancient crop which fed the Central American Aztec Indians for thousands of years, quinoa (prounounced 'keen-wa') has recently been cultivated in Britain and is gaining popularity as a staple food. It has a high protein content, containing between 13-14% protein with a good amino acid composition therefore it is excellent for vegetarians. Quinoa is also gluten-free so suitable for Coeliacs. It has a mild taste, and firm but slightly chewy texture. It absorbs twice its volume in liquid when cooked, and the grains sweeten and become translucent. Use it in place of rice or pasta in cooked dishes, serve it as an accompaniment, in salads or as a stuffing.
Bulgar Wheat – a cracked wheat, bulgar can be bought in an easy-to-use form where you just add water, similar to couscous. It is an excellent source of complex carbs and also a useful source of B vitamins and small amounts of iron and copper. Bulgar wheat can be eaten hot as an alternative to rice or pasta, or cold in salads such as tabbouleh.
Nuts – despite bad press in the past due to their high fat and calorie content, nuts are actually low in saturated fat and most nuts, especially hazelnuts and macadamias, have a high monounsaturated fat content. All nuts are low Gi and contain significant amounts of iron, zinc and magnesium, with Brazil nuts being particularly rich in selenium, an antioxidant which is thought to help protect against heart disease, ageing and cancer. Anyone with a peanut allergy should avoid all nuts and nut-containing foods. Click here for some more nutty facts.
Seeds – with the recent popularity of the Gi diet, sales of seeds such as pumpkin, sunflower and sesame seeds have soared. A handy snack, seeds are rich in polyunsaturated fats, protein and minerals such as potassium, copper, zinc and magnesium. Seeds can also be added to soups, salads, cereal and yoghurt for extra crunch. Limit intake to 1 tablespoon per day if you are following a weight loss plan, due to their high calorie and fat content.
Wild Rice – not actually a rice at all, but an American grass used as an important food by the Indians and early settlers. It is cooked and served the same way as other rice but takes about 50 minutes to cook. It has a subtle nutty flavour making it a good base for a special dish and it can be economically mixed with other rice. Wild rice will nutritionally enhance any dish, providing protein, B vitamins, calcium and lots of fibre.


Business Card on Jeans Mockup Free Download for a graphic designer that need to introduce their work professionally. This free psd business card mockup was found from the astounding maker called Freedesignresources. This is empty mockup so you can without much of a stretch add your own design art to it.


text:
Q: Extra blank pages inserted when using \cleardoublepage and \newgeometry Using a report class with the twoside and openright options, I've defined a function, \mycentered[1], to display a vertically and horizontally aligned (at the center of the page) quote before the table of contents.
The text gets correctly displayed, and when \cleardoublepage is used before \tableofcontents just a blank page is inserted. But, if I use \newgometry (provided by the geometry package) between the page clearing and the table of contents, three blank pages are inserted. However, if I replace \mycentered with some text, those pages are not inserted. How can avoid those two extra pages being added?
In the following MWE the pagestyle is also changed just to show that the aditional blank pages are introduced after the explicit \cleardoublepage.
\documentclass[a4paper,twoside,openright]{report}
\usepackage[top=2cm,bottom=2cm]{geometry}
\newcommand\mycentered[1]{\topskip0pt\vspace*{\fill}{\centering#1\par}\vspace*{\fill}}

\def\mytextblock{
This is some text

with several paragraphs
}

\begin{document}
\pagestyle{empty}
\mycentered{\mytextblock}
\cleardoublepage
\pagestyle{plain}
\newgeometry{top=3cm,bottom=3cm}
\tableofcontents
\chapter{First}

\end{document}

I've tried removing \topskip0pt and the blank pages issue is solved. But the content is not really centered, since some space is put in the top. It is not noticeable with not very long quotes, but the following image shows the difference if used to vertically center bigger blocks. On the left hand side the result with \topskip0pt is shown, and on the right hand side the result without it is overlaid.

A: Explicitly compensating the \topskip, instead of setting it to 0pt, solved the problem and no extra space is put at the top.
\newcommand\th@centered[1]{\hbox{}\vspace*{-\topskip}\vspace*{\fill}{\centering#1\par}\vspace{\fill}}


text:
All healthandbeauty archives from January 15, 2019 - HELLO!
Prince Harry reveals surprising new hobby - and wife Meghan may have influenced it
Prince Harry revealed he has new hobby during a visit to Birkenhead with wife Meghan on Monday. Chatting to a Buddhist monk at an engagement at Number 7 - a Feeding Birkenhead citizen's supermarket and community café - he told him that he now practices meditation every day. According to the Daily Mail, the 69-year-old monk, named Kelsang Sonam, gave Harry a copy of a book entitled '8 Steps to Happiness' after the Prince discussed the holistic practice with him. Harry and wife Meghan in Birkenhead on Monday Of course, the Duchess of Sussex is known to be passionate about yoga
Kim Kardashian confirms fourth baby is on the way – and reveals gender
Kim Kardashian has confirmed she is expecting her fourth child, just weeks after those baby rumours swirled. During an interview with Watch What Happens Live, she told host Andy Cohen that she and husband Kanye West are having a boy via a surrogate. The couple are already the proud parents to daughter North, five, son Saint, three, and one-year-old Chicago. Their daughter Chicago was born via a surrogate in January 2018. Us Weekly was one of the first to report the news earlier this month, claiming that Kim and Kanye have used the same surrogate for their fourth child, who
Robbie Williams takes up art with son Charlie for important reason – see photo
Robbie Williams has taken up drawing since the new year, and over the weekend the dad-of-three took his son Charlie to an art store near their home in LA. The dad and son duo were pictured walking hand-in-hand to the shop in a sweet photo posted on Ayda Field's Instagram account. "Father and son off to the art store," she captioned the image. Not only is art giving Robbie and his son another hobby to bond over, but it is also doing wonders to help Robbie's health too. The Let Me Entertain You hit maker told his fans on
Strictly's Kevin Clifton looks unrecognisable as a goth in never-before-seen photo
Kevin Clifton was one of the many celebrities to take part in the viral ten-year challenge on Tuesday – and he certainly looked very different in his chosen throwback photo! The Strictly Come Dancing pro took to Instagram to share a picture of himself in 2009 aged 26, and revealed that he was a "wannabe rockstar." In the photo, Kevin had long black hair, and was wearing a top hat, a black jumper and silver chains around his neck. The image was placed next to a picture of himself as Stacee Jaxx, the protagonist he will be soon playing
Keto diet: what is it and does it work?
If you've picked up any magazine or scrolled through a health blog lately, you will have probably come across the keto diet and its promise of transforming your body. But, what exactly is it and how does it work? We spoke to Nutritionist Resource member Sonal Shah to find out the facts... What is keto diet? The Keto diet is a weight loss plan that is based on the principle of a high-fat, low-carb eating plan. 75% of your daily calories are made up of fats, 20% are made up of proteins and just five % are made up of carbohydrates. This eating system
5:2 diet: what is it and does it work?
The 5:2 diet has been around for many years but instead of disappearing like many other 'it'-diets which have in the past - it doesn't seem to be going anywhere. We tracked down Nutritionist Resource member Sonal Shah to find out exactly how it works, what you can eat and what the benefits and risks of it are... What is the 5:2 diet? Originally slated as a more modern approach to the Dukan or Atkins diet, the 5:2 diet went viral in 2012 after Michael Mosley's documentary, Eat, Fast And Live Longer, highlighted the potentially huge benefits of it. It works like this:
Victoria Beckham makes new announcement about her latest adventure
Victoria Beckham has shown us all that she is a woman of many talents, and back in November she made the exciting announcement that she was launching her own YouTube channel. And after a busy couple of months, Victoria's focusing on creating her very first video for the new platform. On Tuesday, the former Spice Girl revealed that she had began her first day of filming – and she wasn't doing anything by halves! The fashion designer will even be wearing customised clothes from her Victoria Beckham collection, and shared a short video on Instagram Stories of one of


text:
Huntington Political Cartoons
Huntington Public Library
Stopping the Advance of Colonel Roosevelt - Image Source
Political cartoons have been a staple of American history as long as there's been political dissent -- a very long time. Political cartoonists gained currency during the Civil War, when artist Thomas Nast created some of the most instantly recognizable images in U.S. politics, including Uncle Sam, the Republican elephant and the Democratic donkey. Like most politicians, Teddy Roosevelt drew his fair share of criticism when it came to political cartoons for his glorification of military strength and his patriotic fervor.
Huntington Public Library contains a number of scrapbooks of which this collection contains, "Cartoons of Uncle Sam Scrapbook", donated by: Mrs. Gordon L. Holcomb of Lloyd Harbor, NY. The cartoons heavily feature Theodore Roosevelt.
Theodore Roosevelt, Rough-Riders, Political Cartoon, United States.
Theodore Roosevelt, Rough-Riders, United States, Political Cartoon.
Theodore Roosevelt, Political Cartoon, United States, New York, Oyster Bay.
Charles Nelan
Burt Loescher Collection on Rogers' Rangers in the French and Indian War
Amy Jennings Family Collection
Art Oneida
Rochester Area Historian's Holdings


text:
Q: how to include header and footer files usinig gwt? I'm trying to create a webApplication with gwt and my idea is to make a header and footer files to be included in all pages. I tried to use the UiBinder for this but it dosen't work.
 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui">
    <g:DockLayoutPanel unit="EM">
        <g:north size="5">
            <!-- I want to include my heaader file here -->
        </g:north>
      </g:DockLayoutPanel>
</ui:UiBinder>

Any idea ?

A: You could do something like this:
 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui">
    <g:DockLayoutPanel unit="EM">
        <g:north size="5">
            <!-- I want to include my heaader file here -->
             <g:HTML ui:field="header">
                <OBJECT data="file_to_include.html">
                   Warning: file_to_include.html could not be included.
                 </OBJECT>
             </g:HTML>
        </g:north>
        <g:center>
            <g:DeckLayoutPanel ui:field="containerDiv" height="100%" width="100%" animationDuration="900" />
        </g:center>
      </g:DockLayoutPanel>
</ui:UiBinder>

EDIT: to include a html file you could just include your header.html.
You would instantiate this class once and then change the content of containerDiv. containerDiv can be of whatever type you want, doesnt has to be a DeckLayoutPanel.


The best √ 24+ Nice Bridesmaid Hairstyles For Long Hair: Bridesmaid image you are looking at is likely one of the photographs from the Wedding Hairstyles For Medium Length Hair Updos put up I have revealed on my web site. You need to use my web site as probably the greatest reference sources of haircut, haircut and hair colour on the web. I always try to give the perfect image for my web site visitor, including you. An example image of a coiffure is very important when choosing and making use of a coiffure. The extra hair kinds you see, the more you possibly can choose the most effective that suits you finest.
In the event you love √ 24+ Nice Bridesmaid Hairstyles For Long Hair: Bridesmaid and want to apply it to your hair, make certain it fits you. Hair situation drastically have an effect on the appearance. Subsequently, deal with your hair rigorously. Buy one of the best hair care merchandise to maintain your hair healthy and exquisite. To have the ability to have healthy hair and beautiful, it takes effort and cost.
It can save you √ 24+ Nice Bridesmaid Hairstyles For Long Hair: Bridesmaid images above to your computer, laptop computer, tablet and smartphone. References about coiffure will be discovered on the internet. You can find articles, photos and videos about the perfect coiffure, haircut and hair coloration by way of web. If you are not glad and still wish to see different greatest √ 24+ Nice Bridesmaid Hairstyles For Long Hair: Bridesmaid photographs, please click right here now. There are a lot of categories, publish and pictures about coiffure on my website. Please flick thru my website to find concepts, inspiration and ease in selecting and applying one of the best coiffure that fits you greatest.
You possibly can visit the closest salon in your city for a haircut, hair care and apply a brand new hairstyle that fits you. Hair is like your crown. Therefore, give the most effective to your hair. Don't be afraid to change the looks of your hair. Be your self, an attention-grabbing person, confident and optimistic. Could also be helpful. thanks.


text:
In mathematics, a harmonic divisor number, or Ore number (named after Øystein Ore who defined it in 1948), is a positive integer whose divisors have a harmonic mean that is an integer. The first few harmonic divisor numbers are:

1, 6, 28, 140, 270, 496, 672, 1638, 2970, 6200, 8128, 8190 .

Examples
For example, the harmonic divisor number 6 has the four divisors 1, 2, 3, and 6. Their harmonic mean is an integer:

The number 140 has divisors 1, 2, 4, 5, 7, 10, 14, 20, 28, 35, 70, and 140. Their harmonic mean is:

5 is an integer, making 140 a harmonic divisor number.

Factorization of the harmonic mean
The harmonic mean  of the divisors of any number  can be expressed as the formula

where  is the sum of th powers of the divisors of :  is the number of divisors, and  is the sum of divisors .
All of the terms in this formula are multiplicative, but not completely multiplicative.
Therefore, the harmonic mean  is also multiplicative.
This means that, for any positive integer , the harmonic mean  can be expressed as the product of the harmonic means of the prime powers in the factorization of .

For instance, we have

and

Harmonic divisor numbers and perfect numbers

For any integer M, as Ore observed, the product of the harmonic mean and arithmetic mean of its divisors equals M itself, as can be seen from the definitions. Therefore, M is harmonic, with harmonic mean of divisors k, if and only if the average of its divisors is the product of M with a unit fraction 1/k.

Ore showed that every perfect number is harmonic. To see this, observe that the sum of the divisors of a perfect number M is exactly 2M; therefore, the average of the divisors is M(2/τ(M)), where τ(M) denotes the number of divisors of M. For any M, τ(M) is odd if and only if M is a square number, for otherwise each divisor d of M can be paired with a different divisor M/d. But, no perfect number can be a square: this follows from the known form of even perfect numbers and from the fact that odd perfect numbers (if they exist) must have a factor of the form qα where α ≡ 1 (mod 4). Therefore, for a perfect number M, τ(M) is even and the average of the divisors is the product of M with the unit fraction 2/τ(M); thus, M is a harmonic divisor number.

Ore conjectured that no odd harmonic divisor numbers exist other than 1. If the conjecture is true, this would imply the nonexistence of odd perfect numbers.

Bounds and computer searches

W. H. Mills (unpublished; see Muskat) showed that any odd harmonic divisor number above 1 must have a prime power factor greater than 107, and Cohen showed that any such number must have at least three different prime factors.  showed that there are no odd harmonic divisor numbers smaller than 1024.

Cohen, Goto, and others starting with Ore himself have performed computer searches listing all small harmonic divisor numbers. From these results, lists are known of all harmonic divisor numbers up to 2 × 109, and all harmonic divisor numbers for which the harmonic mean of the divisors is at most 300.

References

Divisor function
Integer sequences
Number theory
Perfect numbers

redpajama_set_name: RedPajamaWikipedia


"Robert (3D) Del Naja AKA, singer with Massive Attack once told me that he went with a 12 year old Tricky to see Bauhaus play in Bristol in the the early 80's and that was the start of Massive Attack."
Кто из них заболел то хоть?
Эээээ, может тупо засцали везти ето шоу в асашаи?
п.с. у меня ещё мысль возникла по поводу суицида кита.


text:
Q: Loginview Before TabBarController Instantly present the LoginViewController in my appdelegate before my tabbarcontroller

i tried with this code block and also name the navagation controller Identity to "log"

 UIStoryboard *storyboard=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UINavigationController *logincontroller=[storyboard instantiateViewControllerWithIdentifier:@"log"];
[tabBarController presentViewController:logincontroller animated:YES completion:NULL];

Warning: Attempt to present  on  whose view is not in the window hierarchy!

Please any ideas.

A: You have to use self.window.rootViewController when you are in appDelegate:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
LoginViewController *logincontroller= [storyboard instantiateViewControllerWithIdentifier:@"log"];
[self.window.rootViewController presentViewController:logincontroller animated:NO completion:nil];

I dont think you see what I am trying to point out, You are using UINavigationController, but the UINavigationController class implements a specialized view controller that manages the navigation of hierarchical content. You are trying to present the login view modally so it is not part of the navigation stack.
You should be looking for LoginViewController and create a new instance of it using its storyboard Id.

A: Are you trying to present the LoginViewcontroller in applicationDidFinishLaunching:? At that point, the root view controller has not appeared yet, so it is not yet in the window hierarchy. There are three things you can do. One, make it appear in the applicationDidBecomeActive:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

    UIStoryboard *storyboard=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
    UINavigationController *controller = [storyboard instantiateViewControllerWithIdentifier:@"navigationForLog"];
    [self.window.rootViewController presentViewController:controller animated:YES completion:nil];
}

Or, you can make it appear from the tabbar controller's viewDidAppear. This assumes you have a custom tab bar controller.
In MyCustomTabBarController.m:
-(void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    UIStoryboard *storyboard=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
   UINavigationController *controller = [storyboard instantiateViewControllerWithIdentifier:@"navigationForLog"];
    [self presentViewController:controller animated:YES completion:nil];
}

Both of these solutions will display the root view controller first, then modally push the log viewcontroller. If you want it to appear immediately, change the animated:YES to animated:NO.
Another way you can do it is to have your login be a root view controller. You shouldn't have a tabbar controller if your user hasn't logged in yet, because then it may try to load content that isn't available. If that's the case, you should start with a single login controller in your storyboard. If login succeeds, you can either put the tabbar on top of the login (instead of the login on top of the tabbar) or you can replace the rootviewcontroller with the login controller.
Edit 1:
When you present a modal view controller on top of another one, in order for the new controller to have a navigation controller, you have to present a navigation controller along with it. This is the storyboard you should have. The first view is your tab controller. When you determine that the user needs to login, preset the UINavigationController whose rootViewController is your loginController.

Edit 2:
I adjusted my storyboard so the login controller doesn't get covered by the navigation bar. You have to unset Extended Edges: Under Top Bars in the right pane. Also, you can add a back/close button directly onto the navigation bar in storyboard.

Edit 3:
Note that the controller you should present in the applicationDidBecomeActive: is the navigation controller. The example login controller i showed does nothing, and you should add other functionality to the buttons, etc. When you instantiate and show the navigation controller, it will display whatever rootViewController it has (in this case, your login controller) along with a navigation bar.


text:
Code.org Aims for the Cool Factor
Sign up for our newsletter →
YA CAN'T SPELL 'COOL' WITHOUT CODE: It starts with, oh, say, learning to code a green circle. Or a tic-tac-toe game. Code.org, a nonprofit that wants to see many more kids learning to code, is ramping up its campaign to draw students into coding with a slick video coming out today. Sure, you knew that Mark Zuckerberg and Bill Gates code. But how about NBA All-Star Chris Bosh or Will.i.am of the Black Eyed Peas? (Okay, so Will.i.am is still taking those coding classes.) "The programmers of tomorrow are the wizards of the future. You're going to look like you have magic powers compared to everyone else," says Gabe Newell, co-founder of Valve. Yep, programming is getting cool, kids. And if that isn't enough, the experts are predicting that a million jobs will be unfilled if more kids don't learn to code. Check it out here.
More from EdSurge
U. of Florida Asks Students to Use App to Report Profs Who Don't Teach In Person
By Jeffrey R. Young
Do Instructional Videos Work Better When the Teacher is On Screen? It Depends.
With the Pandemic Shining New Light on Early Childhood Educators, Proponents Look to 'Radical' Changes
By Emily Tate
A Record Year Amid a Pandemic: US Edtech Raises $2.2 Billion in 2020
By Tony Wan


text:
Home Nuclear Reactors New Reactors Design Certification Applications for New Reactors APR1400
Page Last Reviewed/Updated Monday, March 09, 2020
APR1400 Final Safety Evaluations
The following table provides access to Final Safety Evaluations that the NRC has issued in connection with its review of the DCD application that Korea Electric Power Corporation (KEPCO) and Korea Hydro & Nuclear Power Co., Ltd. (KHNP) submitted for the Advanced Power Reactor 1400 (APR1400):
This page includes links to files in non-HTML format. See Plugins, Viewers, and Other Tools for more information.
TOC Table of Contents 09/28/18
1 Introduction and General Discussion 09/28/18
2 Site Characteristics 09/28/18
3 Design of Structures, Components, Equipment, and Systems 09/28/18
4 Reactor 09/28/18
5 Reactor Coolant System and Connected Systems 09/28/18
6 Engineered Safety Features 09/28/18
7 Instrumentation and Controls 09/28/18
8 Electric Power 09/28/18
9 Auxiliary Systems 09/28/18
10 Steam and Power Conversion System 09/28/18
11 Radioactive Waste Management 09/28/18
12 Radiation Protection 09/28/18
13 Conduct of Operations 09/28/18
14 Verification Programs 09/28/18
15 Accident and Transient Analyses 09/28/18
16 Technical Specifications 09/28/18
17 Quality Assurance and Reliability Assurance 09/28/18
18 Human Factors Engineering 09/28/18
19 Probabilistic Risk Assessment and Severe Accident Evaluation 09/28/18
Appendix A Chronology 09/28/18
Appendix B References 09/28/18
Appendix C Acronyms 09/28/18
Appendix D Principal Contributors 09/28/18
Appendix E Index of NRC's Requests for Additional Information 09/28/18
Appendix F Report by the Advisory Committee on Reactor Safeguards 09/28/18
APR1400 Design Control Document and Environmental Report
APR1400 Application Review Schedule
NRC COVID-19 Update
Transformation at the NRC - Updated
RIC 2021
Rulemaking Activity
New Reactor Construction - Vogtle
Community Advisory Board Meetings
Information Quality Program
Accident Tolerant Fuel
Commission Documents
NRC Safety Culture Policy Statement


text:
Smart App Reviews
Reviews of Latest Mobile Apps, Games, & Tech
Mangafreak : 10 Best Alternatives & Similar Sites Like Manga Freak
Apr 23 Amit Ahuja
Manga is a Japanese word which stands for both cartoons and comics. It has a deep complex history in Japanese Art as Japanese artists and writers originally created it. Manga actually is graphic novels and comics.
Manga freak is a site that allows you to read and download for free and also saves you from any kind of registration. It targets children as well as adults as its readers. The name of the site manga freaks, speaks for itself.
It offers its users free access to reading and downloading. The manga is categorized into different genres. Manga freak quickly gained popularity around the world that soon afterward for its i. Reading lovers; it was translated into English for free.
This article will prove to be very beneficial to those who are looking for manga freak alternatives. As it shares the top 10 manga freak alternatives that the users can access and enjoy in 2019.
List of 10 Best Mangafreak Alternatives & Similar Sites
1. Mangafox
Mangafox is a good alternative for Mangafreak. It is a paradise for its users as it features over 8000 manga of high quality, which is divided into nearly 39 categories.
Its users have been following it for years. It is the most viewed manga at the site which makes it a one of the best mega freak alternative.
It has a separate app which makes reading easy.
It is always up-to-date.
Its variety is huge which caters all kinds of readers.
The ads occupy a large portion of the site which annoys the readers.
2. Kissmanga
This site too offers its users, reading and downloading for free. It doesn't need and registration prior to reading a Manga. For faster access, it is divided into different niche like action, adventure, and fantasy and many more.
It is to use and frequently gets updated too. Kissmanga is a free website for reading manga online without registration. Hence it's a good alternative for Mangafreak
It provides a variety of mangas that offers its users many options to choose or select for reading.
A very dependable alternative with easy to use features
The images often disappear and then you have to refresh the site.
You need to disable Adblock\uBlock in order to access the site, as sometimes the pages get blocked.
The ads and pop-ups often test the patience of the readers.
Official Site: https://kissmanga.com
3. Comic Book Plus
It provides its users with a lively and friendly forum. It gives you access to free reading and downloading.
It is a site that offers all content for free and which is all legal
It contains both silver and golden age comic books. The outlook of the site is attractive with its huge collection.
It shows fewer ads.
It also offers pulp fiction.
You can also locate them on twitter, Google, and even Facebook.
The site looks a bit retro and sometimes seems a bit confusing
Official Site: www.comicbookplus.com
4. Viz Media
This is an app which stood out as a sound alternative in 2019. Android users as well as IOS users can use it by simply pressing the download button. It gives you the option of reading it offline too due to which it has emerged as a good alternative for the manga lovers.
This is not a free app,thus you need to pay before reading it.. After the payment is done, one can read manga from any platform e.g. IOS or Android.
It is an e-reader and a library app that allows its users to make their collection to select for reading.
It has a frame zoom feature too. It is ideal for those readers who have a lot of Japanese manga to store.
it also gives u access to comic one piece mega
It is one of the top manga sites that are easy to use.
The obscure and smaller content might not be available on it as it caters the general content.
5. Comics Punch
This site offers a wide catalog to its users, with hundreds of comic books that are available on it.
It not only provides you the old fiction but also something new that you never heard of.
It has an extensive library.
This sit appears to be a little sketchy with a wonky interface.
It might not have all the titles that you are looking for.
The comics are pre-organized therefore; the searching might require some effort.
Official site: https://comicpunch.net/
6. Shenon Jump Manga Reader
It is an English source that provides legal manga of a different kind for free. It is quite easy to use.
It offers you the latest manga even those that are released the very same day.
It also gives you access to the famous one-piece manga.
On becoming a regular member you get a reward to unlock 10,000 + manga chapters
It contains nearly all the chapters in English.
You can also bookmark your favorite moments
They lack a "watch list" feature to track your favorite series
It again requires a "continue reading" option so that you can easily go back to the series that you were enjoying earlier.
Official site: https://www.viz.com/shonenjump
7. Manga Reader
With mangareader.net you can read the Manga online It is a free site for reading manga online.. All the latest Manga are available here.
It doesn't require any registration for reading it
It provides all the newly released manga to its viewers.
This is a free website so you can read comics and other Manga stuff without paying anything
It also has an advanced search feature that allows searching based on the genre that is arranged on the basis of popularity.
8. Comixology:
It is a digital comic that is cloud based. It includes the latest manga for free.
It is the largest selection of digital comics.
If your favorite comic is not available on it you can ask them to put it on the list by clicking the "Request Comics" option.
On this site, you can make your library.
You can also report any comics to them.
The scroll bar is very long and gets boring
It has paid comics
Official site :www.comixology.com
9. View Comic Online
It allows you to read manga online for free. It has the latest comics. It has emerged as another choice in place of mangafreak.
If your favorite comic is not available on their site then you can request them to put it on the list by clicking the "Request Comic" option
You can also report a comic by going to the "Report Error" button.
Users solely do the links here posted so the site doesn't take any responsibility
The theme of this site is not attractive
The site doesn't take responsibility of copyrights as all the stuff posted is by users
Official site: www.view-comic.com
10. Manga Browser
It is an android app which makes it easily accessible for everyone just like mangafreak.
It downloads chapters efficiently.
Sometimes there are errors in downloading and often the site gives you image errors.
Sometimes certain chapters are found missing.
Often the dates of publication for different series are not available.
After prolonged usage, the app closes.
Among all the manga mentioned above freak alternatives, shenon jump manga reader is the best alternative site with its maximum pros and least cons. It is a legal manga site which does not charge anything.
It not only provides all the series in English but also gives you access to the manga that is released the very same day you visit the site. The most popular and famous one piece, which is liked by many, is also available on it.
When you become a regular member, the site rewards you with 10,000 + manga chapters. It offers its users nearly all the chapters in English and allows you to bookmark your favorite moments. All these Amazing features that this site offers, makes it the best manga freak alternative.
This post Mangafreak : 10 Best Alternatives & Similar Sites Like Manga Freak first appeared on impactresearch.org
Source – https://impactresearch.org/mangafreak-alternatives/
Posted in Alternatives
Top 14 Farming Games Like Harvest Moon to Play in 2019
10 Best Strategy Battle Games Like Clash of Clans You Can Play in 2019
Best Open World Games Like Assassin's Creed That You can Play In 2019
MalwareFox Anti-Malware Review : Everything You Need to Know
Free Amazon Gift Cards : Legit Sources to Get Them in 2019
Designed by InkHive. © 2019 Smart App Reviews. All Rights Reserved.


text:
Q: VBA collection not updating? I have a global dictionary actionDict that has a structure that looks like this:
id: [collection1 collection2 collection3 collection4 collection5]

each collection has 5 strings (either user informations or an empty string)
When the user clicks a button, the script will update the dictionary
' inside the onclick function
    ElseIf actionDict(constituentID.Value)(2)(2) = "" Then
        actionDict(constituentID.Value)(2)(2) = action_date.Value 'value = test1
        actionDict(constituentID.Value)(2)(5) = agent_tm.Value 'value = test1
        actionDict(constituentID.Value)(2)(4) = action_response.Value 'value = test1
        actionDict(constituentID.Value)(2)(3) = "Call Center"
        ' this is displayed correctly
        MsgBox "second action empty"
        ' this displays the correct information
        MsgBox action_date.Value & " " & agent_tm.Value & " " & action_response.Value
        ' this displays an empty string
        MsgBox actionDict(constituentID.Value)(2)(2) & " " & actionDict(constituentID.Value)(2)(5) & " " & actionDict(constituentID.Value)(2)(4)

The first 2 message boxes are displaying the right information when I click the button is the right information, however the third one is displaying a blank string.
Also when I access the dictionary again, the newly added values are still displayed as empty
' inside calling function
Sub onclick()
    action = actionDict(id)(2)
    'tmagent, actiondate, actionresponse, pledge_amnt are text fields
    populatefieldsAction(tmagent, actiondate, actionresponse, pledge_amnt, action)
End Sub

Function populatefieldsAction(tmagent, actiondate, actionresponse, pledge_amnt, action)
    MsgBox action(5) & "  " & action(2) & action(4)
    'showing empty string
    tmagent.Value = action(5)
    actiondate.Value = action(2)
    actionresponse.Value = action(4)
End Function

What exactly is going wrong? Thanks

A: Building on what freeflow said:

You cannot change the contents of an array held in a Dictionary because the value returned by the key is a copy of the array. To correctly update the dictionary you must first retrieve the array,then make your changes, then replace the old array with the updated array. – freeflow

You code will look something like this:
' inside the onclick function
ElseIf actionDict(constituentID.Value)(2)(2) = "" Then
    temp_arr = actionDict(constituentID.Value)

    temp_arr(2)(2) = action_date.Value 'value = test1
    temp_arr(2)(5) = agent_tm.Value 'value = test1
    temp_arr(2)(4) = action_response.Value 'value = test1
    temp_arr(2)(3) = "Call Center"

    actionDict(constituentID.Value) = temp_arr

' inside calling function
Sub onclick()
    'tmagent, actiondate, actionresponse, pledge_amnt are text fields
    Call populatefieldsAction(tmagent, actiondate, actionresponse, pledge_amnt, actionDict, id) 'Pass the entire dictionary
End Sub

Function populatefieldsAction(tmagent, actiondate, actionresponse, pledge_amnt, ByRef actionDict, id)
    tmagent.Value = actionDict(id)(2)(5)
    actiondate.Value = actionDict(id)(2)(2)
    actionresponse.Value = actionDict(id)(2)(4)
End Function

A: I ended up creating a new array altoghether, based on what @freeflow and @Hrishikesh Nadkarni said:
    Dim new_arr
    Set new_arr = New Collection

    Dim new_act()
    ReDim new_act(1 To 5)

    new_act(1) = agent_tm.Value
    new_act(2) = action_date.Value
    new_act(3) = action_response.Value
    new_act(4) = pledge_amnt.Value

    'Set test = actionDict(constituentID.Value)
    If Not actionDict.Exists(constituentID.Value) Then
        Dim arr()
        ReDim arr(1 To 5)
        arr(1) = agent_tm.Value
        arr(4) = action_date.Value
        arr(3) = action_response.Value
        arr(2) = pledge_amnt.Value
        new_arr.Add (arr)
    Else
        For i = 1 To 5
            If actionDict(constituentID.Value)(i)(2) <> "" Then
                new_arr.Add (actionDict(constituentID.Value)(i))
            End If
        Next i
    End If

    new_arr.Add (new_act)

    Do While new_arr.Count < 5
        Dim emptyArr()
        ReDim emptyArr(1 To 5)
        emptyArr(1) = ""
        emptyArr(2) = ""
        emptyArr(3) = ""
        emptyArr(4) = ""
        emptyArr(5) = ""
        new_arr.Add emptyArr 'add empty array
    Loop

    Set actionDict(constituentID.Value) = new_arr


text:
<TITLE>Contents of Entries</TITLE>
<LINK REL=StyleSheet HREF="../rw.css" TYPE="text/css" TITLE="Apache stdcxx Stylesheet">

Apache C++ Standard Library Reference Guide

1.1 Contents of Entries

This reference guide is an alphabetical listing of the header files, classes, containers, algorithms, iterators, and other constructs of the Apache C++ Standard Library Module. The entry for each class includes:

An illustration showing the inheritance hierarchy, or the general category to which the class belongs

A brief summary of the class functionality

A synopsis indicating the header file(s) associated with the class

A description of the class

The C++ code that describes the class interface

All methods associated with the class, including constructors, operators, member functions, and so on. These are grouped together and listed alphabetically within each group. These groups are not a part of the C++ language, but they are a useful way to organize information.

Examples and warnings

Entries that are not classes include other appropriate categories of information. In general, there is still a brief summary of the entry's functionality, followed by a more detailed description, and in many cases an example.


text:
William Blum, Independent Journalist and Anti-Imperialist Historian, Dies at 85
HeadlineDec 11, 2018
And independent journalist and author William Blum died Sunday at the age of 85 at a hospice in Virginia. Early in his career, Blum worked with computers at the U.S. State Department but left after becoming disillusioned with the American war on Vietnam. He co-founded the underground paper, the Washington Free Press. Blum's books "Killing Hope" and "Rogue State" were widely praised for their detailed history of recent U.S. foreign policy. Blum said of his work, "The thesis in my books and my writing is that anti-American terrorism arises from the behavior of U.S. foreign policy. It is what the U.S. government does which angers people all over the world."


You want to get leads, close leads and move the markers forward.
We help owners do exactly that for their businesses.
This blog will help with all of that.
We cover lead generation, prospecting, CRM design and closing.
Our weekly newsletter will help you get leads and build a process that allows them to work with you. Easily.


Healthcare is a hot button issue in the US and has been for as long as most people can remember. In the lead up to this year's midterm elections, the national debate regarding the price Americans pay for healthcare and who has access to it is being discussed at length from a variety of different perspectives.
However, in the absence of any monumental regulatory change from above, many people have instead put their trust and hope in private healthcare providers and the technology they leverage to make our lives better. With the ability to effectively analyze patient data revolutionizing healthcare, we spoke to Derrick Schafer, senior director of data and analytics at Sanford Health, about how the company is bettering its patients' lives through data-driven decision making.
Innovation Enterprise: How do you use data analytics to manage such a large healthcare base?
Derrick Schafer: We believe the key to our success in supporting our large healthcare base with analytics is the centralization of data that occurred approximately three years ago. This has allowed us to spend our time focusing on what to do with the data instead of arguing about the validity of the data. A common term we have used is "One Source of Truth". Key in this transition was top-level leadership support driven largely by the desire to be a data-driven organization.
IE: How have you used data visualization in decision making?
DS: Sanford utilizes visualization for our leading indicators that provide end-users with actionable information as well as key descriptive indicators. We also leverage visualizations tools as we roll out new models. We are an SAP shop, so Lumira and Webi are our primary tools for visualizing data.
IE: How has the mindset around data analysis transformed since you first joined Sanford Health and what were the biggest propellers of these changes?
DS: The mindset around data at Sanford has really transitioned from descriptive metrics to leading indicators. It has taken some time to change the culture, but we have made significant headway toward actionable data and what that means. The other key change has been our movement to an on-demand culture. To allow our staff capacity to focus on advanced analytics we needed to get a high percentage (our goal is 80%) of our descriptive data available for end users to access when and where they need it without requesting that information. We have made significant headway on this initiative, but it was met with initial resistance. Creating embedding analysts within key organizational service lines was also a major change that has had remarkable success.
IE: Do you believe data analysis can help make a difference in national issues such as the opioid crisis?
DS: I think it can and already is at Sanford Health. One example is the extensive work we have carried out with Physician Leadership to create information for every provider ordering opioids and benzodiazepines on a routine basis that compares them to their specific specialty.
IE: Do you think wearables will become more widely utilized by healthcare systems and does Sanford Health any plans to begin using them?
DS: We don't currently leverage wearables or devices in our analytics, but do see them as an important source of information and a key part of our analytics strategy in our one-to-two year vision.
To find out more on how you can leverage data analytics to deliver patient-centric outcomes, visit this year AI & Data for Pharma Summit, part of DATAx New York on December 12–13, 2018.


The PROFIdrive Profile Tester supports the development of PROFINET devices with PROFIdrive or ENCODER Profile application interfaces. It can be used as a means for preparation of the PROFIdrive certification and also as test tool to run self-programmed test scripts.
V5.0 is an improved and reworked V4.0 and adds isochronous operation (sign of life and DSC test cases are now operable).
With Service Pack 1 the additional features Device Access, PROFIdrive on PROFIsafe and Alarm channel/Diagnostics (for both PROFIdrive & Encoder) can be tested.
In addition it provides updated scripts as well as new developed scripts for some of the described features in the new Encoder Profile V4.2.
1. For installation you need administrator privileges.
2. Follow the instructions of the Install Wizard.
3. For further installation details see the User Guide.
A maximum of one CP1616 is permitted in one PC. The CP1616 shall be used exclusively by the Profile Tester and shall not be used also by other software, different from the Profile Tester.
Extention of test cases for ENCODER profile certification test.
New frame work. Isochronous operation supported.
Bugfix for TIA Portal engineered projects.
Alarm channel/Diagnostics and Encoder Profile V4.2.