text:
(function() {
    define(['jquery'],function($) {
        var userGridController = function($scope, $rootScope, userService, $routeParams, $location) {
            var ORDER_ASC = "asc";
            var ORDER_DESC = "desc";

            $scope.limit = 5;
            $scope.page = 1;
            $scope.currentPage = 1;
            $scope.reverse = true;
            $scope.order = ORDER_ASC;
            $scope.filterOptions = {};
            $scope.checkFilter = false;

            /**
             * Get searched users function
             * */
            $scope.getUsers = function () {
                $scope.usersGrid = [];
                if (typeof ($routeParams.params) === 'undefined') {
                    $location.path('/params/page=1');
                } else {
                    parseUrlParams($routeParams.params);
                }
                userService.getUsers($scope.page, $scope.orderField, $scope.order, $scope.filterField, $scope.searchString, $scope.limit, function(response) {
                    $scope.testGrid = [];
                    angular.forEach(response.data,function(item) {
                        $scope.usersGrid.push(item);
                    });
                    $scope.allowedFilters = response.allowedFilters;
                    $scope.columns = response.columns;
                    angular.forEach($scope.columns, function(value, key) {
                        if ($.inArray(key, $scope.allowedFilters) !== -1) {
                            $scope.filterOptions[key] = value;
                        }
                    });
                    $scope.options = [];
                    $scope.totalPages = response.totalPages;
                    $scope.allowedOrders = response.allowedOrders;
                    $scope.defaultLimit = response.defaultLimit;
                    $scope.urlPrev = response.urlPrev;
                    $scope.urlNext = response.urlNext;
                    $scope.gridPages = Math.ceil(response.count/$scope.limit);
                    $scope.checkFilter = true;
                });
            };

            /**
             * Set orders params
             * */
            $scope.setOrder = function (order) {
                $scope.page = 1;
                $scope.orderField = order;
                $scope.reverse = !$scope.reverse;
                if ($scope.reverse) {
                    $scope.order = ORDER_ASC;
                } else {
                    $scope.order = ORDER_DESC;
                }
                setUrl();
                $scope.getUsers();
            };

            /**
             * change page
             */
            $scope.changePage = function(num) {
                $scope.page = num + 1;
                setUrl();
                $scope.getUsers();
            };

            /**
             * get prev page
             */
            $scope.prev = function() {
                $scope.page--;
                setUrl();
                $scope.getUsers();
            };

            /**
             * get next page
             */
            $scope.next = function() {
                $scope.page++;
                setUrl();
                $scope.getUsers();
            };

            /**
             * Search users
             * */
            $scope.search = function () {
                $scope.page = 1;
                setUrl();
                $scope.getUsers();
            };

            /**
             * Change limit
             * */
            $scope.changeLimit = function (limit) {
                $scope.page = 1;
                $scope.limit = limit;
                setUrl();
                $scope.getUsers();
            };

            parseUrlParams = function (urlParams) {
                var params = [];
                tmp = (urlParams).split('&');
                for(var i=0; i < tmp.length; i++) {
                    tmp2 = tmp[i].split('=');
                    params[tmp2[0]] = tmp2[1];
                }
                if (typeof (params.page) !== 'undefined') {
                    $scope.page = params.page;
                }
                if (typeof (params.limit) !== 'undefined') {
                    $scope.limit = params.limit;
                }
                if (typeof (params.filter_string) !== 'undefined') {
                    $scope.searchString = params.filter_string;
                }
                if (typeof (params.filter_field) !== 'undefined') {
                    $scope.filterField = params.filter_field;
                }
                if (typeof (params.order_field) !== 'undefined') {
                    $scope.orderField = params.order_field;
                }
                if (typeof (params.order) !== 'undefined') {
                    $scope.order = params.order;
                }
                return params;
            };

            setUrl = function () {
                var params;
                if (typeof ($scope.page) !== 'undefined') {
                    params = 'page=' + $scope.page;
                }
                if (typeof ($scope.limit) !== 'undefined') {
                    params += '&limit=' + $scope.limit;
                }
                if (typeof ($scope.searchString) !== 'undefined' && $scope.searchString !== '') {
                    params += '&filter_string=' + $scope.searchString;
                }
                if (typeof ($scope.filterField) !== 'undefined' && $scope.filterField !== '') {
                    params += '&filter_field=' + $scope.filterField;
                }
                if (typeof ($scope.order) !== 'undefined' && $scope.order !== '') {
                    params += '&order=' + $scope.order;
                }
                if (typeof ($scope.orderField) !== 'undefined' && $scope.orderField !== '') {
                    params += '&order_field=' + $scope.orderField;
                }
                $location.path('/params/' + params);
            };

            $scope.getTimes=function(n){
                return new Array(n);
            };

            init();

            /**
             * Initial function to load users and show grid
             *
             * Created by Maxim Mandryka maxim.mandryka@nixsolutions.com
             */
            function init() {
                $scope.getUsers();
            }

        };

        return ['$scope', '$rootScope', 'userService', '$routeParams', '$location', userGridController];
    });
}());


text:
package com.system.distribute.client;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 *
 *
 *
 * @author zhuyuping
 * @version 1.0
 * @created 2014-3-28 上午11:18:56
 * @function:客服端回调 udp使用
 */

public final class ClientUDPHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelActive(ChannelHandlerContext ctx){
      System.out.println("ClientUDPHandler.channelActive()");
    }

    @Override
    public void channelRead(ChannelHandlerContext ctx,Object msg) {

    }

    @Override
    public void channelInactive(final ChannelHandlerContext ctx) {
        //FileUtils.write(Resources.CLIENT_OUTPUT, String.format("Received %d messages", noMessagesReceived));
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause){

    }
}

redpajama_set_name: RedPajamaGithub


text:
package ru.job4j.list;

import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
* Класс NodeTest.
* @author Konstantin Kolganov (kkolganov.92@gmail.com)
* @since 18.11.2017
* @version 2.0
*/

public class NodeTest {
/**
* Класс NodeTest.
*/
	@Test
	public void whenLinkedListIsCloseThenMethodCycleReturnTrue() {
		// Создать 5 узлов связанного списка
		Node<Double> third = new Node<>(3.0);
		Node<Double> fourth = new Node<>(4.0);
		Node<Double> fifth = new Node<>(5.0);
		Node<Double> first = new Node<>(1.0);
		Node<Double> second = new Node<>(2.0);
		// Замкнуть их в кольцо
		third.setNext(fourth);
		fourth.setNext(fifth);
		fifth.setNext(first);
		first.setNext(second);
		second.setNext(third);
		// Проверка цикличности возвращает true
		assertThat(Node.hasCycle(fifth), is(true));
		assertThat(Node.hasCycle(second), is(true));
	}
}


text:
Game Over

Build failed

            <Insert coin to begin playing>

<Building>

                RS
                Fri.170513

Hall of Fame

                        {{developer.name}}
                        ({{developer.issues_solved}})

Hall of Shame

                        {{developer.name}}
                        ({{developer.issues_solved}})

Merge requests open {{mergeRequestsSum}}

{{project.getProjectName()}}

                {{project.getCount()}}

                    Period end
                    # bugs opened
                    # bugs closed

                    {{day.date}}
                    {{day.bugsOpened}}
                    {{day.bugsClosed}}

                    Period end
                    # open bugs

                    {{day.date}}
                    {{day.bugsOpened}}

Open bugs

                {{bugsOpen}}

= 0]">
                {{delta | abs}}


text:
<?php

namespace Kaperys\Financial\Message\Unpacker;

use Kaperys\Financial\Cache\CacheManager;
use Kaperys\Financial\Message\AbstractPackUnpack;
use Kaperys\Financial\Message\Schema\MessageSchemaInterface;
use Kaperys\Financial\Message\Schema\SchemaManager;
use Kaperys\Financial\Message\Unpacker\Exception\MessageLengthHeaderException;

/**
 * Class MessageUnpacker
 *
 * @package Kaperys\Financial\Message\Unpacker
 *
 * @author  Mike Kaperys <mike@kaperys.io>
 */
class MessageUnpacker extends AbstractPackUnpack
{

    /** @var SchemaManager $schemaManager the message schema manager */
    protected $schemaManager;

    /** @var CacheManager $cacheManager the schema cache manager */
    protected $cacheManager;

    /**
     * MessageUnpacker constructor.
     *
     * @param CacheManager  $cacheManager  the schema cache manager
     * @param SchemaManager $schemaManager the schema manager class
     */
    public function __construct(CacheManager $cacheManager, SchemaManager $schemaManager)
    {
        $this->cacheManager  = $cacheManager;
        $this->schemaManager = $schemaManager;
    }

    /**
     * Parses the message to the schema format
     *
     * @param string $message the iso message, in hexadecimal format
     *
     * @return MessageUnpacker
     *
     * @throws MessageLengthHeaderException if the message fails length validation
     */
    public function parse(string $message): MessageUnpacker
    {
        // Parse the message length header
        if ($this->getHeaderLength() > 0) {
            $messageLengthHeader = $this->parseMessageLengthHeader($message);
            $this->shrink($message, ($this->getHeaderLength() * 2));

            if (($messageLengthHeader - $this->getHeaderLength()) != (strlen($message) / 2)) {
                throw new MessageLengthHeaderException(
                    'Message length should be ' . ($messageLengthHeader - $this->getHeaderLength()) . ', but ' .
                    (strlen($message) / 2) . ' was found'
                );
            }
        }

        // Parse the message type indicator
        $this->setMti((string) $this->parseMti($message));
        $this->shrink($message, 8);

        // Parse the bitmap
        $bitmap = $this->parseBitmap($message);

        $numberOfBitmaps = 1;

        if (strlen($bitmap) > 64) {
            $numberOfBitmaps = 2;
        }

        if (strlen($bitmap) > 128) {
            $numberOfBitmaps = 3;
        }

        // Message without bitmaps
        $this->shrink($message, ($numberOfBitmaps * 16));

        // Parse the data element
        $dataElement = $this->parseDataElement($bitmap, $message);

        foreach ($dataElement as $bit => $value) {
            $this->schemaManager
                ->{$this->cacheManager
                    ->getSchemaCache($this->schemaManager->getSchema())
                    ->getDataForBit($bit)
                    ->getSetterName()
                }($value);
        }

        return $this;
    }

    /**
     * Gets the schema manager
     *
     * @return SchemaManager
     */
    public function getSchemaManager(): SchemaManager
    {
        return $this->schemaManager;
    }

    /**
     * Parses the message length header
     *
     * @param string $message
     *
     * @return string the parsed message length header
     */
    protected function parseMessageLengthHeader(string $message): string
    {
        return base_convert(substr($message, 0, ($this->getHeaderLength() * 2)), 16, 10);
    }

    /**
     * Parses the message type indicator
     *
     * @param string $message
     *
     * @return string the parsed MTI
     */
    protected function parseMti(string $message): string
    {
        return hex2bin(substr($message, 0, 8));
    }

    /**
     * Parses the bitmap
     *
     * @param string $message
     *
     * @return string the parsed bitmap
     */
    protected function parseBitmap(string $message): string
    {
        $compiledBitmap = "";

        for (;;) {
            // Support for PHPs accuracy issues when using base_convert - ugly, I know!
            $bitmap = implode(null, array_map(function ($bit) {
                return str_pad(base_convert($bit, 16, 2), 8, 0, STR_PAD_LEFT);
            }, str_split(substr($message, 0, 16), 2)));

            $this->shrink($message, 16);

            $compiledBitmap .= $bitmap;

            if (substr($bitmap, 0, 1) !== "1" || strlen($compiledBitmap) > 128) {
                break;
            }
        }

        return $compiledBitmap;
    }

    /**
     * Parses the data element
     *
     * @param string $bitmap  the message bitmap
     * @param string $message the message data element
     *
     * @return array the parsed data element
     */
    protected function parseDataElement(string $bitmap, string $message): array
    {
        $dataElement = [];

        $schemaCache = $this->cacheManager->getSchemaCache($this->schemaManager->getSchema());

        for ($i = 0; $i < strlen($bitmap); $i++) {
            if ($bitmap[$i] === "1") {
                $bit = $i + 1;

                if ($bit === 1 || $bit === 65 || $bit === 129) {
                    continue;
                }

                $bitData = $schemaCache->getDataForBit($bit);

                if ($bitData->isFixedLength()) {
                    $bitReadLength = $bitData->getLength() * 2;
                } else {
                    $bitLengthIndicator = $bitData->getLengthIndicator() * 2;
                    $bitReadLength      = hex2bin(substr($message, 0, $bitLengthIndicator)) * 2;

                    $this->shrink($message, $bitLengthIndicator);
                }

                $fieldData = substr($message, 0, $bitReadLength);

                $unpackedBit = $bitData->getMapper()->unpack($fieldData);

                $this->shrink($message, $bitReadLength);

                $dataElement[$bit] = $unpackedBit;
            }
        }

        return $dataElement;
    }

    /**
     * Shrinks the message
     *
     * @param string $message the message
     * @param int    $length  the length to shrink by
     */
    private function shrink(&$message, $length)
    {
        $message = substr($message, $length);
    }
}


text:
<?php
namespace Ups\Entity;

use DOMDocument;
use DOMElement;
use Ups\NodeInterface;

class Service implements NodeInterface
{
	// Valid domestic values
    const S_AIR_1DAYEARLYAM = '14';
    const S_AIR_1DAY = '01';
    const S_AIR_1DAYSAVER = '13';
    const S_AIR_2DAYAM = '59';
    const S_AIR_2DAY = '02';
    const S_3DAYSELECT = '12';
    const S_GROUND = '03';

    // Valid international values
    const S_STANDARD = '11';
    const S_WW_EXPRESS = '07';
    const S_WW_EXPRESSPLUS = '54';
    const S_WW_EXPEDITED = '08';
    const S_SAVER = '65'; // Require for Rating, ignored for Shopping

    // Valid Poland to Poland same day values
    const S_UPSTODAY_STANDARD = '82';
    const S_UPSTODAY_DEDICATEDCOURIER = '83';
    const S_UPSTODAY_INTERCITY = '84';
    const S_UPSTODAY_EXPRESS = '85';
    const S_UPSTODAY_EXPRESSSAVER = '86';
	const S_UPSWW_EXPRESSFREIGHT = '96';

	private $serviceNames = array(
		'01' => 'UPS Next Day Air',
		'02' => 'UPS Second Day Air',
		'03' => 'UPS Ground',
		'07' => 'UPS Worldwide Express',
		'08' => 'UPS Worldwide Expedited',
		'11' => 'UPS Standard',
		'12' => 'UPS Three-Day Select',
		'13' => 'Next Day Air Saver',
		'14' => 'UPS Next Day Air Early AM',
		'54' => 'UPS Worldwide Express Plus',
		'59' => 'UPS Second Day Air AM',
		'65' => 'UPS Saver'
    );

    /** @deprecated */
    public $Description;

    /**
     * @var string
     */
    private $code = self::S_GROUND;

    /**
     * @var string
     */
    private $description;

    /**
     * @param null|object $attributes
     */
    public function __construct($attributes = null)
    {
        if (null !== $attributes) {
            if (isset($attributes->Code)) {
                $this->setCode($attributes->Code);
            }
            if (isset($attributes->Description)) {
                $this->setDescription($attributes->Description);
            }
        }
    }

    /**
     * @param null|DOMDocument $document
     * @return DOMElement
     */
    public function toNode(DOMDocument $document = null)
    {
        if (null === $document) {
            $document = new DOMDocument();
        }

        $node = $document->createElement('Service');
        $node->appendChild($document->createElement('Code', $this->getCode()));
        $node->appendChild($document->createElement('Description', $this->getDescription()));
        return $node;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return $this->serviceNames[$this->getCode()];
    }

    /**
     * @return string
     */
    public function getCode()
    {
        return $this->Code;
    }

    /**
     * @param string $code
     * @return $this
     */
    public function setCode($code)
    {
        $this->Code = $code;
        return $this;
    }

    /**
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * @param string $description
     * @return $this
     */
    public function setDescription($description)
    {
        $this->Description = $description;
        $this->description = $description;
        return $this;
    }
}


text:
from __future__ import annotations

from dataclasses import dataclass
from textwrap import dedent
from typing import cast

from pants.backend.docker.registries import DockerRegistries
from pants.engine.environment import Environment, EnvironmentRequest
from pants.engine.rules import Get, collect_rules, rule
from pants.option.subsystem import Subsystem
from pants.util.frozendict import FrozenDict
from pants.util.memo import memoized_method
from pants.util.strutil import bullet_list

class DockerOptions(Subsystem):
    options_scope = "docker"
    help = "Options for interacting with Docker."

    @classmethod
    def register_options(cls, register):
        registries_help = (
            dedent(
                """\
                Configure Docker registries. The schema for a registry entry is as follows:

                    {
                        "registry-alias": {
                            "address": "registry-domain:port",
                            "default": bool,
                        },
                        ...
                    }

                """
            )
            + (
                "If no registries are provided in a `docker_image` target, then all default "
                "addresses will be used, if any.\n"
                "The `docker_image.registries` may be provided with a list of registry addresses "
                "and registry aliases prefixed with `@` to be used instead of the defaults.\n"
                "A configured registry is marked as default either by setting `default = true` "
                'or with an alias of `"default"`.'
            )
        )
        default_repository_help = (
            "Configure the default repository name used in the Docker image tag.\n\n"
            "The value is formatted and may reference these variables:\n\n"
            + bullet_list(["name", "directory", "parent_directory"])
            + "\n\n"
            'Example: `--default-repository="{directory}/{name}"`.\n\n'
            "The `name` variable is the `docker_image`'s target name, `directory` and "
            "`parent_directory` are the name of the directory in which the BUILD file is for the "
            "target, and its parent directory respectively.\n\n"
            "Use the `repository` field to set this value directly on a `docker_image` "
            "target.\nAny registries or tags are added to the image name as required, and should "
            "not be part of the repository name."
        )
        super().register_options(register)
        register("--registries", type=dict, fromfile=True, help=registries_help)
        register(
            "--default-repository",
            type=str,
            help=default_repository_help,
            default="{name}",
        )

        register(
            "--build-args",
            type=list,
            member_type=str,
            default=[],
            help=(
                "Build arguments (`--build-arg`) to use for `docker build` invocations. "
                "Entries are either strings in the form `ARG_NAME=value` to set an explicit value; "
                "or just `ARG_NAME` to copy the value from Pants's own environment."
            ),
        )

        register(
            "--env-vars",
            type=list,
            member_type=str,
            default=[],
            advanced=True,
            help=(
                "Environment variables to set for `docker` invocations. "
                "Entries are either strings in the form `ENV_VAR=value` to set an explicit value; "
                "or just `ENV_VAR` to copy the value from Pants's own environment."
            ),
        )

    @property
    def build_args(self) -> tuple[str, ...]:
        return tuple(sorted(set(self.options.build_args)))

    @property
    def env_vars_to_pass_to_docker(self) -> tuple[str, ...]:
        return tuple(
            sorted(
                set(self.options.env_vars).union(
                    {build_arg for build_arg in self.build_args if "=" not in build_arg}
                )
            )
        )

    @property
    def default_repository(self) -> str:
        return cast(str, self.options.default_repository)

    @memoized_method
    def registries(self) -> DockerRegistries:
        return DockerRegistries.from_dict(self.options.registries)

@dataclass(frozen=True)
class DockerEnvironmentVars:
    vars: FrozenDict[str, str]

@rule
async def get_docker_environment(
    docker: DockerOptions,
) -> DockerEnvironmentVars:
    return DockerEnvironmentVars(
        await Get(Environment, EnvironmentRequest(docker.env_vars_to_pass_to_docker))
    )

def rules():
    return collect_rules()


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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="pt.iscte.row_timer.android.activities.EventDetailActivity"

    android:padding="0dp"
    android:background="@color/bluePrimary">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Referee"
        android:id="@+id/btnReferee"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true"
        android:onClick="chooseRefereeMenu" />
</RelativeLayout>


text:
/**
 * \file include/mpidi_star.h
 * \brief ???
 */
/******************************************************************************

Copyright (c) 2006, Ahmad Faraj & Xin Yuan,
All rights reserved.

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

  * Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

  * Neither the name of the Florida State University nor the names of its
    contributors may be used to endorse or promote products derived from this
    software without specific prior written permission.

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

  ***************************************************************************
  *     Any results obtained from executing this software require the       *
  *     acknowledgment and citation of the software and its owners.         *
  *     The full citation is given below:                                   *
  *                                                                         *
  *     A. Faraj, X. Yuan, and D. Lowenthal. "STAR-MPI: Self Tuned Adaptive *
  *     Routines for MPI Collective Operations." The 20th ACM International *
  *     Conference on Supercomputing (ICS), Queensland, Australia           *
  *     June 28-July 1, 2006.                                               *
  ***************************************************************************

******************************************************************************/

/*
  NOTE:
  STAR-MPI is not supported in threaded mode yet.
 */

#ifndef _MPIDI_STAR_H_
#define _MPIDI_STAR_H_

#include <dcmf.h>
#include <mpiimpl.h>
#include <defines.h>
#include <execinfo.h>

#define STAR_ROUTINES 10
#define STAR_FAILURE 1

/*
   if STAR is on by default, library developer can use these thresholds to
   decide when to enable star. I.E. if message size is more than 512, star is
   on, otherwise, it is off.
*/

#define STAR_ALLOC(x,t,c) (x = (t *) MPIU_Malloc(sizeof(t) * c))

typedef enum {NO_CALL = 0, ALLTOALL_CALL, ALLGATHER_CALL, ALLGATHERV_CALL,
              ALLREDUCE_CALL, BCAST_CALL, REDUCE_CALL, GATHER_CALL,
	      SCATTER_CALL, BARRIER_CALL} STAR_MPI_Call;

/* MPIDO-Like function pointers for major collectives */
typedef int (* bcast_fptr)     (void *, int, int, MPID_Comm *);

typedef int (* allreduce_fptr) (void *, void *, int, DCMF_Dt, DCMF_Op,
				MPI_Datatype, MPID_Comm *);

typedef int (* alltoall_fptr)  (void *, int, MPI_Datatype,
                                void *, int, MPI_Datatype,
                                MPID_Comm *);

typedef int (* allgather_fptr) (void *, int, MPI_Datatype,
				void *, int, MPI_Datatype,
				MPI_Aint, MPI_Aint,
				size_t, size_t, MPID_Comm *);

typedef int (* allgatherv_fptr) (void *, int, MPI_Datatype,
				 void *, int *, int, int *, MPI_Datatype,
				 MPI_Aint, MPI_Aint,
				 size_t, size_t, MPID_Comm *);

typedef int (* reduce_fptr) (void *, void *, int, DCMF_Dt, DCMF_Op,
			     MPI_Datatype, int, MPID_Comm *);

typedef int (* gather_fptr) (void *, int, MPI_Datatype,
                             void *, int, MPI_Datatype,
                             int, MPID_Comm *);

typedef int (* scatter_fptr) (void *, int, MPI_Datatype,
                              void *, int, MPI_Datatype,
                              int, MPID_Comm *);

typedef int (* barrier_fptr) (MPID_Comm *);

/*
   to save on variables,
   we use a union of function pointers for diff collectives
*/
typedef union
{
  alltoall_fptr   alltoall_func;
  allgather_fptr  allgather_func;
  allgatherv_fptr allgatherv_func;
  allreduce_fptr  allreduce_func;
  barrier_fptr    barrier_func;
  bcast_fptr      bcast_func;
  reduce_fptr     reduce_func;
  gather_fptr     gather_func;
  scatter_fptr    scatter_func;
} STAR_Func_Ptr;

/*
  this creates a struct of algorithms. This structure shall contain a list of
  algorithms for a given collective operation.
 */
typedef struct
{
  STAR_Func_Ptr func; /* a pointer to the function performing the op */

  /* [0] minimum number of processes this algorithm works with */
  /* [1] max number of processes this algorithm works with */
  unsigned int nprocs[2];

  /* [0] minimum number of bytes this algorithm works with */
  /* [1] maximum number of bytes this algorithm works with */
  unsigned int bytes[2];

  /* stores properties of a given algorithm in bits pattern variable */
  MPIDO_Embedded_Info_Set properties;

  char name[64]; /* name of alltoall, allgather, bcast, ... algorithm */
} STAR_Algorithm;

typedef struct
{
  /* type of collective operation: bcast, reduce, ..etc */
  STAR_MPI_Call call_type;

  MPID_Comm * comm; /* communicator used in a given collective call site */
  unsigned bytes; /* number of bytes to be communicated in the call site */
  int id; /* identifier for a given call site, set by trace_back */
  int op_type_support; /* code represinting if there's support for op/type */
  char buff_attributes[4];
} STAR_Callsite;

typedef struct STAR_Tuning_Session
{
  /* a ptr to collective repository for an op */
  STAR_Algorithm * repository;

  /* communicator used for the particular call site */
  MPID_Comm * comm;

  /* type of MPI routine: Bcast, reduce, ..etc */
  STAR_MPI_Call call_type;
  int handle;
  int callsite_id; /* identifier for the particular call site */
  int op_type_support; /* code represinting if there's support for op/type */
  unsigned np; /* records the number of processes involved in this call site */
  unsigned bytes; /* message size in bytes */
  unsigned total_tuned_algorithms; /* counts the number of algorithms tuned */
  unsigned tuning_calls; /* counts number of invocs algorithms are tuned for */
  unsigned total_examined; /* counts what algorithms have been tried so far */
  int curr_alg_index; /* an index pointing to current algorithm in use */
  int best_alg_index; /* index pointing to best algorithm when found */

  /* counts number of invocations in monitor phase for a tuning session */
  unsigned monitor_calls;

  /* monitoring factor, set to 2, and then doubles each time an algorithm is
     decided to be kept */
  unsigned factor;

  /* checks to see whether try a new algorithm or keep using current one */
  unsigned char get_next_alg;

  unsigned char panic;

  unsigned char one_at_least; /* at least one algorithm is available */

  unsigned skip; /* indicates a skipping of a measurement record */

  unsigned post_tuning_calls; /* counts number of calls in the monitor phase */

  double initial_time; /* time at start of a tuning session */
  /*
     [0] holds ave of time measures of an algorithm over all monitor calls
     [1] holds ave of time measures of an algorithm over last
     INVOCS_PER_ALGORITHM
  */
  double max[4];

  double tune_overhead; /* measure time overhead in tuning phase */
  double monitor_overhead; /* measures time overhead in monitor phase */
  double comm_overhead; /* measures only comm. time to execute an algorithm  */

  /* measures only total comm. time for executing best algorithm over all
     phases post the initial tuning phase */
  double post_tuning_time;

  /* records current invocation number / trial of an algorithm */
  unsigned * curr_invoc;

  /* array to record timing measurement per algorithm per invocation */
  double * time;

  /* records each algorithm best time */
  double * algorithms_times;

  /* sorts algorithms based on timing results */
  int * best;

  struct STAR_Tuning_Session * next; /* pointer to next tuning session */
} STAR_Tuning_Session;

typedef struct
{
  /* env variable setting the use of STAR */
  int enabled;

  int alltoall_threshold; /* min message size to have star kick in */
  int allgather_threshold; /* min message size to have star kick in */
  int allgatherv_threshold; /* min message size to have star kick in */
  int allreduce_threshold; /* min message size to have star kick in */
  int reduce_threshold; /* min message size to have star kick in */
  int bcast_threshold; /* min message size to have star kick in */
  int gather_threshold; /* min message size to have star kick in */
  int scatter_threshold; /* min message size to have star kick in */

  /* flag to indicate where is the control coming from, App or within BG lib */
  unsigned char internal_control_flow;

  unsigned char agree_on_callsite;

  /* env variable setting the levels to trace back a call */
  int traceback_levels;
  int debug;

  int bcast_algorithms;
  int barrier_algorithms;
  int alltoall_algorithms;
  int allreduce_algorithms;
  int allgather_algorithms;
  int allgatherv_algorithms;
  int reduce_algorithms;
  int scatter_algorithms;
  int gather_algorithms;

  unsigned invocs_per_algorithm;

  char mpis[STAR_ROUTINES][20];

} STAR_Info;

extern STAR_Info STAR_info;
extern FILE * MPIDO_STAR_fd;
extern char * MPID_Executable_name;

extern STAR_Algorithm * repository_ptr;
extern STAR_Algorithm * STAR_bcast_repository;
extern STAR_Algorithm * STAR_allreduce_repository;
extern STAR_Algorithm * STAR_reduce_repository;
extern STAR_Algorithm * STAR_allgather_repository;
extern STAR_Algorithm * STAR_allgatherv_repository;
extern STAR_Algorithm * STAR_alltoall_repository;
extern STAR_Algorithm * STAR_gather_repository;
extern STAR_Algorithm * STAR_scatter_repository;
extern STAR_Algorithm * STAR_barrier_repository;

extern void STAR_InitRepositories();
extern void STAR_FreeMem();

int  STAR_DisplayStatistics(MPID_Comm *);

void STAR_AssignBestAlgorithm(STAR_Tuning_Session *);
void STAR_NextAlgorithm(STAR_Tuning_Session *,
			STAR_Callsite *, int);
int  STAR_SortAlgorithms(STAR_Tuning_Session *);
void STAR_CheckPerformanceOfBestAlg(STAR_Tuning_Session *);
void STAR_ComputePerformance(STAR_Tuning_Session *,
			     double *,
			     int);
STAR_Tuning_Session *
STAR_GetTuningSession(STAR_Callsite *,
		      STAR_Algorithm *,
		      int);

STAR_Tuning_Session *
STAR_AssembleSession(STAR_Callsite *,
		     STAR_Algorithm *,
		     int);

void STAR_CreateSession(STAR_Tuning_Session **,
			STAR_Callsite *,
			STAR_Algorithm *, int);

int  STAR_ProcessMonitorPhase(STAR_Tuning_Session *, double);
void STAR_ProcessTuningPhase(STAR_Tuning_Session *, double);

int STAR_Bcast(char *,
	       int,
	       STAR_Callsite *,
	       STAR_Algorithm *,
	       int);

int STAR_Reduce(void * sbuff,
		void * rbuff,
		int count,
		DCMF_Dt dcmf_data,
		DCMF_Op dcmf_op,
		MPI_Datatype datatype,
		int root,
		STAR_Callsite * collective_site,
		STAR_Algorithm * repo,
		int total_algs);

int STAR_Allreduce(void *,
		   void *,
		   int,
		   DCMF_Dt,
		   DCMF_Op,
		   MPI_Datatype,
		   STAR_Callsite *,
		   STAR_Algorithm *,
		   int);

int STAR_Scatter(void * sendbuf,
		 int sendcount,
		 MPI_Datatype sendtype,
		 void * recvbuf,
		 int recvcount,
		 MPI_Datatype recvtype,
		 int root,
		 STAR_Callsite * collective_site,
		 STAR_Algorithm * repo,
		 int total_algs);

int STAR_Gather(void * sendbuf,
		int sendcount,
		MPI_Datatype sendtype,
		void * recvbuf,
		int recvcount,
		MPI_Datatype recvtype,
		int root,
		STAR_Callsite * collective_site,
		STAR_Algorithm * repo,
		int total_algs);

int STAR_Allgather(void * sendbuf,
		   int sendcount,
		   MPI_Datatype sendtype,
		   void * recvbuf,
		   int recvcount,
		   MPI_Datatype recvtype,
		   MPI_Aint send_true_lb,
		   MPI_Aint recv_true_lb,
		   size_t send_size,
		   size_t recv_size,
		   STAR_Callsite * collective_site,
		   STAR_Algorithm * repo,
		   int total_algs);

int STAR_Allgatherv(void * sendbuf,
		    int sendcount,
		    MPI_Datatype sendtype,
		    void * recvbuf,
		    int * recvcounts,
		    int buffer_sum,
		    int * displs,
		    MPI_Datatype recvtype,
		    MPI_Aint send_true_lb,
		    MPI_Aint recv_true_lb,
		    size_t send_size,
		    size_t recv_size,
		    STAR_Callsite * collective_site,
		    STAR_Algorithm * repo,
		    int total_algs);

int STAR_Alltoall(void * sendbuf,
		  int sendcount,
		  MPI_Datatype sendtype,
		  void * recvbuf,
		  int recvcount,
		  MPI_Datatype recvtype,
		  STAR_Callsite * collective_site,
		  STAR_Algorithm * repo,
		  int total_algs);
#endif


text:
<?php
namespace Scalr\Service\CloudStack\DataType;

/**
 * AbstractListDataType
 *
 * @author   Vlad Dobrovolskiy  <v.dobrovolskiy@scalr.com>
 * @since    4.5.2
 */
abstract class AbstractListDataType extends \ArrayIterator
{

    /**
     * This method must return class name of the values for the list.
     * This list will restrict.
     *
     * @return  string Return class name.
     */
    abstract public function getClass();

    /**
     * Constructor
     *
     * @param   array   $array   Array of the objects.
     * @throws  \InvalidArgumentException
     */
    public function __construct($array = array())
    {
        $strictClass = $this->getClass();
        if ($strictClass !== null) {
            foreach ($array as $v) {
                if (!(is_a($v, $strictClass))) {
                    throw new \InvalidArgumentException(sprintf('Only Array of ' . $strictClass . ' objects is allowed!'));
                }
            }
        }
        parent::__construct($array);
    }

    /**
     * {@inheritdoc}
     * @see ArrayIterator::append()
     */
    public function append($value)
    {
        $strictClass = $this->getClass();
        if ($strictClass !== null && !(is_a($value, $strictClass))) {
            throw new \InvalidArgumentException(sprintf('Only %s object is allowed to append!', $strictClass));
        }
        parent::append($value);
    }

    /**
     * Transforms list to Array
     *
     * @return  Array Returns array
     */
    public function toArray()
    {
        $result = array();

        foreach ($this as $data) {
            $result[] = $data->toArray();
        }

        return $result;
    }

}


text:
var hotChocolate = angular.module("hotChocolate");
hotChocolate.factory('query',function($http) {
     return {
       saveQuery: function (parameters, connId) {
         var params = {};
         params.parameters = parameters;
         params.connId = connId;
         var req = {
            method: 'POST',
            url: '/query/new',
            data: {parameter: JSON.stringify(params)}
          };
         return $http(req);
       },
       getSavedQueries: function (connId) {
         var req = {
            method: 'GET',
            url: '/query/byUser/byConn',
            data: {connId: connId}
          };
         return $http(req);
       }
     };
  });


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Alokasi extends CoreModel {

    public function __construct()
    {
        parent::__construct();

    }

    public function add($data = array()){
    	$rules = array(
            array('field' => 'uid', 'label' => 'Petugas', 'rules' => 'required|numeric'),
            array('field' => 'irigasiid', 'label' => 'Lokasi', 'rules' => 'required|numeric'),
            array('field' => 'type', 'label' => 'Type', 'rules' => 'required|numeric')
        );

        if (!$this->set_data($rules, $data)) {
            $this->umsg = $this->msg;
            return false;
        }

        if($this->db->insert('alokasi', $data)){
        	$this->umsg = "Input data berhasil";
        	return true;
        }else{
        	$this->umsg = $this->db->error();
        	return false;
        }

    }

    public function get($uid){
        $sql = "select aid,username,u.nama, i.nama as irigasi, desa, kecamatan, latitude, longitude, type
            from alokasi a
            join users u on a.uid = u.uid
            join irigasi i on a.irigasiid = i.irigasiid
            where a.uid = $uid
            Order by a.irigasiid";

        return $this->db->query($sql)->result();
    }

    public function getall(){
    	$sql = "select aid,username,u.nama, i.nama as irigasi, desa, kecamatan, latitude, longitude, type
			from alokasi a
			join users u on a.uid = u.uid
			join irigasi i on a.irigasiid = i.irigasiid
			Order by a.irigasiid";

		return $this->db->query($sql)->result();
    }

    public function del($id){
        return $this->db->delete('alokasi', array("aid"=>$id));
    }

}


text:
from dal import autocomplete

from django.conf.urls import url

from .models import TModel

urlpatterns = [
    url(
        'test-autocomplete/$',
        autocomplete.Select2QuerySetView.as_view(model=TModel),
        name='select2_fk',
    ),
]


text:
package com.thoughtworks.go.domain.builder.pluggableTask;

import com.thoughtworks.go.plugin.api.task.Console;
import com.thoughtworks.go.util.command.StreamPumper;
import com.thoughtworks.go.work.DefaultGoPublisher;

import java.io.InputStream;
import java.util.Map;

public class PluggableTaskConsole implements Console {
    public static final String MASK_VALUE = "********";
    private final DefaultGoPublisher publisher;

    public PluggableTaskConsole(DefaultGoPublisher publisher) {
        this.publisher = publisher;
    }

    @Override
    public void printLine(String line) {
        publisher.consumeLine(line);
    }

    @Override
    public void readErrorOf(InputStream in) {
        StreamPumper.pump(in, publisher, "", null);
    }

    @Override
    public void readOutputOf(InputStream in) {
        StreamPumper.pump(in, publisher, "", null);
    }

    @Override
    public void printEnvironment(Map<String, String> environment, SecureEnvVarSpecifier secureEnvVarSpecifier) {
        publisher.consumeLine("Environment variables: ");
        for (String key : environment.keySet()) {
            boolean secure = secureEnvVarSpecifier.isSecure(key);
            publisher.consumeLine(String.format("Name= %s  Value= %s", key, secure ? MASK_VALUE : environment.get(key)));
        }
    }
}


text:
package org.teavm.chromerdp;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.teavm.chromerdp.data.*;
import org.teavm.chromerdp.messages.*;
import org.teavm.debugging.javascript.*;

/**
 *
 * @author Alexey Andreev
 */
public class ChromeRDPDebugger implements JavaScriptDebugger, ChromeRDPExchangeConsumer {
    private static final Logger logger = LoggerFactory.getLogger(ChromeRDPDebugger.class);
    private static final Object dummy = new Object();
    private ChromeRDPExchange exchange;
    private ConcurrentMap<JavaScriptDebuggerListener, Object> listeners = new ConcurrentHashMap<>();
    private ConcurrentMap<JavaScriptLocation, RDPBreakpoint> breakpointLocationMap = new ConcurrentHashMap<>();
    private ConcurrentMap<RDPBreakpoint, Object> breakpoints = new ConcurrentHashMap<>();
    private volatile RDPCallFrame[] callStack = new RDPCallFrame[0];
    private ConcurrentMap<String, String> scripts = new ConcurrentHashMap<>();
    private ConcurrentMap<String, String> scriptIds = new ConcurrentHashMap<>();
    private boolean suspended;
    private ObjectMapper mapper = new ObjectMapper();
    private ConcurrentMap<Integer, ResponseHandler> responseHandlers = new ConcurrentHashMap<>();
    private AtomicInteger messageIdGenerator = new AtomicInteger();
    private Lock breakpointLock = new ReentrantLock();

    private List<JavaScriptDebuggerListener> getListeners() {
        return new ArrayList<>(listeners.keySet());
    }

    @Override
    public void setExchange(ChromeRDPExchange exchange) {
        if (this.exchange == exchange) {
            return;
        }
        if (this.exchange != null) {
            this.exchange.removeListener(exchangeListener);
        }
        this.exchange = exchange;
        if (exchange != null) {
            for (RDPBreakpoint breakpoint : breakpoints.keySet().toArray(new RDPBreakpoint[0])) {
                updateBreakpoint(breakpoint);
            }
            for (JavaScriptDebuggerListener listener : getListeners()) {
                listener.attached();
            }
        } else {
            suspended = false;
            callStack = null;
            for (JavaScriptDebuggerListener listener : getListeners()) {
                listener.detached();
            }
        }
        if (this.exchange != null) {
            this.exchange.addListener(exchangeListener);
        }
    }

    private ChromeRDPExchangeListener exchangeListener = new ChromeRDPExchangeListener() {
        @Override public void received(String messageText) throws IOException {
            receiveMessage(messageText);
        }
    };

    private void receiveMessage(final String messageText) {
        new Thread() {
            @Override public void run() {
                try {
                    JsonNode jsonMessage = mapper.readTree(messageText);
                    if (jsonMessage.has("id")) {
                        Response response = mapper.reader(Response.class).readValue(jsonMessage);
                        if (response.getError() != null) {
                            if (logger.isWarnEnabled()) {
                                logger.warn("Error message #{} received from browser: {}", jsonMessage.get("id"),
                                        response.getError().toString());
                            }
                        }
                        responseHandlers.remove(response.getId()).received(response.getResult());
                    } else {
                        Message message = mapper.reader(Message.class).readValue(messageText);
                        if (message.getMethod() == null) {
                            return;
                        }
                        switch (message.getMethod()) {
                            case "Debugger.paused":
                                firePaused(parseJson(SuspendedNotification.class, message.getParams()));
                                break;
                            case "Debugger.resumed":
                                fireResumed();
                                break;
                            case "Debugger.scriptParsed":
                                scriptParsed(parseJson(ScriptParsedNotification.class, message.getParams()));
                                break;
                        }
                    }
                } catch (Exception e) {
                    if (logger.isErrorEnabled()) {
                        logger.error("Error receiving message from Google Chrome", e);
                    }
                }
            }
        }.start();
    }

    private synchronized void firePaused(SuspendedNotification params) {
        suspended = true;
        CallFrameDTO[] callFrameDTOs = params.getCallFrames();
        RDPCallFrame[] callStack = new RDPCallFrame[callFrameDTOs.length];
        for (int i = 0; i < callStack.length; ++i) {
            callStack[i] = map(callFrameDTOs[i]);
        }
        this.callStack = callStack;
        for (JavaScriptDebuggerListener listener : getListeners()) {
            listener.paused();
        }
    }

    private synchronized void fireResumed() {
        suspended = false;
        callStack = null;
        for (JavaScriptDebuggerListener listener : getListeners()) {
            listener.resumed();
        }
    }

    private synchronized void scriptParsed(ScriptParsedNotification params) {
        if (scripts.putIfAbsent(params.getScriptId(), params.getUrl()) != null) {
            return;
        }
        scriptIds.put(params.getUrl(), params.getScriptId());
        for (JavaScriptDebuggerListener listener : getListeners()) {
            listener.scriptAdded(params.getUrl());
        }
    }

    @Override
    public void addListener(JavaScriptDebuggerListener listener) {
        listeners.put(listener, dummy);
    }

    @Override
    public void removeListener(JavaScriptDebuggerListener listener) {
        listeners.remove(listener);
    }

    @Override
    public void suspend() {
        if (exchange == null) {
            return;
        }
        Message message = new Message();
        message.setMethod("Debugger.pause");
        sendMessage(message);
    }

    @Override
    public void resume() {
        if (exchange == null) {
            return;
        }
        Message message = new Message();
        message.setMethod("Debugger.resume");
        sendMessage(message);
    }

    @Override
    public void stepInto() {
        if (exchange == null) {
            return;
        }
        Message message = new Message();
        message.setMethod("Debugger.stepInto");
        sendMessage(message);
    }

    @Override
    public void stepOut() {
        if (exchange == null) {
            return;
        }
        Message message = new Message();
        message.setMethod("Debugger.stepOut");
        sendMessage(message);
    }

    @Override
    public void stepOver() {
        if (exchange == null) {
            return;
        }
        Message message = new Message();
        message.setMethod("Debugger.stepOver");
        sendMessage(message);
    }

    @Override
    public void continueToLocation(JavaScriptLocation location) {
        if (exchange == null) {
            return;
        }
        Message message = new Message();
        message.setMethod("Debugger.continueToLocation");
        ContinueToLocationCommand params = new ContinueToLocationCommand();
        params.setLocation(unmap(location));
        message.setParams(mapper.valueToTree(params));
        sendMessage(message);
    }

    @Override
    public boolean isSuspended() {
        return exchange != null && suspended;
    }

    @Override
    public boolean isAttached() {
        return exchange != null;
    }

    @Override
    public void detach() {
        if (exchange != null) {
            exchange.disconnect();
        }
    }

    @Override
    public JavaScriptCallFrame[] getCallStack() {
        if (exchange == null) {
            return null;
        }
        JavaScriptCallFrame[] callStack = this.callStack;
        return callStack != null ? callStack.clone() : null;
    }

    @Override
    public JavaScriptBreakpoint createBreakpoint(JavaScriptLocation location) {
        RDPBreakpoint breakpoint;

        breakpointLock.lock();
        try {
            breakpoint = breakpointLocationMap.get(location);
            if (breakpoint == null) {
                breakpoint = new RDPBreakpoint(this, location);
                breakpointLocationMap.put(location, breakpoint);
                updateBreakpoint(breakpoint);
            }
            breakpoint.referenceCount.incrementAndGet();
            breakpoints.put(breakpoint, dummy);
        } finally {
            breakpointLock.unlock();
        }

        return breakpoint;
    }

    void destroyBreakpoint(RDPBreakpoint breakpoint) {
        if (breakpoint.referenceCount.decrementAndGet() > 0) {
            return;
        }
        breakpointLock.lock();
        try {
            if (breakpoint.referenceCount.get() > 0) {
                return;
            }
            breakpointLocationMap.remove(breakpoint.getLocation());
            breakpoints.remove(breakpoint);
            if (breakpoint.chromeId != null) {
                if (logger.isInfoEnabled()) {
                    logger.info("Removing breakpoint at {}", breakpoint.getLocation());
                }
                Message message = new Message();
                message.setMethod("Debugger.removeBreakpoint");
                RemoveBreakpointCommand params = new RemoveBreakpointCommand();
                params.setBreakpointId(breakpoint.chromeId);
                message.setParams(mapper.valueToTree(params));
                sendMessage(message);
            }
            breakpoint.debugger = null;
            breakpoint.chromeId = null;
        } finally {
            breakpointLock.unlock();
        }
    }

    void fireScriptAdded(String script) {
        for (JavaScriptDebuggerListener listener : getListeners()) {
            listener.scriptAdded(script);
        }
    }

    void updateBreakpoint(final RDPBreakpoint breakpoint) {
        if (exchange == null || breakpoint.chromeId != null) {
            return;
        }
        final Message message = new Message();
        message.setId(messageIdGenerator.incrementAndGet());
        message.setMethod("Debugger.setBreakpoint");
        SetBreakpointCommand params = new SetBreakpointCommand();
        params.setLocation(unmap(breakpoint.getLocation()));
        message.setParams(mapper.valueToTree(params));
        if (logger.isInfoEnabled()) {
            logger.info("Setting breakpoint at {}, message id is ", breakpoint.getLocation(), message.getId());
        }
        ResponseHandler handler = new ResponseHandler() {
            @Override public void received(JsonNode node) throws IOException {
                if (node != null) {
                    SetBreakpointResponse response = mapper.reader(SetBreakpointResponse.class).readValue(node);
                    breakpoint.chromeId = response.getBreakpointId();
                } else {
                    if (logger.isWarnEnabled()) {
                        logger.warn("Error setting breakpoint at {}, message id is {}",
                                breakpoint.getLocation(), message.getId());
                    }
                    breakpoint.chromeId = null;
                }
                for (JavaScriptDebuggerListener listener : getListeners()) {
                    listener.breakpointChanged(breakpoint);
                }
            }
        };
        responseHandlers.put(message.getId(), handler);
        sendMessage(message);
    }

    List<RDPLocalVariable> getScope(String scopeId) {
        if (exchange == null) {
            return Collections.emptyList();
        }
        Message message = new Message();
        message.setId(messageIdGenerator.incrementAndGet());
        message.setMethod("Runtime.getProperties");
        GetPropertiesCommand params = new GetPropertiesCommand();
        params.setObjectId(scopeId);
        params.setOwnProperties(true);
        message.setParams(mapper.valueToTree(params));
        final BlockingQueue<List<RDPLocalVariable>> sync = new LinkedTransferQueue<>();
        responseHandlers.put(message.getId(), new ResponseHandler() {
            @Override public void received(JsonNode node) throws IOException {
                GetPropertiesResponse response = mapper.reader(GetPropertiesResponse.class).readValue(node);
                sync.add(parseProperties(response.getResult()));
            }
        });
        sendMessage(message);
        try {
            return sync.take();
        } catch (InterruptedException e) {
            return Collections.emptyList();
        }
    }

    String getClassName(String objectId) {
        if (exchange == null) {
            return null;
        }
        Message message = new Message();
        message.setId(messageIdGenerator.incrementAndGet());
        message.setMethod("Runtime.callFunctionOn");
        CallFunctionCommand params = new CallFunctionCommand();
        CallArgumentDTO arg = new CallArgumentDTO();
        arg.setObjectId(objectId);
        params.setObjectId(objectId);
        params.setArguments(new CallArgumentDTO[] { arg });
        params.setFunctionDeclaration("$dbg_class");
        message.setParams(mapper.valueToTree(params));
        final BlockingQueue<String> sync = new LinkedTransferQueue<>();
        responseHandlers.put(message.getId(), new ResponseHandler() {
            @Override public void received(JsonNode node) throws IOException {
                if (node == null) {
                    sync.add("");
                } else {
                    CallFunctionResponse response = mapper.reader(CallFunctionResponse.class).readValue(node);
                    RemoteObjectDTO result = response.getResult();
                    sync.add(result.getValue() != null ? result.getValue().getTextValue() : "");
                }
            }
        });
        sendMessage(message);
        try {
            String result = sync.take();
            return result.isEmpty() ? null : result;
        } catch (InterruptedException e) {
            return null;
        }
    }

    String getRepresentation(String objectId) {
        if (exchange == null) {
            return null;
        }
        Message message = new Message();
        message.setId(messageIdGenerator.incrementAndGet());
        message.setMethod("Runtime.callFunctionOn");
        CallFunctionCommand params = new CallFunctionCommand();
        CallArgumentDTO arg = new CallArgumentDTO();
        arg.setObjectId(objectId);
        params.setObjectId(objectId);
        params.setArguments(new CallArgumentDTO[] { arg });
        params.setFunctionDeclaration("$dbg_repr");
        message.setParams(mapper.valueToTree(params));
        final BlockingQueue<RepresentationWrapper> sync = new LinkedTransferQueue<>();
        responseHandlers.put(message.getId(), new ResponseHandler() {
            @Override public void received(JsonNode node) throws IOException {
                if (node == null) {
                    sync.add(new RepresentationWrapper(null));
                } else {
                    CallFunctionResponse response = mapper.reader(CallFunctionResponse.class).readValue(node);
                    RemoteObjectDTO result = response.getResult();
                    sync.add(new RepresentationWrapper(result.getValue() != null
                            ? result.getValue().getTextValue() : null));
                }
            }
        });
        sendMessage(message);
        try {
            RepresentationWrapper result = sync.take();
            return result.repr;
        } catch (InterruptedException e) {
            return null;
        }
    }

    private static class RepresentationWrapper {
        String repr;

        public RepresentationWrapper(String repr) {
            super();
            this.repr = repr;
        }
    }

    private List<RDPLocalVariable> parseProperties(PropertyDescriptorDTO[] properties) {
        List<RDPLocalVariable> variables = new ArrayList<>();
        if (properties != null) {
            for (PropertyDescriptorDTO property : properties) {
                RemoteObjectDTO remoteValue = property.getValue();
                RDPValue value;
                if (remoteValue != null && remoteValue.getType() != null) {
                    switch (remoteValue.getType()) {
                        case "undefined":
                            value = new RDPValue(this, "undefined", "undefined", null, false);
                            break;
                        case "object":
                        case "function":
                            value = new RDPValue(this, null, remoteValue.getType(), remoteValue.getObjectId(), true);
                            break;
                        default:
                            value = new RDPValue(this, remoteValue.getValue().asText(), remoteValue.getType(),
                                    remoteValue.getObjectId(), false);
                            break;
                    }
                } else {
                    value = new RDPValue(this, "null", "null", "null", false);
                }

                RDPLocalVariable var = new RDPLocalVariable(property.getName(), value);
                variables.add(var);
            }
        }
        return variables;
    }

    private <T> T parseJson(Class<T> type, JsonNode node) throws IOException {
        return mapper.reader(type).readValue(node);
    }

    private void sendMessage(Message message) {
        if (exchange == null) {
            return;
        }
        try {
            exchange.send(mapper.writer().writeValueAsString(message));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    RDPCallFrame map(CallFrameDTO dto) {
        String scopeId = null;
        RDPValue thisObject = null;
        RDPValue closure = null;
        for (ScopeDTO scope : dto.getScopeChain()) {
            if (scope.getType().equals("local")) {
                scopeId = scope.getObject().getObjectId();
            } else if (scope.getType().equals("closure")) {
                closure = new RDPValue(this, scope.getObject().getDescription(), scope.getObject().getType(),
                        scope.getObject().getObjectId(), true);
            } else if (scope.getType().equals("global")) {
                thisObject = new RDPValue(this, scope.getObject().getDescription(), scope.getObject().getType(),
                        scope.getObject().getObjectId(), true);
            }
        }
        return new RDPCallFrame(this, dto.getCallFrameId(), map(dto.getLocation()), new RDPScope(this, scopeId),
                thisObject, closure);
    }

    JavaScriptLocation map(LocationDTO dto) {
        return new JavaScriptLocation(scripts.get(dto.getScriptId()), dto.getLineNumber(), dto.getColumnNumber());
    }

    LocationDTO unmap(JavaScriptLocation location) {
        LocationDTO dto = new LocationDTO();
        dto.setScriptId(scriptIds.get(location.getScript()));
        dto.setLineNumber(location.getLine());
        dto.setColumnNumber(location.getColumn());
        return dto;
    }

    interface ResponseHandler {
        void received(JsonNode node) throws IOException;
    }
}


text:
import {actionTypes} from '../actions/actionTypes'

const initialValue = {
  advisor: '',
  category: '',
  search: null
}

export const filters = (state = initialValue, action) => {
  switch (action.type) {

  case actionTypes.SET_ADVISOR_FILTER:
    return { ...initialValue, advisor: action.payload }

  case actionTypes.SET_CATEGORY_FILTER:
    return { ...initialValue, category: action.payload }

  case actionTypes.SEARCH_PROJECT_SUCCEEDED:
    return { ...initialValue, search: action.payload } // reset advisor and category to ''

  case actionTypes.RESET_SEARCH:
    return { ...state, search: null }

  default:
    return state
  }
}


text:
package liquibase.change.core;

import liquibase.change.AbstractChange;
import liquibase.change.DatabaseChange;
import liquibase.change.ChangeMetaData;
import liquibase.change.DatabaseChangeProperty;
import liquibase.database.Database;
import liquibase.statement.SqlStatement;
import liquibase.statement.core.DropIndexStatement;

/**
 * Drops an existing index.
 */
@DatabaseChange(name="dropIndex", description = "Drops an existing index", priority = ChangeMetaData.PRIORITY_DEFAULT, appliesTo = "index")
public class DropIndexChange extends AbstractChange {

    private String schemaName;
    private String indexName;
    private String tableName;

    private String associatedWith;
    private String catalogName;

    @DatabaseChangeProperty(mustEqualExisting ="index.schema")
    public String getSchemaName() {
        return schemaName;
    }

    public void setSchemaName(String schemaName) {
        this.schemaName = schemaName;
    }

    @DatabaseChangeProperty(mustEqualExisting = "index", description = "Name of the index to drop")
    public String getIndexName() {
        return indexName;
    }

    public void setIndexName(String indexName) {
        this.indexName = indexName;
    }

    @DatabaseChangeProperty(mustEqualExisting = "index.table", description = "Name fo the indexed table.")
    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    @Override
    public SqlStatement[] generateStatements(Database database) {
        return new SqlStatement[] {
            new DropIndexStatement(getIndexName(), getCatalogName(), getSchemaName(), getTableName(), getAssociatedWith())
        };
    }

    @Override
    public String getConfirmationMessage() {
        return "Index " + getIndexName() + " dropped from table " + getTableName();
    }

    @DatabaseChangeProperty(isChangeProperty = false)
    public String getAssociatedWith() {
        return associatedWith;
    }

    public void setAssociatedWith(String associatedWith) {
        this.associatedWith = associatedWith;
    }

    @DatabaseChangeProperty(mustEqualExisting = "index.catalog", since = "3.0")
    public String getCatalogName() {
        return catalogName;
    }

    public void setCatalogName(String catalogName) {
        this.catalogName = catalogName;
    }
}


text:
/*
  Created by 'myth' on Mar 16. 2016

  Snekify is licenced under the MIT licence.
*/

module.exports = require('./core/snekify')


text:
<?
/**
*
* @package Utilities
*/
defined('C5_EXECUTE') or die("Access Denied.");
class DatabaseItemList extends Concrete5_Library_DatabaseItemList {}
class DatabaseItemListColumn extends Concrete5_Library_DatabaseItemListColumn {}
class DatabaseItemListAttributeKeyColumn extends Concrete5_Library_DatabaseItemListAttributeKeyColumn {}
class DatabaseItemListColumnSet extends Concrete5_Library_DatabaseItemListColumnSet {}


text:
package br.com.urbano.controller.cliente.outros;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import br.com.urbano.DAO.cliente.DAOCliente;
import br.com.urbano.DAO.cliente.DAOOutros;
import br.com.urbano.DAO.login.DAOLogin;
import br.com.urbano.controller.Constants;
import br.com.urbano.controller.cliente.apoio.outros.Emails;
import br.com.urbano.exceptions.EmptyException;
import br.com.urbano.exceptions.UnauthorizedException;
import br.com.urbano.modelo.cliente.Cliente;
import br.com.urbano.modelo.cliente.outros.Email;

@RestController
public class EmailController {
	@Autowired
	private DAOOutros outrosDAO;

	@Autowired
	private DAOLogin loginDAO;

	@Autowired
	private DAOCliente clienteDAO;

	/**
	 * Exibindo Emails
	 *
	 * @param cookien
	 * @param request
	 * @return
	 */
	@RequestMapping(value = Constants.EMAIL, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	private ResponseEntity<Object> Exibir(@CookieValue(name = "token", required = true) String cookien,
			HttpServletRequest request) {
		long id_login;
		// Operações com o cookie
		try {
			Cookie cookie = request.getCookies()[request.getCookies().length - 1];
			id_login = loginDAO.ChecarCookieCompleta(cookie);
		} catch (NullPointerException e) {
			// TODO: handle exception
			return new ResponseEntity<>(HttpStatus.NETWORK_AUTHENTICATION_REQUIRED);
		} catch (UnauthorizedException e) {
			// TODO Auto-generated catch block
			return new ResponseEntity<>(HttpStatus.UNAUTHORIZED);
		}

		try {
			Cliente cliente = (Cliente) clienteDAO.Exibir(id_login);
			return ResponseEntity.status(HttpStatus.OK).body(new Emails(outrosDAO.Emails(cliente.getId())));
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = Constants.EMAIL_VARIABLE, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
	private ResponseEntity<Email> Exibir(@CookieValue(name = "token", required = true) String cookien,
			HttpServletRequest request, @PathVariable(value = Constants.PATH_VARIABLE) long id_email) {
		long id_login;
		// Operações com o cookie
		try {
			Cookie cookie = request.getCookies()[request.getCookies().length - 1];
			id_login = loginDAO.ChecarCookieCompleta(cookie);
		} catch (NullPointerException e) {
			// TODO: handle exception
			return new ResponseEntity<>(HttpStatus.NETWORK_AUTHENTICATION_REQUIRED);
		} catch (UnauthorizedException e) {
			// TODO Auto-generated catch block
			return new ResponseEntity<>(HttpStatus.UNAUTHORIZED);
		}

		try {
			Cliente cliente = (Cliente) clienteDAO.Exibir(id_login);
			return ResponseEntity.status(HttpStatus.OK).body(outrosDAO.Email(cliente.getId(), id_email));
		} catch (EmptyException e) {
			// TODO: handle exception
			return new ResponseEntity<>(HttpStatus.NO_CONTENT);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
		}
	}

	/**
	 * Inserindo Emails
	 *
	 * @param cookien
	 * @param request
	 * @param response
	 * @param enderecos
	 * @return
	 */
	@RequestMapping(value = Constants.EMAIL, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
	private ResponseEntity<Object> Inserir(@CookieValue(name = "token", required = true) String cookien,
			HttpServletRequest request, HttpServletResponse response, @RequestBody Emails emails) {
		long id_login;
		// Operações com o cookie
		try {
			Cookie cookie = request.getCookies()[request.getCookies().length - 1];
			id_login = loginDAO.ChecarCookieCompleta(cookie);
		} catch (NullPointerException e) {
			// TODO: handle exception
			return new ResponseEntity<>(HttpStatus.NETWORK_AUTHENTICATION_REQUIRED);
		} catch (UnauthorizedException e) {
			// TODO Auto-generated catch block
			return new ResponseEntity<>(HttpStatus.UNAUTHORIZED);
		}

		try {
			Cliente cliente = (Cliente) clienteDAO.Exibir(id_login);
			outrosDAO.InserirEmail(emails.getEmails(), cliente);

			response.sendRedirect(request.getContextPath() + Constants.EMAIL);
			return ResponseEntity.status(HttpStatus.CREATED).body(null);
		} catch (Exception e) {
			// TODO: handle exception
			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
		}
	}

	@RequestMapping(value = Constants.EMAIL_VARIABLE, method = RequestMethod.DELETE)
	private ResponseEntity<Object> Excluir(@CookieValue(name = "token", required = true) String cookien,
			HttpServletRequest request, HttpServletResponse response,
			@PathVariable(value = Constants.PATH_VARIABLE) long id_email) {
		long id_login;
		// Operações com o cookie
		try {
			Cookie cookie = request.getCookies()[request.getCookies().length - 1];
			id_login = loginDAO.ChecarCookieCompleta(cookie);
		} catch (NullPointerException e) {
			// TODO: handle exception
			return new ResponseEntity<>(HttpStatus.NETWORK_AUTHENTICATION_REQUIRED);
		} catch (UnauthorizedException e) {
			// TODO Auto-generated catch block
			return new ResponseEntity<>(HttpStatus.UNAUTHORIZED);
		}

		try {
			Cliente cliente = (Cliente) clienteDAO.Exibir(id_login);
			// Isto serve para ver se o ID é do endereco é do mesmo cliente
			Email email = outrosDAO.Email(cliente.getId(), id_email);
			outrosDAO.ExcluirEmail(email.getId());

			return ResponseEntity.status(HttpStatus.OK).body(null);

		} catch (EmptyException e) {
			// TODO: handle exception
			return new ResponseEntity<>(HttpStatus.NO_CONTENT);
		} catch (Exception e) {
			// TODO: handle exception
			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
		}
	}

}