text:
<?php

declare(strict_types=1);

namespace Sylius\Bundle\AdminBundle\Form\Extension;

use Sylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionActionType;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Twig\Environment;

final class CatalogPromotionActionTypeExtension extends AbstractTypeExtension
{
    private array $actionTypes = [];

    private array $actionConfigurationTypes;

    private Environment $twig;

    public function __construct(iterable $actionConfigurationTypes, Environment $twig)
    {
        foreach ($actionConfigurationTypes as $type => $formType) {
            $this->actionConfigurationTypes[$type] = get_class($formType);
            $this->actionTypes['sylius.form.catalog_promotion.action.' . $type] = $type;
        }

        $this->twig = $twig;
    }

    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('type', ChoiceType::class, [
                'label' => 'sylius.ui.type',
                'choices' => $this->actionTypes,
                'choice_attr' => function(?string $type) use ($builder): array {
                    return [
                        'data-configuration' => $this->twig->render(
                            '@SyliusAdmin/CatalogPromotion/_action.html.twig',
                            ['field' => $builder->create(
                                'configuration',
                                $this->actionConfigurationTypes[$type],
                                ['label' => false, 'csrf_protection' => false]
                            )->getForm()->createView()]
                        )
                    ];
                }
            ])
        ;
    }

    public static function getExtendedTypes(): iterable
    {
        return [CatalogPromotionActionType::class];
    }
}


text:
<?php
namespace Stackify\Log\Transport\Config;

/**
 * Agent Config Class
 */
class Agent extends AbstractConfig
{
    const SOCKET_PROTOCOL = 'tcp';
    const SOCKET_HOST = '127.0.0.1';
    const SOCKET_PORT = 10601;
    const SOCKET_TIMEOUT_CONNECT = 1;
    const SOCKET_TIMEOUT_WRITE = 1;
    const SOCKET_MAX_CONNECT_ATTEMPTS = 2;
    const DOMAIN_SOCKET_PATH = '/usr/local/stackify/stackify.sock';

    /**
     * Socket protocol
     *
     * @var integer
     */
    protected $Protocol;
    /**
     * Socket hostname
     *
     * @var string
     */
    protected $Host;
    /**
     * Socket port
     *
     * @var integer
     */
    protected $Port;
    /**
     * Socket connect timeout
     *
     * @var integer
     */
    protected $SocketTimeoutConnect;
    /**
     * Socket write timeout
     *
     * @var integer
     */
    protected $SocketTimeoutWrite;
    /**
     * Socket connect max attempts
     *
     * @var integer
     */
    protected $SocketMaxConnectAttempts;
    /**
     * Socket domain path
     *
     * @var string
     */
    protected $DomainSocketPath;
    /**
     * Api Base Url
     *
     * @var string
     */
    protected $ApiBaseUrl;
    /**
     * Api Url Call Logs Endpoint
     *
     * @var string
     */
    protected $ApiCallLogsEndpoint;
    /**
     * Api Max Time out
     *
     * @var string
     */
    protected $ApiMaxTimeout;
    /**
     * Api Version Header
     *
     * @var string
     */
    protected $ApiVersionHeader;
    /**
     * Valid protocols
     *
     * @var array
     */
    protected $ValidProtocols = array('tcp', 'udp');
    /**
     * Log message filters
     *
     * @var string
     */
    protected $LogMessageFilters;
    /**
     * Mask error stack trace arguments
     *
     * @var boolean
     */
    protected $MaskErrorStackTraceArguments;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->Protocol = static::SOCKET_PROTOCOL;
        $this->Host = static::SOCKET_HOST;
        $this->Port = static::SOCKET_PORT;
        $this->SocketTimeoutConnect = static::SOCKET_TIMEOUT_CONNECT;
        $this->SocketTimeoutWrite = static::SOCKET_TIMEOUT_WRITE;
        $this->SocketMaxConnectAttempts = static::SOCKET_MAX_CONNECT_ATTEMPTS;
        $this->DomainSocketPath = static::DOMAIN_SOCKET_PATH;
        $this->ApiBaseUrl = Api::API_BASE_URL;
        $this->ApiCallLogsEndpoint = Api::API_CALL_LOGS;
        $this->ApiMaxTimeout = Api::API_MAX_TIME;
        $this->ApiVersionHeader = Api::API_VERSION_HEADER;

        parent::__construct();
    }

    /**
     * Set protocol for the agent transport
     *
     * @param string $protocol Protocol for the transport
     *
     * @return void
     */
    public function setProtocol($protocol = null)
    {
        if (in_array($protocol, $this->ValidProtocols) == false) {
            $this->logError('[Protocol] is not valid.');
            return;
        }

        $this->Protocol = $protocol;
    }

    /**
     * Set hostname for the agent transport
     *
     * @param string $host Hostname
     *
     * @return void
     */
    public function setHost($host = null)
    {
        if ($host == null) {
            $this->logError('[Host] is not valid.');
        }

        // TODO: Hostname checking
        $this->Host = $host;
    }

    /**
     * Set port for the agent transport
     *
     * @param integer $port Port
     *
     * @return void
     */
    public function setPort($port = null)
    {
        if (is_numeric($port) == false) {
            $this->logError('[Port] is not an integer.');
            return;
        }

        if ($port < 0 && $port > 65535) {
            $this->logError('[Port] is not valid.');
            return;
        }

        $this->Port = $port;
    }

    /**
     * Set socket connection timeout
     *
     * @param integer $timeout Timeout
     *
     * @return void
     */
    public function setSocketTimeoutConnect($timeout = null)
    {
        if (is_numeric($timeout) == false) {
            $this->logError('[SocketTimeoutConnect] is not an integer.');
            return;
        }

        $this->SocketTimeoutConnect = $timeout;
    }

    /**
     * Set socket write timeout
     *
     * @param integer $timeout Timeout
     *
     * @return void
     */
    public function setSocketTimeoutWrite($timeout )
    {
        if (is_numeric($timeout) == false) {
            $this->logError('[SocketTimeoutWrite] is not an integer.');
            return;
        }

        $this->SocketTimeoutWrite = $timeout;
    }

    /**
     * Set socket max connection attempts
     *
     * @param integer $attempts Attempts
     *
     * @return void
     */
    public function setSocketMaxConnectAttempts($attempts)
    {
        if (is_numeric($attempts) == false) {
            $this->logError('[SocketMaxConnectAttempts] is not an integer.');
            return;
        }

        $this->SocketMaxConnectAttempts = $attempts;
    }

    /**
     * Set domain socket path
     *
     * @param string $path Path
     *
     * @return void
     */
    public function setDomainSocketPath($path)
    {
        if ($path == null) {
            $this->logError('[DomainSocketPath] is not valid.');
            return;
        }

        $this->DomainSocketPath = $path;
    }

    /**
     * Set Api Base Url
     *
     * @param string $url URL
     *
     * @return void
     */
    public function setApiBaseUrl($url)
    {
        if ($url == null) {
            $this->logError('[ApiBaseUrl] is not valid.');
            return;
        }

        $this->ApiBaseUrl = $url;
    }
    /**
     * Set Api Call Logs Endpoint
     *
     * @param string $path Path
     *
     * @return void
     */
    public function setApiCallLogsEndpoint($path)
    {
        if ($path == null) {
            $this->logError('[ApiCallLogsEndpoint] is not valid.');
            return;
        }

        $this->ApiCallLogsEndpoint = $path;
    }
    /**
     * Set Api Max Time Out
     *
     * @param integer $timeout Timeout
     *
     * @return void
     */
    public function setApiMaxTimeout($timeout = null)
    {
        if (is_numeric($timeout) == false) {
            $this->logError('[ApiMaxTimeout] is not an integer.');
            return;
        }

        $this->ApiMaxTimeout = $timeout;
    }
    /**
     * Set Api Version Header
     *
     * @param string $path Path
     *
     * @return void
     */
    public function setApiVersionHeader($path)
    {
        if ($path == null) {
            $this->logError('[ApiVersionHeader] is not valid.');
            return;
        }

        $this->ApiVersionHeader = $path;
    }

    /**
     * Get socket protocol
     *
     * @return integer
     */
    public function getProtocol()
    {
        return $this->Protocol;
    }

    /**
     * Get socket host
     *
     * @return integer
     */
    public function getHost()
    {
        return $this->Host;
    }

    /**
     * Get socket port
     *
     * @return integer
     */
    public function getPort()
    {
        return $this->Port;
    }

    /**
     * Get socket connection timeout
     *
     * @return integer
     */
    public function getSocketTimeoutConnect()
    {
        return $this->SocketTimeoutConnect;
    }

    /**
     * Get socket write timeout
     *
     * @return integer
     */
    public function getSocketTimeoutWrite()
    {
        return $this->SocketTimeoutWrite;
    }

    /**
     * Get socket max connection attempts
     *
     * @return integer
     */
    public function getSocketMaxConnectAttempts()
    {
        return $this->SocketMaxConnectAttempts;
    }

    /**
     * Get socket domain path
     *
     * @return string
     */
    public function getDomainSocketPath()
    {
        return $this->DomainSocketPath;
    }

    /**
     * Get api base url
     *
     * @return string
     */
    public function getApiBaseUrl()
    {
        return $this->ApiBaseUrl;
    }
    /**
     * Get api call logs endpoint
     *
     * @return string
     */
    public function getApiCallLogsEndpoint()
    {
        return $this->ApiCallLogsEndpoint;
    }
    /**
     * Get api max timeout
     *
     * @return integer
     */
    public function getApiMaxTimeout()
    {
        return $this->ApiMaxTimeout;
    }
    /**
     * Get api version header
     *
     * @return string
     */
    public function getApiVersionHeader()
    {
        return $this->ApiVersionHeader;
    }

    /**
     * Log message
     *
     * @param string  $message Message
     * @param mixed   $args    Log context
     * @param boolean $success Success
     *
     * @return void
     */
    protected function log($message, $args = null, $success = true)
    {
        return parent::log('['.get_class().']'.$message, $args, $success);
    }

    /**
     * Singleton attributes
     *
     * @return void
     */
    private function __clone()
    {
    }

    /**
     * Get singleton instance
     *
     * @return self
     */
    public static function getInstance()
    {
        static $instance;
        if (null === $instance) {
            $instance = new self();
        }
        return $instance;
    }

    /**
     * Set log message filtering
     *
     * @param array $filters Log message filters (custom filtering)
     *
     * @return void
     */
    public function setLogMessageFilters($filters = null)
    {
        if (empty($filters)) {
            return;
        }

        if (!is_array($filters)) {
            $this->logError('[LogMessageFilters] is not an array.');
            return;
        }

        $this->LogMessageFilters = $filters;
    }

    /**
     * Get log message filters
     *
     * @return array
     */
    public function getLogMessageFilters()
    {
        return $this->LogMessageFilters;
    }

    /**
     * Set mask error stack trace arguments
     *
     * @param boolean $maskArguments Enable or disable masking
     *
     * @return void
     */
    public function setMaskErrorStackTraceArguments($maskArguments)
    {
        $this->MaskErrorStackTraceArguments = $maskArguments;
    }

    /**
     * Get mask error stack trace arguments
     *
     * @return boolean
     */
    public function isMaskErrorStackTraceArguments()
    {
        return $this->MaskErrorStackTraceArguments;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace ampf\services\translator\impl;

use ampf\beans\BeanFactoryAccess;
use ampf\beans\impl\DefaultBeanFactoryAccess;
use ampf\services\translator\TranslatorService;
use RuntimeException;

/** @phpcs:disable SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter */
class DefaultTranslatorService implements BeanFactoryAccess, TranslatorService
{
    use DefaultBeanFactoryAccess;

    /** @var ?array<string, string> */
    protected ?array $_config = null;

    protected ?string $language = null;

    public function getKey(string $translation, bool $ignoreCase = true): ?string
    {
        $config = $this->getConfig();
        foreach ($config as $key => $value) {
            if (mb_strtolower($value) === mb_strtolower($translation)) {
                return $key;
            }
        }

        return null;
    }

    public function getLanguage(): ?string
    {
        if ($this->language === null) {
            throw new RuntimeException('No language set');
        }

        return $this->language;
    }

    public function setLanguage(string $language): void
    {
        if (trim($language) === '') {
            throw new RuntimeException();
        }

        $this->language = $language;
    }

    /** @param ?string[] $args */
    public function translate(string $key, ?array $args = null): ?string
    {
        if (trim($key) === '') {
            throw new RuntimeException();
        }

        $value = $this->getValue($key);

        if (is_array($args) && count($args) > 0) {
            $value = vsprintf($value, $args);
        }

        return $value;
    }

    /** @param array{"translation.dir": ?string} $config */
    protected function setConfig(array $config): void
    {
        if (!isset($config['translation.dir'])) {
            throw new RuntimeException();
        }

        $transFile = ($config['translation.dir'] . '/' . $this->getLanguage() . '.php');
        if (!file_exists($transFile)) {
            throw new RuntimeException();
        }

        ob_start();
        $this->_config = require $transFile;
        ob_end_clean();
    }

    /** @return array<string, string> */
    protected function getConfig(): array
    {
        if ($this->_config === null) {
            $config = $this->getBeanFactory()->get('Config');
            if (!is_array($config) || !isset($config['translation.dir'])) {
                throw new RuntimeException();
            }
            $this->setConfig($config);
        }

        if ($this->_config === null) {
            throw new RuntimeException();
        }

        return $this->_config;
    }

    protected function getValue(string $key): string
    {
        $config = $this->getConfig();
        if (!isset($config[$key])) {
            return $key;
        }

        return $config[$key];
    }
}


text:
#ifndef CAFFE2_CORE_NET_GL_H_
#define CAFFE2_CORE_NET_GL_H_

#include <vector>

#include "caffe2/core/common.h"
#include "caffe2/core/logging.h"
#include "caffe2/core/net.h"
#include "caffe2/core/registry.h"
#include "caffe2/core/tensor.h"
#include "caffe2/core/workspace.h"
#include "caffe2/proto/caffe2.pb.h"

namespace caffe2 {

// This is the very basic structure you need to run a network with
// ARM's compute library
class GLNet : public NetBase {
 private:
  bool first_run_ = true;
  Workspace* ws_;
  // record output blob for sync step in operator level benchmarking
  std::vector<string> output_blobs_;
  // record operator type and only sync after gpu op
  std::vector<bool> opengl_device_;
 public:
  GLNet(const std::shared_ptr<const NetDef>& net_def, Workspace* ws);
  bool SupportsAsync() override {
    return false;
  }

  vector<float> TEST_Benchmark(
      const int warmup_runs,
      const int main_runs,
      const bool run_individual) override;

  /*
   * This returns a list of pointers to objects stored in unique_ptrs.
   * Used by Observers.
   *
   * Think carefully before using.
   */
  vector<OperatorBase*> GetOperators() const override {
    vector<OperatorBase*> op_list;
    for (auto& op : operators_) {
      op_list.push_back(op.get());
    }
    return op_list;
  }

 protected:
  bool Run();
  bool RunAsync();
  bool DoRunAsync() override {
    return Run();
  }

  vector<unique_ptr<OperatorBase>> operators_;

  DISABLE_COPY_AND_ASSIGN(GLNet);
};

} // namespace caffe2

#endif // CAFFE2_CORE_NET_SIMPLE_H_


text:
ACCEPTED

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

#### Published in
Mycologia 27: 194 (1935)

#### Original name
Acaulopage ceratospora Drechsler, 1935

### Remarks
null


text:
function new_category() {
    name = $('#new_category_name').val();

    $.ajaxSetup({
        beforeSend: function(xhr, settings) {
            xhr.setRequestHeader("X-CSRFToken", $("input[name=csrfmiddlewaretoken]").val());
        }
    });
    $.ajax({
        type: "POST",
        url: "/recipes/new_category/",
        data: {
            name: name
        },
        success: function(data) {
            $('#new_category_name').val('');
            $('#sort_container').html(data);
        },
        error: function(data) {
            alert(gettext('Error!'));
        }
    });
}

function delete_category(id) {
    if (confirm(gettext("Are you sure to delete?"))) {
        $.ajaxSetup({
            beforeSend: function(xhr, settings) {
                xhr.setRequestHeader("X-CSRFToken", $("input[name=csrfmiddlewaretoken]").val());
            }
        });
        $.ajax({
            type: "POST",
            url: "/recipes/delete_category/",
            data: {
                id: id
            },
            success: function(data) {
                $('#sort_container').html(data);
            },
            error: function(data) {
                alert(gettext('Error!'));
            }
        });
    }
}

function save_category() {
    var order = []
    $('#sort_items li').each(function(i) {
        id = $(this).attr('id');
        name = $('#' + id + ' input').val();
        if (id) {
            order.push(id + ':' + name);
        }
    });

    $.ajaxSetup({
        beforeSend: function(xhr, settings) {
            xhr.setRequestHeader("X-CSRFToken", $("input[name=csrfmiddlewaretoken]").val());
        }
    });
    $.ajax({
        type: "POST",
        url: "/recipes/save_category/",
        data: {
            order: order
        },
        success: function(data) {
            toast(gettext("Saved successfully."));
        },
        error: function(data) {
            alert(gettext('Error!'));
        }
    });
}

$(function() {
    if ($("#sort_items").length) {
        $("#sort_items").sortable({containment: "#sort_container"});
        $("#sort_items").disableSelection();
    }
});


text:
import requests
from datetime import datetime
import pytz

try:
    city = input("Въведете град в България: \n")

    url = "http://api.openweathermap.org/data/2.5/weather/?q=" + city + ",bg&units=metric&appid=c1d344dc9eb1db61f225488045d115be"

    print('...получаваме информация за времето...')
    print()

    r = requests.get(url, timeout=10)
    content = r.json()
    if r.status_code != 200 \
            or (content['sys']['country'] != 'BG' and content['sys']['country'] != 'Bulgaria') \
            or content['name'] != city:
        raise Exception("Може да сте въвели невалидни данни. Опитайте пак!")

    unix = content['dt']
    zone_sofia = pytz.timezone("Europe/Sofia")
    date = datetime.fromtimestamp(unix, tz=zone_sofia)  # we set the timezone to UTC+02:00
    date = date.strftime("%d.%m.%Y %H:%M")

    main_info = content['main']
    wind = content['wind']

    print("Информация към", date)
    print("Температура:", "{:.2f}°C".format(main_info['temp']))
    print("Налягане:", main_info['pressure'])
    print("Влажност:", "{}%".format(main_info['humidity']))
    print("Вятър:", "{} м/с".format(wind['speed']))

    r.close()

except Exception as e:
    print("Грешка:", e)


text:
(function (global, factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        module.exports = factory(module.exports, true);
    } else {
        factory(global);
    }
}(typeof window !== "undefined" ? window : this, (window, noGlobal) => {

const IS_BROWSER = typeof window !== "undefined";
const exports = {
    yessir: {}
};
const defineExportProperty = (proto, val) => {
    Object.defineProperty(exports.yessir, proto, val);
};

/*
// say cheese
if (IS_BROWSER) console.log("      %cYes-Sir Assertion Libary\n" +
    "(c) zoweb 2017 | github/zoweb/yes-sir", "color:purple;font-weight:bold;");
else console.log(" __     __              _____ _      \n" +
    " \\ \\   / /             / ____(_)     \n" +
    "  \\ \\_/ /__  ___ _____| (___  _ _ __ \n" +
    "   \\   / _ \\/ __|______\\___ \\| | '__|\n" +
    "    | |  __/\\__ \\      ____) | | |   \n" +
    "    |_|\\___||___/     |_____/|_|_|   \n" +
    "                                     \n" +
    "                                     \n" +
    "          assertion library\n");
*/

/* HEY THERE! I SEE YOU'RE INSPECTING THE SOURCE CODE! */
/* DO YOU WANT TO SPREAD THE WORD ABOUT Yes-Sir? IF YOUR */
/* ANSWER WAS "Yes, sir!", THEN MAKE SURE YOU UN-COMMENT OUT THE LINES BELOW "say cheese"! */

// %PAGE_CONTENTS%

// Export Yes-Sir
if (typeof noGlobal === "undefined") {
    // adds Exports object to window and sets window.YesSirNoConflict
    for (let current in exports) {
        if (!exports.hasOwnProperty(current)) continue;
        window[current] = exports[current];
    }

    /**
     * Returns the Yes-Sir object
     * @returns {Object} Yes-Sir object
     */
    window.YesSirNoConflict = function() {
        return exports;
    };
}/* else if (typeof module === "object" && typeof module.exports === "object") {
    exports.loadLanguage = function(location, languageName) {
        require(location);
        exports.setLanguage(languageName);
    };
}*/

return exports;
}));


text:
namespace device {

BluetoothTestFuchsia::BluetoothTestFuchsia() = default;

BluetoothTestFuchsia::~BluetoothTestFuchsia() = default;

bool BluetoothTestFuchsia::PlatformSupportsLowEnergy() {
  return true;
}

}  // namespace device


text:
// This file is part of the "x0" project, http://github.com/christianparpart/x0>
//   (c) 2009-2018 Christian Parpart <christian@parpart.family>
//
// Licensed under the MIT License (the "License"); you may not use this
// file except in compliance with the License. You may obtain a copy of
// the License at: http://opensource.org/licenses/MIT

#pragma once

#include <xzero/http/HeaderField.h>
#include <string>
#include <vector>
#include <list>

namespace xzero {
namespace http {

/**
 * Represents a list of headers (key/value pairs) for an HTTP message.
 */
class HeaderFieldList {
 public:
  HeaderFieldList() = default;
  HeaderFieldList(HeaderFieldList&&) = default;
  HeaderFieldList(const HeaderFieldList&) = default;
  HeaderFieldList& operator=(HeaderFieldList&&) = default;
  HeaderFieldList& operator=(const HeaderFieldList&) = default;
  HeaderFieldList(const std::initializer_list<std::pair<std::string, std::string>>& init);
  HeaderFieldList(const std::vector<std::pair<std::string, std::string>>& init);

  void push_back(const HeaderFieldList& list);
  void push_back(HeaderFieldList&& list);
  void push_back(HeaderField&& field);
  void push_back(const HeaderField& field);
  void push_back(const std::string& name, const std::string& value);
  void push_back(const std::string& name, const std::string& value, bool sensitive);
  void overwrite(const std::string& name, const std::string& value);
  void prepend(const std::string& name, const std::string& value,
               const std::string& delim = "");
  void append(const std::string& name, const std::string& value,
              const std::string& delim = "");
  void remove(const std::string& name);

  bool empty() const;
  size_t size() const;
  bool contains(const std::string& name) const;
  bool contains(const std::string& name, const std::string& value) const;
  const std::string& get(const std::string& name) const;
  const std::string& operator[](const std::string& name) const;
  const HeaderField& operator[](size_t index) const;

  typedef std::list<HeaderField>::iterator iterator;
  typedef std::list<HeaderField>::const_iterator const_iterator;

  iterator begin() { return entries_.begin(); }
  iterator end() { return entries_.end(); }

  const_iterator begin() const { return entries_.cbegin(); }
  const_iterator end() const { return entries_.cend(); }

  const_iterator cbegin() const { return entries_.cbegin(); }
  const_iterator cend() const { return entries_.cend(); }

  /**
   * Completely removes all entries from this header list.
   */
  void reset();

  void swap(HeaderFieldList& other);

 private:
  std::list<HeaderField> entries_;
};

inline bool HeaderFieldList::empty() const {
  return entries_.empty();
}

inline size_t HeaderFieldList::size() const {
  return entries_.size();
}

inline void HeaderFieldList::swap(HeaderFieldList& other) {
  entries_.swap(other.entries_);
}

}  // namespace http
}  // namespace xzero


text:
package com.github.games647.scoreboardstats.variables.defaults;

import com.github.games647.scoreboardstats.variables.ReplaceEvent;
import com.github.games647.scoreboardstats.variables.ReplaceManager;
import com.github.games647.scoreboardstats.variables.VariableReplaceAdapter;

import de.ftbastler.bukkitgames.api.BukkitGamesAPI;
import de.ftbastler.bukkitgames.api.PlayerBuyKitEvent;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;

public class BukkitGamesVariables extends VariableReplaceAdapter<Plugin> implements Listener {

    private final ReplaceManager replaceManager;
    private final BukkitGamesAPI bukkitGamesAPI = BukkitGamesAPI.getApi();

    public BukkitGamesVariables(ReplaceManager replaceManager) {
        super(Bukkit.getPluginManager().getPlugin("BukkitGames"), "coins");

        this.replaceManager = replaceManager;
    }

    @Override
    public void onReplace(Player player, String variable, ReplaceEvent replaceEvent) {
        replaceEvent.setConstant(true);
        replaceEvent.setScore(bukkitGamesAPI.getPlayerBalance(player));
    }

    @EventHandler(ignoreCancelled = true)
    public void onKitBuy(PlayerBuyKitEvent buyKitEvent) {
        final Player player = buyKitEvent.getPlayer();
        final int newBalance = bukkitGamesAPI.getPlayerBalance(player) - buyKitEvent.getKitCost();
        replaceManager.updateScore(player, "coins", newBalance);
    }
}


text:
package com.noodleofdeath.pastaparser.model.graph;

/**
 * Specifications for a node.
 *
 * @param <R> the type of the parent of this node.
 */
public interface Node<R extends Node<R>> {

	/**
	 * true if this node has no parent node; false, otherwise.
	 *
	 * @return true if this node has no parent node; false,
	 *         otherwise.
	 */
	public default boolean isRoot() {
		return parent() == null;
	}

	/**
	 * Gets the parent node of this node, if one exists.
	 *
	 * @return parent node of this node, if one exists.
	 */
	public abstract R parent();

	/**
	 * Sets the parent node of this node.
	 *
	 * @param parent node to set as the parent of this node.
	 */
	public abstract void setParent(R parent);

}


text:
namespace sf1r
{

class AdFeedbackMgr
{
public:
    static AdFeedbackMgr* get()
    {
        return izenelib::util::Singleton<AdFeedbackMgr>::get();
    }

    AdFeedbackMgr();
    ~AdFeedbackMgr();

    enum FeedbackActionT
    {
        View,
        Click,
        Buy,
        TotalAction
    };

    struct UserProfile
    {
        std::map<std::string, std::map<std::string, double> > profile_data;
        time_t timestamp;
        MSGPACK_DEFINE(profile_data, timestamp);
    };

    struct FeedbackInfo
    {
        FeedbackInfo()
            :click_cost(0), click_slot(0)
        {
        }
        std::string user_id;
        std::string ad_id;
        std::string hit_bidstr;
        FeedbackActionT action;
        double click_cost;
        uint32_t click_slot;
        UserProfile user_profiles;
    };

    void init(const std::string& dmp_server_ip, uint16_t port);
    void stop();
    bool parserFeedbackLog(const std::string& log_data, FeedbackInfo& feedback_info);
    bool parserFeedbackLogForAVRO(const std::string& log_data, FeedbackInfo& feedback_info);

    void setDMPRsp(const std::string& key, const std::string& value);

private:
    bool getUserProfileFromDMP(const std::string& user_id, UserProfile& user_profile);
    lcb_t get_conn_from_pool();
    void free_conn_to_pool(lcb_t conn);

    typedef izenelib::concurrent_cache::ConcurrentCache<std::string, UserProfile> cache_type;
    std::string dmp_server_ip_;
    uint16_t dmp_server_port_;
    cache_type cached_user_profiles_;
    std::list<lcb_t> dmp_conn_pool_;
    boost::mutex  dmp_pool_lock_;
    boost::mutex  dmp_rsp_lock_;
    std::map<std::string, std::string> tmp_rsp_list_;
};

};

#endif


text:
package java.lang;

/**
 * Thrown when an application tries to use the Java new
 * construct to instantiate an abstract class or an interface.
 *

 * Normally, this error is caught by the compiler; this error can
 * only occur at run time if the definition of a class has
 * incompatibly changed.
 *
 * @author  unascribed
 * @version 1.13, 11/17/05
 * @since   JDK1.0
 */

public
class InstantiationError extends IncompatibleClassChangeError {
    /**
     * Constructs an InstantiationError with no detail  message.
     */
    public InstantiationError() {
	super();
    }

    /**
     * Constructs an InstantiationError with the specified
     * detail message.
     *
     * @param   s   the detail message.
     */
    public InstantiationError(String s) {
	super(s);
    }
}


text:
package io.github.ibuildthecloud.dstack.json;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;
import java.util.Map;

public interface JsonMapper {

    Map<String,Object> readValue(InputStream is) throws IOException;

    Map<String,Object> readValue(byte[] bytes) throws IOException;

    Map<String,Object> readValue(String text) throws IOException;

    <T> T readValue(InputStream is, Class<T> type) throws IOException;

    <T> T readValue(byte[] bytes, Class<T> type) throws IOException;

    <T> T readValue(String text, Class<T> type) throws IOException;

    String writeValueAsString(Object object) throws IOException;

    byte[] writeValueAsBytes(Object data) throws IOException;

    Map<String,Object> writeValueAsMap(Object data);

    void writeValue(OutputStream baos, Object object) throws IOException;

    @SuppressWarnings("rawtypes")
    <T> T readCollectionValue(InputStream is, Class<? extends Collection> collectionClass, Class<?> elementsClass)
            throws IOException;

    @SuppressWarnings("rawtypes")
    <T> T readCollectionValue(String content, Class<? extends Collection> collectionClass, Class<?> elementsClass)
            throws IOException;

    <T> T convertValue(Object fromValue, Class<T> toValueType);

//    /**
//     * @deprecated
//     *
//     * This method provides a toJson() method to match Gson. It is preferable to
//     * use writeValueAsString() as that method throws an IOException.
//     *
//     * @param object
//     * @return
//     */
//    String toJson(Object object);
//
//    /**
//     * @deprecated
//     *
//     * This method provides a toJson() method to match Gson.
//     *
//     * @param object
//     * @param os
//     */
//    void toJson(Object object, Writer os);
//
//    /**
//     * @deprecated
//     *
//     * This method provides a fromJson() method to match Gson. It is preferable
//     * to use readValue() as that method throws an IOException.
//     *
//     * @param text
//     * @param type
//     * @return
//     */
//    <T> T fromJson(String text, Class<T> type);

}


text:
.class Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallbackProxy;
.super Landroid/support/v4/media/MediaBrowserCompatApi21$SubscriptionCallbackProxy;
.source "MediaBrowserCompatApi24.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/support/v4/media/MediaBrowserCompatApi24;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = "SubscriptionCallbackProxy"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T::",
        "Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallback;",
        ">",
        "Landroid/support/v4/media/MediaBrowserCompatApi21$SubscriptionCallbackProxy",
        "<TT;>;"
    }
.end annotation

# direct methods
.method public constructor <init>(Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallback;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 54
    .local p0, "this":Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallbackProxy;, "Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallbackProxy<TT;>;"
    .local p1, "callback":Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallback;, "TT;"
    invoke-direct {p0, p1}, Landroid/support/v4/media/MediaBrowserCompatApi21$SubscriptionCallbackProxy;-><init>(Landroid/support/v4/media/MediaBrowserCompatApi21$SubscriptionCallback;)V

    .line 55
    return-void
.end method

# virtual methods
.method public onChildrenLoaded(Ljava/lang/String;Ljava/util/List;Landroid/os/Bundle;)V
    .locals 1
    .param p1, "parentId"    # Ljava/lang/String;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param
    .param p3, "options"    # Landroid/os/Bundle;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/List",
            "<",
            "Landroid/media/browse/MediaBrowser$MediaItem;",
            ">;",
            "Landroid/os/Bundle;",
            ")V"
        }
    .end annotation

    .prologue
    .line 60
    .local p0, "this":Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallbackProxy;, "Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallbackProxy<TT;>;"
    .local p2, "children":Ljava/util/List;, "Ljava/util/List<Landroid/media/browse/MediaBrowser$MediaItem;>;"
    iget-object v0, p0, Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallbackProxy;->mSubscriptionCallback:Landroid/support/v4/media/MediaBrowserCompatApi21$SubscriptionCallback;

    check-cast v0, Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallback;

    invoke-interface {v0, p1, p2, p3}, Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallback;->onChildrenLoaded(Ljava/lang/String;Ljava/util/List;Landroid/os/Bundle;)V

    .line 61
    return-void
.end method

.method public onError(Ljava/lang/String;Landroid/os/Bundle;)V
    .locals 1
    .param p1, "parentId"    # Ljava/lang/String;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param
    .param p2, "options"    # Landroid/os/Bundle;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param

    .prologue
    .line 65
    .local p0, "this":Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallbackProxy;, "Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallbackProxy<TT;>;"
    iget-object v0, p0, Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallbackProxy;->mSubscriptionCallback:Landroid/support/v4/media/MediaBrowserCompatApi21$SubscriptionCallback;

    check-cast v0, Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallback;

    invoke-interface {v0, p1, p2}, Landroid/support/v4/media/MediaBrowserCompatApi24$SubscriptionCallback;->onError(Ljava/lang/String;Landroid/os/Bundle;)V

    .line 66
    return-void
.end method


text:
package org.cidrz.webapp.dynasite.dao;

import org.cidrz.webapp.dynasite.exception.ObjectNotFoundException;
import org.cidrz.webapp.dynasite.utils.DatabaseUtils;
import org.cidrz.webapp.dynasite.valueobject.Comment;

import javax.servlet.ServletException;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * @author Chris Kelley
 *         Date: Jun 9, 2005
 *         Time: 10:25:51 PM
 */
public class CommentDAO {

    /**
     * Get most recent comment
     * Does not include all of the fields, especially uuid-related fields.
     *
     * @param conn
     * @param patientId
     * @param status
     * @return
     * @throws SQLException
     * @throws ServletException
     */
    public static Object getMostRecent(Connection conn, Long patientId, Boolean status) throws SQLException, ServletException, ObjectNotFoundException {
        Object result = null;
        ArrayList values = new ArrayList();
        values = new ArrayList();
        String sql = "select c.id, c.encounter_id AS encounterId, c.patient_id AS patientId, c.pregnancy_id AS pregnancyId, " +
                "c.problem_id AS problemId, c.comment_text AS commentText, " +
                "c.action_plan AS actionPlan, c.outcome_id AS outcomeId, " +
                "c.last_modified AS 'lastModified', " +
                "c.created AS 'created', " +
                "CONCAT_WS(' ', u.lastName, u.firstName) AS 'lastModifiedBy' " +
                "from comment c, problem p, userdata.address u " +
                "where c.problem_id = p.id " +
                "and c.last_modified_by=u.nickname " +
                "and c.patient_id=? " +
                "and p.active=? " +
                "order by c.last_modified DESC";
        values.add(patientId);
        values.add(status);
        result = DatabaseUtils.getBean(conn, Comment.class, sql, values);
        return result;
    }

    /**
     * Fetch list of comments for this problem
     * Looks up lastModifiedByName
     *
     * @param conn
     * @param patientId
     * @param problemId
     * @return
     * @throws SQLException
     * @throws ServletException
     */
    public static List getAllforProblemFullname(Connection conn, Long patientId, Long problemId) throws SQLException, ServletException {

        List list = new ArrayList();
        ArrayList values = new ArrayList();
        String sql = "select c.id, c.encounter_id AS encounterId, c.patient_id AS patientId, c.pregnancy_id AS pregnancyId, " +
                "c.problem_id AS problemId, c.comment_text AS commentText, " +
                "c.action_plan AS actionPlan, c.outcome_id AS outcomeId, c.last_modified AS 'lastModified', " +
                "c.created AS 'created', c.last_modified_by AS 'lastModifiedBy', c.created_by AS 'createdBy', " +
                "CONCAT_WS(' ', u.lastName, u.firstName) AS 'lastModifiedByName', c.site_id AS siteId, " +
                "c.import_comment_id AS importCommentId, " +
                "c.uuid AS uuid, c.patient_uuid AS patientUuid, c.pregnancy_uuid AS pregnancyUuid, c.problem_uuid AS problemUuid, c.outcome_uuid AS outcomeUuid, c.encounter_uuid AS encounterUuid " +
                "from comment c " +
                "LEFT JOIN userdata.address u ON c.last_modified_by=u.nickname " +
                "where c.patient_id=? " +
                "and c.problem_id=? " +
                "order by c.last_modified DESC";
        values.add(patientId);
        values.add(problemId);
        list = DatabaseUtils.getList(conn, Comment.class, sql, values);
        return list;
    }

    /**
     * Fetch list of comments for this problem
     *
     * @param conn
     * @param problemId
     * @return
     * @throws SQLException
     * @throws ServletException
     */
    public static List getAllforProblem(Connection conn, Long problemId) throws SQLException, ServletException {

        List list = new ArrayList();
        ArrayList values = new ArrayList();
        String sql = "select c.id, c.encounter_id AS encounterId, c.patient_id AS patientId, c.pregnancy_id AS pregnancyId, " +
                "c.problem_id AS problemId, c.comment_text AS commentText, " +
                "c.action_plan AS actionPlan, c.outcome_id AS outcomeId, c.last_modified AS 'lastModified', " +
                "c.created AS 'created', c.last_modified_by AS 'lastModifiedBy', c.created_by AS 'createdBy', " +
                "CONCAT_WS(' ', u.lastName, u.firstName) AS 'lastModifiedByName', c.site_id AS siteId, " +
                "c.import_comment_id AS importCommentId, " +
                "c.uuid AS uuid, c.patient_uuid AS patientUuid, c.pregnancy_uuid AS pregnancyUuid, c.problem_uuid AS problemUuid, c.outcome_uuid AS outcomeUuid, c.encounter_uuid AS encounterUuid " +
                "from comment c " +
                "LEFT JOIN userdata.address u ON c.last_modified_by=u.nickname " +
                "where c.problem_id=? " +
                "order by c.last_modified DESC";
        values.add(problemId);
        list = DatabaseUtils.getList(conn, Comment.class, sql, values);
        return list;
    }

    /**
     * Fetch list of comments for this problem
     * @param conn
     * @param problemUuid
     * @return
     * @throws SQLException
     * @throws ServletException
     */
    public static List getAllforProblem(Connection conn, String problemUuid) throws SQLException, ServletException {
    	List list = new ArrayList();
    	ArrayList values = new ArrayList();
    	String sql = "select c.id, c.encounter_id AS encounterId, c.patient_id AS patientId, c.pregnancy_id AS pregnancyId, " +
    	"c.problem_id AS problemId, c.comment_text AS commentText, " +
    	"c.action_plan AS actionPlan, c.outcome_id AS outcomeId, c.last_modified AS 'lastModified', " +
    	"c.created AS 'created', c.last_modified_by AS 'lastModifiedBy', c.created_by AS 'createdBy', " +
    	"CONCAT_WS(' ', u.lastName, u.firstName) AS 'lastModifiedByName', c.site_id AS siteId, " +
    	"c.import_comment_id AS importCommentId, " +
        "c.uuid AS uuid, c.patient_uuid AS patientUuid, c.pregnancy_uuid AS pregnancyUuid, c.problem_uuid AS problemUuid, c.outcome_uuid AS outcomeUuid, c.encounter_uuid AS encounterUuid " +
    	"from comment c " +
    	"LEFT JOIN userdata.address u ON c.last_modified_by=u.nickname " +
    	"where c.problem_uuid=? " +
    	"order by c.last_modified DESC";
    	values.add(problemUuid);
    	list = DatabaseUtils.getList(conn, Comment.class, sql, values);
    	return list;
    }

    /**
     * Fetch all comments for a patient
     * Used in record import
     *
     * @param conn
     * @param patientId
     * @return
     * @throws SQLException
     * @throws ServletException
     */
    public static List getAll(Connection conn, Long patientId) throws SQLException, ServletException {

        List list = new ArrayList();
        ArrayList values = new ArrayList();
        String sql = "select c.id, c.encounter_id AS encounterId, c.patient_id AS patientId, c.pregnancy_id AS pregnancyId, " +
                "c.problem_id AS problemId, c.comment_text AS commentText, " +
                "c.action_plan AS actionPlan, c.outcome_id AS outcomeId, c.last_modified AS 'lastModified', " +
                "c.created AS 'created', c.last_modified_by AS 'lastModifiedBy', c.created_by AS 'createdBy', " +
                "CONCAT_WS(' ', u.lastName, u.firstName) AS 'lastModifiedByName', c.site_id AS siteId, " +
                "c.import_comment_id AS importCommentId, " +
                "c.uuid AS uuid, c.patient_uuid AS patientUuid, c.pregnancy_uuid AS pregnancyUuid, c.problem_uuid AS problemUuid, c.outcome_uuid AS outcomeUuid, c.encounter_uuid AS encounterUuid " +
                "from comment c " +
                "LEFT JOIN userdata.address u ON c.last_modified_by=u.nickname " +
                "where c.patient_id=? " +
                "order by c.created DESC";
        values.add(patientId);
        list = DatabaseUtils.getList(conn, Comment.class, sql, values);
        return list;
    }

    /**
     * Fetch list of comments for this outcome
     * Includes full staff name who last modified record
     *
     * @param conn
     * @param outcomeId
     * @return
     * @throws SQLException
     * @throws ServletException
     */
    public static List getAllforOutcomeFullName(Connection conn, Long outcomeId) throws SQLException, ServletException {

        List list = new ArrayList();
        ArrayList values = new ArrayList();
        values = new ArrayList();
        String sql = "select c.id, c.encounter_id AS encounterId, c.patient_id AS patientId, c.pregnancy_id AS pregnancyId, " +
                "c.problem_id AS problemId, c.comment_text AS commentText, " +
                "c.action_plan AS actionPlan, c.outcome_id AS outcomeId, c.last_modified AS 'lastModified', " +
                "c.created AS 'created', c.site_id AS siteId, c.last_modified_by AS 'lastModifiedBy', c.created_by AS 'createdBy', " +
                "CONCAT_WS(' ', u.lastName, u.firstName) AS 'lastModifiedByName', " +
                "c.import_comment_id AS importCommentId, " +
                "c.uuid AS uuid, c.patient_uuid AS patientUuid, c.pregnancy_uuid AS pregnancyUuid, c.problem_uuid AS problemUuid, c.outcome_uuid AS outcomeUuid, c.encounter_uuid AS encounterUuid " +
                "from comment c " +
                "LEFT JOIN (userdata.address u) ON (u.nickname = c.last_modified_by) " +
                "where c.outcome_id=? " +
                "order by c.last_modified DESC";
        values.add(outcomeId);
        list = DatabaseUtils.getList(conn, Comment.class, sql, values);
        return list;
    }

    /**
     * Fetch list of comments for this outcome
     *
     * @param conn
     * @param outcomeId
     * @return
     * @throws SQLException
     * @throws ServletException
     */
    public static List getAllforOutcome(Connection conn, Long outcomeId) throws SQLException, ServletException {

        List list = new ArrayList();
        ArrayList values = new ArrayList();
        values = new ArrayList();
        String sql = "select c.id, c.encounter_id AS encounterId, c.patient_id AS patientId, c.pregnancy_id AS pregnancyId, " +
                "c.problem_id AS problemId, c.comment_text AS commentText, " +
                "c.action_plan AS actionPlan, c.outcome_id AS outcomeId, c.last_modified AS 'lastModified', " +
                "c.created AS 'created', c.site_id AS siteId, c.last_modified_by AS 'lastModifiedBy', c.created_by AS 'createdBy', " +
                "c.import_comment_id AS importCommentId, " +
                "c.uuid AS uuid, c.patient_uuid AS patientUuid, c.pregnancy_uuid AS pregnancyUuid, c.problem_uuid AS problemUuid, c.outcome_uuid AS outcomeUuid, c.encounter_uuid AS encounterUuid " +
                "from comment c " +
                "where c.outcome_id=? " +
                "order by c.last_modified DESC";
        values.add(outcomeId);
        list = DatabaseUtils.getList(conn, Comment.class, sql, values);
        return list;
    }

    /**
     * Fetch list of comments for this outcome
     * @param conn
     * @param outcomeUuid
     * @return
     * @throws SQLException
     * @throws ServletException
     */
    public static List getAllforOutcome(Connection conn, String outcomeUuid) throws SQLException, ServletException {
    	List list = new ArrayList();
    	ArrayList values = new ArrayList();
    	values = new ArrayList();
    	String sql = "select c.id, c.encounter_id AS encounterId, c.patient_id AS patientId, c.pregnancy_id AS pregnancyId, " +
    	"c.problem_id AS problemId, c.comment_text AS commentText, " +
    	"c.action_plan AS actionPlan, c.outcome_id AS outcomeId, c.last_modified AS 'lastModified', " +
    	"c.created AS 'created', c.site_id AS siteId, c.last_modified_by AS 'lastModifiedBy', c.created_by AS 'createdBy', " +
    	"c.import_comment_id AS importCommentId, " +
        "c.uuid AS uuid, c.patient_uuid AS patientUuid, c.pregnancy_uuid AS pregnancyUuid, c.problem_uuid AS problemUuid, c.outcome_uuid AS outcomeUuid, c.encounter_uuid AS encounterUuid " +
    	"from comment c " +
    	"where c.outcome_uuid=? " +
    	"order by c.last_modified DESC";
    	values.add(outcomeUuid);
    	list = DatabaseUtils.getList(conn, Comment.class, sql, values);
    	return list;
    }

    /**
     * Saves a comment. Sets uuid if null.
     * @param conn
     * @param comment
     * @param userName
     * @param siteId
     * @return
     * @throws SQLException
     * @throws ServletException
     */
    public static Long save(Connection conn, Comment comment, String userName, Long siteId) throws SQLException, ServletException {
    	if (comment.getUuid() == null) {
    		// create the uuid for the record
    		UUID uuidRand = UUID.randomUUID();
    		comment.setUuid(uuidRand.toString());
    	}
        Timestamp created = new Timestamp(System.currentTimeMillis());
        if (comment.getCreated() != null) {
            created = comment.getCreated();
        }
        Timestamp lastModified = new Timestamp(System.currentTimeMillis());
        if (comment.getLastModified() != null) {
            lastModified = comment.getLastModified();
        }
        String sql = "INSERT INTO comment " +
        "(patient_id, problem_id, comment_text, action_plan, pregnancy_id, outcome_id, " +
        "encounter_id, last_modified, created, last_modified_by, created_by, site_id, " +
        "import_comment_id, uuid, patient_uuid, pregnancy_uuid, problem_uuid, outcome_uuid, encounter_uuid) " +
        "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
        ArrayList values = new ArrayList();
        values.add(comment.getPatientId());
        values.add(comment.getProblemId());
        values.add(comment.getCommentText());
        values.add(comment.getActionPlan());
        values.add(comment.getPregnancyId());
        values.add(comment.getOutcomeId());
        values.add(comment.getEncounterId());
        values.add(lastModified);
        values.add(created);
        values.add(userName);
        values.add(userName);
        values.add(siteId);
        values.add(comment.getImportCommentId());
        values.add(comment.getUuid());
        values.add(comment.getPatientUuid());
        values.add(comment.getPregnancyUuid());
        values.add(comment.getProblemUuid());
        values.add(comment.getOutcomeUuid());
        values.add(comment.getEncounterUuid());
        Long commentId = (Long) DatabaseUtils.create(conn, sql, values.toArray());
        return commentId;
    }

    public static String delete(Connection conn, Long patientId) {
        String result = "Comments deleted.";
        // delete the associated patient_status table
        String sql = "delete from comment where patient_id=?";
        ArrayList values = new ArrayList();
        // add infantId to values
        values.add(patientId);
        try {
            DatabaseUtils.update(conn, sql, values.toArray());
        } catch (Exception e) {
            result = "Error while deleting comments.";
            e.printStackTrace();
        }
        return result;
    }

    /**
     * Delete comments for an outcome
     *
     * @param conn
     * @param outcomeId
     */
    public static void deleteOutcomeComments(Connection conn, Long outcomeId) {
        String sql = "delete from comment where outcome_id=?";
        ArrayList values = new ArrayList();
        values.add(outcomeId);
        try {
            DatabaseUtils.update(conn, sql, values.toArray());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * Delete comments for an outcome
     * @param conn
     * @param uuid - outcome_uuid
     */
    public static void deleteOutcomeComments(Connection conn, String uuid) {
    	String sql = "delete from comment where outcome_uuid=?";
    	ArrayList values = new ArrayList();
    	values.add(uuid);
    	try {
    		DatabaseUtils.update(conn, sql, values.toArray());
    	} catch (Exception e) {
    		e.printStackTrace();
    	}
    }

    /**
     * Delete comments for an outcome
     *
     * @param conn
     * @param outcomeId
     */
    public static void deleteProblemComments(Connection conn, Long outcomeId) {
        String sql = "delete from comment where problem_id=?";
        ArrayList values = new ArrayList();
        // add infantId to values
        values.add(outcomeId);
        try {
            DatabaseUtils.update(conn, sql, values.toArray());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * Delete comments for a problem
     * @param conn
     * @param uuid
     */
    public static void deleteProblemComments(Connection conn, String uuid) {
    	String sql = "delete from comment where problem_uuid=?";
    	ArrayList values = new ArrayList();
    	// add infantId to values
    	values.add(uuid);
    	try {
    		DatabaseUtils.update(conn, sql, values.toArray());
    	} catch (Exception e) {
    		e.printStackTrace();
    	}
    }

}


text:
rake db:create
rake db:migrate

# Purge in the background
./purge-sessions.sh &

# Start the server
exec rails server -b 0.0.0.0 -p 3000


text:
/*
 * SMGObjectTest.cc
 *
 *  Created on: Dec 3, 2015
 *      Author: pmuller
 */

/*
 *  This file is part of SMG, a symbolic memory graph Java library
 *  Originally developed as part of CPAChecker, the configurable software verification platform
 *
 *  Copyright (C) 2011-2015  Petr Muller
 *  Copyright (C) 2007-2014  Dirk Beyer
 *  All rights reserved.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

#include <gtest/gtest.h>
#include "objects/SMGObject.hh"

namespace smg {

static int SIZE8 = 8;
static int SIZE12 = 12;

class TestingObject : public SMGObject {
 public:
  TestingObject(const int size, const std::string label) : SMGObject(size, label) {}
  ~TestingObject() {}
  TestingObject(const TestingObject&) = default;

  bool NotNull() const override { return true; }

  bool IsAbstract() const override { return false; }

  void Accept(SMGObjectVisitor& visitor) const override { (void)visitor; }

  bool IsMoreGeneral(const SMGObject&) const override {
    return false;
  };

  SMGObjectPtr Join(const SMGObject&) const override {
    return std::make_shared<TestingObject>(*this);
  }
};

TestingObject object_8 = TestingObject(8, "label");
TestingObject object_12 = TestingObject(12, "another label");

TEST(SMGObject, GetNullObject) {
  const SMGObjectPtr null_object = SMGNullObject::GetNullObject();
  EXPECT_FALSE(null_object->NotNull());
  EXPECT_TRUE(object_8.NotNull());
  EXPECT_FALSE(null_object->IsAbstract());
  EXPECT_FALSE(null_object->IsMoreGeneral(object_8));
  EXPECT_FALSE(null_object->IsMoreGeneral(*null_object));
  EXPECT_EQ(*null_object, *(null_object->Join(*null_object)));
  EXPECT_EQ(object_8, *(null_object->Join(object_8)));
}

//  public final void testSMGObjectIntString() {
//    Assert.assertEquals(SIZE8, object8.getSize());
//    Assert.assertEquals("label", object8.getLabel());
//    Assert.assertEquals(SIZE12, object12.getSize());
//    Assert.assertEquals("another label", object12.getLabel());
//    SMGObject object12copy = new TestingObject(object12);
//    Assert.assertEquals(SIZE12, object12copy.getSize());
//    Assert.assertEquals("another label", object12copy.getLabel());
//  }

TEST(SMGObject, PropertySanity) {
  EXPECT_EQ(SIZE8, object_8.GetSize());
  EXPECT_STREQ("label", object_8.GetLabel().c_str());
  EXPECT_EQ(SIZE12, object_12.GetSize());
  EXPECT_STREQ("another label", object_12.GetLabel().c_str());
  SMGObject* object_12_copy = new TestingObject(object_12);
  EXPECT_EQ(SIZE12, object_12_copy->GetSize());
  EXPECT_STREQ("another label", object_12_copy->GetLabel().c_str());
  delete object_12_copy;
}

//  private static class TestingObject extends SMGObject {
//
//    protected TestingObject(final int pSize, final String pLabel) {
//      super(pSize, pLabel);
//    }
//
//    protected TestingObject(final TestingObject pOther) {
//      super(pOther);
//    }
//
//    @Override
//    public boolean isAbstract() {
//      return false;
//    }
//
//    @Override
//    public void accept(final SMGObjectVisitor pVisitor) {
//      pVisitor.visit(this);
//    }
//
//    @Override
//    public boolean isMoreGeneral(final SMGObject pOther) {
//      return false;
//    }
//
//    @Override
//    public SMGObject join(final SMGObject pOther) {
//      return pOther;
//    }
//  }
//
//  @Test
//  public final void testVisitorOnNull() {
//    SMGObject nullObject = SMGObject.getNullObject();
//    SMGObjectVisitor visitor = new SMGObjectVisitor() {
//      @Override
//      public void visit(final SMGObject pObject) {
//        Assert.assertFalse(pObject.notNull());
//      }
//    };
//    nullObject.accept(visitor);
//  }
//}

}  // namespace smg


text:
/* //////////////////////////////////////////////////////////////////////////////////////
 * includes
 */
#include "prefix.h"
#include "../atomic.h"
#include "../memory.h"
#include "../dynamic.h"
#include "../native_memory.h"
#if 0
#   include <unwind.h>
#   include <dlfcn.h>
#endif

/* //////////////////////////////////////////////////////////////////////////////////////
 * types
 */

/* a single frame of a backtrace.
 *
 * from corkscrew/backtrace.h
 */
typedef struct __tb_backtrace_frame_t
{
    // absolute PC offset
    tb_size_t               absolute_pc;

    // top of stack for this frame
    tb_size_t               stack_top;

    // size of this stack frame
    tb_size_t               stack_size;

} tb_backtrace_frame_t, *tb_backtrace_frame_ref_t;

/* the symbols associated with a backtrace frame.
 *
 * from corkscrew/backtrace.h
 */
typedef struct __tb_backtrace_symbol_t
{
    /* relative frame PC offset from the start of the library,
     * or the absolute PC if the library is unknown
     */
    tb_size_t               relative_pc;

    /* relative offset of the symbol from the start of the
     * library or 0 if the library is unknown
     */
    tb_size_t               relative_symbol_addr;

    // executable or library name, or NULL if unknown
    tb_char_t*              map_name;

    // symbol name, or NULL if unknown
    tb_char_t*              symbol_name;

    // demangled symbol name, or NULL if unknown
    tb_char_t*              demangled_name;

} tb_backtrace_symbol_t, *tb_backtrace_symbol_ref_t;

// the symbols type
typedef struct __tb_backtrace_symbols_t
{
    // the symbols
    tb_backtrace_symbol_t   symbols[64];

    // the info
    tb_char_t               info[256];

    // the frame count
    tb_size_t               nframe;

} tb_backtrace_symbols_t, *tb_backtrace_symbols_ref_t;

// the unwind_backtrace function type
typedef tb_long_t   (*tb_backtrace_unwind_backtrace_func_t)(tb_backtrace_frame_ref_t, tb_size_t, tb_size_t);

// the get_backtrace_symbols function type
typedef tb_void_t   (*tb_backtrace_get_backtrace_symbols_func_t)(tb_backtrace_frame_ref_t, tb_size_t, tb_backtrace_symbol_ref_t);

// the free_backtrace_symbols function type
typedef tb_void_t   (*tb_backtrace_free_backtrace_symbols_func_t)(tb_backtrace_symbol_ref_t, tb_size_t);

/* //////////////////////////////////////////////////////////////////////////////////////
 * globals
 */

// the unwind_backtrace function
static tb_backtrace_unwind_backtrace_func_t         g_unwind_backtrace = tb_null;

// the get_backtrace_symbols function
static tb_backtrace_get_backtrace_symbols_func_t    g_get_backtrace_symbols = tb_null;

// the free_backtrace_symbols function
static tb_backtrace_free_backtrace_symbols_func_t   g_free_backtrace_symbols = tb_null;

/* //////////////////////////////////////////////////////////////////////////////////////
 * private implementation
 */
#if 0
static _Unwind_Reason_Code tb_backtrace_unwind(struct _Unwind_Context* context, tb_pointer_t args)
{
    // check
    tb_value_ref_t info = (tb_value_ref_t)args;
    tb_check_return_val(context && info, _URC_END_OF_STACK);

    // get info
    tb_backtrace_frame_ref_t    frames      = (tb_backtrace_frame_ref_t)info[0].ptr;
    tb_size_t                   nskip       = info[1].ul;
    tb_size_t                   nframe_maxn = info[2].ul;
    tb_long_t                   count       = info[3].l;
    tb_check_return_val(frames && nframe_maxn && count < nframe_maxn, _URC_END_OF_STACK);

    // get ip
#ifdef HAVE_GETIPINFO
    tb_int_t ip_before_insn = 0;
    tb_size_t ip = (tb_size_t)_Unwind_GetIPInfo (context, &ip_before_insn);
    if (!ip_before_insn) ip--;
#else
    tb_size_t ip = (tb_size_t)_Unwind_GetIP (context);
#endif

    // trace
    tb_trace_d("unwind: count: %ld, nframe_maxn: %lu, ip: %p", count, nframe_maxn, ip);

    // skip and save frame
    if (ip)
    {
        if (nskip > 0) nskip--;
        else
        {
            frames[count].absolute_pc   = ip;
            frames[count].stack_top     = 0;
            frames[count].stack_size    = 0;
            count++;
        }
    }

    // update info
    info[1].ul  = nskip;
    info[3].l   = count;

    // ok
    return _URC_OK;
}
#endif

/* //////////////////////////////////////////////////////////////////////////////////////
 * implementation
 */
tb_size_t tb_backtrace_frames(tb_pointer_t* frames, tb_size_t nframe, tb_size_t nskip)
{
    // check
    tb_check_return_val(frames && nframe, 0);

    // done
    tb_long_t count = 0;
    do
    {
        // load libcorkscrew.so?
        static tb_atomic_flag_t g_loaded = TB_ATOMIC_FLAG_INIT;
        if (!tb_atomic_flag_test_and_set(&g_loaded))
        {
            // init dynamic
            tb_dynamic_ref_t dynamic = tb_dynamic_init("/system/lib/libcorkscrew.so");
            tb_check_break(dynamic);

            // get the unwind_backtrace function
            g_unwind_backtrace = (tb_backtrace_unwind_backtrace_func_t)tb_dynamic_func(dynamic, "unwind_backtrace");

            // get the get_backtrace_symbols function
            g_get_backtrace_symbols = (tb_backtrace_get_backtrace_symbols_func_t)tb_dynamic_func(dynamic, "get_backtrace_symbols");

            // get the free_backtrace_symbols function
            g_free_backtrace_symbols = (tb_backtrace_free_backtrace_symbols_func_t)tb_dynamic_func(dynamic, "free_backtrace_symbols");
        }
        tb_check_break(g_unwind_backtrace && g_get_backtrace_symbols && g_free_backtrace_symbols);

        // calculate max frames count which can be storaged
        tb_size_t nframe_maxn = (sizeof(tb_pointer_t) * nframe) / sizeof(tb_backtrace_frame_t);
        tb_check_break(nframe_maxn && nframe_maxn < 64);

#if 1
        // unwind backtrace
        count = g_unwind_backtrace((tb_backtrace_frame_ref_t)frames, nskip, nframe_maxn);
        tb_check_break_state(count >= 0, count, 0);
#else
        // need add cxflags: -funwind-tables
        tb_value_t info[4];
        info[0].ptr     = (tb_pointer_t)frames;
        info[1].ul      = nskip;
        info[2].ul      = nframe_maxn;
        info[3].l       = 0;
        _Unwind_Backtrace(tb_backtrace_unwind, info);
        count = info[3].l;
#endif

    } while (0);

    // ok?
    return count;
}
tb_handle_t tb_backtrace_symbols_init(tb_pointer_t* frames, tb_size_t nframe)
{
    // check
    tb_check_return_val(frames && nframe, tb_null);
    tb_check_return_val(g_get_backtrace_symbols, tb_null);

    // done
    tb_backtrace_symbols_ref_t symbols = tb_null;
    do
    {
        // the real frames count
        tb_size_t nframe_real = tb_min(nframe, 64);

        // make symbols
        symbols = (tb_backtrace_symbols_ref_t)tb_native_memory_malloc0(sizeof(tb_backtrace_symbols_t));
        tb_check_break(symbols);

        // get backtrace symbols
        g_get_backtrace_symbols((tb_backtrace_frame_ref_t)frames, nframe_real, symbols->symbols);

        // save the frame count
        symbols->nframe = nframe_real;

    } while (0);

    // ok?
    return (tb_handle_t)symbols;
}
#if 1
tb_char_t const* tb_backtrace_symbols_name(tb_handle_t handle, tb_pointer_t* frames, tb_size_t nframe, tb_size_t iframe)
{
    // check
    tb_backtrace_symbols_ref_t symbols = (tb_backtrace_symbols_ref_t)handle;
    tb_check_return_val(symbols && symbols->nframe && frames && iframe < symbols->nframe && symbols->nframe == nframe, tb_null);

    // get symbol
    tb_backtrace_symbol_ref_t symbol = &symbols->symbols[iframe];

    // get map name
    tb_char_t const* map_name = symbol->map_name? symbol->map_name : "<unknown>";

    // get symbol name
    tb_char_t const* symbol_name = symbol->demangled_name? symbol->demangled_name : symbol->symbol_name;

    // make symbol info
    tb_long_t info_size = 0;
    if (symbol_name)
    {
        // the pc offset relative symbol
        tb_size_t relative_symbol_pc_offset = symbol->relative_pc - symbol->relative_symbol_addr;
        if (relative_symbol_pc_offset)
        {
            // make it
            info_size = tb_snprintf(    symbols->info
                                    ,   sizeof(symbols->info)
                                    ,   "[%08lx]: %2lu   %s %08lx %s + %lu"
                                    ,   symbol->relative_pc
                                    ,   iframe
                                    ,   map_name
                                    ,   symbol->relative_pc
                                    ,   symbol_name
                                    ,   relative_symbol_pc_offset);
        }
        else
        {
            // make it
            info_size = tb_snprintf(    symbols->info
                                    ,   sizeof(symbols->info)
                                    ,   "[%08lx]: %2lu   %s %08lx %s"
                                    ,   symbol->relative_pc
                                    ,   iframe
                                    ,   map_name
                                    ,   symbol->relative_pc
                                    ,   symbol_name);
        }
    }
    else
    {
        // make it
        info_size = tb_snprintf(    symbols->info
                                ,   sizeof(symbols->info)
                                ,   "[%08lx]: %2lu   %s %08lx"
                                ,   symbol->relative_pc
                                ,   iframe
                                ,   map_name
                                ,   symbol->relative_pc);
    }

    // end
    if (info_size >= 0 && info_size < sizeof(symbols->info))
        symbols->info[info_size] = '\0';

    // ok?
    return symbols->info;
}
#else
tb_char_t const* tb_backtrace_symbols_name(tb_handle_t handle, tb_pointer_t* frames, tb_size_t nframe, tb_size_t iframe)
{
    // check
    tb_backtrace_symbols_ref_t symbols = (tb_backtrace_symbols_ref_t)handle;
    tb_check_return_val(symbols && frames && iframe < nframe, tb_null);

    // get frame address
    tb_size_t addr = ((tb_backtrace_frame_ref_t)frames)[iframe].absolute_pc;

    // make symbol info
    Dl_info     info;
    tb_long_t   info_size = 0;
    if (dladdr((tb_pointer_t)addr, &info) && info.dli_sname)
    {
        // make it
        info_size = tb_snprintf(    symbols->info
                                ,   sizeof(symbols->info)
                                ,   "[%08lx]: %2lu   %s %08lx %s + %lu"
                                ,   addr
                                ,   iframe
                                ,   ""
                                ,   addr
                                ,   info.dli_sname
                                ,   0);
    }
    else
    {
        // make it
        info_size = tb_snprintf(    symbols->info
                                ,   sizeof(symbols->info)
                                ,   "[%08lx]: %2lu   %s %08lx"
                                ,   addr
                                ,   iframe
                                ,   ""
                                ,   addr);
    }

    // end
    if (info_size >= 0 && info_size < sizeof(symbols->info))
        symbols->info[info_size] = '\0';

    // ok?
    return symbols->info;
}
#endif
tb_void_t tb_backtrace_symbols_exit(tb_handle_t handle)
{
    // check
    tb_backtrace_symbols_ref_t symbols = (tb_backtrace_symbols_ref_t)handle;
    tb_check_return(symbols && g_free_backtrace_symbols);

    // free symbols
    if (symbols->nframe) g_free_backtrace_symbols(symbols->symbols, symbols->nframe);

    // exit it
    tb_native_memory_free(symbols);
}


text:
Vaultcoin
================================

http://www.vaultcoin.info

Copyright (c) 2009-2013 Bitcoin Developers
Copyright (c) 2011-2013 Litecoin Developers
Copyright (c) 2014 Vaultcoin Developers

What is Vaultcoin?
----------------

Vaultcoin is a lite version of Bitcoin using:
 - scrypt-adaptive-N as a proof-of-work algorithm
 - 5 minute block time
 - 500 coins per block
 - subsidy halves every 100k blocks (~11 months)
 - 100 million total coins
 - RPC: 22152, Testnet: 22114, P2P: 41514
 - Kimotos Gravity Well algorithm prevents ASIC's to mine Vaultcoin
 - 120 Confirmations needed

Go to http://www.vaultcoin.info for more information as well as the releases of the Vaultcoin software

License
-------

Vaultcoin is released under the terms of the MIT license. See `COPYING` for more
information or see http://opensource.org/licenses/MIT.


text:
MEDUSA_BEGIN;

class ElasticEaseInAction :public BaseTweenAction
{
public:
	ElasticEaseInAction(BaseFiniteAction* innerAction, float period) :BaseTweenAction(innerAction), mPeriod(period) {}
	virtual ~ElasticEaseInAction(void) {}
public:
	virtual ElasticEaseInAction* Clone()const override
	{
		return new ElasticEaseInAction((BaseFiniteAction*)this->mInnerAction, mPeriod);
	}
	virtual ElasticEaseInAction* Reverse()const override
	{
		return new ElasticEaseInAction((BaseFiniteAction*)this->mInnerAction->Reverse(), mPeriod);
	}

	static ElasticEaseInAction* Create(ElasticEaseInAction* innerAction, float period)
	{
		return new ElasticEaseInAction(innerAction, period);
	}
protected:
	virtual float TransformUpdatePercent(float percent)const override
	{
		return Math::Tween::ElasticEaseIn(percent, mPeriod);
	}
private:
	float mPeriod;
};
MEDUSA_END;


text:
package com.opentangerine.clean;

import java.util.Scanner;
import java.util.function.Function;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.StrBuilder;

/**
 * Replace object that is able to apply specific line transformation for a
 * given text.
 *
 * @author Grzegorz Gajos (grzegorz.gajos@opentangerine.com)
 * @version $Id$
 * @since 0.5
 */
public final class Replace {
    /**
     * Text text.
     */
    private final transient String text;

    /**
     * Ctor.
     * @param content Raw text text.
     */
    public Replace(final String content) {
        this.text = content;
    }

    /**
     * Apply replace transformation on selected line only if matching
     * function returned true.
     *
     * @param matching Closure that returns true if line has been matched.
     * @param transformation Closure with line transformation.
     * @return Replace object.
     */
    public Replace replace(
        final Function<String, Boolean> matching,
        final Function<String, String> transformation
    ) {
        final StrBuilder out = new StrBuilder();
        try (Scanner scanner = new Scanner(this.text)) {
            while (scanner.hasNextLine()) {
                final String line = scanner.nextLine();
                if (matching.apply(line)) {
                    out.append(transformation.apply(line));
                } else {
                    out.append(line);
                }
                out.appendNewLine();
            }
        }
        return new Replace(out.build());
    }

    /**
     * Find specific pattern and replace with provided value.
     *
     * @param pattern Pattern that should be replaced.
     * @param value Value that should be used for replacement.
     * @return Replace object.
     */
    public Replace replace(final String pattern, final String value) {
        return this.replace(
            it -> it.contains(pattern),
            it -> StringUtils.replace(it, pattern, value)
        );
    }

    /**
     * Return final version of text.
     *
     * @return Final version of text.
     */
    public String output() {
        return this.text;
    }

}


text:
#ifndef TCPERROR_H
#define TCPERROR_H

#ifdef	UNIX

	// Unix
	#include <errno.h>
#else

	// Windows
	#include <winsock.h>

#endif

#include <exception>

////////////////////////////////////////////////////////////////////////////////
// class tcperror

class tcperror : public std::exception {
public:
	// Create a tcperror object with the last error code
	tcperror() throw()

#ifdef	UNIX

	// Unix
	: m_code(errno) {}
#else

	// Windows
	: m_code(WSAGetLastError()) {}
#endif

	// Create a tcperror object with the specified error code
	explicit tcperror(int code) throw()
	: m_code(code) {}

	// Get a description for this exception
	virtual const char* what() const throw();

	// Get the error code
	int code() const
	{ return m_code; }

private:
	int m_code;
};

////////////////////////////////////////////////////////////////////////////////

#endif // !TCPERROR_H


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2013 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/date_picker_header_end"
    android:layout_width="@dimen/mdtp_date_picker_component_width"
    android:layout_height="@dimen/mdtp_date_picker_header_height"
    android:gravity="center"
    android:includeFontPadding="false"
    android:textColor="@color/mdtp_accent_color_focused"
    android:textSize="@dimen/mdtp_date_picker_header_text_size"
    android:importantForAccessibility="no" />

    <!--android:textColor="@color/mdtp_white"-->
    <!--android:background="@color/mdtp_calendar_header"-->


text:
import sys

import clusto
from clusto import drivers
from clusto import script_helper

class Allocate(script_helper.Script):
    '''
    Allocate servers from a given pool, you can specify filters
    to get a server with certain features. By default the script
    will search for the cheapest machine it can find
    '''

    def __init__(self):
        script_helper.Script.__init__(self)

    def _add_arguments(self, parser):
        parser.add_argument('--memory', '-m', type=int,
            help='Minimum system memory (in Gb)')
        parser.add_argument('--cores', '-c', type=int,
            help='Minimum number of system cores')
        parser.add_argument('--disk', '-d', type=int,
            help='Minimum disk size (in Gb)')
        parser.add_argument('--spindles', '-s', type=int,
            help='Minimum number of spindles')
        parser.add_argument('--to-pool', '-t', action='append', required=True,
            help='After allocating, add to the specified pools'
            ' (use more than once to set multi-pool)')
        parser.add_argument('--create-pools', '-C', action='store_true', default=False,
            help='Create the target pools if they do not exist')
        parser.add_argument('--from-pool', '-f',
            help='What pool to search in (you can set this in clusto.conf too '
                 'in allocate.pool: --from-pool > clusto.conf:allocate.pool > "unallocated")')
        parser.add_argument('--parent', '-p', required=True,
            help='Parent to start looking at. Can be a datacenter or a rack')
        parser.add_argument('number', nargs='?', type=int, default=1,
            help='How many machines to allocate, defaults to cheapest machine available')

    def __sort_servers(self, servers):
        tuples = []
        for server in servers:
            mem = server.attr_value(key='system', subkey='memory', default=None)
            cores = server.attr_value(key='system', subkey='cpucount',
                                      default=None)
            disk_size = server.attr_value(key='system', subkey='disk', default=None)
            disk_num = len(server.attrs(key='disk', subkey='size'))
            tuples.append((server, mem, cores, disk_size, disk_num))

        # do a single sort based on a four tuple as key!
        # tuple column order determines sort priority...
        tuples = sorted(tuples, key=lambda t:(t[3],t[2],t[1],t[4]))

        return [item[0] for item in tuples]

    def __make_filter(self, subkey, expected):
        def __filter(server):
            sys_info = server.attr_value(key='system', subkey=subkey, default=None)
            if not sys_info:
                return False
            if sys_info >= expected:
                return True
            else:
                return False

        def __filter_spindle(server):
            sys_len = len(server.attrs(key='disk', subkey='size'))
            return sys_len >= expected

        if subkey == 'spindles':
            return __filter_spindle
        else:
            return __filter

    def run(self, args):
        number = args.number

        if args.from_pool:
            self.debug('Grabbing pool from parameter')
            pool = args.from_pool
        else:
            self.debug('Grabbing pool from config file or default')
            pool = self.get_conf('allocate.pool', 'unallocated')
        self.debug('Unallocated pool is "%s"' % pool)

        pools = []
        try:
            if args.create_pools:
                pools = [ clusto.get_or_create(_, drivers.pool.Pool) for _ in args.pool ]
            else:
                pools = [ clusto.get_by_name(_, assert_driver=drivers.pool.Pool) for _ in args.to_pool ]
        except Exception as e:
            self.debug(e)
            self.error('There was an error when fetching/creating the pools to allocate the servers to')
            return 4
        self.debug('Target pool list: %s' % pools)

        try:
            pool = clusto.get_by_name(pool, assert_driver=drivers.pool.Pool)
        except Exception as e:
            self.debug(e)
            self.error('The pool "%s" does not exist' % pool)
            return 1

        try:
            parent = clusto.get(args.parent)
            if not parent:
                raise LookupError("Parent object is %s" % parent)
        except Exception as e:
            self.debug(e)
            self.error('The parent object "%s" does not exist' % args.parent)
            return 2
        parent = parent[0]
        if not isinstance(parent, drivers.racks.BasicRack) and not isinstance(parent, drivers.datacenters.BasicDatacenter):
            self.error('The parent "%s" is not a rack or a datacenter' % args.parent)
            return 2

        self.info('Searching for servers in "%s", this may take a while' % parent.name)

        unallocated = [ _ for _ in parent.contents(clusto_types=[drivers.servers.BasicServer], search_children=True) ]
        unallocated = [ _ for _ in unallocated if _ in pool and _.get_ips() ]
        self.debug('The unallocated list size is %d' % len(unallocated))
        if len(unallocated) < number:
            self.error('There are not enough servers in "%s" to fulfill your request' % args.parent)
            return 3

        filters = []
        if args.memory:
            filters.append(self.__make_filter('memory', args.memory * 1000))
        if args.disk:
            filters.append(self.__make_filter('disk', args.disk))
        if args.cores:
            filters.append(self.__make_filter('cpucount', args.cores))
        if args.spindles:
            filters.append(self.__make_filter('spindles', args.spindles))

        self.debug('Applying filters: %s' % filters)
        servers = []
        if not filters:
            servers = self.__sort_servers(unallocated)[:number]
        else:
            for func in filters:
                servers = filter(func, unallocated)[:number]
        self.debug('Server list: %s' % servers)

        for s in servers:
            pool.remove(s)
            for p in pools:
                p.insert(s)

        self.info('Allocated the following list of servers matching your filters '
            'were allocated from the pool "%s"' % pool.name)
        self.info('The servers were also added to the pools %s' % ','.join([ _.name for _ in pools ]))
        for s in servers:
            if s.get_ips():
                print s.get_ips()[0]
            else:
                print s.name

def main():
    allocate, args = script_helper.init_arguments(Allocate)
    return(allocate.run(args))

if __name__ == '__main__':
    sys.exit(main())


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>redisTest</groupId>
    <artifactId>redisTest</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>redisTest Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <properties>
        <spring.version>4.3.2.RELEASE</spring.version>
        <slf4j.version>1.6.6</slf4j.version>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>
        <finalName>redisTest</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- 单元测试包 -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>RELEASE</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <!-- 单元测试包 -->

        <!-- spring相关包 -->

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <!-- spring相关包 -->

        <!-- spring事务相关包-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>4.3.2.RELEASE</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <!-- spring事务相关包-->

        <!-- spring mvc 相关-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <!-- spring mvc 相关-->

        <!-- 工具包-->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <!-- 工具包-->

        <!-- mybatis包-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.2.7</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>1.2.4</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.26</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.0.2</version>
        </dependency>
        <!--  mybatis包-->
        <!-- log-->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
        <!--log-->

        <!-- 缓存jedis-->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>1.6.6.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.4.0</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
            <version>2.4.2</version>
        </dependency>
        <!-- 缓存jedis-->
    </dependencies>

</project>


text:
/* DO NOT EDIT */
/* This file was generated from team_log_generated.stone */

package com.dropbox.core.v2.teamlog;

import com.dropbox.core.stone.StoneDeserializerLogger;
import com.dropbox.core.stone.StoneSerializers;
import com.dropbox.core.stone.UnionSerializer;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;

import java.io.IOException;
import java.util.Arrays;

public enum FedAdminRole {
    // union team_log.FedAdminRole (team_log_generated.stone)
    ENTERPRISE_ADMIN,
    NOT_ENTERPRISE_ADMIN,
    /**
     * Catch-all used for unknown tag values returned by the Dropbox servers.
     *
     * <p> Receiving a catch-all value typically indicates this SDK version is
     * not up to date. Consider updating your SDK version to handle the new
     * tags. </p>
     */
    OTHER; // *catch_all

    /**
     * For internal use only.
     */
    static class Serializer extends UnionSerializer<FedAdminRole> {
        public static final Serializer INSTANCE = new Serializer();

        @Override
        public void serialize(FedAdminRole value, JsonGenerator g) throws IOException, JsonGenerationException {
            switch (value) {
                case ENTERPRISE_ADMIN: {
                    g.writeString("enterprise_admin");
                    break;
                }
                case NOT_ENTERPRISE_ADMIN: {
                    g.writeString("not_enterprise_admin");
                    break;
                }
                default: {
                    g.writeString("other");
                }
            }
        }

        @Override
        public FedAdminRole deserialize(JsonParser p) throws IOException, JsonParseException {
            FedAdminRole value;
            boolean collapsed;
            String tag;
            if (p.getCurrentToken() == JsonToken.VALUE_STRING) {
                collapsed = true;
                tag = getStringValue(p);
                p.nextToken();
            }
            else {
                collapsed = false;
                expectStartObject(p);
                tag = readTag(p);
            }
            if (tag == null) {
                throw new JsonParseException(p, "Required field missing: " + TAG_FIELD);
            }
            else if ("enterprise_admin".equals(tag)) {
                value = FedAdminRole.ENTERPRISE_ADMIN;
            }
            else if ("not_enterprise_admin".equals(tag)) {
                value = FedAdminRole.NOT_ENTERPRISE_ADMIN;
            }
            else {
                value = FedAdminRole.OTHER;
            }
            if (!collapsed) {
                skipFields(p);
                expectEndObject(p);
            }
            return value;
        }
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>mx.com.hexabytes</groupId>
  <artifactId>tommy</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>tommy</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <!-- versions -->
    <cdi.weld.version>3.0.0.Final</cdi.weld.version>
    <jaxrs.resteasy.version>3.1.4.Final</jaxrs.resteasy.version>
    <spring.framework.version>4.3.11.RELEASE</spring.framework.version>
    <tiles.version>3.0.7</tiles.version>
    <jstl.version>1.2</jstl.version>

    <loggin.version>2.8.2</loggin.version>
    <junit.version>4.12</junit.version>
    <mockito.version>2.8.47</mockito.version>
  </properties>
  <dependencies>
    <!-- JEE -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>${jstl.version}</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.weld.servlet</groupId>
        <artifactId>weld-servlet-core</artifactId>
        <version>${cdi.weld.version}</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-servlet-initializer</artifactId>
        <version>${jaxrs.resteasy.version}</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-cdi</artifactId>
        <version>${jaxrs.resteasy.version}</version>
    </dependency>
    <!-- SPRING -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>${spring.framework.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${spring.framework.version}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>${spring.framework.version}</version>
    </dependency>
    <!-- TILES -->
    <dependency>
      <groupId>org.apache.tiles</groupId>
      <artifactId>tiles-el</artifactId>
      <version>${tiles.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.tiles</groupId>
      <artifactId>tiles-extras</artifactId>
      <version>${tiles.version}</version>
    </dependency>
    <!-- LOGS -->
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>${loggin.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <version>${loggin.version}</version>
    </dependency>
    <!-- TEST -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>tommy</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.2</version>
            <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
            </configuration>
        </plugin>
    </plugins>
  </build>
</project>


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

namespace SVPMigrator
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SVP.SVPEntitiesContainer newContext = new SVP.SVPEntitiesContainer())
            {
                using (Old.svp_oldEntities1 oldContext = new Old.svp_oldEntities1())
                {
                    foreach(Old.profile oldProfile in oldContext.profiles)
                    {
                        SVP.Profile newProfile = new SVP.Profile();
                        newProfile.Name = oldProfile.name;
                        newProfile.Value = oldProfile.disagprofiles.FirstOrDefault().value;
                        newContext.Profiles.Add(newProfile);
                    }
                    newContext.SaveChanges();
                    foreach(Old.club oldClub in oldContext.clubs)
                    {
                        SVP.Club newClub = new SVP.Club();
                        newClub.Name = oldClub.name;
                        foreach(Old.member oldMember in oldClub.members)
                        {
                            SVP.Member newMember = new SVP.Member();
                            newMember.Firstname = oldMember.firstname;
                            newMember.Name = oldMember.name;
                            newMember.Shortname = (oldMember.shortname == null ? "" : oldMember.shortname);
                            if (oldMember.birthday < new DateTime(2017, 1, 1))
                                newMember.Birthday = oldMember.birthday;
                            else
                                newMember.Birthday = null;
                            foreach(Old.sequence oldSeq in oldMember.sequences)
                            {
                                SVP.Sequence newSeq = new SVP.Sequence();
                                newSeq.Profile = newContext.Profiles.FirstOrDefault(x => x.Name.Equals(oldSeq.profile.name));
                                newSeq.Date = oldSeq.date.Value;
                                foreach(Old.shot oldShot in oldSeq.shots)
                                {
                                    SVP.Shot newShot = new SVP.Shot();
                                    newShot.Angle = oldShot.angle;
                                    newShot.FactorValue = oldShot.factor_value;
                                    newShot.ShotNumber = (short)oldShot.shot_number;
                                    newShot.Valid = oldShot.valid;
                                    newShot.Value = oldShot.value;
                                    newSeq.Shots.Add(newShot);
                                }
                                newMember.Sequences.Add(newSeq);
                            }
                            newClub.Members.Add(newMember);
                        }
                        newContext.Clubs.Add(newClub);
                    }
                }
                newContext.SaveChanges();
            }
        }
    }
}