text:
namespace TwitterBackup.Services.Tests
{
    using System.Linq;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using TwitterBackup.Services.Tests.TestObjects;
    using TwitterBackup.Models;
    using TwitterBackup.Services.Exceptions;

    [TestClass]
    public class RetweetServiceTests
    {
        private FakeMemoryRepository<Retweet> retweetRepo;
        private RetweetService retweetService;

        [TestInitialize]
        public void Init()
        {
            this.retweetRepo = new FakeMemoryRepository<Retweet>();
            this.retweetService = new RetweetService(retweetRepo);
        }

        #region Save

        [TestMethod]
        public void Population_ShouldPopulateDatabaseCorrect()
        {
            var retweetTwitterId = 10023012321;
            var createdById = 123465798;
            var createdByScreenName = "Gosho";
            var twitterOwnerId = 4433668899;
            this.retweetService.Save(retweetTwitterId, createdById, createdByScreenName, twitterOwnerId);
            var storedTweet = this.retweetRepo
                .All()
                .Where(retweet => retweet.ReweetTwitterId == retweetTwitterId)
                .FirstOrDefault();

            Assert.IsNotNull(storedTweet);
            Assert.AreEqual(createdById, storedTweet.CreatedById);
            Assert.AreEqual(twitterOwnerId, storedTweet.TweetOwnerId);
        }

        [ExpectedException(typeof(RetweetException))]
        [TestMethod]
        public void DoubleAddingSameRetweet_ThrowException()
        {
            var retweetTwitterId = 10023012321;
            var createdById = 123465798;
            var createdByScreenName = "Gosho";
            var twitterOwnerId = 4433668899;

            this.retweetService.Save(retweetTwitterId, createdById, createdByScreenName, twitterOwnerId);
            this.retweetService.Save(retweetTwitterId, createdById, createdByScreenName, twitterOwnerId);
        }

        [TestMethod]
        public void DoubleAddingSameRetweetWithDiffrentCreator_ShouldWork()
        {
            var retweetTwitterId = 10023012321;
            var createdByIdOne = 123465798;
            var createdByIdTwo = 9876543211;
            var createdByScreenNameOne = "Gosho";
            var createdByScreenNameTwo = "Vase";
            var twitterOwnerId = 4433668899;

            this.retweetService.Save(retweetTwitterId, createdByIdOne, createdByScreenNameOne, twitterOwnerId);
            this.retweetService.Save(retweetTwitterId, createdByIdTwo, createdByScreenNameTwo, twitterOwnerId);
        }

        #endregion Save

        #region GetTotalRetweetsCount

        [TestMethod]
        public void AddSomeRetweets_GetCorrectCount()
        {
            var retweetTwitterIdOne = 10023012321;
            var retweetTwitterIdTwo = 10023012322;
            var createdByIdOne = 123465798;
            var createdByIdTwo = 9876543211;
            var createdByScreenNameOne = "Gosho";
            var createdByScreenNameTwo = "Vase";
            var twitterOwnerId = 4433668899;
            this.retweetService.Save(retweetTwitterIdOne, createdByIdOne, createdByScreenNameOne, twitterOwnerId);
            this.retweetService.Save(retweetTwitterIdOne, createdByIdTwo, createdByScreenNameTwo, twitterOwnerId);
            this.retweetService.Save(retweetTwitterIdTwo, createdByIdOne, createdByScreenNameOne, twitterOwnerId);
            this.retweetService.Save(retweetTwitterIdTwo, createdByIdTwo, createdByScreenNameTwo, twitterOwnerId);

            var retweetsCount = this.retweetService.GetTotalRetweetsCount();
            Assert.AreEqual(4, retweetsCount);
        }

        [TestMethod]
        public void DontAddRetweets_GetCorrectCount()
        {
            var retweetsCount = this.retweetService.GetTotalRetweetsCount();
            Assert.AreEqual(0, retweetsCount);
        }

        #endregion GetTotalRetweetsCount

        #region GetRetweets

        [TestMethod]
        public void AddSomeRetweets_GetCorrectCollection()
        {
            var retweetTwitterIdOne = 10023012321;
            var retweetTwitterIdTwo = 10023012322;
            var createdByIdOne = 123465798;
            var createdByIdTwo = 9876543211;
            var createdByScreenNameOne = "Gosho";
            var createdByScreenNameTwo = "Vase";
            var twitterOwnerId = 4433668899;
            this.retweetService.Save(retweetTwitterIdOne, createdByIdOne,createdByScreenNameOne, twitterOwnerId);
            this.retweetService.Save(retweetTwitterIdOne, createdByIdTwo, createdByScreenNameTwo, twitterOwnerId);
            this.retweetService.Save(retweetTwitterIdTwo, createdByIdOne, createdByScreenNameOne, twitterOwnerId);
            this.retweetService.Save(retweetTwitterIdTwo, createdByIdTwo, createdByScreenNameTwo, twitterOwnerId);

            var retweetsCollection = this.retweetService.GetRetweets();
            Assert.IsNotNull(retweetsCollection);
            Assert.AreEqual(4, retweetsCollection.Count());

            var firstElement = retweetsCollection.FirstOrDefault();
            Assert.IsNotNull(firstElement);
            Assert.AreEqual(10023012321, firstElement.ReweetTwitterId);

            var lastElement = retweetsCollection.LastOrDefault();
            Assert.IsNotNull(lastElement);
            Assert.AreEqual(10023012322, lastElement.ReweetTwitterId);
        }

        [TestMethod]
        public void DontAddRetweets_GetCorrectCollection()
        {
            var retweetsCollection = this.retweetService.GetRetweets();
            Assert.IsNotNull(retweetsCollection);
            Assert.AreEqual(0, retweetsCollection.Count());

            var firstElement = retweetsCollection.FirstOrDefault();
            Assert.IsNull(firstElement);
        }

        #endregion GetRetweets

        //#region GetRetweetsCountForFriend

        //[TestMethod]
        //public void AddSomeRetweets_GetCorrectCollectionOfTweetsForGivenFriend()
        //{
        //    var retweetTwitterIdOne = 10023012321;
        //    var retweetTwitterIdTwo = 10023012322;
        //    var retweetTwitterIdThree = 10023012323;
        //    var createdByScreenNameOne = "Ivan";
        //    var createdByScreenNameTwo = "Petar";
        //    var twitterOwnerScreenNameOne = "Maria";
        //    var twitterOwnerScreenNameTwo = "Gergana";

        //    this.retweetService.Save(retweetTwitterIdOne, createdByScreenNameOne, twitterOwnerScreenNameOne);
        //    this.retweetService.Save(retweetTwitterIdTwo, createdByScreenNameOne, twitterOwnerScreenNameOne);
        //    this.retweetService.Save(retweetTwitterIdThree, createdByScreenNameOne, twitterOwnerScreenNameTwo);
        //    this.retweetService.Save(retweetTwitterIdOne, createdByScreenNameTwo, twitterOwnerScreenNameOne);
        //    this.retweetService.Save(retweetTwitterIdTwo, createdByScreenNameTwo, twitterOwnerScreenNameOne);

        //    var retweetsForFirstCreatorFirstOwner = this.retweetService.GetRetweetsCountForFriend(createdByScreenNameOne, twitterOwnerScreenNameOne);
        //    var retweetsForFirstCreatorSecondOwner = this.retweetService.GetRetweetsCountForFriend(createdByScreenNameOne, twitterOwnerScreenNameTwo);
        //    var retweetsForSecondCreatorFirstOwner = this.retweetService.GetRetweetsCountForFriend(createdByScreenNameTwo, twitterOwnerScreenNameOne);
        //    var retweetsForSecondCreatorSecondOwner = this.retweetService.GetRetweetsCountForFriend(createdByScreenNameTwo, twitterOwnerScreenNameTwo);

        //    var retweetsForNonExistingCreatorAndOwner = this.retweetService.GetRetweetsCountForFriend(9156357147, 753159963321);

        //    Assert.AreEqual(2, retweetsForFirstCreatorFirstOwner);
        //    Assert.AreEqual(1, retweetsForFirstCreatorSecondOwner);
        //    Assert.AreEqual(2, retweetsForSecondCreatorFirstOwner);
        //    Assert.AreEqual(0, retweetsForSecondCreatorSecondOwner);
        //    Assert.AreEqual(0, retweetsForNonExistingCreatorAndOwner);
        //}

        //#endregion GetRetweetsCountForFriend
    }
}


text:
<TITLE>Review for Dastforoush (1987)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Dastforoush (1987)

reviewed by
Thomas E. Billings

                             THE PEDDLER
                  A film review by Thomas E. Billings
                   Copyright 1990 Thomas E. Billings

Synopsis:
A trilogy of unusual stories set in the slums of modern Tehran, that
provide a bleak look at the harshness and cruelty of life.  Reminiscent
of the films by noted Greek Director Theo Angelopolous, this is an
interesting, but also disturbing film.  Some viewers will be fascinated,
many others repelled by this film.

Iran (English subtitles), color, 1987, 95 minutes.
Director/Writer:  Mohsen Makhmalbaf

     The first story in the trilogy concerns an impoverished married
couple; they are cousins and live in the remnants of an old bus in the
slums of Tehran.  She is pregnant with her fifth (fourth?) child; her
previous children are all severely deformed and handicapped.  The couple
fears that the new child will also be handicapped.  They resolve to
abandon the child so it can receive better care.  The story concerns the
difficulties they face in this effort.

     The second story concerns a mentally incompetent young man who
lives in a run-down apartment, where he takes care of his elderly,
invalid mother.  The third story shows the last few hours of the life of
a peddler, who is suspected of betraying his suppliers (who are
criminals).  This part of the story is told from the point of view of
the peddler, who has vivid fantasies of his impending death.

     The film is a strange mixture -- although it is primarily a gritty,
bleak look at life, it also includes elements of fantasy that make it
resemble a horror movie at times.  The result is a real-life horror
film, full of deformed people, crazy people, and brutal criminals.

     A comparison to the films of Theo Angelopolous is appropriate here.
However, the present film is not as pretentious, nor is it as
depressing as, for example, Angelopolous' LANDSCAPE IN THE MIST.  The
style though, is very similar to Angelopolous.

     The film can be interpreted as a sharp criticism of the state of
Iranian society at present.  However, the major thrust seems to be a
criticism of human nature and its failings: the indecision of the
parents trying to abandon their child, the way the young man mistreats
his mother, and the paranoia of the peddler.

     Certain cautions are in order here.  The film includes scenes that
will offend many viewers: a sheep is killed in a butcher shop; its
throat is cut & it bleeds to death; there are also scenes of apparent
cruelty to a dairy cow.

     Because of the general negative tone of the film, I would not
recommend it to a general audience.  However, fans of the films of Theo
Angelopolous will find it worth considering.

Distribution.  Part of a film series, "Iranian Film Now," coordinated by
The Film Center, Chicago on behalf of the Farabi Cinema Foundation.
Screened at the Pacific Film Archive,  University of California,
Berkeley.  This film may be available on video, if you can find a source
for Iranian videos.

Reviewer contact:  teb@stat.Berkeley.EDU

.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews

redpajama_set_name: RedPajamaGithub


text:
(function() {
  var DOWN, ENTER, ESCAPE, Evented, SPACE, Select, UP, addClass, clickEvent, extend, getBounds, getFocusedSelect, hasClass, isRepeatedChar, lastCharacter, removeClass, searchText, searchTextTimeout, touchDevice, useNative, _ref,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  _ref = Tether.Utils, extend = _ref.extend, addClass = _ref.addClass, removeClass = _ref.removeClass, hasClass = _ref.hasClass, getBounds = _ref.getBounds, Evented = _ref.Evented;

  ENTER = 13;

  ESCAPE = 27;

  SPACE = 32;

  UP = 38;

  DOWN = 40;

  touchDevice = 'ontouchstart' in document.documentElement;

  clickEvent = touchDevice ? 'touchstart' : 'click';

  useNative = function() {
    return touchDevice && (innerWidth <= 640 || innerHeight <= 640);
  };

  isRepeatedChar = function(str) {
    return Array.prototype.reduce.call(str, function(a, b) {
      if (a === b) {
        return b;
      } else {
        return false;
      }
    });
  };

  getFocusedSelect = function() {
    var _ref1;
    return (_ref1 = document.querySelector('.select-target-focused')) != null ? _ref1.selectInstance : void 0;
  };

  searchText = '';

  searchTextTimeout = void 0;

  lastCharacter = void 0;

  document.addEventListener('keypress', function(e) {
    var options, repeatedOptions, select, selected;
    if (!(select = getFocusedSelect())) {
      return;
    }
    if (e.charCode === 0) {
      return;
    }
    if (e.keyCode === SPACE) {
      e.preventDefault();
    }
    clearTimeout(searchTextTimeout);
    searchTextTimeout = setTimeout(function() {
      return searchText = '';
    }, 500);
    searchText += String.fromCharCode(e.charCode);
    options = select.findOptionsByPrefix(searchText);
    if (options.length === 1) {
      select.selectOption(options[0]);
      return;
    }
    if (searchText.length > 1 && isRepeatedChar(searchText)) {
      repeatedOptions = select.findOptionsByPrefix(searchText[0]);
      if (repeatedOptions.length) {
        selected = repeatedOptions.indexOf(select.getChosen());
        selected += 1;
        selected = selected % repeatedOptions.length;
        select.selectOption(repeatedOptions[selected]);
        return;
      }
    }
    if (options.length) {
      select.selectOption(options[0]);
    }
  });

  document.addEventListener('keydown', function(e) {
    var select, _ref1, _ref2;
    if (!(select = getFocusedSelect())) {
      return;
    }
    if ((_ref1 = e.keyCode) === UP || _ref1 === DOWN || _ref1 === ESCAPE) {
      e.preventDefault();
    }
    if (select.isOpen()) {
      switch (e.keyCode) {
        case UP:
        case DOWN:
          return select.moveHighlight(e.keyCode);
        case ENTER:
          return select.selectHighlightedOption();
        case ESCAPE:
          select.close();
          return select.target.focus();
      }
    } else {
      if ((_ref2 = e.keyCode) === UP || _ref2 === DOWN || _ref2 === SPACE) {
        return select.open();
      }
    }
  });

  Select = (function(_super) {
    __extends(Select, _super);

    Select.defaults = {
      alignToHighlighed: 'auto',
      className: 'select-theme-default'
    };

    function Select(options) {
      this.options = options;
      this.options = extend({}, Select.defaults, this.options);
      this.select = this.options.el;
      if (this.select.selectInstance != null) {
        throw new Error("This element has already been turned into a Select");
      }
      this.setupTarget();
      this.renderTarget();
      this.setupDrop();
      this.renderDrop();
      this.setupSelect();
      this.setupTether();
      this.bindClick();
      this.value = this.select.value;
    }

    Select.prototype.useNative = function() {
      return this.options.useNative === true || (useNative() && this.options.useNative !== false);
    };

    Select.prototype.setupTarget = function() {
      var tabIndex,
        _this = this;
      this.target = document.createElement('a');
      this.target.href = 'javascript:;';
      addClass(this.target, 'select-target');
      tabIndex = this.select.getAttribute('tabindex') || 0;
      this.target.setAttribute('tabindex', tabIndex);
      if (this.options.className) {
        addClass(this.target, this.options.className);
      }
      this.target.selectInstance = this;
      this.target.addEventListener('click', function() {
        if (!_this.isOpen()) {
          return _this.target.focus();
        } else {
          return _this.target.blur();
        }
      });
      this.target.addEventListener('focus', function() {
        return addClass(_this.target, 'select-target-focused');
      });
      this.target.addEventListener('blur', function(e) {
        if (_this.isOpen()) {
          if (e.relatedTarget && !_this.drop.contains(e.relatedTarget)) {
            _this.close();
          }
        }
        return removeClass(_this.target, 'select-target-focused');
      });
      return this.select.parentNode.insertBefore(this.target, this.select.nextSibling);
    };

    Select.prototype.setupDrop = function() {
      var _this = this;
      this.drop = document.createElement('div');
      addClass(this.drop, 'select');
      if (this.options.className) {
        addClass(this.drop, this.options.className);
      }
      document.body.appendChild(this.drop);
      this.drop.addEventListener('click', function(e) {
        if (hasClass(e.target, 'select-option')) {
          return _this.pickOption(e.target);
        }
      });
      this.drop.addEventListener('mousemove', function(e) {
        if (hasClass(e.target, 'select-option')) {
          return _this.highlightOption(e.target);
        }
      });
      this.content = document.createElement('div');
      addClass(this.content, 'select-content');
      return this.drop.appendChild(this.content);
    };

    Select.prototype.open = function() {
      var positionSelectStyle, selectedOption,
        _this = this;
      addClass(this.target, 'select-open');
      if (this.useNative()) {
        this.select.style.display = 'block';
        setTimeout(function() {
          var event;
          event = document.createEvent("MouseEvents");
          event.initEvent("mousedown", true, true);
          return _this.select.dispatchEvent(event);
        });
        return;
      }
      addClass(this.drop, 'select-open');
      setTimeout(function() {
        return _this.tether.enable();
      });
      selectedOption = this.drop.querySelector('.select-option-selected');
      if (!selectedOption) {
        return;
      }
      this.highlightOption(selectedOption);
      this.scrollDropContentToOption(selectedOption);
      positionSelectStyle = function() {
        var dropBounds, offset, optionBounds;
        if (hasClass(_this.drop, 'tether-abutted-left') || hasClass(_this.drop, 'tether-abutted-bottom')) {
          dropBounds = getBounds(_this.drop);
          optionBounds = getBounds(selectedOption);
          offset = dropBounds.top - (optionBounds.top + optionBounds.height);
          return _this.drop.style.top = (parseFloat(_this.drop.style.top) || 0) + offset + 'px';
        }
      };
      if (this.options.alignToHighlighted === 'always' || (this.options.alignToHighlighted === 'auto' && this.content.scrollHeight <= this.content.clientHeight)) {
        setTimeout(positionSelectStyle);
      }
      return this.trigger('open');
    };

    Select.prototype.close = function() {
      removeClass(this.target, 'select-open');
      if (this.useNative()) {
        this.select.style.display = 'none';
        return;
      }
      this.tether.disable();
      removeClass(this.drop, 'select-open');
      return this.trigger('close');
    };

    Select.prototype.toggle = function() {
      if (this.isOpen()) {
        return this.close();
      } else {
        return this.open();
      }
    };

    Select.prototype.isOpen = function() {
      return hasClass(this.drop, 'select-open');
    };

    Select.prototype.bindClick = function() {
      var _this = this;
      this.target.addEventListener(clickEvent, function(e) {
        e.preventDefault();
        return _this.toggle();
      });
      return document.addEventListener(clickEvent, function(event) {
        if (!_this.isOpen()) {
          return;
        }
        if (event.target === _this.drop || _this.drop.contains(event.target)) {
          return;
        }
        if (event.target === _this.target || _this.target.contains(event.target)) {
          return;
        }
        return _this.close();
      });
    };

    Select.prototype.setupTether = function() {
      return this.tether = new Tether({
        element: this.drop,
        target: this.target,
        attachment: 'top left',
        targetAttachment: 'bottom left',
        classPrefix: 'select',
        constraints: [
          {
            to: 'window',
            attachment: 'together'
          }
        ]
      });
    };

    Select.prototype.renderTarget = function() {
      var option, _i, _len, _ref1;
      this.target.innerHTML = '';
      _ref1 = this.select.querySelectorAll('option');
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        option = _ref1[_i];
        if (option.selected) {
          this.target.innerHTML = option.innerHTML;
          break;
        }
      }
      return this.target.appendChild(document.createElement('b'));
    };

    Select.prototype.renderDrop = function() {
      var el, option, optionList, _i, _len, _ref1;
      optionList = document.createElement('ul');
      addClass(optionList, 'select-options');
      _ref1 = this.select.querySelectorAll('option');
      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
        el = _ref1[_i];
        option = document.createElement('li');
        addClass(option, 'select-option');
        option.setAttribute('data-value', el.value);
        option.innerHTML = el.innerHTML;
        if (el.selected) {
          addClass(option, 'select-option-selected');
        }
        optionList.appendChild(option);
      }
      this.content.innerHTML = '';
      return this.content.appendChild(optionList);
    };

    Select.prototype.setupSelect = function() {
      var _this = this;
      this.select.selectInstance = this;
      addClass(this.select, 'select-select');
      return this.select.addEventListener('change', function() {
        _this.renderDrop();
        return _this.renderTarget();
      });
    };

    Select.prototype.findOptionsByPrefix = function(text) {
      var options;
      options = this.drop.querySelectorAll('.select-option');
      text = text.toLowerCase();
      return Array.prototype.filter.call(options, function(option) {
        return option.innerHTML.toLowerCase().substr(0, text.length) === text;
      });
    };

    Select.prototype.findOptionsByValue = function(val) {
      var options;
      options = this.drop.querySelectorAll('.select-option');
      return Array.prototype.filter.call(options, function(option) {
        return option.getAttribute('data-value') === val;
      });
    };

    Select.prototype.getChosen = function() {
      if (this.isOpen()) {
        return this.drop.querySelector('.select-option-highlight');
      } else {
        return this.drop.querySelector('.select-option-selected');
      }
    };

    Select.prototype.selectOption = function(option) {
      if (this.isOpen()) {
        this.highlightOption(option);
        return this.scrollDropContentToOption(option);
      } else {
        return this.pickOption(option, false);
      }
    };

    Select.prototype.resetSelection = function() {
      return this.selectOption(this.drop.querySelector('.select-option'));
    };

    Select.prototype.highlightOption = function(option) {
      var highlighted;
      highlighted = this.drop.querySelector('.select-option-highlight');
      if (highlighted != null) {
        removeClass(highlighted, 'select-option-highlight');
      }
      addClass(option, 'select-option-highlight');
      return this.trigger('highlight', {
        option: option
      });
    };

    Select.prototype.moveHighlight = function(directionKeyCode) {
      var highlighted, highlightedIndex, newHighlight, options;
      if (!(highlighted = this.drop.querySelector('.select-option-highlight'))) {
        this.highlightOption(this.drop.querySelector('.select-option'));
        return;
      }
      options = this.drop.querySelectorAll('.select-option');
      highlightedIndex = Array.prototype.indexOf.call(options, highlighted);
      if (!(highlightedIndex >= 0)) {
        return;
      }
      if (directionKeyCode === UP) {
        highlightedIndex -= 1;
      } else {
        highlightedIndex += 1;
      }
      if (highlightedIndex < 0 || highlightedIndex >= options.length) {
        return;
      }
      newHighlight = options[highlightedIndex];
      this.highlightOption(newHighlight);
      return this.scrollDropContentToOption(newHighlight);
    };

    Select.prototype.scrollDropContentToOption = function(option) {
      var contentBounds, optionBounds;
      if (this.content.scrollHeight > this.content.clientHeight) {
        contentBounds = getBounds(this.content);
        optionBounds = getBounds(option);
        return this.content.scrollTop = optionBounds.top - (contentBounds.top - this.content.scrollTop);
      }
    };

    Select.prototype.selectHighlightedOption = function() {
      return this.pickOption(this.drop.querySelector('.select-option-highlight'));
    };

    Select.prototype.pickOption = function(option, close) {
      var _this = this;
      if (close == null) {
        close = true;
      }
      this.value = this.select.value = option.getAttribute('data-value');
      this.triggerChange();
      if (close) {
        return setTimeout(function() {
          _this.close();
          return _this.target.focus();
        });
      }
    };

    Select.prototype.triggerChange = function() {
      var event;
      event = document.createEvent("HTMLEvents");
      event.initEvent("change", true, false);
      this.select.dispatchEvent(event);
      return this.trigger('change', {
        value: this.select.value
      });
    };

    Select.prototype.change = function(val) {
      var options;
      options = this.findOptionsByValue(val);
      if (!options.length) {
        throw new Error("Select Error: An option with the value \"" + val + "\" doesn't exist");
      }
      return this.pickOption(options[0], false);
    };

    return Select;

  })(Evented);

  Select.init = function(options) {
    var el, _i, _len, _ref1, _results;
    if (options == null) {
      options = {};
    }
    if (document.readyState === 'loading') {
      document.addEventListener('DOMContentLoaded', function() {
        return Select.init(options);
      });
      return;
    }
    if (options.selector == null) {
      options.selector = 'select';
    }
    _ref1 = document.querySelectorAll(options.selector);
    _results = [];
    for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
      el = _ref1[_i];
      if (!el.selectInstance) {
        _results.push(new Select(extend({
          el: el
        }, options)));
      } else {
        _results.push(void 0);
      }
    }
    return _results;
  };

  window.Select = Select;

}).call(this);


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/trace/service.C $                                     */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2012,2022                        */
/* [+] Google Inc.                                                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#include "service.H"
#include "buffer.H"
#include "entry.H"
#include "compdesc.H"
#include "daemonif.H"
#include "debug.H"

#include <sys/time.h>
#include <sys/task.h>
#include <util/align.H>
#include <string.h>
#include <util/singleton.H>
#include <assert.h>
#include <time.h>
#include <console/consoleif.H>
#include <stdio.h>
#include <ctype.h>
#include <util/sprintf.H>
#include <debugpointers.H>

namespace TRACE
{
    Service::Service()
    {
        iv_daemon = new DaemonIf();
        iv_buffers[BUFFER_SLOW] = new Buffer(iv_daemon, Buffer::UNLIMITED);
        iv_buffers[BUFFER_FAST] = new Buffer(iv_daemon);
        iv_compList = &(Singleton<ComponentList>::instance());

        // initialize tracelite setting to off
        iv_traceLite = false;

        DEBUG::add_debug_pointer(DEBUG::TRACESERVICE,
                                 this,
                                 sizeof(TRACE::Service));
    }

    Service::~Service()
    {
        // No need to destruct the service.
        assert(0);
    }

    void Service::setTraceLite(bool i_isEnabled)
    {
        iv_traceLite = i_isEnabled;
    }

    void setTraceLite(bool i_isEnabled)
    {
        Singleton<Service>::instance().setTraceLite(i_isEnabled);
    }

    bool Service::getTraceLite()
    {
        return iv_traceLite;
    }

    bool getTraceLite()
    {
        return Singleton<Service>::instance().getTraceLite();
    }

    void Service::writeEntry(ComponentDesc* i_td,
                             trace_hash_val i_hash,
                             const char * i_fmt,
                             uint32_t i_line,
                             uint32_t i_type,
                             va_list i_args)
    {
        // Skip writing trace if debug is disabled.
        if (unlikely(i_type == TRACE_DEBUG))
        {
            if ((!i_td->iv_debugEnabled) &&
                (!g_debugSettings.globalDebugEnable))
            {
                return;
            }
        }

        #ifdef CONFIG_NO_FAPI_TRACE
        // Skip FAPI trace
        if (!strcmp( i_td->iv_compName, "FAPI" ))
        {
            return;
        }
        #endif

        #ifdef CONFIG_CONSOLE_OUTPUT_TRACE
        {
            va_list args;
            va_copy(args, i_args);
            #ifdef CONFIG_CONSOLE_OUTPUT_TRACE_COMP_NAME
            if ( !strcmp(i_td->iv_compName,
                         CONFIG_CONSOLE_OUTPUT_TRACE_COMP_NAME) )
            {
            #endif
                CONSOLE::vdisplayf(CONSOLE::VUART1, i_td->iv_compName,
                                   i_fmt, i_args);
            #ifdef CONFIG_CONSOLE_OUTPUT_TRACE_COMP_NAME
            }
            #endif
            va_end(args);
        }
        #endif

        // copy args for use with openpower trace lite
        va_list l_tl_args;
        va_copy(l_tl_args, i_args);

        do
        {
            // Get the right buffer for this component.
            Buffer* l_buffer = iv_buffers[i_td->iv_bufferType];

            // Copy the current time.
            trace_entry_stamp_t l_time;
            _createTimeStamp(&l_time);

            // Sizes for trace entry.
            uint32_t l_size = 0;
            uint32_t l_num_args = 0;
            uint32_t l_num_words = 0;

            // Maps of arguments to special types.
            uint64_t l_str_map = 0, l_char_map = 0, l_double_map = 0;

            va_list l_args;
            va_copy(l_args, i_args);

            // Parse the fmt list to determine the types/sizes of each
            // argument.
            while(NULL != (i_fmt = strchr(i_fmt, '%')))
            {
                i_fmt++; // skip %

                // skip width in front of format type
                while ((i_fmt != nullptr) && (isdigit(*i_fmt) || (*i_fmt == '-')))
                {
                    i_fmt++;
                }
                if (i_fmt == nullptr)
                    break;

                switch (*i_fmt)
                {
                    case '%':
                        break;

                    case 's': // string.
                        l_str_map |= (1 << l_num_args);
                        l_num_args++;
                        l_num_words++;
                        l_size += ALIGN_4(strlen(va_arg(l_args, char*)) + 1);
                        break;

                    case 'c': // character.
                        l_char_map |= (1 << l_num_args);
                        l_num_args++;
                        l_num_words++;
                        va_arg(l_args, uint32_t);
                        l_size += sizeof(uint32_t);
                        break;

                    case 'e': // doubles.
                    case 'f':
                    case 'g':
                        l_double_map |= (1 << l_num_args);
                        l_num_args++;
                        l_num_words += 2;
                        va_arg(l_args, double);
                        l_size += sizeof(double);
                        break;

                    default: // uint64_t-sized argument.
                        l_num_args++;
                        l_num_words += 2;
                        va_arg(l_args, uint64_t);
                        l_size += sizeof(uint64_t);
                        break;
                }
                i_fmt++;
            }

            va_end(l_args);

            // Ensure we don't have too many arguments.
            if (l_num_args > TRAC_MAX_ARGS)
            {
                // Simply reducing the number of arguments and continuing
                // causes FSP trace to crash.  See defect 864438.
                //l_num_args = TRAC_MAX_ARGS;
                break;
            }

            // Claim an entry from the buffer.
            uint32_t l_realSize = ALIGN_4(sizeof(trace_bin_entry_t) + l_size);
            Entry* l_entry = l_buffer->claimEntry(i_td, l_realSize);
            if (NULL == l_entry)
            {
                break;
            }

            // Copy contents into the 'fsp-trace'-style structure.
            trace_bin_entry_t* l_binEntry =
                reinterpret_cast<trace_bin_entry_t*>(&l_entry->data[0]);

            l_binEntry->stamp = l_time;
            l_binEntry->head.length = l_size;
            l_binEntry->head.tag = TRACE_COMP_TRACE;
            l_binEntry->head.hash = i_hash;
            l_binEntry->head.line = i_line;

            // Define a buffer class to hold the formatting for tracelite.
            // This is needed to avoid heap allocation of the tracelite
            // format string. This code is called many times per second
            // regardless of whether tracelite is enabled.  We prefer not to
            // increase the number of page faults occuring in this code path.
            // Using std::string is a no-no as it calls new behind the scenes.
            // This class should not be separated from its methods in a header
            // file because:
            //   1. It needs to be inline (for performance).
            //   2. It is a special purpose class and should not be called
            //         anywhere else due to its buffer overflow potential
            //         if used incorrectly.
            class CharBuffer {
                char a[TRAC_MAX_ARGS * 8 + 20];
                // TRAC_MAX_ARGS is the number of arguments allowed
                // an arg's format is 8 characters worst case. ex: "%.16llX "
                // the string "trace_lite " is 11 characters
                // the hash plus a space is 9 characters
                char* s;  // position
            public:
                CharBuffer()
                {
                    s = a;
                }
                void append(const char* str)
                {
                    const char *c = str;
                    // strcat cannot be used here because it does not give us
                    // the length of string so we'd need to recompute
                    while(*c != '\0')
                    {
                        // will not overrun because of TRAC_MAX_ARGS limit
                        *s++ = *c++;
                    }
                }
                char* operator*()
                {
                    *s = '\0';
                    return a;
                }
            };

            // use this buffer to hold the formatting for tracelite output
            CharBuffer l_cb;

            // use the string "trace_lite " to indicate to the receiving tool
            // that we are about to send a hash and some arguments
            l_cb.append("trace_lite ");

            { // allocate 10 bytes on the stack
                char hashstring[10]; // 8 characters plus space plus null char
                sprintf(hashstring,"%.8X ",i_hash);
                l_cb.append(hashstring);
            } // free 10 bytes on the stack

            const char* l_s = NULL;  // pointer to format string to append

            // Copy arguments into the 'fsp-trace' entry's data section.
            char* l_dataOut = reinterpret_cast<char*>(&l_binEntry->data[0]);
            for (size_t i = 0; i < l_num_args; i++)
            {
                // String.
                if (l_str_map & (1 << i))
                {
                    char* str = va_arg(i_args, char*);
                    uint32_t strSize = strlen(str);

                    memcpy(l_dataOut, str, strSize+1);

                    l_s = "\"%s\" ";  // format string fragment for tracelite

                    l_dataOut += ALIGN_4(strSize + 1);
                }
                // Single character.
                else if (l_char_map & (1 << i))
                {
                    *(reinterpret_cast<uint32_t*>(l_dataOut)) =
                        va_arg(i_args, uint32_t);
                    l_dataOut += sizeof(uint32_t);

                    l_s = "%.8X ";  // set formatting for tracelite
                }
                // Doubles.
                else if (l_double_map & (1 << i))
                {
                    *(reinterpret_cast<double*>(l_dataOut)) =
                        va_arg(i_args, double);

                    l_s = "%.16llX ";  // set formatting for tracelite

                    l_dataOut += sizeof(double);
                }
                // All others (as uint64_t's).
                else
                {
                    *(reinterpret_cast<uint64_t*>(l_dataOut)) =
                        va_arg(i_args, uint64_t);

                    l_s = "%.16llX ";  // set formatting for tracelite

                    l_dataOut += sizeof(uint64_t);
                }
                l_cb.append(l_s);  // append to format string for tracelite
            }

            if (iv_traceLite)
            {
            #ifdef CONFIG_NO_FAPI_IN_TRACE_LITE_OUTPUT
                if (strcmp( i_td->iv_compName, "FAPI" ))
            #endif
                {
                    char tmpstr[sizeof(i_td->iv_compName)+sizeof(l_time.tid)+1];
                    sprintf(tmpstr, "%d %s", l_time.tid, i_td->iv_compName );
                    CONSOLE::vdisplayf(CONSOLE::VUART2, tmpstr,
                                       *l_cb, l_tl_args);
                }
            }

            // "Commit" entry to buffer.
            l_buffer->commitEntry(l_entry);

        } while(0);

        va_end(l_tl_args);  // for trace lite

    }

    void Service::writeBinEntry(ComponentDesc* i_td,
                                trace_hash_val i_hash,
                                const char * i_fmt,
                                uint32_t i_line,
                                const void* i_ptr,
                                uint32_t i_size,
                                uint32_t i_type)
    {
        // Skip writing trace if debug is disabled.
        if (unlikely(i_type == TRACE_DEBUG))
        {
            if ((!i_td->iv_debugEnabled) &&
                (!g_debugSettings.globalDebugEnable))
            {
                return;
            }
        }

        #ifdef CONFIG_NO_FAPI_TRACE
        // Skip FAPI trace
        if (!strcmp( i_td->iv_compName, "FAPI" ))
        {
            return;
        }
        #endif

        #ifdef CONFIG_CONSOLE_OUTPUT_TRACE
        {
        // Output binary data.
        // Format is:
        // ~[0x0000] 01234567 01234567 01234567 01234567    *012345689abcdef*
            static size_t BINARY_FORMAT_LENGTH = 69;

            size_t pos = 0;
            char* output = strdup(i_fmt);
            size_t output_size = strlen(output)+1;
            while(pos < i_size)
            {
                char bin_output[BINARY_FORMAT_LENGTH];

                // Create length header.
                size_t bin_pos = sprintf(bin_output,
                                         "~[0x%04hx]", (uint16_t) pos);

                // Create hex representation.
                for (int i =0 ; i < 16; ++i)
                {
                    if ((i % 4) == 0)
                    {
                        bin_output[bin_pos++] = ' ';
                    }
                    if ((pos + i) < i_size)
                    {
                        sprintf(&bin_output[bin_pos],
                                "%02x", ((const char*)i_ptr)[pos+i]);
                        bin_pos += 2;
                    }
                    else
                    {
                        bin_output[bin_pos++] = ' ';
                        bin_output[bin_pos++] = ' ';
                    }
                }

                for (int i = 0; i < 4; ++i)
                {
                    bin_output[bin_pos++] = ' ';
                }
                bin_output[bin_pos++] = '*';

                // Create ascii representation.
                for(int i = 0; i< 16; ++i)
                {
                    char ch = ' ';
                    if ((pos + i) < i_size)
                    {
                        ch = ((const char*) i_ptr)[pos+i];
                        if (!isprint(ch))
                        {
                            ch = '.';
                        }
                    }
                    bin_output[bin_pos++] = ch;
                }
                bin_output[bin_pos++] = '*';
                bin_output[bin_pos++] = '\0';

                // Append to output string.
                output = static_cast<char*>(
                    realloc(output, output_size + BINARY_FORMAT_LENGTH));
                strcat(output, "\n");
                strcat(output, bin_output);
                output_size += BINARY_FORMAT_LENGTH;

                pos += 16;
            }

            // Output full binary dump.
            #ifdef CONFIG_CONSOLE_OUTPUT_TRACE_COMP_NAME
            if ( !strcmp(i_td->iv_compName,
                         CONFIG_CONSOLE_OUTPUT_TRACE_COMP_NAME) )
            #endif
            {CONSOLE::displayf(CONSOLE::VUART1, i_td->iv_compName,"%s",output);}

            free(output);

        }
        #endif

        do
        {
            // Get the right buffer for this component.
            Buffer* l_buffer = iv_buffers[i_td->iv_bufferType];

            // Copy the current time.
            trace_entry_stamp_t l_time;
            _createTimeStamp(&l_time);

            // Claim an entry from the buffer.
            uint32_t l_realSize = ALIGN_4(sizeof(trace_bin_entry_t) + i_size);
            Entry* l_entry = l_buffer->claimEntry(i_td, l_realSize);
            if (NULL == l_entry)
            {
                break;
            }

            // Copy contents into the 'fsp-trace'-style structure.
            trace_bin_entry_t* l_binEntry =
                reinterpret_cast<trace_bin_entry_t*>(&l_entry->data[0]);

            l_binEntry->stamp = l_time;
            l_binEntry->head.length = i_size;
            l_binEntry->head.tag = TRACE_FIELDBIN;
            l_binEntry->head.hash = i_hash;
            l_binEntry->head.line = i_line;

            // Copy bin-data into the 'fsp-trace' entry's data section.
            memcpy(&l_binEntry->data[0], i_ptr, i_size);

            // "Commit" entry to buffer.
            l_buffer->commitEntry(l_entry);

        } while(0);
    }

    size_t Service::getBuffer(ComponentDesc* i_comp,
                              void * o_data,
                              size_t i_size)
    {
        return
            iv_buffers[i_comp->iv_bufferType]->getTrace(i_comp,o_data,i_size);
    }

    void Service::flushBuffers()
    {
        iv_daemon->signal(true);
    }

    void Service::enableContinous()
    {
        iv_daemon->continousMode(true);
    }

    void Service::disableContinous()
    {
        iv_daemon->continousMode(false);
    }

    Service* Service::getGlobalInstance()
    {
        return &(Singleton<Service>::instance());
    }

    void Service::_createTimeStamp(trace_entry_stamp_t *o_entry)
    {
        timespec_t curTime;

        clock_gettime(CLOCK_MONOTONIC, &curTime);

        o_entry->tbh = curTime.tv_sec;
        o_entry->tbl = curTime.tv_nsec;
        o_entry->tid = task_gettid();
    }

}


text:
@implementation CCEffectDropShadow

-(id)init
{
    return [self initWithShadowOffset:GLKVector2Make(5, -5) shadowColor:[CCColor blackColor]];
}

-(id)initWithShadowOffset:(GLKVector2)shadowOffset shadowColor:(CCColor*)shadowColor
{
    NSArray *uniforms = @[
                          [CCEffectUniform uniform:@"vec2" name:@"u_shadowOffset" value:[NSValue valueWithGLKVector2:shadowOffset]],
                          [CCEffectUniform uniform:@"vec4" name:@"u_shadowColor" value: [NSValue valueWithGLKVector4:shadowColor.glkVector4]],
                          ];

    if((self = [super initWithFragmentUniforms:uniforms vertexUniforms:nil varyings:nil]))
    {
        _shadowColor = shadowColor;
        _shadowOffset = shadowOffset;
        self.debugName = @"CCEffectDropShadow";
    }
    return self;
}

+(id)effectWithShadowOffset:(GLKVector2)shadowOffset shadowColor:(CCColor*)shadowColor
{
    return [[self alloc] initWithShadowOffset:shadowOffset shadowColor:shadowColor];
}

-(void)buildFragmentFunctions
{
    self.fragmentFunctions = [[NSMutableArray alloc] init];

    NSString* effectBody = CC_GLSL(

                                   vec4 outputColor = texture2D(cc_MainTexture, cc_FragTexCoord1);

                                   // Grab the alpha at the shadowOffset, we will use this to determine the shadow alpha and if a
                                   // shadowColor should be added at all.
                                   float shadowOffsetAlpha = texture2D(cc_MainTexture, cc_FragTexCoord1 - u_shadowOffset).a;

                                   vec4 shadowColor = u_shadowColor*shadowOffsetAlpha;
                                   outputColor = outputColor + (1.0 - outputColor.a) * shadowColor;

//                                   vec4 shadowColor = vec4(u_shadowColor.rgb, shadowOffsetAlpha * u_shadowColor.a);

//                                   // Since we use premultiplied alpha, we need to be careful and avoid changing the
//                                   // output color of every fragment. If we add a non-zero shadowColor to the output, then
//                                   // we will end up tinting the whole quad with a shadowColor.
//                                   const float alphaThreshold = 0.2; // Maybe make this a uniform? it's kind of hacky..
//                                   if(shadowOffsetAlpha < alphaThreshold)
//                                       return outputColor; //shadowColor = vec4(0.0);
//
//                                   // Ensures that the cc_MainTexture color does not get over written by the shadowcolor
//                                   outputColor = outputColor + (1.0 - outputColor.a) * shadowColor;

                                   const float sampleDist = 1.0;
                                   const float sampleStrength = 2.2;

                                   float samples[10];
                                   samples[0] = -0.08;
                                   samples[1] = -0.05;
                                   samples[2] = -0.03;
                                   samples[3] = -0.02;
                                   samples[4] = -0.01;
                                   samples[5] =  0.01;
                                   samples[6] =  0.02;
                                   samples[7] =  0.03;
                                   samples[8] =  0.05;
                                   samples[9] =  0.08;

                                   vec2 dir = 0.5 - cc_FragTexCoord1;
                                   float dist = sqrt(dir.x*dir.x + dir.y*dir.y);
                                   dir = dir/dist;

                                   vec4 sum = outputColor;

                                   for (int i = 0; i < 10; i++)
                                        sum += texture2D( cc_MainTexture, cc_FragTexCoord1 + dir * samples[i] * sampleDist );

                                   sum *= 1.0/11.0;
                                   float t = dist * sampleStrength;
                                   t = clamp( t ,0.0,1.0);

                                   outputColor = mix( outputColor, sum, t );

                                   return outputColor;
                                   );

    CCEffectFunction* fragmentFunction = [[CCEffectFunction alloc] initWithName:@"dropShadowEffect"
                                                                           body:effectBody inputs:nil returnType:@"vec4"];
    [self.fragmentFunctions addObject:fragmentFunction];
}

-(void)buildRenderPasses
{
    __weak CCEffectDropShadow *weakSelf = self;

    CCEffectRenderPass *pass0 = [[CCEffectRenderPass alloc] init];
    pass0.debugLabel = @"CCEffectDropShadow pass 0";
    pass0.shader = self.shader;
    pass0.blendMode = [CCBlendMode premultipliedAlphaMode];
    pass0.beginBlocks = @[[^(CCEffectRenderPass *pass, CCTexture *previousPassTexture){

        pass.shaderUniforms[CCShaderUniformMainTexture] = previousPassTexture;
        pass.shaderUniforms[CCShaderUniformPreviousPassTexture] = previousPassTexture;

        GLKVector2 offset = GLKVector2Make(weakSelf.shadowOffset.x /  previousPassTexture.contentSize.width, weakSelf.shadowOffset.y /  previousPassTexture.contentSize.height);

        pass.shaderUniforms[weakSelf.uniformTranslationTable[@"u_shadowOffset"]] = [NSValue valueWithGLKVector2:offset];
        pass.shaderUniforms[weakSelf.uniformTranslationTable[@"u_shadowColor"]] = [NSValue valueWithGLKVector4:weakSelf.shadowColor.glkVector4];

    } copy]];

    self.renderPasses = @[pass0];
}

@end


text:
<!DOCTYPE html>

    {% block header %}
    <title>Timeline JS3 - Beautifully crafted timelines that are easy, and intuitive to use.</title>
    <meta name="description" content="Beautifully crafted timelines that are easy, and intuitive to use.">
    {% endblock %}

    <meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="author" content="Northwestern University Knight Lab">
  <meta name="viewport" content="initial-scale=1,width=device-width">

    <link rel="stylesheet" href="/build/css/timeline.css">

  <link rel="icon" type="image/png" href="//cdn.knightlab.com/libs/purpleline/latest/img/favicon.png">
  <link href="//cloud.webtype.com/css/d4767ecb-457a-4677-8761-72f890add836.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="//cdn.knightlab.com/libs/purpleline/latest/css/purpleline.css">
	<link title="" rel="stylesheet" type="text/css" href="{{ static_url }}/css/site.css">
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

  {% block nav %}
    {% include "_nav.html" %}
  {% endblock %}
	{% block content %}
	{% endblock %}

The Northwestern University Knight Lab is a team of technologists and journalists working at advancing news media innovation through exploration and experimentation.

A joint initiative of the Robert R. McCormick School of Engineering and Applied Science and the Medill School of Journalism, Media, Integrated Marketing Communications.

          <address itemscope="" itemtype="http://data-vocabulary.org/Organization">
            Knight Lab
            (847) 467-4971 |

              1845 Sheridan Road Fisk #109 & #111,
              Evanston,
              IL
              60208 |
              United States

              Latitude: 42.056893

              Longitude: -87.676735

            Northwestern University Knight Lab | Advancing media innovation through exploration and experimentation.
          </address>
          | Copyright 2015, Northwestern University

  {% block scripts %}
	{% endblock %}


text:
<?php

namespace Thruster\Action\DoctrineActions\Tests;

use Thruster\Action\DoctrineActions\DoctrinePersistActionExecutor;

class DoctrinePersistActionExecutorTest extends \PHPUnit_Framework_TestCase
{

    public function testSupportedActionName()
    {
        $entityManagerMock = $this->getMockBuilder('\Doctrine\ORM\EntityManager')
            ->disableOriginalConstructor()
            ->getMock();

        $executor = new DoctrinePersistActionExecutor($entityManagerMock);

        $this->assertSame('thruster_doctrine_persist_action', $executor->getSupportedAction());
    }

    public function testExecuteManagerDefault()
    {
        $object = new \stdClass();

        $em = $this->getMockBuilder('\Doctrine\ORM\EntityManager')
            ->disableOriginalConstructor()
            ->getMock();

        $em->expects($this->once())
            ->method('persist')
            ->with($object);

        $em->expects($this->once())
            ->method('flush');

        $executor = new DoctrinePersistActionExecutor($em);
        $executor->execute([$object]);
    }
}


text:
package org.apache.ignite.ml.naivebayes.discrete;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.apache.ignite.ml.dataset.impl.local.LocalDatasetBuilder;
import org.apache.ignite.ml.math.primitives.vector.Vector;
import org.apache.ignite.ml.math.primitives.vector.VectorUtils;
import org.junit.Assert;
import org.junit.Test;

/**
 * Integration tests for Bernoulli naive Bayes algorithm with different datasets.
 */
public class DiscreteNaiveBayesTest {
    /** Precision in test checks. */
    private static final double PRECISION = 1e-2;

    /** Example from book Barber D. Bayesian reasoning and machine learning. Chapter 10. */
    @Test
    public void testLearnsAndPredictCorrently() {
        double english = 1.;
        double scottish = 2.;
        Map<Integer, double[]> data = new HashMap<>();
        data.put(0, new double[] {0, 0, 1, 1, 1, english});
        data.put(1, new double[] {1, 0, 1, 1, 0, english});
        data.put(2, new double[] {1, 1, 0, 0, 1, english});
        data.put(3, new double[] {1, 1, 0, 0, 0, english});
        data.put(4, new double[] {0, 1, 0, 0, 1, english});
        data.put(5, new double[] {0, 0, 0, 1, 0, english});
        data.put(6, new double[] {1, 0, 0, 1, 1, scottish});
        data.put(7, new double[] {1, 1, 0, 0, 1, scottish});
        data.put(8, new double[] {1, 1, 1, 1, 0, scottish});
        data.put(9, new double[] {1, 1, 0, 1, 0, scottish});
        data.put(10, new double[] {1, 1, 0, 1, 1, scottish});
        data.put(11, new double[] {1, 0, 1, 1, 0, scottish});
        data.put(12, new double[] {1, 0, 1, 0, 0, scottish});
        double[][] thresholds = new double[][] {{.5}, {.5}, {.5}, {.5}, {.5}};
        DiscreteNaiveBayesTrainer trainer = new DiscreteNaiveBayesTrainer().setBucketThresholds(thresholds);

        DiscreteNaiveBayesModel model = trainer.fit(
            new LocalDatasetBuilder<>(data, 2),
            (k, v) -> VectorUtils.of(Arrays.copyOfRange(v, 0, v.length - 1)),
            (k, v) -> v[v.length - 1]
        );
        Vector observation = VectorUtils.of(1, 0, 1, 1, 0);

        Assert.assertEquals(scottish, model.predict(observation), PRECISION);
    }
}


text:
{% macro test_nothing(model) %}

-- a silly test to make sure that table-level tests show up in the manifest
-- without a column_name field
select 0

{% endmacro %}


text:
package net.jforum.entities;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

import net.jforum.util.preferences.ConfigKeys;
import net.jforum.util.preferences.SystemGlobals;

/**
 * @author Rafael Steil
 * @version $Id: MostUsersEverOnline.java,v 1.5 2006/08/23 02:13:46 rafaelsteil Exp $
 */
public class MostUsersEverOnline implements Serializable
{
	private int total;
	private String date;
	private long timeInMillis;

	public MostUsersEverOnline() {}

	public int getTotal() {
		return this.total;
	}

	public String getDate() {
		return this.date;
	}

	public long getTimeInMillis() {
		return this.timeInMillis;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public void setTimeInMillis(long time) {
		this.timeInMillis = time;

		SimpleDateFormat df = new SimpleDateFormat(SystemGlobals.getValue(ConfigKeys.DATE_TIME_FORMAT));
		GregorianCalendar gc = new GregorianCalendar();
		gc.setTimeInMillis(time);

		this.setDate(df.format(gc.getTime()));
	}
}


text:
package com.dubture.twig.ui.actions;

import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.php.internal.ui.actions.SelectionHandler;
import org.eclipse.php.internal.ui.editor.PHPStructuredEditor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.handlers.HandlerUtil;

@SuppressWarnings("restriction")
public class SurroundWithHandler extends SelectionHandler implements IHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		IEditorPart editor = HandlerUtil.getActiveEditor(event);

		if (editor instanceof PHPStructuredEditor) {
			final SurroundWithAction surroundWithAction = new SurroundWithAction((PHPStructuredEditor) editor);
			surroundWithAction.run();
		}

		return null;
	}

}


text:
package com.google.cloud.solutions.autotokenize.testing;

import com.google.auto.value.AutoValue;
import com.google.common.io.ByteSource;
import java.io.IOException;
import java.io.InputStream;
import java.nio.channels.Channels;
import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;
import org.apache.beam.sdk.io.FileIO;
import org.apache.beam.sdk.io.FileIO.ReadableFile;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.PTransform;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.transforms.ParDo.SingleOutput;
import org.apache.beam.sdk.values.PBegin;
import org.apache.beam.sdk.values.PCollection;

@AutoValue
public abstract class FileStringReader extends PTransform<PBegin, PCollection<String>> {

  abstract String filePattern();

  public static SingleOutput<ReadableFile, String> createReader() {
    return ParDo.of(new ReadFileAsStringFn());
  }

  public static FileStringReader create(String filePattern) {
    return new AutoValue_FileStringReader(filePattern);
  }

  @Override
  public PCollection<String> expand(PBegin input) {
    return input
        .apply(FileIO.match().filepattern(filePattern()))
        .apply(FileIO.readMatches())
        .apply(createReader());
  }

  public static final class ReadFileAsStringFn extends DoFn<ReadableFile, String> {

    @ProcessElement
    public void exportFileAsString(
        @Element ReadableFile file, OutputReceiver<String> outputReceiver) throws IOException {

      var fileSource =
          new ByteSource() {
            @Override
            public InputStream openStream() throws IOException {
              return Channels.newInputStream(file.open());
            }
          };

      var fileContentString =
          fileSource.asCharSource(StandardCharsets.UTF_8).lines().collect(Collectors.joining("\n"));

      outputReceiver.output(fileContentString);
    }
  }
}


text:
@implementation ZFReorderPhotoSetResponse

#if FL_MRC
- (void) dealloc {
    [super dealloc];
}
#endif
+ (ZFReorderPhotoSetResponse*) reorderPhotoSetResponse {
    return FLAutorelease([[[self class] alloc] init]);
}

@end


text: DanielkeetonCom::Application.config.session_store :cookie_store, key: '_danielkeeton.com_session'


text:
var socket = io('/scoreCardIndex');

// Emit Insert Score Card
function insertScoreCard() {

  var data = new Object();

  data['m_id'] = getQueryString().m_id;

  if($('input[name="radio"]:checked').val() === "me"){

    data['sessionID'] = document.cookie;

    console.log('emit insertOwnScoreCard');
    console.log(data);

    socket.emit('insertOwnScoreCard', data);
  }

  else if($('input[name="radio"]:checked').val() === "others") {

    data['sessionID'] = document.cookie;
    data['email'] = $('#email').val();
    data['password'] = $('#password').val();

    console.log('emit insertScoreCard');
    console.log(data);

    socket.emit('insertScoreCard', data);
  }
};

// 得点表作成後の処理
socket.on('insertScoreCard', function(data) {

  console.log('on insertScoreCard')
  console.log(data);

  if(data != '') {
    if(data.status == true) {
      location.href = '/scoreCard?m_id=' + getQueryString().m_id + '&sc_id=' + data.sc_id;
    }
    else if(data.status == false) {
      alert(data.err);
    }
  }
});

// set Default value
$(function() {

  if($('input[name="radio"]:checked').val() === "me"){
    $('.others-form').hide();
  }
  else if($('input[name="radio"]:checked').val() === "others") {
    $('.others-form').show();
  }
});

// Formの切り分け
function showForm(flag){
  if(flag) {
    $('.others-form').show();
  }
  else{
    $('.others-form').hide();
  }
}


text:
title: "Feature Matrix"
date: 2019-02-01T12:15:00-07:00
draft: false
weight: 100
---

This matrix shows feature compatibility for OpenCensus languages.
{{% tabs Tracing Tags Stats Metrics Resource Exporters%}}

Feature|Java|Go|C#|Python|Nodejs|PHP|Ruby|Erlang/Elixir
---|---|---|---|---|---|---|---|---
Core Data Models||||||||
SpanContext|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Tracestate|Yes|Yes|Yes|Yes|Yes|No|No|Yes
Attributes (String/Bool/Int)|Yes|Yes|Yes|Yes|Yes|String Only|Yes|Yes
Attributes Double/Float64|Yes|Yes|Yes|Yes|Yes|No|No|Yes
Link|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Annotation|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
SpanKind|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
MessageEvent|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Start/End Time|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
SpanData (for exporting)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Status|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Trace Configs||||||||
TraceParam Limits (Attributes, Annotations, etc.)|Yes|Yes|Yes|Yes|Yes|No|Yes|No
Basic Operations||||||||
Create a root span|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Put span into/get span from current context|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Create a span from current context|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Create a span with explicit parent|Yes|Yes|Yes|Yes|Yes|No|Yes|Yes
Add attributes, links, annotations, message events|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Register/Unregister Exporters|Yes|Yes|Yes|Yes|Yes|Register only (use Agent)|Yes|
Child Span Count|Yes|Yes|No|No|Yes|No|Yes|Yes
Override sampling for a span|Yes|Yes|Yes|Yes|Yes|No|Yes|Yes
Propagation||||||||
Binary Format - gRPC|Yes|Yes|Yes|Yes|Yes|Client only|No|Yes
W3C TraceContext Format - HTTP|Yes|Yes|Yes|Yes|Yes|No|Yes|Yes
B3 Format - HTTP|Yes|Yes|Yes|Yes|Yes|In Progress|No|In Progress
Google Cloud Text Format|Yes|Yes|No|Yes|Yes|Yes|Yes|No

Feature|Java|Go|C#|Python|Nodejs|PHP|Ruby|Erlang/Elixir
---|---|---|---|---|---|---|---|---
Core Data Models||||||||
Tag|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
TagKey (restrictions apply)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
TagValue (restrictions apply)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
TagMap|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
TagMetadata|Yes|Yes|No|No|Yes|No|No|No
Basic Operations||||||||
Validate TagKey and TagValue|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Insert a list of Tags into current context|Yes|Yes|Yes|No|Yes|Yes|Yes|Yes
Get Tags from current context|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Update Tags in current context|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Propagation||||||||
Binary Format|Yes|Yes|No|Yes|Yes|Yes|No|Yes
Text Format (W3C)|Yes|No|No|In Progress|Yes|No|No|Yes
gRPC Propagation|Yes|Yes|No|No|Yes|No|No|No
HTTP Propagation|In Progress|No|No|No|In Progress|No|No|No

Feature|Java|Go|C#|Python|Nodejs|PHP|Ruby|Erlang/Elixir
---|---|---|---|---|---|---|---|---
Core Data Models||||||||
Measure (Int64 and Double)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Measurement (Int64 and Double)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
MeasureMap or equivalent (allow for batch recording)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Aggregation (Count, Sum, LastValue, Distribution)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Bucket Boundaries (only with positive bounds)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
AggregationData (Count, Sum, LastValue, Distribution)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
View|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
ViewData|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Basic Operations||||||||
Create Int64 or Double Measurements|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Validate Measurements (no negative values)|Yes|Yes|Yes|Yes|Yes|Yes|No|Yes
Batch recording Measurements|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Record against explicit context|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Record against implicit (current) context|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Record with additional attachments (e.g SpanContext)|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Define and register Views|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Apply Aggregation to Measurements according to View definitions|Yes|Yes|Yes|Yes|Yes|Yes|Yes|Yes
Validate bucket boundaries for a Distribution|Yes|Yes|Yes|Yes|Yes|No|No|Yes
Retrieve aggregated data for a given View|Yes|Yes|Yes|Yes|Yes|Yes|No|Yes
Stats Plug-in||||||||
gRPC plug-in for Metrics|Yes|Yes (missing started_rpcs metrics)|No|No|Yes|No|No|Yes
HTTP plug-in for Metrics|Yes|Yes|No|No|In Progress|No|No|Yes

Feature|Java|Go|C#|Python|Nodejs|PHP|Ruby|Erlang/Elixir
---|---|---|---|---|---|---|---|---
Core Data Models||||||||
LabelKey|Yes|Yes|Yes|Yes|Yes|No|No|No
LabelValue|Yes|Yes|Yes|Yes|Yes|No|No|No
Double and Int64 Value|Yes|Yes|Yes|Yes|Yes|No|No|No
Summary Value|Yes|Yes|Yes|Yes|Yes|No|No|No
Distribution Value (including BucketOptions and Exemplar.)|Yes|Yes|No|Yes|Yes|No|No|No
Point|Yes|Yes|No|Yes|Yes|No|No|No
TimeSeries|Yes|Yes|Yes|Yes|Yes|No|No|No
MetricDescriptor|Yes|Yes|Yes|Yes|Yes|No|No|No
Metric|Yes|Yes|Yes|Yes|Yes|No|No|No
Double and Long Gauge|Yes|Yes|Yes|Yes|Yes|No|No|No
Derived Gauge|Yes|Yes|No|Yes|Yes|No|No|No
Cumulative|Yes|Yes|No|Yes|Yes|No|No|No
MetricProducer|Yes|Yes|No|Yes|Yes|No|No|No
Basic Operations||||||||
Add/remove metric producers|Yes|Yes|No|Yes|Yes|No|No|No
Retrieve metrics from each metric producer|Yes|Yes|No|Yes|Yes|No|No|No
Register gauges to metric registry|Yes|Yes|No|Yes|Yes|No|No|No

Feature|Java|Go|C#|Python|Nodejs|PHP|Ruby|Erlang/Elixir
---|---|---|---|---|---|---|---|---
Top-level Resource API|Yes|Yes|No|Yes|Yes|No|No|No
Auto-detect GCE/K8S/AWS EC2 resources|Yes|Yes(missing K8S)|No|Yes|Yes|No|No|No
Set resources for custom environment|Yes|Yes|No|Yes|Yes|No|No|No
Encode and decode resource|Yes|Yes|No|Yes|Yes|No|No|No
Merge mutiple resources|Yes|Yes|No|Yes|Yes|No|No|No
Add resource labels to span|Yes|No|No|Yes  (without new names)|Yes|No|No|No

Feature|Java|Go|C#|Python|Nodejs|PHP|Ruby|Erlang/Elixir
---|---|---|---|---|---|---|---|---
Metrics||||||||
Google Cloud Monitoring|Yes|Yes|No|Yes (without Gauges)|Yes|Yes (using Go Daemon)|Yes|No
Prometheus|Yes|Yes|Yes (without Gauges)|Yes (without Gauges)|Yes (without Gauges)|Yes (using Go Daemon)|No|Yes
Tracing||||||||
Google Cloud Trace|Yes|Yes|No|Yes|Yes|Yes|Yes|yes
Jaeger|Yes|Yes|No|Yes|Yes|Yes|No|Yes
Zipkin|Yes|Yes|Yes|Yes|Yes|Yes|No|Yes
{{% /tabs %}}


text:
// This file is automatically generated.

package adila.db;

/*
 * Samsung Galaxy A5
 *
 * DEVICE: a5lte
 * MODEL: SM-A500F
 */
final class a5lte_sm2da500f {
    public static final String DATA = "Samsung|Galaxy A5|Galaxy A";
}