text:
<!DOCTYPE html>

<title>Login</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/>
<link type="text/css" rel="stylesheet" href="/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="/css/bootstrap-theme.min.css" />
<link type="text/css" rel="stylesheet" href="/css/layout.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

(navbar)

(footer)


text:
class CgtraderLevels::User < ActiveRecord::Base
  attr_reader :level

  after_update :set_new_level
  after_update :reward_user, if: :level_id_changed?

  after_initialize do
    self.reputation = 0

    set_new_level
  end

  private

  def set_new_level
    matching_level = CgtraderLevels::Level.where(experience: reputation).first

    if matching_level
      self.level_id = matching_level.id
      @level = matching_level
    end
  end

  def reward_user
    if reputation > reputation_was
      add_coins
      reduce_taxes
    end
  end

  def add_coins
    self.coins += 7
  end

  def reduce_taxes
    self.tax -= 1
  end
end

redpajama_set_name: RedPajamaGithub


text:
layout: single
title: "Lineare Algebra I"
permalink: /teaching/W20/LA_I/
---

## Wintersemester 2020/21

### Aktuelles

Aktuelle Informationen und die Übungsaufgaben finden Sie auf der [Moodle-Seite der Vorlesung](https://moodle.uni-siegen.de/course/view.php?id=23266).

### Termine

* Vorlesungstermine: [Siehe Unisono-Eintrag](https://unisono.uni-siegen.de/). (Beginn: 3. November)
* Übungstermine:  [Siehe Unisono-Eintrag](https://unisono.uni-siegen.de/). (Beginn: 9. November)

<!--
* Tutoriumstermine: [Siehe Unisono-Eintrag](). (Beginn: 11. Oktober)
* Klausurtermin: (5.2.2018, 09:00-11:00, ENC-D 114).
-->

### Kurzbeschreibung

In dieser Vorlesung werden wir die Kategorie endlichdimensionaler
Vektorräume kennenlernen. Diese Kategorie weist eine äußerst nützliche
Analogie zur Kategorie endlicher Mengen auf, ist aber wesentlich
reicher an Struktur. Beherrscht man das Rechnen in der Kategorie
endlichdimensionaler Vektorräume, insbesondere das Lösen von
Gleichungssystemen und das Ausrechnen einer starken Normalform von
Endomorphismen, so hat man einen algorithmischen Zugang zu vielen
interessanten Anwendungen innerhalb und außerhalb der Mathematik.

### Skript

Meine Vorlesungsnotizen werden den Zuhörern der Vorlesung mit einer
Woche Verzögerung zur Verfügung gestellt.


text:
\documentclass{beamer}
\usetheme[titleformat=regular,sectiontitleformat=regular,frametitleformat=regular]{m}

\usepackage[noend]{algpseudocode}
\usepackage{algorithm}

\usepackage[brazil]{babel}
\usepackage[numberedbib]{apacite}
\usepackage[utf8]{inputenc}
\usepackage{mathabx}
\usepackage{tabularx}
\usepackage{lipsum}
\usepackage{multicol}

\newcommand\Fontvi{\fontsize{7}{7.2}\selectfont}

\title{Programação automática evolucionária aplicada ao problema de deduplicação de registros}
\date{\today}
\author{Acadêmico: Herberth Amaral \\
Orientador: Prof. Dr. Renê Rodrigues Veloso}
\institute{Programa de Pós-Graduação em Modelagem Computacional e Sistemas - UNIMONTES}
\begin{document}
  \maketitle

  \section{Problema}

  \begin{frame}{Problema}
      \begin{itemize}
          \item Duplicação de registros é um problema de qualidade de bases de dados;
          \item Instituições com diferentes softwares para diferentes problemas;
          \item Várias bases de dados;
          \item Registros duplicados entre bases de dados;
      \end{itemize}
  \end{frame}

  \begin{frame}{Exemplo de duplicação de registros em uma instituição de saúde}
      \begin{figure}
          \centering
          \includegraphics[width=1.0\textwidth]{hospital.jpg}
          \caption{Diferentes sistemas dentro de um hospital \cite{hospital}}
      \end{figure}
  \end{frame}

  \begin{frame}{Problemas com registros duplicados}
      Os principais problemas com registros duplicados/distribuídos em uma instituição de saúde são:
      \begin{itemize}
          \item Impossibilidade de unificação de prontuários de forma confiável;
          \item Dificuldades de comunicação entre diferentes setores (ex: farmácia e financeiro);
          \item Erros de diagnóstico;
          \item Falta de confiança em processos informatizados.
      \end{itemize}
  \end{frame}

  \section{Deduplicação de registros}

  \begin{frame}{Introdução à deduplicação de registros}
      \begin{itemize}
          \item Deduplicação de registros (também conhecido como \textit{record linkage - RL}) é o processo de identificação de registros duplicados que representam a mesma entidade em um ou mais bases de dados \cite{survey};
          \item Permite a unificação de dados a partir de um ponto em comum (ex: paciente).
      \end{itemize}
  \end{frame}

  \begin{frame}{Processo de deduplicação}
      \begin{figure}
          \centering
          \includegraphics[width=0.9\textwidth]{rlprocess.png}
          \caption{Processo de deduplicação \cite{survey}}
      \end{figure}
  \end{frame}

  \begin{frame}{Funções de similaridade para comparação de registros}
      \begin{table}
          \centering
          \caption{Algumas funções de similaridade \cite{survey}}
          \begin{tabularx}{\textwidth}{|l|X|}
              \hline
              Função                    & Observação \\ \hline
              Jaro                      & Principalmente para primeiros e últimos nomes. Retorna um valor no intervalo $[0,1]$ em que 0 é diferente e 1 é igual. \cite{jaro}\\ \hline
              Jaro-Winkler              & Baseado na Jaro. Dá mais pesos à prefixos. \cite{jaro-winkler} \\ \hline
              Levenshtein               & Número de edições entre duas strings. 0 significa que são iguais\\ \hline
              Similaridade de cosenos   & Intervalo $[-1, 1]$. Utilizado em busca em textos. \\ \hline
          \end{tabularx}
      \end{table}
  \end{frame}

  \begin{frame}{Breve exemplo}
      Considere dois bancos de dados de exemplo:
      \Fontvi
      \begin{multicols}{2}
          \begin{table}[]
              \centering
              \caption{Banco de dados A}
              \begin{tabular}{|l|l|l|l|}
                  \hline
                  ID & Nome  & Sobrenome & Nascimento \\ \hline
                  1  & Luís  & Silva     & 1990-05-01 \\
                  2  & Marco & Túlio     & 1978-03-14 \\ \hline
              \end{tabular}
          \end{table}
          \columnbreak
          \begin{table}[]
              \centering
              \caption{Banco de dados B}
              \begin{tabular}{|l|l|l|l|}
                  \hline
                  ID & Nome   & Sobrenome & Nascimento \\ \hline
                  1  & Luiz   & Silva     & 1990-01-05 \\
                  2  & Marcos & Tulio     & 1978-03-14 \\
                  3  & Pedro  & Ferreira  & 1989-10-21 \\ \hline
              \end{tabular}
          \end{table}
      \end{multicols}

      \textbf{Problema:} Como descobrir as duplicatas?
  \end{frame}

  \begin{frame}{Comparação campo-a-campo}
      \begin{table}[]
          \centering
          \caption{Comparação entre dois registros das bases de dados (depois da limpeza)}
          \label{tbl:comparacao}
          \begin{tabular}{|l|l|l|l|}
              \hline
              Função de comparação             & Nome & Sobrenome & Nascimento \\ \hline
              Jaro                             & luiz & silva     & 1990-05-01 \\
              Jaro                             & luis & silva     & 1990-01-05 \\ \hline
              \textbf{Resultado da comparação} & 0.83 & 1         & 0.96       \\ \hline
          \end{tabular}
      \end{table}

      Chamaremos de $E$ o vetor resultante da comparação.
  \end{frame}
  \begin{frame}{Regra de ligação (classificação)}
      Função que associa o vetor de comparação $E$ com a probabilidade do par de registros pertencerem a uma mesma entidade.

      \textbf{Exemplo:} \[
          F_s(E) = \begin{cases}
              1  &  \text{if }\dfrac{\sum \limits_{e \in E} e}{|E|} \geq 0.95 \\
              0  &  \text{otherwise} \\
          \end{cases}
      \]

      \textbf{Problema:} infelizmente, nem sempre a regra de ligação é tão simples.
  \end{frame}

  \section{Objetivos}
  \begin{frame}{Objetivo geral}
      Desenvolver uma melhoria para o trabalho desenvolvido em \cite{geneticrl} através do uso de programação automática por formigas (DAP) em detrimento à programação genética (GP).
  \end{frame}
  \begin{frame}{Objetivos específicos}
      \begin{itemize}
          \item Um algoritmo de programação genética eficiente do ponto de vista de melhores ajustes de regras de ligação;
          \item Extensões de algoritmos para comparação de pares de registros em meio a dados faltantes;
          \item Uma métrica similar a Jaro-Winkler para nomes lusófonos.
      \end{itemize}
  \end{frame}

  \section{Proposta deste trabalho: DAP para geração das regras de ligação}
  \begin{frame}{\textit{Dynamic ant programming}}
      \begin{itemize}
          \item Programação genética (\textit{Genetic programming - GP}) é uma técnica proposta por \cite{koza} para evolução artificial de programas de computador;
          \item Problema do inchaço;
          \item Programação automática por formigas (\textit{Dynamic ant programming - DAP}) é uma forma de geração automática de programas que resolve o problema do inchaço através da limitação prévia do número de nós \cite{shirakawa}.
      \end{itemize}
  \end{frame}

  \begin{frame}{Algoritmo}
        \begin{algorithm}[H]
        \caption{Dynamic Ant Programming}
        \label{alg:dap}
        \begin{algorithmic}[1]

        \Procedure{DAP}{m:numero de formigas}
        \Repeat
        \For{k=1 \textbf{to} m}
        \Repeat
          \State{Do nó atual $i$, selecione o nó $j$ com probabilidade definida na eq.\ref{eq:pkijt}}
        \Until{caminho completo ser construido}
        \EndFor
        \State Atualiza feromônio utilizando eq.\ref{eq:atualizacao-feromonio}
        \State{Exclui nós;}
        \State Insere nós;
        \Until{condição de parada é verdadeira}
        \EndProcedure
        \end{algorithmic}
        \end{algorithm}
  \end{frame}

  \begin{frame}{Funcionamento do DAP}
      A probabilidade da formiga $k$ localizada no nó $i$ movendo do nó $j$ para o nó $u$ no tempo $t$ é:
      \begin{equation}
          \label{eq:pkijt}
          p^k_{i_uj}(t) = \begin{cases}
              \dfrac{\tau_{i_uj}(t)}{\sum_{l\in N^k_i(t)}\tau_{i_ul}(t)} & \text{ if } j \in N^k_i(t) \\
              0 & \text{ if } j \notin N^k_i(t) \\
          \end{cases}
      \end{equation}

      A atualização de feromônio é feita segundo a seguinte regra:

      \begin{equation}
          \label{eq:atualizacao-feromonio}
          \tau_{ij}(t+1) = (1-\rho)\tau_{ij}(t) + \Delta\tau^{best}_{ij}(t), \rho \in (0,1]
      \end{equation}

      $\Delta\tau^{best}_{ij}$ é definido da seguinte forma:

      \begin{equation}
          \label{eq:delta-t}
          \Delta\tau^{best}_{ij}(t) = \begin{cases}
              \dfrac{Q}{L_k} & \text{ if} (i,j) \in T_k \\
              0 & \text{ otherwise}
          \end{cases}
      \end{equation}
  \end{frame}

  \begin{frame}{Metodologia deste trabalho}
      \begin{itemize}
          \item Baseia-se primeiramente na metodologia em \cite{geneticrl};
          \item Substitui a evolução de programas usando programação genética (GP) pela técnica de progrmação automática por formigas (DAP);
          \item \textit{Hipótese}: programas menores e mais expressivos, sem perda da capacidade de generalização;
      \end{itemize}
  \end{frame}

  \begin{frame}{Função de \textit{fitness}}
      Utiliza-se o escore F1, uma média harmônica entre \textit{precisão}
      (chance de acontecer uma classificação correta) e \textit{revocação}
      (chance de uma classificação positiva dela ser realmente positiva).
      Matematicamente falando:
      \begin{equation}
          P = \dfrac{T_p}{T_p+F_p}
      \end{equation}
      \begin{equation}
          R = \dfrac{T_p}{T_p+F_n}
      \end{equation}
      \begin{equation}
          \label{eq:f1-score}
          F_1 = 2\cdot \dfrac{P\cdot R}{P+R}
      \end{equation}
  \end{frame}

  \begin{frame}{Resultados parciais}
      Parâmetros:
        \begin{itemize}
            \item \textbf{População:} 20 formigas;
            \item \textbf{Gerações:} 20 gerações;
            \item \textbf{Critério de parada:} finalização das 20 gerações;
            \item \textbf{$\tau_{min}$:} 0;
            \item \textbf{$\tau_{max}$:} 1;
            \item \textbf{$\rho$:} 0.5;
            \item \textbf{Métrica de fitness:} Escore F1;
        \end{itemize}
  \end{frame}

  \begin{frame}{Resultados parciais}
    Dentre as execuções, o melhor valor final do escore F1 foi 0.9821, com uma média de 0.8412 ($\sigma=0.1691$) e mediana 0.8844.
    \begin{figure}[H]
        \centering
        \includegraphics[width=0.8\textwidth]{grafico.png}
        \caption{Evolução do fitness médio e respectivo desvio padrão através das gerações}
        \label{fig:grafico}
    \end{figure}
  \end{frame}

  \begin{frame}{Resultados parciais}
        \begin{table}[H]
        \centering
        \caption{Comparação entre o método proposto por \cite{geneticrl} e método por DAP}
        \label{tbl:comparacao}
        \begin{tabular}{ll}
        \multicolumn{1}{c}{\textbf{Média GP (DP)}} & \multicolumn{1}{c}{\textbf{Média DAP (DP)}} \\
        0.956 (0.053)                                & 0.841 (0.169)
        \end{tabular}
        \end{table}
  \end{frame}

  \section{Conclusões e direcionamento de pesquisa}
  \begin{frame}{Conclusões}
      \begin{itemize}
          \item Proposta apresentada em estágio inicial, outra proposta em desenvolvimento;
          \item Resultados estatisticamente equivalentes àqueles apresentados por \cite{geneticrl};
      \end{itemize}
  \end{frame}
  \begin{frame}{Direcionamento de pesquisa}
      \Fontvi
      \begin{itemize}
          \item Usar outras abordagens para inserção e remoção de nós;
          \item Outras abordagens em colônia de formigas (evaporação de feromônio, escolha de nó, etc);
          \item Adaptação da função Jaro-Winkler para o contexto local;
      \end{itemize}
  \end{frame}

  \begin{frame}{Cronograma}
      \begin{figure}
          \centering
          \includegraphics[width=0.9\textwidth]{cronograma.png}
      \end{figure}
  \end{frame}

  \section{Perguntas}
  \section{Muito obrigado!}
  \begin{frame}{Códigos}
      Os códigos dos experimentos feitos até agora estão disponibilizados em \url{https://github.com/herberthamaral/mestrado/tree/master/ProjetoDissertacao}.
  \end{frame}

  \begin{frame}
      \bibliographystyle{apacite}
      \bibliography{apresentacao}
  \end{frame}
\end{document}


text:
<?php

namespace AMZ\BaseBundle\Form;

class FormGeneratorProvider extends FormGeneratorAware
{

    protected $formType;

    protected $createRoute;

    protected $editRoute;

    protected $deleteRoute;

    /**
     * Creates a form to create a entity.
     *
     * @param Object $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    public function generateCreateForm($entity)
    {
        return $this->createForm(
            $this->formType,
            $entity,
            array(
                'action' => $this->generateUrl($this->createRoute),
                'method' => 'POST',
            )
        );
    }

    /**
     * Creates a form to create a entity.
     *
     * @param Object $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    public function generateEditForm($entity)
    {
        return $this->createForm(
            $this->formType,
            $entity,
            array(
                'action' => $this->generateUrl($this->editRoute, array('id' => $entity->getId())),
                'method' => 'PUT',
            )
        );
    }

    /**
     * Creates a form to delete a Video entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return \Symfony\Component\Form\Form The form
     */
    public function generateDeleteForm($id)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl($this->deleteRoute, array('id' => $id)))
            ->setMethod('DELETE')
            ->add('submit', 'submit', array('label' => 'Delete'))
            ->getForm()
            ;
    }
}


text:
div.autocomplete_internal_container {
  border: 2px solid #ccc;
  color: #333;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: normal;
  line-height: 20px;
  padding: 4px;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  border-radius: 8px;
}
div.autocomplete_internal_container div.placeholder {
  color: #777;
  float: left;
  font-size: 16px;
  line-height: 20px;
  margin: 10px 0 0 0;
}
div.autocomplete_internal_container input.autocomplete-input {
  background: transparent;
  border: 0px;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
  color: #000;
  float: left;
  font-size: 16px;
  height: 20px;
  line-height: 20px;
  margin: 10px 0px;
  outline: none;
  padding: 0px;
  vertical-align: middle;
  width: 120px;
}
div.autocomplete_internal_container div.token-group {
  background: #eee;
  border: 1px solid #ccc;
  cursor: pointer;
  float: left;
  margin: 4px;
  padding: 4px 6px;
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
}
div.autocomplete_internal_container div.token-group span.remove-token-group {
  font-size: 11px;
  margin-right: 2px;
}
div.autocomplete_internal_container div.selected {
  background: #b0d1f9;
  background: -moz-linear-gradient(top,#d2e6fd 0%,#b0d1f9 100%);
  background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#d2e6fd),color-stop(100%,#b0d1f9));
  background: -webkit-linear-gradient(top,#d2e6fd 0%,#b0d1f9 100%);
  background: -o-linear-gradient(top,#d2e6fd 0%,#b0d1f9 100%);
  background: -ms-linear-gradient(top,#d2e6fd 0%,#b0d1f9 100%);
  background: linear-gradient(top,#d2e6fd 0%,#b0d1f9 100%);
}
div.autocomplete_internal_container span.token {
  margin: 0px 2px;
}
div.autocomplete_internal_container ul.dropdown {
  background: #e3e3e3;
  border: 1px solid #ccc;
  margin: 12px 0px 0px 0px;
  max-height: 300px;
  min-width: 140px;
  overflow-x: visible;
  overflow-y: auto;
  padding: 0px;
  position: absolute;
  z-index: 10;
}
div.autocomplete_internal_container ul.dropdown li {
  background: #f9f9f9;
  border-bottom: 1px solid #d8d8d8;
  font-size: 13px;
  list-style: none;
  margin: 0px;
  padding: 4px;
}
div.autocomplete_internal_container ul.dropdown li span.children-indicator {
  float: right;
}
div.autocomplete_internal_container ul.dropdown li.option {
  cursor: pointer;
}
div.autocomplete_internal_container ul.dropdown li.highlighted {
  background: #00519d;
  color: white;
}
div.autocomplete_internal_container ul.dropdown li.last {
  border-bottom: 0px;
}
div.autocomplete_internal_container div.clear7282 {
  clear: both;
}


text:
$here = (Split-Path -Parent $MyInvocation.MyCommand.Path)
. $here\Example.ps1

# Pester tests
Describe 'Get-Planet' {
  It "Given no parameters, it lists all 8 planets" {
    $allPlanets = Get-Planet
    $allPlanets.Count | Should -Be 8
  }

  Context "Filtering by Name" {
    It "Given valid -Name '<Filter>', it returns '<Expected>'" -TestCases @(
      @{ Filter = 'Earth'; Expected = 'Earth' }
      @{ Filter = 'ne*'  ; Expected = 'Neptune' }
      @{ Filter = 'ur*'  ; Expected = 'Uranus' }
      @{ Filter = 'm*'   ; Expected = 'Mercury', 'Mars' }
    ) {
      param ($Filter, $Expected)

      $planets = Get-Planet -Name $Filter
      $planets.Name | Should -Be $Expected
    }

    It "Given invalid parameter -Name 'Alpha Centauri', it returns `$null" {
      $planets = Get-Planet -Name 'Alpha Centauri'
      $planets | Should -Be $null
    }
  }
}


text:
package admixer

import (
	"encoding/json"
	"fmt"
	"net/http"

	"github.com/prebid/openrtb/v17/openrtb2"
	"github.com/prebid/prebid-server/adapters"
	"github.com/prebid/prebid-server/config"
	"github.com/prebid/prebid-server/errortypes"
	"github.com/prebid/prebid-server/openrtb_ext"
)

type AdmixerAdapter struct {
	endpoint string
}

// Builder builds a new instance of the Admixer adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
	bidder := &AdmixerAdapter{
		endpoint: config.Endpoint,
	}
	return bidder, nil
}

type admixerImpExt struct {
	CustomParams map[string]interface{} `json:"customParams"`
}

func (a *AdmixerAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) (requests []*adapters.RequestData, errors []error) {
	rq, errs := a.makeRequest(request)

	if len(errs) > 0 {
		errors = append(errors, errs...)
		return
	}

	if rq != nil {
		requests = append(requests, rq)
	}

	return
}

func (a *AdmixerAdapter) makeRequest(request *openrtb2.BidRequest) (*adapters.RequestData, []error) {
	var errs []error
	var validImps []openrtb2.Imp

	if len(request.Imp) == 0 {
		return nil, []error{&errortypes.BadInput{
			Message: "No impressions in request",
		}}
	}

	for _, imp := range request.Imp {
		if err := preprocess(&imp); err != nil {
			errs = append(errs, err)
			continue
		}
		validImps = append(validImps, imp)
	}

	if len(validImps) == 0 {
		return nil, errs
	}

	request.Imp = validImps

	reqJSON, err := json.Marshal(request)
	if err != nil {
		errs = append(errs, err)
		return nil, errs
	}

	headers := http.Header{}
	headers.Add("Content-Type", "application/json;charset=utf-8")
	headers.Add("Accept", "application/json")
	return &adapters.RequestData{
		Method:  "POST",
		Uri:     a.endpoint,
		Body:    reqJSON,
		Headers: headers,
	}, errs
}

func preprocess(imp *openrtb2.Imp) error {
	var bidderExt adapters.ExtImpBidder
	if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil {
		return &errortypes.BadInput{
			Message: err.Error(),
		}
	}

	var admixerExt openrtb_ext.ExtImpAdmixer
	if err := json.Unmarshal(bidderExt.Bidder, &admixerExt); err != nil {
		return &errortypes.BadInput{
			Message: "Wrong Admixer bidder ext",
		}
	}

	//don't use regexp due to possible performance reduce
	if len(admixerExt.ZoneId) < 32 || len(admixerExt.ZoneId) > 36 {
		return &errortypes.BadInput{
			Message: "ZoneId must be UUID/GUID",
		}
	}

	imp.TagID = admixerExt.ZoneId

	if imp.BidFloor == 0 && admixerExt.CustomBidFloor > 0 {
		imp.BidFloor = admixerExt.CustomBidFloor
	}

	imp.Ext = nil

	if admixerExt.CustomParams != nil {
		impExt := admixerImpExt{
			CustomParams: admixerExt.CustomParams,
		}
		var err error
		if imp.Ext, err = json.Marshal(impExt); err != nil {
			return &errortypes.BadInput{
				Message: err.Error(),
			}
		}
	}

	return nil
}

func (a *AdmixerAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) {
	if response.StatusCode == http.StatusNoContent {
		return nil, nil
	}

	if response.StatusCode >= http.StatusInternalServerError {
		return nil, []error{&errortypes.BadServerResponse{
			Message: fmt.Sprintf("Unexpected status code: %d. Dsp server internal error", response.StatusCode),
		}}
	}

	if response.StatusCode >= http.StatusBadRequest {
		return nil, []error{&errortypes.BadInput{
			Message: fmt.Sprintf("Unexpected status code: %d. Bad request to dsp", response.StatusCode),
		}}
	}

	if response.StatusCode != http.StatusOK {
		return nil, []error{&errortypes.BadServerResponse{
			Message: fmt.Sprintf("Unexpected status code: %d", response.StatusCode),
		}}
	}

	var bidResp openrtb2.BidResponse
	if err := json.Unmarshal(response.Body, &bidResp); err != nil {
		return nil, []error{err}
	}

	//additional no content check
	if len(bidResp.SeatBid) == 0 || len(bidResp.SeatBid[0].Bid) == 0 {
		return nil, nil
	}

	bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(bidResp.SeatBid[0].Bid))

	for _, sb := range bidResp.SeatBid {
		for i := range sb.Bid {
			bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{
				Bid:     &sb.Bid[i],
				BidType: getMediaTypeForImp(sb.Bid[i].ImpID, internalRequest.Imp),
			})
		}
	}
	return bidResponse, nil
}

func getMediaTypeForImp(impID string, imps []openrtb2.Imp) openrtb_ext.BidType {
	for _, imp := range imps {
		if imp.ID == impID {
			if imp.Banner != nil {
				return openrtb_ext.BidTypeBanner
			} else if imp.Video != nil {
				return openrtb_ext.BidTypeVideo
			} else if imp.Native != nil {
				return openrtb_ext.BidTypeNative
			} else if imp.Audio != nil {
				return openrtb_ext.BidTypeAudio
			}
		}
	}
	return openrtb_ext.BidTypeBanner
}


text:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mastertheboss.jaxrs</groupId>
  <artifactId>jaxrs-demo</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>war</packaging>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
    <version.wildfly.maven.plugin>2.0.0.Final</version.wildfly.maven.plugin>
  </properties>
  <dependencies>
    <dependency>
      <groupId>jakarta.platform</groupId>
      <artifactId>jakarta.jakartaee-api</artifactId>
      <version>10.0.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
          <source>11</source>
          <target>11</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          <!-- Java EE 6 doesn't require web.xml, Maven needs to catch up! -->
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.wildfly.plugins</groupId>
        <artifactId>wildfly-maven-plugin</artifactId>
        <version>${version.wildfly.maven.plugin}</version>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <!-- The default profile skips all tests, though you can tune it to run
             just unit tests based on a custom pattern -->
      <!-- Seperate profiles are provided for running all tests, including Arquillian
             tests that execute in the specified container -->
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.4.3</version>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


text:
/****************************************************************************
** Meta object code from reading C++ file 'qsound.h'
**
** Created: Mon 26. Nov 09:27:18 2012
**      by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#include "../../../kernel/qsound.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'qsound.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.4. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif

QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_QSound[] = {

 // content:
       6,       // revision
       0,       // classname
       0,    0, // classinfo
       2,   14, // methods
       0,    0, // properties
       0,    0, // enums/sets
       0,    0, // constructors
       0,       // flags
       0,       // signalCount

 // slots: signature, parameters, type, tag, flags
       8,    7,    7,    7, 0x0a,
      15,    7,    7,    7, 0x0a,

       0        // eod
};

static const char qt_meta_stringdata_QSound[] = {
    "QSound\0\0play()\0stop()\0"
};

void QSound::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
    if (_c == QMetaObject::InvokeMetaMethod) {
        Q_ASSERT(staticMetaObject.cast(_o));
        QSound *_t = static_cast<QSound *>(_o);
        switch (_id) {
        case 0: _t->play(); break;
        case 1: _t->stop(); break;
        default: ;
        }
    }
    Q_UNUSED(_a);
}

const QMetaObjectExtraData QSound::staticMetaObjectExtraData = {
    0,  qt_static_metacall
};

const QMetaObject QSound::staticMetaObject = {
    { &QObject::staticMetaObject, qt_meta_stringdata_QSound,
      qt_meta_data_QSound, &staticMetaObjectExtraData }
};

#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &QSound::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION

const QMetaObject *QSound::metaObject() const
{
    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}

void *QSound::qt_metacast(const char *_clname)
{
    if (!_clname) return 0;
    if (!strcmp(_clname, qt_meta_stringdata_QSound))
        return static_cast<void*>(const_cast< QSound*>(this));
    return QObject::qt_metacast(_clname);
}

int QSound::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 2)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 2;
    }
    return _id;
}
QT_END_MOC_NAMESPACE


text:
package org.ujorm.transaction.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.ujorm.criterion.Criterion;
import org.ujorm.spring.UjormTransactionManager;
import org.ujorm.transaction.domains.Order;
import org.ujorm.transaction.service.OrderService;

/** An Order service implementation */
@Service("orderService")
public class OrderServiceImpl implements OrderService {

    @Autowired
    private UjormTransactionManager manager;

    /** Uloží ménu */
    @Transactional
    @Override
    public void save(Order order) {
        manager.getLocalSession().insert(order);
    }

    /** Aktualizuje měnu */
    @Transactional
    @Override
    public void update(Order order) {
        manager.getLocalSession().update(order);
    }

    /** Smaže měnu */
    @Transactional
    @Override
    public void delete(Order order) {
        manager.getLocalSession().delete(order);
    }

    /** Načte měnu podle ID */
    @Transactional
    @Override
    public Order getOrder(Long orderId) {
        final Criterion<Order> criterion = Order.ID.whereEq(orderId);
        return manager.getLocalSession().createQuery(criterion).uniqueResult();
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: dtome
 * Date: 18/02/17
 * Time: 0:46
 */

namespace Slx\UserInterface\Controllers\User;

use Silex\Application;
use Slx\Application\Command\User\SignUpUserCommand;
use Slx\Domain\Entity\User\Exception\UserAlreadyExistsException;
use Slx\Domain\ValueObject\Password\PasswordIsNotValidException;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormError;

class SignUpController
{
    /**
     * @var Application
     */
    private $application;

    /**
     * SignInController constructor.
     *
     * @param Application $application
     */
    public function __construct(Application $application)
    {
        $this->application = $application;
    }

    public function indexAction()
    {
        /** @var Form $form */
        $form = $this->application['sign_up_form'];
        $form->handleRequest($this->application['request_stack']->getCurrentRequest());
        try {
            if ($form->isValid()) {
                $isSignedUp = $this->application['commandhandler.service']->execute(
                    new SignUpUserCommand(
                        $form->get('username')->getData(),
                        $form->get('email')->getData(),
                        $form->get('password')->getData()
                    )
                );

                if ($isSignedUp) {
                    return $this->application->redirect($this->application['url_generator']->generate('signin'));
                }
            }
        } catch (UserAlreadyExistsException $exception) {
            $form->get('email')->addError(new FormError('Email is already registered by another user'));
        } catch (PasswordIsNotValidException $passwordIsNotValidException) {
            $form->get('password')->addError(new FormError($passwordIsNotValidException->getMessage()));
        }

        return $this->application['twig']->render('views/user/signup.html.twig',
            [
                'form' => $this->application['sign_up_form']->createView()
            ]
        );
    }

}


text:
#ifndef _LIB_ERRNO_H_
#define _LIB_ERRNO_H_

#include <sys/cdefs.h>

#include <stdint.h>

typedef int32_t error_t;

#define EPERM            1
#define ENOENT           2
#define ESRCH            3
#define EINTR            4
#define EIO              5
#define ENXIO            6
#define E2BIG            7
#define ENOEXEC          8
#define EBADF            9
#define ECHILD          10
#define EAGAIN          11
#define ENOMEM          12
#define EACCES          13
#define EFAULT          14
#define ENOTBLK         15
#define EBUSY           16
#define EEXIST          17
#define EXDEV           18
#define ENODEV          19
#define ENOTDIR         20
#define EISDIR          21
#define EINVAL          22
#define ENFILE          23
#define EMFILE          24
#define ENOTTY          25
#define ETXTBSY         26
#define EFBIG           27
#define ENOSPC          28
#define ESPIPE          29
#define EROFS           30
#define EMLINK          31
#define EPIPE           32
#define EDOM            33
#define ERANGE          34
#define EDEADLK         35
#define ENAMETOOLONG    36
#define ENOLCK          37
#define ENOSYS          38
#define ENOTEMPTY       39
#define ELOOP           40
#define EWOULDBLOCK     EAGAIN
#define ENOMSG          42
#define EIDRM           43
#define ECHRNG          44
#define EL2NSYNC        45
#define EL3HLT          46
#define EL3RST          47
#define ELNRNG          48
#define EUNATCH         49
#define ENOCSI          50
#define EL2HLT          51
#define EBADE           52
#define EBADR           53
#define EXFULL          54
#define ENOANO          55
#define EBADRQC         56
#define EBADSLT         57
#define EDEADLOCK       EDEADLK
#define EBFONT          59
#define ENOSTR          60
#define ENODATA         61
#define ETIME           62
#define ENOSR           63
#define ENONET          64
#define ENOPKG          65
#define EREMOTE         66
#define ENOLINK         67
#define EADV            68
#define ESRMNT          69
#define ECOMM           70
#define EPROTO          71
#define EMULTIHOP       72
#define EDOTDOT         73
#define EBADMSG         74
#define EOVERFLOW       75
#define ENOTUNIQ        76
#define EBADFD          77
#define EREMCHG         78
#define ELIBACC         79
#define ELIBBAD         80
#define ELIBSCN         81
#define ELIBMAX         82
#define ELIBEXEC        83
#define EILSEQ          84
#define ERESTART        85
#define ESTRPIPE        86
#define EUSERS          87
#define ENOTSOCK        88
#define EDESTADDRREQ    89
#define EMSGSIZE        90
#define EPROTOTYPE      91
#define ENOPROTOOPT     92
#define EPROTONOSUPPORT 93
#define ESOCKTNOSUPPORT 94
#define EOPNOTSUPP      95
#define ENOTSUP         EOPNOTSUPP
#define EPFNOSUPPORT    96
#define EAFNOSUPPORT    97
#define EADDRINUSE      98
#define EADDRNOTAVAIL   99
#define ENETDOWN        100
#define ENETUNREACH     101
#define ENETRESET       102
#define ECONNABORTED    103
#define ECONNRESET      104
#define ENOBUFS         105
#define EISCONN         106
#define ENOTCONN        107
#define ESHUTDOWN       108
#define ETOOMANYREFS    109
#define ETIMEDOUT       110
#define ECONNREFUSED    111
#define EHOSTDOWN       112
#define EHOSTUNREACH    113
#define EALREADY        114
#define EINPROGRESS     115
#define ESTALE          116
#define EUCLEAN         117
#define ENOTNAM         118
#define ENAVAIL         119
#define EISNAM          120
#define EREMOTEIO       121
#define EDQUOT          122
#define ENOMEDIUM       123
#define EMEDIUMTYPE     124
#define ECANCELED       125
#define ENOKEY          126
#define EKEYEXPIRED     127
#define EKEYREVOKED     128
#define EKEYREJECTED    129
#define EOWNERDEAD      130
#define ENOTRECOVERABLE 131
#define ERFKILL         132
#define EHWPOISON       133

#ifdef __GNUC__
__const
#endif
__hidden int *__errno_location(void);

#undef errno
#define errno (*__errno_location())

#endif /* !_LIB_ERRNO_H_ */


text:
package groovy.servlet;

import groovy.util.ResourceConnector;
import groovy.util.ResourceException;

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

/**
 * A base class dealing with common HTTP servlet API housekeeping aspects.
 *

 *
Resource name mangling (pattern replacement)

 *

 * Also implements Groovy's {@link groovy.util.ResourceConnector} in a dynamic
 * manner. It allows you to modify the resource name that is searched for with a
 * replace all operation. See {@link java.util.regex.Pattern} and
 * {@link java.util.regex.Matcher} for details.
 * The servlet init parameter names are:
 *

 * {@value #INIT_PARAM_RESOURCE_NAME_REGEX} = empty - defaults to null
 * resource.name.replacement = empty - defaults to null
 * resource.name.replace.all = true (default) | false means replaceFirst()
 *

 * Note: If you specify a regex, you have to specify a replacement string too!
 * Otherwise an exception gets raised.
 *

 *
Logging and bug-hunting options

 *

 * This implementation provides a verbosity flag switching log statements.
 * The servlet init parameter name is:
 *

 * verbose = false(default) | true
 *

 *

 * In order to support class-loading-troubles-debugging with Tomcat 4 or
 * higher, you can log the class loader responsible for loading some classes.
 * See GROOVY-861 for details.
 * The servlet init parameter name is:
 *

 * log.GROOVY861 = false(default) | true
 *

 *

 * If you experience class-loading-troubles with Tomcat 4 (or higher) or any
 * other servlet container using custom class loader setups, you can fallback
 * to use (slower) reflection in Groovy's MetaClass implementation. Please
 * contact the dev team with your problem! Thanks.
 * The servlet init parameter name is:
 *

 * reflection = false(default) | true
 *

 *
 * @author Christian Stein
 * @author Roshan Dawrani (roshandawrani)
 */
public abstract class AbstractHttpServlet extends HttpServlet implements ResourceConnector {

    public static final String INIT_PARAM_RESOURCE_NAME_REGEX = "resource.name.regex";

    public static final String INIT_PARAM_RESOURCE_NAME_REGEX_FLAGS = "resource.name.regex.flags";

    /**
     * Content type of the HTTP response.
     */
    public static final String CONTENT_TYPE_TEXT_HTML = "text/html";

    /**
     * Servlet API include key name: path_info
     */
    public static final String INC_PATH_INFO = "javax.servlet.include.path_info";

    /* *** Not used, yet. See comments in getScriptUri(HttpServletRequest). ***
     * Servlet API include key name: request_uri
     */
    public static final String INC_REQUEST_URI = "javax.servlet.include.request_uri";

    /**
     * Servlet API include key name: servlet_path
     */
    public static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path";

    /**
     * Servlet (or the web application) context.
     */
    protected ServletContext servletContext;

    /**
     * Either null or a compiled pattern read from "{@value #INIT_PARAM_RESOURCE_NAME_REGEX}"
     * and used in {@link AbstractHttpServlet#getScriptUri(HttpServletRequest)}.
     */
    protected Pattern resourceNamePattern;

    /**
     * The replacement used by the resource name matcher.
     */
    protected String resourceNameReplacement;

    /**
     * The replace method to use on the matcher.
     *

     * true - replaceAll(resourceNameReplacement); (default)
     * false - replaceFirst(resourceNameReplacement);
     *

     */
    protected boolean resourceNameReplaceAll;

    /**
     * Controls almost all log output.
     */
    protected boolean verbose;

    /**
     * Encoding to use, becomes charset part of contentType.
     */
    protected String encoding = "UTF-8";

    /**
     * Mirrors the static value of the reflection flag in MetaClass.
     * See AbstractHttpServlet#logGROOVY861
     */
    protected boolean reflection;

    /**
     * Debug flag logging the class the class loader of the request.
     */
    private boolean logGROOVY861;

    /** a.fink: it was in {@link #removeNamePrefix}, but was extracted to var for optimization*/
    protected String namePrefix;

    /**
     * Initializes all fields with default values.
     */
    public AbstractHttpServlet () {
        this.servletContext = null;
        this.resourceNameReplacement = null;
        this.resourceNameReplaceAll = true;
        this.verbose = false;
        this.reflection = false;
        this.logGROOVY861 = false;
    }

    protected void generateNamePrefixOnce () {
        URI uri = null;

        String realPath = servletContext.getRealPath("/");
        if (realPath != null) { uri = new File(realPath).toURI();}//prevent NPE if in .war

        try {
            URL res = servletContext.getResource("/");
            if (res != null) { uri = res.toURI(); }
        } catch (MalformedURLException ignore) {
        } catch (URISyntaxException ignore) {
        }

        if (uri != null) {
            try {
                namePrefix = uri.toURL().toExternalForm();
                return;
            } catch (MalformedURLException e) {
                log("generateNamePrefixOnce [ERROR] Malformed URL for base path / == '"+ uri +'\'', e);
            }
        }

        namePrefix = "";
    }

    protected String removeNamePrefix(String name) throws ResourceException {
        if (namePrefix == null) {
            generateNamePrefixOnce();
        }
        if (name.startsWith(namePrefix)) {//usualy name has text
            return name.substring(namePrefix.length());
        }
        return name;
    }

    /**
     * Interface method for ResourceContainer. This is used by the GroovyScriptEngine.
     */
    public URLConnection getResourceConnection (String name) throws ResourceException {
        name = removeNamePrefix(name).replace('\\', '/');

        //remove the leading / as we are trying with a leading / now
        if (name.startsWith("WEB-INF/groovy/")) {
            name = name.substring(15);//just for uniformity
        } else if (name.startsWith("/")) {
            name = name.substring(1);
        }

        /*
        * Try to locate the resource and return an opened connection to it.
        */
        try {
            URL url = servletContext.getResource('/' + name);
            if (url == null) {
                url = servletContext.getResource("/WEB-INF/groovy/" + name);
            }
            if (url == null) {
                throw new ResourceException("Resource \"" + name + "\" not found!");
            }
            return url.openConnection();
        } catch (IOException e) {
            throw new ResourceException("Problems getting resource named \"" + name + "\"!", e);
        }
    }

    /**
     * Returns the include-aware uri of the script or template file.
     *
     * @param request the http request to analyze
     * @return the include-aware uri either parsed from request attributes or
     *         hints provided by the servlet container
     */
    protected String getScriptUri(HttpServletRequest request) {
        /*
         * Log some debug information for http://jira.codehaus.org/browse/GROOVY-861
         */
        if (logGROOVY861) {
            log("Logging request class and its class loader:");
            log(" c = request.getClass() :\"" + request.getClass() + "\"");
            log(" l = c.getClassLoader() :\"" + request.getClass().getClassLoader() + "\"");
            log(" l.getClass()           :\"" + request.getClass().getClassLoader().getClass() + "\"");
            /*
             * Keep logging, if we're verbose. Else turn it off.
             */
            logGROOVY861 = verbose;
        }

        //
        // NOTE: This piece of code is heavily inspired by Apaches Jasper2!
        //
        // http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-jasper/jasper2/ \
        //        src/share/org/apache/jasper/servlet/JspServlet.java?view=markup
        //
        // Why doesn't it use request.getRequestURI() or INC_REQUEST_URI?
        //

        String uri = null;
        String info = null;

        //
        // Check to see if the requested script/template source file has been the
        // target of a RequestDispatcher.include().
        //
        uri = (String) request.getAttribute(INC_SERVLET_PATH);
        if (uri != null) {
            //
            // Requested script/template file has been target of
            // RequestDispatcher.include(). Its path is assembled from the relevant
            // javax.servlet.include.* request attributes and returned!
            //
            info = (String) request.getAttribute(INC_PATH_INFO);
            if (info != null) {
                uri += info;
            }
            return applyResourceNameMatcher(uri);
        }

        //
        // Requested script/template file has not been the target of a
        // RequestDispatcher.include(). Reconstruct its path from the request's
        // getServletPath() and getPathInfo() results.
        //
        uri = request.getServletPath();
        info = request.getPathInfo();
        if (info != null) {
            uri += info;
        }

        /*
         * TODO : Enable auto ".groovy" extension replacing here!
         * http://cvs.groovy.codehaus.org/viewrep/groovy/groovy/groovy-core/src/main/groovy/servlet/GroovyServlet.java?r=1.10#l259
         */

        return applyResourceNameMatcher(uri);
    }

    protected String applyResourceNameMatcher (String uri) {
        if (resourceNamePattern != null) {// mangle resource name with the compiled pattern.
            Matcher matcher = resourceNamePattern.matcher(uri);

            String replaced;
            if (resourceNameReplaceAll) {
                replaced = matcher.replaceAll(resourceNameReplacement);
            } else {
                replaced = matcher.replaceFirst(resourceNameReplacement);
            }
            if (!uri.equals(replaced)) {
                if (verbose) {
                    log("Replaced resource name \"" + uri + "\" with \"" + replaced + "\".");
                }
                return replaced;
            }
        }
        return uri;
    }

    /**
     * Parses the http request for the real script or template source file.
     *
     * @param request
     *            the http request to analyze
     * @return a file object using an absolute file path name, or null if the
     *         servlet container cannot translate the virtual path to a real
     *         path for any reason (such as when the content is being made
     *         available from a .war archive).
     */
    protected File getScriptUriAsFile(HttpServletRequest request) {
        String uri = getScriptUri(request);
        String real = servletContext.getRealPath(uri);
        if (real == null) {
            return null;
        }
        return new File(real).getAbsoluteFile();
    }

    /**
     * Overrides the generic init method to set some debug flags.
     *
     * @param config the servlet configuration provided by the container
     * @throws ServletException if init() method defined in super class
     *                          javax.servlet.GenericServlet throws it
     */
    public void init(ServletConfig config) throws ServletException {
        /*
         * Never forget super.init()!
         */
        super.init(config);

        /*
         * Grab the servlet context.
         */
        this.servletContext = config.getServletContext();

        // Get verbosity hint.
        String value = config.getInitParameter("verbose");
        if (value != null) {
            this.verbose = Boolean.valueOf(value);
        }

        // get encoding
        value = config.getInitParameter("encoding");
        if (value != null) {
            this.encoding = value;
        }

        // And now the real init work...
        if (verbose) {
            log("Parsing init parameters...");
        }

        String regex = config.getInitParameter(INIT_PARAM_RESOURCE_NAME_REGEX);
        if (regex != null) {
            String replacement = config.getInitParameter("resource.name.replacement");
            if (replacement == null) {
                Exception npex = new NullPointerException("resource.name.replacement");
                String message = "Init-param 'resource.name.replacement' not specified!";
                log(message, npex);
                throw new ServletException(message, npex);
            } else if ("EMPTY_STRING".equals(replacement)) {//<param-value></param-value> is prohibited
                replacement = "";
            }
            int flags = 0; // TODO : Parse pattern compile flags (literal names).
            String flagsStr = config.getInitParameter(INIT_PARAM_RESOURCE_NAME_REGEX_FLAGS);
            if (flagsStr != null && flagsStr.length() > 0) {
              flags = Integer.decode(flagsStr.trim());//throws NumberFormatException
            }
            resourceNamePattern = Pattern.compile(regex, flags);
            this.resourceNameReplacement = replacement;
            String all = config.getInitParameter("resource.name.replace.all");
            if (all != null) {
                this.resourceNameReplaceAll = Boolean.valueOf(all.trim());
            }
        }

        value = config.getInitParameter("logGROOVY861");
        if (value != null) {
            this.logGROOVY861 = Boolean.valueOf(value);
            // nothing else to do here
        }

        /*
         * If verbose, log the parameter values.
         */
        if (verbose) {
            log("(Abstract) init done. Listing some parameter name/value pairs:");
            log("verbose = " + verbose); // this *is* verbose! ;)
            log("reflection = " + reflection);
            log("logGROOVY861 = " + logGROOVY861);
            log(INIT_PARAM_RESOURCE_NAME_REGEX + " = " + resourceNamePattern);//toString == pattern
            log("resource.name.replacement = " + resourceNameReplacement);
        }
    }

    /**
     * Override this method to set your variables to the Groovy binding.
     *

     * All variables bound the binding are passed to the template source text,
     * e.g. the HTML file, when the template is merged.
     *

     * The binding provided by TemplateServlet does already include some default
     * variables. As of this writing, they are (copied from
     * {@link groovy.servlet.ServletBinding}):
     *

     *
<tt>"request"</tt> : HttpServletRequest

     *
<tt>"response"</tt> : HttpServletResponse

     *
<tt>"context"</tt> : ServletContext

     *
<tt>"application"</tt> : ServletContext

     *
<tt>"session"</tt> : request.getSession(false)

     *

     *

     * And via implicit hard-coded keywords:
     *

     *
<tt>"out"</tt> : response.getWriter()

     *
<tt>"sout"</tt> : response.getOutputStream()

     *
<tt>"html"</tt> : new MarkupBuilder(response.getWriter())

     *

     *

     * The binding also provides convenient methods:
     *

     *
<tt>"forward(String path)"</tt> : request.getRequestDispatcher(path).forward(request, response);

     *
<tt>"include(String path)"</tt> : request.getRequestDispatcher(path).include(request, response);

     *
<tt>"redirect(String location)"</tt> : response.sendRedirect(location);

     *

     *

     *
Example binding all servlet context variables:
     *

     * class MyServlet extends TemplateServlet {
     *
     *   protected void setVariables(ServletBinding binding) {
     *     // Bind a simple variable
     *     binding.setVariable("answer", new Long(42));
     *
     *     // Bind all servlet context attributes...
     *     ServletContext context = (ServletContext) binding.getVariable("context");
     *     Enumeration enumeration = context.getAttributeNames();
     *     while (enumeration.hasMoreElements()) {
     *       String name = (String) enumeration.nextElement();
     *       binding.setVariable(name, context.getAttribute(name));
     *     }
     *   }
     * }
     *

     *
     * @param binding to be modified
     */
    protected void setVariables(ServletBinding binding) {
        // empty
    }
}


text:
"use strict"

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const checkPublish = require("../util/check-publish")
const getAllowModules = require("../util/get-allow-modules")
const getConvertPath = require("../util/get-convert-path")
const getRequireTargets = require("../util/get-require-targets")
const getTryExtensions = require("../util/get-try-extensions")

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * The definition of this rule.
 *
 * @param {RuleContext} context - The rule context to check.
 * @returns {object} The definition of this rule.
 */
function create(context) {
    const filePath = context.getFilename()
    if (filePath === "<input>") {
        return {}
    }

    return {
        "Program:exit"() {
            checkPublish(
                context,
                filePath,
                getRequireTargets(context)
            )
        },
    }
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

module.exports = {
    create,
    meta: {
        docs: {
            description: "disallow `require()` expressions for files that npm ignores",
            category: "Possible Errors",
            recommended: false,
        },
        fixable: false,
        schema: [
            {
                type: "object",
                properties: {
                    allowModules: getAllowModules.schema,
                    convertPath: getConvertPath.schema,
                    tryExtensions: getTryExtensions.schema,
                },
                additionalProperties: false,
            },
        ],
    },
}


text:
package org.archboy.clobaframe.blobstore.impl;

import java.io.InputStream;
import java.util.Date;
import java.util.Map;
import org.archboy.clobaframe.blobstore.BlobResourceInfo;
import org.archboy.clobaframe.blobstore.BlobResourceInfoFactory;
import org.archboy.clobaframe.io.ResourceInfo;
import org.springframework.util.Assert;

/**
 *
 * @author yang
 *
 */
public class DefaultBlobResourceInfoFactory implements BlobResourceInfoFactory {

	@Override
	public BlobResourceInfo make(String repositoryName, String key,
			InputStream inputStream, long contentLength,
			String mimeType, Date lastModified,
			Map<String, Object> metadata) {
		Assert.notNull(repositoryName);
		Assert.notNull(key);
		Assert.notNull(inputStream);
		Assert.isTrue(contentLength >0);
		Assert.hasText(mimeType);
		//Assert.notNull(lastModified);

		return new BlobResourceInfoFromInputStream(repositoryName, key,
				inputStream, contentLength, mimeType, lastModified,
				metadata);
	}

	@Override
	public BlobResourceInfo make(String repositoryName, String key,
			byte[] content, String mimeType, Date lastModified,
			Map<String, Object> metadata) {
		Assert.notNull(repositoryName);
		Assert.notNull(key);
		Assert.notNull(content);
		Assert.hasText(mimeType);
		//Assert.notNull(lastModified);

		return new BlobResourceInfoFromByteArray(repositoryName, key,
				content, mimeType, lastModified,
				metadata);
	}

	@Override
	public BlobResourceInfo make(String repositoryName, String key, ResourceInfo resourceInfo, Map<String, Object> metadata) {
		Assert.notNull(repositoryName);
		Assert.notNull(key);
		Assert.notNull(resourceInfo);

		return new BlobResourceInfoFromResourceInfo(repositoryName, key, resourceInfo, metadata);
	}

}


text:
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';

// Redux
import {createStore, applyMiddleware, compose} from 'redux';
import {Provider} from 'react-redux';
import ReduxPromise from 'redux-promise';

// Reducers
import rootRedcer from './reducers';

// Components
import Posts from './components/Posts';
import Submit from './components/Submit';
import PostPage from './components/PostPage';
import EditPost from './components/EditPost';
import EditComment from './components/EditComment';
import AddComment from './components/AddComment';

// Router
import {Route, Switch} from 'react-router';
import {BrowserRouter} from 'react-router-dom';

import 'font-awesome/css/font-awesome.min.css';

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

const store = createStore(
  rootRedcer,
  composeEnhancers(applyMiddleware(ReduxPromise)),
);

ReactDOM.render(

        READABLE

    <Provider store={store}>
      <BrowserRouter>
        <Switch>
          <Route path="/submit" component={Submit} />
          <Route
            path="/:category/:post_id/:comment_id/edit"
            component={EditComment}
          />
          <Route path="/:category/:post_id/edit" component={EditPost} />
          <Route path="/:category/:post_id/comment" component={AddComment} />
          <Route path="/:category/:post_id" component={PostPage} />
          <Route path="/:category" component={Posts} />
          <Route path="/" component={Posts} />
        </Switch>
      </BrowserRouter>
    </Provider>

,
  document.getElementById('root'),
);


text:
namespace engine
{
static IGameEngine& Instance();
} // namespace engine


text:
static const mips_entry_t mips_74k_pe []={
  {
    .name = "CYCLES", /* BOTH */
    .code = 0x0,
    .desc = "Cycles",
  },
  {
    .name = "INSTRUCTIONS", /* BOTH */
    .code = 0x1,
    .desc = "Instructions graduated",
  },
  {
    .name = "PREDICTED_JR_31",
    .code = 0x2,
    .desc = "jr $31 (return) instructions whose target is predicted",
  },
  {
    .name = "JR_31_MISPREDICTIONS",
    .code = 0x82,
    .desc = "jr $31 (return) predicted but guessed wrong",
  },
  {
    .name = "REDIRECT_STALLS",
    .code = 0x3,
    .desc = "Cycles where no instruction is fetched because it has no next address candidate. This includes stalls due to register indirect jumps such as jr, stalls following a wait or eret and stalls dues to exceptions from instruction fetch",
  },
  {
    .name = "JR_31_NO_PREDICTIONS",
    .code = 0x83,
    .desc = "jr $31 (return) instructions fetched and not predicted using RPS",
  },
  {
    .name = "ITLB_ACCESSES",
    .code = 0x4,
    .desc = "ITLB accesses",
  },
  {
    .name = "ITLB_MISSES",
    .code = 0x84,
    .desc = "ITLB misses, which result in a JTLB access",
  },
  {
    .name = "JTLB_INSN_MISSES",
    .code = 0x85,
    .desc = "JTLB instruction access misses (will lead to an exception)",
  },
  {
    .name = "ICACHE_ACCESSES",
    .code = 0x6,
    .desc = "Instruction cache accesses. 74K cores have a 128-bit connection to the I-cache and fetch 4 instructions every access. This counts every such access, including accesses for instructions which are eventually discarded. For example, following a branch which is incorrectly predicted, the 74K core will continue to fetch instructions, which will eventually get thrown away",
  },
  {
    .name = "ICACHE_MISSES",
    .code = 0x86,
    .desc = "I-cache misses. Includes misses resulting from fetch-ahead and speculation",
  },
  {
    .name = "ICACHE_MISS_STALLS",
    .code = 0x7,
    .desc = "Cycles where no instruction is fetched because we missed in the I-cache",
  },
  {
    .name = "UNCACHED_IFETCH_STALLS",
    .code = 0x8,
    .desc = "Cycles where no instruction is fetched because we're waiting for an I-fetch from uncached memory",
  },
  {
    .name = "PDTRACE_BACK_STALLS",
    .code = 0x88,
    .desc = "PDTrace back stalls",
  },
  {
    .name = "IFU_REPLAYS",
    .code = 0x9,
    .desc = "Number of times the instruction fetch pipeline is flushed and replayed because the IFU buffers are full and unable to accept any instructions",
  },
  {
    .name = "KILLED_FETCH_SLOTS",
    .code = 0x89,
    .desc = "Valid fetch slots killed due to taken branches/jumps or stalling instructions",
  },
  {
    .name = "DDQ0_FULL_DR_STALLS",
    .code = 0xd,
    .desc = "Cycles where no instructions are brought into the IDU because the ALU instruction candidate pool is full",
  },
  {
    .name = "DDQ1_FULL_DR_STALLS",
    .code = 0x8d,
    .desc = "Cycles where no instructions are brought into the IDU because the AGEN instruction candidate pool is full",
  },
  {
    .name = "ALCB_FULL_DR_STALLS",
    .code = 0xe,
    .desc = "Cycles where no instructions can be added to the issue pool, because we have run out of ALU completion buffers (CBs)",
  },
  {
    .name = "AGCB_FULL_DR_STALLS",
    .code = 0x8e,
    .desc = "Cycles where no instructions can be added to the issue pool, because we have run out of AGEN completion buffers (CBs)",
  },
  {
    .name = "CLDQ_FULL_DR_STALLS",
    .code = 0xf,
    .desc = "Cycles where no instructions can be added to the issue pool, because we've used all the FIFO entries in the CLDQ which keep track of data coming back from the FPU",
  },
  {
    .name = "IODQ_FULL_DR_STALLS",
    .code = 0x8f,
    .desc = "Cycles where no instructions can be added to the issue pool, because we've filled the in order FIFO used for coprocessor 1 instructions (IOIQ)",
  },
  {
    .name = "ALU_EMPTY_CYCLES",
    .code = 0x10,
    .desc = "Cycles with no ALU-pipe issue; no instructions available",
  },
  {
    .name = "AGEN_EMPTY_CYCLES",
    .code = 0x90,
    .desc = "Cycles with no AGEN-pipe issue; no instructions available",
  },
  {
    .name = "ALU_OPERANDS_NOT_READY_CYCLES",
    .code = 0x11,
    .desc = "Cycles with no ALU-pipe issue; we have instructions, but operands not ready",
  },
  {
    .name = "AGEN_OPERANDS_NOT_READY_CYCLES",
    .code = 0x91,
    .desc = "Cycles with no AGEN-pipe issue; we have instructions, but operands not ready",
  },
  {
    .name = "ALU_NO_ISSUE_CYCLES",
    .code = 0x12,
    .desc = "Cycles with no ALU-pipe issue; we have instructions, but some resource is unavailable. This includes, operands are not ready (same as event 17), div in progress inhibits MDU instructions, CorExtend resource limitation",
  },
  {
    .name = "AGEN_NO_ISSUE_CYCLES",
    .code = 0x92,
    .desc = "Cycles with no AGEN-pipe issue; we have instructions, but some resource is unavailable. This includes, operands are not ready (same as event 17), Non-issued stores blocking ready to issue loads, issued cacheops blocking ready to issue loads",
  },
  {
    .name = "ALU_BUBBLE_CYCLES",
    .code = 0x13,
    .desc = "ALU-pipe bubble issued. The resulting empty pipe stage guarantees that some resource will be unused for a cycle, sometime soon. Used, for example, to guarantee an opportunity to write mfc1 data into a CB",
  },
  {
    .name = "AGEN_BUBBLE_CYCLES",
    .code = 0x93,
    .desc = "AGEN-pipe bubble issued. The resulting empty pipe stage guarantees that some resource will be unused for a cycle, sometime soon. Used, for example, to allow access to the data cache for refill or eviction",

  },
  {
    .name = "SINGLE_ISSUE_CYCLES",
    .code = 0x14,
    .desc = "Cycles when one instruction is issued",
  },
  {
    .name = "DUAL_ISSUE_CYCLES",
    .code = 0x94,
    .desc = "Cycles when two instructions are issued (one ALU, one AGEN)",
  },
  {
    .name = "OOO_ALU_ISSUE_CYCLES",
    .code = 0x15,
    .desc = "Cycles when instructions are issued out of order into the ALU pipe. i.e. instruction issued is not the oldest in the pool",
  },
  {
    .name = "OOO_AGEN_ISSUE_CYCLES",
    .code = 0x95,
    .desc = "Cycles when instructions are issued out of order into the AGEN pipe. i.e. instruction issued is not the oldest in the pool",
  },
  {
    .name = "JALR_JALR_HB_INSNS",
    .code = 0x16,
    .desc = "Graduated JAR/JALR.HB",
  },
  {
    .name = "DCACHE_LINE_REFILL_REQUESTS",
    .code = 0x96,
    .desc = "D-Cache line refill (not LD/ST misses)",
  },
  {
    .name = "DCACHE_LOAD_ACCESSES",
    .code = 0x17,
    .desc = "Cacheable loads - Counts all accesses to the D-cache caused by load instructions. This count includes instructions that do not graduate",
  },
  {
    .name = "DCACHE_ACCESSES",
    .code = 0x97,
    .desc = "All D-cache accesses (loads, stores, prefetch, cacheop etc). This count includes instructions that do not graduate",
  },
  {
    .name = "DCACHE_WRITEBACKS",
    .code = 0x18,
    .desc = "D-Cache writebacks",
  },
  {
    .name = "DCACHE_MISSES",
    .code = 0x98,
    .desc = "D-cache misses. This count is per instruction at grad- uation and includes load, store, prefetch, synci and address based cacheops",
  },
  {
    .name = "JTLB_DATA_ACCESSES",
    .code = 0x19,
    .desc = "JTLB d-side (data side as opposed to instruction side) accesses",
  },
  {
    .name = "JTLB_DATA_MISSES",
    .code = 0x99,
    .desc = "JTLB translation fails on d-side (data side as opposed to instruction side) accesses. This count includes instructions that do not graduate",
  },
  {
    .name = "LOAD_STORE_REPLAYS",
    .code = 0x1a,
    .desc = "Load/store instruction redirects, which happen when the load/store follows too closely on a possibly matching cacheop",
  },
  {
    .name = "DCACHE_VTAG_MISMATCH",
    .code = 0x9a,
    .desc = "The 74K core's D-cache has an auxiliary virtual tag, used to pick the right line early. When (occasionally) the physical tag match and virtual tag match do not line up, it is treated as a cache miss - in processing the miss the virtual tag is correcyed for future accesses. This event counts those bogus misses",
  },
  {
    .name = "L2_CACHE_WRITEBACKS",
    .code = 0x1c,
    .desc = "L2 cache writebacks",
  },
  {
    .name = "L2_CACHE_ACCESSES",
    .code = 0x9c,
    .desc = "L2 cache accesses",
  },
  {
    .name = "L2_CACHE_MISSES",
    .code = 0x1d,
    .desc = "L2 cache misses",
  },
  {
    .name = "L2_CACHE_MISS_CYCLES",
    .code = 0x9d,
    .desc = "L2 cache miss cycles",
  },
  {
    .name = "FSB_FULL_STALLS",
    .code = 0x1e,
    .desc = "Cycles Fill Store Buffer(FSB) are full and cause a pipe stall",
  },
  {
    .name = "FSB_OVER_50_FULL",
    .code = 0x9e,
    .desc = "Cycles Fill Store Buffer(FSB) > 1/2 full",
  },
  {
    .name = "LDQ_FULL_STALLS",
    .code = 0x1f,
    .desc = "Cycles Load Data Queue (LDQ) are full and cause a pipe stall",
  },
  {
    .name = "LDQ_OVER_50_FULL",
    .code = 0x9f,
    .desc = "Cycles Load Data Queue(LDQ) > 1/2 full",
  },
  {
    .name = "WBB_FULL_STALLS",
    .code = 0x20,
    .desc = "Cycles Writeback Buffer(WBB) are full and cause a pipe stall",
  },
  {
    .name = "WBB_OVER_50_FULL",
    .code = 0xa0,
    .desc = "Cycles Writeback Buffer(WBB) > 1/2 full",
  },
  {
    .name = "LOAD_MISS_CONSUMER_REPLAYS",
    .code = 0x23,
    .desc = "Replays following optimistic issue of instruction dependent on load which missed. Counted only when the dependent instruction graduates",
  },
  {
    .name = "FPU_LOAD_INSNS",
    .code = 0xa3,
    .desc = "Floating Point Load instructions graduated",
  },
  {
    .name = "JR_NON_31_INSNS",
    .code = 0x24,
    .desc = "jr (not $31) instructions graduated",
  },
  {
    .name = "MISPREDICTED_JR_31_INSNS",
    .code = 0xa4,
    .desc = "jr $31 mispredicted at graduation",
  },
  {
    .name = "INT_BRANCH_INSNS",
    .code = 0x25,
    .desc = "Integer branch instructions graduated",
  },
  {
    .name = "FPU_BRANCH_INSNS",
    .code = 0xa5,
    .desc = "Floating point branch instructions graduated",
  },
  {
    .name = "BRANCH_LIKELY_INSNS",
    .code = 0x26,
    .desc = "Branch-likely instructions graduated",
  },
  {
    .name = "MISPREDICTED_BRANCH_LIKELY_INSNS",
    .code = 0xa6,
    .desc = "Mispredicted branch-likely instructions graduated",
  },
  {
    .name = "COND_BRANCH_INSNS",
    .code = 0x27,
    .desc = "Conditional branches graduated",
  },
  {
    .name = "MISPREDICTED_BRANCH_INSNS",
    .code = 0xa7,
    .desc = "Mispredicted conditional branches graduated",
  },
  {
    .name = "INTEGER_INSNS",
    .code = 0x28,
    .desc = "Integer instructions graduated (includes nop, ssnop, ehb as well as all arithmetic, locial, shift and extract type operations)",
  },
  {
    .name = "FPU_INSNS",
    .code = 0xa8,
    .desc = "Floating point instructions graduated (but not counting floating point load/store)",
  },
  {
    .name = "LOAD_INSNS",
    .code = 0x29,
    .desc = "Loads graduated (includes floating point)",
  },
  {
    .name = "STORE_INSNS",
    .code = 0xa9,
    .desc = "Stores graduated (includes floating point). Of sc instructions, only successful ones are counted",
  },
  {
    .name = "J_JAL_INSNS",
    .code = 0x2a,
    .desc = "j/jal graduated",
  },
  {
    .name = "MIPS16_INSNS",
    .code = 0xaa,
    .desc = "MIPS16e instructions graduated",
  },
  {
    .name = "NOP_INSNS",
    .code = 0x2b,
    .desc = "no-ops graduated - included (sll, nop, ssnop, ehb)",
  },
  {
    .name = "NT_MUL_DIV_INSNS",
    .code = 0xab,
    .desc = "integer multiply/divides graduated",
  },
  {
    .name = "DSP_INSNS",
    .code = 0x2c,
    .desc = "DSP instructions graduated",
  },
  {
    .name = "ALU_DSP_SATURATION_INSNS",
    .code = 0xac,
    .desc = "ALU-DSP instructions graduated, result was saturated",
  },
  {
    .name = "DSP_BRANCH_INSNS",
    .code = 0x2d,
    .desc = "DSP branch instructions graduated",
  },
  {
    .name = "MDU_DSP_SATURATION_INSNS",
    .code = 0xad,
    .desc = "MDU-DSP instructions graduated, result was saturated",
  },
  {
    .name = "UNCACHED_LOAD_INSNS",
    .code = 0x2e,
    .desc = "Uncached loads graduated",
  },
  {
    .name = "UNCACHED_STORE_INSNS",
    .code = 0xae,
    .desc = "Uncached stores graduated",
  },
  {
    .name = "EJTAG_INSN_TRIGGERS",
    .code = 0x31,
    .desc = "EJTAG instruction triggers",
  },
  {
    .name = "EJTAG_DATA_TRIGGERS",
    .code = 0xb1,
    .desc = "EJTAG data triggers",
  },
  {
    .name = "CP1_BRANCH_MISPREDICTIONS",
    .code = 0x32,
    .desc = "CP1 branches mispredicted",
  },
  {
    .name = "SC_INSNS",
    .code = 0x33,
    .desc = "sc instructions graduated",
  },
  {
    .name = "FAILED_SC_INSNS",
    .code = 0xb3,
    .desc = "sc instructions failed",
  },
  {
    .name = "PREFETCH_INSNS",
    .code = 0x34,
    .desc = "prefetch instructions graduated at the top of LSGB",
  },
  {
    .name = "CACHE_HIT_PREFETCH_INSNS",
    .code = 0xb4,
    .desc = "prefetch instructions which did nothing, because they hit in the cache",
  },
  {
    .name = "NO_INSN_CYCLES",
    .code = 0x35,
    .desc = "Cycles where no instructions graduated",
  },
  {
    .name = "LOAD_MISS_INSNS",
    .code = 0xb5,
    .desc = "Load misses graduated. Includes floating point loads",
  },
  {
    .name = "ONE_INSN_CYCLES",
    .code = 0x36,
    .desc = "Cycles where one instruction graduated",
  },
  {
    .name = "TWO_INSNS_CYCLES",
    .code = 0xb6,
    .desc = "Cycles where two instructions graduated",
  },
  {
    .name = "GFIFO_BLOCKED_CYCLES",
    .code = 0x37,
    .desc = "GFifo blocked cycles",
  },
  {
    .name = "FPU_STORE_INSNS",
    .code = 0xb7,
    .desc = "Floating point stores graduated",
  },
  {
    .name = "GFIFO_BLOCKED_TLB_CACHE",
    .code = 0x38,
    .desc = "GFifo blocked due to TLB or Cacheop",
  },
  {
    .name = "NO_INSTRUCTIONS_FROM_REPLAY_CYCLES",
    .code = 0xb8,
    .desc = "Number of cycles no instructions graduated from the time the pipe was flushed because of a replay until the first new instruction graduates. This is an indicator of the graduation bandwidth loss due to replay. Often times this replay is a result of event 25 and therefor an indicator of bandwidth lost due to cache misses",
  },
  {
    .name = "MISPREDICTION_BRANCH_NODELAY_CYCLES",
    .code = 0x39, /* even counters event 57 (raw 57) */
    .desc = "Slot 0 misprediction branch instruction graduation cycles without the delay slot"
  },
  {
    .name = "MISPREDICTION_BRANCH_DELAY_WAIT_CYCLES",
    .code = 0xb9, /* even counters event 57 (raw 57) */
    .desc = "Cycles waiting for delay slot to graduate on a mispredicted branch",
  },
  {
    .name = "EXCEPTIONS_TAKEN",
    .code = 0x3a,
    .desc = "Exceptions taken",
  },
  {
    .name = "GRADUATION_REPLAYS",
    .code = 0xba,
    .desc = "Replays initiated from graduation",
  },
  {
    .name = "COREEXTEND_EVENTS",
    .code = 0x3b,
    .desc = "Implementation specific CorExtend event. The integrator of this core may connect the core pin UDI_perfcnt_event to an event to be counted. This is intended for use with the CorExtend interface",
  },
  {
    .name = "DSPRAM_EVENTS",
    .code = 0xbe,
    .desc = "Implementation-specific DSPRAM event. The integrator of this core may connect the core pin SP_prf_c13_e62_xx to the event to be counted",
  },
  {
    .name = "L2_CACHE_SINGLE_BIT_ERRORS",
    .code = 0x3f,
    .desc = "L2 single-bit errors which were detected",
  },
  {
    .name = "SYSTEM_EVENT_0",
    .code = 0x40,
    .desc = "SI_Event[0] - Implementation-specific system event. The integrator of this core may connect the core pin SI_PCEvent[0] to an event to be counted",
  },
  {
    .name = "SYSTEM_EVENT_1",
    .code = 0xc0,
    .desc = "SI_Event[1] - Implementation-specific system event. The integrator of this core may connect the core pin SI_PCEvent[1] to an event to be counted",
  },
  {
    .name = "SYSTEM_EVENT_2",
    .code = 0x41,
    .desc = "SI_Event[2] - Implementation-specific system event. The integrator of this core may connect the core pin SI_PCEvent[2] to an event to be counted",
  },
  {
    .name = "SYSTEM_EVENT_3",
    .code = 0xc1,
    .desc = "SI_Event[3] - Implementation-specific system event. The integrator of this core may connect the core pin SI_PCEvent[3] to an event to be counted",
  },
  {
    .name = "SYSTEM_EVENT_4",
    .code = 0x42,
    .desc = "SI_Event[4] - Implementation-specific system event. The integrator of this core may connect the core pin SI_PCEvent[4] to an event to be counted",
  },
  {
    .name = "SYSTEM_EVENT_5",
    .code = 0xc2,
    .desc = "SI_Event[5] - Implementation-specific system event. The integrator of this core may connect the core pin SI_PCEvent[5] to an event to be counted",
  },
  {
    .name = "SYSTEM_EVENT_6",
    .code = 0x43,
    .desc = "SI_Event[6] - Implementation-specific system event. The integrator of this core may connect the core pin SI_PCEvent[6] to an event to be counted",
  },
  {
    .name = "SYSTEM_EVENT_7",
    .code = 0xc3,
    .desc = "SI_Event[7] - Implementation-specific system event. The integrator of this core may connect the core pin SI_PCEvent[7] to an event to be counted",
  },
  {
    .name = "OCP_ALL_REQUESTS",
    .code = 0x44,
    .desc = "All OCP requests accepted",
  },
  {
    .name = "OCP_ALL_CACHEABLE_REQUESTS",
    .code = 0xc4,
    .desc = "All OCP cacheable requests accepted",
  },
  {
    .name = "OCP_READ_REQUESTS",
    .code = 0x45,
    .desc = "OCP read requests accepted",
  },
  {
    .name = "OCP_READ_CACHEABLE_REQUESTS",
    .code = 0xc5,
    .desc = "OCP cacheable read requests accepted",
  },
  {
    .name = "OCP_WRITE_REQUESTS",
    .code = 0x46,
    .desc = "OCP write requests accepted",
  },
  {
    .name = "OCP_WRITE_CACHEABLE REQUESTS",
    .code = 0xc6,
    .desc = "OCP cacheable write requests accepted",
  },
  {
    .name = "OCP_WRITE_DATA_SENT",
    .code = 0xc7,
    .desc = "OCP write data sent",
  },
  {
    .name = "OCP_READ_DATA_RECEIVED",
    .code = 0xc8,
    .desc = "OCP read data received",
  },
  {
    .name = "FSB_LESS_25_FULL",
    .code = 0x4a,
    .desc = "Cycles fill store buffer (FSB) < 1/4 full",
  },
  {
    .name = "FSB_25_50_FULL",
    .code = 0xca,
    .desc = "Cycles fill store buffer (FSB) 1/4 to 1/2 full",
  },
  {
    .name = "LDQ_LESS_25_FULL",
    .code = 0x4b,
    .desc = "Cycles load data queue (LDQ) < 1/4 full",
  },
  {
    .name = "LDQ_25_50_FULL",
    .code = 0xcb,
    .desc = "Cycles load data queue (LDQ) 1/4 to 1/2 full",
  },
  {
    .name = "WBB_LESS_25_FULL",
    .code = 0x4c,
    .desc = "Cycles writeback buffer (WBB) < 1/4 full",
  },
  {
    .name = "WBB_25_50_FULL",
    .code = 0xcc,
    .desc = "Cycles writeback buffer (WBB) 1/4 to 1/2 full",
  },
};


text:
package me.simple.cms.service;

import java.util.List;

import me.simple.common.entity.Channel;
import me.simple.common.entity.ChannelNode;
import me.simple.common.entity.Pagination;

public interface ChannelService {

    Channel saveChannel(Channel channel);

    int removeChannel(String channelName);

    /**
     * just update channel viewname
     *
     * @param channel
     * @return
     */
    int updateChannel(Channel channel);

    boolean checkChannelExists(String channelName);

    Channel getChannel(String channelName);

    /**
     * query by viewname or channelName
     *
     * @param channel
     * @param pagination
     * @return
     */
    List<Channel> queryChannel(Channel channel, Pagination<Channel> pagination);

    List<Channel> queryChannelChildren(String parentName);

    List<ChannelNode> queryUserChannelChain(String owner, String channelName);
    List<ChannelNode> queryUserChannelTree(String owner, String channelName);

}


text:
//
//  GTLAnalyticsFilterExpression.h
//

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   Google Analytics API (analytics/v3)
// Description:
//   View and manage your Google Analytics data
// Documentation:
//   https://developers.google.com/analytics/
// Classes:
//   GTLAnalyticsFilterExpression (0 custom class methods, 5 custom properties)

#if GTL_BUILT_AS_FRAMEWORK
  #import "GTL/GTLObject.h"
#else
  #import "GTLObject.h"
#endif

// ----------------------------------------------------------------------------
//
//   GTLAnalyticsFilterExpression
//

// JSON template for an Analytics filter expression.

@interface GTLAnalyticsFilterExpression : GTLObject

// Determines if the filter is case sensitive.
@property (retain) NSNumber *caseSensitive;  // boolValue

// Filter expression value
@property (copy) NSString *expressionValue;

// Field to filter. Possible values:
// - Reserved
// - UNUSED,
// - Content and Traffic
// - PAGE_REQUEST_URI,
// - PAGE_HOSTNAME,
// - PAGE_TITLE,
// - REFERRAL,
// - COST_DATA_URI (Campaign target URL),
// - HIT_TYPE,
// - INTERNAL_SEARCH_TERM,
// - INTERNAL_SEARCH_TYPE,
// - SOURCE_PROPERTY_TRACKING_ID,
// - Campaign or AdGroup
// - CAMPAIGN_SOURCE,
// - CAMPAIGN_MEDIUM,
// - CAMPAIGN_NAME,
// - CAMPAIGN_AD_GROUP,
// - CAMPAIGN_TERM,
// - CAMPAIGN_CONTENT,
// - CAMPAIGN_CODE,
// - CAMPAIGN_REFERRAL_PATH,
// - E-Commerce
// - TRANSACTION_COUNTRY,
// - TRANSACTION_REGION,
// - TRANSACTION_CITY,
// - TRANSACTION_AFFILIATION (Store or order location),
// - ITEM_NAME,
// - ITEM_CODE,
// - ITEM_VARIATION,
// - TRANSACTION_ID,
// - TRANSACTION_CURRENCY_CODE,
// - PRODUCT_ACTION_TYPE,
// - Audience/Users
// - BROWSER,
// - BROWSER_VERSION,
// - BROWSER_SIZE,
// - PLATFORM,
// - PLATFORM_VERSION,
// - LANGUAGE,
// - SCREEN_RESOLUTION,
// - SCREEN_COLORS,
// - JAVA_ENABLED,
// - FLASH_VERSION,
// - GEO_SPEED (Connection speed),
// - VISITOR_TYPE,
// - GEO_ORGANIZATION (ISP organization),
// - GEO_DOMAIN,
// - GEO_IP_ADDRESS,
// - GEO_IP_VERSION,
// - Location
// - GEO_COUNTRY,
// - GEO_REGION,
// - GEO_CITY,
// - Event
// - EVENT_CATEGORY,
// - EVENT_ACTION,
// - EVENT_LABEL,
// - Other
// - CUSTOM_FIELD_1,
// - CUSTOM_FIELD_2,
// - USER_DEFINED_VALUE,
// - Application
// - APP_ID,
// - APP_INSTALLER_ID,
// - APP_NAME,
// - APP_VERSION,
// - SCREEN,
// - IS_APP,
// - IS_FATAL_EXCEPTION,
// - EXCEPTION_DESCRIPTION,
// - Mobile device
// - IS_MOBILE,
// - IS_TABLET,
// - MOBILE_HAS_QWERTY_KEYBOARD,
// - MOBILE_HAS_NFC_SUPPORT,
// - MOBILE_HAS_CELLULAR_RADIO,
// - MOBILE_HAS_WIFI_SUPPORT,
// - MOBILE_BRAND_NAME,
// - MOBILE_MODEL_NAME,
// - MOBILE_MARKETING_NAME,
// - MOBILE_POINTING_METHOD,
// - Social
// - SOCIAL_NETWORK,
// - SOCIAL_ACTION,
// - SOCIAL_ACTION_TARGET,
@property (copy) NSString *field;

// Kind value for filter expression
@property (copy) NSString *kind;

// Match type for this filter. Possible values are BEGINS_WITH, EQUAL,
// ENDS_WITH, CONTAINS, MATCHES. Include and Exclude filters can use any match
// type. Match type is not applicable to Upper case and Lower case filters.
// Search and Replace expressions in the Search and Replace filter and all
// filter expressions in the Advanced filter default to MATCHES. User should not
// set match type for those filters.
@property (copy) NSString *matchType;

@end


text:
. ./base.sh

rlJournalStart

# just the disk name as 'sda', without '/dev/'
DISKNAME=$( echo $LMI_STORAGE_DISK | sed 's!.*/!!' )
SIZE1=10M # primary one
SIZE2=20M # first logical
# third is over rest of the extended partition

rlPhaseStartTest "Create the partition table"
	rlLogInfo "Creating partition table"
	rlRun "$LMI storage partition-table create --msdos $LMI_STORAGE_DISK"

    rlLogInfo "Check the partition table exists"
    rlRun -s "parted $LMI_STORAGE_DISK print"
    rlAssertGrep "Partition Table: msdos" $rlRun_LOG
    rm $rlRun_LOG

    rlLogInfo "Check lmi storage partition-table list shows it"
    rlRun -s "$LMI -NHL csv storage partition-table list $LMI_STORAGE_DISK"
    rlAssertGrep "\"$LMI_STORAGE_DISK\"" $rlRun_LOG
    rm $rlRun_LOG

    rlLogInfo "Check lmi storage partition-table show shows it"
    rlRun -s "$LMI -NHL csv storage partition-table show $LMI_STORAGE_DISK"
    rlAssertGrep "\"Partition Table Type\",\"MS-DOS\"" $rlRun_LOG
    rlAssertGrep "\"Partition Table Size (in blocks)\",1" $rlRun_LOG
    rm $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Create partitions"
    rlLogInfo "Creating partitions"
    rlRun "$LMI storage partition create $LMI_STORAGE_DISK $SIZE1"
    rlRun "$LMI storage partition create --extended $LMI_STORAGE_DISK"
    rlRun "$LMI storage partition create --logical $LMI_STORAGE_DISK $SIZE2"
    rlRun "$LMI storage partition create --logical $LMI_STORAGE_DISK"

    rlLogInfo "Check lmi storage partition list shows them"
    rlRun "$LMI -NHL csv storage partition list"
    rlRun "$LMI -NHL csv storage partition list ${LMI_STORAGE_DISK}2"
    rlRun -s "$LMI -NHL csv storage partition list $LMI_STORAGE_DISK"
    rlAssertGrep "\"${LMI_STORAGE_DISK}1\",\"primary\",\"$SIZE1\"" $rlRun_LOG
    rlAssertGrep "\"${LMI_STORAGE_DISK}2\",\"extended\"," $rlRun_LOG
    rlAssertGrep "\"${LMI_STORAGE_DISK}5\",\"logical\",\"$SIZE2\"" $rlRun_LOG
    rlAssertGrep "\"${LMI_STORAGE_DISK}6\",\"logical\"," $rlRun_LOG
    rm $rlRun_LOG

    rlLogInfo "Check lmi partition show shows them"
    rlRun -s "$LMI -NHL csv storage partition show ${LMI_STORAGE_DISK}1"
    rlAssertGrep "\"Name\",\"${LMI_STORAGE_DISK}1\"" $rlRun_LOG
    rlAssertGrep "\"ElementName\",\"${DISKNAME}1\"" $rlRun_LOG
    rlAssertGrep "\"Total Size\",\"$SIZE1\"" $rlRun_LOG
    rlAssertGrep "\"Disk\",\"${LMI_STORAGE_DISK}\"" $rlRun_LOG
    rlAssertGrep "\"Partition Type\",\"primary\"" $rlRun_LOG
    rm $rlRun_LOG
    rlRun -s "$LMI -NHL csv storage partition show ${LMI_STORAGE_DISK}2"
    rlAssertGrep "\"Name\",\"${LMI_STORAGE_DISK}2\"" $rlRun_LOG
    rlAssertGrep "\"ElementName\",\"${DISKNAME}2\"" $rlRun_LOG
    rlAssertGrep "\"Disk\",\"${LMI_STORAGE_DISK}\"" $rlRun_LOG
    rlAssertGrep "\"Partition Type\",\"extended\"" $rlRun_LOG
    rm $rlRun_LOG
    rlRun -s "$LMI -NHL csv storage partition show ${LMI_STORAGE_DISK}5"
    rlAssertGrep "\"Name\",\"${LMI_STORAGE_DISK}5\"" $rlRun_LOG
    rlAssertGrep "\"ElementName\",\"${DISKNAME}5\"" $rlRun_LOG
    rlAssertGrep "\"Total Size\",\"$SIZE2\"" $rlRun_LOG
    rlAssertGrep "\"Disk\",\"${LMI_STORAGE_DISK}\"" $rlRun_LOG
    rlAssertGrep "\"Partition Type\",\"logical\"" $rlRun_LOG
    rm $rlRun_LOG
    rlRun -s "$LMI -NHL csv storage partition show ${LMI_STORAGE_DISK}6"
    rlAssertGrep "\"Name\",\"${LMI_STORAGE_DISK}6\"" $rlRun_LOG
    rlAssertGrep "\"ElementName\",\"${DISKNAME}6\"" $rlRun_LOG
    rlAssertGrep "\"Disk\",\"${LMI_STORAGE_DISK}\"" $rlRun_LOG
    rlAssertGrep "\"Partition Type\",\"logical\"" $rlRun_LOG
    rm $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Delete partitions"
    rlLogInfo "Deleting partitions"
    rlRun "$LMI storage partition delete ${LMI_STORAGE_DISK}1 ${LMI_STORAGE_DISK}5 ${LMI_STORAGE_DISK}5 ${LMI_STORAGE_DISK}2"

    rlLogInfo "Check lmi storage partition list does not show them"
    rlRun -s "$LMI -NHL csv storage partition list $LMI_STORAGE_DISK"
    rlAssertNotGrep "\"${LMI_STORAGE_DISK}1\"" $rlRun_LOG
    rlAssertNotGrep "\"${LMI_STORAGE_DISK}2\"" $rlRun_LOG
    rlAssertNotGrep "\"${LMI_STORAGE_DISK}5\"" $rlRun_LOG
    rm $rlRun_LOG
rlPhaseEnd

rlJournalPrintText
rlJournalEnd


text:
'use strict'
const TestRunner = require('test-runner')
const a = require('core-assert')
const option = require('../lib/option')

const runner = new TestRunner()

runner.test('option', function () {
  a.strictEqual(option.isOption('--yeah'), true)
  a.strictEqual(option.isOption('в--yeah'), false)
})


text:
package org.kaazing.gateway.transport.http.security.auth.token;

public class DefaultAuthenticationTokenExtractor extends AbstractAuthenticationTokenExtractor {

    public static final DefaultAuthenticationTokenExtractor INSTANCE = new DefaultAuthenticationTokenExtractor();

}


text:
<ion-header>
    <ion-toolbar>
        <ion-title>

                {{'core.user.useraccount' | translate}}

        </ion-title>
        <ion-buttons slot="end">
            <ion-button fill="clear" (click)="close($event)" [attr.aria-label]="'core.close' | translate">
                <ion-icon name="fas-times" slot="icon-only" aria-hidden="true"></ion-icon>
            </ion-button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>
<ion-content>
    <core-loading [hideUntil]="siteLogoLoaded && handlersLoaded">
        <ion-list>
            <ion-item button class="core-usermenu-siteinfo ion-text-wrap" *ngIf="siteInfo" lines="full" detail="false" [href]="siteUrl"
                core-link auto-login="yes">
                <ion-label>

                        <core-format-text [text]="siteName" contextLevel="system" [contextInstanceId]="0" [wsNotFiltered]="true">
                        </core-format-text>

                    {{ siteUrl }}
                </ion-label>
            </ion-item>
            <ion-item button class="core-usermenu-handler ion-text-wrap" *ngIf="siteInfo" lines="full" (click)="openUserProfile($event)"
                detail="true" [attr.aria-label]="'core.user.profile' | translate">
                <core-user-avatar [user]="siteInfo" [userId]="siteInfo.userid" [linkProfile]="false" slot="start"></core-user-avatar>
                <ion-label>

{{ siteInfo.fullname }}

                </ion-label>
            </ion-item>

            <ion-item class="ion-text-center" *ngIf="(!handlers || !handlers.length) && !handlersLoaded">
                <ion-label>
                    <ion-spinner [attr.aria-label]="'core.loading' | translate"></ion-spinner>
                </ion-label>
            </ion-item>

            <ion-item button *ngFor="let handler of handlers" class="ion-text-wrap" (click)="handlerClicked($event, handler)"
                [ngClass]="['core-user-menu-handler', handler.class || '']" [hidden]="handler.hidden"
                [attr.aria-label]="handler.title | translate" detail="true">
                <ion-icon *ngIf="handler.icon" [name]="handler.icon" slot="start" aria-hidden="true"></ion-icon>
                <ion-label>

{{ handler.title | translate }}

                </ion-label>
                <ion-badge slot="end" *ngIf="handler.showBadge" [hidden]="handler.loading || !handler.badge" aria-hidden="true">
                    {{handler.badge}}
                </ion-badge>

                    {{ handler.badgeA11yText | translate: {$a : handler.badge } }}

                <ion-spinner slot="end" *ngIf="handler.showBadge && handler.loading" [attr.aria-label]="'core.loading' | translate">
                </ion-spinner>
            </ion-item>

            <ion-item button (click)="openPreferences($event)" [attr.aria-label]="'core.settings.preferences' | translate" detail="true"
                class="core-user-menu-preferences">
                <ion-icon name="fas-wrench" slot="start" aria-hidden="true"></ion-icon>
                <ion-label>

{{ 'core.settings.preferences' | translate }}

                </ion-label>
            </ion-item>
        </ion-list>
    </core-loading>
</ion-content>
<ion-footer>
    <ion-item *ngIf="displaySwitchAccount" button lines="full" (click)="switchAccounts($event)" detail="true" class="ion-text-wrap">
        <ion-icon name="fas-exchange-alt" slot="start" aria-hidden="true"></ion-icon>
        <ion-label>

{{ 'core.mainmenu.switchaccount' | translate }}

        </ion-label>
    </ion-item>

        <ion-button (click)="logout($event)" expand="block" color="danger" [attr.aria-label]="'core.mainmenu.logout' | translate"
            class="ion-text-wrap">
            <ng-container *ngIf="!removeAccountOnLogout">
                <ion-icon name="fas-sign-out-alt" slot="start" aria-hidden="true"></ion-icon>
                {{ 'core.mainmenu.logout' | translate }}
            </ng-container>
            <ng-container *ngIf="removeAccountOnLogout">
                <ion-icon name="fas-trash" slot="start" aria-hidden="true"></ion-icon>
                {{ 'core.login.removeaccount' | translate }}
            </ng-container>
        </ion-button>

</ion-footer>


text:
module Azure::DataBoxEdge::Mgmt::V2019_08_01
  module Models
    #
    # Defines values for NetworkAdapterDHCPStatus
    #
    module NetworkAdapterDHCPStatus
      Disabled = "Disabled"
      Enabled = "Enabled"
    end
  end
end


text:
from qrl.core import config
from qrl.core.misc import ntp

class OutgoingMessage:
    def __init__(self, priority, message):
        self.priority = priority
        self.timestamp = int(ntp.getTime())
        self.message = message

    def is_expired(self):
        return self.timestamp - ntp.getTime() > config.user.outgoing_message_expiry

    def __lt__(self, outgoing_message):
        return self.priority < outgoing_message.priority


text:
module.exports = {
	entry: {
		app: { import: "./app.js", dependOn: ["other-vendors"] },
		page1: { import: "./page1.js", dependOn: ["app", "react-vendors"] },
		"react-vendors": ["react", "react-dom", "prop-types"],
		"other-vendors": "./other-vendors"
	},
	optimization: {
		runtimeChunk: "single",
		chunkIds: "named" // To keep filename consistent between different modes (for example building only)
	},
	stats: {
		chunks: true,
		chunkRelations: true
	}
};


text:
#include <aws/core/client/AWSError.h>
#include <aws/cognito-identity/CognitoIdentityErrorMarshaller.h>
#include <aws/cognito-identity/CognitoIdentityErrors.h>

using namespace Aws::Client;
using namespace Aws::CognitoIdentity;

AWSError<CoreErrors> CognitoIdentityErrorMarshaller::FindErrorByName(const char* errorName) const
{
  AWSError<CoreErrors> error = CognitoIdentityErrorMapper::GetErrorForName(errorName);
  if(error.GetErrorType() != CoreErrors::UNKNOWN)
  {
    return error;
  }

  return AWSErrorMarshaller::FindErrorByName(errorName);
}