text:
import math
import sys

import pygame
from pygame.constants import K_w, K_s
from utils.vec2d import vec2d
from utils import percent_round_int

import base

class Ball(pygame.sprite.Sprite):

    def __init__(self, radius, speed,
                 pos_init, SCREEN_WIDTH, SCREEN_HEIGHT):

        pygame.sprite.Sprite.__init__(self)

        self.radius = radius
        self.speed = speed
        self.pos = vec2d(pos_init)
        self.vel = vec2d((speed, -1.0 * speed))

        self.SCREEN_HEIGHT = SCREEN_HEIGHT
        self.SCREEN_WIDTH = SCREEN_WIDTH

        image = pygame.Surface((radius * 2, radius * 2))
        image.fill((0, 0, 0, 0))
        image.set_colorkey((0, 0, 0))

        pygame.draw.circle(
            image,
            (255, 255, 255),
            (radius, radius),
            radius,
            0
        )

        self.image = image
        self.rect = self.image.get_rect()
        self.rect.center = pos_init

    def update(self, agentPlayer, cpuPlayer, dt):

        if self.pos.y - self.radius <= 0:
            self.vel.y *= -0.99
            self.pos.y += 1.0

        if self.pos.y + self.radius >= self.SCREEN_HEIGHT:
            self.vel.y *= -0.99
            self.pos.y -= 1.0

        if self.pos.x <= agentPlayer.pos.x + agentPlayer.rect_width:
            if pygame.sprite.collide_rect(self, agentPlayer):
                self.vel.x = -1 * (self.vel.x + self.speed * 0.05)
                self.vel.y += agentPlayer.vel.y * 0.01
                self.pos.x += self.radius

        if self.pos.x >= cpuPlayer.pos.x - cpuPlayer.rect_width:
            if pygame.sprite.collide_rect(self, cpuPlayer):
                self.vel.x = -1 * (self.vel.x + self.speed * 0.05)
                self.vel.y += cpuPlayer.vel.y * 0.006
                self.pos.x -= self.radius

        self.pos.x += self.vel.x * dt
        self.pos.y += self.vel.y * dt

        self.rect.center = (self.pos.x, self.pos.y)

class Player(pygame.sprite.Sprite):

    def __init__(self, speed, rect_width, rect_height,
                 pos_init, SCREEN_WIDTH, SCREEN_HEIGHT):

        pygame.sprite.Sprite.__init__(self)

        self.speed = speed
        self.pos = vec2d(pos_init)
        self.vel = vec2d((0, 0))

        self.rect_height = rect_height
        self.rect_width = rect_width
        self.SCREEN_HEIGHT = SCREEN_HEIGHT
        self.SCREEN_WIDTH = SCREEN_WIDTH

        image = pygame.Surface((rect_width, rect_height))
        image.fill((0, 0, 0, 0))
        image.set_colorkey((0, 0, 0))

        pygame.draw.rect(
            image,
            (255, 255, 255),
            (0, 0, rect_width, rect_height),
            0
        )

        self.image = image
        self.rect = self.image.get_rect()
        self.rect.center = pos_init

    def update(self, dy, dt):
        self.vel.y += dy * dt
        self.vel.y *= 0.9

        self.pos.y += self.vel.y

        if self.pos.y - self.rect_height / 2 <= 0:
            self.pos.y = self.rect_height / 2
            self.vel.y = 0.0

        if self.pos.y + self.rect_height / 2 >= self.SCREEN_HEIGHT:
            self.pos.y = self.SCREEN_HEIGHT - self.rect_height / 2
            self.vel.y = 0.0

        self.rect.center = (self.pos.x, self.pos.y)

    def updateCpu(self, ball, dt):
        dy = 0.0
        if ball.vel.x >= 0 and ball.pos.x >= self.SCREEN_WIDTH / 2:
            dy = self.speed
            if self.pos.y > ball.pos.y:
                dy = -1.0 * dy
        else:
            dy = 1.0 * self.speed / 4.0

            if self.pos.y > self.SCREEN_HEIGHT / 2.0:
                dy = -1.0 * self.speed / 4.0

        if self.pos.y - self.rect_height / 2 <= 0:
            self.pos.y = self.rect_height / 2
            self.vel.y = 0.0

        if self.pos.y + self.rect_height / 2 >= self.SCREEN_HEIGHT:
            self.pos.y = self.SCREEN_HEIGHT - self.rect_height / 2
            self.vel.y = 0.0

        self.pos.y += dy * dt
        self.rect.center = (self.pos.x, self.pos.y)

class Pong(base.PyGameWrapper):
    """
    Loosely based on code from marti1125's `pong game`_.

    .. _pong game: https://github.com/marti1125/pong/

    Parameters
    ----------
    width : int
        Screen width.

    height : int
        Screen height, recommended to be same dimension as width.

    MAX_SCORE : int (default: 11)
        The max number of points the agent or cpu need to score to cause a terminal state.

    """

    def __init__(self, width=64, height=48, MAX_SCORE=11):

        actions = {
            "up": K_w,
            "down": K_s
        }

        base.PyGameWrapper.__init__(self, width, height, actions=actions)

        # the %'s come from original values, wanted to keep same ratio when you
        # increase the resolution.
        self.ball_radius = percent_round_int(height, 0.03)
        self.players_speed = 0.22 * height
        self.cpu_speed = 0.7 * height
        self.ball_speed = 0.75 * height
        self.paddle_width = percent_round_int(width, 0.023)
        self.paddle_height = percent_round_int(height, 0.15)
        self.paddle_dist_to_wall = percent_round_int(width, 0.0625)
        self.MAX_SCORE = MAX_SCORE

        self.dy = 0.0
        self.score_sum = 0.0  # need to deal with 11 on either side winning
        self.score_counts = {
            "agent": 0.0,
            "cpu": 0.0
        }

    def _handle_player_events(self):
        self.dy = 0
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                pygame.quit()
                sys.exit()

            if event.type == pygame.KEYDOWN:
                key = event.key
                if key == self.actions['up']:
                    self.dy -= self.players_speed

                if key == self.actions['down']:
                    self.dy += self.players_speed

    def getGameState(self):
        """
        Gets a non-visual state representation of the game.

        Returns
        -------

        dict
            * player y position.
            * players velocity.
            * cpu y position.
            * ball x position.
            * ball y position.
            * ball x velocity.
            * ball y velocity.

            See code for structure.

        """
        state = {
            "player_y": self.agentPlayer.pos.y,
            "player_velocity": self.agentPlayer.vel.y,
            "cpu_y": self.cpuPlayer.pos.y,
            "ball_x": self.ball.pos.x,
            "ball_y": self.ball.pos.y,
            "ball_velocity_x": self.ball.pos.x,
            "ball_velocity_y": self.ball.pos.y
        }

        return state

    def getScore(self):
        return self.score_sum

    def game_over(self):
        # pong used 11 as max score
        return (self.score_counts['agent'] == self.MAX_SCORE) or (
            self.score_counts['cpu'] == self.MAX_SCORE)

    def init(self):
        self.score_counts = {
            "agent": 0.0,
            "cpu": 0.0
        }

        self.score_sum = 0.0
        self.ball = Ball(
            self.ball_radius,
            self.ball_speed,
            (self.width / 2, self.height / 2),
            self.width,
            self.height
        )

        self.agentPlayer = Player(
            self.players_speed,
            self.paddle_width,
            self.paddle_height,
            (self.paddle_dist_to_wall, self.height / 2),
            self.width,
            self.height)

        self.cpuPlayer = Player(
            self.cpu_speed,
            self.paddle_width,
            self.paddle_height,
            (self.width - self.paddle_dist_to_wall, self.height / 2),
            self.width,
            self.height)

        self.players_group = pygame.sprite.Group()
        self.players_group.add(self.agentPlayer)
        self.players_group.add(self.cpuPlayer)

        self.ball_group = pygame.sprite.Group()
        self.ball_group.add(self.ball)

    def _reset_ball(self, direction):
        self.ball.pos.x = self.width / 2  # move it to the center

        # we go in the same direction that they lost in but at starting vel.
        self.ball.vel.x = self.ball_speed * direction
        self.ball.vel.y = (self.rng.random_sample() *
                           self.ball_speed) - self.ball_speed

    def step(self, dt):
        dt /= 1000.0
        self.screen.fill((0, 0, 0))

        self._handle_player_events()

        # doesnt make sense to have this, but include if needed.
        self.score_sum += self.rewards["tick"]

        # logic
        if self.ball.pos.x <= 0:
            self.score_sum += self.rewards["negative"]
            self.score_counts["cpu"] += 1.0
            self._reset_ball(-1)

        if self.ball.pos.x >= self.width:
            self.score_sum += self.rewards["positive"]
            self.score_counts["agent"] += 1.0
            self._reset_ball(1)

        # winning
        if self.score_counts['agent'] == self.MAX_SCORE:
            self.score_sum += self.rewards["win"]

        # losing
        if self.score_counts['cpu'] == self.MAX_SCORE:
            self.score_sum += self.rewards["loss"]

        self.ball.update(self.agentPlayer, self.cpuPlayer, dt)
        self.agentPlayer.update(self.dy, dt)
        self.cpuPlayer.updateCpu(self.ball, dt)

        self.players_group.draw(self.screen)
        self.ball_group.draw(self.screen)

if __name__ == "__main__":
    import numpy as np

    pygame.init()
    game = Pong(width=256, height=200)
    game.screen = pygame.display.set_mode(game.getScreenDims(), 0, 32)
    game.clock = pygame.time.Clock()
    game.rng = np.random.RandomState(24)
    game.init()

    while True:
        dt = game.clock.tick_busy_loop(60)
        game.step(dt)
        pygame.display.update()


text:
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Lesser General Public License as        *
 *   published by the Free Software Foundation; either version 2.1 of the  *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

static int s_socket_bsd_init (void)
{
	return 0;
}

static int s_socket_bsd_uninit (void)
{
	return 0;
}

static int s_socket_bsd_poll (struct pollfd *ufds, nfds_t nfds, int timeout)
{
	return s_pipe_api_poll(ufds, nfds, timeout);
}

static int s_socket_bsd_recv (int s, void *read_buf, int total_size)
{
	int r = 0;
	int r_size = 0;
	while (total_size != r_size) {
		r = recv(s, read_buf + r_size, total_size - r_size, MSG_NOSIGNAL);
		if (r <= 0) {
			s_socket_api_close(s);
			return -1;
		}
		r_size += r;
	}
	return r_size;
}

static int s_socket_bsd_send (int s, void *write_buf, int total_size)
{
	int w = 0;
	int w_size = 0;
	while (total_size != w_size) {
		w = send(s, write_buf + w_size, total_size - w_size, MSG_NOSIGNAL);
		if (w <= 0) {
			s_socket_api_close(s);
			return -1;
		}
		w_size += w;
	}
	return w_size;
}

static int s_socket_bsd_socket (int domain, int type, int protocol)
{
	return socket(domain, type, protocol);
}

static int s_socket_bsd_bind (int sockfd, const s_sockaddr_t *my_addr, socklen_t addrlen)
{
	unsigned int yes = 1;
	if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) {
		debugf(DSER | DSYS, "Reusing ADDR failed");
		return -1;
	}
	return bind(sockfd, my_addr, addrlen);
}

static int s_socket_bsd_listen (int s, int backlog)
{
	return listen(s, backlog);
}

static int s_socket_bsd_accept (int s, s_sockaddr_t *addr, socklen_t *addrlen)
{
#define TCP_NODELAY     0x0001
	int off = 0;
	int s = accept(s, addr, addrlen);
	setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &off, sizeof(off));
	return s;
}

static int s_socket_bsd_connect (int sockfd, const s_sockaddr_t *serv_addr, socklen_t addrlen)
{
	int ret = connect(sockfd, serv_addr, addrlen);
	//printf("s_socket_bsd_connect retval= %d..",ret);
	return ret;
}

static int s_socket_bsd_close (int fd)
{
	shutdown(fd, SHUT_RDWR);
	close(fd);
	return 0;
}

static s_socket_api_t s_socket_api_bsd = {
	s_socket_bsd_init,
	s_socket_bsd_uninit,
	s_socket_bsd_poll,
	s_socket_bsd_recv,
	s_socket_bsd_send,
	s_socket_bsd_socket,
	s_socket_bsd_bind,
	s_socket_bsd_listen,
	s_socket_bsd_accept,
	s_socket_bsd_connect,
	s_socket_bsd_close
};

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="#ddffffff" android:state_activated="true" />
    <item android:color="#ddffffff" />
</selector>


text:
"""This code example gets all active content categorized as a "comedy" using the
network's content browse custom targeting key.

This feature is only available to DFP video publishers.

The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information"
section of our README.

"""

# Import appropriate modules from the client library.
from googleads import dfp

def main(client):
  # Initialize appropriate service.
  content_service = client.GetService('ContentService', version='v201508')
  network_service = client.GetService('NetworkService', version='v201508')
  custom_targeting_service = client.GetService(
      'CustomTargetingService', version='v201508')

  # Get the network's content browse custom targeting key.
  network = network_service.getCurrentNetwork()
  key_id = network['contentBrowseCustomTargetingKeyId']

  # Create a statement to select the categories matching the name comedy.
  values = [
      {
          'key': 'contentBrowseCustomTargetingKeyId',
          'value': {
              'xsi_type': 'NumberValue',
              'value': key_id
          }
      },
      {
          'key': 'category',
          'value': {
              'xsi_type': 'TextValue',
              'value': 'comedy'
          }
      }
  ]
  category_filter_query = ('WHERE customTargetingKeyId = '
                           ':contentBrowseCustomTargetingKeyId and name = '
                           ':category')
  category_filter_statement = dfp.FilterStatement(
      category_filter_query, values, 1)

  # Get categories matching the filter statement.
  response = custom_targeting_service.getCustomTargetingValuesByStatement(
      category_filter_statement.ToStatement())

  # Get the custom targeting value ID for the comedy category.
  if 'results' in response:
    category_custom_targeting_value_id = (response['results']['id'])

    # Create a statement to select the active content.
    content_values = [
        {
            'key': 'status',
            'value': {
                'xsi_type': 'TextValue',
                'value': 'ACTIVE'
            }
        }
    ]
    content_query = 'WHERE status = :status'
    content_statement = dfp.FilterStatement(content_query, content_values)

    while True:
      # Get the content by statement and custom targeting value.
      response = content_service.getContentByStatementAndCustomTargetingValue(
          content_statement.ToStatement(),
          category_custom_targeting_value_id)
      if 'results' in response:
        # Display results.
        for content_item in response['results']:
          print ('Content with id \'%s\', name \'%s\', and status \'%s\' was '
                 'found.' % (content_item['id'], content_item['name'],
                             content_item['status']))
        content_statement.offset += dfp.SUGGESTED_PAGE_LIMIT
      else:
        break

    print '\nNumber of results found: %s' % response['totalResultSetSize']

if __name__ == '__main__':
  # Initialize client object.
  dfp_client = dfp.DfpClient.LoadFromStorage()
  main(dfp_client)


text:
.ui-overlaypanel {
    padding: 0;
    margin: 0;
    position: absolute;
}

.ui-overlaypanel-content {
    padding: 0.5em 1em;
}

.ui-overlaypanel-close {
    position: absolute;
    top: -1em;
    right: -1em;
    width: 2em;
    height: 2em;
    line-height: 2em;
    text-align: center;
    -moz-border-radius: 100%;
    -webkit-border-radius: 100%;
    border-radius: 100%;
}

.ui-overlaypanel-close-icon {
    line-height: inherit;
}


text:
package com.hazelcast.internal.nio.tcp;

import com.hazelcast.client.impl.protocol.util.ClientMessageEncoder;
import com.hazelcast.instance.EndpointQualifier;
import com.hazelcast.internal.networking.OutboundHandler;
import com.hazelcast.internal.networking.HandlerStatus;
import com.hazelcast.internal.nio.IOService;
import com.hazelcast.internal.nio.ascii.TextEncoder;
import com.hazelcast.spi.properties.HazelcastProperties;

import java.nio.ByteBuffer;

import static com.hazelcast.internal.networking.ChannelOption.SO_SNDBUF;
import static com.hazelcast.internal.networking.HandlerStatus.CLEAN;
import static com.hazelcast.internal.networking.HandlerStatus.DIRTY;
import static com.hazelcast.internal.nio.IOService.KILO_BYTE;
import static com.hazelcast.internal.nio.IOUtil.compactOrClear;
import static com.hazelcast.internal.nio.Protocols.CLIENT_BINARY;
import static com.hazelcast.internal.nio.Protocols.CLUSTER;
import static com.hazelcast.internal.nio.Protocols.PROTOCOL_LENGTH;
import static com.hazelcast.internal.nio.ascii.TextEncoder.TEXT_ENCODER;
import static com.hazelcast.spi.properties.ClusterProperty.SOCKET_CLIENT_SEND_BUFFER_SIZE;
import static com.hazelcast.spi.properties.ClusterProperty.SOCKET_SEND_BUFFER_SIZE;
import static com.hazelcast.internal.util.StringUtil.stringToBytes;

/**
 * The ProtocolEncoder is responsible for writing the protocol and once the protocol
 * has been written, the ProtocolEncoder is replaced by the appropriate handler.
 *
 * The ProtocolEncoder and the 'client' side of a member connection, will always
 * write the cluster protocol immediately. The ProtocolEncoder on the 'server' side
 * of the connection will wait till it has received the protocol and then will only
 * send the protocol if the client side was a member.
 */
public class UnifiedProtocolEncoder
        extends OutboundHandler<Void, ByteBuffer> {

    private final IOService ioService;
    private final HazelcastProperties props;
    private volatile String inboundProtocol;
    private boolean clusterProtocolBuffered;

    public UnifiedProtocolEncoder(IOService ioService) {
        this.ioService = ioService;
        this.props = ioService.properties();
    }

    @Override
    public void handlerAdded() {
        initDstBuffer(PROTOCOL_LENGTH);

        if (channel.isClientMode()) {
            // from the clientSide of a connection, we always send the cluster protocol to a fellow member.
            inboundProtocol = CLUSTER;
        }
    }

    /**
     * Signals the ProtocolEncoder that the protocol is known. This call will be
     * made by the ProtocolDecoder as soon as it knows the inbound protocol.
     *
     * @param inboundProtocol
     */
    void signalProtocolEstablished(String inboundProtocol) {
        assert !channel.isClientMode() : "Signal protocol should only be made on channel in serverMode";
        this.inboundProtocol = inboundProtocol;
        channel.outboundPipeline().wakeup();
    }

    @Override
    public HandlerStatus onWrite() {
        compactOrClear(dst);

        try {
            if (inboundProtocol == null) {
                // deal with spurious calls; the protocol to send isn't known yet.
                return CLEAN;
            }

            if (CLUSTER.equals(inboundProtocol)) {
                // in case of a member, the cluster protocol needs to be send first before initializing the channel.

                if (!clusterProtocolBuffered) {
                    clusterProtocolBuffered = true;
                    dst.put(stringToBytes(CLUSTER));
                    // Return false because ProtocolEncoder is not ready yet; but first we need to flush protocol
                    return DIRTY;
                }

                if (!isProtocolBufferDrained()) {
                    // Return false because ProtocolEncoder is not ready yet; but first we need to flush protocol
                    return DIRTY;
                }

                initChannelForCluster();
            } else if (CLIENT_BINARY.equals(inboundProtocol)) {
                // in case of a client, the member will not send the member protocol
                initChannelForClient();
            } else {
                // in case of a text-client, the member will not send the member protocol
                initChannelForText();
            }

            return CLEAN;
        } finally {
            dst.flip();
        }
    }

    /**
     * Checks if the protocol bytes have been drained.
     *
     * The protocol buffer is in write mode, so if position is 0, the protocol
     * buffer has been drained.
     *
     * @return true if the protocol buffer has been drained.
     */
    private boolean isProtocolBufferDrained() {
        return dst.position() == 0;
    }

    private void initChannelForCluster() {
        channel.options()
                .setOption(SO_SNDBUF, props.getInteger(SOCKET_SEND_BUFFER_SIZE) * KILO_BYTE);

        TcpIpConnection connection = (TcpIpConnection) channel.attributeMap().get(TcpIpConnection.class);
        OutboundHandler[] handlers = ioService.createOutboundHandlers(EndpointQualifier.MEMBER, connection);
        channel.outboundPipeline().replace(this, handlers);
    }

    private void initChannelForClient() {
        channel.options()
                .setOption(SO_SNDBUF, clientSndBuf());

        channel.outboundPipeline().replace(this, new ClientMessageEncoder());
    }

    private void initChannelForText() {
        channel.options()
                .setOption(SO_SNDBUF, clientSndBuf());

        TextEncoder encoder = (TextEncoder) channel.attributeMap().remove(TEXT_ENCODER);
        channel.outboundPipeline().replace(this, encoder);
    }

    private int clientSndBuf() {
        int sndBuf = props.getInteger(SOCKET_CLIENT_SEND_BUFFER_SIZE);
        if (sndBuf == -1) {
            sndBuf = props.getInteger(SOCKET_SEND_BUFFER_SIZE);
        }
        return sndBuf * KILO_BYTE;
    }
}


text:
namespace AIFH_Vol3.Core.Learning
{
    /// <summary>
    ///     This interface defines a Machine Learning Method.  A MLMethod is an
    ///     algorithm that accepts data and provides some sort of insight into it.
    ///     This could be a neural network, support vector machine, clustering
    ///     algorithm, or something else entirely.
    /// </summary>
    public interface IMLMethod
    {
        /// <summary>
        ///     The long term memory for the algorithm.  This is usually weights or other coefficients.
        /// </summary>
        double[] LongTermMemory { get; }
    }
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
        <link rel="stylesheet" href="assets/css/style.css">
        <link rel="stylesheet" href="assets/css/normalize.css">

 All Events

 Communities

 About

 Login

 Register

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

                            <input type="text" class="form-control" placeholder="Search events">

                    </form>

Community

@2014 Flipbox Studio


text:
using System;
using static System.Console;

namespace hwappwincli
{
    public class MainCls
    {
        public static void Main(string[] args)
        {
            ForegroundColor = ConsoleColor.Cyan;

            WriteLine("Hello World! \nFrom Windows .Net CLI.");

            WriteLine("\n\nPress any key ....");
            ReadLine();
        }
    }

}


text:
package tk.mybatis.mapper.annotation;

import org.apache.ibatis.mapping.ResultMap;
import org.apache.ibatis.mapping.ResultMapping;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.type.StringTypeHandler;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import tk.mybatis.mapper.code.Style;
import tk.mybatis.mapper.entity.Config;
import tk.mybatis.mapper.entity.EntityColumn;
import tk.mybatis.mapper.entity.EntityTable;
import tk.mybatis.mapper.mapperhelper.EntityHelper;

import javax.persistence.Column;
import java.util.Set;

/**
 * @author liuzh
 */
public class ColumnTest {

    private Config config;

    private Configuration configuration;

    @Before
    public void beforeTest(){
        config = new Config();
        config.setStyle(Style.normal);

        configuration = new Configuration();
    }

    class UserColumn {
        @Column(name = "user_name")
        private String name;
    }

    @Test
    public void testColumn(){
        EntityHelper.initEntityNameMap(UserColumn.class, config);
        EntityTable entityTable = EntityHelper.getEntityTable(UserColumn.class);
        Assert.assertNotNull(entityTable);

        Set<EntityColumn> columns = entityTable.getEntityClassColumns();
        Assert.assertEquals(1, columns.size());

        for (EntityColumn column : columns) {
            Assert.assertEquals("user_name", column.getColumn());
            Assert.assertEquals("name", column.getProperty());

            Assert.assertEquals("user_name = #{name}", column.getColumnEqualsHolder());
            Assert.assertEquals("user_name = #{record.name}", column.getColumnEqualsHolder("record"));
            Assert.assertEquals("#{name}", column.getColumnHolder());
            Assert.assertEquals("#{record.name}", column.getColumnHolder("record"));
            Assert.assertEquals("#{record.name}", column.getColumnHolder("record", "suffix"));
            Assert.assertEquals("#{record.namesuffix},", column.getColumnHolder("record", "suffix", ","));
            Assert.assertNull(column.getTypeHandler());
        }

        ResultMap resultMap = entityTable.getResultMap(configuration);
        Assert.assertEquals("[USER_NAME]", resultMap.getMappedColumns().toString());

        Assert.assertEquals(1, resultMap.getResultMappings().size());

        ResultMapping resultMapping = resultMap.getResultMappings().get(0);
        Assert.assertEquals("user_name", resultMapping.getColumn());
        Assert.assertEquals("name", resultMapping.getProperty());
        Assert.assertNull(resultMapping.getJdbcType());
        Assert.assertEquals(StringTypeHandler.class, resultMapping.getTypeHandler().getClass());
    }

}


text:
package de.greenrobot.performance.activeandroid;

import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;

/**
 * Simple entity with a string property that is indexed.
 */
@Table(name = "INDEXED_STRING_ENTITY")
public class IndexedStringEntity extends Model {

    @Column(name = "INDEXED_STRING", index =  true)
    public String indexedString;

}


text: raise NotImplementedError("UserString is not yet implemented in Skulpt")


text:
'use strict';

var gaze = require('../lib/gaze.js');
var grunt = require('grunt');
var path = require('path');
var helper = require('./helper');

var fixtures = path.resolve(__dirname, 'fixtures');
var sortobj = helper.sortobj;

function cleanUp (done) {
  [
    'newfolder',
  ].forEach(function (d) {
    var p = path.join(fixtures, d);
    if (grunt.file.exists(p)) {
      grunt.file.delete(p);
    }
  });
  done();
}

exports.matching = {
  setUp: function (done) {
    process.chdir(fixtures);
    cleanUp(done);
  },
  tearDown: cleanUp,
  globAll: function (test) {
    test.expect(2);
    gaze('**/*', {nosort:true}, function () {
      var result = this.relative(null, true);
      helper.deepEqual(test, result['.'], ['Project (LO)/', 'nested/', 'one.js', 'sub/']);
      helper.deepEqual(test, result['sub/'], ['one.js', 'two.js']);
      this.on('end', test.done);
      this.close();
    });
  },
  relativeDir: function (test) {
    test.expect(1);
    gaze('**/*', function () {
      test.deepEqual(this.relative('sub', true), ['one.js', 'two.js']);
      this.on('end', test.done);
      this.close();
    });
  },
  globArray: function (test) {
    test.expect(2);
    gaze(['*.js', 'sub/*.js'], function () {
      var result = this.relative(null, true);
      test.deepEqual(sortobj(result['.']), sortobj(['one.js', 'Project (LO)/', 'nested/', 'sub/']));
      test.deepEqual(sortobj(result['sub/']), sortobj(['one.js', 'two.js']));
      this.on('end', test.done);
      this.close();
    });
  },
  globArrayDot: function (test) {
    test.expect(1);
    gaze(['./sub/*.js'], function () {
      var result = this.relative(null, true);
      test.deepEqual(result['sub/'], ['one.js', 'two.js']);
      this.on('end', test.done);
      this.close();
    });
  },
  oddName: function (test) {
    test.expect(1);
    gaze(['Project (LO)/*.js'], function () {
      var result = this.relative(null, true);
      test.deepEqual(result['Project (LO)/'], ['one.js']);
      this.on('end', test.done);
      this.close();
    });
  },
  addedLater: function (test) {
    test.expect(2);
    var times = 0;
    gaze('**/*.js', function (err, watcher) {
      watcher.on('all', function (status, filepath) {
        times++;
        var result = watcher.relative(null, true);
        test.deepEqual(result['newfolder/'], ['added.js']);
        if (times > 1) { watcher.close(); }
      });
      grunt.file.write(path.join(fixtures, 'newfolder', 'added.js'), 'var added = true;');
      setTimeout(function () {
        grunt.file.write(path.join(fixtures, 'newfolder', 'added.js'), 'var added = true;');
      }, 1000);
      watcher.on('end', function () {
        // TODO: Figure out why this test is finicky leaking it's newfolder into the other tests
        setTimeout(test.done, 2000);
      });
    });
  },
};


text:
<?php

namespace Protimbre\TamponBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Session\Session;

use Protimbre\TamponBundle\Entity\Tampon;
use Protimbre\TamponBundle\Form\TamponType;

/**
 * Tampon controller.
 *
 */
class TamponController extends Controller
{

    /**
     * Lists all Tampon entities.
     *
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('ProtimbreTamponBundle:Tampon')->findAll();

        return $this->render('ProtimbreTamponBundle:Tampon:index.html.twig', array(
            'entities' => $entities,
        ));
    }

    public function persoAction($id, Request $request)
    {
        $em      = $this->getDoctrine()->getManager();
        $rTampon = $em->getRepository('ProtimbreTamponBundle:Tampon');
        $modeles = $rTampon->findAll();
        $session = $this->getRequest()->getSession();

        $entite     = $rTampon->find($id);
        $tamponTest = $rTampon->findOneByNom('test');

        if(!is_object($entite) && !is_object($tamponTest)){
            $nTampon = new Tampon();
            $nTampon->setNom('test')
                    ->setLignes(4)
                    ->setLargeur(20)
                    ->setHauteur(20);

            $em->persist($nTampon);

            $em->flush();

            $entite = $nTampon;
        }elseif(!is_object($entite) && is_object($tamponTest)){
            $entite = $tamponTest;
        }

        $form = $this->formulaire();
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            if($form->get('envoiLogo')->isClicked()){
                // On envoie le logo et on enregistre les entrées déjà rentrées.
                $session = new Session();

                $data = $form->getData();

                $file = $data["logo"];
                if(isset($file)){
                    $extension = $file->guessExtension();
                    if (!$extension) {
                        $extension = 'bin';
                    }
                }

                if($data['email'] == ''){
                    $retour = array(
                        'succes'  => true,
                        'img'     => $dir.'/'.$identifiant. '/' . $identifiant . $nbImages . '.' . $extension,
                        'message' => 'Veuillez rentrer un email valable au préalable.'
                    );
                }else {
                    $email = explode('@', $data['email']);

                    $identifiant = $email[0];

                    $extensionsAutorisees = array('jpg', 'jpeg', 'bmp', 'png');

                    if(in_array($extension, $extensionsAutorisees)){

                        if(filesize($file) <= 2097152){
                            $dir = $this->getRequest()->server->get('DOCUMENT_ROOT') . 'Protimbre/web/upload/';
                            //var_dump($dir); exit();

                            if(!is_dir($dir.'/'.$identifiant)){
                                mkdir($dir.'/'.$identifiant);
                            }

                            if ($handle = opendir($dir.'/'.$identifiant)) {
                                /* Ceci est la façon correcte de traverser un dossier. */
                                while (false !== ($entry = readdir($handle))) {
                                    if(!isset($nbImages)){
                                        $nbImages = 1;
                                    }else{
                                        $nbImages++;
                                    }
                                }

                                $nbImages--;

                                closedir($handle);
                            }
                            $file->move($dir.'/'.$identifiant, $identifiant . $nbImages . '.' . $extension);

                            $this->get('session')->set('succes', true);
                            $this->get('session')->set('img', '/Protimbre/web/upload/' . $identifiant . '/' . $identifiant . $nbImages . '.' . $extension);
                            $this->get('session')->getFlashBag()->add(
                                'notice',
                                'Votre logo a bien été sauvegardé.'
                            );
                        }else {
                            $session->set('succes', false);
                            $this->get('session')->getFlashBag()->add(
                                'notice',
                                'Le fichier que vous avez rentré est trop volumineux, il ne doit pas dépasser 2Mo.'
                            );
                        }
                    }else{
                        $session->set('succes', false);
                        $this->get('session')->getFlashBag()->add(
                            'notice',
                            'Le fichier que vous avez rentré n\'est pas une image. (images autorisées : jpg, jpeg, bmp, png)'
                        );
                    }
                }
            }else if($form->get('envoi')->isClicked()){
                // On envoie le formulaire final

            }
        }

        $tLigne = array();
        $fLigne = array();
        $formLigne = array();

        for($i = 1; $i <= $entite->getLignes(); $i++){
            $tLigne[$i] = '#form_ligne'.$i;
            $fLigne[$i] = 'ligne'.$i;
            $formLigne[$i] = array(
                    0 => "form.ligne".$i,
                    1 => "form.italique_".$i,
                    2 => "form.taille_".$i,
                );
        }

        return $this->render('ProtimbreTamponBundle:Tampon:perso.html.twig', array(
            'modeles'   => $modeles,
            'entite'    => $entite,
            'form'      => $form->createView(),
            'tLigne'    => $tLigne,
            'fLigne'    => $fLigne,
            'formLigne' => $formLigne,
            'logo'      => $session->get('logo'),
        ));
    }

    public function formulaire(){
        $tTailles = array();
        for($i = 7; $i <= 18; $i++){
            $tTailles[$i] = $i;
        }

        $defaultData = array('message' => 'defaut');
        $formBuilder = $this->createFormBuilder($defaultData)
                ->setAction($this->generateUrl('tampon_perso'))
                ->add('email', 'email', array(
                    'label'    => 'Email de votre commande',
                    'required' => true,
                    'attr'     => array('class' => 'in_email'),
                ))
                ->add('police', 'choice', array(
                    'label'    => 'Caractère de votre tampon',
                    'choices'  => array(
                            'arial'      => 'Arial',
                            'comic'      => 'Comic',
                            'coperplate' => 'Coperplate',
                            'kaufmann'   => 'Kaufmann',
                            'calisto'    => 'Calisto',
                        ),
                    'required' => true,
                    'attr'     => array('class' => 'in_police'),
                ))
                ->add('nombre', 'number', array(
                    'label' => 'Nombre de tampon pour ce texte :',
                    'data'  => 1,
                    'attr'  => array('class' => 'in_nombre'),
                ))
                ;

        for($i = 1; $i <= 10; $i++){
            $numero = 'ligne' . $i;
            $placeholder = 'texte de la ligne ' . $i;
            $formBuilder
                ->add($numero, 'text', array(
                    'attr'     => array('placeholder' => $placeholder),
                    'label'    => 'ligne ' . $i,
                    'attr'     => array('class' => 'in_ligne'),
                    'required' => false,
                ))
                ->add('italique_'.$i, 'checkbox', array(
                    'label'    => 'italique',
                    'attr'     => array('class' => 'italique'),
                    'required' => false,
                ))
                ->add('taille_'.$i, 'choice', array(
                    'label'             => 'Taille',
                    'choices'           => $tTailles,
                    'preferred_choices' => array('10'),
                    'attr'              => array('class' => 'taille'),
                ));
        }
        $formBuilder
            ->add('couleurBoitier', 'choice', array(
                'label'    => 'Couleur du boitier',
                'choices'  => array(
                        'bleu'  => 'bleu',
                        'gris'  => 'gris',
                        'rouge' => 'rouge',
                    ),
                'required' => true,
                'attr'     => array('class' => 'in_couleurboitier'),
            ))
            ->add('couleurEncre', 'choice', array(
                'label'    => 'Couleur du boitier',
                'choices'  => array(
                        'noir'   => 'noir',
                        'bleu'   => 'bleu',
                        'rouge'  => 'rouge',
                        'vert'   => 'vert',
                        'violet' => 'violet',
                    ),
                'required' => true,
                'attr'     => array('class' => 'in_couleurencre'),
            ));

        $formBuilder
            ->add('logo', 'file', array(
                'label'    => 'Insérer votre logo (Entrez au préalable votre adresse mail)',
                'required' => false,
            ))
            ->add('envoi', 'submit', array(
            	'label' => 'Envoyer votre tampon',
                'attr'  => array('class' => 'btn btn-success'),
            	))
            ->add('envoiLogo', 'submit', array(
            	'label' => 'Envoyer votre logo',
                'attr'  => array('class' => 'btn btn-success'),
            	));

        return $formBuilder->getForm();
    }

    public function formulaireLogo(){

        $defaultData = array('message' => 'defaut');
        $formBuilder = $this->createFormBuilder($defaultData)
                ->add('copieEmail', 'hidden', array(
                    'data' => '',
                    'attr' => array('class' => 'copieEmail'),
                ))
                ->add('logo', 'file', array(
                    'label'    => 'Insérer votre logo (Entrez au préalable votre adresse mail)',
                    'required' => false,
                ))
                ->add('Envoyer', 'button');

        return $formBuilder->getForm();
    }

    /**
     * Creates a new Tampon entity.
     *
     */
    public function createAction(Request $request)
    {
        $entity  = new Tampon();
        $form = $this->createForm(new TamponType(), $entity);
        $form->bind($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('tampon_show', array('id' => $entity->getId())));
        }

        return $this->render('ProtimbreTamponBundle:Tampon:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
        ));
    }

    /**
     * Displays a form to create a new Tampon entity.
     *
     */
    public function newAction()
    {
        $entity = new Tampon();
        $form   = $this->createForm(new TamponType(), $entity);

        return $this->render('ProtimbreTamponBundle:Tampon:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
        ));
    }

    /**
     * Finds and displays a Tampon entity.
     *
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('ProtimbreTamponBundle:Tampon')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Tampon entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return $this->render('ProtimbreTamponBundle:Tampon:show.html.twig', array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),        ));
    }

    /**
     * Displays a form to edit an existing Tampon entity.
     *
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('ProtimbreTamponBundle:Tampon')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Tampon entity.');
        }

        $editForm = $this->createForm(new TamponType(), $entity);
        $deleteForm = $this->createDeleteForm($id);

        return $this->render('ProtimbreTamponBundle:Tampon:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Edits an existing Tampon entity.
     *
     */
    public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('ProtimbreTamponBundle:Tampon')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Tampon entity.');
        }

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createForm(new TamponType(), $entity);
        $editForm->bind($request);

        if ($editForm->isValid()) {
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('tampon_edit', array('id' => $id)));
        }

        return $this->render('ProtimbreTamponBundle:Tampon:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }
    /**
     * Deletes a Tampon entity.
     *
     */
    public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->bind($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('ProtimbreTamponBundle:Tampon')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Tampon entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('tampon'));
    }

    /**
     * Creates a form to delete a Tampon entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm($id)
    {
        return $this->createFormBuilder(array('id' => $id))
            ->add('id', 'hidden')
            ->getForm()
        ;
    }

    public function logoAction(Request $request){

        $form = $this->formulaireLogo();

        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $data = $form->getData();

            $file = $data["logo"];
            $extension = $file->guessExtension();
            if (!$extension) {
                $extension = 'bin';
            }

            if($data['copieEmail'] == ''){
                $retour = array(
                    'succes'  => true,
                    'img'     => $dir.'/'.$identifiant. '/' . $identifiant . $nbImages . '.' . $extension,
                    'message' => 'Veuillez rentrer un email valable au préalable.'
                );
            }else {
                $email = explode('@', $data['copieEmail']);

	            $identifiant = $email[0];

	            $extensionsAutorisees = array('jpg', 'jpeg', 'bmp', 'png');

	            if(in_array($extension, $extensionsAutorisees)){
	                if(filesize($file) <= 2097152){
	                    $dir = $this->get('kernel')->getRootDir() . '/../web/upload' . $this->getRequest()->getBasePath();

	                    if(mkdir($dir.'/'.$identifiant)){
	                        if ($handle = opendir($dir.'/'.$identifiant)) {
	                            /* Ceci est la façon correcte de traverser un dossier. */
	                            while (false !== ($entry = readdir($handle))) {
	                                if(!isset($nbImages)){
	                                    $nbImages = 1;
	                                }else{
	                                    $nbImages++;
	                                }
	                            }

	                            $nbImages++;

	                            closedir($handle);
	                        }
	                        $file->move($dir.'/'.$identifiant, $identifiant . $nbImages . '.' . $extension);

	                        $retour = array(
		                        'succes'  => true,
		                        'img'     => $dir.'/'.$identifiant. '/' . $identifiant . $nbImages . '.' . $extension,
		                        'message' => 'Votre logo a bien été sauvegardé.'
	                        );
	                    }
	                }else {
	                    $retour = array(
	                        'succes'  => false,
	                        'img'     => '',
	                        'message' => 'Le fichier que vous avez rentré est trop volumineux, il ne doit pas dépasser 2Mo.'
	                	);
	                }
	            }else{
	                $retour = array(
	                    'succes'  => false,
	                    'img'     => '',
	                    'message' => 'Le fichier que vous avez rentré n\'est pas une image.'
	                );

	            }
	    	}
	        if(!isset($retour)){
		        $retour = array(
				    'succes'  => false,
				    'img'     => '',
				    'message' => 'Une erreur s\'est produite lors de la soumission de votre image.'
		        );
	        }
	    }
        $response = new Response(json_encode($retour));
        $response->headers->set('Content-Type', 'application/json');

        return $response;
    }
}


text:
class AddDownloadTimeToAssets < ActiveRecord::Migration
  def self.up
    add_column :assets, :download_time, :datetime
  end

  def self.down
    remove_column :assets, :download_time
  end
end


text:
package net.dzikoysk.ups.modules.required.network.protocol.clientbound.status;

import net.dzikoysk.ups.modules.required.network.protocol.ProtocolSpecification;
import net.dzikoysk.ups.network.protocol.ProtocolState;
import net.dzikoysk.ups.network.protocol.*;
import net.dzikoysk.ups.network.protocol.PacketInfo.ClientboundConstructor;

@PacketInfo(state = ProtocolState.STATUS, id = ProtocolSpecification.PONG_CLIENTBOUND_PACKET, bound = ProtocolBound.CLIENT)
public class PongClientboundPacket extends Packet {

    private long payload;

    @ClientboundConstructor
    public PongClientboundPacket(long payload) {
        this.payload = payload;
    }

    @Override
    public void send(PacketSerializer serializer) {
        serializer.writeLong(payload);
    }

    @Override
    public void receive(PacketSerializer serializer) {
        this.payload = serializer.readLong();
    }

    @Override
    public int getPacketSize() {
        return ProtocolSizer.LONG;
    }

    public long getPayload() {
        return payload;
    }

}


text:
Bitcore Node has a service module system that can start up additional services that can include additional:
- Blockchain indexes (e.g. querying balances for addresses)
- API methods
- HTTP routes
- Event types to publish and subscribe

The `bitcore-node.json` file describes which services will load for a node:

```json
{
  "services": [
    "bitcoind", "web"
  ]
}
```

Services correspond with a Node.js module as described in 'package.json', for example:

```json
{
  "dependencies": {
    "bitcore-lib": "^0.13.7",
    "bitcore-node": "^0.2.0",
    "insight-api": "^3.0.0"
  }
}
```

_Note:_ If you already have a bitcore-node database, and you want to query data from previous blocks in the blockchain, you will need to reindex. Reindexing right now means deleting your bitcore-node database and resyncing.

## Using Services Programmatically
If, instead, you would like to run a custom node, you can include services by including them in your configuration object when initializing a new node.

```js
//Require bitcore
var bitcore = require('bitcore-node');

//Services
var Bitcoin = bitcore.services.Bitcoin;
var Web = bitcore.services.Web;

var myNode = new bitcore.Node({
  network: 'regtest'
  services: [
    {
      name: 'bitcoind',
      module: Bitcoin,
      config: {
        spawn: {
          datadir: '/home/<username>/.bitcoin',
          exec: '/home/<username>/bitcore-node/bin/bitcoind'
        }
      }
    },
    {
      name: 'web',
      module: Web,
      config: {
        port: 3001
      }
    }
  ]
});
```

Now that you've loaded your services you can access them via `myNode.services.<service-name>.<method-name>`. For example if you wanted to check the balance of an address, you could access the address service like so.

```js
myNode.services.bitcoind.getAddressBalance('1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v', false, function(err, total) {
  console.log(total.balance); //Satoshi amount of this address
});
```

## Writing a Service
A new service can be created by inheriting from `Node.Service` and implementing these methods and properties:
- `Service.dependencies` -  An array of services that are needed, this will determine the order that services are started on the node.
- `Service.prototype.start()` - Called to start up the service.
- `Service.prototype.stop()` - Called to stop the service.
- `Service.prototype.blockHandler()` - Will be called when a block is added or removed from the chain, and is useful for updating a database view/index.
- `Service.prototype.getAPIMethods()` - Describes which API methods that this service includes, these methods can then be called over the JSON-RPC API, as well as the command-line utility.
- `Service.prototype.getPublishEvents()` - Describes which events can be subscribed to for this service, useful to subscribe to events over the included web socket API.
- `Service.prototype.setupRoutes()` - A service can extend HTTP routes on an express application by implementing this method.

The `package.json` for the service module can either export the `Node.Service` directly, or specify a specific module to load by including `"bitcoreNode": "lib/bitcore-node.js"`.

Please take a look at some of the existing services for implementation specifics.


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="MissingPrefix"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <ListView
        android:id="@+id/listview"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:dividerHeight="0dp"
        android:divider="@android:color/transparent"
        android:listSelector="@android:color/transparent"/>

    <ProgressBar
        android:id="@+id/progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_margin="@dimen/content_margin"
        android:visibility="gone"
        style="?android:attr/progressBarStyle"/>

</RelativeLayout>


text:
package com.amee.platform.resource.tag;

import com.amee.base.validation.BaseValidator;
import com.amee.domain.tag.Tag;

import java.util.HashSet;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.validation.Validator;

@Service
@Scope("prototype")
public class TagValidationHelper extends BaseValidator {

    @Autowired
    private TagValidator tagValidator;

    private Tag tag;
    private Set<String> allowedFields;

    @Override
    public Object getObject() {
        return tag;
    }

    @Override
    protected Validator getValidator() {
        return tagValidator;
    }

    @Override
    public String getName() {
        return "tag";
    }

    @Override
    public String[] getAllowedFields() {
        if (allowedFields == null) {
            allowedFields = new HashSet<String>();
            allowedFields.add("tag");
        }
        return allowedFields.toArray(new String[] {});
    }

    public Tag getTag() {
        return tag;
    }

    public void setTag(Tag tag) {
        this.tag = tag;
    }

    @Override
    public boolean supports(Class<?> clazz) {
        return tagValidator.supports(clazz);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Isaria congesta Berk. & Broome, 1875

### Remarks
null


text: Data persistence using MongoDB.


text:
package net.razorvine.serpent.ast;

public class DoubleNode extends PrimitiveNode<Double>
{
	public DoubleNode(double value)
	{
		super(value);
	}

	@Override
	public void accept(INodeVisitor visitor)
	{
		visitor.visit(this);
	}
}


text:
package eu.lighthouselabs.obd.reader.drawable;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;

import com.skywin.obdreader.R;

public class AccelGaugeView extends GradientGaugeView {

	public final static int TEXT_SIZE = 15;
	public final static int range = 20;
	private double accel = 2;

	public AccelGaugeView(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.context = context;
		paint = new Paint();
		paint.setTextSize(TEXT_SIZE);
		Typeface bold = Typeface.defaultFromStyle(Typeface.BOLD);
		paint.setTypeface(bold);
		paint.setStrokeWidth(3);
		paint.setStyle(Paint.Style.FILL);
	}

	public void setAccel(double accel) {
		this.accel = accel;
	}

	@Override
	protected void onDraw(Canvas canvas) {
		Resources res = context.getResources();
		Drawable container = (Drawable) res.getDrawable(R.drawable.accel_gauge);
		int width = getWidth();
		int left = getLeft();
		int top = getTop();
		paint.setColor(Color.GREEN);
		canvas.drawText("Soft",left,top+TEXT_SIZE,paint);
		paint.setColor(Color.RED);
		canvas.drawText("Hard", left+width-TEXT_SIZE*3, top+TEXT_SIZE, paint);
		drawGradient(canvas, container, TEXT_SIZE+5, accel, range);
	}
}


text:
namespace ModComponentMapper
{
    public class SerializableSkill : Skill
    {
        public static LocalizedString[] CreateLocalizedStrings(string prefix)
        {
            LocalizedString[] result = new LocalizedString[5];

            for (int i = 0; i < result.Length; i++)
            {
                result[i] = new LocalizedString() { m_LocalizationID = prefix + (i + 1) };
            }

            return result;
        }

        public static string GetSkillSaveKey(Skill skill)
        {
            if (skill.m_SkillType <= SkillType.ToolRepair)
            {
                return "m_" + skill.name + "Serialized";
            }

            return skill.name;
        }

        public void Deserialize(string text)
        {
            SkillData skillData = Utils.DeserializeObject<SkillData>(text);
            this.SetPoints(skillData.Points, SkillsManager.PointAssignmentMode.AssignInAnyMode);
        }

        public string Serialize()
        {
            SkillData skillData = new SkillData();
            skillData.Points = this.GetPoints();

            return Utils.SerializeObject(skillData);
        }
    }

    public class SkillData
    {
        public int Points;
    }
}


text:
body { text-align: center; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: .7em; padding: 10px; margin: 0px; color: #000; background: #fff; line-height: 1.3em; }

a { color: #009; text-decoration: none; border-bottom: 1px dotted #000; }
a:hover{ text-decoration: none; border-bottom: 1px solid #009; }
.img, .img:hover { border-bottom: 0; }
#image {  border-bottom: 0; }
#searchfield2 { display: block; width: 500px; margin: 0 auto 20px auto; text-align: center; padding: 0 0 0 10px; }
.ad { float: right; margin-right: 0px; }
.ad a { text-decoration: none; border: 0; }

.ad2 { float: right; margin-right: 0px; }
.ad2 a { text-decoration: none; border: 0; }
.smalltext { font-size: .8em; }
#TPBlogo { float: left; border: 0; padding: 0; margin-top: -7px; padding-right: 10px; }
#breadcrumbs { text-align: left; vertical-align: bottom; font-size: 0.8em; font-family: Tahoma, Arial, Verdana, sans-serif; font-weight: bold; padding: 0 0 0 5px;
margin: 0; clear: both; }
h2 { font-size: 1.1em; line-height: 1.5em; text-align: right; padding: 2px 5px; margin: 0; border-bottom: 1px solid #D2B9A6; background: #F6F1EE; font-weight: normal;
clear: both; }
h2 span { font-weight: bold; float: left; font-size: 1.1em; }
.header a { color: #000; }
#searchfield { display: block; width: 650px; height: 200px; margin: 0 auto; text-align: center; vertical-align: bottom; padding: 0; }
#q { vertical-align:bottom; text-align: left; margin: 0; }
#q .inputbox { margin: 6px; width: 300px; vertical-align: middle; padding: 2px; }
.submitbutton { vertical-align: middle; }

.nohover:hover{
 background: #F6F1EE;
}

.hide { display: none; }

table#searchResult { font-size: 1em; border-collapse: collapse; border-spacing:1px; margin:0; text-align: left; width: 100%; min-width: 400px; }
table#searchResult a { border: 0; }
table#searchResult a:hover { text-decoration: underline; }
thead#tableHead a { color: #000; font-weight: bold; }
thead#tableHead a:hover { border: 0; }
thead#tableHead th { background: #D2B9A6; }
table#searchResult th, table#searchResult td { padding: 3px; border: 1px solid #fff; }
table#searchResult tr { background: #F6F1EE;}
table#searchResult tr.alt { background: #F2ECE7; }
table#searchResult tr:hover { background: #fff; }
table#searchResult td.vertTh { font-weight:bold; color: #7B563A; }
table#searchResult img { border:0; margin-left:2px; margin-right:2px; }
table#searchResult img.dl { width:9px; height:11px; }
table#searchResult img.co { width:11px; height:9px; }

/* ##    UPLOAD. PHP    ## */
.uldetails label { font-weight: bold; color: #7B563A; }
.uldetails text, #tname, #torrent { width: 400px; }
.uldetails select { width: 200px; }
.uldetails .nfo { height: 300px; }
.uldetails #descpart    { padding-top: 10px; clear: both; }
.uldetails { padding: 0; margin: 0; width: 650px; }
.uldetails td { width: 120px; text-align: left; font-weight: bold; vertical-align: top; padding: 7px 0px 7px 0; margin: 0; color: #7B563A; border-bottom: 1px dashed
#E8DCD2; }
.uldetails .tdleft { width: 100px; text-align: left; padding-right: 10px; border-bottom: 1px dashed #E8DCD2; }
/* ##    END OF UPLOAD. PHP    ## */

#browseContainer { text-align: center; font-family: Verdana, Helvetica; font-size: 1em; }
#browseContainer a { color: #009; text-decoration: none; }
#browseContainer a:hover { border-bottom: 1px solid #009; }
#browseContainer dt { font-weight: bold; font-size: 1.6em; margin-bottom: 5px; clear: both; }

.tv #browseContainer dt { line-height: 1.4em; font-size: 1.3em; }
.tv #browseContainer dd { line-height: 1.4em; }
.tv #browseContainer .categoriesContainer { width:      33%; }

#browseContainer dd { margin: 0 0 15px 10px; float: left; font-size: 1.2em; }
#browseContainer .categoriesContainer { text-align: left; vertical-align: top; padding: 15px; width: 50%; }
* html .categoriesContainer a { display: inline-block; }

dt#upload a{ color: #080; }
dt#upload a:hover { border-bottom: 1px solid #080; }

dt#latest a{ color: #080; }
dt#latest a:hover { border-bottom: 1px solid #080; }

dt#showall a{ color: #080; }
dt#showall a:hover { border-bottom: 1px solid #080; }

#categoriesTable { width: 700px; height: auto; border: 0; text-align: center; margin: 20px auto; }

/* ##    DETAILS. PHP    ## */
#detailsouterframe {
	position: relative; margin: 0 auto; width: 680px; text-align: right;
	padding: 0;
}

#detailsouterframe #delete { text-align: right; padding-right: 4px; width: 20px; background: #D2B9A6; float: right; clear: both; font-size: 0.8em; font-weight: bold; }

#delete :hover { border: 1px dashed red; }
#delete a { text-decoration: none; border: 0; color: #ff0000; }

#detailsframe { clear: both; border-top: 1px solid #fff; background: #F6F1EE; text-align: left;
overflow: hidden; margin-top: 10px; }
#detailsframe #title { padding: 6px 0 8px 20px; font-size: 1.2em; text-align: left; font-weight: bold;
letter-spacing: 0.07em; border-bottom: 1px solid #fff; }

#detailsframe #title { height: 1%; background: #D2B9A6; }

#detailsframe #title div { font-weight: bold; float: right; font-size: 0.9em; padding-right: 20px; }

#details { padding: 10px; padding-left: 20px; padding-top: 0; background: #F6F1EE; }
#details h3 { margin: 0; border-bottom: 1px solid #D2B9A6; font-size: 1.3em; }
#details h3 em { font-style: normal; text-decoration: underline; }
#details h3 a   { text-decoration: none; border-bottom: none; }
#details h4 { margin: 20px 0 0 0; color: #7B563A; font-size: 1.2em; }
#details p { margin: 10px 0 0 10px; text-align: left; }
#details dl { text-align: left; float: left; margin: 10px 40px 10px 0px; }
#details dt { float: left; font-weight: bold; padding: 0 5px 0 0; color: #7B563A; border-bottom: 1px dashed #E8DCD2; clear: both; }
#details dd { padding: 0 0 0 40px; border-bottom: 1px dashed #E8DCD2; }
#details .col1 { width: 307px; }
#details dl.col2 { clear: right; width: 260px;  }
#details dl.col2 dd { padding: 0 0 0 70px; }
#details dd img { width: 59px; height: 10px; }

#details #CommentDiv { text-align: left; clear: both; background-color: #f6f1ee; width: 620px; height: 130px; padding:
10px; margin-top: 10px; margin-bottom: 20px; }
/* #CommentDiv #comments-captcha .info { float: left; width: 30em; }
#CommentDiv #comments-captcha { border: 1px solid red; width: 18em; float: left; }
*/
#details #filelist { width: 100%; border: 0; }

#filelistContainer { margin: 3em 0 1em 0; min-height: 50px; border: 1px solid #D2B9A6; background: #fff; padding: 10px; clear: left; }

#details pre {
       white-space: -moz-pre-wrap;
       white-space: -pre-wrap;
       white-space: -o-pre-wrap;
       white-space: pre-wrap;
       word-wrap: break-word;
       font-size:      11px;
       font-family: "Courier New", Courier, monospace;
}
.nfo { margin: 1em 0 1em 0px; width: 600px; min-height: 50px; border: 1px solid #D2B9A6; background: #fff; padding: 10px; font-size: 12px; font-family: "Courier New",
Courier, monospace; clear: left; line-height: .9em; }

p.info { padding: 10px 0 0; font-size: .9em; clear: both; }
p.info textarea { padding: 3px; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 11px; width: 300px; height: 100px; }
p.info input { margin: 4px 7px 0 0; }

.download { clear: both; }
.download a { font-size: 1.0em; color: #008E00 !important; font-weight: bold; text-transform: uppercase; border-bottom: 1px dotted #80C780;
       background: url(/static/img/icons/dl.gif) 0 0px no-repeat;padding: 0 0 0 13px;
}
.download a:hover{ color: #008E00; text-decoration: none; border-bottom: 1px solid #80C780; }
.detailartist { clear: both; }
.detailartist a { font-size: 1.0em; color: #008E00 !important; font-weight: bold; text-transform: uppercase; border-bottom: 1px dotted #80C780;
       background: url(/static/img/icons/td-nfo.png) 0 0px no-repeat;padding: 0 0 0 13px;
}
.detailartist a:hover{ color: #008E00; text-decoration: none; border-bottom: 1px solid #80C780; }
#details a.comments { padding: 0 0 0 14px; background: url(/static/img/icons/comments.gif) 0 3px no-repeat; }
#details a.list { font-weight: bold; }

table#details { margin: 40px 0 0; font-size: .9em; width: 100%; border-collapse: collapse; }
th#details, td#details { padding: 1px 4px; border-bottom: 1px solid #fff; border-right: 1px solid #fff; background: #F6F1EE; }
thead#details th#details { background: #D2B9A6; }
tbody#details th#details { color: #7B563A; }

.shortcuts{ width: 27px; padding: 0; margin: 0; }
.shortcuts li { float: left; list-style: none; padding: 0; margin: 0; }
.shortcuts a, .shortcuts a:hover { width: 13px; height: 13px; display: block; text-indent: -9999px; padding: 0; margin: 0; border: 0; background-position: center; }
.shortcuts .comments a { background: url(/static/img/icons/comments.gif) center no-repeat; }

#comments { font-size: 0.9em; }
#comments p { margin: .5em 0 0 .5em; padding: .3em 0; }
#comments p.byline { color: #BB967A; margin-top: 12px; }
#comments img { padding-bottom: 0; vertical-align: bottom; }
#comments .comment { background: #fff; margin-top: .3em; }
.browse-coms { text-align: center; margin: 1em 0; }

#AdvSearch { width: 600px; margin: 0 auto; }
#AdvSearch .longtext { width: 300px; }
#AdvSearch .shorttext { width: 85px; }
#AdvSearch dt.short { width: 150px; float: left; margin: 5px 5px 15px 0; text-align: right; }
#AdvSearch dd.short { float: left; width: 400px; margin: 0 0 15px 0; padding: 0; }

#loginForm { width: 25em; text-align: left; margin: 0 auto; margin-bottom: 4em; }
#loginForm fieldset { position: relative; border: 0; }
#loginForm label { display: block; margin-top: 1.5em; }
#loginForm input { position: absolute; right: 0; }
#loginForm #submit { margin-top: 1.5em; }

.rating { text-indent: -9999px; background: url(/static/img/icons/star0.gif) no-repeat;
 height: 10px; width: 59px; position: relative;
margin-left: 110px; }
* html .rating { margin-left: 110px !important;  }
#details dl.col2 dd.rating { padding: 0; }
.rating span { display: none; }
.rating a { text-decoration: none; border: 0; display: block; width: 11px; height: 10px; float: left; position: absolute; }
.rating .one { left: 1px; }
.rating .two { left: 11px; }
.rating .three { left: 23px; }
.rating .four { left: 34px; }
.rating .five { left: 47px; }
.r1 .one, .r2 .two, .r3 .three, .r4 .four, .r5 .five { background: url(/static/img/icons/star1.gif) no-repeat; left: 0; border:
0; }
.r1 .one { width: 11px; }
.r2 .two { width: 23px; }
.r3 .three { width: 35px; }
.r4 .four { width: 47px; }
.r5 .five { width: 59px; }

/* Fulhack */
* html dd.rating { margin-left: 190px; }
/**/

.logged-in a:hover { background: url(/static/img/icons/star1.gif) no-repeat; left: 0; border: 0; }
.logged-in .two:hover { width: 23px; }
.logged-in .three:hover { width: 35px; }
.logged-in .four:hover { width: 47px; }
.logged-in .five:hover { width: 59px; }

.guide h1, .guide h2, .guide h3 { margin: 1.3em 0 .5em 0; }
.guide h2 { font-size: 1.5em; }
.guide h3 { color:#080; font-size: 1.2em; }
.guide { width: 40em; margin: 0 auto 10em auto; text-align: left; }
.guide a { color: #009; text-decoration: none; border-bottom: 1px dotted #4040D9; }
.guide a:visited, .guide a:hover, .guidea:focus { text-decoration: none; border-bottom: 1px solid #009; }
.guide .highlight { background: #FFFECF; }
.guide li p:first-child { font-weight: bold; }
.guide #intro p { font-style: italic; }
.guide img { display: block; float: left; border: 1px solid #ddd; margin: .2em; padding: .2em; }
.guide img:hover { border: 1px solid #bbb; }
.guide a:focus img { border: 1px solid #f00; }
.guide p, .guide li { clear: both; }
.guide li { margin-bottom: 2em; }
.guide ol { padding-left: 2em; }
dl#keywords { margin-top: 1.5em; }
#keywords dt { font-weight: bold; float: left; clear: both; }
#keywords dt, #keywords dd { margin-bottom: 1em; }
#keywords dt { width: 10em; }
#about, #donate, #subscribe { width: 35em; text-align: left; margin: 0 auto; line-height: 1.4em; }

#pm legend {text-indent: -9999px; line-height: 0; }
#pm fieldset { border: 0; }
#pm label { display: block; margin-bottom: 2em; }
#pm * { margin: 0; padding: 0; }
#pm { text-align: left; width: 35em; margin: 2em auto; position: relative; }
#pm label input { position: absolute; left: 6em; right: 0; }
#pm .submit { left: 12.8em; margin-top: 1em; padding: 0 .3em; }
#pm .msg { margin-bottom: .2em; font-weight: bold; }
#pm #msg { width: 30em; }
.noborder, .noborder:hover, .noborder img { border: 0; text-decoration: none; }
#pms { margin: 0 auto; text-align: left; line-height: 2em; }
#pms td { padding: 0 2em; margin: 0 auto; }
#pms th { padding: 0 1.8em; text-align: left; }
.read-pm {width: 40em; }
#legal-threats { text-align: left; width: 45em; margin: 0 auto; line-height: 2em; }

#cpl {line-height: 1.5em; text-align: left; }
#cpl th { padding-right: 3em; }
#cpl .submit {margin-top: 1em; }

#news { text-align: left; width: 30em; margin: 0 auto; }
#news dt { font-weight: bold; margin-top: 1em; }
#news dd { margin-left: 0; }
#news dt span {color: #888; font-style: italic; }

.read-pm { margin: 2em auto; text-align: left; }
.read-pm th { padding-right: 5em; }
.read-pm .msg { padding-top: 2em; }

#registerTable { text-align: left; line-height: 2.5em; }
#registerTable td { padding: 0 1em; }
#registerTable label { margin-right: 1em; }

.ad, .ad:hover { border: 0; }
.ad2, .ad2:hover { border: 0; }
.spons-link { clear: both; }
.spons-link strong { color: #7B563A; }

#irc { width: 39.8em; margin: 0 auto; text-align: left; padding: .4em; background: #fbfbfb; border: 1px solid #ddd; color: #888; margin-top: 1em; line-height: 1.6em; }
#contact { line-height: 3em; width: 41em; margin: 2em auto; }
#contact fieldset { border: 0; }
#contact label { display: block; text-align: left; position: relative; }
#contact label input, #contact label select { width: 19em; position: absolute; left: 10em; }
#contact .submit { margin: 0; width: auto; padding: .2em .3em; display: block; }
* html #contact textarea { margin: 0; width: 30em; height: 10em; margin-left: -3em; }
#contact textarea { margin: 0; width: 30em; height: 10em; margin-left: -3.6em; }
.hide { display: none; }

#subscribe li { list-style: none; margin: 0; padding: 0; line-height: 1.6em; height: 1%; }
#subscribe li li { margin-left: 10px; }
#subscribe ul { margin: 2em 0 0 0; padding: 0; }
#subscribe li { font-weight: bold; }
#subscribe li a { background: url(/static/img/rss_small.gif) no-repeat right 2px; display: block; border: 0; }
#subscribe li a:hover { background-color: #f2ece7; }
#subscribe li ul { margin: 0; margin-bottom: 1em; }
#subscribe li ul li { font-weight: normal; }
#kopimi, .rss, .rss:hover {text-decoration: none; border: 0;}

#content {  position: relative; text-align: left; -width: expression(document.body.clientWidth < 960? "960px" : document.body.clientWidth > 1200? "1200px" : "auto"); min-width: 960px; max-width: 1200px; margin: 15px auto 0px auto; }

#sky-banner { width: 120px; position: fixed; top: 230px; z-index: 1; }
#sky-banner a, #sky-banner img { border: 0; }
#sky-right {width: 162px; float:right; margin-right:1px; top: 230px; }

#main-content {  margin-left: 130px;  margin-bottom: 0; margin-right: 170px; margin-top: 0;  overflow: hidden; position: relative; z-index: 90; }
.adText { color: #000; border: 0; }

#fbanners { padding: 10px; margin: 0 auto; }
#fbanners a { border: 0; margin: 0 7px; color: #000; }
#fbanners img { border: 0; }
#fbanners #kopimi { display: block; margin: 20px auto 0 auto; width: 40px;}

.noborder, .noborder a, .noborder img { border: 0; text-decoration: none; }

#new-post { margin-bottom: 1em; }
#headbar { position: relative; height: 1%; }
#headbar #rss a { display: block; background: url(/static/img/rss.gif) no-repeat; text-indent: -9999px; width: 35px; height: 13px; border: 0;
position: absolute; top: .5em; right: .5em; }
#blog img { border: 0; }
#blog { width: 45em; text-align: left; margin: 0 auto; margin-top: 2em; }
.meta { color: #999; }
.post { margin-bottom: 3em; }
#blog h4 { margin-top: 3em; }
#blog #comments dt { background: #f6f1ee; padding: .3em; color: #7b563a; margin-top: 1.5em; }
#blog #comments dd { margin: 0; padding: 0 .3em; }
#blog #comments p { margin-left: 0; margin-bottom: 1em; }

#blog form textarea { width: 100%; display: block; height: 10em; margin-top: 0; }
#blog form .button { margin-top: .5em; }
#blog-form { margin-bottom: 1em; width: 100%; background: #fff; }
#blog-form #title { width: 100%; font-weight: bold; }
#blog-form div { margin: 1em 0; }
#blog-form div input { width: auto; margin-bottom: .3em;  }
#blog-form label { display: block; margin-bottom: .5em; }

#rss { display: inline; }

.hide { display: none; }

#header .ad { width: 470px;  }
#header .ad2 { width: 630px;  }

#search-manual dd {
	margin: 0;
}
#search-manual dt {
	margin-top: 1em;
}
#search-manual code {
	font-size: 1.2em;
	font-family: Courier;
}
#search-manual a { border: 0; }
#search-manual h4 {
	margin: 0; padding: 0; margin-top: 2em;
}
#search-manual ul {
	padding: 0;
	list-style: none;
}
#autocomplete_choice {
	border: 1px solid red;
}

#torrent-admin {
	margin: .5em 0 0 0;
	overflow: auto;
	float: right;
}
#torrent-admin h4 { margin: 0;
	padding: 0; width: 3.6em; background: #D2B9A6;
	padding: .2em;
	float: left;
}
#torrent-admin a, .user-admin a { color: #000; }
#torrent-admin h4 a, .whip { border: 0; }
#torrent-admin #buttons { background: #F6F1EE; float: left; padding: .2em .2em .2em 1em; }

#uploader, .comment { position: relative; }
#uploader-admin, .user-admin { border: 1px solid #D2B9A6; position: absolute; top: -1.5em; right: -4em;
background: #F6F1EE; padding: .2em; }
.comment .user-admin { left: 4em; top: 0; width: 30em;}
.whip img { width: auto !important; border: 0; }
.whip:hover { border: 0; }

.com-vote { float: right; margin-top: -1.8em; margin-right: .5em; }
.com-vote img, .com-vote a { border: 0; }

#edit-user { border: 1px solid red; position: absolute; top: 0; left: 0;
	width: 100%;
	background: #fff;
	padding: .2em;
	opacity: .9;
}
#edit-user form { margin: 0; padding: 0; border: 1px solid red;}
#edit-user .close {
	border: 1px solid red;
	text-align: right;
}

.spons-link { background: #fff; padding: .5em .3em; margin-top: 1em; }
.spons-link iframe { margin: 0 auto;
 text-align: center;  }
.doodle { border-top: 1px solid #ccc; padding-top: .5em; margin-top: .5em; }
.doodle img { display: block; margin: 0 auto; }

#main-content iframe { margin: 0 auto; margin-bottom: 1em; display: block; }

#searchcloud { width: 56em; margin: 2em auto; border: 0; text-decoration:
none; line-height: 1.5; }

tbody { position: relative; }
#spinner { position: absolute; width: 10em; height: 10em; background: #fff; z-index: 1; left: 50%;
margin-left: -5em; top: 15em; opacity: .9; }
#spinner img { display: block; margin: 3em auto 0 auto; }

.policy { width: 42.4em !important; }
.policy p { text-align: justify; }

.adHeadline {font: bold 10pt Arial; text-decoration: underline; color: #0000FF;}
.adText {font: normal 10pt Arial; text-decoration: none; color: #000000;}

.cover h3, .morealbums h3, .upcomingevents h3 {line-height: 1.4em;border: 0 !important;padding: 0 10px;}
.similarartists h3 {line-height: 1.4em;padding: 0 10px;}

.cover {float: left; width: 200px; margin: 0 15px 5px 0; text-align: center; }
.cover img { margin: 10px 0 0 0; }

.torpicture {float: left; width: 280px; margin: 0 15px 5px 0; text-align: center; }
.torpicture img { margin: 10px 0 0 0; }

.lastfm { float: left; margin: 12px 15px 5px 0; }
.morealbums { float: right; width: 300px; }
.similarartists a {display: block; float: left; margin: 0 5px; padding: 0 3px; }
.upcomingevents, .similarartists { float: left; width: 340px; margin: 20px 0 0 0; }
.morealbums ul, .upcomingevents ul {list-style: none; margin: 10px 0; padding: 0; border-top: 1px solid #D2B9A6; }
.morealbums ul {margin: 10px 10px 10px 0;}
.morealbums li { list-style: none; border-bottom: 1px solid #D2B9A6; padding: 4px;}
.upcomingevents li { list-style: none; border-bottom: 1px solid #D2B9A6; }
.upcomingevents a { border: 0; }
.morealbums li a { display: block; padding: 0px 0px; border: 0; }
.upcomingevents li a { display: block; padding: 4px 10px; border: 0; }
.morealbums li a:hover, .upcomingevents li a:hover { background: #efe9e5; }
#social { padding: 10px 0; float: left; line-height:18px; width: 460px; }
#social * { float: left; margin-right: 5px; border: 0; }
#social .FlattrButton { float: right; }


text:
class Restaurant < ActiveRecord::Base
  belongs_to :city
  has_many :reviews
  has_many :reviewers, through: :reviews
  belongs_to :owner, class_name: "User", foreign_key: :owner_id
  #customers/reviewers and restaurant owners
end


text:
JavaScript is all like "You images done yet or what?"

[desandro.github.io/imagesloaded](http://desandro.github.io/imagesloaded/)

Detect when images have been loaded.

## Install

Get a packaged source file:

+ [imagesloaded.pkgd.min.js](http://desandro.github.io/imagesloaded/imagesloaded.pkgd.min.js)
+ [imagesloaded.pkgd.js](http://desandro.github.io/imagesloaded/imagesloaded.pkgd.js)

Or install via [Bower](http://bower.io):

``` bash
bower install imagesloaded
```

## Usage

``` js
imagesLoaded( elem, callback )
// you can use `new` if you like
new imagesLoaded( elem, callback )
```

+ `elem` _Element, NodeList, Array, or Selector String_
+ `callback` _Function_ - function triggered after all images have been loaded

Using a callback function is the same as binding it to the `always` event (see below).

``` js
// element
imagesLoaded( document.querySelector('#container'), function( instance ) {
  console.log('all images are loaded');
});
// selector string
imagesLoaded( '#container', function() {...});
// multiple elements
var posts = document.querySelectorAll('.post');
imagesLoaded( posts, function() {...});
```

## Events

imagesLoaded is an Event Emitter. You can bind event listeners to events.

``` js
var imgLoad = imagesLoaded( elem );
function onAlways( instance ) {
  console.log('all images are loaded');
}
// bind with .on()
imgLoad.on( 'always', onAlways );
// unbind with .off()
imgLoad.off( 'always', onAlways );
```

### always

``` js
imgLoad.on( 'always', function( instance ) {
  console.log('ALWAYS - all images have been loaded');
});
```

Triggered after all images have been either loaded or confirmed broken.

+ `instance` _imagesLoaded_ - the imagesLoaded instance

### done

``` js
imgLoad.on( 'done', function( instance ) {
  console.log('DONE  - all images have been successfully loaded');
});
```

Triggered after all images have successfully loaded without any broken images.

### fail

``` js
imgLoad.on( 'fail', function( instance ) {
  console.log('FAIL - all images loaded, at least one is broken');
});
```

Triggered after all images have been loaded with at least one broken image.

### progress

``` js
imgLoad.on( 'progress', function( instance, image ) {
  var result = image.isLoaded ? 'loaded' : 'broken';
  console.log( 'image is ' + result + ' for ' + image.img.src );
});
```

Triggered after each image has been loaded.

+ `instance` _imagesLoaded_ - the imagesLoaded instance
+ `image` _LoadingImage_ - the LoadingImage instance of the loaded image

## Properties

### LoadingImage.img

_Image_ - The `img` element

### LoadingImage.isLoaded

_Boolean_ - `true` when the image has succesfully loaded

### imagesLoaded.images

Array of _LoadingImage_ instances for each image detected

``` js
var imgLoad = imagesLoaded('#container');
imgLoad.on( 'always', function() {
  console.log( imgLoad.images.length + ' images loaded' );
  // detect which image is broken
  for ( var i = 0, len = imgLoad.images.length; i < len; i++ ) {
    var image = imgLoad.images[i];
    var result = image.isLoaded ? 'loaded' : 'broken';
    console.log( 'image is ' + result + ' for ' + image.img.src );
  }
});
```

## jQuery

If you include jQuery, imagesLoaded can be used as a jQuery Plugin.

``` js
$('#container').imagesLoaded( function() {
  // images have loaded
});
```

### jQuery Deferred

The jQuery plugin returns a [jQuery Deferred object](http://api.jquery.com/category/deferred-object/). This allows you to use `.always()`, `.done()`, `.fail()` and `.progress()`, similarly to the emitted events.

``` js
$('#container').imagesLoaded()
  .always( function( instance ) {
    console.log('all images loaded');
  })
  .done( function( instance ) {
    console.log('all images successfully loaded');
  })
  .fail( function() {
    console.log('all images loaded, at least one is broken');
  })
  .progress( function( instance, image ) {
    var result = image.isLoaded ? 'loaded' : 'broken';
    console.log( 'image is ' + result + ' for ' + image.img.src );
  });
```

## RequireJS

imagesLoaded works with RequireJS.

1. Install imagesLoaded and its dependencies
2. Update your [RequireJS paths config](http://requirejs.org/docs/api.html#config-paths) so it can find those modules

``` js
requirejs.config({
  paths: {
    "eventie": "components/eventie/eventie",
    "eventEmitter": "components/eventEmitter/EventEmitter"
  }
});
```

Consider taking a look at the [Grunt Bower RequireJS task](https://github.com/yeoman/grunt-bower-requirejs) to "Automagically wire-up installed Bower components into your RequireJS config."

## Contributors

This project has a [storied legacy](https://github.com/desandro/imagesloaded/graphs/contributors). Its current incarnation was developed by [Tomas Sardyha @Darsain](http://darsa.in/) and [David DeSandro @desandro](http://desandro.com).

## MIT License

imagesLoaded is released under the [MIT License](http://desandro.mit-license.org/). Have at it.


text:
namespace MenuBuddy
{
	/// <summary>
	/// A single item in the dropdown list.
	/// </summary>
	/// <typeparam name="T"></typeparam>
	public class DropdownItem<T> : RelativeLayoutButton, IDropdownItem<T>
	{
		#region Properties

		/// <summary>
		/// The item this dropdownitem is representing in the gui
		/// </summary>
		public T Item
		{
			get; set;
		}

		/// <summary>
		/// the dropdown control that owns this item
		/// </summary>
		private IDropdown<T> Owner { get; set; }

		#endregion //Properties

		#region Methods

		public DropdownItem(T item, IDropdown<T> owner)
		{
			Item = item;
			Owner = owner;
			Clickable = false;

			OnClick += ((obj, e) =>
			{
				Owner.SelectedDropdownItem = this;
			});
		}

		public DropdownItem(DropdownItem<T> inst) : base(inst)
		{
			Item = inst.Item;
			Owner = inst.Owner;
		}

		/// <summary>
		/// Get a deep copy of this item
		/// </summary>
		/// <returns></returns>
		public override IScreenItem DeepCopy()
		{
			return new DropdownItem<T>(this);
		}

		#endregion //Methods
	}
}


text:
package me.flibio.jobslite;

/**
 * General information about the {@link JobsLite} plugin
 */
public class PluginInfo {

    private PluginInfo() {
    }

    public static final String ID = "jobslite";
    public static final String NAME = "JobsLite";
    public static final String VERSION = "@project.version@";
    public static final String DESCRIPTION = "Sponge jobs plugin.";
}


text:
package httpnodeinfo

import "strings"

type NgbNodeInfo struct {
	NgbId         string
	NgbType       string
	NgbAddr       string
	HttpInfoAddr  string
	HttpInfoPort  int
	HttpInfoStart bool
}

type NgbNodeInfoSlice []NgbNodeInfo

func (n NgbNodeInfoSlice) Len() int {
	return len(n)
}

func (n NgbNodeInfoSlice) Swap(i, j int) {
	n[i], n[j] = n[j], n[i]
}

func (n NgbNodeInfoSlice) Less(i, j int) bool {
	if 0 <= strings.Compare(n[i].HttpInfoAddr, n[j].HttpInfoAddr) {
		return false
	} else {
		return true
	}
}


text:
const int number = 100;

const QList<QColor> colors = {
    QColor(Qt::blue),
    QColor(Qt::darkCyan),
    QColor(Qt::green),
    QColor(Qt::red),
    QColor(Qt::darkRed),
    QColor(Qt::cyan),
    QColor(Qt::darkGreen),
    QColor(Qt::darkBlue),
};

TreeItem *createTreeItem(const QString &title, TreeItem *parent = 0, bool isOpen = true){
    int level = parent ? parent->level() + 1 : 0;
    auto res = new TreeItem(title, colors.at(level), parent, isOpen);
    return res;
}

Model::Model(QObject *parent) :
    QObject(parent),
    m_tree(QList<TreeItem*>())
{
    auto factory1 = createTreeItem("Завод");

    auto plant1 = createTreeItem("Цех №1", factory1);
    auto c11 = createTreeItem("Компрессор", plant1);

    auto p1 = createTreeItem("Подшипник №1", c11, false);
    createTreeItem("x", p1);
    createTreeItem("y", p1);
    createTreeItem("z", p1);

    p1 = createTreeItem("Подшипник №2", c11);
    createTreeItem("x", p1);
    createTreeItem("y", p1);
    createTreeItem("z", p1);

    auto t11 = createTreeItem("Турбина", plant1, false);
    createTreeItem("обороты", t11);
    createTreeItem("t", t11);
    auto n11 = createTreeItem("Нагнетатель", plant1, false);
    createTreeItem("Вкл", n11);
    createTreeItem("Авария", n11);
    auto d11 = createTreeItem("Диагностика", plant1, false);
    auto d12 = createTreeItem("Вычисляемое значение 1", d11);
    auto d13 = createTreeItem("Вычисляемое значение 2", d12);
    auto d14 = createTreeItem("Вычисляемое значение 3", d13);
    auto d15 = createTreeItem("Вычисляемое значение 4", d14);
    auto d16 = createTreeItem("Вычисляемое значение 5", d15);
    //! todo: защиту от listIndexOutOfBounds
    //! auto d17 = createTreeItem("Вычисляемое значение 5", d16);

    plant1 = createTreeItem("Цех №2", factory1, false);
    c11 = createTreeItem("Компрессор", plant1, false);

    p1 = createTreeItem("Подшипник №1", c11, false);
    createTreeItem("x", p1);
    createTreeItem("y", p1);
    createTreeItem("z", p1);

    t11 = createTreeItem("Турбина", plant1, false);
    createTreeItem("обороты", t11);
    createTreeItem("t", t11);
    n11 = createTreeItem("Нагнетатель", plant1, false);
    createTreeItem("Вкл", n11);
    createTreeItem("Авария", n11);
    d11 = createTreeItem("Диагностика", plant1, false);
    createTreeItem("Вычисляемое значение 1", d11);
    createTreeItem("Вычисляемое значение 2", d11);
    createTreeItem("Вычисляемое значение 3", d11);
    createTreeItem("Вычисляемое значение 4", d11);
    createTreeItem("Вычисляемое значение 5", d11);

    auto factory2 = createTreeItem("Завод 2", 0);

    plant1 = createTreeItem("Цех №1", factory2);
    c11 = createTreeItem("Компрессор", plant1);

    p1 = createTreeItem("Подшипник №1", c11);
    createTreeItem("x", p1);
    createTreeItem("y", p1);
    createTreeItem("z", p1);

    t11 = createTreeItem("Турбина", plant1);
    createTreeItem("обороты", t11);
    createTreeItem("t", t11);
    n11 = createTreeItem("Нагнетатель", plant1);
    createTreeItem("Вкл", n11);
    createTreeItem("Авария", n11);
    d11 = createTreeItem("Диагностика", plant1);
    createTreeItem("Вычисляемое значение 1", d11);
    createTreeItem("Вычисляемое значение 2", d11);
    createTreeItem("Вычисляемое значение 3", d11);
    createTreeItem("Вычисляемое значение 4", d11);
    createTreeItem("Вычисляемое значение 5", d11);

    m_tree.append(factory1);
    m_tree.append(factory2);
}

const QList<TreeItem *> &Model::tree() const{
    return m_tree;
}

const QList<QObject *> Model::treeAsQObjects() const{
    QList<QObject *> res;
    res.reserve(m_tree.count());
    for(auto i : m_tree)
        res.append(i);
    return res;
}

int Model::count() const
{
    return m_tree.count();
}


text:
struct GraphTimer {
public:
    GraphTimer();

    ~GraphTimer();

    static GraphTimer* get_instance();

    unsigned int create_line(std::string label);
    unsigned int delete_line(unsigned int idx);

    void start(unsigned int idx);
    void stop(unsigned int idx);
    void frame(unsigned int idx, double delta_time);
    void count(unsigned int idx, int counter);

    void draw();

private:

    static std::chrono::time_point<std::chrono::system_clock> start_time;
    static bool started;

    const unsigned int FPS_ARRAY_LENGTH = 1000;
    std::vector<std::vector<float>> fps_vectors;
    std::vector<double> checkpoints;
    std::vector<int> counters;
    std::vector<std::string> labels;

    // I actually think I might make this a singleton, along
    static GraphTimer* instance;
};


text:
/**
 *  \file     control_states.h
 *  \brief    Control states declaration for control loop & ihm display
 *  \author   Sylvain Gaeremynck <sylvain.gaeremynck@parrot.com>
 *  \version  1.0
 */

#ifndef _CONTROL_STATES_H_
#define _CONTROL_STATES_H_

#ifdef CTRL_STATES_STRING
typedef char ctrl_string_t[32];
#endif

// Macros to customize preprocessing
// If this CTRL_STATES_STRING is not defined, this file declare several enumeration
// If user defines CTRL_STATES_STRING, this file will define several array of strings.
// Each string being equivalent to an enumeration entry

#ifdef CTRL_STATES_STRING
#define CVAR(a) #a  /* Using # causes the first argument after the # to be returned as a string in quotes */
#define CVARZ(a) #a
#else
#define CVARZ(a) a = 0
#define CVAR(a) a
#endif

/**
 * \enum  CONTROL_STATE
 * \brief control loop thread states.
 * \brief this defines major states
*/
#ifndef DO_NOT_INCLUDE_MAJOR_CTRL_STATES
#ifdef CTRL_STATES_STRING
static ctrl_string_t ctrl_states[] = {
#else
typedef enum {
#endif
  CVARZ( CTRL_DEFAULT ),
  CVAR( CTRL_INIT ),
  CVAR( CTRL_LANDED ),
  CVAR( CTRL_FLYING ),
  CVAR( CTRL_HOVERING ),
  CVAR( CTRL_TEST ),
  CVAR( CTRL_TRANS_TAKEOFF ),
  CVAR( CTRL_TRANS_GOTOFIX ),
  CVAR( CTRL_TRANS_LANDING ),
  CVAR( CTRL_TRANS_LOOPING ),
  //CVAR( CTRL_TRANS_NO_VISION ),
#ifndef CTRL_STATES_STRING
  CTRL_NUM_STATES
} CTRL_STATES;
#else
};
#endif
#endif

/**
 * \enum  FLYING_STATES
 * \brief flying states.
 * \brief this is one of the minor state
*/
#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES
#ifdef CTRL_STATES_STRING
static ctrl_string_t flying_states[] = {
#else
typedef enum {
#endif
  CVARZ( FLYING_OK ),
  CVAR( FLYING_LOST_ALT ),
  CVAR( FLYING_LOST_ALT_GO_DOWN ),
  CVAR( FLYING_ALT_OUT_ZONE ),
  CVAR( FLYING_COMBINED_YAW ),
  CVAR( FLYING_BRAKE ),
  CVAR( FLYING_NO_VISION )
  #ifndef CTRL_STATES_STRING
} FLYING_STATES;
#else
};
#endif
#endif

/**
 * \enum  HOVERING_STATES
 * \brief flying states.
 * \brief this is one of the minor state
*/
#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES
#ifdef CTRL_STATES_STRING
static ctrl_string_t hovering_states[] = {
#else
typedef enum {
#endif
  CVARZ( HOVERING_OK ),
  CVAR( HOVERING_YAW ),
  CVAR( HOVERING_YAW_LOST_ALT),
  CVAR( HOVERING_YAW_LOST_ALT_GO_DOWN),
  CVAR( HOVERING_ALT_OUT_ZONE),
  CVAR( HOVERING_YAW_ALT_OUT_ZONE),
  CVAR( HOVERING_LOST_ALT ),
  CVAR( HOVERING_LOST_ALT_GO_DOWN ),
  CVAR( HOVERING_LOST_COM ),
  CVAR( LOST_COM_LOST_ALT ),
  CVAR( LOST_COM_LOST_ALT_TOO_LONG ),
  CVAR( LOST_COM_ALT_OK ),
  CVAR( HOVERING_MAGNETO_CALIB ),
  CVAR( HOVERING_DEMO )
#ifndef CTRL_STATES_STRING
} HOVERING_STATES;
#else
};
#endif
#endif

/**
 * \enum  TAKEOFF_TRANS_STATES
 * \brief take off states.
 * \brief this is one of the minor state
*/
#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES
#ifdef CTRL_STATES_STRING
static ctrl_string_t takeoff_trans_states[] = {
#else
typedef enum {
#endif
  CVARZ( TAKEOFF_GROUND ),
  CVAR( TAKEOFF_AUTO )
  #ifndef CTRL_STATES_STRING
} TAKEOFF_TRANS_STATES;
#else
};
#endif
#endif

/**
 * \enum  GOTOFIX_TRANS_STATES
 * \brief gotofix substates.
 * \brief this is one of the minor state
*/
#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES
#ifdef CTRL_STATES_STRING
static ctrl_string_t gotofix_trans_states[] = {
#else
typedef enum {
#endif
  CVARZ( GOTOFIX_OK ),
  CVAR( GOTOFIX_LOST_ALT ),
  CVAR( GOTOFIX_YAW )
  #ifndef CTRL_STATES_STRING
} GOTOFIX_TRANS_STATES;
#else
};
#endif
#endif

/**
 * \enum  LANDING_TRANS_STATES
 * \brief landing states.
 * \brief this is one of the minor state
*/
#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES
#ifdef CTRL_STATES_STRING
static ctrl_string_t landing_trans_states[] = {
#else
typedef enum {
#endif
  CVARZ( LANDING_CLOSED_LOOP ),
  CVAR( LANDING_OPEN_LOOP ),
  CVAR( LANDING_OPEN_LOOP_FAST )
#ifndef CTRL_STATES_STRING
} LANDING_TRANS_STATES;
#else
};
#endif
#endif

/**
 * \enum  TAKEOFF_TRANS_STATES
 * \brief take off states.
 * \brief this is one of the minor state
*/
#ifndef DO_NOT_INCLUDE_MINOR_CTRL_STATES
#ifdef CTRL_STATES_STRING
static ctrl_string_t looping_trans_states[] = {
#else
typedef enum {
#endif
	CVARZ( LOOPING_IMPULSION),
	CVAR( LOOPING_OPEN_LOOP_CTRL ),
	CVAR( LOOPING_PLANIF_CTRL )
  #ifndef CTRL_STATES_STRING
} LOOPING_TRANS_STATES;
#else
};
#endif
#endif

#ifdef CTRL_STATES_STRING
#ifndef DO_NOT_INCLUDE_CTRL_STATES_LINK
/**
 * control link tates
 * \brief This array is used to link minor states & major state's strings
*/
static ctrl_string_t* control_states_link[] = {
  NULL,
  NULL,
  NULL,
  flying_states,
  hovering_states,
  NULL,
  takeoff_trans_states,
  gotofix_trans_states,
  landing_trans_states,
  looping_trans_states
};
#endif
#endif

#endif // _CONTROL_STATES_H_


text:
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var queues = twilio.ListQueues();

    foreach (var queue in queues.Queues)
    {
      Console.WriteLine(queue.AverageWaitTime);
    }
  }
}


text:
<?php

namespace SofaChamps\Bundle\BowlPickemBundle\Event;

use SofaChamps\Bundle\BowlPickemBundle\Entity\Game;
use Symfony\Component\EventDispatcher\Event;

class GameEvent extends Event
{
    protected $game;

    public function __construct(Game $game)
    {
        $this->game = $game;
    }

    public function getGame()
    {
        return $this->game;
    }
}


text:
namespace Dwarf {

void
DWARFReader::readForm(const Info &info, Unit &unit, Form form)
{
    switch (form) {
        case DW_FORM_string:
        case DW_FORM_line_strp:
        case DW_FORM_strp:
            readFormString(info, unit, form);
            break;
        case DW_FORM_data16:
            skip(16); // line info uses this for LNCT_MD5
            return;

        default:
            abort();
    }
}

std::string
DWARFReader::readFormString(const Info &dwarf, Unit &unit, Form form)
{
    switch (form) {
        case DW_FORM_string:
            return getstring();
        default:
            abort();
        case DW_FORM_line_strp: {
            auto off = getuint(unit.dwarfLen);
            return dwarf.debugLineStrings.io()->readString(off);
        }
        case DW_FORM_strp: {
            auto off = getuint(unit.dwarfLen);
            return dwarf.debugStrings.io()->readString(off);
        }
        case DW_FORM_strx: {
            size_t off = getuleb128();
            return unit.strx(off);
        }
    }
}

uintmax_t
DWARFReader::readFormUnsigned(Unit &, Form form)
{
    switch (form) {
        case DW_FORM_udata:
            return getuleb128();
        case DW_FORM_data1:
            return getu8();
        case DW_FORM_data2:
            return getu16();
        case DW_FORM_data4:
            return getu32();
        default:
            abort();
    }
}

intmax_t
DWARFReader::readFormSigned(Unit &, Form form)
{
    switch (form) {
        default:
            abort();
    }
}

Elf::Off
DWARFReader::getlength(size_t *dwarflen)
{
    size_t length = getu32();
    if (length >= 0xfffffff0) {
        switch (length) {
            case 0xffffffff:
                if (dwarflen != nullptr)
                    *dwarflen = 8;
                return getuint(8);
            default:
                return 0;
        }
    } else {
        if (dwarflen != nullptr)
            *dwarflen = 4;
        return length;
    }
}

}


text:
Fired when a panorama finishes loading.

## `scenechange`

Fired when a scene change is initiated. A `load` event will be fired when the
new scene finishes loading. Passes scene ID string to handler.

## `fullscreenchange`

Fired when browser fullscreen status changed. Passes status boolean to handler.

## `zoomchange`

Fired when scene hfov update. Passes new HFOV value to handler.

## `scenechangefadedone`

If a scene transition fade interval is specified, this event is fired when the
fading is completed after changing scenes.

## `animatefinished`

Fired when any movements / animations finish, i.e. when the renderer stops
rendering new frames. Passes final pitch, yaw, and HFOV values to handler.

## `error`

Fired when an error occured. The error message string is passed to the
event listener.

## `errorcleared`

Fired when an error is cleared.

## `mousedown`

Fired when the mouse button is pressed. Passes `MouseEvent` to handler.

## `mouseup`

Fired when the mouse button is released. Passes `MouseEvent` to handler.

## `touchstart`

Fired when a touch starts. Passes `TouchEvent` to handler.

## `touchend`

Fired when a touch ends. Passes `TouchEvent` to handler.

## `messageshown`

Fired when a message, e.g., for needing `ctrl` + scroll to zoom, is shown.

## `messagecleared`

Fired when a previously shown message is cleared.


text:
package com.erc.dal.upgrade;

import android.database.sqlite.SQLiteDatabase;

/**
 * Created by einar on 10/15/2015.
 */
public interface UpgradeListener {
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion);
}