text:
/**
 * Help command
 * @module commands/help
 */
const argvParser = require('argv');

/**
 * Command to print usage
 */
class Help {
    /**
     * Create the service
     * @param {App} app                 The application
     * @param {object} config           Configuration
     * @param {Util} util               Utility service
     */
    constructor(app, config, util) {
        this._app = app;
        this._config = config;
        this._util = util;
    }

    /**
     * Service name is 'commands.help'
     * @type {string}
     */
    static get provides() {
        return 'commands.help';
    }

    /**
     * Dependencies as constructor arguments
     * @type {string[]}
     */
    static get requires() {
        return [ 'app', 'config', 'util' ];
    }

    /**
     * Run the command
     * @param {string[]} argv           Arguments
     * @return {Promise}
     */
    async run(argv) {
        let args = argvParser
            .option({
                name: 'help',
                short: 'h',
                type: 'boolean',
            })
            .run(argv);

        if (args.targets.length < 2)
            return this.usage();

        let method = this[`help${this._util.dashedToCamel(args.targets[1], true)}`];
        if (typeof method !== 'function')
            return this.usage();

        return method.call(this, argv);
    }

    /**
     * General help
     * @return {Promise}
     */
    async usage() {
        await this._app.info(
            'Usage:\tcmd <command> [<parameters]\n\n' +
            'Commands:\n' +
            '\thelp\t\tPrint help about any other command\n' +
            '\tcreate-cert\tCreate SSL certificate\n'
        );
        process.exit(0);
    }

    /**
     * Help command
     * @return {Promise}
     */
    async helpHelp(argv) {
        await this._app.info(
            'Usage:\tcmd help <command>\n\n' +
            '\tPrint help for the given command'
        );
        process.exit(0);
    }

    /**
     * CreateCert help command
     * @return {Promise}
     */
    async helpCreateCert(argv) {
        await this._app.info(
            'Usage:\tcmd create-cert <hostname|ip-address>\n\n' +
            '\tCreate self-signed SSL certificate'
        );
        process.exit(0);
    }

    /**
     * Log error and terminate
     * @param {...*} args
     * @return {Promise}
     */
    async error(...args) {
        try {
            await args.reduce(
                async (prev, cur) => {
                    await prev;
                    return this._app.error(cur.fullStack || cur.stack || cur.message || cur);
                },
                Promise.resolve()
            );
        } catch (error) {
            // do nothing
        }
        process.exit(1);
    }
}

module.exports = Help;


text:
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.IO;
using System;
using System.Reflection;
using System.Xml.Serialization;

namespace Igor
{
	public class IgoriOSSourceUtils
	{
		public static void AddHeaderToAppControllerSource(IIgorModule ModuleInst, string PathToProject, string HeaderFile)
		{
			IgorUtils.ReplaceStringsInFile(ModuleInst, Path.Combine(PathToProject, Path.Combine("Classes", "UnityAppController.mm")),
				"@implementation UnityAppController", "#import \"" + HeaderFile + "\"\n@implementation UnityAppController");
		}

		public static void AddFunctionToAppControllerSource(IIgorModule ModuleInst, string PathToProject, string FunctionSource)
		{
			IgorUtils.ReplaceStringsInFile(ModuleInst, Path.Combine(PathToProject, Path.Combine("Classes", "UnityAppController.mm")),
				"@implementation UnityAppController", "@implementation UnityAppController\n" + FunctionSource);
		}

		public static void AddSourceToApplicationDidBecomeActive(IIgorModule ModuleInst, string PathToProject, string AdditionalSource)
		{
			IgorUtils.ReplaceStringsInFile(ModuleInst, Path.Combine(PathToProject, Path.Combine("Classes", "UnityAppController.mm")),
				"printf_console(\"-> applicationDidBecomeActive()\\n\");", AdditionalSource + "\nprintf_console(\"-> applicationDidBecomeActive()\\n\");");
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
package org.sakaiproject.metaobj.utils.mvc.intf;

import java.util.Map;

import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by IntelliJ IDEA.
 * User: jbush
 * Date: Dec 15, 2004
 * Time: 9:36:16 PM
 * To change this template use File | Settings | File Templates.
 */
public interface CancelableController {
   public boolean isCancel(Map request);

   public ModelAndView processCancel(Map request, Map session, Map application,
                                     Object command, Errors errors) throws Exception;
}


text:
<!DOCTYPE html>

    <title>ClusterAnnotation Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>

Cluster Docs (56% documented)

        Cluster Reference

        ClusterAnnotation Class Reference

            Classes

                Annotation

                ClusterAnnotation

                ClusterAnnotationView

                ClusterManager

                – ClusterPosition

                QuadTree

                StyledClusterAnnotationView

            Enumerations

                ClusterAnnotationStyle

            Extensions

                CLLocationCoordinate2D

            Functions

                ==(_:_:)

            Protocols

                ClusterManagerDelegate

ClusterAnnotation

open class ClusterAnnotation : Annotation

Undocumented

                    annotations

Undocumented

Declaration

Swift

open var annotations: [MKAnnotation]

                    isEqual(_:)

Undocumented

Declaration

Swift

open override func isEqual(_ object: Any?) -> Bool

© 2019 efremidze. All rights reserved. (Last updated: 2019-04-24)

Generated by jazzy ♪♫ v0.9.4, a Realm project.


text:
<?php
/**
 * @package library
 * @author Joseph LEMOINE <j.lemoine@ludi.cat>
 * @link https://ludi.cat
 */
namespace Jihel\Library\RBTree\Model;

/**
 * Class Node
 */
abstract class AbstractNode implements NodeInterface
{
    /**
     * id the value tha we will compare.
     * Basically it's an integer. You can override the Tree::compare
     * to set other comparison functions
     *
     * @var int
     */
    protected $id;

    /**
     * The content of this node. Can be anything
     *
     * @var mixed
     */
    protected $value;

    /**
     * Current color of the node
     *
     * @var bool
     */
    protected $color = self::COLOR_BLACK;

    /**
     * @var array|NodeInterface[]
     */
    protected $children = [
        self::POSITION_LEFT => null,
        self::POSITION_RIGHT => null,
    ];

    /**
     * Node's position relative to parent
     *
     * @var bool
     */
    protected $position;

    /**
     * Parent of the node
     *
     * @var NodeInterface
     */
    protected $parent = null;

    /**
     * @param int $id
     * @param mixed $value
     */
    public function __construct($id, $value)
    {
        $this
            ->setId($id)
            ->setValue($value)
        ;
    }

    public abstract function __toString();

    /**
     * @return mixed
     */
    public abstract function getId();

    /**
     * @param mixed $id
     * @return $this
     */
    public abstract function setId($id);

    /**
     * @return mixed
     */
    public abstract function getValue();

    /**
     * @param mixed $value
     * @return $this
     */
    public abstract function setValue($value);

    /**
     * @return boolean
     */
    public function getColor()
    {
        return $this->color;
    }

    /**
     * @param boolean $color
     * @return $this
     */
    public function setColor($color)
    {
        $this->color = $color;
        return $this;
    }

    /**
     * @param int $position
     * @return NodeInterface
     */
    public function getChild($position)
    {
        return $this->children[$position];
    }

    /**
     * @param int $position
     * @return bool
     */
    public function haveChild($position)
    {
        return null !== $this->children[$position];
    }

    /**
     * Set child
     *
     * @param int $position
     * @param NodeInterface|null $child
     * @return $this
     */
    public function setChild($position, NodeInterface $child = null)
    {
        $this->children[$position] = $child;
        if (null !== $child) {
            $child->setParent($this)->setPosition($position);
        }
        return $this;
    }

    /**
     * @return integer
     */
    public function getPosition()
    {
        return $this->position;
    }

    /**
     * @param integer|null $position
     * @return $this
     */
    public function setPosition($position)
    {
        $this->position = $position;
        return $this;
    }

    /**
     * @return NodeInterface|null
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * @param NodeInterface|null $parent
     * @return $this
     */
    public function setParent(NodeInterface $parent = null)
    {
        $this->parent = $parent;
        return $this;
    }

    /**
     * =========================================================================
     *                              SHORTCUTS
     * =========================================================================
     */

    /**
     * get grand parent if a parent exist
     *
     * @return NodeInterface|null
     */
    public function getGrandParent()
    {
        if (null !== $this->getParent()) {
            return $this->getParent()->getParent();
        }

        return null;
    }

    /**
     * Get uncle if grand parent exist
     *
     * @return NodeInterface|null
     */
    public function getUncle()
    {
        if (null !== $this->getGrandParent()) {
            return $this->getGrandParent()->getChild(-$this->getParent()->getPosition());
        }

        return null;
    }

    /**
     * Is a NIL / Leaf
     *
     * @return bool
     */
    public function isLeaf()
    {
        return null === $this->children[static::POSITION_LEFT]
            && null === $this->children[static::POSITION_RIGHT];
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
MailReceiver
</TITLE>

<META NAME="date" CONTENT="2013-05-13">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      概述
      软件包
    类
      使用
      树
      索引
      帮助

 上一个类
 下一个类

  框架
 无框架

  所有类

  摘要: 嵌套 | 字段 | 构造方法 | 方法

详细信息: 字段 | 构造方法 | 方法

com.conlect.oatos.mail

类 MailReceiver

java.lang.Object
  com.conlect.oatos.mail.MailReceiver

public class MailReceiver
extends java.lang.Object

字段摘要

private  java.util.List<com.conlect.oatos.dto.client.mail.MailAttachDTO>
attachDTOs

private  java.lang.StringBuffer
bodytext

private  javax.mail.internet.MimeMessage
msg

构造方法摘要

MailReceiver(javax.mail.internet.MimeMessage msg)

方法摘要

private  java.lang.String
addMissHtml(java.lang.String htmlBody)

          因为在Linux环境下, content-type为text/html的邮件如果缺失了头部格式则解析失败的问题.

private  com.conlect.oatos.dto.client.mail.MailAttachDTO
createAttachDTO(javax.mail.BodyPart mpart,
                java.lang.String filename,
                java.lang.String contentType)

private  java.io.InputStream
extractStream(javax.mail.Part part,
              java.lang.String attachFileName)

 java.io.InputStream
getAttachInputStream(java.lang.String attachFileName)

          对应附件输出流

 java.lang.String
getBodyText()

          获取邮件正文内容

 java.lang.String
getMailAddress(java.lang.String type)

          获取邮件收件人,抄送,密送的地址和信息。

 java.lang.String
getMessageId()

          获取此邮件的message-id

 java.util.Date
getReceivedDate()

 boolean
getReplySign()

          判断邮件是否需要回执,如需回执返回true,否则返回false

 java.lang.String
getSendDate()

          获取邮件发送日期

 java.lang.String
getSender()

          获取发送邮件者信息

 java.lang.String
getSubject()

          获取邮件主题

private  java.lang.String
getUtf8Str(java.lang.String raw)

private  boolean
haveAttach(javax.mail.Part part)

          判断是是否包含附件

private  boolean
haveRead()

          判断此邮件是否已读,如果未读则返回false,已读返回true

private  void
parseAttach(javax.mail.Part part)

private  void
parseContent(javax.mail.Part part,
             boolean multipartFlag)

          解析邮件,将得到的邮件内容保存到一个stringBuffer对象中,解析邮件 主要根据MimeType的不同执行不同的操作,一步一步的解析

 com.conlect.oatos.dto.client.mail.MailDTO
receive()

private  com.conlect.oatos.dto.client.mail.MailDTO
receiveSimpleInfo()

从类 java.lang.Object 继承的方法

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

字段详细信息

attachDTOs

private java.util.List<com.conlect.oatos.dto.client.mail.MailAttachDTO> attachDTOs

bodytext

private java.lang.StringBuffer bodytext

msg

private javax.mail.internet.MimeMessage msg

构造方法详细信息

MailReceiver

public MailReceiver(javax.mail.internet.MimeMessage msg)

方法详细信息

addMissHtml

private java.lang.String addMissHtml(java.lang.String htmlBody)

因为在Linux环境下, content-type为text/html的邮件如果缺失了头部格式则解析失败的问题.

参数:
htmlBody -

返回:
正确格式的html

createAttachDTO

private com.conlect.oatos.dto.client.mail.MailAttachDTO createAttachDTO(javax.mail.BodyPart mpart,
                                                                        java.lang.String filename,
                                                                        java.lang.String contentType)
                                                                 throws javax.mail.MessagingException

抛出:

javax.mail.MessagingException

extractStream

private java.io.InputStream extractStream(javax.mail.Part part,
                                          java.lang.String attachFileName)
                                   throws java.lang.Exception

抛出:

java.lang.Exception

getAttachInputStream

public java.io.InputStream getAttachInputStream(java.lang.String attachFileName)

对应附件输出流

参数:
attachFileName - 附件文件名

返回:

getBodyText

public java.lang.String getBodyText()

获取邮件正文内容

getMailAddress

public java.lang.String getMailAddress(java.lang.String type)
                                throws javax.mail.MessagingException,
                                       java.io.UnsupportedEncodingException

获取邮件收件人,抄送,密送的地址和信息。根据所传递的参数不同 "to"-->收件人,"cc"-->抄送人地址,"bcc"-->密送地址

参数:
type - BCC, CC, TO

抛出:

javax.mail.MessagingException

java.io.UnsupportedEncodingException

getMessageId

public java.lang.String getMessageId()
                              throws javax.mail.MessagingException

获取此邮件的message-id

返回:

抛出:

javax.mail.MessagingException

getReceivedDate

public java.util.Date getReceivedDate()

getReplySign

public boolean getReplySign()
                     throws javax.mail.MessagingException

判断邮件是否需要回执,如需回执返回true,否则返回false

返回:

抛出:

javax.mail.MessagingException

getSendDate

public java.lang.String getSendDate()
                             throws javax.mail.MessagingException

获取邮件发送日期

返回:

抛出:

javax.mail.MessagingException

getSender

public java.lang.String getSender()

获取发送邮件者信息

getSubject

public java.lang.String getSubject()

获取邮件主题

getUtf8Str

private java.lang.String getUtf8Str(java.lang.String raw)

haveAttach

private boolean haveAttach(javax.mail.Part part)

判断是是否包含附件

参数:
part -

返回:

抛出:

javax.mail.MessagingException

java.io.IOException

haveRead

private boolean haveRead()

判断此邮件是否已读,如果未读则返回false,已读返回true

返回:

抛出:

javax.mail.MessagingException

parseAttach

private void parseAttach(javax.mail.Part part)
                  throws java.lang.Exception

抛出:

java.lang.Exception

parseContent

private void parseContent(javax.mail.Part part,
                          boolean multipartFlag)
                   throws javax.mail.MessagingException,
                          java.io.IOException

解析邮件,将得到的邮件内容保存到一个stringBuffer对象中,解析邮件 主要根据MimeType的不同执行不同的操作,一步一步的解析

参数:
part -

抛出:

javax.mail.MessagingException

java.io.IOException

receive

public com.conlect.oatos.dto.client.mail.MailDTO receive()
                                                  throws java.lang.Exception

抛出:

java.lang.Exception

receiveSimpleInfo

private com.conlect.oatos.dto.client.mail.MailDTO receiveSimpleInfo()
                                                             throws javax.mail.MessagingException,
                                                                    java.io.IOException

抛出:

javax.mail.MessagingException

java.io.IOException

      概述
      软件包
    类
      使用
      树
      索引
      帮助

 上一个类
 下一个类

  框架
 无框架

  所有类

  摘要: 嵌套 | 字段 | 构造方法 | 方法

详细信息: 字段 | 构造方法 | 方法


text:
//
//      Copyright (C) 2012-2014 DataStax Inc.
//
//   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.
//

namespace Cassandra
{
    internal class ErrorResponse : AbstractResponse
    {
        public const byte OpCode = 0x00;
        public OutputError Output;

        internal ErrorResponse(ResponseFrame frame)
            : base(frame)
        {
            int errorCode = BeBinaryReader.ReadInt32();
            string message = BeBinaryReader.ReadString();
            Output = OutputError.CreateOutputError(errorCode, message, BeBinaryReader);
        }

        internal static ErrorResponse Create(ResponseFrame frame)
        {
            return new ErrorResponse(frame);
        }
    }
}


text:
class Fragment {
public:
    void setStopCount(size_t stopCount) {
        stopCount_ = stopCount;
    }
    void addTimeLine(const TimeLine& tline) {
        assert(tline.size() == stopCount_);

        timeTable_.insert(timeTable_.end(), tline.cbegin(), tline.cend());
        ++timeLinesCount_;

        assert(timeTable_.size() == stopCount_ * timeLinesCount_);
    }

    TimeLine getStopTimes(size_t stopIndex) const;

    Time getTime(size_t timelineIx, size_t stopIx) const {
        assert(timelineIx < timeLinesCount_);
        assert(stopIx < stopCount_);
        assert(timeTable_.size() == stopCount_ * timeLinesCount_);

        return timeTable_[timelineIx * stopCount_ + stopIx];
    }

    std::pair<Time, bool> findArriveTime(size_t fromIndex, Time leave, size_t toIndex) const;

private:
    using TimeTable = std::vector<Time>;
    struct TimeTableIterator: std::forward_iterator_tag {
        TimeTableIterator();
    };

    size_t      stopCount_;
    size_t      timeLinesCount_;
    TimeTable   timeTable_;
};

#endif // FRAGMENT_HPP


text:
package oasis.names.tc.ebxml_regrep.xsd.lcm._3;

import javax.xml.bind.annotation.XmlRegistry;

@XmlRegistry
public class ObjectFactory
{
  public UndeprecateObjectsRequest createUndeprecateObjectsRequest()
  {
    return new UndeprecateObjectsRequest();
  }

  public AcceptObjectsRequest createAcceptObjectsRequest()
  {
    return new AcceptObjectsRequest();
  }

  public RemoveObjectsRequest createRemoveObjectsRequest()
  {
    return new RemoveObjectsRequest();
  }

  public SubmitObjectsRequest createSubmitObjectsRequest()
  {
    return new SubmitObjectsRequest();
  }

  public DeprecateObjectsRequest createDeprecateObjectsRequest()
  {
    return new DeprecateObjectsRequest();
  }

  public RelocateObjectsRequest createRelocateObjectsRequest()
  {
    return new RelocateObjectsRequest();
  }

  public UpdateObjectsRequest createUpdateObjectsRequest()
  {
    return new UpdateObjectsRequest();
  }

  public ApproveObjectsRequest createApproveObjectsRequest()
  {
    return new ApproveObjectsRequest();
  }
}


text:
<?php

declare(strict_types = 1);

namespace Telegram\Storage;

use Telegram\API\Base\Abstracts\ABaseObject;
use Telegram\LogHelpers\Interfaces\ILoggerAwareInterface;
use Telegram\LogHelpers\Traits\TLoggerTrait;
use Psr\Log;

class StorageService implements Interfaces\ITelegramStorageService, ILoggerAwareInterface {

    use TLoggerTrait;

    /**
     * @var \Telegram\Storage\Interfaces\ITelegramStorageHandler[]
     */
    private $_storageHandlers = [];

    /**
     * @inheritdoc
     */
    public function getStorageHandlerName() : string {
        return 'StorageService';
    }

    /**
     * Tries to store the given TelegramObject in all provided storageHandlers; Returns TRUE on success, FALSE when one or more storageHandlers fails to store the object
     * @param \Telegram\API\Base\Abstracts\ABaseObject $object
     * @param array $optionalArguments
     * @return bool
     * @throws \Exception
     */
    public function store(ABaseObject $object, array $optionalArguments = []) : bool {
        if (empty($this->_storageHandlers)) {
            throw new \Exception('No storageHandlers pushed onto the stack!');
        }
        $success = TRUE;
        foreach ($this->_storageHandlers as $storageHandler) {
            $res = $storageHandler->store($object, $optionalArguments);
            if (!$res) {
                $success = FALSE;
                $this->logAlert('Storing was unsuccessfull for StorageHandler ' . $storageHandler->getStorageHandlerName());
            }
        }
        return $success;
    }

    /**
     * Tries to delete all refereces of Telegram object. Returns TRUE on Success; False when one of the StorageHandlers fails
     * @param \Telegram\API\Base\Abstracts\ABaseObject $object
     * @return bool
     * @throws \Exception
     */
    public function delete(ABaseObject $object) : bool {
        if (empty($this->_storageHandlers)) {
            throw new \Exception('No storageHandlers pushed onto the stack!');
        }
        $success = TRUE;
        foreach ($this->_storageHandlers as $storageHandler) {
            $res = $storageHandler->store($object);
            if (!$res) {
                $success = FALSE;
                $this->logAlert('Deleting was unsuccessfull for StorageHandler ' . $storageHandler->getStorageHandlerName());
            }
        }
        return $success;
    }

    /**
     * Returns the first viable result from a storageHandler
     * @param string $class
     * @param string $id
     * @param string $index
     * @param array $optionalArguments
     * @return \Telegram\API\Base\Abstracts\ABaseObject
     * @throws \Exception
     */
    public function load(string $class, string $id = '', string $index = NULL, array $optionalArguments = []) : ABaseObject {
        if (empty($this->_storageHandlers)) {
            throw new \Exception('No storageHandlers pushed onto the stack!');
        }
        foreach ($this->_storageHandlers as $storageHandler) {
            $result = $storageHandler->load($class, $id, $index);
            if (is_a($result, $class)) {
                return $result;
            } else {
                $this->logAlert("Incompatible result encountered while loading $class with loader " . $storageHandler->getStorageHandlerName());
            }
        }
        throw new \Exception("unable to load data for class '$class' with id '$id' and index '$index'");
    }

    /**
     * Returns the first viable set from a storageHandler
     * @param string $class
     * @param array $optionalArguments
     * @return array
     * @throws \Exception
     */
    public function loadAll(string $class, array $optionalArguments = []): array {
        if (empty($this->_storageHandlers)) {
            throw new \Exception('No storageHandlers pushed onto the stack!');
        }
        foreach ($this->_storageHandlers as $storageHandler) {
            $result = $storageHandler->loadAll($class, $optionalArguments);
            if ($result !== NULL && $result !== FALSE) {
                return $result;
            }
        }
        throw new \Exception("unable to load data for class '$class' with id '$id' and index '$index'");
    }

    /**
     * Push a storageHandler on the stack
     * @param \Telegram\Storage\Interfaces\ITelegramStorageHandler $storageHandler
     * @return int
     */
    public function pushStorageHandler(Interfaces\ITelegramStorageHandler $storageHandler) : int {
        return array_unshift($this->_storageHandlers, $storageHandler);
    }

    /**
     * Pop a storagHandler from the stack
     * @return \Telegram\Storage\Interfaces\ITelegramStorageHandler
     */
    public function popStorageHandler() : Interfaces\ITelegramStorageHandler {
        return array_shift($this->_storageHandlers);
    }
}


text:
import DS from 'ember-data';
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
import Configuration from '../config/environment';
import Ember from 'ember';

export default DS.RESTAdapter.extend(DataAdapterMixin, {

  authorizer: 'authorizer:kontinuous',
  defaultSerializer: 'kontinuous',
  host: Configuration.APP.kontinuousAPI.host,
  namespace: `api/${Configuration.APP.kontinuousAPI.version}`,

  handleResponse(status, headers, payload) {
    if (payload && payload.hasOwnProperty('Code') && (payload.Code >= 400 && payload.Code <= 500)) {
      return new DS.AdapterError(payload);
    }
    return this._super(...arguments);
  },

  queryRecord(store, type, query) {
    var q = Ember.copy(query),
        url = this.buildURL(type.modelName, null, null, "queryRecord", q);

    if (this.sortQueryParams) {
      q = this.sortQueryParams(q);
    }

    return this.ajax(url, "GET", { data: q });
  },

  query(store, type, query) {
    var q = Ember.copy(query),
        url = this.buildURL(type.modelName, null, null, "query", q);

    if (this.sortQueryParams) {
      q = this.sortQueryParams(q);
    }

    return this.ajax(url, "GET", { data: q });
  },

  urlForQueryRecord: function(query, modelName) {
    var urlParts = this._buildURL(modelName).split('/');

    if (Ember.isPresent(query.owner) && Ember.isPresent(query.repo)) {
      urlParts.push(query.owner, query.repo);
      delete query.owner;
      delete query.repo;
    }

    return urlParts.join('/');
  },

});


text:
"""
switchboard.admin
~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2015 Kyle Adams.
:license: Apache License 2.0, see LICENSE for more details.
"""

from datetime import datetime
import logging
from operator import attrgetter

from bottle import Bottle, request, mako_view as view
import datastore.core
from webob.exc import HTTPNotFound

from .. import operator, signals
from ..models import Switch
from .utils import (
    json_api,
    SwitchboardException,
    valid_sort_orders
)
from ..settings import settings

log = logging.getLogger(__name__)

app = Bottle()
# Template poke-jiggery; will hopefully give way to config options soon.
import bottle
import os
dir_name = os.path.dirname(os.path.realpath(__file__))
bottle.TEMPLATE_PATH.append(dir_name)

@app.get('/')
@view('index')
def index():
    by = request.query.by or '-date_modified'
    if by not in valid_sort_orders():
        raise HTTPNotFound('Invalid sort order.')

    reverse = by.find('-') is 0
    sort_by = by.lstrip('-')

    switches = Switch.all()
    switches.sort(key=attrgetter(sort_by), reverse=reverse)

    messages = []
    if isinstance(Switch.ds, datastore.DictDatastore):
        m = dict(status='warning',
                 message='An in-memory datastore is being used; no changes \
                          will persist after a server restart.')
        messages.append(m)

    return dict(
        switches=[s.to_dict(operator) for s in switches],
        all_conditions=list(operator.get_all_conditions()),
        sorted_by=by,
        messages=messages,
        settings=settings,
    )

@app.post('/add')
@json_api
def add():
    key = request.forms['key']
    label = request.forms.get('label', '')
    description = request.forms.get('description')

    if not key:
        raise SwitchboardException("Key cannot be empty")

    if len(key) > 32:
        raise SwitchboardException("Key must be less than or equal to 32"
                                   + " characters in length")

    if len(label) > 32:
        raise SwitchboardException("Name must be less than or equal to 32"
                                   + " characters in length")

    if Switch.get(key):
        raise SwitchboardException("Switch with key %s already exists"
                                   % key)

    switch = Switch.create(key=key, label=label or None,
                           description=description)

    log.info('Switch %r added (%%s)' % switch.key,
             ', '.join('%s=%r' % (k, getattr(switch, k)) for k in
                       sorted(('key', 'label', 'description', ))))

    signals.switch_added.send(switch)
    return switch.to_dict(operator)

@app.post('/update')
@json_api
def update():
    curkey = request.forms['curkey']
    key = request.forms['key']
    label = request.forms.get('label', '')
    description = request.forms.get('description')

    switch = Switch.get(curkey)

    if len(key) > 32:
        raise SwitchboardException("Key must be less than or equal to 32"
                                   + " characters in length")

    if len(label) > 32:
        raise SwitchboardException("Name must be less than or equal to 32"
                                   + " characters in length")

    values = dict(
        label=label,
        key=key,
        description=description,
    )

    changes = {}
    for k, v in values.iteritems():
        old_value = getattr(switch, k)
        if old_value != v:
            changes[k] = (v, old_value)

    if changes:
        if switch.key != key:
            switch.delete()
            switch.key = key

        switch.label = label
        switch.description = description
        switch.date_modified = datetime.utcnow()
        switch.save()

        log.info('Switch %r updated %%s' % switch.key,
                 ', '.join('%s=%r->%r' % (k, v[0], v[1]) for k, v in
                           sorted(changes.iteritems())))

        signals.switch_updated.send(switch)

    return switch.to_dict(operator)

@app.post('/status')
@json_api  # XXX Not needed?
def status():
    key = request.forms['key']
    status = request.forms['status']
    switch = Switch.get(key)

    try:
        status = int(status)
    except ValueError:
        raise SwitchboardException("Status must be integer")

    old_status_label = switch.get_status_display()

    if switch.status != status:
        switch.status = status
        switch.date_modified = datetime.utcnow()
        switch.save()

        log.info('Switch %r updated (status=%%s->%%s)' % switch.key,
                 old_status_label, switch.get_status_display())

        signals.switch_status_updated.send(switch)

    return switch.to_dict(operator)

@app.post('/delete')
@json_api
def delete():
    key = request.forms['key']
    switch = Switch.remove(key)
    log.info('Switch %r removed' % key)
    signals.switch_deleted.send(switch)
    return {}

@app.post('/add_condition')
@json_api
def add_condition():
    post = request.POST
    key = post.get("key")
    condition_set_id = post.get("id")
    field_name = post.get("field")
    exclude = int(post.get("exclude") or 0)

    if not all([key, condition_set_id, field_name]):
        raise SwitchboardException("Fields cannot be empty")

    condition_set = operator.get_condition_set_by_id(condition_set_id)
    field = condition_set.fields[field_name]
    value = field.validate(post)

    switch = operator[key]
    switch.add_condition(condition_set_id, field_name, value,
                         exclude=exclude)

    log.info('Condition added to %r (%r, %s=%r, exclude=%r)',
             switch.key, condition_set_id, field_name, value,
             bool(exclude))

    signals.switch_condition_added.send(switch)

    return switch.to_dict(operator)

@app.post('/remove_condition')
@json_api
def remove_condition():
    post = request.POST
    key = post.get("key")
    condition_set_id = post.get("id")
    field_name = post.get("field")
    value = post.get("value")

    if not all([key, condition_set_id, field_name, value]):
        raise SwitchboardException("Fields cannot be empty")

    switch = operator[key]
    switch.remove_condition(condition_set_id, field_name, value)

    log.info('Condition removed from %r (%r, %s=%r)' % (switch.key,
             condition_set_id, field_name, value))

    signals.switch_condition_removed.send(switch)

    return switch.to_dict(operator)


text:
@implementation REDGETHTTPRequest

#pragma mark - GET
-(void)callWithRequest:(id<REDRequestProtocol>)request andURL:(NSString *)url andCallback:(REDHTTPRequestProtocolCallback)callback {
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.requestSerializer = [AFJSONRequestSerializer serializer];
    manager.responseSerializer = [request Serializer] == REDXMLSerializer ? [AFXMLParserResponseSerializer serializer] : [AFJSONResponseSerializer serializer];
    [manager GET:url parameters:[request HTTPEncode] success:^(NSURLSessionDataTask *task, id responseObject) {
        if ([responseObject isKindOfClass:[NSDictionary class]]) {
            if (responseObject[@"success"] == nil) {
                callback(responseObject, nil);
                return ;
            }
            if ([responseObject[@"success"] boolValue]) {
                callback(responseObject, nil);
            } else {
                callback(responseObject, [NSError errorWithDomain:REDErrorDomain code:101 userInfo:@{NSLocalizedDescriptionKey : responseObject[@"message"]}]);
            }
        } else {
            callback(responseObject, nil);
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        callback(nil, [NSError errorWithDomain:REDErrorDomain code:error.code userInfo :@{ NSLocalizedDescriptionKey : error.localizedDescription }]);
    }];
}

@end


text:
define({
  "transparencyLabel": "Transparence",
  "outline": "Contour",
  "fill": "Remplissage (La couleur s'applique uniquement lorsque le style est uni)",
  "style": "Style",
  "mandatoryLabel": "Distance d'évacuation obligatoire",
  "mandatoryButtonLabel": "Configurer les paramètres de distance d'évacuation obligatoire",
  "safeLabel": "Distance d'évacuation de sécurité",
  "safeButtonLabel": "Configurer les paramètres de distance d'évacuation de sécurité",
  "selectOpLayerLabel": "Sélectionner une couche opérationnelle pour les résultats",
  "selectDefaultMeasurementLabel": "Sélectionner une unité de mesure par défaut.",
  "helpIconTooltip": "La liste des couches opérationnelles est renseignée à l'aide des couches de la carte web actuelle dont le type de géométrie est Polygone.",
  "lineStyles": {
    "esriSLSDash": "Tiret",
    "esriSLSDashDot": "Tiret-point",
    "esriSLSDashDotDot": "Tiret-point-point",
    "esriSLSDot": "Point",
    "esriSLSLongDash": "Tiret long",
    "esriSLSLongDashDot": "Tiret-point long",
    "esriSLSNull": "Nulle",
    "esriSLSShortDash": "Tiret court",
    "esriSLSShortDashDot": "Tiret court-point",
    "esriSLSShortDashDotDot": "Tiret court-point-point",
    "esriSLSShortDot": "Point court",
    "esriSLSSolid": "Solide"
  },
  "fillStyles": {
    "esriSFSBackwardDiagonal": "Arrière",
    "esriSFSCross": "Croiser",
    "esriSFSDiagonalCross": "Diagonal",
    "esriSFSForwardDiagonal": "Avant",
    "esriSFSHorizontal": "Horizontale",
    "esriSFSNull": "Nulle",
    "esriSFSSolid": "Solide",
    "esriSFSVertical": "Verticale"
  }
});


text:
using System;
using Xunit;

// ReSharper disable ImpureMethodCallOnReadonlyValueField

namespace Beefeater.Tests.EitherTests
{
    public class WhenCreatingAnEitherFooBarUsingNullFooThen
    {
        private readonly Either<Foo, Bar> _either;

        public WhenCreatingAnEitherFooBarUsingNullFooThen()
        {
            _either = Either<Foo, Bar>.OfResult1(null);
        }

        [Fact]
        public void HasValueReturnsFalse()
        {
            Assert.False(_either.HasValue);
        }

        [Fact]
        public void AccessingItem1ReturnsNull()
        {
            Assert.Equal(null, _either.Item1);
        }

        [Fact]
        public void ExplicitCastToAnFooThrowsException()
        {
            Assert.Throws<InvalidOperationException>(() => _either.Item2);
        }

        public class Foo
        {
        }

        public class Bar
        {
        }
    }
}


text:
Hammock
=======

If you're looking for a modern server-side replacement for Hammock, you can try:

http://github.com/danielcrenna/hammock2

If you need legacy support and System.Web namespace usage, then you'll want:

http://github.com/restsharp/restsharp

Sunset Notice
-------------
I'm really glad if this project was/is helpful for your development.

But I wouldn't count on any updates.

Patches that can merge cleanly are always welcome.

For everything else, there's a fork button.


text:
import * as React from 'react';
declare class JqxTooltip extends React.PureComponent<ITooltipProps, IState> {
    protected static getDerivedStateFromProps(props: ITooltipProps, state: IState): null | IState;
    private _jqx;
    private _id;
    private _componentSelector;
    constructor(props: ITooltipProps);
    componentDidMount(): void;
    componentDidUpdate(): void;
    render(): React.ReactNode;
    setOptions(options: ITooltipProps): void;
    getOptions(option: string): any;
    close(index?: number): void;
    destroy(): void;
    open(left?: number, top?: number): void;
    refresh(): void;
    private _manageProps;
    private _wireEvents;
}
export default JqxTooltip;
export declare const jqx: any;
export declare const JQXLite: any;
interface IState {
    lastProps: object;
}
interface ITooltipOptions {
    absolutePositionX?: number;
    absolutePositionY?: number;
    autoHide?: boolean;
    autoHideDelay?: number;
    animationShowDelay?: number | string;
    animationHideDelay?: number | string;
    content?: string;
    closeOnClick?: boolean;
    disabled?: boolean;
    enableBrowserBoundsDetection?: boolean;
    height?: number | string;
    left?: number;
    name?: string;
    opacity?: number;
    position?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'bottom-left' | 'top-right' | 'bottom-right' | 'absolute' | 'mouse' | 'mouseenter' | 'default';
    rtl?: boolean;
    showDelay?: number;
    showArrow?: boolean;
    top?: number | string;
    trigger?: 'hover' | 'click' | 'none';
    theme?: string;
    width?: number | string;
}
export interface ITooltipProps extends ITooltipOptions {
    className?: string;
    style?: React.CSSProperties;
    onClose?: (e?: Event) => void;
    onClosing?: (e?: Event) => void;
    onOpen?: (e?: Event) => void;
    onOpening?: (e?: Event) => void;
}


text:
<?php

namespace aRvi\WebResponse;

class JsonWebResponse extends WebResponse {

    /**
     * Constructor
     */
    public function __construct() {
        $this->arrHeaders[] = "Content-type: application/json";
    }

    /**
     * Set JSON payload
     *
     * @param mixed $mixedPayload Payload
     */
    public function setPayload($mixedPayload) {
        parent::setPayload(json_encode($mixedPayload));
    }

}


text:
package org.ohdsi.webapi.pathway.converter;

import org.ohdsi.webapi.pathway.dto.PathwayCohortDTO;
import org.springframework.stereotype.Component;

@Component
public class PathwayCohortToPathwayCohortDTOConverter extends BasePathwayCohortToPathwayCohortDTOConverter<PathwayCohortDTO> {

    @Override
    protected PathwayCohortDTO getResultObject() {

        return new PathwayCohortDTO();
    }
}


text:
package com.jiahaoliuliu.android.dialogfragment;

// Source code: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/android/app/DialogFragment.java

import com.jiahaoliuliu.androidframeprogressdialog.R;

import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;

public class LoadingDialog extends DialogFragment {

	private boolean isDialogShownBool;
	private int numberDialogShowRequest;

	public LoadingDialog() {
		// Empty constructor required for DialogFragment
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInsntaceState) {
		View view = inflater.inflate(R.layout.fragment_loading, container);

		// Remove the title
		getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
		return view;
	}

	@Override
	public int show(FragmentTransaction transaction, String tag) {
		int result = -1;
		if (!isDialogShownBool) {
			result = super.show(transaction, tag);
			isDialogShownBool = true;
		}
		numberDialogShowRequest++;
		return result;
	}

	@Override
	public void show(FragmentManager manager, String tag) {
		if (!isDialogShownBool) {
			super.show(manager, tag);
			isDialogShownBool = true;
		}
		numberDialogShowRequest++;
	}

	@Override
	public void dismiss() {
		numberDialogShowRequest--;
		if (numberDialogShowRequest <= 0) {
			if (isDialogShownBool) {
				super.dismiss();
				isDialogShownBool = false;
			}
			numberDialogShowRequest = 0;
		}
	}

	/**
	 * Method used to force dismiss the loading dialog, no matter the number
	 * of requests
	 */
	public void dismissForce() {
		numberDialogShowRequest = 0;
		if (isDialogShownBool) {
			super.dismiss();
			isDialogShownBool = false;
		}
	}
	/**
	 * Check if the dialog is being shown
	 * @return true  if the dialog is shown
	 *         false otherwise
	 */
	public boolean isDialogShown() {
		return isDialogShownBool;
	}

	public int getNumberDialogShowRequest() {
		return numberDialogShowRequest;
	}

	@Override
	public void onCancel(DialogInterface dialog) {
		super.onCancel(dialog);

		// Restart the values
		isDialogShownBool = false;
		numberDialogShowRequest = 0;
	}
}


text:
<resources>
    <string name="app_name">Zemer</string>

    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
    <string name="push">Push to enter</string>
</resources>


text:
<?xml version = '1.0' encoding = 'UTF-8'?>
<Entity class="oracle.dbtools.crest.model.design.logical.Entity" directorySegmentName="seg_0" id="AF594E8D-41A5-6121-B2A6-A568EA74B040" name="Parte">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 10:56:03 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<adequatelyNormalized>NO</adequatelyNormalized>
<expectedVolumes>0</expectedVolumes>
<fwdEngineeringStrategyName>Single Table</fwdEngineeringStrategyName>
<growthPercent>0</growthPercent>
<growthType>Year</growthType>
<maxVolumes>9999999</maxVolumes>
<minVolumes>0</minVolumes>
<normalForm>Third</normalForm>
<attributes itemClass="oracle.dbtools.crest.model.design.logical.Attribute">
<Attribute name="idParte" id="0F204569-EF53-FC72-F8FD-27216EFEFF37">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:14:47 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT019</logicalDatatype>
<dataTypePrecision>10</dataTypePrecision>
<ownDataTypeParameters>,10,</ownDataTypeParameters>
</Attribute>
<Attribute name="fecha" id="CBF76140-D27B-9B27-8B38-E82E14A3207A">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:15:05 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT007</logicalDatatype>
<ownDataTypeParameters>,,</ownDataTypeParameters>
</Attribute>
<Attribute name="kmInicio" id="07DC516D-0C31-2038-EBAB-B16396472056">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:15:19 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT019</logicalDatatype>
<dataTypePrecision>7</dataTypePrecision>
<ownDataTypeParameters>,7,</ownDataTypeParameters>
</Attribute>
<Attribute name="kmFinal" id="684012A8-A066-E22C-1E11-6006FDB371A1">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:16:01 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT019</logicalDatatype>
<dataTypePrecision>7</dataTypePrecision>
<ownDataTypeParameters>,7,</ownDataTypeParameters>
</Attribute>
<Attribute name="gasolina" id="E9D7B1F5-06EF-ED27-5E68-6F0F00EE2D46">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:16:21 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<nullsAllowed>true</nullsAllowed>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT019</logicalDatatype>
<dataTypePrecision>4</dataTypePrecision>
<ownDataTypeParameters>,4,</ownDataTypeParameters>
</Attribute>
<Attribute name="peaje" id="C73C4DD4-0A9A-209B-CBD2-BAAFC9C3ACAF">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:16:35 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<nullsAllowed>true</nullsAllowed>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT019</logicalDatatype>
<dataTypePrecision>3</dataTypePrecision>
<ownDataTypeParameters>,3,</ownDataTypeParameters>
</Attribute>
<Attribute name="dietas" id="94C1244E-F39F-F9F5-84D3-86F3494FE9B2">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:16:49 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<nullsAllowed>true</nullsAllowed>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT019</logicalDatatype>
<dataTypePrecision>3</dataTypePrecision>
<ownDataTypeParameters>,3,</ownDataTypeParameters>
</Attribute>
<Attribute name="otros" id="B6FDC017-84F9-CD7C-584D-0EDDBE163CF6">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:17:04 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<nullsAllowed>true</nullsAllowed>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT019</logicalDatatype>
<dataTypePrecision>4</dataTypePrecision>
<ownDataTypeParameters>,4,</ownDataTypeParameters>
</Attribute>
<Attribute name="incidencia" id="A1AFDFC6-BB86-9ADD-AD71-0433896F0A3E">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:17:12 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<nullsAllowed>true</nullsAllowed>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT024</logicalDatatype>
<dataTypeSize>255</dataTypeSize>
<ownDataTypeParameters>255,,</ownDataTypeParameters>
</Attribute>
<Attribute name="validado" id="4BA26971-067F-9065-8AF1-0DA4BC4D131F">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:21:25 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="true"/>
</engineerTo>
<useDomainConstraints>false</useDomainConstraints>
<use>1</use>
<logicalDatatype>LOGDT024</logicalDatatype>
<dataTypeSize>2</dataTypeSize>
<ownDataTypeParameters>2,,</ownDataTypeParameters>
</Attribute>
</attributes>
<identifiers itemClass="oracle.dbtools.crest.model.design.logical.CandidateKey">
<identifier id="653D6B8B-77D0-D37A-3C5B-1551F3FD5FBC" name="Parte PK">
<createdBy>1GPROG12</createdBy>
<createdTime>2016-05-12 11:15:04 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>MER-Relacional-Actualizado</ownerDesignName>
<shouldEngineer>false</shouldEngineer>
<engineerTo>
<item key="790F7506-F93A-DF10-E556-3648863FD72A" value="false"/>
</engineerTo>
<pk>true</pk>
<usedAttributes>
<attributeRef>0F204569-EF53-FC72-F8FD-27216EFEFF37</attributeRef>
</usedAttributes>
</identifier>
</identifiers>
</Entity>


text:
// Code generated by client-gen. DO NOT EDIT.

package v1alpha1

import (
	"context"
	v1alpha1 "github.com/libopenstorage/autopilot-api/pkg/apis/autopilot/v1alpha1"
	scheme "github.com/libopenstorage/autopilot-api/pkg/client/clientset/versioned/scheme"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	types "k8s.io/apimachinery/pkg/types"
	watch "k8s.io/apimachinery/pkg/watch"
	rest "k8s.io/client-go/rest"
	"time"
)

// ActionApprovalsGetter has a method to return a ActionApprovalInterface.
// A group's client should implement this interface.
type ActionApprovalsGetter interface {
	ActionApprovals(namespace string) ActionApprovalInterface
}

// ActionApprovalInterface has methods to work with ActionApproval resources.
type ActionApprovalInterface interface {
	Create(*v1alpha1.ActionApproval) (*v1alpha1.ActionApproval, error)
	Update(*v1alpha1.ActionApproval) (*v1alpha1.ActionApproval, error)
	UpdateStatus(*v1alpha1.ActionApproval) (*v1alpha1.ActionApproval, error)
	Delete(name string, options *v1.DeleteOptions) error
	DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
	Get(name string, options v1.GetOptions) (*v1alpha1.ActionApproval, error)
	List(opts v1.ListOptions) (*v1alpha1.ActionApprovalList, error)
	Watch(opts v1.ListOptions) (watch.Interface, error)
	Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ActionApproval, err error)
	ActionApprovalExpansion
}

// actionApprovals implements ActionApprovalInterface
type actionApprovals struct {
	client rest.Interface
	ns     string
}

// newActionApprovals returns a ActionApprovals
func newActionApprovals(c *AutopilotV1alpha1Client, namespace string) *actionApprovals {
	return &actionApprovals{
		client: c.RESTClient(),
		ns:     namespace,
	}
}

// Get takes name of the actionApproval, and returns the corresponding actionApproval object, and an error if there is any.
func (c *actionApprovals) Get(name string, options v1.GetOptions) (result *v1alpha1.ActionApproval, err error) {
	result = &v1alpha1.ActionApproval{}
	err = c.client.Get().
		Namespace(c.ns).
		Resource("actionapprovals").
		Name(name).
		VersionedParams(&options, scheme.ParameterCodec).
		Do(context.TODO()).
		Into(result)
	return
}

// List takes label and field selectors, and returns the list of ActionApprovals that match those selectors.
func (c *actionApprovals) List(opts v1.ListOptions) (result *v1alpha1.ActionApprovalList, err error) {
	var timeout time.Duration
	if opts.TimeoutSeconds != nil {
		timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
	}
	result = &v1alpha1.ActionApprovalList{}
	err = c.client.Get().
		Namespace(c.ns).
		Resource("actionapprovals").
		VersionedParams(&opts, scheme.ParameterCodec).
		Timeout(timeout).
		Do(context.TODO()).
		Into(result)
	return
}

// Watch returns a watch.Interface that watches the requested actionApprovals.
func (c *actionApprovals) Watch(opts v1.ListOptions) (watch.Interface, error) {
	var timeout time.Duration
	if opts.TimeoutSeconds != nil {
		timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
	}
	opts.Watch = true
	return c.client.Get().
		Namespace(c.ns).
		Resource("actionapprovals").
		VersionedParams(&opts, scheme.ParameterCodec).
		Timeout(timeout).
		Watch(context.TODO())
}

// Create takes the representation of a actionApproval and creates it.  Returns the server's representation of the actionApproval, and an error, if there is any.
func (c *actionApprovals) Create(actionApproval *v1alpha1.ActionApproval) (result *v1alpha1.ActionApproval, err error) {
	result = &v1alpha1.ActionApproval{}
	err = c.client.Post().
		Namespace(c.ns).
		Resource("actionapprovals").
		Body(actionApproval).
		Do(context.TODO()).
		Into(result)
	return
}

// Update takes the representation of a actionApproval and updates it. Returns the server's representation of the actionApproval, and an error, if there is any.
func (c *actionApprovals) Update(actionApproval *v1alpha1.ActionApproval) (result *v1alpha1.ActionApproval, err error) {
	result = &v1alpha1.ActionApproval{}
	err = c.client.Put().
		Namespace(c.ns).
		Resource("actionapprovals").
		Name(actionApproval.Name).
		Body(actionApproval).
		Do(context.TODO()).
		Into(result)
	return
}

// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().

func (c *actionApprovals) UpdateStatus(actionApproval *v1alpha1.ActionApproval) (result *v1alpha1.ActionApproval, err error) {
	result = &v1alpha1.ActionApproval{}
	err = c.client.Put().
		Namespace(c.ns).
		Resource("actionapprovals").
		Name(actionApproval.Name).
		SubResource("status").
		Body(actionApproval).
		Do(context.TODO()).
		Into(result)
	return
}

// Delete takes name of the actionApproval and deletes it. Returns an error if one occurs.
func (c *actionApprovals) Delete(name string, options *v1.DeleteOptions) error {
	return c.client.Delete().
		Namespace(c.ns).
		Resource("actionapprovals").
		Name(name).
		Body(options).
		Do(context.TODO()).
		Error()
}

// DeleteCollection deletes a collection of objects.
func (c *actionApprovals) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	var timeout time.Duration
	if listOptions.TimeoutSeconds != nil {
		timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
	}
	return c.client.Delete().
		Namespace(c.ns).
		Resource("actionapprovals").
		VersionedParams(&listOptions, scheme.ParameterCodec).
		Timeout(timeout).
		Body(options).
		Do(context.TODO()).
		Error()
}

// Patch applies the patch and returns the patched actionApproval.
func (c *actionApprovals) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ActionApproval, err error) {
	result = &v1alpha1.ActionApproval{}
	err = c.client.Patch(pt).
		Namespace(c.ns).
		Resource("actionapprovals").
		SubResource(subresources...).
		Name(name).
		Body(data).
		Do(context.TODO()).
		Into(result)
	return
}


text:
package com.tngtech.archunit.lang;

import java.util.Collection;

import com.tngtech.archunit.PublicAPI;

import static com.tngtech.archunit.PublicAPI.State.EXPERIMENTAL;
import static com.tngtech.archunit.PublicAPI.Usage.INHERITANCE;

@PublicAPI(usage = INHERITANCE, state = EXPERIMENTAL)
public interface ViolationHandler<T> {
    void handle(Collection<T> violatingObjects, String message);
}


text:
package snetproxy

import (
	"sync"
)

type AtomicBool struct {
	m sync.Mutex
	v bool
}

func (f *AtomicBool) Set(v bool) {
	f.m.Lock()
	f.v = v
	f.m.Unlock()
}

func (f *AtomicBool) IsTrue() bool {
	f.m.Lock()
	result := f.v == true
	f.m.Unlock()
	return result
}

func (f *AtomicBool) IsFalse() bool {
	return !f.IsTrue()
}

// A State objects encodes an up or down state in a way that can be used
// directly in selects. Note that not all methods are safe for concurrent use
// (see their documentation for more information).
type State struct {
	ch chan struct{}
}

// NewState returns a new state. The state is initially set to up.
func NewState() *State {
	s := &State{ch: make(chan struct{})}
	s.SetUp()
	return s
}

// SetDown sets the state to down.
//
// It is not safe to call SetDown concurrently with other methods.
func (s *State) SetDown() {
	s.ch = make(chan struct{})
}

// SetUp sets the state to up.
//
// It is safe to call SetUp concurrently with Up.
func (s *State) SetUp() {
	close(s.ch)
}

// Up yields a channel that will be closed once SetUp() is called.
//
// It is safe to call SetUp concurrently with Up.
func (s *State) Up() <-chan struct{} {
	return s.ch
}


text:
package lexer

import (
	"fmt"
	"strings"
	"unicode"
	"unicode/utf8"
)

const (
	eof                        rune   = 0
	leftParenthesis            string = "("
	rightParenthesis                  = ")"
	singleQuotationMark               = "'"
	doubleQuotationMark               = "\""
	escapedSingleQuotationMark        = "\\'"
	escapedDoubleQuotationMark        = "\\\""
	comma                             = ","
	regexEqual                        = "~="
	stringEqual                       = "=="
	not                               = "!"
	and                               = "&&"
	or                                = "||"
	sha1                              = "sha1"
)

const (
	errorClosingSingleQuotationMarkIsMissing = "missing closing single quotation mark"
	errorClosingDoubleQuotationMarkIsMissing = "missing closing double quotation mark"
	errorClosingParenthesisMissing           = "missing closing parenthesis"
	errorUnexpectedToken                     = "unexpected token %c"
)

// TokenType represents a type of recognized token
type TokenType int

const (
	// TokenEOF is an End of File token
	TokenEOF TokenType = iota

	// TokenLeftParenthesis is a left parenthesis token
	TokenLeftParenthesis

	// TokenRightParenthesis is a right parenthesis token
	TokenRightParenthesis

	// TokenComma is a comma token
	TokenComma

	// TokenRegexEqual is a regex equal operator token
	TokenRegexEqual

	// TokenStringEqual is a string equal operator token
	TokenStringEqual

	// TokenNot is a negation logical operator token
	TokenNot

	// TokenAnd is an and logical operator token
	TokenAnd

	// TokenOr is an or logical operator token
	TokenOr

	// TokenSingleQuotedStringLiteral is a single quoted string literal token
	TokenSingleQuotedStringLiteral

	// TokenDoubleQuotedStringLiteral is a double quoted string literal token
	TokenDoubleQuotedStringLiteral

	// TokenSha1 is a sha1 function token
	TokenSha1
)

// Token is a structure that contains type of recognized token and it's value if applicable
type Token struct {
	Type  TokenType
	Value string
}

// LexFn is an interface that lexing functions have to implement
type LexFn func(*Lexer) LexFn

// Lexer is a structure that contains current state of the lexer
type Lexer struct {
	Input                string
	Tokens               []Token
	State                LexFn
	Errors               []error
	TokenStart           int
	Position             int
	OpenParenthesisCount int
}

// New returns a new lexer for the given input
func New(input string) *Lexer {
	return &Lexer{Input: input, State: LexBegin}
}

// Lex performs lexing
func (lexer *Lexer) Lex() []error {
	for {
		if lexer.State == nil {
			break
		}

		lexer.State = (lexer.State)(lexer)
	}

	if lexer.OpenParenthesisCount > 0 {
		lexer.Errorf(errorClosingParenthesisMissing)
	}

	return lexer.Errors
}

// IsEOF returns true if the lexer has reached the end of the input
func (lexer *Lexer) IsEOF() bool {
	return lexer.Position >= utf8.RuneCountInString(lexer.Input)
}

// HasTokenTypeAt returns true if the lexer recognized given token type at the given position
func (lexer *Lexer) HasTokenTypeAt(pos int, tokenType TokenType) bool {
	if pos < 0 || pos >= len(lexer.Tokens) {
		return false
	}

	return lexer.Tokens[pos].Type == tokenType
}

// Read returns current rune
func (lexer *Lexer) Read() rune {
	if lexer.IsEOF() {
		return eof
	}

	ch := rune(lexer.Input[lexer.Position])

	lexer.Position++

	return ch
}

// Emit appends given token to the lexer tokens slice
func (lexer *Lexer) Emit(tokenType TokenType) {
	lexer.Tokens = append(lexer.Tokens, Token{Type: tokenType, Value: lexer.Input[lexer.TokenStart:lexer.Position]})
}

// Errorf appends error with the given error message to the list of lexer errors
func (lexer *Lexer) Errorf(err string) LexFn {
	lexer.Errors = append(lexer.Errors, fmt.Errorf("%s at position: %d", err, lexer.Position))
	return nil
}

// RemainingInput returns a string of an unread remainder input string
func (lexer *Lexer) RemainingInput() string {
	return lexer.Input[lexer.Position:]
}

// EatWhitespaces skips all whitespaces
func (lexer *Lexer) EatWhitespaces() rune {
	var ch rune

	for {
		ch = lexer.Read()

		if ch == eof {
			break
		}

		if !unicode.IsSpace(ch) {
			lexer.Position--
			break
		}
	}

	return ch
}

// LexComma emits TokenComma
func LexComma(lexer *Lexer) LexFn {
	lexer.TokenStart = lexer.Position
	lexer.Position += len(comma)
	lexer.Emit(TokenComma)

	if lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return nil
	}

	return LexBegin
}

// LexLeftParenthesis emits TokenLeftParenthesis
func LexLeftParenthesis(lexer *Lexer) LexFn {
	lexer.TokenStart = lexer.Position
	lexer.Position += len(leftParenthesis)
	lexer.Emit(TokenLeftParenthesis)
	lexer.OpenParenthesisCount++

	if lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return lexer.Errorf(errorClosingParenthesisMissing)
	}

	return LexBegin
}

// LexRightParenthesis emits TokenRightParenthesis
func LexRightParenthesis(lexer *Lexer) LexFn {
	lexer.TokenStart = lexer.Position
	lexer.Position += len(rightParenthesis)
	lexer.Emit(TokenRightParenthesis)
	lexer.OpenParenthesisCount--

	if lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return nil
	}

	return LexBegin
}

// LexSingleQuotedString emits TokenSingleQuotedStringLiteral
func LexSingleQuotedString(lexer *Lexer) LexFn {
	lexer.Position += len(singleQuotationMark)
	lexer.TokenStart = lexer.Position
	for {
		if lexer.IsEOF() {
			lexer.TokenStart = lexer.Position
			lexer.Emit(TokenEOF)
			return lexer.Errorf(errorClosingSingleQuotationMarkIsMissing)
		}

		switch {
		case strings.HasPrefix(lexer.RemainingInput(), escapedSingleQuotationMark):
			lexer.Position += len(escapedSingleQuotationMark)
		case strings.HasPrefix(lexer.RemainingInput(), singleQuotationMark):
			lexer.Emit(TokenSingleQuotedStringLiteral)
			lexer.Position += len(singleQuotationMark)
			return LexBegin
		default:
			lexer.Position++
		}
	}
}

// LexDoubleQuotedString emits TokenDoubleQuotedStringLiteral
func LexDoubleQuotedString(lexer *Lexer) LexFn {
	lexer.Position += len(doubleQuotationMark)
	lexer.TokenStart = lexer.Position
	for {
		if lexer.IsEOF() {
			lexer.TokenStart = lexer.Position
			lexer.Emit(TokenEOF)
			return lexer.Errorf(errorClosingDoubleQuotationMarkIsMissing)
		}

		switch {
		case strings.HasPrefix(lexer.RemainingInput(), escapedDoubleQuotationMark):
			lexer.Position += len(escapedDoubleQuotationMark)
		case strings.HasPrefix(lexer.RemainingInput(), doubleQuotationMark):
			lexer.Emit(TokenDoubleQuotedStringLiteral)
			lexer.Position += len(doubleQuotationMark)
			return LexBegin
		default:
			lexer.Position++
		}
	}
}

// LexStringEqual emits TokenStringEqual
func LexStringEqual(lexer *Lexer) LexFn {
	lexer.TokenStart = lexer.Position
	lexer.Position += len(stringEqual)
	lexer.Emit(TokenStringEqual)

	if lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return nil
	}

	return LexBegin
}

// LexRegexEqual emits TokenRegexEqual
func LexRegexEqual(lexer *Lexer) LexFn {
	lexer.TokenStart = lexer.Position
	lexer.Position += len(regexEqual)
	lexer.Emit(TokenRegexEqual)

	if lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return nil
	}

	return LexBegin
}

// LexAnd emits TokenAnd
func LexAnd(lexer *Lexer) LexFn {
	lexer.TokenStart = lexer.Position
	lexer.Position += len(and)
	lexer.Emit(TokenAnd)

	if lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return nil
	}

	return LexBegin
}

// LexOr emits TokenOr
func LexOr(lexer *Lexer) LexFn {
	lexer.TokenStart = lexer.Position
	lexer.Position += len(or)
	lexer.Emit(TokenOr)

	if lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return nil
	}

	return LexBegin
}

// LexNot emits TokenNot
func LexNot(lexer *Lexer) LexFn {
	lexer.TokenStart = lexer.Position
	lexer.Position += len(not)
	lexer.Emit(TokenNot)

	if lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return nil
	}

	return LexBegin
}

// LexSha1 emits TokenSha1
func LexSha1(lexer *Lexer) LexFn {
	lexer.TokenStart = lexer.Position
	lexer.Position += len(sha1)
	lexer.Emit(TokenSha1)

	if lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return nil
	}

	return LexBegin
}

// LexBegin skips all whitespaces and returns a function that can lex the remaining input
func LexBegin(lexer *Lexer) LexFn {
	if lexer.EatWhitespaces(); lexer.IsEOF() {
		lexer.TokenStart = lexer.Position
		lexer.Emit(TokenEOF)
		return nil
	}

	remainingInput := lexer.RemainingInput()

	switch {
	case strings.HasPrefix(remainingInput, leftParenthesis):
		return LexLeftParenthesis
	case strings.HasPrefix(remainingInput, rightParenthesis):
		return LexRightParenthesis
	case strings.HasPrefix(remainingInput, comma):
		return LexComma
	case strings.HasPrefix(remainingInput, singleQuotationMark):
		return LexSingleQuotedString
	case strings.HasPrefix(remainingInput, doubleQuotationMark):
		return LexDoubleQuotedString
	case strings.HasPrefix(remainingInput, not):
		return LexNot
	case strings.HasPrefix(remainingInput, and):
		return LexAnd
	case strings.HasPrefix(remainingInput, or):
		return LexOr
	case strings.HasPrefix(remainingInput, stringEqual):
		return LexStringEqual
	case strings.HasPrefix(remainingInput, regexEqual):
		return LexRegexEqual
	case strings.HasPrefix(strings.ToLower(remainingInput), sha1):
		return LexSha1
	default:
		return lexer.Errorf(fmt.Sprintf(errorUnexpectedToken, remainingInput[0]))
	}
}


text:
package li.strolch.model.visitor;

import li.strolch.model.Order;
import li.strolch.model.ParameterBag;
import li.strolch.model.Resource;
import li.strolch.model.activity.Action;
import li.strolch.model.activity.Activity;
import li.strolch.model.timedstate.*;

/**
 * @author Robert von Burg <eitch@eitchnet.ch>
 */
public interface ParameterVisitor<U> extends StrolchElementVisitor<U> {

	@Override
	default U visitActivity(Activity activity) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + activity.getClass());
	}

	@Override
	default U visitOrder(Order order) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + order.getClass());
	}

	@Override
	default U visitResource(Resource resource) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + resource.getClass());
	}

	@Override
	default U visitAction(Action action) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + action.getClass());
	}

	@Override
	default U visitBooleanState(BooleanTimedState state) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + state.getClass());
	}

	@Override
	default U visitFloatState(FloatTimedState state) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + state.getClass());
	}

	@Override
	default U visitFloatListState(FloatListTimedState state) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + state.getClass());
	}

	@Override
	default U visitIntegerListState(IntegerListTimedState state) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + state.getClass());
	}

	@Override
	default U visitIntegerState(IntegerTimedState state) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + state.getClass());
	}

	@Override
	default U visitLongState(LongTimedState state) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + state.getClass());
	}

	@Override
	default U visitStringState(StringSetTimedState state) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + state.getClass());
	}

	@Override
	default U visitParameterBag(ParameterBag bag) {
		throw new UnsupportedOperationException(getClass().getName() + " can not handle " + bag.getClass());
	}
}


text:
package org.datadog.jenkins.plugins.datadog.traces;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;

import org.datadog.jenkins.plugins.datadog.DatadogUtilities;
import org.datadog.jenkins.plugins.datadog.model.BuildData;
import org.datadog.jenkins.plugins.datadog.model.PipelineNodeInfoAction;
import org.datadog.jenkins.plugins.datadog.model.StageBreakdownAction;
import org.datadog.jenkins.plugins.datadog.model.StageData;
import org.datadog.jenkins.plugins.datadog.util.SuppressFBWarnings;
import org.datadog.jenkins.plugins.datadog.util.json.JsonUtils;

import hudson.model.Run;

/**
 * Base class for DatadogTraceBuildLogic and DatadogPipelineBuildLogic
 */
public class DatadogBaseBuildLogic {

    protected static final String HOSTNAME_NONE = "none";
    private static final int MAX_TAG_LENGTH = 5000;
    private static final Logger logger = Logger.getLogger(DatadogBaseBuildLogic.class.getName());

    protected String getNodeName(Run<?, ?> run, BuildData buildData, BuildData updatedBuildData) {
        final PipelineNodeInfoAction pipelineNodeInfoAction = run.getAction(PipelineNodeInfoAction.class);
        if(pipelineNodeInfoAction != null){
            return pipelineNodeInfoAction.getNodeName();
        }

        return buildData.getNodeName("").isEmpty() ? updatedBuildData.getNodeName("") : buildData.getNodeName("");
    }

    protected String getNodeHostname(Run<?, ?> run, BuildData updatedBuildData) {
        final PipelineNodeInfoAction pipelineNodeInfoAction = run.getAction(PipelineNodeInfoAction.class);
        if(pipelineNodeInfoAction != null){
            return pipelineNodeInfoAction.getNodeHostname();
        } else if (!updatedBuildData.getHostname("").isEmpty()) {
            return updatedBuildData.getHostname("");
        }
        return null;
    }

    @SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
    protected Set<String> getNodeLabels(Run<?,?> run, final String nodeName) {
        try {
            if(run == null){
                return Collections.emptySet();
            }

            final PipelineNodeInfoAction pipelineNodeInfoAction = run.getAction(PipelineNodeInfoAction.class);
            if(pipelineNodeInfoAction != null) {
                return pipelineNodeInfoAction.getNodeLabels();
            }

            if(run.getExecutor() != null && run.getExecutor().getOwner() != null) {
                Set<String> nodeLabels = DatadogUtilities.getNodeLabels(run.getExecutor().getOwner());
                if(nodeLabels != null && !nodeLabels.isEmpty()) {
                    return nodeLabels;
                }
            }

            // If there is no labels and the node name is master,
            // we force the label "master".
            if("master".equalsIgnoreCase(nodeName)){
                final Set<String> masterLabels = new HashSet<>();
                masterLabels.add("master");
                return masterLabels;
            }

            return Collections.emptySet();
        } catch (Exception ex) {
            logger.fine("Unable to find node labels: " + ex.getMessage());
            return Collections.emptySet();
        }
    }

    protected long getMillisInQueue(BuildData buildData) {
        // Reported by the Jenkins Queue API.
        // It's not included in the root span duration.
        final long millisInQueue = buildData.getMillisInQueue(-1L);

        // Reported by a child span.
        // It's included in the root span duration.
        final long propagatedMillisInQueue = buildData.getPropagatedMillisInQueue(-1L);
        return Math.max(Math.max(millisInQueue, propagatedMillisInQueue), 0);
    }

    protected String getStageBreakdown(Run run) {
        final StageBreakdownAction stageBreakdownAction = run.getAction(StageBreakdownAction.class);
        if(stageBreakdownAction == null) {
            return null;
        }

        final Map<String, StageData> stageDataByName = stageBreakdownAction.getStageDataByName();
        final List<StageData> stages = new ArrayList<>(stageDataByName.values());
        Collections.sort(stages);

        final String stagesJson = JsonUtils.toJson(new ArrayList<>(stages));
        if (stagesJson.length() > MAX_TAG_LENGTH) {
            logger.warning("Skipping sending stage to Datadog; stage breakdown is too large");
            return null;
        }

        return stagesJson;
    }

}


text:
#import <iLifeSlideshow/MPEffect.h>

@interface MPEffect (Private)
- (id)effectPresetID;
- (id)videoPaths;
- (id)fullDebugLog;
- (void)dump;
- (void)reconfigureSlides;
- (void)createSecondarySlidesWithPaths:(id)arg1;
- (void)createSlidesWithPaths:(id)arg1;
- (void)createTextsWithStrings:(id)arg1 secondLineFactor:(double)arg2 fillIn:(_Bool)arg3;
- (void)createTextsWithStrings:(id)arg1 secondLineFactor:(double)arg2;
- (void)replaceTextsWitStrings:(id)arg1;
- (void)createTextsWithDefaultStrings;
- (id)plug;
- (id)container;
- (void)setLiveIndex:(long long)arg1;
- (long long)liveIndex;
- (long long)maxNumberOfSecondarySlides;
- (long long)maxNumberOfSlides;
@end


text:
cd $(dirname $0)

cd client

mvn clean package
ret=$?
if [ $ret -ne 0 ]; then
    exit $ret
fi
rm -rf target

./gradlew clean build
ret=$?
if [ $ret -ne 0 ]; then
    exit $ret
fi
rm -rf build

cd ../server

mvn clean package
ret=$?
if [ $ret -ne 0 ]; then
    exit $ret
fi
rm -rf target

./gradlew clean build
ret=$?
if [ $ret -ne 0 ]; then
    exit $ret
fi
rm -rf build


text:
using System.IO;

using MODEXngine.lib.CommonObjects;

using Newtonsoft.Json;

namespace MODEXngine.lib.Managers
{
    public static class SettingsManager
    {
        private static Settings GetDefaultSettings() => new Settings
        {
            Resolution = new Resolution {Width = 640, Height = 480, RefreshRate = 60, Bpp = 32},
            Renderer = "OpenGL",
            RenderingMode = "Display_List",
            PreviousGame = "Dark Forces",
            IsFullScreen = true,
            SoundEnabled = true
        };

        public static void SaveSettings(string fileName, Settings settings)
        {
            File.WriteAllText(fileName, JsonConvert.SerializeObject(settings));
        }

        public static Settings LoadSettings(string fileName)
        {
            if (File.Exists(fileName))
            {
                return JsonConvert.DeserializeObject<Settings>(File.ReadAllText(fileName));
            }

            var defaultSettings = GetDefaultSettings();

            File.WriteAllText(fileName, JsonConvert.SerializeObject(defaultSettings));

            return defaultSettings;
        }
    }
}


text:
SYNONYM

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

#### Published in
Gard. Bull. Singapore 31:129. 1978

#### Original name
null

### Remarks
null


text:
require File.dirname(__FILE__) + '/../../test_helper'

class Gateway < Test::Unit::TestCase
  def test_should_detect_if_a_card_is_supported
    Gateway.supported_cardtypes = [:visa, :bogus]
    assert [:visa, :bogus].all? { |supported_cardtype| Gateway.supports?(supported_cardtype) }

    Gateway.supported_cardtypes = []
    assert_false [:visa, :bogus].all? { |invalid_cardtype| Gateway.supports?(invalid_cardtype) }
  end

  def test_should_gateway_uses_ssl_strict_checking_by_default
    assert Gateway.ssl_strict
  end

  def test_should_be_able_to_look_for_test_mode
    Base.gateway_mode = :test
    assert Gateway.new.test?

    Base.gateway_mode = :production
    assert_false Gateway.new.test?
  end

  def test_amount_style
   assert_equal '10.34', Gateway.new.send(:amount, 1034)

   assert_raise(ArgumentError) do
     Gateway.new.send(:amount, '10.34')
   end
  end

  def test_invalid_type
    credit_card = stub(:type => "visa")
    assert_equal "visa", Gateway.card_brand(credit_card)
  end

  def test_invalid_type
    credit_card = stub(:type => "String", :brand => "visa")
    assert_equal "visa", Gateway.card_brand(credit_card)
  end
end


text:
package org.alien4cloud.tosca.topology;

import java.util.*;
import java.util.stream.Collectors;

import org.alien4cloud.tosca.editor.EditionContext;
import org.alien4cloud.tosca.model.CSARDependency;
import org.alien4cloud.tosca.model.definitions.CapabilityDefinition;
import org.alien4cloud.tosca.model.definitions.PropertyDefinition;
import org.alien4cloud.tosca.model.definitions.RequirementDefinition;
import org.alien4cloud.tosca.model.templates.AbstractTemplate;
import org.alien4cloud.tosca.model.templates.NodeTemplate;
import org.alien4cloud.tosca.model.templates.Topology;
import org.alien4cloud.tosca.model.types.*;
import org.springframework.stereotype.Service;

import com.google.common.collect.Maps;

import alien4cloud.topology.AbstractTopologyDTO;
import alien4cloud.topology.DependencyConflictDTO;
import alien4cloud.topology.TopologyDTO;
import alien4cloud.tosca.context.ToscaContext;
import alien4cloud.tosca.context.ToscaContextual;
import alien4cloud.tosca.normative.ToscaType;

/**
 * Service that helps to create a topology dto object out of a topology.
 */
@Service
public class TopologyDTOBuilder {
    /**
     * Build a topology dto (topology and all used types) out of a topology.
     *
     * @param context The edition context from which to build the dto.
     */
    @ToscaContextual
    public TopologyDTO buildTopologyDTO(EditionContext context) {
        TopologyDTO topologyDTO = new TopologyDTO();
        buildAbstractTopologyDTO(context.getTopology(), topologyDTO);
        topologyDTO.setArchiveContentTree(context.getArchiveContentTree());
        topologyDTO.setLastOperationIndex(context.getLastOperationIndex());
        topologyDTO.setOperations(context.getOperations());
        topologyDTO.setDelegateType(context.getCsar().getDelegateType());

        topologyDTO.setDependencyConflicts(getDependencyConflictDTOs(context));

        // FIXME add validation information
        return topologyDTO;
    }

    /**
     * Compute a list of transitive dependency conflicts from the Context.
     * @param context the EditionContext of the Topology being built.
     * @return a list of dependency conflicts.
     */
    private List<DependencyConflictDTO> getDependencyConflictDTOs(EditionContext context) {
        // Generate a map with all transitive dependency conflict for each dependency in the context.
        final Set<CSARDependency> dependencies = context.getToscaContext().getDependencies();
        Map<CSARDependency, Set<CSARDependency>> dependencyConflictMap = new HashMap<>();
        dependencies.forEach(source -> {
            final Set<CSARDependency> transitives =
                    Optional.ofNullable(ToscaContext.get().getArchive(source.getName(), source.getVersion()).getDependencies())
                            .orElse(Collections.emptySet())
                            .stream().filter((o) -> !dependencies.contains(o)).collect(Collectors.toSet());
            if (!transitives.isEmpty()) dependencyConflictMap.put(source, transitives);
        });

        final ArrayList<DependencyConflictDTO> dependencyConflicts = new ArrayList<>();
        dependencyConflictMap.forEach((source, conflicts) ->
            conflicts.forEach(conflict -> {
                String actualVersion = dependencies.stream().filter(d -> d.getName().equals(conflict.getName())).findFirst().map(CSARDependency::getVersion).orElse("");
                dependencyConflicts.add(new DependencyConflictDTO(source.getName(), conflict.getName() + ":" + conflict.getVersion(), actualVersion));
            })
        );
        return dependencyConflicts;
    }

    /**
     * Build a topology dto from a topology.
     *
     * @param topology The topology from which to build the DTO object.
     * @param <T> The type of topology (can be a topology or a deployment topology)
     * @return An instance of TopologyDTO (FIXME Should return an Abstract Topology DTO and renamed as not abstract)
     */
    @ToscaContextual
    public <T extends Topology> TopologyDTO buildTopologyDTO(T topology) {
        TopologyDTO topologyDTO = new TopologyDTO();
        if (topology != null) {
            buildAbstractTopologyDTO(topology, topologyDTO);
            // This contains the value ouf output properties. This has nothing to do with capability somehow..
            topologyDTO.setOutputCapabilityProperties(topology.getOutputCapabilityProperties());
        }
        return topologyDTO;
    }

    private <T extends Topology> void buildAbstractTopologyDTO(T topology, AbstractTopologyDTO<T> topologyDTO) {
        topologyDTO.setTopology(topology);
        topologyDTO.setNodeTypes(getNodeTypes(topology));
        topologyDTO.setRelationshipTypes(getRelationshipTypes(topology));
        topologyDTO.setCapabilityTypes(getCapabilityTypes(topologyDTO));
        topologyDTO.setDataTypes(getDataTypes(topologyDTO));
    }

    private <T extends Topology> Map<String, NodeType> getNodeTypes(T topology) {
        Map<String, NodeType> types = Maps.newHashMap();
        fillTypeMap(NodeType.class, types, topology.getNodeTemplates(), false, false);
        return types;
    }

    private <T extends Topology> Map<String, RelationshipType> getRelationshipTypes(T topology) {
        Map<String, RelationshipType> types = Maps.newHashMap();
        if (topology.getNodeTemplates() != null) {
            for (NodeTemplate nodeTemplate : topology.getNodeTemplates().values()) {
                fillTypeMap(RelationshipType.class, types, nodeTemplate.getRelationships(), false, false);
            }
        }
        return types;
    }

    private <T extends Topology> Map<String, CapabilityType> getCapabilityTypes(AbstractTopologyDTO<T> topologyDTO) {
        Map<String, CapabilityType> types = Maps.newHashMap();
        Map<String, NodeType> delayedNodeTypeAddMap = Maps.newHashMap();
        for (NodeType nodeType : topologyDTO.getNodeTypes().values()) {
            if (nodeType != null) {
                for (CapabilityDefinition capabilityDefinition : nodeType.getCapabilities()) {
                    types.put(capabilityDefinition.getType(), ToscaContext.get(CapabilityType.class, capabilityDefinition.getType()));
                }
                for (RequirementDefinition requirementDefinition : nodeType.getRequirements()) {
                    CapabilityType capabilityType = ToscaContext.get(CapabilityType.class, requirementDefinition.getType());
                    if (capabilityType != null) {
                        types.put(requirementDefinition.getType(), capabilityType);
                    } else {
                        // requirements are authorized to be a node type rather than a capability type TODO is it still possible in TOSCA ?
                        NodeType indexedNodeType = ToscaContext.get(NodeType.class, requirementDefinition.getType());
                        // add it to the actual node types map
                        delayedNodeTypeAddMap.put(requirementDefinition.getType(), indexedNodeType);
                    }
                }
            }
        }
        for (Map.Entry<String, NodeType> delayedNodeType : delayedNodeTypeAddMap.entrySet()) {
            topologyDTO.getNodeTypes().put(delayedNodeType.getKey(), delayedNodeType.getValue());
        }
        return types;
    }

    private <T extends AbstractInheritableToscaType, V extends AbstractTemplate> void fillTypeMap(Class<T> elementClass, Map<String, T> types,
            Map<String, V> templateMap, boolean useTemplateNameAsKey, boolean abstractOnly) {
        if (templateMap == null) {
            return;
        }
        for (Map.Entry<String, V> template : templateMap.entrySet()) {
            if (!types.containsKey(template.getValue().getType())) {
                T type = ToscaContext.get(elementClass, template.getValue().getType());
                if (!abstractOnly || type.isAbstract()) {
                    String key = useTemplateNameAsKey ? template.getKey() : template.getValue().getType();
                    types.put(key, type);
                }
            }
        }
    }

    private Map<String, DataType> getDataTypes(AbstractTopologyDTO topologyDTO) {
        Map<String, DataType> indexedDataTypes = Maps.newHashMap();
        indexedDataTypes = fillDataTypes(indexedDataTypes, topologyDTO.getNodeTypes());
        indexedDataTypes = fillDataTypes(indexedDataTypes, topologyDTO.getRelationshipTypes());
        indexedDataTypes = fillDataTypes(indexedDataTypes, topologyDTO.getCapabilityTypes());
        return indexedDataTypes;
    }

    private <T extends AbstractInheritableToscaType> Map<String, DataType> fillDataTypes(Map<String, DataType> indexedDataTypes, Map<String, T> elements) {
        for (AbstractInheritableToscaType indexedNodeType : elements.values()) {
            if (indexedNodeType != null && indexedNodeType.getProperties() != null) {
                for (PropertyDefinition pd : indexedNodeType.getProperties().values()) {
                    String type = pd.getType();
                    if (ToscaType.isPrimitive(type) || indexedDataTypes.containsKey(type)) {
                        continue;
                    }
                    DataType dataType = ToscaContext.get(DataType.class, type);
                    if (dataType == null) {
                        dataType = ToscaContext.get(PrimitiveDataType.class, type);
                    }
                    indexedDataTypes.put(type, dataType);
                }
            }
        }
        return indexedDataTypes;
    }
}