text:
<?php

namespace Ublaboo\DataGrid\Tests\Files;

use Nette;
use Ublaboo\DataGrid\DataGrid;

final class ExportTestingPresenter extends Nette\Application\UI\Presenter
{

	protected function createComponentGrid($name)
	{
		$grid = new DataGrid(NULL, $name);
		$grid->addExportCsv('export', 'export.csv');

		return $grid;
	}

}


text:
module.exports = {
    endpoints: {
        traffic: {
            stations: 'http://www.comune.cagliari.it/portale/api/rs/en/traffico/postazioni.json',
            station: 'http://www.comune.cagliari.it/portale/api/rs/en/traffico/postazione.json',
            stationData: 'http://www.comune.cagliari.it/portale/api/rs/en/traffico/misurepostazione.json',
            sensorData: 'http://www.comune.cagliari.it/portale/api/rs/en/traffico/misuresensore.json'
        }
    },
    errors:{
        generic: 'An Error happened calling the Stations API endpoint, maybe due to a temporary server issue. Please, retry later',
        dates: 'Error processing dates, please check them',
        missingId: 'id field is mandatory, please check it'
    }
};

redpajama_set_name: RedPajamaGithub


text:
require 'grape'
path = File.expand_path('../../../../',__FILE__)
require File.join(path, 'models', 'post')

module API
  module V1
    class PostEndPoint < Grape::API
      format :json

      resource :posts do
        desc 'List All posts'
        get do
          Post.all
        end

        desc 'Return a post.'
        params do
          requires :id, type: Integer, desc: "Id."
        end
        route_param :id do
          get do
            post = Post.get(params[:id])
            post.nil? ? {:errors => ["Post not found"]} : post
          end
        end

        desc 'Create a post'
        params do
          requires :title, type: String, desc: "Title"
          requires :description, type: String, desc: "Description"
        end
        post do
          res = {errors:[]}
          post = Post.first(:title => params[:title])
          if post.nil?
            post = Post.new()
            post.title = params[:title]
            post.description = params[:description]
            saved = post.save
          else
            res[:errors].push("Post already exists")
          end
          res[:errors].empty? ? post.attributes : res
        end

        desc 'Update title and description'
        params do
          requires :title, type: String, desc: "Title"
          requires :description, type: String, desc: "Description"
        end
        route_param :id do
          res = {success:[], errors:[]}
          put do
            post = Post.get(params[:id])
            unless post.nil?
              post.title = params[:title]
              post.description = params[:description]
              saved = post.save
              saved ? res[:success].push("Post updated") : res[:errros].push("Post not updated")
            else
              res[:errors].push("Post not found")
            end
            res
          end
        end

        desc "Delete a post."
        params do
          requires :id, type: Integer, desc: "id"
        end
        delete ':id' do

          deleted = Post.get(params[:id]).destroy
          deleted ? deleted : {:errors => ["Post not deleted"]}
        end
      end

    end
  end
end


text:
import { Runners } from './Runners';
import { Pipelines } from './Pipelines';
import { ProjectBuilds } from './ProjectBuilds';
import { ProjectMergeRequests } from './ProjectMergeRequests';
import { ProjectKeys } from './ProjectDeployKeys';
import { ProjectMilestones } from './ProjectMilestones';
import { ProjectRepository } from './ProjectRepository';
import { ProjectLabels } from './ProjectLabels';
import { ProjectIssues } from './ProjectIssues';
import { ProjectHooks } from './ProjectHooks';
import { ProjectMembers } from './ProjectMembers';
import { BaseModel, DefParams, TId } from '../BaseModel';
import { ProjectServices } from './ProjectServices';

type ProjectsCb = (projects: any[]) => any;

export class Projects extends BaseModel {

    readonly members: ProjectMembers;
    readonly hooks: ProjectHooks;
    readonly issues: ProjectIssues;
    readonly labels: ProjectLabels;
    readonly repository: ProjectRepository;
    readonly milestones: ProjectMilestones;
    readonly deploy_keys: ProjectKeys;
    readonly merge_requests: ProjectMergeRequests;
    readonly services: ProjectServices;
    readonly builds: ProjectBuilds;
    readonly pipelines: Pipelines;
    readonly runners: Runners;

    all(fn?: ProjectsCb): any;
    all(params?: DefParams, fn?: ProjectsCb): any;
    allAdmin(fn?: Function): any;
    allAdmin(params?: DefParams, fn?: Function): any;
    show(projectId: TId, fn?: Function): any;
    create(params: object, fn?: Function): any;
    create_for_user(params: object, fn?: Function): any;
    edit(projectId: TId, params: object, fn?: Function): any;
    addMember(params?: object, fn?: Function): any;
    editMember(params?: object, fn?: Function): any;
    listMembers(params?: object, fn?: Function): any;
    listCommits(params?: object, fn?: Function): any;
    listTags(params?: object, fn?: Function): any;
    remove(projectId: TId, fn?: Function): any;
    fork(params?: object, fn?: Function): any;
    share(params?: object, fn?: Function): any;
    search(projectName: string, fn?: Function): any;
    search(projectName: string, params?: object, fn?: Function): any;
    listTriggers(projectId: TId, fn?: Function): any;
    showTrigger(projectId: TId, token: string, fn?: Function): any;
    createTrigger(params?: object, fn?: Function): any;
    removeTrigger(projectId: TId, token: string, fn?: Function): any;
}


text:
using System;
using Xunit;

public class AffineCipherTests
{
    [Fact]
    public void Encode_yes()
    {
        Assert.Equal("xbt", AffineCipher.Encode("yes", 5, 7));
    }

    [Fact(Skip = "Remove to run test")]
    public void Encode_no()
    {
        Assert.Equal("fu", AffineCipher.Encode("no", 15, 18));
    }

    [Fact(Skip = "Remove to run test")]
    public void Encode_omg()
    {
        Assert.Equal("lvz", AffineCipher.Encode("OMG", 21, 3));
    }

    [Fact(Skip = "Remove to run test")]
    public void Encode_o_m_g()
    {
        Assert.Equal("hjp", AffineCipher.Encode("O M G", 25, 47));
    }

    [Fact(Skip = "Remove to run test")]
    public void Encode_mindblowingly()
    {
        Assert.Equal("rzcwa gnxzc dgt", AffineCipher.Encode("mindblowingly", 11, 15));
    }

    [Fact(Skip = "Remove to run test")]
    public void Encode_numbers()
    {
        Assert.Equal("jqgjc rw123 jqgjc rw", AffineCipher.Encode("Testing,1 2 3, testing.", 3, 4));
    }

    [Fact(Skip = "Remove to run test")]
    public void Encode_deep_thought()
    {
        Assert.Equal("iynia fdqfb ifje", AffineCipher.Encode("Truth is fiction.", 5, 17));
    }

    [Fact(Skip = "Remove to run test")]
    public void Encode_all_the_letters()
    {
        Assert.Equal("swxtj npvyk lruol iejdc blaxk swxmh qzglf", AffineCipher.Encode("The quick brown fox jumps over the lazy dog.", 17, 33));
    }

    [Fact(Skip = "Remove to run test")]
    public void Encode_with_a_not_coprime_to_m()
    {
        Assert.Throws<ArgumentException>(() => AffineCipher.Encode("This is a test.", 6, 17));
    }

    [Fact(Skip = "Remove to run test")]
    public void Decode_exercism()
    {
        Assert.Equal("exercism", AffineCipher.Decode("tytgn fjr", 3, 7));
    }

    [Fact(Skip = "Remove to run test")]
    public void Decode_a_sentence()
    {
        Assert.Equal("anobstacleisoftenasteppingstone", AffineCipher.Decode("qdwju nqcro muwhn odqun oppmd aunwd o", 19, 16));
    }

    [Fact(Skip = "Remove to run test")]
    public void Decode_numbers()
    {
        Assert.Equal("testing123testing", AffineCipher.Decode("odpoz ub123 odpoz ub", 25, 7));
    }

    [Fact(Skip = "Remove to run test")]
    public void Decode_all_the_letters()
    {
        Assert.Equal("thequickbrownfoxjumpsoverthelazydog", AffineCipher.Decode("swxtj npvyk lruol iejdc blaxk swxmh qzglf", 17, 33));
    }

    [Fact(Skip = "Remove to run test")]
    public void Decode_with_no_spaces_in_input()
    {
        Assert.Equal("thequickbrownfoxjumpsoverthelazydog", AffineCipher.Decode("swxtjnpvyklruoliejdcblaxkswxmhqzglf", 17, 33));
    }

    [Fact(Skip = "Remove to run test")]
    public void Decode_with_too_many_spaces()
    {
        Assert.Equal("jollygreengiant", AffineCipher.Decode("vszzm    cly   yd cg    qdp", 15, 16));
    }

    [Fact(Skip = "Remove to run test")]
    public void Decode_with_a_not_coprime_to_m()
    {
        Assert.Throws<ArgumentException>(() => AffineCipher.Decode("Test", 13, 5));
    }
}


text:
#ifndef __HIERARCHICAL_ALLOCATOR_PROCESS_HPP__
#define __HIERARCHICAL_ALLOCATOR_PROCESS_HPP__

#include <algorithm>
#include <vector>

#include <mesos/resources.hpp>

#include <process/delay.hpp>
#include <process/id.hpp>
#include <process/timeout.hpp>

#include <stout/check.hpp>
#include <stout/duration.hpp>
#include <stout/hashmap.hpp>
#include <stout/stopwatch.hpp>
#include <stout/stringify.hpp>

#include "master/allocator.hpp"
#include "master/drf_sorter.hpp"
#include "master/master.hpp"
#include "master/sorter.hpp"

namespace mesos {
namespace internal {
namespace master {
namespace allocator {

// Forward declarations.
class Filter;

// We forward declare the hierarchical allocator process so that we
// can typedef an instantiation of it with DRF sorters.
template <typename RoleSorter, typename FrameworkSorter>
class HierarchicalAllocatorProcess;

typedef HierarchicalAllocatorProcess<DRFSorter, DRFSorter>
HierarchicalDRFAllocatorProcess;

struct Slave
{
  Slave() {}

  explicit Slave(const SlaveInfo& _info)
    : available(_info.resources()),
      activated(true),
      whitelisted(false),
      checkpoint(_info.checkpoint()),
      info(_info) {}

  Resources resources() const { return info.resources(); }

  std::string hostname() const { return info.hostname(); }

  // Contains all of the resources currently free on this slave.
  Resources available;

  // Whether the slave is activated. Resources are not offered for
  // deactivated slaves until they are reactivated.
  bool activated;

  // Indicates if the resources on this slave should be offered to
  // frameworks.
  bool whitelisted;

  bool checkpoint;
private:
  SlaveInfo info;
};

struct Framework
{
  Framework() {}

  explicit Framework(const FrameworkInfo& _info)
    : checkpoint(_info.checkpoint()),
      info(_info) {}

  std::string role() const { return info.role(); }

  // Filters that have been added by this framework.
  hashset<Filter*> filters;

  bool checkpoint;
private:
  FrameworkInfo info;
};

// Implements the basic allocator algorithm - first pick a role by
// some criteria, then pick one of their frameworks to allocate to.
template <typename RoleSorter, typename FrameworkSorter>
class HierarchicalAllocatorProcess : public AllocatorProcess
{
public:
  HierarchicalAllocatorProcess();

  virtual ~HierarchicalAllocatorProcess();

  process::PID<HierarchicalAllocatorProcess> self();

  void initialize(
      const Flags& flags,
      const process::PID<Master>& _master,
      const hashmap<std::string, RoleInfo>& _roles);

  void frameworkAdded(
      const FrameworkID& frameworkId,
      const FrameworkInfo& frameworkInfo,
      const Resources& used);

  void frameworkRemoved(
      const FrameworkID& frameworkId);

  void frameworkActivated(
      const FrameworkID& frameworkId,
      const FrameworkInfo& frameworkInfo);

  void frameworkDeactivated(
      const FrameworkID& frameworkId);

  void slaveAdded(
      const SlaveID& slaveId,
      const SlaveInfo& slaveInfo,
      const hashmap<FrameworkID, Resources>& used);

  void slaveRemoved(
      const SlaveID& slaveId);

  void slaveDeactivated(
      const SlaveID& slaveId);

  void slaveActivated(
      const SlaveID& slaveId);

  void updateWhitelist(
      const Option<hashset<std::string> >& whitelist);

  void resourcesRequested(
      const FrameworkID& frameworkId,
      const std::vector<Request>& requests);

  void resourcesRecovered(
      const FrameworkID& frameworkId,
      const SlaveID& slaveId,
      const Resources& resources,
      const Option<Filters>& filters);

  void offersRevived(
      const FrameworkID& frameworkId);

protected:
  // Useful typedefs for dispatch/delay/defer to self()/this.
  typedef HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter> Self;
  typedef HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter> This;

  // Callback for doing batch allocations.
  void batch();

  // Allocate any allocatable resources.
  void allocate();

  // Allocate resources just from the specified slave.
  void allocate(const SlaveID& slaveId);

  // Allocate resources from the specified slaves.
  void allocate(const hashset<SlaveID>& slaveIds);

  // Remove a filter for the specified framework.
  void expire(const FrameworkID& frameworkId, Filter* filter);

  // Checks whether the slave is whitelisted.
  bool isWhitelisted(const SlaveID& slave);

  // Returns true if there is a filter for this framework
  // on this slave.
  bool isFiltered(
      const FrameworkID& frameworkId,
      const SlaveID& slaveId,
      const Resources& resources);

  bool allocatable(const Resources& resources);

  bool initialized;

  Flags flags;
  process::PID<Master> master;

  // Contains all frameworks.
  hashmap<FrameworkID, Framework> frameworks;

  // Maps role names to the Sorter object which contains
  // all of that role's frameworks.
  hashmap<std::string, FrameworkSorter*> sorters;

  // Contains all active slaves.
  hashmap<SlaveID, Slave> slaves;

  hashmap<std::string, RoleInfo> roles;

  // Slaves to send offers for.
  Option<hashset<std::string> > whitelist;

  // Sorter containing all active roles.
  RoleSorter* roleSorter;
};

// Used to represent "filters" for resources unused in offers.
class Filter
{
public:
  virtual ~Filter() {}

  virtual bool filter(const SlaveID& slaveId, const Resources& resources) = 0;
};

class RefusedFilter: public Filter
{
public:
  RefusedFilter(
      const SlaveID& _slaveId,
      const Resources& _resources,
      const process::Timeout& _timeout)
    : slaveId(_slaveId), resources(_resources), timeout(_timeout) {}

  virtual bool filter(const SlaveID& slaveId, const Resources& resources)
  {
    return slaveId == this->slaveId &&
           resources <= this->resources && // Refused resources are superset.
           timeout.remaining() > Seconds(0);
  }

  const SlaveID slaveId;
  const Resources resources;
  const process::Timeout timeout;
};

template <class RoleSorter, class FrameworkSorter>
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::HierarchicalAllocatorProcess() // NOLINT(whitespace/line_length)
  : ProcessBase(process::ID::generate("hierarchical-allocator")),
    initialized(false) {}

template <class RoleSorter, class FrameworkSorter>
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::~HierarchicalAllocatorProcess() // NOLINT(whitespace/line_length)
{}

template <class RoleSorter, class FrameworkSorter>
process::PID<HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter> >
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::self()
{
  return process::PID<HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter> >(this); // NOLINT(whitespace/line_length)
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::initialize(
    const Flags& _flags,
    const process::PID<Master>& _master,
    const hashmap<std::string, RoleInfo>& _roles)
{
  flags = _flags;
  master = _master;
  roles = _roles;
  initialized = true;

  roleSorter = new RoleSorter();
  foreachpair (const std::string& name, const RoleInfo& roleInfo, roles) {
    roleSorter->add(name, roleInfo.weight());
    sorters[name] = new FrameworkSorter();
  }

  VLOG(1) << "Initializing hierarchical allocator process "
          << "with master : " << master;

  delay(flags.allocation_interval, self(), &Self::batch);
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::frameworkAdded(
    const FrameworkID& frameworkId,
    const FrameworkInfo& frameworkInfo,
    const Resources& used)
{
  CHECK(initialized);

  const std::string& role = frameworkInfo.role();

  CHECK(roles.contains(role));

  CHECK(!sorters[role]->contains(frameworkId.value()));
  sorters[role]->add(frameworkId.value());

  // Update the allocation to this framework.
  roleSorter->allocated(role, used);
  sorters[role]->add(used);
  sorters[role]->allocated(frameworkId.value(), used);

  frameworks[frameworkId] = Framework(frameworkInfo);

  LOG(INFO) << "Added framework " << frameworkId;

  allocate();
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::frameworkRemoved(
    const FrameworkID& frameworkId)
{
  CHECK(initialized);

  CHECK(frameworks.contains(frameworkId));
  const std::string& role = frameworks[frameworkId].role();

  // Might not be in 'sorters[role]' because it was previously
  // deactivated and never re-added.
  if (sorters[role]->contains(frameworkId.value())) {
    Resources allocation = sorters[role]->allocation(frameworkId.value());
    roleSorter->unallocated(role, allocation);
    sorters[role]->remove(allocation);
    sorters[role]->remove(frameworkId.value());
  }

  // Do not delete the filters contained in this
  // framework's 'filters' hashset yet, see comments in
  // HierarchicalAllocatorProcess::offersRevived and
  // HierarchicalAllocatorProcess::expire.
  frameworks.erase(frameworkId);

  LOG(INFO) << "Removed framework " << frameworkId;
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::frameworkActivated(
    const FrameworkID& frameworkId,
    const FrameworkInfo& frameworkInfo)
{
  CHECK(initialized);

  const std::string& role = frameworkInfo.role();
  sorters[role]->activate(frameworkId.value());

  LOG(INFO) << "Activated framework " << frameworkId;

  allocate();
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::frameworkDeactivated(
    const FrameworkID& frameworkId)
{
  CHECK(initialized);

  CHECK(frameworks.contains(frameworkId));
  const std::string& role = frameworks[frameworkId].role();

  sorters[role]->deactivate(frameworkId.value());

  // Note that the Sorter *does not* remove the resources allocated
  // to this framework. For now, this is important because if the
  // framework fails over and is activated, we still want a record
  // of the resources that it is using. We might be able to collapse
  // the added/removed and activated/deactivated in the future.

  // Do not delete the filters contained in this
  // framework's 'filters' hashset yet, see comments in
  // HierarchicalAllocatorProcess::offersRevived and
  // HierarchicalAllocatorProcess::expire.
  frameworks[frameworkId].filters.clear();

  LOG(INFO) << "Deactivated framework " << frameworkId;
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::slaveAdded(
    const SlaveID& slaveId,
    const SlaveInfo& slaveInfo,
    const hashmap<FrameworkID, Resources>& used)
{
  CHECK(initialized);

  CHECK(!slaves.contains(slaveId));

  slaves[slaveId] = Slave(slaveInfo);
  slaves[slaveId].whitelisted = isWhitelisted(slaveId);

  roleSorter->add(slaveInfo.resources());

  Resources unused = slaveInfo.resources();

  foreachpair (const FrameworkID& frameworkId,
               const Resources& resources,
               used) {
    if (frameworks.contains(frameworkId)) {
      const std::string& role = frameworks[frameworkId].role();
      sorters[role]->add(resources);
      sorters[role]->allocated(frameworkId.value(), resources);
      roleSorter->allocated(role, resources);
    }

    unused -= resources; // Only want to allocate resources that are not used!
  }

  slaves[slaveId].available = unused;

  LOG(INFO) << "Added slave " << slaveId << " (" << slaveInfo.hostname()
            << ") with " << slaveInfo.resources() << " (and " << unused
            << " available)";

  allocate(slaveId);
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::slaveRemoved(
    const SlaveID& slaveId)
{
  CHECK(initialized);
  CHECK(slaves.contains(slaveId));

  roleSorter->remove(slaves[slaveId].resources());

  slaves.erase(slaveId);

  // Note that we DO NOT actually delete any filters associated with
  // this slave, that will occur when the delayed
  // HierarchicalAllocatorProcess::expire gets invoked (or the framework
  // that applied the filters gets removed).

  LOG(INFO) << "Removed slave " << slaveId;
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::slaveDeactivated(
    const SlaveID& slaveId)
{
  CHECK(initialized);
  CHECK(slaves.contains(slaveId));

  slaves[slaveId].activated = false;

  LOG(INFO) << "Slave " << slaveId << " deactivated";
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::slaveActivated(
    const SlaveID& slaveId)
{
  CHECK(initialized);
  CHECK(slaves.contains(slaveId));

  slaves[slaveId].activated = true;

  LOG(INFO)<< "Slave " << slaveId << " reactivated";
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::updateWhitelist(
    const Option<hashset<std::string> >& _whitelist)
{
  CHECK(initialized);

  whitelist = _whitelist;

  if (whitelist.isSome()) {
    LOG(INFO) << "Updated slave white list: " << stringify(whitelist.get());

    foreachkey (const SlaveID& slaveId, slaves) {
      slaves[slaveId].whitelisted = isWhitelisted(slaveId);
    }
  }
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::resourcesRequested(
    const FrameworkID& frameworkId,
    const std::vector<Request>& requests)
{
  CHECK(initialized);

  LOG(INFO) << "Received resource request from framework " << frameworkId;
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::resourcesRecovered(
    const FrameworkID& frameworkId,
    const SlaveID& slaveId,
    const Resources& resources,
    const Option<Filters>& filters)
{
  CHECK(initialized);

  if (resources.allocatable().size() == 0) {
    return;
  }

  // Updated resources allocated to framework (if framework still
  // exists, which it might not in the event that we dispatched
  // Master::offer before we received AllocatorProcess::frameworkRemoved
  // or AllocatorProcess::frameworkDeactivated, in which case we will
  // have already recovered all of its resources).
  if (frameworks.contains(frameworkId) &&
      sorters[frameworks[frameworkId].role()]->contains(frameworkId.value())) {
    const std::string& role = frameworks[frameworkId].role();
    sorters[role]->unallocated(frameworkId.value(), resources);
    sorters[role]->remove(resources);
    roleSorter->unallocated(role, resources);
  }

  // Update resources allocatable on slave (if slave still exists,
  // which it might not in the event that we dispatched Master::offer
  // before we received Allocator::slaveRemoved).
  if (slaves.contains(slaveId)) {
    slaves[slaveId].available += resources;

    LOG(INFO) << "Recovered " << resources.allocatable()
              << " (total allocatable: " << slaves[slaveId].available
              << ") on slave " << slaveId
              << " from framework " << frameworkId;
  }

  // Create a filter for this slave/framework pair if both exist.
  if (frameworks.contains(frameworkId) && slaves.contains(slaveId)) {
    // Create a refused resources filter.
    Try<Duration> seconds_ = Duration::create(Filters().refuse_seconds());
    CHECK_SOME(seconds_);
    Duration seconds = seconds_.get();

    // Update the value of 'seconds' if the input isSome() and is
    // valid.
    if (filters.isSome()) {
      seconds_ = Duration::create(filters.get().refuse_seconds());
      if (seconds_.isError()) {
        LOG(WARNING) << "Using the default value of 'refuse_seconds' to create "
                     << "the refused resources filter because the input value "
                     << "is invalid: " << seconds_.error();
      } else if (seconds_.get() < Duration::zero()) {
        LOG(WARNING) << "Using the default value of 'refuse_seconds' to create "
                     << "the refused resources filter because the input value "
                     << "is negative";
      } else {
        seconds = seconds_.get();
      }
    }

    if (seconds != Duration::zero()) {
      VLOG(1) << "Framework " << frameworkId
              << " filtered slave " << slaveId
              << " for " << seconds;

      // Create a new filter and delay its expiration.
      Filter* filter =
        new RefusedFilter(slaveId, resources, process::Timeout::in(seconds));

      frameworks[frameworkId].filters.insert(filter);

      delay(seconds, self(), &Self::expire, frameworkId, filter);
    }
  }
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::offersRevived(
    const FrameworkID& frameworkId)
{
  CHECK(initialized);

  frameworks[frameworkId].filters.clear();

  // We delete each actual Filter when
  // HierarchicalAllocatorProcess::expire gets invoked. If we delete the
  // Filter here it's possible that the same Filter (i.e., same
  // address) could get reused and HierarchicalAllocatorProcess::expire
  // would expire that filter too soon. Note that this only works
  // right now because ALL Filter types "expire".

  LOG(INFO) << "Removed filters for framework " << frameworkId;

  allocate();
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::batch()
{
  CHECK(initialized);
  allocate();
  delay(flags.allocation_interval, self(), &Self::batch);
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::allocate()
{
  CHECK(initialized);

  Stopwatch stopwatch;
  stopwatch.start();

  allocate(slaves.keys());

  VLOG(1) << "Performed allocation for " << slaves.size() << " slaves in "
            << stopwatch.elapsed();
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::allocate(
    const SlaveID& slaveId)
{
  CHECK(initialized);

  hashset<SlaveID> slaveIds;
  slaveIds.insert(slaveId);

  Stopwatch stopwatch;
  stopwatch.start();

  allocate(slaveIds);

  VLOG(1) << "Performed allocation for slave " << slaveId << " in "
          << stopwatch.elapsed();
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::allocate(
    const hashset<SlaveID>& slaveIds_)
{
  CHECK(initialized);

  if (roleSorter->count() == 0) {
    VLOG(1) << "No roles to allocate resources!";
    return;
  }

  if (slaveIds_.empty()) {
    VLOG(1) << "No resources available to allocate!";
    return;
  }

  // Randomize the order in which slaves' resources are allocated.
  // TODO(vinod): Implement a smarter sorting algorithm.
  std::vector<SlaveID> slaveIds(slaveIds_.begin(), slaveIds_.end());
  std::random_shuffle(slaveIds.begin(), slaveIds.end());

  hashmap<FrameworkID, hashmap<SlaveID, Resources> > offerable;
  foreach (const SlaveID& slaveId, slaveIds) {
    // If the slave is not activated or whitelisted, ignore it.
    if (!slaves[slaveId].activated || !slaves[slaveId].whitelisted) {
      continue;
    }

    foreach (const std::string& role, roleSorter->sort()) {
      foreach (const std::string& frameworkIdValue, sorters[role]->sort()) {
        FrameworkID frameworkId;
        frameworkId.set_value(frameworkIdValue);

        Resources unreserved = slaves[slaveId].available.extract("*");
        Resources resources = unreserved;
        if (role != "*") {
          resources += slaves[slaveId].available.extract(role);
        }

        // If the resources are not allocatable, ignore.
        if (!allocatable(resources)) {
          continue;
        }

        // If the framework filters these resources, ignore.
        if (isFiltered(frameworkId, slaveId, resources)) {
          continue;
        }

        VLOG(1)
          << "Offering " << resources << " on slave " << slaveId
          << " to framework " << frameworkId;

        offerable[frameworkId][slaveId] = resources;

        // Update slave resources.
        slaves[slaveId].available -= resources;

        // Update the sorters.
        // We only count resources not reserved for this role
        // in the share the sorter considers.
        sorters[role]->add(unreserved);
        sorters[role]->allocated(frameworkIdValue, unreserved);
        roleSorter->allocated(role, unreserved);
      }
    }
  }

  // Now offer the resources to each framework.
  foreachkey (const FrameworkID& frameworkId, offerable) {
    dispatch(master, &Master::offer, frameworkId, offerable[frameworkId]);
  }
}

template <class RoleSorter, class FrameworkSorter>
void
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::expire(
    const FrameworkID& frameworkId,
    Filter* filter)
{
  // The filter might have already been removed (e.g., if the
  // framework no longer exists or in
  // HierarchicalAllocatorProcess::offersRevived) but not yet deleted (to
  // keep the address from getting reused possibly causing premature
  // expiration).
  if (frameworks.contains(frameworkId) &&
      frameworks[frameworkId].filters.contains(filter)) {
    frameworks[frameworkId].filters.erase(filter);
  }

  delete filter;
}

template <class RoleSorter, class FrameworkSorter>
bool
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::isWhitelisted(
    const SlaveID& slaveId)
{
  CHECK(initialized);

  CHECK(slaves.contains(slaveId));

  return whitelist.isNone() ||
         whitelist.get().contains(slaves[slaveId].hostname());
}

template <class RoleSorter, class FrameworkSorter>
bool
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::isFiltered(
    const FrameworkID& frameworkId,
    const SlaveID& slaveId,
    const Resources& resources)
{
  CHECK(frameworks.contains(frameworkId));
  CHECK(slaves.contains(slaveId));

  // Do not offer a non-checkpointing slave's resources to a checkpointing
  // framework. This is a short term fix until the following is resolved:
  // https://issues.apache.org/jira/browse/MESOS-444.
  if (frameworks[frameworkId].checkpoint && !slaves[slaveId].checkpoint) {
    VLOG(1) << "Filtered " << resources
            << " on non-checkpointing slave " << slaveId
            << " for checkpointing framework " << frameworkId;
    return true;
  }

  foreach (Filter* filter, frameworks[frameworkId].filters) {
    if (filter->filter(slaveId, resources)) {
      VLOG(1) << "Filtered " << resources
              << " on slave " << slaveId
              << " for framework " << frameworkId;
      return true;
    }
  }
  return false;
}

template <class RoleSorter, class FrameworkSorter>
bool
HierarchicalAllocatorProcess<RoleSorter, FrameworkSorter>::allocatable(
    const Resources& resources)
{
  // TODO(benh): For now, only make offers when there is some cpu
  // and memory left. This is an artifact of the original code that
  // only offered when there was at least 1 cpu "unit" available,
  // and without doing this a framework might get offered resources
  // with only memory available (which it obviously will decline)
  // and then end up waiting the default Filters::refuse_seconds
  // (unless the framework set it to something different).

  Option<double> cpus = resources.cpus();
  Option<Bytes> mem = resources.mem();

  if (cpus.isSome() && mem.isSome()) {
    return cpus.get() >= MIN_CPUS && mem.get() > MIN_MEM;
  }

  return false;
}

} // namespace allocator {
} // namespace master {
} // namespace internal {
} // namespace mesos {

#endif // __HIERARCHICAL_ALLOCATOR_PROCESS_HPP__


text:
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');

if (!common.hasCrypto)
  common.skip('missing crypto');

const assert = require('assert');
const https = require('https');

const options = {
  key: fixtures.readKey('agent1-key.pem'),
  cert: fixtures.readKey('agent1-cert.pem')
};

const tests = 2;
let successful = 0;

const testSucceeded = () => {
  successful = successful + 1;
  if (successful === tests) {
    server.close();
  }
};

const body = 'hello world\n';

const serverCallback = common.mustCall(function(req, res) {
  res.writeHead(200, { 'content-type': 'text/plain' });
  res.end(body);
});

const server = https.createServer(options, serverCallback);

server.listen(0, common.mustCall(() => {
  // Do a request ignoring the unauthorized server certs
  const port = server.address().port;

  const noCertCheckOptions = {
    hostname: '127.0.0.1',
    port: port,
    path: '/',
    method: 'GET',
    rejectUnauthorized: false
  };

  noCertCheckOptions.Agent = new https.Agent(noCertCheckOptions);

  const req = https.request(noCertCheckOptions, common.mustCall((res) => {
    let responseBody = '';
    res.on('data', function(d) {
      responseBody = responseBody + d;
    });

    res.on('end', common.mustCall(() => {
      assert.strictEqual(responseBody, body);
      testSucceeded();
    }));
  }));
  req.end();

  req.on('error', function(e) {
    throw e;
  });

  // Do a request that throws error due to the invalid server certs
  const checkCertOptions = {
    hostname: '127.0.0.1',
    port: port,
    path: '/',
    method: 'GET'
  };

  const checkCertReq = https.request(checkCertOptions, function(res) {
    res.on('data', function() {
      throw new Error('data should not be received');
    });

    res.on('end', function() {
      throw new Error('connection should not be established');
    });
  });
  checkCertReq.end();

  checkCertReq.on('error', common.mustCall((e) => {
    assert.strictEqual(e.code, 'UNABLE_TO_VERIFY_LEAF_SIGNATURE');
    testSucceeded();
  }));
}));

process.on('exit', function() {
  assert.strictEqual(successful, tests);
});


text:
package org.apache.commons.jxpath;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;

/**
 * An implementation of JXPathBeanInfo based on JavaBeans' BeanInfo. Properties
 * advertised by JXPathBasicBeanInfo are the same as those advertised by
 * BeanInfo for the corresponding class.
 *
 * @see java.beans.BeanInfo
 * @see java.beans.Introspector
 *
 * @author Dmitri Plotnikov
 * @version $Revision$ $Date$
 */
public class JXPathBasicBeanInfo implements JXPathBeanInfo {
    private static final long serialVersionUID = -3863803443111484155L;

    private static final Comparator PROPERTY_DESCRIPTOR_COMPARATOR = new Comparator() {
        public int compare(Object left, Object right) {
            return ((PropertyDescriptor) left).getName().compareTo(
                ((PropertyDescriptor) right).getName());
        }
    };

    private boolean atomic = false;
    private Class clazz;
    private Class dynamicPropertyHandlerClass;
    private transient PropertyDescriptor[] propertyDescriptors;
    private transient HashMap propertyDescriptorMap;

    /**
     * Create a new JXPathBasicBeanInfo.
     * @param clazz bean class
     */
    public JXPathBasicBeanInfo(Class clazz) {
        this.clazz = clazz;
    }

    /**
     * Create a new JXPathBasicBeanInfo.
     * @param clazz bean class
     * @param atomic whether objects of this class are treated as atomic
     *               objects which have no properties of their own.
     */
    public JXPathBasicBeanInfo(Class clazz, boolean atomic) {
        this.clazz = clazz;
        this.atomic = atomic;
    }

    /**
     * Create a new JXPathBasicBeanInfo.
     * @param clazz bean class
     * @param dynamicPropertyHandlerClass dynamic property handler class
     */
    public JXPathBasicBeanInfo(Class clazz, Class dynamicPropertyHandlerClass) {
        this.clazz = clazz;
        this.atomic = false;
        this.dynamicPropertyHandlerClass = dynamicPropertyHandlerClass;
    }

    /**
     * Returns true if objects of this class are treated as atomic
     * objects which have no properties of their own.
     * @return boolean
     */
    public boolean isAtomic() {
        return atomic;
    }

    /**
     * Return true if the corresponding objects have dynamic properties.
     * @return boolean
     */
    public boolean isDynamic() {
        return dynamicPropertyHandlerClass != null;
    }

    public synchronized PropertyDescriptor[] getPropertyDescriptors() {
        if (propertyDescriptors == null) {
            if (clazz == Object.class) {
                propertyDescriptors = new PropertyDescriptor[0];
            }
            else {
                try {
                    BeanInfo bi = null;
                    if (clazz.isInterface()) {
                        bi = Introspector.getBeanInfo(clazz);
                    }
                    else {
                        bi = Introspector.getBeanInfo(clazz, Object.class);
                    }
                    PropertyDescriptor[] pds = bi.getPropertyDescriptors();
                    PropertyDescriptor[] descriptors = new PropertyDescriptor[pds.length];
                    System.arraycopy(pds, 0, descriptors, 0, pds.length);
                    Arrays.sort(descriptors, PROPERTY_DESCRIPTOR_COMPARATOR);
                    propertyDescriptors = descriptors;
                }
                catch (IntrospectionException ex) {
                    ex.printStackTrace();
                    return new PropertyDescriptor[0];
                }
            }
        }
        if (propertyDescriptors.length == 0) {
            return propertyDescriptors;
        }
        PropertyDescriptor[] result = new PropertyDescriptor[propertyDescriptors.length];
        System.arraycopy(propertyDescriptors, 0, result, 0, propertyDescriptors.length);
        return result;
    }

    public synchronized PropertyDescriptor getPropertyDescriptor(String propertyName) {
        if (propertyDescriptorMap == null) {
            propertyDescriptorMap = new HashMap();
            PropertyDescriptor[] pds = getPropertyDescriptors();
            for (int i = 0; i < pds.length; i++) {
                propertyDescriptorMap.put(pds[i].getName(), pds[i]);
            }
        }
        return (PropertyDescriptor) propertyDescriptorMap.get(propertyName);
    }

    /**
     * For a dynamic class, returns the corresponding DynamicPropertyHandler
     * class.
     * @return Class
     */
    public Class getDynamicPropertyHandlerClass() {
        return dynamicPropertyHandlerClass;
    }

    public String toString() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("BeanInfo [class = ");
        buffer.append(clazz.getName());
        if (isDynamic()) {
            buffer.append(", dynamic");
        }
        if (isAtomic()) {
            buffer.append(", atomic");
        }
        buffer.append(", properties = ");
        PropertyDescriptor[] jpds = getPropertyDescriptors();
        for (int i = 0; i < jpds.length; i++) {
            buffer.append("\n    ");
            buffer.append(jpds[i].getPropertyType());
            buffer.append(": ");
            buffer.append(jpds[i].getName());
        }
        buffer.append("]");
        return buffer.toString();
    }
}


text:
This is where The Nacho Club's new website lives. It's a work in progress, and
it's going to be a static site hosted through GitHub pages.

All of the members are at least a little bit technical, so this is going to be a
way to expand our skills by taking the technical stuff in-house.

## Progress

Work being done is tracked [on our Trello board][trello-board].

## Development

Under the hood here is a static site built using [Metalsmith][metalsmith],
[Handlebars][handlebars], [Gulp][gulp] and [SASS][sass].

To get up and running for development:

1. `git clone https://github.com/TheNachoClub/thenachoclub.com.git`
2. `cd thenachoclub.com`
3. Ensure your machine is using Node `^6.3.0`, with NPM `^3.10.0`
4. Install dependencies with `npm install`
5. Run a development server with `gulp serve`

It should automatically open a tab with a running local webserver using
[Browser Sync][browser-sync]. Go nuts!

## Deployment

This site will be hosted with [GitHub Pages][github-pages]. Anything in the
`gh-pages` branch will automatically be synced to the live site, while `master`
will be the merging branch for our source files. To deploy, we push the `build`
directory from `master` over as the root of `gh-pages`. There's a script for it.

While in the `master` branch, run: `./bin/deploy.sh`.

Then go check out [thenachoclub.com][the-nacho-club] to see your changes.

[metalsmith]: (http://www.metalsmith.io/)
[handlebars]: (http://handlebarsjs.com/)
[sass]: (http://sass-lang.com/)
[gulp]: (http://gulpjs.com/)
[browser-sync]: (https://www.browsersync.io/)
[trello-board]: (https://trello.com/b/IfaflIpq/the-nacho-club)
[github-pages]: (https://pages.github.com/)
[the-nacho-club]: (http://thenachoclub.com)


text:
from django.test import TestCase
from django.shortcuts import resolve_url as r
from eventex.core.models import Talk, Speaker, Course

class TalkListGet(TestCase):
    def setUp(self):
        t1 = Talk.objects.create(title='Título da Palestra', start='10:00',
                                 description='Descrição da palestra.')
        t2 = Talk.objects.create(title='Título da Palestra', start='13:00',
                                 description='Descrição da palestra.')

        c1 = Course.objects.create(title='Título do Curso', start='09:00',
                                   description='Descrição do curso.', slots=20)

        speaker = Speaker.objects.create(name='Luca Bezerra',
                                         slug='luca-bezerra',
                                         website='http://lucabezerra.com')

        t1.speakers.add(speaker)
        t2.speakers.add(speaker)
        c1.speakers.add(speaker)

        self.response = self.client.get(r('talk_list'))

    def test_get(self):
        self.assertEqual(200, self.response.status_code)

    def test_template(self):
        self.assertTemplateUsed(self.response, 'core/talk_list.html')

    def test_html(self):
        contents = [
            (2, 'Título da Palestra'),
            (1, '10:00'),
            (1, '13:00'),
            (3, '/palestrantes/luca-bezerra/'),
            (3, 'Luca Bezerra'),
            (2, 'Descrição da palestra.'),
            (1, 'Título do Curso'),
            (1, '09:00'),
            (1, 'Descrição do curso.'),
        ]

        for count, expected in contents:
            with self.subTest():
                self.assertContains(self.response, expected, count)

    def test_context(self):
        variables = ['talk_list']

        for key in variables:
            with self.subTest():
                self.assertIn(key, self.response.context)

class TalkListGetEmpty(TestCase):
    def setUp(self):
        self.response = self.client.get(r('talk_list'))

    def test_get_empty(self):
        self.assertContains(self.response, 'Ainda não existem palestras de manhã.')
        self.assertContains(self.response, 'Ainda não existem palestras de tarde.')


text:
* Fixed a bug where horizontal scrolling layouts did not lay cells out correctly
* Fixed a bug where changing the size of the collection view did not properly invalidate the layout and force a recalculation of attribute frames.

## 0.1.0

Initial release.


text:
(function(win, doc) {
	var iframe;
	var bodyOverflow;

	var onMessage = function(event) {
		if (event.data === 'collapse') {
			iframe.height = 40;
			iframe.width = 40;
			doc.body.style.overflow = bodyOverflow;
			return;
		}
		if (event.data === 'toolbar') {
			iframe.height = 40;
			iframe.width = '100%';
			doc.body.style.overflow = bodyOverflow;
			return;
		}
		if (event.data === 'expand') {
			iframe.width = '100%';
			iframe.height = '100%';
			doc.body.style.overflow = 'hidden';
			return;
		}
	};

	var onReady = function() {
		if (!win.__debug_kit_id) {
			return;
		}
		var body = doc.body;
		iframe = doc.createElement('iframe');
		iframe.setAttribute('style', 'position: fixed; bottom: 0; right: 0; border: 0; outline: 0; overflow: hidden; z-index: 99999;');
		iframe.height = 40;
		iframe.width = 40;
		iframe.src = __debug_kit_base_url + 'debug_kit/toolbar/' + __debug_kit_id;

		body.appendChild(iframe);

		bodyOverflow = body.style.overflow;

		window.addEventListener('message', onMessage, false);
	};

	// Bind on ready callback.
	if (doc.addEventListener) {
		doc.addEventListener('DOMContentLoaded', onReady, false);
	} else {
		throw new Error('Unable to add event listener for DebugKit. Please use a browser' +
			'that supports addEventListener().')
	}
}(window, document));


text:
@implementation Location

@dynamic date;
@dynamic latitude;
@dynamic longitude;
@dynamic uuid;
@dynamic speed;
@dynamic altitude;

@end


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Profile | Mahasiswa</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>

    <link href="<?php echo base_url('assets') ?>/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

    <link href="<?php echo base_url('assets') ?>/bootstrap/css/font-awesome.min.css" rel="stylesheet" type="text/css" />

    <link href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />

    <link href="<?php echo base_url('assets') ?>/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />

    <link href="<?php echo base_url('assets') ?>/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />

      <?php require 'global_header.php'; ?>

      <?php require 'mahasiswa_navigasi.php'; ?>

            Data Diri Mahasiswa
            Preview

 Home

Forms

Profile Mahasiswa

Profile <?php echo $this->session->userdata('status') ?>

                <?php echo form_open('control_mahasiswa/update_profile') ?>

                      Nomor Induk
                      <input name="nomor_induk" value="<?php echo $no; ?>" type="text" class="form-control" id="exampleInputEmail1">

                      Nama Lengkap
                      <input name="nama_lengkap" value="<?php echo $nama; ?>" type="text" class="form-control" id="exampleInputPassword1">

                    <button type="submit" class="btn btn-primary">Submit</button>

                </form>

Upload Foto

                <?php echo form_open_multipart('control_uploader/do_upload') ?>

                      Upload Foto
                      <input name="userfile" type="file" id="exampleInputFile">

Mohon tidak lebih dari 500 KB.

                    <button type="submit" class="btn btn-primary">Submit</button>

                </form>

          Version 2.0

        Copyright © 2014-2015 Almsaeed Studio. All rights reserved.


text:
require 'chronic/dictionary'
require 'chronic/handlers'

module Chronic
  class Parser
    include Handlers

    # Hash of default configuration options.
    DEFAULT_OPTIONS = {
      :context => :future,
      :now => nil,
      :hours24 => nil,
      :week_start => :sunday,
      :guess => true,
      :ambiguous_time_range => 6,
      :endian_precedence    => [:middle, :little],
      :ambiguous_year_future_bias => 50
    }

    attr_accessor :now
    attr_reader :options

    # options - An optional Hash of configuration options:
    #        :context - If your string represents a birthday, you can set
    #                   this value to :past and if an ambiguous string is
    #                   given, it will assume it is in the past.
    #        :now - Time, all computations will be based off of time
    #               instead of Time.now.
    #        :hours24 - Time will be parsed as it would be 24 hour clock.
    #        :week_start - By default, the parser assesses weeks start on
    #                  sunday but you can change this value to :monday if
    #                  needed.
    #        :guess - By default the parser will guess a single point in time
    #                 for the given date or time. If you'd rather have the
    #                 entire time span returned, set this to false
    #                 and a Chronic::Span will be returned. Setting :guess to :end
    #                 will return last time from Span, to :middle for middle (same as just true)
    #                 and :begin for first time from span.
    #        :ambiguous_time_range - If an Integer is given, ambiguous times
    #                  (like 5:00) will be assumed to be within the range of
    #                  that time in the AM to that time in the PM. For
    #                  example, if you set it to `7`, then the parser will
    #                  look for the time between 7am and 7pm. In the case of
    #                  5:00, it would assume that means 5:00pm. If `:none`
    #                  is given, no assumption will be made, and the first
    #                  matching instance of that time will be used.
    #        :endian_precedence - By default, Chronic will parse "03/04/2011"
    #                 as the fourth day of the third month. Alternatively you
    #                 can tell Chronic to parse this as the third day of the
    #                 fourth month by setting this to [:little, :middle].
    #        :ambiguous_year_future_bias - When parsing two digit years
    #                 (ie 79) unlike Rubys Time class, Chronic will attempt
    #                 to assume the full year using this figure. Chronic will
    #                 look x amount of years into the future and past. If the
    #                 two digit year is `now + x years` it's assumed to be the
    #                 future, `now - x years` is assumed to be the past.
    def initialize(options = {})
      validate_options!(options)
      @options = DEFAULT_OPTIONS.merge(options)
      @now = options[:now] || Chronic.time_class.now
    end

    # Parse "text" with the given options
    # Returns either a Time or Chronic::Span, depending on the value of options[:guess]
    def parse(text)
      tokens = tokenize(text, options)
      span = tokens_to_span(tokens, options.merge(:text => text))

      puts "+#{'-' * 51}\n| #{tokens}\n+#{'-' * 51}" if Chronic.debug

      guess(span, options[:guess]) if span
    end

    # Clean up the specified text ready for parsing.
    #
    # Clean up the string by stripping unwanted characters, converting
    # idioms to their canonical form, converting number words to numbers
    # (three => 3), and converting ordinal words to numeric
    # ordinals (third => 3rd)
    #
    # text - The String text to normalize.
    #
    # Examples:
    #
    #   Chronic.pre_normalize('first day in May')
    #     #=> "1st day in may"
    #
    #   Chronic.pre_normalize('tomorrow after noon')
    #     #=> "next day future 12:00"
    #
    #   Chronic.pre_normalize('one hundred and thirty six days from now')
    #     #=> "136 days future this second"
    #
    # Returns a new String ready for Chronic to parse.
    def pre_normalize(text)
      text = text.to_s.downcase
      text.gsub!(/\b(\d{1,2})\.(\d{1,2})\.(\d{4})\b/, '\3 / \2 / \1')
      text.gsub!(/\b([ap])\.m\.?/, '\1m')
      text.gsub!(/(\s+|:\d{2}|:\d{2}\.\d+)\-(\d{2}:?\d{2})\b/, '\1tzminus\2')
      text.gsub!(/\./, ':')
      text.gsub!(/([ap]):m:?/, '\1m')
      text.gsub!(/'(\d{2})\b/) do
        number = $1.to_i

        if Chronic::Date::could_be_year?(number)
          Chronic::Date::make_year(number, options[:ambiguous_year_future_bias])
        else
          number
        end
      end
      text.gsub!(/['"]/, '')
      text.gsub!(/,/, ' ')
      text.gsub!(/^second /, '2nd ')
      text.gsub!(/\bsecond (of|day|month|hour|minute|second|quarter)\b/, '2nd \1')
      text.gsub!(/\bthird quarter\b/, '3rd q')
      text.gsub!(/\bfourth quarter\b/, '4th q')
      text.gsub!(/quarters?(\s+|$)(?!to|till|past|after|before)/, 'q\1')
      text = Numerizer.numerize(text)
      text.gsub!(/\b(\d)(?:st|nd|rd|th)\s+q\b/, 'q\1')
      text.gsub!(/([\/\-\,\@])/) { ' ' + $1 + ' ' }
      text.gsub!(/(?:^|\s)0(\d+:\d+\s*pm?\b)/, ' \1')
      text.gsub!(/\btoday\b/, 'this day')
      text.gsub!(/\btomm?orr?ow\b/, 'next day')
      text.gsub!(/\byesterday\b/, 'last day')
      text.gsub!(/\bnoon|midday\b/, '12:00pm')
      text.gsub!(/\bmidnight\b/, '24:00')
      text.gsub!(/\bnow\b/, 'this second')
      text.gsub!('quarter', '15')
      text.gsub!('half', '30')
      text.gsub!(/(\d{1,2}) (to|till|prior to|before)\b/, '\1 minutes past')
      text.gsub!(/(\d{1,2}) (after|past)\b/, '\1 minutes future')
      text.gsub!(/\b(?:ago|before(?: now)?)\b/, 'past')
      text.gsub!(/\bthis (?:last|past)\b/, 'last')
      text.gsub!(/\b(?:in|during) the (morning)\b/, '\1')
      text.gsub!(/\b(?:in the|during the|at) (afternoon|evening|night)\b/, '\1')
      text.gsub!(/\btonight\b/, 'this night')
      text.gsub!(/\b\d+:?\d*[ap]\b/,'\0m')
      text.gsub!(/\b(\d{2})(\d{2})(am|pm)\b/, '\1:\2\3')
      text.gsub!(/(\d)([ap]m|oclock)\b/, '\1 \2')
      text.gsub!(/\b(hence|after|from)\b/, 'future')
      text.gsub!(/^\s?an? /i, '1 ')
      text.gsub!(/\b(\d{4}):(\d{2}):(\d{2})\b/, '\1 / \2 / \3') # DTOriginal
      text.gsub!(/\b0(\d+):(\d{2}):(\d{2}) ([ap]m)\b/, '\1:\2:\3 \4')
      text
    end

    # Guess a specific time within the given span.
    #
    # span - The Chronic::Span object to calcuate a guess from.
    #
    # Returns a new Time object.
    def guess(span, mode = :middle)
      return span if not mode
      return span.begin + span.width / 2 if span.width > 1 and (mode == true or mode == :middle)
      return span.end if mode == :end
      span.begin
    end

    # List of Handler definitions. See Chronic.parse for a list of options this
    # method accepts.
    #
    # options - An optional Hash of configuration options.
    #
    # Returns a Hash of Handler definitions.
    def definitions(options = {})
      SpanDictionary.new(options).definitions
    end

    private

    def validate_options!(options)
      given = options.keys.map(&:to_s).sort
      allowed = DEFAULT_OPTIONS.keys.map(&:to_s).sort
      non_permitted = given - allowed
      raise ArgumentError, "Unsupported option(s): #{non_permitted.join(', ')}" if non_permitted.any?
    end

    def tokenize(text, options)
      text = pre_normalize(text)
      tokens = Tokenizer::tokenize(text)
      [Repeater, Grabber, Pointer, Scalar, Ordinal, Separator, Sign, TimeZone].each do |tok|
        tok.scan(tokens, options)
      end
      tokens.select { |token| token.tagged? }
    end

    def tokens_to_span(tokens, options)
      definitions = definitions(options)

      (definitions[:endian] + definitions[:date]).each do |handler|
        if handler.match(tokens, definitions)
          good_tokens = tokens.select { |o| !o.get_tag Separator }
          return handler.invoke(:date, good_tokens, self, options)
        end
      end

      definitions[:anchor].each do |handler|
        if handler.match(tokens, definitions)
          good_tokens = tokens.select { |o| !o.get_tag Separator }
          return handler.invoke(:anchor, good_tokens, self, options)
        end
      end

      definitions[:arrow].each do |handler|
        if handler.match(tokens, definitions)
          good_tokens = tokens.reject { |o| o.get_tag(SeparatorAt) || o.get_tag(SeparatorSlash) || o.get_tag(SeparatorDash) || o.get_tag(SeparatorComma) || o.get_tag(SeparatorAnd) }
          return handler.invoke(:arrow, good_tokens, self, options)
        end
      end

      definitions[:narrow].each do |handler|
        if handler.match(tokens, definitions)
          return handler.invoke(:narrow, tokens, self, options)
        end
      end

      puts '-none' if Chronic.debug
      return nil
    end
  end
end


text:
// PortDepend.cpp : implementation file
//

#include "stdafx.h"
#include "ResourcerDoc.h"
#include "Resource.h"
#include "PortDepend.h"

/////////////////////////////////////////////////////////////////////////////
// CPortDepend dialog

CPortDepend::CPortDepend(Array< CharString > & dep, CWnd* pParent /*=NULL*/)
	: CDialog(CPortDepend::IDD, pParent), m_Depend( dep )
{
	//{{AFX_DATA_INIT(CPortDepend)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}

void CPortDepend::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPortDepend)
	DDX_Control(pDX, IDC_TREE1, m_DependTree);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CPortDepend, CDialog)
	//{{AFX_MSG_MAP(CPortDepend)
	ON_NOTIFY(NM_DBLCLK, IDC_TREE1, OnOpenDepend)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPortDepend message handlers

BOOL CPortDepend::OnInitDialog()
{
	CDialog::OnInitDialog();

	for(int i=0;i<m_Depend.size();i++)
		if ( m_Depend[i].length() > 0 )
			buildTree( m_DependTree.InsertItem( m_Depend[i] ) );

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CPortDepend::OnOpenDepend(NMHDR* pNMHDR, LRESULT* pResult)
{
	HTREEITEM treeItem = m_DependTree.GetSelectedItem();
	if ( treeItem  )
		AfxGetApp()->OpenDocumentFile( m_DependTree.GetItemText( treeItem ) );

	*pResult = 0;
}

//----------------------------------------------------------------------------

void CPortDepend::buildTree( HTREEITEM parent )
{
	// load the port
	Port::Ref port = Port::portLoad( m_DependTree.GetItemText( parent ) );
	if ( port.valid() )
	{
		Array< CharString > depend;
		port->dependencies( depend );

		for(int i=0;i<depend.size();i++)
			if ( depend[i].length() > 0 )
				buildTree( m_DependTree.InsertItem( depend[i], parent ) );
	}
}

//----------------------------------------------------------------------------
// EOF


text:
import bcrypt from "bcrypt"

import Model, { transaction } from "./base"

import Email from "./email"
import Profile from "./profile"
import Rating from "./rating"

const saltRounds = 8

export default class User extends Model {
  constructor(...args) {
    super(...args)

    this.on("saving", this.hashPassword)
  }

  get tableName() {
    return "users"
  }

  get hasTimestamps() {
    return true
  }

  profile() {
    return this.hasOne(Profile, "provider_id")
  }

  ratings() {
    return this.hasMany(Rating)
  }

  rating() {
    return this.hasOne(Rating)
      .orderBy("created_at", "DESC")
      .query(qb => qb.limit(1))
  }

  static async create({ email, password, displayName }) {
    const user = User.forge({ password })

    await transaction(async transacting => {
      await user.save(null, { transacting })

      await Email.forge({
        user_id: user.id,
        value: email
      }).save(null, { transacting })

      await Profile.forge({
        name: { },
        provider: "local",
        provider_id: user.id,
        display_name: displayName
      }).save(null, { transacting })

      await Rating.forge({
        user_id: user.id
      }).save(null, { transacting })
    })

    return user
  }

  serialize() {
    return {
      uuid: this.get("uuid"),
      displayName: this.related("profile").get("display_name"),
      rating: this.related("rating").get("value") || this.get("rating")
    }
  }

  async isValidPassword(plaintext) {
    return await bcrypt.compare(plaintext, this.get("password_hash") || '')
  }

  async hashPassword() {
    if (this.has("password") && this.get("password").length > 0) {
      this.set("password_hash", await bcrypt.hash(this.get("password"), saltRounds))
    }

    this.unset("password")
  }
}


text:
package org.pepstock.charba.client.impl.plugins;

import org.pepstock.charba.client.callbacks.CrosshairFormatterCallback;
import org.pepstock.charba.client.callbacks.ScriptableFunctions.ProxyStringCallback;
import org.pepstock.charba.client.colors.ColorBuilder;
import org.pepstock.charba.client.colors.HtmlColor;
import org.pepstock.charba.client.colors.IsColor;
import org.pepstock.charba.client.commons.CallbackPropertyHandler;
import org.pepstock.charba.client.commons.CallbackProxy;
import org.pepstock.charba.client.commons.Checker;
import org.pepstock.charba.client.commons.JsHelper;
import org.pepstock.charba.client.commons.Key;
import org.pepstock.charba.client.commons.NativeObject;
import org.pepstock.charba.client.commons.NativeObjectContainer;
import org.pepstock.charba.client.data.BarBorderRadius;
import org.pepstock.charba.client.options.IsFont;

/**
 * {@link Crosshair#ID} plugin configuration element in order to have in the chart the label on the axes where the mouse is positioned.
 *
 * @author Andrea "Stock" Stocchero
 */
public final class CrosshairLabel extends NativeObjectContainer implements IsCrosshairDefaultLabel {

	/**
	 * Default font color for label, {@link HtmlColor#WHITE}.
	 */
	public static final IsColor DEFAULT_COLOR = HtmlColor.WHITE;

	/**
	 * Default font color for label, as string, {@link HtmlColor#WHITE}.
	 */
	public static final String DEFAULT_COLOR_AS_STRING = DEFAULT_COLOR.toRGBA();

	/**
	 * Default background color for label, rgb(110, 112, 121).
	 */
	public static final IsColor DEFAULT_BACKGROUND_COLOR = ColorBuilder.build(110, 112, 121);

	/**
	 * Default background color for label, as string, rgb(110, 112, 121).
	 */
	public static final String DEFAULT_BACKGROUND_COLOR_AS_STRING = DEFAULT_BACKGROUND_COLOR.toRGB();

	/**
	 * Default border color for label, {@link HtmlColor#TRANSPARENT}.
	 */
	public static final IsColor DEFAULT_BORDER_COLOR = HtmlColor.TRANSPARENT;

	/**
	 * Default border color for label, as string, {@link HtmlColor#TRANSPARENT}.
	 */
	public static final String DEFAULT_BORDER_COLOR_AS_STRING = DEFAULT_BORDER_COLOR.toRGBA();

	/**
	 * Default border width for crosshair label, value is {@value DEFAULT_BORDER_WIDTH}.
	 */
	public static final int DEFAULT_BORDER_WIDTH = 0;

	/**
	 * Default flag if crosshair label must be showed in the chart, value is {@value DEFAULT_DISPLAY}.
	 */
	public static final boolean DEFAULT_DISPLAY = true;

	/**
	 * Default padding for crosshair label, value is {@value DEFAULT_PADDING}.
	 */
	public static final int DEFAULT_PADDING = 6;

	/**
	 * Default border radius for crosshair label, value is {@value DEFAULT_PADDING}.
	 */
	public static final int DEFAULT_BORDER_RADIUS = 6;

	/**
	 * Name of properties of native object.
	 */
	private enum Property implements Key
	{
		BACKGROUND_COLOR("backgroundColor"),
		BORDER_COLOR("borderColor"),
		BORDER_WIDTH("borderWidth"),
		BORDER_RADIUS("borderRadius"),
		COLOR("color"),
		DISPLAY("display"),
		FONT("font"),
		PADDING("padding"),
		// internal property to set the callbacks
		CHARBA_FORMATTER_CALLBACK("formatter");

		// name value of property
		private final String value;

		/**
		 * Creates with the property value to use in the native object.
		 *
		 * @param value value of property name
		 */
		private Property(String value) {
			this.value = value;
		}

		/*
		 * (non-Javadoc)
		 *
		 * @see org.pepstock.charba.client.commons.Key#value()
		 */
		@Override
		public String value() {
			return value;
		}

	}

	// callback proxy to invoke the formatter function
	private final CallbackProxy<ProxyStringCallback> formatterCallbackProxy = JsHelper.get().newCallbackProxy();
	// progress callback
	private static final CallbackPropertyHandler<CrosshairFormatterCallback> FORMATTER_CALLBACK = new CallbackPropertyHandler<>(Property.CHARBA_FORMATTER_CALLBACK);

	// parent plugin options
	private CrosshairOptions parent;
	// defaults global options instance
	private IsCrosshairDefaultLabel defaultOptions;
	// label font instance
	private final CrosshairLabelFont font;
	// bar border radius instance
	private BarBorderRadius borderRadiusObject = null;

	/**
	 * Creates new label element, using stored native object instance and the default values options.
	 *
	 * @param parent the plugin options instance
	 * @param nativeObject stored label values in the native object to read.
	 * @param defaultOptions default crosshair label options to returns the default when required.
	 */
	CrosshairLabel(CrosshairOptions parent, NativeObject nativeObject, IsCrosshairDefaultLabel defaultOptions) {
		super(nativeObject);
		// checks the default values
		this.defaultOptions = checkDefaultValuesArgument(defaultOptions);
		// stores parent
		this.parent = parent;
		// gets font
		this.font = new CrosshairLabelFont(this.defaultOptions.getFont(), getNativeObject());
		// stores border radius
		// getting value from object
		this.borderRadiusObject = new BarBorderRadius(getBorderRadius());
		// stores incremental ID
		setNewIncrementalId();
	}

	/**
	 * Returns the font object.
	 *
	 * @return the font object.
	 */
	@Override
	public IsFont getFont() {
		return font;
	}

	/**
	 * Sets true if label will be applied in the chart, otherwise false.
	 *
	 * @param display true if label will be applied in the chart, otherwise false
	 */
	public void setDisplay(boolean display) {
		setValue(Property.DISPLAY, display);
	}

	/**
	 * Returns true if label will be applied in the chart, otherwise false.
	 *
	 * @return true if label will be applied in the chart, otherwise false
	 */
	@Override
	public boolean isDisplay() {
		return getValue(Property.DISPLAY, defaultOptions.isDisplay());
	}

	/**
	 * Returns the crosshair label font color.
	 *
	 * @return the crosshair label font color.
	 */
	@Override
	public String getColorAsString() {
		return getValue(Property.COLOR, defaultOptions.getColorAsString());
	}

	/**
	 * Returns the crosshair label font color.
	 *
	 * @return the crosshair label font color.
	 */
	public IsColor getColor() {
		return ColorBuilder.parse(getColorAsString());
	}

	/**
	 * Sets the crosshair label font color.
	 *
	 * @param color the crosshair label font color.
	 */
	public void setColor(String color) {
		setValue(Property.COLOR, color);
	}

	/**
	 * Set the crosshair label font color.
	 *
	 * @param color the crosshair label font color.
	 */
	public void setColor(IsColor color) {
		setColor(IsColor.checkAndGetValue(color));
	}

	/**
	 * Sets the padding of crosshair label.
	 *
	 * @param padding padding of crosshair label
	 */
	public void setPadding(int padding) {
		setValue(Property.PADDING, Checker.positiveOrZero(padding));
	}

	/**
	 * Returns the padding of crosshair label.
	 *
	 * @return the padding of crosshair label
	 */
	@Override
	public int getPadding() {
		return getValue(Property.PADDING, defaultOptions.getPadding());
	}

	/**
	 * Sets the background color.
	 *
	 * @param color the background color.
	 */
	public void setBackgroundColor(String color) {
		setValue(Property.BACKGROUND_COLOR, color);
	}

	/**
	 * Sets the background color.
	 *
	 * @param color the background color.
	 */
	public void setBackgroundColor(IsColor color) {
		setBackgroundColor(IsColor.checkAndGetValue(color));
	}

	/**
	 * Returns the background color.
	 *
	 * @return the background color.
	 */
	@Override
	public String getBackgroundColorAsString() {
		return getValue(Property.BACKGROUND_COLOR, defaultOptions.getBackgroundColorAsString());
	}

	/**
	 * Returns the background color.
	 *
	 * @return the background color.
	 */
	public IsColor getBackgroundColor() {
		return ColorBuilder.parse(getBackgroundColorAsString());
	}

	/**
	 * Sets the label border radius (in pixels).
	 *
	 * @param borderRadius the label border radius (in pixels).
	 */
	public void setBorderRadius(int borderRadius) {
		setValue(Property.BORDER_RADIUS, Checker.positiveOrZero(borderRadius));
		// stores border radius
		this.borderRadiusObject = new BarBorderRadius(getBorderRadius());
	}

	/**
	 * Returns the label border radius (in pixels).
	 *
	 * @return the label border radius (in pixels).
	 */
	@Override
	public int getBorderRadius() {
		return getValue(Property.BORDER_RADIUS, defaultOptions.getBorderRadius());
	}

	/**
	 * Sets the border color.
	 *
	 * @param borderColor the border color.
	 */
	public void setBorderColor(IsColor borderColor) {
		setBorderColor(IsColor.checkAndGetValue(borderColor));
	}

	/**
	 * Sets the border color.
	 *
	 * @param borderColor the border color.
	 */
	public void setBorderColor(String borderColor) {
		setValue(Property.BORDER_COLOR, borderColor);
	}

	/**
	 * Returns the border color.
	 *
	 * @return the border color.
	 */
	@Override
	public String getBorderColorAsString() {
		return getValue(Property.BORDER_COLOR, defaultOptions.getBorderColorAsString());
	}

	/**
	 * Returns the border color.
	 *
	 * @return the border color.
	 */
	public IsColor getBorderColor() {
		return ColorBuilder.parse(getBorderColorAsString());
	}

	/**
	 * Sets the border width.
	 *
	 * @param borderWidth the border width.
	 */
	public void setBorderWidth(int borderWidth) {
		setValue(Property.BORDER_WIDTH, Checker.positiveOrZero(borderWidth));
	}

	/**
	 * Returns the border width.
	 *
	 * @return the border width.
	 */
	@Override
	public int getBorderWidth() {
		return getValue(Property.BORDER_WIDTH, defaultOptions.getBorderWidth());
	}

	// ------------------
	// CALLBACKS
	// ------------------

	/**
	 * Returns the callback which can be implemented to change the text of label.
	 *
	 * @return the callback which can be implemented to change the text of label
	 */
	@Override
	public CrosshairFormatterCallback getFormatter() {
		return FORMATTER_CALLBACK.getCallback(this, defaultOptions.getFormatter());
	}

	/**
	 * Sets the callback which can be implemented to change the text of label.
	 *
	 * @param formatterCallback the callback which can be implemented to change the text of label
	 */
	public void setFormatter(CrosshairFormatterCallback formatterCallback) {
		FORMATTER_CALLBACK.setCallback(this, parent.getId(), formatterCallback, formatterCallbackProxy.getProxy());
	}

	// ------------------
	// INTERNALS
	// ------------------

	/**
	 * Returns the {@link BarBorderRadius} instance.
	 *
	 * @return the {@link BarBorderRadius} instance
	 */
	BarBorderRadius getBarBordeRadius() {
		return this.borderRadiusObject;
	}
}


text:
using System;
using Weapsy.Blog.Commands.Contracts;

namespace Weapsy.Blog.Commands
{
	public class ApproveCommentCommand : ICommand
	{
		public Guid Id { get; private set; }

		public ApproveCommentCommand(Guid id)
		{
			Id = id;
		}
	}
}


text:
#include <inviwo/core/common/inviwoapplication.h>
#include <inviwo/core/datastructures/representationconverterfactory.h>
#include <inviwo/core/io/datareaderfactory.h>
#include <inviwo/core/io/datawriterfactory.h>
#include <inviwo/core/interaction/pickingmanager.h>
#include <inviwo/core/metadata/metadatafactory.h>
#include <inviwo/core/network/processornetworkevaluator.h>
#include <inviwo/core/ports/portfactory.h>
#include <inviwo/core/ports/portinspectorfactory.h>
#include <inviwo/core/processors/processorfactory.h>
#include <inviwo/core/processors/processorwidgetfactory.h>
#include <inviwo/core/properties/optionproperty.h>
#include <inviwo/core/properties/propertyfactory.h>
#include <inviwo/core/properties/propertywidgetfactory.h>
#include <inviwo/core/rendering/meshdrawerfactory.h>
#include <inviwo/core/resources/resourcemanager.h>
#include <inviwo/core/util/dialogfactory.h>
#include <inviwo/core/util/filesystem.h>
#include <inviwo/core/util/rendercontext.h>
#include <inviwo/core/properties/propertyconvertermanager.h>
#include <inviwo/core/util/settings/systemsettings.h>

namespace inviwo {
// Helper function to retriever user settings path
void getInviwoUserSettingsPath();

InviwoApplication::InviwoApplication(int argc, char** argv, std::string displayName,
                                     std::string basePath)
    : displayName_(displayName)
    , basePath_(basePath)
    , commandLineParser_(argc, argv)
    , initialized_(false)
    , pool_(0)
    , progressCallback_() {

    if (commandLineParser_.getLogToFile()) {
        LogCentral::getPtr()->registerLogger(
            new FileLogger(commandLineParser_.getLogToFileFileName()));
    }
    processorNetwork_ = new ProcessorNetwork();
    processorNetworkEvaluator_ = new ProcessorNetworkEvaluator(processorNetwork_);
    init(this);
}

InviwoApplication::InviwoApplication() : InviwoApplication(0, nullptr, "Inviwo", "") {}

InviwoApplication::InviwoApplication(std::string displayName, std::string basePath)
    : InviwoApplication(0, nullptr, displayName, basePath) {}

InviwoApplication::~InviwoApplication() {
    if (initialized_) deinitialize();

    for (auto module : modules_) delete module;
    modules_.clear();

    for (auto callback : moudleCallbackActions_) delete callback;
    moudleCallbackActions_.clear();

    delete processorNetwork_;
    delete processorNetworkEvaluator_;

    SingletonBase::deleteAllSingeltons();
    DataFormatBase::cleanDataFormatBases();
}

void InviwoApplication::initialize(registerModuleFuncPtr regModuleFunc) {
    printApplicationInfo();
    // initialize singletons
    postProgress("Initializing singletons");
    RenderContext::init();
    ResourceManager::init();
    DataReaderFactory::init();
    DataWriterFactory::init();
    DialogFactory::init();
    MeshDrawerFactory::init();
    MetaDataFactory::init();
    PickingManager::init();
    PortFactory::init();
    PortInspectorFactory::init();
    ProcessorFactory::init();
    ProcessorWidgetFactory::init();
    PropertyFactory::init();
    PropertyWidgetFactory::init();
    PropertyConverterManager::init();
    RepresentationConverterFactory::init();

    //Create and register core
    InviwoCore* ivwCore = new InviwoCore();
    registerModule(ivwCore);

    //Initialize core
    ivwCore->initialize();

    //Load settings from core
    auto coreSettings = ivwCore->getSettings();
    for (auto setting : coreSettings) setting->loadFromDisk();

    //Create and register other modules
    (*regModuleFunc)(this);

    //Initialize other modules
    for (size_t i = 1; i < modules_.size(); i++) {
        postProgress("Initializing module: " + modules_[i]->getIdentifier());
        modules_[i]->initialize();
    }

    //Load settings from other modules
    postProgress("Loading settings...");
    auto settings = getModuleSettings(1);
    for (auto setting : settings) setting->loadFromDisk();

    auto sys = getSettingsByType<SystemSettings>();
    if (sys && !commandLineParser_.getQuitApplicationAfterStartup()) {
        pool_.setSize(static_cast<size_t>(sys->poolSize_.get()));
        sys->poolSize_.onChange(
            [this, sys]() { pool_.setSize(static_cast<size_t>(sys->poolSize_.get())); });
    }

    initialized_ = true;
}

void InviwoApplication::deinitialize() {
    // Clear the network
    getProcessorNetwork()->clear();
    // Deinitialize Resource manager before modules
    // to prevent them from using module specific
    // (OpenGL/OpenCL) features after their module
    // has been deinitialized
    ResourceManager::deleteInstance();
    for (auto& elem : modules_) elem->deinitialize();

    DataReaderFactory::deleteInstance();
    DataWriterFactory::deleteInstance();
    DialogFactory::deleteInstance();
    MeshDrawerFactory::deleteInstance();
    MetaDataFactory::deleteInstance();
    PickingManager::deleteInstance();
    PortFactory::deleteInstance();
    PortInspectorFactory::deleteInstance();
    ProcessorWidgetFactory::deleteInstance();
    PropertyFactory::deleteInstance();
    PropertyWidgetFactory::deleteInstance();
    PropertyConverterManager::deleteInstance();
    RepresentationConverterFactory::deleteInstance();
    RenderContext::deleteInstance();
    initialized_ = false;
}

const std::string& InviwoApplication::getBasePath() const {
    return basePath_;
}

std::string InviwoApplication::getPath(PathType pathType, const std::string& suffix,
                                       const bool& createFolder) {
    std::string result = getBasePath();

    switch (pathType) {
        case inviwo::InviwoApplication::PATH_DATA:
            result += "/data";
            break;

        case inviwo::InviwoApplication::PATH_VOLUMES:
            result += "/data/volumes";
            break;

        case inviwo::InviwoApplication::PATH_MODULES:
            result += "/modules";
            break;

        case inviwo::InviwoApplication::PATH_WORKSPACES:
            result += "/data/workspaces";
            break;

        case inviwo::InviwoApplication::PATH_PORTINSPECTORS:
            result += "/data/workspaces/portinspectors";
            break;

        case inviwo::InviwoApplication::PATH_SCRIPTS:
            result += "/data/scripts";
            break;

        case inviwo::InviwoApplication::PATH_IMAGES:
            result += "/data/images";
            break;

        case inviwo::InviwoApplication::PATH_DATABASES:
            result += "/data/databases";
            break;

        case inviwo::InviwoApplication::PATH_RESOURCES:
            result += "/resources";
            break;

        case inviwo::InviwoApplication::PATH_TRANSFERFUNCTIONS:
            result += "/data/transferfunctions";
            break;

        case inviwo::InviwoApplication::PATH_SETTINGS:
            result = filesystem::getInviwoUserSettingsPath();
            break;

        case inviwo::InviwoApplication::PATH_HELP:
            result += "/data/help";
            break;

        default:
            break;
    }

    if (createFolder) {
        filesystem::createDirectoryRecursively(result);
    }
    return result + suffix;
}

void InviwoApplication::registerModule(InviwoModule* module) {
    postProgress("Loaded module: " + module->getIdentifier());
    modules_.push_back(module);
}

const std::vector<InviwoModule*>& InviwoApplication::getModules() const {
    return modules_;
}

ProcessorNetwork* InviwoApplication::getProcessorNetwork() {
    return processorNetwork_;
}

ProcessorNetworkEvaluator* InviwoApplication::getProcessorNetworkEvaluator() {
    return processorNetworkEvaluator_;
}

const CommandLineParser* InviwoApplication::getCommandLineParser() const {
    return &commandLineParser_;
}

void InviwoApplication::printApplicationInfo() {
    LogInfoCustom("InviwoInfo", "Inviwo Version: " << IVW_VERSION);
    LogInfoCustom("InviwoInfo", "Base Path: " << getBasePath());
    std::string config = "";
#ifdef CMAKE_GENERATOR
    config += std::string(CMAKE_GENERATOR);
#endif
#if defined(CMAKE_BUILD_TYPE)
    config += " [" + std::string(CMAKE_BUILD_TYPE) + "]";
#elif defined(CMAKE_INTDIR)
    config += " [" + std::string(CMAKE_INTDIR) + "]";
#endif

    if (config != "")
        LogInfoCustom("InviwoInfo", "Config: " << config);
}

void InviwoApplication::postProgress(std::string progress) {
    if(progressCallback_) progressCallback_(progress);
}

void InviwoApplication::setPostEnqueueFront(std::function<void()> func) {
    queue_.postEnqueue = std::move(func);
}

std::string InviwoApplication::getDisplayName() const {
    return displayName_;
}

void InviwoApplication::addCallbackAction(ModuleCallbackAction* callbackAction) {
    moudleCallbackActions_.push_back(callbackAction);
}

std::vector<ModuleCallbackAction*> InviwoApplication::getCallbackActions() {
    return moudleCallbackActions_;
}

std::vector<Settings*> InviwoApplication::getModuleSettings(size_t startIdx) {
    std::vector<Settings*> allModuleSettings;

    for (size_t i=startIdx; i<modules_.size(); i++) {
        auto modSettings = modules_[i]->getSettings();
        allModuleSettings.insert(allModuleSettings.end(), modSettings.begin(), modSettings.end());
    }

    return allModuleSettings;
}

void InviwoApplication::addNonSupportedTags(const Tags t){
    for (auto& elem : t.tags_) {
        nonSupportedTags_.addTag(elem);
    }
}

bool InviwoApplication::checkIfAllTagsAreSupported(const Tags t) const{
    return (nonSupportedTags_.getMatches(t) == 0);
}

void InviwoApplication::processFront() {
    NetworkLock netlock(processorNetwork_);
    std::function<void()> task;
    while (true) {
        {
            std::unique_lock<std::mutex> lock{queue_.mutex};
            if (queue_.tasks.empty()) return;
            task = std::move(queue_.tasks.front());
            queue_.tasks.pop();
        }
        task();
    }

}

void InviwoApplication::setProgressCallback(std::function<void(std::string)> progressCallback) {
    progressCallback_ = progressCallback;
}

void InviwoApplication::waitForPool() {
    size_t old_size = pool_.getSize();
    pool_.setSize(0); // This will wait until all tasks are done;
    processFront();
    pool_.setSize(old_size);
}

} // namespace


text:
package org.search.system.models.validated;

import org.search.system.interfaces.Page;
import org.search.system.models.NullablePage;

import java.util.List;

/** Class contains main info about web-page null-safe
 * @author Daniil Matkov
 */
public class ValidatedPage implements Page {

    private NullablePage origin;

    public ValidatedPage(String title, String description, List<String> tags, String link, long rang) throws IllegalArgumentException {
        validate(title, description, tags, link);
        origin = new NullablePage(title, description, tags, link, rang);
    }

    private void validate(String title, String description, List<String> tags, String link) throws IllegalArgumentException {
        if (title == null) {
            throw new IllegalArgumentException();
        }

        if (description == null) {
            throw new IllegalArgumentException();
        }

        if (tags == null) {
            throw new IllegalArgumentException();
        }

        if (link == null) {
            throw new IllegalArgumentException();
        }
    }

    @Override
    public String getTitle() {
        return this.origin.getTitle();
    }

    @Override
    public String getDescription() {
        return this.origin.getDescription();
    }

    @Override
    public String getLink() {
        return this.origin.getLink();
    }

    @Override
    public long getRang() {
        return this.origin.getRang();
    }

    @Override
    public List<String> getTags() {
        return this.origin.getTags();
    }

    @Override
    public int compareTo(Object o) {
        return this.origin.compareTo(o);
    }
}


text:
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import LoginView
from django.core.exceptions import ImproperlyConfigured

from explorer import permissions, app_settings

class PermissionRequiredMixin:

    permission_required = None

    @staticmethod
    def handle_no_permission(request):
        return app_settings.EXPLORER_NO_PERMISSION_VIEW()(request)

    def get_permission_required(self):
        if self.permission_required is None:
            raise ImproperlyConfigured(
                '{0} is missing the permission_required attribute. '
                'Define {0}.permission_required, or override '
                '{0}.get_permission_required().'.format(
                    self.__class__.__name__
                )
            )
        return self.permission_required

    def has_permission(self, request, *args, **kwargs):
        perms = self.get_permission_required()

        # TODO: fix the case when the perms is not defined in
        #  permissions module.
        handler = getattr(permissions, perms)
        return handler(request, *args, **kwargs)

    def dispatch(self, request, *args, **kwargs):
        if not self.has_permission(request, *args, **kwargs):
            return self.handle_no_permission(request)
        return super().dispatch(request, *args, **kwargs)

class SafeLoginView(LoginView):
    template_name = 'admin/login.html'

def safe_login_view_wrapper(request):
    return SafeLoginView.as_view(
        extra_context={
            'title': 'Log in',
            REDIRECT_FIELD_NAME: request.get_full_path()
        }
    )(request)


text:
"""
Extended functionality not officially part of PEP 483/484 (at least not yet).
"""
from .shared import TypeLogic

__all__ = [
    'Intersection',
    'Not'
]

class Intersection(TypeLogic):
    """
    Currently mentioned as a possibility in PEP 483
    """
    def __init__(self, *_types):
        TypeLogic.__init__(*_types)

    def __instancecheck__(self, instance):
        return not any(
            isinstance(instance, _type)
            for _type in self.types
        )

    def __subclasscheck__(self, subclass):
        return not any(
            issubclass(subclass, _type)
            for _type in self.types
        )

class Not(TypeLogic):
    """
    Checks that instance does not match ANY element of self.types
    """
    def __init__(self, *_types):
        TypeLogic.__init__(*_types)

    def __instancecheck__(self, instance):
        return not any(
            isinstance(instance, _type)
            for _type in self.types
        )

    def __subclasscheck__(self, subclass):
        return not any(
            issubclass(subclass, _type)
            for _type in self.types
        )


text:
//
//  PPOcrScanResult.h
//  PhotoPayFramework
//
//  Created by Jura on 18/09/14.
//  Copyright (c) 2014 MicroBlink Ltd. All rights reserved.
//

#import "PPRecognizerResult.h"
#import "PPOcrLayout.h"

/**
 * Result of scanning with OCR Recognizer
 *
 * For each parser group, the result contains one Ocr Layout, and one or more parsed results.
 */
@interface PPOcrRecognizerResult : PPRecognizerResult

/**
 * Designated initializer for this class
 *
 *  @param recognitionResult Recognition result private implementation
 *
 *  @return initialized OCR recognizer result
 */
- (instancetype)initWithRecognitionResult:(struct RecognitionResultImpl *)recognitionResult;

/**
 * If only default parser group is used, this method returns the OCR layout for this parser group
 *
 *  @return OCR layout for default parser group
 */
- (PPOcrLayout*)ocrLayout;

/**
 * If only default parser group is used, this method returns parsed string from the defaul parser group
 *
 *  @param name name of the parser responsible for parsing the wanted string
 *
 *  @return parsed string
 */
- (NSString*)parsedResultForName:(NSString*)name;

/**
 * Retrieves OCR layout from arbitrary parser groups
 *
 *  @param parserGroup parser group name
 *
 *  @return OCR layout for given parser group
 */
- (PPOcrLayout*)ocrLayoutForParserGroup:(NSString*)parserGroup;

/**
 *  Retrieves parsed string from given parser group
 *
 *  @param name        name of the parser responsible for parsing the wanted string
 *  @param parserGroup parser group name
 *
 *  @return parsed string
 */
- (NSString*)parsedResultForName:(NSString*)name parserGroup:(NSString*)parserGroup;

@end


text:
package org.skia.skottie;
import android.app.Application;

public class SkottieApplication extends Application {

    static {
        System.loadLibrary("skottie_android");
    }

    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
    }
}


text:
[![Build Status](https://travis-ci.org/clovislima/mathematical.svg?branch=master)](https://travis-ci.org/clovislima/mathematical)
[![Dependency Status](https://david-dm.org/clovislima/mathematical.svg)](https://david-dm.org/clovislima/mathematical)
[![devDependency Status](https://david-dm.org/clovislima/mathematical/dev-status.svg)](https://david-dm.org/clovislima/mathematical#info=devDependencies)
## Objects

Mathematical : object

Mathematical is a collection of methods to help dealing with the Number class in javascript

## Functions

decimalsCurry(func) ⇒ function

A method factory to deal with decimals

## Mathematical : object
Mathematical is a collection of methods to help dealing with the Number class in javascript

**Kind**: global namespace
**this**: HTMLStock
**Access:** public
**Since**: 0.1.0

| Param | Type | Description |
| --- | --- | --- |
| arrayLike | object | A NodeList, HTMLCollection or an Array Like object containing HTMLElements or undefined properties |

* [Mathematical](#Mathematical) : object
    * [.Utils](#Mathematical.Utils) : object
        * [.round(num, [decimals])](#Mathematical.Utils.round) ⇒ Number
        * [.ceil(num, [decimals])](#Mathematical.Utils.ceil) ⇒ Number
        * [.floor(num, [decimals])](#Mathematical.Utils.floor) ⇒ Number
        * [.roundToEven(num, [decimals])](#Mathematical.Utils.roundToEven) ⇒ Number
        * [.random([min], [max])](#Mathematical.Utils.random) ⇒ Number
        * [.randomInt([min], [max])](#Mathematical.Utils.randomInt) ⇒ Number
        * [.getDirection(num)](#Mathematical.Utils.getDirection) ⇒ Number

### Mathematical.Utils : object
Utilities to deal with numbers

**Kind**: static namespace of [Mathematical](#Mathematical)
**this**: HTMLStock
**Access:** public
**Since**: 0.1.0

| Param | Type | Description |
| --- | --- | --- |
| arrayLike | object | A NodeList, HTMLCollection or an Array Like object containing HTMLElements or undefined properties |

* [.Utils](#Mathematical.Utils) : object
    * [.round(num, [decimals])](#Mathematical.Utils.round) ⇒ Number
    * [.ceil(num, [decimals])](#Mathematical.Utils.ceil) ⇒ Number
    * [.floor(num, [decimals])](#Mathematical.Utils.floor) ⇒ Number
    * [.roundToEven(num, [decimals])](#Mathematical.Utils.roundToEven) ⇒ Number
    * [.random([min], [max])](#Mathematical.Utils.random) ⇒ Number
    * [.randomInt([min], [max])](#Mathematical.Utils.randomInt) ⇒ Number
    * [.getDirection(num)](#Mathematical.Utils.getDirection) ⇒ Number

#### Utils.round(num, [decimals]) ⇒ Number
A proxy to Math.round method, but with scientific notation to deal with decimals

**Kind**: static method of [Utils](#Mathematical.Utils)
**Access:** public
**Since**: 1.0.0

| Param | Type | Description |
| --- | --- | --- |
| num | number | The number to be rounded |
| [decimals] | number | The number of decimals that will be used |

#### Utils.ceil(num, [decimals]) ⇒ Number
A proxy to Math.ceil method, but with scientific notation to deal with decimals

**Kind**: static method of [Utils](#Mathematical.Utils)
**Access:** public
**Since**: 1.0.0

| Param | Type | Description |
| --- | --- | --- |
| num | number | The number to be rounded to the next bigger value |
| [decimals] | number | The number of decimals that will be used |

#### Utils.floor(num, [decimals]) ⇒ Number
A proxy to Math.floor method, but with scientific notation to deal with decimals

**Kind**: static method of [Utils](#Mathematical.Utils)
**Access:** public
**Since**: 1.0.0

| Param | Type | Description |
| --- | --- | --- |
| num | number | The number to be rounded to the next lesser value |
| [decimals] | number | The number of decimals that will be used |

#### Utils.roundToEven(num, [decimals]) ⇒ Number
Rounds a number to the nearest even number

**Kind**: static method of [Utils](#Mathematical.Utils)
**Access:** public
**Since**: 1.0.0

| Param | Type | Description |
| --- | --- | --- |
| num | number | The number to be rounded to the next even value |
| [decimals] | number | The number of decimals that will be used |

#### Utils.random([min], [max]) ⇒ Number
Generates a random float number

**Kind**: static method of [Utils](#Mathematical.Utils)
**Access:** public
**Since**: 1.0.0

| Param | Type | Description |
| --- | --- | --- |
| [min] | number | The minimum value to be generated. If only one value is passed as an argument then this value is considered a max. |
| [max] | number | The maximum value to be generated. |

#### Utils.randomInt([min], [max]) ⇒ Number
Generates a random integer number

**Kind**: static method of [Utils](#Mathematical.Utils)
**Access:** public
**Since**: 1.0.0

| Param | Type | Description |
| --- | --- | --- |
| [min] | number | The minimum value to be generated. If only one value is passed as an argument then this value is considered a max. |
| [max] | number | The maximum value to be generated. |

#### Utils.getDirection(num) ⇒ Number
Returns -1 if the number passed is negative, +1 e its positive or 0 if its 0

**Kind**: static method of [Utils](#Mathematical.Utils)
**Throws**:

- TypeError

**Access:** public
**Since**: 1.0.0

| Param | Type | Description |
| --- | --- | --- |
| num | number | A number on which the direction will be discovered |

## decimalsCurry(func) ⇒ function
A method factory to deal with decimals

**Kind**: global function
**Since**: 1.0.0

| Param | Type | Description |
| --- | --- | --- |
| func | function | The function that will deal with decimals |


text:
package com.google.android.exoplayer.text;

import com.google.android.exoplayer.SampleHolder;
import com.google.android.exoplayer.util.Assertions;

import android.media.MediaCodec;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Wraps a {@link SubtitleParser}, exposing an interface similar to {@link MediaCodec} for
 * asynchronous parsing of subtitles.
 */
public class SubtitleParserHelper implements Handler.Callback {

  private final SubtitleParser parser;

  private final Handler handler;
  private SampleHolder sampleHolder;
  private boolean parsing;
  private Subtitle result;
  private IOException error;

  /**
   * @param looper The {@link Looper} associated with the thread on which parsing should occur.
   * @param parser The parser that should be used to parse the raw data.
   */
  public SubtitleParserHelper(Looper looper, SubtitleParser parser) {
    this.handler = new Handler(looper, this);
    this.parser = parser;
    flush();
  }

  /**
   * Flushes the helper, canceling the current parsing operation, if there is one.
   */
  public synchronized void flush() {
    sampleHolder = new SampleHolder(SampleHolder.BUFFER_REPLACEMENT_MODE_NORMAL);
    parsing = false;
    result = null;
    error = null;
  }

  /**
   * Whether the helper is currently performing a parsing operation.
   *
   * @return True if the helper is currently performing a parsing operation. False otherwise.
   */
  public synchronized boolean isParsing() {
    return parsing;
  }

  /**
   * Gets the holder that should be populated with data to be parsed.
   *

   * The returned holder will remain valid unless {@link #flush()} is called. If {@link #flush()}
   * is called the holder is replaced, and this method should be called again to obtain the new
   * holder.
   *
   * @return The holder that should be populated with data to be parsed.
   */
  public synchronized SampleHolder getSampleHolder() {
    return sampleHolder;
  }

  /**
   * Start a parsing operation.
   *

   * The holder returned by {@link #getSampleHolder()} should be populated with the data to be
   * parsed prior to calling this method.
   */
  public synchronized void startParseOperation() {
    Assertions.checkState(!parsing);
    parsing = true;
    result = null;
    error = null;
    handler.obtainMessage(0, sampleHolder).sendToTarget();
  }

  /**
   * Gets the result of the most recent parsing operation.
   *

   * The result is cleared as a result of calling this method, and so subsequent calls will return
   * null until a subsequent parsing operation has finished.
   *
   * @return The result of the parsing operation, or null.
   * @throws IOException If the parsing operation failed.
   */
  public synchronized Subtitle getAndClearResult() throws IOException {
    try {
      if (error != null) {
        throw error;
      }
      return result;
    } finally {
      error = null;
      result = null;
    }
  }

  @Override
  public boolean handleMessage(Message msg) {
    Subtitle result;
    IOException error;
    SampleHolder holder = (SampleHolder) msg.obj;
    try {
      InputStream inputStream = new ByteArrayInputStream(holder.data.array(), 0, holder.size);
      result = parser.parse(inputStream, null, sampleHolder.timeUs);
      error = null;
    } catch (IOException e) {
      result = null;
      error = e;
    }
    synchronized (this) {
      if (sampleHolder != holder) {
        // A flush has occurred since this holder was posted. Do nothing.
      } else {
        this.result = result;
        this.error = error;
        this.parsing = false;
      }
    }
    return true;
  }

}


text:
/*

Name:       Base16 Duotone-DarkLake Light
Author:     adapted from: Simurai (https://github.com/simurai/duotone-dark-syntax/)

Prism template by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/prism/)
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)

*/

code[class*="language-"],
pre[class*="language-"] {
  font-family: Consolas, Menlo, Monaco, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
  font-size: 14px;
  line-height: 1.375;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;

  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
  background: #e1ebff;
  color: #ffa3d3;
}

pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
  text-shadow: none;
  background: #a5c2fe;
}

pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
  text-shadow: none;
  background: #a5c2fe;
}

/* Code blocks */
pre[class*="language-"] {
  padding: 1em;
  margin: .5em 0;
  overflow: auto;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
  padding: .1em;
  border-radius: .3em;
}

.token.punctuation,
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #a5c2fe;
}

.token.namespace {
  opacity: .7;
}

.token.tag,
.token.operator,
.token.boolean,
.token.number {
  color: #f075b5;
}
.token.property,
.token.function {
  color: #4e72bc;
}

.token.tag-id,
.token.selector,
.token.atrule-id {
  color: #182234;
}

code.language-javascript,
.token.attr-name {
  color: #295cc2;
}

code.language-css,
code.language-scss {
  color: #ffa3d3;
}

.token.string,
.token.entity,
.token.url,
.language-css .token.string,
.language-scss .token.string,
.style .token.string,
.token.attr-value,
.token.keyword,
.token.control,
.token.directive,
.token.unit,
.token.statement,
.token.regex,
.token.atrule {
  color: #f075b5;
}

.token.placeholder,
.token.variable {
  color: #f994c9;
}

.token.deleted {
  text-decoration: line-through;
}

.token.inserted {
  border-bottom: 1px dotted #182234;
  text-decoration: none;
}

.token.italic {
  font-style: italic;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.important {
  color: #295cc2;
}

.token.entity {
  cursor: help;
}

pre > code.highlight {
  outline: .4em solid #295cc2;
  outline-offset: .4em;
}