text:
using NUnit.Framework;
using System.Diagnostics.CodeAnalysis;
using System.Linq;

namespace BDDoc.UnitTest
{
    [ExcludeFromCodeCoverage]
    [StoryInfo(StoryId)]
    [Story(StoryText, Order = StoryOrder)]
    public class ObjectExtensionsTests : IStory
    {
        //Constants

        private const string StoryId = "StoryID";
        private const string StoryText = "This story's text is used just for testing purpose";
        private const int StoryOrder = 11;
        private const string ScenarioText = "This scenario's text is used just for testing purpose";
        private const int ScenarioOrder = 22;

        //Tests

        [Test]
        [Scenario(ScenarioText, Order = ScenarioOrder)]
        public void CreatePlainScenario_UsingTheObjectExtensions_ANewPlainScenarioHasToBeInstanced()
        {
            var scenario = this.CreateScenario();
            Assert.NotNull(scenario);
            Assert.AreEqual(StoryId, scenario.StoryInfoAttribute.StoryId);
            Assert.AreEqual(1, scenario.StoryAttributes.Count);
            Assert.AreEqual(StoryText, scenario.StoryAttributes.First().Text);
            Assert.AreEqual(StoryOrder, scenario.StoryAttributes.First().Order);
            Assert.AreEqual(1, scenario.ScenarioAttributes.Count);
            Assert.AreEqual(ScenarioText, scenario.ScenarioAttributes.First().Text);
            Assert.AreEqual(ScenarioOrder, scenario.ScenarioAttributes.First().Order);
        }

        [Test]
        public void CreatePlainScenario_UsingTheObjectExtensionsWithoutDecorateWithAScenarioAttribute_AnExceptionIsThrown()
        {
            var ex = Assert.Throws<BDDocException>(() => this.CreateScenario());
            Assert.AreEqual(Constants.CExceptionMessageMissingScenarioAttribute, ex.Message);
        }
    }

    [ExcludeFromCodeCoverage]
    [Story(StoryText, Order = StoryOrder)]
    public class ObjectExtensionsTests1 : IStory
    {
        //Constants

        private const string StoryId = "StoryID";
        private const string StoryText = "This story's text is used just for testing purpose";
        private const int StoryOrder = 11;
        private const string ScenarioText = "This scenario's text is used just for testing purpose";
        private const int ScenarioOrder = 22;

        //Tests

        [Test]
        [Scenario(ScenarioText, Order = ScenarioOrder)]
        public void CreatePlainScenario_UsingTheObjectExtensions_ANewPlainScenarioHasToBeInstanced()
        {
            var scenario = this.CreateScenario();
            Assert.NotNull(scenario);
            Assert.AreEqual("BDDoc_UnitTest_ObjectExtensionsTests1", scenario.StoryInfoAttribute.StoryId);
            Assert.AreEqual(1, scenario.StoryAttributes.Count);
            Assert.AreEqual(StoryText, scenario.StoryAttributes.First().Text);
            Assert.AreEqual(StoryOrder, scenario.StoryAttributes.First().Order);
            Assert.AreEqual(1, scenario.ScenarioAttributes.Count);
            Assert.AreEqual(ScenarioText, scenario.ScenarioAttributes.First().Text);
            Assert.AreEqual(ScenarioOrder, scenario.ScenarioAttributes.First().Order);
        }
    }
}


text:
using System;

namespace Clarity.RpaCompiler
{
    public class RloTypedRefType : RloType
    {
        public override ETypeOfType TypeOfType { get { return ETypeOfType.TypedRef; } }

        public override bool Equals(RloType rloType)
        {
            RloTypedRefType tOther = rloType as RloTypedRefType;
            if (tOther == null)
                return false;
            return true;
        }

        public override int GetHashCode()
        {
            return 3000;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Rocks;
use Config;

class Redis {

  /***
   ** User/Login data
   **/

  public static function haveSeenUserRecently($url, $set=false) {
    $key = Config::$base.'seen/'.md5($url);
    if($set) {
      redis()->setex($key, 60*60*24*7, 1);
    } else {
      return redis()->get($key) == 1;
    }
  }

  /***
   ** For sending webmentions
   **/

  // Generates a new code that will be used as the source URL for sending to the specified target.
  // The code is based off the test number and target URL so if the test is run again later the same code will be returned.
  public static function generateCodeForTarget($target, $num, $user) {
    $code = md5('target::'.$num.'::'.$target);
    $key = Config::$base . 'receive/' . $code . '/target';
    redis()->setex($key, 3600*72, json_encode([
      'target' => $target,
      'num' => $num,
      'published' => date('Y-m-d H:i:s'),
      'user' => $user
    ]));
    return $code;
  }

  public static function getTargetDataFromCode($code) {
    $key = Config::$base . 'receive/' . $code . '/target';
    $data = redis()->get($key);
    if($data) {
      return json_decode($data);
    } else {
      return null;
    }
  }

  public static function saveReceiverTestResult($code, $result) {
    $key = Config::$base . 'receive/' . $code . '/target/results';
    redis()->setex($key, 3600*72, json_encode($result));
  }

  public static function getReceiverTestResult($code) {
    $key = Config::$base . 'receive/' . $code . '/target/results';
    $data = redis()->get($key);
    if($data) {
      return json_decode($data);
    } else {
      return null;
    }
  }

  /***
   ** For receiving webmentions
   **/

  public static function makeResponseID($source, $target) {
    return Config::$base . 'response/' . md5($source . '::' . $target);
  }

  public static function makeSourceID($source) {
    return Config::$base . 'source/' . md5($source);
  }

  public static function makeWebmentionID($source, $target) {
    return Config::$base . 'webmention/' . md5($source . '::' . $target . '::' . date('c'));
  }

  private static function filenameForResponse($responseID, $deleted=false) {
    $folder = dirname(__FILE__) . '/../../data/response/';
    preg_match('/response\/(.+)/', $responseID, $id);
    if(array_key_exists(1, $id))
      return $folder.'/'.$id[1].($deleted ? '.deleted' : '').'.json';
    else
      return null;
  }

  private static function filenameForSource($sourceID, $deleted=false) {
    $folder = dirname(__FILE__) . '/../../data/source/';
    preg_match('/source\/(.+)/', $sourceID, $id);
    return $folder.'/'.$id[1].($deleted ? '.deleted' : '').'.json';
  }

  public static function setResponseData($responseID, $data, $type='response') {
    redis()->setex($responseID, 3600*48, json_encode($data));
    // Also write to a file for archiving
    if($type == 'response')
      $filename = self::filenameForResponse($responseID);
    elseif($type == 'source')
      $filename = self::filenameForSource($responseID);
    $folder = dirname($filename);
    if(!file_exists($folder))
      mkdir($folder, 0755, true);
    file_put_contents($filename, json_encode($data));
  }

  public static function getResponseData($responseID) {
    $data = redis()->get($responseID);
    if($data) {
      return json_decode($data);
    } else {
      return null;
    }
  }

  public static function addResponse($testNum, $responseID, $testKey='test') {
    redis()->zadd(Config::$base . $testKey . '/' . $testNum . '/responses', time(), $responseID);
    // TODO: Remove old responses from the list
  }

  public static function deleteResponse($id, $testKey='test') {
    redis()->del($id);
    // Also delete this response ID from any response collections
    if($testKey == 'test') {
      foreach(DiscoveryTestData::data() as $num=>$data) {
        redis()->zrem(Config::$base . $testKey . '/' . $num . '/responses', $id);
      }
    } elseif($testKey == 'update') {
      foreach(UpdateTestData::data() as $num=>$data) {
        redis()->zrem(Config::$base . $testKey . '/' . $num . '/responses', $id);
      }
    }
    // Rename the file to *.deleted.json
    $oldfilename = self::filenameForResponse($id);
    if(file_exists($oldfilename))
      rename($oldfilename, self::filenameForResponse($id, true));
  }

  public static function getResponsesForTest($testNum, $testKey='test') {
    return redis()->zrevrangebyscore(Config::$base . $testKey . '/' . $testNum . '/responses',
      time()+300, time()-3600*24*14);
  }

  public static function getAllResponses() {
    $glob = dirname(__FILE__) . '/../../data/response/*.json';
    $files = glob($glob);
    $responses = [];
    foreach($files as $f) {
      if(preg_match('/\/([a-z0-9]+)\.json/', $f, $match)) {
        $responses[] = Config::$base . 'response/' . $match[1];
      }
    }
    return $responses;
  }

  public static function getResponse($id, $onlyCached=false) {
    $data = redis()->get($id);
    if($data)
      return new Response($data, $id);

    if($onlyCached == false) {
      $filename = self::filenameForResponse($id);
      if(file_exists($filename))
        return new Response(file_get_contents($filename), $id);
    }

    return null;
  }

  public static function getSource($id, $onlyCached=false) {
    $data = redis()->get($id);
    if($data)
      return new Response($data, $id);

    if($onlyCached == false) {
      $filename = self::filenameForSource($id);
      if(file_exists($filename))
        return new Response(file_get_contents($filename), $id);
    }

    return null;
  }

  /***
   ** One-time keys for single-use webmention endpoints **
   **/

  public static function createOneTimeKey() {
    $key = random_string(20);
    redis()->setex(Config::$base . 'onetime/' . $key, 600, 'active');
    return $key;
  }

  // If the key exists (hasn't been used yet), it deletes the key and returns true.
  // Returns false if the key doesn't exist (the endpoint has expired).
  public static function useOneTimeKey($key) {
    $str = Config::$base . 'onetime/' . $key;
    if(redis()->get($str) == 'active') {
      redis()->del($str);
      return true;
    } else {
      return false;
    }
  }

  /***
   ** Helper methods for keeping track of update state
   **/

  public static function setInProgressSourceData($sourceID, $data) {
    redis()->setex($sourceID, 600, json_encode($data));
  }

  // Check if this source URL has passed step 1/2/3/4
  public static function hasSourcePassedPart($responseID, $test, $part, $group='update') {
    return redis()->get(Config::$base . $group . '/' . $test . '/part/' . $part . '/' . $responseID) == 'passed';
  }

  // Store source URL has passed step 1/2/3/4
  public static function setSourceHasPassedPart($responseID, $test, $part, $group='update') {
    redis()->setex(Config::$base . $group . '/' . $test . '/part/' . $part . '/' . $responseID, 600, 'passed');
  }

  public static function addInProgressResponse($testNum, $responseID, $group='update') {
    redis()->zadd(Config::$base . $group . '/' . $testNum . '/inprogress/responses', time(), $responseID);
    // TODO: Remove old responses from the list
  }

  public static function removeInProgressResponse($testNum, $responseID, $group='update') {
    redis()->zrem(Config::$base . $group . '/' . $testNum . '/inprogress/responses', $responseID);
    for($part=1; $part<=3; $part++)
      redis()->del(Config::$base . $group . '/' . $testNum . '/part/' . $part . '/' . $responseID);
  }

  public static function getInProgressResponses($testNum, $group='update') {
    return redis()->zrevrangebyscore(Config::$base . $group . '/' . $testNum . '/inprogress/responses',
      time()+300, time()-600);
  }

  public static function extendExpiration($test, $responseID, $group='update') {
    // Extend the expiration of passing the three tests
    for($part=1; $part<=3; $part++)
      redis()->expire(Config::$base . $group . '/' . $test . '/part/' . $part . '/' . $responseID, 600);
    // And bump the timer of the in progress item
    self::addInProgressResponse($test, $responseID, $group);
  }

}


text:
const should = require('should');
const sinon = require('sinon');
const Promise = require('bluebird');
const testUtils = require('../../../../utils');
const api = require('../../../../../core/server/api');
const helpers = require('../../../../../core/frontend/services/routing/helpers');

describe('Unit - services/routing/helpers/entry-lookup', function () {
    let locals;

    afterEach(function () {
        sinon.restore();
    });

    describe('v2', function () {
        describe('static pages', function () {
            const routerOptions = {
                permalinks: '/:slug/',
                query: {controller: 'pagesPublic', resource: 'pages'}
            };

            let pages;
            let postsReadStub;
            let pagesReadStub;

            beforeEach(function () {
                pages = [
                    testUtils.DataGenerator.forKnex.createPost({url: '/test/', slug: 'test', page: true})
                ];

                postsReadStub = sinon.stub();
                pagesReadStub = sinon.stub();

                pagesReadStub//.withArgs({slug: pages[0].slug, include: 'author,authors,tags'})
                    .resolves({
                        pages: pages
                    });

                sinon.stub(api.v2, 'posts').get(() => {
                    return {
                        read: postsReadStub
                    };
                });

                sinon.stub(api.v2, 'pagesPublic').get(() => {
                    return {
                        read: pagesReadStub
                    };
                });

                locals = {apiVersion: 'v2'};
            });

            it('ensure pages controller is triggered', function () {
                const testUrl = 'http://127.0.0.1:2369' + pages[0].url;

                return helpers.entryLookup(testUrl, routerOptions, locals).then(function (lookup) {
                    postsReadStub.called.should.be.false();
                    pagesReadStub.calledOnce.should.be.true();
                    should.exist(lookup.entry);
                    lookup.entry.should.have.property('url', pages[0].url);
                    lookup.isEditURL.should.be.false();
                });
            });
        });

        describe('posts', function () {
            const routerOptions = {
                permalinks: '/:slug/',
                query: {controller: 'posts', resource: 'posts'}
            };

            let posts;
            let postsReadStub;
            let pagesReadStub;

            beforeEach(function () {
                posts = [
                    testUtils.DataGenerator.forKnex.createPost({url: '/test/', slug: 'test'})
                ];

                postsReadStub = sinon.stub();
                pagesReadStub = sinon.stub();

                postsReadStub//.withArgs({slug: posts[0].slug, include: 'author,authors,tags'})
                    .resolves({
                        posts: posts
                    });

                sinon.stub(api.v2, 'posts').get(() => {
                    return {
                        read: postsReadStub
                    };
                });

                sinon.stub(api.v2, 'pagesPublic').get(() => {
                    return {
                        read: pagesReadStub
                    };
                });

                locals = {apiVersion: 'v2'};
            });

            it('ensure posts controller is triggered', function () {
                const testUrl = 'http://127.0.0.1:2369' + posts[0].url;

                return helpers.entryLookup(testUrl, routerOptions, locals).then(function (lookup) {
                    postsReadStub.calledOnce.should.be.true();
                    pagesReadStub.called.should.be.false();
                    should.exist(lookup.entry);
                    lookup.entry.should.have.property('url', posts[0].url);
                    lookup.isEditURL.should.be.false();
                });
            });
        });
    });

    describe('canary', function () {
        describe('static pages', function () {
            const routerOptions = {
                permalinks: '/:slug/',
                query: {controller: 'pagesPublic', resource: 'pages'}
            };

            let pages;
            let postsReadStub;
            let pagesReadStub;

            beforeEach(function () {
                pages = [
                    testUtils.DataGenerator.forKnex.createPost({url: '/test/', slug: 'test', page: true})
                ];

                postsReadStub = sinon.stub();
                pagesReadStub = sinon.stub();

                pagesReadStub//.withArgs({slug: pages[0].slug, include: 'author,authors,tags'})
                    .resolves({
                        pages: pages
                    });

                sinon.stub(api.canary, 'posts').get(() => {
                    return {
                        read: postsReadStub
                    };
                });

                sinon.stub(api.canary, 'pagesPublic').get(() => {
                    return {
                        read: pagesReadStub
                    };
                });

                locals = {apiVersion: 'canary'};
            });

            it('ensure pages controller is triggered', function () {
                const testUrl = 'http://127.0.0.1:2369' + pages[0].url;

                return helpers.entryLookup(testUrl, routerOptions, locals).then(function (lookup) {
                    postsReadStub.called.should.be.false();
                    pagesReadStub.calledOnce.should.be.true();
                    should.exist(lookup.entry);
                    lookup.entry.should.have.property('url', pages[0].url);
                    lookup.isEditURL.should.be.false();
                });
            });
        });

        describe('posts', function () {
            const routerOptions = {
                permalinks: '/:slug/',
                query: {controller: 'posts', resource: 'posts'}
            };

            let posts;
            let postsReadStub;
            let pagesReadStub;

            beforeEach(function () {
                posts = [
                    testUtils.DataGenerator.forKnex.createPost({url: '/test/', slug: 'test'})
                ];

                postsReadStub = sinon.stub();
                pagesReadStub = sinon.stub();

                postsReadStub//.withArgs({slug: posts[0].slug, include: 'author,authors,tags'})
                    .resolves({
                        posts: posts
                    });

                sinon.stub(api.canary, 'posts').get(() => {
                    return {
                        read: postsReadStub
                    };
                });

                sinon.stub(api.canary, 'pagesPublic').get(() => {
                    return {
                        read: pagesReadStub
                    };
                });

                locals = {apiVersion: 'canary'};
            });

            it('ensure posts controller is triggered', function () {
                const testUrl = 'http://127.0.0.1:2369' + posts[0].url;

                return helpers.entryLookup(testUrl, routerOptions, locals).then(function (lookup) {
                    postsReadStub.calledOnce.should.be.true();
                    pagesReadStub.called.should.be.false();
                    should.exist(lookup.entry);
                    lookup.entry.should.have.property('url', posts[0].url);
                    lookup.isEditURL.should.be.false();
                });
            });
        });
    });

    describe('v3', function () {
        describe('static pages', function () {
            const routerOptions = {
                permalinks: '/:slug/',
                query: {controller: 'pagesPublic', resource: 'pages'}
            };

            let pages;
            let postsReadStub;
            let pagesReadStub;

            beforeEach(function () {
                pages = [
                    testUtils.DataGenerator.forKnex.createPost({url: '/test/', slug: 'test', page: true})
                ];

                postsReadStub = sinon.stub();
                pagesReadStub = sinon.stub();

                pagesReadStub//.withArgs({slug: pages[0].slug, include: 'author,authors,tags'})
                    .resolves({
                        pages: pages
                    });

                sinon.stub(api.v3, 'posts').get(() => {
                    return {
                        read: postsReadStub
                    };
                });

                sinon.stub(api.v3, 'pagesPublic').get(() => {
                    return {
                        read: pagesReadStub
                    };
                });

                locals = {apiVersion: 'v3'};
            });

            it('ensure pages controller is triggered', function () {
                const testUrl = 'http://127.0.0.1:2369' + pages[0].url;

                return helpers.entryLookup(testUrl, routerOptions, locals).then(function (lookup) {
                    postsReadStub.called.should.be.false();
                    pagesReadStub.calledOnce.should.be.true();
                    should.exist(lookup.entry);
                    lookup.entry.should.have.property('url', pages[0].url);
                    lookup.isEditURL.should.be.false();
                });
            });
        });

        describe('posts', function () {
            const routerOptions = {
                permalinks: '/:slug/',
                query: {controller: 'posts', resource: 'posts'}
            };

            let posts;
            let postsReadStub;
            let pagesReadStub;

            beforeEach(function () {
                posts = [
                    testUtils.DataGenerator.forKnex.createPost({url: '/test/', slug: 'test'})
                ];

                postsReadStub = sinon.stub();
                pagesReadStub = sinon.stub();

                postsReadStub//.withArgs({slug: posts[0].slug, include: 'author,authors,tags'})
                    .resolves({
                        posts: posts
                    });

                sinon.stub(api.v3, 'posts').get(() => {
                    return {
                        read: postsReadStub
                    };
                });

                sinon.stub(api.v3, 'pagesPublic').get(() => {
                    return {
                        read: pagesReadStub
                    };
                });

                locals = {apiVersion: 'v3'};
            });

            it('ensure posts controller is triggered', function () {
                const testUrl = 'http://127.0.0.1:2369' + posts[0].url;

                return helpers.entryLookup(testUrl, routerOptions, locals).then(function (lookup) {
                    postsReadStub.calledOnce.should.be.true();
                    pagesReadStub.called.should.be.false();
                    should.exist(lookup.entry);
                    lookup.entry.should.have.property('url', posts[0].url);
                    lookup.isEditURL.should.be.false();
                });
            });
        });
    });
});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Friesia 10(4-5): 265 (1975)

#### Original name
Chaetomium delhianum Mukerji & N. Singh

### Remarks
null


text:
class TaxonSwap < TaxonChange
  has_many :old_taxa, :through => :taxon_change_taxa, :source => :taxon

  validate :only_has_one_input
  validate :has_inputs_and_outputs

  def only_has_one_input
    errors.add(:base, "only one input allowed for a swap") if input_taxa.size > 1
  end

  def has_inputs_and_outputs
    errors.add(:base, "swap must have both inputs and outputs") if input_taxa.size == 0 || output_taxa.size == 0
  end

  def old_taxon
    old_taxa.first
  end

  def opposite_taxon_from(subject_taxon)
    if subject_taxon.id == taxon_id
      taxa.loaded? ? taxa.first : old_taxon
    else
      taxon
    end
  end

  def add_input_taxon(t)
    self.taxon_change_taxa.build(:taxon => t, :taxon_change => self)
  end

  def add_output_taxon(t)
    self.taxon = t
  end

  def input_taxa
    taxa.loaded? ? taxa : taxon_change_taxa.map(&:taxon)
  end

  def output_taxa
    [taxon].compact
  end

  def input_taxon
    taxa.loaded? ? taxa.first : taxon_change_taxa.first.try(:taxon)
  end

  def output_taxon
    taxon
  end

  def verb_phrase
    "replaced with"
  end

  def commit
    # duplicate photos
    input_taxon.taxon_photos.sort_by(&:id).each do |taxon_photo|
      begin
        output_taxon.photos << taxon_photo.photo
      rescue ActiveRecord::RecordInvalid => e
        Rails.logger.error "[ERROR #{Time.now}] Failed to add #{taxon_photo} to #{output_taxon}: #{e}"
      end
    end

    # duplicate iucn_status
    output_taxon.conservation_status = input_taxon.conservation_status
    output_taxon.conservation_status_source_id = input_taxon.conservation_status_source_id
    output_taxon.conservation_status_source_identifier = input_taxon.conservation_status_source_identifier

    # duplicate conservation_statuses
    input_taxon.conservation_statuses.each do |cs|
      new_cs = cs.dup
      new_cs.taxon_id = output_taxon.id
      unless new_cs.save
        Rails.logger.error "[ERROR #{Time.now}] TaxonChange #{id} failed to duplicate #{cs}: " +
          new_cs.errors.full_messages.to_sentence
      end
    end

    # duplicate taxon_names
    input_taxon.taxon_names.each do |taxon_name|
      taxon_name.reload
      unless taxon_name.valid?
        Rails.logger.info "[INFO] Destroying #{taxon_name} while committing taxon change " +
          "#{self.id}: #{taxon_name.errors.full_messages.to_sentence}"
        taxon_name.destroy
        next
      end
      new_taxon_name = taxon_name.dup
      new_taxon_name.taxon_id = output_taxon.id
      new_taxon_name.is_valid = false if taxon_name.is_scientific_names? && taxon_name.is_valid?
      unless new_taxon_name.save
        Rails.logger.error "[ERROR #{Time.now}] TaxonChange #{id} failed to duplicate #{taxon_name}: " +
          new_taxon_name.errors.full_messages.to_sentence
      end
    end

    # duplicate taxon_range
    if output_taxon.taxon_ranges.count == 0
      input_taxon.taxon_ranges.each do |taxon_range|
        new_taxon_range = taxon_range.dup
        new_taxon_range.taxon_id = output_taxon.id
        unless new_taxon_range.save
          Rails.logger.error "[ERROR #{Time.now}] TaxonChange #{id} failed to duplicate #{taxon_range}: " +
            new_taxon_range.errors.full_messages.to_sentence
        end
        unless new_taxon_range.create_kml_attachment
          Rails.logger.error "[ERROR #{Time.now}] TaxonChange #{id} failed to duplicate #{taxon_range} attachment: " +
            new_taxon_range.errors.full_messages.to_sentence
        end
      end
    end

    # duplicate colors
    output_taxon.colors << input_taxon.colors if output_taxon.colors.blank?

    super
  end

end


text:
require_relative 'API_client'

module TestRail
  class TestRunParameters
    VENTURE_REGEX ||= TestRail::TestRailDataLoad.test_rail_data[:ventures]
    ENVIRONMENT_REGEX ||= TestRail::TestRailDataLoad.test_rail_data[:environments]
    CHECK_TEST_RUN_NAME ||= TestRail::TestRailDataLoad.test_rail_data[:check_test_run_name]
    EXEC_COMMAND ||= TestRail::TestRailDataLoad.test_rail_data[:exec_command]

    attr_accessor :environment, :venture, :command

    #
    # Checking of correct naming of created test run and return parameters for running test run
    #
    def initialize(env=nil)
      @venture = ""
      @environment = ""
      if env
        if env[0]
          @venture = env[0] if env[0].match(/(#{VENTURE_REGEX})/)
        end
        if env[1]
          @environment = env[1] if env[1].match(/(#{ENVIRONMENT_REGEX})/)
        end
      end
      @command = EXEC_COMMAND
    end
  end
end


text:
using MasterDevs.ChromeDevTools;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace MasterDevs.ChromeDevTools.Protocol.Chrome.CSS
{
	///
	/// Creates a new special "via-inspector" stylesheet in the frame with given frameId.
	///
	[Command(ProtocolName.CSS.CreateStyleSheet)]
	[SupportedBy("Chrome")]
	public class CreateStyleSheetCommand: ICommand<CreateStyleSheetCommandResponse>
	{
		///
		/// Gets or sets Identifier of the frame where "via-inspector" stylesheet should be created.
		///
		public string FrameId { get; set; }
	}
}


text:
@interface FAKIcon ()

@property (strong, nonatomic) NSMutableAttributedString *mutableAttributedString;

@end

@implementation FAKIcon

+ (void)registerIconFontWithURL:(NSURL *)url
{
    NSAssert([[NSFileManager defaultManager] fileExistsAtPath:[url path]], @"Font file doesn't exist");
    CGDataProviderRef fontDataProvider = CGDataProviderCreateWithURL((__bridge CFURLRef)url);
    CGFontRef newFont = CGFontCreateWithDataProvider(fontDataProvider);
    CGDataProviderRelease(fontDataProvider);
    CFErrorRef error;
    CTFontManagerRegisterGraphicsFont(newFont, &error);
    CGFontRelease(newFont);
}

+ (NSDictionary *)allIcons
{
    @throw @"You need to implement this method in subclass.";
}

+ (UIFont *)iconFontWithSize:(CGFloat)size
{
    @throw @"You need to implement this method in subclass.";
}

+ (instancetype)iconWithCode:(NSString *)code size:(CGFloat)size
{
    FAKIcon *icon = [[self alloc] init];
    icon.mutableAttributedString = [[NSMutableAttributedString alloc] initWithString:code attributes:@{NSFontAttributeName: [self iconFontWithSize:size]}];
    return icon;
}

- (NSAttributedString *)attributedString
{
    return [self.mutableAttributedString copy];
}

- (NSString *)characterCode
{
    return [self.mutableAttributedString string];
}

- (NSString *)iconName
{
    return [[self class] allIcons][[self characterCode]];
}

- (CGFloat)iconFontSize
{
    return [self iconFont].pointSize;
}

- (void)setIconFontSize:(CGFloat)iconSize
{
    [self addAttribute:NSFontAttributeName value:[[self iconFont] fontWithSize:iconSize]];
}

#pragma mark - Setting and Getting Attributes

- (void)setAttributes:(NSDictionary *)attrs;
{
    if (!attrs[NSFontAttributeName]) {
        NSMutableDictionary *mutableAttrs = [attrs mutableCopy];
        mutableAttrs[NSFontAttributeName] = self.iconFont;
        attrs = [mutableAttrs copy];
    }
    [self.mutableAttributedString setAttributes:attrs range:[self rangeForMutableAttributedText]] ;
}

- (void)addAttribute:(NSString *)name value:(id)value
{
    [self.mutableAttributedString addAttribute:name value:value range:[self rangeForMutableAttributedText]];
}

- (void)addAttributes:(NSDictionary *)attrs
{
    [self.mutableAttributedString addAttributes:attrs range:[self rangeForMutableAttributedText]];
}

- (void)removeAttribute:(NSString *)name
{
    [self.mutableAttributedString removeAttribute:name range:[self rangeForMutableAttributedText]];
}

- (NSDictionary *)attributes
{
    return [self.mutableAttributedString attributesAtIndex:0 effectiveRange:NULL];
}

- (id)attribute:(NSString *)attrName
{
    return [self.mutableAttributedString attribute:attrName atIndex:0 effectiveRange:NULL];
}

- (NSRange)rangeForMutableAttributedText
{
    return NSMakeRange(0, [self.mutableAttributedString length]);
}

- (UIFont *)iconFont
{
    return [self attribute:NSFontAttributeName];
}

#pragma mark - Image Drawing

- (UIImage *)imageWithSize:(CGSize)imageSize
{
    UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0);

	// ---------- begin context ----------
	CGContextRef context = UIGraphicsGetCurrentContext();

    [self fillBackgroundForContext:context backgroundSize:imageSize];

    [self.mutableAttributedString drawInRect:[self drawingRectWithImageSize:imageSize]];
	UIImage *iconImage = UIGraphicsGetImageFromCurrentImageContext();

	// ---------- end context ----------
	UIGraphicsEndImageContext();

	return iconImage;
}

- (void)fillBackgroundForContext:(CGContextRef)context backgroundSize:(CGSize)size
{
    if (self.drawingBackgroundColor) {
		[self.drawingBackgroundColor setFill];
		CGContextFillRect(context, CGRectMake(0, 0, size.width, size.height));
	}
}

// Calculate the correct drawing position
- (CGRect)drawingRectWithImageSize:(CGSize)imageSize
{
    CGSize iconSize = [self.mutableAttributedString size];
    CGFloat xOffset = (imageSize.width - iconSize.width) / 2.0;
    xOffset += self.drawingPositionAdjustment.horizontal;
    CGFloat yOffset = (imageSize.height - iconSize.height) / 2.0;
    yOffset += self.drawingPositionAdjustment.vertical;
    return CGRectMake(xOffset, yOffset, iconSize.width, iconSize.height);
}

@end

#pragma mark - Stacked Icons

@implementation UIImage (FAKAddon)

+ (UIImage *)imageWithStackedIcons:(NSArray *)icons imageSize:(CGSize)imageSize
{
    UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0);

	// ---------- begin context ----------
    CGContextRef context = UIGraphicsGetCurrentContext();

    for (FAKIcon *icon in icons) {
        NSAssert([icon isKindOfClass:[FAKIcon class]], @"You can only stack FAKIcon derived objects.");
        [icon fillBackgroundForContext:context backgroundSize:imageSize];
        [icon.mutableAttributedString drawInRect:[icon drawingRectWithImageSize:imageSize]];
    }

	UIImage *iconImage = UIGraphicsGetImageFromCurrentImageContext();

	// ---------- end context ----------
	UIGraphicsEndImageContext();

	return iconImage;
}

@end


text:
class BusinessesController < ApplicationController
  helper BusinessHelper

  def new
    @business = Business.new
  end

  def create
    @business = Business.new(business_params)
    @business.user_id = current_user.id
    if @business.save
      redirect_to @business
    else
      render :new
    end
  end

  def index
    @businesses = Business.all

    if params[:search]
      @businesses = @businesses.check_query(params[:search])
    end
  end

  def show
    @business = Business.find(params[:id])
  end

  def edit
    @business = Business.find(params[:id])
  end

  def update
    @business = Business.find(params[:id])
    if @business.update_attributes(business_params)
      redirect_to business_path(@business)
    else
      render :edit
    end

  end

  def format_id(string)
    string.match(/\d{1,}/)
  end

  def claim_business
    @business = Business.find(params[:id])
  end

  def business_claimed
    user_id = format_id("#{params[:user_id]}")
    name = params[:name]
    email = params[:email]
    business_name = params[:business_name]
    business_address = params[:business_address]
    business_phone = params[:business_phone]
    comments = params[:comments]

    OwnerMailer.claim_business_email(user_id, name, email, business_name, business_address, business_phone, comments).deliver
    flash[:notice] = "Business claim request has been sent."
    redirect_to business_path
  end

  def register_class
    businessID = format_id("#{params[:business_id]}")
    @business = Business.find(businessID[0].to_i)
    name = params[:name]
    phone_number = params[:phonenumber]
    email = params[:email]
    class_name = params[:class_name]
    class_date = params[:class_date]
    comments = params[:comments]

    ClassMailer.class_signup_email(name, phone_number, email, class_name, class_date, comments, @business).deliver
    flash[:notice] = "Class signup has been sent to the business."
    redirect_to business_path(@business.id)
  end

  protected

  def business_params
    params.require(:business).permit(:category, :name, :phone, :email, :photo, :description, :website, :address, :city, :postal_code, :province, :country)
  end

end


text:
layout: page
title: Seattle Police Officer 7736 James R. Coma
permalink: /information/agencies/city_of_seattle/seattle_police_department/copbook/7736/
---

**Age as of Feb. 24, 2016:** 36


text:
(function (f, define) {
    define('kendo.timepicker', ['kendo.popup'], f);
}(function () {
    var __meta__ = {
        id: 'timepicker',
        name: 'TimePicker',
        category: 'web',
        description: 'The TimePicker widget allows the end user to select a value from a list of predefined values or to type a new value.',
        depends: ['popup']
    };
    (function ($, undefined) {
        var kendo = window.kendo, keys = kendo.keys, parse = kendo.parseDate, activeElement = kendo._activeElement, extractFormat = kendo._extractFormat, support = kendo.support, browser = support.browser, ui = kendo.ui, Widget = ui.Widget, OPEN = 'open', CLOSE = 'close', CHANGE = 'change', ns = '.kendoTimePicker', CLICK = 'click' + ns, DEFAULT = 'k-state-default', DISABLED = 'disabled', READONLY = 'readonly', LI = 'li', SPAN = '', FOCUSED = 'k-state-focused', HOVER = 'k-state-hover', HOVEREVENTS = 'mouseenter' + ns + ' mouseleave' + ns, MOUSEDOWN = 'mousedown' + ns, MS_PER_MINUTE = 60000, MS_PER_DAY = 86400000, SELECTED = 'k-state-selected', STATEDISABLED = 'k-state-disabled', ARIA_SELECTED = 'aria-selected', ARIA_EXPANDED = 'aria-expanded', ARIA_HIDDEN = 'aria-hidden', ARIA_DISABLED = 'aria-disabled', ARIA_ACTIVEDESCENDANT = 'aria-activedescendant', ID = 'id', isArray = $.isArray, extend = $.extend, proxy = $.proxy, DATE = Date, TODAY = new DATE();
        TODAY = new DATE(TODAY.getFullYear(), TODAY.getMonth(), TODAY.getDate(), 0, 0, 0);
        var TimeView = function (options) {
            var that = this, id = options.id;
            that.options = options;
            that._dates = [];
            that.ul = $('
').css({ overflow: support.kineticScrollNeeded ? '' : 'auto' }).on(CLICK, LI, proxy(that._click, that)).on('mouseenter' + ns, LI, function () {
                $(this).addClass(HOVER);
            }).on('mouseleave' + ns, LI, function () {
                $(this).removeClass(HOVER);
            });
            that.list = $('
').append(that.ul).on(MOUSEDOWN, preventDefault);
            if (id) {
                that._timeViewID = id + '_timeview';
                that._optionID = id + '_option_selected';
                that.ul.attr(ID, that._timeViewID);
            }
            that._popup();
            that._heightHandler = proxy(that._height, that);
            that.template = kendo.template('
#=data#
', { useWithBlock: false });
        };
        TimeView.prototype = {
            current: function (candidate) {
                var that = this, active = that.options.active;
                if (candidate !== undefined) {
                    if (that._current) {
                        that._current.removeClass(SELECTED).removeAttr(ARIA_SELECTED).removeAttr(ID);
                    }
                    if (candidate) {
                        candidate = $(candidate).addClass(SELECTED).attr(ID, that._optionID).attr(ARIA_SELECTED, true);
                        that.scroll(candidate[0]);
                    }
                    that._current = candidate;
                    if (active) {
                        active(candidate);
                    }
                } else {
                    return that._current;
                }
            },
            close: function () {
                this.popup.close();
            },
            destroy: function () {
                var that = this;
                that.ul.off(ns);
                that.list.off(ns);
                that.popup.destroy();
            },
            open: function () {
                var that = this;
                if (!that.ul[0].firstChild) {
                    that.bind();
                }
                that.popup.open();
                if (that._current) {
                    that.scroll(that._current[0]);
                }
            },
            dataBind: function (dates) {
                var that = this, options = that.options, format = options.format, toString = kendo.toString, template = that.template, length = dates.length, idx = 0, date, html = '';
                for (; idx < length; idx++) {
                    date = dates[idx];
                    if (isInRange(date, options.min, options.max)) {
                        html += template(toString(date, format, options.culture));
                    }
                }
                that._html(html);
            },
            refresh: function () {
                var that = this, options = that.options, format = options.format, offset = dst(), ignoreDST = offset < 0, min = options.min, max = options.max, msMin = getMilliseconds(min), msMax = getMilliseconds(max), msInterval = options.interval * MS_PER_MINUTE, toString = kendo.toString, template = that.template, start = new DATE(+min), startDay = start.getDate(), msStart, lastIdx, idx = 0, length, html = '';
                if (ignoreDST) {
                    length = (MS_PER_DAY + offset * MS_PER_MINUTE) / msInterval;
                } else {
                    length = MS_PER_DAY / msInterval;
                }
                if (msMin != msMax) {
                    if (msMin > msMax) {
                        msMax += MS_PER_DAY;
                    }
                    length = (msMax - msMin) / msInterval + 1;
                }
                lastIdx = parseInt(length, 10);
                for (; idx < length; idx++) {
                    if (idx) {
                        setTime(start, msInterval, ignoreDST);
                    }
                    if (msMax && lastIdx == idx) {
                        msStart = getMilliseconds(start);
                        if (startDay < start.getDate()) {
                            msStart += MS_PER_DAY;
                        }
                        if (msStart > msMax) {
                            start = new DATE(+max);
                        }
                    }
                    that._dates.push(getMilliseconds(start));
                    html += template(toString(start, format, options.culture));
                }
                that._html(html);
            },
            bind: function () {
                var that = this, dates = that.options.dates;
                if (dates && dates[0]) {
                    that.dataBind(dates);
                } else {
                    that.refresh();
                }
            },
            _html: function (html) {
                var that = this;
                that.ul[0].innerHTML = html;
                that.popup.unbind(OPEN, that._heightHandler);
                that.popup.one(OPEN, that._heightHandler);
                that.current(null);
                that.select(that._value);
            },
            scroll: function (item) {
                if (!item) {
                    return;
                }
                var content = this.list[0], itemOffsetTop = item.offsetTop, itemOffsetHeight = item.offsetHeight, contentScrollTop = content.scrollTop, contentOffsetHeight = content.clientHeight, bottomDistance = itemOffsetTop + itemOffsetHeight;
                if (contentScrollTop > itemOffsetTop) {
                    contentScrollTop = itemOffsetTop;
                } else if (bottomDistance > contentScrollTop + contentOffsetHeight) {
                    contentScrollTop = bottomDistance - contentOffsetHeight;
                }
                content.scrollTop = contentScrollTop;
            },
            select: function (li) {
                var that = this, options = that.options, current = that._current, selection;
                if (li instanceof Date) {
                    li = kendo.toString(li, options.format, options.culture);
                }
                if (typeof li === 'string') {
                    if (!current || current.text() !== li) {
                        li = $.grep(that.ul[0].childNodes, function (node) {
                            return (node.textContent || node.innerText) == li;
                        });
                        li = li[0] ? li : null;
                    } else {
                        li = current;
                    }
                }
                selection = that._distinctSelection(li);
                that.current(selection);
            },
            _distinctSelection: function (selection) {
                var that = this, currentValue, selectionIndex;
                if (selection && selection.length > 1) {
                    currentValue = getMilliseconds(that._value);
                    selectionIndex = $.inArray(currentValue, that._dates);
                    selection = that.ul.children()[selectionIndex];
                }
                return selection;
            },
            setOptions: function (options) {
                var old = this.options;
                options.min = parse(options.min);
                options.max = parse(options.max);
                this.options = extend(old, options, {
                    active: old.active,
                    change: old.change,
                    close: old.close,
                    open: old.open
                });
                this.bind();
            },
            toggle: function () {
                var that = this;
                if (that.popup.visible()) {
                    that.close();
                } else {
                    that.open();
                }
            },
            value: function (value) {
                var that = this;
                that._value = value;
                if (that.ul[0].firstChild) {
                    that.select(value);
                }
            },
            _click: function (e) {
                var that = this, li = $(e.currentTarget), date = li.text(), dates = that.options.dates;
                if (dates && dates.length > 0) {
                    date = dates[li.index()];
                }
                if (!e.isDefaultPrevented()) {
                    that.select(li);
                    that.options.change(date, true);
                    that.close();
                }
            },
            _height: function () {
                var that = this;
                var list = that.list;
                var parent = list.parent('.k-animation-container');
                var height = that.options.height;
                if (that.ul[0].children.length) {
                    list.add(parent).show().height(that.ul[0].scrollHeight > height ? height : 'auto').hide();
                }
            },
            _parse: function (value) {
                var that = this, options = that.options, current = that._value || TODAY;
                if (value instanceof DATE) {
                    return value;
                }
                value = parse(value, options.parseFormats, options.culture);
                if (value) {
                    value = new DATE(current.getFullYear(), current.getMonth(), current.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds());
                }
                return value;
            },
            _adjustListWidth: function () {
                var list = this.list, width = list[0].style.width, wrapper = this.options.anchor, computedStyle, computedWidth, outerWidth = kendo._outerWidth;
                if (!list.data('width') && width) {
                    return;
                }
                computedStyle = window.getComputedStyle ? window.getComputedStyle(wrapper[0], null) : 0;
                computedWidth = computedStyle ? parseFloat(computedStyle.width) : outerWidth(wrapper);
                if (computedStyle && (browser.mozilla || browser.msie)) {
                    computedWidth += parseFloat(computedStyle.paddingLeft) + parseFloat(computedStyle.paddingRight) + parseFloat(computedStyle.borderLeftWidth) + parseFloat(computedStyle.borderRightWidth);
                }
                width = computedWidth - (outerWidth(list) - list.width());
                list.css({
                    fontFamily: wrapper.css('font-family'),
                    width: width
                }).data('width', width);
            },
            _popup: function () {
                var that = this, list = that.list, options = that.options, anchor = options.anchor;
                that.popup = new ui.Popup(list, extend(options.popup, {
                    anchor: anchor,
                    open: options.open,
                    close: options.close,
                    animation: options.animation,
                    isRtl: support.isRtl(options.anchor)
                }));
            },
            move: function (e) {
                var that = this, key = e.keyCode, ul = that.ul[0], current = that._current, down = key === keys.DOWN;
                if (key === keys.UP || down) {
                    if (e.altKey) {
                        that.toggle(down);
                        return;
                    } else if (down) {
                        current = current ? current[0].nextSibling : ul.firstChild;
                    } else {
                        current = current ? current[0].previousSibling : ul.lastChild;
                    }
                    if (current) {
                        that.select(current);
                    }
                    that.options.change(that._current.text());
                    e.preventDefault();
                } else if (key === keys.ENTER || key === keys.TAB || key === keys.ESC) {
                    e.preventDefault();
                    if (current) {
                        that.options.change(current.text(), true);
                    }
                    that.close();
                }
            }
        };
        function setTime(date, time, ignoreDST) {
            var offset = date.getTimezoneOffset(), offsetDiff;
            date.setTime(date.getTime() + time);
            if (!ignoreDST) {
                offsetDiff = date.getTimezoneOffset() - offset;
                date.setTime(date.getTime() + offsetDiff * MS_PER_MINUTE);
            }
        }
        function dst() {
            var today = new DATE(), midnight = new DATE(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0), noon = new DATE(today.getFullYear(), today.getMonth(), today.getDate(), 12, 0, 0);
            return -1 * (midnight.getTimezoneOffset() - noon.getTimezoneOffset());
        }
        function getMilliseconds(date) {
            return date.getHours() * 60 * MS_PER_MINUTE + date.getMinutes() * MS_PER_MINUTE + date.getSeconds() * 1000 + date.getMilliseconds();
        }
        function isInRange(value, min, max) {
            var msMin = getMilliseconds(min), msMax = getMilliseconds(max), msValue;
            if (!value || msMin == msMax) {
                return true;
            }
            msValue = getMilliseconds(value);
            if (msMin > msValue) {
                msValue += MS_PER_DAY;
            }
            if (msMax < msMin) {
                msMax += MS_PER_DAY;
            }
            return msValue >= msMin && msValue <= msMax;
        }
        TimeView.getMilliseconds = getMilliseconds;
        kendo.TimeView = TimeView;
        var TimePicker = Widget.extend({
            init: function (element, options) {
                var that = this, ul, timeView, disabled;
                Widget.fn.init.call(that, element, options);
                element = that.element;
                options = that.options;
                options.min = parse(element.attr('min')) || parse(options.min);
                options.max = parse(element.attr('max')) || parse(options.max);
                normalize(options);
                that._initialOptions = extend({}, options);
                that._wrapper();
                that.timeView = timeView = new TimeView(extend({}, options, {
                    id: element.attr(ID),
                    anchor: that.wrapper,
                    format: options.format,
                    change: function (value, trigger) {
                        if (trigger) {
                            that._change(value);
                        } else {
                            element.val(value);
                        }
                    },
                    open: function (e) {
                        that.timeView._adjustListWidth();
                        if (that.trigger(OPEN)) {
                            e.preventDefault();
                        } else {
                            element.attr(ARIA_EXPANDED, true);
                            ul.attr(ARIA_HIDDEN, false);
                        }
                    },
                    close: function (e) {
                        if (that.trigger(CLOSE)) {
                            e.preventDefault();
                        } else {
                            element.attr(ARIA_EXPANDED, false);
                            ul.attr(ARIA_HIDDEN, true);
                        }
                    },
                    active: function (current) {
                        element.removeAttr(ARIA_ACTIVEDESCENDANT);
                        if (current) {
                            element.attr(ARIA_ACTIVEDESCENDANT, timeView._optionID);
                        }
                    }
                }));
                ul = timeView.ul;
                that._icon();
                that._reset();
                try {
                    element[0].setAttribute('type', 'text');
                } catch (e) {
                    element[0].type = 'text';
                }
                element.addClass('k-input').attr({
                    'role': 'combobox',
                    'aria-expanded': false,
                    'aria-owns': timeView._timeViewID
                });
                disabled = element.is('[disabled]') || $(that.element).parents('fieldset').is(':disabled');
                if (disabled) {
                    that.enable(false);
                } else {
                    that.readonly(element.is('[readonly]'));
                }
                if (options.dateInput) {
                    var min = options.min;
                    var max = options.max;
                    var today = new DATE();
                    if (getMilliseconds(min) == getMilliseconds(max)) {
                        min = new DATE(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0);
                        max = new DATE(today.getFullYear(), today.getMonth(), today.getDate(), 24, 0, 0);
                    } else {
                        min = new DATE(today.getFullYear(), today.getMonth(), today.getDate(), min.getHours(), min.getMinutes(), min.getSeconds(), min.getMilliseconds());
                        max = new DATE(today.getFullYear(), today.getMonth(), today.getDate(), max.getHours(), max.getMinutes(), max.getSeconds(), max.getMilliseconds());
                    }
                    that._dateInput = new ui.DateInput(element, {
                        culture: options.culture,
                        format: options.format,
                        min: min,
                        max: max,
                        value: options.value
                    });
                }
                that._old = that._update(options.value || that.element.val());
                that._oldText = element.val();
                kendo.notify(that);
            },
            options: {
                name: 'TimePicker',
                min: TODAY,
                max: TODAY,
                format: '',
                dates: [],
                parseFormats: [],
                value: null,
                interval: 30,
                height: 200,
                animation: {}
            },
            events: [
                OPEN,
                CLOSE,
                CHANGE
            ],
            setOptions: function (options) {
                var that = this;
                var value = that._value;
                Widget.fn.setOptions.call(that, options);
                options = that.options;
                normalize(options);
                that.timeView.setOptions(options);
                if (value) {
                    that.element.val(kendo.toString(value, options.format, options.culture));
                }
            },
            dataBind: function (dates) {
                if (isArray(dates)) {
                    this.timeView.dataBind(dates);
                }
            },
            _editable: function (options) {
                var that = this, disable = options.disable, readonly = options.readonly, arrow = that._arrow.off(ns), element = that.element.off(ns), wrapper = that._inputWrapper.off(ns);
                if (!readonly && !disable) {
                    wrapper.addClass(DEFAULT).removeClass(STATEDISABLED).on(HOVEREVENTS, that._toggleHover);
                    element.removeAttr(DISABLED).removeAttr(READONLY).attr(ARIA_DISABLED, false).on('keydown' + ns, proxy(that._keydown, that)).on('focusout' + ns, proxy(that._blur, that)).on('focus' + ns, function () {
                        that._inputWrapper.addClass(FOCUSED);
                    });
                    arrow.on(CLICK, proxy(that._click, that)).on(MOUSEDOWN, preventDefault);
                } else {
                    wrapper.addClass(disable ? STATEDISABLED : DEFAULT).removeClass(disable ? DEFAULT : STATEDISABLED);
                    element.attr(DISABLED, disable).attr(READONLY, readonly).attr(ARIA_DISABLED, disable);
                }
            },
            readonly: function (readonly) {
                this._editable({
                    readonly: readonly === undefined ? true : readonly,
                    disable: false
                });
            },
            enable: function (enable) {
                this._editable({
                    readonly: false,
                    disable: !(enable = enable === undefined ? true : enable)
                });
            },
            destroy: function () {
                var that = this;
                Widget.fn.destroy.call(that);
                that.timeView.destroy();
                that.element.off(ns);
                that._arrow.off(ns);
                that._inputWrapper.off(ns);
                if (that._form) {
                    that._form.off('reset', that._resetHandler);
                }
            },
            close: function () {
                this.timeView.close();
            },
            open: function () {
                this.timeView.open();
            },
            min: function (value) {
                return this._option('min', value);
            },
            max: function (value) {
                return this._option('max', value);
            },
            value: function (value) {
                var that = this;
                if (value === undefined) {
                    return that._value;
                }
                that._old = that._update(value);
                if (that._old === null) {
                    that.element.val('');
                }
                that._oldText = that.element.val();
            },
            _blur: function () {
                var that = this, value = that.element.val();
                that.close();
                if (value !== that._oldText) {
                    that._change(value);
                }
                that._inputWrapper.removeClass(FOCUSED);
            },
            _click: function () {
                var that = this, element = that.element;
                that.timeView.toggle();
                if (!support.touch && element[0] !== activeElement()) {
                    element.focus();
                }
            },
            _change: function (value) {
                var that = this;
                value = that._update(value);
                if (+that._old != +value) {
                    that._old = value;
                    that._oldText = that.element.val();
                    if (!that._typing) {
                        that.element.trigger(CHANGE);
                    }
                    that.trigger(CHANGE);
                }
                that._typing = false;
            },
            _icon: function () {
                var that = this, element = that.element, arrow;
                arrow = element.next('span.k-select');
                if (!arrow[0]) {
                    arrow = $('').insertAfter(element);
                }
                that._arrow = arrow.attr({
                    'role': 'button',
                    'aria-controls': that.timeView._timeViewID
                });
            },
            _keydown: function (e) {
                var that = this, key = e.keyCode, timeView = that.timeView, value = that.element.val();
                if (timeView.popup.visible() || e.altKey) {
                    timeView.move(e);
                    if (that._dateInput && e.stopImmediatePropagation) {
                        e.stopImmediatePropagation();
                    }
                } else if (key === keys.ENTER && value !== that._oldText) {
                    that._change(value);
                } else {
                    that._typing = true;
                }
            },
            _option: function (option, value) {
                var that = this, options = that.options;
                if (value === undefined) {
                    return options[option];
                }
                value = that.timeView._parse(value);
                if (!value) {
                    return;
                }
                value = new DATE(+value);
                options[option] = value;
                that.timeView.options[option] = value;
                that.timeView.bind();
            },
            _toggleHover: function (e) {
                $(e.currentTarget).toggleClass(HOVER, e.type === 'mouseenter');
            },
            _update: function (value) {
                var that = this, options = that.options, timeView = that.timeView, date = timeView._parse(value);
                if (!isInRange(date, options.min, options.max)) {
                    date = null;
                }
                that._value = date;
                if (that._dateInput) {
                    that._dateInput.value(date || value);
                } else {
                    that.element.val(kendo.toString(date || value, options.format, options.culture));
                }
                timeView.value(date);
                return date;
            },
            _wrapper: function () {
                var that = this, element = that.element, wrapper;
                wrapper = element.parents('.k-timepicker');
                if (!wrapper[0]) {
                    wrapper = element.wrap(SPAN).parent().addClass('k-picker-wrap k-state-default');
                    wrapper = wrapper.wrap(SPAN).parent();
                }
                wrapper[0].style.cssText = element[0].style.cssText;
                that.wrapper = wrapper.addClass('k-widget k-timepicker k-header').addClass(element[0].className);
                element.css({
                    width: '100%',
                    height: element[0].style.height
                });
                that._inputWrapper = $(wrapper[0].firstChild);
            },
            _reset: function () {
                var that = this, element = that.element, formId = element.attr('form'), form = formId ? $('#' + formId) : element.closest('form');
                if (form[0]) {
                    that._resetHandler = function () {
                        that.value(element[0].defaultValue);
                        that.max(that._initialOptions.max);
                        that.min(that._initialOptions.min);
                    };
                    that._form = form.on('reset', that._resetHandler);
                }
            }
        });
        function normalize(options) {
            var parseFormats = options.parseFormats;
            options.format = extractFormat(options.format || kendo.getCulture(options.culture).calendars.standard.patterns.t);
            parseFormats = isArray(parseFormats) ? parseFormats : [parseFormats];
            parseFormats.splice(0, 0, options.format);
            options.parseFormats = parseFormats;
        }
        function preventDefault(e) {
            e.preventDefault();
        }
        ui.plugin(TimePicker);
    }(window.kendo.jQuery));
    return window.kendo;
}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {
    (a3 || a2)();
}));


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.technovalley21.app.addtocardanimation.MainActivity">

    <android.support.v7.widget.Toolbar
        android:id="@id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:background="?attr/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <RelativeLayout

            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginLeft="-5dip"
            android:layout_marginRight="10dip">

            <TextView
                android:id="@+id/toolbar_center_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_gravity="center"
                android:layout_marginRight="5dip"
                android:ellipsize="end"
                android:singleLine="true"
                android:text="Cart Animation"
                android:textColor="@android:color/white"
                android:textSize="16sp"
                android:textStyle="normal" />

            <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/cartRelativeLayout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:clickable="true"
                android:paddingRight="3dip">

                <ImageButton
                    android:id="@+id/cartButtonIV"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@null"
                    android:clickable="false"
                    android:padding="5dip"
                    android:src="@drawable/cart" />

                <TextView
                    android:id="@+id/textNotify"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignRight="@id/cartButtonIV"
                    android:layout_alignTop="@id/cartButtonIV"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="5dip"
                    android:background="@drawable/cart_counter"
                    android:gravity="center"
                    android:minHeight="20dip"
                    android:minWidth="20dip"
                    android:padding="3dip"
                    android:text="0"
                    android:textColor="#fafafa"
                    android:textSize="12sp" />
            </RelativeLayout>
        </RelativeLayout>

    </android.support.v7.widget.Toolbar>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/toolbar"
        android:layout_marginBottom="8dp"
        android:layout_marginTop="8dp" />

</RelativeLayout>


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=IEventLogController.js.map


text:
<!DOCTYPE html>

        <link rel="icon" href="img/icon.ico">
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">
        <title>Mohamed Oun</title>

        <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

        <link href="css/freelancer.min.css" rel="stylesheet">

        <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
        <link href="https://fonts.googleapis.com/css?family=Slabo+27px:400,700" rel="stylesheet" type="text/css">
        <link href="https://fonts.googleapis.com/css?family=Roboto:400,700,400italic,700italic" rel="stylesheet" type="text/css">

 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation Menu
                </button> Mohamed Oun

 About

 Projects

 Mohamed Oun

 Software Engineer

About

 I'm an Egyptian software engineer, currently working at  Groupxs.

I really enjoy watching & playing football (Big Real Madrid fan!), movies, TV shows, video games,
                            music and travelling.

Playing with technology and using software to make my daily life easier & more efficient has always
                            been my passion, and that is why I became a software engineer.

 Here's my Resume,
                            and you can find all my links (Github, Twitter, etc) in the footer.

I'm mostly active on twitter, and sometimes, I write stuff on Dev.to.

Projects

Around the Web

 Copyright © Mohamed Oun

 Source

 Email: Mohamed3on@gmail.com

Twitter Friend Finder

This program analyzes your twitter friends, finds out the people you don't follow but
                                        have the most mutual friends with, so that you can find new cool accounts to follow.

Technologies: Python, Tweepy, HTML, Javascript.

Date: 2016

 <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

 Student Transcript System

Student Transcript System for students to view their grades, detailed marks, passing status
                                    and more. Also an admin side where they can delete, modify and add grades.

Technologies: PHP, Javascript, HTML, CSS, jQuery.

Date: 2015

 <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Co-op space shooter

A 2-player shooter set in space, fighting aliens to get back to earth!

Technologies: Unity, C#.

Date:  2015

Awards:  Best video game award (BUE competition, 2016).

 <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

DVD Rental System

 A DVD Store System to rent, buy and view movies and TV shows.

Technologies: Java, Derby.

Date: 2014

 <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Arabic Spell-checker

 A GUI for Arabic spell checking and next word prediction.

Technologies: Java.

Date: 2016

 <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

IMDB Top Movies

 An application that searches IMDB, compiles a list of its most highly rated titles and displays
                                    them in a Django web app. (Works with Goodreads too)

Technologies: Python, BeautifulSoup, Django, Bootstrap.

Date: 2017

 <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>


text:
  Aviré est
       un village
       localisé dans le département de Maine-et-Loire en Pays de la Loire. Elle comptait 426 habitants en 2008.

Si vous pensez venir habiter à Aviré, vous pourrez facilement trouver une maison à acheter.

À proximité de Aviré sont positionnées géographiquement les villes de
Montguillon localisée à 4 km, 184 habitants,
La Chapelle-sur-Oudon à 4 km, 551 habitants,
Chambellay à 8 km, 296 habitants,
Andigné située à 4 km, 307 habitants,
Saint-Martin-du-Bois à 3 km, 784 habitants,
Saint-Sauveur-de-Flée localisée à 5 km, 280 habitants,
 entre autres. De plus, Aviré est située à seulement 27 km de Avrillé.

Le nombre d'habitations, à Aviré, se décomposait en 2011 en deux appartements et 201 maisons soit
 un marché relativement équilibré.

La commune compte quelques  aménagements, elle dispose, entre autres, de un terrain de sport.


text:
package org.jooq.lambda;

import java.util.Collection;
import java.util.Collections;

import static java.util.Comparator.naturalOrder;
import static java.util.Comparator.comparing;
import static java.util.Collections.binarySearch;
import static org.jooq.lambda.Seq.seq;
import static org.jooq.lambda.tuple.Tuple.tuple;

import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.function.ToDoubleFunction;
import java.util.function.ToIntFunction;
import java.util.function.ToLongFunction;
import java.util.stream.Collector;
import java.util.stream.Collectors;

import org.jooq.lambda.tuple.Tuple2;

/**
 * @author Lukas Eder
 */
class WindowImpl<T> implements Window<T> {

    final Tuple2<T, Long>       value;
    final int                   index;
    final Partition<T>          partition;
    final Comparator<? super T> order;
    final long                  lower;
    final long                  upper;

    @SuppressWarnings({ "unchecked" })
    WindowImpl(
        Tuple2<T, Long> value,
        Partition<T> partition,
        WindowSpecification<T> specification
    ) {
        this.value = value;
        this.partition = partition;
        this.order = specification.order().orElse((Comparator<? super T>) naturalOrder());
        this.lower = specification.lower();
        this.upper = specification.upper();

        int i = specification.order().isPresent()
              ? binarySearch(partition.list, value, comparing((Tuple2<T, Long> t) -> t.v1, specification.order().get()).thenComparing(t -> t.v2))
              : binarySearch(partition.list, value, comparing(t -> t.v2));
        this.index = (i >= 0 ? i : -i - 1);
    }

    // Accessor methods
    // -------------------------------------------------------------------------

    @Override
    public T value() {
        return value.v1;
    }

    @Override
    public Seq<T> window() {
        return Seq.seq(partition.list.subList(lower(), upper() + 1)).map(t -> t.v1);
    }

    // Utilities
    // -------------------------------------------------------------------------

    private int lower() {
        // TODO: What about under/overflows?
        return lower == Long.MIN_VALUE ? 0 : (int) Math.max(0L, index + lower);
    }

    private boolean lowerInPartition() {
        // TODO: What about under/overflows?
        return lower == Long.MIN_VALUE || (index + lower >= 0L && index + lower < partition.list.size());
    }

    private int upper() {
        // TODO: What about under/overflows?
        return upper == Long.MAX_VALUE ? partition.list.size() - 1 : (int) Math.min(partition.list.size() - 1, (index + upper));
    }

    private boolean upperInPartition() {
        // TODO: What about under/overflows?
        return upper == Long.MAX_VALUE || (index + upper >= 0L && index + upper < partition.list.size());
    }

    private boolean completePartition() {
        return count() == partition.list.size();
    }

    // Ranking functions
    // -------------------------------------------------------------------------

    @Override
    public long rowNumber() {
        return (long) index;
    }

    @Override
    public long rank() {
        return seq(partition.list).map(t -> t.v1).collect(Agg.rank(value.v1, order)).get();
    }

    @Override
    public long denseRank() {
        return seq(partition.list).map(t -> t.v1).collect(Agg.denseRank(value.v1, order)).get();
    }

    @Override
    public double percentRank() {
        return ((double) rank()) / ((double) (partition.list.size() - 1));
    }

    @Override
    public long ntile(long bucket) {
        return (bucket * rowNumber() / partition.list.size());
    }

    @Override
    public Optional<T> lead() {
        return lead(1);
    }

    @Override
    public Optional<T> lead(long lead) {
        return lead0(lead);
    }

    @Override
    public Optional<T> lag() {
        return lag(1);
    }

    @Override
    public Optional<T> lag(long lag) {
        return lead0(-lag);
    }

    private Optional<T> lead0(long lead) {
        if (lead == 0)
            return Optional.of(value.v1);
        else if (index + lead >= 0 && index + lead < partition.list.size())
            return Optional.of(partition.list.get(index + (int) lead).v1);
        else
            return Optional.empty();
    }

    @Override
    public Optional<T> firstValue() {
        return firstValue(t -> t);
    }

    @Override
    public <U> Optional<U> firstValue(Function<? super T, ? extends U> function) {
        return lowerInPartition()
             ? Optional.of(function.apply(partition.list.get(lower()).v1))
             : upperInPartition()
             ? Optional.of(function.apply(partition.list.get(0).v1))
             : Optional.empty();
    }

    @Override
    public Optional<T> lastValue() {
        return lastValue(t -> t);
    }

    @Override
    public <U> Optional<U> lastValue(Function<? super T, ? extends U> function) {
        return upperInPartition()
             ? Optional.of(function.apply(partition.list.get(upper()).v1))
             : lowerInPartition()
             ? Optional.of(function.apply(partition.list.get(partition.list.size() - 1).v1))
             : Optional.empty();
    }

    @Override
    public Optional<T> nthValue(long n) {
        return nthValue(n, t -> t);
    }

    @Override
    public <U> Optional<U> nthValue(long n, Function<? super T, ? extends U> function) {
        return lower() + n <= upper()
             ? Optional.of(function.apply(partition.list.get(lower() + (int) n).v1))
             : Optional.empty();
    }

    // Aggregate functions
    // -------------------------------------------------------------------------

    @Override
    public long count() {
        return 1 + upper() - lower();
    }

    @Override
    public long count(Predicate<? super T> predicate) {
        return partition.cacheIf(completePartition(), tuple("count", predicate), () -> window().count(predicate));
    }

    @Override
    public long countDistinct() {
        return partition.cacheIf(completePartition(), "countDistinct", () -> window().countDistinct());
    }

    @Override
    public long countDistinct(Predicate<? super T> predicate) {
        return partition.cacheIf(completePartition(), tuple("countDistinct", predicate), () -> window().countDistinct(predicate));
    }

    @Override
    public <U> long countDistinctBy(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("countDistinctBy", function), () -> window().countDistinctBy(function));
    }

    @Override
    public <U> long countDistinctBy(Function<? super T, ? extends U> function, Predicate<? super U> predicate) {
        return partition.cacheIf(completePartition(), tuple("countDistinctBy", function, predicate), () -> window().countDistinctBy(function, predicate));
    }

    @Override
    public Optional<T> sum() {
        return partition.cacheIf(completePartition(), "sum", () -> window().sum());
    }

    @Override
    public <U> Optional<U> sum(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("sum", function), () -> window().sum(function));
    }

    @Override
    public int sumInt(ToIntFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("sumInt", function), () -> window().sumInt(function));
    }

    @Override
    public long sumLong(ToLongFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("sumLong", function), () -> window().sumLong(function));
    }

    @Override
    public double sumDouble(ToDoubleFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("sumDouble", function), () -> window().sumDouble(function));
    }

    @Override
    public Optional<T> avg() {
        return partition.cacheIf(completePartition(), "avg", () -> window().avg());
    }

    @Override
    public <U> Optional<U> avg(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("avg", function), () -> window().avg(function));
    }

    @Override
    public double avgInt(ToIntFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("avgInt", function), () -> window().avgInt(function));
    }

    @Override
    public double avgLong(ToLongFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("avgLong", function), () -> window().avgLong(function));
    }

    @Override
    public double avgDouble(ToDoubleFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("avgDouble", function), () -> window().avgDouble(function));
    }

    @Override
    @SuppressWarnings("unchecked")
    public Optional<T> min() {
        return partition.cacheIf(completePartition(), "min", () -> window().min((Comparator) naturalOrder()));
    }

    @Override
    public Optional<T> min(Comparator<? super T> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("min", comparator), () -> window().min(comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Optional<U> min(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("min", function), () -> window().min(function));
    }

    @Override
    public <U> Optional<U> min(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("min", function, comparator), () -> window().min(function, comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Optional<T> minBy(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("minBy", function), () -> window().minBy(function));
    }

    @Override
    public <U> Optional<T> minBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("minBy", function, comparator), () -> window().minBy(function, comparator));
    }

    @Override
    @SuppressWarnings("unchecked")
    public Seq<T> minAll() {
        return partition.cacheIf(completePartition(), "minAll", () -> window().minAll((Comparator) naturalOrder()));
    }

    @Override
    public Seq<T> minAll(Comparator<? super T> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("minAll", comparator), () -> window().minAll(comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Seq<U> minAll(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("minAll", function), () -> window().minAll(function));
    }

    @Override
    public <U> Seq<U> minAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("minAll", function, comparator), () -> window().minAll(function, comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Seq<T> minAllBy(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("minAllBy", function), () -> window().minAllBy(function));
    }

    @Override
    public <U> Seq<T> minAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("minAllBy", function, comparator), () -> window().minAllBy(function, comparator));
    }

    @Override
    @SuppressWarnings("unchecked")
    public Optional<T> max() {
        return partition.cacheIf(completePartition(), "max", () -> window().max((Comparator) naturalOrder()));
    }

    @Override
    public Optional<T> max(Comparator<? super T> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("max", comparator), () -> window().max(comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Optional<U> max(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("max", function), () -> window().max(function));
    }

    @Override
    public <U> Optional<U> max(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("max", function, comparator), () -> window().max(function, comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Optional<T> maxBy(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("maxBy", function), () -> window().maxBy(function));
    }

    @Override
    public <U> Optional<T> maxBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("maxBy", function, comparator), () -> window().maxBy(function, comparator));
    }

    @Override
    @SuppressWarnings("unchecked")
    public Seq<T> maxAll() {
        return partition.cacheIf(completePartition(), "maxAll", () -> window().maxAll((Comparator) naturalOrder()));
    }

    @Override
    public Seq<T> maxAll(Comparator<? super T> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("maxAll", comparator), () -> window().maxAll(comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Seq<U> maxAll(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("maxAll", function), () -> window().maxAll(function));
    }

    @Override
    public <U> Seq<U> maxAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("maxAll", function, comparator), () -> window().maxAll(function, comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Seq<T> maxAllBy(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("maxAllBy", function), () -> window().maxAllBy(function));
    }

    @Override
    public <U> Seq<T> maxAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("maxAllBy", function, comparator), () -> window().maxAllBy(function, comparator));
    }

    @Override
    @SuppressWarnings("unchecked")
    public Optional<T> median() {
        return partition.cacheIf(completePartition(), "median", () -> window().median((Comparator) naturalOrder()));
    }

    @Override
    public Optional<T> median(Comparator<? super T> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("median", comparator), () -> window().median(comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Optional<T> medianBy(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("medianBy", function), () -> window().medianBy(function));
    }

    @Override
    public <U> Optional<T> medianBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("medianBy", function, comparator), () -> window().medianBy(function, comparator));
    }

    @Override
    @SuppressWarnings("unchecked")
    public Optional<T> percentile(double percentile) {
        return partition.cacheIf(completePartition(), () -> tuple("percentile", percentile), () -> window().percentile(percentile, (Comparator) naturalOrder()));
    }

    @Override
    public Optional<T> percentile(double percentile, Comparator<? super T> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("percentile", percentile, comparator), () -> window().percentile(percentile, comparator));
    }

    @Override
    public <U extends Comparable<? super U>> Optional<T> percentileBy(double percentile, Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("percentileBy", percentile, function), () -> window().percentileBy(percentile, function));
    }

    @Override
    public <U> Optional<T> percentileBy(double percentile, Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
        return partition.cacheIf(completePartition(), () -> tuple("percentileBy", percentile, function, comparator), () -> window().percentileBy(percentile, function, comparator));
    }

    @Override
    public Optional<T> mode() {
        return partition.cacheIf(completePartition(), "mode", () -> window().mode());
    }

    @Override
    public <U> Optional<T> modeBy(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), tuple("modeBy", function), () -> window().modeBy(function));
    }

    @Override
    public Seq<T> modeAll() {
        return partition.cacheIf(completePartition(), "modeAll", () -> window().modeAll());
    }

    @Override
    public <U> Seq<T> modeAllBy(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), tuple("modeAllBy", function), () -> window().modeAllBy(function));
    }

    @Override
    public boolean allMatch(Predicate<? super T> predicate) {
        return partition.cacheIf(completePartition(), () -> tuple("allMatch", predicate), () -> window().allMatch(predicate));
    }

    @Override
    public boolean anyMatch(Predicate<? super T> predicate) {
        return partition.cacheIf(completePartition(), () -> tuple("anyMatch", predicate), () -> window().anyMatch(predicate));
    }

    @Override
    public boolean noneMatch(Predicate<? super T> predicate) {
        return partition.cacheIf(completePartition(), () -> tuple("noneMatch", predicate), () -> window().noneMatch(predicate));
    }

    @Override
    public Optional<T> bitAnd() {
        return partition.cacheIf(completePartition(), () -> tuple("bitAnd"), () -> window().bitAnd());
    }

    @Override
    public <U> Optional<U> bitAnd(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("bitAnd", function), () -> window().bitAnd(function));
    }

    @Override
    public int bitAndInt(ToIntFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("bitAndInt", function), () -> window().bitAndInt(function));
    }

    @Override
    public long bitAndLong(ToLongFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("bitAndLong", function), () -> window().bitAndLong(function));
    }

    @Override
    public Optional<T> bitOr() {
        return partition.cacheIf(completePartition(), () -> tuple("bitOr"), () -> window().bitOr());
    }

    @Override
    public <U> Optional<U> bitOr(Function<? super T, ? extends U> function) {
        return partition.cacheIf(completePartition(), () -> tuple("bitOr", function), () -> window().bitOr(function));
    }

    @Override
    public int bitOrInt(ToIntFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("bitOrInt", function), () -> window().bitOrInt(function));
    }

    @Override
    public long bitOrLong(ToLongFunction<? super T> function) {
        return partition.cacheIf(completePartition(), () -> tuple("bitOrLong", function), () -> window().bitOrLong(function));
    }

    @Override
    public <R, A> R collect(Collector<? super T, A, R> collector) {
        return partition.cacheIf(completePartition(), () -> tuple("collect", collector), () -> window().collect(collector));
    }

    @Override
    public List<T> toList() {
        return partition.cacheIf(completePartition(), "toList", () -> window().toList());
    }

    @Override
    public <L extends List<T>> L toList(Supplier<L> factory) {
        return partition.cacheIf(completePartition(), () -> tuple("toList", factory), () -> window().toList(factory));
    }

    @Override
    public List<T> toUnmodifiableList() {
        return Collections.unmodifiableList(toList());
    }

    @Override
    public Set<T> toSet() {
        return partition.cacheIf(completePartition(), "toSet", () -> window().toSet());
    }

    @Override
    public <S extends Set<T>> S toSet(Supplier<S> factory) {
        return partition.cacheIf(completePartition(), () -> tuple("toSet", factory), () -> window().toSet(factory));
    }

    @Override
    public Set<T> toUnmodifiableSet() {
        return Collections.unmodifiableSet(toSet());
    }

    @Override
    public <C extends Collection<T>> C toCollection(Supplier<C> factory) {
        return partition.cacheIf(completePartition(), () -> tuple("toCollection", factory), () -> window().toCollection(factory));
    }

    @Override
    public <K, V> Map<K, V> toMap(Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valueMapper) {
        return partition.cacheIf(completePartition(), () -> tuple("toMap", keyMapper, valueMapper), () -> window().toMap(keyMapper, valueMapper));
    }

    @Override
    public <K> Map<K, T> toMap(Function<? super T, ? extends K> keyMapper) {
        return toMap(keyMapper, Function.identity());
    }

    @Override
    public String toString() {
        return partition.cacheIf(completePartition(), "toString", () -> window().toString());
    }

    @Override
    public String toString(CharSequence delimiter) {
        return partition.cacheIf(completePartition(), () -> tuple("toString", delimiter), () -> Seq.toString(window(), delimiter));
    }

    @Override
    public String toString(CharSequence delimiter, CharSequence prefix, CharSequence suffix) {
        return partition.cacheIf(completePartition(), () -> tuple("toString", delimiter, prefix, suffix), () -> window().map(Objects::toString).collect(Collectors.joining(delimiter, prefix, suffix)));
    }

    @Override
    public String commonPrefix() {
        return partition.cacheIf(completePartition(), () -> "commonPrefix", () -> window().commonPrefix());
    }

    @Override
    public String commonSuffix() {
        return partition.cacheIf(completePartition(), () -> "commonSuffix", () -> window().commonSuffix());
    }
}


text:
FROM python:3.8

RUN dnf install -y mesa-libGL-devel \
    && pip install easyocr -i https://mirrors.aliyun.com/pypi/simple/ \
    && mkdir -p /easyocr/image

COPY main.py /easyocr/

VOLUME [ "/root/.EasyOCR/model", "/easyocr/image" ]

EXPOSE 8080

CMD [ "python", "/easyocr/main.py" ]


text:
package org.elasticsearch.index.flush;

import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Streamable;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;

import java.io.IOException;

public class FlushStats implements Streamable, ToXContent {

    private long total;

    private long totalTimeInMillis;

    public FlushStats() {

    }

    public FlushStats(long total, long totalTimeInMillis) {
        this.total = total;
        this.totalTimeInMillis = totalTimeInMillis;
    }

    public void add(long total, long totalTimeInMillis) {
        this.total += total;
        this.totalTimeInMillis += totalTimeInMillis;
    }

    public void add(FlushStats flushStats) {
        addTotals(flushStats);
    }

    public void addTotals(FlushStats flushStats) {
        if (flushStats == null) {
            return;
        }
        this.total += flushStats.total;
        this.totalTimeInMillis += flushStats.totalTimeInMillis;
    }

    /**
     * The total number of flush executed.
     */
    public long getTotal() {
        return this.total;
    }

    /**
     * The total time merges have been executed (in milliseconds).
     */
    public long getTotalTimeInMillis() {
        return this.totalTimeInMillis;
    }

    /**
     * The total time merges have been executed.
     */
    public TimeValue getTotalTime() {
        return new TimeValue(totalTimeInMillis);
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        builder.startObject(Fields.FLUSH);
        builder.field(Fields.TOTAL, total);
        builder.timeValueField(Fields.TOTAL_TIME_IN_MILLIS, Fields.TOTAL_TIME, totalTimeInMillis);
        builder.endObject();
        return builder;
    }

    static final class Fields {
        static final String FLUSH = "flush";
        static final String TOTAL = "total";
        static final String TOTAL_TIME = "total_time";
        static final String TOTAL_TIME_IN_MILLIS = "total_time_in_millis";
    }

    @Override
    public void readFrom(StreamInput in) throws IOException {
        total = in.readVLong();
        totalTimeInMillis = in.readVLong();
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        out.writeVLong(total);
        out.writeVLong(totalTimeInMillis);
    }
}


text:
<?php
return array (
  'HTML tracking code' => 'HTML izleme kodu',
);


text:
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class MultiResourcePartitionerUT {

  @Before
  public void setUp() throws Exception {
  }

  @After
  public void tearDown() throws Exception {
  }

  @Test
  public void test() {
    // fail("Not yet implemented");

    String jobConfigXml = "f://tmp//batch//partitionFileJob.xml";

    ApplicationContext ctx = new FileSystemXmlApplicationContext(jobConfigXml);

    // SimpleJobLauncher jobLuncher = (SimpleJobLauncher) ctx
    // .getBean("jobLauncher");

    MockMultiResourcePartitioner x = (MockMultiResourcePartitioner) ctx
        .getBean("partitioner");

    System.out.println(x);
  }

  @Test
  public void testCase1() {
    MockMultiResourcePartitioner x = new MockMultiResourcePartitioner();
    String fileResourcePattern = "file:xxxE:\\wrk\\text-classification-v2\\src\\main\\resources\\data\\reviews\\reviews-*.txt";
    // x.setResources(fileResourcePattern);

  }

}


text:
.box {
  width: 222px;
  height: 400px;
}
.box:hover {
  background: #eee;
  transition-delay: 0s;
  transition-duration: 420s;
  transition-property: background;
  transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
}
.box:not(:hover) {
  background: #000;
  transition-delay: 0s;
  transition-duration: 420s;
  transition-property: background;
  transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
}