text:
<?php

namespace Surfnet\SamlBundle\Entity;

use SAML2\Configuration\PrivateKey;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\RouterInterface;

class HostedEntities
{
    /**
     * @var ServiceProvider
     */
    private $serviceProvider;

    /**
     * @var array
     */
    private $serviceProviderConfiguration;

    /**
     * @var IdentityProvider
     */
    private $identityProvider;

    /**
     * @var array
     */
    private $identityProviderConfiguration;

    /**
     * @var \Symfony\Component\Routing\RouterInterface
     */
    private $router;

    /**
     * @var RequestStack
     */
    private $requestStack;

    /**
     * @param RouterInterface $router
     * @param RequestStack    $requestStack
     * @param array           $serviceProviderConfiguration
     * @param array           $identityProviderConfiguration
     */
    public function __construct(
        RouterInterface $router,
        RequestStack $requestStack,
        array $serviceProviderConfiguration = null,
        array $identityProviderConfiguration = null
    ) {
        $this->router                        = $router;
        $this->requestStack                  = $requestStack;
        $this->serviceProviderConfiguration  = $serviceProviderConfiguration;
        $this->identityProviderConfiguration = $identityProviderConfiguration;
    }

    /**
     * @return null|ServiceProvider
     */
    public function getServiceProvider()
    {
        if (!empty($this->serviceProvider)) {
            return $this->serviceProvider;
        }

        if (!$this->serviceProviderConfiguration['enabled']) {
            return null;
        }

        $configuration = $this->createStandardEntityConfiguration($this->serviceProviderConfiguration);
        $configuration['assertionConsumerUrl'] = $this->generateUrl(
            $this->serviceProviderConfiguration['assertion_consumer_route']
        );

        return $this->serviceProvider = new ServiceProvider($configuration);
    }

    /**
     * @return null|IdentityProvider
     */
    public function getIdentityProvider()
    {
        if (!empty($this->identityProvider)) {
            return $this->identityProvider;
        }

        if (!$this->identityProviderConfiguration['enabled']) {
            return null;
        }

        $configuration = $this->createStandardEntityConfiguration($this->identityProviderConfiguration);
        $configuration['ssoUrl'] = $this->generateUrl(
            $this->identityProviderConfiguration['sso_route']
        );

        return $this->identityProvider = new IdentityProvider($configuration);
    }

    /**
     * @param array $entityConfiguration
     * @return array
     */
    private function createStandardEntityConfiguration($entityConfiguration)
    {
        $privateKey = new PrivateKey($entityConfiguration['private_key'], PrivateKey::NAME_DEFAULT);

        return [
            'entityId'                   => $this->generateUrl($entityConfiguration['entity_id_route']),
            'certificateFile'            => $entityConfiguration['public_key'],
            'privateKeys'                => [$privateKey],
            'blacklistedAlgorithms'      => [],
            'assertionEncryptionEnabled' => false
        ];
    }

    /**
     * @param string|array $routeDefinition
     * @return string
     */
    private function generateUrl($routeDefinition)
    {
        $route      = is_array($routeDefinition) ? $routeDefinition['route'] : $routeDefinition;
        $parameters = is_array($routeDefinition) ? $routeDefinition['parameters'] : [];

        $context = $this->router->getContext();

        if (method_exists($this->requestStack, 'getMainRequest')) {
            $context->fromRequest($this->requestStack->getMainRequest());
        } else {
            $context->fromRequest($this->requestStack->getMasterRequest());
        }
        $url = $this->router->generate($route, $parameters, RouterInterface::ABSOLUTE_URL);

        $context->fromRequest($this->requestStack->getCurrentRequest());

        return $url;
    }
}


text:
Extend is a set of .Net extension methods build as portable class library.
Extend enhance the .Net framework by adding a bunch of methods to increase developer's productivity.
Currently it contains 377 unique extension methods (623 overloads included).
### Where can I use it?
You can use it in every .Net application or library targeting one of the following profiles:
* .Net 4.5
* Windows 8
* Windows Phone 8
* Windows Phone 8.1

### How do I use it?
1. Install ["Extend"](http://www.nuget.org/packages/Extend/) via [NuGet](http://nuget.org)
__Install-Package PortableExtensions__
2. Add using for Extend ```using Extend; ```
3. Done!

redpajama_set_name: RedPajamaGithub


text:
var mongoose = require('mongoose');
var bcrypt = require('bcryptjs');

// User Schema
var UserSchema = mongoose.Schema({
	username: {
		type: String,
		required: true,
        unique: true
	},
	password: {
		type: String,
        required: true
	},
	email: {
		type: String,
        required: true,
        unique: true
	},
	name: {
		type: String,
        required: true
	},
    resetPasswordToken: String,
    resetPasswordExpires: Date
});

var User = module.exports = mongoose.model('User', UserSchema);

module.exports.createUser = function(newUser, callback){
	bcrypt.genSalt(10, function(err, salt) {
	    bcrypt.hash(newUser.password, salt, function(err, hash) {
	        newUser.password = hash;
	        newUser.save(callback);
	    });
	});
}

module.exports.getUserByUsername = function(username, callback){
	var query = {username: username};
	User.findOne(query, callback);
}

module.exports.getUserById = function(id, callback){
	User.findById(id, callback);
}

module.exports.comparePassword = function(candidatePassword, hash, callback){
	bcrypt.compare(candidatePassword, hash, function(err, isMatch) {
    	if(err) throw err;
    	callback(null, isMatch);
	});
}


text:
require File.expand_path('../helper', __FILE__)
require 'rbconfig'
require 'open-uri'
require 'timeout'

class IntegrationTest < Test::Unit::TestCase
  def app_file
    File.expand_path('../integration/app.rb', __FILE__)
  end

  def port
    5000 + (Process.pid % 1000)
  end

  def command
    cmd = ['exec']
    if RbConfig.respond_to? :ruby
      cmd << RbConfig.ruby.inspect
    else
      file, dir = RbConfig::CONFIG.values_at('ruby_install_name', 'bindir')
      cmd << File.expand_path(file, dir).inspect
    end
    cmd << "-I" << File.expand_path('../../lib', __FILE__).inspect
    cmd << app_file.inspect << '-p' << port << '2>&1'
    cmd.join(" ")
  end

  def display_output(pipe)
    out = ""
    loop { out <<  pipe.read_nonblock(1) }
  rescue
    $stderr.puts command, out unless out.empty?
  end

  def kill(pid, signal = "TERM")
    Process.kill(signal, pid)
  rescue NotImplementedError
    system "kill -s #{signal} #{pid}"
  end

  def with_server
    pipe = IO.popen(command)
    error = nil
    Timeout.timeout(120) do
      begin
        yield
      rescue Errno::ECONNREFUSED => e
        error = e
        sleep 0.1
        retry
      end
    end
    kill(pipe.pid) if pipe
  rescue Timeout::Error => e
    display_output pipe
    kill(pipe.pid, "KILL") if pipe
    raise error || e
  end

  it 'starts a top level application' do
    with_server do
      assert_equal open("http://127.0.0.1:#{port}/app_file").read, app_file
    end
  end
end


text:
This folder was last updated as follows:

    export ver=1.16.3
    cd third_party
    curl -L -O https://github.com/BinomialLLC/basis_universal/archive/refs/tags/${ver}.zip
    unzip ${ver}.zip
    mv basis_universal-* basis_new
    rsync -r basis_new/ basisu/ --delete --exclude tnt
    rm -rf ${ver}.zip basis_new
    git add basisu ; git status

Our CMakeLists differs from the one in basisu as follows.

(1)

Disable support for various texture formats that we don't need.

(2)

Remove the `CMAKE_RUNTIME_OUTPUT_DIRECTORY` setter and strip commands from their CMakeLists, because
we prefer to use the default location for the executable.

(3)

Add a library target called `basis_encoder` because we prefer to use it as a library, not an
executable.

(4)

Add a library target called `basis_transcoder` for use as a lean & mean reader-only library.

(5)

Simplify by removing support for OPENCL and requiring ZSTD to be enabled.


text:
EDLIB=~/git/edlib/build/bin/edlib-aligner

TEST_DATA=.

########################## TEST RUNNERS ########################

F_YELLOW='\e[93m'
F_NONE='\e[0m'
F_UNDERLINE='\e[4m'
F_NO_UNDERLINE='\e[24m'
F_BOLD='\e[1m'
F_NO_BOLD='\e[21m'

function echo_underlined {
    local input=$1
    echo -e "${F_UNDERLINE}${input}${F_NO_UNDERLINE}"
}

function echo_bolded {
    local input=$1
    echo -e "${F_BOLD}${input}${F_NO_BOLD}"
}

function edlib {
    mode=$1
    query=$2
    target=$3
    num_tests=$4
    k=$5
    r=${6-1}  # Number of repetitions, default is 1.

    time_sum=0
    for i in $(seq $num_tests); do
        sleep 0.25
        output=$($EDLIB -m $mode -k $k -r $r $query $target)
        time=$(echo "$output" | grep "Cpu time of searching" | cut -d " " -f5)
        score=$(echo "$output" | grep "#0:" | cut -d " " -f2)
        time_sum=$(python -c "print($time_sum + $time)")
        #echo ">" "#"$i $score $time
    done
    avg_time=$(python -c "print($time_sum / $num_tests)")
    echo -e "    => Edlib, $r repetition(s): time=${F_YELLOW}${avg_time}${F_NONE}s, score=$score"
}

function edlib_path {
    mode=$1
    query=$2
    target=$3
    num_tests=$4
    r=${5-1}  # Number of repetitions, default is 1.

    time_sum=0
    for i in $(seq $num_tests); do
        sleep 0.1
        output=$($EDLIB -m $mode -r $r -p -s $query $target)
        time=$(echo "$output" | grep "Cpu time of searching" | cut -d " " -f5)
        time_sum=$(python -c "print($time_sum + $time)")
        #echo ">" "#"$i $time
    done
    avg_time=$(python -c "print($time_sum / $num_tests)")
    echo -e "    => Edlib (path), $r repetition(s): time=${F_YELLOW}${avg_time}${F_NONE}s, score=$score"
}

############################ TESTS #############################

# ---------------------- Short reads ----------------------- #

# SHW (prefix).
echo_bolded "\nSHW, short query (<= 500bp) and long target."
target=$TEST_DATA/E_coli_DH1/e_coli_DH1.fasta
for query_length in 50 100 250 500; do
    echo_underlined "Query length: $query_length"
    for query in $(ls $TEST_DATA/E_coli_DH1/prefixes/${query_length}bp/mutated_*_perc.fasta); do
        echo "  Query: $query"
        edlib      SHW $query $target 3 -1 100  # Last number here is num repetitions, tweak it if times are too small.
        edlib_path SHW $query $target 3    100
    done
done

# HW (infix).
echo_bolded "\nHW, short query (<= 500bp) and long target."
target=$TEST_DATA/E_coli_DH1/e_coli_DH1.fasta
for query_length in 50 100 250 500; do
    echo_underlined "Query length: $query_length"
    for query in $(ls $TEST_DATA/E_coli_DH1/mason_illumina_reads/${query_length}bp/*.fasta); do
        echo "  Query: $query"
        edlib      HW $query $target 3 -1
        edlib_path HW $query $target 3
    done
done

# NW (global).
echo_bolded "\nNW, query and target of equal size, both short (<= 500bp)."
for seq_length in 50 100 250 500; do
    reads_dir=$TEST_DATA/E_coli_DH1/mason_illumina_reads/${seq_length}bp
    target=$reads_dir/e_coli_DH1_illumina_1x${seq_length}.fasta
    echo_underlined "Query and target length: $seq_length"
    echo_underlined "Target: $target"
    for query in $(ls $reads_dir/*.fasta); do
        echo "  Query: $query"
        edlib      HW $query $target 3 -1 100000  # Last number here is num repetitions, tweak it if times are too small.
        edlib_path HW $query $target 3    10000
    done
done

# ----------------------- Long reads ----------------------- #

# HW (infix).
echo_bolded -e "\nHW, long query and long target."
target=$TEST_DATA/E_coli_DH1/e_coli_DH1.fasta
for query in $(ls $TEST_DATA/E_coli_DH1/mason_illumina_reads/10kbp/*.fasta); do
    echo_underlined "Query: $query"
    edlib      HW $query $target 3 -1
    edlib_path HW $query $target 3
done

# SHW (prefix).
echo_bolded -e "\nSHW, long query and long target."
target=$TEST_DATA/E_coli_DH1/e_coli_DH1.fasta
for query in $(ls $TEST_DATA/E_coli_DH1/prefixes/10kbp/mutated_*_perc.fasta); do
    echo_underlined "Query: $query"
    edlib      SHW $query $target 3 -1
    edlib_path SHW $query $target 3
done

# NW (global).
echo_bolded "\nNW, big query and target."
target=$TEST_DATA/Chromosome_2890043_3890042_0/Chromosome_2890043_3890042_0.fasta
for query in $(ls $TEST_DATA/Chromosome_2890043_3890042_0/mutated_*_perc.fasta); do
    echo_underlined "Query: $query"
    edlib      NW $query $target 3 -1
    edlib_path NW $query $target 3
done


text:
namespace ghost_test {

// This class is the central orchestrator of the RocksDB experiment. It manages
// the load generator, the dispatcher (if one exists), and the workers. It
// prints out the results when the experiment is finished.
//
// Note that this is an abstract class so it cannot be constructed.
class Orchestrator {
 public:
  enum GhostWaitType {
    kPrioTable,
    kFutex,
  };

  // Orchestrator configuration options.
  struct Options {
    // Parses all command line flags and returns them as an 'Options' instance.
    static Options GetOptions();

    // This pass a string representation of 'options' to 'os'. The options are
    // printed in alphabetical order by name.
    friend std::ostream& operator<<(std::ostream& os, const Options& options);

    latency::PrintOptions print_options;

    // The orchestrator prints the overall results for all request types
    // combined, no matter what.

    // If true, the orchestrator will also print a section with the results for
    // just Get requests.
    bool print_get;

    // If true, the orchestrator will also print a section with the results for
    // just Range queries.
    bool print_range;

    // The path to the RocksDB database.
    std::filesystem::path rocksdb_db_path;

    // The throughput of the generated synthetic load.
    double throughput;

    // The share of requests that are Range queries. This value must be greater
    // than or equal to 0 and less than or equal to 1. The share of requests
    // that are Get requests is '1 - range_query_ratio'.
    double range_query_ratio;

    // The CPU that the load generator thread runs on.
    int load_generator_cpu;

    // For CFS (Linux Completely Fair Scheduler) experiments, the CPU that the
    // dispatcher runs on.
    int cfs_dispatcher_cpu;

    // The number of workers. Each worker has one thread.
    size_t num_workers;

    // The CPUs that worker threads run on for CFS (Linux Completely Fair
    // Scheduler) experiments. Each worker thread is pinned to its own CPU.
    // Thus, `worker_cpus.size()` must be equal to `num_workers`.
    //
    // For ghOSt experiments, ghOSt assigns workers to CPUs. Thus, this vector
    // must be empty when ghOSt is used.
    std::vector<int> worker_cpus;

    // The worker wait type for CFS (Linux Completely Fair Scheduler)
    // experiments. The workers can either spin while waiting for more work
    // ('kWaitSpin') or they can sleep on a futex while waiting for more work
    // ('kWaitFutex').
    ThreadWait::WaitType cfs_wait_type;

    // The worker wait type for ghOSt experiments. The workers can either
    // interact with ghOSt and wait via the PrioTable or they can wait via a
    // futex. In the former case, ghOSt learns worker runnability status via the
    // PrioTable. In the latter case, ghOSt learns worker runnability status
    // implicitly via TASK_BLOCKED/TASK_WAKEUP messages generated via the futex.
    GhostWaitType ghost_wait_type;

    // The total amount of time spent processing a Get request in RocksDB and
    // doing synthetic work.
    absl::Duration get_duration;

    // The total amount of time spent processing a Range query in RocksDB and
    // doing synthetic work.
    absl::Duration range_duration;

    // The Get request service time distribution can be converted from a fixed
    // distribution to an exponential distribution by adding a sample from the
    // exponential distribution with a mean of 'get_exponential_mean' to
    // 'get_duration' to get the total service time for a Get request.
    //
    // Distribution: 'get_duration' + Exp(1 / 'get_exponential_mean')
    //
    // To keep the Get request service time distribution as a fixed
    // distribution, set 'get_exponential_mean' to 'absl::ZeroDuration()'.
    absl::Duration get_exponential_mean;

    // The maximum number of requests to assign at a time to a worker. Generally
    // this should be set to 1 (otherwise centralized queuing and Shinjuku
    // cannot be faithfully implemented) but we support larger batches for
    // future experiments that may want them.
    size_t batch;

    // The experiment duration.
    absl::Duration experiment_duration;

    // Discards all results from when the experiment starts to when the
    // 'discard' duration has elapsed. We do not want the results to include
    // initialization costs, such as page faults.
    absl::Duration discard_duration;

    // The scheduler that schedules the experiment. This is either CFS (Linux
    // Completely Fair Scheduler) or ghOSt.
    ghost::GhostThread::KernelScheduler scheduler;

    // For the ghOSt experiments, this is the QoS (Quality-of-Service) class
    // for the PrioTable work class that all worker sched items are added to.
    uint32_t ghost_qos;
  };

  // Threads use this type to pass requests to each other. In the CFS (Linux
  // Completely Fair Scheduler) experiments, the load generator uses this to
  // pass requests to the dispatcher and the dispatcher uses this to pass
  // requests to workers. In the ghOSt experiments, the load generator uses this
  // to pass requests to workers.
  //
  // When 'num_requests' is greater than zero, there are pending requests for
  // the worker. When 'num_requests' is 0, there are no pending requests for the
  // worker, so the dispatcher should add requests.
  struct WorkerWork {
    // The number of requests in 'requests'. We use this atomic rather than just
    // look at 'requests.size()' since the dispatcher and the worker need an
    // atomic to sync on. This number should never be greater than
    // 'options_.batch'.
    std::atomic<size_t> num_requests;
    // The requests.
    std::vector<Request> requests;
  } ABSL_CACHELINE_ALIGNED;

  // Affine all background threads to this CPU.
  static constexpr int kBackgroundThreadCpu = 0;

  virtual ~Orchestrator() = 0;

  // Stops the experiment, joins all threads (i.e., the load generator, the
  // dispatcher (if one exists), and the workers) and prints the results
  // specified in 'options_'.
  virtual void Terminate() = 0;

  // Returns the CPU runtime for the calling thread.
  absl::Duration GetThreadCpuTime() const;

 protected:
  // The SID (sched item identifier) of the load generator.
  static constexpr uint32_t kLoadGeneratorSid = 0;

  // The SID (sched item identifier) of the dispatcher. Note that the dispatcher
  // only runs in the CFS (Linux Completely Fair Scheduler) experiments. In the
  // ghOSt experiments, the global agent plays the role of the dispatcher.
  static constexpr uint32_t kDispatcherSid = 1;

  // Constructs the orchestrator. 'options' is the experiment settings.
  // 'total_threads' is the total number of threads managed by the orchestrator,
  // including the load generator thread, the worker threads, and if relevant,
  // the dispatcher thread.
  Orchestrator(Options options, size_t total_threads);

  // This method is executed in a loop by the load generator thread. This method
  // checks the ingress queue for pending requests. 'sid' is the sched item
  // identifier for the load generator thread.
  virtual void LoadGenerator(uint32_t sid) = 0;

  // This method is executed in a loop by the dispatcher thread, if one exists.
  // If so, this method receives requests from the load generator and assigns
  // them to workers. 'sid' is the sched item identifier for the dispatcher
  // thread.
  virtual void Dispatcher(uint32_t sid) = 0;

  // This method is executed in a loop by worker threads. This method handles
  // the request assigned to it by accessing the RocksDB database and doing
  // synthetic work. 'sid' is the sched item identifier for the worker thread.
  virtual void Worker(uint32_t sid) = 0;

  // Handles 'request' which is either a Get request or a Range query. 'gen' is
  // a random bit generator used for Get requests that have an exponential
  // service time. 'gen' is used to generate a sample from the exponential
  // distribution.
  void HandleRequest(Request& request, absl::BitGen& gen);

  // Prints all results (total numbers of requests, throughput, and latency
  // percentiles). 'experiment_duration' is the duration of the experiment.
  void PrintResults(absl::Duration experiment_duration) const;

  const Options& options() const { return options_; }

  size_t total_threads() const { return total_threads_; }

  SyntheticNetwork& network() { return network_; }

  ExperimentThreadPool& thread_pool() { return thread_pool_; }

  absl::Time start() const { return start_; }
  void set_start(absl::Time start) { start_ = start; }

  std::vector<std::unique_ptr<WorkerWork>>& worker_work() {
    return worker_work_;
  }

  std::vector<std::vector<Request>>& requests() { return requests_; }

  std::vector<absl::BitGen>& gen() { return gen_; }

  ThreadTrigger& first_run() { return first_run_; }

 private:
  // Processes 'request', which must be a Get request (a CHECK will fail if
  // not).
  void HandleGet(Request& request, absl::BitGen& gen);

  // Processes 'request', which must be a Range query (a CHECK will fail if
  // not).
  void HandleRange(Request& request, absl::BitGen& gen);

  // Prints the results for 'requests' (total number of requests in 'requests',
  // throughput, and latency percentiles). 'results_name' is a name printed with
  // the results (e.g., "Get" for Get requests) and 'experiment_duration' is the
  // duration of the experiment.
  void PrintResultsHelper(const std::string& results_name,
                          absl::Duration experiment_duration,
                          const std::vector<Request>& requests) const;

  // Squashes the two-dimensional 'requests' vector into a one-dimensional
  // vector and returns the one-dimensional vector. Each request is only added
  // into the one-dimensional vector if 'should_include' returns true when the
  // request is passed as a parameter to it.
  std::vector<Request> FilterRequests(
      const std::vector<std::vector<Request>>& requests,
      std::function<bool(const Request&)> should_include) const;

  // Returns true if 'request' was generated during the discard period should
  // not be included in the results. Returns false if 'request' was generated
  // after the discard and should be included in the results.
  bool ShouldDiscard(const Request& request) const;

  // Spins for 'duration'. 'start_duration' is the CPU time consumed by the
  // thread when calling this method. There is overhead to calling this method,
  // such as creating the stack frame, so passing 'start_duration' allows the
  // method to count this overhead toward its synthetic work.
  void Spin(absl::Duration duration, absl::Duration start_duration) const;

  // Orchestrator options.
  const Options options_;

  // The total number of threads managed by the orchestrator, including the load
  // generator thread, the worker threads, and if relevant, the dispatcher
  // thread.
  const size_t total_threads_;

  // The RocksDB database.
  Database database_;

  // The synthetic network that the load generator uses to generate synthetic
  // requests.
  SyntheticNetwork network_;

  // The time that the experiment started at (after initialization).
  absl::Time start_;

  // Shared memory used by the dispatcher to pass requests to workers. Worker
  // 'i' accesses index 'i' in this vector. We wrap each 'WorkerWork' struct in
  // a unique pointer since the struct contains an atomic and therefore does not
  // have a copy constructor, so it cannot be stored directly into a vector.
  std::vector<std::unique_ptr<WorkerWork>> worker_work_;

  // The requests processed to completion by workers.
  std::vector<std::vector<Request>> requests_;

  // Random bit generators. Each thread has its own bit generator since the bit
  // generators are not thread safe.
  std::vector<absl::BitGen> gen_;

  // A thread triggers itself the first time it runs. Each thread does work on
  // its first iteration, so each thread uses the trigger to know if it is in
  // its first iteration or not.
  ThreadTrigger first_run_;

  // The thread pool.
  ExperimentThreadPool thread_pool_;
};

}  // namespace ghost_test

#endif  // GHOST_EXPERIMENTS_ROCKSDB_ORCHESTRATOR_H_


text:
import { vec3 } from 'gl-matrix';

let vecTemp = vec3.create();

export default class BlenderControllerSystem {
  constructor(engine) {
    this.engine = engine;
    this.hooks = {
      'blenderController.setRadius:post!': ([entity]) => {
        if (entity.camera == null) return;
        // Update camera projection
        if (entity.camera.type === 'ortho') {
          this.engine.actions.camera.setOrtho(entity,
            entity.blenderController.radius / 2,
            0.1, 100);
        }
      },
      'blenderController.*:post!': ([entity]) => {
        this.setPosition(entity);
      },
      'transform.setRotation:post!': ([entity]) => {
        this.setPosition(entity);
      }
    };
  }
  setPosition(entity) {
    if (entity.blenderController == null) return;
    if (entity.transform == null) return;
    // Update camera position
    vec3.transformQuat(vecTemp, [0, 0, entity.blenderController.radius],
      entity.transform.rotation);
    vec3.add(vecTemp, vecTemp, entity.blenderController.center);
    this.engine.actions.transform.setPosition(entity, vecTemp);
  }
}


text:
{% set lb = "{" %}
{% set rb = "}" %}
{%- set pathParams = m.parameters|getPathParams -%}
/**
 * {{ m.id }}
 *
 * {% if m.description %}@desc {{ m.description|oneLine|cleanComments|safe }}{% endif %}
 *
 * @alias {{ m.id }}
 * @memberOf! {{ name }}({{ version }})
 *
 * @param  {object{% if !m.parameterOrder && !m.request %}={% endif %}} params - Parameters for request
 {% for pname, p in m.parameters -%}
 * @param  {{ lb }}{{ p.type }}{% if ! p.required %}={% endif %}{{ rb }} params.{{ pname|getSafeParamName }} - {{ p.description|oneLine|cleanComments|safe }}
 {% endfor -%}
{% if m.supportsMediaUpload -%}
{% if m.request -%}
 * @param  {object} params.resource - Media resource metadata
{% endif -%}
 * @param  {object} params.media - Media object
 * @param  {string} params.media.mimeType - Media mime-type
 * @param  {string|object} params.media.body - Media body contents
{% elif m.request -%}
 * @param  {object} params.resource - Request body data
{% endif -%}
 * @param  {callback} callback - The callback that handles the response.
 * @return {object} Request object
 */
{% if globalmethods %}this.{{ mname }} ={% else %}{{ mname }}:{% endif %} function(params, callback) {
  var parameters = {
    options: {
      url: {{ (rootUrl + servicePath + m.path)|buildurl }},
      method: '{{ m.httpMethod }}'
    },
    params: params,
    {%- if m.mediaUpload.protocols.simple.path -%}mediaUrl: {{ [rootUrl, m.mediaUpload.protocols.simple.path]|join('')|buildurl }},{%- endif -%}
    requiredParams: [{%- if m.parameterOrder.length -%}'{{ m.parameterOrder|join("', '")|safe }}'{%- endif -%}],
    pathParams: [{%- if pathParams.length -%}'{{ pathParams|join("', '")|safe }}'{%- endif -%}],
    context: self
  };

  return createAPIRequest(parameters, callback);
}{%- if globalmethods -%};{%- elif not loop.last -%},
{%- endif -%}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>W-Index</title>
<meta name="date" content="2014-04-28">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I L M N O P Q R S T U V W X

W

write(TTE) - Method in class venicehub.IrioPush

write(TTE) - Method in class venicehub.RSBPush

Write data to RSB scope.

writeTo(CodedOutputStream) - Method in class protobuf.SimpleStringProtos.SimpleString

A B C D E F G H I L M N O P Q R S T U V W X

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
<?php

namespace Zimbra\Admin\Struct;

use Zimbra\Struct\Base;

/**
 * PolicyHolder struct class
 *
 * @package    Zimbra
 * @subpackage Admin
 * @category   Struct
 * @author     Nguyen Van Nguyen - nguyennv1981@gmail.com
 * @copyright  Copyright © 2013 by Nguyen Van Nguyen.
 */
class PolicyHolder extends Base
{
    /**
     * Constructor method for PolicyHolder
     * @param  Policy $policy
     * @return self
     */
    public function __construct(Policy $policy = null)
    {
        parent::__construct();
        if($policy instanceof Policy)
        {
            $this->setChild('policy', $policy);
        }
    }

    /**
     * Gets the policy.
     *
     * @return Policy
     */
    public function getPolicy()
    {
        return $this->getChild('policy');
    }

    /**
     * Sets the policy.
     *
     * @param  Policy $policy
     * @return self
     */
    public function setPolicy(Policy $policy)
    {
        return $this->setChild('policy', $policy);
    }

    /**
     * Returns the array representation of this class
     *
     * @param  string $name
     * @return array
     */
    public function toArray($name = 'holder')
    {
        return parent::toArray($name);
    }

    /**
     * Method returning the xml representation of this class
     *
     * @param  string $name
     * @return SimpleXML
     */
    public function toXml($name = 'holder')
    {
        return parent::toXml($name);
    }
}


text:
<?php

class Agileo_Form_Twitter_Element_Image extends Zend_Form_Element_Xhtml
{
    public $helper = 'eImage';

    public static $defOptions = array(
        'chooser' => false,
        'crop' => false
    );

    public function __construct($spec, $options = null)
    {

        $options = array_merge(self::$defOptions, (array) $options);

        parent::__construct($spec, $options);

    }

}


text:
using GM.Application.AppCore.Entities.Meetings;
using GM.Application.Configuration;
using GM.Application.EditTranscript;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System.Collections.Generic;

#pragma warning disable CS0219

namespace GM.WorkflowApp
{
    /* The final meeting transctipt is ready for viewing, when either:
     *  1.  An original transcript has been processed and tagged.
     *  OR
     *  2. An original recording has been transcribed and edited.
     */

    public class WF6_View
    {
        readonly ILogger<WF6_View> logger;
        readonly AppSettings config;
        ////readonly IDBOperations dBOperations;
        readonly WorkSegments workSegments = new WorkSegments();

        public WF6_View(
            ILogger<WF6_View> _logger,
            IOptions<AppSettings> _config
            ////IDBOperations _dBOperations
           )
        {
            logger = _logger;
            config = _config.Value;
            ////dBOperations = _dBOperations;
        }

        public void Run()
        {
            // Do we need manager approval?
            bool? approved = true;
            if (!config.RequireManagerApproval) approved = null;
            List<Meeting> meetings;

            // Find all tagged transcripts or edited transcriptions

            ////meetings = dBOperations.FindMeetings(SourceType.Transcript, WorkStatus.Tagged, approved);
            meetings = new List<Meeting>();   // TODO - CA
            foreach (Meeting meeting in meetings)
            {
                ViewTaggedTranscript(meeting);
            }

            ////meetings = dBOperations.FindMeetings(SourceType.Recording, WorkStatus.Edited, approved);
            foreach (Meeting meeting in meetings)
            {
                ViewEditedTranscription(meeting);
            }
        }

        private void ViewTaggedTranscript(Meeting meeting)
        {

        }

        private void ViewEditedTranscription(Meeting meeting)
        {

        }

    }
}


text:
.openUpLeftReturn {
  animation-name: openUpLeftReturn;
}
@keyframes openUpLeftReturn {
  0% {
    transform-origin: top left;
    transform: rotate(110deg);
    animation-timing-function: ease-in-out;
  }

  100% {
    transform-origin: top left;
    transform: rotate(0deg);
    animation-timing-function: ease-out;
  }
}


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.NetApp.Models
{
    internal partial class VaultList
    {
        internal static VaultList DeserializeVaultList(JsonElement element)
        {
            Optional<IReadOnlyList<NetAppVault>> value = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<NetAppVault> array = new List<NetAppVault>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(NetAppVault.DeserializeNetAppVault(item));
                    }
                    value = array;
                    continue;
                }
            }
            return new VaultList(Optional.ToList(value));
        }
    }
}


text:
// =========================================================================== //
//                                                                             //
// Copyright 2011 Anton Dubrau and McGill University.                          //
//                                                                             //
//   Licensed under the Apache License, Version 2.0 (the "License");           //
//   you may not use this file except in compliance with the License.          //
//   You may obtain a copy of the License at                                   //
//                                                                             //
//       http://www.apache.org/licenses/LICENSE-2.0                            //
//                                                                             //
//   Unless required by applicable law or agreed to in writing, software       //
//   distributed under the License is distributed on an "AS IS" BASIS,         //
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  //
//   See the License for the specific language governing permissions and       //
//  limitations under the License.                                             //
//                                                                             //
// =========================================================================== //

package natlab.tame.valueanalysis.components.constant;

import java.util.ArrayList;
import java.util.List;

import natlab.tame.classes.reference.PrimitiveClassReference;

/**
 * currently a scalar logical constant only.
 *
 * @author adubra
 */
public class LogicalConstant extends Constant {
    private boolean value;

    public LogicalConstant(boolean value) {
        this.value = value;
    }

    @Override
    public PrimitiveClassReference getMatlabClass() {
        return PrimitiveClassReference.LOGICAL;
    }

    @Override
    public Boolean getValue() {
        return value;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (!(obj instanceof LogicalConstant)) return false;
        return ((LogicalConstant)obj).value == value;
    }

    @Override
    public boolean isScalar() {
        return true;
    }

    @Override
    public List<Integer> getShape() {
    	ArrayList<Integer> list = new ArrayList<Integer>(2);
    	list.add(1);
    	list.add(1);
    	return list;
    }

	@Override
	public String getisComplexInfo() {
		return "REAL";
	}
}


text:
(function() {
  'use strict';

  angular.module('ui.tree')

    .controller('TreeNodeController', ['$scope', '$element', '$attrs', 'treeConfig', '$uiTreeHelper', '$firebase',
      function ($scope, $element, $attrs, treeConfig, $uiTreeHelper, $firebase) {
        this.scope = $scope;

        $scope.$element = $element; // xgao: no use.
        $scope.$nodeElement = $element; // xgao: no use.
        $scope.$modelValue = undefined; // Model value for node;
        $scope.$parentNodeScope = undefined; // uiTreeNode Scope of parent node;
        $scope.$childNodesScope = undefined; // uiTreeNodes Scope of child nodes.
        $scope.$parentNodesScope = undefined; // uiTreeNodes Scope of parent nodes.
        $scope.$treeScope = undefined; // uiTree scope
        $scope.$handleScope = undefined; // it's handle scope
        $scope.$type = 'uiTreeNode';
        $scope.$$apply = false; // xgao: represent if it in a $apply function
        $scope.$dragInfo = undefined; // xgao: store info needed by drag. refer to helper.js dragInfo()

        //$scope.node.collapsed = false;
        $scope.expandOnHover = false;

        //$scope.node.selected = false;

        $scope.init = function(controllersArr) {
          $scope.$treeNodesCtrl = controllersArr[0];
          var treeNodesCtrl = controllersArr[0];
          $scope.$treeScope = controllersArr[1] ? controllersArr[1].scope : undefined;

          // find the scope of it's parent node
          $scope.$parentNodeScope = treeNodesCtrl.scope.$nodeScope;
          // modelValue for current node
          $scope.$modelValue = treeNodesCtrl.scope.$modelValue[$scope.$index];
          $scope.$parentNodesScope = treeNodesCtrl.scope;
          treeNodesCtrl.scope.initSubNode($scope); // init sub nodes

          //console.log($scope.node_key)

          var node_base_url = $scope.base_url + "/nodes";

          //You should put an empty node here. The binding will cause error without an empty child array.
           $scope.node = {
             content : "",
             collapsed : true,
          //   selected : false,
          //   children:[]
          };

          // console.log("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
          // console.log($scope.node_stub.key)
          // console.log($scope)

          $scope.children = $scope.node_stub.children;

          var node_url = node_base_url + "/" + $scope.node_stub.key;
          // if (!$scope.node_stub.children) {
          //   $scope.node_stub.children = [];
          //   $scope.$parentNodesScope.initSubNode($scope); // init sub nodes
          // };
          //$scope.children = $scope.node_stub.children;
          // console.log("dsdfsdfsdfdsfsdfsd: "+ node_url);
          // console.log($scope.node_stub);
          var node = $firebase(new Firebase(node_url)).$asObject();
          node.$loaded().then(function() {
            if (undefined === node.icon) node.icon = 0;
            if (undefined === node.fold) node.fold = false;
            if (undefined === node.content) node.content = "";
            if (undefined === node.children) node.children = [];
            node.$bindTo($scope, "node").then(function() {
              $scope.$watch(function() {
                  return $scope.node.collapsed
                },
                function(newVal, oldVal) {
                  if (!newVal) {
                    $scope.$broadcast('elastic:adjust');
                  }
                });
            });

          });

          $element.on('$destroy', function() {
            treeNodesCtrl.scope.destroySubNode($scope); // destroy sub nodes
          });
        };

        $scope.toggleSelected = function() {
          if ($scope.selected) {
            $scope.unselect();
          } else {
            $scope.select();
          }
        };

        $scope.select = function() {
          if (!$scope.selected) {
            $scope.selectNode();
            // console.log("select")
            // console.log($scope.node)
            //$scope.$treeScope.$selectedNodeScope.push($scope);
          }
        };

        $scope.unselect = function() {
          // console.log("unselect")
          // console.log($scope.$parentNodeScope.selected)
          // console.log($scope.selected)
          if (!$scope.$parentNodeScope || !$scope.$parentNodeScope.selected && $scope.selected) {
            $scope.unselectNode();
            var indexOf = $scope.$treeScope.$selectedNodeScope.indexOf($scope);
            if (angular.isDefined(indexOf) && indexOf > -1) {
              $scope.$treeScope.$selectedNodeScope.splice(indexOf, 1);
            }
          }
        };

        $scope.selectNode = function() {
          if (!$scope.selected) {
            //$scope.$childNodesScope.selected = true;
            $scope.selected = true;
            $scope.selectSubNode(true);
            //$scope.node.$parentNodesScope = $scope.$parentNodesScope;
          }
        };

        $scope.unselectNode = function() {
          // console.log("unselectNode")
          // console.log($scope.$parentNodeScope.selected)
          // console.log($scope.selected)
          if (!$scope.$parentNodeScope || !$scope.$parentNodeScope.selected && $scope.selected) {
            //$scope.$childNodesScope.selected = false;
            $scope.selected = false;
            $scope.selectSubNode(false);
            //$scope.node.$parentNodesScope = undefined;
          }
        };

        $scope.selectSubNode = function(select) {
          var childNodes = $scope.childNodes();
          for (var i = childNodes.length - 1; i >= 0; i--) {
            if (select) {
              childNodes[i].selectNode();
            } else {
              childNodes[i].unselectNode();
            }
            childNodes[i].selectSubNode(select);
          };
        }

        // $scope.newSubItem = function(scope) {
        //   // console.log($scope)
        //   if ($scope.node.collapsed) $scope.node.collapsed = false;
        //   var positionArray = $scope.$treeScope.getPositionArray($scope, $scope.$treeScope);
        //   positionArray.push(0)
        //   console.log(positionArray)
        //   var nodeData = {
        //     positionArray : positionArray,
        //     key : $uiTreeHelper.getUniqueId(),
        //     content : "",
        //     collapsed : false,
        //     icon : 0,
        //     children : []
        //   }
        //   $scope.$treeScope.insertNodeAt(nodeData, positionArray, $scope.$treeScope);
        //   $scope.$treeScope.record([nodeData], "insert");
        //   return nodeData;
        //   // //console.log(JSON.stringify($scope.tree))
        //   // // if (!$scope.$childNodesScope.$modelValue) {
        //   // //   $scope.$childNodesScope.$modelValue = [];
        //   // //   $scope.$parentNodesScope.initSubNode($scope); // init sub nodes
        //   // // }
        //   // //console.log("newSubItem: " + JSON.stringify($scope.$childNodesScope.$modelValue, null, 2))
        //   // setTimeout(function(){
        //   //   $scope.addNewItem($scope.$childNodesScope, 0, {
        //   //     content : "",
        //   //     collapsed : false,
        //   //   });
        //   // }, 0);
        // };

        // $scope.newSiblingNode = function(next) {
        //   // var index = $scope.index();
        //   // var position = -1;
        //   // if (next) {
        //   //   position = index+1;
        //   // } else {
        //   //   position = index;
        //   // }
        //   // console.log($scope);
        //   // $scope.addNewItem($scope.$parentNodesScope, position, {
        //   //   content : "",
        //   //   collapsed : false,
        //   // });
        //   var positionArray = $scope.$treeScope.getPositionArray($scope, $scope.$treeScope);
        //   if (next)
        //     positionArray[positionArray.length-1]++;

        //   var nodeData = {
        //     positionArray : positionArray,
        //     key : $uiTreeHelper.getUniqueId(),
        //     content : "",
        //     collapsed : false,
        //     icon : 0,
        //     children : []
        //   }
        //   $scope.$treeScope.insertNodeAt(nodeData, positionArray, $scope.$treeScope);
        //   $scope.$treeScope.record([nodeData], "insert");
        //   return nodeData;
        // };

        // $scope.onKeyDown = function(scope, $event) {
        //   $event.returnValue = false;
        //   if ($event.shiftKey && 13 == $event.keyCode) {
        //     $scope.$treeScope.clearNodeState();
        //     var nodeData = scope.newSubItem(scope);
        //     setTimeout(function(){
        //       $scope.$treeScope.focusNodeAt(nodeData.positionArray);
        //     }, 0);

        //     // setTimeout(function(){
        //     //   $scope.focusNode($scope.$childNodesScope, node.$$hashKey);
        //     // }, 0);

        //     $event.cancelBubble = true;
        //   } else if (13 == $event.keyCode) {
        //     //console.log($event)
        //     var direction = null;
        //     if ($event.ctrlKey) {
        //       direction = true;
        //     } else if ($event.altKey) {
        //       direction = false;
        //     }
        //     if (null != direction) {
        //       $scope.$treeScope.clearNodeState();
        //       var nodeData = $scope.newSiblingNode(direction);
        //       setTimeout(function(){
        //         $scope.$treeScope.focusNodeAt(nodeData.positionArray);
        //       }, 0);
        //       // var node = $scope.newSiblingNode(direction);
        //       // setTimeout(function(){
        //       //   $scope.focusNode($scope.$parentNodesScope, node.$$hashKey);
        //       // }, 0);

        //       $event.cancelBubble = true;
        //     }
        //   } else if ($event.ctrlKey && $event.shiftKey && 86 == $event.keyCode) {
        //     $scope.$treeScope.clearNodeState();
        //     var positionArray = $scope.$treeScope.getPositionArray($scope, $scope.$treeScope);
        //     positionArray[positionArray.length-1]++;
        //     $scope.$treeScope.paste(positionArray);
        //     $event.cancelBubble = true;
        //   } else {
        //     $event.returnValue = true;
        //   }
        // };

        $scope.onClick = function(scope, $event) {
          //console.log($event);
          if ($event.ctrlKey) {
            scope.toggleSelected();
            $event.returnValue = false;
          }
        };

        $scope.index = function() {
          var nodesScope = !!$scope.$parentNodesScope?$scope.$parentNodesScope:$scope.$treeScope.$childNodesScope;
          return nodesScope.$modelValue.indexOf($scope.$modelValue);
        };

        $scope.dragEnabled = function() {
          return !($scope.$treeScope && !$scope.$treeScope.dragEnabled);
        };

        $scope.isSibling = function(targetNode) {
          return $scope.$parentNodesScope === targetNode.$parentNodesScope;
        };

        $scope.isChild = function(targetNode) {
          var nodes = $scope.childNodes();
          return nodes && nodes.indexOf(targetNode) > -1;
        };

        $scope.prev = function() {
          var index = $scope.index();
          if (index > 0) {
            return $scope.siblings()[index - 1];
          }

          return undefined;
        };

        $scope.siblings = function() {
          return $scope.$parentNodesScope.childNodes();
        };

        $scope.childNodesCount = function() {
          return (angular.isDefined($scope.childNodes())) ? $scope.childNodes().length : 0;
        };

        $scope.hasChild = function() {
          return $scope.childNodesCount() > 0;
        };

        $scope.childNodes = function() {
          return (angular.isDefined($scope.$childNodesScope) && angular.isDefined($scope.$childNodesScope.$modelValue)) ?
                 $scope.$childNodesScope.childNodes() : undefined;
        };

        $scope.accept = function(sourceNode, destIndex) {
          return angular.isDefined($scope.$childNodesScope) &&
                  angular.isDefined($scope.$childNodesScope.$modelValue) &&
                  $scope.$childNodesScope.accept(sourceNode, destIndex);
        };

        $scope.isLastNode = function() {
          if ($scope.tree.children.length ==1 && $scope.node_stub.key == $scope.tree.children[0].key) {
            $scope.deleteTreeContent($scope.tree.children[0])
            $scope.tree.children[0].children = [];
            $scope.syncNodesToRemote($scope.$childNodesScope);
            return true;
          } else
            return false;
        }

        $scope.remove = function() {
          // if ($scope.isLastNode()) return;
          //$scope.deleteNodeList([$scope]);
          var positionArray = $scope.$treeScope.getPositionArray($scope, $scope.$treeScope);
          var nodeData = $scope.$treeScope.removeNodeAt(positionArray, $scope.$treeScope);
          $scope.$treeScope.record([nodeData], "remove");

        };

        $scope.toggle = function() {
          $scope.node.collapsed = !$scope.node.collapsed;
        };

        $scope.collapse = function(all) {
          $scope.node.collapsed = $scope.$treeScope.$callbacks.collapse($scope, all);
        };

        $scope.expand = function(all) {
          $scope.node.collapsed = !$scope.$treeScope.$callbacks.expand($scope, all);
        };

        $scope.depth = function() {
          var parentNode = $scope.$parentNodeScope;
          if (parentNode) {
            return parentNode.depth() + 1;
          }

          return 1;
        };

        var subDepth = 0;
        var countSubDepth = function(scope) {
          var count = 0;
          var nodes = scope.childNodes();
          for (var i = 0; i < nodes.length; i++) {
            var childNodes = nodes[i].$childNodesScope;
            if (childNodes) {
              count = 1;
              countSubDepth(childNodes);
            }
          }
          subDepth += count;
        };

        $scope.maxSubDepth = function() {
          subDepth = 0;
          if ($scope.$childNodesScope) {
            countSubDepth($scope.$childNodesScope);
          }

          return subDepth;
        };
      }
    ]);
})();


text:
namespace Xilium.CefGlue
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    using Xilium.CefGlue.Interop;

    // Role: HANDLER
    public abstract unsafe partial class CefRenderHandler
    {
        private static Dictionary<IntPtr, CefRenderHandler> _roots = new Dictionary<IntPtr, CefRenderHandler>();

        private int _refct;
        private cef_render_handler_t* _self;

        protected object SyncRoot { get { return this; } }

        private cef_render_handler_t.add_ref_delegate _ds0;
        private cef_render_handler_t.release_delegate _ds1;
        private cef_render_handler_t.has_one_ref_delegate _ds2;
        private cef_render_handler_t.get_root_screen_rect_delegate _ds3;
        private cef_render_handler_t.get_view_rect_delegate _ds4;
        private cef_render_handler_t.get_screen_point_delegate _ds5;
        private cef_render_handler_t.get_screen_info_delegate _ds6;
        private cef_render_handler_t.on_popup_show_delegate _ds7;
        private cef_render_handler_t.on_popup_size_delegate _ds8;
        private cef_render_handler_t.on_paint_delegate _ds9;
        private cef_render_handler_t.on_cursor_change_delegate _dsa;
        private cef_render_handler_t.start_dragging_delegate _dsb;
        private cef_render_handler_t.update_drag_cursor_delegate _dsc;
        private cef_render_handler_t.on_scroll_offset_changed_delegate _dsd;

        protected CefRenderHandler()
        {
            _self = cef_render_handler_t.Alloc();

            _ds0 = new cef_render_handler_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_render_handler_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_render_handler_t.has_one_ref_delegate(has_one_ref);
            _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3 = new cef_render_handler_t.get_root_screen_rect_delegate(get_root_screen_rect);
            _self->_get_root_screen_rect = Marshal.GetFunctionPointerForDelegate(_ds3);
            _ds4 = new cef_render_handler_t.get_view_rect_delegate(get_view_rect);
            _self->_get_view_rect = Marshal.GetFunctionPointerForDelegate(_ds4);
            _ds5 = new cef_render_handler_t.get_screen_point_delegate(get_screen_point);
            _self->_get_screen_point = Marshal.GetFunctionPointerForDelegate(_ds5);
            _ds6 = new cef_render_handler_t.get_screen_info_delegate(get_screen_info);
            _self->_get_screen_info = Marshal.GetFunctionPointerForDelegate(_ds6);
            _ds7 = new cef_render_handler_t.on_popup_show_delegate(on_popup_show);
            _self->_on_popup_show = Marshal.GetFunctionPointerForDelegate(_ds7);
            _ds8 = new cef_render_handler_t.on_popup_size_delegate(on_popup_size);
            _self->_on_popup_size = Marshal.GetFunctionPointerForDelegate(_ds8);
            _ds9 = new cef_render_handler_t.on_paint_delegate(on_paint);
            _self->_on_paint = Marshal.GetFunctionPointerForDelegate(_ds9);
            _dsa = new cef_render_handler_t.on_cursor_change_delegate(on_cursor_change);
            _self->_on_cursor_change = Marshal.GetFunctionPointerForDelegate(_dsa);
            _dsb = new cef_render_handler_t.start_dragging_delegate(start_dragging);
            _self->_start_dragging = Marshal.GetFunctionPointerForDelegate(_dsb);
            _dsc = new cef_render_handler_t.update_drag_cursor_delegate(update_drag_cursor);
            _self->_update_drag_cursor = Marshal.GetFunctionPointerForDelegate(_dsc);
            _dsd = new cef_render_handler_t.on_scroll_offset_changed_delegate(on_scroll_offset_changed);
            _self->_on_scroll_offset_changed = Marshal.GetFunctionPointerForDelegate(_dsd);
        }

        ~CefRenderHandler()
        {
            Dispose(false);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (_self != null)
            {
                cef_render_handler_t.Free(_self);
                _self = null;
            }
        }

        private void add_ref(cef_render_handler_t* self)
        {
            lock (SyncRoot)
            {
                var result = ++_refct;
                if (result == 1)
                {
                    lock (_roots) { _roots.Add((IntPtr)_self, this); }
                }
            }
        }

        private int release(cef_render_handler_t* self)
        {
            lock (SyncRoot)
            {
                var result = --_refct;
                if (result == 0)
                {
                    lock (_roots) { _roots.Remove((IntPtr)_self); }
                    return 1;
                }
                return 0;
            }
        }

        private int has_one_ref(cef_render_handler_t* self)
        {
            lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
        }

        internal cef_render_handler_t* ToNative()
        {
            add_ref(_self);
            return _self;
        }

        [Conditional("DEBUG")]
        private void CheckSelf(cef_render_handler_t* self)
        {
            if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
        }

    }
}


text:
                {{ vm.media.shop.username }}

            

                {{ vm.media.created_time | date: 'medium' }}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.github.zikani03.acescrape</groupId>
    <artifactId>ace-scrape</artifactId>
    <packaging>jar</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>Ace Scrape API</name>
	<description>Scraping data from the Ace website for learning</description>

    <properties>
        <sparkjava.version>2.1</sparkjava.version>
        <jsoup.version>1.8.1</jsoup.version>
        <gson.version>2.3.1</gson.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
		    <groupId>com.sparkjava</groupId>
			<artifactId>spark-core</artifactId>
            <version>${sparkjava.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.argparse4j</groupId>
            <artifactId>argparse4j</artifactId>
            <version>0.4.4</version>
        </dependency>
		<dependency>
			<!-- jsoup HTML parser library @ http://jsoup.org/ -->
			<groupId>org.jsoup</groupId>
			<artifactId>jsoup</artifactId>
		    <version>${jsoup.version}</version>
		</dependency>
		<dependency>
			<groupId>com.sparkjava</groupId>
			<artifactId>spark-template-velocity</artifactId>
			<version>2.0.0</version>
		</dependency>
    </dependencies>

    <build>

        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/java</directory>
                <includes>
                    <include>**</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <optimize>true</optimize>
                    <debug>true</debug>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <executable>${env.JAVA_HOME_8}/bin/javac</executable>
                    <fork>true</fork>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.14</version>
                <configuration>
                    <forkCount>1</forkCount>
                    <reuseForks>false</reuseForks>
                </configuration>
            </plugin>
             <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>java</executable>
                    <arguments>
                        <argument>-classpath</argument>
                        <classpath/>
                        <argument>io.github.zikani03.acescrape.Application</argument>
                    </arguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                </configuration>
            </plugin>
            <plugin>
            	<groupId>org.apache.maven.plugins</groupId>
            	<artifactId>maven-resources-plugin</artifactId>
            	<version>2.6</version>
            </plugin>
            <plugin>
            	<groupId>org.apache.maven.plugins</groupId>
            	<artifactId>maven-jar-plugin</artifactId>
            	<version>2.4</version>
            </plugin>
        </plugins>
    </build>
</project>


text:
CREATE TABLE [log4Private].[SqlException] (
    [ExceptionId]       INT            IDENTITY (1, 1) NOT NULL,
    [UtcDate]           DATETIME       CONSTRAINT [DF_SqlException_UtcDate] DEFAULT (getutcdate()) NOT NULL,
    [SystemDate]        DATETIME       CONSTRAINT [DF_SqlException_SystemDate] DEFAULT (getdate()) NOT NULL,
    [ErrorContext]      NVARCHAR (512) NOT NULL,
    [ErrorNumber]       INT            NOT NULL,
    [ErrorSeverity]     INT            NOT NULL,
    [ErrorState]        INT            NOT NULL,
    [ErrorProcedure]    NVARCHAR (128) NOT NULL,
    [ErrorLine]         INT            NOT NULL,
    [ErrorMessage]      NVARCHAR (MAX) NOT NULL,
    [ErrorDatabase]     NVARCHAR (128) NOT NULL,
    [SessionId]         INT            NOT NULL,
    [ServerName]        NVARCHAR (128) NOT NULL,
    [HostName]          NVARCHAR (128) NOT NULL,
    [ProgramName]       NVARCHAR (128) NOT NULL,
    [NTDomain]          NVARCHAR (128) NOT NULL,
    [NTUsername]        NVARCHAR (128) NOT NULL,
    [LoginName]         NVARCHAR (128) NOT NULL,
    [OriginalLoginName] NVARCHAR (128) NOT NULL,
    [SessionLoginTime]  DATETIME       NULL,
    CONSTRAINT [PK_SqlException] PRIMARY KEY CLUSTERED ([ExceptionId] ASC)
);


text:
from django.contrib import admin
from .models import Prompt, Statement, Persona

admin.site.register(Prompt)
admin.site.register(Statement)
admin.site.register(Persona)


text:
from google.cloud.gsuiteaddons import gapic_version as package_version

__version__ = package_version.__version__

from .services.g_suite_add_ons import GSuiteAddOnsAsyncClient, GSuiteAddOnsClient
from .types.gsuiteaddons import (
    AddOns,
    Authorization,
    CreateDeploymentRequest,
    DeleteDeploymentRequest,
    Deployment,
    GetAuthorizationRequest,
    GetDeploymentRequest,
    GetInstallStatusRequest,
    InstallDeploymentRequest,
    InstallStatus,
    ListDeploymentsRequest,
    ListDeploymentsResponse,
    ReplaceDeploymentRequest,
    UninstallDeploymentRequest,
)

__all__ = (
    "GSuiteAddOnsAsyncClient",
    "AddOns",
    "Authorization",
    "CreateDeploymentRequest",
    "DeleteDeploymentRequest",
    "Deployment",
    "GSuiteAddOnsClient",
    "GetAuthorizationRequest",
    "GetDeploymentRequest",
    "GetInstallStatusRequest",
    "InstallDeploymentRequest",
    "InstallStatus",
    "ListDeploymentsRequest",
    "ListDeploymentsResponse",
    "ReplaceDeploymentRequest",
    "UninstallDeploymentRequest",
)


text:
import java.io.IOException;

/**
 * Created by od on 16.02.2017.
 */
public class Main {

    public static void main (String[] args) {
        try {
            Thread t = new Server();
            t.start();
        } catch(IOException e) {
            e.printStackTrace();
        }
    }

}


text:
package com.naijab.nextzytimeline.ui.people.addform;

import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;

import com.naijab.nextzytimeline.R;
import com.naijab.nextzytimeline.base.BaseActivity;
import com.naijab.nextzytimeline.ui.people.addform.fragment.AddPeopleFragment;

public class AddPeopleActivity extends BaseActivity {

    private Toolbar toolbar;

    @Override
    public int getLayoutView() {
        return R.layout.activity_add;
    }

    @Override
    public void bindView() {
        toolbar = (Toolbar) findViewById(R.id.toolbar);
    }

    @Override
    public void setupInstance() {}

    @Override
    public void setupView() {
        setupToolbar();
    }

    private void setupToolbar() {
        setSupportActionBar(toolbar);
        ActionBar actionbar = getSupportActionBar();
        if (actionbar != null) {
            actionbar.setDisplayHomeAsUpEnabled(true);
            actionbar.setDisplayShowHomeEnabled(true);
            actionbar.setDisplayShowTitleEnabled(false);
        }
    }

    @Override
    public void initialize() {
        setupFragment();
    }

    private void setupFragment() {
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.container, AddPeopleFragment.newInstance())
                .commit();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.menu_add_people, menu);
        return true;
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
    }

}


text:
. ./build.properties

# -----------------------------------------------------------------------------

# fix for jenkins inserting the windows-style path in $WORKSPACE
cd "$WORKSPACE"
export WORKSPACE=`pwd`

# ----- Utility functions -----------------------------------------------------

function winpath() {
  # Convert gitbash style path '/c/Users/Big John/Development' to 'c:\Users\Big John\Development',
  # via dumb substitution. Handles drive letters; incurs process creation penalty for sed.
  if [ -e /etc/bash.bashrc ] ; then
    # Cygwin specific settings
    echo "`cygpath -w $1`"
  else
    # Msysgit specific settings
    echo "$1" | sed -e 's|^/\(\w\)/|\1:\\|g;s|/|\\|g'
  fi
}

function bashpath() {
  # Convert windows style path 'c:\Users\Big John\Development' to '/c/Users/Big John/Development'
  # via dumb substitution. Handles drive letters; incurs process creation penalty for sed.
  if [ -e /etc/bash.bashrc ] ; then
    # Cygwin specific settings
    echo "`cygpath $1`"
  else
    # Msysgit specific settings
    echo "$1" | sed -e 's|\(\w\):|/\1|g;s|\\|/|g'
  fi
}

function parentwith() {  # used to find $WORKSPACE, below.
  # Starting at the current dir and progressing up the ancestors,
  # retuns the first dir containing $1. If not found returns pwd.
  SEARCHTERM="$1"
  DIR=`pwd`
  while [ ! -e "$DIR/$SEARCHTERM" ]; do
    NEWDIR=`dirname "$DIR"`
    if [ "$NEWDIR" = "$DIR" ]; then
      pwd
      return
    fi
    DIR="$NEWDIR"
  done
  echo "$DIR"
  }

# If we aren't running under jenkins. some variables will be unset.
# So set them to a reasonable value

if [ -z "$WORKSPACE" ]; then
  export WORKSPACE=`parentwith .git`;
fi

#TOOLSDIRS=". $WORKSPACE/GetBuildTools $WORKSPACE/v1_build_tools $WORKSPACE/../v1_build_tools $WORKSPACE/nuget_tools"
TOOLSDIRS="."
for D in $TOOLSDIRS; do
  if [ -d "$D/bin" ]; then
    export BUILDTOOLS_PATH="$D/bin"
  fi
done
if [ ! $(which $BUILDTOOLS_PATH/NuGet.exe) ] && [ $(which $WORKSPACE/.nuget/NuGet.exe) ]; then
  export BUILDTOOLS_PATH="$WORKSPACE/.nuget"
fi
echo "Using $BUILDTOOLS_PATH for NuGet"

if [ -z "$DOTNET_PATH" ]; then
  for D in `bashpath "$SYSTEMROOT\\Microsoft.NET\\Framework\\*"`; do
    if [ -d $D ]; then
      export DOTNET_PATH="$D"
    fi
  done
fi
echo "Using $DOTNET_PATH for .NET"

export PATH="$PATH:$BUILDTOOLS_PATH:$DOTNET_PATH"

if [ -z "$SIGNING_KEY_DIR" ]; then
  export SIGNING_KEY_DIR=`pwd`;
fi

export SIGNING_KEY="$SIGNING_KEY_DIR/VersionOne.snk"

if [ -f "$SIGNING_KEY" ]; then
  export SIGN_ASSEMBLY="true"
else
  export SIGN_ASSEMBLY="false"
  echo "Please place VersionOne.snk in `pwd` or $SIGNING_KEY_DIR to enable signing.";
fi

if [ -z "$VERSION_NUMBER" ]; then
  export VERSION_NUMBER="0.0.0"
fi

if [ -z "$BUILD_NUMBER" ]; then
  # presume local workstation, use date-based build number
  export BUILD_NUMBER=`date +%H%M`  # hour + minute
fi

function update_nuget_deps() {
  PKGSDIRW=`winpath "$WORKSPACE/packages"`
  for D in $WORKSPACE/*; do
    if [ -d $D ] && [ -f $D/packages.config ]; then
      PKGSCONFIGW=`winpath "$D/packages.config"`
      NuGet.exe install $PKGSCONFIGW -o $PKGSDIRW -Source $NUGET_FETCH_URL
    fi
  done
  NuGet.exe update $SOLUTION_FILE -Verbose -Source $NUGET_FETCH_URL
}

# ---- Produce .NET Metadata --------------------------------------------------

COMPONENTS="VersionOne.RequestHelper VersionOne.RequestHelper.Test"
for COMPONENT_NAME in $COMPONENTS; do
cat > "$WORKSPACE/$COMPONENT_NAME/Properties/AssemblyInfo.cs" <<EOF
// Auto generated by build.sh at `date -u`

using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("$VERSION_NUMBER.0")]
[assembly: AssemblyFileVersion("$VERSION_NUMBER.$BUILD_NUMBER")]
[assembly: AssemblyInformationalVersion("See $GITHUB_WEB_URL/wiki")]

[assembly: AssemblyProduct("$COMPONENT_NAME")]
[assembly: AssemblyTitle("$COMPONENT_NAME")]
[assembly: AssemblyDescription("$PRODUCT_NAME $Configuration Build")]
[assembly: AssemblyCompany("$ORGANIZATION_NAME")]
[assembly: AssemblyCopyright("Copyright $COPYRIGHT_RANGE, $ORGANIZATION_NAME, Licensed under modified BSD.")]

[assembly: AssemblyConfiguration("$Configuration")]
EOF
done

# ---- Clean solution ---------------------------------------------------------

# MSBuild.exe $SOLUTION_FILE /m /t:Clean

# ---- Update NuGet Packages --------------------------------------------------

update_nuget_deps

# ---- Build solution using msbuild -------------------------------------------

WIN_SIGNING_KEY="`winpath "$SIGNING_KEY"`"
MSBuild.exe $SOLUTION_FILE -p:SignAssembly=$SIGN_ASSEMBLY -p:AssemblyOriginatorKeyFile=$WIN_SIGNING_KEY


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/ivProgress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:contentDescription="@string/app_name"
        android:src="@drawable/loading" />

    <TextView
        android:id="@+id/tvProgress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ivProgress"
        android:layout_centerHorizontal="true"
        android:paddingTop="20dp"
        android:textColor="@color/black" />

</RelativeLayout>


text:
package main

import (
	"log"
	"net/http"

	"github.com/gorilla/handlers"
	"github.com/gorilla/mux"
	mtr_go "github.com/untoreh/mtr-go"
	"github.com/untoreh/mtr-go/tools"
)

func main() {
	log.SetFlags(log.LstdFlags | log.Lshortfile)

	log.Print("loading services...")
	m := mtr_go.New(map[string]interface{}{
		"services": []string{
			"bing",
			"google",
			"yandex",
			"frengly",
			"multillect",
			"promt",
			"systran",

			// "convey",
			// "sdl",
		},
	})
	tools.Cache.Save()

	// Routes consist of a path and a handler function.
	r := mux.NewRouter()
	r.Handle("/", handlers.CompressHandler(&mtr_go.MtrGet{m})).Methods("GET")
	r.Handle("/", handlers.CompressHandler(&mtr_go.MtrPost{m})).Methods("POST")
	r.Handle("/multi", handlers.CompressHandler(&mtr_go.MtrPostMulti{m})).Methods("POST")

	// Bind to a port and pass our router in
	log.Print("starting server...")
	server := &http.Server{
		Addr:    ":8001",
		Handler: r,
	}
	log.Print(server.ListenAndServe())
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Hedwigia 37: 198 (1898)

#### Original name
Calonectria geralensis Rehm

### Remarks
null


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/dialogflow/v2beta1/environment.proto

package com.google.cloud.dialogflow.v2beta1;

public interface EnvironmentHistoryOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2beta1.EnvironmentHistory)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Output only. The name of the environment this history is for.
   * Supported formats:
   * - `projects/<Project Number / ID>/agent/environments/<Environment ID>`
   * - `projects/<Project Number / ID>/locations/<Location
   *    ID>/agent/environments/<Environment ID>`
   *

   *
   * string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The parent.
   */
  java.lang.String getParent();
  /**
   *
   *
   *

   * Output only. The name of the environment this history is for.
   * Supported formats:
   * - `projects/<Project Number / ID>/agent/environments/<Environment ID>`
   * - `projects/<Project Number / ID>/locations/<Location
   *    ID>/agent/environments/<Environment ID>`
   *

   *
   * string parent = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The bytes for parent.
   */
  com.google.protobuf.ByteString getParentBytes();

  /**
   *
   *
   *

   * Output only. The list of agent environments. There will be a maximum number of items
   * returned based on the page_size field in the request.
   *

   *
   *
   * repeated .google.cloud.dialogflow.v2beta1.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  java.util.List<com.google.cloud.dialogflow.v2beta1.EnvironmentHistory.Entry> getEntriesList();
  /**
   *
   *
   *

   * Output only. The list of agent environments. There will be a maximum number of items
   * returned based on the page_size field in the request.
   *

   *
   *
   * repeated .google.cloud.dialogflow.v2beta1.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.cloud.dialogflow.v2beta1.EnvironmentHistory.Entry getEntries(int index);
  /**
   *
   *
   *

   * Output only. The list of agent environments. There will be a maximum number of items
   * returned based on the page_size field in the request.
   *

   *
   *
   * repeated .google.cloud.dialogflow.v2beta1.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  int getEntriesCount();
  /**
   *
   *
   *

   * Output only. The list of agent environments. There will be a maximum number of items
   * returned based on the page_size field in the request.
   *

   *
   *
   * repeated .google.cloud.dialogflow.v2beta1.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  java.util.List<? extends com.google.cloud.dialogflow.v2beta1.EnvironmentHistory.EntryOrBuilder>
      getEntriesOrBuilderList();
  /**
   *
   *
   *

   * Output only. The list of agent environments. There will be a maximum number of items
   * returned based on the page_size field in the request.
   *

   *
   *
   * repeated .google.cloud.dialogflow.v2beta1.EnvironmentHistory.Entry entries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.cloud.dialogflow.v2beta1.EnvironmentHistory.EntryOrBuilder getEntriesOrBuilder(
      int index);

  /**
   *
   *
   *

   * Output only. Token to retrieve the next page of results, or empty if there are no
   * more results in the list.
   *

   *
   * string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The nextPageToken.
   */
  java.lang.String getNextPageToken();
  /**
   *
   *
   *

   * Output only. Token to retrieve the next page of results, or empty if there are no
   * more results in the list.
   *

   *
   * string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The bytes for nextPageToken.
   */
  com.google.protobuf.ByteString getNextPageTokenBytes();
}


text:
package org.geogit.cli.plumbing;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

import jline.console.ConsoleReader;

import org.geogit.api.plumbing.diff.Patch;
import org.geogit.api.plumbing.diff.PatchSerializer;
import org.geogit.api.plumbing.diff.VerifyPatchOp;
import org.geogit.api.plumbing.diff.VerifyPatchResults;
import org.geogit.cli.AbstractCommand;
import org.geogit.cli.GeogitCLI;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.google.common.io.Closeables;

/**
 * Verifies that a patch can be applied
 *
 */
@Parameters(commandNames = "verify-patch", commandDescription = "Verifies that a patch can be applied")
public class VerifyPatch extends AbstractCommand {

    /**
     * The path to the patch file
     */
    @Parameter(description = "<patch>")
    private List<String> patchFiles = new ArrayList<String>();

    @Parameter(names = { "--reverse" }, description = "Check if the patch can be applied in reverse")
    private boolean reverse;

    @Override
    public void runInternal(GeogitCLI cli) throws IOException {
        checkParameter(patchFiles.size() < 2, "Only one single patch file accepted");
        checkParameter(!patchFiles.isEmpty(), "No patch file specified");

        ConsoleReader console = cli.getConsole();

        File patchFile = new File(patchFiles.get(0));
        checkParameter(patchFile.exists(), "Patch file cannot be found");
        FileInputStream stream;
        try {
            stream = new FileInputStream(patchFile);
        } catch (FileNotFoundException e1) {
            throw new IllegalStateException("Can't open patch file " + patchFile);
        }
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
        } catch (UnsupportedEncodingException e) {
            Closeables.closeQuietly(reader);
            Closeables.closeQuietly(stream);
            throw new IllegalStateException("Error reading patch file " + patchFile, e);
        }
        Patch patch = PatchSerializer.read(reader);
        Closeables.closeQuietly(reader);
        Closeables.closeQuietly(stream);

        VerifyPatchResults verify = cli.getGeogit().command(VerifyPatchOp.class).setPatch(patch)
                .setReverse(reverse).call();
        Patch toReject = verify.getToReject();
        Patch toApply = verify.getToApply();
        if (toReject.isEmpty()) {
            console.println("Patch can be applied.");
        } else {
            console.println("Error: Patch cannot be applied\n");
            console.println("Applicable entries:\n");
            console.println(toApply.toString());
            console.println("\nConflicting entries:\n");
            console.println(toReject.toString());
        }

    }

}


text:
angular.module('formApp.ngDocumentFullscreen',[]).directive('ngDocumentFullscreen', function(){
    return {
        restrict: "A",
        link: function(scope, elem, attr, ctrl) {
            elem.bind('click', function(e) {
                this.classList.toggle('fullscreen');
            });
        }
    }
});


text:
import { test } from 'qunit';
import moduleForAcceptance from 'danger-brewing/tests/helpers/module-for-acceptance';
import startFirebaseApp from '../helpers/start-firebase-app';
import destroyFirebaseApp from '../helpers/destroy-firebase-app';
import page from 'danger-brewing/tests/pages/history';

let application;

moduleForAcceptance('Acceptance | history', {
  beforeEach() { },
  afterEach() {
    destroyFirebaseApp(application);
  }
});

const setupData = (fixture = { }) => {
  application = startFirebaseApp(fixture);
};

// this feature is not yet implemented
test('placeholder', function(assert) {
  setupData();
  andThen(function() {
    visit(page.url);
    andThen(function() {
      assert.equal(currentURL(), page.url, 'on the right page');
    });
  });
});


text:
<?php

use yii\db\Migration;

class m160407_161203_add_original_price_to_product extends Migration
{
    public function up()
    {
        $this->addColumn('product', 'originalPrice', $this->decimal(10, 2));
    }

    public function down()
    {
        $this->dropColumn('product', 'originalPrice');
    }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

public partial class error404 {

    /// <summary>
    /// divSearchEngine control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlGenericControl divSearchEngine;

    /// <summary>
    /// divSearchResult control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlGenericControl divSearchResult;

    /// <summary>
    /// divExternalReferrer control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlGenericControl divExternalReferrer;

    /// <summary>
    /// divInternalReferrer control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlGenericControl divInternalReferrer;

    /// <summary>
    /// SearchBox2 control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::App_Code.Controls.SearchBox SearchBox2;

    /// <summary>
    /// divDirectHit control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlGenericControl divDirectHit;

    /// <summary>
    /// phSearchResult control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.PlaceHolder phSearchResult;

    /// <summary>
    /// SearchBox1 control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::App_Code.Controls.SearchBox SearchBox1;
}


text:
(function($) {

  // check the number every 4 seconds
  setInterval(function() {
    $.post('/wp-admin/admin-ajax.php', { action: 'get_downloads', url: 'http://profiles.wordpress.org/zuige/' }, function(data) {

      console.log('downloads: ' + data);

      if(data != $('.downloads').html()) {
        console.log('CHA-CHING!');

        var sfx = new Audio('/wp-content/themes/plugins-theme/assets/CashRegister.mp3');
        sfx.play();

        $('.downloads').html(data);
      }

    });
  }, 2000);

})(jQuery);


text:
namespace Google.Cloud.ResourceSettings.V1.Snippets
{
    // [START resourcesettings_v1_generated_ResourceSettingsService_ListSettings_async_flattened]
    using Google.Api.Gax;
    using Google.Cloud.ResourceSettings.V1;
    using System;
    using System.Linq;
    using System.Threading.Tasks;

    public sealed partial class GeneratedResourceSettingsServiceClientSnippets
    {
        /// <summary>Snippet for ListSettingsAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task ListSettingsAsync()
        {
            // Create client
            ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
            // Initialize request argument(s)
            string parent = "a/wildcard/resource";
            // Make the request
            PagedAsyncEnumerable<ListSettingsResponse, Setting> response = resourceSettingsServiceClient.ListSettingsAsync(parent);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Setting item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListSettingsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Setting item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<Setting> singlePage = await response.ReadPageAsync(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Setting item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
        }
    }
    // [END resourcesettings_v1_generated_ResourceSettingsService_ListSettings_async_flattened]
}


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import SortButton from './SortButton';
import { ASCENDING, DESCENDING } from './constants';

class DefaultHeaderCell extends Component {

    constructor(props){
        super(props);
        this.buttonClicked = this.buttonClicked.bind(this);
    }

    buttonClicked(){
        const { columnName, updateSort, sort } = this.props;
        const newSort = sort === ASCENDING ? DESCENDING : ASCENDING;
        updateSort(columnName, newSort);
    }

    render(){
        const { label, sortable, sort } = this.props;
        return(
            <th>
                {label}
                { sortable && <SortButton onClick={this.buttonClicked} sort={sort} /> }
            </th>
        );
    }

}
if (process.env.NODE_ENV !== 'production'){
    DefaultHeaderCell.propTypes = {
        columnName: PropTypes.string.isRequired,
        sort: PropTypes.oneOf([ASCENDING, DESCENDING]),
        updateSort: PropTypes.func.isRequired,
        sortable: PropTypes.bool,
        label: PropTypes.string
    };
}

export default DefaultHeaderCell;


text:
module.exports = {
    'stream': require('./dist_node/stream'),
    'gen': require('./dist_node/gen'),
    'quantifier': require('./dist_node/quantifier'),
    'select': require('./dist_node/select')
};


text:
//  Copyright 2021 The KeepTry Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package binarysearch;

import java.util.PriorityQueue;

public class Leetcode774MinimizeMaxDistancetoGasStation {
  /*
  You should add k new gas stations. You can add the stations anywhere on the x-axis,
  and not necessarily on an integer position.
  Let penalty() be the maximum distance between adjacent gas stations
  after adding the k new stations.
  Return the smallest possible value of penalty().
  Answers within 10^-6 of the actual answer will be accepted.

    10 <= stations.length <= 2000
    0 <= stations[i] <= 10^8
    stations is sorted in a strictly increasing order.
    1 <= k <= 10^6
  Idea:
    the original bus station location is integer.
    the new bug station location may be real number with a infinite circle decimal

    max heap: O(min{NlogN, KlogN})time and O(N) space. Time Limit Exceeded
   */
  public double minmaxGasDistOriginalIdea(int[] stations, int K) {
    int N = stations.length;
    PriorityQueue<int[]> q =
        new PriorityQueue<>((a, b) -> (double) b[0] / b[1] < (double) a[0] / a[1] ? -1 : 1);
    for (int i = 0; i < N - 1; ++i) q.add(new int[] {stations[i + 1] - stations[i], 1});

    for (int k = 0; k < K; ++k) {
      int[] n = q.poll();
      n[1]++;
      // insert one to share the interval. not to cut the interval into 2 parts.
      // It maybe be > 2 parts if some new station has already been inserted in
      // this interval.
      q.add(n);
    }

    int[] n = q.poll();
    return (double) n[0] / n[1];
  }

  /*
   Idea:
     binary search
     - initial value l = 0 and r = 1e8 is the search space of smallest possible value of max distance of
       any adjacent 2 gas stations. this search space is monotonic and binary search can be applied here
     - try a value in the search space calculated by binary search to see with it(Double)
       how many new bus stations (Integer) can be added in total in a manner with which for any 2 existing
       adjacent gas stations the new gas station(s) are evenly allocated in the interval.
     - what we want to get from the predicate after comparing the possible added new station
       number with K is only the heuristic hint which can let us know we should make the next distance
       value used to try to be smaller or bigger than the current one.
       thus continue trying till step in the a accepted shrink search space and stop there.
       This is binary search character in real number search space.
       So handle the scenario of
         new gas station number n and K:
         n < K  : current value is bigger that target one. try a smaller value
         n > K  : current value is smaller that target one. try a bigger value
         how about  n == K, let l=mid or let r=mid? and why?
             Note: the first distance value used to try is (0+max)/2
             for any interval of 2 adjacent existing gas stations,
             when n == K happen for the first time the last distance value
             is a bigger one that the one which firstly make n == K happen.
             at that time if use l=mid, then with this rule the following distance value
             will be bigger than the current one again as before and at last reach an extreme
             where still can allowing to add n==K but the fraction is nearly 0.
             at the time when n == K happens for the first time, even the value of n
             is expected but the distance value may be not the one which can
             evenly allocate the new gas stations. in this case still need tuning
             it to be smaller in next step without increasing the number of n
             because the required distance is the one who will make smallest possible
             value of penalty(). for this reason use r=mid.
             E.g. stations=[0,1] ,K=1. with the l=mid rule then the distance will eventually
             reach to 0.9999.. still keeping n==1. but not evenly allocated.

    'Answers within 10^-6 of the actual answer will be accepted.'
     means: the search space shrink to where any 2 value's diff is < 10^-6
           then the search can terminate and any answer in that search space is
           acceptable.

      O(NlogW) time. W is the value of the last element value of station.
      O(1) space
  */
  public static double minmaxGasDist(int[] stations, int K) {
    // Check null, k is positive and stations is sorted in a strictly increasing order
    double l = 0, r = stations[stations.length - 1];
    while (r - l > 1e-6) { // when search space is real number.
      double d = (l + r) / 2.0;

      int n = 0; // new gas stations. it is integer
      for (int i = 0; i < stations.length - 1; i++) {
        // n += (int) ((stations[i + 1] - stations[i]) / d);
        n += Math.ceil((stations[i + 1] - stations[i]) / d) - 1; // same with above line when
        // the above value's fraction is not 0.
      }

      if (n < K) r = d;
      else if (n > K) l = d;
      else if (n == K) r = d;
    }
    return l;
  }
}


text:
package com.wt.pinger.events;

/**
 * Created by Kenumir on 2016-12-03.
 *
 */

public class EventNames {

    public static final String ADDRESS_ADDED = "Address Added";
    public static final String REPLAIO_AD_CLICKED = "Replaio Ad Clicked";
    public static final String REPLAIO_TAB_OPENED = "Replaio Tab Opened";

}


text:
package io.searchbox.core;

import io.searchbox.client.JestResult;
import io.searchbox.common.AbstractIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase;
import org.junit.Test;

import java.io.IOException;
import java.util.Map;

/**
 * @author cihat keser
 */
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.SUITE, numDataNodes = 1)
public class SearchShardsIntegrationTest extends AbstractIntegrationTest {
    static final String INDEX = "twitter";
    static final String TYPE = "tweet";

    @Test
    public void testBasicFlow() throws IOException {
        SearchShards searchShards = new SearchShards.Builder()
                .addIndex(INDEX)
                .addType(TYPE)
                .build();
        JestResult result = client.execute(searchShards);
        assertTrue(result.getErrorMessage(), result.isSucceeded());

        Map source = result.getSourceAsObject(Map.class);
        assertTrue(source.containsKey("nodes"));
        assertTrue(source.containsKey("shards"));
    }

}


text:
$(function() {
	$messages = $('#messages');
	$body = $("#msg_body");
	$username = $("#username")
	var socket = new Phoenix.Socket("/ws");

	socket.join("rooms:", {"username": "JJ"},function(chan){
		chan.on("user:entered",function(message){
			$messages.append("
(" +message["username"] +") has joined to" + message["room"]);
		});

		chan.on("new:message",function(msg){
			$messages.append("
(" +msg["username"] +") said: " + msg["msg_body"]);
			var height = $messages[0].scrollHeight - $messages.height();
			$messages[0].scrollTop = height;
		});

		$body.off("keypress").on("keypress",function(e){
			if(e.keyCode == 13){
				chan.send("new:message",{
					username: $username.val(),
					msg_body: $body.val()
				});
				$body.val("");
			}
		})
	});
});


text:
package org.delft.naward07.postProcessing;

import java.util.ArrayList;
import java.util.List;

/**
 * Item indices.
 *
 * @author Feng Wang
 */
public class ItemIndices implements Comparable<ItemIndices> {

    /**
     * Number of the item.
     */
	private int num;

    /**
     * Indices of the item.
     */
	private List<Integer> indices;

	public ItemIndices(){
		num = 0;
		indices = new ArrayList<Integer>();
	}

	public void update(Integer index){
		num ++;
		indices.add(index);
	}

	public int getNum() { return num; }
	public List<Integer> getIndices() { return indices; }

	@Override
	public int compareTo(ItemIndices arg0) {
		// TODO Auto-generated method stub

		return this.getNum() < arg0.getNum() ? 1 : -1;
	}

}


text:
class EditAssessements < ActiveRecord::Migration[5.1]
  def change
    remove_column :assessments, :grade
    remove_column :assessments, :comment
    remove_column :assessments, :student_id
  end
end