text:
/*
 * O Acesso da árvore é feita a partir de pós-ordem ou seja acessa todos da esquerda, depois da direita e por último a raiz
 */
package repositorio;

import Model.No;

/**
 *
 * @author fabio
 * @param <V>
 */
public class ArvoreBinaria<V> {

    private No raiz;

    public Boolean estaVazia() {
        Boolean vazia = false;
        if (raiz == null) {
            return vazia = true;
        }
        return vazia;
    }

    public int getQuantidade() {
        System.out.print("Quantidade: ");
        return getQuantidadeNos(this.raiz);
    }

    public void adicionar(int key, V valor) {

        if (this.raiz == null) {
            this.raiz = new No(valor, key);
        } else {
            inserir(this.raiz, key, valor);
        }
    }

    public void listaArvore() {
        System.out.println("Imprimindo árvore em pós-ordem");
        System.out.println("=====================");
        if (this.raiz == null) {
            System.out.println("Árvore Vazia");
        } else {
            imprimirArvore(this.raiz);
        }
    }

    public No exclui(int valor) throws Exception {
        return remove(this.raiz, valor);
    }

    public No pesquisa(int valor) throws Exception {
        return encontraValor(this.raiz, valor);
    }

    public void Atualiza(int key, V valor) {
        atualizar(this.raiz, key, valor);
    }

    public void desenha(){
        if (this.raiz == null){
            System.out.println("Não tem elementos para desenhar");
        }
        this.desenhaArvore(this.raiz);
    }

    //Métodos Privados
    private int getQuantidadeNos(No raiz) {
        int tamanho = 0;
        if (raiz == null) {
            return tamanho;
        }
        int quantidadeNoEsq = getQuantidadeNos(raiz.getNoEsquerda());
        int quantidadeNoDir = getQuantidadeNos(raiz.getNoDireita());
        tamanho = (quantidadeNoEsq + quantidadeNoDir + 1);
        return tamanho;
    }

    private void inserir(No elemento, int key, V valor) {

        if (key == elemento.getKey()) {
            System.err.println("Não pode adicionar números repetidos");
        }

        if (key < elemento.getKey()) {//Verifica se o valor é menor que o do nó

            if (elemento.getNoEsquerda() != null) {
                inserir(elemento.getNoEsquerda(), key, valor);
            } else {
                //Nó esquerdo vazio
                elemento.setNoEsquerda(new No(valor, key));
            }

        } else if (key > elemento.getKey()) {//Verifica se o valor é maior que o do nó

            if (elemento.getNoDireita() != null) {
                inserir(elemento.getNoDireita(), key, valor);
            } else {
                //Nó direito vazio
                elemento.setNoDireita(new No(valor, key));
            }

        }

    }

    private void atualizar(No elemento, int key, V valor) {
        if (this.raiz == null) {
            throw new IllegalArgumentException("Árvore Vazia");
        } else {
            if (key == elemento.getKey()) {
                elemento.setValor(valor);
            } else if (key < elemento.getKey()) {
                if (elemento.getNoEsquerda() != null) {
                    atualizar(elemento.getNoEsquerda(), key, valor);
                }
            } else if (key > elemento.getKey()) {
                if (elemento.getNoDireita() != null) {
                    atualizar(elemento.getNoDireita(), key, valor);
                }
            }

        }
    }

    private void desenhaArvore(No elemento) {

        if (elemento.quantidadeFilhos() == 0) {
            System.out.println("(" + elemento.getKey() + ")");

        } else if (elemento.quantidadeFilhos() == 1) {

            System.out.println("(" + elemento.getKey() + ")");

            if (elemento.getNoEsquerda() != null){
                System.out.println("/");
                desenhaArvore(elemento.getNoEsquerda());

            } else if (elemento.getNoDireita() != null){
                System.out.println("\\");
                desenhaArvore(elemento.getNoDireita());
            }

        } else if (elemento.quantidadeFilhos() == 2) {
            System.out.println("("+elemento.getKey()+")");
            System.out.println("      /                   \\");
            System.out.println("(" + elemento.getNoEsquerda().getKey() + ")              (" + elemento.getNoDireita().getKey() + ")");

            if (elemento.getNoEsquerda().quantidadeFilhos() != 0){
                desenhaArvore(elemento.getNoEsquerda());
            } else if (elemento.getNoDireita().quantidadeFilhos() != 0 ){
                desenhaArvore(elemento.getNoDireita());
            }
        }
    }

    private void imprimirArvore(No elemento) {

        if (elemento.getNoEsquerda() != null) {

            imprimirArvore(elemento.getNoEsquerda());
            System.out.println("Elemento Da esquerda");
            System.out.println("Do nó:" + elemento.getValor() + "key: " + elemento.getKey());

            System.out.println("=====================");
        }
        if (elemento.getNoDireita() != null) {

            imprimirArvore(elemento.getNoDireita());
            System.out.println("Elemento da direita");
            System.out.println("Do nó:" + elemento.getValor() + "key: " + elemento.getKey());
            System.out.println("=====================");
        }
        System.out.println("Nó:" + elemento.getValor() + "key: " + elemento.getKey());
        if (elemento == this.raiz) {
            System.out.println("Raiz");
            System.out.println("=====================");
        }
    }

    private No remove(No elemento, int key) throws Exception {
        if (this.raiz == null) {
            throw new Exception("Árvore Vazia");
        } else {

            if (key < elemento.getKey()) {
                elemento.setNoEsquerda(remove(elemento.getNoEsquerda(), key));
            } else if (key > elemento.getKey()) {
                elemento.setNoEsquerda(remove(elemento.getNoDireita(), key));
            } else if (elemento.getNoEsquerda() != null && elemento.getNoDireita() != null) {
                //2 nós filhos

                elemento.setValor(encontraMinimo(elemento.getNoDireita()).getValor());
                elemento.setNoDireita(removeMinimo(elemento.getNoDireita()));
            } else {

                elemento = (elemento.getNoEsquerda() != null) ? elemento.getNoEsquerda() : elemento.getNoDireita();
            }
            return elemento;
        }

    }

    private No removeMinimo(No elemento) {
        if (elemento == null) {
            System.out.println("  ERRO ");
        } else if (elemento.getNoEsquerda() != null) {
            elemento.setNoEsquerda(removeMinimo(elemento.getNoEsquerda()));
            return elemento;
        } else {
            return elemento.getNoDireita();
        }
        return null;
    }

    private No encontraMinimo(No elemento) {
        if (elemento != null) {
            while (elemento.getNoEsquerda() != null) {
                elemento = elemento.getNoEsquerda();
            }
        }
        return elemento;
    }

    private No encontraValor(No elemento, int key) throws Exception {

        if (this.raiz == null) {
            throw new Exception("Árvore Vazia");
        } else {

            if (key == elemento.getKey()) {

                return elemento;

            } else if (key < elemento.getKey()) {

                if (elemento.getNoEsquerda() != null) {
                    return encontraValor(elemento.getNoEsquerda(), key);
                }

            } else if (key > elemento.getKey()) {

                if (elemento.getNoDireita() != null) {
                    return encontraValor(elemento.getNoDireita(), key);
                }

            }

        }

        return elemento;
    }

    public No pegarParente(int key) {
        No aux = this.raiz;

        while (aux != null) {
            No esquerdo = aux.getNoEsquerda();
            No direito = aux.getNoDireita();

            if (aux.getKey() == key || (esquerdo != null && esquerdo.getKey() == key) || (direito != null && direito.getKey() == key)) {
                return aux;
            } else if (key < aux.getKey()) {
                aux = esquerdo;
            } else {
                aux = direito;
            }
        }
        return null;
    }

    //pega o maior valor da subarvore da esquerda
    public No pegarSucessor(No elemento) {
        No aux = elemento.getNoEsquerda();

        while (aux != null) {
            No direito = aux.getNoDireita();

            if (direito != null) {
                aux = aux.getNoDireita();
            } else {
                return aux;
            }
        }

        return null;
    }

}


text:
#include <mitkTestingMacros.h>
#include <mitkKinectDevice.h>

/**Documentation
 *  test for the class "KinectDevice".
 */
int mitkKinectDeviceTest(int /* argc */, char* /*argv*/[])
{

  MITK_TEST_BEGIN("KinectDevice");
  //Try to connect a device. In failure case an exception is thrown.
  mitk::KinectDevice::Pointer kinectDevice = mitk::KinectDevice::New();
  try
  {
  MITK_TEST_CONDITION_REQUIRED(kinectDevice.IsNotNull(),"Testing initialzation!");
  MITK_TEST_CONDITION_REQUIRED(kinectDevice->ConnectCamera(),"Testing ConnectCamera()");
  MITK_TEST_OUTPUT(<<"Testing StartCamera()");
  kinectDevice->StartCamera();
  int captureHeight = kinectDevice->GetCaptureHeight();
  int captureWidth = kinectDevice->GetCaptureWidth();
  MITK_TEST_CONDITION_REQUIRED(captureHeight== 480 ,"Testing initialization of CaptureHeight");
  MITK_TEST_CONDITION_REQUIRED(captureWidth== 640 ,"Testing initialization of CaptureWidth");
  //
  MITK_TEST_OUTPUT(<<"Testing StopCamera()");
  kinectDevice->StopCamera();
  MITK_TEST_CONDITION_REQUIRED(kinectDevice->DisconnectCamera(),"Testing DisconnectCamera()");
  }
  catch(std::exception &e)
  {
      MITK_INFO << e.what();
      MITK_TEST_CONDITION(!kinectDevice->IsCameraActive(), "Testing that no device could be connected.");
  }
  MITK_TEST_END();

}

redpajama_set_name: RedPajamaGithub


text:
package com.samuelyvon.braincramp.compilation.nasm;

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

public class Segment {

    private final String name;
    private final List<NASMInstruction> instructions;

    public Segment(String name) {
        this.name = name;
        this.instructions = new ArrayList<>();
    }

    public void toStringBuilder(StringBuilder sb) {
        sb.append("section .").append(name);
        sb.append("\n\r");
        for(NASMInstruction instr : instructions) {
            sb.append("\t");
            instr.toStringBuilder(sb);
        }
    }

    public void addInstruction(Object... words) {
        instructions.add(new NASMInstruction(words));
    }

    public void addInstruction(NASMInstruction instr) {
        instructions.add(instr);
    }

}


text:
package org.graphwalker.cli.commands;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;

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

@Parameters(commandDescription = "Generate a test sequence offline. The sequence is fetched using different techniques, like RestAPI")
public class Online {

  @Parameter(names = {"--model", "-m"}, required = true, arity = 2,
          description = "The model, as a graphml file followed by generator with stop condition. " +
                  "The format is GENERATOR(STOP_CONDITION) See HTML DOC")
  public List<String> model = new ArrayList<String>();

  @Parameter(names = {"--restful", "-r"}, required = false, arity = 1,
          description = "Starts as a Restful API service.")
  public boolean restful = true;
}


text:
<!DOCTYPE>

    <link href="/stylesheet/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="stylesheet/font-awesome.min.css">
    <link rel=stylesheet href="stylesheet/bootstrap-social.css">
    <link href="stylesheet/style.css" rel="stylesheet">

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

Hot

Trending

Random

                        Tags

Funny

Animals

Anime and manga

Movies and TV

WTF

Savage

                <form class="navbar-form navbar-left" role="search">

                        <input type="text" class="form-control" placeholder="Type to search">

                    <button type="submit" class="btn btn-default">  </button>
                </form>

Iniciar Sesion

Registrarse

LA FILA DE ATRAS

                    <form class="form-horizontal" action="/login" method="POST">
                        <fieldset>

                            <legend class="">Log in</legend>
                            {{#loginerror}}

Wrong username or password

                            {{/loginerror}}

                                Username

                                    <input type="text" id="username" name="username" placeholder="" class="input-xlarge">

                                Password

                                    <input type="password" id="password" name="password" placeholder="" class="input-xlarge">

                                    <input class="btn btn-success" type="submit" value="Log in"></input>

                        </fieldset>
                    </form>

You can also:

                          Log in with Twitter
                          Log in with Facebook
                          Log in with Google+

                    Siguenos en


text:
@class DLSDirectoryServiceObject;
@class DLSTimetableWrapper;

@interface DLSDirectoryServiceWrapper : NSObject

@property (nonatomic, readonly) NSString *directoryId;
@property (nonatomic, readonly) NSString *organisationId;
@property (nonatomic, readonly) NSString *categoryId;
@property (nonatomic, readonly) NSString *name;
@property (nonatomic, readonly) NSString *address1;
@property (nonatomic, readonly) NSString *address2;
@property (nonatomic, readonly) NSString *town;
@property (nonatomic, readonly) NSString *country;
@property (nonatomic, readonly) NSString *postcode;
@property (nonatomic, readonly) DLSLocationWrapper *location;
@property (nonatomic, readonly) NSURL *websiteURL;
@property (nonatomic, readonly) NSString *telephone;
@property (nonatomic, readonly) NSArray<DLSTimetableWrapper *> *openingTimes;
@property (nonatomic, readonly) float distance;

@property (nonatomic, readonly) NSNumber *isHandleMinorAilments;

@property (nonatomic, readonly) NSString *fullAddress;

- (instancetype)initWithDirectoryService:(DLSDirectoryServiceObject *)object;

+ (instancetype)directoryServiceWithObject:(DLSDirectoryServiceObject *)object;

@end

@interface DLSDirectoryServiceWrapper (DLSDescriptions)

- (NSString *)openingTimesDescription;

@end


text:
using System.Threading;
using System.Threading.Tasks;
using MailKit.Net.Smtp;
using Microsoft.Extensions.Options;
using MimeKit;

namespace Scalider.Email.MailKit
{

    /// <summary>
    /// Provides an implementation of the <see cref="IEmailSender"/> interface that uses MailKit to deliver email
    /// messages.
    /// </summary>
    public class MailKitEmailSender : IEmailSender
    {

        private readonly MailKitEmailSenderOptions _options;

        /// <summary>
        /// Initializes a new instance of the <see cref="MailKitEmailSender"/> class.
        /// </summary>
        /// <param name="wrappedOptions"></param>
        public MailKitEmailSender(IOptions<MailKitEmailSenderOptions> wrappedOptions)
        {
            Check.NotNull(wrappedOptions, nameof(wrappedOptions));

            _options = wrappedOptions.Value;
        }

        /// <inheritdoc />
        public async Task SendAsync(MimeMessage message, CancellationToken cancellationToken = default)
        {
            var client = new SmtpClient();
            if (_options.Timeout.HasValue)
                client.Timeout = _options.Timeout.Value;

            await client.ConnectAsync(_options.Host, _options.Port, _options.SocketOptions, cancellationToken)
                .ConfigureAwait(false);

            try
            {
                if (!string.IsNullOrWhiteSpace(_options.UserName))
                {
                    await client.AuthenticateAsync(_options.UserName, _options.Password, cancellationToken)
                        .ConfigureAwait(false);
                }

                await client.SendAsync(message, cancellationToken);
            }
            finally
            {
                await client.DisconnectAsync(true, cancellationToken);
            }
        }

    }

}


text:
from __future__ import print_function, division, unicode_literals

import re
import sys
import time
import threading
from math import ceil

import six
if six.PY2:
    from backports.shutil_get_terminal_size import get_terminal_size
    input = raw_input
else:
    from shutil import get_terminal_size
    from builtins import input

import colorama
colorama.init()

last_output_lines = 0
overflow_flag = False
is_atty = sys.stdout.isatty()

cursor_up = "\x1b[1A"

widths = [
    (126,    1), (159,    0), (687,     1), (710,   0), (711,   1),
    (727,    0), (733,    1), (879,     0), (1154,  1), (1161,  0),
    (4347,   1), (4447,   2), (7467,    1), (7521,  0), (8369,  1),
    (8426,   0), (9000,   1), (9002,    2), (11021, 1), (12350, 2),
    (12351,  1), (12438,  2), (12442,   0), (19893, 2), (19967, 1),
    (55203,  2), (63743,  1), (64106,   2), (65039, 1), (65059, 0),
    (65131,  2), (65279,  1), (65376,   2), (65500, 1), (65510, 2),
    (120831, 1), (262141, 2), (1114109, 1),
]

def get_char_width(char):
    global widths
    o = ord(char)
    if o == 0xe or o == 0xf:
        return 0
    for num, wid in widths:
        if o <= num:
            return wid
    return 1

def width_cal_preprocess(content):
    """
    此函数同时删除 ANSI escape code,避免影响行宽计算
    This function also remove ANSI escape code to avoid the influence on line width calculation
    """
    ptn = re.compile(r'(\033|\x1b)\[.*?m', re.I)
    _content = re.sub(ptn, '', content) # remove ANSI escape code
    return _content

def preprocess(content):
    """
    对输出内容进行预处理,转为str类型 (py3),并替换行内\r\t\n等字符为空格
    do pre-process to the content, turn it into str (for py3), and replace \r\t\n with space
    """

    if six.PY2:
        if not isinstance(content, unicode):
            if isinstance(content, str):
                _content = unicode(content, encoding=sys.stdin.encoding)
            elif isinstance(content, int):
                _content = unicode(content)
        else:
            _content = content
        assert isinstance(_content, unicode)

    elif six.PY3:
        _content = str(content)

    _content = re.sub(r'\r|\t|\n', ' ', _content)
    return _content

def cut_off_at(content, width):
    if line_width(content) > width:
        now = content[:width]
        while line_width(now) > width:
            now = now[:-1]
        now += "$" * (width - line_width(now))
        return now
    else:
        return content

def print_line(content, columns, force_single_line):
    padding = " " * ((columns - line_width(content)) % columns)
    output = "{content}{padding}".format(content=content, padding=padding)
    if force_single_line:
        output = cut_off_at(output, columns)

    # here use extra space to unify the cursor position when printing
    # full-width line, which is different in windows cmd and others
    print(output, end=' \b')
    sys.stdout.flush()

def line_width(line):
    """
    计算本行在输出到命令行后所占的宽度
    calculate the width of output in terminal
    """
    if six.PY2:
        assert isinstance(line, unicode)
    _line = width_cal_preprocess(line)
    result = sum(map(get_char_width, _line))
    return result

def lines_of_content(content, width):
    """
    计算内容在特定输出宽度下实际显示的行数
    calculate the actual rows with specific terminal width
    """
    result = 0
    if isinstance(content, list):
        for line in content:
            _line = preprocess(line)
            result += ceil(line_width(_line) / width)
    elif isinstance(content, dict):
        for k, v in content.items():
            # 加2是算上行内冒号和空格的宽度
            # adding 2 for the for the colon and space ": "
            _k, _v = map(preprocess, (k, v))
            result += ceil((line_width(_k) + line_width(_v) + 2) / width)
        for line in content.sublist:
            _line = preprocess(line)
            result += ceil(line_width(_line) / width)
    return int(result)

def print_multi_line(content, force_single_line, sort_key):
    """
    'sort_key' 参数只在 dict 模式时有效
    'sort_key' parameter only available in 'dict' mode
    """

    global last_output_lines
    global overflow_flag
    global is_atty

    if not is_atty:
        if isinstance(content, list):
            for line in content:
                print(line)
        elif isinstance(content, dict):
            for k, v in sorted(content.items(), key=sort_key):
                print("{}: {}".format(k, v))
        else:
            raise TypeError("Excepting types: list, dict. Got: {}".format(type(content)))
        return

    columns, rows = get_terminal_size()
    lines = lines_of_content(content, columns)
    if force_single_line is False and lines > rows:
        overflow_flag = True
    elif force_single_line is True and len(content) > rows:
        overflow_flag = True

    # 确保初始输出位置是位于最左处的
    # to make sure the cursor is at the left most
    print("\b" * columns, end="")

    if isinstance(content, list):
        for line in content:
            _line = preprocess(line)
            print_line(_line, columns, force_single_line)
    elif isinstance(content, dict):
        for k, v in sorted(content.items(), key=sort_key):
            _k, _v = map(preprocess, (k, v))
            print_line("{}: {}".format(_k, _v), columns, force_single_line)
        for line in content.sublist:
            _line = preprocess(line)
            print_line(_line, columns, force_single_line)
    else:
        raise TypeError("Excepting types: list, dict. Got: {}".format(type(content)))

    # 输出额外的空行来清除上一次输出的剩余内容
    # do extra blank lines to wipe the remaining of last output
    print(" " * columns * (last_output_lines - lines), end=" \b")

    # 回到初始输出位置
    # back to the origin pos
    print(cursor_up * (max(last_output_lines, lines)), end="")
    sys.stdout.flush()
    last_output_lines = lines

class output:

    class SignalList(list):

        def __init__(self, parent, obj):
            super(output.SignalList, self).__init__(obj)
            self.parent = parent
            self.lock = threading.Lock()

        def __setitem__(self, key, value):
            global is_atty
            with self.lock:
                super(output.SignalList, self).__setitem__(key, value)
                if not is_atty:
                    print("{}".format(value))
                else:
                    self.parent.refresh(int(time.time()*1000), forced=False)

        def clear(self):
            global is_atty
            # with self.lock: In all places you call clear, you actually already have the lock
            if six.PY2:
                self[:] = []
            elif six.PY3:
                super(output.SignalList, self).clear()

            if is_atty:
                self.parent.refresh(int(time.time()*1000), forced=False)

        def change(self, newlist):
            with self.lock:
                self.clear()
                self.extend(newlist)
                if is_atty:
                    self.parent.refresh(int(time.time()*1000), forced=False)

        def append(self, x):
            global is_atty
            with self.lock:
                super(output.SignalList, self).append(x)
                if not is_atty:
                    print("{}".format(x))
                else:
                    self.parent.refresh(int(time.time()*1000), forced=False)

        def insert(self, i, x):
            global is_atty
            with self.lock:
                super(output.SignalList, self).insert(i, x)
                if not is_atty:
                    print("{}".format(x))
                else:
                    self.parent.refresh(int(time.time()*1000), forced=False)

        def remove(self, x):
            global is_atty
            with self.lock:
                super(output.SignalList, self).remove(x)
                if is_atty:
                    self.parent.refresh(int(time.time()*1000), forced=False)

        def pop(self, i=-1):
            global is_atty
            with self.lock:
                rs = super(output.SignalList, self).pop(i)
                if is_atty:
                    self.parent.refresh(int(time.time()*1000), forced=False)
                return rs

        def sort(self, *args, **kwargs):
            global is_atty
            with self.lock:
                super(output.SignalList, self).sort(*args, **kwargs)
                if is_atty:
                    self.parent.refresh(int(time.time()*1000), forced=False)

    class SignalDict(dict):

        def __init__(self, parent, obj):
            super(output.SignalDict, self).__init__(obj)
            self.parent = parent
            self.lock = threading.Lock()
            self.sublist = []

        def change(self, newlist):
            with self.lock:
                self.clear()
                super(output.SignalDict, self).update(newlist)
                self.parent.refresh(int(time.time()*1000), forced=False)

        def __setitem__(self, key, value):
            global is_atty
            with self.lock:
                super(output.SignalDict, self).__setitem__(key, value)
                if not is_atty:
                    print("{}: {}".format(key, value))
                else:
                    self.parent.refresh(int(time.time()*1000), forced=False)

        def clear(self):
            global is_atty
            # with self.lock: In all places you call clear, you actually already have the lock
            super(output.SignalDict, self).clear()
            if is_atty:
                self.parent.refresh(int(time.time()*1000), forced=False)

        def pop(self, *args, **kwargs):
            global is_atty
            with self.lock:
                rs = super(output.SignalDict, self).pop(*args, **kwargs)
                if is_atty:
                    self.parent.refresh(int(time.time()*1000), forced=False)
                return rs

        def popitem(self, *args, **kwargs):
            global is_atty
            with self.lock:
                rs = super(output.SignalDict, self).popitem(*args, **kwargs)
                if is_atty:
                    self.parent.refresh(int(time.time()*1000), forced=False)
                return rs

        def setdefault(self, *args, **kwargs):
            global is_atty
            with self.lock:
                rs = super(output.SignalDict, self).setdefault(*args, **kwargs)
                if is_atty:
                    self.parent.refresh(int(time.time()*1000), forced=False)
                return rs

        def update(self, *args, **kwargs):
            global is_atty
            with self.lock:
                super(output.SignalDict, self).update(*args, **kwargs)
                if is_atty:
                    self.parent.refresh(int(time.time()*1000), forced=False)

        def append(self, x):
            global is_atty
            with self.lock:
                self.sublist.append(x)
                if is_atty:
                    self.parent.refresh(int(time.time()*1000), forced=False)

    def __init__(self, output_type="list", initial_len=1, interval=0, force_single_line=False, no_warning=False, sort_key=lambda x:x[0]):
        self.sort_key = sort_key
        self.no_warning = no_warning
        no_warning and print("All reprint warning diabled.")

        global is_atty
        # reprint does not work in the IDLE terminal, and any other environment that can't get terminal_size
        if is_atty and not all(get_terminal_size()):
            if not no_warning:
                r = input("Fail to get terminal size, we got {}, continue anyway? (y/N)".format(get_terminal_size()))
                if not (r and isinstance(r, str) and r.lower()[0] in ['y','t','1']):
                    sys.exit(0)

            is_atty = False

        if output_type == "list":
            self.warped_obj = output.SignalList(self, [''] * initial_len)
        elif output_type == "dict":
            self.warped_obj = output.SignalDict(self, {})

        self.interval = interval
        self.force_single_line = force_single_line
        self._last_update = int(time.time()*1000)

    def refresh(self, new_time=0, forced=True):
        if new_time - self._last_update >= self.interval or forced:
            print_multi_line(self.warped_obj, self.force_single_line, sort_key=self.sort_key)
            self._last_update = new_time

    def __enter__(self):
        global is_atty
        if not is_atty:
            if not self.no_warning:
                print("Not in terminal, reprint now using normal build-in print function.")

        return self.warped_obj

    def __exit__(self, exc_type, exc_val, exc_tb):
        global is_atty

        self.refresh(forced=True)
        if is_atty:
            columns, _ = get_terminal_size()
            if self.force_single_line:
                print('\n' * len(self.warped_obj), end="")
            else:
                print('\n' * lines_of_content(self.warped_obj, columns), end="")
            global last_output_lines
            global overflow_flag
            last_output_lines = 0
            if overflow_flag:
                if not self.no_warning:
                    print("Detected that the lines of output has been exceeded the height of terminal windows, which \
                    caused the former output remained and keep adding new lines.")
                    print("检测到输出过程中, 输出行数曾大于命令行窗口行数, 这会导致输出清除不完整, 而使输出不停增长。请注意控制输出行数。")


text:
#ifndef COS_COS_CAST_H
#define COS_COS_CAST_H

#ifndef COS_COS_COS_H
#error "COS: use <cos/cos/cos.h> instead of <cos/cos/cast.h>"
#endif

#ifdef  COS_DISABLE_ALL
#define COS_DISABLE_CAST
#define COS_DISABLE_cast
#define COS_DISABLE_dyncast
#define COS_DISABLE_ecast
#define COS_DISABLE_edyncast
#define COS_DISABLE_ecastLoc
#define COS_DISABLE_edyncastLoc
#define COS_DISABLE_dbgcast
#endif

#ifndef COS_DISABLE_CAST
#define CAST(typename,value) COS_CAST(typename,value)
#endif

#ifndef COS_DISABLE_cast
#define cast(class,object) COS_OBJECT_CAST(class,object)
#endif

#ifndef COS_DISABLE_dyncast
#define dyncast(class,object) COS_OBJECT_DYNCAST(class,object)
#endif

#ifndef COS_DISABLE_ecast
#define ecast(class,object) COS_OBJECT_ECAST(class,object)
#endif

#ifndef COS_DISABLE_edyncast
#define edyncast(class,object) COS_OBJECT_EDYNCAST(class,object)
#endif

#ifndef COS_DISABLE_ecastLoc
#define ecastLoc(cls,obj,file,line) COS_OBJECT_ECASTLOC(cls,obj,file,line)
#endif

#ifndef COS_DISABLE_edyncastLoc
#define edyncastLoc(cls,obj,file,line) COS_OBJECT_EDYNCASTLOC(cls,obj,file,line)
#endif

#ifndef COS_DISABLE_dbgcast
#define dbgcast(class,object) COS_OBJECT_DBGCAST(class,object)
#endif

/***********************************************************
 * Implementation
 */

// convert value (C cast)
#define COS_CAST(type,value) ((type) (value))

// convert object (COS cast)
#define COS_OBJECT_CAST(cls,obj) \
((struct cls*) cos_object_cast(obj,classref(cls)))

// convert object (COS downcast)
#define COS_OBJECT_DYNCAST(cls,obj) \
((struct cls*) cos_object_dyncast(obj,classref(cls)))

// convert object (COS cast or throw)
#define COS_OBJECT_ECAST(cls,obj) \
        COS_OBJECT_ECASTLOC(cls,obj,__FILE__,__LINE__)

// convert object (COS downcast or throw)
#define COS_OBJECT_EDYNCAST(cls,obj) \
        COS_OBJECT_EDYNCASTLOC(cls,obj,__FILE__,__LINE__)

// convert object (COS cast or throw)
#define COS_OBJECT_ECASTLOC(cls,obj,file,line) \
((struct cls*) cos_object_ecast(obj,classref(cls),file,line))

// convert object (COS downcast or throw)
#define COS_OBJECT_EDYNCASTLOC(cls,obj,file,line) \
((struct cls*) cos_object_edyncast(obj,classref(cls),file,line))

// convert value (static cast in release mode, dynamic cast in debug mode)
#define COS_OBJECT_DBGCAST(cls,obj) \
COS_PP_IFNDEF(COS_DEBUG)( COS_CAST(struct cls*, obj), \
                          COS_OBJECT_EDYNCASTLOC(cls,obj,__FILE__,__LINE__) )

#endif // COS_COS_CAST_H


text:
package com.dongdongxia.myfastjson.util;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;

/**
 *
 *
Description: 泛型接口实现

 * @ClassName: ParameterizedTypeImpl
 * @author java_liudong@163.com  2017年5月24日 上午11:06:57
 */
public class ParameterizedTypeImpl implements ParameterizedType{

	private final Type[] actualTypeArguments;
	private final Type ownerType;
	private final Type rawType;

	public ParameterizedTypeImpl(Type[] actualTypeArguments, Type ownerType, Type rawType) {
		this.actualTypeArguments = actualTypeArguments;
		this.ownerType = ownerType;
		this.rawType = rawType;
	}

	@Override
	public Type[] getActualTypeArguments() {
		return actualTypeArguments;
	}

	@Override
	public Type getRawType() {
		return rawType;
	}

	@Override
	public Type getOwnerType() {
		return ownerType;
	}

	/**
	 *
	 *
Title: equals

	 *
Description: 重写equals方法

	 * @param obj
	 * @return
	 * @author java_liudong@163.com  2017年5月24日 上午11:14:42
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}

		if (obj == null || getClass() != obj.getClass()) {
			return false;
		}

		ParameterizedTypeImpl that = (ParameterizedTypeImpl) obj;

		if (!Arrays.equals(actualTypeArguments, that.actualTypeArguments)) {
			return false;
		}

		if (ownerType != null ? ownerType.equals(that.ownerType) : that.ownerType != null) {
			return false;
		}

		return rawType != null ? rawType.equals(that.rawType) : that.rawType == null;
	}

	@Override
	public int hashCode() {
		int result = actualTypeArguments != null ? Arrays.hashCode(actualTypeArguments) : 0;
		result = 31 * result + (ownerType != null ? ownerType.hashCode() : 0);
		result = 31 * result + (rawType != null ? rawType.hashCode() : 0);
		return result;
	}
}


text:
[![CI Status](http://img.shields.io/travis/Marco Musella/QuramiJsonApi.svg?style=flat)](https://travis-ci.org/Marco Musella/QuramiJsonApi)
[![Version](https://img.shields.io/cocoapods/v/QuramiJsonApi.svg?style=flat)](http://cocoapods.org/pods/QuramiJsonApi)
[![License](https://img.shields.io/cocoapods/l/QuramiJsonApi.svg?style=flat)](http://cocoapods.org/pods/QuramiJsonApi)
[![Platform](https://img.shields.io/cocoapods/p/QuramiJsonApi.svg?style=flat)](http://cocoapods.org/pods/QuramiJsonApi)

# ⚠ WARNING ⚠

This resource is currently under development and not currently published, I will release publicly the first version of this pod when achieving a decent test coverage.
In the meanwhile feel free to fork and hack!

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

QuramiJsonApi is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "QuramiJsonApi"
```

## Acknowledgements

This library is a fork of another great iOS library by [Josh Holtz](https://github.com/joshdholtz/jsonapi-ios).
Since the design ideas and the classes have changed from his original implementation, we've decided to publish it as a separate library that we maintain and update for our app [Qurami](http://qurami.com).
We believe that what is Open Source remains Open Source, so here's our contribution.

## Author

Marco Musella, marco.musella@qurami.com

## License

QuramiJsonApi is available under the MIT license. See the LICENSE file for more info.


text:
/**
 * Contains all of the classes associated with Interactive participant events returned from the Interactive service.
 *
 * @author      Microsoft Corporation
 *
 * @since       1.0.0
 */
package com.mixer.interactive.event.participant;


text:
<resources>
    <string name="app_name">WorkManager Demo</string>
    <string name="select_stock_image">Select Stock Image</string>
    <string name="select_image">Select Image</string>

    <string name="filters_title">Choose Filters</string>
    <string name="filter_watercolor">Watercolor</string>
    <string name="filter_grayscale">Grayscale</string>
    <string name="filter_blur">Blur</string>

    <string name="destinations_title">Destination</string>
    <string name="destination_save">Save Image</string>
    <string name="destination_upload">Upload to Imgur</string>

    <string name="go">Go</string>
    <string name="cancel">Cancel</string>
    <string name="output">Output</string>

    <string name="description_image">The image to filter and upload.</string>

    <string name="set_permissions_in_settings">
        Go to Settings -> Apps and Notifications -> WorkManager Demo -> App Permissions
        and grant access to Storage.
    </string>
    <string name="credits">
        <![CDATA[Stock Photos by Romain Guy.
        CC2 License.]]>
    </string>
</resources>


text:
import os

import bayeslite
import bayeslite.read_csv as read_csv

from bayeslite.core import bayesdb_get_generator
from bayeslite.guess import bayesdb_guess_population
from bayeslite.backends.cgpm_backend import CGPM_Backend

root = os.path.dirname(os.path.abspath(__file__))
dha_csv = os.path.join(root, 'dha.csv')

def test_subsample():
    with bayeslite.bayesdb_open(builtin_backends=False) as bdb:
        backend = CGPM_Backend(cgpm_registry={}, multiprocess=False)
        bayeslite.bayesdb_register_backend(bdb, backend)
        with open(dha_csv, 'rU') as f:
            read_csv.bayesdb_read_csv(bdb, 'dha', f, header=True, create=True)
        bayesdb_guess_population(bdb, 'hospitals_full', 'dha',
            overrides=[('name', 'key')])
        bayesdb_guess_population(bdb, 'hospitals_sub', 'dha',
            overrides=[('name', 'key')])
        bdb.execute('''
            CREATE GENERATOR hosp_full_cc FOR hospitals_full USING cgpm;
        ''')
        bdb.execute('''
            CREATE GENERATOR hosp_sub_cc FOR hospitals_sub USING cgpm(
                SUBSAMPLE 100
            )
        ''')
        bdb.execute('INITIALIZE 1 MODEL FOR hosp_sub_cc')
        bdb.execute('ANALYZE hosp_sub_cc FOR 1 ITERATION (OPTIMIZED)')
        bdb.execute('''
            ESTIMATE SIMILARITY TO (_rowid_=2) IN THE CONTEXT OF PNEUM_SCORE
            FROM hospitals_sub WHERE _rowid_ = 1 OR _rowid_ = 101
        ''').fetchall()
        bdb.execute('''
            ESTIMATE SIMILARITY TO (_rowid_=102) IN THE CONTEXT OF
            N_DEATH_ILL FROM hospitals_sub
            WHERE _rowid_ = 1 OR _rowid_ = 101
        ''').fetchall()
        bdb.execute('''
            ESTIMATE PREDICTIVE PROBABILITY OF mdcr_spnd_amblnc
            FROM hospitals_sub
            WHERE _rowid_ = 1 OR _rowid_ = 101
        ''').fetchall()
        bdb.execute('''
            ESTIMATE SIMILARITY IN THE CONTEXT OF PNEUM_SCORE
            FROM PAIRWISE hospitals_sub
            WHERE (r0._rowid_ = 1 OR r0._rowid_ = 101) AND
            (r1._rowid_ = 1 OR r1._rowid_ = 101)
        ''').fetchall()
        bdb.execute('''
            INFER mdcr_spnd_amblnc FROM hospitals_sub
            WHERE _rowid_ = 1 OR _rowid_ = 101
        ''').fetchall()
        sql = '''
            SELECT table_rowid FROM bayesdb_cgpm_individual
                WHERE generator_id = ?
                ORDER BY cgpm_rowid ASC
                LIMIT 100
        '''
        gid_full = bayesdb_get_generator(bdb, None, 'hosp_full_cc')
        cursor = bdb.sql_execute(sql, (gid_full,))
        assert [row[0] for row in cursor] == range(1, 100 + 1)
        gid = bayesdb_get_generator(bdb, None, 'hosp_sub_cc')
        cursor = bdb.sql_execute(sql, (gid,))
        assert [row[0] for row in cursor] != range(1, 100 + 1)
        bdb.execute('DROP GENERATOR hosp_sub_cc')
        bdb.execute('DROP GENERATOR hosp_full_cc')
        bdb.execute('DROP POPULATION hospitals_sub')
        bdb.execute('DROP POPULATION hospitals_full')


text:
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bootstrap import Bootstrap
from config import config
from flask_mail import Mail
# from flask_moment import Moment
from flask_login import LoginManager
from flask_pagedown import PageDown
from flaskext.markdown import Markdown
import markdown

bootstrap = Bootstrap()
mail = Mail()
# moment = Moment()
db = SQLAlchemy()
pagedown = PageDown()
login_manager = LoginManager()
login_manager.session_protection = 'strong'
login_manager.login_view = 'auth.login'

def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    config[config_name].init_app(app)
    db.init_app(app)
    bootstrap.init_app(app)
    mail.init_app(app)
    Markdown(app)
    # moment.init_app(app)
    login_manager.init_app(app)
    pagedown.init_app(app)
    # 附加路由和自定义的错误页面

    from .views import main as app_blueprint
    app.register_blueprint(app_blueprint)

    from .auth import auth as auth_blueprint
    app.register_blueprint(auth_blueprint, url_prefix='/auth')

    @app.template_filter('markdown2html')
    def markdown2html(text):
        return markdown.markdown(text, ['extra'])

    return app


text:
package org.apache.samza.job.yarn;

import org.apache.hadoop.yarn.api.records.Container;
import org.apache.hadoop.yarn.client.api.AMRMClient;
import org.apache.hadoop.yarn.client.api.async.AMRMClientAsync;
import org.apache.samza.config.YarnConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;

/**
 * This is the allocator thread that will be used by SamzaTaskManager when host-affinity is enabled for a job. It is similar to {@link org.apache.samza.job.yarn.ContainerAllocator}, except that it considers container locality for allocation.
 *
 * In case of host-affinity, each container request ({@link org.apache.samza.job.yarn.SamzaContainerRequest} encapsulates the identifier of the container to be run and a "preferredHost". preferredHost is determined by the locality mappings in the coordinator stream.
 * This thread periodically wakes up and makes the best-effort to assign a container to the preferredHost. If the preferredHost is not returned by the RM before the corresponding container expires, the thread assigns the container to any other host that is allocated next.
 * The container expiry is determined by CONTAINER_REQUEST_TIMEOUT and is configurable on a per-job basis.
 *
 * If there aren't enough containers, it waits by sleeping for ALLOCATOR_SLEEP_TIME milliseconds.
 */
public class HostAwareContainerAllocator extends AbstractContainerAllocator {
  private static final Logger log = LoggerFactory.getLogger(HostAwareContainerAllocator.class);

  private final int CONTAINER_REQUEST_TIMEOUT;

  public HostAwareContainerAllocator(AMRMClientAsync<AMRMClient.ContainerRequest> amClient,
                                     ContainerUtil containerUtil,
                                     YarnConfig yarnConfig) {
    super(amClient, containerUtil, new ContainerRequestState(amClient, true), yarnConfig);
    this.CONTAINER_REQUEST_TIMEOUT = yarnConfig.getContainerRequestTimeout();
  }

  /**
   * Since host-affinity is enabled, all allocated container resources are buffered in the list keyed by "preferredHost".
   *
   * If the requested host is not available, the thread checks to see if the request has expired.
   * If it has expired, it runs the container with expectedContainerID on one of the available hosts from the
   * allocatedContainers buffer keyed by "ANY_HOST".
   */
  @Override
  public void run() {
    try {
      while (isRunning.get()) {
        while (!containerRequestState.getRequestsQueue().isEmpty()) {
          SamzaContainerRequest request = containerRequestState.getRequestsQueue().peek();
          String preferredHost = request.getPreferredHost();
          int expectedContainerId = request.getExpectedContainerId();

          log.info(
              "Handling request for container id {} on preferred host {}",
              expectedContainerId,
              preferredHost);

          List<Container> allocatedContainers = containerRequestState.getContainersOnAHost(preferredHost);
          if (allocatedContainers != null && allocatedContainers.size() > 0) {
            // Found allocated container at preferredHost
            Container container = allocatedContainers.get(0);

            containerRequestState.updateStateAfterAssignment(request, preferredHost, container);

            log.info("Running {} on {}", expectedContainerId, container.getId());
            containerUtil.runMatchedContainer(expectedContainerId, container);
          } else {
            // No allocated container on preferredHost
            log.info(
                "Did not find any allocated containers on preferred host {} for running container id {}",
                preferredHost,
                expectedContainerId);
            boolean expired = requestExpired(request);
            allocatedContainers = containerRequestState.getContainersOnAHost(ANY_HOST);
            if (!expired || allocatedContainers == null || allocatedContainers.size() == 0) {
              log.info("Either the request timestamp {} is greater than container request timeout {}ms or we couldn't " +
                      "find any free allocated containers in the buffer. Breaking out of loop.",
                  request.getRequestTimestamp(),
                  CONTAINER_REQUEST_TIMEOUT);
              break;
            } else {
              if (allocatedContainers.size() > 0) {
                Container container = allocatedContainers.get(0);
                log.info("Found available containers on ANY_HOST. Assigning request for container_id {} with " +
                        "timestamp {} to container {}",
                    new Object[] { String.valueOf(expectedContainerId), request.getRequestTimestamp(), container.getId()
                });
                containerRequestState.updateStateAfterAssignment(request, ANY_HOST, container);
                log.info("Running {} on {}", expectedContainerId, container.getId());
                containerUtil.runContainer(expectedContainerId, container);
              }
            }
          }
        }
        // Release extra containers and update the entire system's state
        containerRequestState.releaseExtraContainers();

        Thread.sleep(ALLOCATOR_SLEEP_TIME);
      }
    } catch (InterruptedException ie) {
      log.info("Got an InterruptedException in HostAwareContainerAllocator thread!", ie);
    } catch (Exception e) {
      log.info("Got an unknown Exception in HostAwareContainerAllocator thread!", e);
    }
  }

  private boolean requestExpired(SamzaContainerRequest request) {
    return System.currentTimeMillis() - request.getRequestTimestamp() > CONTAINER_REQUEST_TIMEOUT;
  }
}


text:
var auctionModule = angular.module('auction');

auctionModule.factory('Items', ['$resource', function($resource) {
  return $resource('/auction.json',{}, {
    query: {method: 'GET', isArray: true}
  });
}]);

auctionModule.controller('AuctionCtrl', ['$scope', '$timeout', '$http', '$document', 'Items', function($scope, $timeout, $http, $document, Items) {

  $scope.init = function() {
    $scope.itemsPerPage = 10;
    $scope.pageNumber = 0;
    $scope.totalItems = 0;
    $scope.timeLeft = 3600;

    $scope.allItems = [];
    $scope.pageItems = [];

    (function refreshItems() {
      Items.query({}, function(items) {
          $scope.totalItems = items.length;
          $scope.allItems = items;
          $scope.pageItems = [];

          var firstItemIndex = $scope.pageNumber * $scope.itemsPerPage;
          var lastItemIndex = firstItemIndex + $scope.itemsPerPage;
          angular.forEach($scope.allItems, function(item, index) {
            if(index >= firstItemIndex && index < lastItemIndex) {
              $scope.pageItems.push(item);
            }
          });

         $timeout(refreshItems, 1000);
      });
    })();

    (function refreshAmountRaised() {
      $http({method: 'GET', url: '/amount_raised'}).
      success(function(data, status, headers, config) {
        $scope.amountRaised = data.amount_raised;
      });

      $timeout(refreshAmountRaised, 1000);
    })();

    (function refreshTimer() {
      $http({method: 'GET', url: '/time_left'}).
      success(function(data, status, headers, config) {
        $scope.timeLeft = data.time_left;
      });

      $timeout(refreshTimer, 60000);
    })();

    (function tickTimeLeft() {
      if($scope.timeLeft > 0) {
        $scope.timeLeft = $scope.timeLeft - 1;
        duration = moment.duration($scope.timeLeft, 'seconds');
        $scope.timer = moment(duration.asMilliseconds()).utc().format('H:mm:ss');

        $timeout(tickTimeLeft, 1000);
      } else {
        $scope.timer = 'Auction is now closed';
      }
    })();

    (function nextPage() {
      $scope.loadNextPage();
      $timeout(nextPage, 10000);
    })();
  };

  $scope.loadPreviousPage = function() {
    $scope.pageNumber = $scope.pageNumber - 1;
    if($scope.pageNumber < 0) {
      $scope.pageNumber = ($scope.totalItems / $scope.itemsPerPage);
    }
  };

  $scope.loadNextPage = function() {
    $scope.pageNumber = $scope.pageNumber + 1;
    if($scope.pageNumber > ($scope.totalItems / $scope.itemsPerPage)) {
      $scope.pageNumber = 0;
    }
  };

  $document.bind('keyup', function(event) {
    if(event.which === 37) {
      $scope.loadPreviousPage();
    } else if(event.which === 39) {
      $scope.loadNextPage();
    } else {
      return;
    }

    Items.query({}, function(items) {
      $scope.totalItems = items.length;
      $scope.allItems = items;
      $scope.pageItems = [];

      var firstItemIndex = $scope.pageNumber * $scope.itemsPerPage;
      var lastItemIndex = firstItemIndex + $scope.itemsPerPage;
      angular.forEach($scope.allItems, function(item, index) {
        if(index >= firstItemIndex && index < lastItemIndex) {
          $scope.pageItems.push(item);
        }
      });
    });
  });

}]);


text:
package com.google.security.zynamics.binnavi.APIHelpers;

import com.google.common.base.Preconditions;

/**
 * Provides a small helper method that can be used to search for a BinNavi object in a list of
 * plugin API objects.
 */
public final class ObjectFinders {
  /**
   * Private constructor because you are not supposed to instantiate this class.
   */
  private ObjectFinders() {
    // You are not supposed to instantiate this class
  }

  /**
   * Searches for an API object in a list of API objects.
   *
   * @param <InternalType> BinNavi object type.
   * @param <ApiType> API object type.
   *
   * @param internalObject BinNavi object that corresponds to the API object to search for.
   * @param apiObjects List of API objects to search through.
   *
   * @return The API object that corresponds to the given BinNavi object. Null, if there is no such
   *         object.
   */
  public static <InternalType, ApiType extends ApiObject<?>> ApiType getObject(
      final InternalType internalObject, final Iterable<ApiType> apiObjects) {
    Preconditions.checkNotNull(internalObject, "IE00003: Internal object argument can not be null");
    Preconditions.checkNotNull(apiObjects, "IE00004: API objects argument can not be null");

    for (final ApiType apiObject : apiObjects) {
      if (apiObject.getNative() == internalObject) {
        return apiObject;
      }
    }

    return null;
  }
}


text:
namespace GenerationText
{
    partial class Form1
    {
        /// <summary>
        /// Обязательная переменная конструктора.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Освободить все используемые ресурсы.
        /// </summary>
        /// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Код, автоматически созданный конструктором форм Windows

        /// <summary>
        /// Требуемый метод для поддержки конструктора — не изменяйте
        /// содержимое этого метода с помощью редактора кода.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.SuspendLayout();
            //
            // Form1
            //
            resources.ApplyResources(this, "$this");
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Name = "Form1";
            this.ShowIcon = false;
            this.ResumeLayout(false);

        }

        #endregion
    }
}


text:
package com.bar.foo.wraptree;

import java.util.Iterator;
import java.util.List;

import com.bar.foo.wraptree.iterator.TreeIterationOrder;

public interface ITree<T> extends INode<T> {

	public List<INode<T>> getChildren();

	public int getNumberOfChildren();

	public INode<T> getChild(int index);

	public void addChild(INode<T> node);

	public void removeChild(int index);

	public Iterator<INode<T>> iterator();

	public Iterator<INode<T>> iterator(TreeIterationOrder order);
}


text:
> {%= description %}

## Install
{%= include("install-npm", {save: true}) %}

## Run tests

```bash
npm test
```

## Usage

```js
var omit = require('{%= name %}');

omit('abcabcabcabcabcabc', 'a')
//=> 'bcbcbcbcbcbc'

omit('abcabcabcabcabcabc', ['a', 'c'])
//=> 'bbbbbb'

omit('abcabcabcabcabcabc', [/a/g, /c/g])
//=> 'bbbbbb'
```

## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue][issues].

## Author
{%= include("author") %}

## License
{%= copyright() %}
{%= license() %}

***

{%= include("footer") %}

[issues]: https://github.com/jonschlinkert/string-omit/issues


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="@android:color/white">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/my_recycler_view"
        android:scrollbars="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/new_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        android:layout_margin="16dp"
        android:backgroundTint="@color/colorPrimary"
        app:srcCompat="@drawable/ic_add" />
</RelativeLayout>


text:
layout: beer
beer: draft_9
---

Session Ale mit mittlerem Körper und hopfigem Abgang.

Maischen bei 70°C, um dem Hopfen genug Körper gegenüber zu stellen.


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

package com.google.gerrit.client.info;

import com.google.gwt.core.client.JavaScriptObject;

public class AgreementInfo extends JavaScriptObject {
  public final native String name() /*-{ return this.name; }-*/;

  public final native String description() /*-{ return this.description; }-*/;

  public final native String url() /*-{ return this.url; }-*/;

  public final native GroupInfo autoVerifyGroup() /*-{ return this.auto_verify_group; }-*/;

  protected AgreementInfo() {}
}


text:
.popupViewFlickr .headerContainer {
	margin-bottom: 15px;
}

.popupViewFlickr .btn-userLogin {
	vertical-align: 4px;
	margin-bottom: 15px;
}

.popupViewFlickr .signInMsg {
	font-size: 14px;
	color: #30750a;
	font-weight: bold;
	vertical-align: 2px;
}

.popupViewFlickr .signInMsg.error {
	color: #c43d40;
}

.popupViewFlickr .signInMsg img {
	vertical-align: -2px;
}

.popupViewFlickr .selectContainer {
	width: 49%;
	display: inline-block;
	text-align: center;
	padding-top: 10px;
	padding-bottom: 15px;
}

.popupViewFlickr .selectContainer:nth-child(1) {
	border-right: 1px solid black;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WakSharp.Utilities.Crypto
{
    public static class CryptoManager
    {
        public static WakSharp.Utilities.Crypto.RSA.RSAProvider RSA { get; set; }
        public static List<byte> RsaPublicKey { get; set; }

        public static void InitRSA()
        {
            RSA = new WakSharp.Utilities.Crypto.RSA.RSAProvider(1024);
            RsaPublicKey = RSA.ExportToX509().ToList();
            Utilities.ConsoleStyle.Infos("RSA @key pairs@ initialized !");
        }
    }
}


text:
/**
 * Created by Kamaron on 6/30/2015.
 *
 * Manage the results, cache them for a set amount of time
 */

var config = require('../config');
var BuildResult = require('./buildResult').BuildResult;

var ERRORS = {
    BUILD_ID_TAKEN: 'The provided build ID has already been taken',
    BUILD_ID_UNKNOWN: 'The provided build ID has not been reported to the results store'
};

// TODO KAM: Check for timeout! If a build was notified, and hasn't been built after BUILD_TIMEOUT time, do error

/**
 * Used by ResultsStore._pendingResults, in case no request is waiting for a build to finish.
 */
function doNothing() {}

/**
 * Store results from builds, delete them after a set amount of time.
 * Also have getter methods for queries about builds.
 * @constructor
 */
var ResultsStore = function () {

    /**
     * @type {{string: BuildResult}}
     * @private
     */
    this._resultsStore = {};

    /**
     * Map of which results have been notified, but not yet received
     * @type {{string: function(err: Error=, rsl: BuildResult=)}}
     * @private
     */
    this._pendingResultsCallbacks = {};
};

/**
 * Notify the results store of a result. Keep result for amount of time specified in configuration.
 * @param buildID {string} Globally unique ID of this build. Throw an exception if this ID is already taken.
 * @param result {BuildResult} Result of the build
 */
ResultsStore.prototype.postResult = function(buildID, result) {
    var me = this;

    if (this._pendingResultsCallbacks[buildID]) {
        this._pendingResultsCallbacks[buildID](null, result);

        this._pendingResultsCallbacks[buildID] = null;
        delete this._pendingResultsCallbacks[buildID];
    }

    if (this._resultsStore[buildID]) {
        throw new Error(ERRORS.BUILD_ID_TAKEN)
    } else {
        this._resultsStore[buildID] = result;

        // If the resultsAvailabilityTimeout has been set, delete after that amount of time
        if (config.buildConstraints.resultsAvailabilityTimeout > 0) {
            setTimeout(function () {
                me._resultsStore[buildID] = null;
                delete me._resultsStore[buildID];
            }, config.buildConstraints.resultsAvailabilityTimeout);
        }
    }
};

/**
 * Notify the results store that a build has started, but the result has not been generated yet.
 * @param buildID {string} Globally unique build ID of the build in question
 */
ResultsStore.prototype.notifyBuildStart = function(buildID) {
    if (this._pendingResultsCallbacks[buildID] || this._resultsStore[buildID]) {
        throw new Error(ERRORS.BUILD_ID_TAKEN);
    } else {
        this._pendingResultsCallbacks[buildID] = doNothing;
    }
};

/**
 * Get the result of a given build. Invoke given callback when the result is ready. This may involve waiting.
 *  Instead of waiting, pass on the callback function to the _pendingResults array
 * @param buildID {string} Globally unique ID of this build
 * @param cb {function(err: Error=, result: BuildResult=)} Method to call when the result is available
 */
ResultsStore.prototype.getResult = function (buildID, cb) {
    if (this._resultsStore[buildID]) {
        // This is the easy case. The result is ready, just immediately provide it
        cb(null, this._resultsStore[buildID]);
    } else if (this._pendingResultsCallbacks[buildID]) {
        this._pendingResultsCallbacks[buildID] = cb;
    } else {
        cb(new Error(ERRORS.BUILD_ID_UNKNOWN));
    }
};

module.exports.ResultsStore = new ResultsStore();
module.exports.ERRORS = ERRORS;


text:
class Win32Pixmap : public OSPixmap
{
  public:
    Win32Pixmap();
    ~Win32Pixmap() override;

    bool initialize(EGLNativeDisplayType display, size_t width, size_t height, int depth) override;

    EGLNativePixmapType getNativePixmap() const override;

  private:
    HBITMAP mBitmap;
};

#endif // UTIL_WIN32_PIXMAP_H_


text:
"""Constants for the AirNow integration."""
ATTR_API_AQI = "AQI"
ATTR_API_AQI_LEVEL = "Category.Number"
ATTR_API_AQI_DESCRIPTION = "Category.Name"
ATTR_API_AQI_PARAM = "ParameterName"
ATTR_API_CATEGORY = "Category"
ATTR_API_CAT_LEVEL = "Number"
ATTR_API_CAT_DESCRIPTION = "Name"
ATTR_API_O3 = "O3"
ATTR_API_PM25 = "PM2.5"
ATTR_API_POLLUTANT = "Pollutant"
ATTR_API_REPORT_DATE = "HourObserved"
ATTR_API_REPORT_HOUR = "DateObserved"
ATTR_API_STATE = "StateCode"
ATTR_API_STATION = "ReportingArea"
ATTR_API_STATION_LATITUDE = "Latitude"
ATTR_API_STATION_LONGITUDE = "Longitude"
DEFAULT_NAME = "AirNow"
DOMAIN = "airnow"
SENSOR_AQI_ATTR_DESCR = "description"
SENSOR_AQI_ATTR_LEVEL = "level"


text:
The Page Objects methodology is a popular pattern to write end-to-end tests by wrapping the pages or page fragments of a web app into objects.
The purpose of a page object is to allow a software client to do anything and see anything that a human can by abstracting away the underlying html actions needed to access and manipulate the page.

A comprehensive introduction to Page Objects can be found in this article.

As of version `0.7` Nightwatch provides an enhanced and more powerful interface for creating page objects, significantly improved over the previous support. Page objects created prior to `v0.7` will still continue to work however we recommend upgrading to the new version.

To use the new version, your page object must contain either the `elements` or `sections` property. Otherwise, Nightwatch will defer to the old.

#### Configuring Page Objects

To create a page object simply create an object with properties that describe the page. Each page object should be located in a separate file, located in a designated folder. Nightwatch reads the page objects from the folder (or folders) specified in the `page_objects_path` configuration property.

The `page_objects_path` property can also be an array of folders, allowing you thus to logically split the page objects into smaller groups.

#### The Url property

You can optionally add a `url` property that designates the page's URL. To navigate to the page, you can call the `navigate` method on the page object.

The URL will usually be defined as a string:

module.exports = {
  url: 'http://google.com',
  elements: {}
};

It can also be a function in case the URL is dynamic. One use case for this is to support different test environments. You can create a function that gets called in the context of the page, thus allowing you to do:

module.exports = {
  url: function() {
    return this.api.launchUrl + '/login';
  },
  elements: {}
};


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Gams & Carreiro, Stud. Mycol. 31: 91 (1989)

#### Original name
Mortierella ornata W. Gams, 1977

### Remarks
null


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

<TITLE>
Interceptor (Grails 1.0.4)
</TITLE>

<META NAME="keywords" CONTENT="org.codehaus.groovy.grails.commons.metaclass.Interceptor interface">

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

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.codehaus.groovy.grails.commons.metaclass

Interface Interceptor

All Known Subinterfaces:
ConstructorInterceptor, PropertyAccessInterceptor

All Known Implementing Classes:
AbstractDynamicMethodsInterceptor, GroovyDynamicMethodsInterceptor

public interface Interceptor

Implementers of this interface can be registered in the ProxyMetaClass for
 notifications about method calls for objects managed by the ProxyMetaClass.

 Based off the original work in Groovy core, but uses a callback object instead
 for thread safety

Since:

0.2

Version:

$Revision: $
 First Created: 02-Jun-2006
 Last Updated: $Date: $

Author:

Dierk Koenig, Graeme Rocher

Method Summary

 Object
afterInvoke(Object object,
            String methodName,
            Object[] arguments,
            Object result)

          This code is executed after the method is optionally called.

 Object
beforeInvoke(Object object,
             String methodName,
             Object[] arguments,
             InvocationCallback callback)

          This code is executed before the method is optionally called.

Method Detail

beforeInvoke

Object beforeInvoke(Object object,
                    String methodName,
                    Object[] arguments,
                    InvocationCallback callback)

This code is executed before the method is optionally called.

Parameters:
object - receiver object for the method call
methodName - name of the method to call
arguments - arguments to the method call
callback - The callback object

Returns:
any arbitrary result that replaces the result of the
 original method call only if the callback object is marked
 relays this result.

afterInvoke

Object afterInvoke(Object object,
                   String methodName,
                   Object[] arguments,
                   Object result)

This code is executed after the method is optionally called.

Parameters:
object - receiver object for the called method
methodName - name of the called method
arguments - arguments to the called method
result - result of the executed method call or result of beforeInvoke if method was not called

Returns:
any arbitrary result that can replace the result of the
 original method call. Typically, the result parameter is returned.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2005-2006 The Grails project


text:
/*

This is an attempt to implement manual memory management in Go. Please DO NOT
use this. This was just for fun and would likely be worse than Go's garbage
collection.

*/

package main

import (
	"fmt"
	"reflect"
	"sync"
	"unsafe"
)

var pool = newmemoryPool()

type bufferNode struct {
	start []byte
	next  *bufferNode
}

type memNode struct {
	start uintptr
	len   int
	next  *memNode
}

type memoryPool struct {
	sync.Mutex
	cur    *memNode
	newCap int

	// Needed so that data isn't garbage collected
	bufs *bufferNode
}

func newmemoryPool() *memoryPool {
	pool := new(memoryPool)
	pool.newCap = 4096
	return pool
}

func newbufferNode(siz int) *bufferNode {
	return &bufferNode{make([]byte, siz), nil}
}

func (bn *bufferNode) memNode() *memNode {
	start := (*reflect.SliceHeader)(unsafe.Pointer(&bn.start)).Data
	return &memNode{start, cap(bn.start), nil}
}

func (p *memoryPool) grow() {
	// Ensure the lock is held
	n := newbufferNode(p.newCap)
	n.next = p.bufs
	p.bufs = n
	p.newCap <<= 1

	m := n.memNode()
	m.next = p.cur
	p.cur = m
}

func (p *memoryPool) String() string {
	s := ""
	for cur := p.cur; cur != nil; cur = cur.next {
		s += fmt.Sprint(*cur, "")
	}
	return s
}

const sizeInt = 8

// Malloc creates an object of size siz (bytes).
func Malloc(siz int) unsafe.Pointer {
	if siz <= 0 {
		return nil
	}

	var addr unsafe.Pointer
	pool.Lock()

	ssiz := siz + sizeInt
	fmt.Println("State:", pool)

	searching := true
	for searching {
		fmt.Println("At:", pool.cur)
		var prev *memNode
		for cur := pool.cur; cur != nil; prev, cur = cur, cur.next {
			if cur.len < ssiz {
				continue
			}

			searching = false
			if prev == nil {
				pool.cur = cur.next
			} else {
				prev.next = cur.next
			}

			fmt.Println("found:", cur.start)

			h := (*int)(unsafe.Pointer(cur.start))
			*h = ssiz
			addr = unsafe.Pointer(cur.start + sizeInt)

			if cur.len-ssiz > 0 {
				n := &memNode{cur.start + uintptr(ssiz), cur.len - ssiz, pool.cur}
				pool.cur = n
			} else if cur.len-ssiz < 0 {
				panic("somehow are using small block")
			}
			break
		}
		if searching {
			pool.grow()
		}
	}

	pool.Unlock()
	fmt.Println("State:", pool)
	fmt.Println("Returned:", uintptr(addr))
	return addr
}

// Free frees the object being passed in. The object must have been allocated using
// Malloc!
func Free(addr unsafe.Pointer) {
	// Not very smart.

	if addr == nil {
		return
	}

	hptr := uintptr(addr) - sizeInt
	h := (*int)(unsafe.Pointer(hptr))
	n := &memNode{hptr, *h, nil}

	pool.Lock()
	n.next = pool.cur
	pool.cur = n
	pool.Unlock()
}

func main() {
	ip := (*int)(Malloc(sizeInt))
	*ip = 3
	fmt.Println(*ip)
	Free(unsafe.Pointer(ip))
	jp := (*int)(Malloc(sizeInt))
	*jp = 4
	fmt.Println(*ip, "?=", *jp) // Should be equal to show that we are free-ing
}


text:
$TESTING=true

require 'rubygems'
require 'spec'
require 'cyme/spec_helpers'


text:
class C_BaseCombatWeapon;
class C_BaseViewModel;
class C_FuncLadder;
class CFlashlightEffect;

extern int g_nKillCamMode;
extern int g_nKillCamTarget1;
extern int g_nKillCamTarget2;
extern int g_nUsedPrediction;

class C_CommandContext
{
public:
	bool			needsprocessing;

	CUserCmd		cmd;
	int				command_number;
};

class C_PredictionError
{
public:
	float	time;
	Vector	error;
};

#define CHASE_CAM_DISTANCE		96.0f
#define WALL_OFFSET				6.0f

//-----------------------------------------------------------------------------
// Purpose: Base Player class
//-----------------------------------------------------------------------------
class C_BasePlayer : public C_BaseCombatCharacter
{
public:
	DECLARE_CLASS( C_BasePlayer, C_BaseCombatCharacter );
	DECLARE_CLIENTCLASS();
	DECLARE_PREDICTABLE();
	DECLARE_INTERPOLATION();

	C_BasePlayer();
	virtual			~C_BasePlayer();

	virtual void	Spawn( void );
	virtual void	SharedSpawn(); // Shared between client and server.

	// IClientEntity overrides.
	virtual void	OnPreDataChanged( DataUpdateType_t updateType );
	virtual void	OnDataChanged( DataUpdateType_t updateType );

	virtual void	PostDataUpdate( DataUpdateType_t updateType );

	virtual void	ReceiveMessage( int classID, bf_read &msg );

	virtual void	OnRestore();

	virtual void	AddEntity( void );

	virtual void	MakeTracer( const Vector &vecTracerSrc, const trace_t &tr, int iTracerType );

	virtual void	GetToolRecordingState( KeyValues *msg );

	void	SetAnimationExtension( const char *pExtension );

	C_BaseViewModel		*GetViewModel( int viewmodelindex = 0 );
	C_BaseCombatWeapon	*GetActiveWeapon( void ) const;

	// View model prediction setup
	virtual void		CalcView( Vector &eyeOrigin, QAngle &eyeAngles, float &zNear, float &zFar, float &fov );
	virtual void		CalcViewModelView( const Vector& eyeOrigin, const QAngle& eyeAngles);

	// Handle view smoothing when going up stairs
	void				SmoothViewOnStairs( Vector& eyeOrigin );
	virtual float		CalcRoll (const QAngle& angles, const Vector& velocity, float rollangle, float rollspeed);
	void				CalcViewRoll( QAngle& eyeAngles );
	void				CreateWaterEffects( void );

	virtual Vector			Weapon_ShootPosition();
	virtual void			Weapon_DropPrimary( void ) {}

	virtual Vector			GetAutoaimVector( float flScale );
	void					SetSuitUpdate(char *name, int fgroup, int iNoRepeat);

	// Input handling
	virtual void	CreateMove( float flInputSampleTime, CUserCmd *pCmd );
	virtual void	AvoidPhysicsProps( CUserCmd *pCmd );

	virtual void	PlayerUse( void );
	CBaseEntity		*FindUseEntity( void );
	virtual bool	IsUseableEntity( CBaseEntity *pEntity, unsigned int requiredCaps );

	// Data handlers
	virtual bool	IsPlayer( void ) const { return true; };
	virtual int		GetHealth() const { return m_iHealth; };

	// observer mode
	virtual int			GetObserverMode() const;
	virtual CBaseEntity	*GetObserverTarget() const;
	void			SetObserverTarget( EHANDLE hObserverTarget );

	bool IsObserver() const;
	bool IsHLTV() const;
	void ResetObserverMode();
	bool IsBot( void ) const { return false; }

	// Eye position..
	virtual Vector		 EyePosition();
	virtual const QAngle &EyeAngles();		// Direction of eyes
	void				 EyePositionAndVectors( Vector *pPosition, Vector *pForward, Vector *pRight, Vector *pUp );
	virtual const QAngle &LocalEyeAngles();		// Direction of eyes

	// This can be overridden to return something other than m_pRagdoll if the mod uses separate
	// entities for ragdolls.
	virtual IRagdoll* GetRepresentativeRagdoll() const;

	// Returns eye vectors
	void			EyeVectors( Vector *pForward, Vector *pRight = NULL, Vector *pUp = NULL );

	bool			IsSuitEquipped( void ) { return m_Local.m_bWearingSuit; };

	// Team handlers
	virtual void	TeamChange( int iNewTeam );

	// *HAJ 020* - Jed team icon over head (overridden in local player class)
	virtual	void	DrawTeamSprite() {};

	// Flashlight
	void	Flashlight( void );
	void	UpdateFlashlight( void );

	// Weapon selection code
	virtual bool				IsAllowedToSwitchWeapons( void ) { return !IsObserver(); }
	virtual C_BaseCombatWeapon	*GetActiveWeaponForSelection( void );

	// Returns the view model if this is the local player. If you're in third person or
	// this is a remote player, it returns the active weapon
	//
	virtual C_BaseAnimating*	GetRenderedWeaponModel();

	virtual bool				IsOverridingViewmodel( void ) { return false; };
	virtual int					DrawOverriddenViewmodel( C_BaseViewModel *pViewmodel, int flags ) { return 0; };

	virtual float				GetDefaultAnimSpeed( void ) { return 1.0; }

	void						SetMaxSpeed( float flMaxSpeed ) { m_flMaxspeed = flMaxSpeed; }
	float						MaxSpeed() const		{ return m_flMaxspeed; }

	// Should this object cast shadows?
	virtual ShadowType_t		ShadowCastType() { return SHADOWS_NONE; }

	bool						ShouldReceiveProjectedTextures( int flags )
	{
		return false;
	}

	bool						IsLocalPlayer( void ) const;

	// Global/static methods
	static bool					ShouldDrawLocalPlayer();
	static C_BasePlayer			*GetLocalPlayer( void );
	int							GetUserID( void );

	// Called by the view model if its rendering is being overridden.
	virtual bool		ViewModel_IsTransparent( void );

#if !defined( NO_ENTITY_PREDICTION )
	void						AddToPlayerSimulationList( C_BaseEntity *other );
	void						SimulatePlayerSimulatedEntities( void );
	void						RemoveFromPlayerSimulationList( C_BaseEntity *ent );
	void						ClearPlayerSimulationList( void );
#endif

	virtual void				PhysicsSimulate( void );
	virtual unsigned int	PhysicsSolidMaskForEntity( void ) const { return MASK_PLAYERSOLID; }

	// Prediction stuff
	virtual bool				ShouldPredict( void );

	virtual void				PreThink( void );
	virtual void				PostThink( void );

	virtual void				ItemPreFrame( void );
	virtual void				ItemPostFrame( void );
	virtual void				AbortReload( void );

	virtual void				SelectLastItem(void);
	virtual void				Weapon_SetLast( C_BaseCombatWeapon *pWeapon );
	virtual bool				Weapon_ShouldSetLast( C_BaseCombatWeapon *pOldWeapon, C_BaseCombatWeapon *pNewWeapon ) { return true; }
	virtual bool				Weapon_ShouldSelectItem( C_BaseCombatWeapon *pWeapon );
	virtual	bool				Weapon_Switch( C_BaseCombatWeapon *pWeapon, int viewmodelindex = 0 );		// Switch to given weapon if has ammo (false if failed)
	virtual C_BaseCombatWeapon *GetLastWeapon( void ) { return m_hLastWeapon.Get(); }
	C_BaseCombatWeapon			*Weapon_GetLast( void ) { return m_hLastWeapon.Get(); }

	void						ResetAutoaim( void );
	virtual void 				SelectItem( const char *pstr, int iSubType = 0 );

	virtual void				UpdateClientData( void );

	virtual float				GetFOV( void );
	int							GetDefaultFOV( void ) const;
	virtual bool				IsZoomed( void )	{ return false; }

	float						GetFOVDistanceAdjustFactor();

	virtual void				ViewPunch( const QAngle &angleOffset );
	void						ViewPunchReset( float tolerance = 0 );

	void						UpdateButtonState( int nUserCmdButtonMask );
	int							GetImpulse( void ) const;

	virtual void				Simulate();

	virtual bool				ShouldInterpolate();

	virtual bool				ShouldDraw();
	virtual int					DrawModel( int flags );

	// Called when not in tactical mode. Allows view to be overriden for things like driving a tank.
	virtual void				OverrideView( CViewSetup *pSetup );

	// returns the player name
	const char *				GetPlayerName();
	virtual const Vector		GetPlayerMins( void ) const; // uses local player
	virtual const Vector		GetPlayerMaxs( void ) const; // uses local player

	// Is the player dead?
	bool				IsPlayerDead();
	bool				IsPoisoned( void ) { return m_Local.m_bPoisoned; }

	// Vehicles...
	IClientVehicle			*GetVehicle();

	bool			IsInAVehicle() const	{ return ( NULL != m_hVehicle.Get() ) ? true : false; }
	virtual void	SetVehicleRole( int nRole );
	void					LeaveVehicle( void );

	bool					UsingStandardWeaponsInVehicle( void );

	virtual void			SetAnimation( PLAYER_ANIM playerAnim );

	float					GetTimeBase( void ) const;
	float					GetFinalPredictedTime() const;

	bool					IsInVGuiInputMode() const;

	C_CommandContext		*GetCommandContext();

	// Get the command number associated with the current usercmd we're running (if in predicted code).
	int CurrentCommandNumber() const;
	const CUserCmd *GetCurrentUserCommand() const;

	const QAngle& GetPunchAngle();
	void SetPunchAngle( const QAngle &angle );

	float					GetWaterJumpTime() const;
	void					SetWaterJumpTime( float flWaterJumpTime );
	float					GetSwimSoundTime( void ) const;
	void					SetSwimSoundTime( float flSwimSoundTime );

	// CS wants to allow small FOVs for zoomed-in AWPs.
	virtual float GetMinFOV() const;

	virtual void DoMuzzleFlash();
	virtual void PlayPlayerJingle();

	virtual void UpdateStepSound( surfacedata_t *psurface, const Vector &vecOrigin, const Vector &vecVelocity  );
	virtual void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
	virtual surfacedata_t * GetFootstepSurface( const Vector &origin, const char *surfaceName );

	// Called by prediction when it detects a prediction correction.
	// vDelta is the line from where the client had predicted the player to at the usercmd in question,
	// to where the server says the client should be at said usercmd.
	void NotePredictionError( const Vector &vDelta );

	// Called by the renderer to apply the prediction error smoothing.
	void GetPredictionErrorSmoothingVector( Vector &vOffset );

	virtual void ExitLadder() {}

	surfacedata_t *GetSurfaceData( void ) { return m_pSurfaceData; }

	void SetLadderNormal( Vector vecLadderNormal ) { m_vecLadderNormal = vecLadderNormal; }

public:
	int m_StuckLast;

	// Data for only the local player
	CNetworkVarEmbedded( CPlayerLocalData, m_Local );

	// Data common to all other players, too
	CPlayerState			pl;

	// Player FOV values
	int						m_iFOV;				// field of view
	int						m_iFOVStart;		// starting value of the FOV changing over time (client only)
	float					m_flFOVTime;		// starting time of the FOV zoom
	int						m_iDefaultFOV;		// default FOV if no other zooms are occurring

	// For weapon prediction
	bool			m_fOnTarget;		//Is the crosshair on a target?

	char			m_szAnimExtension[32];

	int				m_afButtonLast;
	int				m_afButtonPressed;
	int				m_afButtonReleased;

	int				m_nButtons;

	CUserCmd		*m_pCurrentCommand;

	// Movement constraints
	EHANDLE			m_hConstraintEntity;
	Vector			m_vecConstraintCenter;
	float			m_flConstraintRadius;
	float			m_flConstraintWidth;
	float			m_flConstraintSpeedFactor;

protected:

	void				CalcPlayerView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
	void				CalcVehicleView(IClientVehicle *pVehicle, Vector& eyeOrigin, QAngle& eyeAngles,
							float& zNear, float& zFar, float& fov );
	virtual void		CalcObserverView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
	void				CalcChaseCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
	void				CalcInEyeCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
	void				CalcDeathCamView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
	void				CalcRoamingView(Vector& eyeOrigin, QAngle& eyeAngles, float& fov);

	// Check to see if we're in vgui input mode...
	void DetermineVguiInputMode( CUserCmd *pCmd );

	// Used by prediction, sets the view angles for the player
	void SetLocalViewAngles( const QAngle &viewAngles );

	// used by client side player footsteps
	surfacedata_t* GetGroundSurface();

protected:
	// Did we just enter a vehicle this frame?
	bool			JustEnteredVehicle();

// DATA
	int				m_iObserverMode;	// if in spectator mode != 0
	EHANDLE			m_hObserverTarget;	// current observer target
	float			m_flObserverChaseDistance; // last distance to observer traget
	float			m_flDeathTime;		// last time player died

	float			m_flStepSoundTime;

private:
	// Make sure no one calls this...
	C_BasePlayer& operator=( const C_BasePlayer& src );
	C_BasePlayer( const C_BasePlayer & ); // not defined, not accessible

	// Vehicle stuff.
	EHANDLE			m_hVehicle;
	EHANDLE			m_hOldVehicle;
	EHANDLE			m_hUseEntity;

	float			m_flMaxspeed;
	int				m_iHealth;

	CInterpolatedVar< Vector >	m_iv_vecViewOffset;

	// Not replicated
	Vector			m_vecWaterJumpVel;
	float			m_flWaterJumpTime;  // used to be called teleport_time
	int				m_nImpulse;

	float			m_flSwimSoundTime;
	Vector			m_vecLadderNormal;

	QAngle			m_vecOldViewAngles;

	bool			m_bWasFrozen;
	int				m_flPhysics;

	int				m_nTickBase;
	int				m_nFinalPredictedTick;

	EHANDLE			m_pCurrentVguiScreen;

	// Player flashlight dynamic light pointers
	CFlashlightEffect *m_pFlashlight;

	typedef CHandle<C_BaseCombatWeapon> CBaseCombatWeaponHandle;
	CNetworkVar( CBaseCombatWeaponHandle, m_hLastWeapon );

#if !defined( NO_ENTITY_PREDICTION )
	CUtlVector< CHandle< C_BaseEntity > > m_SimulatedByThisPlayer;
#endif

	// players own view models, left & right hand
	CHandle< C_BaseViewModel >	m_hViewModel[ MAX_VIEWMODELS ];

	float					m_flOldPlayerZ;
	float					m_flOldPlayerViewOffsetZ;

	// For UI purposes...
	int				m_iOldAmmo[ MAX_AMMO_TYPES ];

	C_CommandContext		m_CommandContext;

	// For underwater effects
	float							m_flWaterSurfaceZ;
	bool							m_bResampleWaterSurface;
	TimedEvent						m_tWaterParticleTimer;
	CSmartPtr<WaterDebrisEffect>	m_pWaterEmitter;

	friend class CPrediction;

	friend class CTFGameMovementRecon;
	friend class CGameMovement;
	friend class CTFGameMovement;
	friend class CHL1GameMovement;
	friend class CCSGameMovement;
	friend class CHL2GameMovement;
	friend class CDODGameMovement;

	// Accessors for gamemovement
	float GetStepSize( void ) const { return m_Local.m_flStepSize; }

	float m_flNextAvoidanceTime;
	float m_flAvoidanceRight;
	float m_flAvoidanceForward;
	float m_flAvoidanceDotForward;
	float m_flAvoidanceDotRight;

protected:
	virtual bool IsDucked( void ) const { return m_Local.m_bDucked; }
	virtual bool IsDucking( void ) const { return m_Local.m_bDucking; }
	virtual float GetFallVelocity( void ) { return m_Local.m_flFallVelocity; }

	float m_flLaggedMovementValue;

	// These are used to smooth out prediction corrections. They're most useful when colliding with
	// vphysics objects. The server will be sending constant prediction corrections, and these can help
	// the errors not be so jerky.
	Vector m_vecPredictionError;
	float m_flPredictionErrorTime;

	char m_szLastPlaceName[MAX_PLACE_NAME_LENGTH];	// received from the server

	// Texture names and surface data, used by CGameMovement
	int				m_surfaceProps;
	surfacedata_t*	m_pSurfaceData;
	float			m_surfaceFriction;
	char			m_chTextureType;

public:

	const char *GetLastKnownPlaceName( void ) const	{ return m_szLastPlaceName; }	// return the last nav place name the player occupied

	float GetLaggedMovementValue( void ){ return m_flLaggedMovementValue;	}
	bool  ShouldGoSouth( Vector vNPCForward, Vector vNPCRight ); //Such a bad name.

	void SetOldPlayerZ( float flOld ) { m_flOldPlayerZ = flOld;	}
};

EXTERN_RECV_TABLE(DT_BasePlayer);

//-----------------------------------------------------------------------------
// Inline methods
//-----------------------------------------------------------------------------
inline C_BasePlayer *ToBasePlayer( C_BaseEntity *pEntity )
{
	if ( !pEntity || !pEntity->IsPlayer() )
		return NULL;

#if _DEBUG
	Assert( dynamic_cast<C_BasePlayer *>( pEntity ) != NULL );
#endif

	return static_cast<C_BasePlayer *>( pEntity );
}

inline IClientVehicle *C_BasePlayer::GetVehicle()
{
	C_BaseEntity *pVehicleEnt = m_hVehicle.Get();
	return pVehicleEnt ? pVehicleEnt->GetClientVehicle() : NULL;
}

inline bool C_BasePlayer::IsObserver() const
{
	return (GetObserverMode() != OBS_MODE_NONE);
}

inline int C_BasePlayer::GetImpulse( void ) const
{
	return m_nImpulse;
}

inline C_CommandContext* C_BasePlayer::GetCommandContext()
{
	return &m_CommandContext;
}

inline int CBasePlayer::CurrentCommandNumber() const
{
	Assert( m_pCurrentCommand );
	return m_pCurrentCommand->command_number;
}

inline const CUserCmd *CBasePlayer::GetCurrentUserCommand() const
{
	Assert( m_pCurrentCommand );
	return m_pCurrentCommand;
}

#endif // C_BASEPLAYER_H


text:
<?php

namespace PhpOffice\PhpWord\Writer\HTML\Element;

/**
 * Endnote element HTML writer
 *
 * @since 0.10.0
 */
class Endnote extends Footnote
{
    /**
     * Note type
     *
     * @var string
     */
    protected $noteType = 'endnote';
}


text:
wumpus-rover
============

Arduino and schematics for implementing the WumpusRover

Homepage: http://www.wumpus-cave.net