text:
<?php

final class DifferentialChangesetParser extends Phobject {

  const HIGHLIGHT_BYTE_LIMIT = 262144;

  protected $visible      = array();
  protected $new          = array();
  protected $old          = array();
  protected $intra        = array();
  protected $newRender    = null;
  protected $oldRender    = null;

  protected $filename     = null;
  protected $hunkStartLines = array();

  protected $comments     = array();
  protected $specialAttributes = array();

  protected $changeset;
  protected $whitespaceMode = null;

  protected $renderCacheKey = null;

  private $handles = array();
  private $user;

  private $leftSideChangesetID;
  private $leftSideAttachesToNewFile;

  private $rightSideChangesetID;
  private $rightSideAttachesToNewFile;

  private $originalLeft;
  private $originalRight;

  private $renderingReference;
  private $isSubparser;

  private $isTopLevel;

  private $coverage;
  private $markupEngine;
  private $highlightErrors;
  private $disableCache;
  private $renderer;
  private $characterEncoding;
  private $highlightAs;
  private $highlightingDisabled;
  private $showEditAndReplyLinks = true;
  private $canMarkDone;
  private $objectOwnerPHID;
  private $offsetMode;

  private $rangeStart;
  private $rangeEnd;
  private $mask;
  private $linesOfContext = 8;

  private $highlightEngine;

  public function setRange($start, $end) {
    $this->rangeStart = $start;
    $this->rangeEnd = $end;
    return $this;
  }

  public function setMask(array $mask) {
    $this->mask = $mask;
    return $this;
  }

  public function renderChangeset() {
    return $this->render($this->rangeStart, $this->rangeEnd, $this->mask);
  }

  public function setShowEditAndReplyLinks($bool) {
    $this->showEditAndReplyLinks = $bool;
    return $this;
  }

  public function getShowEditAndReplyLinks() {
    return $this->showEditAndReplyLinks;
  }

  public function setHighlightAs($highlight_as) {
    $this->highlightAs = $highlight_as;
    return $this;
  }

  public function getHighlightAs() {
    return $this->highlightAs;
  }

  public function setCharacterEncoding($character_encoding) {
    $this->characterEncoding = $character_encoding;
    return $this;
  }

  public function getCharacterEncoding() {
    return $this->characterEncoding;
  }

  public function setRenderer(DifferentialChangesetRenderer $renderer) {
    $this->renderer = $renderer;
    return $this;
  }

  public function getRenderer() {
    if (!$this->renderer) {
      return new DifferentialChangesetTwoUpRenderer();
    }
    return $this->renderer;
  }

  public function setDisableCache($disable_cache) {
    $this->disableCache = $disable_cache;
    return $this;
  }

  public function getDisableCache() {
    return $this->disableCache;
  }

  public function setCanMarkDone($can_mark_done) {
    $this->canMarkDone = $can_mark_done;
    return $this;
  }

  public function getCanMarkDone() {
    return $this->canMarkDone;
  }

  public function setObjectOwnerPHID($phid) {
    $this->objectOwnerPHID = $phid;
    return $this;
  }

  public function getObjectOwnerPHID() {
    return $this->objectOwnerPHID;
  }

  public function setOffsetMode($offset_mode) {
    $this->offsetMode = $offset_mode;
    return $this;
  }

  public function getOffsetMode() {
    return $this->offsetMode;
  }

  public static function getDefaultRendererForViewer(PhabricatorUser $viewer) {
    $is_unified = $viewer->compareUserSetting(
      PhabricatorUnifiedDiffsSetting::SETTINGKEY,
      PhabricatorUnifiedDiffsSetting::VALUE_ALWAYS_UNIFIED);

    if ($is_unified) {
      return '1up';
    }

    return null;
  }

  public function readParametersFromRequest(AphrontRequest $request) {
    $this->setWhitespaceMode($request->getStr('whitespace'));
    $this->setCharacterEncoding($request->getStr('encoding'));
    $this->setHighlightAs($request->getStr('highlight'));

    $renderer = null;

    // If the viewer prefers unified diffs, always set the renderer to unified.
    // Otherwise, we leave it unspecified and the client will choose a
    // renderer based on the screen size.

    if ($request->getStr('renderer')) {
      $renderer = $request->getStr('renderer');
    } else {
      $renderer = self::getDefaultRendererForViewer($request->getViewer());
    }

    switch ($renderer) {
      case '1up':
        $this->setRenderer(new DifferentialChangesetOneUpRenderer());
        break;
      default:
        $this->setRenderer(new DifferentialChangesetTwoUpRenderer());
        break;
    }

    return $this;
  }

  const CACHE_VERSION = 11;
  const CACHE_MAX_SIZE = 8e6;

  const ATTR_GENERATED  = 'attr:generated';
  const ATTR_DELETED    = 'attr:deleted';
  const ATTR_UNCHANGED  = 'attr:unchanged';
  const ATTR_WHITELINES = 'attr:white';
  const ATTR_MOVEAWAY   = 'attr:moveaway';

  const WHITESPACE_SHOW_ALL         = 'show-all';
  const WHITESPACE_IGNORE_TRAILING  = 'ignore-trailing';
  const WHITESPACE_IGNORE_MOST      = 'ignore-most';
  const WHITESPACE_IGNORE_ALL       = 'ignore-all';

  public function setOldLines(array $lines) {
    $this->old = $lines;
    return $this;
  }

  public function setNewLines(array $lines) {
    $this->new = $lines;
    return $this;
  }

  public function setSpecialAttributes(array $attributes) {
    $this->specialAttributes = $attributes;
    return $this;
  }

  public function setIntraLineDiffs(array $diffs) {
    $this->intra = $diffs;
    return $this;
  }

  public function setVisibileLinesMask(array $mask) {
    $this->visible = $mask;
    return $this;
  }

  public function setLinesOfContext($lines_of_context) {
    $this->linesOfContext = $lines_of_context;
    return $this;
  }

  public function getLinesOfContext() {
    return $this->linesOfContext;
  }

  /**
   * Configure which Changeset comments added to the right side of the visible
   * diff will be attached to. The ID must be the ID of a real Differential
   * Changeset.
   *
   * The complexity here is that we may show an arbitrary side of an arbitrary
   * changeset as either the left or right part of a diff. This method allows
   * the left and right halves of the displayed diff to be correctly mapped to
   * storage changesets.
   *
   * @param id    The Differential Changeset ID that comments added to the right
   *              side of the visible diff should be attached to.
   * @param bool  If true, attach new comments to the right side of the storage
   *              changeset. Note that this may be false, if the left side of
   *              some storage changeset is being shown as the right side of
   *              a display diff.
   * @return this
   */
  public function setRightSideCommentMapping($id, $is_new) {
    $this->rightSideChangesetID = $id;
    $this->rightSideAttachesToNewFile = $is_new;
    return $this;
  }

  /**
   * See setRightSideCommentMapping(), but this sets information for the left
   * side of the display diff.
   */
  public function setLeftSideCommentMapping($id, $is_new) {
    $this->leftSideChangesetID = $id;
    $this->leftSideAttachesToNewFile = $is_new;
    return $this;
  }

  public function setOriginals(
    DifferentialChangeset $left,
    DifferentialChangeset $right) {

    $this->originalLeft = $left;
    $this->originalRight = $right;
    return $this;
  }

  public function diffOriginals() {
    $engine = new PhabricatorDifferenceEngine();
    $changeset = $engine->generateChangesetFromFileContent(
      implode('', mpull($this->originalLeft->getHunks(), 'getChanges')),
      implode('', mpull($this->originalRight->getHunks(), 'getChanges')));

    $parser = new DifferentialHunkParser();

    return $parser->parseHunksForHighlightMasks(
      $changeset->getHunks(),
      $this->originalLeft->getHunks(),
      $this->originalRight->getHunks());
  }

  /**
   * Set a key for identifying this changeset in the render cache. If set, the
   * parser will attempt to use the changeset render cache, which can improve
   * performance for frequently-viewed changesets.
   *
   * By default, there is no render cache key and parsers do not use the cache.
   * This is appropriate for rarely-viewed changesets.
   *
   * NOTE: Currently, this key must be a valid Differential Changeset ID.
   *
   * @param   string  Key for identifying this changeset in the render cache.
   * @return  this
   */
  public function setRenderCacheKey($key) {
    $this->renderCacheKey = $key;
    return $this;
  }

  private function getRenderCacheKey() {
    return $this->renderCacheKey;
  }

  public function setChangeset(DifferentialChangeset $changeset) {
    $this->changeset = $changeset;

    $this->setFilename($changeset->getFilename());

    return $this;
  }

  public function setWhitespaceMode($whitespace_mode) {
    $this->whitespaceMode = $whitespace_mode;
    return $this;
  }

  public function setRenderingReference($ref) {
    $this->renderingReference = $ref;
    return $this;
  }

  private function getRenderingReference() {
    return $this->renderingReference;
  }

  public function getChangeset() {
    return $this->changeset;
  }

  public function setFilename($filename) {
    $this->filename = $filename;
    return $this;
  }

  public function setHandles(array $handles) {
    assert_instances_of($handles, 'PhabricatorObjectHandle');
    $this->handles = $handles;
    return $this;
  }

  public function setMarkupEngine(PhabricatorMarkupEngine $engine) {
    $this->markupEngine = $engine;
    return $this;
  }

  public function setUser(PhabricatorUser $user) {
    $this->user = $user;
    return $this;
  }

  public function getUser() {
    return $this->user;
  }

  public function setCoverage($coverage) {
    $this->coverage = $coverage;
    return $this;
  }
  private function getCoverage() {
    return $this->coverage;
  }

  public function parseInlineComment(
    PhabricatorInlineCommentInterface $comment) {

    // Parse only comments which are actually visible.
    if ($this->isCommentVisibleOnRenderedDiff($comment)) {
      $this->comments[] = $comment;
    }
    return $this;
  }

  private function loadCache() {
    $render_cache_key = $this->getRenderCacheKey();
    if (!$render_cache_key) {
      return false;
    }

    $data = null;

    $changeset = new DifferentialChangeset();
    $conn_r = $changeset->establishConnection('r');
    $data = queryfx_one(
      $conn_r,
      'SELECT * FROM %T WHERE id = %d',
      $changeset->getTableName().'_parse_cache',
      $render_cache_key);

    if (!$data) {
      return false;
    }

    if ($data['cache'][0] == '{') {
      // This is likely an old-style JSON cache which we will not be able to
      // deserialize.
      return false;
    }

    $data = unserialize($data['cache']);
    if (!is_array($data) || !$data) {
      return false;
    }

    foreach (self::getCacheableProperties() as $cache_key) {
      if (!array_key_exists($cache_key, $data)) {
        // If we're missing a cache key, assume we're looking at an old cache
        // and ignore it.
        return false;
      }
    }

    if ($data['cacheVersion'] !== self::CACHE_VERSION) {
      return false;
    }

    // Someone displays contents of a partially cached shielded file.
    if (!isset($data['newRender']) && (!$this->isTopLevel || $this->comments)) {
      return false;
    }

    unset($data['cacheVersion'], $data['cacheHost']);
    $cache_prop = array_select_keys($data, self::getCacheableProperties());
    foreach ($cache_prop as $cache_key => $v) {
      $this->$cache_key = $v;
    }

    return true;
  }

  protected static function getCacheableProperties() {
    return array(
      'visible',
      'new',
      'old',
      'intra',
      'newRender',
      'oldRender',
      'specialAttributes',
      'hunkStartLines',
      'cacheVersion',
      'cacheHost',
      'highlightingDisabled',
    );
  }

  public function saveCache() {
    if (PhabricatorEnv::isReadOnly()) {
      return false;
    }

    if ($this->highlightErrors) {
      return false;
    }

    $render_cache_key = $this->getRenderCacheKey();
    if (!$render_cache_key) {
      return false;
    }

    $cache = array();
    foreach (self::getCacheableProperties() as $cache_key) {
      switch ($cache_key) {
        case 'cacheVersion':
          $cache[$cache_key] = self::CACHE_VERSION;
          break;
        case 'cacheHost':
          $cache[$cache_key] = php_uname('n');
          break;
        default:
          $cache[$cache_key] = $this->$cache_key;
          break;
      }
    }
    $cache = serialize($cache);

    // We don't want to waste too much space by a single changeset.
    if (strlen($cache) > self::CACHE_MAX_SIZE) {
      return;
    }

    $changeset = new DifferentialChangeset();
    $conn_w = $changeset->establishConnection('w');

    $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
      try {
        queryfx(
          $conn_w,
          'INSERT INTO %T (id, cache, dateCreated) VALUES (%d, %B, %d)
            ON DUPLICATE KEY UPDATE cache = VALUES(cache)',
          DifferentialChangeset::TABLE_CACHE,
          $render_cache_key,
          $cache,
          time());
      } catch (AphrontQueryException $ex) {
        // Ignore these exceptions. A common cause is that the cache is
        // larger than 'max_allowed_packet', in which case we're better off
        // not writing it.

        // TODO: It would be nice to tailor this more narrowly.
      }
    unset($unguarded);
  }

  private function markGenerated($new_corpus_block = '') {
    $generated_guess = (strpos($new_corpus_block, '@'.'generated') !== false);

    if (!$generated_guess) {
      $generated_path_regexps = PhabricatorEnv::getEnvConfig(
        'differential.generated-paths');
      foreach ($generated_path_regexps as $regexp) {
        if (preg_match($regexp, $this->changeset->getFilename())) {
          $generated_guess = true;
          break;
        }
      }
    }

    $event = new PhabricatorEvent(
      PhabricatorEventType::TYPE_DIFFERENTIAL_WILLMARKGENERATED,
      array(
        'corpus' => $new_corpus_block,
        'is_generated' => $generated_guess,
      )
    );
    PhutilEventEngine::dispatchEvent($event);

    $generated = $event->getValue('is_generated');

    $attribute = $this->changeset->isGeneratedChangeset();
    if ($attribute) {
      $generated = true;
    }

    $this->specialAttributes[self::ATTR_GENERATED] = $generated;
  }

  public function isGenerated() {
    return idx($this->specialAttributes, self::ATTR_GENERATED, false);
  }

  public function isDeleted() {
    return idx($this->specialAttributes, self::ATTR_DELETED, false);
  }

  public function isUnchanged() {
    return idx($this->specialAttributes, self::ATTR_UNCHANGED, false);
  }

  public function isWhitespaceOnly() {
    return idx($this->specialAttributes, self::ATTR_WHITELINES, false);
  }

  public function isMoveAway() {
    return idx($this->specialAttributes, self::ATTR_MOVEAWAY, false);
  }

  private function applyIntraline(&$render, $intra, $corpus) {

    foreach ($render as $key => $text) {
      if (isset($intra[$key])) {
        $render[$key] = ArcanistDiffUtils::applyIntralineDiff(
          $text,
          $intra[$key]);
      }
    }
  }

  private function getHighlightFuture($corpus) {
    $language = $this->highlightAs;

    if (!$language) {
      $language = $this->highlightEngine->getLanguageFromFilename(
        $this->filename);

      if (($language != 'txt') &&
          (strlen($corpus) > self::HIGHLIGHT_BYTE_LIMIT)) {
        $this->highlightingDisabled = true;
        $language = 'txt';
      }
    }

    return $this->highlightEngine->getHighlightFuture(
      $language,
      $corpus);
  }

  protected function processHighlightedSource($data, $result) {

    $result_lines = phutil_split_lines($result);
    foreach ($data as $key => $info) {
      if (!$info) {
        unset($result_lines[$key]);
      }
    }
    return $result_lines;
  }

  private function tryCacheStuff() {
    $whitespace_mode = $this->whitespaceMode;
    switch ($whitespace_mode) {
      case self::WHITESPACE_SHOW_ALL:
      case self::WHITESPACE_IGNORE_TRAILING:
      case self::WHITESPACE_IGNORE_ALL:
        break;
      default:
        $whitespace_mode = self::WHITESPACE_IGNORE_MOST;
        break;
    }

    $skip_cache = ($whitespace_mode != self::WHITESPACE_IGNORE_MOST);
    if ($this->disableCache) {
      $skip_cache = true;
    }

    if ($this->characterEncoding) {
      $skip_cache = true;
    }

    if ($this->highlightAs) {
      $skip_cache = true;
    }

    $this->whitespaceMode = $whitespace_mode;

    $changeset = $this->changeset;

    if ($changeset->getFileType() != DifferentialChangeType::FILE_TEXT &&
        $changeset->getFileType() != DifferentialChangeType::FILE_SYMLINK) {

      $this->markGenerated();

    } else {
      if ($skip_cache || !$this->loadCache()) {
        $this->process();
        if (!$skip_cache) {
          $this->saveCache();
        }
      }
    }
  }

  private function process() {
    $whitespace_mode = $this->whitespaceMode;
    $changeset = $this->changeset;

    $ignore_all = (($whitespace_mode == self::WHITESPACE_IGNORE_MOST) ||
                  ($whitespace_mode == self::WHITESPACE_IGNORE_ALL));

    $force_ignore = ($whitespace_mode == self::WHITESPACE_IGNORE_ALL);

    if (!$force_ignore) {
      if ($ignore_all && $changeset->getWhitespaceMatters()) {
        $ignore_all = false;
      }
    }

    // The "ignore all whitespace" algorithm depends on rediffing the
    // files, and we currently need complete representations of both
    // files to do anything reasonable. If we only have parts of the files,
    // don't use the "ignore all" algorithm.
    if ($ignore_all) {
      $hunks = $changeset->getHunks();
      if (count($hunks) !== 1) {
        $ignore_all = false;
      } else {
        $first_hunk = reset($hunks);
        if ($first_hunk->getOldOffset() != 1 ||
            $first_hunk->getNewOffset() != 1) {
            $ignore_all = false;
        }
      }
    }

    if ($ignore_all) {
      $old_file = $changeset->makeOldFile();
      $new_file = $changeset->makeNewFile();
      if ($old_file == $new_file) {
        // If the old and new files are exactly identical, the synthetic
        // diff below will give us nonsense and whitespace modes are
        // irrelevant anyway. This occurs when you, e.g., copy a file onto
        // itself in Subversion (see T271).
        $ignore_all = false;
      }
    }

    $hunk_parser = new DifferentialHunkParser();
    $hunk_parser->setWhitespaceMode($whitespace_mode);
    $hunk_parser->parseHunksForLineData($changeset->getHunks());

    // Depending on the whitespace mode, we may need to compute a different
    // set of changes than the set of changes in the hunk data (specifically,
    // we might want to consider changed lines which have only whitespace
    // changes as unchanged).
    if ($ignore_all) {
      $engine = new PhabricatorDifferenceEngine();
      $engine->setIgnoreWhitespace(true);
      $no_whitespace_changeset = $engine->generateChangesetFromFileContent(
        $old_file,
        $new_file);

      $type_parser = new DifferentialHunkParser();
      $type_parser->parseHunksForLineData($no_whitespace_changeset->getHunks());

      $hunk_parser->setOldLineTypeMap($type_parser->getOldLineTypeMap());
      $hunk_parser->setNewLineTypeMap($type_parser->getNewLineTypeMap());
    }

    $hunk_parser->reparseHunksForSpecialAttributes();

    $unchanged = false;
    if (!$hunk_parser->getHasAnyChanges()) {
      $filetype = $this->changeset->getFileType();
      if ($filetype == DifferentialChangeType::FILE_TEXT ||
          $filetype == DifferentialChangeType::FILE_SYMLINK) {
        $unchanged = true;
      }
    }

    $moveaway = false;
    $changetype = $this->changeset->getChangeType();
    if ($changetype == DifferentialChangeType::TYPE_MOVE_AWAY) {
      $moveaway = true;
    }

    $this->setSpecialAttributes(array(
      self::ATTR_UNCHANGED  => $unchanged,
      self::ATTR_DELETED    => $hunk_parser->getIsDeleted(),
      self::ATTR_WHITELINES => !$hunk_parser->getHasTextChanges(),
      self::ATTR_MOVEAWAY   => $moveaway,
    ));

    $lines_context = $this->getLinesOfContext();

    $hunk_parser->generateIntraLineDiffs();
    $hunk_parser->generateVisibileLinesMask($lines_context);

    $this->setOldLines($hunk_parser->getOldLines());
    $this->setNewLines($hunk_parser->getNewLines());
    $this->setIntraLineDiffs($hunk_parser->getIntraLineDiffs());
    $this->setVisibileLinesMask($hunk_parser->getVisibleLinesMask());
    $this->hunkStartLines = $hunk_parser->getHunkStartLines(
      $changeset->getHunks());

    $new_corpus = $hunk_parser->getNewCorpus();
    $new_corpus_block = implode('', $new_corpus);
    $this->markGenerated($new_corpus_block);

    if ($this->isTopLevel &&
        !$this->comments &&
          ($this->isGenerated() ||
           $this->isUnchanged() ||
           $this->isDeleted())) {
      return;
    }

    $old_corpus = $hunk_parser->getOldCorpus();
    $old_corpus_block = implode('', $old_corpus);
    $old_future = $this->getHighlightFuture($old_corpus_block);
    $new_future = $this->getHighlightFuture($new_corpus_block);
    $futures = array(
      'old' => $old_future,
      'new' => $new_future,
    );
    $corpus_blocks = array(
      'old' => $old_corpus_block,
      'new' => $new_corpus_block,
    );

    $this->highlightErrors = false;
    foreach (new FutureIterator($futures) as $key => $future) {
      try {
        try {
          $highlighted = $future->resolve();
        } catch (PhutilSyntaxHighlighterException $ex) {
          $this->highlightErrors = true;
          $highlighted = id(new PhutilDefaultSyntaxHighlighter())
            ->getHighlightFuture($corpus_blocks[$key])
            ->resolve();
        }
        switch ($key) {
        case 'old':
          $this->oldRender = $this->processHighlightedSource(
            $this->old,
            $highlighted);
          break;
        case 'new':
          $this->newRender = $this->processHighlightedSource(
            $this->new,
            $highlighted);
          break;
        }
      } catch (Exception $ex) {
        phlog($ex);
        throw $ex;
      }
    }

    $this->applyIntraline(
      $this->oldRender,
      ipull($this->intra, 0),
      $old_corpus);
    $this->applyIntraline(
      $this->newRender,
      ipull($this->intra, 1),
      $new_corpus);
  }

  private function shouldRenderPropertyChangeHeader($changeset) {
    if (!$this->isTopLevel) {
      // We render properties only at top level; otherwise we get multiple
      // copies of them when a user clicks "Show More".
      return false;
    }

    return true;
  }

  public function render(
    $range_start  = null,
    $range_len    = null,
    $mask_force   = array()) {

    // "Top level" renders are initial requests for the whole file, versus
    // requests for a specific range generated by clicking "show more". We
    // generate property changes and "shield" UI elements only for toplevel
    // requests.
    $this->isTopLevel = (($range_start === null) && ($range_len === null));
    $this->highlightEngine = PhabricatorSyntaxHighlighter::newEngine();

    $encoding = null;
    if ($this->characterEncoding) {
      // We are forcing this changeset to be interpreted with a specific
      // character encoding, so force all the hunks into that encoding and
      // propagate it to the renderer.
      $encoding = $this->characterEncoding;
      foreach ($this->changeset->getHunks() as $hunk) {
        $hunk->forceEncoding($this->characterEncoding);
      }
    } else {
      // We're just using the default, so tell the renderer what that is
      // (by reading the encoding from the first hunk).
      foreach ($this->changeset->getHunks() as $hunk) {
        $encoding = $hunk->getDataEncoding();
        break;
      }
    }

    $this->tryCacheStuff();

    // If we're rendering in an offset mode, treat the range numbers as line
    // numbers instead of rendering offsets.
    $offset_mode = $this->getOffsetMode();
    if ($offset_mode) {
      if ($offset_mode == 'new') {
        $offset_map = $this->new;
      } else {
        $offset_map = $this->old;
      }

      $range_end = $this->getOffset($offset_map, $range_start + $range_len);
      $range_start = $this->getOffset($offset_map, $range_start);
      $range_len = ($range_end - $range_start);
    }

    $render_pch = $this->shouldRenderPropertyChangeHeader($this->changeset);

    $rows = max(
      count($this->old),
      count($this->new));

    $renderer = $this->getRenderer()
      ->setUser($this->getUser())
      ->setChangeset($this->changeset)
      ->setRenderPropertyChangeHeader($render_pch)
      ->setIsTopLevel($this->isTopLevel)
      ->setOldRender($this->oldRender)
      ->setNewRender($this->newRender)
      ->setHunkStartLines($this->hunkStartLines)
      ->setOldChangesetID($this->leftSideChangesetID)
      ->setNewChangesetID($this->rightSideChangesetID)
      ->setOldAttachesToNewFile($this->leftSideAttachesToNewFile)
      ->setNewAttachesToNewFile($this->rightSideAttachesToNewFile)
      ->setCodeCoverage($this->getCoverage())
      ->setRenderingReference($this->getRenderingReference())
      ->setMarkupEngine($this->markupEngine)
      ->setHandles($this->handles)
      ->setOldLines($this->old)
      ->setNewLines($this->new)
      ->setOriginalCharacterEncoding($encoding)
      ->setShowEditAndReplyLinks($this->getShowEditAndReplyLinks())
      ->setCanMarkDone($this->getCanMarkDone())
      ->setObjectOwnerPHID($this->getObjectOwnerPHID())
      ->setHighlightingDisabled($this->highlightingDisabled);

    $shield = null;
    if ($this->isTopLevel && !$this->comments) {
      if ($this->isGenerated()) {
        $shield = $renderer->renderShield(
          pht(
            'This file contains generated code, which does not normally '.
            'need to be reviewed.'));
      } else if ($this->isMoveAway()) {
        // We put an empty shield on these files. Normally, they do not have
        // any diff content anyway. However, if they come through `arc`, they
        // may have content. We don't want to show it (it's not useful) and
        // we bailed out of fully processing it earlier anyway.

        // We could show a message like "this file was moved", but we show
        // that as a change header anyway, so it would be redundant. Instead,
        // just render an empty shield to skip rendering the diff body.
        $shield = '';
      } else if ($this->isUnchanged()) {
        $type = 'text';
        if (!$rows) {
          // NOTE: Normally, diffs which don't change files do not include
          // file content (for example, if you "chmod +x" a file and then
          // run "git show", the file content is not available). Similarly,
          // if you move a file from A to B without changing it, diffs normally
          // do not show the file content. In some cases `arc` is able to
          // synthetically generate content for these diffs, but for raw diffs
          // we'll never have it so we need to be prepared to not render a link.
          $type = 'none';
        }

        $type_add = DifferentialChangeType::TYPE_ADD;
        if ($this->changeset->getChangeType() == $type_add) {
          // Although the generic message is sort of accurate in a technical
          // sense, this more-tailored message is less confusing.
          $shield = $renderer->renderShield(
            pht('This is an empty file.'),
            $type);
        } else {
          $shield = $renderer->renderShield(
            pht('The contents of this file were not changed.'),
            $type);
        }
      } else if ($this->isWhitespaceOnly()) {
        $shield = $renderer->renderShield(
          pht('This file was changed only by adding or removing whitespace.'),
          'whitespace');
      } else if ($this->isDeleted()) {
        $shield = $renderer->renderShield(
          pht('This file was completely deleted.'));
      } else if ($this->changeset->getAffectedLineCount() > 2500) {
        $shield = $renderer->renderShield(
          pht(
            'This file has a very large number of changes (%s lines).',
            new PhutilNumber($this->changeset->getAffectedLineCount())));
      }
    }

    if ($shield !== null) {
      return $renderer->renderChangesetTable($shield);
    }

    // This request should render the "undershield" headers if it's a top-level
    // request which made it this far (indicating the changeset has no shield)
    // or it's a request with no mask information (indicating it's the request
    // that removes the rendering shield). Possibly, this second class of
    // request might need to be made more explicit.
    $is_undershield = (empty($mask_force) || $this->isTopLevel);
    $renderer->setIsUndershield($is_undershield);

    $old_comments = array();
    $new_comments = array();
    $old_mask = array();
    $new_mask = array();
    $feedback_mask = array();
    $lines_context = $this->getLinesOfContext();

    if ($this->comments) {
      // If there are any comments which appear in sections of the file which
      // we don't have, we're going to move them backwards to the closest
      // earlier line. Two cases where this may happen are:
      //
      //   - Porting ghost comments forward into a file which was mostly
      //     deleted.
      //   - Porting ghost comments forward from a full-context diff to a
      //     partial-context diff.

      list($old_backmap, $new_backmap) = $this->buildLineBackmaps();

      foreach ($this->comments as $comment) {
        $new_side = $this->isCommentOnRightSideWhenDisplayed($comment);

        $line = $comment->getLineNumber();
        if ($new_side) {
          $back_line = $new_backmap[$line];
        } else {
          $back_line = $old_backmap[$line];
        }

        if ($back_line != $line) {
          // TODO: This should probably be cleaner, but just be simple and
          // obvious for now.
          $ghost = $comment->getIsGhost();
          if ($ghost) {
            $moved = pht(
              'This comment originally appeared on line %s, but that line '.
              'does not exist in this version of the diff. It has been '.
              'moved backward to the nearest line.',
              new PhutilNumber($line));
            $ghost['reason'] = $ghost['reason']."\n\n".$moved;
            $comment->setIsGhost($ghost);
          }

          $comment->setLineNumber($back_line);
          $comment->setLineLength(0);

        }

        $start = max($comment->getLineNumber() - $lines_context, 0);
        $end = $comment->getLineNumber() +
          $comment->getLineLength() +
          $lines_context;
        for ($ii = $start; $ii <= $end; $ii++) {
          if ($new_side) {
            $new_mask[$ii] = true;
          } else {
            $old_mask[$ii] = true;
          }
        }
      }

      foreach ($this->old as $ii => $old) {
        if (isset($old['line']) && isset($old_mask[$old['line']])) {
          $feedback_mask[$ii] = true;
        }
      }

      foreach ($this->new as $ii => $new) {
        if (isset($new['line']) && isset($new_mask[$new['line']])) {
          $feedback_mask[$ii] = true;
        }
      }

      $this->comments = id(new PHUIDiffInlineThreader())
        ->reorderAndThreadCommments($this->comments);

      foreach ($this->comments as $comment) {
        $final = $comment->getLineNumber() +
          $comment->getLineLength();
        $final = max(1, $final);
        if ($this->isCommentOnRightSideWhenDisplayed($comment)) {
          $new_comments[$final][] = $comment;
        } else {
          $old_comments[$final][] = $comment;
        }
      }
    }
    $renderer
      ->setOldComments($old_comments)
      ->setNewComments($new_comments);

    switch ($this->changeset->getFileType()) {
      case DifferentialChangeType::FILE_IMAGE:
        $old = null;
        $new = null;
        // TODO: Improve the architectural issue as discussed in D955
        // https://secure.phabricator.com/D955
        $reference = $this->getRenderingReference();
        $parts = explode('/', $reference);
        if (count($parts) == 2) {
          list($id, $vs) = $parts;
        } else {
          $id = $parts[0];
          $vs = 0;
        }
        $id = (int)$id;
        $vs = (int)$vs;

        if (!$vs) {
          $metadata = $this->changeset->getMetadata();
          $data = idx($metadata, 'attachment-data');

          $old_phid = idx($metadata, 'old:binary-phid');
          $new_phid = idx($metadata, 'new:binary-phid');
        } else {
          $vs_changeset = id(new DifferentialChangeset())->load($vs);
          $old_phid = null;
          $new_phid = null;

          // TODO: This is spooky, see D6851
          if ($vs_changeset) {
            $vs_metadata = $vs_changeset->getMetadata();
            $old_phid = idx($vs_metadata, 'new:binary-phid');
          }

          $changeset = id(new DifferentialChangeset())->load($id);
          if ($changeset) {
            $metadata = $changeset->getMetadata();
            $new_phid = idx($metadata, 'new:binary-phid');
          }
        }

        if ($old_phid || $new_phid) {
          // grab the files, (micro) optimization for 1 query not 2
          $file_phids = array();
          if ($old_phid) {
            $file_phids[] = $old_phid;
          }
          if ($new_phid) {
            $file_phids[] = $new_phid;
          }

          $files = id(new PhabricatorFileQuery())
            ->setViewer($this->getUser())
            ->withPHIDs($file_phids)
            ->execute();
          foreach ($files as $file) {
            if (empty($file)) {
              continue;
            }
            if ($file->getPHID() == $old_phid) {
              $old = $file;
            } else if ($file->getPHID() == $new_phid) {
              $new = $file;
            }
          }
        }

        $renderer->attachOldFile($old);
        $renderer->attachNewFile($new);

        return $renderer->renderFileChange($old, $new, $id, $vs);
      case DifferentialChangeType::FILE_DIRECTORY:
      case DifferentialChangeType::FILE_BINARY:
        $output = $renderer->renderChangesetTable(null);
        return $output;
    }

    if ($this->originalLeft && $this->originalRight) {
      list($highlight_old, $highlight_new) = $this->diffOriginals();
      $highlight_old = array_flip($highlight_old);
      $highlight_new = array_flip($highlight_new);
      $renderer
        ->setHighlightOld($highlight_old)
        ->setHighlightNew($highlight_new);
    }
    $renderer
      ->setOriginalOld($this->originalLeft)
      ->setOriginalNew($this->originalRight);

    if ($range_start === null) {
      $range_start = 0;
    }
    if ($range_len === null) {
      $range_len = $rows;
    }
    $range_len = min($range_len, $rows - $range_start);

    list($gaps, $mask, $depths) = $this->calculateGapsMaskAndDepths(
      $mask_force,
      $feedback_mask,
      $range_start,
      $range_len);

    $renderer
      ->setGaps($gaps)
      ->setMask($mask)
      ->setDepths($depths);

    $html = $renderer->renderTextChange(
      $range_start,
      $range_len,
      $rows);

    return $renderer->renderChangesetTable($html);
  }

  /**
   * This function calculates a lot of stuff we need to know to display
   * the diff:
   *
   * Gaps - compute gaps in the visible display diff, where we will render
   * "Show more context" spacers. If a gap is smaller than the context size,
   * we just display it. Otherwise, we record it into $gaps and will render a
   * "show more context" element instead of diff text below. A given $gap
   * is a tuple of $gap_line_number_start and $gap_length.
   *
   * Mask - compute the actual lines that need to be shown (because they
   * are near changes lines, near inline comments, or the request has
   * explicitly asked for them, i.e. resulting from the user clicking
   * "show more"). The $mask returned is a sparsely populated dictionary
   * of $visible_line_number => true.
   *
   * Depths - compute how indented any given line is. The $depths returned
   * is a sparsely populated dictionary of $visible_line_number => $depth.
   *
   * This function also has the side effect of modifying member variable
   * new such that tabs are normalized to spaces for each line of the diff.
   *
   * @return array($gaps, $mask, $depths)
   */
  private function calculateGapsMaskAndDepths(
    $mask_force,
    $feedback_mask,
    $range_start,
    $range_len) {

    $lines_context = $this->getLinesOfContext();

    // Calculate gaps and mask first
    $gaps = array();
    $gap_start = 0;
    $in_gap = false;
    $base_mask = $this->visible + $mask_force + $feedback_mask;
    $base_mask[$range_start + $range_len] = true;
    for ($ii = $range_start; $ii <= $range_start + $range_len; $ii++) {
      if (isset($base_mask[$ii])) {
        if ($in_gap) {
          $gap_length = $ii - $gap_start;
          if ($gap_length <= $lines_context) {
            for ($jj = $gap_start; $jj <= $gap_start + $gap_length; $jj++) {
              $base_mask[$jj] = true;
            }
          } else {
            $gaps[] = array($gap_start, $gap_length);
          }
          $in_gap = false;
        }
      } else {
        if (!$in_gap) {
          $gap_start = $ii;
          $in_gap = true;
        }
      }
    }
    $gaps = array_reverse($gaps);
    $mask = $base_mask;

    // Time to calculate depth.
    // We need to go backwards to properly indent whitespace in this code:
    //
    //   0: class C {
    //   1:
    //   1:   function f() {
    //   2:
    //   2:     return;
    //   1:
    //   1:   }
    //   0:
    //   0: }
    //
    $depths = array();
    $last_depth = 0;
    $range_end = $range_start + $range_len;
    if (!isset($this->new[$range_end])) {
      $range_end--;
    }
    for ($ii = $range_end; $ii >= $range_start; $ii--) {
      // We need to expand tabs to process mixed indenting and to round
      // correctly later.
      $line = str_replace("\t", '  ', $this->new[$ii]['text']);
      $trimmed = ltrim($line);
      if ($trimmed != '') {
        // We round down to flatten "/**" and " *".
        $last_depth = floor((strlen($line) - strlen($trimmed)) / 2);
      }
      $depths[$ii] = $last_depth;
    }

    return array($gaps, $mask, $depths);
  }

  /**
   * Determine if an inline comment will appear on the rendered diff,
   * taking into consideration which halves of which changesets will actually
   * be shown.
   *
   * @param PhabricatorInlineCommentInterface Comment to test for visibility.
   * @return bool True if the comment is visible on the rendered diff.
   */
  private function isCommentVisibleOnRenderedDiff(
    PhabricatorInlineCommentInterface $comment) {

    $changeset_id = $comment->getChangesetID();
    $is_new = $comment->getIsNewFile();

    if ($changeset_id == $this->rightSideChangesetID &&
        $is_new == $this->rightSideAttachesToNewFile) {
        return true;
    }

    if ($changeset_id == $this->leftSideChangesetID &&
        $is_new == $this->leftSideAttachesToNewFile) {
        return true;
    }

    return false;
  }

  /**
   * Determine if a comment will appear on the right side of the display diff.
   * Note that the comment must appear somewhere on the rendered changeset, as
   * per isCommentVisibleOnRenderedDiff().
   *
   * @param PhabricatorInlineCommentInterface Comment to test for display
   *              location.
   * @return bool True for right, false for left.
   */
  private function isCommentOnRightSideWhenDisplayed(
    PhabricatorInlineCommentInterface $comment) {

    if (!$this->isCommentVisibleOnRenderedDiff($comment)) {
      throw new Exception(pht('Comment is not visible on changeset!'));
    }

    $changeset_id = $comment->getChangesetID();
    $is_new = $comment->getIsNewFile();

    if ($changeset_id == $this->rightSideChangesetID &&
        $is_new == $this->rightSideAttachesToNewFile) {
      return true;
    }

    return false;
  }

  /**
   * Parse the 'range' specification that this class and the client-side JS
   * emit to indicate that a user clicked "Show more..." on a diff. Generally,
   * use is something like this:
   *
   *   $spec = $request->getStr('range');
   *   $parsed = DifferentialChangesetParser::parseRangeSpecification($spec);
   *   list($start, $end, $mask) = $parsed;
   *   $parser->render($start, $end, $mask);
   *
   * @param string Range specification, indicating the range of the diff that
   *               should be rendered.
   * @return tuple List of <start, end, mask> suitable for passing to
   *               @{method:render}.
   */
  public static function parseRangeSpecification($spec) {
    $range_s = null;
    $range_e = null;
    $mask = array();

    if ($spec) {
      $match = null;
      if (preg_match('@^(\d+)-(\d+)(?:/(\d+)-(\d+))?$@', $spec, $match)) {
        $range_s = (int)$match[1];
        $range_e = (int)$match[2];
        if (count($match) > 3) {
          $start = (int)$match[3];
          $len = (int)$match[4];
          for ($ii = $start; $ii < $start + $len; $ii++) {
            $mask[$ii] = true;
          }
        }
      }
    }

    return array($range_s, $range_e, $mask);
  }

  /**
   * Render "modified coverage" information; test coverage on modified lines.
   * This synthesizes diff information with unit test information into a useful
   * indicator of how well tested a change is.
   */
  public function renderModifiedCoverage() {
    $na = phutil_tag('em', array(), '-');

    $coverage = $this->getCoverage();
    if (!$coverage) {
      return $na;
    }

    $covered = 0;
    $not_covered = 0;

    foreach ($this->new as $k => $new) {
      if (!$new['line']) {
        continue;
      }

      if (!$new['type']) {
        continue;
      }

      if (empty($coverage[$new['line'] - 1])) {
        continue;
      }

      switch ($coverage[$new['line'] - 1]) {
        case 'C':
          $covered++;
          break;
        case 'U':
          $not_covered++;
          break;
      }
    }

    if (!$covered && !$not_covered) {
      return $na;
    }

    return sprintf('%d%%', 100 * ($covered / ($covered + $not_covered)));
  }

  /**
   * Build maps from lines comments appear on to actual lines.
   */
  private function buildLineBackmaps() {
    $old_back = array();
    $new_back = array();
    foreach ($this->old as $ii => $old) {
      $old_back[$old['line']] = $old['line'];
    }
    foreach ($this->new as $ii => $new) {
      $new_back[$new['line']] = $new['line'];
    }

    $max_old_line = 0;
    $max_new_line = 0;
    foreach ($this->comments as $comment) {
      if ($this->isCommentOnRightSideWhenDisplayed($comment)) {
        $max_new_line = max($max_new_line, $comment->getLineNumber());
      } else {
        $max_old_line = max($max_old_line, $comment->getLineNumber());
      }
    }

    $cursor = 1;
    for ($ii = 1; $ii <= $max_old_line; $ii++) {
      if (empty($old_back[$ii])) {
        $old_back[$ii] = $cursor;
      } else {
        $cursor = $old_back[$ii];
      }
    }

    $cursor = 1;
    for ($ii = 1; $ii <= $max_new_line; $ii++) {
      if (empty($new_back[$ii])) {
        $new_back[$ii] = $cursor;
      } else {
        $cursor = $new_back[$ii];
      }
    }

    return array($old_back, $new_back);
  }

  private function getOffset(array $map, $line) {
    if (!$map) {
      return null;
    }

    $line = (int)$line;
    foreach ($map as $key => $spec) {
      if ($spec && isset($spec['line'])) {
        if ((int)$spec['line'] >= $line) {
          return $key;
        }
      }
    }

    return $key;
  }

}

redpajama_set_name: RedPajamaGithub


text:
The Third District Court of Appeal held that the California Department of Fish and Wildlife's program EIR analyzing the Department's statewide fish hatchery and stocking enterprise passed muster. The Department did not abuse its discretion in the manner it organized the EIR, analyzed the project, and mitigated numerous impacts. The court also found, however, that ...
Third Appellate District Upholds Department of Fish and Wildlife EIR, But Finds Department Violated APA in Adopting Underground Regulations
Gwynne Hunter
Adequacy of Mitigation, Alternatives, APA, Baseline, Program EIR, underground regulations
The Third District Court of Appeal held that the California Department of Fish and Wildlife's program EIR analyzing the Department's statewide fish hatchery and stocking enterprise passed muster. The Department did not abuse its discretion in the manner it organized the EIR, analyzed the project, and mitigated numerous impacts. The court also found, however, that the Department had violated the Administrative Procedure Act (APA) by adopting three mitigation measures, which imposed new obligations on private aquaculture facilities and required the Department to perform new duties, without complying with APA procedures. Center for Biological Diversity v. Dept. of Fish and Wildlife (Feb. 10, 2015) ___ Cal.App.4th ___, Case No. C072486.
The Department operates 14 trout hatcheries and 10 salmon and steelhead hatcheries throughout the state, stocking fish at close to 1,000 locations each year. After CEQA's enactment, the hatching and stocking enterprise was found categorically exempt from complying with CEQA. Subsequently, concerns arose regarding the enterprise's impact on native and wild animals due to predation and genetic hybridization. To address these concerns, the Department developed aquatic biodiversity management plans and hatchery genetic management plans. Center for Biological Diversity sued the Department in 2006, and the trial court agreed with the Center that the enterprise was not categorically exempt from CEQA because it likely caused significant environmental impacts. The court in this prior suit ordered the Department to prepare an EIR and comply with CEQA.
The Department prepared a broad-scope, program EIR/environmental impact statement pursuant to that decision and to additionally comply with NEPA. The EIR analyzed the statewide hatchery and stocking enterprise, as well as three other programs, including the Fishing in the City Program (providing fishing opportunities in urban areas), and the Private Stocking Permit Program (authorizing fish stocking by private aquaculture facilities in private and public lakes and ponds). The Department selected operations from 2004 to 2008 as the baseline and identified more than 200 impacts on biological resources. The EIR proposed a number of mitigation measures to lessen these impacts, and laid out three project alternatives. The EIR did not consider closing the hatcheries or eliminating trout stocking as alternatives.
The Department's EIR was challenged by the Center and other plaintiffs representing environmental interests in two separate CEQA suits, with plaintiffs representing recreational fishing interests bringing a third suit under the APA. The trial court upheld the EIR and found no violations of the APA. The appellate court affirmed in part and reversed in part.
First, the Third District addressed the EIR's level of analysis. The CEQA Guidelines do not specify the level of analysis required to be performed in a program EIR. Rather, the Guidelines require an EIR to provide sufficient information in light of what is reasonably feasible. The court found the EIR satisfied that standard. The document reviewed and analyzed the hatchery and stocking enterprise specifically and comprehensively, but within reason, providing for further environmental review where warranted. Given the nature and statewide scope of the project and the consistency of its impacts across the state, the court found the analysis adequate to serve as a program EIR that also operated as project EIR. No additional site-specific environmental review was required given the agency's determination that site-specific impacts were sufficiently addressed in the program EIR, and there were no new impacts. Indeed, that is the function of a program EIR.
The court also found the EIR did not impermissibly defer formulation of mitigation measures, as it provided sufficient performance standards for future mitigation to meet. The court noted that the rule prohibiting deferred mitigation prohibits loose or open-ended performance criteria. Here, in contrast, the EIR's performance standards were sufficient to inform the Department what it had to do and accomplish, and committed the Department to mitigating impacts before proceeding with the enterprise. The performance standards were sufficient to ensure the aquatic biodiversity management plans would mitigate impacts in mountain lakes to insignificance. The Department also relied upon federal regulations to develop mitigation measures for impacts on anadromous fish.
The court held that the Department properly used the existing enterprise as the environmental baseline. The court rejected the Center's contention that the EIR must use the existing environmental conditions—absent the project—as the baseline. It noted that though the origin of present conditions may interest enforcement agencies, such information is irrelevant to CEQA baseline determinations. The CEQA baseline must include existing conditions even when those conditions have never been reviewed and are unlawful. Furthermore, despite using the existing enterprise as the baseline, the EIR described, as much as reasonably possible the impacts hatcheries and stocking have had statewide on the environment from the enterprise's inception more than a century ago, and proposed mitigation for those continuing impacts. Thus, the EIR did exactly what the Center sought.
Finally, the court held the EIR considered an adequate range of alternatives. For the no project alternative, the EIR considered the baseline project—continuation of the existing enterprise without making any changes. The court upheld this decision, noting that where the EIR is reviewing an existing operation or changes to that operation, the no project alternative is the existing operation; it is a factually based forecast of the environmental impacts of preserving the status quo. The court rejected the Center's argument that the no project alternative should have been the elimination of the stocking enterprise, stating that the EIR is not the approval of a new program, but review of an ongoing one. The Department was not required to analyze the alternative scenario of discontinuing its hatchery and production enterprise, as it had no legal authority to implement a no-stocking alternative.
Turning to the APA contentions, the court concluded that three mitigation measures imposed by the Department were underground regulations, i.e., regulations adopted without complying with the notice and procedure requirements imposed by the APA. The mitigation measures at issue were: MM BIO-226 (Implement Private Stocking Permit Evaluation Protocol), MM BIO-229 (Require and Monitor Invasive Species Controls at Private Aquaculture Facilities), and MM BIO-233b (Implement Private Stocking Permit Evaluation Protocol). The court found that the measures fell within the definition of a "regulation" and were not exempt from APA requirements. The court rejected the Department's argument that MM BIO-226 was exempt as a regulation relating "only to the internal management of the state agency," and that MM BIO-229 and MM BIO-233b were exempt as regulations that embody the "only legally tenable interpretation of a provision of law." In particular, the court concluded that MM BIO-226 required the Department to "perform a new duty" and MM BIO-229 imposed on a "class of persons a new affirmative duty." The court's application of the APA to mitigation measures in a state agency's EIR appears to be a first and could have far-reaching implications on other EIRs studying statewide activities.

redpajama_set_name: RedPajamaCommonCrawl


text:
The history of the Jews in Alaska began before the Alaska Purchase in 1867. Jews from Imperial Russia lived there periodically as fur traders, and a Jewish community has existed since the 1880s. The Klondike and Nome gold rushes attracted Jews to Alaska to seek their fortunes as miners and businessmen and resulted in the first organized Jewish communities. In the Nazi period, Jewish refugee resettlement in Alaska was seriously considered by the government, but after facing backlash, never came to be. Alaskan Jews played a significant role in business and politics before and after statehood, and have included mayors, judges, senators and governors. Today, there are Jews living in every urban area of the state.

Early history

In the 1850s and 1860s, during the time of the Russian America colony in Alaska, Russian Jewish fur traders working for the Russian-American Company had commercial ties with the Jewish community in San Francisco. After the United States purchased the Alaskan Territory from Russia in 1867, some San Francisco Jewish miners, merchants, fur dealers, and traders moved up to Alaska. At the formal transfer of sovereignty in Sitka, Jewish soldier Benjamin Levi (Levy) lowered the Russian flag and raised that of the United States. The following year, two Jews from San Francisco, Louis Sloss and Lewis Gerstle, helped found the Alaska Commercial Company. In 1885, the first permanent Jewish settlers, Robert Gottstein and his wife, moved to Juneau. They were followed by their son Jacob, who settled in Anchorage soon after it was founded. Jacob established a successful business (which would later merge with Carrs), while his wife, Anna, a teacher, helped found Alaska's first Parent-Teacher Association (PTA).

When the Klondike Gold Rush took off in 1897, a number of Jews were among the fortune seekers. At one point, up to 200 Jews were living in Dawson City, where the first Jewish religious services in the territory probably took place. Sid Grauman of Grauman's Chinese Theatre was among the Jews living in Dawson during this period, and spent his youth there with his family. A Jewish cemetery in Dawson that was created during the rush, Bet Chaim, was rediscovered in 1998.

Jews also ventured to the Nome Gold Rush that began in 1899. In 1900, Sam Bayles, brother of prominent Alaskan pioneer businessman Isadore "Ike" Bayles, arrived in Nome with the first Torah in Alaska. After hearing about the discovery of gold, 19 year old Max Hirschberg biked the  from Dawson to Nome in ten weeks, despite freezing temperatures and extreme weather.
Frontier lawman Wyatt Earp and his Jewish common-law wife Josephine Earp earned a fortune running their successful Nome-based saloon, The Dexter, during the peak of the rush. In 1900, around 60 Jews attended Rosh Hashanah services in Nome.

The Jewish community in Fairbanks was first organized by immigrant Robert Bloom in 1904. Between 1904 and 1910, during the Fairbanks Gold Rush, there were enough Jews to have regular High Holy Days services. In 1908, the Fairbanks community formally organized Congregation Bikkur Cholim, and the Clay Street cemetery still has a Jewish section dating back from this period. Following the gold rush, there were few Jews remaining in Fairbanks other than Robert Bloom and his wife, Jessie, who came from Ireland in 1912. They continued to be the driving force in the Fairbanks community, Jewish and otherwise, for decades. Jessie Bloom started the first Girl Scouts chapter in Alaska in 1925. Robert Bloom was among those who helped establish the base that became Fort Wainwright, and was among the founders of the University of Alaska. When World War II brought a number of Jewish GIs to the Fairbanks area, the Blooms acted as "unofficial chaplains" and opened their home to many service members.

Leopold David became the first mayor of Anchorage after it was legally incorporated in 1920.

1940s – 2000s

In 1939, Ernest Gruening was appointed governor of the Alaska Territory, a position he held until 1953. Often called "the father of Alaskan statehood", he lobbied and advocated intensely for Alaska to become a state. When it did, he became its first senator, elected to the United States Senate on November 25, 1958.

In 1906, Russian-Jewish immigrant and Fairbanks resident Abe Spring proposed that Jewish refugees fleeing Russian pogroms be settled in Alaska.  Spring's idea was soon rejected by the U.S. Congress and was not seriously considered for decades. Over 30 years later, in the face of Nazi persecution of Jews in Germany, a similar idea was considered. Following Kristallnacht, the Secretary of the Interior Harold L. Ickes proposed a Jewish settlement in Alaska with the aim of both building up Alaska and its industry and creating an opportunity to allow in more German Jewish refugees. The resulting Slattery Report and the introduction of a bill to make the idea possible were roundly rejected by the Alaskan public who did not think that such "aliens" would fit in well. While the bill died in subcommittee in 1940 and the plan never came to fruition, the subject garnered fresh interest in 2007 with the publication of the bestselling novel The Yiddish Policemen's Union by Michael Chabon.

During World War II, Jewish GIs were among the tens of thousands of service members who were stationed in Alaska. The Elmendorf Air Force Base near Anchorage retained a Jewish chaplain between the 1940s and 1980s, changing every two years and rotating between Reform, Conservative, and Orthodox leaders. In 1974, Alaska's only mikveh was established at Elmendorf Air Force Base for the Jewish chaplain's wife and the broader community. These chaplains often ended up serving the entire Jewish community in Alaska, travelling to cities, small towns, and outposts for a bar mitzvah or offering a learning opportunity. From the 1940s through the 1970s, Jewish military personnel outnumbered Jewish civilians in Alaska.

Zachariah "Zach" J. Loussac was the mayor of Anchorage from 1948 to 1951. A Jewish immigrant from Russia, he became a local philanthropist after selling his business and contributed greatly to Anchorage's first purpose-built library. While the library building he helped make a reality no longer exists, the main branch of the Anchorage public library system is still named in his honor.

The largest congregation in Alaska, Beth Sholom in Anchorage, was first formed in 1958 and became affiliated with the Reform movement in 1960. The congregation's small first synagogue was built in 1964 and was used for religious school classes and Shabbat services but not for the High Holy Days when larger facilities were required. As membership grew, a new larger synagogue was required and was opened for the congregation's 30th anniversary in 1988.

Jay Rabinowitz was a Justice on the Alaska Supreme Court for over thirty years, from 1965 to 1997, and was Chief Justice for 12 of those years. His tenure began during the first years of statehood when much of Alaska's constitution was untested, and many of the over 1,200 opinions (along with 200 dissents) he wrote while on the court have defined the legal structure governing Alaska. The Rabinowitz Courthouse in Fairbanks is named in his honor.

Avrum Gross served as the Alaska Attorney General from 1974 to 1980 while Jay Hammond was Governor, despite their differing personal politics.

The Jewish Congregation of Fairbanks was incorporated in 1980, started its summer rabbinic intern program in 1989, received a full-size Torah in 1991, and in 1992 purchased a synagogue building and became known as Congregation Or HaTzafon. In 1997, the congregation became officially affiliated with the Reform movement. It is possibly the northernmost permanent synagogue in the world.

Chabad emissaries, or shlichim, Yosef "Yossi" and Esty Greenberg arrived in Alaska in 1991 to set up a Chabad center in Anchorage and soon started prayer services and a preschool.

In the 1990s, the popular TV show Northern Exposure centered on a young Jewish doctor moving from New York to a fictionalized small town in Alaska.

Professor Bernard Reisman of Brandeis University conducted a demographic study of Jewish Alaskans 1994–1999. It found that contrary to popular assumption, the Alaska Jewish community was more, not less, affiliated on average than other Jewish Americans in the "Lower 48".

21st century
In 2005, Congregation Sukkat Shalom in Juneau opened its first synagogue after years of meeting in members' homes.

As of 2012, there are an estimated 6,000 Jews living in Alaska, most of whom reside in Anchorage, followed by Fairbanks, Juneau, and several smaller communities such as Sitka and Ketchikan. The Jewish community there often refers to itself as the "Frozen Chosen". There are presently two permanent rabbis in the state, both of whom are in Anchorage, Michael Oblath of Congregation Beth Sholom, and Yossi Greenberg of Chabad.

Anchorage mayor Ethan Berkowitz, who assumed office in July 2015, is the third Jew to serve in this position. Democrat Les Gara and Republican Jay Ramras are two other Jews prominent in state politics.

In 2013, Chabad's Alaska outpost, headed by Yossi and Esty Greenberg, opened a new campus in Anchorage that serves Alaskan Jews as well as visitors. The state's only mikveh is also on the campus, built after the one at Elmendorf Air Force Base was demolished in 1999. In addition, the Chabad center houses a preschool and the Alaska Jewish Museum, which showcases the ways that Jews have made an impact in Alaska and explores Jewish history, culture, and the Holocaust.

In 2016, Captain Michael Bram became the first Jewish chaplain at Joint Base Elmendorf–Richardson in 25 years.

Heritage monuments
There are at least four mountains named for Jews in Alaska: Mount Ripinski after Solomon Ripinski (Ripinsky), Mount Neuberger after Richard L. Neuberger, Mount Applebaum after Samuel Applebaum, and Mount Gruening for Ernest Gruening. Additionally, the Gerstle River was named for Lewis Gerstle.

References

External links

 Congregation Beth Sholom, Anchorage
 Lubavitch Jewish Center of Alaska, Anchorage
 Congregation Or HaTzafon, Fairbanks
 Congregation Sukkat Shalom, Juneau
 Alaska Jewish Museum
  Alaska Jewish Visitor Information

Alaska
Jews

redpajama_set_name: RedPajamaWikipedia


text:
The Two Popes movie review: Anthony Hopkins-Jonathan Pryce Netflix film is a charming affirmation of faith
Rohini Nair
Cast: Anthony Hopkins, Jonathan Pryce, Juan Minujín
Director: Fernando Meirelles
An early exchange in The Two Popes sees the cardinals Jorge Bergoglio and Benedict Ratzinger in a washroom; Pope John Paul II has just passed away and all the cardinals have gathered in Vatican City to elect his successor. As Bergoglio washes his hands, Benedict asks him of the tune he's whistling: "What hymn is that?" "Oh, it's 'Dancing Queen'," Bergoglio replies. "'Dancing Queen?'" Benedict asks, at a loss. "Yes, by ABBA," Bergoglio says. "ABBA?" Benedict, who clearly doesn't know about the pop quartet, wonders.
It's an interaction that quickly establishes the difference between the two men, both destined to be popes.
In the scene that follows — featuring red-robed cardinals walking down the stately white marble halls of the Vatican, shot with symmetrical precision — their differences become even more apparent. Benedict represents the old guard, a watch-guard of dogma who thinks the Catholic Church must remain unchanging in a changing-beyond-all-recognition world. Bergoglio, on the other hand, represents reform, a spiritual leader of and among the people.
And yet, as becomes evident over the course of the events depicted in the film, for all their differences in personality, ideology and outlook, Benedict and Bergoglio are also bound by their love for and submission to God.
The bulk of The Two Popes' narrative is spread over two days, with the events that preceded and followed those two days (namely, the ascension of first Ratzinger and then Bergoglio as Pope Benedict XVI in 2005 and Pope Francis in 2013, respectively) acting as bookends. The two days in question occur when a disillusioned Bergoglio, years after the election of Benedict as Pope, decides to turn in his resignation. He meets with the Pope in Rome, and is whisked away to his summer residence, where Benedict entirely avoids accepting or discussing Bergoglio's resignation.
Anthony Hopkins and Jonathan Pryce in a still from The Two Popes | Netflix
Instead, they walk through the gardens, discussing Bergoglio's position on various issues (same sex marriage, celibacy for the clergy, punitive measures against priests found guilty of sexual abuse) — all of which Pope Benedict disagrees with, incidentally. Over the course of the evening, however, they begin to find common ground, each speaking of how they communicate with God, and of receiving their calling.
Their meeting occurs at a time when the Church is mired in controversy; the fall-out of the "Vati-Leaks" scandal intrudes on their time together, with Benedict being called away to Vatican City urgently. Benedict and Bergoglio's conversations continue there, with each sharing deeply shameful chapters from their past, before Benedict tells him why he won't accept his resignation: he wants to step down as Pope, and have Bergoglio succeed him.
It's a historic moment: Popes don't resign, although Benedict points to Pope Celestine V in 1294 and Pope Gregory XII in 1415 as precedents for papal renunciation. Amid Bergoglio's protestations, Benedict insists that a change of the guard is due.
By the time the men part, there is a genuine affection, an unlikely friendship that has sprung up between them, partly due to Bergoglio's charm but also because Benedict sees in the younger man something he feels he has recently lost: a closeness with God.
Did anyone expect Anthony Hopkins and Jonathan Pryce to be anything less than spellbinding in their roles? Hopkins plays Benedict by combining physical frailness with a steely resolve; the Pope's health may be failing, but his convictions about the Church's role are not. Pryce's Bergoglio is the perfect foil to Hopkins' Benedict, a man of the people, at ease with himself and able to make friends wherever he goes. Each so different, each so compelling as they spar, then bond.
Even aside from the performances, The Two Popes is an unadulterated pleasure to watch. Every frame is designed with care: sunlight falling into a room just so, the geometry of how characters are positioned within a space. The Vatican sequences, in particular, are gorgeous: the electing of the Pope brings together colour, sound and movement like a choreographed routine that would please even the most exacting of aesthetes. Writer Anthony McCarten (The Theory of Everything, Darkest Hour, Bohemian Rhapsody) and director Fernando Meirelles (City of God) turn the former's play into a piece of cinematic art, while also imbuing it with deep reserves of humour, emotion and warmth.
The Two Popes doesn't shy away from the Church's many failures, or its gross role in perpetuating child sexual abuse. By placing these deeply contrasting personalities together, with their imagined conversations, The Two Popes shows a Catholic Church at the crossroads, and the choices it must make to stay relevant to 1.2 billion people around the globe. The film's release comes just months after the former pontiff wrote a letter expressing his views on the problem of sexual abuse among the clergy, which was seen as a challenge to Pope Francis' position, and the differences in their respective ideologies haven't exactly faded away.
The Two Popes, however, chooses to end on a hopeful note; a quiet, charming film that's a reaffirmation of faith.
The Two Popes is currently streaming on Netflix. Watch the trailer here —
tags: Anthony Hopkins , Buzz Patrol , BuzzPatrol , Cardinal Benedict Ratzinger , Cardinal Jorge Bergoglio , Catholic Church , Fernando Meirelles , Fernando Meirelles movies , FWeekend , Hollywood , Jonathan Pryce , Movie review , MovieReview , Pope Benedict XVI , Pope Francis , The Two Popes , The Two Popes movie review , The Two Popes Netflix , The Two Popes review , Vatican City
The Grudge movie review: Nicolas Pesce can do only so much to revive a franchise that never had any potential
Like A Boss movie review: Salma Hayek has never been this forgettable than in this big bowl of nothingness
Dolittle movie review: Robert Downey Jr tries too hard, fully aware he's signed up for a tonally inconsistent train wreck
1The Two Popes movie review: Anthony Hopkins-Jonathan Pryce Netflix film is a charming affirmation of faith


On November 1, President Trump formally did away with a Consumer Financial Protection Bureau (CFPB) arbitration rule that would have given consumers the opportunity to file class actions against banks and other companies in the financial services industry.
The CFPB rule was released in July 2017. It sought to prohibit and eliminate bans against class actions that had become a staple of arbitration clauses in consumer financial agreements.
Join us on Thursday, June 15th from 12:00PM to 1:00PM for an in-depth webinar as Philip R. Stein, a partner in Bilzin Sumberg's Litigation Practice, and Ray Vasquez, a director in Enterprise Risk Management's Cybersecurity and IT Risk Management practice, discuss primary cybersecurity risks and leading practices.
They will discuss the reasons why a business may be targeted by cybercriminals, steps that can be taken to better safeguard private data, and fiduciary or professional responsibility obligations associated with protecting confidential information. Learn about best practices following a data breach, including certain actions that should be part of a company's response.
Click here to register for this CLE-accredited webinar.
Thousands of mortgage lenders across the country either recently received, or will soon be receiving, this document from Lehman Brothers Holdings, Inc. (LBHI). It is a notice of a motion to approve a proposed settlement of Residential Mortgage-Backed Securities (RMBS) claims asserted by trustees and investors against LBHI over the last few years. The notice of proposed settlement refers to proposed findings of fact, sets a deadline (June 22) for objections to the settlement, and schedules a hearing date (July 6) for approval of the RMBS settlement.
For those who have been wondering—as I did in a previous post—what the new presidential administration would mean for the Consumer Financial Protection Bureau (CFPB), an agency that has been in Republicans' crosshairs virtually since it came into existence, we now have at least the beginnings of a concrete answer. Claiming that the CFPB's leadership structure is unconstitutional, the Trump administration asked the U.S. Court of Appeals for the D.C. Circuit last week to allow the president to fire the bureau's director, Richard Cordray, at will. The administration did not go so far as to ask the court to authorize elimination of the agency, however.
Wednesday, February 1 brought a welcome development for the many correspondent lenders currently defending against claims filed by (or threatened with future lawsuits by) Residential Funding Company ("RFC") and its successor-in-interest, the ResCap Liquidating Trust ("ResCap"). There have been three venues in which RFC and ResCap have been litigating, for years now, against correspondent lenders. They filed dozens of lawsuits in federal court in Minnesota, several more in the Bankruptcy Court for the Southern District of New York, and just a few in state court in Minnesota. On February 1, three state court defendants triumphed on their motion for partial summary judgment against RFC and ResCap. They obtained a ruling that, though limited in scope, is potentially of great significance. Specifically, the Minnesota state court (the District Court of Hennepin County) held that RFC and ResCap would not be able to pursue loan-level (i.e., loan-by-loan) damages associated with a repurchase claim, and thus could not apply a repurchase price "formula" to establish damages.
The Consumer Financial Protection Bureau (CFPB) will likely be weakened by the incoming Trump administration and its Republican allies in Congress. Exactly how, and how much, remains to be seen, however—and, in the meantime, the agency continues to make its presence felt. Earlier this week, the CFPB warned companies that it oversees to take steps to ensure that their incentive compensation programs are not likely to motivate unethical conduct by employees. The types of unethical conduct that the CFPB wants to ensure that companies are guarding against might include employees creating fake accounts, as happened at Wells Fargo & Co., or enticing consumers to sign up for products they neither want nor need. But the CFPB made clear in its warning to companies that its concerns over sales practices go beyond situations similar to Wells Fargo's fake account scandal. In other words, as has at times been the case with the CFPB, it is casting a broad net, but not necessarily saying what specifically it intends to catch with that net.
After the Dodd-Frank Wall Street Reform and Consumer Protection Act of 2010 authorized its creation, the Consumer Financial Protection Bureau (CFPB) began operating on July 21, 2011. In the more than five years since it opened its doors, the CFPB has rarely appeared shy or hesitant about asserting its authority. Critics—most often the businesses over which it exercises jurisdiction, or proponents of "limited government"—in fact have assailed the agency as a prime example of allegedly unaccountable bureaucrats run amok. Still, few steps taken by the CFPB have aroused its critics' ire as much as its now-pending proposal to stop banks and other financial firms from placing class action bans in consumer contracts.


text:
Mike Williams
Mike Williams, WR (LAC)
Nets game-winning TD
Williams caught five of six targets for 97 yards and a touchdown in the 41-37 win over the Steelers on Sunday.
Williams had essentially been shut down for most of evening until the team's final possession when Justin Herbert beautifully identified a corner blitz and lofted a pass to the big-bodied target, setting up a 53-yard catch-and-run touchdown which put the Chargers on top for good. After a blazing start to the season, Williams has been directly tied down to the offensive struggles over the last four weeks and while Sunday's outing may look good on the surface, it took until the final drive for the 27-year-old to cross 50 yards receiving for just the second time since Week 5. Up next is a difficult matchup against a gamey Broncos secondary.
More Los Angeles Chargers Fantasy Football News
RB | LAC
Best season to date
Jackson carried the ball three times for 20 yards in Sunday's 35-32 overtime loss to the Raiders. The fourth-year back finished the season with 68 carries and 364 rushing yards to go along with 22 receptions and 178 receiving yards. He also compiled two rushing touchdowns.
Joshua Palmer
WR | LAC
Scores in season finale
Palmer caught four of his nine targets for 45 yards and a touchdown in Sunday's 35-32 overtime loss to the Raiders. The rookie finished the 2021 season with 33 receptions for 353 yards and four touchdowns.
Jalen Guyton
Excels in final game
Guyton caught six of his nine targets for 52 yards in Sunday's 35-32 loss to the Raiders. The third-year wide receiver finished the season with 31 receptions for 448 yards and three touchdowns in 16 games.
TE | LAC
Finishes season with 48 catches
Cook tallied four receptions on seven targets for 80 yards in Sunday's 35-32 overtime loss to the Raiders. The veteran tight end finished the 2021 campaign with 48 receptions for 564 yards and four touchdowns in 16 games.
Held in check in loss
Allen recorded six receptions for 52 yards on eight targets in Sunday's 35-32 overtime loss to the Raiders.
Incredible fourth QT comes up short
Williams registered nine receptions for 119 yards and a touchdown across 17 targets in Sunday's 35-32 overtime loss to the Raiders.
Austin Ekeler
Two TDs caps off historic season
Ekeler registered 16 carries for 64 yards and also caught five of his 12 targets for 35 yards to go along with two total touchdowns in Sunday's 35-32 overtime loss to the Raiders.
QB | LAC
Fourth-down heroics not enough
Herbert completed 34 of 64 pass attempts for 383 yards and three touchdowns to go along with one interception in Sunday's 35-32 overtime loss to the Raiders.
Comes off COVID list
The Chargers activated Cook (illness) from the reserve/COVID-19 list Wednesday, Daniel Popper of The Athletic reports.
Set to come off COVID list
Chargers head coach Brandon Staley said Wednesday that Cook (illness) is in line to come off the reserve/COVID-19 list, Jeff Miller of the Los Angeles Times reports.


text:
Dorylus aethiopicus é uma espécie de formiga do gênero Dorylus.

Referências

aethiopicus
Espécies descritas em 1895


text:
Q: Select the latest client record from query with many joins I have a query with many joins and I am trying to select the latest client record from it. This is the query I have but it is giving me all records of the client:

EDIT:

SELECT ca.CA_ID, ca.CLIENT_ID, ca.CA_STATUS_TYPE, ca.CREATED_BY, MAX(ca.CREATED_DATE), ca.UPDATED_BY, MAX(ca.UPDATED_DATE), ca.CA_REFERENCE_NUMBER,
cl.SOURCE_SYSTEM_CODE, catchment.EST_CATCHMENT_AREA,  catchment.SERVICE_PROVIDER_NAME, sds.SDS_NAME, sds.SDS_ADDRESS_TEXT, u.CA_USER_TYPE "USER TYPE",

CASE WHEN ca.REFERRED_IND = 1 THEN 'REFERRED' ELSE 'NOT REFERRED' END REFER_TYPE
FROM CA ca
JOIN(
     SELECT TOP 1
     CLIENT_ID, MAX(CREATED_DATE) CREATED_DATE
     FROM CA
     GROUP BY
     CLIENT_ID
     ORDER BY
     MAX(CREATED_DATE)
     ) maxclient
     ON maxclient.CLIENT_ID = ca.CLIENT_ID
     AND maxclient.CREATED_DATE = ca.CREATED_DATE
LEFT JOIN CLIENT cl
ON ca.CLIENT_ID = cl.CLIENT_ID
LEFT JOIN (
    SELECT * FROM CATCHMENT_AREA catchment LEFT JOIN SERVICE_PROVIDER sp ON sp.SERVICE_PROVIDER_ID = catchment.SERVICE_PROVIDER_ID
  ) catchment ON ca.CATCHMENT_ID = catchment.CATCHMENT_ID
LEFT JOIN SERVICE_DELIVERY_SITE sds
ON ca.SERVICE_DELIVERY_SITE_ID = sds.SERVICE_DELIVERY_SITE_ID
LEFT JOIN USER u
ON ca.CREATED_BY = u.CA_USER_ID
WHERE (ca.CREATED_DATE) BETWEEN TO_DATE('2021-01-04', 'yyyy-mm-dd') AND TO_DATE('2021-01-08', 'yyyy-mm-dd')

A: Oracle don't have the top clause:
If you want the max created date from all est_ca_client_id you do:
select est_ca_client_id, max(created_date) created_date
  from ca_cdr.est_ca
  group by est_ca_client_id

But if you want the last est_ca_client_id from the created_date, assuming you don't have clients created in the same second you can do something like:
select est_ca_client_id
  from ca_cdr.est_ca
 where created_date = (select max(created_date)
                         from ca_cdr.est_ca)

redpajama_set_name: RedPajamaStackExchange


text:
#pragma once

#include <fmt/format.h>

#include "item.hpp"
#include "screens/base.hpp"

/*
 * Interface-wise, this will be like opening an email for reading in mutt.
 * A thread will be spawned to fetch more info about the item from some
 * database, and the bookwyrm will print that info in this window in a pretty
 * way.
 *
 * The user should still be able to check another item's details while this
 * thread is running. Item details will be kept in the actual item. So a passed
 * item will be modified, otherwise, if the user goes back to an item, we'll
 * need to fetch the data again.
 *
 * The user doesn't need to exit the detail screen to select another item for
 * details. Implementing this is a problem for the future, though.
 */
namespace bookwyrm::tui::screen {

    class item_details : public base {
    public:
        explicit item_details(const core::item &item, int padding_top);

        void paint() override;

        std::string controls_legacy() const override;

    private:
        const core::item &item_;

        void print_borders();
        void print_details();
    };

} // namespace bookwyrm::tui::screen


Muslim preacher says that, according to Islamic law, the 'Palestinian right of return' passes from one generation to the next.
Citing Islamic law, Sheikh Ikrima Sabri, head of the Supreme Muslim Council in Jerusalem, rejected any possibility of Palestinian Arab concession on the so-called "right of return" of fourth generation Palestinian Arab "refugees."
In a sermon delivered at the Al-Aqsa Mosque on February 2, Sabri said that the "Palestinian refugees" had the right to return to their homes in "the 1948 territories," according to the Palestinian Arab newspaper Felesteen.
"The refugee is the one who was expelled from his home and his land and the term refugee applies to the children and grandchildren, and that is the religious Islamic meaning [of the word refugee], because the rights of the refugee and his property exist and hold in future generations via inheritance according to Islamic law," Sabri said.
UNRWA must exist until the "Palestinian refugees" and their descendants return to their homes, Sabri said, adding that the US decision to cut aid to the organization was expected in light of the existing "plot to eliminate the Palestinian problem." As such, he said that Arab and Islamic countries should transfer financial aid to UNRWA.
He attacked "Judaization" efforts in Jerusalem, asserting that these were "illegal" activities and that the Palestinians Arabs would not recognize them since the city of "Al Quds" is an "occupied" city. "The Al-Aqsa Mosque belongs only to Muslims," he said.


At the dental offices of Dr. Yolonda Cruz in Toronto, we offer porcelain and composite inlays and onlays. Dental inlays and onlays are premolded, custom fit fillings that fit into the grooves of your tooth. These dental restorations repair the chewing surface of the tooth and are nearly invisible, if made from tooth colored material. Manufactured in a lab, they can be made from porcelain, composite resin or even gold. Dental inlays and onlays are usually more durable than regular fillings. An inlay does not extend over the cusps of the tooth, while an onlay extends onto the chewing surface of a back tooth to replace one or more cusps. An onlay is used to repair a tooth that has more extensive damage affecting the cusp or the tooth's biting surface.
The process of installing an inlay or onlay is very similar to the installation of a dental crown. First, Dr. Yolonda Cruz will numb your gum using a local anesthetic and clean the decay from your tooth. Next, Dr. Cruz will take an impression of the tooth and send to a lab. While the dental restoration is being fabricated, Dr. Cruz will place a temporary filling into the space in order to protect your tooth from fracture or further deterioration. Once the inlay or onlay is back from the lab, Dr. Cruz will fit the restoration into place and bond it to the natural tooth.
After the restoration is complete, it is normal to experience some minor discomfort, normally at the site of the anesthetic or at the tooth itself. To alleviate the discomfort, our dental office may recommend on taking an over the counter pain medication such as Advil. If your symptoms persist for more than few days, you should call one of our Toronto dental offices: Downtown office 416-595-5490 or Etobicoke office 647-951-8888.
You should treat your inlay or onlay like your natural teeth by maintaining proper oral hygiene and diet. Avoid habits that can wear down or damage your restoration such as chewing ice, cracking nuts with your teeth or excessive gum chewing.


As it would happen, the innovators in luxury cruising, Costa Cruising, have busted out the worlds leading golf simulator.
Guests on the Costa Luminosa and the Costa Deliziosa can work on their short game using the customised putting green, which is just a chip away from the simulator. Situated near the top of the ship on Deck 10, the practice area is approximately 100 m2 and features six different holes. The ultra-light synthetic turf and special construction techniques provide true ball roll and make this putting green realistic for the discerning golfer.
In addition to the onboard golfing experience, the Costa Deliziosa and Costa Luminosa have introduced itineraries featuring stops at resorts with actual courses and dedicated golfing excursions.
In the 2010 (northern) summer season, both vessels' Northern European trips include tours to world-class golf courses from the two main Norwegian ports: the Baerum GolfKlub Oslo and the Meland Golf Club in Bergen.
The Costa Deliziosa offers two regular seven-day cruises: the first to the Northern Fjords departing from Copenhagen (Denmark) with stopovers in Flam, Hellsylt, Geiranger, Bergen, Stavanger and Oslo (Norway).
The second itinerary also operates out of Copenhagen and takes in the Baltic cities with port calls at Tallinn (Estonia), St. Petersburg (Russia), Helsinki (Finland) and Stockholm (Sweden).
The Costa Luminosa is deployed on two regular 11-day itineraries: the first goes to the Baltic cities with departure from Amsterdam (Netherlands) and calls at Copenhagen (Danimarca), Stockholm (Sweden), Helsinki (Finland), St. Petersburg (Russia) and Tallin (Estonia).
The second cruise sails to North Cape from Amsterdam, and includes stopovers in Hellsylt, Geiranger, Honningsvag, Tromso, Giavdal, Trondheim, Andalsanes and Bergen (Norway). There is also an exclusive 20-day cruise to Greenland onboard the Costa Luminosa.
Next (northern) winter on their Arabian Gulf cruises, the Costa Deliziosa and the Costa Luminosa will be offering tours to famous golf clubs in Dubai and Abu Dhabi; a session on the practice range followed by a round on lush courses carved out of the desert against a backdrop of sea, endless beaches and luxury hotels.
Cruisers who choose the Mediterranean routes on one of the other Costa ships can take excursions to the Do Santo Da Serra Golf Club in Funchal, Madeira (Portugal), the Costa Teguise Golf Club in Lanzarote (Spain) and the Glyfada Golf Club of Athens amongst others.


text:
Web-Series
The Dripped On The Road Spring 2017 Program was a month long trip that visited 6 cities, painted 9 murals, hosted 3 artist talks and camped in 5 State and National Parks and Forrests.
Resident artists were Lauren Asta and Kit Mizeres hosted by DOTR directors Denton Burrows, Ramiro Davaro-Comas and Jonathan Neville. Documenting the journey was DOTR videographer Lisa Bolden of Elixir Motion Picture.
The Program visited Washington DC, Asheville NC, Nashville TN, Florence AL, Atlanta GA, Bethlehem PA and hosted a gallery exhibition in New York City.
April 2nd - April 6th
The first stop after departing NYC was the nation's capital, Washington DC. The team had a full schedule with three murals planned across the city.
The first mural was for Pabst Blue Ribbon in the well-known bar, The Pinch, on 14th Street NW and Parkwood Place NW. Ramiro Davaro-Comas, Denton Burrows, Kit Mizeres and Lauren Asta collaborated on a black & white mural in the venue's performance space. For two days the artists worked non-stop transforming a once white, bland wall into a masterpiece that reflects The Pinch's persona.
Washington DC Part 2
Next in DC, the program headed over to The Fridge Gallery, a gallery focused on street art and community events on Barracks Row in the historic Eastern Market neighborhood to collaborate on a large mural on the gallery's facade. The Fridge is a neighborhood staples that has some of the best art exhibits in DC. Alex, the owner, lives there with his amazing dog Bongo and each morning they greeted the program with coffee and donuts!
During the Fridge Gallery mural, Ramiro and Jonathan Neville headed over to DOTR sponsor Artist & Craftsman Supply to paint a small mural on the entrance to the store. The A+C crew was friendly and psyched to work with the DOTR Directors.
April 7th - April 8th
Gatewood Park, VA
After DC, the Program packed up the supplies in the RVs and hit the road for a few nights in George Washington & Jefferson National Forest before the next city and mural in Asheville North Carolina. The first campground the Program stayed in was a riverside campsite in Gatewood Park, a 6 mile drive into the mountains. Gatewood park had about 15 RV sites and was next to a bald eagle's nest.
Overnight there was a wind and hailstorm and the team awoke to flurries in the morning. A little coffee made on the DOTR sponsor BioLite stove and the artists were back on the road headed to the next campground.
The crew arrived to their next mural location, the Desoto Lounge in Asheville NC and parked the RVs in the lot behind behind the bar. The owners and DeSoto staff greeted the crew with open arms and kept them fed with delicious fried chicken sandwiches and homemade meals.
The Asheville Pabst Blue Ribbon rep, Alex, brought the crew out to amazing local restaurants and bars to eat dinner and responsibly enjoy PBR.
The DOTR crew painted a black and white mural spanning two walls based on PBR cans and DeSoto Lounge's mascot, the ConquistaDeer. Overall, Asheville is a great place to visit!
April 10th -April 14th
Nashville was a lively stop. The program partnered with Pabst Blue Ribbon painting two enormous murals on the side and on the parking lot fence of The Crying Wolf, a great bar in East Nashville. The owners of The Crying Wolf allowed the program to park and stay on their property conveniently located down the road from the bar.
The days were hot and humid but with the assistance of two articulated boom lifts the crew was able complete the mural while still experiencing the amazing cultures Nashville has to offer from the honky tonks to BBQ.
On the final day, as the crew packed up the supplies and took photos, the owner of a restaurant across the street, Butcher & Bee, invited the crew to have their final meal in Nashville at the restaurant. The crew was treated to a table full of delicious Middle Eastern inspired dishes. The staff's kindness was a true example of southern hospitality.
April 14th- April 16th
In Florence Alabama, the program stayed with DOTR friends and tattoo artists, Ulyss Blair and Eva Jean at a beautiful lakeside residence. The tranquil space afforded the program a much-needed opportunity to work on their artwork for the gallery exhibition at the end of the program. The program explored Florence stumbling into an amazing concert by the grammy winning blues musician Alvin Youngblood Heart. A Mississippi legend.
Ulyss and Eva took great care of the crew and had an awesome dog named Tater that kept the DOTR dog Yuki company. The house the crew stayed in was out of a movie providing photo shoot opportunities in every room at every moment.
Ulys and Eva competed on Spike TV's Ink Master Season 9 and run their own tattoo parlor, Allegory Arts.
April 17th - April 20th
DOTR returned to one of our favorite cities, Atlanta. The Atlanta PBR rep, Luis, hosted the Program in his cul-de-sac and as he is known to do, made sure they experienced the city.
The program was in Atlanta for four days in which Lauren Asta, Ramiro Davaro-Comas and Kit Mizeres collaborated on a PBR mural for The Graveyard, a bar and music venue in East Atlanta Village.
Directors Denton Burrows, Ramiro Davaro-Comas and Jonathan Neville hosted an artist talk and website building workshop with DOTR Sponsor Wix.com at the Facet Gallery. Facet Gallery was one of the most beautiful galleries the crew visited in Atlanta. A two story gallery space with beautiful exposed wood beams and a front yard blooming with flowers.
On the drive from Atlanta GA to Bethlehem PA the program camped in three state parks Lake Norman State (NC), Lake Anna State Park (Va.) and one in Pennsylvania.
The RVs pulled into Lake Norman State Park in the late afternoon, cooked dinner and told ghost stories over the campfire. The following day they took photos, spent time drawing and explored the park and lake before hitting the road to North Carolina.
Driving through Virginia was beautiful and Lake Anna State Park lived up to our expectations and hopes. Not only was the park beautiful but the Park Rangers were very informative and kind, inviting the crew to participate in a gold panning class on the lake. While the crew did want to find gold, Lake Anna was a perfect setting to keep working on the artwork for the gallery exhibition.
The crew spent the night in the Pennsylvania State Park. The grounds and facilities were nice, however the night was eerily quiet
April 25th-April 30th
The Program spent five days in Bethlehem PA partnering with the local non-profit ArtsQuest and Lehigh University for the Southside Arts & Music Festival. The program had a busy schedule as they were set to paint a 3-story mural (45'x34'), host a youth mural workshop as well as host an artist talk and website building workshop with Wix.com. The RVs parked in their usual Bethlehem location behind the beautiful abandoned steel stacks, an iconic Bethlehem landmark.
The Program worked closely with Bethlehem's Historical Commission, Arts Commission, Parking Lot Commission and ArtsQuest to make certain that the proposed mural reflected Bethlehem's rich history and culture. The mural draws inspiration from Rosie the Riveter, photographs from the 1920s of steel workers and local Bethlehem imagery and insignias.
The Bethlehem community rallied around the mural and the owner of the building invited the crew to have dinner at his restaurant, a Victorian mansion repurposed in 1980 into a Euro-Asian café. The setting was a moment captured in the Victorian Age and the food was amazing.
On the last night in Bethlehem and of the Program, the crew was invited to Lehigh University professor and DOTR advocate and friend for a good-bye dinner. The night was full of great conversations, silly art games, great conversations and reflection.
Bethlehem was an amazing end to an amazing DOTR Spring '17 Program
April 30th-May 4th
The Program arrived back in New York with three days to prepare for the "End of The Road" exhibition on May 4th. The exhibition was held at 287 Bleecker Street hosted by Cami Ledy and All Mad Here productions.
Lauren Asta showed approximately 40 illustrations based on phrases said during the trip and people she encountered at Wal-Marts during the trip. Kit Mizeres installed four framed illustrations, an impressive feat considering two works were destroyed, one ending up in an Alabama lake. Jonathan Neville created an entire new company, Street Art Succulents, repurposing the aerosol cans used during the trip into planters for succulents. Denton Burrows exhibited two detailed illustrations inspired by the trip. Ramiro Davaro-Comas installed nine illustrations inluding pieces on wood and on paper sown together with hemp chord framed by wooden sticks found in state parks visited during the trip. Lisa Bolden showed a video installation as well as her photography from the different locations the Program visited.
The exhibition saw approximately 200 guests and sold a majority of the artwork.
© 2019 by Dripped On The Road