text:
  { \
    ast_t* t = (ast); \
    ASSERT_NE((void*)NULL, t); \
    ASSERT_EQ(expected, ast_id(t)); \
  }

#ifdef PLATFORM_IS_VISUAL_STUDIO
#  define EXPORT_SYMBOL __declspec(dllexport)
#else
#  define EXPORT_SYMBOL
#endif

class PassTest : public testing::Test
{
protected:
  pass_opt_t opt;
  ast_t* program; // AST produced from given source
  ast_t* package; // AST of first package, cache of ast_child(program)
  ast_t* module;  // AST of first module in first package
  compile_t* compile;
  pass_id last_pass;

  virtual void SetUp();
  virtual void TearDown();

  // Override the default builtin source. If NULL, the real builtin package is
  // used
  void set_builtin(const char* src);

  // Add an additional package source
  void add_package(const char* path, const char* src);

  // Override the default path of the main package (useful for package loops)
  void default_package_name(const char* path);

  // Count the number of symbol table references to the specified name in all
  // symbol tables in the given tree
  size_t ref_count(ast_t* ast, const char* name);

  // Check that the 2 given chunks of AST are the same. Siblings of the ASTs
  // are ignored.
  // Errors are checked with ASSERTs, call in ASSERT_NO_FATAL_FAILURE.
  void check_ast_same(ast_t* expect, ast_t* actual);

  // Test methods.
  // These all build the given src code, up to the specified pass, and check
  // the resulting tree as required.
  // On successful build the resulting AST is stored in the program member with
  // the package and module members pointing to the appropriate nodes.
  // These methods all use ASSERTs, call in ASSERT_NO_FATAL_FAILURE.

  // Check that the given source compiles to the specified pass without error
  void test_compile(const char* src, const char* pass);

  // Check that the given source compiles to the specified pass without error.
  // Starts from an AST built in a previous call to test_compile
  void test_compile_resume(const char* src);

  // Check that the given source fails when compiled to the specified pass
  void test_error(const char* src, const char* pass);

  // Check that the given source fails when compiled to the specified pass,
  // that a specific number of errors are produced, and that the errors match
  // expected text, given as a NULL-terminated array of NULL-terminated strings.
  void test_expected_errors(const char* src, const char* pass,
    const char** errors);

  // Performs the same check as test_expected_errors, and alse checks all
  // errors within each error frame, given as a NULL-terminated array of
  // NULL-terminated arrays of additional error messages.
  void test_expected_error_frames(const char* src, const char* pass,
    const char** errors, const char*** frames);

  // Check that the 2 given sources compile to give the same AST for the first
  // package
  void test_equiv(const char* actual_src, const char* actual_pass,
    const char* expect_src, const char* expect_pass);

  // Find the type of the parameter, field or local variable with the specified
  // name in the previously built program.
  // If there are multiple matches the first found will be returned.
  // Returns: type of specified name, NULL if none found.
  ast_t* type_of(const char* name);

  // Lookup the specified name in the symbol table of the given AST node,
  // without checking any symbol tables of outer scopes.
  // Returns: the AST found in the symbol table, NULL if not found.
  ast_t* lookup_in(ast_t* ast, const char* name);

  // Lookup the type with the given name in the loaded previously package.
  // Returns: the AST of the type definition, NULL if not found.
  ast_t* lookup_type(const char* name);

  // Lookup the member with the given name in the type with the given name in
  // the loaded previously package.
  // Returns: the AST of the named definition, NULL if not found.
  ast_t* lookup_member(const char* type_name, const char* member_name);

  // Lookup the first instance of the given integer as a number literal in
  // the previously loaded package
  ast_t* numeric_literal(uint64_t num);

  // Run the compiled program. The program must have been successfully compiled
  // up to the ir pass before calling this function.
  bool run_program(int* exit_code);

private:
  const char* _builtin_src;
  const char* _first_pkg_path;

  // Attempt to compile the package with the specified name into a program.
  // Errors are checked with ASSERTs, call in ASSERT_NO_FATAL_FAILURE.
  void build_package(const char* pass, const char* src,
    const char* package_name, bool check_good, const char** expected_errors,
    bool resume);

  // Find the type of the parameter, field or local variable with the specified
  // name in the given AST.
  // If there are multiple matches the first found will be returned.
  // Returns: type of specified name, NULL if none found.
  ast_t* type_of_within(ast_t* ast, const char* name);

  ast_t* numeric_literal_within(ast_t* ast, uint64_t num);
};

class Environment : public testing::Environment
{
private:
  virtual void SetUp();
  virtual void TearDown();
};

#endif

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <link rel="stylesheet" href="./css/bootstrap.css">
    <link rel="stylesheet" href="./css/calculater.css">

    <title>简易计算器逻辑实现</title>

简易计算器

                    <input type="text" class="form-control" id="outcome">

                        <button class="btn btn-success" id="plus" value="+">+</button>
                        <button class="btn btn-success" id="minus" value="-">-</button>
                        <button class="btn btn-success" id="times" value="*">×</button>
                        <button class="btn btn-success" id="divide" value="/">÷</button>
                        <button class="btn btn-success" id="equal" value="=">=</button>
                        <button class="btn btn-primary" id="clear" onclick="clearValue()">C</button>
                        <button class="btn btn-primary" id="del" value="del">del</button>
                        <button class="btn btn-info" id="zero" value="0">0</button>
                        <button class="btn btn-warning" id="negative" value="+/-">+/-</button>
                        <button class="btn btn-warning" id="percentage" value="%">%</button>
                        <button class="btn btn-info" id="one" value="1">1</button>
                        <button class="btn btn-info" id="two" value="2">2</button>
                        <button class="btn btn-info" id="three" value="3">3</button>
                        <button class="btn btn-warning" id="sqrt" value="sqrt">sqrt</button>
                        <button class="btn btn-warning" id="square" value="square">x2</button>
                        <button class="btn btn-info" id="four" value="4">4</button>
                        <button class="btn btn-info" id="five" value="5">5</button>
                        <button class="btn btn-info" id="six" value="6">6</button>
                        <button class="btn btn-warning" id="sin" value="sin">sin</button>
                        <button class="btn btn-warning" id="cos" value="cos">cos</button>
                        <button class="btn btn-info" id="seven" value="7">7</button>
                        <button class="btn btn-info" id="eight" value="8">8</button>
                        <button class="btn btn-info" id="nine" value="9">9</button>
                        <button class="btn btn-info" id="dot" value=".">.</button>
                        <button class="btn btn-warning" id="pi" value="pi">π</button>


text:
package de.tudarmstadt.ukp.dkpro.argumentation.annotations.filters;

import org.apache.uima.jcas.JCas;

/**
 * Filtering documents in {@link de.tudarmstadt.ukp.dkpro.argumentation.annotations.FilteredDocumentReader}
 *
 * @author Ivan Habernal
 */
public interface DocumentCollectionFilter
{
    /**
     * Returns true, if the document should be removed from the collection
     *
     * @param jCas jcas
     * @return boolean
     */
    boolean removeFromCollection(JCas jCas);

    /**
     * Returns true, if this filter should be applied in general (e.g. might be empty which saves
     * time)
     *
     * @return boolean
     */
    boolean applyFilter();
}


text:
body {
	padding: 20px 10px;
  font-family: times new roman;
	max-width: 2000px;
	font-size: 1.4em;
  background-color: teal;
}
h1 {
  font-family: courier;
	text-align: center;
	color: white;
}

h2 {
  background-color: grey;
  text-align: center;
	margin: auto;
  border: 1px solid white;
  color: white;
}
h3 {
  font-family: courier;
  text-align: left;
  margin: auto;
  background-color: blue;
  color: black;
}

.notes {
  background-color: green;
  color: white;
  border: 1px solid white;
  display: block;
}

ul {
  list-style-type: none;
}


text:
#ifndef SERVICECOMPONENTS_HPP
#define SERVICECOMPONENTS_HPP

#include "SpellCheckImpl.hpp"

#endif


text:
'use strict';

var QueryString = exports;

// use the native querystring implementation for encoding and decoding
var qs = require('querystring');
var methods = [
  'unescapeBuffer',
  'unescape',
  'escape',
  'stringify',
  'encode',
];

methods.forEach(function (method) {
  QueryString[method] = qs[method];
});

/**
 * Everything below this comment is basically copied from io.js
 * As of version: https://github.com/iojs/io.js/blob/10e31ba56c676bdcad39ccad22ea9117733b8eb5/lib/querystring.js
 */

// Parse a key=val string.
QueryString.parse = QueryString.decode = function(qs, sep, eq, options) {
  sep = sep || '&';
  eq = eq || '=';
  var obj = {};

  if (typeof qs !== 'string' || qs.length === 0) {
    return obj;
  }

  var regexp = /\+/g;
  qs = qs.split(sep);

  var maxKeys = 1000;
  if (options && typeof options.maxKeys === 'number') {
    maxKeys = options.maxKeys;
  }

  var len = qs.length;
  // maxKeys <= 0 means that we should not limit keys count
  if (maxKeys > 0 && len > maxKeys) {
    len = maxKeys;
  }

  var decode = QueryString.unescape;
  if (options && typeof options.decodeURIComponent === 'function') {
    decode = options.decodeURIComponent;
  }

  for (var i = 0; i < len; ++i) {
    var x = qs[i].replace(regexp, '%20'),
        idx = x.indexOf(eq),
        k, v;

    if (idx >= 0) {
      k = decodeStr(x.substring(0, idx), decode);
      v = decodeStr(x.substring(idx + 1), decode);
    } else {
      k = decodeStr(x, decode);
      v = '';
    }

    obj[k] = v;
  }

  return obj;
};

function decodeStr(s, decoder) {
  try {
    return decoder(s);
  } catch (e) {
    return QueryString.unescape(s, true);
  }
}


text:
package com.jeometry.twod.segment;

import com.aljebra.field.Field;
import com.aljebra.field.impl.doubles.Decimal;
import com.aljebra.scalar.Random;
import com.aljebra.scalar.Scalar;
import com.aljebra.vector.Vect;
import com.jeometry.twod.line.analytics.Parallel;
import com.jeometry.twod.point.RandomPoint;
import com.jeometry.twod.scalar.SegmentLength;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;

/**
 * Tests for {@link LengthSegment}.
 * @since 0.1
 */
public final class LengthSegmentTest {

    /**
     * {@link LengthSegment} builds a segment congruent to the passed segment.
     */
    @Test
    public void createsCongruentSegment() {
        final Segment<Double> ref = new PtVectSegment<>(
            new RandomPoint<>(), new RandomPoint<>()
        );
        final Segment<Double> seg = new LengthSegment<>(ref);
        final Field<Double> dec = new Decimal();
        final double error = 1.e-6;
        MatcherAssert.assertThat(
            new SegmentLength<Double>(ref).value(dec),
            Matchers.closeTo(new SegmentLength<Double>(seg).value(dec), error)
        );
    }

    /**
     * {@link LengthSegment} builds a segment congruent to the passed segment,
     * having the passed start extremity.
     */
    @Test
    public void createsCongruentSegmentWithStartPoint() {
        final Segment<Double> ref = new PtVectSegment<>(
            new RandomPoint<>(), new RandomPoint<>()
        );
        final Vect<Double> start = new RandomPoint<>();
        final Segment<Double> seg = new LengthSegment<>(start, ref);
        final Field<Double> dec = new Decimal();
        final double error = 1.e-6;
        MatcherAssert.assertThat(
            new SegmentLength<Double>(ref).value(dec),
            Matchers.closeTo(new SegmentLength<Double>(seg).value(dec), error)
        );
        MatcherAssert.assertThat(seg.start(), Matchers.equalTo(start));
    }

    /**
     * {@link LengthSegment} builds a segment with the given length.
     */
    @Test
    public void createsLengthSegment() {
        final Scalar<Double> length = new Random<>();
        final Segment<Double> seg = new LengthSegment<>(length);
        final Field<Double> dec = new Decimal();
        final double error = 1.e-6;
        MatcherAssert.assertThat(
            Math.abs(length.value(dec)),
            Matchers.closeTo(new SegmentLength<Double>(seg).value(dec), error)
        );
    }

    /**
     * {@link LengthSegment} builds a segment with the given length,
     * having the passed start extremity.
     */
    @Test
    public void createsLengthSegmentWithStartPoint() {
        final Scalar<Double> length = new Random<>();
        final Vect<Double> start = new RandomPoint<>();
        final Segment<Double> seg = new LengthSegment<>(start, length);
        final Field<Double> dec = new Decimal();
        final double error = 1.e-6;
        MatcherAssert.assertThat(
            Math.abs(length.value(dec)),
            Matchers.closeTo(new SegmentLength<Double>(seg).value(dec), error)
        );
        MatcherAssert.assertThat(seg.start(), Matchers.equalTo(start));
    }

    /**
     * {@link LengthSegment} builds a segment with the given length,
     * having the passed start extremity and the given direction.
     */
    @Test
    public void createsLengthSegmentWithStartPointAndDirection() {
        final Scalar<Double> length = new Random<>();
        final Vect<Double> start = new RandomPoint<>();
        final Vect<Double> dir = new RandomPoint<>();
        final Segment<Double> seg = new LengthSegment<>(start, dir, length);
        final Field<Double> dec = new Decimal();
        final double error = 1.e-6;
        MatcherAssert.assertThat(
            Math.abs(length.value(dec)),
            Matchers.closeTo(new SegmentLength<Double>(seg).value(dec), error)
        );
        MatcherAssert.assertThat(seg.start(), Matchers.equalTo(start));
        MatcherAssert.assertThat(
            new Parallel<>(
                new PtVectSegment<>(new RandomPoint<>(), dir), seg
            ).resolve(dec),
            Matchers.is(true)
        );
    }
}


text:
"""
Compatibility functionality for Windbg users.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import codecs
import math
import sys

import gdb

import pwndbg.arch
import pwndbg.commands
import pwndbg.memory
import pwndbg.strings
import pwndbg.symbol
import pwndbg.typeinfo

def get_type(size):
    return {
    1: pwndbg.typeinfo.uint8,
    2: pwndbg.typeinfo.uint16,
    4: pwndbg.typeinfo.uint32,
    8: pwndbg.typeinfo.uint64,
    }[size]

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def db(address, count=64):
    """
    Starting at the specified address, dump N bytes
    (default 64).
    """
    return dX(1, (address), (count))

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def dw(address, count=32):
    """
    Starting at the specified address, dump N words
    (default 32).
    """
    return dX(2, (address), (count))

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def dd(address, count=16):
    """
    Starting at the specified address, dump N dwords
    (default 16).
    """
    return dX(4, (address), (count))

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def dq(address, count=8):
    """
    Starting at the specified address, dump N qwords
    (default 8).
    """
    return dX(8, (address), (count))

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def dc(address, count=8):
    return pwndbg.commands.hexdump.hexdump(address=address, count=count)

def dX(size, address, count, to_string=False):
    """
    Traditionally, windbg will display 16 bytes of data per line.
    """
    values = []
    address = int(address) & pwndbg.arch.ptrmask
    type   = get_type(size)
    count = int(count)
    for i in range(count):
        try:
            gval = pwndbg.memory.poi(type, address + i * size)
            # print(str(gval))
            values.append(int(gval))
        except gdb.MemoryError:
            break

    n_rows = int(math.ceil(count * size / float(16)))
    row_sz = int(16 / size)
    rows   = [values[i*row_sz:(i+1)*row_sz] for i in range(n_rows)]
    lines  = []

    # sys.stdout.write(repr(rows) + '\n')

    for i, row in enumerate(rows):
        if not row:
            continue
        line = [enhex(pwndbg.arch.ptrsize, address + (i*16)),'   ']
        for value in row:
            line.append(enhex(size, value))
        lines.append(' '.join(line))

    if not to_string:
        print('\n'.join(lines))

    return lines

def enhex(size, value):
    value = value & pwndbg.arch.ptrmask
    x = "%x" % abs(value)
    x = x.rjust(size * 2, '0')
    return x

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def eb(address, *data):
    """
    Write hex bytes at the specified address.
    """
    return eX(1, address, data)

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def ew(address, *data):
    """
    Write hex words at the specified address.
    """
    return eX(2, address, data)

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def ed(address, *data):
    """
    Write hex dwords at the specified address.
    """
    return eX(4, address, data)

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def eq(address, *data):
    """
    Write hex qwords at the specified address.
    """
    return eX(8, address, data)

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def ez(address, *data):
    """
    Write a string at the specified address.
    """
    return eX(1, address, data[0], hex=False)

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def eza(address, *data):
    """
    Write a string at the specified address.
    """
    return ez(address, data)

def eX(size, address, data, hex=True):
    """
    This relies on windbg's default hex encoding being enforced
    """
    address = pwndbg.commands.fix(address)

    if address is None:
        return

    for i,bytestr in enumerate(data):
        if hex:
            bytestr = bytestr.rjust(size*2, '0')
            data    = codecs.decode(bytestr, 'hex')
        else:
            data    = bytestr

        if pwndbg.arch.endian == 'little':
            data = data[::-1]

        pwndbg.memory.write(address + (i * size), data)

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def dds(*a):
    """
    Dump pointers and symbols at the specified address.
    """
    return pwndbg.commands.telescope.telescope(*a)

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def kd(*a):
    """
    Dump pointers and symbols at the specified address.
    """
    return pwndbg.commands.telescope.telescope(*a)

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def dps(*a):
    """
    Dump pointers and symbols at the specified address.
    """
    return pwndbg.commands.telescope.telescope(*a)

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def dqs(*a):
    """
    Dump pointers and symbols at the specified address.
    """
    return pwndbg.commands.telescope.telescope(*a)

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def da(address, max=256):
    """
    Dump a string at the specified address.
    """
    print("%x" % address, repr(pwndbg.strings.get(address, max)))

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def ds(address, max=256):
    """
    Dump a string at the specified address.
    """
    print("%x" % address, repr(pwndbg.strings.get(address, max)))

@pwndbg.commands.ParsedCommand
def bl():
    """
    List breakpoints
    """
    gdb.execute('info breakpoints')

@pwndbg.commands.Command
def bd(which = '*'):
    """
    Disable the breapoint with the specified index.
    """
    if which == '*':
        gdb.execute('disable breakpoints')
    else:
        gdb.execute('disable breakpoints %s' % which)

@pwndbg.commands.Command
def be(which = '*'):
    """
    Enable the breapoint with the specified index.
    """
    if which == '*':
        gdb.execute('enable breakpoints')
    else:
        gdb.execute('enable breakpoints %s' % which)

@pwndbg.commands.Command
def bc(which = '*'):
    """
    Clear the breapoint with the specified index.
    """
    if which == '*':
        gdb.execute('delete breakpoints')
    else:
        gdb.execute('delete breakpoints %s' % which)

@pwndbg.commands.ParsedCommand
def bp(where):
    """
    Set a breakpoint at the specified address.
    """
    result = pwndbg.commands.fix(where)
    if result is not None:
        gdb.execute('break *%#x' % int(result))

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def u(where=None, n=5):
    """
    Starting at the specified address, disassemble
    N instructions (default 5).
    """
    if where is None:
        where = pwndbg.regs.pc
    pwndbg.commands.nearpc(where, n)

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def k():
    """
    Print a backtrace (alias 'bt')
    """
    gdb.execute('bt')

@pwndbg.commands.ParsedCommand
@pwndbg.commands.OnlyWhenRunning
def ln(value=None):
    """
    List the symbols nearest to the provided value.
    """
    if value is None: value = pwndbg.regs.pc
    x = pwndbg.symbol.get(value)
    if x:
        result = '(%#x)   %s' % (value, x)

@pwndbg.commands.QuietSloppyParsedCommand
@pwndbg.commands.OnlyWhenRunning
def lm(map):
    """
    Windbg compatibility alias for 'vmmap' command.
    """
    return pwndbg.commands.vmmap.vmmap(map)

@pwndbg.commands.QuietSloppyParsedCommand
@pwndbg.commands.OnlyWhenRunning
def address(map):
    """
    Windbg compatibility alias for 'vmmap' command.
    """
    return pwndbg.commands.vmmap.vmmap(map)

@pwndbg.commands.QuietSloppyParsedCommand
@pwndbg.commands.OnlyWhenRunning
def vprot(map):
    """
    Windbg compatibility alias for 'vmmap' command.
    """
    return pwndbg.commands.vmmap.vmmap(map)

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def peb(*a):
    print("This isn't Windows!")

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def go():
    '''
    Windbg compatibility alias for 'continue' command.
    '''
    gdb.execute('continue')

@pwndbg.commands.Command
@pwndbg.commands.OnlyWhenRunning
def pc():
    '''
    Windbg compatibility alias for 'nextcall' command.
    '''
    return pwndbg.commands.next.nextcall()


text:
//%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// License.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////
/* NOCHKSRC */

//
//%/////////////////////////////////////////////////////////////////////////////

#ifndef Pegasus_Char16_h
#define Pegasus_Char16_h

#include <Pegasus/Common/Config.h>
#include <Pegasus/Common/Linkage.h>

PEGASUS_NAMESPACE_BEGIN

/** The Char16 class represents a CIM sixteen bit character (char16).
    This class is a trivial wrapper for a sixteen bit integer. It is used
    as the element type in the String class (used to represent the CIM
    string type). Ordinarily Uint16 could be used; however, a distinguishable
    type was needed for the purposes of function overloaded which occurs in
    the CIMValue class.
*/
class PEGASUS_COMMON_LINKAGE Char16
{
public:

    /// Constructor.
    Char16();

    /// Constructor.
    Char16(Uint16 x);

    /// Constructor.
    Char16(const Char16& x);

    /// Destructor.
    ~Char16();

    /// Assignment operator.
    Char16& operator=(Uint16 x);

    /// Assignment operator.
    Char16& operator=(const Char16& x);

    /// Implicit converter from Char16 to Uint16
    operator Uint16() const;

private:
    Uint16 _code;
};

PEGASUS_COMMON_LINKAGE Boolean operator==(const Char16& x, const Char16& y);
PEGASUS_COMMON_LINKAGE Boolean operator==(const Char16& x, char y);
PEGASUS_COMMON_LINKAGE Boolean operator==(char x, const Char16& y);
PEGASUS_COMMON_LINKAGE Boolean operator!=(const Char16& x, const Char16& y);
PEGASUS_COMMON_LINKAGE Boolean operator!=(const Char16& x, char y);
PEGASUS_COMMON_LINKAGE Boolean operator!=(char x, const Char16& y);

PEGASUS_NAMESPACE_END

#if defined(PEGASUS_INTERNALONLY) && !defined(PEGASUS_DISABLE_INTERNAL_INLINES)
# include "Char16Inline.h"
#endif

#endif /* Pegasus_Char16_h */


text:
package com.cloudera.cdk.morphline.stdlib;

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

import com.cloudera.cdk.morphline.api.Command;
import com.cloudera.cdk.morphline.api.CommandBuilder;
import com.cloudera.cdk.morphline.api.MorphlineCompilationException;
import com.cloudera.cdk.morphline.api.MorphlineContext;
import com.cloudera.cdk.morphline.api.Record;
import com.cloudera.cdk.morphline.base.AbstractCommand;
import com.typesafe.config.Config;

/**
 * Command that iterates over the items in a given record input field, interprets each item as a key-value
 * pair where the key and value are separated by the given separator character, and adds the pair's
 * value to the record field named after the pair's key.
 */
public final class SplitKeyValueBuilder implements CommandBuilder {

  @Override
  public Collection<String> getNames() {
    return Collections.singletonList("splitKeyValue");
  }

  @Override
  public Command build(Config config, Command parent, Command child, MorphlineContext context) {
    return new SplitKeyValue(this, config, parent, child, context);
  }

  ///////////////////////////////////////////////////////////////////////////////
  // Nested classes:
  ///////////////////////////////////////////////////////////////////////////////
  private static final class SplitKeyValue extends AbstractCommand {

    private final String inputFieldName;
    private final String outputFieldPrefix;
    private final char separatorChar;
    private final boolean addEmptyStrings;
    private final boolean trim;

    public SplitKeyValue(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) {
      super(builder, config, parent, child, context);
      this.inputFieldName = getConfigs().getString(config, "inputField");
      this.outputFieldPrefix = getConfigs().getString(config, "outputFieldPrefix", "");
      String separator = getConfigs().getString(config, "separator", "=");
      if (separator.length() != 1) {
        throw new MorphlineCompilationException("separator must be one character only: " + separator, config);
      }
      this.separatorChar = separator.charAt(0);
      this.addEmptyStrings = getConfigs().getBoolean(config, "addEmptyStrings", false);
      this.trim = getConfigs().getBoolean(config, "trim", true);
      validateArguments();
    }

    @Override
    protected boolean doProcess(Record record) {
      for (Object item : record.get(inputFieldName)) {
        String str = item.toString();
        String key = str;
        String value = "";
        int i = str.indexOf(separatorChar);
        if (i >= 0) {
          key = str.substring(0, i);
          value = str.substring(i + 1, str.length());
        }
        value = trim(value);
        if (value.length() > 0 || addEmptyStrings) {
          record.put(concat(outputFieldPrefix, trim(key)), value);
        }
      }

      // pass record to next command in chain:
      return super.doProcess(record);
    }

    private String trim(String str) {
      return trim ? str.trim() : str;
    }

    private String concat(String x, String y) {
      return x.length() == 0 ? y : x + y;
    }

  }

}


text:
package org.docksidestage.dockside.dbflute.whitebox.bhv;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.util.DfCollectionUtil;
import org.dbflute.util.DfTypeUtil;
import org.docksidestage.dockside.dbflute.cbean.MemberCB;
import org.docksidestage.dockside.dbflute.exbhv.MemberBhv;
import org.docksidestage.dockside.dbflute.exbhv.MemberWithdrawalBhv;
import org.docksidestage.dockside.dbflute.exbhv.WithdrawalReasonBhv;
import org.docksidestage.dockside.dbflute.exentity.Member;
import org.docksidestage.dockside.dbflute.exentity.MemberWithdrawal;
import org.docksidestage.dockside.dbflute.exentity.WithdrawalReason;
import org.docksidestage.dockside.unit.UnitContainerTestCase;

/**
 * @author jflute
 * @since 0.9.7.9 (2011/01/08 Saturday)
 */
public class WxBhvVaryingQueryInsertTest extends UnitContainerTestCase {

    // ===================================================================================
    //                                                                           Attribute
    //                                                                           =========
    private MemberBhv memberBhv;
    private WithdrawalReasonBhv withdrawalReasonBhv;
    private MemberWithdrawalBhv memberWithdrawalBhv;

    // ===================================================================================
    //                                                                       Common Column
    //                                                                       =============
    public void test_varyingQueryInsert_disableCommonColumnAutoSetup() { // and same column
        // ## Arrange ##
        int countAll = memberWithdrawalBhv.selectCount(countCB -> {});
        Map<Integer, Member> formalizedMemberMap = new LinkedHashMap<Integer, Member>();
        {
            ListResultBean<Member> memberList = memberBhv.selectList(cb -> {
                cb.query().setMemberStatusCode_Equal_Formalized();
            });

            for (Member member : memberList) {
                formalizedMemberMap.put(member.getMemberId(), member);
            }
        }
        WithdrawalReason firstReason = withdrawalReasonBhv.selectEntityWithDeletedCheck(cb -> {
            cb.fetchFirst(1);
        });

        // ## Act ##
        int inserted = memberWithdrawalBhv.varyingQueryInsert((entity, intoCB) -> {
            entity.setWithdrawalReasonCodeAsWithdrawalReason(firstReason.getWithdrawalReasonCodeAsWithdrawalReason());
            MemberCB cb = new MemberCB();
            intoCB.specify().columnMemberId().mappedFrom(cb.specify().columnMemberId());
            intoCB.specify().columnWithdrawalDatetime().mappedFrom(cb.specify().columnFormalizedDatetime());
            intoCB.specify().columnWithdrawalReasonInputText().mappedFrom(cb.specify().columnMemberName());
            intoCB.specify().columnRegisterDatetime().mappedFrom(cb.specify().columnFormalizedDatetime());
            intoCB.specify().columnRegisterUser().mappedFrom(cb.specify().columnMemberName());
            intoCB.specify().columnUpdateDatetime().mappedFrom(cb.specify().columnFormalizedDatetime());
            intoCB.specify().columnUpdateUser().mappedFrom(cb.specify().columnMemberName());

            cb.query().setMemberStatusCode_Equal_Formalized();
            return cb;
        }, op -> op.disableCommonColumnAutoSetup());

        // ## Assert ##
        int actualCountAll = memberWithdrawalBhv.selectCount(countCB -> {});
        assertNotSame(0, inserted);
        assertNotSame(countAll, actualCountAll);
        assertTrue(countAll < actualCountAll);
        assertEquals(actualCountAll - countAll, inserted);
        List<Integer> memberIdList = DfCollectionUtil.newArrayList();
        ListResultBean<MemberWithdrawal> actualList = memberWithdrawalBhv.selectList(cb -> {
            for (Member member : formalizedMemberMap.values()) {
                memberIdList.add(member.getMemberId());
            }
            cb.query().setMemberId_InScope(memberIdList);
        });

        assertNotSame(0, actualList.size());
        assertEquals(memberIdList.size(), actualList.size());
        String fmt = "yyyy-MM-dd HH:mm:ss.SSS";
        for (MemberWithdrawal actual : actualList) {
            String withdrawalReasonCode = actual.getWithdrawalReasonCode();
            assertNotNull(withdrawalReasonCode);
            assertEquals(firstReason.getWithdrawalReasonCode(), withdrawalReasonCode);
            Member member = formalizedMemberMap.get(actual.getMemberId());

            // common columns
            String formalizedDatetime = DfTypeUtil.toString(member.getFormalizedDatetime(), fmt);
            assertEquals(member.getMemberName(), actual.getWithdrawalReasonInputText());
            assertEquals(formalizedDatetime, DfTypeUtil.toString(actual.getRegisterDatetime(), fmt));
            assertEquals(member.getMemberName(), actual.getRegisterUser());
            assertEquals(formalizedDatetime, DfTypeUtil.toString(actual.getUpdateDatetime(), fmt));
            assertEquals(member.getMemberName(), actual.getUpdateUser());
        }
    }
}


text:
package org.apache.sysml.runtime.instructions.cp;

import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM;
import org.apache.sysml.conf.ConfigurationManager;
import org.apache.sysml.hops.OptimizerUtils;
import org.apache.sysml.parser.Expression.DataType;
import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.caching.CacheableData;
import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
import org.apache.sysml.runtime.functionobjects.Builtin;
import org.apache.sysml.runtime.instructions.InstructionUtils;
import org.apache.sysml.runtime.matrix.MatrixCharacteristics;
import org.apache.sysml.runtime.matrix.data.MatrixBlock;
import org.apache.sysml.runtime.matrix.data.MatrixIndexes;
import org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator;
import org.apache.sysml.runtime.matrix.operators.Operator;
import org.apache.sysml.runtime.matrix.operators.SimpleOperator;

public class AggregateUnaryCPInstruction extends UnaryCPInstruction
{
	public enum AUType {
		NROW, NCOL, LENGTH, EXISTS,
		DEFAULT;
		public boolean isMeta() {
			return this != DEFAULT;
		}
	}

	private final AUType _type;

	private AggregateUnaryCPInstruction(Operator op, CPOperand in, CPOperand out, AUType type, String opcode, String istr) {
		this(op, in, null, null, out, type, opcode, istr);
	}

	protected AggregateUnaryCPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand in3, CPOperand out,
			AUType type, String opcode, String istr) {
		super(CPType.AggregateUnary, op, in1, in2, in3, out, opcode, istr);
		_type = type;
	}

	public static AggregateUnaryCPInstruction parseInstruction(String str) {
		String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
		String opcode = parts[0];
		CPOperand in1 = new CPOperand(parts[1]);
		CPOperand out = new CPOperand(parts[2]);

		if(opcode.equalsIgnoreCase("nrow") || opcode.equalsIgnoreCase("ncol")
			|| opcode.equalsIgnoreCase("length") || opcode.equalsIgnoreCase("exists")){
			return new AggregateUnaryCPInstruction(new SimpleOperator(Builtin.getBuiltinFnObject(opcode)),
				in1, out, AUType.valueOf(opcode.toUpperCase()), opcode, str);
		}
		else { //DEFAULT BEHAVIOR
			AggregateUnaryOperator aggun = InstructionUtils
				.parseBasicAggregateUnaryOperator(opcode, Integer.parseInt(parts[3]));
			return new AggregateUnaryCPInstruction(aggun, in1, out, AUType.DEFAULT, opcode, str);
		}
	}

	@Override
	public void processInstruction( ExecutionContext ec ) {
		String output_name = output.getName();
		String opcode = getOpcode();

		if( _type.isMeta() && _type!=AUType.EXISTS ) //nrow/ncol/length
		{
			//check existence of input variable
			if( !ec.getVariables().keySet().contains(input1.getName()) )
				throw new DMLRuntimeException("Variable '"+input1.getName()+"' does not exist.");

			//get meta data information
			long rval = -1;
			if (input1.getDataType() == DataType.LIST && _type == AUType.LENGTH ) {
				rval = ((ListObject)ec.getVariable(input1.getName())).getLength();
			}
			else if( input1.getDataType().isMatrix() || input1.getDataType().isFrame() ) {
				MatrixCharacteristics mc = ec.getMatrixCharacteristics(input1.getName());
				rval = getSizeMetaData(_type, mc);

				//check for valid output, and acquire read if necessary
				//(Use case: In case of forced exec type singlenode, there are no reblocks. For csv
				//we however, support unspecified input sizes, which requires a read to obtain the
				//required meta data)
				//Note: check on matrix characteristics to cover incorrect length (-1*-1 -> 1)
				if( !mc.dimsKnown() ) //invalid nrow/ncol/length
				{
					if( ConfigurationManager.getExecutionMode() == RUNTIME_PLATFORM.SINGLE_NODE
						|| (input1.getDataType() == DataType.FRAME && OptimizerUtils.isHadoopExecutionMode()) )
					{
						if( OptimizerUtils.isHadoopExecutionMode() )
							LOG.warn("Reading csv input frame of unkown size into memory for '"+opcode+"'.");

						//read the input matrix/frame and explicitly refresh meta data
						CacheableData<?> obj = ec.getCacheableData(input1.getName());
						obj.acquireRead();
						obj.refreshMetaData();
						obj.release();

						//update meta data information
						mc = ec.getMatrixCharacteristics(input1.getName());
						rval = getSizeMetaData(_type, mc);
					}
					else {
						throw new DMLRuntimeException("Invalid meta data returned by '"+opcode+"': "+rval + ":" + instString);
					}
				}
			}

			//create and set output scalar
			ec.setScalarOutput(output_name, new IntObject(rval));
		}
		else if( _type == AUType.EXISTS ) {
			//probe existence of variable in symbol table w/o error
			String varName = !input1.isScalar() ? input1.getName() :
				ec.getScalarInput(input1).getStringValue();
			boolean rval = ec.getVariables().keySet().contains(varName);
			//create and set output scalar
			ec.setScalarOutput(output_name, new BooleanObject(rval));
		}
		else { //DEFAULT
			MatrixBlock matBlock = ec.getMatrixInput(input1.getName());
			AggregateUnaryOperator au_op = (AggregateUnaryOperator) _optr;

			MatrixBlock resultBlock = (MatrixBlock) matBlock.aggregateUnaryOperations(au_op, new MatrixBlock(),
				matBlock.getNumRows(), matBlock.getNumColumns(), new MatrixIndexes(1, 1), true);

			ec.releaseMatrixInput(input1.getName());
			if(output.getDataType() == DataType.SCALAR){
				DoubleObject ret = new DoubleObject(resultBlock.getValue(0, 0));
				ec.setScalarOutput(output_name, ret);
			} else{
				// since the computed value is a scalar, allocate a "temp" output matrix
				ec.setMatrixOutput(output_name, resultBlock);
			}
		}
	}

	private static long getSizeMetaData(AUType type, MatrixCharacteristics mc) {
		switch( type ) {
			case NROW: return mc.getRows();
			case NCOL: return mc.getCols();
			case LENGTH: return mc.getRows() * mc.getCols();
			default:
				throw new RuntimeException("Opcode not applicable: "+type.name());
		}
	}
}


text:
#pragma once

#include <cppunit/extensions/HelperMacros.h>

#ifdef CPPUNIT_HAVE_NAMESPACES
using namespace CPPUNIT_NS;
#endif

class TestModMigrate :
    public TestFixture
{

    CPPUNIT_TEST_SUITE( TestModMigrate );
    CPPUNIT_TEST( testEnrichContext );
    CPPUNIT_TEST( testTranslateHook );
    CPPUNIT_TEST( testInputFilterBody2Brigade );
    CPPUNIT_TEST( testConfig );
    CPPUNIT_TEST( testScope );
    CPPUNIT_TEST( testMigrateEnv );
    CPPUNIT_TEST( testInitAndCleanUp );
    CPPUNIT_TEST_SUITE_END();

public:
    void testEnrichContext();
    void testTranslateHook();
    void testInputFilterBody2Brigade();
    void testConfig();
    void testScope();
    void testMigrateEnv();
    void testInitAndCleanUp();
};


text:
const cors = require('cors')
const express = require('express')
const bodyParser = require('body-parser')
const router = require('./routes/router.js')
const database = require('./database.js')
const account = require('./account/manager.js')

const success = '\x1b[32mOK\x1b[0m'
const failure = '\x1b[31mFAILED\x1b[0m'
const homecomixApi = '[\x1b[35mHomeComix-API\x1b[0m] '

const app = express()

// Port setting
const port = process.env.PORT || 3000

// Enable all CORS request
app.use(cors())
// Allows nested object
app.use(bodyParser.urlencoded({extended: true}))
// Parses incoming request bodies in a middleware
app.use(bodyParser.json())

// Account management
app.post('/api.homecomix/register', account.register)
app.post('/api.homecomix/authorize', account.authorize)
app.delete('/api.homecomix/delete', account.delete)

// Middlewares
// Ensures that all requests starting with /api.homecomix/* will be checked
// for the token
app.all('/api.homecomix/*', [require('./middleware/token')])

// Mounts the router as middleware at path "/"
app.use('/', router)

database.connect()
  .then(() => {
    console.log(`${homecomixApi}Connection to the database [${success}]`)
    database.init()
      .then(() => {
        app.listen(port, () => {
          console.log(`${homecomixApi}Listening on port ${port} [${success}]`)
          console.log(`${homecomixApi}HomeComix starting service [${success}]`)
        })
      })
      .catch(err => {
        console.log(`${homecomixApi}HomeComix starting service [${failure}]`)
        console.log(err.message)
        database.close()
        process.exit(1)
      })
  })
  .catch(err => {
    if (err) {
      console.log(`${homecomixApi}Connection to the database [${failure}]`)
      console.log(err.message)
      process.exit(1)
    }
  })


text:
require 'fog'

module Salt
  module Commands
    class Upgrade < BaseCommand
      def run(args=[])
        require_master_server!

        dsystem sudo_cmd master_server, "apt-get -y upgrade salt-master"
        dsystem sudo_cmd master_server, "service salt-master restart"
        salt_cmd master_server, "pkg.upgrade salt-minion"
        salt_cmd master_server, "service.restart salt-minion"
      end
    end
  end
end

Salt.register_command "upgrade", Salt::Commands::Upgrade


text:
$content = Invoke-WebRequest "http://langs.bigsbyspot.org/files/webcall.txt"
Write-Host $content


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

<TITLE>
org.springframework.aop.framework.adapter (Spring Framework API 2.5)
</TITLE>

<META NAME="date" CONTENT="2007-11-19">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

The Spring Framework

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package org.springframework.aop.framework.adapter

SPI package allowing Spring AOP framework to handle arbitrary advice types.

See:

          Description

Interface Summary

AdvisorAdapter
Interface allowing extension to the Spring AOP framework to allow
 handling of new Advisors and Advice types.

AdvisorAdapterRegistry
Interface for registries of Advisor adapters.

Class Summary

AdvisorAdapterRegistrationManager
BeanPostProcessor that registers AdvisorAdapter beans in the BeanFactory with
 an AdvisorAdapterRegistry (by default the GlobalAdvisorAdapterRegistry).

AfterReturningAdviceInterceptor
Interceptor to wrap am AfterReturningAdvice.

DefaultAdvisorAdapterRegistry
Default implementation of the AdvisorAdapterRegistry interface.

GlobalAdvisorAdapterRegistry
Singleton to publish a shared DefaultAdvisorAdapterRegistry instance.

MethodBeforeAdviceInterceptor
Interceptor to wrap am MethodBeforeAdvice.

ThrowsAdviceInterceptor
Interceptor to wrap an after-throwing advice.

Exception Summary

UnknownAdviceTypeException
Exception thrown when an attempt is made to use an unsupported
 Advisor or Advice type.

Package org.springframework.aop.framework.adapter Description

SPI package allowing Spring AOP framework to handle arbitrary advice types.

Users who want merely to use the Spring AOP framework, rather than extend
its capabilities, don't need to concern themselves with this package.

        You may wish to use these adapters to wrap Spring-specific advices, such as MethodBeforeAdvice,
        in MethodInterceptor, to allow their use in another AOP framework supporting the AOP Alliance interfaces.

        These adapters do not depend on any other Spring framework classes to allow such usage.

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

The Spring Framework

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2002-2007 The Spring Framework.


text:
layout: tag
tag: gay-marriage
permalink: /blog/tag/gay-marriage/
---


text:
#include <linux/interrupt.h>
#include <sound/control.h>
#include <sound/tlv.h>

#include "control.h"
#include "comm.h"
#include "chip.h"

static const char * const opt_coax_texts[2] = { "Optical", "Coax" };
static const char * const line_phono_texts[2] = { "Line", "Phono" };

/*
 * data that needs to be sent to device. sets up card internal stuff.
 * values dumped from windows driver and filtered by trial'n'error.
 */
static const struct {
	u8 type;
	u8 reg;
	u8 value;
}
init_data[] = {
	{ 0x22, 0x00, 0x00 }, { 0x20, 0x00, 0x08 }, { 0x22, 0x01, 0x01 },
	{ 0x20, 0x01, 0x08 }, { 0x22, 0x02, 0x00 }, { 0x20, 0x02, 0x08 },
	{ 0x22, 0x03, 0x00 }, { 0x20, 0x03, 0x08 }, { 0x22, 0x04, 0x00 },
	{ 0x20, 0x04, 0x08 }, { 0x22, 0x05, 0x01 }, { 0x20, 0x05, 0x08 },
	{ 0x22, 0x04, 0x01 }, { 0x12, 0x04, 0x00 }, { 0x12, 0x05, 0x00 },
	{ 0x12, 0x0d, 0x38 }, { 0x12, 0x21, 0x82 }, { 0x12, 0x22, 0x80 },
	{ 0x12, 0x23, 0x00 }, { 0x12, 0x06, 0x02 }, { 0x12, 0x03, 0x00 },
	{ 0x12, 0x02, 0x00 }, { 0x22, 0x03, 0x01 },
	{ 0 } /* TERMINATING ENTRY */
};

static const int rates_altsetting[] = { 1, 1, 2, 2, 3, 3 };
/* values to write to soundcard register for all samplerates */
static const u16 rates_6fire_vl[] = {0x00, 0x01, 0x00, 0x01, 0x00, 0x01};
static const u16 rates_6fire_vh[] = {0x11, 0x11, 0x10, 0x10, 0x00, 0x00};

static DECLARE_TLV_DB_MINMAX(tlv_output, -9000, 0);
static DECLARE_TLV_DB_MINMAX(tlv_input, -1500, 1500);

enum {
	DIGITAL_THRU_ONLY_SAMPLERATE = 3
};

static void usb6fire_control_output_vol_update(struct control_runtime *rt)
{
	struct comm_runtime *comm_rt = rt->chip->comm;
	int i;

	if (comm_rt)
		for (i = 0; i < 6; i++)
			if (!(rt->ovol_updated & (1 << i))) {
				comm_rt->write8(comm_rt, 0x12, 0x0f + i,
					180 - rt->output_vol[i]);
				rt->ovol_updated |= 1 << i;
			}
}

static void usb6fire_control_output_mute_update(struct control_runtime *rt)
{
	struct comm_runtime *comm_rt = rt->chip->comm;

	if (comm_rt)
		comm_rt->write8(comm_rt, 0x12, 0x0e, ~rt->output_mute);
}

static void usb6fire_control_input_vol_update(struct control_runtime *rt)
{
	struct comm_runtime *comm_rt = rt->chip->comm;
	int i;

	if (comm_rt)
		for (i = 0; i < 2; i++)
			if (!(rt->ivol_updated & (1 << i))) {
				comm_rt->write8(comm_rt, 0x12, 0x1c + i,
					rt->input_vol[i] & 0x3f);
				rt->ivol_updated |= 1 << i;
			}
}

static void usb6fire_control_line_phono_update(struct control_runtime *rt)
{
	struct comm_runtime *comm_rt = rt->chip->comm;
	if (comm_rt) {
		comm_rt->write8(comm_rt, 0x22, 0x02, rt->line_phono_switch);
		comm_rt->write8(comm_rt, 0x21, 0x02, rt->line_phono_switch);
	}
}

static void usb6fire_control_opt_coax_update(struct control_runtime *rt)
{
	struct comm_runtime *comm_rt = rt->chip->comm;
	if (comm_rt) {
		comm_rt->write8(comm_rt, 0x22, 0x00, rt->opt_coax_switch);
		comm_rt->write8(comm_rt, 0x21, 0x00, rt->opt_coax_switch);
	}
}

static int usb6fire_control_set_rate(struct control_runtime *rt, int rate)
{
	int ret;
	struct usb_device *device = rt->chip->dev;
	struct comm_runtime *comm_rt = rt->chip->comm;

	if (rate < 0 || rate >= CONTROL_N_RATES)
		return -EINVAL;

	ret = usb_set_interface(device, 1, rates_altsetting[rate]);
	if (ret < 0)
		return ret;

	/* set soundcard clock */
	ret = comm_rt->write16(comm_rt, 0x02, 0x01, rates_6fire_vl[rate],
			rates_6fire_vh[rate]);
	if (ret < 0)
		return ret;

	return 0;
}

static int usb6fire_control_set_channels(
	struct control_runtime *rt, int n_analog_out,
	int n_analog_in, bool spdif_out, bool spdif_in)
{
	int ret;
	struct comm_runtime *comm_rt = rt->chip->comm;

	/* enable analog inputs and outputs
	 * (one bit per stereo-channel) */
	ret = comm_rt->write16(comm_rt, 0x02, 0x02,
			(1 << (n_analog_out / 2)) - 1,
			(1 << (n_analog_in / 2)) - 1);
	if (ret < 0)
		return ret;

	/* disable digital inputs and outputs */
	/* TODO: use spdif_x to enable/disable digital channels */
	ret = comm_rt->write16(comm_rt, 0x02, 0x03, 0x00, 0x00);
	if (ret < 0)
		return ret;

	return 0;
}

static int usb6fire_control_streaming_update(struct control_runtime *rt)
{
	struct comm_runtime *comm_rt = rt->chip->comm;

	if (comm_rt) {
		if (!rt->usb_streaming && rt->digital_thru_switch)
			usb6fire_control_set_rate(rt,
				DIGITAL_THRU_ONLY_SAMPLERATE);
		return comm_rt->write16(comm_rt, 0x02, 0x00, 0x00,
			(rt->usb_streaming ? 0x01 : 0x00) |
			(rt->digital_thru_switch ? 0x08 : 0x00));
	}
	return -EINVAL;
}

static int usb6fire_control_output_vol_info(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_info *uinfo)
{
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = 2;
	uinfo->value.integer.min = 0;
	uinfo->value.integer.max = 180;
	return 0;
}

static int usb6fire_control_output_vol_put(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	unsigned int ch = kcontrol->private_value;
	int changed = 0;

	if (ch > 4) {
		dev_err(&rt->chip->dev->dev,
			"Invalid channel in volume control.");
		return -EINVAL;
	}

	if (rt->output_vol[ch] != ucontrol->value.integer.value[0]) {
		rt->output_vol[ch] = ucontrol->value.integer.value[0];
		rt->ovol_updated &= ~(1 << ch);
		changed = 1;
	}
	if (rt->output_vol[ch + 1] != ucontrol->value.integer.value[1]) {
		rt->output_vol[ch + 1] = ucontrol->value.integer.value[1];
		rt->ovol_updated &= ~(2 << ch);
		changed = 1;
	}

	if (changed)
		usb6fire_control_output_vol_update(rt);

	return changed;
}

static int usb6fire_control_output_vol_get(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	unsigned int ch = kcontrol->private_value;

	if (ch > 4) {
		dev_err(&rt->chip->dev->dev,
			"Invalid channel in volume control.");
		return -EINVAL;
	}

	ucontrol->value.integer.value[0] = rt->output_vol[ch];
	ucontrol->value.integer.value[1] = rt->output_vol[ch + 1];
	return 0;
}

static int usb6fire_control_output_mute_put(struct snd_kcontrol *kcontrol,
	struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	unsigned int ch = kcontrol->private_value;
	u8 old = rt->output_mute;
	u8 value = 0;

	if (ch > 4) {
		dev_err(&rt->chip->dev->dev,
			"Invalid channel in volume control.");
		return -EINVAL;
	}

	rt->output_mute &= ~(3 << ch);
	if (ucontrol->value.integer.value[0])
		value |= 1;
	if (ucontrol->value.integer.value[1])
		value |= 2;
	rt->output_mute |= value << ch;

	if (rt->output_mute != old)
		usb6fire_control_output_mute_update(rt);

	return rt->output_mute != old;
}

static int usb6fire_control_output_mute_get(struct snd_kcontrol *kcontrol,
	struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	unsigned int ch = kcontrol->private_value;
	u8 value = rt->output_mute >> ch;

	if (ch > 4) {
		dev_err(&rt->chip->dev->dev,
			"Invalid channel in volume control.");
		return -EINVAL;
	}

	ucontrol->value.integer.value[0] = 1 & value;
	value >>= 1;
	ucontrol->value.integer.value[1] = 1 & value;

	return 0;
}

static int usb6fire_control_input_vol_info(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_info *uinfo)
{
	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
	uinfo->count = 2;
	uinfo->value.integer.min = 0;
	uinfo->value.integer.max = 30;
	return 0;
}

static int usb6fire_control_input_vol_put(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	int changed = 0;

	if (rt->input_vol[0] != ucontrol->value.integer.value[0]) {
		rt->input_vol[0] = ucontrol->value.integer.value[0] - 15;
		rt->ivol_updated &= ~(1 << 0);
		changed = 1;
	}
	if (rt->input_vol[1] != ucontrol->value.integer.value[1]) {
		rt->input_vol[1] = ucontrol->value.integer.value[1] - 15;
		rt->ivol_updated &= ~(1 << 1);
		changed = 1;
	}

	if (changed)
		usb6fire_control_input_vol_update(rt);

	return changed;
}

static int usb6fire_control_input_vol_get(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);

	ucontrol->value.integer.value[0] = rt->input_vol[0] + 15;
	ucontrol->value.integer.value[1] = rt->input_vol[1] + 15;

	return 0;
}

static int usb6fire_control_line_phono_info(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_info *uinfo)
{
	return snd_ctl_enum_info(uinfo, 1, 2, line_phono_texts);
}

static int usb6fire_control_line_phono_put(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	int changed = 0;
	if (rt->line_phono_switch != ucontrol->value.integer.value[0]) {
		rt->line_phono_switch = ucontrol->value.integer.value[0];
		usb6fire_control_line_phono_update(rt);
		changed = 1;
	}
	return changed;
}

static int usb6fire_control_line_phono_get(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	ucontrol->value.integer.value[0] = rt->line_phono_switch;
	return 0;
}

static int usb6fire_control_opt_coax_info(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_info *uinfo)
{
	return snd_ctl_enum_info(uinfo, 1, 2, opt_coax_texts);
}

static int usb6fire_control_opt_coax_put(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	int changed = 0;

	if (rt->opt_coax_switch != ucontrol->value.enumerated.item[0]) {
		rt->opt_coax_switch = ucontrol->value.enumerated.item[0];
		usb6fire_control_opt_coax_update(rt);
		changed = 1;
	}
	return changed;
}

static int usb6fire_control_opt_coax_get(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	ucontrol->value.enumerated.item[0] = rt->opt_coax_switch;
	return 0;
}

static int usb6fire_control_digital_thru_put(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	int changed = 0;

	if (rt->digital_thru_switch != ucontrol->value.integer.value[0]) {
		rt->digital_thru_switch = ucontrol->value.integer.value[0];
		usb6fire_control_streaming_update(rt);
		changed = 1;
	}
	return changed;
}

static int usb6fire_control_digital_thru_get(struct snd_kcontrol *kcontrol,
		struct snd_ctl_elem_value *ucontrol)
{
	struct control_runtime *rt = snd_kcontrol_chip(kcontrol);
	ucontrol->value.integer.value[0] = rt->digital_thru_switch;
	return 0;
}

static struct snd_kcontrol_new vol_elements[] = {
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Analog Playback Volume",
		.index = 0,
		.private_value = 0,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
			SNDRV_CTL_ELEM_ACCESS_TLV_READ,
		.info = usb6fire_control_output_vol_info,
		.get = usb6fire_control_output_vol_get,
		.put = usb6fire_control_output_vol_put,
		.tlv = { .p = tlv_output }
	},
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Analog Playback Volume",
		.index = 1,
		.private_value = 2,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
			SNDRV_CTL_ELEM_ACCESS_TLV_READ,
		.info = usb6fire_control_output_vol_info,
		.get = usb6fire_control_output_vol_get,
		.put = usb6fire_control_output_vol_put,
		.tlv = { .p = tlv_output }
	},
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Analog Playback Volume",
		.index = 2,
		.private_value = 4,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
			SNDRV_CTL_ELEM_ACCESS_TLV_READ,
		.info = usb6fire_control_output_vol_info,
		.get = usb6fire_control_output_vol_get,
		.put = usb6fire_control_output_vol_put,
		.tlv = { .p = tlv_output }
	},
	{}
};

static struct snd_kcontrol_new mute_elements[] = {
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Analog Playback Switch",
		.index = 0,
		.private_value = 0,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
		.info = snd_ctl_boolean_stereo_info,
		.get = usb6fire_control_output_mute_get,
		.put = usb6fire_control_output_mute_put,
	},
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Analog Playback Switch",
		.index = 1,
		.private_value = 2,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
		.info = snd_ctl_boolean_stereo_info,
		.get = usb6fire_control_output_mute_get,
		.put = usb6fire_control_output_mute_put,
	},
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Analog Playback Switch",
		.index = 2,
		.private_value = 4,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
		.info = snd_ctl_boolean_stereo_info,
		.get = usb6fire_control_output_mute_get,
		.put = usb6fire_control_output_mute_put,
	},
	{}
};

static struct snd_kcontrol_new elements[] = {
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Line/Phono Capture Route",
		.index = 0,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
		.info = usb6fire_control_line_phono_info,
		.get = usb6fire_control_line_phono_get,
		.put = usb6fire_control_line_phono_put
	},
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Opt/Coax Capture Route",
		.index = 0,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
		.info = usb6fire_control_opt_coax_info,
		.get = usb6fire_control_opt_coax_get,
		.put = usb6fire_control_opt_coax_put
	},
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Digital Thru Playback Route",
		.index = 0,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
		.info = snd_ctl_boolean_mono_info,
		.get = usb6fire_control_digital_thru_get,
		.put = usb6fire_control_digital_thru_put
	},
	{
		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
		.name = "Analog Capture Volume",
		.index = 0,
		.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
			SNDRV_CTL_ELEM_ACCESS_TLV_READ,
		.info = usb6fire_control_input_vol_info,
		.get = usb6fire_control_input_vol_get,
		.put = usb6fire_control_input_vol_put,
		.tlv = { .p = tlv_input }
	},
	{}
};

static int usb6fire_control_add_virtual(
	struct control_runtime *rt,
	struct snd_card *card,
	char *name,
	struct snd_kcontrol_new *elems)
{
	int ret;
	int i;
	struct snd_kcontrol *vmaster =
		snd_ctl_make_virtual_master(name, tlv_output);
	struct snd_kcontrol *control;

	if (!vmaster)
		return -ENOMEM;
	ret = snd_ctl_add(card, vmaster);
	if (ret < 0)
		return ret;

	i = 0;
	while (elems[i].name) {
		control = snd_ctl_new1(&elems[i], rt);
		if (!control)
			return -ENOMEM;
		ret = snd_ctl_add(card, control);
		if (ret < 0)
			return ret;
		ret = snd_ctl_add_slave(vmaster, control);
		if (ret < 0)
			return ret;
		i++;
	}
	return 0;
}

int usb6fire_control_init(struct sfire_chip *chip)
{
	int i;
	int ret;
	struct control_runtime *rt = kzalloc(sizeof(struct control_runtime),
			GFP_KERNEL);
	struct comm_runtime *comm_rt = chip->comm;

	if (!rt)
		return -ENOMEM;

	rt->chip = chip;
	rt->update_streaming = usb6fire_control_streaming_update;
	rt->set_rate = usb6fire_control_set_rate;
	rt->set_channels = usb6fire_control_set_channels;

	i = 0;
	while (init_data[i].type) {
		comm_rt->write8(comm_rt, init_data[i].type, init_data[i].reg,
				init_data[i].value);
		i++;
	}

	usb6fire_control_opt_coax_update(rt);
	usb6fire_control_line_phono_update(rt);
	usb6fire_control_output_vol_update(rt);
	usb6fire_control_output_mute_update(rt);
	usb6fire_control_input_vol_update(rt);
	usb6fire_control_streaming_update(rt);

	ret = usb6fire_control_add_virtual(rt, chip->card,
		"Master Playback Volume", vol_elements);
	if (ret) {
		dev_err(&chip->dev->dev, "cannot add control.\n");
		kfree(rt);
		return ret;
	}
	ret = usb6fire_control_add_virtual(rt, chip->card,
		"Master Playback Switch", mute_elements);
	if (ret) {
		dev_err(&chip->dev->dev, "cannot add control.\n");
		kfree(rt);
		return ret;
	}

	i = 0;
	while (elements[i].name) {
		ret = snd_ctl_add(chip->card, snd_ctl_new1(&elements[i], rt));
		if (ret < 0) {
			kfree(rt);
			dev_err(&chip->dev->dev, "cannot add control.\n");
			return ret;
		}
		i++;
	}

	chip->control = rt;
	return 0;
}

void usb6fire_control_abort(struct sfire_chip *chip)
{}

void usb6fire_control_destroy(struct sfire_chip *chip)
{
	kfree(chip->control);
	chip->control = NULL;
}


text:
title: ViiMed's Tasklist
client: ViiMed
type: Interface
thumbnail: viimed-tasklist/thumbnail.gif
asset: viimed-tasklist/asset.png
weight: 1
---


text:
package net.genesishub.gFeatures.API.PlayerStats;

import java.io.File;
import java.util.HashMap;

import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;

public class gPlayer {
	private Player player;
	private String uuid;
	private String name;
	Setup setup = new Setup();
	private HashMap<String, String> values = new HashMap<>();
	public gPlayer(Player players){
		player = players;
		uuid = players.getUniqueId().toString();
		name = player.getName();
	}
	public gPlayer(String UUID, String names){
		uuid = UUID;
		name = names;
	}
	public Player getPlayer(){
		return player;
	}
	public String getUUID(){
		return uuid;
	}
	public String getName(){
		return name;
	}
	public HashMap<String, String> getValues(){
		return values;
	}
	public void setPlayer(Player p){
		player = p;
	}
	@Deprecated
	public void setUUID(String uuids){
		uuid = uuids;
	}
	@Deprecated
	public void setName(String names){
		name = names;
	}
	public void setValue(String valuename, String value){
		values.remove(valuename);
		values.put(valuename, value);
		setup.smartFlush(this, valuename, value);
		//setup.flushPlayer(this);
	}
	@Deprecated
	public void addValue(String valuename, String value){
		values.put(valuename, value);
	}
	public void removeValue(String valuename, String value){
		values.remove(valuename, value);
		setup.flushPlayer(this);
	}
	public void removeValue(String valuename){
		values.remove(valuename);
		setup.flushPlayer(this);
	}
	public String getValue(String valuename){
		/*File f = new File("plugins/gFeatures/Players/" + uuid + ".yml");
		YamlConfiguration yamlFile = YamlConfiguration.loadConfiguration(f);
		return yamlFile.get("Config." + valuename).toString();*/
		return values.get(valuename);
	}
	public String getStrictValue(String valuename){
		return values.get(valuename);
	}
	public void clearCache(){
		values = null;
		values = new HashMap<>();
	}
}


text:
package com.google.cloud.bigquery;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import com.google.cloud.bigquery.StandardTableDefinition.StreamingBuffer;

import org.junit.Test;

public class TableDefinitionTest {

  private static final Field FIELD_SCHEMA1 =
      Field.builder("StringField", Field.Type.string())
          .mode(Field.Mode.NULLABLE)
          .description("FieldDescription1")
          .build();
  private static final Field FIELD_SCHEMA2 =
      Field.builder("IntegerField", Field.Type.integer())
          .mode(Field.Mode.REPEATED)
          .description("FieldDescription2")
          .build();
  private static final Field FIELD_SCHEMA3 =
      Field.builder("RecordField", Field.Type.record(FIELD_SCHEMA1, FIELD_SCHEMA2))
          .mode(Field.Mode.REQUIRED)
          .description("FieldDescription3")
          .build();
  private static final Schema TABLE_SCHEMA = Schema.of(FIELD_SCHEMA1, FIELD_SCHEMA2, FIELD_SCHEMA3);
  private static final Long NUM_BYTES = 42L;
  private static final Long NUM_ROWS = 43L;
  private static final String LOCATION = "US";
  private static final StreamingBuffer STREAMING_BUFFER = new StreamingBuffer(1L, 2L, 3L);
  private static final StandardTableDefinition TABLE_DEFINITION =
      StandardTableDefinition.builder()
          .location(LOCATION)
          .numBytes(NUM_BYTES)
          .numRows(NUM_ROWS)
          .streamingBuffer(STREAMING_BUFFER)
          .schema(TABLE_SCHEMA)
          .build();

  @Test
  public void testToBuilder() {
    compareTableDefinition(TABLE_DEFINITION, TABLE_DEFINITION.toBuilder().build());
    StandardTableDefinition tableDefinition = TABLE_DEFINITION.toBuilder().location("EU").build();
    assertEquals("EU", tableDefinition.location());
    tableDefinition = tableDefinition.toBuilder()
        .location(LOCATION)
        .build();
    compareTableDefinition(TABLE_DEFINITION, tableDefinition);
  }

  @Test
  public void testToBuilderIncomplete() {
    StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA);
    assertEquals(tableDefinition, tableDefinition.toBuilder().build());
  }

  @Test
  public void testBuilder() {
    assertEquals(TableDefinition.Type.TABLE, TABLE_DEFINITION.type());
    assertEquals(TABLE_SCHEMA, TABLE_DEFINITION.schema());
    assertEquals(LOCATION, TABLE_DEFINITION.location());
    assertEquals(NUM_BYTES, TABLE_DEFINITION.numBytes());
    assertEquals(NUM_ROWS, TABLE_DEFINITION.numRows());
    assertEquals(STREAMING_BUFFER, TABLE_DEFINITION.streamingBuffer());
  }

  @Test
  public void testToAndFromPb() {
    assertTrue(TableDefinition.fromPb(TABLE_DEFINITION.toPb()) instanceof StandardTableDefinition);
    compareTableDefinition(TABLE_DEFINITION,
        TableDefinition.<StandardTableDefinition>fromPb(TABLE_DEFINITION.toPb()));
  }

  private void compareTableDefinition(StandardTableDefinition expected,
      StandardTableDefinition value) {
    assertEquals(expected, value);
    assertEquals(expected.schema(), value.schema());
    assertEquals(expected.type(), value.type());
    assertEquals(expected.numBytes(), value.numBytes());
    assertEquals(expected.numRows(), value.numRows());
    assertEquals(expected.location(), value.location());
    assertEquals(expected.streamingBuffer(), value.streamingBuffer());
    assertEquals(expected.type(), value.type());
    assertEquals(expected.hashCode(), value.hashCode());
  }
}


text:
#ifndef IIR1_TYPES_H
#define IIR1_TYPES_H

#include "Common.h"
#include "MathSupplement.h"

namespace Iir {

/**
 * A conjugate or real pair
 **/
	struct IIR_EXPORT ComplexPair : complex_pair_t
	{
		ComplexPair() = default;

		explicit ComplexPair (const complex_t& c1)
			: complex_pair_t (c1, 0.)
		{
			if (!isReal()) throw_invalid_argument("A single complex number needs to be real.");
		}

		ComplexPair (const complex_t& c1,
			     const complex_t& c2)
			: complex_pair_t (c1, c2)
		{
		}

		bool isConjugate () const
		{
			return second == std::conj (first);
		}

		bool isReal () const
		{
			return first.imag() == 0 && second.imag() == 0;
		}

		/**
		 * Returns true if this is either a conjugate pair,
		 * or a pair of reals where neither is zero.
		 */
		bool isMatchedPair () const
		{
			if (first.imag() != 0)
				return second == std::conj (first);
			else
				return second.imag () == 0 &&
					second.real () != 0 &&
					first.real () != 0;
		}

		bool is_nan () const
		{
			return Iir::is_nan (first) || Iir::is_nan (second);
		}
	};

/**
 * A pair of pole/zeros. This fits in a biquad (but is missing the gain)
 **/
	struct IIR_EXPORT PoleZeroPair
	{
		ComplexPair poles = ComplexPair();
		ComplexPair zeros = ComplexPair();

		PoleZeroPair () = default;

		// single pole/zero
		PoleZeroPair (const complex_t& p, const complex_t& z)
			: poles (p), zeros (z)
		{
		}

		// pole/zero pair
		PoleZeroPair (const complex_t& p1, const complex_t& z1,
			      const complex_t& p2, const complex_t& z2)
			: poles (p1, p2)
			, zeros (z1, z2)
		{
		}

		bool isSinglePole () const
		{
			return poles.second == 0. && zeros.second == 0.;
		}

		bool is_nan () const
		{
			return poles.is_nan() || zeros.is_nan();
		}
	};

/**
 * Identifies the general class of filter
 **/
	enum Kind
	{
		kindLowPass,
		kindHighPass,
		kindBandPass,
		kindBandStop,
		kindLowShelf,
		kindHighShelf,
		kindBandShelf,
		kindOther
	};

}

#endif


text:
void Terminal_Init();
void Terminal_Test();
void Terminal_Write(const char *buffer, unsigned int ui32Count);
void Terminal_Writeln(const char *buffer, unsigned int ui32Count);
unsigned int Terminal_Recv(char* buffer, unsigned int ui32Count);

#endif


text:
package org.jboss.logmanager;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Comparator;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

import java.util.logging.Handler;

/**
 * Utility for snapshot/copy-on-write arrays.  To use these methods, two things are required: an immutable array
 * stored on a volatile field, and an instance of
 * {@link java.util.concurrent.atomic.AtomicReferenceFieldUpdater AtomicReferenceFieldUpdater}
 * which corresponds to that field.  Some of these methods perform multi-step operations; if the array field value is
 * changed in the middle of such an operation, the operation is retried.  To avoid spinning, in some situations it
 * may be advisable to hold a write lock to prevent multiple concurrent updates.
 *
 * @param <T> the type which contains the target field
 * @param <V> the array value type
 */
final class AtomicArray<T, V> {

    private final AtomicReferenceFieldUpdater<T, V[]> updater;
    private final Class<V> componentType;
    private final V[] emptyArray;

    /**
     * Construct an instance.
     *
     * @param updater the field updater
     * @param componentType the component class
     */
    public AtomicArray(AtomicReferenceFieldUpdater<T, V[]> updater, Class<V> componentType) {
        this.updater = updater;
        this.componentType = componentType;
        emptyArray = newInstance(componentType, 0);
    }

    /**
     * Convenience method to create an instance.
     *
     * @param updater the field updater
     * @param componentType the component class
     * @param <T> the type which contains the target field
     * @param <V> the array value type
     * @return the new instance
     */
    public static <T, V> AtomicArray<T, V> create(AtomicReferenceFieldUpdater<T, V[]> updater, Class<V> componentType) {
        return new AtomicArray<T,V>(updater, componentType);
    }

    /**
     * Convenience method to set the field value to the empty array.  Empty array instances are shared.
     *
     * @param instance the instance holding the field
     */
    public void clear(T instance) {
        updater.set(instance, emptyArray);
    }

    /**
     * Update the value of this array.
     *
     * @param instance the instance holding the field
     * @param value the new value
     */
    public void set(T instance, V[] value) {
        updater.set(instance, value);
    }

    /**
     * Atomically get and update the value of this array.
     *
     * @param instance the instance holding the field
     * @param value the new value
     */
    public V[] getAndSet(T instance, V[] value) {
        return updater.getAndSet(instance, value);
    }

    @SuppressWarnings({ "unchecked" })
    private static <V> V[] copyOf(final Class<V> componentType, V[] old, int newLen) {
        final V[] target = newInstance(componentType, newLen);
        System.arraycopy(old, 0, target, 0, Math.min(old.length, newLen));
        return target;
    }

    /**
     * Atomically replace the array with a new array which is one element longer, and which includes the given value.
     *
     * @param instance the instance holding the field
     * @param value the updated value
     */
    public void add(T instance, V value) {
        final AtomicReferenceFieldUpdater<T, V[]> updater = this.updater;
        for (;;) {
            final V[] oldVal = updater.get(instance);
            final int oldLen = oldVal.length;
            final V[] newVal = copyOf(componentType, oldVal, oldLen + 1);
            newVal[oldLen] = value;
            if (updater.compareAndSet(instance, oldVal, newVal)) {
                return;
            }
        }
    }

    /**
     * Atomically replace the array with a new array which is one element longer, and which includes the given value,
     * if the value is not already present within the array.  This method does a linear search for the target value.
     *
     * @param instance the instance holding the field
     * @param value the updated value
     * @param identity {@code true} if comparisons should be done using reference identity, or {@code false} to use the {@code equals()} method
     * @return {@code true} if the value was added, or {@code false} if it was already present
     */
    public boolean addIfAbsent(T instance, V value, boolean identity) {
        final AtomicReferenceFieldUpdater<T, V[]> updater = this.updater;
        for (;;) {
            final V[] oldVal = updater.get(instance);
            final int oldLen = oldVal.length;
            if (identity || value == null) {
                for (int i = 0; i < oldLen; i++) {
                    if (oldVal[i] == value) {
                        return false;
                    }
                }
            } else {
                for (int i = 0; i < oldLen; i++) {
                    if (value.equals(oldVal[i])) {
                        return false;
                    }
                }
            }
            final V[] newVal = copyOf(componentType, oldVal, oldLen + 1);
            newVal[oldLen] = value;
            if (updater.compareAndSet(instance, oldVal, newVal)) {
                return true;
            }
        }
    }

    /**
     * Atomically replace the array with a new array which does not include the first occurrence of the given value, if
     * the value is present in the array.
     *
     * @param instance the instance holding the field
     * @param value the updated value
     * @param identity {@code true} if comparisons should be done using reference identity, or {@code false} to use the {@code equals()} method
     * @return {@code true} if the value was removed, or {@code false} if it was not present
     */
    public boolean remove(T instance, V value, boolean identity) {
        final AtomicReferenceFieldUpdater<T, V[]> updater = this.updater;
        for (;;) {
            final V[] oldVal = updater.get(instance);
            final int oldLen = oldVal.length;
            if (oldLen == 0) {
                return false;
            } else {
                int index = -1;
                if (identity || value == null) {
                    for (int i = 0; i < oldLen; i++) {
                        if (oldVal[i] == value) {
                            index = i;
                            break;
                        }
                    }
                } else {
                    for (int i = 0; i < oldLen; i++) {
                        if (value.equals(oldVal[i])) {
                            index = i;
                            break;
                        }
                    }
                }
                if (index == -1) {
                    return false;
                }
                final V[] newVal = newInstance(componentType, oldLen - 1);
                System.arraycopy(oldVal, 0, newVal, 0, index);
                System.arraycopy(oldVal, index + 1, newVal, index, oldLen - index - 1);
                if (updater.compareAndSet(instance, oldVal, newVal)) {
                    return true;
                }
            }
        }
    }

    /**
     * Atomically replace the array with a new array which does not include any occurrences of the given value, if
     * the value is present in the array.
     *
     * @param instance the instance holding the field
     * @param value the updated value
     * @param identity {@code true} if comparisons should be done using reference identity, or {@code false} to use the {@code equals()} method
     * @return the number of values removed
     */
    public int removeAll(T instance, V value, boolean identity) {
        final AtomicReferenceFieldUpdater<T, V[]> updater = this.updater;
        for (;;) {
            final V[] oldVal = updater.get(instance);
            final int oldLen = oldVal.length;
            if (oldLen == 0) {
                return 0;
            } else {
                final boolean[] removeSlots = new boolean[oldLen];
                int removeCount = 0;
                if (identity || value == null) {
                    for (int i = 0; i < oldLen; i++) {
                        if (oldVal[i] == value) {
                            removeSlots[i] = true;
                            removeCount++;
                        }
                    }
                } else {
                    for (int i = 0; i < oldLen; i++) {
                        if (value.equals(oldVal[i])) {
                            removeSlots[i] = true;
                            removeCount++;
                        }
                    }
                }
                if (removeCount == 0) {
                    return 0;
                }
                final int newLen = oldLen - removeCount;
                final V[] newVal;
                if (newLen == 0) {
                    newVal = emptyArray;
                } else {
                    newVal = newInstance(componentType, newLen);
                    for (int i = 0, j = 0; i < oldLen; i ++) {
                        if (! removeSlots[i]) {
                            newVal[j++] = oldVal[i];
                        }
                    }
                }
                if (updater.compareAndSet(instance, oldVal, newVal)) {
                    return removeCount;
                }
            }
        }
    }

    /**
     * Add a value to a sorted array.  Does not check for duplicates.
     *
     * @param instance the instance holding the field
     * @param value the value to add
     * @param comparator a comparator, or {@code null} to use natural ordering
     */
    public void add(T instance, V value, Comparator<? super V> comparator) {
        final AtomicReferenceFieldUpdater<T, V[]> updater = this.updater;
        for (;;) {
            final V[] oldVal = updater.get(instance);
            final int oldLen = oldVal.length;
            final int pos = insertionPoint(Arrays.binarySearch(oldVal, value, comparator));
            final V[] newVal = newInstance(componentType, oldLen + 1);
            System.arraycopy(oldVal, 0, newVal, 0, pos);
            newVal[pos] = value;
            System.arraycopy(oldVal, pos, newVal, pos + 1, oldLen - pos);
            if (updater.compareAndSet(instance, oldVal, newVal)) {
                return;
            }
        }
    }

    /**
     * Add a value to a sorted array if it is not already present.  Does not check for duplicates.
     *
     * @param instance the instance holding the field
     * @param value the value to add
     * @param comparator a comparator, or {@code null} to use natural ordering
     */
    public boolean addIfAbsent(T instance, V value, Comparator<? super V> comparator) {
        final AtomicReferenceFieldUpdater<T, V[]> updater = this.updater;
        for (;;) {
            final V[] oldVal = updater.get(instance);
            final int oldLen = oldVal.length;
            final int pos = Arrays.binarySearch(oldVal, value, comparator);
            if (pos < 0) {
                return false;
            }
            final V[] newVal = newInstance(componentType, oldLen + 1);
            System.arraycopy(oldVal, 0, newVal, 0, pos);
            newVal[pos] = value;
            System.arraycopy(oldVal, pos, newVal, pos + 1, oldLen - pos);
            if (updater.compareAndSet(instance, oldVal, newVal)) {
                return true;
            }
        }
    }

    /**
     * Remove a value to a sorted array.  Does not check for duplicates.  If there are multiple occurrences of a value,
     * there is no guarantee as to which one is removed.
     *
     * @param instance the instance holding the field
     * @param value the value to remove
     * @param comparator a comparator, or {@code null} to use natural ordering
     */
    public boolean remove(T instance, V value, Comparator<? super V> comparator) {
        final AtomicReferenceFieldUpdater<T, V[]> updater = this.updater;
        for (;;) {
            final V[] oldVal = updater.get(instance);
            final int oldLen = oldVal.length;
            if (oldLen == 0) {
                return false;
            } else {
                final int pos = Arrays.binarySearch(oldVal, value, comparator);
                if (pos < 0) {
                    return false;
                }
                final V[] newVal = newInstance(componentType, oldLen - 1);
                System.arraycopy(oldVal, 0, newVal, 0, pos);
                System.arraycopy(oldVal, pos + 1, newVal, pos, oldLen - pos - 1);
                if (updater.compareAndSet(instance, oldVal, newVal)) {
                    return true;
                }
            }
        }
    }

    /**
     * Sort an array.
     *
     * @param instance the instance holding the field
     * @param comparator a comparator, or {@code null} to use natural ordering
     */
    public void sort(T instance, Comparator<? super V> comparator) {
        final AtomicReferenceFieldUpdater<T, V[]> updater = this.updater;
        for (;;) {
            final V[] oldVal = updater.get(instance);
            if (oldVal.length == 0) {
                return;
            }
            final V[] newVal = oldVal.clone();
            Arrays.sort(newVal, comparator);
            if (updater.compareAndSet(instance, oldVal, newVal)) {
                return;
            }
        }
    }

    private static int insertionPoint(int searchResult) {
        return searchResult > 0 ? searchResult : - (searchResult + 1);
    }

    @SuppressWarnings({ "unchecked" })
    private static <V> V[] newInstance(Class<V> componentType, int length) {
        if (componentType == Handler.class) {
            return (V[]) new Handler[length];
        } else if (componentType == Object.class) {
            return (V[]) new Object[length];
        } else {
            return (V[]) Array.newInstance(componentType, length);
        }
    }

    /**
     * Compare and set the array.
     *
     * @param instance the instance holding the field
     * @param expect the expected value
     * @param update the update value
     * @return {@code true} if the value was updated or {@code false} if the expected value did not match
     */
    public boolean compareAndSet(final T instance, final V[] expect, final V[] update) {
        return updater.compareAndSet(instance, expect, update);
    }
}


text:
def verbose(parser, options=('-v', '--verbose'), help='increase verbosity'):
    """Add -v and --verbose options to an ArgumentParser

    :param parser: an argparse.ArgumentParser instance
    :param options: overrides the default `-v, --verbose` options.
    :param help: overrides the default help text.

    """
    parser.add_argument(help=help, default=False, action='store_true', *options)


text:
package com.google.appengine.v1.stub;

import static com.google.appengine.v1.VersionsClient.ListVersionsPagedResponse;

import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.appengine.v1.CreateVersionMetadataV1;
import com.google.appengine.v1.CreateVersionRequest;
import com.google.appengine.v1.DeleteVersionRequest;
import com.google.appengine.v1.GetVersionRequest;
import com.google.appengine.v1.ListVersionsRequest;
import com.google.appengine.v1.ListVersionsResponse;
import com.google.appengine.v1.OperationMetadataV1;
import com.google.appengine.v1.UpdateVersionRequest;
import com.google.appengine.v1.Version;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import com.google.protobuf.Empty;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Base stub class for the Versions service API.
 *
 * <p>This class is for advanced usage and reflects the underlying API directly.
 */
@Generated("by gapic-generator-java")
public abstract class VersionsStub implements BackgroundResource {

  public OperationsStub getOperationsStub() {
    return null;
  }

  public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
    return null;
  }

  public UnaryCallable<ListVersionsRequest, ListVersionsPagedResponse> listVersionsPagedCallable() {
    throw new UnsupportedOperationException("Not implemented: listVersionsPagedCallable()");
  }

  public UnaryCallable<ListVersionsRequest, ListVersionsResponse> listVersionsCallable() {
    throw new UnsupportedOperationException("Not implemented: listVersionsCallable()");
  }

  public UnaryCallable<GetVersionRequest, Version> getVersionCallable() {
    throw new UnsupportedOperationException("Not implemented: getVersionCallable()");
  }

  public OperationCallable<CreateVersionRequest, Version, CreateVersionMetadataV1>
      createVersionOperationCallable() {
    throw new UnsupportedOperationException("Not implemented: createVersionOperationCallable()");
  }

  public UnaryCallable<CreateVersionRequest, Operation> createVersionCallable() {
    throw new UnsupportedOperationException("Not implemented: createVersionCallable()");
  }

  public OperationCallable<UpdateVersionRequest, Version, OperationMetadataV1>
      updateVersionOperationCallable() {
    throw new UnsupportedOperationException("Not implemented: updateVersionOperationCallable()");
  }

  public UnaryCallable<UpdateVersionRequest, Operation> updateVersionCallable() {
    throw new UnsupportedOperationException("Not implemented: updateVersionCallable()");
  }

  public OperationCallable<DeleteVersionRequest, Empty, OperationMetadataV1>
      deleteVersionOperationCallable() {
    throw new UnsupportedOperationException("Not implemented: deleteVersionOperationCallable()");
  }

  public UnaryCallable<DeleteVersionRequest, Operation> deleteVersionCallable() {
    throw new UnsupportedOperationException("Not implemented: deleteVersionCallable()");
  }

  @Override
  public abstract void close();
}


text:
package com.xiantrimble.dropwizard.copycat.example;

import com.xiantrimble.dropwizard.copycat.CopycatConfiguration;

import io.dropwizard.Configuration;

public class CopycatExampleConfiguration extends Configuration {

  public CopycatConfiguration copycat;

  public CopycatConfiguration getCopycat() {
    return copycat;
  }

  public void setCopycat(CopycatConfiguration copycat) {
    this.copycat = copycat;
  }

}


text:
package cmd

import (
	"fmt"
	"io"

	kapi "k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/errors"
	"k8s.io/kubernetes/pkg/fields"
	cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
	"k8s.io/kubernetes/pkg/labels"
	"k8s.io/kubernetes/pkg/watch"

	"github.com/openshift/origin/pkg/client"
	"github.com/openshift/origin/pkg/cmd/cli/describe"
	imageapi "github.com/openshift/origin/pkg/image/api"
	"github.com/spf13/cobra"

	"github.com/openshift/origin/pkg/cmd/util/clientcmd"
)

const (
	importImageLong = `
Import tag and image information from an external Docker image repository

Only image streams that have a value set for spec.dockerImageRepository may
have tag and image information imported.`

	importImageExample = `  $ %[1]s import-image mystream`
)

// NewCmdImportImage implements the OpenShift cli import-image command.
func NewCmdImportImage(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
	cmd := &cobra.Command{
		Use:     "import-image IMAGESTREAM",
		Short:   "Imports images from a Docker registry",
		Long:    importImageLong,
		Example: fmt.Sprintf(importImageExample, fullName),
		Run: func(cmd *cobra.Command, args []string) {
			err := RunImportImage(f, out, cmd, args)
			cmdutil.CheckErr(err)
		},
	}
	cmd.Flags().String("from", "", "A Docker image repository to import images from")
	cmd.Flags().Bool("confirm", false, "If true, allow the image stream import location to be set or changed")

	return cmd
}

// RunImportImage contains all the necessary functionality for the OpenShift cli import-image command.
func RunImportImage(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
	if len(args) == 0 || len(args[0]) == 0 {
		return cmdutil.UsageError(cmd, "you must specify the name of an image stream")
	}

	streamName := args[0]
	namespace, _, err := f.DefaultNamespace()
	if err != nil {
		return err
	}

	osClient, _, err := f.Clients()
	if err != nil {
		return err
	}

	from := cmdutil.GetFlagString(cmd, "from")
	confirm := cmdutil.GetFlagBool(cmd, "confirm")

	imageStreamClient := osClient.ImageStreams(namespace)
	stream, err := imageStreamClient.Get(streamName)
	if err != nil {
		if len(from) == 0 || !errors.IsNotFound(err) {
			return err
		}
		if !confirm {
			return fmt.Errorf("the image stream does not exist, pass --confirm to create")
		}
		stream = &imageapi.ImageStream{
			ObjectMeta: kapi.ObjectMeta{Name: streamName},
			Spec:       imageapi.ImageStreamSpec{DockerImageRepository: from},
		}
	} else {
		if len(stream.Spec.DockerImageRepository) == 0 {
			if len(from) == 0 {
				return fmt.Errorf("only image streams with spec.dockerImageRepository set may have images imported")
			}
			if !confirm {
				return fmt.Errorf("the image stream already has an import repository set, pass --confirm to update")
			}
			stream.Spec.DockerImageRepository = from
		} else {
			if len(from) != 0 {
				if from != stream.Spec.DockerImageRepository {
					if !confirm {
						return fmt.Errorf("the image stream has a different import spec %q, pass --confirm to update", stream.Spec.DockerImageRepository)
					}
				}
			}
		}
	}

	if stream.Annotations != nil {
		delete(stream.Annotations, imageapi.DockerImageRepositoryCheckAnnotation)
	}

	if stream.CreationTimestamp.IsZero() {
		stream, err = imageStreamClient.Create(stream)
	} else {
		stream, err = imageStreamClient.Update(stream)
	}
	if err != nil {
		return err
	}

	resourceVersion := stream.ResourceVersion

	fmt.Fprintln(cmd.Out(), "Waiting for the import to complete, CTRL+C to stop waiting.")

	stream, err = waitForImport(imageStreamClient, stream.Name, resourceVersion)
	if err != nil {
		return fmt.Errorf("unable to determine if the import completed successfully - please run 'oc describe -n %s imagestream/%s' to see if the tags were updated as expected: %v", stream.Namespace, stream.Name, err)
	}

	fmt.Fprintln(cmd.Out(), "The import completed successfully.\n")

	d := describe.ImageStreamDescriber{osClient}
	info, err := d.Describe(stream.Namespace, stream.Name)
	if err != nil {
		return err
	}

	fmt.Fprintln(out, info)
	return nil
}

func hasImportAnnotation(stream *imageapi.ImageStream) bool {
	return stream.Annotations != nil && len(stream.Annotations[imageapi.DockerImageRepositoryCheckAnnotation]) != 0
}

func waitForImport(imageStreamClient client.ImageStreamInterface, name, resourceVersion string) (*imageapi.ImageStream, error) {
	streamWatch, err := imageStreamClient.Watch(labels.Everything(), fields.SelectorFromSet(fields.Set{"name": name}), resourceVersion)
	if err != nil {
		return nil, err
	}
	defer streamWatch.Stop()

	for {
		select {
		case event, ok := <-streamWatch.ResultChan():
			if !ok {
				return nil, fmt.Errorf("image stream watch ended prematurely")
			}

			switch event.Type {
			case watch.Modified:
				s, ok := event.Object.(*imageapi.ImageStream)
				if !ok {
					continue
				}

				if hasImportAnnotation(s) {
					return s, nil
				}
			case watch.Deleted:
				return nil, fmt.Errorf("the image stream was deleted")
			case watch.Error:
				return nil, fmt.Errorf("error watching image stream")
			}
		}
	}
}