text:
package jp.riken.kscope.profiler.utils;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import jp.riken.kscope.Message;

/**
 * バイト列を各種のデータ型に変換するためのメソッドを提供するユーティリティクラス
 *
 * @author RIKEN
 *
 */
public class ProfilerReaderUtil {

    /**
     * リトルエンディアンを表す定数
     */
    public static final int LITTLE_ENDIAN = 0x00;

    /**
     * ビッグエンディアンを表す定数
     */
    public static final int BIG_ENDIAN = 0x01;

    /**
     * プロファイラファイルのshort型のデータサイズ(バイト)
     */
    public static final int SIZEOF_SHORT = 0x02;

    /**
     * プロファイラファイルのint型のデータサイズ(バイト)
     */
    public static final int SIZEOF_INT = 0x04;

    /**
     * プロファイラファイルのfloat型のデータサイズ(バイト)
     */
    public static final int SIZEOF_FLOAT = 0x04;

    /**
     * プロファイラファイルのdouble型のデータサイズ(バイト)
     */
    public static final int SIZEOF_DOUBLE = 0x08;

    /**
     * プロファイラファイルのlong型のデータサイズ(バイト)
     */
    public static final int SIZEOF_LONG = 0x08;

    private static void setEndian(ByteBuffer byteBuf, int endian) {
        switch (endian) {
        case (LITTLE_ENDIAN):
            byteBuf.order(ByteOrder.LITTLE_ENDIAN);
            break;
        case (BIG_ENDIAN):
            byteBuf.order(ByteOrder.BIG_ENDIAN);
            break;
        }
    }

    /**
     * 指定したエンディアンでバイト配列をshort型に変換する
     *
     * @param byteArray
     *            変換するバイト配列
     * @param endian
     *            エンディアン指定 ProfilerReaderUtil.LITTLE_ENDIAN または
     *            ProfilerReaderUtil.BIG_ENDIANを指定する
     * @return 変換後のshort型変数の値
     */
    public static short convertShort(byte[] byteArray, int endian) {
        if (byteArray.length < SIZEOF_SHORT) {
        	System.err.println(Message.getString("profilerreaderutil.errout.bytearrayshort")); //エラー: バイト配列の長さが変換先のデータ型より小さいため、変換できません。
            return 0;
        }
        ByteBuffer byteBuf = ByteBuffer.allocate(SIZEOF_SHORT * byteArray.length);
        byteBuf.put(byteArray);
        setEndian(byteBuf, endian);
        byteBuf.put(byteArray);
        byteBuf.flip();
        return byteBuf.getShort();
    }

    /**
     * 指定したエンディアンでバイト配列をint型に変換する
     *
     * @param byteArray
     *            変換するバイト配列
     * @param endian
     *            エンディアン指定 ProfilerReaderUtil.LITTLE_ENDIAN または
     *            ProfilerReaderUtil.BIG_ENDIANを指定する
     * @return 変換後のint型変数の値
     */
    public static int convertInt(byte[] byteArray, int endian) {
        if (byteArray.length < SIZEOF_INT) {
        	System.err.println(Message.getString("profilerreaderutil.errout.bytearrayshort")); //エラー: バイト配列の長さが変換先のデータ型より小さいため、変換できません。
            return 0;
        }
        ByteBuffer byteBuf = ByteBuffer.allocate(SIZEOF_INT * byteArray.length);
        byteBuf.put(byteArray);
        setEndian(byteBuf, endian);
        byteBuf.put(byteArray);
        byteBuf.flip();
        return byteBuf.getInt();
    }

    /**
     * 指定したエンディアンでバイト配列をlong型に変換する
     *
     * @param byteArray
     *            変換するバイト配列
     * @param endian
     *            エンディアン指定 ProfilerReaderUtil.LITTLE_ENDIAN または
     *            ProfilerReaderUtil.BIG_ENDIANを指定する
     * @return 変換後のlong型変数の値
     */
    public static long convertLong(byte[] byteArray, int endian) {
        if (byteArray.length < SIZEOF_LONG) {
        	System.err.println(Message.getString("profilerreaderutil.errout.bytearrayshort")); //エラー: バイト配列の長さが変換先のデータ型より小さいため、変換できません。
            return 0;
        }
        ByteBuffer byteBuf = ByteBuffer.allocate(SIZEOF_LONG * byteArray.length);
        byteBuf.put(byteArray);
        setEndian(byteBuf, endian);
        byteBuf.put(byteArray);
        byteBuf.flip();
        return byteBuf.getLong();
    }

    /**
     * 指定したエンディアンでバイト配列をfloat型に変換する
     *
     * @param byteArray
     *            変換するバイト配列
     * @param endian
     *            エンディアン指定 ProfilerReaderUtil.LITTLE_ENDIAN または
     *            ProfilerReaderUtil.BIG_ENDIANを指定する
     * @return 変換後のfloat型変数の値
     */
    public static float convertFloat(byte[] byteArray, int endian) {
        if (byteArray.length < SIZEOF_FLOAT) {
        	System.err.println(Message.getString("profilerreaderutil.errout.bytearrayshort")); //エラー: バイト配列の長さが変換先のデータ型より小さいため、変換できません。
            return 0;
        }
        ByteBuffer byteBuf = ByteBuffer.allocate(SIZEOF_FLOAT * byteArray.length);
        byteBuf.put(byteArray);
        setEndian(byteBuf, endian);
        byteBuf.put(byteArray);
        byteBuf.flip();
        return byteBuf.getFloat();
    }

    /**
     * 指定したエンディアンでバイト配列をdouble型に変換する
     *
     * @param byteArray
     *            変換するバイト配列
     * @param endian
     *            エンディアン指定 ProfilerReaderUtil.LITTLE_ENDIAN または
     *            ProfilerReaderUtil.BIG_ENDIANを指定する
     * @return 変換後のdouble型変数の値
     */
    public static double convertDouble(byte[] byteArray, int endian) {
        if (byteArray.length < SIZEOF_DOUBLE) {
        	System.err.println(Message.getString("profilerreaderutil.errout.bytearrayshort")); //エラー: バイト配列の長さが変換先のデータ型より小さいため、変換できません。
            return 0;
        }
        ByteBuffer byteBuf = ByteBuffer.allocate(SIZEOF_DOUBLE * byteArray.length);
        byteBuf.put(byteArray);
        setEndian(byteBuf, endian);
        byteBuf.put(byteArray);
        byteBuf.flip();
        return byteBuf.getDouble();
    }

    /**
     * 指定したエンディアンでバイト配列をString型に変換する
     *
     * @param byteArray
     *            変換するバイト配列
     * @param length
     *            変換するバイト配列の長さ
     * @param endian
     *            エンディアン指定 ProfilerReaderUtil.LITTLE_ENDIAN または
     *            ProfilerReaderUtil.BIG_ENDIANを指定する
     * @return 変換後の文字列
     */
    public static String convertString(byte[] byteArray, int length, int endian) {
        if (byteArray.length < length) {
        	System.err.println(Message.getString("profilerreaderutil.errout.bytearrayshort")); //エラー: バイト配列の長さが変換先のデータ型より小さいため、変換できません
            return "";
        }
        return new String(byteArray);
    }
}


text:
<?php

namespace Symfony\Component\Form\Extension\Core\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\Extension\Core\EventListener\FixUrlProtocolListener;

class UrlType extends AbstractType
{
    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder->addEventSubscriber(new FixUrlProtocolListener($options['default_protocol']));
    }

    /**
     * {@inheritdoc}
     */
    public function getDefaultOptions(array $options)
    {
        return array(
            'default_protocol' => 'http',
        );
    }

    /**
     * {@inheritdoc}
     */
    public function getParent(array $options)
    {
        return 'text';
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'url';
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<?php
    require("../transversales/encabezado.php");
    ?>
</head>
<body>
	<?php
    require ('../funcionesUnivirtual.php');
    ?>
    <form action="guarda.php" method="post">
	<label for="entidadCertificaSolicitada">Entidad que Certifica</label>

                                    <?php
                                            $total1 =new crudEntidadCertifica();
                                            $total1->conectarDB();
                                            $total1->selectEntidad();
                                    ?>
       <input type="submit" value="Enviar">
    </form>

</body>

	<?php
	    require("../transversales/select2.php");
    	require("../transversales/foot.php");

	?>
</html>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report Classes</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>

All Packages

Classes

AbstractAdapterFaxClientSpi (42%)

AbstractCloseable (83%)

AbstractCommPortAdapter (100%)

AbstractCommPortConnectionFactory (84%)

AbstractConnectionFactory (91%)

AbstractContextFaxBridge (100%)

AbstractFax4JBridge (100%)

AbstractFax4JClientSpi (70%)

AbstractFax4JConnectionFactory (66%)

AbstractFax4JFaxModemAdapter (100%)

AbstractFaxBridge (97%)

AbstractFaxClientSpi (78%)

AbstractFaxClientSpiInterceptor (75%)

AbstractFaxClientSpiProxy (65%)

AbstractFaxEvent (100%)

AbstractFaxJob (100%)

AbstractFaxJob2HTTPRequestConverter (100%)

AbstractFaxJobMonitor (87%)

AbstractFaxModemAdapter (82%)

AbstractHTTPClient (92%)

AbstractHTTPResponseHandler (100%)

AbstractHylaFAXClientConnectionFactory (86%)

AbstractLogger (95%)

AbstractMailConnectionFactory (100%)

AbstractMailFaxClientSpi (83%)

AbstractMappingHTTPResponseHandler (98%)

AbstractMultiPart2JSONHTTPFaxClientSpi (100%)

AbstractProcessExecutor (94%)

AbstractRequestParser (100%)

AbstractService (100%)

AbstractVendorPolicy (100%)

AdapterFaxClientSpi (96%)

ApacheCommonsLogger (0%)

ApacheHTTPClient (90%)

CloseableResourceManager (92%)

CommFaxClientSpi (89%)

CommPortAdapter (N/A)

CommPortConnectionFactory (N/A)

CommandLineArgumentsParser (N/A)

CommonHTTPClientConfiguration (100%)

ConfigurationHolder (N/A)

ConfigurationHolderImpl (100%)

Connection (N/A)

ConnectionFactory (N/A)

ConnectionImpl (100%)

ContextFaxBridge (N/A)

DefaultCommandLineArgumentsParser (100%)

DefaultMailMessageParser (89%)

DefaultProcessExecutor (95%)

EFaxMailFaxClientSpi (100%)

EMail2FaxBridge (100%)

EmptyHTTPResponseHandler (100%)

EmptyVendorPolicy (100%)

ExitCodeProcessOutputValidator (100%)

ExtremeFaxMailFaxClientSpi (100%)

Fax4JProvider (100%)

FaxActionType (100%)

FaxAgeMailFaxClientSpi (100%)

FaxBridge (N/A)

FaxBridgeFlowHelper (95%)

FaxBridgeImpl (90%)

FaxClient (71%)

FaxClientActionEvent (100%)

FaxClientActionEventListener (N/A)

FaxClientActions (N/A)

FaxClientFactory (75%)

FaxClientSpi (N/A)

FaxClientSpiFactory (89%)

FaxClientSpiInterceptor (N/A)

FaxClientSpiProxy (100%)

FaxClientSpiProxyImpl (100%)

FaxException (100%)

FaxJob (100%)

FaxJob2HTTPRequestConverter (N/A)

FaxJobImpl (100%)

FaxJobMonitor (N/A)

FaxJobMonitorImpl (96%)

FaxJobStatus (100%)

FaxModemAdapter (N/A)

FaxMonitorEvent (100%)

FaxMonitorEventListener (N/A)

FileInfo (100%)

HTTP2FaxBridge (100%)

HTTPClient (100%)

HTTPClientConfiguration (N/A)

HTTPFaxClientSpi (96%)

HTTPRequest (91%)

HTTPRequestParser (N/A)

HTTPResponse (100%)

HTTPResponseHandler (N/A)

HoiioFaxClientSpi (95%)

HylaFAXClientConnectionFactory (N/A)

HylaFAXClientConnectionFactoryImpl (66%)

HylaFaxClientSpi (76%)

HylaFaxJob (50%)

IOHelper (88%)

Initializable (N/A)

InterfaxMailFaxClientSpi (100%)

JDKLogger (0%)

JSONHTTPResponseHandler (91%)

LibraryConfigurationLoader (75%)

LinuxFaxClientSpi (100%)

LogFaxClientSpiInterceptor (89%)

LogLevel (91%)

Logger (N/A)

LoggerManager (83%)

MacFaxClientSpi (100%)

MailAuthenticator (75%)

MailConnectionFactory (N/A)

MailConnectionFactoryImpl (84%)

MailFaxClientSpi (87%)

MailMessageParser (N/A)

MailResourcesHolder (100%)

MetroFaxMailFaxClientSpi (100%)

MultiPartFaxJob2HTTPRequestConverter (99%)

MultiPartHTTPRequestParser (97%)

NextivafaxMailFaxClientSpi (100%)

PhaxioFaxClientSpi (96%)

Process2FaxBridge (100%)

ProcessExecutor (N/A)

ProcessExecutorHelper (77%)

ProcessFaxClientSpi (87%)

ProcessOutputHandler (N/A)

ProcessOutputValidator (N/A)

ProductInfo (73%)

Provider (N/A)

ProviderImpl (100%)

ProviderImplementation (N/A)

RFaxFaxClientSpi (87%)

RXTXCommPortAdapter (60%)

RXTXCommPortConnectionFactory (71%)

ReflectionHelper (95%)

RequestParser (N/A)

Send2FaxMailFaxClientSpi (100%)

Service (N/A)

ServiceFactory (90%)

SimpleHTTPRequestParser (100%)

SimpleLogger (40%)

SpiUtil (89%)

TemplateFaxJob2HTTPRequestConverter (95%)

VBSFaxClientSpi (60%)

VBSProcessOutputHandler (100%)

VBSProcessOutputValidator (96%)

VendorPolicy (N/A)

WindowsFaxClientSpi (63%)

WindowsFaxClientSpiHelper (89%)

WindowsJNIFaxClientSpi (0%)

WindowsProcessFaxClientSpi (64%)

WindowsProcessOutputHandler (100%)

WindowsProcessOutputValidator (100%)

XMLHTTPResponseHandler (93%)


text:
package com.fireflysource.net.http.common.v2.encoder;

import com.fireflysource.common.io.BufferUtils;
import com.fireflysource.net.http.common.v2.frame.DataFrame;
import com.fireflysource.net.http.common.v2.frame.Flags;
import com.fireflysource.net.http.common.v2.frame.Frame;
import com.fireflysource.net.http.common.v2.frame.FrameType;

import java.nio.ByteBuffer;
import java.util.LinkedList;

public class DataGenerator {
    private final HeaderGenerator headerGenerator;

    public DataGenerator(HeaderGenerator headerGenerator) {
        this.headerGenerator = headerGenerator;
    }

    public FrameBytes generate(DataFrame frame, int maxLength) {
        return generateData(frame.getStreamId(), frame.getData(), frame.isEndStream(), maxLength);
    }

    public FrameBytes generateData(int streamId, ByteBuffer data, boolean last, int maxLength) {
        if (streamId < 0)
            throw new IllegalArgumentException("Invalid stream id: " + streamId);

        FrameBytes frameBytes = new FrameBytes();
        frameBytes.setByteBuffers(new LinkedList<>());

        int dataLength = data.remaining();
        int maxFrameSize = headerGenerator.getMaxFrameSize();
        int length = Math.min(dataLength, Math.min(maxFrameSize, maxLength));
        if (length == dataLength) {
            generateFrame(streamId, data, last, frameBytes);
        } else {
            int limit = data.limit();
            int newLimit = data.position() + length;
            data.limit(newLimit);
            ByteBuffer slice = data.slice();
            data.position(newLimit);
            data.limit(limit);
            generateFrame(streamId, slice, false, frameBytes);
        }
        frameBytes.setLength(Frame.HEADER_LENGTH + length);
        return frameBytes;
    }

    private void generateFrame(int streamId, ByteBuffer data, boolean last, FrameBytes frameBytes) {
        int length = data.remaining();

        int flags = Flags.NONE;
        if (last)
            flags |= Flags.END_STREAM;

        ByteBuffer header = headerGenerator.generate(FrameType.DATA, Frame.HEADER_LENGTH + length, length, flags, streamId);
        BufferUtils.flipToFlush(header, 0);
        frameBytes.getByteBuffers().add(header);
        // Skip empty data buffers.
        if (data.remaining() > 0)
            frameBytes.getByteBuffers().add(data);
    }
}


text:
require 'spec_helper'

describe "TimeToAngleFromZenithCommand" do
	it "should calculate the time the sun will reach a 90deg angle from the zenith" do
		@result = {julian_century:0.149125142596397, latitude:SolCal::Angle.from_deg(53.5333),declination:SolCal::Angle.from_deg(-21.7958) ,solar_noon:0.515931}
		@result[:angle_from_zenith] = 90
		SolCal::Commands::TimeToAngleFromZenithCommand.new(@result).execute
		expect(@result[:time_to_angle_from_zenith].to_s).to eql("08:33")
	end

	it "should calculate the time the sun will reach a 72deg angle from the zenith on 2015-08-05" do
		@result = {julian_century:0.15592060, latitude:SolCal::Angle.from_deg(53.5333),longitude:SolCal::Angle.from_deg(-113.5), time_zone: -7}
		@result[:angle_from_zenith] = 72
		SolCal::Commands::TimeToAngleFromZenithCommand.new(@result).execute
		expect(@result[:time_to_angle_from_zenith].to_s).to eql("07:10")
	end

	it "should calculate the time the sun will reach max angle on 2015-12-21" do
		@result = {julian_century:0.15969883641341548, latitude:SolCal::Angle.from_deg(53.5333),longitude:SolCal::Angle.from_deg(-113.5), time_zone: -7}
		@result[:angle_from_zenith] = 76.97
		SolCal::Commands::TimeToAngleFromZenithCommand.new(@result).execute
		expect(@result[:time_to_angle_from_zenith].to_s).to eql("12:28")
	end

	it "should return error when requesting time sun will reach above max angle on 2015-12-21" do
		@result = {julian_century:0.15969883641341548, latitude:SolCal::Angle.from_deg(53.5333),longitude:SolCal::Angle.from_deg(-113.5), time_zone: -7}
		@result[:angle_from_zenith] = 76.96
		SolCal::Commands::TimeToAngleFromZenithCommand.new(@result).execute
		expect(@result[:time_to_angle_from_zenith].to_s).to eql("The sun will not reach 76.96 degrees from zenith today.")
	end
end


text:
class RenameDimensionsTableToDetailedItems < ActiveRecord::Migration
  def change
    rename_table :dimensions, :detailed_items
  end
end


text:
'''
All the consts and hardcode are here
'''

RESPONSES = {
    'empty_add_command': 'There should be at least one Username to add. For example "/add @username" or "/add username".',
    'empty_remove_command': 'There is nobody to remove, your following list is empty',
    'remove_keyboard_message': 'Choose someone to remove',
    'empty_send_command': 'There should be a message after "/send". For example "/send  I have a proof that there are reptilians in the government".',
    'empty_contact': 'The user is not in the Telegram yet.',
    'before_sticker_send': 'Someone has just gave me the sticker',
    'photo_caption': 'Somebody has just shown me that',
    'message_boilerplate': 'Somebody told me, that "{}"',
    'important_message': 'Important message for all the users - "{}"',
    'new_follower': "Hey bro, I've heard that one more someone started following you"
}

COMMANDS = {
    'start',
    'remove',
    'send',
    'update',
    'send_all'
}


text:
class Api::AccountsController < ApplicationController

  before_action :validate_token

  load_and_authorize_resource

  def index
    respond_to do |format|
      format.json { render json: @accounts }
    end
  end

  def create
    if @account.save
      respond_to do |format|
        format.json { render json: @account }
      end
    else
     respond_to do |format|
        format.json { render json: @account.errors, status: :unprocessable_entity}
      end
    end
  end

  def update
    if @account.update_attributes(update_params)
      respond_to do |format|
        format.json { render json: @account }
      end
    else
     respond_to do |format|
        format.json { render json: @account.errors, status: :unprocessable_entity}
      end
    end
  end

  private

    def create_params
      params.require(:account).permit(:name, :domain, :canvas_uri, :code)
    end

    def update_params
      params.require(:account).permit(:name, :domain, :canvas_uri, :code)
    end

end


text:
using namespace ombt;

class MyHandler: public MultiProcMSDatagramServer::Handler {
public:
    MyHandler() { setOk(true); }
    virtual ~MyHandler() { }

    virtual int operator()(EndPoint *serverep)
    {
        count = BUFSIZ;

        UseCntPtr<EndPoint> pserverep(serverep);
        UseCntPtr<Address> peer(pserverep->getInternalAddress().create());

        count = pserverep->read(buf, count, *peer);
        if (count > 0)
        {
            if (pserverep->write(buf, count, *peer) > 0)
                return(1);
            else
                return(-1);
        }
        else if (count < 0)
            return(-1); // error
        else
            return(1); // EOF -- all done
    }

    size_t count;
    char buf[BUFSIZ+1];
};

int
main(int argc, char *argv[])
{
    std::string filepath1("/tmp/xxxyyy");
    std::string filepath2("/tmp/yyyzzz");

    std::cout << "Creating Datagram Socket 1 ..." << std::endl;
    UseCntPtr<DatagramSocket> datagram_socket1(new DatagramSocket());
    assert(datagram_socket1->isOk());

    std::cout << "Creating Local Address 1 ... " << filepath1 << std::endl;
    ::unlink(filepath1.c_str());
    UseCntPtr<LocalAddress> my_address1(new LocalAddress(filepath1));
    assert(my_address1->isOk());

    std::cout << "Creating Datagram EndPoint 1 ..." << std::endl;
    UseCntPtr<EndPoint> server_ep1(new EndPoint(datagram_socket1, my_address1));
    assert(server_ep1->isOk());

    std::cout << "Creating Datagram Socket 2 ..." << std::endl;
    UseCntPtr<DatagramSocket> datagram_socket2(new DatagramSocket());
    assert(datagram_socket2->isOk());

    std::cout << "Creating Local Address 2 ... " << filepath2 << std::endl;
    ::unlink(filepath2.c_str());
    UseCntPtr<LocalAddress> my_address2(new LocalAddress(filepath2));
    assert(my_address2->isOk());

    std::cout << "Creating Datagram EndPoint 2 ..." << std::endl;
    UseCntPtr<EndPoint> server_ep2(new EndPoint(datagram_socket2, my_address2));
    assert(server_ep2->isOk());

    UseCntPtr<MyHandler> handler1(new MyHandler);
    UseCntPtr<MyHandler> handler2(new MyHandler);

    MultiProcMSDatagramServer idg;
    assert(idg.isOk());

    idg.registerHandler(server_ep1, handler1);
    idg.registerHandler(server_ep2, handler2);

    assert(idg.init() == 0);

    assert(idg.run() == 0);;

    assert(idg.finish() == 0);

    return(0);
}


text:
import re

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

with open('licenser/__init__.py', 'r') as f:
        version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
                            f.read(), re.MULTILINE).group(1)
if not version:
    raise RuntimeError('Cannot find version information')

config = {
    'name': 'licenser',
    'version': version,
    'description': 'Tool for adding open source licenses to your projects',
    'author': 'Ty-Lucas Kelley',
    'author_email': 'tylucaskelley@gmail.com',
    'license': 'MIT',
    'url': 'http://github.com/tylucaskelley/licenser',
    'long_description': open('README.md').read(),
    'classifiers': [
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'License :: OSI Approved :: MIT License',
        'Operating System :: MacOS :: MacOS X',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Topic :: Utilities'
    ],
    'entry_points': {
        'console_scripts': [
            'licenser = licenser.licenser:main'
        ]
    },
    'keywords': [
        'cli',
        'license',
        'tools',
        'script'
    ],
    'packages': [
        'licenser'
    ],
    'package_dir': {
        'licenser': 'licenser'
    },
    'package_data': {
        'licenser': [
            'assets/*'
        ]
    },
    'tests_require': [
        'nose==1.3.7'
    ]
}

setup(**config)


text:
package org.apache.causeway.applib.events.ui;

import java.util.EventObject;

import org.apache.causeway.applib.services.i18n.TranslatableString;

import lombok.Getter;

/**
 * Emitted for subscribers to obtain a title hint (equivalent to the
 * <tt>title()</tt> supporting method).
 *
 *

 * The class has a number of responsibilities:
 *

 *
 *

 *

 *          capture the target object being interacted with
 *

 *

 *          capture the title, if any, as specified to one of the subscribers
 *

 *

 *
 *

 *  The class itself is instantiated automatically by the framework.
 *

 *
 * @since 1.x {@index}
 */
public abstract class TitleUiEvent<S> extends AbstractUiEvent<S> {

    /**
     * This class is the default for the
     * {@link org.apache.causeway.applib.annotation.DomainObjectLayout#titleUiEvent()}
     * annotation element.
     *
     *

     * Whether this raises an event or not depends upon the
     * <tt>causeway.applib.annotation.domain-object-layout.title-ui-event.post-for-default</tt>
     * configuration property.
     *

     */
    public static class Default extends TitleUiEvent<Object> {}

    /**
     * Convenience class to use indicating that an event should not be
     * posted (irrespective of the configuration property seting for the
     * {@link Default} event.
     */
    public static class Noop extends TitleUiEvent<Object> {}

    /**
     * Convenience class meaning that an event should be posted
     * (irrespective of the configuration property setting for the
     * {@link Default} event.
     */
    public static class Doop extends TitleUiEvent<Object> {}

    /**
     * If used then the framework will set state via (non-API) setters.
     *
     *

     *     Because the {@link EventObject} superclass prohibits a null source, a dummy value is temporarily used.
     *

     */
    public TitleUiEvent() {
        this(null);
    }

    public TitleUiEvent(final S source) {
        super(source);
    }

    /**
     * The title as provided by a subscriber using {@link #setTitle(String)}.
     *
     *

     *     Note that a {@link #getTranslatableTitle()} will be used in preference, if available.
     *

     */
    @Getter
    private String title;

    /**
     * For subscribers to call to provide a (non-translated) title for this object.
     */
    public void setTitle(final String title) {
        this.title = title;
    }

    /**
     * The translatable (i18n) title as provided by a subscriber using {@link #setTranslatableTitle(TranslatableString)}.
     *
     *

     *     If a translatable title has been provided then this will be used in preference to any
     *     {@link #getTitle() non-translatable title}.
     *

     */
    @Getter
    private TranslatableString translatableTitle;

    /**
     * For subscribers to call to provide a translatable (i18n) title for this object.
     */
    public void setTranslatableTitle(final TranslatableString translatableTitle) {
        this.translatableTitle = translatableTitle;
    }

}


text:
<!DOCTYPE html>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
        <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.ttf" rel="stylesheet">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">


text:
<?php

namespace Web\WebBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * SolMantenimientoIdentificacion
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Web\WebBundle\Entity\SolMantenimientoIdentificacionRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class SolMantenimientoIdentificacion
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="fechaSolicitud", type="datetime")
     */
    private $fechaSolicitud;

    /**
     * @var string
     *
     * @ORM\ManyToOne(targetEntity="ICA\TramiteBundle\Entity\Seccionales")
     *
     */
    private $seccional;

    /**
     * @var string
     *
     * @ORM\Column(name="justificacionReidentificacion", type="string", length=45)
     * @Assert\NotBlank(message="Escribe una Justificación")
     */
    private $justificacionReidentificacion;

    /**
     * @var string
     *
     * @ORM\Column(name="solicitudMantenimientoIdentificacion", type="string", length=45)
     */
    private $solicitudMantenimientoIdentificacion;

    /**
     * @var string
     *
     * @ORM\Column(name="ica_3_101", type="string", length=45)
     * @Assert\NotBlank(message="Falta ICA3101")
     */
    private $ica3101;

    /**
     * @var string
     *
     * @ORM\Column(name="nombreFinca", type="string", length=45)
     * @Assert\NotBlank(message="Nombre Finca")
     */
    private $nombreFinca;

    /**
     * @var string
     *
     * @ORM\Column(name="nombrePropietarioFinca", type="string", length=45)
     * @Assert\NotBlank(message="Nombre del Propietario")
     */
    private $nombrePropietarioFinca;

    /**
     * @var string
     *
     * @ORM\Column(name="cedulaPropietarioFinca", type="string", length=45)
     * @Assert\NotBlank(message="Cédula Propietario")
     */
    private $cedulaPropietarioFinca;

    /**
     * @var string
     *
     * @ORM\Column(name="telefonoFijoPropietario", type="string", length=45)
     * @Assert\NotBlank(message="Teléfono Fijo del Propietario")
     */
    private $telefonoFijoPropietario;

    /**
     * @var string
     *
     * @ORM\Column(name="telefonoCelularPropietario", type="string", length=45)
     * @Assert\NotBlank(message="Celular del propietario")
     */
    private $telefonoCelularPropietario;

    /**
     * @var string
     *
     * @ORM\Column(name="nombreSolicitante", type="string", length=45)
     * @Assert\NotBlank(message="Nombre del solicitante")
     */
    private $nombreSolicitante;

    /**
     * @var string
     *
     * @ORM\Column(name="cedulaSolicitante", type="string", length=45)
     * @Assert\NotBlank(message="Cédula del solicitante")
     */
    private $cedulaSolicitante;

    /**
     * @var string
     *
     * @ORM\Column(name="telefonoFijoSolicitante", type="string", length=45)
     * @Assert\NotBlank(message="Teléfono fijo solicitante")
     */
    private $telefonoFijoSolicitante;

    /**
     * @var string
     *
     * @ORM\Column(name="telefonoCelularSolicitante", type="string", length=45)
     * @Assert\NotBlank(message="Teléfono Celular del solicitante")
     */
    private $telefonoCelularSolicitante;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="fechaProgramadaIdentificacion", type="datetime", nullable=true)
     */
    private $fechaProgramadaIdentificacion;

    /**
     * @var string
     *
     * @ORM\Column(name="observacionesRevision", type="string", length=500, nullable=true)
     * @Assert\Length(
     *      min = "0",
     *      max = "500",
     *      minMessage = "El campo debe ser mayor a {{ limit }} caracteres de largo",
     *      maxMessage = "El campo no puede tener más de {{ limit }} caracteres de largo"
     * )
     */
    private $observacionesRevision;

    /**
     * @var string
     *
     * @ORM\ManyToOne(targetEntity="Twinpeaks\UserBundle\Entity\User")
     */
    private $usuario;

    /**
     * @var string
     *
     * @ORM\ManyToOne(targetEntity="Web\WebBundle\Entity\Estado")
     */
    private $estadoSolicitud;

    /**
     * @var string
     *
     * @ORM\OneToMany(targetEntity="Web\WebBundle\Entity\SolicitudCantidadMotivo", mappedBy="solicitudMantenimiento", cascade={"persist","remove"})
     * @Assert\Valid
     * @Assert\NotBlank(message="Escoge una cantidad")
     */
    private $cantidadMotivo;

    /**
     * @var string
     *
     * @ORM\OneToMany(targetEntity="Web\WebBundle\Entity\EspecieRangoSolicitud", mappedBy="solicitudMantenimiento", cascade={"persist","remove"})
     * @Assert\Valid
     * @Assert\NotBlank(message="Escoge una especie")
     */
    private $especieRango;

    /**
     * @var string
     *
     * @ORM\Column(name="vereda", type="string", length=45, nullable=true)
     */
    private $vereda;

    /**
     * @var string
     *
     * @ORM\Column(name="oficina", type="string", length=45, nullable=true)
     */
    private $oficina;

    /**
     * @var string
     *
     * @ORM\Column(name="nosolicitud", type="string", length=45, nullable=true)
     */
    private $noSolicitud;

    /**
     * @var string
     *
     * @ORM\Column(name="municipioVereda", type="string", length=45, nullable=false)
     * @Assert\NotNull()
     */
    private $municipioVereda;

    /**
     * @var string
     *
     * @ORM\Column(name="departamento", type="string", length=45, nullable=false)
     * @Assert\NotNull()
     */
    private $departamento;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->cantidadMotivo = new ArrayCollection();
        $this->especieRango = new ArrayCollection();

    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set fechaSolicitud
     *
     * @param \DateTime $fechaSolicitud
     * @return SolMantenimientoIdentificacion
     */
    public function setFechaSolicitud($fechaSolicitud)
    {
        $this->fechaSolicitud = $fechaSolicitud;

        return $this;
    }

    /**
     * Get fechaSolicitud
     *
     * @return \DateTime
     */
    public function getFechaSolicitud()
    {
        return $this->fechaSolicitud;
    }

    /**
     * Set seccional
     *
     * @param string $seccional
     * @return SolMantenimientoIdentificacion
     */
    public function setSeccional(\ICA\TramiteBundle\Entity\Seccionales $seccional)
    {
        $this->seccional = $seccional;

        return $this;
    }

    /**
     * Get seccional
     *
     * @return string
     */
    public function getSeccional()
    {
        return $this->seccional;
    }

    /**
     * Set justificacionReidentificacion
     *
     * @param string $justificacionReidentificacion
     * @return SolMantenimientoIdentificacion
     */
    public function setJustificacionReidentificacion($justificacionReidentificacion)
    {
        $this->justificacionReidentificacion = $justificacionReidentificacion;

        return $this;
    }

    /**
     * Get justificacionReidentificacion
     *
     * @return string
     */
    public function getJustificacionReidentificacion()
    {
        return $this->justificacionReidentificacion;
    }

    /**
     * Set solicitudMantenimientoIdentificacion
     *
     * @param string $solicitudMantenimientoIdentificacion
     * @return SolMantenimientoIdentificacion
     */
    public function setSolicitudMantenimientoIdentificacion($solicitudMantenimientoIdentificacion)
    {
        $this->solicitudMantenimientoIdentificacion = $solicitudMantenimientoIdentificacion;

        return $this;
    }

    /**
     * Get solicitudMantenimientoIdentificacion
     *
     * @return string
     */
    public function getSolicitudMantenimientoIdentificacion()
    {
        return $this->solicitudMantenimientoIdentificacion;
    }

    /**
     * Set ica3101
     *
     * @param string $ica3101
     * @return SolMantenimientoIdentificacion
     */
    public function setIca3101($ica3101)
    {
        $this->ica3101 = $ica3101;

        return $this;
    }

    /**
     * Get ica3101
     *
     * @return string
     */
    public function getIca3101()
    {
        return $this->ica3101;
    }

    /**
     * Set nombreFinca
     *
     * @param string $nombreFinca
     * @return SolMantenimientoIdentificacion
     */
    public function setNombreFinca($nombreFinca)
    {
        $this->nombreFinca = $nombreFinca;

        return $this;
    }

    /**
     * Get nombreFinca
     *
     * @return string
     */
    public function getNombreFinca()
    {
        return $this->nombreFinca;
    }

    /**
     * Set nombrePropietarioFinca
     *
     * @param string $nombrePropietarioFinca
     * @return SolMantenimientoIdentificacion
     */
    public function setNombrePropietarioFinca($nombrePropietarioFinca)
    {
        $this->nombrePropietarioFinca = $nombrePropietarioFinca;

        return $this;
    }

    /**
     * Get nombrePropietarioFinca
     *
     * @return string
     */
    public function getNombrePropietarioFinca()
    {
        return $this->nombrePropietarioFinca;
    }

    /**
     * Set cedulaPropietarioFinca
     *
     * @param string $cedulaPropietarioFinca
     * @return SolMantenimientoIdentificacion
     */
    public function setCedulaPropietarioFinca($cedulaPropietarioFinca)
    {
        $this->cedulaPropietarioFinca = $cedulaPropietarioFinca;

        return $this;
    }

    /**
     * Get cedulaPropietarioFinca
     *
     * @return string
     */
    public function getCedulaPropietarioFinca()
    {
        return $this->cedulaPropietarioFinca;
    }

    /**
     * Set telefonoFijoPropietario
     *
     * @param string $telefonoFijoPropietario
     * @return SolMantenimientoIdentificacion
     */
    public function setTelefonoFijoPropietario($telefonoFijoPropietario)
    {
        $this->telefonoFijoPropietario = $telefonoFijoPropietario;

        return $this;
    }

    /**
     * Get telefonoFijoPropietario
     *
     * @return string
     */
    public function getTelefonoFijoPropietario()
    {
        return $this->telefonoFijoPropietario;
    }

    /**
     * Set telefonoCelularPropietario
     *
     * @param string $telefonoCelularPropietario
     * @return SolMantenimientoIdentificacion
     */
    public function setTelefonoCelularPropietario($telefonoCelularPropietario)
    {
        $this->telefonoCelularPropietario = $telefonoCelularPropietario;

        return $this;
    }

    /**
     * Get telefonoCelularPropietario
     *
     * @return string
     */
    public function getTelefonoCelularPropietario()
    {
        return $this->telefonoCelularPropietario;
    }

    /**
     * Set nombreSolicitante
     *
     * @param string $nombreSolicitante
     * @return SolMantenimientoIdentificacion
     */
    public function setNombreSolicitante($nombreSolicitante)
    {
        $this->nombreSolicitante = $nombreSolicitante;

        return $this;
    }

    /**
     * Get nombreSolicitante
     *
     * @return string
     */
    public function getNombreSolicitante()
    {
        return $this->nombreSolicitante;
    }

    /**
     * Set cedulaSolicitante
     *
     * @param string $cedulaSolicitante
     * @return SolMantenimientoIdentificacion
     */
    public function setCedulaSolicitante($cedulaSolicitante)
    {
        $this->cedulaSolicitante = $cedulaSolicitante;

        return $this;
    }

    /**
     * Get cedulaSolicitante
     *
     * @return string
     */
    public function getCedulaSolicitante()
    {
        return $this->cedulaSolicitante;
    }

    /**
     * Set telefonoFijoSolicitante
     *
     * @param string $telefonoFijoSolicitante
     * @return SolMantenimientoIdentificacion
     */
    public function setTelefonoFijoSolicitante($telefonoFijoSolicitante)
    {
        $this->telefonoFijoSolicitante = $telefonoFijoSolicitante;

        return $this;
    }

    /**
     * Get telefonoFijoSolicitante
     *
     * @return string
     */
    public function getTelefonoFijoSolicitante()
    {
        return $this->telefonoFijoSolicitante;
    }

    /**
     * Set telefonoCelularSolicitante
     *
     * @param string $telefonoCelularSolicitante
     * @return SolMantenimientoIdentificacion
     */
    public function setTelefonoCelularSolicitante($telefonoCelularSolicitante)
    {
        $this->telefonoCelularSolicitante = $telefonoCelularSolicitante;

        return $this;
    }

    /**
     * Get telefonoCelularSolicitante
     *
     * @return string
     */
    public function getTelefonoCelularSolicitante()
    {
        return $this->telefonoCelularSolicitante;
    }

    /**
     * Set fechaProgramadaIdentificacion
     *
     * @param \DateTime $fechaProgramadaIdentificacion
     * @return SolMantenimientoIdentificacion
     */
    public function setFechaProgramadaIdentificacion($fechaProgramadaIdentificacion)
    {

        $this->fechaProgramadaIdentificacion = $fechaProgramadaIdentificacion;

        return $this;
    }

    /**
     * Get fechaProgramadaIdentificacion
     *
     * @return \DateTime
     */
    public function getFechaProgramadaIdentificacion()
    {
        return $this->fechaProgramadaIdentificacion;
    }

    /**
     * Set observacionesRevision
     *
     * @param string $observacionesRevision
     * @return SolMantenimientoIdentificacion
     */
    public function setObservacionesRevision($observacionesRevision)
    {
        $this->observacionesRevision = $observacionesRevision;

        return $this;
    }

    /**
     * Get observacionesRevision
     *
     * @return string
     */
    public function getObservacionesRevision()
    {
        return $this->observacionesRevision;
    }

    /**
     * Set usuario
     *
     * @param string $usuario
     * @return SolMantenimientoIdentificacion
     */
    public function setUsuario(\Twinpeaks\UserBundle\Entity\User $usuario)
    {
        $this->usuario = $usuario;

        return $this;
    }

    /**
     * Get usuario
     *
     * @return string
     */
    public function getUsuario()
    {
        return $this->usuario;
    }

    /**
     * Set estadoSolicitud
     *
     * @param string $estadoSolicitud
     * @return SolMantenimientoIdentificacion
     */
    public function setEstadoSolicitud($estadoSolicitud)
    {
        $this->estadoSolicitud = $estadoSolicitud;

        return $this;
    }

    /**
     * Get estadoSolicitud
     *
     * @return string
     */
    public function getEstadoSolicitud()
    {
        return $this->estadoSolicitud;
    }

    /**
     * Set especieRango
     *
     * @return \Web\WebBundle\Entity\EspecieRangoSolicitud
     */
    public function setEspecieRango(\Doctrine\Common\Collections\Collection $especieRango)
    {
        $this->especieRango = $especieRango;
        foreach ($especieRango as $especiesRangos){
            $especiesRangos->setSolicitudMantenimiento($this);
        }
    }

    /**
     * Get especieRango
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEspecieRango()
    {
        return $this->especieRango;
    }

    /**
     * Set cantidadMotivo
     *
     * @return \Web\WebBundle\Entity\SolicitudCantidadMotivo
     */
    public function setCantidadMotivo(\Doctrine\Common\Collections\Collection $cantidadMotivo)
    {
        $this->cantidadMotivo = $cantidadMotivo;
        foreach ($cantidadMotivo as $cantidades) {
            $cantidades->setSolicitudMantenimiento($this);
        }
    }

    /**
     * Get cantidadMotivo
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCantidadMotivo()
    {
        return $this->cantidadMotivo;
    }

    /**
     * Set municipioVereda
     *
     * @param string $municipioVereda
     * @return SolMantenimientoIdentificacion
     */
    public function setMunicipioVereda($municipioVereda)
    {
        $this->municipioVereda = $municipioVereda;

        return $this;
    }

    /**
     * Get municipioVereda
     *
     * @return string
     */
    public function getMunicipioVereda()
    {
        return $this->municipioVereda;
    }

     /**
     * Set departamento
     *
     * @param string $departamento
     * @return SolMantenimientoIdentificacion
     */
    public function setDepartamento($departamento)
    {
        $this->departamento = $departamento;

        return $this;
    }

    /**
     * Get departamento
     *
     * @return string
     */
    public function getDepartamento()
    {
        return $this->departamento;
    }
    /**
     * @ORM\preUpdate
     */
    public function validarFechas()
    {
        $fecha = new \DateTime("now");
        if($this->getFechaProgramadaIdentificacion() < $this->getFechaSolicitud()){

            $this->setFechaProgramadaIdentificacion($this->getFechaSolicitud());
            return true;
        }
    }

    public function __toString()
    {
        return $this->getCedulaSolicitante()." ".$this->getNombreSolicitante();
    }

    /**
     * Set vereda
     *
     * @param string $vereda
     * @return SolMantenimientoIdentificacion
     */
    public function setVereda($vereda)
    {
        $this->vereda = $vereda;

        return $this;
    }

    /**
     * Get vereda
     *
     * @return string
     */
    public function getVereda()
    {
        return $this->vereda;
    }

    /**
     * Set oficina
     *
     * @param string $oficina
     * @return SolMantenimientoIdentificacion
     */
    public function setOficina($oficina)
    {
        $this->oficina = $oficina;

        return $this;
    }

    /**
     * Get oficina
     *
     * @return string
     */
    public function getOficina()
    {
        return $this->oficina;
    }

    /**
     * Set noSolicitud
     *
     * @param string $noSolicitud
     * @return SolMantenimientoIdentificacion
     */
    public function setNoSolicitud($noSolicitud)
    {
        $this->noSolicitud = $noSolicitud;

        return $this;
    }

    /**
     * Get noSolicitud
     *
     * @return string
     */
    public function getNoSolicitud()
    {
        return $this->noSolicitud;
    }

}


text:
namespace dart {

RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address,
                                            const Code& code) {
  ASSERT(code.ContainsInstructionAt(return_address));
  CallPattern call(return_address, code);
  return call.TargetCode();
}

void CodePatcher::PatchStaticCallAt(uword return_address,
                                    const Code& code,
                                    const Code& new_target) {
  ASSERT(code.ContainsInstructionAt(return_address));
  CallPattern call(return_address, code);
  call.SetTargetCode(new_target);
}

void CodePatcher::InsertDeoptimizationCallAt(uword start) {
  UNREACHABLE();
}

RawCode* CodePatcher::GetInstanceCallAt(uword return_address,
                                        const Code& caller_code,
                                        Object* data) {
  ASSERT(caller_code.ContainsInstructionAt(return_address));
  ICCallPattern call(return_address, caller_code);
  if (data != NULL) {
    *data = call.Data();
  }
  return call.TargetCode();
}

void CodePatcher::PatchInstanceCallAt(uword return_address,
                                      const Code& caller_code,
                                      const Object& data,
                                      const Code& target) {
  ASSERT(caller_code.ContainsInstructionAt(return_address));
  ICCallPattern call(return_address, caller_code);
  call.SetData(data);
  call.SetTargetCode(target);
}

RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address,
                                                     const Code& caller_code,
                                                     ICData* ic_data_result) {
  ASSERT(caller_code.ContainsInstructionAt(return_address));
  ICCallPattern static_call(return_address, caller_code);
  ICData& ic_data = ICData::Handle();
  ic_data ^= static_call.Data();
  if (ic_data_result != NULL) {
    *ic_data_result = ic_data.raw();
  }
  return ic_data.GetTargetAt(0);
}

void CodePatcher::PatchSwitchableCallAt(uword return_address,
                                        const Code& caller_code,
                                        const Object& data,
                                        const Code& target) {
  ASSERT(caller_code.ContainsInstructionAt(return_address));
  if (FLAG_precompiled_mode && FLAG_use_bare_instructions) {
    BareSwitchableCallPattern call(return_address, caller_code);
    call.SetData(data);
    call.SetTarget(target);
  } else {
    SwitchableCallPattern call(return_address, caller_code);
    call.SetData(data);
    call.SetTarget(target);
  }
}

RawCode* CodePatcher::GetSwitchableCallTargetAt(uword return_address,
                                                const Code& caller_code) {
  ASSERT(caller_code.ContainsInstructionAt(return_address));
  if (FLAG_precompiled_mode && FLAG_use_bare_instructions) {
    BareSwitchableCallPattern call(return_address, caller_code);
    return call.target();
  } else {
    SwitchableCallPattern call(return_address, caller_code);
    return call.target();
  }
}

RawObject* CodePatcher::GetSwitchableCallDataAt(uword return_address,
                                                const Code& caller_code) {
  ASSERT(caller_code.ContainsInstructionAt(return_address));
  if (FLAG_precompiled_mode && FLAG_use_bare_instructions) {
    BareSwitchableCallPattern call(return_address, caller_code);
    return call.data();
  } else {
    SwitchableCallPattern call(return_address, caller_code);
    return call.data();
  }
}

void CodePatcher::PatchNativeCallAt(uword return_address,
                                    const Code& code,
                                    NativeFunction target,
                                    const Code& trampoline) {
  ASSERT(code.ContainsInstructionAt(return_address));
  NativeCallPattern call(return_address, code);
  call.set_target(trampoline);
  call.set_native_function(target);
}

RawCode* CodePatcher::GetNativeCallAt(uword return_address,
                                      const Code& code,
                                      NativeFunction* target) {
  ASSERT(code.ContainsInstructionAt(return_address));
  NativeCallPattern call(return_address, code);
  *target = call.native_function();
  return call.target();
}

}  // namespace dart

#endif  // defined TARGET_ARCH_ARM


text:
.. acorn documentation master file, created by
   sphinx-quickstart on Fri Sep 23 15:09:05 2016.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Automatic Computational Research Notebook
=========================================

ACORN automates the decoration and logging of computational research in a smart
way that makes it easy to keep "lab notebooks" for computational
scientists. This API focuses on the python backend that handles all the package
decoration functions needed to implement smart logging.

.. note:: the ipython notebook interface provides logging of commands typed into
	  the notebook. In that way, it is possible to keep a log of everything
	  that was done. However, the log is not as useful as `acorn` because
	  it is just text. We treat variables and methods individually and
	  expose ways to analyze and document results automatically.

The backend is made up a few key pieces:

1. Decorator logic that can handle any kind of package, including the
   C-extension modules that optimize numerical operations.
2. Descriptors that use configuration files to decide how best to describe
   variables/objects in the database.
3. A database module that saves method calls, object instantiations and the
   objects and variables used in those calls.
4. Automated importer so that new packages (including those created by users)
   can be decorated without modifying `acorn`.
5. `Ipython` extension module that allows classes and functions defined in an
   ipython notebook to be automatically decorated and included in the database.
6. Special sub-classing modules for optimized packages that cannot be handled by
   the default decoration machinery (e.g., `numpy.ndarray`).
7. An analysis module that analyzes the results of certain function calls (based
   on the FQDN of the function) to expose additional features that are
   interesting to the user in the context of a notebook. For example, when a ML
   model is fit, the scores can be configured to automatically be extracted
   whenever `*.predict` is called on the model.

Each of these building blocks is described below in a separate documentation
file. Each file also includes the API documentation for the code. Additionally,
the syntax for configuring which parts of packages are included is described in
the :doc:`configuration` section.

Contents:

.. toctree::
   :maxdepth: 1

   decoration.rst
   descriptors.rst
   database.rst
   importer.rst
   ipython.rst
   subclass.rst
   analysis.rst
   configuration.rst

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
#include "tracer.h"
#include "tracer_util.h"
#include "tracer_internal.h"
#include "CuTest.h"

void TestDict(CuTest* tc)
{
    TRState* state = triGetState();
    TRStrDict* dict = triCreateStrDict(state);
    TRArray* keys;
    TRArray* values;

    CuAssertPtrNotNull(tc, dict);

    CuAssertIntEquals(tc, 0, triDictSize(dict));
    triStrDictSet(dict, "foo", (void*)1234);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 1, triDictSize(dict));
    CuAssertIntEquals(tc, 1234, (int)triStrDictGet(dict, "foo"));

    triStrDictSet(dict, "foo", (void*)31337);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 1, triDictSize(dict));
    CuAssertIntEquals(tc, 31337, (int)triStrDictGet(dict, "foo"));

    triStrDictSet(dict, "bar", (void*)715517);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 2, triDictSize(dict));
    CuAssertIntEquals(tc, 715517, (int)triDictGet(dict, "bar"));

    keys = triDictGetKeys(dict);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 2, triArraySize(keys));
    triDestroyArray(keys);

    values = triDictGetKeys(dict);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 2, triArraySize(values));
    triDestroyArray(values);

    CuAssertIntEquals(tc, 0, (int)triStrDictGet(dict, "none"));
    triStrDictRemove(dict, "none");
    triStrDictRemove(dict, "foo");
    triStrDictRemove(dict, "bar");
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 0, triDictSize(dict));

    triStrDictSet(dict, "foo", (void*)1234);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 1, triDictSize(dict));

    triDestroyDict(dict);
    triDestroyState(state);
}

static TRint pseudoRand(TRint seed)
{
    return (seed ^ ((seed << 3) + 0x213214) * (seed ^ 0x9853));
}

void StressTestDict(CuTest* tc)
{
    TRState* state = triGetState();
    TRStrDict* dict = triCreateStrDict(state);
    TRint i, n = 1000;
    TRbyte name[32];

    CuAssertPtrNotNull(tc, dict);

    for (i = 0; i < n; i++)
    {
        TRint k = pseudoRand(i);
        sprintf(name, "%d", k);
        triStrDictSet(dict, name, (void*)(i + 1));
    }
    CuAssertIntEquals(tc, n, triDictSize(dict));

    /* Remove every other key */
    for (i = 0; i < n; i += 2)
    {
        TRint k = pseudoRand(i);
        sprintf(name, "%d", k);
        CuAssertPtrNotNull(tc, triStrDictGet(dict, name));
        CuAssertIntEquals(tc, TR_TRUE, triStrDictRemove(dict, name));
        CuAssertIntEquals(tc, 0, (int)triStrDictGet(dict, name));
        CuAssertIntEquals(tc, n - i / 2 - 1, triDictSize(dict));
    }

    /* Remove the remaining keys */
    for (i = 1; i < n; i += 2)
    {
        TRint k = pseudoRand(i);
        sprintf(name, "%d", k);
        CuAssertPtrNotNull(tc, triStrDictGet(dict, name));
        CuAssertIntEquals(tc, TR_TRUE, triStrDictRemove(dict, name));
        CuAssertIntEquals(tc, 0, (int)triStrDictGet(dict, name));
        CuAssertIntEquals(tc, n / 2 - i / 2 - 1, triDictSize(dict));
    }

    CuAssertIntEquals(tc, 0, triDictSize(dict));
    triDestroyDict(dict);
    triDestroyState(state);
}

void TestIntDict(CuTest* tc)
{
    TRState* state = triGetState();
    TRIntDict* dict = triCreateIntDict(state);
    TRArray* keys;
    TRArray* values;

    CuAssertPtrNotNull(tc, dict);

    CuAssertIntEquals(tc, 0, triDictSize(dict));
    triIntDictSet(dict, 0x1, (void*)1234);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 1, triDictSize(dict));
    CuAssertIntEquals(tc, 1234, (int)triIntDictGet(dict, 0x1));

    triIntDictSet(dict, 0x1, (void*)31337);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 1, triDictSize(dict));
    CuAssertIntEquals(tc, 31337, (int)triIntDictGet(dict, 0x1));

    triIntDictSet(dict, 0x2, (void*)715517);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 2, triDictSize(dict));
    CuAssertIntEquals(tc, 715517, (int)triIntDictGet(dict, 0x2));

    keys = triDictGetKeys(dict);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 2, triArraySize(keys));
    triDestroyArray(keys);

    values = triDictGetKeys(dict);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 2, triArraySize(values));
    triDestroyArray(values);

    CuAssertIntEquals(tc, 0, (int)triIntDictGet(dict, 0x3));
    triIntDictRemove(dict, 0x3);
    triIntDictRemove(dict, 0x1);
    triIntDictRemove(dict, 0x2);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 0, triDictSize(dict));

    triIntDictSet(dict, 0x1, (void*)1234);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 1, triDictSize(dict));

    triDestroyDict(dict);
    triDestroyState(state);
}

void TestArray(CuTest* tc)
{
    TRState* state = triGetState();
    TRArray* array = triCreateArray(state);

    CuAssertPtrNotNull(tc, array);

    CuAssertIntEquals(tc, 0, triArraySize(array));
    triArrayAppend(array, (void*)1234);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 1, triArraySize(array));
    CuAssertIntEquals(tc, 1234, (int)triArrayGet(array, 0));

    triArrayAppend(array, (void*)31337);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 2, triArraySize(array));
    CuAssertIntEquals(tc, 31337, (int)triArrayGet(array, 1));

    triArrayRemove(array, (void*)1234);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 1, triArraySize(array));
    CuAssertIntEquals(tc, 31337, (int)triArrayGet(array, 0));

    /* Nonexistent value */
    CuAssertIntEquals(tc, TR_FALSE, triArrayRemove(array, (void*)715517));
    CuAssertIntEquals(tc, TR_TRUE,  triArrayRemove(array, (void*)31337));
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 0, triArraySize(array));

    triArrayAppend(array, (void*)1234);
    CuAssertIntEquals(tc, TR_NO_ERROR, trGetError());
    CuAssertIntEquals(tc, 1, triArraySize(array));

    triDestroyArray(array);
    triDestroyState(state);
}

void TestCRC(CuTest* tc)
{
    TRState* state = triGetState();
    const TRbyte data1[] = "Apples";
    const TRbyte data2[] = "Oranges";
    const TRbyte data3[] = "";

    TRuint crc1 = triCalculateCRC32(state, triStringLength(data1), data1);
    TRuint crc2 = triCalculateCRC32(state, triStringLength(data2), data2);
    TRuint crc3 = triCalculateCRC32(state, triStringLength(data3), data3);

    CuAssertIntEquals(tc, 0x6614e5a,  crc1);
    CuAssertIntEquals(tc, 0x8ef260b4, crc2);
    CuAssertIntEquals(tc, 0x0,        crc3);

    triDestroyState(state);
}

CuSuite* CuUtilGetSuite(void)
{
  CuSuite* suite = CuSuiteNew();

  SUITE_ADD_TEST(suite, TestArray);
  SUITE_ADD_TEST(suite, TestDict);
  SUITE_ADD_TEST(suite, StressTestDict);
  SUITE_ADD_TEST(suite, TestIntDict);
  SUITE_ADD_TEST(suite, TestCRC);

  return suite;
}


text:
<?php

namespace Metrique\Building\Http\Requests;

use Illuminate\Contracts\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
use Metrique\Building\Rules\ComponentIsBoundRule;
use Metrique\Building\Services\BuildingServiceInterface;

class ComponentEditRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get custom attributes for validator errors.
     *
     * @return array
     */
    public function attributes()
    {
        return [
        ];
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $this->redirect = url()->previous() . '#' . $this->request->get('_id');

        return $this->fetchRules(
            $this->request->get(
                '_parent',
                $this->request->get('_id')
            )
        );
    }

    public function prepareForValidation()
    {
        abort_unless(
            (new ComponentIsBoundRule)->passes(
                null,
                $this->request->get('_component')
            ),
            403
        );

        $this->merge(
            collect($this->request)->mapWithKeys(function ($value, $key) {
                return [
                    str_replace('_' . $this->_id, '', $key) => $value
                ];
            })->toArray()
        );
    }

    private function fetchRules($componentId)
    {
        $component = resolve(BuildingServiceInterface::class)
            ->readComponentOnPage(
                $componentId,
                $this->page
            );

        $rules = collect($component->rules())->map(function ($field) {
            return collect($field)->map(
                fn ($rule) => is_a($rule, Rule::class, true) ? new $rule : $rule
            )->toArray();
        });

        if ($this->request->get('_type', '') == 'attributes') {
            return $rules->intersectByKeys(
                $component->attributes()
            )->toArray();
        }

        if ($this->request->get('_type', '') == 'multiple') {
            return $rules->intersectByKeys(
                collect(
                    $component->properties()
                )->merge(
                    $component->attributes()
                )
            )->toArray();
        }

        if ($this->request->get('_type', '') == 'properties') {
            return $rules->intersectByKeys(
                $component->properties()
            )->toArray();
        }
    }
}


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

namespace FMI.WeAzure.Boxing.Contracts.Dto
{
    public class Boxer
    {
        public int Id { get; set; }

        public string Name { get; set; }

        public string Biography { get; set; }
    }
}


text:
<!DOCTYPE html>

    <title>Basic usage</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">

        Back

                    Choose culture:
                    <input id="culture" value="en-US" />

Product promotion

                    Discount start date:
                    <input id="startDate" />
                    <input id="startTime" value="12:00 AM" />

                    Discount end date:
                    <input id="endDate" />
                    <input id="endTime" value="12:00 AM" />

                    Initial price:
                    <input id="initial" value="10" min="1"/>

                    Discount:
                    <input id="discount" value="0.05" min="0" max="0.5" step="0.01"/>


text:
test:
	./vendor/bin/phpunit --colors --verbose

deps:
	composer install

dev-deps:
	composer install --dev

fresh:
	rm -rf .git/
	git init


text:
<?php
/**
 * Extends SiteTree with basic metadata fields, as well as the main `Metadata()` method.
 *
 * @package silverstripe-seo
 * @subpackage metadata
 * @author Andrew Gerber <atari@graphiquesdigitale.net>
 * @version 1.0.0
 */

/**
 * Class SEO_Metadata_SiteTree_DataExtension
 */
class SEO_Metadata_SiteTree_DataExtension extends DataExtension
{

    /* Overload Model
    ------------------------------------------------------------------------------*/

    /**
     * Database attributes.
     *
     * @var array $db
     */
    private static $db = array(
        'MetaTitle' => 'Varchar(128)',
        'MetaDescription' => 'Text', // redundant, but included for backwards-compatibility
        'ExtraMeta' => 'HTMLText', // redundant, but included for backwards-compatibility
    );

    /* Overload Methods
    ------------------------------------------------------------------------------*/

    // @todo @inheritdoc ?? or does it happen automagically as promised?
    public function updateCMSFields(FieldList $fields)
    {
        // Remove framework default metadata group
        $fields->removeByName(array('Metadata'));
        // Add SEO
        $fields->addFieldsToTab('Root.Metadata.SEO', $this->owner->getSEOFields());
        // Add full output
        $fields->addFieldsToTab('Root.Metadata.FullOutput', $this->owner->getFullOutput());
    }

    /**
     * Gets SEO fields.
     *
     * @return array
     */
    public function getSEOFields()
    {
        // Variables
        $config = SiteConfig::current_site_config();
        $SEO = [];
        // Canonical
        if ($config->CanonicalEnabled()) {
            $SEO[] = ReadonlyField::create('ReadonlyMetaCanonical', 'link rel="canonical"', $this->owner->AbsoluteLink());
        }
        // Title
        if ($config->TitleEnabled()) {
            $SEO[] = TextField::create('MetaTitle', 'meta title')
                ->setAttribute('placeholder', $this->owner->GenerateTitle());
        }
        // Description
        $SEO[] = TextareaField::create('MetaDescription', 'meta description')
            ->setAttribute('placeholder', $this->owner->GenerateDescriptionFromContent());
        // ExtraMeta
        if ($config->ExtraMetaEnabled()) {
            $SEO[] = TextareaField::create('ExtraMeta', 'Custom Metadata');
        }
        return $SEO;
    }

    /**
     * Gets the full output.
     *
     * @return array
     */
    public function getFullOutput()
    {
        return array(
            LiteralField::create('HeaderMetadata', '
$Metadata()
'),
            LiteralField::create('LiteralMetadata', '
' . nl2br(htmlentities(trim($this->owner->Metadata()), ENT_QUOTES)) . '
')
        );
    }

    /**
     * Main function to format & output metadata as an HTML string.
     *
     * Use the `updateMetadata($config, $owner, $metadata)` update hook when extending `DataExtension`s.
     *
     * @return string
     */
    public function Metadata()
    {
        // variables
        $config = SiteConfig::current_site_config();
        // begin SEO
        $metadata = PHP_EOL . $this->owner->MarkupComment('SEO');
        // register extension update hook
        $this->owner->extend('updateMetadata', $config, $this->owner, $metadata);
        // end
        $metadata .= $this->owner->MarkupComment('END SEO');
        // return
        return $metadata;
    }

    /* Template Methods
    ------------------------------------------------------------------------------*/

    /**
     * Updates metadata fields.
     *
     * @param SiteConfig $config
     * @param SiteTree $owner
     * @param string $metadata
     *
     * @return void
     */
    public function updateMetadata(SiteConfig $config, SiteTree $owner, &$metadata)
    {
        // metadata
        $metadata .= $owner->MarkupComment('Metadata');
        // charset
        if ($config->CharsetEnabled()) {
            $metadata .= '<meta charset="' . $config->Charset() . '" />' . PHP_EOL;
        }
        // canonical
        if ($config->CanonicalEnabled()) {
            $metadata .= $owner->MarkupLink('canonical', $owner->AbsoluteLink());
        }
        // title
        if ($config->TitleEnabled()) {
            $metadata .= '<title>' . $owner->encodeContent($owner->GenerateTitle(), $config->Charset()) . '</title>' . PHP_EOL;
        }
        // description
        if ($description = $owner->GenerateDescription()) {
            $metadata .= $owner->MarkupMeta('description', $description, $config->Charset());
        }
        // extra metadata
        if ($config->ExtraMetaEnabled()) {
            $metadata .= $owner->MarkupComment('Extra Metadata');
            $metadata .= $owner->GenerateExtraMeta();
        }
    }

    /* Markup Methods
    ------------------------------------------------------------------------------*/

    /**
     * Returns a given string as a HTML comment.
     *
     * @param string $comment
     *
     * @return string
     */
    public function MarkupComment($comment)
    {
        return '' . PHP_EOL;
    }

    /**
     * Returns markup for a HTML meta element. Can be flagged for encoding.
     *
     * @param string $name
     * @param string $content
     * @param string|null $encode
     *
     * @return string
     */
    public function MarkupMeta($name, $content, $encode = null)
    {
        if ($encode !== null) {
            return '<meta name="' . $name . '" content="' . $this->encodeContent($content, $encode) . '" />' . PHP_EOL;
        } else {
            return '<meta name="' . $name . '" content="' . $content . '" />' . PHP_EOL;
        }
    }

    /**
     * Returns markup for a HTML link element.
     *
     * @param string $rel
     * @param string $href
     * @param string|null $type
     * @param string|null $sizes
     *
     * @return string
     */
    public function MarkupLink($rel, $href, $type = null, $sizes = null)
    {
        // start fragment
        $return = '<link rel="' . $rel . '" href="' . $href . '"';
        // if type
        if ($type !== null) {
            $return .= ' type="' . $type . '"';
        }
        // if sizes
        if ($sizes !== null) {
            $return .= ' sizes="' . $sizes . '"';
        }
        // end fragment
        $return .= ' />' . PHP_EOL;
        // return
        return $return;
    }

    /* Generation Methods
    ------------------------------------------------------------------------------*/

    /**
     * Generates HTML title based on configuration settings.
     *
     * @return string|null
     */
    public function GenerateTitle()
    {
        if ($this->owner->MetaTitle) {
            return $this->owner->MetaTitle;
        } else {
            return SiteConfig::current_site_config()->GenerateTitle($this->owner->Title);
        }
    }

    /**
     * Generates description from the page `MetaDescription`, or the first paragraph of the `Content` attribute.
     *
     * @return string|null
     */
    public function GenerateDescription()
    {
        if ($this->owner->MetaDescription) {
            return $this->owner->MetaDescription;
        } else {
            return $this->owner->GenerateDescriptionFromContent();
        }
    }

    /**
     * Generates description from the first paragraph of the `Content` attribute.
     *
     * @return string|null
     */
    public function GenerateDescriptionFromContent()
    {
        // check for content
        if ($content = trim($this->owner->Content)) {
            // pillage first paragraph from page content
            if (preg_match('/
(.*?)<\/p>/i', $content, $match)) {
                // is HTML
                $content = $match[0];
            } else {
                // is plain text
                $content = explode(PHP_EOL, $content);
                $content = $content[0];
            }
            // decode (no harm done) & return
            return trim(html_entity_decode(strip_tags($content)));
        } else {
            return null;
        }
    }

    /**
     * Generates extra metadata.
     *
     * @return string
     */
    public function GenerateExtraMeta()
    {
        if ($this->owner->ExtraMeta) {
            return $this->owner->ExtraMeta . PHP_EOL;
        } else {
            return $this->owner->MarkupComment('none');
        }
    }

    /* Utility Methods
    --------------------------------------------------------------------------*/

    /**
     * Returns a plain or HTML-encoded string according to the current charset & encoding settings.
     *
     * @param string $content
     * @param string $charset
     *
     * @return string
     */
    public function encodeContent($content, $charset)
    {
        return htmlentities($content, ENT_QUOTES, $charset);
    }

}


text:
@implementation CDVCookieMaster

 - (void)getCookieValue:(CDVInvokedUrlCommand*)command
{
    CDVPluginResult* pluginResult = nil;
    NSString* urlString = [command.arguments objectAtIndex:0];
    __block NSString* cookieName = [command.arguments objectAtIndex:1];

    if (urlString != nil) {
        NSArray* cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:[NSURL URLWithString:urlString]];

        __block NSString *cookieValue;

        [cookies enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
            NSHTTPCookie *cookie = obj;
            if([cookie.name isEqualToString:cookieName])
            {
                cookieValue = cookie.value;
                *stop = YES;
            }
        }];
        if (cookieValue != nil) {
            pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:@{@"cookieValue":cookieValue}];
        } else {
            pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No cookie found"];
        }

    } else {
        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"URL was null"];
    }
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

 - (void)setCookieValue:(CDVInvokedUrlCommand*)command
{
    //[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];

    CDVPluginResult* pluginResult = nil;
    NSString* urlString = [command.arguments objectAtIndex:0];
    NSString* cookieName = [command.arguments objectAtIndex:1];
    NSString* cookieValue = [command.arguments objectAtIndex:2];

     NSMutableDictionary *cookieProperties = [NSMutableDictionary dictionary];
     [cookieProperties setObject:cookieName forKey:NSHTTPCookieName];
     [cookieProperties setObject:cookieValue forKey:NSHTTPCookieValue];
     [cookieProperties setObject:urlString forKey:NSHTTPCookieOriginURL];
     [cookieProperties setObject:@"/" forKey:NSHTTPCookiePath];

    NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:cookieProperties];
    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie];

    NSArray* cookies = [NSArray arrayWithObjects:cookie, nil];

    NSURL *url = [[NSURL alloc] initWithString:urlString];
    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:cookies forURL:url mainDocumentURL:nil];

    pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"Set cookie executed"];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

-(void)setCookieOption:(CDVInvokedUrlCommand*)command
{
    CDVPluginResult* pluginResult = nil;
    NSMutableDictionary* options = [command.arguments objectAtIndex:0];
    NSDictionary *properties = [self mapCookieProperties:options];
    NSLog(@"Setting cookie with properties: %@", properties);

    NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:properties];
    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie];

    pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"Set cookie executed"];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];}

- (void)clearCookies:(CDVInvokedUrlCommand*)command
{
    NSHTTPCookie *cookie;
    NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
    for (cookie in [storage cookies]) {
        [storage deleteCookie:cookie];
    }
    [[NSUserDefaults standardUserDefaults] synchronize];

    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

-(NSDictionary*)mapCookieProperties:(NSDictionary*)options {
    NSDictionary *cookiePropertiesMap = @{
      @"comment": NSHTTPCookieComment,
      @"commentUrl": NSHTTPCookieCommentURL,
      @"discard": NSHTTPCookieDiscard,
      @"domain": NSHTTPCookieDomain,
      @"expires": NSHTTPCookieExpires,
      @"maximumAge": NSHTTPCookieMaximumAge,
      @"name": NSHTTPCookieName,
      @"originUrl": NSHTTPCookieOriginURL,
      @"path": NSHTTPCookiePath,
      @"port": NSHTTPCookiePort,
      @"secure": NSHTTPCookieSecure,
      @"value": NSHTTPCookieValue,
      @"version": NSHTTPCookieVersion,
    };
    NSMutableDictionary* properties = [NSMutableDictionary dictionary];
    for (NSString *key in options) {
        id value = [options objectForKey:key];
        if ([key isEqual: @"expires"]) {
            NSTimeInterval time = (int) value;
            value = [[NSDate date] dateByAddingTimeInterval:time];
        }
        NSString *property = [cookiePropertiesMap objectForKey:key];
        if (value && property) {
            [properties setObject:value forKey:property];
        }
    }
    return properties;
}

@end


text:
describe('delete() Should ', function () {
    const basicConfig = {
        children: [
            {
                type: "row",
                children: [
                    {
                        type: "window",
                        appName: "dummyApp"
                    }
                ]
            }
        ]
    }

    before(() => coreReady);

    let layoutsForCleanup = [];

    afterEach(async () => {
        const summaries = await glue.workspaces.layouts.getSummaries();
        await Promise.all(layoutsForCleanup.map(l => {
            if (summaries.some(s => s.name === l)) {
                return glue.workspaces.layouts.delete(l);
            }
        }));
        const frames = await glue.workspaces.getAllFrames();
        await Promise.all(frames.map((f) => f.close()));
    });

    it(`delete the layout when the name is correct`, async () => {
        const workspace = await glue.workspaces.createWorkspace(basicConfig);
        const layoutName = gtf.getWindowName("layout");
        await workspace.saveLayout(layoutName);

        layoutsForCleanup.push(layoutName);

        await glue.workspaces.layouts.delete(layoutName);

        const summaries = await glue.workspaces.layouts.getSummaries();

        summaries.forEach((s) => console.log(s.name));

        expect(summaries.filter(s => s.name === layoutName).length).to.eql(0);
    });
    Array.from([null, undefined, 42, {}, []]).forEach((input) => {
        it(`reject when the name is a ${JSON.stringify(input)}`, (done) => {
            glue.workspaces.layouts.delete(input).then(() => {
                done("Should not resolve");
            }).catch(() => done());
        });
    });
});


text:
namespace solar {

	class json_archive_writer : public archive_writer {

	private:
		json_writer _writer;
		bool _is_writing;

	public:
		explicit json_archive_writer(stream& stream);
		virtual ~json_archive_writer();

		virtual void begin_writing() override;
		virtual void end_writing() override;

		virtual void write_name(const char* name) override;
		virtual void write_array(unsigned int size, std::function<void(archive_writer&, unsigned int)> write_element_func) override;
		virtual void write_object(std::function<void(archive_writer&)> write_object_func) override;
		virtual void write_bool(bool value) override;
		virtual void write_uint16(uint16_t value) override;
		virtual void write_int(int value, const archive_int_compression& compression) override;
		virtual void write_int64(int64_t value) override;
		virtual void write_uint(unsigned int value) override;
		virtual void write_float(float value) override;
		virtual void write_string(const std::string& value) override;
		virtual void write_color(const color& value) override;

	private:
		void try_write_name_before_value();
	};

}


text:
package com.liferay.wsrp.service;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.util.ClassLoaderProxy;
import com.liferay.portal.kernel.util.MethodCache;
import com.liferay.portal.kernel.util.ReferenceRegistry;

/**
 * The utility for the w s r p producer local service. This utility wraps {@link com.liferay.wsrp.service.impl.WSRPProducerLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
 *
 *

 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
 *

 *
 * @author Brian Wing Shun Chan
 * @see WSRPProducerLocalService
 * @see com.liferay.wsrp.service.base.WSRPProducerLocalServiceBaseImpl
 * @see com.liferay.wsrp.service.impl.WSRPProducerLocalServiceImpl
 * @generated
 */
public class WSRPProducerLocalServiceUtil {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify this class directly. Add custom service methods to {@link com.liferay.wsrp.service.impl.WSRPProducerLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
	 */

	/**
	* Adds the w s r p producer to the database. Also notifies the appropriate model listeners.
	*
	* @param wsrpProducer the w s r p producer
	* @return the w s r p producer that was added
	* @throws SystemException if a system exception occurred
	*/
	public static com.liferay.wsrp.model.WSRPProducer addWSRPProducer(
		com.liferay.wsrp.model.WSRPProducer wsrpProducer)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().addWSRPProducer(wsrpProducer);
	}

	/**
	* Creates a new w s r p producer with the primary key. Does not add the w s r p producer to the database.
	*
	* @param wsrpProducerId the primary key for the new w s r p producer
	* @return the new w s r p producer
	*/
	public static com.liferay.wsrp.model.WSRPProducer createWSRPProducer(
		long wsrpProducerId) {
		return getService().createWSRPProducer(wsrpProducerId);
	}

	/**
	* Deletes the w s r p producer with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param wsrpProducerId the primary key of the w s r p producer
	* @throws PortalException if a w s r p producer with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static void deleteWSRPProducer(long wsrpProducerId)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		getService().deleteWSRPProducer(wsrpProducerId);
	}

	/**
	* Deletes the w s r p producer from the database. Also notifies the appropriate model listeners.
	*
	* @param wsrpProducer the w s r p producer
	* @throws PortalException
	* @throws SystemException if a system exception occurred
	*/
	public static void deleteWSRPProducer(
		com.liferay.wsrp.model.WSRPProducer wsrpProducer)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		getService().deleteWSRPProducer(wsrpProducer);
	}

	/**
	* Performs a dynamic query on the database and returns the matching rows.
	*
	* @param dynamicQuery the dynamic query
	* @return the matching rows
	* @throws SystemException if a system exception occurred
	*/
	@SuppressWarnings("rawtypes")
	public static java.util.List dynamicQuery(
		com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().dynamicQuery(dynamicQuery);
	}

	/**
	* Performs a dynamic query on the database and returns a range of the matching rows.
	*
	*

	* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	*

	*
	* @param dynamicQuery the dynamic query
	* @param start the lower bound of the range of model instances
	* @param end the upper bound of the range of model instances (not inclusive)
	* @return the range of matching rows
	* @throws SystemException if a system exception occurred
	*/
	@SuppressWarnings("rawtypes")
	public static java.util.List dynamicQuery(
		com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
		int end) throws com.liferay.portal.kernel.exception.SystemException {
		return getService().dynamicQuery(dynamicQuery, start, end);
	}

	/**
	* Performs a dynamic query on the database and returns an ordered range of the matching rows.
	*
	*

	* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	*

	*
	* @param dynamicQuery the dynamic query
	* @param start the lower bound of the range of model instances
	* @param end the upper bound of the range of model instances (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally null)
	* @return the ordered range of matching rows
	* @throws SystemException if a system exception occurred
	*/
	@SuppressWarnings("rawtypes")
	public static java.util.List dynamicQuery(
		com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
		int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService()
				   .dynamicQuery(dynamicQuery, start, end, orderByComparator);
	}

	/**
	* Returns the number of rows that match the dynamic query.
	*
	* @param dynamicQuery the dynamic query
	* @return the number of rows that match the dynamic query
	* @throws SystemException if a system exception occurred
	*/
	public static long dynamicQueryCount(
		com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().dynamicQueryCount(dynamicQuery);
	}

	public static com.liferay.wsrp.model.WSRPProducer fetchWSRPProducer(
		long wsrpProducerId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().fetchWSRPProducer(wsrpProducerId);
	}

	/**
	* Returns the w s r p producer with the primary key.
	*
	* @param wsrpProducerId the primary key of the w s r p producer
	* @return the w s r p producer
	* @throws PortalException if a w s r p producer with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.liferay.wsrp.model.WSRPProducer getWSRPProducer(
		long wsrpProducerId)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService().getWSRPProducer(wsrpProducerId);
	}

	public static com.liferay.portal.model.PersistedModel getPersistedModel(
		java.io.Serializable primaryKeyObj)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService().getPersistedModel(primaryKeyObj);
	}

	/**
	* Returns the w s r p producer with the UUID in the group.
	*
	* @param uuid the UUID of w s r p producer
	* @param groupId the group id of the w s r p producer
	* @return the w s r p producer
	* @throws PortalException if a w s r p producer with the UUID in the group could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static com.liferay.wsrp.model.WSRPProducer getWSRPProducerByUuidAndGroupId(
		java.lang.String uuid, long groupId)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService().getWSRPProducerByUuidAndGroupId(uuid, groupId);
	}

	/**
	* Returns a range of all the w s r p producers.
	*
	*

	* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	*

	*
	* @param start the lower bound of the range of w s r p producers
	* @param end the upper bound of the range of w s r p producers (not inclusive)
	* @return the range of w s r p producers
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<com.liferay.wsrp.model.WSRPProducer> getWSRPProducers(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().getWSRPProducers(start, end);
	}

	/**
	* Returns the number of w s r p producers.
	*
	* @return the number of w s r p producers
	* @throws SystemException if a system exception occurred
	*/
	public static int getWSRPProducersCount()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().getWSRPProducersCount();
	}

	/**
	* Updates the w s r p producer in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
	*
	* @param wsrpProducer the w s r p producer
	* @return the w s r p producer that was updated
	* @throws SystemException if a system exception occurred
	*/
	public static com.liferay.wsrp.model.WSRPProducer updateWSRPProducer(
		com.liferay.wsrp.model.WSRPProducer wsrpProducer)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().updateWSRPProducer(wsrpProducer);
	}

	/**
	* Updates the w s r p producer in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
	*
	* @param wsrpProducer the w s r p producer
	* @param merge whether to merge the w s r p producer with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
	* @return the w s r p producer that was updated
	* @throws SystemException if a system exception occurred
	*/
	public static com.liferay.wsrp.model.WSRPProducer updateWSRPProducer(
		com.liferay.wsrp.model.WSRPProducer wsrpProducer, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().updateWSRPProducer(wsrpProducer, merge);
	}

	/**
	* Returns the Spring bean ID for this bean.
	*
	* @return the Spring bean ID for this bean
	*/
	public static java.lang.String getBeanIdentifier() {
		return getService().getBeanIdentifier();
	}

	/**
	* Sets the Spring bean ID for this bean.
	*
	* @param beanIdentifier the Spring bean ID for this bean
	*/
	public static void setBeanIdentifier(java.lang.String beanIdentifier) {
		getService().setBeanIdentifier(beanIdentifier);
	}

	public static com.liferay.wsrp.model.WSRPProducer addWSRPProducer(
		long userId, long groupId, java.lang.String name,
		java.lang.String version, java.lang.String portletIds,
		com.liferay.portal.service.ServiceContext serviceContext)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService()
				   .addWSRPProducer(userId, groupId, name, version, portletIds,
			serviceContext);
	}

	public static com.liferay.wsrp.model.WSRPProducer addWSRPProducer(
		long userId, java.lang.String name, java.lang.String version,
		java.lang.String portletIds,
		com.liferay.portal.service.ServiceContext serviceContext)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService()
				   .addWSRPProducer(userId, name, version, portletIds,
			serviceContext);
	}

	public static com.liferay.wsrp.model.WSRPProducer getWSRPProducer(
		java.lang.String wsrpProducerUuid)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService().getWSRPProducer(wsrpProducerUuid);
	}

	public static java.util.List<com.liferay.wsrp.model.WSRPProducer> getWSRPProducers(
		long companyId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().getWSRPProducers(companyId, start, end);
	}

	public static int getWSRPProducersCount(long companyId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getService().getWSRPProducersCount(companyId);
	}

	public static com.liferay.wsrp.model.WSRPProducer updateWSRPProducer(
		long wsrpProducerId, java.lang.String name, java.lang.String version,
		java.lang.String portletIds)
		throws com.liferay.portal.kernel.exception.PortalException,
			com.liferay.portal.kernel.exception.SystemException {
		return getService()
				   .updateWSRPProducer(wsrpProducerId, name, version, portletIds);
	}

	public static void clearService() {
		_service = null;
	}

	public static WSRPProducerLocalService getService() {
		if (_service == null) {
			Object object = PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(),
					WSRPProducerLocalService.class.getName());
			ClassLoader portletClassLoader = (ClassLoader)PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(),
					"portletClassLoader");

			ClassLoaderProxy classLoaderProxy = new ClassLoaderProxy(object,
					WSRPProducerLocalService.class.getName(), portletClassLoader);

			_service = new WSRPProducerLocalServiceClp(classLoaderProxy);

			ClpSerializer.setClassLoader(portletClassLoader);

			ReferenceRegistry.registerReference(WSRPProducerLocalServiceUtil.class,
				"_service");
			MethodCache.remove(WSRPProducerLocalService.class);
		}

		return _service;
	}

	public void setService(WSRPProducerLocalService service) {
		MethodCache.remove(WSRPProducerLocalService.class);

		_service = service;

		ReferenceRegistry.registerReference(WSRPProducerLocalServiceUtil.class,
			"_service");
		MethodCache.remove(WSRPProducerLocalService.class);
	}

	private static WSRPProducerLocalService _service;
}