text:
\begin{ManPage}{\label{man-condor-findhost}\Condor{findhost}}{1}
{find machine(s) in the pool that
can be used with minimal impact on currently running HTCondor jobs
and best meet any specified constraints}
\index{HTCondor commands!condor\_findhost}
\index{condor\_findhost command}

\Synopsis \SynProg{\Condor{findhost}}
\oOpt{-help}
\oOpt{-m}
\oOptArg{-n}{num}
\oOptArg{-c}{c\_expr}
\oOptArg{-r}{r\_expr}
\oOptArg{-p}{centralmanagerhostname}

\Description

\Condor{findhost} searches an HTCondor pool of machines for the
best machine or machines that
will have the minimum impact on running HTCondor jobs
if the machine or machines are taken out of the pool.
The search may be limited to the machine or machines
that match a set of constraints and rank expression.

\Condor{findhost}
returns a fully-qualified domain name for each machine.
The search is limited (constrained) to a specific set of machines
using the \Arg{-c} option.
The search can use the \Arg{-r} option for rank,
the criterion used for selecting a machine or machines from the
constrained list.

\begin{Options}
    \OptItem{\Opt{-help}}{Display usage information and exit}
    \OptItem{\Opt{-m}}{Only search for entire machines.
        Slots within an entire machine are not considered.}
    \OptItem{\OptArg{-n}{num}}{Find and list up to \Arg{num} machines that
	fulfill the specification. \Arg{num} is an integer greater than zero.}
    \OptItem{\OptArg{-c}{c\_expr}}{Constrain the search to only consider
        machines that result from the evaluation of \Arg{c\_expr}.
        \Arg{c\_expr} is a ClassAd expression.
	}
    \OptItem{\OptArg{-r}{r\_expr}}{\Arg{r\_expr} is the rank expression
        evaluated to use as a basis for machine selection.
        \Arg{r\_expr} is a ClassAd expression.
	}
    \OptItem{\OptArg{-p}{centralmanagerhostname}}{Specify the pool to
        be searched by giving the central manager's host name.
	Without this option, the current pool is searched.}
\end{Options}

\GenRem

% general remarks go here
\Condor{findhost} is used to locate a machine
within a pool that can be taken out of the pool with the least
disturbance of the pool.

An administrator should set preemption requirements for
the HTCondor pool.
The expression
\begin{verbatim}
(Interactive =?= TRUE )
\end{verbatim}
will let \Condor{findhost} know that it can claim a machine even
if HTCondor would not normally preempt a job running on that machine.

\ExitStatus

The exit status of \Condor{findhost} is zero on success.
If not able to identify as many machines as requested,
it returns one more than the number of machines identified.
For example, if 8 machines are requested, and \Condor{findhost}
only locates 6, the exit status will be 7.
If not able to locate any machines, or an error is encountered,
\Condor{findhost} will return the value 1.

\Examples
To find and list four machines, preferring those with the highest
mips (on Drystone benchmark) rating:
\begin{verbatim}
condor_findhost -n 4 -r "mips"
\end{verbatim}
To find and list 24 machines, considering only those
where the \AdAttr{kflops} attribute is not defined:
\begin{verbatim}
condor_findhost -n 24 -c "kflops=?=undefined"
\end{verbatim}

\end{ManPage}

%  Usage: condor_findhost [-m] -[n number] [-c c_expr] [-r r_expr] [-p pool]
%  -m: Return entire machine, not slots
%  -n num: Return num machines, where num is an integer greater than zero
%  -c c_expr: Use c_expr as the constraint expression
%  -r r_expr: Use r_expr as the rank expression
%  -p pool: Contact the HTCondor pool "pool"
%  -h: this screen


text:
import user from '../user/user.module';
import MenuController from './menu-controller';

export default angular.module('banking.menu', ['ionic', user.name])
  .controller('MenuCtrl', MenuController);

redpajama_set_name: RedPajamaGithub


text:
package handlers

import (
	"context"
	"fmt"

	cloudevents "github.com/cloudevents/sdk-go/v2"
)

/*

The following steps should be taken when implementing a new type of probe.

1. Define a static probe handler which implements the Interface interface.
2. Declare a singleton Interface object of this kind in the probe helper initializerHandlers method.
3. Add the mapping between forward probe type and the object from step 2 to the forward map in EventTypeProbe.
4. Add the mapping between receiver probe type and the object from step 2 to the receive map in EventTypeProbe.

*/

// Interface is the interface which static probe objects should implement.
type Interface interface {
	// Forward is the handler function which is called for probe requests which come
	// from PROBE_PORT.
	Forward(context.Context, cloudevents.Event) error
	// Receive is the handler function which is called for probe requests which come
	// from RECEIVER_PORT.
	Receive(context.Context, cloudevents.Event) error
}

func channelID(prefix, eventID string) string {
	return fmt.Sprintf("%s/%s", prefix, eventID)
}

type CeForwardClient cloudevents.Client
type CeReceiveClient cloudevents.Client


text:
package org.adligo.models.params.shared;

public class Tag {
	private TagMutant mutant;

	Tag(TagMutant other) {
		mutant = new TagMutant(other);
	}

	public int getStart() {
		return mutant.getStart();
	}

	public String getName() {
		return mutant.getName();
	}

	public int getEnd() {
		return mutant.getEnd();
	}

	public boolean isSelfEnding() {
		return mutant.isSelfEnding();
	}

	public String toString() {
		return mutant.toString(Tag.class);
	}
}


text:
import itertools

import ggrc
import ggrc.models as models
import integration.ggrc
import integration.ggrc.generator

counter = 0

def make_name(msg):
  global counter
  counter += 1
  return msg + str(counter)

def relate(src, dst):
  if src < dst:
    return (src, dst)
  else:
    return (dst, src)

class automapping_count_limit:
  def __init__(self, new_limit):
    self.new_limit = new_limit

  def __enter__(self):
    self.original_limit = ggrc.automapper.rules.count_limit
    ggrc.automapper.rules.count_limit = self.new_limit

  def __exit__(self, type, value, traceback):
    ggrc.automapper.rules.count_limit = self.original_limit

class TestAutomappings(integration.ggrc.TestCase):

  def setUp(self):
    integration.ggrc.TestCase.setUp(self)
    self.gen = integration.ggrc.generator.ObjectGenerator()
    self.api = self.gen.api

  def tearDown(self):
    integration.ggrc.TestCase.tearDown(self)

  def create_object(self, cls, data):
    name = cls._inflector.table_singular
    data['context'] = None
    res, obj = self.gen.generate(cls, name, {name: data})
    self.assertIsNotNone(obj, '%s, %s: %s' % (name, str(data), str(res)))
    return obj

  def create_mapping(self, src, dst):
    return self.create_object(models.Relationship, {
        'source': {'id': src.id, 'type': src.type},
        'destination': {'id': dst.id, 'type': dst.type}
    })

  def assert_mapping(self, obj1, obj2, missing=False):
    ggrc.db.session.flush()
    rel = models.Relationship.find_related(obj1, obj2)
    if not missing:
      self.assertIsNotNone(rel,
                           msg='%s not mapped to %s' % (obj1.type, obj2.type))
    else:
      self.assertIsNone(rel,
                        msg='%s mapped to %s' % (obj1.type, obj2.type))

  def assert_mapping_implication(self, to_create, implied, relevant=set()):
    objects = set()
    for obj in relevant:
      objects.add(obj)
    mappings = set()
    if type(to_create) is not list:
      to_create = [to_create]
    for src, dst in to_create:
      objects.add(src)
      objects.add(dst)
      self.create_mapping(src, dst)
      mappings.add(relate(src, dst))
    if type(implied) is not list:
      implied = [implied]
    for src, dst in implied:
      objects.add(src)
      objects.add(dst)
      self.assert_mapping(src, dst)
      mappings.add(relate(src, dst))
    possible = set()
    for src, dst in itertools.product(objects, objects):
      possible.add(relate(src, dst))
    for src, dst in possible - mappings:
      self.assert_mapping(src, dst, missing=True)

  def with_permutations(self, mk1, mk2, mk3):
    obj1, obj2, obj3 = mk1(), mk2(), mk3()
    self.assert_mapping_implication(
        to_create=[(obj1, obj2), (obj2, obj3)],
        implied=(obj1, obj3),
    )
    obj1, obj2, obj3 = mk1(), mk2(), mk3()
    self.assert_mapping_implication(
        to_create=[(obj2, obj3), (obj1, obj2)],
        implied=(obj1, obj3),
    )

  def test_mapping_directive_to_a_program(self):
    self.with_permutations(
        lambda: self.create_object(models.Program, {
            'title': make_name('Program')
        }),
        lambda: self.create_object(models.Regulation, {
            'title': make_name('Test PD Regulation')
        }),
        lambda: self.create_object(models.Objective, {
            'title': make_name('Objective')
        }),
    )
    program = self.create_object(models.Program, {
        'title': make_name('Program')
    })
    objective1 = self.create_object(models.Objective, {
        'title': make_name('Objective')
    })
    objective2 = self.create_object(models.Objective, {
        'title': make_name('Objective')
    })
    self.assert_mapping_implication(
        to_create=[(program, objective1), (objective1, objective2)],
        implied=[],
    )

  def test_mapping_to_sections(self):
    regulation = self.create_object(models.Regulation, {
        'title': make_name('Test Regulation')
    })
    section = self.create_object(models.Section, {
        'title': make_name('Test section'),
    })
    objective = self.create_object(models.Objective, {
        'title': make_name('Objective')
    })
    self.assert_mapping_implication(
        to_create=[(regulation, section), (objective, section)],
        implied=(objective, regulation),

    )
    program = self.create_object(models.Program, {
        'title': make_name('Program')
    })
    self.assert_mapping_implication(
        to_create=[(objective, program)],
        implied=[(regulation, section),
                 (objective, section),
                 (objective, regulation)],
        relevant=[regulation, section, objective]
    )

  def test_automapping_limit(self):
    with automapping_count_limit(-1):
      program = self.create_object(models.Program, {
          'title': make_name('Program')
      })
      regulation = self.create_object(models.Regulation, {
          'title': make_name('Test PD Regulation')
      })
      objective = self.create_object(models.Objective, {
          'title': make_name('Objective')
      })
      self.assert_mapping_implication(
          to_create=[(regulation, objective), (objective, program)],
          implied=[],
      )

  def test_mapping_to_objective(self):
    regulation = self.create_object(models.Regulation, {
        'title': make_name('Test PD Regulation')
    })
    section = self.create_object(models.Section, {
        'title': make_name('Test section'),
        'directive': {'id': regulation.id},
    })
    control = self.create_object(models.Control, {
        'title': make_name('Test control')
    })
    objective = self.create_object(models.Objective, {
        'title': make_name('Test control')
    })
    self.assert_mapping_implication(
        to_create=[(regulation, section),
                   (section, objective),
                   (objective, control)],
        implied=[
            (regulation, objective),
            (section, control),
            (regulation, control),
        ]
    )

    program = self.create_object(models.Program, {
        'title': make_name('Program')
    })
    self.assert_mapping_implication(
        to_create=[(control, program)],
        implied=[
            (regulation, section),
            (section, objective),
            (objective, control),
            (regulation, objective),
            (section, control),
            (regulation, control),
        ],
        relevant=[regulation, section, objective, control]
    )

  def test_mapping_between_objectives(self):
    regulation = self.create_object(models.Regulation, {
        'title': make_name('Test PD Regulation')
    })
    section = self.create_object(models.Section, {
        'title': make_name('Test section'),
        'directive': {'id': regulation.id},
    })
    objective1 = self.create_object(models.Objective, {
        'title': make_name('Test Objective')
    })
    objective2 = self.create_object(models.Objective, {
        'title': make_name('Test Objective')
    })
    self.assert_mapping_implication(
        to_create=[(regulation, section),
                   (section, objective1),
                   (objective1, objective2)],
        implied=[
            (section, objective2),
            (regulation, objective1),
            (regulation, objective2),
        ]
    )

  def test_mapping_nested_controls(self):
    objective = self.create_object(models.Objective, {
        'title': make_name('Test Objective')
    })
    controlP = self.create_object(models.Control, {
        'title': make_name('Test control')
    })
    control1 = self.create_object(models.Control, {
        'title': make_name('Test control')
    })
    control2 = self.create_object(models.Control, {
        'title': make_name('Test control')
    })
    self.assert_mapping_implication(
        to_create=[(objective, controlP),
                   (controlP, control1),
                   (controlP, control2)],
        implied=[(objective, control1), (objective, control2)]
    )

  def test_automapping_permissions_check(self):
    _, creator = self.gen.generate_person(user_role="Creator")
    _, admin = self.gen.generate_person(user_role="gGRC Admin")

    program = self.create_object(models.Program, {
        'title': make_name('Program')
    })
    regulation = self.create_object(models.Regulation, {
        'title': make_name('Regulation'),
        'owners': [{"id": admin.id}],
    })
    owners = [{"id": creator.id}]
    self.api.set_user(creator)
    section = self.create_object(models.Section, {
        'title': make_name('Section'),
        'owners': owners,
    })
    objective = self.create_object(models.Objective, {
        'title': make_name('Objective'),
        'owners': owners,
    })
    control = self.create_object(models.Control, {
        'title': make_name('Control'),
        'owners': owners,
    })

    self.api.set_user(admin)
    self.assert_mapping_implication(
        to_create=[(program, regulation), (regulation, section)],
        implied=[(program, section)]
    )

    self.api.set_user(creator)
    self.assert_mapping_implication(
        to_create=[(section, objective),
                   (control, objective)],
        implied=[(program, regulation),
                 (program, section),
                 (section, regulation),
                 (control, section)],
    )

  def test_automapping_request_audit(self):
    _, creator = self.gen.generate_person(user_role="Creator")
    program = self.create_object(models.Program, {
        'title': make_name('Program')
    })
    audit = self.create_object(models.Audit, {
        'title': make_name('Audit'),
        'program': {'id': program.id},
        'status': 'Planned',
    })
    control = self.create_object(models.Control, {
        'title': make_name('Test control')
    })
    self.create_mapping(audit, control)
    request = self.create_object(models.Request, {
        'audit': {'id': audit.id},
        'title': make_name('Request'),
        'assignee': {'id': creator.id},
        'request_type': 'documentation',
        'status': 'Not Started',
        'start_date': '1/1/2015',
        'end_date': '1/1/2016',
    })
    self.assert_mapping(request, program)
    self.assert_mapping(request, audit, missing=True)
    self.assert_mapping(request, control, missing=True)

  def test_automapping_control_assesment(self):
    program = self.create_object(models.Program, {
        'title': make_name('Program')
    })
    regulation = self.create_object(models.Regulation, {
        'title': make_name('Test Regulation')
    })
    audit = self.create_object(models.Audit, {
        'title': make_name('Audit'),
        'program': {'id': program.id},
        'status': 'Planned',
    })
    control = self.create_object(models.Control, {
        'title': make_name('Test control')
    })
    assessment = self.create_object(models.Assessment, {
        'title': make_name('Test CA'),
        'audit': {
            'id': audit.id,
            'type': audit.type
        },
        'object': {
            'id': control.id,
            'type': control.type
        },
    })
    self.assert_mapping_implication(
        to_create=[(program, regulation), (regulation, assessment)],
        implied=[(program, assessment)]
    )

  def test_automapping_audit_program_object(self):
    """Test rule 'mapping program objects to audit'."""
    program = self.create_object(models.Program, {
        'title': make_name('Program')
    })
    audit = self.create_object(models.Audit, {
        'title': make_name('Audit'),
        'program': {'id': program.id},
        'status': 'Planned',
    })
    regulation = self.create_object(models.Regulation, {
        'title': make_name('Test PD Regulation')
    })
    section = self.create_object(models.Section, {
        'title': make_name('Test section'),
        'directive': {'id': regulation.id},
    })

    self.assert_mapping_implication(
        to_create=[(program, regulation), (program, section)],
        implied=[(regulation, audit), (section, audit)]
    )

    audit_new = self.create_object(models.Audit, {
        'title': make_name('Audit'),
        'program': {'id': program.id},
        'status': 'Planned',
    })
    self.assert_mapping(audit_new, regulation)
    self.assert_mapping(audit_new, section)
    self.assert_mapping(audit_new, program, missing=True)


text:
/*
 * Gemm performance test cases
 */

#include <stdlib.h>             // srand()
#include <string.h>             // memcpy()
#include <gtest/gtest.h>
#include <clBLAS.h>

#include <common.h>
#include <clBLAS-wrapper.h>
#include <BlasBase.h>
#include <gemm-2.h>
#include <blas-random.h>

#ifdef PERF_TEST_WITH_ACML
#include <blas-internal.h>
#include <blas-wrapper.h>
#endif

#include "PerformanceTest.h"

//#define SHUNT_ACML_RUN
/*
 * NOTE: operation factor means overall number
 *       of multiply and add per each operation involving
 *       2 matrix elements
 */

using namespace std;
using namespace clMath;

#define CHECK_RESULT(ret)                                                   \
do {                                                                        \
    ASSERT_GE(ret, 0) << "Fatal error: can not allocate resources or "      \
                         "perform an OpenCL request!" << endl;              \
    EXPECT_EQ(0, ret) << "The OpenCL version is slower in the case" <<      \
                         endl;                                              \
} while (0)

namespace clMath {

template <typename ElemType> class GemmPerformanceTest : public PerformanceTest
{
public:
    virtual ~GemmPerformanceTest();

    virtual int prepare(void);
    virtual nano_time_t etalonPerfSingle(void);
    virtual nano_time_t clblasPerfSingle(void);

    static void runInstance(BlasFunction fn, TestParams *params)
    {
        GemmPerformanceTest<ElemType> perfCase(fn, params);
        int ret = 0;
        int opFactor;
        BlasBase *base;

        base = clMath::BlasBase::getInstance();

        if (fn == FN_SGEMM_2 || fn == FN_DGEMM_2) {
            opFactor = 2;
        }
        else {
            opFactor = 8;
        }

        if ((fn == FN_DGEMM_2 || fn == FN_ZGEMM_2) &&
            !base->isDevSupportDoublePrecision()) {

            std::cerr << ">> WARNING: The target device doesn't support native "
                         "double precision floating point arithmetic" <<
                         std::endl << ">> Test skipped" << std::endl;
            return;
        }

        if (!perfCase.areResourcesSufficient(params)) {
            std::cerr << ">> RESOURCE CHECK: Skip due to unsufficient resources" <<
                        std::endl;
        }
        else {
            ret = perfCase.run(opFactor);
        }

        ASSERT_GE(ret, 0) << "Fatal error: can not allocate resources or "
                             "perform an OpenCL request!" << endl;
        EXPECT_EQ(0, ret) << "The OpenCL version is slower in the case" << endl;
    }

private:
    GemmPerformanceTest(BlasFunction fn, TestParams *params);

    bool areResourcesSufficient(TestParams *params);

    TestParams params_;
    ElemType alpha_;
    ElemType beta_;
    ElemType *A_;
    ElemType *B_;
    ElemType *C_;
    ElemType *backC_;
    cl_mem mobjA_;
    cl_mem mobjB_;
    cl_mem mobjC_;
    ::clMath::BlasBase *base_;
};

template <typename ElemType>
GemmPerformanceTest<ElemType>::GemmPerformanceTest(
    BlasFunction fn,
    TestParams *params) : PerformanceTest(fn, (problem_size_t)params->M * params->N
                                            * params->K),
                        params_(*params), mobjA_(NULL), mobjB_(NULL), mobjC_(NULL)
{
    A_ = new ElemType[params_.rowsA * params_.columnsA];
    B_ = new ElemType[params_.rowsB * params_.columnsB];
    C_ = new ElemType[params_.rowsC * params_.columnsC];
    backC_ = new ElemType[params_.rowsC * params_.columnsC];

    base_ = ::clMath::BlasBase::getInstance();
}

template <typename ElemType>
GemmPerformanceTest<ElemType>::~GemmPerformanceTest()
{
    if(A_ != NULL)
    {
        delete[] A_;
    }
	if(B_ != NULL)
	{
        delete[] B_;
	}
	if(C_ != NULL)
	{
        delete[] C_;
	}
	if(backC_ != NULL)
	{
        delete[] backC_;
	}
    if(mobjA_ != NULL)
 	{
        clReleaseMemObject(mobjA_);
    }
	if(mobjB_ != NULL)
    {
		clReleaseMemObject(mobjB_);
	}
	if(mobjC_ != NULL)
	{
		clReleaseMemObject(mobjC_);
	}
}

/*
 * Check if available OpenCL resources are sufficient to
 * run the test case
 */
template <typename ElemType> bool
GemmPerformanceTest<ElemType>::areResourcesSufficient(TestParams *params)
{
    clMath::BlasBase *base;
    size_t gmemSize, allocSize, maxMatrSize;
    bool ret = true;
    size_t m = params->M, n = params->N, k = params->K;

	if((A_ == NULL) || (backC_ == NULL) || (C_ == NULL) || (B_ == NULL))
	{
		return 0;
	}

    base = clMath::BlasBase::getInstance();
    gmemSize = (size_t)base->availGlobalMemSize(0);
    allocSize = (size_t)base->maxMemAllocSize();

    if (base->useImages()) {
        maxMatrSize = gmemSize / 5;
        ret = (k < base->scratchImageWidth() *
                  sizeof(cl_float4) / sizeof(ElemType));
    }
    else {
        maxMatrSize = gmemSize / 3;
    }
    maxMatrSize = std::min(maxMatrSize, allocSize);

    if (ret) {
        ret = ((std::max(m, n) * k * sizeof(ElemType) < maxMatrSize) &&
               (m * n * sizeof(ElemType) < maxMatrSize));
    }

    return ret;
}

template <typename ElemType> int
GemmPerformanceTest<ElemType>::prepare(void)
{
    bool useAlpha = base_->useAlpha();
    bool useBeta = base_->useBeta();

    if (useAlpha) {
        alpha_ = convertMultiplier<ElemType>(params_.alpha);
    }
    if (useBeta) {
        beta_ = convertMultiplier<ElemType>(params_.beta);
    }

    randomGemmMatrices<ElemType>(params_.order, params_.transA, params_.transB,
                                 params_.M, params_.N, params_.K, useAlpha,
                                 &alpha_, A_, params_.lda, B_, params_.ldb,
                                 useBeta, &beta_, C_, params_.ldc);

    mobjA_ = base_->createEnqueueBuffer(A_, params_.rowsA * params_.columnsA *
                                        sizeof(ElemType),
                                        params_.offA * sizeof(ElemType),
                                        CL_MEM_READ_ONLY);
    if (mobjA_) {
        mobjB_ = base_->createEnqueueBuffer(B_, params_.rowsB * params_.columnsB *
                                            sizeof(ElemType),
                                            params_.offBX * sizeof(ElemType),
                                            CL_MEM_READ_ONLY);
    }
    if (mobjB_) {
        mobjC_ = base_->createEnqueueBuffer(backC_, params_.rowsC * params_.columnsC *
                                            sizeof(ElemType),
                                            params_.offCY * sizeof(ElemType),
                                            CL_MEM_READ_WRITE);
    }

    return (mobjC_) ? 0 : -1;
}

template <typename ElemType> nano_time_t
GemmPerformanceTest<ElemType>::etalonPerfSingle(void)
{
    nano_time_t time = 0;
    clblasOrder order;
    size_t lda, ldb, ldc;

#ifndef PERF_TEST_WITH_ROW_MAJOR
    if (params_.order == clblasRowMajor) {
        cerr << "Row major order is not allowed" << endl;
        return NANOTIME_ERR;
    }
#endif

    memcpy(C_, backC_, params_.rowsC * params_.columnsC * sizeof(ElemType));
    order = params_.order;
    lda = params_.lda;
    ldb = params_.ldb;
    ldc = params_.ldc;

#ifdef PERF_TEST_WITH_ACML

    if (order == clblasRowMajor) {
        order = clblasColumnMajor;
        if (params_.transA == clblasNoTrans) {
            lda = params_.M;
        }
        else {
            lda = params_.K;
        }
        if (params_.transB == clblasNoTrans) {
            ldb = params_.K;
        }
        else {
            ldb = params_.N;
        }
        ldc = params_.M;
    }

    time = getCurrentTime();
	#ifndef SHUNT_ACML_RUN
    clMath::blas::gemm(order, params_.transA, params_.transB,
                    params_.M, params_.N, params_.K,
                    alpha_, A_, lda, B_, ldb, beta_, C_, ldc);
	#endif
    time = getCurrentTime() - time;

#endif  // PERF_TEST_WITH_ACML

    return time;
}

template <typename ElemType> nano_time_t
GemmPerformanceTest<ElemType>::clblasPerfSingle(void)
{
    nano_time_t time;
    cl_event event, gemmevent;
    cl_int status;
    cl_command_queue queue = base_->commandQueues()[0];

    status = clEnqueueWriteBuffer(queue, mobjC_, CL_TRUE, 0,
                                  params_.rowsC * params_.columnsC *
                                  sizeof(ElemType), backC_, 0, NULL, &event);
    if (status != CL_SUCCESS) {
        cerr << "Matrix C buffer object enqueuing error, status = " <<
                 status << endl;

        return NANOTIME_ERR;
    }

    status = clWaitForEvents(1, &event);
    if (status != CL_SUCCESS) {
        cout << "Wait on event failed, status = " <<
                status << endl;

        return NANOTIME_ERR;
    }

    event = NULL;
    status = (cl_int)clMath::clblas::gemm2(params_.order,
        params_.transA, params_.transB, params_.M, params_.N, params_.K, alpha_,
        mobjA_, params_.offA, params_.lda, mobjB_, params_.offBX, params_.ldb,
        beta_, mobjC_, params_.offCY, params_.ldc, 1, &queue, 0, NULL, &gemmevent);
    if (status != CL_SUCCESS) {
        cerr << "The CLBLAS GEMM function failed, status = " <<
                status << endl;

        return NANOTIME_ERR;
    }
    status = flushAll(1, &queue);
    if (status != CL_SUCCESS) {
        cerr << "clFlush() failed, status = " << status << endl;
        return NANOTIME_ERR;
    }

    time = getCurrentTime();
    status = waitForSuccessfulFinish(1, &queue, &gemmevent);
    if (status == CL_SUCCESS) {
        time = getCurrentTime() - time;
    }
    else {
        cerr << "Waiting for completion of commands to the queue failed, "
                "status = " << status << endl;
        time = NANOTIME_ERR;
    }

	//printf("Returning Time: %lu\n", time);
    return time;
}

} // namespace clMath

// sgemm performance test
TEST_P(GEMM2, sgemm)
{
    TestParams params;

    getParams(&params);
    GemmPerformanceTest<float>::runInstance(FN_SGEMM_2, &params);
}

// dgemm performance test case
TEST_P(GEMM2, dgemm)
{
    TestParams params;

    getParams(&params);
    GemmPerformanceTest<double>::runInstance(FN_DGEMM_2, &params);
}

// cgemm performance test case
TEST_P(GEMM2, cgemm)
{
    TestParams params;

    getParams(&params);
    GemmPerformanceTest<FloatComplex>::runInstance(FN_CGEMM_2, &params);
}

// zgemm performance test case
TEST_P(GEMM2, zgemm)
{
    TestParams params;

    getParams(&params);
    GemmPerformanceTest<DoubleComplex>::runInstance(FN_ZGEMM_2, &params);
}


text: JOSÉ ROBERTO DOS SANTOS


text:
from cms.utils.compat.dj import python_2_unicode_compatible
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models import CMSPlugin, Page

@python_2_unicode_compatible
class Link(CMSPlugin):
    """
    A link to an other page or to an external website
    """

    name = models.CharField(_("name"), max_length=256)
    url = models.URLField(_("link"), blank=True, null=True)
    page_link = models.ForeignKey(Page, verbose_name=_("page"), blank=True, null=True, help_text=_("A link to a page has priority over a text link."))
    mailto = models.EmailField(_("mailto"), blank=True, null=True, help_text=_("An email adress has priority over a text link."))
    target = models.CharField(_("target"), blank=True, max_length=100, choices=((
        ("", _("same window")),
        ("_blank", _("new window")),
        ("_parent", _("parent window")),
        ("_top", _("topmost frame")),
    )))

    def __str__(self):
        return self.name

    search_fields = ('name',)


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	errorHandler = require('./errors.server.controller'),
	Guest = mongoose.model('Guest'),
	_ = require('lodash');

/**
 * Create a Guest
 */
exports.create = function(req, res) {
	var guest = new Guest(req.body);
	guest.user = req.user;

	guest.save(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(guest);
		}
	});
};

/**
 * Show the current Guest
 */
exports.read = function(req, res) {
	res.jsonp(req.guest);
};

/**
 * Update a Guest
 */
exports.update = function(req, res) {
	var guest = req.guest ;

	guest = _.extend(guest , req.body);

	guest.save(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(guest);
		}
	});
};

/**
 * Delete an Guest
 */
exports.delete = function(req, res) {
	var guest = req.guest ;

	guest.remove(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(guest);
		}
	});
};

/**
 * List of Guests
 */
exports.list = function(req, res) {
	Guest.find().sort('-created').populate('user', 'displayName').exec(function(err, guests) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(guests);
		}
	});
};

/**
 * Guest middleware
 */
exports.guestByID = function(req, res, next, id) {
	Guest.findById(id).populate('user', 'displayName').exec(function(err, guest) {
		if (err) return next(err);
		if (! guest) return next(new Error('Failed to load Guest ' + id));
		req.guest = guest ;
		next();
	});
};

/**
 * Guest authorization middleware
 */
exports.hasAuthorization = function(req, res, next) {
	if (req.guest.user.id !== req.user.id) {
		return res.status(403).send('User is not authorized');
	}
	next();
};


text:
'''
    utility script to initialize sqlite database.
    Do we even need security on the HRDR?
'''
from database import dbcontext
import sys,subprocess
import optparse

from optparse import OptionParser

parser = OptionParser()
parser.add_option("-c", "--create", dest="create",action="store_true",help="destroy/create database", metavar="CREATE")

if __name__=="__main__":

    (options, args) = parser.parse_args()

    if options.create:
        print 'creating database'
        try:
            subprocess.check_output(["dropdb","gains"])
        except:
            pass
        subprocess.check_output(["createdb","gains"])

    schema=file('schema.sql').read()

    with dbcontext() as cursor:
        cursor.execute(schema)


text:
package com.capitalone.dashboard.repository;

import com.capitalone.dashboard.model.SplunkCollector;

public interface SplunkCollectorRepository extends BaseCollectorRepository<SplunkCollector> {

}


text:
import java.io.FileNotFoundException;
import java.io.IOException;
import org.lwjgl.LWJGLException;
import org.lwjgl.Sys;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;

/**
 *
 * @author Šarūnas Navickas
 */
public class Main
{
    private static int _fps = 60;
    public static boolean _baigtas = false;
    private static Thread _logic;
    public static boolean _done = true;
    private static void cleanup()
    {
        Display.destroy();
    }
    public static void cleanObj()
    {
        for(int i = 0; i<Duomenys._objektai.size();i++)
            {
                try
                {
                    Logika.world.remove(Duomenys._objektai.get(i).body);
                    Duomenys._objektai.remove(i);
                }
                catch(Exception ex)
                {}
            }
    }
    public static void objects() throws IOException
    {
        _done = false;
        System.out.print("Objects..");
        //Išvalom viską
        while(Duomenys._objektai.size() > 0)
        {
            try
            {
                cleanObj();
            }
            catch(Exception ex)
            {

            }
        }
        Logika._rudos = 0;
        Duomenys.loadObj("Lygiai/base.txt",true);
        try
        {
            Duomenys.loadObj("Lygiai/"+Logika._lygis+"/boxes.txt",false);
        }
        catch(Exception ex)
        {
            Duomenys.loadObj("Lygiai/1/boxes.txt",false);
        }
        System.out.print("done.\n");
        _done = true;
    }
    private static void init() throws LWJGLException, FileNotFoundException, IOException
    {
        System.out.println("Initializing:");
        System.out.print("Screen..");
        Display.setTitle("Kamuoliukų manija");
        Display.setFullscreen(true);
        Display.setVSyncEnabled(true);
        Display.create();
        Display.setDisplayMode(new DisplayMode(1024,768));
        System.out.print("done.\n");

        System.out.print("OpenGL..");
        GL11.glMatrixMode(GL11.GL_PROJECTION);
        GL11.glLoadIdentity();
        GL11.glOrtho(0.0, Display.getDisplayMode().getWidth(), 0.0, Display.getDisplayMode().getHeight(), -1.0, 1.0);
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        GL11.glLoadIdentity();
        GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
        GL11.glMatrixMode(GL11.GL_PROJECTION);
        System.out.print("done.\n");
        System.out.print("Textures..");
        Duomenys.loadTex("kamuoliukas", "Tekstūros/kamuoliukas.tga");
        Duomenys.loadTex("blokelis", "Tekstūros/blokelis.tga");
        Duomenys.loadTex("patranka", "Tekstūros/patranka.tga");
        Duomenys.loadTex("patranka2", "Tekstūros/patranka2.tga");
        Duomenys.loadTex("jėga_pilkas", "Tekstūros/jėga_pilkas.tga");
        Duomenys.loadTex("jėga_geltonas", "Tekstūros/jėga_geltonas.tga");
        Duomenys.loadTex("jėga_žalias", "Tekstūros/jėga_žalias.tga");
        Duomenys.loadTex("jėga_raudonas", "Tekstūros/jėga_raudonas.tga");
        Duomenys.loadTex("deze_raudona", "Tekstūros/dėžė_raudona.tga");
        Duomenys.loadTex("deze_ruda", "Tekstūros/dėžė_ruda.tga");
        Duomenys.loadTex("deze_pilka", "Tekstūros/dėžė_pilka.tga");
        Duomenys.loadTex("font", "Tekstūros/font.tga");
        System.out.print("done.\n");
        _logic = new Thread(new LogicsThread());
    }
    private static void run() throws LWJGLException, IOException
    {
        while(!_baigtas)
        {
            Display.update();

            if (Display.isCloseRequested())
            {
                _baigtas = true;
            }
            else if (Display.isActive())
            {
                Grafika.render();
                Display.sync(_fps);
            }
            else
            {
                try
                {
                  Thread.sleep(100);
                }
                catch (InterruptedException e) {}
            }
            if (Display.isVisible() || Display.isDirty())
            {
                 Grafika.render();
            }
        }
    }
    public static void main(String[] args)
    {
        try
        {
            init();
            run();
        }
        catch (Exception ex)
        {
            System.out.println(ex.toString());
            Sys.alert("Kamuoliukų Manija", "Nepavyko paleisti žaidimo.");
        }
        finally
        {
            cleanup();
        }
        System.exit(0);
    }

}


text:
Gear Tracker
============

Gear Tracker is an inventory system for wilderness travel and backpacking gear. It runs on [Django](http://www.djangoproject.com/).

Genesis
--------

Weight is an important consideration when travelling in wilderness places. A digital scale is a useful tool to measure the weight of individual items. If you know the weight of an item, you can more accurately judge whether the item should be added to your pack.

When I first bought my scale, I started a spreadsheet containing the weights of various pieces of gear. It seemed like a good idea -- I knew I wanted some sort of database to store my measured weights and other notes in -- but I never got around to updating it. Data in a spreadsheet is too static. You can't do much with it. I think that characteristic contributed to my disinterest with the spreadsheet. So, I decided to write an application to fill my needs.

Features
--------

### Metric and Imperial Weights

Weights are always input in grams, but can be displayed in either metric (grams, kilograms) or imperial (ounces, pounds) units.

### Public/Private Gear Lists

A gear list can be marked either public or private.

If a gear list is private, it will only be viewable to logged in users who have permissions to create a gear list. The intent behind allowing private lists is that you can create your gear list before you leave on a trip, but not make the gear list public until after you have returned. Thus, your trip is not public knowledge until you make it back.

### Archivable Items

Items can be archived.

When an item is archived, it will not be displayed in any list of items (such as the All Gear list, or list of items by category/type/tag). The item's page will continue to exist, so that any hard-coded links (from your site or others) will not be broken.

Archived items will continue to appear in any gear lists they might belong to. This is to retain the historical accuracy of the gear lists, and to avoid screwing with weights. The archived item's name will not be a link to the item's page, and the table row of the archived item will have a unique class applied to it so that the user may style it differently than non-archived items.

The idea behind archivable items is that if you no longer possess an item, you may not want it to appear in your list of items. But you may want to retain the item's entry so that you can reference its weight in the future, and you don't want to delete the item outright for fear of thus invalidating old gear lists which that item may appear in.

Installation
------------

1.  Put the `geartracker` directory somewhere in your Python path (like inside your Django project folder).

2.  Add `geartracker` to your `settings.INSTALLED_APPS`.

Requirements
------------

* [sorl-thumbnail](http://thumbnail.sorl.net/) is used to generate thumbnails of images.
* [Python Imaging Library](http://www.pythonware.com/products/pil/) is required for getting photo EXIF data.
* [django-taggit](https://github.com/alex/django-taggit) is required for tagging.
* [django-taggit-templatetags](https://github.com/feuervogel/django-taggit-templatetags) is required for listing tags in templates.

Feedback
--------

If you use Gear Tracker, I'd be interested to hear any feedback you might have. [Contact me via email](mailto:pm@pig-monkey.com).

From the user perspective, I'm keen to hear whether the app fills your needs or not.

I am new to both Django and Python, so, from the developer perspective, I would appreciate any feedback on the code.


text:
package org.spongepowered.api.block.tileentity;

import org.spongepowered.api.CatalogType;
import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.util.annotation.CatalogedBy;

/**
 * Describes a type of tile entity.
 */
@CatalogedBy(TileEntityTypes.class)
public interface TileEntityType extends CatalogType {

    /**
     * Gets the type of {@link BlockType} that this {@link TileEntityType}
     * can be created from.
     *
     * @return The type of block this tile entity type can be created with
     */
    BlockType getParentBlockType();

    /**
     * Returns the tile entity class for this type.
     *
     * @return The tile class for this type
     */
    Class<? extends TileEntity> getTileEntityType();

}


text:
@implementation ARLocation

@synthesize gotPreciseEnoughLocation;
@synthesize currentLat, currentLon;

-(id) init
{
    self = [super init];
    if(self)
    {
        gotPreciseEnoughLocation = NO;
        [self setLocationManager];
        [self setDateFormat];
        motionManager = [[CMMotionManager alloc] init];

    }
    [self startLocationUpdate];

    return self;
}

+(id)shareInstance{
    static ARLocation *__instance = nil;
    if(__instance == nil){
        __instance = [[ARLocation alloc] init];
    }

    return __instance;
}

- (void) setLocationManager
{
    if (locationManager == nil){

        locationManager = [[CLLocationManager alloc]init];

	}
    [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
    locationManager.delegate = self;

}

- (void) setDateFormat
{
    formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"hh:mm:ss a z"];
}

- (void) startLocationUpdate
{
    [locationManager startUpdatingLocation];

}

- (void) stopLocationUpdate
{
    [locationManager stopUpdatingLocation];
}

- (CLLocationCoordinate2D) getCurrent2Dlocation
{
    [self startLocationUpdate];

    //Assign location value
    self.lat = location.coordinate.latitude;
    self.lon = location.coordinate.longitude;

    currentLoc =  CLLocationCoordinate2DMake(self.lat , self.lon);

    return currentLoc;
}

#pragma mark -
#pragma mark CLLocationManagerDelegate

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
    location = [locations lastObject];

    //Get timeStemp of lastest location update
    NSDate * eventDate = [(CLLocation *)[locations lastObject] timestamp];

    NSTimeInterval howRecent = [eventDate timeIntervalSinceNow];
    if (abs(howRecent) < 1.0 || location.horizontalAccuracy < 100 ) {
        //Assign location value
        self.lat = location.coordinate.latitude;
        self.lon = location.coordinate.longitude;

        gotPreciseEnoughLocation = YES;
        currentLat = location.coordinate.latitude;
        currentLon = location.coordinate.longitude;

    }

}

- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
        currentHeading =  fmod(newHeading.trueHeading, 360.0);

}
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
    if(error.code == kCLErrorDenied) {
        [locationManager stopUpdatingLocation];
    } else if(error.code == kCLErrorLocationUnknown) {
        // retry
    } else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Retrieving location error"
                                                        message:[error description]
                                                       delegate:nil
                                              cancelButtonTitle:@"OK"
                                              otherButtonTitles:nil];
        [alert show];
    }
}

#pragma mark - AR delegate

-(void)arStopUpdateLocation
{
    [locationManager stopUpdatingLocation];
}

-(void)pollAccellerometerForVerticalPosition {

    CMAcceleration acceleration = motionManager.accelerometerData.acceleration;

    rollingZ  = (acceleration.z * kFilteringFactor) + (rollingZ  * (1.0 - kFilteringFactor));
    rollingX = (acceleration.y * kFilteringFactor) + (rollingX * (1.0 - kFilteringFactor));

	if (rollingZ > 0.0)      currentInclination = inc_avg(atan(rollingX / rollingZ) + M_PI / 2.0);
	else if (rollingZ < 0.0) currentInclination = inc_avg(atan(rollingX / rollingZ) - M_PI / 2.0);
	else if (rollingX < 0)   currentInclination = inc_avg(M_PI/2.0);
	else if (rollingX >= 0)  currentInclination = inc_avg(3 * M_PI/2.0);
}

# pragma mark - Accellerometer

-(void)startAR:(CGSize)deviceScreenSize {

    deviceViewHeight = deviceScreenSize.height;

    [locationManager startUpdatingHeading];
    [motionManager startAccelerometerUpdates];

    if (accelTimer) {
        accelTimer = nil;
    }
    accelTimer = [NSTimer scheduledTimerWithTimeInterval:REFRESH_RATE
                                                  target:self
                                                selector:@selector(pollAccellerometerForVerticalPosition)
                                                userInfo:nil
                                                 repeats:YES];
}

# pragma mark - Callback functions

-(CGRect)getCurrentFramePosition {
    float y_pos = currentInclination*VERTICAL_SENS;
    float x_pos = X_CENTER+(0-currentHeading)*HORIZ_SENS;

    return CGRectMake(x_pos, y_pos+60, OVERLAY_VIEW_WIDTH, deviceViewHeight);
}
-(int)getARObjectXPosition:(ARObject*)arObject {
    CLLocationCoordinate2D coordinates;
    coordinates.latitude        = [[arObject getARObjectData][@"latitude"] doubleValue];
    coordinates.longitude       = [[arObject getARObjectData][@"longitude"] doubleValue];

    double latitudeDistance     = max(coordinates.latitude, currentLat) - min(coordinates.latitude, currentLat);
    double longitudeDistance    = max(coordinates.longitude, currentLon) - min(coordinates.longitude, currentLon);

    int x_position = DEGREES(atanf(longitudeDistance/(latitudeDistance*lat_over_lon)));

    if ((coordinates.latitude < currentLat) && (coordinates.longitude > currentLon))
        x_position = 180-x_position;

    else if ((coordinates.latitude < currentLat) && (coordinates.longitude < currentLon))
        x_position += 180;

    else if ((coordinates.latitude > currentLat) && (coordinates.longitude < currentLon))
        x_position += 270;

    return x_position*HORIZ_SENS;
}

@end


text:
namespace rocksdb {

// Simple implementation of SlicePart variants of Put().  Child classes
// can override these method with more performant solutions if they choose.
void WriteBatchBase::Put(ColumnFamilyHandle* column_family,
                         const SliceParts& key, const SliceParts& value) {
  std::string key_buf, value_buf;
  Slice key_slice(key, &key_buf);
  Slice value_slice(value, &value_buf);

  Put(column_family, key_slice, value_slice);
}

void WriteBatchBase::Put(const SliceParts& key, const SliceParts& value) {
  std::string key_buf, value_buf;
  Slice key_slice(key, &key_buf);
  Slice value_slice(value, &value_buf);

  Put(key_slice, value_slice);
}

void WriteBatchBase::Delete(ColumnFamilyHandle* column_family,
                            const SliceParts& key) {
  std::string key_buf;
  Slice key_slice(key, &key_buf);
  Delete(column_family, key_slice);
}

void WriteBatchBase::Delete(const SliceParts& key) {
  std::string key_buf;
  Slice key_slice(key, &key_buf);
  Delete(key_slice);
}

void WriteBatchBase::SingleDelete(ColumnFamilyHandle* column_family,
                                  const SliceParts& key) {
  std::string key_buf;
  Slice key_slice(key, &key_buf);
  SingleDelete(column_family, key_slice);
}

void WriteBatchBase::SingleDelete(const SliceParts& key) {
  std::string key_buf;
  Slice key_slice(key, &key_buf);
  SingleDelete(key_slice);
}

void WriteBatchBase::Merge(ColumnFamilyHandle* column_family,
                         const SliceParts& key, const SliceParts& value) {
  std::string key_buf, value_buf;
  Slice key_slice(key, &key_buf);
  Slice value_slice(value, &value_buf);

  Merge(column_family, key_slice, value_slice);
}

void WriteBatchBase::Merge(const SliceParts& key, const SliceParts& value) {
  std::string key_buf, value_buf;
  Slice key_slice(key, &key_buf);
  Slice value_slice(value, &value_buf);

  Merge(key_slice, value_slice);
}

}  // namespace rocksdb


text:
(function(scope) {

  // element api

  var properties = {
    inferObservers: function(prototype) {
      // called before prototype.observe is chained to inherited object
      var observe = prototype.observe, property;
      for (var n in prototype) {
        if (n.slice(-7) === 'Changed') {
          if (!observe) {
            observe  = (prototype.observe = {});
          }
          property = n.slice(0, -7)
          observe[property] = observe[property] || n;
        }
      }
    },
    explodeObservers: function(prototype) {
      // called before prototype.observe is chained to inherited object
      var o = prototype.observe;
      if (o) {
        var exploded = {};
        for (var n in o) {
          var names = n.split(' ');
          for (var i=0, ni; ni=names[i]; i++) {
            exploded[ni] = o[n];
          }
        }
        prototype.observe = exploded;
      }
    },
    optimizePropertyMaps: function(prototype) {
      if (prototype.observe) {
        // construct name list
        var a = prototype._observeNames = [];
        for (var n in prototype.observe) {
          var names = n.split(' ');
          for (var i=0, ni; ni=names[i]; i++) {
            a.push(ni);
          }
        }
      }
      if (prototype.publish) {
        // construct name list
        var a = prototype._publishNames = [];
        for (var n in prototype.publish) {
          a.push(n);
        }
      }
      if (prototype.computed) {
        // construct name list
        var a = prototype._computedNames = [];
        for (var n in prototype.computed) {
          a.push(n);
        }
      }
    },
    publishProperties: function(prototype, base) {
      // if we have any properties to publish
      var publish = prototype.publish;
      if (publish) {
        // transcribe `publish` entries onto own prototype
        this.requireProperties(publish, prototype, base);
        // construct map of lower-cased property names
        prototype._publishLC = this.lowerCaseMap(publish);
      }
    },
    //
    // `name: value` entries in the `publish` object may need to generate
    // matching properties on the prototype.
    //
    // Values that are objects may have a `reflect` property, which
    // signals that the value describes property control metadata.
    // In metadata objects, the prototype default value (if any)
    // is encoded in the `value` property.
    //
    // publish: {
    //   foo: 5,
    //   bar: {value: true, reflect: true},
    //   zot: {}
    // }
    //
    // `reflect` metadata property controls whether changes to the property
    // are reflected back to the attribute (default false).
    //
    // A value is stored on the prototype unless it's === `undefined`,
    // in which case the base chain is checked for a value.
    // If the basal value is also undefined, `null` is stored on the prototype.
    //
    // The reflection data is stored on another prototype object, `reflect`
    // which also can be specified directly.
    //
    // reflect: {
    //   foo: true
    // }
    //
    requireProperties: function(propertyInfos, prototype, base) {
      // per-prototype storage for reflected properties
      prototype.reflect = prototype.reflect || {};
      // ensure a prototype value for each property
      // and update the property's reflect to attribute status
      for (var n in propertyInfos) {
        var value = propertyInfos[n];
        // value has metadata if it has a `reflect` property
        if (value && value.reflect !== undefined) {
          prototype.reflect[n] = Boolean(value.reflect);
          value = value.value;
        }
        // only set a value if one is specified
        if (value !== undefined) {
          prototype[n] = value;
        }
      }
    },
    lowerCaseMap: function(properties) {
      var map = {};
      for (var n in properties) {
        map[n.toLowerCase()] = n;
      }
      return map;
    },
    createPropertyAccessor: function(name, ignoreWrites) {
      var proto = this.prototype;

      var privateName = name + '_';
      var privateObservable  = name + 'Observable_';
      proto[privateName] = proto[name];

      Object.defineProperty(proto, name, {
        get: function() {
          var observable = this[privateObservable];
          if (observable)
            observable.deliver();

          return this[privateName];
        },
        set: function(value) {
          if (ignoreWrites) {
            return this[privateName];
          }

          var observable = this[privateObservable];
          if (observable) {
            observable.setValue(value);
            return;
          }

          var oldValue = this[privateName];
          this[privateName] = value;
          this.emitPropertyChangeRecord(name, value, oldValue);

          return value;
        },
        configurable: true
      });
    },
    createPropertyAccessors: function(prototype) {
      var n$ = prototype._computedNames;
      if (n$ && n$.length) {
        for (var i=0, l=n$.length, n, fn; (i<l) && (n=n$[i]); i++) {
          this.createPropertyAccessor(n, true);
        }
      }
      var n$ = prototype._publishNames;
      if (n$ && n$.length) {
        for (var i=0, l=n$.length, n, fn; (i<l) && (n=n$[i]); i++) {
          // If the property is computed and published, the accessor is created
          // above.
          if (!prototype.computed || !prototype.computed[n]) {
            this.createPropertyAccessor(n);
          }
        }
      }
    }
  };

  // exports

  scope.api.declaration.properties = properties;

})(Polymer);


text:
package get_test

import (
	"fmt"
	"os"
	"path/filepath"
	"runtime"
	"testing"

	"github.com/GoogleContainerTools/kpt/commands/pkg/get"
	"github.com/GoogleContainerTools/kpt/internal/testutil"
	kptfilev1 "github.com/GoogleContainerTools/kpt/pkg/api/kptfile/v1"
	"github.com/GoogleContainerTools/kpt/pkg/printer/fake"
	"github.com/spf13/cobra"
	"github.com/stretchr/testify/assert"
	"sigs.k8s.io/kustomize/kyaml/yaml"
)

func TestMain(m *testing.M) {
	os.Exit(testutil.ConfigureTestKptCache(m))
}

// TestCmd_execute tests that get is correctly invoked.
func TestCmd_execute(t *testing.T) {
	g, w, clean := testutil.SetupRepoAndWorkspace(t, testutil.Content{
		Data:   testutil.Dataset1,
		Branch: "master",
	})
	defer clean()

	defer testutil.Chdir(t, w.WorkspaceDirectory)()

	dest := filepath.Join(w.WorkspaceDirectory, g.RepoName)

	r := get.NewRunner(fake.CtxWithDefaultPrinter(), "kpt")
	// defaults LOCAL_DEST_DIR to current working directory
	r.Command.SetArgs([]string{"file://" + g.RepoDirectory + ".git/"})
	err := r.Command.Execute()

	assert.NoError(t, err)

	// verify the cloned contents matches the repository with merge comment added
	g.AssertEqual(t, filepath.Join(g.DatasetDirectory, testutil.Dataset1), dest, true)

	commit, err := g.GetCommit()
	assert.NoError(t, err)
	g.AssertKptfile(t, dest, kptfilev1.KptFile{
		ResourceMeta: yaml.ResourceMeta{
			ObjectMeta: yaml.ObjectMeta{
				NameMeta: yaml.NameMeta{
					Name: g.RepoName,
				},
			},
			TypeMeta: yaml.TypeMeta{
				APIVersion: kptfilev1.KptFileGVK().GroupVersion().String(),
				Kind:       kptfilev1.KptFileGVK().Kind,
			},
		},
		Upstream: &kptfilev1.Upstream{
			Type: kptfilev1.GitOrigin,
			Git: &kptfilev1.Git{
				Directory: "/",
				Repo:      "file://" + g.RepoDirectory,
				Ref:       "master",
			},
			UpdateStrategy: kptfilev1.ResourceMerge,
		},
		UpstreamLock: &kptfilev1.UpstreamLock{
			Type: kptfilev1.GitOrigin,
			Git: &kptfilev1.GitLock{
				Directory: "/",
				Repo:      "file://" + g.RepoDirectory,
				Ref:       "master",
				Commit:    commit, // verify the commit matches the repo
			},
		},
	})
}

// TestCmdMainBranch_execute tests that get is correctly invoked if default branch
// is main and master branch doesn't exist
func TestCmdMainBranch_execute(t *testing.T) {
	// set up git repository with master and main branches
	g, w, clean := testutil.SetupRepoAndWorkspace(t, testutil.Content{
		Data: testutil.Dataset1,
	})
	defer clean()

	defer testutil.Chdir(t, w.WorkspaceDirectory)()

	dest := filepath.Join(w.WorkspaceDirectory, g.RepoName)
	err := g.CheckoutBranch("main", false)
	if !assert.NoError(t, err) {
		t.FailNow()
	}

	r := get.NewRunner(fake.CtxWithDefaultPrinter(), "kpt")
	r.Command.SetArgs([]string{"file://" + g.RepoDirectory + ".git/", "./"})
	err = r.Command.Execute()

	assert.NoError(t, err)

	// verify the cloned contents matches the repository with merge comment added
	g.AssertEqual(t, filepath.Join(g.DatasetDirectory, testutil.Dataset1), dest, true)

	commit, err := g.GetCommit()
	assert.NoError(t, err)
	g.AssertKptfile(t, dest, kptfilev1.KptFile{
		ResourceMeta: yaml.ResourceMeta{
			ObjectMeta: yaml.ObjectMeta{
				NameMeta: yaml.NameMeta{
					Name: g.RepoName,
				},
			},
			TypeMeta: yaml.TypeMeta{
				APIVersion: kptfilev1.KptFileGVK().GroupVersion().String(),
				Kind:       kptfilev1.KptFileGVK().Kind,
			},
		},
		Upstream: &kptfilev1.Upstream{
			Type: kptfilev1.GitOrigin,
			Git: &kptfilev1.Git{
				Directory: "/",
				Repo:      "file://" + g.RepoDirectory,
				Ref:       "main",
			},
			UpdateStrategy: kptfilev1.ResourceMerge,
		},
		UpstreamLock: &kptfilev1.UpstreamLock{
			Type: kptfilev1.GitOrigin,
			Git: &kptfilev1.GitLock{
				Directory: "/",
				Repo:      "file://" + g.RepoDirectory,
				Ref:       "main",
				Commit:    commit, // verify the commit matches the repo
			},
		},
	})
}

// TestCmd_fail verifies that that command returns an error rather than exiting the process
func TestCmd_fail(t *testing.T) {
	r := get.NewRunner(fake.CtxWithDefaultPrinter(), "kpt")
	r.Command.SilenceErrors = true
	r.Command.SilenceUsage = true
	r.Command.SetArgs([]string{"file://" + filepath.Join("not", "real", "dir") + ".git/@master", "./"})

	defer os.RemoveAll("dir")

	err := r.Command.Execute()
	if !assert.Error(t, err) {
		return
	}
	assert.Contains(t, err.Error(), "'/real/dir' does not appear to be a git repository")
}

// NoOpRunE is a noop function to replace the run function of a command.  Useful for testing argument parsing.
var NoOpRunE = func(cmd *cobra.Command, args []string) error { return nil }

// NoOpFailRunE causes the test to fail if run is called.  Useful for validating run isn't called for
// errors.
type NoOpFailRunE struct {
	t *testing.T
}

func (t NoOpFailRunE) runE(cmd *cobra.Command, args []string) error {
	assert.Fail(t.t, "run should not be called")
	return nil
}

// TestCmd_Execute_flagAndArgParsing verifies that the flags and args are parsed into the correct Command fields
func TestCmd_Execute_flagAndArgParsing(t *testing.T) {
	var pathPrefix string
	if runtime.GOOS == "darwin" {
		pathPrefix = "/private"
	}

	_, w, clean := testutil.SetupRepoAndWorkspace(t, testutil.Content{
		Data:   testutil.Dataset1,
		Branch: "master",
	})
	defer clean()

	defer testutil.Chdir(t, w.WorkspaceDirectory)()

	failRun := NoOpFailRunE{t: t}.runE

	testCases := map[string]struct {
		argsFunc    func(repo, dir string) []string
		runE        func(*cobra.Command, []string) error
		validations func(repo, dir string, r *get.Runner, err error)
	}{
		"must have at least 1 arg": {
			argsFunc: func(repo, _ string) []string {
				return []string{}
			},
			runE: failRun,
			validations: func(_, _ string, r *get.Runner, err error) {
				assert.EqualError(t, err, "requires at least 1 arg(s), only received 0")
			},
		},
		"must provide unambiguous repo, dir and version": {
			argsFunc: func(repo, _ string) []string {
				return []string{"foo", "bar", "baz"}
			},
			runE: failRun,
			validations: func(_, _ string, r *get.Runner, err error) {
				assert.Error(t, err)
				assert.Contains(t, err.Error(), "ambiguous repo/dir@version specify '.git' in argument")
			},
		},
		"repo arg is split up correctly into ref and repo": {
			argsFunc: func(repo, _ string) []string {
				return []string{"something://foo.git/@master", "./"}
			},
			runE: NoOpRunE,
			validations: func(_, _ string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, "master", r.Get.Git.Ref)
				assert.Equal(t, "something://foo", r.Get.Git.Repo)
				assert.Equal(t, filepath.Join(pathPrefix, w.WorkspaceDirectory, "foo"), r.Get.Destination)
			},
		},
		"repo arg is split up correctly into ref, directory and repo": {
			argsFunc: func(repo, _ string) []string {
				return []string{fmt.Sprintf("file://%s.git/blueprints/java", repo), "."}
			},
			runE: NoOpRunE,
			validations: func(repo, _ string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, fmt.Sprintf("file://%s", repo), r.Get.Git.Repo)
				assert.Equal(t, "master", r.Get.Git.Ref)
				assert.Equal(t, "/blueprints/java", r.Get.Git.Directory)
				assert.Equal(t, filepath.Join(pathPrefix, w.WorkspaceDirectory, "java"), r.Get.Destination)
			},
		},
		"current working dir -- should use package name": {
			argsFunc: func(repo, _ string) []string {
				return []string{fmt.Sprintf("file://%s.git/blueprints/java", repo), "foo/../bar/../"}
			},
			runE: NoOpRunE,
			validations: func(repo, _ string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, fmt.Sprintf("file://%s", repo), r.Get.Git.Repo)
				assert.Equal(t, "master", r.Get.Git.Ref)
				assert.Equal(t, "/blueprints/java", r.Get.Git.Directory)
				assert.Equal(t, filepath.Join(pathPrefix, w.WorkspaceDirectory, "java"), r.Get.Destination)
			},
		},
		"clean relative path": {
			argsFunc: func(repo, _ string) []string {
				return []string{fmt.Sprintf("file://%s.git/blueprints/java", repo), "./foo/../bar/../baz"}
			},
			runE: NoOpRunE,
			validations: func(repo, _ string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, fmt.Sprintf("file://%s", repo), r.Get.Git.Repo)
				assert.Equal(t, "master", r.Get.Git.Ref)
				assert.Equal(t, "/blueprints/java", r.Get.Git.Directory)
				assert.Equal(t, filepath.Join(pathPrefix, w.WorkspaceDirectory, "baz"), r.Get.Destination)
			},
		},
		"clean absolute path": {
			argsFunc: func(repo, _ string) []string {
				return []string{fmt.Sprintf("file://%s.git/blueprints/java", repo), "/foo/../bar/../baz"}
			},
			runE: NoOpRunE,
			validations: func(repo, _ string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, fmt.Sprintf("file://%s", repo), r.Get.Git.Repo)
				assert.Equal(t, "master", r.Get.Git.Ref)
				assert.Equal(t, "/blueprints/java", r.Get.Git.Directory)
				assert.Equal(t, "/baz", r.Get.Destination)
			},
		},
		"provide an absolute destination directory": {
			argsFunc: func(repo, dir string) []string {
				return []string{fmt.Sprintf("file://%s.git", repo), filepath.Join(dir, "my-app")}
			},
			runE: NoOpRunE,
			validations: func(repo, dir string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, fmt.Sprintf("file://%s", repo), r.Get.Git.Repo)
				assert.Equal(t, "master", r.Get.Git.Ref)
				assert.Equal(t, filepath.Join(dir, "my-app"), r.Get.Destination)
			},
		},
		"package in a subdirectory": {
			argsFunc: func(repo, dir string) []string {
				return []string{fmt.Sprintf("file://%s.git/baz", repo), filepath.Join(dir, "my-app")}
			},
			runE: NoOpRunE,
			validations: func(repo, dir string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, fmt.Sprintf("file://%s", repo), r.Get.Git.Repo)
				assert.Equal(t, "/baz", r.Get.Git.Directory)
				assert.Equal(t, "master", r.Get.Git.Ref)
				assert.Equal(t, filepath.Join(dir, "my-app"), r.Get.Destination)
			},
		},
		"package in a subdirectory at a specific ref": {
			argsFunc: func(repo, dir string) []string {
				return []string{fmt.Sprintf("file://%s.git/baz@v1", repo), filepath.Join(dir, "my-app")}
			},
			runE: NoOpRunE,
			validations: func(repo, dir string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, fmt.Sprintf("file://%s", repo), r.Get.Git.Repo)
				assert.Equal(t, "/baz", r.Get.Git.Directory)
				assert.Equal(t, "v1", r.Get.Git.Ref)
				assert.Equal(t, filepath.Join(dir, "my-app"), r.Get.Destination)
			},
		},
		"provided directory already exists": {
			argsFunc: func(repo, dir string) []string {
				return []string{fmt.Sprintf("file://%s.git", repo), filepath.Join(dir, "package")}
			},
			runE: NoOpRunE,
			validations: func(repo, dir string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, fmt.Sprintf("file://%s", repo), r.Get.Git.Repo)
				assert.Equal(t, "master", r.Get.Git.Ref)
				assert.Equal(t, filepath.Join(dir, "package"), r.Get.Destination)
			},
		},
		"invalid repo": {
			argsFunc: func(repo, dir string) []string {
				return []string{"/", filepath.Join(dir, "package", "my-app")}
			},
			runE: failRun,
			validations: func(repo, dir string, r *get.Runner, err error) {
				assert.Error(t, err)
				assert.Contains(t, err.Error(), "specify '.git'")
			},
		},
		"valid strategy provided": {
			argsFunc: func(repo, dir string) []string {
				return []string{fmt.Sprintf("file://%s.git", repo), filepath.Join(dir, "package"), "--strategy=fast-forward"}
			},
			runE: NoOpRunE,
			validations: func(repo, dir string, r *get.Runner, err error) {
				assert.NoError(t, err)
				assert.Equal(t, fmt.Sprintf("file://%s", repo), r.Get.Git.Repo)
				assert.Equal(t, "master", r.Get.Git.Ref)
				assert.Equal(t, filepath.Join(dir, "package"), r.Get.Destination)
				assert.Equal(t, kptfilev1.FastForward, r.Get.UpdateStrategy)
			},
		},
		"invalid strategy provided": {
			argsFunc: func(repo, dir string) []string {
				return []string{fmt.Sprintf("file://%s.git", repo), filepath.Join(dir, "package"), "--strategy=does-not-exist"}
			},
			runE: failRun,
			validations: func(repo, dir string, r *get.Runner, err error) {
				assert.Error(t, err)
				assert.Contains(t, err.Error(), "unknown update strategy \"does-not-exist\"")
			},
		},
	}

	for tn, tc := range testCases {
		t.Run(tn, func(t *testing.T) {
			g, w, clean := testutil.SetupRepoAndWorkspace(t, testutil.Content{
				Data:   testutil.Dataset1,
				Branch: "master",
			})
			defer clean()

			r := get.NewRunner(fake.CtxWithDefaultPrinter(), "kpt")
			r.Command.SilenceErrors = true
			r.Command.SilenceUsage = true
			r.Command.RunE = tc.runE
			r.Command.SetArgs(tc.argsFunc(g.RepoDirectory, w.WorkspaceDirectory))
			err := r.Command.Execute()
			tc.validations(g.RepoDirectory, w.WorkspaceDirectory, r, err)
		})
	}
}

func TestCmd_flagAndArgParsing_Symlink(t *testing.T) {
	dir := t.TempDir()
	defer testutil.Chdir(t, dir)()

	err := os.MkdirAll(filepath.Join(dir, "path", "to", "pkg", "dir"), 0700)
	assert.NoError(t, err)
	err = os.Symlink(filepath.Join("path", "to", "pkg", "dir"), "link")
	assert.NoError(t, err)

	r := get.NewRunner(fake.CtxWithDefaultPrinter(), "kpt")
	r.Command.RunE = NoOpRunE
	r.Command.SetArgs([]string{"file://foo.git" + "@refs/heads/foo", "link"})
	err = r.Command.Execute()
	assert.NoError(t, err)
	cwd, err := os.Getwd()
	assert.NoError(t, err)
	assert.Equal(t, filepath.Join(cwd, "path", "to", "pkg", "dir", "foo"), r.Get.Destination)

	// make the link broken by deleting the dir
	err = os.RemoveAll(filepath.Join("path", "to", "pkg", "dir"))
	assert.NoError(t, err)
	r = get.NewRunner(fake.CtxWithDefaultPrinter(), "kpt")
	r.Command.RunE = NoOpRunE
	r.Command.SetArgs([]string{"file://foo.git" + "@refs/heads/foo", "link"})
	err = r.Command.Execute()
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "no such file or directory")
}


text:
    {{cellmodel.evaluator}}
    ({{cellmodel.lineCount}} lines)

    <bk-language-logo
        ng-if="!cellmodel.input.hidden"
        bg-color="{{getEvaluator().bgColor}}"
        fg-color="{{getEvaluator().fgColor}}"
        border-color="{{getEvaluator().borderColor}}">{{getEvaluator().shortName}}</bk-language-logo>

Initializing {{cellmodel.evaluator}}

  [Debug]: cell Id = {{cellmodel.id}}, parent = {{getParentId()}}, level = {{cellmodel.level}}
  show more
  show less

{{cellmodel | json}}

  <bk-cell-menu items="cellview.menu.items"></bk-cell-menu>
  <bk-new-cell-menu config="newCellMenuConfig" ng-if="newCellMenuConfig.isShow()"></bk-new-cell-menu>


text:
.. Metafunctions/Type Selection//if_c |20

if_c
====

Synopsis
--------

.. parsed-literal::

    template<
          bool c
        , typename T1
        , typename T2
        >
    struct if_c
    {
        typedef |unspecified| type;
    };

Description
-----------

Returns one of its two arguments, ``T1`` or ``T2``, depending on the value of
integral constant ``c``. ``if_c<c,t1,t2>::type`` is a shorcut notation for
``if_< bool_<c>,t1,t2 >::type``.

Header
------

.. parsed-literal::

    #include <boost/mpl/if.hpp>

Parameters
----------

+---------------+-----------------------------------+-----------------------------------------------+
| Parameter     | Requirement                       | Description                                   |
+===============+===================================+===============================================+
| ``c``         | An integral constant              | A selection condition.                        |
+---------------+-----------------------------------+-----------------------------------------------+
| ``T1``, ``T2``| Any type                          | Types to select from.                         |
+---------------+-----------------------------------+-----------------------------------------------+

Expression semantics
--------------------

For any integral constant ``c`` and arbitrary types ``t1``, ``t2``:

.. parsed-literal::

    typedef if_c<c,t1,t2>::type t;

:Return type:
    Any type.

:Semantics:
    Equivalent to ``typedef if_< bool_<c>,t1,t2 >::type t;``

Example
-------

.. parsed-literal::

    typedef if_c<true,char,long>::type t1;
    typedef if_c<false,char,long>::type t2;

    BOOST_MPL_ASSERT(( is_same<t1, char> ));
    BOOST_MPL_ASSERT(( is_same<t2, long> ));

.. parsed-literal::

    // allocates space for an object of class T on heap or "inplace"
    // depending on its size
    template< typename T > struct lightweight
    {
        // ...
        typedef typename if_c<
              sizeof(T) <= sizeof(T*)
            , inplace_storage<T>
            , heap_storage<T>
            >::type impl_t;

        impl_t impl;
    };

See also
--------

|Metafunctions|, |Integral Constant|, |if_|, |eval_if|, |bool_|

.. copyright:: Copyright ©  2001-2009 Aleksey Gurtovoy and David Abrahams
   Distributed under the Boost Software License, Version 1.0. (See accompanying
   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
#if !defined(SSL_CALLS_H)
#define SSL_CALLS_H

#include "arch.h"

int
ssl_init(void);
int
ssl_finish(void);
void* APP_CC
ssl_rc4_info_create(void);
void APP_CC
ssl_rc4_info_delete(void* rc4_info);
void APP_CC
ssl_rc4_set_key(void* rc4_info, char* key, int len);
void APP_CC
ssl_rc4_crypt(void* rc4_info, char* data, int len);
void* APP_CC
ssl_sha1_info_create(void);
void APP_CC
ssl_sha1_info_delete(void* sha1_info);
void APP_CC
ssl_sha1_clear(void* sha1_info);
void APP_CC
ssl_sha1_transform(void* sha1_info, const char *data, int len);
void APP_CC
ssl_sha1_complete(void* sha1_info, char* data);
void* APP_CC
ssl_md5_info_create(void);
void APP_CC
ssl_md5_info_delete(void* md5_info);
void APP_CC
ssl_md5_clear(void* md5_info);
void APP_CC
ssl_md5_transform(void* md5_info, char* data, int len);
void APP_CC
ssl_md5_complete(void* md5_info, char* data);
void *APP_CC
ssl_des3_encrypt_info_create(const char *key, const char* ivec);
void *APP_CC
ssl_des3_decrypt_info_create(const char *key, const char* ivec);
void APP_CC
ssl_des3_info_delete(void *des3);
int APP_CC
ssl_des3_encrypt(void *des3, int length, const char *in_data, char *out_data);
int APP_CC
ssl_des3_decrypt(void *des3, int length, const char *in_data, char *out_data);
void * APP_CC
ssl_hmac_info_create(void);
void APP_CC
ssl_hmac_info_delete(void *hmac);
void APP_CC
ssl_hmac_sha1_init(void *hmac, const char *data, int len);
void APP_CC
ssl_hmac_transform(void *hmac, const char *data, int len);
void APP_CC
ssl_hmac_complete(void *hmac, char *data, int len);
int APP_CC
ssl_mod_exp(char* out, int out_len, char* in, int in_len,
            char* mod, int mod_len, char* exp, int exp_len);
int APP_CC
ssl_gen_key_xrdp1(int key_size_in_bits, char* exp, int exp_len,
                  char* mod, int mod_len, char* pri, int pri_len);

/* ssl_tls */
struct ssl_tls
{
    struct ssl_st *ssl; /* SSL * */
    struct ssl_ctx_st *ctx; /* SSL_CTX * */
    char *cert;
    char *key;
    struct trans *trans;
    tintptr rwo; /* wait obj */
};

/* xrdp_tls.c */
struct ssl_tls *APP_CC
ssl_tls_create(struct trans *trans, const char *key, const char *cert);
int APP_CC
ssl_tls_accept(struct ssl_tls *self, int disableSSLv3,
               const char *tls_ciphers);
int APP_CC
ssl_tls_disconnect(struct ssl_tls *self);
void APP_CC
ssl_tls_delete(struct ssl_tls *self);
int APP_CC
ssl_tls_read(struct ssl_tls *tls, char *data, int length);
int APP_CC
ssl_tls_write(struct ssl_tls *tls, const char *data, int length);
int APP_CC
ssl_tls_can_recv(struct ssl_tls *tls, int sck, int millis);

#endif


text:
package org.jbb.members.api.registration;

import java.util.Set;

import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;

public class RegistrationException extends ConstraintViolationException { // NOSONAR
// (This class has 6 parents which is greater than 5 authorized.)

    public RegistrationException(Set<? extends ConstraintViolation<?>> violations) {
        super(violations);
    }
}


text:
layout: page
title: "Matt Wedel"
comments: true
description: "blanks"
keywords: "Matt Wedel,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Arts and Sciences

**Classes taught**: ARTS 2085, ARTS 2095

#### ARTS 2085: Ceramics 2: Handbuilding

**Terms taught**: Fall 2011

**Instructor rating**: 5.46

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 3.65

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 4.17

**Standard deviation in workload** (raw): 0.0

#### ARTS 2095: Ceramics 2: Wheelthrowing

**Terms taught**: Fall 2011

**Instructor rating**: 5.57

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 3.54

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 4.14

**Standard deviation in workload** (raw): 0.0


text:
SMSH
====
SSH via SMS written in NodeJS!  Made possible through use of Twilio or SendHub.  SMSH can run on any public facing server (listening on port 1337) or by use of [ngrok](https://ngrok.com/).

Installation
---
First clone the repo:

`git clone https://github.com/strix/smsh.git`

`cd smsh`

Then run `npm install` to install the dependencies(Note: NodeJS must be installed)

Twilio
---
If you haven't already, sign up and set up you [Twilio](https://www.twilio.com/) account (it will guide you through the basic setup upon signing up).  After signing up, you should receive an AccountSID and an AuthToken (found under Account --> Dev Tools --> Test Credentials) and also your Twilio number.  These will be used when you run `config.js` (see below).  Also make sure to go to Account --> Numbers --> Twilio Numbers --> and change the URL under SMS & MMS to your public facing one.

Setup the config file by running:

`node config.js twilio`

After that, start the service:

`node twilio.js`

Now when you send messages to your Twilio number with your password at the beginning of the message (Ex: Password echo "hello world"), you will get texted back the output of that command (Ex. hello world).

SendHub
---
**Note: SendHub functionality has not been maintained for a while now.  It should still work but no guarantees.**

This can send and receive messages locally for testing purposes.

Setup the config file by running:

`node config.js sendhub`

After that, start the service:

`node sendhub.js`

Security
---
So far there is sort of a two factor auth system built in.  When you run `config.js`, It will ask you for a password (which will need to be added at the beginning of each message sent to your server) and also a space-separated list of allowed phone numbers.  This way, you'll only be compromised if someone sent the messages from your phone and knew the password.


text:
<?php

namespace Chamilo\Core\Repository\Component;

use Chamilo\Core\Repository\Common\Import\ContentObjectImportService;
use Chamilo\Core\Repository\Common\Import\Factory\ImportFactories;
use Chamilo\Core\Repository\Manager;
use Chamilo\Core\Repository\Workspace\Service\ContentObjectRelationService;
use Chamilo\Core\Repository\Workspace\Service\RightsService;
use Chamilo\Libraries\Architecture\Exceptions\NotAllowedException;
use Chamilo\Libraries\Format\Structure\Breadcrumb;
use Chamilo\Libraries\Format\Structure\BreadcrumbTrail;
use Chamilo\Libraries\Translation\Translation;
use Chamilo\Libraries\Utilities\StringUtilities;

/**
 *
 * @package repository.lib.repository_manager.component
 */
class ImporterComponent extends Manager
{

    /**
     * Runs this component and displays its output.
     */
    public function run()
    {
        if (!RightsService::getInstance()->canAddContentObjects($this->get_user(), $this->getWorkspace()))
        {
            throw new NotAllowedException();
        }

        $type = $this->getRequest()->getFromUrl(self::PARAM_IMPORT_TYPE, 'cpo');
        $importFactory = $this->getImportFactories()->getImportFactoryByAlias($type);

        $contentObjectImportService = new ContentObjectImportService(
            $importFactory, $type, $this->getWorkspace(), $this
        );

        if ($contentObjectImportService->hasFinished())
        {
            // Session :: register(self :: PARAM_MESSAGES, $controller->get_messages_for_url());
            $this->simple_redirect(array(self::PARAM_ACTION => self::ACTION_BROWSE_CONTENT_OBJECTS));
        }
        else
        {
            BreadcrumbTrail::getInstance()->add(
                new Breadcrumb(
                    $this->get_url(),
                    Translation::get(
                        'ImportType',
                        array(
                            'TYPE' => Translation::get(
                                'ImportType' . StringUtilities::getInstance()->createString($type)->upperCamelize(),
                                [], $importFactory->getImportContext()
                            )
                        )
                    )
                )
            );

            $html = array();

            $html[] = $this->render_header();
            $html[] = $contentObjectImportService->renderForm();
            $html[] = $this->render_footer();

            return implode(PHP_EOL, $html);
        }

        return null;
    }

    public function get_additional_parameters($additionalParameters = array())
    {
        return parent::get_additional_parameters([self::PARAM_IMPORT_TYPE]);
    }

    /**
     * @return ContentObjectRelationService
     */
    protected function getContentObjectRelationService()
    {
        return $this->getService(ContentObjectRelationService::class);
    }

    /**
     * @return ImportFactories
     */
    protected function getImportFactories()
    {
        return $this->getService(ImportFactories::class);
    }
}


text:
static UserDefaultsUtil *userDefaultsUtil;

NSUserDefaults *userDefaults;

@implementation UserDefaultsUtil

+ (UserDefaultsUtil *)instance {
    @synchronized (self) {
        if (userDefaultsUtil == nil) {
            userDefaultsUtil = [[self alloc] init];
            userDefaults = [NSUserDefaults standardUserDefaults];
        }
    }
    return userDefaultsUtil;
}

- (NSInteger)getLastVersion {
    return [userDefaults integerForKey:USER_DEFAULT_LAST_VER];
}

- (void)setLastVersion:(NSInteger)version {
    [userDefaults setInteger:version forKey:USER_DEFAULT_LAST_VER];
    [userDefaults synchronize];
}

- (MarketType)getDefaultMarket {
    if (![userDefaults objectForKey:DEFAULT_MARKET]) {
        [self setDefaultMarket];
    }
    return [self getMarket];
}

- (MarketType)getMarket {
    NSInteger market = [userDefaults integerForKey:DEFAULT_MARKET];
    return [GroupUtil getMarketType:market];
}

- (void)setDefaultMarket {
    if ([self localeIsChina]) {
        [self setMarket:BTCCHINA];
    } else {
        [self setMarket:BITSTAMP];
    }

}

- (void)setMarket:(MarketType)marketType {
    [userDefaults setInteger:[GroupUtil getMarketValue:marketType] forKey:DEFAULT_MARKET];
    [userDefaults synchronize];
    [[GroupUserDefaultUtil instance] setDefaultMarket:marketType];
}

- (void)setExchangeType:(Currency)exchangeType {
    [userDefaults setInteger:exchangeType forKey:DEFAULT_EXCHANGE_RATE];
    [userDefaults synchronize];
    [[GroupUserDefaultUtil instance] setDefaultCurrency:(GroupCurrency) exchangeType];
}

- (Currency)getDefaultCurrency {
    NSInteger type = [self getExchangeType];
    if (type == -1) {
        [self setDefaultExchangeType];
    }
    return [self getExchangeType];
}

- (void)setDefaultExchangeType {

    if ([self localeIsChina]) {
        [self setExchangeType:CNY];
    } else {
        [self setExchangeType:USD];
    }
}

- (BOOL)localeIsChina {
    NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
    return [language isEqualToString:@"zh-Hans"];
}

- (BOOL)localeIsZHHant {
    NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
    return [language isEqualToString:@"zh-Hant"];
}

- (NSInteger)getExchangeType {
    if ([userDefaults objectForKey:DEFAULT_EXCHANGE_RATE]) {
        return [userDefaults integerForKey:DEFAULT_EXCHANGE_RATE];
    } else {
        return -1;
    }
}

- (long long)getLastCheckPrivateKeyTime {
    return [[userDefaults objectForKey:LAST_CHECK_PRIVATE_KEY_TIME] longLongValue];
}

- (void)setLastCheckPrivateKeyTime:(long long)time {
    [userDefaults setObject:[NSNumber numberWithLongLong:time] forKey:LAST_CHECK_PRIVATE_KEY_TIME];
    [userDefaults synchronize];
}

- (long long)getLastBackupKeyTime {
    return [[userDefaults objectForKey:LAST_BACK_UP_PRIVATE_KEY_TIME] longLongValue];
}

- (void)setLastBackupKeyTime:(long long)time {
    [userDefaults setObject:[NSNumber numberWithLongLong:time] forKey:LAST_BACK_UP_PRIVATE_KEY_TIME];
    [userDefaults synchronize];
}

- (BOOL)hasPrivateKey {
    return [userDefaults boolForKey:HAS_PRIVATE_KEY];
}

- (void)setHasPrivateKey:(BOOL)hasPrivateKey {
    [userDefaults setBool:hasPrivateKey forKey:HAS_PRIVATE_KEY];
    [userDefaults synchronize];
}

- (BOOL)getSyncBlockOnlyWifi {
    return [userDefaults boolForKey:SYNC_BLOCK_ONLY_WIFI];
}

- (void)setSyncBlockOnlyWifi:(BOOL)onlyWifi {
    [userDefaults setBool:onlyWifi forKey:SYNC_BLOCK_ONLY_WIFI];
    [userDefaults synchronize];
}

- (BOOL)getDownloadSpvFinish {
    return [userDefaults boolForKey:DOWNLOAD_SPV_FINISH];
}

- (void)setDownloadSpvFinish:(BOOL)finish {
    [userDefaults setBool:finish forKey:DOWNLOAD_SPV_FINISH];
    [userDefaults synchronize];
}

- (BTPasswordSeed *)getPasswordSeedForOldVersion {
    NSString *str = [userDefaults stringForKey:PASSWORD_SEED];
    if ([StringUtil isEmpty:str]) {
        return nil;
    }
    return [[BTPasswordSeed alloc] initWithString:str];
}

- (void)setPasswordSeed:(BTPasswordSeed *)passwordSeed {
    [userDefaults setValue:[passwordSeed toPasswordSeedString] forKey:PASSWORD_SEED];
    [userDefaults synchronize];

}

- (TransactionFeeMode)getTransactionFeeMode {
    if ([userDefaults objectForKey:TRANSACTION_FEE_MODE]) {
        if ([userDefaults integerForKey:TRANSACTION_FEE_MODE] == Low) {
            return Low;
        } else if ([userDefaults integerForKey:TRANSACTION_FEE_MODE] == High) {
            return High;
        } else {
            return Normal;
        }
    } else {
        return Normal;
    }
}

- (void)setTransactionFeeMode:(TransactionFeeMode)feeMode {
    if (!feeMode) {
        feeMode = Normal;
    }
    [userDefaults setInteger:feeMode forKey:TRANSACTION_FEE_MODE];
    [userDefaults synchronize];
}

- (BOOL)hasUserAvatar {
    return [StringUtil isEmpty:[self getUserAvatar]];

}

- (NSString *)getUserAvatar {
    return [userDefaults stringForKey:USER_AVATAR];
}

- (void)setUserAvatar:(NSString *)avatar {
    [userDefaults setObject:avatar forKey:USER_AVATAR];
    [userDefaults synchronize];
}

- (NSInteger)getQrCodeTheme {
    NSInteger index = [userDefaults integerForKey:FANCY_QR_CODE_THEME];
    if (index < 0) {
        index = 0;
    }
    if (index >= [QRCodeTheme themes].count) {
        index = [QRCodeTheme themes].count - 1;
    }
    if (index != [GroupUserDefaultUtil instance].getQrCodeTheme) {
        [[GroupUserDefaultUtil instance] setQrCodeTheme:index];
    }
    return index;
}

- (void)setQrCodeTheme:(NSInteger)qrCodeTheme {
    [userDefaults setInteger:qrCodeTheme forKey:FANCY_QR_CODE_THEME];
    [userDefaults synchronize];
    [[GroupUserDefaultUtil instance] setQrCodeTheme:qrCodeTheme];
}

- (void)setBitcoinUnit:(BitcoinUnit)bitcoinUnit {
    [userDefaults setInteger:bitcoinUnit forKey:BITCOIN_UNIT];
    [userDefaults synchronize];
    [[GroupUserDefaultUtil instance] setDefaultBitcoinUnit:(GroupBitcoinUnit) bitcoinUnit];
}

- (BitcoinUnit)getBitcoinUnit {
    if ([userDefaults objectForKey:BITCOIN_UNIT]) {
        return [userDefaults integerForKey:BITCOIN_UNIT];
    }
    return UnitBTC;
}

- (void)setPinCode:(NSString *)code {
    if (!code || code.length == 0) {
        [self deletePinCode];
        return;
    }
    NSUInteger salt;
    NSData *randomBytes = [NSData randomWithSize:sizeof(salt)];
    [randomBytes getBytes:&salt length:sizeof(salt)];

    NSString *beforeHashStr = [NSString stringWithFormat:@"%@%lu", code, (unsigned long) salt];

    [userDefaults setObject:[NSString stringWithFormat:@"%lu;%lu", salt, [beforeHashStr hash]] forKey:PIN_CODE];
    [userDefaults synchronize];
}

- (BOOL)hasPinCode {
    NSString *hash = [userDefaults objectForKey:PIN_CODE];
    if (!hash || hash.length == 0) {
        return NO;
    }
    NSArray *strs = [hash componentsSeparatedByString:@";"];
    if (strs.count != 2) {
        [self deletePinCode];
        return NO;
    }
    return YES;
}

- (void)deletePinCode {
    [userDefaults removeObjectForKey:PIN_CODE];
    [userDefaults synchronize];
}

- (BOOL)checkPinCode:(NSString *)code {
    if ([self hasPinCode]) {
        NSString *hash = [userDefaults objectForKey:PIN_CODE];
        NSArray *strs = [hash componentsSeparatedByString:@";"];
        NSString *saltStr = strs[0];
        hash = strs[1];
        NSString *codeHash = [NSString stringWithFormat:@"%@%@", code, saltStr];
        return [StringUtil compareString:hash compare:[NSString stringWithFormat:@"%lu", [codeHash hash]]];
    } else {
        return YES;
    }
}

- (KeychainMode)getKeychainMode {
    if ([userDefaults objectForKey:KEYCHAIN_MODE]) {
        if ([userDefaults integerForKey:KEYCHAIN_MODE] == Off) {
            return Off;
        } else {
            return On;
        }
    } else {
        return Off;
    }
}

- (void)setKeychainMode:(KeychainMode)keychainMode {
    if (!keychainMode) {
        keychainMode = Off;
    }
    [userDefaults setInteger:keychainMode forKey:KEYCHAIN_MODE];
    [userDefaults synchronize];
}

- (void)setPasswordStrengthCheck:(BOOL)check {
    [userDefaults setBool:check forKey:PASSWORD_STRENGTH_CHECK];
    [userDefaults synchronize];
}

- (BOOL)getPasswordStrengthCheck {
    if (![userDefaults objectForKey:PASSWORD_STRENGTH_CHECK]) {
        return YES;
    }
    return [userDefaults boolForKey:PASSWORD_STRENGTH_CHECK];
}

- (void)setPaymentAddress:(NSString *)address {
    if ([BTUtils compareString:address compare:self.paymentAddress]) {
        return;
    }
    if (address) {
        [userDefaults setObject:address forKey:PAYMENT_ADDRESS];
    } else {
        [userDefaults setObject:@"" forKey:PAYMENT_ADDRESS];
    }
    [userDefaults synchronize];
    if ([BTUtils isEmpty:address]) {
        [[GroupUserDefaultUtil instance] setPaymentAddress:nil];
    } else {
        [[GroupUserDefaultUtil instance] setPaymentAddress:address];
    }
}

- (NSString *)paymentAddress {
    return [userDefaults objectForKey:PAYMENT_ADDRESS];
}

- (void)setFirstRunDialogShown:(BOOL)shown {
    [userDefaults setBool:shown forKey:FIRST_RUN_DIALOG_SHOWN];
    [userDefaults synchronize];
}

- (BOOL)firstRunDialogShown {
    return [userDefaults boolForKey:FIRST_RUN_DIALOG_SHOWN];
}

- (TotalBalanceHide)getTotalBalanceHide {
    return [userDefaults integerForKey:TOTAL_BALANCE_HIDE];
}

- (void)setTotalBalanceHide:(TotalBalanceHide)h {
    [userDefaults setInteger:h forKey:TOTAL_BALANCE_HIDE];
    [userDefaults synchronize];
}

@end


text:
require "spec_helper"

describe SalsaLabs::SalsaObject do

  let(:attributes) do
    {
      "description" => "A depiction of a description",
      "organization_key" => "456"
    }
  end

  let(:salsa_object) { SalsaLabs::SalsaObject.new(attributes) }

  describe "#attributes" do
    it "returns the hash used to construct the object" do
      expect(salsa_object.attributes).to eq(attributes)
    end
  end

  describe "#organization_key" do
    it "returns the organization_key attribute as an integer" do
      expect(salsa_object.organization_key).to eq(456)
    end
  end

end


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.DesignerAttribute;

namespace Microsoft.CodeAnalysis.Remote
{
    internal sealed partial class RemoteDesignerAttributeIncrementalAnalyzer : AbstractDesignerAttributeIncrementalAnalyzer
    {
        /// <summary>
        /// Channel back to VS to inform it of the designer attributes we discover.
        /// </summary>
        private readonly RemoteCallback<IRemoteDesignerAttributeDiscoveryService.ICallback> _callback;
        private readonly RemoteServiceCallbackId _callbackId;

        public RemoteDesignerAttributeIncrementalAnalyzer(RemoteCallback<IRemoteDesignerAttributeDiscoveryService.ICallback> callback, RemoteServiceCallbackId callbackId)
        {
            _callback = callback;
            _callbackId = callbackId;
        }

        protected override async ValueTask ReportProjectRemovedAsync(ProjectId projectId, CancellationToken cancellationToken)
        {
            await _callback.InvokeAsync(
                (callback, cancellationToken) => callback.OnProjectRemovedAsync(_callbackId, projectId, cancellationToken),
                cancellationToken).ConfigureAwait(false);
        }

        protected override async ValueTask ReportDesignerAttributeDataAsync(ImmutableArray<DesignerAttributeData> data, CancellationToken cancellationToken)
        {
            await _callback.InvokeAsync(
               (callback, cancellationToken) => callback.ReportDesignerAttributeDataAsync(_callbackId, data, cancellationToken),
               cancellationToken).ConfigureAwait(false);
        }
    }
}


text:
package info.tiefenauer;

import com.mongodb.MongoClient;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.model.UpdateOptions;
import org.bson.Document;

import java.util.ArrayList;

import static com.mongodb.client.model.Filters.eq;
import static com.mongodb.client.model.Filters.gt;
import static com.mongodb.client.model.Filters.gte;
import static com.mongodb.client.model.Updates.combine;
import static com.mongodb.client.model.Updates.inc;
import static com.mongodb.client.model.Updates.set;
import static info.tiefenauer.Helpers.printJson;

/**
 * Created by Daniel on 01.04.2016.
 */
public class DeleteTest {

    public static void main(String[] args) {
        MongoClient client = new MongoClient();
        MongoDatabase db = client.getDatabase("course");
        MongoCollection<Document> collection = db.getCollection("test");

        collection.drop();

        // insert 8 documents with both _id and x set to the value of the loop variable
        for (int i = 0; i < 8; i++) {
            collection.insertOne(new Document().append("_id", i));
        }

        collection.deleteOne(eq("_id", 2));
        collection.deleteMany(gt("_id", 4));

        for (Document cur : collection.find().into(new ArrayList<Document>())) {
            printJson(cur);
        }
    }
}


text:
package com.thoughtworks.go.apiv2.stageoperations;

import com.thoughtworks.go.api.ApiController;
import com.thoughtworks.go.api.ApiVersion;
import com.thoughtworks.go.api.spring.ApiAuthenticationHelper;
import com.thoughtworks.go.server.service.PipelineService;
import com.thoughtworks.go.server.service.ScheduleService;
import com.thoughtworks.go.server.service.result.HttpOperationResult;
import com.thoughtworks.go.spark.Routes;
import com.thoughtworks.go.spark.spring.SparkSpringController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import spark.Request;
import spark.Response;

import java.io.IOException;
import java.util.Optional;

import static com.thoughtworks.go.api.util.HaltApiResponses.haltBecauseOfReason;
import static spark.Spark.*;

@Component
public class StageOperationsControllerV2 extends ApiController implements SparkSpringController {
    private static final Logger LOGGER = LoggerFactory.getLogger(StageOperationsControllerV2.class);

    private final ScheduleService scheduleService;
    private final ApiAuthenticationHelper apiAuthenticationHelper;
    private final PipelineService pipelineService;

    @Autowired
    public StageOperationsControllerV2(ScheduleService scheduleService, ApiAuthenticationHelper apiAuthenticationHelper, PipelineService pipelineService) {
        super(ApiVersion.v2);
        this.scheduleService = scheduleService;
        this.apiAuthenticationHelper = apiAuthenticationHelper;
        this.pipelineService = pipelineService;
    }

    @Override
    public String controllerBasePath() {
        return Routes.Stage.BASE;
    }

    @Override
    public void setupRoutes() {
        path(controllerPath(), () -> {
            before("", mimeType, this::setContentType);
            before("/*", mimeType, this::setContentType);
            before("", mimeType, this::verifyContentType);
            before("/*", mimeType, this::verifyContentType);

            before(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateOfPipelineOrGroupInURLUserAnd403);

            post(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, this::triggerStage);
        });
    }

    public String triggerStage(Request req, Response res) throws IOException {
        String pipelineName = req.params("pipeline_name");
        String pipelineCounter = req.params("pipeline_counter");
        String stageName = req.params("stage_name");
        HttpOperationResult result = new HttpOperationResult();

        Optional<Integer> pipelineCounterValue = pipelineService.resolvePipelineCounter(pipelineName, pipelineCounter);
        if (!pipelineCounterValue.isPresent()) {
            String errorMessage = String.format("Error while running [%s/%s/%s]. Received non-numeric pipeline counter '%s'.", pipelineName, pipelineCounter, stageName, pipelineCounter);
            LOGGER.error(errorMessage);
            throw haltBecauseOfReason(errorMessage);
        }

        scheduleService.rerunStage(pipelineName, pipelineCounterValue.get(), stageName, result);
        return renderHTTPOperationResult(result, req, res);
    }
}


text:
package info.jerrinot.subzero.internal.strategy;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.ReferenceResolver;
import info.jerrinot.subzero.UserSerializer;
import org.junit.Test;

import java.lang.reflect.Field;

import static org.junit.Assert.assertEquals;

public class KryoStrategyCustomReferenceResolverTest {

    @SuppressWarnings("unchecked")
    @Test
    public void should_use_strategy_with_specified_reference_resolver() throws Exception {
        // given
        System.setProperty("subzero.referenceresolver.class", "info.jerrinot.subzero.internal.strategy.NullReferenceResolver");
        GlobalKryoStrategy kryoStrategy = new GlobalKryoStrategy(NULL_USER_SERIALIZER);

        // when
        Field field = KryoStrategy.class.getDeclaredField("KRYOS");
        field.setAccessible(true);
        Class<? extends ReferenceResolver> actualClassResolver = ((ThreadLocal<KryoContext>) field.get(kryoStrategy))
                .get().getKryo().getReferenceResolver().getClass();

        // then
        assertEquals(NullReferenceResolver.class, actualClassResolver);
    }

    private static final UserSerializer NULL_USER_SERIALIZER = new UserSerializer() {
        @Override
        public void registerSingleSerializer(Kryo kryo, Class clazz) {
            // do nothing
        }
        @Override
        public void registerAllSerializers(Kryo kryo) {
            // do nothing
        }
    };
}


text:
The log viewer assists in debugging client-side issues by grabbing the log from the VidyoClient SDK through a socket and displaying it in a browser with an easy to read format.

## Usage with VidyoConnector

To use the log viewer with VidyoConnector please follow these steps:

1. Enable Debug in VidyoConnector either through a pull down menu in one of the samples or by calling EnableDebug().
   * EX: in C `VidyoConnectorEnableDebug(c, 7776, "warning all@VidyoClient info@VidyoConnector");`
   * Please take a look at the ReferenceGuide for usage of EnableDebug and possible log filters.
1. Open [VidyoLog.html](https://git.vidyo.io/VidyoLog.html) in a browser.
   * By default, the log viewer will query port `7776` on localhost. This is useful for clients running on the same endpoint.
   * To debug a remote endpoint such as iOS or Android device, point to the IP address of the device. EX: `192.168.1.100:7776`
   * Alternatively the contents of the log file such as `VidyoClient.log` can be pasted into `[Paste the log]` section of the header.
   * The `[log filter` dialog allows the log to be filtered for easy viewing. To reset the filter enter an empty string.