text:
require 'CloudServer'

# OCA
include OpenNebula

# OCCI libs
require 'VirtualMachineOCCI'
require 'VirtualMachinePoolOCCI'
require 'VirtualNetworkOCCI'
require 'VirtualNetworkPoolOCCI'
require 'ImageOCCI'
require 'ImagePoolOCCI'
require 'UserOCCI'
require 'UserPoolOCCI'

require 'OpenNebulaVNC'

require 'pp'

##############################################################################
# The OCCI Server provides an OCCI implementation based on the
# OpenNebula Engine
##############################################################################

COLLECTIONS = ["compute", "instance_type", "network", "storage", "user"]

# FLAG that will filter the elements retrieved from the Pools
POOL_FILTER = Pool::INFO_ALL

# Secs to sleep between checks to see if image upload&copy to repo is finished
IMAGE_POLL_SLEEP_TIME = 5

class OCCIServer < CloudServer
    # Server initializer
    # config_file:: _String_ path of the config file
    # template:: _String_ path to the location of the templates
    def initialize(client, config, logger)
        super(config, logger)

        if config[:ssl_server]
            @base_url=config[:ssl_server]
        else
            @base_url="http://#{config[:server]}:#{config[:port]}"
        end

        @client = client
    end

    # Prepare the OCCI XML Response
    # resource:: _Pool_ or _PoolElement_ that represents a OCCI resource
    # [return] _String_,_Integer_ Resource Representation or error, status code
    def to_occi_xml(resource, opts)
        xml_response = resource.to_occi(@base_url, opts[:verbose])
        return xml_response, 500 if OpenNebula.is_error?(xml_response)

        return xml_response, opts[:code]
    end

    ############################################################################
    ############################################################################
    #                      POOL RESOURCE METHODS
    ############################################################################
    ############################################################################

    def get_collections(request)
        xml_resp = "<COLLECTIONS>"

        COLLECTIONS.sort.each { |c|
            xml_resp << "<#{c.upcase}_COLLECTION href=\"#{@base_url}/#{c}\"/>"
        }

        xml_resp << "</COLLECTIONS>"

        return xml_resp, 200
    end

    INSTANCE_TYPE = %q{
        <INSTANCE_TYPE href="<%= @base_url %>/instance_type/<%=name%>" name="<%= name %>">
            <ID><%= name.to_s %></ID>
            <NAME><%= name.to_s %></NAME>
        <% opts.sort{|k1,k2| k1[0].to_s<=>k2[0].to_s}.each { |elem, value|
            next if elem==:template
            str = elem.to_s.upcase %>
            <<%= str %>><%= value %></<%= str %>>
        <% } %>
        </INSTANCE_TYPE>
    }

    def get_instance_types(request)
        xml_resp = "<INSTANCE_TYPE_COLLECTION>"

        @config[:instance_types].sort { |k1,k2|
            k1[0].to_s<=>k2[0].to_s
        }.each { |name, opts|
            if request.params['verbose']
                begin
                    occi_it = ERB.new(INSTANCE_TYPE)
                    occi_it = occi_it.result(binding)
                rescue Exception => e
                    error = OpenNebula::Error.new(e.message)
                    return error, CloudServer::HTTP_ERROR_CODE[error.errno]
                end

                xml_resp << occi_it.gsub(/\n\s*/,'')
            else
                xml_resp << "<INSTANCE_TYPE href=\"#{@base_url}/instance_type/#{name.to_s}\"  name=\"#{name}\"/>"
            end
        }

        xml_resp << "</INSTANCE_TYPE_COLLECTION>"

        return xml_resp, 200
    end

    def get_instance_type(request, params)
        name = params[:id].to_sym
        unless @config[:instance_types].keys.include?(name)
            error = OpenNebula::Error.new("INSTANCE_TYPE #{name} not found")
            return error, 404
        else
            opts = @config[:instance_types][name]
            begin
                occi_it = ERB.new(INSTANCE_TYPE)
                occi_it = occi_it.result(binding)
            rescue Exception => e
                error = OpenNebula::Error.new(e.message)
                return error, CloudServer::HTTP_ERROR_CODE[error.errno]
            end

            return occi_it.gsub(/\n\s*/,''), 200
        end
    end

    # Gets the pool representation of COMPUTES
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Pool Representation or error, status code
    def get_computes(request)
        # --- Get User's VMs ---
        vmpool = VirtualMachinePoolOCCI.new(
                        @client,
                        POOL_FILTER)

        # --- Prepare XML Response ---
        rc = vmpool.info
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        return to_occi_xml(vmpool, :code=>200, :verbose=>request.params['verbose'])
    end

    # Gets the pool representation of NETWORKS
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Network pool representation or error,
    # =>                          status code
    def get_networks(request)
        # --- Get User's VNETs ---
        network_pool = VirtualNetworkPoolOCCI.new(
                            @client,
                            POOL_FILTER)

        # --- Prepare XML Response ---
        rc = network_pool.info
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        return to_occi_xml(network_pool, :code=>200, :verbose=>request.params['verbose'])
    end

    # Gets the pool representation of STORAGES
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Image pool representation or error,
    #                             status code
    def get_storages(request)
        # --- Get User's Images ---
        image_pool = ImagePoolOCCI.new(
                            @client,
                            POOL_FILTER)

        # --- Prepare XML Response ---
        rc = image_pool.info
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        return to_occi_xml(image_pool, :code=>200, :verbose=>request.params['verbose'])
    end

    # Gets the pool representation of USERs
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ User pool representation or error,
    #                             status code
    def get_users(request)
        # --- Get Users Pool ---
        user_pool = UserPoolOCCI.new(@client)

        # --- Prepare XML Response ---
        rc = user_pool.info
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        return to_occi_xml(user_pool, :code=>200, :verbose=>request.params['verbose'])
    end

    ############################################################################
    ############################################################################
    #                      ENTITY RESOURCE METHODS
    ############################################################################
    ############################################################################

    ############################################################################
    # COMPUTE Methods
    ############################################################################

    # Post a new compute to the COMPUTE pool
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ COMPUTE Representation or error, status code
    def post_compute(request)
        # --- Create the new Instance ---
        vm = VirtualMachineOCCI.new(
                    VirtualMachine.build_xml,
                    @client,
                    request.body.read,
                    @config[:instance_types],
                    @config[:template_location])

        # --- Generate the template and Allocate the new Instance ---
        template = vm.to_one_template
        return template, 500 if OpenNebula.is_error?(template)

        rc = vm.allocate(template)
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        # --- Prepare XML Response ---
        vm.info
        return to_occi_xml(vm, :code=>201)
    end

    # Get the representation of a COMPUTE resource
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ COMPUTE representation or error,
    #                             status code
    def get_compute(request, params)
        # --- Get the VM ---
        vm = VirtualMachineOCCI.new(
                    VirtualMachine.build_xml(params[:id]),
                    @client)

        # --- Prepare XML Response ---
        rc = vm.info
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        return to_occi_xml(vm, :code=>200)
    end

    # Deletes a COMPUTE resource
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Delete confirmation msg or error,
    #                             status code
    def delete_compute(request, params)
        # --- Get the VM ---
        vm = VirtualMachineOCCI.new(
                    VirtualMachine.build_xml(params[:id]),
                    @client)

        # --- Finalize the VM ---
        result = vm.finalize
        if OpenNebula.is_error?(result)
            return result, CloudServer::HTTP_ERROR_CODE[result.errno]
        end

        return "", 204
    end

    # Updates a COMPUTE resource
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Update confirmation msg or error,
    #                             status code
    def put_compute(request, params)
        # --- Get the VM ---
        vm = VirtualMachineOCCI.new(
                    VirtualMachine.build_xml(params[:id]),
                    @client)

        rc = vm.info
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        result, code = vm.update_from_xml(request.body)

        if OpenNebula.is_error?(result)
            return result, code
        else
            vm.info
            return to_occi_xml(vm, :code=>code)
        end
    end

    ############################################################################
    # NETWORK Methods
    ############################################################################

    # Post a new network to the NETWORK pool
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Network Representation or error, status code
    def post_network(request)
        # --- Create the new Instance ---
        network = VirtualNetworkOCCI.new(
                        VirtualNetwork.build_xml,
                        @client,
                        request.body,
                        @config[:template_location])

        # --- Generate the template and Allocate the new Instance ---
        template = network.to_one_template
        return template, 500 if OpenNebula.is_error?(template)

        rc = network.allocate(template, @config[:cluster_id]||ClusterPool::NONE_CLUSTER_ID)
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        # --- Prepare XML Response ---
        network.info
        return to_occi_xml(network, :code=>201)
    end

    # Retrieves a NETWORK resource
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ NETWORK occi representation or error,
    #                             status code
    def get_network(request, params)
        network = VirtualNetworkOCCI.new(
                        VirtualNetwork.build_xml(params[:id]),
                        @client)

        # --- Prepare XML Response ---
        rc = network.info
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        return to_occi_xml(network, :code=>200)
    end

    # Deletes a NETWORK resource
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Delete confirmation msg or error,
    #                             status code
    def delete_network(request, params)
        network = VirtualNetworkOCCI.new(
                        VirtualNetwork.build_xml(params[:id]),
                        @client)

        # --- Delete the VNET ---
        rc = network.delete
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        return "", 204
    end

    # Updates a NETWORK resource
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Update confirmation msg or error,
    #                             status code
    def put_network(request, params)
        xmldoc    = XMLElement.build_xml(request.body, 'NETWORK')
        vnet_info = XMLElement.new(xmldoc) if xmldoc != nil

        vnet = VirtualNetworkOCCI.new(
                    VirtualNetwork.build_xml(params[:id]),
                    @client)

        rc = nil
        if vnet_info['PUBLIC'] == 'YES'
            rc = vnet.publish
        elsif vnet_info['PUBLIC'] == 'NO'
            rc = vnet.unpublish
        end

        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        # --- Prepare XML Response ---
        vnet.info
        return to_occi_xml(vnet, :code=>202)
    end

    ############################################################################
    # STORAGE Methods
    ############################################################################

    # Post a new image to the STORAGE pool
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Image representation or error, status code
    def post_storage(request)
        # --- Check OCCI XML from POST ---
        if request.params['occixml'] == nil
            error_msg = "OCCI XML representation of Image" +
                        " not present in the request"
            error = OpenNebula::Error.new(error_msg)
            return error, 400
        end

        # --- Create and Add the new Image ---
        occixml = request.params['occixml']
        occixml = occixml[:tempfile].read if occixml.class == Hash

        image = ImageOCCI.new(
                        Image.build_xml,
                        @client,
                        occixml,
                        request.params['file'])

        # --- Generate the template and Allocate the new Instance ---
        template = image.to_one_template
        return template, 500 if OpenNebula.is_error?(template)

        rc = image.allocate(template, @config[:datastore_id]||1)
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        image.info
        #wait until image is ready to return
        while (image.state_str == 'LOCKED') && (image['RUNNING_VMS'] == '0') do
            sleep IMAGE_POLL_SLEEP_TIME
            image.info
        end

        # --- Prepare XML Response ---
        return to_occi_xml(image, :code=>201)
    end

    # Get a STORAGE resource
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ STORAGE occi representation or error,
    #                             status code
    def get_storage(request, params)
        # --- Get the Image ---
        image = ImageOCCI.new(
                        Image.build_xml(params[:id]),
                        @client)

        rc = image.info
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        # --- Prepare XML Response ---
        return to_occi_xml(image, :code=>200)
    end

    # Deletes a STORAGE resource (Not yet implemented)
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Delete confirmation msg or error,
    #                             status code
    def delete_storage(request, params)
        # --- Get the Image ---
        image = ImageOCCI.new(
                        Image.build_xml(params[:id]),
                        @client)

        # --- Delete the Image ---
        rc = image.delete
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        return "", 204
    end

    # Updates a STORAGE resource
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ Update confirmation msg or error,
    #                             status code
    def put_storage(request, params)
        xmldoc     = XMLElement.build_xml(request.body, 'STORAGE')
        image_info = XMLElement.new(xmldoc) if xmldoc != nil

        image = ImageOCCI.new(
                    Image.build_xml(params[:id]),
                    @client)

        rc = nil
        if image_info['PERSISTENT'] && image_info['PUBLIC']
            error_msg = "It is not allowed more than one change per request"
            return OpenNebula::Error.new(error_msg), 400
        elsif image_info['PERSISTENT'] == 'YES'
            rc = image.persistent
        elsif image_info['PERSISTENT'] == 'NO'
            rc = image.nonpersistent
        elsif image_info['PUBLIC'] == 'YES'
            rc = image.publish
        elsif image_info['PUBLIC'] == 'NO'
            rc = image.unpublish
        end

        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        # --- Prepare XML Response ---
        image.info
        return to_occi_xml(image, :code=>202)
    end

    # Get the representation of a USER
    # request:: _Hash_ hash containing the data of the request
    # [return] _String_,_Integer_ USER representation or error,
    #                             status code
    def get_user(request, params)
        # --- Get the USER ---
        user = UserOCCI.new(
                    User.build_xml(params[:id]),
                    @client)

        # --- Prepare XML Response ---
        rc = user.info
        if OpenNebula.is_error?(rc)
            return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]
        end

        return to_occi_xml(user, :code=>200)
    end

    ############################################################################
    # VNC Methods
    ############################################################################

    def startvnc(id,config)
        vm = VirtualMachineOCCI.new(VirtualMachine.build_xml(id), @client)
        rc = vm.info

        if OpenNebula.is_error?(rc)
            error =  "Error starting VNC session, "
            error << "could not retrieve Virtual Machine"
            return [404, error]
        end

        vnc_proxy = OpenNebulaVNC.new(config, logger, {:json_errors => false})
        return vnc_proxy.start(vm)
    end

    def stopvnc(pipe)
        begin
            OpenNebulaVNC.stop(pipe)
        rescue Exception => e
            logger.error {e.message}
            return [500, "Error stopping VNC. Please check server logs."]
        end

        return [200,nil]
    end
end


text:
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require 'coveralls'
Coveralls.wear_merged! 'rails'

ENV['CUCUMBER'] = 'cucumber'

require 'cucumber/rails'
require 'cucumber/rspec/doubles'
require 'capybara/poltergeist'
require 'capybara-screenshot/cucumber'
require 'geocoder/lookups/base'
require 'geocoder/results/freegeoip'
require 'webmock/cucumber'
require 'delorean'
require 'billy/cucumber'

WebMock.disable_net_connect!(allow_localhost: true)

OmniAuth.config.logger.level = Logger::WARN

Capybara.javascript_driver = :poltergeist_billy

Billy.configure do |c|
  c.cache = true
  c.ignore_params = ['http://maps.googleapis.com/maps/gen_204',
                     'http://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate',
                     'http://csi.gstatic.com/csi',
                     'http://maps.gstatic.com/mapfiles/openhand_8_8.cur',
                     'http://www.google-analytics.com/collect',
                     'http://www.google-analytics.com/r/collect',
                     'http://www.google-analytics.com/__utm.gif',
  ]
  c.persist_cache = true
  c.cache_path = 'features/req_cache/'
end
Billy.proxy.reset_cache

Capybara.default_max_wait_time = 5

test_options = {
    timeout: 20,
    phantomjs_options: ['--ignore-ssl-errors=yes', "--proxy=#{Billy.proxy.host}:#{Billy.proxy.port}"],
    phantomjs: Phantomjs.path
}

debug_options = {
    inspector: true,
    timeout: 10,
    phantomjs_options: ["--proxy=#{Billy.proxy.host}:#{Billy.proxy.port}"],
    phantomjs: Phantomjs.path
}

Capybara.register_driver :poltergeist_billy do |app|
  Capybara::Poltergeist::Driver.new app, test_options
end

Capybara.register_driver :poltergeist_billy_debug do |app|
  Capybara::Poltergeist::Driver.new app, debug_options
end

ActionController::Base.allow_rescue = false

Cucumber::Rails::Database.javascript_strategy = :truncation

Geocoder.configure(ip_lookup: :test)
Geocoder::Lookup::Test.add_stub(
    '127.0.0.1', [
    {
        ip: '127.0.0.1',
        country_code: 'SE',
        country_name: 'Sweden',
        region_code: '28',
        region_name: 'Västra Götaland',
        city: 'Alingsås',
        zipcode: '44139',
        latitude: 57.9333,
        longitude: 12.5167,
        metro_code: '',
        areacode: ''
    }.as_json
]
)

Before do
  Settings.reload!
end

redpajama_set_name: RedPajamaGithub


text:
hbase: this is a mirror copy of hbase-branch-0.94 from http://svn.apache.org/repos/asf/hbase/branches/0.94/ r1595266
=====

1.mvn instlal

mvn -Dmaven.test.skip.exec=true clean install

2.mvn package

mvn -Dmaven.test.skip.exec=true clean package


text:
<?php

class Google_Service_Analytics_McfData extends Google_Collection
{
  protected $collection_key = 'rows';
  protected $columnHeadersType = 'Google_Service_Analytics_McfDataColumnHeaders';
  protected $columnHeadersDataType = 'array';
  public $containsSampledData;
  public $id;
  public $itemsPerPage;
  public $kind;
  public $nextLink;
  public $previousLink;
  protected $profileInfoType = 'Google_Service_Analytics_McfDataProfileInfo';
  protected $profileInfoDataType = '';
  protected $queryType = 'Google_Service_Analytics_McfDataQuery';
  protected $queryDataType = '';
  protected $rowsType = 'Google_Service_Analytics_McfDataRows';
  protected $rowsDataType = 'array';
  public $sampleSize;
  public $sampleSpace;
  public $selfLink;
  public $totalResults;
  public $totalsForAllResults;

  public function setColumnHeaders($columnHeaders)
  {
    $this->columnHeaders = $columnHeaders;
  }
  public function getColumnHeaders()
  {
    return $this->columnHeaders;
  }
  public function setContainsSampledData($containsSampledData)
  {
    $this->containsSampledData = $containsSampledData;
  }
  public function getContainsSampledData()
  {
    return $this->containsSampledData;
  }
  public function setId($id)
  {
    $this->id = $id;
  }
  public function getId()
  {
    return $this->id;
  }
  public function setItemsPerPage($itemsPerPage)
  {
    $this->itemsPerPage = $itemsPerPage;
  }
  public function getItemsPerPage()
  {
    return $this->itemsPerPage;
  }
  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  public function getKind()
  {
    return $this->kind;
  }
  public function setNextLink($nextLink)
  {
    $this->nextLink = $nextLink;
  }
  public function getNextLink()
  {
    return $this->nextLink;
  }
  public function setPreviousLink($previousLink)
  {
    $this->previousLink = $previousLink;
  }
  public function getPreviousLink()
  {
    return $this->previousLink;
  }
  public function setProfileInfo(Google_Service_Analytics_McfDataProfileInfo $profileInfo)
  {
    $this->profileInfo = $profileInfo;
  }
  public function getProfileInfo()
  {
    return $this->profileInfo;
  }
  public function setQuery(Google_Service_Analytics_McfDataQuery $query)
  {
    $this->query = $query;
  }
  public function getQuery()
  {
    return $this->query;
  }
  public function setRows($rows)
  {
    $this->rows = $rows;
  }
  public function getRows()
  {
    return $this->rows;
  }
  public function setSampleSize($sampleSize)
  {
    $this->sampleSize = $sampleSize;
  }
  public function getSampleSize()
  {
    return $this->sampleSize;
  }
  public function setSampleSpace($sampleSpace)
  {
    $this->sampleSpace = $sampleSpace;
  }
  public function getSampleSpace()
  {
    return $this->sampleSpace;
  }
  public function setSelfLink($selfLink)
  {
    $this->selfLink = $selfLink;
  }
  public function getSelfLink()
  {
    return $this->selfLink;
  }
  public function setTotalResults($totalResults)
  {
    $this->totalResults = $totalResults;
  }
  public function getTotalResults()
  {
    return $this->totalResults;
  }
  public function setTotalsForAllResults($totalsForAllResults)
  {
    $this->totalsForAllResults = $totalsForAllResults;
  }
  public function getTotalsForAllResults()
  {
    return $this->totalsForAllResults;
  }
}


text:
namespace SoukeyNetget
{
    partial class frmUrlEncoding
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmUrlEncoding));
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.comWebCode = new System.Windows.Forms.ComboBox();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            //
            // textBox1
            //
            this.textBox1.AccessibleDescription = null;
            this.textBox1.AccessibleName = null;
            resources.ApplyResources(this.textBox1, "textBox1");
            this.textBox1.BackgroundImage = null;
            this.textBox1.Font = null;
            this.textBox1.Name = "textBox1";
            //
            // comWebCode
            //
            this.comWebCode.AccessibleDescription = null;
            this.comWebCode.AccessibleName = null;
            resources.ApplyResources(this.comWebCode, "comWebCode");
            this.comWebCode.BackgroundImage = null;
            this.comWebCode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comWebCode.Font = null;
            this.comWebCode.FormattingEnabled = true;
            this.comWebCode.Name = "comWebCode";
            //
            // button1
            //
            this.button1.AccessibleDescription = null;
            this.button1.AccessibleName = null;
            resources.ApplyResources(this.button1, "button1");
            this.button1.BackgroundImage = null;
            this.button1.Font = null;
            this.button1.Name = "button1";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // button2
            //
            this.button2.AccessibleDescription = null;
            this.button2.AccessibleName = null;
            resources.ApplyResources(this.button2, "button2");
            this.button2.BackgroundImage = null;
            this.button2.Font = null;
            this.button2.Name = "button2";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // textBox2
            //
            this.textBox2.AccessibleDescription = null;
            this.textBox2.AccessibleName = null;
            resources.ApplyResources(this.textBox2, "textBox2");
            this.textBox2.BackgroundImage = null;
            this.textBox2.Font = null;
            this.textBox2.Name = "textBox2";
            //
            // frmUrlEncoding
            //
            this.AccessibleDescription = null;
            this.AccessibleName = null;
            resources.ApplyResources(this, "$this");
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackgroundImage = null;
            this.Controls.Add(this.textBox2);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.comWebCode);
            this.Controls.Add(this.textBox1);
            this.Font = null;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "frmUrlEncoding";
            this.ShowInTaskbar = false;
            this.TopMost = true;
            this.Load += new System.EventHandler(this.frmUrlEncoding_Load);
            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmUrlEncoding_FormClosed);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.ComboBox comWebCode;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.TextBox textBox2;
    }
}


text:
package hrytsenko.gscripts;

import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.ExpectedSystemExit;

import com.google.common.collect.ImmutableMap;

import hrytsenko.gscripts.io.CsvFiles;
import hrytsenko.gscripts.io.XlsFiles;
import hrytsenko.gscripts.util.IOHelper;
import hrytsenko.gscripts.util.IOHelper.Load;

public class AppTest {

    @Rule
    public final ExpectedSystemExit exitRule = ExpectedSystemExit.none();

    @Test
    public void main_emptyArgs_exitWithError() {
        exitRule.expectSystemExitWithStatus(-1);

        App.main(args());
    }

    @Test
    public void main_scritWithError_exitWithError() {
        exitRule.expectSystemExitWithStatus(-1);

        App.main(args("-s", resource("script/ExceptionTest.groovy")));
    }

    @Test
    public void main_scriptForCsv_executeScript() {
        execute("script/CsvFilesTest.groovy", "data/tickers.csv", CsvFiles::loadCsv);
    }

    @Test
    public void main_scriptForXls_executeScript() {
        execute("script/XlsFilesTest.groovy", "data/tickers.xlsx", XlsFiles::loadXls);
    }

    private void execute(String scriptFile, String inputFile, Load load) {
        Path outputFile = IOHelper.createTemporaryFile();

        exitRule.expectSystemExitWithStatus(0);
        assertRecordsAfterExit(expectedRecords(), load, outputFile);

        App.main(args("-s", resource(scriptFile), "-a", resource(inputFile), outputFile));
    }

    private void assertRecordsAfterExit(List<Map<String, String>> expected, Load load, Path pathToOutput) {
        exitRule.checkAssertionAfterwards(() -> Assert.assertEquals(expected, IOHelper.load(load, pathToOutput)));
    }

    private static String[] args(Object... args) {
        return Arrays.stream(args).map(Object::toString).toArray(size -> new String[size]);
    }

    private static Path resource(String resourceName) {
        return IOHelper.pathToResource(resourceName);
    }

    private static List<Map<String, String>> expectedRecords() {
        return Arrays.asList(ImmutableMap.of("ticker", "GOOG", "exchange", "NASDAQ"));
    }

}


text:
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class ExcelHandler {
	public void dataExtract (HSSFWorkbook  workbook,String name) throws Exception{
		HSSFSheet sheet 		 = workbook.getSheetAt(0);
		Iterator rIterator  	 = sheet.rowIterator();
		List<String> columnNames = new ArrayList<>();
		List<String> datalist    = new ArrayList<>();
		int flag 				 = 0;
		DBWriter dbWriter 		 =  new DBWriter();

        while(rIterator.hasNext())
        {
        	HSSFRow row = (HSSFRow) rIterator.next();
        	Iterator cellIterator = row.cellIterator();
        	while(cellIterator.hasNext())
            {
        		HSSFCell  cell =(HSSFCell ) cellIterator.next();
        		System.out.println(cell.getStringCellValue());
        		if(flag==0){
        			columnNames.add(cell.getStringCellValue());
        		}else
        			datalist.add(cell.getStringCellValue());
            }
        	if(flag==0){
        		dbWriter.createTable(columnNames, name);
        	}else
        		dbWriter.writeData(datalist, name);
        	flag=1;
        }

	}
}


text:
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System.Threading;

using Xunit;

namespace System.Net.Sockets.Tests
{
    public class IPPacketInformationTest
    {
        [Fact]
        public void Equals_DefaultValues_Success()
        {
            Assert.Equal(default(IPPacketInformation), default(IPPacketInformation));
            Assert.True(default(IPPacketInformation) == default(IPPacketInformation));
            Assert.False(default(IPPacketInformation) != default(IPPacketInformation));
        }

        [Fact]
        public void GetHashCode_DefaultValues_Success()
        {
            Assert.Equal(default(IPPacketInformation).GetHashCode(), default(IPPacketInformation).GetHashCode());
        }

        [Fact]
        public void Equals_NonDefaultValue_Success()
        {
            IPPacketInformation packetInfo = GetNonDefaultIPPacketInformation();
            IPPacketInformation packetInfoCopy = packetInfo;

            Assert.Equal(packetInfo, packetInfoCopy);
            Assert.True(packetInfo == packetInfoCopy);
            Assert.False(packetInfo != packetInfoCopy);

            Assert.NotEqual(packetInfo, default(IPPacketInformation));
            Assert.False(packetInfo == default(IPPacketInformation));
            Assert.True(packetInfo != default(IPPacketInformation));
        }

        [Fact]
        public void GetHashCode_NonDefaultValue_Succes()
        {
            IPPacketInformation packetInfo = GetNonDefaultIPPacketInformation();

            Assert.Equal(packetInfo.GetHashCode(), packetInfo.GetHashCode());
        }

        private IPPacketInformation GetNonDefaultIPPacketInformation()
        {
            const int ReceiveTimeout = 5000;

            using (var receiver = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp))
            using (var sender = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp))
            {
                int port = receiver.BindToAnonymousPort(IPAddress.Loopback);

                var waitHandle = new ManualResetEvent(false);

                SocketAsyncEventArgs receiveArgs = new SocketAsyncEventArgs {
                    RemoteEndPoint = new IPEndPoint(IPAddress.Loopback, port),
                    UserToken = waitHandle
                };

                receiveArgs.SetBuffer(new byte[1], 0, 1);
                receiveArgs.Completed += (_, args) => ((ManualResetEvent)args.UserToken).Set();

                Assert.True(receiver.ReceiveMessageFromAsync(receiveArgs));

                // Send a few packets, in case they aren't delivered reliably.
                for (int i = 0; i < TestSettings.UDPRedundancy; i++)
                {
                    sender.SendTo(new byte[1], new IPEndPoint(IPAddress.Loopback, port));
                }

                Assert.True(waitHandle.WaitOne(ReceiveTimeout));

                return receiveArgs.ReceiveMessageFromPacketInfo;
            }
        }
    }
}


text:
"use strict";

module.exports = function (conditions) {
  return function () {
    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    for (var _iterator = conditions, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
      var _ref;
      if (_isArray) {
        if (_i >= _iterator.length) break;
        _ref = _iterator[_i++];
      } else {
        _i = _iterator.next();
        if (_i.done) break;
        _ref = _i.value;
      }
      var condition = _ref;
      if (condition[0].apply(null, args) === true) return condition[1].apply(null, args);
    }
  };
};


text:
require 'spec_helper'

describe ENUtils::Tag do
  let(:edam) { build(:edam_tag) }
  let(:core) { build(:core) }
  let(:tag) { ENUtils::Tag.new(core, edam) }

  before do
    allow_any_instance_of(Evernote::EDAM::UserStore::UserStore::Client)
      .to receive(:getNoteStoreUrl).and_return('notestoreurl')
    tag
  end

  it { expect(edam).to be_instance_of Evernote::EDAM::Type::Tag }
  it { expect(tag.name).to be_instance_of String }

  describe '#notes' do
    before do
      allow(core).to receive_message_chain(:notestore, :findNotes, :notes, :map)
        .and_return([])
    end
    it { expect(tag.notes).to be_instance_of ENUtils::NoteList }
  end

  describe '.find_by_guid' do
    before do
      allow(core).to receive_message_chain(:notestore, :listTags, :find)
        .and_return(build(:edam_tag))
    end
    it { expect(ENUtils::Tag.find_by_guid(core, 'guidddd')).to be_instance_of ENUtils::Tag }
  end

  describe '.find_by_name' do
    before do
      allow(core).to receive_message_chain(:notestore, :listTags)
        .and_return([build(:edam_tag, name: 'book')])
    end
    it { expect(ENUtils::Tag.find_by_name(core, 'book')).to be_instance_of ENUtils::Tag }
  end

  describe '.where' do
    before do
      allow(core).to receive_message_chain(:notestore, :listTags)
        .and_return([build(:edam_tag, name: 'book')])
    end
    subject { ENUtils::Tag.where(core, options) }
    [/oo/, 'book'].each do |name|
      let(:options) { {name: name} }
      it { expect(subject).to be_instance_of Array }
      it { expect(subject.first).to be_instance_of ENUtils::Tag }
    end
  end

end


text:
namespace NVelocity.Util.Introspection
{
    using System;
    using System.Linq.Expressions;
    using System.Reflection;

    /// <summary>
    ///
    /// </summary>
    public interface IPropertyAccessor
    {
        /// <summary>
        ///
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        object GetValue(object instance);
    }

    /// <summary>
    ///
    /// </summary>
    public class PropertyAccessor : IPropertyAccessor
    {
        private Func<object, object> m_getter;

        /// <summary>
        ///
        /// </summary>
        public PropertyInfo PropertyInfo { get; private set; }

        /// <summary>
        ///
        /// </summary>
        /// <param name="propertyInfo"></param>
        public PropertyAccessor(PropertyInfo propertyInfo)
        {
            this.PropertyInfo = propertyInfo;
            this.InitializeGet(propertyInfo);
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="propertyInfo"></param>
        private void InitializeGet(PropertyInfo propertyInfo)
        {
            if (!propertyInfo.CanRead) return;

            // Target: (object)(((TInstance)instance).Property)

            // preparing parameter, object type
            var instance = Expression.Parameter(typeof(object), "instance");

            // non-instance for static method, or ((TInstance)instance)
            var instanceCast = propertyInfo.GetGetMethod(true).IsStatic ? null :
                Expression.Convert(instance, propertyInfo.ReflectedType);

            // ((TInstance)instance).Property
            var propertyAccess = Expression.Property(instanceCast, propertyInfo);

            // (object)(((TInstance)instance).Property)
            var castPropertyValue = Expression.Convert(propertyAccess, typeof(object));

            // Lambda expression
            var lambda = Expression.Lambda<Func<object, object>>(castPropertyValue, instance);

            this.m_getter = lambda.Compile();
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="o"></param>
        /// <returns></returns>
        public object GetValue(object o)
        {
            if (this.m_getter == null)
            {
                throw new NotSupportedException("Get method is not defined for this property.");
            }

            return this.m_getter(o);
        }

        #region IPropertyAccessor Members

        /// <summary>
        ///
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        object IPropertyAccessor.GetValue(object instance)
        {
            return this.GetValue(instance);
        }

        #endregion
    }
}


text:
package com.cloudera.hue.livy.spark.interactive

import java.net.URL

import com.cloudera.hue.livy.Logging
import com.cloudera.hue.livy.sessions.interactive.InteractiveSession
import com.cloudera.hue.livy.spark.SparkProcess

import scala.annotation.tailrec
import scala.concurrent.Future

object InteractiveSessionProcess extends Logging {

  def apply(id: Int,
            process: SparkProcess,
            createInteractiveRequest: CreateInteractiveRequest): InteractiveSession = {
    new InteractiveSessionProcess(id, process, createInteractiveRequest)
  }
}

private class InteractiveSessionProcess(id: Int,
                                        process: SparkProcess,
                                        request: CreateInteractiveRequest)
  extends InteractiveWebSession(id, process, request) {

  val stdoutThread = new Thread {
    override def run() = {
      val regex = """Starting livy-repl on (https?://.*)""".r

      val lines = process.inputIterator

      // Loop until we find the ip address to talk to livy-repl.
      @tailrec
      def readUntilURL(): Unit = {
        if (lines.hasNext) {
          val line = lines.next()

          line match {
            case regex(url_) => url = new URL(url_)
            case _ => readUntilURL()
          }
        }
      }

      readUntilURL()
    }
  }

  stdoutThread.setName("process session stdout reader")
  stdoutThread.setDaemon(true)
  stdoutThread.start()

  override def stop(): Future[Unit] = {
    super.stop().andThen { case r =>
      stdoutThread.join()
      r
    }
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--

-->
<resources>

	<!-- ### COLLECTION ======================================================================== -->

	<!-- Style for ListView widget. -->
	<style name="Ui.Widget.ListView" parent="Ui.Base.Widget.ListView">
		<item name="android:listSelector">?attr/uiCollectionItemBackground</item>
		<item name="uiPullDistanceFraction">0.25</item>
		<item name="uiRefreshDistance">144dp</item>
		<item name="uiRefreshPosition">0.5</item>
		<item name="uiRefreshSettlePosition">0.5</item>
	</style>

	<!-- Light style for ListView widget. -->
	<style name="Ui.Widget.Light.ListView" parent="Ui.Widget.ListView"/>

	<!-- Style for drop down ListView widget. -->
	<style name="Ui.Widget.ListView.DropDown" parent="Ui.Base.Widget.ListView.DropDown">
		<item name="android:listSelector">?attr/uiCollectionItemBackground</item>
		<item name="android:divider">@null</item>
		<item name="android:dividerHeight">0dp</item>
	</style>

	<!-- Light style for drop down ListView widget. -->
	<style name="Ui.Widget.Light.ListView.DropDown" parent="Ui.Widget.ListView.DropDown"/>

	<!-- Style for GridView widget. -->
	<style name="Ui.Widget.GridView" parent="Ui.Base.Widget.GridView">
		<item name="android:numColumns">auto_fit</item>
		<item name="android:listSelector">?attr/uiCollectionItemBackground</item>
		<item name="uiPullDistanceFraction">0.25</item>
		<item name="uiRefreshDistance">144dp</item>
		<item name="uiRefreshPosition">0.5</item>
		<item name="uiRefreshSettlePosition">0.5</item>
	</style>

	<!-- Light style for ListView widget. -->
	<style name="Ui.Widget.Light.GridView" parent="Ui.Widget.GridView"/>

	<!-- Style for RecyclerView widget. -->
	<style name="Ui.Widget.RecyclerView">
		<item name="uiPullDistanceFraction">0.25</item>
		<item name="uiRefreshDistance">144dp</item>
		<item name="uiRefreshPosition">0.5</item>
		<item name="uiRefreshSettlePosition">0.5</item>
	</style>

	<!-- Light style for RecyclerView widget. -->
	<style name="Ui.Widget.Light.RecyclerView" parent="Ui.Widget.RecyclerView"/>
</resources>


text:
import { Transition } from '../../transitions/transition';
export declare class LoadingPopIn extends Transition {
    init(): void;
}
export declare class LoadingPopOut extends Transition {
    init(): void;
}
export declare class LoadingMdPopIn extends Transition {
    init(): void;
}
export declare class LoadingMdPopOut extends Transition {
    init(): void;
}
export declare class LoadingWpPopIn extends Transition {
    init(): void;
}
export declare class LoadingWpPopOut extends Transition {
    init(): void;
}


text:
import React, { PropTypes } from 'react';
import Button from 'components/Button/Button';
import { reduxForm } from 'redux-form';
import styles from './styles.scss';
import { Link } from 'react-router';
import BaseLunchForm from './BaseLunchForm';

@reduxForm(
  {
    form: 'draftLunchForm',
    fields: ['cook_id', 'photos_temp_image_ids', 'initial_price', 'accept_rules', 'description',
      'dishes[].id', 'dishes[].name', 'dishes[].size', 'dishes[].dish_type', 'dishes[]._destroy',
      'removing_photos', 'dishes_count', 'photos']
    // https://github.com/erikras/redux-form/issues/621
    // https://github.com/erikras/redux-form/issues/514
    // initialValues: {
    //   dishes: [{name: '', size: ''}]
    // }
  }
)
export default class DraftLunchForm extends BaseLunchForm {
  static propTypes = {
    fields: PropTypes.object.isRequired,
    handleSubmit: PropTypes.func.isRequired,
    error: PropTypes.object,
    acceptRules: PropTypes.bool,
    submitting: PropTypes.bool,
    title: PropTypes.string.isRequired,
    sendLabel: PropTypes.string.isRequired
  };

  render() {
    const { fields, title, acceptRules, handleSubmit, submitting, sendLabel } = this.props;

    return (
      <form className={styles.root} onSubmit={handleSubmit}>

{title}

        {this.descriptionField()}
        {this.photosField()}
        {this.dishesField()}
        {this.priceField()}
        {acceptRules && this.acceptRulesField()}

          {this.submitButton(sendLabel, submitting)}
          <Link className={styles.linkButton} to={`/cooks/${fields.cook_id.value}/draft_lunches`}>
            <Button flat outlined label="К списку моих обедов"/>
          </Link>

      </form>
    );
  }
}


text:
/*
    Demo to show threads colliding
 */
package evengenerator;

import evenints.*;

/**
 *
 * @author sanket
 */
public class EvenGenerator extends IntGenerator{
    private int evenVal = 0;

    public static void main(String[] args) {
        System.out.println("EvenGenerator start");
        EvenChecker.test(new EvenGenerator(), 8);
    }

    @Override
    public int next() {
        // Silly way to increment so as to induce
        // errors

        ++evenVal;
        // There can be a thread switch here...so that
        // the result will be odd instead of even
        ++evenVal;

        // If we were to do
        // evenVal += 2;
        // it will run a while, but it will still eventually
        // have this issue since increment operation
        // is non-atomic!
        return evenVal;
    }

}


text:
"""
Sponge Knowledge Base
Interactive mode example
"""

from java.util.concurrent.atomic import AtomicInteger

def onInit():
    # Variables for assertions only
    sponge.setVariable("alarms", AtomicInteger(0))
    sponge.setVariable("notifications", AtomicInteger(0))

class AlarmTrigger(Trigger):
    def onConfigure(self):
        self.withEvent("alarm")
    def onRun(self, event):
        sponge.getVariable("alarms").incrementAndGet()
        print "Sound the alarm!"


text:
package org.wso2.siddhi.core.executor.condition.compare.not_equal;

import org.wso2.siddhi.core.executor.expression.ExpressionExecutor;

public class NotEqualCompareConditionExecutorLongLong extends
        NotEqualCompareConditionExecutor {

    public NotEqualCompareConditionExecutorLongLong(
            ExpressionExecutor leftExpressionExecutor,
            ExpressionExecutor rightExpressionExecutor) {
        super(leftExpressionExecutor, rightExpressionExecutor);
    }

    @Override
    protected Boolean execute(Object left, Object right) {
        return ((Long) left).longValue() != (Long) right;

    }

}


text:
package org.apache.sshd.common.forward;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.apache.sshd.client.channel.ClientChannel;
import org.apache.sshd.client.future.OpenFuture;
import org.apache.sshd.common.Closeable;
import org.apache.sshd.common.Factory;
import org.apache.sshd.common.FactoryManager;
import org.apache.sshd.common.SshConstants;
import org.apache.sshd.common.SshException;
import org.apache.sshd.common.SshdSocketAddress;
import org.apache.sshd.common.future.SshFutureListener;
import org.apache.sshd.common.io.IoAcceptor;
import org.apache.sshd.common.io.IoHandler;
import org.apache.sshd.common.io.IoHandlerFactory;
import org.apache.sshd.common.io.IoServiceFactory;
import org.apache.sshd.common.io.IoSession;
import org.apache.sshd.common.session.ConnectionService;
import org.apache.sshd.common.session.Session;
import org.apache.sshd.common.util.GenericUtils;
import org.apache.sshd.common.util.Readable;
import org.apache.sshd.common.util.ValidateUtils;
import org.apache.sshd.common.util.buffer.Buffer;
import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
import org.apache.sshd.common.util.closeable.AbstractInnerCloseable;
import org.apache.sshd.server.forward.ForwardingFilter;

/**
 * TODO Add javadoc
 *
 * @author Apache MINA SSHD Project
 */
public class DefaultTcpipForwarder extends AbstractInnerCloseable implements TcpipForwarder {

    private final ConnectionService service;
    private final IoHandlerFactory socksProxyIoHandlerFactory = new IoHandlerFactory() {
        @Override
        public IoHandler create() {
            return new SocksProxy(getConnectionService());
        }
    };
    private final Session session;
    private final Map<Integer, SshdSocketAddress> localToRemote = new HashMap<>();
    private final Map<Integer, SshdSocketAddress> remoteToLocal = new HashMap<>();
    private final Map<Integer, SocksProxy> dynamicLocal = new HashMap<>();
    private final Set<LocalForwardingEntry> localForwards = new HashSet<>();
    private final IoHandlerFactory staticIoHandlerFactory = new IoHandlerFactory() {
        @Override
        public IoHandler create() {
            return new StaticIoHandler();
        }
    };
    private IoAcceptor acceptor;

    public DefaultTcpipForwarder(ConnectionService service) {
        this.service = ValidateUtils.checkNotNull(service, "No connection service");
        this.session = ValidateUtils.checkNotNull(service.getSession(), "No session");
    }

    public final ConnectionService getConnectionService() {
        return service;
    }

    //
    // TcpIpForwarder implementation
    //

    @Override
    public synchronized SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws IOException {
        ValidateUtils.checkNotNull(local, "Local address is null");
        ValidateUtils.checkTrue(local.getPort() >= 0, "Invalid local port: %s", local);
        ValidateUtils.checkNotNull(remote, "Remote address is null");

        if (isClosed()) {
            throw new IllegalStateException("TcpipForwarder is closed");
        }
        if (isClosing()) {
            throw new IllegalStateException("TcpipForwarder is closing");
        }

        InetSocketAddress bound = doBind(local, staticIoHandlerFactory);
        int port = bound.getPort();
        SshdSocketAddress prev;
        synchronized (localToRemote) {
            prev = localToRemote.put(port, remote);
        }

        if (prev != null) {
            throw new IOException("Multiple local port forwarding bindings on port=" + port + ": current=" + remote + ", previous=" + prev);
        }

        SshdSocketAddress result = new SshdSocketAddress(bound.getHostString(), port);
        if (log.isDebugEnabled()) {
            log.debug("startLocalPortForwarding(" + local + " -> " + remote + "): " + result);
        }
        return result;
    }

    @Override
    public synchronized void stopLocalPortForwarding(SshdSocketAddress local) throws IOException {
        ValidateUtils.checkNotNull(local, "Local address is null");

        SshdSocketAddress bound;
        synchronized (localToRemote) {
            bound = localToRemote.remove(local.getPort());
        }

        if ((bound != null) && (acceptor != null)) {
            if (log.isDebugEnabled()) {
                log.debug("stopLocalPortForwarding(" + local + ") unbind " + bound);
            }
            acceptor.unbind(bound.toInetSocketAddress());
        } else {
            if (log.isDebugEnabled()) {
                log.debug("stopLocalPortForwarding(" + local + ") no mapping/acceptor for " + bound);
            }
        }
    }

    @Override
    public synchronized SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws IOException {
        ValidateUtils.checkNotNull(local, "Local address is null");
        ValidateUtils.checkNotNull(remote, "Remote address is null");

        Buffer buffer = session.createBuffer(SshConstants.SSH_MSG_GLOBAL_REQUEST);
        buffer.putString("tcpip-forward");
        buffer.putBoolean(true);
        buffer.putString(remote.getHostName());
        buffer.putInt(remote.getPort());
        Buffer result = session.request(buffer);
        if (result == null) {
            throw new SshException("Tcpip forwarding request denied by server");
        }
        int port = (remote.getPort() == 0) ? result.getInt() : remote.getPort();
        // TODO: Is it really safe to only store the local address after the request ?
        SshdSocketAddress prev;
        synchronized (remoteToLocal) {
            prev = remoteToLocal.put(port, local);
        }

        if (prev != null) {
            throw new IOException("Multiple remote port forwarding bindings on port=" + port + ": current=" + remote + ", previous=" + prev);
        }

        SshdSocketAddress bound = new SshdSocketAddress(remote.getHostName(), port);
        if (log.isDebugEnabled()) {
            log.debug("startRemotePortForwarding(" + remote + " -> " + local + "): " + bound);
        }

        return bound;
    }

    @Override
    public synchronized void stopRemotePortForwarding(SshdSocketAddress remote) throws IOException {
        SshdSocketAddress bound;
        synchronized (remoteToLocal) {
            bound = remoteToLocal.remove(remote.getPort());
        }

        if (bound != null) {
            if (log.isDebugEnabled()) {
                log.debug("stopRemotePortForwarding(" + remote + ") cancel forwarding to " + bound);
            }

            Buffer buffer = session.createBuffer(SshConstants.SSH_MSG_GLOBAL_REQUEST);
            buffer.putString("cancel-tcpip-forward");
            buffer.putBoolean(false);
            buffer.putString(remote.getHostName());
            buffer.putInt(remote.getPort());
            session.writePacket(buffer);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("stopRemotePortForwarding(" + remote + ") no binding found");
            }
        }
    }

    @Override
    public synchronized SshdSocketAddress startDynamicPortForwarding(SshdSocketAddress local) throws IOException {
        ValidateUtils.checkNotNull(local, "Local address is null");
        ValidateUtils.checkTrue(local.getPort() >= 0, "Invalid local port: %s", local);

        if (isClosed()) {
            throw new IllegalStateException("TcpipForwarder is closed");
        }
        if (isClosing()) {
            throw new IllegalStateException("TcpipForwarder is closing");
        }

        SocksProxy socksProxy = new SocksProxy(service);
        SocksProxy prev;
        InetSocketAddress bound = doBind(local, socksProxyIoHandlerFactory);
        int port = bound.getPort();
        synchronized (dynamicLocal) {
            prev = dynamicLocal.put(port, socksProxy);
        }

        if (prev != null) {
            throw new IOException("Multiple dynamic port mappings found for port=" + port + ": current=" + socksProxy + ", previous=" + prev);
        }

        SshdSocketAddress result = new SshdSocketAddress(bound.getHostString(), port);
        if (log.isDebugEnabled()) {
            log.debug("startDynamicPortForwarding(" + local + "): " + result);
        }

        return result;
    }

    @Override
    public synchronized void stopDynamicPortForwarding(SshdSocketAddress local) throws IOException {
        Closeable obj;
        synchronized (dynamicLocal) {
            obj = dynamicLocal.remove(local.getPort());
        }

        if (obj != null) {
            if (log.isDebugEnabled()) {
                log.debug("stopDynamicPortForwarding(" + local + ") unbinding");
            }
            obj.close(true);
            acceptor.unbind(local.toInetSocketAddress());
        } else {
            if (log.isDebugEnabled()) {
                log.debug("stopDynamicPortForwarding(" + local + ") no binding found");
            }
        }
    }

    @Override
    public synchronized SshdSocketAddress getForwardedPort(int remotePort) {
        synchronized (remoteToLocal) {
            return remoteToLocal.get(remotePort);
        }
    }

    @Override
    public synchronized SshdSocketAddress localPortForwardingRequested(SshdSocketAddress local) throws IOException {
        ValidateUtils.checkNotNull(local, "Local address is null");
        ValidateUtils.checkTrue(local.getPort() >= 0, "Invalid local port: %s", local);

        FactoryManager manager = session.getFactoryManager();
        ForwardingFilter filter = manager.getTcpipForwardingFilter();
        if ((filter == null) || (!filter.canListen(local, session))) {
            if (log.isDebugEnabled()) {
                log.debug("localPortForwardingRequested(" + session + ")[" + local + "][haveFilter=" + (filter != null) + "] rejected");
            }
            throw new IOException("Rejected address: " + local);
        }
        InetSocketAddress bound = doBind(local, staticIoHandlerFactory);
        SshdSocketAddress result = new SshdSocketAddress(bound.getHostString(), bound.getPort());
        if (log.isDebugEnabled()) {
            log.debug("localPortForwardingRequested(" + local + "): " + result);
        }

        boolean added;
        synchronized (localForwards) {
            // NOTE !!! it is crucial to use the bound address host name first
            added = localForwards.add(new LocalForwardingEntry(result.getHostName(), local.getHostName(), result.getPort()));
        }

        if (!added) {
            throw new IOException("Failed to add local port forwarding entry for " + local + " -> " + result);
        }
        return result;
    }

    @Override
    public synchronized void localPortForwardingCancelled(SshdSocketAddress local) throws IOException {
        LocalForwardingEntry entry;
        synchronized (localForwards) {
            entry = LocalForwardingEntry.findMatchingEntry(local.getHostName(), local.getPort(), localForwards);
            if (entry != null) {
                localForwards.remove(entry);
            }
        }

        if ((entry != null) && (acceptor != null)) {
            if (log.isDebugEnabled()) {
                log.debug("localPortForwardingCancelled(" + local + ") unbind " + entry);
            }
            acceptor.unbind(entry.toInetSocketAddress());
        } else {
            if (log.isDebugEnabled()) {
                log.debug("localPortForwardingCancelled(" + local + ") no match/acceptor: " + entry);
            }
        }
    }

    @Override
    protected synchronized Closeable getInnerCloseable() {
        return builder().parallel(dynamicLocal.values()).close(acceptor).build();
    }

    /**
     * @param address        The request bind address
     * @param handlerFactory A {@link Factory} to create an {@link IoHandler} if necessary
     * @return The {@link InetSocketAddress} to which the binding occurred
     * @throws IOException If failed to bind
     */
    private InetSocketAddress doBind(SshdSocketAddress address, Factory<? extends IoHandler> handlerFactory) throws IOException {
        if (acceptor == null) {
            FactoryManager manager = session.getFactoryManager();
            IoServiceFactory factory = manager.getIoServiceFactory();
            IoHandler handler = handlerFactory.create();
            acceptor = factory.createAcceptor(handler);
        }

        // TODO find a better way to determine the resulting bind address - what if multi-threaded calls...
        Set<SocketAddress> before = acceptor.getBoundAddresses();
        try {
            InetSocketAddress bindAddress = address.toInetSocketAddress();
            acceptor.bind(bindAddress);

            Set<SocketAddress> after = acceptor.getBoundAddresses();
            if (GenericUtils.size(after) > 0) {
                after.removeAll(before);
            }
            if (GenericUtils.isEmpty(after)) {
                throw new IOException("Error binding to " + address + "[" + bindAddress + "]: no local addresses bound");
            }

            if (after.size() > 1) {
                throw new IOException("Multiple local addresses have been bound for " + address + "[" + bindAddress + "]");
            }
            return (InetSocketAddress) after.iterator().next();
        } catch (IOException bindErr) {
            Set<SocketAddress> after = acceptor.getBoundAddresses();
            if (GenericUtils.isEmpty(after)) {
                close();
            }
            throw bindErr;
        }
    }

    @Override
    public String toString() {
        return getClass().getSimpleName() + "[" + session + "]";
    }

    //
    // Static IoHandler implementation
    //

    class StaticIoHandler implements IoHandler {
        StaticIoHandler() {
            super();
        }

        @SuppressWarnings("synthetic-access")
        @Override
        public void sessionCreated(final IoSession session) throws Exception {
            InetSocketAddress local = (InetSocketAddress) session.getLocalAddress();
            int localPort = local.getPort();
            SshdSocketAddress remote = localToRemote.get(localPort);
            final TcpipClientChannel channel;
            if (remote != null) {
                channel = new TcpipClientChannel(TcpipClientChannel.Type.Direct, session, remote);
            } else {
                channel = new TcpipClientChannel(TcpipClientChannel.Type.Forwarded, session, null);
            }
            session.setAttribute(TcpipClientChannel.class, channel);
            service.registerChannel(channel);
            channel.open().addListener(new SshFutureListener<OpenFuture>() {
                @Override
                public void operationComplete(OpenFuture future) {
                    Throwable t = future.getException();
                    if (t != null) {
                        DefaultTcpipForwarder.this.service.unregisterChannel(channel);
                        channel.close(false);
                    }
                }
            });
        }

        @SuppressWarnings("synthetic-access")
        @Override
        public void sessionClosed(IoSession session) throws Exception {
            TcpipClientChannel channel = (TcpipClientChannel) session.getAttribute(TcpipClientChannel.class);
            if (channel != null) {
                log.debug("IoSession {} closed, will now close the channel", session);
                channel.close(false);
            }
        }

        @Override
        public void messageReceived(IoSession session, Readable message) throws Exception {
            TcpipClientChannel channel = (TcpipClientChannel) session.getAttribute(TcpipClientChannel.class);
            Buffer buffer = new ByteArrayBuffer();
            buffer.putBuffer(message);
            channel.waitFor(ClientChannel.OPENED | ClientChannel.CLOSED, Long.MAX_VALUE);

            OutputStream outputStream = channel.getInvertedIn();
            outputStream.write(buffer.array(), buffer.rpos(), buffer.available());
            outputStream.flush();
        }

        @Override
        public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
            cause.printStackTrace();
            session.close(false);
        }
    }
}


text:
package com.mastercard.api.partnerwallet.domain.common;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for ShippingDestinationWrapper complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="ShippingDestinationWrapper">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="ShippingDestination" type="{}ShippingDestination"/>
 *         <element name="ExtensionPoint" type="{}ExtensionPoint" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ShippingDestinationWrapper", propOrder = {
    "shippingDestination",
    "extensionPoint"
})
public class ShippingDestinationWrapper {

    @XmlElement(name = "ShippingDestination", required = true)
    protected ShippingDestination shippingDestination;
    @XmlElement(name = "ExtensionPoint")
    protected ExtensionPoint extensionPoint;

    /**
     * Gets the value of the shippingDestination property.
     *
     * @return
     *     possible object is
     *     {@link ShippingDestination }
     *
     */
    public ShippingDestination getShippingDestination() {
        return shippingDestination;
    }

    /**
     * Sets the value of the shippingDestination property.
     *
     * @param value
     *     allowed object is
     *     {@link ShippingDestination }
     *
     */
    public void setShippingDestination(ShippingDestination value) {
        this.shippingDestination = value;
    }

    /**
     * Gets the value of the extensionPoint property.
     *
     * @return
     *     possible object is
     *     {@link ExtensionPoint }
     *
     */
    public ExtensionPoint getExtensionPoint() {
        return extensionPoint;
    }

    /**
     * Sets the value of the extensionPoint property.
     *
     * @param value
     *     allowed object is
     *     {@link ExtensionPoint }
     *
     */
    public void setExtensionPoint(ExtensionPoint value) {
        this.extensionPoint = value;
    }

}


text:
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
    <clientModule name="StarRating" version="0.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
        <widgetFiles>
            <widgetFile path="com/mendix/widget/StarRating/StarRating.xml"/>
        </widgetFiles>
        <files>
            <file path="com/mendix/widget/StarRating"/>
        </files>
    </clientModule>
</package>


text:
package org.openecard.mdlw.sal.cryptoki;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import java.util.Arrays;
import java.util.List;
/**
 * native declaration : pkcs11_v2.40/pkcs11t.h

 * This file was autogenerated by JNAerator,

 * a tool written by Olivier Chafik that uses a few opensource projects..

 * For help, please visit NativeLibs4Java , Rococoa, or JNA.
 */
public class CK_RC5_PARAMS extends Structure {
	/**
	 * wordsize in bits

	 * C type : CK_ULONG
	 */
	public long ulWordsize;
	public long getUlWordsize() {
		return ulWordsize;
	}
	public void setUlWordsize(long ulWordsize) {
		this.ulWordsize = ulWordsize;
	}
	/**
	 * number of rounds

	 * C type : CK_ULONG
	 */
	public long ulRounds;
	public long getUlRounds() {
		return ulRounds;
	}
	public void setUlRounds(long ulRounds) {
		this.ulRounds = ulRounds;
	}
	public CK_RC5_PARAMS() {
		super();
	}
	 protected List<String> getFieldOrder() {
		return Arrays.asList("ulWordsize", "ulRounds");
	}
	/**
	 * @param ulWordsize wordsize in bits

	 * C type : CK_ULONG

	 * @param ulRounds number of rounds

	 * C type : CK_ULONG
	 */
	public CK_RC5_PARAMS(long ulWordsize, long ulRounds) {
		super();
		this.ulWordsize = ulWordsize;
		this.ulRounds = ulRounds;
	}
	public CK_RC5_PARAMS(Pointer peer) {
		super(peer);
	}
	public static class ByReference extends CK_RC5_PARAMS implements Structure.ByReference {

	};
	public static class ByValue extends CK_RC5_PARAMS implements Structure.ByValue {

	};
}


text:
.section-background{
	background:
		linear-gradient(
	      rgba(0, 0, 0, 0.5),
	      rgba(0, 0, 0, 0.5)
	    ),
		url('../images/gigs-header.jpg');
	background-size: cover;
	background-position: top center;
	background-repeat: no-repeat;
}


text:
<?php
namespace AppBundle\Action\PoolTeam\Export;

use AppBundle\Action\Game\PoolTeam;
use PhpOffice\PhpSpreadsheet;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;

class PoolTeamExportWriterExcel
{
    /** @var PhpSpreadsheet\Spreadsheet */
    private $wb;

    /**
     * @param  PoolTeam[] $poolTeams
     * @param string filename
     * @return string
     * @throws PhpSpreadsheet\Exception
     */
    public function write(array $poolTeams, $filename='php://output')
    {
        // Not sure this is needed
        PhpSpreadsheet\Cell\Cell::setValueBinder(new PhpSpreadsheet\Cell\AdvancedValueBinder());

        $this->wb = $wb = new PhpSpreadsheet\Spreadsheet();

        $ws = $wb->getSheet(0);

        $this->writePoolTeams($ws, $poolTeams);

        return $this->getContents($filename);
    }

    /**
     * @param Worksheet $ws
     * @param PoolTeam[] $poolTeams
     * @throws PhpSpreadsheet\Exception
     */
    private function writePoolTeams(Worksheet $ws,$poolTeams)
    {

        $ws->setTitle('PoolTeams');

        $colProjectId    = 'A';
        $colPoolKey      = 'B';
        $colPoolSlot     = 'C';
        $colPoolTypeKey  = 'D';
        $colPoolTeamKey  = 'E';
        $colPoolTeamSlot = 'F';

        $colRegTeamKey    = 'G';
        $colRegTeamPoints = 'H';

        $colProgram  = 'I';
        $colGender   = 'J';
        $colAge      = 'K';
        $colDivision = 'L';

        // Not really sure about this ABC stuff but try for now
        $ws->getCell($colProjectId    . '1')->setValue('ProjectId');
        $ws->getCell($colPoolKey      . '1')->setValue('PoolKey');
        $ws->getCell($colPoolSlot     . '1')->setValue('PSlot');
        $ws->getCell($colPoolTypeKey  . '1')->setValue('PType');
        $ws->getCell($colPoolTeamKey  . '1')->setValue('PoolTeamKey');
        $ws->getCell($colPoolTeamSlot . '1')->setValue('TSlot');

        $ws->getCell($colRegTeamKey    . '1')->setValue('Reg Team');
        $ws->getCell($colRegTeamPoints . '1')->setValue('PTS');

        $ws->getCell($colProgram  . '1')->setValue('Prog');
        $ws->getCell($colGender   . '1')->setValue('Gen');
        $ws->getCell($colAge      . '1')->setValue('Age');
        $ws->getCell($colDivision . '1')->setValue('Div');

        $ws->getColumnDimension($colProjectId   )->setWidth(24);
        $ws->getColumnDimension($colPoolKey     )->setWidth(24);
        $ws->getColumnDimension($colPoolSlot    )->setWidth( 8);
        $ws->getColumnDimension($colPoolTypeKey )->setWidth(10);
        $ws->getColumnDimension($colPoolTeamKey )->setWidth(24);
        $ws->getColumnDimension($colPoolTeamSlot)->setWidth(10);

        $ws->getColumnDimension($colRegTeamKey)   ->setWidth(20);
        $ws->getColumnDimension($colRegTeamPoints)->setWidth( 4);

        $ws->getColumnDimension($colProgram )->setWidth(8);
        $ws->getColumnDimension($colGender  )->setWidth(6);
        $ws->getColumnDimension($colAge     )->setWidth(6);
        $ws->getColumnDimension($colDivision)->setWidth(6);

        $row = 2;
        foreach($poolTeams as $poolTeam) {

            $ws->getCell($colProjectId   . $row)->setValue($poolTeam->projectId);
            $ws->getCell($colPoolKey     . $row)->setValue($poolTeam->poolKey);
            $ws->getCell($colPoolTypeKey . $row)->setValue($poolTeam->poolTypeKey);
            $ws->getCell($colPoolTeamKey . $row)->setValue($poolTeam->poolTeamKey);

            $regTeamIdParts = explode(':',$poolTeam->regTeamId);
            $regTeamKey = count($regTeamIdParts) === 2 ? $regTeamIdParts[1] : null;
            $ws->getCell($colRegTeamKey    . $row)->setValue($regTeamKey);
            $ws->getCell($colRegTeamPoints . $row)->setValue($poolTeam->regTeamPoints);

            $ws->getCell($colProgram  . $row)->setValue($poolTeam->program);
            $ws->getCell($colGender   . $row)->setValue($poolTeam->gender);
            $ws->getCell($colAge      . $row)->setValue($poolTeam->age);
            $ws->getCell($colDivision . $row)->setValue($poolTeam->division);

            $row++;

            $ws->getCell($colProjectId    . $row)->setValue('Views');
            $ws->getCell($colPoolKey      . $row)->setValue($poolTeam->poolView);
            $ws->getCell($colPoolSlot     . $row)->setValueExplicit($poolTeam->poolSlotView,PhpSpreadsheet\Cell\DataType::TYPE_STRING);
            $ws->getCell($colPoolTypeKey  . $row)->setValue($poolTeam->poolTypeView);
            $ws->getCell($colPoolTeamKey  . $row)->setValue($poolTeam->poolTeamView);
            $ws->getCell($colPoolTeamSlot . $row)->setValueExplicit($poolTeam->poolTeamSlotView,PhpSpreadsheet\Cell\DataType::TYPE_STRING);

            $ws->getCell($colRegTeamKey   . $row)->setValue($poolTeam->regTeamName);

            $row += 2;
        }
    }

    /**
     * @return false|string
     * @throws PhpSpreadsheet\Exception
     */
    private function getContents($filename)
    {
        $writer = new PhpSpreadsheet\Writer\Xlsx($this->wb);
        ob_start();
        $writer->save($filename);
        return ob_get_clean();
    }

    /**
     * @return string
     */
    public function getFileExtension()
    {
        return 'xlsx';
    }

    /**
     * @return string
     */
    public function getContentType()
    {
        return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
    }

}


text:
/**
 *
 */
package com.meidusa.venus.backend.services;

/**
 * Manages only one instance
 *
 * @author Sun Ning
 * @since 2010-3-4
 */
public class SingletonService extends Service {

    private Object instance;

    /**
     * @return the instance
     */
    public Object getInstance() {
        return instance;
    }

    /**
     * @param instance the instance to set
     */
    public void setInstance(Object instance) {
        this.instance = instance;
    }

}


text:
package metricapp.dto.OLD.login;

import java.util.ArrayList;
import java.util.List;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import metricapp.dto.MessageDTO;

@Getter
@Setter
@EqualsAndHashCode(callSuper=true)
public class LoginCrudDTO extends MessageDTO{

	/**
	 *
	 */
	private static final long serialVersionUID = 2926844443273491505L;

	/**
	 *
	 */
	private long count;

	private List<LoginDTO> loginList;

	public LoginCrudDTO(){
		this.setLoginList(new ArrayList<LoginDTO>());
	}

	public void addLoginToList(LoginDTO loginDTO){
		try{
			loginList.add(loginDTO);
		}
		catch(NullPointerException e){
			e.printStackTrace();
		}
	}
}


text:
#ifndef SkDrawClip_DEFINED
#define SkDrawClip_DEFINED

#include "SkADrawable.h"
#include "SkMemberInfo.h"
#include "SkRegion.h"

class SkDrawPath;
class SkDrawRect;

class SkDrawClip : public SkADrawable {
    DECLARE_DRAW_MEMBER_INFO(Clip);
    SkDrawClip();
    bool draw(SkAnimateMaker& ) SK_OVERRIDE;
private:
    SkDrawRect* rect;
    SkDrawPath* path;
};

#endif // SkDrawClip_DEFINED