text:
package com.craftershouse.activerecord;

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

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;

import com.craftershouse.context.ApplicationContextProvider;
import com.craftershouse.jpa.repository.JpaRepositorySpecificationExecutor;

@MappedSuperclass
public class RootAggregate<R extends JpaRepositorySpecificationExecutor<T, Long>, T>
		implements JpaRepositorySpecificationExecutor<T, Long> {

	private Class<R> repositoryClazz;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@Transient
	protected R repository;

	public RootAggregate() {
		repositoryClazz = getParametrizedType();
		if (ApplicationContextProvider.getContext() != null)
			repository = ApplicationContextProvider.getContext().getBean(repositoryClazz);
	}

	public Class<R> getParametrizedType() {

		ParameterizedType type = (ParameterizedType) getClass()
				.getGenericSuperclass();

		Type t = type.getActualTypeArguments()[0];

		return (Class<R>) t;

	}

	public R getAll() {
		return repository;
	}

	@Override
	public Page<T> findAll(Pageable pageable) {
		return this.repository.findAll(pageable);
	}

	public <S extends T> S save() {
		return this.repository.save((S) this);
	}

	@Override
	public <S extends T> S save(S entity) {
		return this.repository.save(entity);
	}

	@Override
	public T findOne(Long id) {
		return this.repository.findOne(id);
	}

	@Override
	public boolean exists(Long id) {
		return this.repository.exists(id);
	}

	@Override
	public long count() {
		return this.repository.count();
	}

	@Override
	public void delete(Long id) {
		this.repository.delete(id);
	}

	@Override
	public void delete(T entity) {
		this.repository.delete(entity);
	}

	@Override
	public void delete(Iterable<? extends T> entities) {
		this.repository.delete(entities);
	}

	@Override
	public void deleteAll() {
		this.repository.deleteAll();
	}

	@Override
	public List<T> findAll() {
		return this.repository.findAll();
	}

	@Override
	public List<T> findAll(Sort sort) {
		return this.repository.findAll(sort);
	}

	@Override
	public List<T> findAll(Iterable<Long> ids) {
		return this.repository.findAll(ids);
	}

	@Override
	public <S extends T> List<S> save(Iterable<S> entities) {
		return this.repository.save(entities);
	}

	@Override
	public void flush() {
		this.repository.flush();
	}

	@Override
	public <S extends T> S saveAndFlush(S entity) {
		return this.repository.saveAndFlush(entity);
	}

	@Override
	public void deleteInBatch(Iterable<T> entities) {
		this.repository.deleteInBatch(entities);
	}

	@Override
	public void deleteAllInBatch() {
		this.repository.deleteAllInBatch();
	}

	@Override
	public T getOne(Long id) {
		return this.repository.getOne(id);
	}

	@Override
	public T findOne(Specification<T> spec) {
		return this.repository.findOne(spec);
	}

	@Override
	public List<T> findAll(Specification<T> spec) {
		return this.repository.findAll(spec);
	}

	@Override
	public Page<T> findAll(Specification<T> spec, Pageable pageable) {
		return this.repository.findAll(spec, pageable);
	}

	@Override
	public List<T> findAll(Specification<T> spec, Sort sort) {
		return this.repository.findAll(spec, sort);
	}

	@Override
	public long count(Specification<T> spec) {
		return this.repository.count(spec);
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Revision: 2972 $ -->
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
<sect1 id="plugins.compiler.functions"><title>Funções Compiladoras</title>
    <para>
     Funções compiladoras só são chamadas durante a compilação do template.
     Elas são úteis para injeção de código PHP ou conteúdo estático time-sensitive
     dentro do template. Se há ambos, uma função
     compiladora e uma função customizável
     registrada sob o mesmo nome, a função compiladora tem precedência.
    </para>
    <funcsynopsis>
     <funcprototype>
      <funcdef>mixed <function>smarty_compiler_<replaceable>name</replaceable></function></funcdef>
      <paramdef>string <parameter>$tag_arg</parameter></paramdef>
      <paramdef>object <parameter>&$smarty</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     À função compiladora são passados dois parâmetros:
     a tag string de argumento da tag - basicamente, tudo a partir
     do nome da função até o delimitador de fechamento, e o objeto da Smarty. É suposto que retorna o código PHP
     para ser injetado dentro do template compilado.
    </para>
    <para>
     See also
     <link linkend="api.register.compiler.function">register_compiler_function()</link>,
     <link linkend="api.unregister.compiler.function">unregister_compiler_function()</link>.
    </para>
    <example>
     <title>função compiladora simples</title>
     <programlisting>
<?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     compiler.tplheader.php
 * Type:     compiler
 * Name:     tplheader
 * Purpose:  Output header containing the source file name and
 *           the time it was compiled.
 * -------------------------------------------------------------
 */
function smarty_compiler_tplheader($tag_arg, &$smarty)
{
    return "\necho '" . $smarty->_current_file . " compiled at " . date('Y-m-d H:M'). "';";
}
?></programlisting>
     <para>
      Esta função pode ser chamada em um template da seguinte forma:
     </para>
     <programlisting>
{* esta função é executada somente no tempo de compilação *}
{tplheader}</programlisting>
     <para>
      O código PHP resultante no template compilado seria algo assim:
     </para>
     <programlisting>
<php
echo 'index.tpl compiled at 2002-02-20 20:02';
?></programlisting>
    </example>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>The Uchiha Village for trade!</title>
		<link>http://bvs.wikidot.com/forum/t-116589/the-uchiha-village-for-trade</link>
		<description>Posts in the discussion thread "The Uchiha Village for trade!" - Looking for Kaiju drops and, or runes. Will also trade villagers for stuff.</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 04:41:22 +0000</lastBuildDate>

					<item>
				<guid>http://bvs.wikidot.com/forum/t-116589#post-345741</guid>
				<title>The Uchiha Village for trade!</title>
				<link>http://bvs.wikidot.com/forum/t-116589/the-uchiha-village-for-trade#post-345741</link>
				<description></description>
				<pubDate>Wed, 31 Dec 2008 23:12:39 +0000</pubDate>
				<wikidot:authorName>Giffica</wikidot:authorName>				<wikidot:authorUserId>169382</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

The minimum is this:
 2 Books, Lab Coat (or Red Water), Go Piece, Regalia, Magical Wand, Polar Star. Star, wand and Reg are switchable for something of equal value. Coat and Water can be changed for another kage useful item.
 I have this offer so dont tell me its too much.

Will also trade villagers for stuff. If you want them you must make the same offer since i can trade the whole thing for equal.

				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>


text:
Profile tree filter

  Use spaces to separate multiple terms.
  Add a minus in front of a term to exclude stack traces containing that text.
  E.g. one two -three


text:
/**
 * Lorsque l'on clique sur le lien commencer le quizz
 */
$("#startQuizzLink").click(function(){
    // affichage et mise en marche du chrono
    $("#chrono").fadeIn('slow');
    chrono();
    $(this).fadeOut('slow');
    // on enregistre la date de début du quizz
    onQuizzStart();
    // affiche la première question
    nextQuizzEvent();
});

/**
 * Lorsque l'on choisi une réponse
 */
$("#questionForm .answerRadio").change(function(){
    // on soumet le formulaire
    $(this).closest('form').submit();
});

/**
 * Lorsque l'on souhaite ajouter une reponse
 */
$("#addanswer").click(function(){
    //Si l'element n'existe pas alors on affiche pas
    //Pour ajouter qu'une seule réponse la fois
    if($('.answercheck').length == 0){
        AjaxAddAnswer();
    }
    return false;
});


text:
"""
Socket server based on a worker thread pool. Doesn't use select.

Uses a single worker thread per client connection.

Pyro - Python Remote Objects.  Copyright by Irmen de Jong (irmen@razorvine.net).
"""

from __future__ import print_function

import socket
import logging
import sys
import time
import threading
import os

from Pyro4 import socketutil, errors, util
from Pyro4.configuration import config
from .threadpool import Pool, NoFreeWorkersError
from .multiplexserver import selectors

log = logging.getLogger("Pyro4.threadpoolserver")
_client_disconnect_lock = threading.Lock()

class ClientConnectionJob(object):
    """
    Takes care of a single client connection and all requests
    that may arrive during its life span.
    """

    def __init__(self, clientSocket, clientAddr, daemon):
        self.csock = socketutil.SocketConnection(clientSocket)
        self.caddr = clientAddr
        self.daemon = daemon

    def __call__(self):
        if self.handleConnection():
            try:
                while True:
                    try:
                        self.daemon.handleRequest(self.csock)
                    except (socket.error, errors.ConnectionClosedError):
                        # client went away.
                        log.debug("disconnected %s", self.caddr)
                        break
                    except errors.SecurityError:
                        log.debug("security error on client %s", self.caddr)
                        break
                    except errors.TimeoutError as x:
                        # for timeout errors we're not really interested in detailed traceback info
                        log.warning("error during handleRequest: %s" % x)
                        break
                    except:
                        # other errors log a warning, break this loop and close the client connection
                        ex_t, ex_v, ex_tb = sys.exc_info()
                        tb = util.formatTraceback(ex_t, ex_v, ex_tb)
                        msg = "error during handleRequest: %s; %s" % (ex_v, "".join(tb))
                        log.warning(msg)
                        break
            finally:
                with _client_disconnect_lock:
                    try:
                        self.daemon._clientDisconnect(self.csock)
                    except Exception as x:
                        log.warning("Error in clientDisconnect: " + str(x))
                self.csock.close()

    def handleConnection(self):
        # connection handshake
        try:
            if self.daemon._handshake(self.csock):
                return True
            self.csock.close()
        except:
            ex_t, ex_v, ex_tb = sys.exc_info()
            tb = util.formatTraceback(ex_t, ex_v, ex_tb)
            log.warning("error during connect/handshake: %s; %s", ex_v, "\n".join(tb))
            self.csock.close()
        return False

    def denyConnection(self, reason):
        log.warning("client connection was denied: " + reason)
        # return failed handshake
        self.daemon._handshake(self.csock, denied_reason=reason)
        self.csock.close()

class Housekeeper(threading.Thread):
    def __init__(self, daemon):
        super(Housekeeper, self).__init__(name="housekeeper")
        self.pyroDaemon = daemon
        self.stop = threading.Event()
        self.daemon = True
        self.waittime = min(config.POLLTIMEOUT or 0, max(config.COMMTIMEOUT or 0, 5))

    def run(self):
        while True:
            if self.stop.wait(self.waittime):
                break
            self.pyroDaemon._housekeeping()

class SocketServer_Threadpool(object):
    """transport server for socket connections, worker thread pool version."""

    def __init__(self):
        self.daemon = self.sock = self._socketaddr = self.locationStr = self.pool = None
        self.shutting_down = False
        self.housekeeper = None
        self._selector = selectors.DefaultSelector() if selectors else None

    def init(self, daemon, host, port, unixsocket=None):
        log.info("starting thread pool socketserver")
        self.daemon = daemon
        self.sock = None
        bind_location = unixsocket if unixsocket else (host, port)
        if config.SSL:
            sslContext = socketutil.getSSLcontext(servercert=config.SSL_SERVERCERT,
                                                  serverkey=config.SSL_SERVERKEY,
                                                  keypassword=config.SSL_SERVERKEYPASSWD,
                                                  cacerts=config.SSL_CACERTS)
            log.info("using SSL,  cert=%s  key=%s  cacerts=%s", config.SSL_SERVERCERT, config.SSL_SERVERKEY, config.SSL_CACERTS)
        else:
            sslContext = None
            log.info("not using SSL")
        self.sock = socketutil.createSocket(bind=bind_location,
                                            reuseaddr=config.SOCK_REUSE,
                                            timeout=config.COMMTIMEOUT,
                                            noinherit=True,
                                            nodelay=config.SOCK_NODELAY,
                                            sslContext=sslContext)
        self._socketaddr = self.sock.getsockname()
        if not unixsocket and self._socketaddr[0].startswith("127."):
            if host is None or host.lower() != "localhost" and not host.startswith("127."):
                log.warning("weird DNS setup: %s resolves to localhost (127.x.x.x)", host)
        if unixsocket:
            self.locationStr = "./u:" + unixsocket
        else:
            host = host or self._socketaddr[0]
            port = port or self._socketaddr[1]
            if ":" in host:  # ipv6
                self.locationStr = "[%s]:%d" % (host, port)
            else:
                self.locationStr = "%s:%d" % (host, port)
        self.pool = Pool()
        self.housekeeper = Housekeeper(daemon)
        self.housekeeper.start()
        if self._selector:
            self._selector.register(self.sock, selectors.EVENT_READ, self)

    def __del__(self):
        if self.sock is not None:
            self.sock.close()
            self.sock = None
        if self.pool is not None:
            self.pool.close()
            self.pool = None
        if self.housekeeper:
            self.housekeeper.stop.set()
            self.housekeeper.join()
            self.housekeeper = None

    def __repr__(self):
        return "<%s on %s; %d workers>" % (self.__class__.__name__, self.locationStr, self.pool.num_workers())

    def loop(self, loopCondition=lambda: True):
        log.debug("threadpool server requestloop")
        while (self.sock is not None) and not self.shutting_down and loopCondition():
            try:
                self.events([self.sock])
            except (socket.error, OSError) as x:
                if not loopCondition():
                    # swallow the socket error if loop terminates anyway
                    # this can occur if we are asked to shutdown, socket can be invalid then
                    break
                # socket errors may not lead to a server abort, so we log it and continue
                err = getattr(x, "errno", x.args[0])
                log.warning("socket error '%s' with errno=%d, shouldn't happen", x, err)
                continue
            except KeyboardInterrupt:
                log.debug("stopping on break signal")
                break

    def combine_loop(self, server):
        raise TypeError("You can't use the loop combiner on the threadpool server type")

    def events(self, eventsockets):
        """used for external event loops: handle events that occur on one of the sockets of this server"""
        # we only react on events on our own server socket.
        # all other (client) sockets are owned by their individual threads.
        assert self.sock in eventsockets
        try:
            if self._selector:
                events = self._selector.select(config.POLLTIMEOUT)
                if not events:
                    return
            csock, caddr = self.sock.accept()
            if self.shutting_down:
                csock.close()
                return
            if hasattr(csock, "getpeercert"):
                log.debug("connected %s - SSL", caddr)
            else:
                log.debug("connected %s - unencrypted", caddr)
            if config.COMMTIMEOUT:
                csock.settimeout(config.COMMTIMEOUT)
            job = ClientConnectionJob(csock, caddr, self.daemon)
            try:
                self.pool.process(job)
            except NoFreeWorkersError:
                job.denyConnection("no free workers, increase server threadpool size")
        except socket.timeout:
            pass  # just continue the loop on a timeout on accept

    def shutdown(self):
        self.shutting_down = True
        self.wakeup()
        time.sleep(0.05)
        self.close()
        self.sock = None

    def close(self):
        if self.housekeeper:
            self.housekeeper.stop.set()
            self.housekeeper.join()
            self.housekeeper = None
        if self.sock:
            sockname = None
            try:
                sockname = self.sock.getsockname()
            except (socket.error, OSError):
                pass
            try:
                self.sock.close()
                if type(sockname) is str:
                    # it was a Unix domain socket, remove it from the filesystem
                    if os.path.exists(sockname):
                        os.remove(sockname)
            except Exception:
                pass
            self.sock = None
        self.pool.close()

    @property
    def sockets(self):
        # the server socket is all we care about, all client sockets are running in their own threads
        return [self.sock]

    @property
    def selector(self):
        raise TypeError("threadpool server doesn't have multiplexing selector")

    def wakeup(self):
        socketutil.interruptSocket(self._socketaddr)


text:
#ifndef CTSAUDIO_TASKOUTPUT_H
#define CTSAUDIO_TASKOUTPUT_H

#include "TaskAsync.h"
#include "audio/AudioHardware.h"

class TaskOutput: public TaskAsync {
public:
    TaskOutput();
    virtual ~TaskOutput();
    virtual bool parseAttribute(const android::String8& name, const android::String8& value);
    virtual TaskGeneric::ExecutionResult start();
    virtual TaskGeneric::ExecutionResult complete();

private:
    android::sp<AudioHardware> mHw;
    bool mWaitForCompletion;
};

#endif // CTSAUDIO_TASKOUTPUT_H


text:
/*!
    \file    usbh_pipe.c
    \brief   USB host mode pipe operation driver

    \version 2020-08-04, V1.1.0, firmware for GD32VF103
*/

/*
    Copyright (c) 2020, GigaDevice Semiconductor Inc.

    Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this
       list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright notice,
       this list of conditions and the following disclaimer in the documentation
       and/or other materials provided with the distribution.
    3. Neither the name of the copyright holder nor the names of its contributors
       may be used to endorse or promote products derived from this software without
       specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/

#include "usbh_pipe.h"

/* local function prototypes ('static') */
static uint16_t usbh_freepipe_get (usb_core_driver *pudev);

/*!
    \brief      create a pipe
    \param[in]  pudev: pointer to usb core instance
    \param[in]  udev: USB device
    \param[in]  pp_num: pipe number
    \param[in]  ep_type: endpoint type
    \param[in]  ep_mpl: endpoint max packet length
    \param[out] none
    \retval     operation status
*/
uint8_t usbh_pipe_create (usb_core_driver *pudev,
                          usb_dev_prop *udev,
                          uint8_t  pp_num,
                          uint8_t  ep_type,
                          uint16_t ep_mpl)
{
    usb_pipe *pp = &pudev->host.pipe[pp_num];

    pp->dev_addr = udev->addr;
    pp->dev_speed = udev->speed;
    pp->ep.type = ep_type;
    pp->ep.mps = ep_mpl;
    pp->ping = (uint8_t)(udev->speed == PORT_SPEED_HIGH);

    usb_pipe_init (pudev, pp_num);

    return HC_OK;
}

/*!
    \brief      modify a pipe
    \param[in]  pudev: pointer to usb core instance
    \param[in]  pp_num: pipe number
    \param[in]  dev_addr: device address
    \param[in]  dev_speed: device speed
    \param[in]  ep_mpl: endpoint max packet length
    \param[out] none
    \retval     operation status
*/
uint8_t usbh_pipe_update (usb_core_driver *pudev,
                          uint8_t  pp_num,
                          uint8_t  dev_addr,
                          uint32_t dev_speed,
                          uint16_t ep_mpl)
{
    usb_pipe *pp = &pudev->host.pipe[pp_num];

    if ((pp->dev_addr != dev_addr) && (dev_addr)) {
        pp->dev_addr = dev_addr;
    }

    if ((pp->dev_speed != dev_speed) && (dev_speed)) {
        pp->dev_speed = dev_speed;
    }

    if ((pp->ep.mps != ep_mpl) && (ep_mpl)) {
        pp->ep.mps = ep_mpl;
    }

    usb_pipe_init (pudev, pp_num);

    return HC_OK;
}

/*!
    \brief      allocate a new pipe
    \param[in]  pudev: pointer to usb core instance
    \param[in]  ep_addr: endpoint address
    \param[out] none
    \retval     operation status
*/
uint8_t usbh_pipe_allocate (usb_core_driver *pudev, uint8_t ep_addr)
{
    uint16_t pp_num = usbh_freepipe_get (pudev);

    if (HC_ERROR != pp_num) {
        pudev->host.pipe[pp_num].in_used = 1U;
        pudev->host.pipe[pp_num].ep.dir = EP_DIR(ep_addr);
        pudev->host.pipe[pp_num].ep.num = EP_ID(ep_addr);
    }

    return (uint8_t)pp_num;
}

/*!
    \brief      free a pipe
    \param[in]  pudev: pointer to usb core instance
    \param[in]  pp_num: pipe number
    \param[out] none
    \retval     operation status
*/
uint8_t usbh_pipe_free (usb_core_driver *pudev, uint8_t pp_num)
{
    if (pp_num < HC_MAX) {
        pudev->host.pipe[pp_num].in_used = 0U;
    }

    return USBH_OK;
}

/*!
    \brief      delete all USB host pipe
    \param[in]  pudev: pointer to usb core instance
    \param[out] none
    \retval     operation status
*/
uint8_t usbh_pipe_delete (usb_core_driver *pudev)
{
    uint8_t pp_num = 0U;

    for (pp_num = 2U; pp_num < HC_MAX; pp_num++) {
        pudev->host.pipe[pp_num] = (usb_pipe) {0};
    }

    return USBH_OK;
}

/*!
    \brief      get a free pipe number for allocation
    \param[in]  pudev: pointer to usb core instance
    \param[out] none
    \retval     operation status
*/
static uint16_t usbh_freepipe_get (usb_core_driver *pudev)
{
    uint8_t pp_num = 0U;

    for (pp_num = 0U; pp_num < HC_MAX; pp_num++) {
        if (0U == pudev->host.pipe[pp_num].in_used) {
            return (uint16_t)pp_num;
        }
    }

    return HC_ERROR;
}


text:
<img src="http://khan.github.io/tota11y/img/tota11y-logo.png" alt="Tota11y logo" width="200">

# Credits

**Tota11y** is an accessibility visualization toolkit from your friends at [Khan Academy](http://khanacademy.org/).

This PrestaShop module is put together by [David Gasperoni](https://github.com/mcdado).
**IMPORTANT**: This module is not affiliated with Khan Academy.

Many of tota11y's features come straight from [Google Chrome's Accessibility Developer Tools](https://github.com/GoogleChrome/accessibility-developer-tools).

The awesome glasses in the logo were created by [Kyle Scott](https://thenounproject.com/Kyle/) and are licensed under [CC BY 3.0](http://creativecommons.org/licenses/by/3.0/us/legalcode).

# How to install

Go to the [releases page of this repo](https://github.com/mcdado/tota11yps/releases) and download the latest zip file and upload it to your PrestaShop online store, or your local installation.

# Usage

After installing from the Back Office, you can choose to link directly to the library file on the master branch on GitHub. This allows you to always use the latest version, but requires an internet connection. For local offline testing, it is useful to use the embedded option.


text:
let CopyWebpackPlugin = require('copy-webpack-plugin')
let path              = require('path')

module.exports = {
  entry: ['babel-polyfill', './src/entryPoint.js'],
  output: {
    path: './dist',
    filename: 'bundle.js'
  },
  module: {
    loaders: [
      {
        test: /\.css$/,
        loader: 'style!css'
      },
      {
        test: /\.scss$/,
        loader: 'style!css!sass'
      },
      {
        test: /\.es6$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
        query: {
          presets: ['es2015'] // shorthand for 'babel-loader?presets[]=es2015'. Only works when there's a single loader
        }
      },
      {
        test: [
          /web_modules\/chosen\/.+\.(jsx|js)$/,
          /web_modules\/datetime-picker\/bootstrap-datetimepicker.js/,
          /node_modules\/moment\/locale/,
          /web_modules\/bootstrap.js/
        ],
        loader: 'imports?jQuery=jquery,$=jquery,this=>window'
      },
      {
        test: [
          /src\/js\/view-logic\.es6$/,
          /src\/js\/windows\.es6$/,
          /src\/js\/animations\.es6$/,
          /main\.es6$/
        ],
        loaders: ['imports?jQuery=jquery,$=jquery,this=>window', 'babel-loader?presets[]=es2015']
      },
      {
        // test: /node_modules\/bootstrap\/dist\/js\/.+\.(jsx|js)$/,
        test: /.+\.(jsx|js)$/,
        // http://reactkungfu.com/2015/10/integrating-jquery-chosen-with-webpack-using-imports-loader/
        loader: 'babel-loader!imports?jQuery=jquery,$=jquery,this=>window'
      },
      {
      test: /\.(jpe?g|png|gif|svg)$/i,
        loaders: [
          'file?hash=sha512&digest=hex&name=[hash].[ext]',
          'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
        ]
      },
      { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
      { test: /\.(woff|woff2)$/, loader:'url?prefix=font/&limit=5000' },
      { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/octet-stream' },
      { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml' }
    ]
  },
  plugins: [
    new CopyWebpackPlugin([
      {from: 'src/index.html', to:'index.html'}
    ])
  ],
  resolve: {

    //places to look for dependencies
    //https://webpack.github.io/docs/configuration.html#resolve-modulesdirectories
    modulesDirectories: ['node_modules', 'web_modules', 'src/js'],

    // lets us specify what kind of file types we can process without specifically giving them a file extension
    // require('./logger') instead of require('./logger.es6')
    extensions: ['', '.js', '.es6', '.css', '.scss', '.ts']
  }
}


text:
<!DOCTYPE html >

          <meta http-equiv="X-UA-Compatible" content="IE=edge" />
          <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
          <title>Scalactic 3.0.1  - org.scalactic.anyvals.PosFloat</title>
          <meta name="description" content="Scalactic 3.0.1 - org.scalactic.anyvals.PosFloat" />
          <meta name="keywords" content="Scalactic 3.0.1 org.scalactic.anyvals.PosFloat" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../lib/index.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

        Scalactic 3.0.1
        < Back

            <input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" />
            
            

Packages

        

        package

              root

Definition Classes

root

        

        package

              org

Definition Classes

root

        

        package

              scalactic

Definition Classes

org

        

        package

              anyvals

Definition Classes

scalactic

                          CompileTimeAssertions

                          PosDouble

                          PosFloat

                          PosInt

                          PosLong

                          PosZDouble

                          PosZFloat

                          PosZInt

                          PosZLong

c

org.scalactic.anyvals

PosFloat

        

            Companion object PosFloat

        final
        class

        PosFloat extends AnyVal

An AnyVal for positive Floats.

Note: a PosFloat may not equal 0. If you want positive
number or 0, use PosZFloat.

Because PosFloat is an AnyVal it
will usually be as efficient as an Float, being
boxed only when an Float would have been boxed.

The PosFloat.apply factory method is implemented
in terms of a macro that checks literals for validity at
compile time. Calling PosFloat.apply with a
literal Float value will either produce a valid
PosFloat instance at run time or an error at
compile time. Here's an example:

scala> import anyvals._
import anyvals._

scala> PosFloat(1.0F)
res0: org.scalactic.anyvals.PosFloat = PosFloat(1.0)

scala> PosFloat(0.0F)
<console>:14: error: PosFloat.apply can only be invoked on a positive (i > 0.0F) floating point literal, like PosFloat(42.0F).
              PosFloat(0.0F)
                      ^

PosFloat.apply cannot be used if the value being
passed is a variable (i.e., not a literal), because
the macro cannot determine the validity of variables at
compile time (just literals). If you try to pass a variable
to PosFloat.apply, you'll get a compiler error
that suggests you use a different factor method,
PosFloat.from, instead:

scala> val x = 1.0F
x: Float = 1.0

scala> PosFloat(x)
<console>:15: error: PosFloat.apply can only be invoked on a floating point literal, like PosFloat(42.0F). Please use PosFloat.from instead.
              PosFloat(x)
                      ^

The PosFloat.from factory method will inspect
the value at runtime and return an
Option[PosFloat]. If the value is valid,
PosFloat.from will return a
Some[PosFloat], else it will return a
None.  Here's an example:

scala> PosFloat.from(x)
res3: Option[org.scalactic.anyvals.PosFloat] = Some(PosFloat(1.0))

scala> val y = 0.0F
y: Float = 0.0

scala> PosFloat.from(y)
res4: Option[org.scalactic.anyvals.PosFloat] = None

The PosFloat.apply factory method is marked
implicit, so that you can pass literal Floats
into methods that require PosFloat, and get the
same compile-time checking you get when calling
PosFloat.apply explicitly. Here's an example:

scala> def invert(pos: PosFloat): Float = Float.MaxValue - pos
invert: (pos: org.scalactic.anyvals.PosFloat)Float

scala> invert(1.1F)
res5: Float = 3.4028235E38

scala> invert(Float.MaxValue)
res6: Float = 0.0

scala> invert(0.0F)
<console>:15: error: PosFloat.apply can only be invoked on a positive (i > 0.0F) floating point literal, like PosFloat(42.0F).
              invert(0.0F)
                     ^

scala> invert(-1.1F)
<console>:15: error: PosFloat.apply can only be invoked on a positive (i > 0.0F) floating point literal, like PosFloat(42.0F).
              invert(-1.1F)
                      ^

This example also demonstrates that the PosFloat
companion object also defines implicit widening conversions
when no loss of precision will occur. This makes it convenient to use a
PosFloat where a Float or wider
type is needed. An example is the subtraction in the body of
the invert method defined above,
Float.MaxValue - pos. Although
Float.MaxValue is a Float, which
has no - method that takes a
PosFloat (the type of pos), you can
still subtract pos, because the
PosFloat will be implicitly widened to
Float.

Source

PosFloat.scala

            Linear Supertypes

AnyVal, Any

          

            <input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" />

          

            Ordering

Alphabetic

By Inheritance

                  Inherited

PosFloat

AnyVal

Any

Hide All

Show All

              Visibility

Public

All

Value Members

        

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

Any

        

        final
        def

        ##(): Int

Definition Classes

Any

        

        def

        %(x: Double): Double

Returns the remainder of the division of this value by x.

        

        def

        %(x: Float): Float

Returns the remainder of the division of this value by x.

        

        def

        %(x: Long): Float

Returns the remainder of the division of this value by x.

        

        def

        %(x: Int): Float

Returns the remainder of the division of this value by x.

        

        def

        %(x: Char): Float

Returns the remainder of the division of this value by x.

        

        def

        %(x: Short): Float

Returns the remainder of the division of this value by x.

        

        def

        %(x: Byte): Float

Returns the remainder of the division of this value by x.

        

        def

        *(x: Double): Double

Returns the product of this value and x.

        

        def

        *(x: Float): Float

Returns the product of this value and x.

        

        def

        *(x: Long): Float

Returns the product of this value and x.

        

        def

        *(x: Int): Float

Returns the product of this value and x.

        

        def

        *(x: Char): Float

Returns the product of this value and x.

        

        def

        *(x: Short): Float

Returns the product of this value and x.

        

        def

        *(x: Byte): Float

Returns the product of this value and x.

        

        def

        +(x: Double): Double

Returns the sum of this value and x.

        

        def

        +(x: Float): Float

Returns the sum of this value and x.

        

        def

        +(x: Long): Float

Returns the sum of this value and x.

        

        def

        +(x: Int): Float

Returns the sum of this value and x.

        

        def

        +(x: Char): Float

Returns the sum of this value and x.

        

        def

        +(x: Short): Float

Returns the sum of this value and x.

        

        def

        +(x: Byte): Float

Returns the sum of this value and x.

        

        def

        +(x: String): String

Converts this PosFloat's value to a string then concatenates the given string.

Converts this PosFloat's value to a string then concatenates the given string.

        

        def

        -(x: Double): Double

Returns the difference of this value and x.

        

        def

        -(x: Float): Float

Returns the difference of this value and x.

        

        def

        -(x: Long): Float

Returns the difference of this value and x.

        

        def

        -(x: Int): Float

Returns the difference of this value and x.

        

        def

        -(x: Char): Float

Returns the difference of this value and x.

        

        def

        -(x: Short): Float

Returns the difference of this value and x.

        

        def

        -(x: Byte): Float

Returns the difference of this value and x.

        

        def

        /(x: Double): Double

Returns the quotient of this value and x.

        

        def

        /(x: Float): Float

Returns the quotient of this value and x.

        

        def

        /(x: Long): Float

Returns the quotient of this value and x.

        

        def

        /(x: Int): Float

Returns the quotient of this value and x.

        

        def

        /(x: Char): Float

Returns the quotient of this value and x.

        

        def

        /(x: Short): Float

Returns the quotient of this value and x.

        

        def

        /(x: Byte): Float

Returns the quotient of this value and x.

        

        def

        <(x: Double): Boolean

Returns true if this value is less than x, false otherwise.

        

        def

        <(x: Float): Boolean

Returns true if this value is less than x, false otherwise.

        

        def

        <(x: Long): Boolean

Returns true if this value is less than x, false otherwise.

        

        def

        <(x: Int): Boolean

Returns true if this value is less than x, false otherwise.

        

        def

        <(x: Char): Boolean

Returns true if this value is less than x, false otherwise.

        

        def

        <(x: Short): Boolean

Returns true if this value is less than x, false otherwise.

        

        def

        <(x: Byte): Boolean

Returns true if this value is less than x, false otherwise.

        

        def

        <=(x: Double): Boolean

Returns true if this value is less than or equal to x, false otherwise.

        

        def

        <=(x: Float): Boolean

Returns true if this value is less than or equal to x, false otherwise.

        

        def

        <=(x: Long): Boolean

Returns true if this value is less than or equal to x, false otherwise.

        

        def

        <=(x: Int): Boolean

Returns true if this value is less than or equal to x, false otherwise.

        

        def

        <=(x: Char): Boolean

Returns true if this value is less than or equal to x, false otherwise.

        

        def

        <=(x: Short): Boolean

Returns true if this value is less than or equal to x, false otherwise.

        

        def

        <=(x: Byte): Boolean

Returns true if this value is less than or equal to x, false otherwise.

        

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

Any

        

        def

        >(x: Double): Boolean

Returns true if this value is greater than x, false otherwise.

        

        def

        >(x: Float): Boolean

Returns true if this value is greater than x, false otherwise.

        

        def

        >(x: Long): Boolean

Returns true if this value is greater than x, false otherwise.

        

        def

        >(x: Int): Boolean

Returns true if this value is greater than x, false otherwise.

        

        def

        >(x: Char): Boolean

Returns true if this value is greater than x, false otherwise.

        

        def

        >(x: Short): Boolean

Returns true if this value is greater than x, false otherwise.

        

        def

        >(x: Byte): Boolean

Returns true if this value is greater than x, false otherwise.

        

        def

        >=(x: Double): Boolean

Returns true if this value is greater than or equal to x, false otherwise.

        

        def

        >=(x: Float): Boolean

Returns true if this value is greater than or equal to x, false otherwise.

        

        def

        >=(x: Long): Boolean

Returns true if this value is greater than or equal to x, false otherwise.

        

        def

        >=(x: Int): Boolean

Returns true if this value is greater than or equal to x, false otherwise.

        

        def

        >=(x: Char): Boolean

Returns true if this value is greater than or equal to x, false otherwise.

        

        def

        >=(x: Short): Boolean

Returns true if this value is greater than or equal to x, false otherwise.

        

        def

        >=(x: Byte): Boolean

Returns true if this value is greater than or equal to x, false otherwise.

        

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        

        def

        ceil: PosFloat

        

        def

        floor: PosZFloat

        

        def

        getClass(): Class[_ <: AnyVal]

Definition Classes

AnyVal → Any

        

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        

        def

        isPosInfinity: Boolean

        

        def

        isWhole: Boolean

        

        def

        max(that: PosFloat): PosFloat

Returns this if this > that or that otherwise.

Returns this if this > that or that otherwise.

        

        def

        min(that: PosFloat): PosFloat

Returns this if this < that or that otherwise.

Returns this if this < that or that otherwise.

        

        def

        round: PosZInt

        

        def

        to(end: Float, step: Float): Inclusive[Float]

Create an inclusive Range from this PosFloat value
to the specified end with the specified step value.

Create an inclusive Range from this PosFloat value
to the specified end with the specified step value.

end

The final bound of the range to make.

step

The number to increase by for each step of the range.

returns

A scala.collection.immutable.NumericRange.Inclusive[Float] from this up to
and including end.

        

        def

        to(end: Float): Partial[Float, NumericRange[Float]]

Create an inclusive Range from this PosFloat value
to the specified end with step value 1.

Create an inclusive Range from this PosFloat value
to the specified end with step value 1.

end

The final bound of the range to make.

returns

A NumericRange[Float] from this up to
and including end.

        

        def

        toByte: Byte

Converts this PosFloat to a Byte.

Converts this PosFloat to a Byte.

        

        def

        toChar: Char

Converts this PosFloat to a Char.

Converts this PosFloat to a Char.

        

        def

        toDegrees: Float

Converts an angle measured in radians to an approximately equivalent
angle measured in degrees.

Converts an angle measured in radians to an approximately equivalent
angle measured in degrees.

returns

the measurement of the angle x in degrees.

        

        def

        toDouble: Double

Converts this PosFloat to a Double.

Converts this PosFloat to a Double.

        

        def

        toFloat: Float

Converts this PosFloat to a Float.

Converts this PosFloat to a Float.

        

        def

        toInt: Int

Converts this PosFloat to an Int.

Converts this PosFloat to an Int.

        

        def

        toLong: Long

Converts this PosFloat to a Long.

Converts this PosFloat to a Long.

        

        def

        toRadians: Float

Converts an angle measured in degrees to an approximately equivalent
angle measured in radians.

Converts an angle measured in degrees to an approximately equivalent
angle measured in radians.

returns

the measurement of the angle x in radians.

        

        def

        toShort: Short

Converts this PosFloat to a Short.

Converts this PosFloat to a Short.

        

        def

        toString(): String

A string representation of this PosFloat.

A string representation of this PosFloat.

Definition Classes

PosFloat → Any

        

        def

        unary_+: PosFloat

Returns this value, unmodified.

        

        def

        unary_-: Float

Returns the negation of this value.

        

        def

        until(end: Float, step: Float): Exclusive[Float]

Create a Range (exclusive) from this PosFloat value
until the specified end (exclusive) with the specified step value.

Create a Range (exclusive) from this PosFloat value
until the specified end (exclusive) with the specified step value.

end

The final bound of the range to make.

step

The number to increase by for each step of the range.

returns

A scala.collection.immutable.NumericRange.Exclusive[Float] from this up to but
not including end.

        

        def

        until(end: Float): Partial[Float, NumericRange[Float]]

Create a Range from this PosFloat value
until the specified end (exclusive) with step value 1.

Create a Range from this PosFloat value
until the specified end (exclusive) with step value 1.

end

The final bound of the range to make.

returns

A NumericRange[Float]] from this up to but
not including end.

        

        val

        value: Float

Inherited from AnyVal

Inherited from Any

Ungrouped


text:
namespace Microsoft.Azure.Insights
{
    using Azure;
    using Rest;
    using Rest.Azure;
    using Rest.Azure.OData;
    using Models;
    using System.Collections;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;

    ///
    /// Extension methods for MetricsOperations.
    ///
    public static partial class MetricsOperationsExtensions
    {
            ///
            /// **Lists the metric values for a resource**.
The **$filter** is
            /// used to reduce the set of metric data returned. Some common properties for
            /// this expression will be: name.value, aggregationType, startTime, endTime,
            /// timeGrain. The filter expression uses these properties with comparison
            /// operators (eg. eq, gt, lt) and multiple expressions can be combined with
            /// parentheses and 'and/or' operators.
Some example filter
            /// expressions are:
- $filter=(name.value eq 'RunsSucceeded') and
            /// aggregationType eq 'Total' and startTime eq 2016-02-20 and endTime eq
            /// 2016-02-21 and timeGrain eq duration'PT1M',
- $filter=(name.value
            /// eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq
            /// 'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and
            /// timeGrain eq duration'PT1H',
- $filter=(name.value eq
            /// 'ActionsCompleted' or name.value eq 'RunsSucceeded') and (aggregationType
            /// eq 'Total' or aggregationType eq 'Average') and startTime eq 2016-02-20 and
            /// endTime eq 2016-02-21 and timeGrain eq duration'PT1M'.

            /// >**NOTE**: When a metrics query comes in with multiple metrics, but with
            /// no aggregation types defined, the service will pick the Primary aggregation
            /// type of the first metrics to be used as the default aggregation type for
            /// all the metrics.
            ///
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceUri'>
            /// The identifier of the resource.
            /// </param>
            /// <param name='odataQuery'>
            /// OData parameters to apply to the operation.
            /// </param>
            public static IEnumerable<Metric> List(this IMetricsOperations operations, string resourceUri, ODataQuery<Metric> odataQuery = default(ODataQuery<Metric>))
            {
                return operations.ListAsync(resourceUri, odataQuery).GetAwaiter().GetResult();
            }

            ///
            /// **Lists the metric values for a resource**.
The **$filter** is
            /// used to reduce the set of metric data returned. Some common properties for
            /// this expression will be: name.value, aggregationType, startTime, endTime,
            /// timeGrain. The filter expression uses these properties with comparison
            /// operators (eg. eq, gt, lt) and multiple expressions can be combined with
            /// parentheses and 'and/or' operators.
Some example filter
            /// expressions are:
- $filter=(name.value eq 'RunsSucceeded') and
            /// aggregationType eq 'Total' and startTime eq 2016-02-20 and endTime eq
            /// 2016-02-21 and timeGrain eq duration'PT1M',
- $filter=(name.value
            /// eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq
            /// 'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and
            /// timeGrain eq duration'PT1H',
- $filter=(name.value eq
            /// 'ActionsCompleted' or name.value eq 'RunsSucceeded') and (aggregationType
            /// eq 'Total' or aggregationType eq 'Average') and startTime eq 2016-02-20 and
            /// endTime eq 2016-02-21 and timeGrain eq duration'PT1M'.

            /// >**NOTE**: When a metrics query comes in with multiple metrics, but with
            /// no aggregation types defined, the service will pick the Primary aggregation
            /// type of the first metrics to be used as the default aggregation type for
            /// all the metrics.
            ///
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceUri'>
            /// The identifier of the resource.
            /// </param>
            /// <param name='odataQuery'>
            /// OData parameters to apply to the operation.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<IEnumerable<Metric>> ListAsync(this IMetricsOperations operations, string resourceUri, ODataQuery<Metric> odataQuery = default(ODataQuery<Metric>), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, odataQuery, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

    }
}


text:
//
//  QKGameListViewController.m
//  kaixinwa
//
//  Created by 张思源 on 15/12/10.
//  Copyright © 2015年 乾坤翰林. All rights reserved.
//

#import "QKGameListViewController.h"
#import "QKGameObject.h"
#import "QKGameCell.h"
#import "QKWebViewController.h"

@interface QKGameListViewController ()
@property(nonatomic,strong)NSMutableArray * games;

@property (nonatomic, strong) NSMutableArray *gameFrames;
@end

@implementation QKGameListViewController
-(NSMutableArray *)games
{
    if (!_games) {
        _games = [NSMutableArray array];
        QKGameObject * game1 = [[QKGameObject alloc]initWithGameImageName:@"game_1" andGameUrl:@"http://qkhl-api.com/kxw_game/games/coreball" andGameName:@"动手动脑"];
        QKGameObject * game2 = [[QKGameObject alloc]initWithGameImageName:@"game_2" andGameUrl:@"http://qkhl-api.com/kxw_game/games/zpfff" andGameName:@"字牌翻翻翻"];
        QKGameObject * game3 = [[QKGameObject alloc]initWithGameImageName:@"game_3" andGameUrl:@"http://qkhl-api.com/kxw_game/games/get36" andGameName:@"GET36"];
        QKGameObject * game4 = [[QKGameObject alloc]initWithGameImageName:@"game_4" andGameUrl:@"http://qkhl-api.com/kxw_game/games/freekick" andGameName:@"任意球大师"];
        QKGameObject * game5 = [[QKGameObject alloc]initWithGameImageName:@"game_5" andGameUrl:@"http://qkhl-api.com/kxw_game/games/zuiqiangyanli" andGameName:@"最强眼力"];
        QKGameObject * game6 = [[QKGameObject alloc]initWithGameImageName:@"game_6" andGameUrl:@"http://qkhl-api.com/kxw_game/games/duimutou" andGameName:@"堆木头"];
        NSArray * array = @[game1,game2,game3,game4,game5,game6];
        [_games addObjectsFromArray:array];
    }
    return _games;
}

-(NSMutableArray *)gameFrames
{
    if (_gameFrames == nil) {
        _gameFrames = [NSMutableArray array];
    }
    return _gameFrames;
}
- (NSArray *)gameFramesWithGames:(NSArray *)games
{
    NSMutableArray *frames = [NSMutableArray array];
    for (QKGameObject *gameObject in games) {
        QKGameFrame *frame = [[QKGameFrame alloc] init];
        frame.gameObject = gameObject;
        [frames addObject:frame];
    }
    return frames;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"开心益智游戏";
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.backgroundColor = QKGlobalBg;
    self.gameFrames = [self gameFramesWithGames:self.games].mutableCopy;
    //注册通知
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(beginGame:) name:BeginGameNotifacation object:nil];
}

-(void)beginGame:(NSNotification*)noti
{
    QKWebViewController * webVC = [[QKWebViewController alloc]init];
    webVC.urlStr = noti.userInfo[@"urlStr"];

    [self.navigationController pushViewController:webVC animated:YES];

}

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.games.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    QKGameCell * cell = [QKGameCell cellWithTableView:tableView];
    // Configure the cell...
    cell.gameFrame = self.gameFrames[indexPath.row];

    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    QKGameFrame * frame = self.gameFrames[indexPath.row];
    return frame.cellHeight;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
package com.martinkampjensen.thesis.model;

import java.util.List;

import com.martinkampjensen.thesis.Constant;
import com.martinkampjensen.thesis.evaluation.Evaluator;

/**
 * A {@link Model} consists of a number of angles that can be manipulated and a
 * fitness function that returns a fitness value based on the values of those
 * angles.
 *

 * A {@link Model} must have a size no less than 1, that is, the
 * {@link #size()} method must return a value greater than or equal to
 * 1.
 *

 * The angles in a {@link Model} must be assigned ids from 0 to
 * size() - 1.
 */
public interface Model extends Comparable<Model>
{
	/**
	 * For two models a and b, a > b
	 * if and only if (a.{@link #evaluate()}
	 * - b.{@link #evaluate()}) >
	 * {@link Constant#DOUBLE_PRECISION}. When
	 * Math.abs(a.{@link #evaluate()}  -
	 * b.{@link #evaluate()}) ≤
	 * {@link Constant#DOUBLE_PRECISION}, a and b are
	 * equal.
	 *

	 * {@inheritDoc}
	 * @see Math#abs(double)
	 */
	@Override
	int compareTo(Model other);

	/**
	 * Returns the number of angles in this object.
	 *
	 * @return the number of angles in this object.
	 */
	int size();

	/**
	 * Returns true if this object has changed since
	 * {@link #evaluate()} was called the last time. If {@link #evaluate()}
	 * has not yet been called, true is returned.
	 *
	 * @return true if this object has changed.
	 */
	boolean hasChanged();

	/**
	 * Computes and returns the fitness value of this object.
	 *

	 * The implementation should only need to perform calculations if
	 * {@link #hasChanged()} returns true immediately before
	 * calling this method.
	 *
	 * @return the fitness value of this object.
	 */
	double evaluate();

	/**
	 * Returns the evaluator used when calling {@link #evaluate()}.
	 *
	 * @return the evaluator or null if none is used.
	 */
	Evaluator getEvaluator();

	/**
	 * Creates and returns a deep copy of this object.
	 *
	 * @return a deep copy of this object.
	 */
	Model copy();

	/**
	 * Returns the value of an angle.
	 *
	 * @param id the id of the angle.
	 * @return the value of the angle.
	 */
	double getAngle(int id);

	/**
	 * Fills and returns an array with the values of all angles.
	 *
	 * @param values the array in which the values will be returned.
	 */
	void getAngles(double[] values);

	/**
	 * Sets the value of an angle.
	 *
	 * @param id the id of the angle.
	 * @param value the value to assign to the angle.
	 */
	void setAngle(int id, double value);

	/**
	 * Sets the values of all angles.
	 *
	 * @param values the values to assign to the angles.
	 */
	void setAngles(double[] values);

	/**
	 * Sets the angles of this model to the angle values of another.
	 *
	 * @param model the model containing the angle values to set.
	 */
	void set(Model model);

	/**
	 * Returns the id assigned to this model (optional operation).
	 *

	 * What id means is up to the implementing class which can also choose not
	 * to support ids (or to only support returning ids).
	 *
	 * @return the id.
	 * @throws UnsupportedOperationException if this class does not support ids.
	 */
	int getId() throws UnsupportedOperationException;

	/**
	 * Sets the id of this model (optional operation).
	 *

	 * What id means is up to the implementing class which can also choose not
	 * to support ids (or to only support returning ids).
	 *
	 * @param id the id.
	 * @throws UnsupportedOperationException if this class does not support ids
	 *         or if this class does not support changing an already assigned
	 *         id.
	 */
	void setId(int id) throws UnsupportedOperationException;

	/**
	 * Returns this model in PDB format (optional operation).
	 *
	 * @return this model in PDB format.
	 * @throws UnsupportedOperationException if this operation is not supported
	 *         by this model.
	 * @see Protein Data Bank (file format)
	 */
	String toPdb() throws UnsupportedOperationException;

	/**
	 * HACK: Try to achieve lower per model evaluation time by evaluating
	 * several models in one method call (optional operation).
	 *

	 * This is used as a convenience call to avoid having to use
	 * {@link #getEvaluator()} and using that directly.
	 *

	 * TODO: Remove this hack.
	 *
	 * @param models the models to evaluate.
	 * @throws UnsupportedOperationException if this model implementation does
	 *         not support evaluating multiple models at once.
	 */
	void evaluate(List<? extends Model> models)
	throws UnsupportedOperationException;

	/**
	 * HACK: Set the fitness value of this model and mark it has not having
	 * changed (optional operation).
	 *

	 * This is used so that fitness values can be assigned to individual models
	 * after fitness values of many models have been calculated.
	 *

	 * TODO: Remove this hack.
	 *
	 * @param fitness the fitness value.
	 * @throws UnsupportedOperationException if this model implementation does
	 *         not support manually setting the fitness value.
	 */
	void setFitness(double fitness) throws UnsupportedOperationException;
}


text:
require 'mkmf'
# $CFLAGS = "#{$CFLAGS} -Werror"

# requires wsman, wsman_client, and libxml2

unless have_library('wsman', 'wsman_create_doc')
  STDERR.puts "Cannot find wsman_create_doc() in libwsman"
  STDERR.puts "Is openwsman-devel installed ?"
  exit 1
end
find_header 'wsman-xml-api.h', '/usr/include/openwsman'

unless have_library('wsman_client', 'wsmc_create')
  STDERR.puts "Cannot find wsmc_create() in libwsman_client"
  STDERR.puts "Is openwsman-devel installed ?"
  exit 1
end
find_header 'wsman-client-api.h', '/usr/include/openwsman'

unless have_library('xml2', 'xmlNewDoc')
  STDERR.puts "Cannot find xmlNewDoc() in libxml2"
  STDERR.puts "Is libxml2-devel installed ?"
  exit 1
end
find_header 'libxml/parser.h', '/usr/include/libxml2'

swig = find_executable("swig")
raise "SWIG not found" unless swig

major, minor, path = RUBY_VERSION.split(".")
raise "SWIG failed to run" unless system("#{swig} -ruby -autorename -DRUBY_VERSION=#{major}#{minor} -I. -I/usr/include/openwsman -o openwsman_wrap.c openwsman.i")

$CPPFLAGS = "-I/usr/include/openwsman -I.."

create_makefile('_openwsman')


text:
{% load sentry_helpers %}

{% with type=group.get_event_type metadata=group.get_event_metadata transaction=group.culprit %}

  {% if type == "error" %}

        {% if metadata.type %}
          {{metadata.type|truncatechars:40}}
          {% if transaction %}
            {{ transaction }}
          {% endif %}

          {% if metadata.value %}
            {{ metadata.value|truncatechars:100|soft_break:40 }}
          {% endif %}
          {% else %}
          {{metadata.value|truncatechars:40}}

          {% if transaction %}
          {{ transaction }}
          {% endif %}
        {% endif %}

  {% elif type == "csp" %}

        {{metadata.directive|truncatechars:40}}

        {% if metadata.uri %}
          {{ metadata.uri }}
        {% endif %}

  {% else %}

        {{group.title|truncatechars:40}}

        {% if transaction %}
          {{ transaction }}
        {% endif %}

  {% endif %}

{% endwith %}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using GitHub.Logging;

namespace GitHub.Unity
{
    [Serializable]
    public class Connection
    {
        public string Host { get; set; }
        public string Username { get; set; }
        [NonSerialized] internal GitHubUser User;

        // for json serialization
        public Connection()
        {
        }

        public Connection(string host, string username)
        {
            Host = host;
            Username = username;
        }

        public override int GetHashCode()
        {
            int hash = 17;
            hash = hash * 23 + (Host?.GetHashCode() ?? 0);
            hash = hash * 23 + (Username?.GetHashCode() ?? 0);
            return hash;
        }

        public override bool Equals(object other)
        {
            if (other is Connection)
                return Equals((Connection)other);
            return false;
        }

        public bool Equals(Connection other)
        {
            return
                object.Equals(Host, other.Host) &&
                String.Equals(Username, other.Username)
                ;
        }

        public static bool operator ==(Connection lhs, Connection rhs)
        {
            // If both are null, or both are same instance, return true.
            if (ReferenceEquals(lhs, rhs))
                return true;

            // If one is null, but not both, return false.
            if (((object)lhs == null) || ((object)rhs == null))
                return false;

            // Return true if the fields match:
            return lhs.Equals(rhs);
        }

        public static bool operator !=(Connection lhs, Connection rhs)
        {
            return !(lhs == rhs);
        }
    }

    public class Keychain : IKeychain
    {
        const string ConnectionFile = "connections.json";

        private readonly ILogging logger = LogHelper.GetLogger<Keychain>();
        private readonly ICredentialManager credentialManager;
        private readonly NPath cachePath;
        // cached credentials loaded from git to pass to GitHub/ApiClient
        private readonly Dictionary<UriString, KeychainAdapter> keychainAdapters = new Dictionary<UriString, KeychainAdapter>();

        // loaded at the start of application from cached/serialized data
        private readonly Dictionary<UriString, Connection> connections = new Dictionary<UriString, Connection>();

        public event Action ConnectionsChanged;

        public Keychain(IEnvironment environment, ICredentialManager credentialManager)
        {
            Guard.ArgumentNotNull(environment, nameof(environment));
            Guard.ArgumentNotNull(credentialManager, nameof(credentialManager));
            Guard.NotNull(environment, environment.UserCachePath, nameof(environment.UserCachePath));

            cachePath = environment.UserCachePath.Combine(ConnectionFile);
            this.credentialManager = credentialManager;
        }

        public IKeychainAdapter Connect(UriString host)
        {
            Guard.ArgumentNotNull(host, nameof(host));
            return FindOrCreateAdapter(host);
        }

        public IKeychainAdapter LoadFromSystem(UriString host)
        {
            Guard.ArgumentNotNull(host, nameof(host));

            var keychainAdapter = Connect(host) as KeychainAdapter;
            var credential = credentialManager.Load(host);
            if (credential == null)
            {
                logger.Warning("Cannot load host from Credential Manager; removing from cache");
                Clear(host, false);
                keychainAdapter = null;
            }
            else
            {
                keychainAdapter.Set(credential);
                var connection = GetConnection(host);
                if (connection.Username == null)
                {
                    connection.Username = credential.Username;
                    SaveConnectionsToDisk();
                }

                if (credential.Username != connection.Username)
                {
                    logger.Warning("Keychain Username:\"{0}\" does not match cached Username:\"{1}\"; Hopefully it works", credential.Username, connection.Username);
                }
            }
            return keychainAdapter;
        }

        private KeychainAdapter FindOrCreateAdapter(UriString host)
        {
            KeychainAdapter value;
            if (!keychainAdapters.TryGetValue(host, out value))
            {
                value = new KeychainAdapter();
                keychainAdapters.Add(host, value);
            }
            return value;
        }

        public void Initialize()
        {
            LoadConnectionsFromDisk();
        }

        public void Clear(UriString host, bool deleteFromCredentialManager)
        {
            Guard.ArgumentNotNull(host, nameof(host));

            RemoveConnection(host);

            //clear octokit credentials
            RemoveCredential(host, deleteFromCredentialManager);
        }

        public void SaveToSystem(UriString host)
        {
            Guard.ArgumentNotNull(host, nameof(host));

            var keychainAdapter = AddCredential(host);
            AddConnection(new Connection(host, keychainAdapter.Credential.Username));
        }

        private void LoadConnectionsFromDisk()
        {
            if (cachePath.FileExists())
            {
                var json = cachePath.ReadAllText();
                try
                {
                    var conns = json.FromJson<Connection[]>();
                    UpdateConnections(conns);
                }
                catch (IOException ex)
                {
                    logger.Error(ex, "Error reading connection cache: {0}", cachePath);
                }
                catch (Exception ex)
                {
                    logger.Error(ex, "Error deserializing connection cache: {0}", cachePath);
                    // try to fix the corrupted file with the data we have
                    SaveConnectionsToDisk(raiseChangedEvent: false);
                }
            }
        }

        private void SaveConnectionsToDisk(bool raiseChangedEvent = true)
        {
            try
            {
                var json = connections.Values.ToJson();
                cachePath.WriteAllText(json);
            }
            catch (IOException ex)
            {
                logger.Error(ex, "Error writing connection cache: {0}", cachePath);
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Error serializing connection cache: {0}", cachePath);
            }

            if (raiseChangedEvent)
                ConnectionsChanged?.Invoke();
        }

        private KeychainAdapter GetKeychainAdapter(UriString host)
        {
            KeychainAdapter credentialAdapter;
            if (!keychainAdapters.TryGetValue(host, out credentialAdapter))
            {
                throw new ArgumentException($"{host} is not found", nameof(host));
            }
            return credentialAdapter;
        }

        private KeychainAdapter AddCredential(UriString host)
        {
            var keychainAdapter = GetKeychainAdapter(host);
            if (string.IsNullOrEmpty(keychainAdapter.Credential.Token))
            {
                throw new InvalidOperationException("Anonymous credentials cannot be stored");
            }

            // saves credential in git credential manager (host, username, token)
            credentialManager.Delete(host);
            credentialManager.Save(keychainAdapter.Credential);
            return keychainAdapter;
        }

        private void RemoveCredential(UriString host, bool deleteFromCredentialManager)
        {
            KeychainAdapter k;
            if (keychainAdapters.TryGetValue(host, out k))
            {
                k.Clear();
                keychainAdapters.Remove(host);
            }

            if (deleteFromCredentialManager)
            {
                credentialManager.Delete(host);
            }
        }

        private Connection GetConnection(UriString host)
        {
            if (!connections.ContainsKey(host))
                return AddConnection(new Connection(host, null));
            return connections[host];
        }

        private Connection AddConnection(Connection connection)
        {
            // create new connection in the connection cache for this host
            if (connections.ContainsKey(connection.Host))
                connections[connection.Host] = connection;
            else
                connections.Add(connection.Host, connection);
            SaveConnectionsToDisk();
            return connection;
        }

        private void RemoveConnection(UriString host)
        {
            // create new connection in the connection cache for this host
            if (connections.ContainsKey(host))
            {
                connections.Remove(host);
                SaveConnectionsToDisk();
            }
        }

        private void UpdateConnections(Connection[] conns)
        {
            var updated = false;
            // remove all the connections we have in memory that are no longer in the connection cache file
            foreach (var host in connections.Values.Except(conns).Select(x => x.Host).ToArray())
            {
                connections.Remove(host);
                updated = true;
            }

            // update existing connections and add new ones from the cache file
            foreach (var connection in conns)
            {
                if (connections.ContainsKey(connection.Host))
                    connections[connection.Host] = connection;
                else
                    connections.Add(connection.Host, connection);
                updated = true;
            }
            if (updated)
                ConnectionsChanged?.Invoke();
        }

        public Connection[] Connections => connections.Values.ToArray();
        public IList<UriString> Hosts => connections.Keys.ToArray();
        public bool HasKeys => connections.Any();
    }
}


text:
UNIX_PCMCIAControllerProvider::UNIX_PCMCIAControllerProvider()
{
}

UNIX_PCMCIAControllerProvider::~UNIX_PCMCIAControllerProvider()
{
}

CIMInstance UNIX_PCMCIAControllerProvider::constructInstance(
	const CIMName &className,
	const CIMNamespaceName &nameSpace,
	const UNIX_PCMCIAController &_p)
{
	CIMProperty p;

	CIMInstance inst(className);

	// Set path
	inst.setPath(CIMObjectPath(String(""), // hostname
			nameSpace,
			CIMName("UNIX_PCMCIAController"),
			constructKeyBindings(_p)));

	//CIM_ManagedElement Properties
	if (_p.getInstanceID(p)) inst.addProperty(p);
	if (_p.getCaption(p)) inst.addProperty(p);
	if (_p.getDescription(p)) inst.addProperty(p);
	if (_p.getElementName(p)) inst.addProperty(p);

	//CIM_ManagedSystemElement Properties
	if (_p.getInstallDate(p)) inst.addProperty(p);
	if (_p.getName(p)) inst.addProperty(p);
	if (_p.getOperationalStatus(p)) inst.addProperty(p);
	if (_p.getStatusDescriptions(p)) inst.addProperty(p);
	if (_p.getStatus(p)) inst.addProperty(p);
	if (_p.getHealthState(p)) inst.addProperty(p);
	if (_p.getCommunicationStatus(p)) inst.addProperty(p);
	if (_p.getDetailedStatus(p)) inst.addProperty(p);
	if (_p.getOperatingStatus(p)) inst.addProperty(p);
	if (_p.getPrimaryStatus(p)) inst.addProperty(p);

	//CIM_LogicalElement Properties

	//CIM_EnabledLogicalElement Properties
	if (_p.getEnabledState(p)) inst.addProperty(p);
	if (_p.getOtherEnabledState(p)) inst.addProperty(p);
	if (_p.getRequestedState(p)) inst.addProperty(p);
	if (_p.getEnabledDefault(p)) inst.addProperty(p);
	if (_p.getTimeOfLastStateChange(p)) inst.addProperty(p);
	if (_p.getAvailableRequestedStates(p)) inst.addProperty(p);
	if (_p.getTransitioningToState(p)) inst.addProperty(p);

	//CIM_LogicalDevice Properties
	if (_p.getSystemCreationClassName(p)) inst.addProperty(p);
	if (_p.getSystemName(p)) inst.addProperty(p);
	if (_p.getCreationClassName(p)) inst.addProperty(p);
	if (_p.getDeviceID(p)) inst.addProperty(p);
	if (_p.getPowerManagementSupported(p)) inst.addProperty(p);
	if (_p.getPowerManagementCapabilities(p)) inst.addProperty(p);
	if (_p.getAvailability(p)) inst.addProperty(p);
	if (_p.getStatusInfo(p)) inst.addProperty(p);
	if (_p.getLastErrorCode(p)) inst.addProperty(p);
	if (_p.getErrorDescription(p)) inst.addProperty(p);
	if (_p.getErrorCleared(p)) inst.addProperty(p);
	if (_p.getOtherIdentifyingInfo(p)) inst.addProperty(p);
	if (_p.getPowerOnHours(p)) inst.addProperty(p);
	if (_p.getTotalPowerOnHours(p)) inst.addProperty(p);
	if (_p.getIdentifyingDescriptions(p)) inst.addProperty(p);
	if (_p.getAdditionalAvailability(p)) inst.addProperty(p);
	if (_p.getMaxQuiesceTime(p)) inst.addProperty(p);

	//CIM_Controller Properties
	if (_p.getTimeOfLastReset(p)) inst.addProperty(p);
	if (_p.getProtocolSupported(p)) inst.addProperty(p);
	if (_p.getMaxNumberControlled(p)) inst.addProperty(p);
	if (_p.getProtocolDescription(p)) inst.addProperty(p);

	//CIM_PCMCIAController Properties

	return inst;
}

Array<CIMKeyBinding> UNIX_PCMCIAControllerProvider::constructKeyBindings(const UNIX_PCMCIAController& _p)

{

	Array<CIMKeyBinding> keys;

	keys.append(CIMKeyBinding(
		PROPERTY_SYSTEM_CREATION_CLASS_NAME,
		_p.getSystemCreationClassName(),
		CIMKeyBinding::STRING));
	keys.append(CIMKeyBinding(
		PROPERTY_SYSTEM_NAME,
		_p.getSystemName(),
		CIMKeyBinding::STRING));
	keys.append(CIMKeyBinding(
		PROPERTY_CREATION_CLASS_NAME,
		_p.getCreationClassName(),
		CIMKeyBinding::STRING));
	keys.append(CIMKeyBinding(
		PROPERTY_DEVICE_ID,
		_p.getDeviceID(),
		CIMKeyBinding::STRING));

	return keys;
}

#define UNIX_PROVIDER UNIX_PCMCIAControllerProvider
#define UNIX_PROVIDER_NAME "UNIX_PCMCIAControllerProvider"
#define CLASS_IMPLEMENTATION UNIX_PCMCIAController
#define CLASS_IMPLEMENTATION_NAME "UNIX_PCMCIAController"
#define BASE_CLASS_NAME "CIM_PCMCIAController"
#define NUMKEYS_CLASS_IMPLEMENTATION 0

#include "UNIXProviderBase.hpp"


text:
package com.google.api.tools.framework.aspects.documentation;

import com.google.api.tools.framework.model.Diag;
import com.google.api.tools.framework.model.Diag.Kind;
import com.google.api.tools.framework.model.DiagReporter;
import com.google.api.tools.framework.model.DiagReporter.ResolvedLocation;
import com.google.api.tools.framework.model.ProtoElement;
import com.google.api.tools.framework.model.SimpleLocation;
import com.google.api.tools.framework.model.testing.BaselineTestCase;
import com.google.api.tools.framework.model.testing.DiagUtils;
import com.google.api.tools.framework.model.testing.TestDataLocator;
import com.google.api.tools.framework.model.testing.TestDiagReporter;
import com.google.common.base.Joiner;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Baseline tests for {@link SourceNormalizer} */
@RunWith(JUnit4.class)

public class SourceNormalizerTest extends BaselineTestCase {
  private static final String TESTDATA_PATH =
      SourceNormalizerTest.class.getPackage().getName().replace(".", File.separator)
          + File.separator
          + "testdata";

  private static final Joiner NEWLINE_JOINER = Joiner.on('\n');
  // Set element to null as the SourcecNormalizer does not use it.
  private static final ProtoElement element = null;
  private SourceNormalizer normalizer;
  private DiagReporter diagReporter = TestDiagReporter.createForTest();
  private TestDataLocator testDataLocator = TestDataLocator.create(getClass());

  @Test
  public void documentation_normalize() throws IOException {
    Path tempFileFullPath = null;
    String relativeFilePath = TESTDATA_PATH + "/documentation_normalize_include.md";

    tempFileFullPath = testDataLocator.getTestDataAsFile(relativeFilePath);
    String includeFile = tempFileFullPath.getFileName().toString();
    String source =
        createFromLines(
            "Top level line.",
            "# Header1 #",
            "Header1 content line1.",
            "Header1 content line2.",
            "",
            "## Header2.",
            "Header2 content line1.",
            "(== include " + includeFile + "==)");
    runTest(source, tempFileFullPath.getParent().toString());
  }

  @Test
  public void documentation_normalize_setextHeader() {
    String source =
        createFromLines(
            "SETEXT-Style Header1",
            "========",
            "Header1 content line1.",
            "SETEXT-Style Header2",
            "--------",
            "Header2 content line1.");
    runTest(source, "");
  }

  @Test
  public void documentation_normalize_invalidInclusion() {
    String invalidFilePath = TESTDATA_PATH + "/dummy.md";
    String invalidExtension = TESTDATA_PATH + "/invalid.dummy";
    String source =
        createFromLines(
            "Top level line.",
            "# Header1 #",
            "(== include " + invalidExtension + "==)",
            "## Header2.",
            "Header2 content line1.",
            "(== include " + invalidFilePath + "==)");
    runTest(source, "");
  }

  private String createFromLines(String... lines) {
    return NEWLINE_JOINER.join(lines);
  }

  /** Runs the test for normalizing given source and compare the result with baseline result. */
  private void runTest(String source, String docPath) {
    normalizer = new SourceNormalizer(diagReporter, docPath);
    testOutput()
        .println(
            normalizer.process(source, ResolvedLocation.create(SimpleLocation.TOPLEVEL), element));
    for (Diag diag : diagReporter.getDiagCollector().getDiags()) {
      if (diag.getKind() == Kind.ERROR) {
        testOutput().println(DiagUtils.getDiagToPrint(diag, true));
      }
    }
  }
}


text:
package com.android.camera.ui;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapRegionDecoder;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class ZoomView extends ImageView {

    private static final String TAG = "ZoomView";

    private int mViewportWidth = 0;
    private int mViewportHeight = 0;

    private int mFullResImageWidth;
    private int mFullResImageHeight;

    private BitmapRegionDecoder mRegionDecoder;
    private DecodePartialBitmap mPartialDecodingTask;

    private Uri mUri;
    private int mOrientation;

    private class DecodePartialBitmap extends AsyncTask<RectF, Void, Bitmap> {

        @Override
        protected Bitmap doInBackground(RectF... params) {
            RectF endRect = params[0];

            // Calculate the rotation matrix to apply orientation on the original image
            // rect.
            RectF fullResRect = new RectF(0, 0, mFullResImageWidth - 1, mFullResImageHeight - 1);
            Matrix rotationMatrix = new Matrix();
            rotationMatrix.setRotate(mOrientation, 0, 0);
            rotationMatrix.mapRect(fullResRect);
            // Set the translation of the matrix so that after rotation, the top left
            // of the image rect is at (0, 0)
            rotationMatrix.postTranslate(-fullResRect.left, -fullResRect.top);
            rotationMatrix.mapRect(fullResRect, new RectF(0, 0, mFullResImageWidth - 1,
                    mFullResImageHeight - 1));

            // Find intersection with the screen
            RectF visibleRect = new RectF(endRect);
            visibleRect.intersect(0, 0, mViewportWidth - 1, mViewportHeight - 1);
            // Calculate the mapping (i.e. transform) between current low res rect
            // and full res image rect, and apply the mapping on current visible rect
            // to find out the partial region in the full res image that we need
            // to decode.
            Matrix mapping = new Matrix();
            mapping.setRectToRect(endRect, fullResRect, Matrix.ScaleToFit.CENTER);
            RectF visibleAfterRotation = new RectF();
            mapping.mapRect(visibleAfterRotation, visibleRect);

            // Now the visible region we have is rotated, we need to reverse the
            // rotation to find out the region in the original image
            RectF visibleInImage = new RectF();
            Matrix invertRotation = new Matrix();
            rotationMatrix.invert(invertRotation);
            invertRotation.mapRect(visibleInImage, visibleAfterRotation);

            // Decode region
            Rect region = new Rect();
            visibleInImage.round(region);

            // Make sure region to decode is inside the image.
            region.intersect(0, 0, mFullResImageWidth - 1, mFullResImageHeight - 1);

            if (region.width() == 0 || region.height() == 0) {
                Log.e(TAG, "Invalid size for partial region. Region: " + region.toString());
                return null;
            }

            if (isCancelled()) {
                return null;
            }

            BitmapFactory.Options options = new BitmapFactory.Options();

            if ((mOrientation + 360) % 180 == 0) {
                options.inSampleSize = getSampleFactor(region.width(), region.height());
            } else {
                // The decoded region will be rotated 90/270 degrees before showing
                // on screen. In other words, the width and height will be swapped.
                // Therefore, sample factor should be calculated using swapped width
                // and height.
                options.inSampleSize = getSampleFactor(region.height(), region.width());
            }

            if (mRegionDecoder == null) {
                InputStream is = getInputStream();
                try {
                    mRegionDecoder = BitmapRegionDecoder.newInstance(is, false);
                    is.close();
                } catch (IOException e) {
                    Log.e(TAG, "Failed to instantiate region decoder");
                }
            }
            if (mRegionDecoder == null) {
                return null;
            }
            Bitmap b = mRegionDecoder.decodeRegion(region, options);
            if (isCancelled()) {
                return null;
            }
            Matrix rotation = new Matrix();
            rotation.setRotate(mOrientation);
            return Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), rotation, false);
        }

        @Override
        protected void onPostExecute(Bitmap b) {
            if (b == null) {
                return;
            }
            setImageBitmap(b);
            showPartiallyDecodedImage(true);
            mPartialDecodingTask = null;
        }
    }

    public ZoomView(Context context) {
        super(context);
        setScaleType(ScaleType.FIT_CENTER);
        addOnLayoutChangeListener(new OnLayoutChangeListener() {
            @Override
            public void onLayoutChange(View v, int left, int top, int right, int bottom,
                                       int oldLeft, int oldTop, int oldRight, int oldBottom) {
                int w = right - left;
                int h = bottom - top;
                if (mViewportHeight != h || mViewportWidth != w) {
                    mViewportWidth = w;
                    mViewportHeight = h;
                }
            }
        });
    }

    public void loadBitmap(Uri uri, int orientation, RectF imageRect) {
        if (!uri.equals(mUri)) {
            mUri = uri;
            mOrientation = orientation;
            mFullResImageHeight = 0;
            mFullResImageWidth = 0;
            decodeImageSize();
            mRegionDecoder = null;
        }
        startPartialDecodingTask(imageRect);
    }

    private void showPartiallyDecodedImage(boolean show) {
        if (show) {
            setVisibility(View.VISIBLE);
        } else {
            setVisibility(View.GONE);
        }
        mPartialDecodingTask = null;
    }

    public void cancelPartialDecodingTask() {
        if (mPartialDecodingTask != null && !mPartialDecodingTask.isCancelled()) {
            mPartialDecodingTask.cancel(true);
            setVisibility(GONE);
        }
        mPartialDecodingTask = null;
    }

    /**
     * If the given rect is smaller than viewport on x or y axis, center rect within
     * viewport on the corresponding axis. Otherwise, make sure viewport is within
     * the bounds of the rect.
     */
    public static RectF adjustToFitInBounds(RectF rect, int viewportWidth, int viewportHeight) {
        float dx = 0, dy = 0;
        RectF newRect = new RectF(rect);
        if (newRect.width() < viewportWidth) {
            dx = viewportWidth / 2 - (newRect.left + newRect.right) / 2;
        } else {
            if (newRect.left > 0) {
                dx = -newRect.left;
            } else if (newRect.right < viewportWidth) {
                dx = viewportWidth - newRect.right;
            }
        }

        if (newRect.height() < viewportHeight) {
            dy = viewportHeight / 2 - (newRect.top + newRect.bottom) / 2;
        } else {
            if (newRect.top > 0) {
                dy = -newRect.top;
            } else if (newRect.bottom < viewportHeight) {
                dy = viewportHeight - newRect.bottom;
            }
        }

        if (dx != 0 || dy != 0) {
            newRect.offset(dx, dy);
        }
        return newRect;
    }

    private void startPartialDecodingTask(RectF endRect) {
        // Cancel on-going partial decoding tasks
        cancelPartialDecodingTask();
        mPartialDecodingTask = new DecodePartialBitmap();
        mPartialDecodingTask.execute(endRect);
    }

    private void decodeImageSize() {
        BitmapFactory.Options option = new BitmapFactory.Options();
        option.inJustDecodeBounds = true;
        InputStream is = getInputStream();
        BitmapFactory.decodeStream(is, null, option);
        try {
            is.close();
        } catch (IOException e) {
            Log.e(TAG, "Failed to close input stream");
        }
        mFullResImageWidth = option.outWidth;
        mFullResImageHeight = option.outHeight;
    }

    // TODO: Cache the inputstream
    private InputStream getInputStream() {
        InputStream is = null;
        try {
            is = getContext().getContentResolver().openInputStream(mUri);
        } catch (FileNotFoundException e) {
            Log.e(TAG, "File not found at: " + mUri);
        }
        return is;
    }

    /**
     * Find closest sample factor that is power of 2, based on the given width and height
     *
     * @param width width of the partial region to decode
     * @param height height of the partial region to decode
     * @return sample factor
     */
    private int getSampleFactor(int width, int height) {

        float fitWidthScale = ((float) mViewportWidth) / ((float) width);
        float fitHeightScale = ((float) mViewportHeight) / ((float) height);

        float scale = Math.min(fitHeightScale, fitWidthScale);

        // Find the closest sample factor that is power of 2
        int sampleFactor = (int) (1f / scale);
        if (sampleFactor <=1) {
            return 1;
        }
        for (int i = 0; i < 32; i++) {
            if ((1 << (i + 1)) > sampleFactor) {
                sampleFactor = (1 << i);
                break;
            }
        }
        return sampleFactor;
    }
}


text:
package com.crawljax.plugins.testilizer.casestudies.wolfcms.originaltests;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class TestDeletePage {
	private WebDriver driver;
	private String baseUrl;
	private boolean acceptNextAlert = true;
	private StringBuffer verificationErrors = new StringBuffer();

	@Before
	public void setUp() throws Exception {
		driver = new FirefoxDriver();
		baseUrl = "http://localhost/";
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	}

	@Test
	public void testDeletePage() throws Exception {
		driver.get("http://localhost:8888/wolfcms/?/admin");
		assertEquals("Login - Wolf CMS", driver.getTitle());
		driver.findElement(By.id("login-username")).clear();
		driver.findElement(By.id("login-username")).sendKeys("admin");
		driver.findElement(By.id("login-password")).clear();
		driver.findElement(By.id("login-password")).sendKeys("admin");
		driver.findElement(By.xpath("//input[@value='Login']")).click();
		driver.findElement(By.linkText("Pages")).click();
		assertEquals("Pages | Wolf CMS", driver.getTitle());
		//assertEquals("Selenium test page", driver.findElement(By.xpath("//ul[@id='site-map']/li/span/div/span/a[span='Selenium test page']")).getText());

		assertTrue(driver.findElement(By.xpath("//ul[@id='site-map']/li/span/div/span/a/span")).getText()!="");

		//assertTrue(driver.findElement(By.cssSelector("#page_11 > span:nth-child(1) > div:nth-child(1) > span:nth-child(1) > a:nth-child(1) > span:nth-child(2)")).getText()!="");

		//driver.findElement(By.xpath("//ul[@id='site-map']/li/span/div/span/a[span='Selenium test page']/../../../div[@class='modify']/a[@class='remove']")).click();

		driver.findElement(By.cssSelector("img[alt='Remove page']")).click();

		//assertTrue(closeAlertAndGetItsText().matches("^Are you sure you wish to delete [\\s\\S] and its underlying pages[\\s\\S]$"));
		assertTrue(closeAlertAndGetItsText().contains("Are you sure you wish to delete"));
		//Thread.sleep(500);
		//assertEquals("Page Selenium test page has been deleted!", driver.findElement(By.xpath("//div[@class='message']")).getText());
		//assertTrue(isElementPresent(By.xpath("//div[@class='message' and text()='Page Selenium test page has been deleted!']")));
		assertEquals("Pages | Wolf CMS", driver.getTitle());
		//assertFalse(isElementPresent(By.xpath("//ul[@id='site-map']/li/span/div/span/a[span='Selenium test page']")));
	}

	@After
	public void tearDown() throws Exception {
		driver.quit();
		String verificationErrorString = verificationErrors.toString();
		if (!"".equals(verificationErrorString)) {
			fail(verificationErrorString);
		}
	}

	private boolean isElementPresent(By by) {
		try {
			driver.findElement(by);
			return true;
		} catch (NoSuchElementException e) {
			return false;
		}
	}

	private boolean isAlertPresent() {
		try {
			driver.switchTo().alert();
			return true;
		} catch (NoAlertPresentException e) {
			return false;
		}
	}

	private String closeAlertAndGetItsText() {
		try {
			Alert alert = driver.switchTo().alert();
			String alertText = alert.getText();
			if (acceptNextAlert) {
				alert.accept();
			} else {
				alert.dismiss();
			}
			return alertText;
		} finally {
			acceptNextAlert = true;
		}
	}
}


text:
<?php

namespace JamesRezo\WebHelper\WebServer;

use Symfony\Component\Process\Process;
use WebHelper\Parser\ParserInterface;

/**
 * Base class for webserver classes.
 *
 * name can be either apache, nginx, lighttpd, php or other webserver name
 *
 * @author james <james@rezo.net>
 */
abstract class WebServer implements WebServerInterface
{
    /**
     * the name of a webserver.
     *
     * @var string the name of a webserver
     */
    private $name;

    /**
     * the version of a webserver.
     *
     * @var string the version of a webserver
     */
    private $version;

    /**
     * binaries that can be used to control the webserver.
     *
     * @var array
     */
    private $binaries = [];

    /**
     * the parameter string to use to detect version and config file.
     *
     * @var string
     */
    private $detectionParameter = '';

    /**
     * a web config parser.
     *
     * @var ParserInterface
     */
    protected $parser;

    /**
     * Constructor.
     *
     * @param string $name    the name of a webserver
     * @param string $version the version of a webserver
     */
    public function __construct($name, $version = '')
    {
        $this->name = $name;
        $this->version = $version;
    }

    /**
     * Gets the name of a webserver.
     *
     * @return string the name of the webserver
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Gets the version of a webserver.
     *
     * @return string the version of the webserver
     */
    public function getVersion()
    {
        return $this->version;
    }

    /**
     * Gets the list of binaries that can be run to analyze.
     *
     * @return array the list of binaries that can be run
     */
    public function getBinaries()
    {
        return $this->binaries;
    }

    public function setBinaries(array $binaries)
    {
        $this->binaries = $binaries;

        return $this;
    }

    public function setDetectionParameter($parameter = '')
    {
        $this->detectionParameter = $parameter;

        return $this;
    }

    public function getSettings($fullPathBinary)
    {
        $process = new Process($fullPathBinary.$this->detectionParameter);
        $process->run();

        return $process->getOutput();
    }

    abstract public function extractVersion($settings = '');

    abstract public function extractRootConfigurationFile($settings = '');

    /**
     * Finds and return a specific information in a string.
     *
     * the regexp must contain delimiters.
     *
     * @param string $regexp   a regular expression to find
     * @param string $settings a string where to find
     *
     * @return string the found value or an empty string
     */
    protected function match($regexp, $settings)
    {
        $matches = [];

        if (preg_match($regexp, $settings, $matches)) {
            return $matches[1];
        }

        return '';
    }

    /**
     * Loads and cleans a config file.
     *
     * @param string $file a Configuration file
     *
     * @return array an array of the cleaned directives of a the config per entry
     */
    abstract public function getActiveConfig($file = '');
}