text:
#pragma once
#include <aws/glue/Glue_EXPORTS.h>
#include <aws/glue/GlueRequest.h>
#include <aws/glue/model/SchemaId.h>
#include <aws/glue/model/SchemaVersionNumber.h>
#include <aws/glue/model/SchemaDiffType.h>
#include <utility>

namespace Aws
{
namespace Glue
{
namespace Model
{

  /**
   */
  class AWS_GLUE_API GetSchemaVersionsDiffRequest : public GlueRequest
  {
  public:
    GetSchemaVersionsDiffRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "GetSchemaVersionsDiff"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
This is a wrapper structure to contain schema identity fields. The structure
     * contains:

SchemaId$SchemaArn: The Amazon Resource Name (ARN) of
     * the schema. One of SchemaArn or SchemaName has to be
     * provided.

SchemaId$SchemaName: The name of the schema. One of
     * SchemaArn or SchemaName has to be provided.

     *

     */
    inline const SchemaId& GetSchemaId() const{ return m_schemaId; }

    /**
     *
This is a wrapper structure to contain schema identity fields. The structure
     * contains:

SchemaId$SchemaArn: The Amazon Resource Name (ARN) of
     * the schema. One of SchemaArn or SchemaName has to be
     * provided.

SchemaId$SchemaName: The name of the schema. One of
     * SchemaArn or SchemaName has to be provided.

     *

     */
    inline bool SchemaIdHasBeenSet() const { return m_schemaIdHasBeenSet; }

    /**
     *
This is a wrapper structure to contain schema identity fields. The structure
     * contains:

SchemaId$SchemaArn: The Amazon Resource Name (ARN) of
     * the schema. One of SchemaArn or SchemaName has to be
     * provided.

SchemaId$SchemaName: The name of the schema. One of
     * SchemaArn or SchemaName has to be provided.

     *

     */
    inline void SetSchemaId(const SchemaId& value) { m_schemaIdHasBeenSet = true; m_schemaId = value; }

    /**
     *
This is a wrapper structure to contain schema identity fields. The structure
     * contains:

SchemaId$SchemaArn: The Amazon Resource Name (ARN) of
     * the schema. One of SchemaArn or SchemaName has to be
     * provided.

SchemaId$SchemaName: The name of the schema. One of
     * SchemaArn or SchemaName has to be provided.

     *

     */
    inline void SetSchemaId(SchemaId&& value) { m_schemaIdHasBeenSet = true; m_schemaId = std::move(value); }

    /**
     *
This is a wrapper structure to contain schema identity fields. The structure
     * contains:

SchemaId$SchemaArn: The Amazon Resource Name (ARN) of
     * the schema. One of SchemaArn or SchemaName has to be
     * provided.

SchemaId$SchemaName: The name of the schema. One of
     * SchemaArn or SchemaName has to be provided.

     *

     */
    inline GetSchemaVersionsDiffRequest& WithSchemaId(const SchemaId& value) { SetSchemaId(value); return *this;}

    /**
     *
This is a wrapper structure to contain schema identity fields. The structure
     * contains:

SchemaId$SchemaArn: The Amazon Resource Name (ARN) of
     * the schema. One of SchemaArn or SchemaName has to be
     * provided.

SchemaId$SchemaName: The name of the schema. One of
     * SchemaArn or SchemaName has to be provided.

     *

     */
    inline GetSchemaVersionsDiffRequest& WithSchemaId(SchemaId&& value) { SetSchemaId(std::move(value)); return *this;}

    /**
     *
The first of the two schema versions to be compared.

     */
    inline const SchemaVersionNumber& GetFirstSchemaVersionNumber() const{ return m_firstSchemaVersionNumber; }

    /**
     *
The first of the two schema versions to be compared.

     */
    inline bool FirstSchemaVersionNumberHasBeenSet() const { return m_firstSchemaVersionNumberHasBeenSet; }

    /**
     *
The first of the two schema versions to be compared.

     */
    inline void SetFirstSchemaVersionNumber(const SchemaVersionNumber& value) { m_firstSchemaVersionNumberHasBeenSet = true; m_firstSchemaVersionNumber = value; }

    /**
     *
The first of the two schema versions to be compared.

     */
    inline void SetFirstSchemaVersionNumber(SchemaVersionNumber&& value) { m_firstSchemaVersionNumberHasBeenSet = true; m_firstSchemaVersionNumber = std::move(value); }

    /**
     *
The first of the two schema versions to be compared.

     */
    inline GetSchemaVersionsDiffRequest& WithFirstSchemaVersionNumber(const SchemaVersionNumber& value) { SetFirstSchemaVersionNumber(value); return *this;}

    /**
     *
The first of the two schema versions to be compared.

     */
    inline GetSchemaVersionsDiffRequest& WithFirstSchemaVersionNumber(SchemaVersionNumber&& value) { SetFirstSchemaVersionNumber(std::move(value)); return *this;}

    /**
     *
The second of the two schema versions to be compared.

     */
    inline const SchemaVersionNumber& GetSecondSchemaVersionNumber() const{ return m_secondSchemaVersionNumber; }

    /**
     *
The second of the two schema versions to be compared.

     */
    inline bool SecondSchemaVersionNumberHasBeenSet() const { return m_secondSchemaVersionNumberHasBeenSet; }

    /**
     *
The second of the two schema versions to be compared.

     */
    inline void SetSecondSchemaVersionNumber(const SchemaVersionNumber& value) { m_secondSchemaVersionNumberHasBeenSet = true; m_secondSchemaVersionNumber = value; }

    /**
     *
The second of the two schema versions to be compared.

     */
    inline void SetSecondSchemaVersionNumber(SchemaVersionNumber&& value) { m_secondSchemaVersionNumberHasBeenSet = true; m_secondSchemaVersionNumber = std::move(value); }

    /**
     *
The second of the two schema versions to be compared.

     */
    inline GetSchemaVersionsDiffRequest& WithSecondSchemaVersionNumber(const SchemaVersionNumber& value) { SetSecondSchemaVersionNumber(value); return *this;}

    /**
     *
The second of the two schema versions to be compared.

     */
    inline GetSchemaVersionsDiffRequest& WithSecondSchemaVersionNumber(SchemaVersionNumber&& value) { SetSecondSchemaVersionNumber(std::move(value)); return *this;}

    /**
     *
Refers to SYNTAX_DIFF, which is the currently supported diff
     * type.

     */
    inline const SchemaDiffType& GetSchemaDiffType() const{ return m_schemaDiffType; }

    /**
     *
Refers to SYNTAX_DIFF, which is the currently supported diff
     * type.

     */
    inline bool SchemaDiffTypeHasBeenSet() const { return m_schemaDiffTypeHasBeenSet; }

    /**
     *
Refers to SYNTAX_DIFF, which is the currently supported diff
     * type.

     */
    inline void SetSchemaDiffType(const SchemaDiffType& value) { m_schemaDiffTypeHasBeenSet = true; m_schemaDiffType = value; }

    /**
     *
Refers to SYNTAX_DIFF, which is the currently supported diff
     * type.

     */
    inline void SetSchemaDiffType(SchemaDiffType&& value) { m_schemaDiffTypeHasBeenSet = true; m_schemaDiffType = std::move(value); }

    /**
     *
Refers to SYNTAX_DIFF, which is the currently supported diff
     * type.

     */
    inline GetSchemaVersionsDiffRequest& WithSchemaDiffType(const SchemaDiffType& value) { SetSchemaDiffType(value); return *this;}

    /**
     *
Refers to SYNTAX_DIFF, which is the currently supported diff
     * type.

     */
    inline GetSchemaVersionsDiffRequest& WithSchemaDiffType(SchemaDiffType&& value) { SetSchemaDiffType(std::move(value)); return *this;}

  private:

    SchemaId m_schemaId;
    bool m_schemaIdHasBeenSet;

    SchemaVersionNumber m_firstSchemaVersionNumber;
    bool m_firstSchemaVersionNumberHasBeenSet;

    SchemaVersionNumber m_secondSchemaVersionNumber;
    bool m_secondSchemaVersionNumberHasBeenSet;

    SchemaDiffType m_schemaDiffType;
    bool m_schemaDiffTypeHasBeenSet;
  };

} // namespace Model
} // namespace Glue
} // namespace Aws


text:
// ReSharper disable All

namespace OpenTl.Schema
{
	using System;
	using System.Collections;
	using System.Text;

	using OpenTl.Schema;
	using OpenTl.Schema.Serialization.Attributes;

	[Serialize(0xedcdc05b)]
	public sealed class TTopPeer : ITopPeer
	{
       [SerializationOrder(0)]
       public OpenTl.Schema.IPeer Peer {get; set;}

       [SerializationOrder(1)]
       public double Rating {get; set;}

	}
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2016 Red Hat, Inc. and/or its affiliates
  ~ and other contributors as indicated by the @author tags.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!-- Generated by Apache ServiceMix Archetype -->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
        http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
        http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml" />

    <bean id="kcAdapterConfig" class="org.keycloak.representations.adapters.config.AdapterConfig">
        <property name="realm" value="demo"/>
        <property name="resource" value="custom-cxf-endpoint"/>
        <property name="bearerOnly" value="true"/>
        <property name="authServerUrl" value="http://localhost:8080/auth" />
        <property name="sslRequired" value="EXTERNAL"/>
    </bean>

    <bean id="keycloakAuthenticator" class="org.keycloak.adapters.jetty.KeycloakJettyAuthenticator">
        <property name="adapterConfig">
            <ref local="kcAdapterConfig" />
        </property>
    </bean>

    <bean id="constraint" class="org.eclipse.jetty.util.security.Constraint">
        <property name="name" value="Customers"/>
        <property name="roles">
            <list>
                <value>user</value>
            </list>
        </property>
        <property name="authenticate" value="true"/>
        <property name="dataConstraint" value="0"/>
    </bean>

    <bean id="constraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
        <property name="constraint" ref="constraint"/>
        <property name="pathSpec" value="/*"/>
    </bean>

    <bean id="securityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
        <property name="authenticator" ref="keycloakAuthenticator" />
        <property name="constraintMappings">
            <list>
                <ref local="constraintMapping" />
            </list>
        </property>
        <property name="authMethod" value="BASIC"/>
        <property name="realmName" value="does-not-matter"/>
    </bean>

    <httpj:engine-factory bus="cxf" id="kc-cxf-endpoint">
        <httpj:engine port="8282">
            <httpj:handlers>
                <ref local="securityHandler" />
            </httpj:handlers>
            <httpj:sessionSupport>true</httpj:sessionSupport>
        </httpj:engine>
    </httpj:engine-factory>

    <jaxws:endpoint
                    implementor="org.keycloak.example.ws.ProductImpl"
                    address="http://localhost:8282/ProductServiceCF" depends-on="kc-cxf-endpoint"/>

</beans>


text:
// ##################################################################################
//
// UDMlib - Unstructured Data Management Library
//
// Copyright (C) 2012-2015 Institute of Industrial Science, The University of Tokyo.
// All rights reserved.
//
// Copyright (c) 2015 Advanced Institute for Computational Science, RIKEN.
// All rights reserved.
//
// ###################################################################################
#ifndef _UDMDFICONFIG_H_
#define _UDMDFICONFIG_H_

/**
 * @file UdmDfiConfig.h
 * index.dfi, proc.dfiの入出力クラスのヘッダーファイル
 */

#include "config/UdmConfigBase.h"
#include "config/UdmFileInfoConfig.h"
#include "config/UdmFilePathConfig.h"
#include "config/UdmTimeSliceConfig.h"
#include "config/UdmUnitListConfig.h"
#include "config/UdmFlowSolutionListConfig.h"
#include "config/UdmDomainConfig.h"
#include "config/UdmMpiConfig.h"
#include "config/UdmProcessConfig.h"

namespace udm {

/**
 * index.dfi, proc.dfiの入出力クラス
 */
class UdmDfiConfig: public UdmConfigBase {
private:
    std::string                filename_input_dfi;        ///< index.dfiファイル名
    std::string              output_path;                ///< 出力パス
    UdmFileInfoConfig        *fileinfo;        ///< index.dfi/FileInfoデータ
    UdmFilePathConfig        *filepath;        ///< index.dfi/FilePathデータ
    UdmTimeSliceConfig        *timeslice;        ///< index.dfi/TimeSliceデータ
    UdmUnitListConfig        *unitlist;        ///< index.dfi/UnitListデータ
    UdmFlowSolutionListConfig    *flowsolutionlist;    ///< index.dfi/FlowSolutionデータ
    UdmDomainConfig            *domain;        ///< proc.dfi/Domainデータ
    UdmMpiConfig            *mpi;            ///< proc.dfi/MPIデータ
    UdmProcessConfig            *process;            ///< proc.dfi/Processデータ
    std::map<int, int>        io_rank_table;        ///< 入出力ランク番号テーブル={CGNS出力ランク番号, CGNS読込ランク番号}

public:
    UdmDfiConfig();
    virtual ~UdmDfiConfig();
    UdmError_t readDfi(const char* filename);
    UdmError_t writeDfi(const char* filename);
    UdmFileInfoConfig* getFileinfoConfig() const;
    UdmFilePathConfig* getFilepathConfig() const;
    UdmFlowSolutionListConfig* getFlowSolutionListConfig() const;
    UdmTimeSliceConfig* getTimesliceConfig() const;
    UdmUnitListConfig* getUnitListConfig() const;
    UdmDomainConfig* getDomainConfig() const;
    UdmMpiConfig* getMpiConfig() const;
    UdmProcessConfig* getProcessConfig() const;
    UdmError_t getIndexDfiPath(std::string &filepath) const;
    UdmError_t getIndexDfiFolder(std::string &filepath) const;
    UdmError_t getDfiValue(const std::string &label_path, std::string &value) const;
    UdmError_t setDfiValue(const std::string &label_path, const std::string &value);
    int getNumDfiValue(const std::string &label_path) const;
    UdmError_t setUnitList(const std::string &unit_name, const std::string &unit, double reference);
    UdmError_t setUnitList(const std::string &unit_name, const std::string &unit, double reference, double difference);
    unsigned int getUnitNameList(std::vector<std::string> &unit_names) const;
    unsigned int getSolutionNameList(std::vector<std::string> &solution_names) const;
    UdmError_t setSolutionConfig(
                    const std::string     &solution_name,
                    UdmGridLocation_t    grid_location,
                    UdmDataType_t        data_type,
                    UdmVectorType_t        vector_type,
                    int                        nvector_size,
                    bool            constant_flag);
    // TimeSlice
    UdmError_t insertTimeSlice(UdmSize_t step, double time);
    UdmError_t insertTimeSlice(UdmSize_t step, double time, UdmSize_t average_step, double average_time);
    UdmSize_t getNumCurrentTimeSlices() const;

    UdmError_t setProcessRank(int rankid, UdmSize_t vertex_size, UdmSize_t cell_size);
    UdmError_t getCgnsInputFilePath(std::string& file_path, int rank_no);
    UdmError_t getCgnsLinkFilePath(std::string &file_path, int rank_no);
    UdmError_t getCgnsTimeSliceFilePath(std::string &file_path, int rank_no, int timeslice_step, bool mpiexec = true);
    UdmError_t getCgnsGridFilePath(std::string &file_path, int rank_no, int timeslice_step);
    UdmError_t getCgnsSolutionFilePath(std::string &file_path, int rank_no, int timeslice_step);
    UdmError_t setDomainConfig(int dimmention, UdmSize_t vertex_size, UdmSize_t cell_size);
    UdmError_t setMpiConfig(int num_process, int num_group);
    UdmError_t setProcessConfig(int num_process, const UdmSize_t *vertex_sizes, const UdmSize_t *cell_sizes);
    const std::string &getOutputPath() const;
    void setOutputPath(const std::string path);
    UdmError_t getDfiOutputDirectory(std::string &path) const;
    UdmError_t getDfiOutputDirectory(char *path) const;
    UdmError_t getCgnsOutputDirectory(std::string &path) const;
    UdmError_t getCgnsTimeSliceDirectory(std::string &path, UdmSize_t time_step) const;
    UdmError_t getWriteIndexDfiPath(std::string &dfi_path) const;
    UdmError_t getWriteProcDfiPath(std::string &filepath) const;
    UdmError_t getReadProcDfiPath(std::string &filepath) const;
    void clearProcessRank();

    // FileInfo
    void setFileInfoPrefix(const std::string &prefix);

    // 入出力ランク番号テーブル
    int makeIoRankTable(int total_ranks, int myrank, std::vector<int>& input_rank_ids);
    int getInputRankno(int output_rankno) const;
    bool existsIoRankTable() const;
    void clearIoRankTable();

private:
    void initialize();
    UdmError_t readProcDfi(const char* filename);
    UdmError_t writeProcDfi(const char* filename);
    UdmError_t connectOutputDirectory(const std::string file_name, std::string &path) const;

};

} /* namespace udm */

#endif /* _UDMDFICONFIG_H_ */


text:
import * as d3v3 from 'd3v3';
import { merge } from 'lodash';
// eslint-disable-next-line @typescript-eslint/no-namespace
export var StoryTransition;
(function (StoryTransition) {
    StoryTransition.FACTOR = 1;
    StoryTransition.MIN_DURATION = -1;
    StoryTransition.MIN_TRANSITION = -1;
})(StoryTransition || (StoryTransition = {}));
/**
 * story player interface and logic
 */
export class Player {
    constructor(graph, controls, options = {}) {
        this.graph = graph;
        this.anim = -1;
        this.options = {
            // default animation step duration
            step: 1000,
        };
        merge(this.options, options);
        const $controls = d3v3.select(controls);
        // eslint-disable-next-line @typescript-eslint/no-this-alias
        const that = this;
        this.$play = $controls.select('[data-player="play"]').on('click', function () {
            const $i = d3v3.select(this);
            if ($i.classed('fa-play') && that.start()) {
                $i.classed('fa-play', false).classed('fa-pause', true);
            }
            else {
                that.pause();
                $i.classed('fa-play', true).classed('fa-pause', false);
            }
        });
        $controls.select('[data-player="stop"]').on('click', function () {
            that.stop();
        });
        $controls.select('[data-player="forward"]').on('click', function () {
            that.forward();
        });
        $controls.select('[data-player="backward"]').on('click', function () {
            that.backward();
        });
        d3v3.select(document).on('keydown.playpause', () => {
            const k = d3v3.event;
            // pause key
            if (k.keyCode === 19) {
                k.preventDefault();
                // fake a click event
                const event = document.createEvent('MouseEvents');
                event.initMouseEvent('click' /* type */, true /* canBubble */, true /* cancelable */, window /* view */, 0 /* detail */, 0 /* screenX */, 0 /* screenY */, 0 /* clientX */, 0 /* clientY */, false /* ctrlKey */, false /* altKey */, false /* shiftKey */, false /* metaKey */, 0 /* button */, null /* relatedTarget */);
                this.$play.node().dispatchEvent(event);
            }
        });
    }
    start() {
        const l = this.graph.getSlideChains();
        const act = this.graph.selectedSlides()[0] || l[l.length - 1];
        if (act) {
            this.render(act).then(() => {
                this.anim = window.setTimeout(this.next.bind(this), act.duration * StoryTransition.FACTOR);
            });
            return true;
        }
        return false;
    }
    render(story) {
        // render by selecting the slide
        this.graph.selectSlide(story);
        // TODO transition time
        return Promise.resolve(story);
    }
    stopAnim() {
        if (this.anim >= 0) {
            clearTimeout(this.anim);
            this.anim = -1;
        }
    }
    stop() {
        this.stopAnim();
        this.render(null).then(() => {
            this.$play.classed('fa-play', true).classed('fa-pause', false);
        });
    }
    pause() {
        this.stopAnim();
    }
    /**
     * renders the next slide in an animated fashion
     */
    next() {
        const r = this.forward();
        if (r) {
            r.then((act) => {
                this.anim = window.setTimeout(this.next.bind(this), act.duration * StoryTransition.FACTOR);
            });
        }
    }
    /**
     * jumps to the next slide
     * @returns {any}
     */
    forward() {
        this.stopAnim();
        const current = this.graph.selectedSlides()[0];
        const act = current.next;
        if (act == null) {
            this.stop();
            return null;
        }
        return this.render(act);
    }
    /**
     * jumps to the previous slide
     * @returns {any}
     */
    backward() {
        this.stopAnim();
        const current = this.graph.selectedSlides()[0];
        const act = current.previous;
        if (act == null) {
            this.stop();
            return null;
        }
        return this.render(act);
    }
}
//# sourceMappingURL=Player.js.map


text:
module.exports = function(RED) {
    "use strict";
    var exec = require('child_process').exec;

    function iTunesNode(n) {
        RED.nodes.createNode(this,n);
        this.playlist = n.playlist;
        var node = this;
        this.on("input", function(msg) {
            var cl;
            var p;
            if(!msg.stop) {
                if(node.playlist)
                    p = node.playlist;
                else
                    p = msg.payload;
                //console.log(node.current);
                //console.log(p);
                if(node.current != p) {
                    node.current = p;
                    cl = "osascript -e 'tell application \"iTunes\" to play playlist \""+p+"\"'";
                }
                else {
                    cl = "osascript -e 'tell application \"iTunes\" \n if player state is paused then play \n end tell'";
                }
            }
            else {
                cl = "osascript -e 'tell application \"iTunes\" to pause'";
            }
            //node.log(cl);
            var child = exec(cl, function (error, stdout, stderr) {
                console.log(stdout);
                /*var msg2 = {payload:stderr};
                var msg3 = null;
                //console.log('[exec] stdout: ' + stdout);
                //console.log('[exec] stderr: ' + stderr);
                if (error !== null) {
                    msg3 = {payload:error};
                    //console.log('[exec] error: ' + error);
                }
                node.status({});
                node.send([msg,msg2,msg3]);*/
            });
        });
    }

    RED.nodes.registerType("itunes-osx",iTunesNode);
}


text:
module NbaRb
  module Player
    class ShotLogTracking < NbaRb::Player::Dashboard
      @endpoint = 'playerdashptshotlog'
    end
  end
end


text:
package org.elasticsearch.action;

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.rest.RestStatus;

import java.io.IOException;

public class NoShardAvailableActionException extends ElasticsearchException {

    public NoShardAvailableActionException(ShardId shardId) {
        this(shardId, null);
    }

    public NoShardAvailableActionException(ShardId shardId, String msg) {
        this(shardId, msg, null);
    }

    public NoShardAvailableActionException(ShardId shardId, String msg, Throwable cause) {
        super(msg, cause);
        setShard(shardId);
    }

    @Override
    public RestStatus status() {
        return RestStatus.SERVICE_UNAVAILABLE;
    }

    public NoShardAvailableActionException(StreamInput in) throws IOException {
        super(in);
    }
}


text:
def camelize(needsCamelizing):
    if isinstance(needsCamelizing, dict):
        return cameldict(needsCamelizing)
    elif isinstance(needsCamelizing, list):
        return [camelize(el) for el in needsCamelizing]
    elif isinstance(needsCamelizing, str):
        return camelcase(needsCamelizing)
    else:
        return None

def camelcase(snake_str, upper=True):
    """
    Format a string from snake case to upper or lower camelCase
    """
    # UpperCamelCase
    if upper:
        return snake_str.title().replace('_', '')

    # lowerCamelCase requires splitting the string into 2 parts
    head, *body = snake_str.split('_', maxsplit=1)

    # Make the first word lower, then capitalize all other words
    return ''.join([
        head.lower(),
        body.title().replace('_', '') if len(body) else body
    ])

def cameldict(snake_dict, upper=True):
    return {camelcase(key): value if isinstance(value, str) else camelize(value)
            for key, value
            in snake_dict.items()}


text:
package water;

import water.H2O.H2OCountedCompleter;
import water.UDP.udp;

/**
 * A class to handle the work of a received UDP packet.  Typically we'll do a
 * small amount of work based on the packet contents (such as returning a Value
 * requested by another Node, or recording a heartbeat).
 *
 * @author
 * @version 1.0
 */
class FJPacket extends H2OCountedCompleter {
  final AutoBuffer _ab;
  final int _ctrl;              // 1st byte of packet
  FJPacket( AutoBuffer ab, int ctrl ) {
    // Run at max priority until we decrypt the packet enough to get priorities out
    super(UDP.udp.UDPS[ctrl]._prior);
    _ab = ab; _ctrl = ctrl;
    assert 0 < _ctrl && _ctrl < udp.UDPS.length;
    assert udp.UDPS[_ctrl]._udp != null:"missing udp " + _ctrl;
  }

  @Override
  public void compute2() {
    _ab.getPort(); // skip past the port
    if( _ctrl <= UDP.udp.nack.ordinal() ) {
      AutoBuffer ab = UDP.udp.UDPS[_ctrl]._udp.call(_ab);
      if(ab != null && !ab.isClosed()) ab.close();
    } else
      RPC.remote_exec(_ab);
    tryComplete();
  }
  /** Exceptional completion path; mostly does printing if the exception was
   *  not handled earlier in the stack.  */
  @Override public boolean onExceptionalCompletion(Throwable ex, jsr166y.CountedCompleter caller) {
    System.err.println("onExCompletion for "+this);
    ex.printStackTrace();
    water.util.Log.err(ex);
    return true;
  }
}


text: © <?php echo date('Y'); ?>  All rights  Reserved by  <a href="<?php echo SITE_URL; ?>" target="target_blank"><?php echo ucwords( SITE_NAME ); ?>


text:
@interface WCSourceScroller : NSScroller {
	NSArray *_buildIssues;
	NSArray *_bookmarks;
}
@property (readwrite,retain,nonatomic) NSArray *buildIssues;
@property (readwrite,retain,nonatomic) NSArray *bookmarks;
@end


text:
package org.glamey.training.spring.event;

import lombok.ToString;
import org.springframework.context.ApplicationEvent;

/**
 * @author zhouyang.zhou. 2017.07.20.14.
 */
@ToString
public class DemoEvent extends ApplicationEvent {

    private String message;

    public DemoEvent(String source) {
        super(source);
        this.message = source;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}


text:
using namespace std;
using namespace cv;

class Network {

private:
    int sokt;
    const char* serverIP;
    int serverPort;
    Timer timer;
    bool open;
    bool deepLearning;

public:
    Network();
    Network(const char * serverIP,const int& serverPort);
    bool isInit() const;
    bool startConnection();
    bool closeConnection();
    bool sendImage(const Mat& image);
    bool receiveImage(Mat image, Result& result);
    bool sendInt(const int& n);
    int receiveInt();
    void printTimer();
    bool isOpen() const;
};

#endif //UNIZAR_MOBILECV_NETWORK_H


text:
set -o nounset
set -o errexit

# Helper to make sure programs exist
ensureCmd() {
  command -v $1 >/dev/null 2>&1 || {
    err >&2 "The program '$1' is not in your path (or not executable)! $2";
    return 1
  }
}

# Some colors, because colors are awesome!
color_clear='\033[0m'
color_red='\033[31;1m'
function red() {
  echo -e "${color_red}$@${color_clear}"
}
color_green='\033[32;1m'
function green() {
  echo -e "${color_green}$@${color_clear}"
}
color_yellow='\033[33;1m'
function yellow() {
  echo -e "${color_yellow}$@${color_clear}"
}

# Determine OS platform
UNAME=$(uname | tr "[:upper:]" "[:lower:]")
# If Linux, try to determine specific distribution
if [ "$UNAME" == "linux" ]; then
    # If available, use LSB to identify distribution
    if [ -f /etc/lsb-release -o -d /etc/lsb-release.d ]; then
        export DISTRO=$(lsb_release -i | cut -d: -f2 | sed s/'^\t'//)
    # Otherwise, use release info file
    else
        export DISTRO=$(ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d'_' -f1)
    fi
fi
# For everything else (or if above failed), just use generic identifier
[ "$DISTRO" == "" ] && export DISTRO=$UNAME
unset UNAME

echo "$DISTRO"

if [ "$DISTRO" == "Ubuntu" ]; then
  echo "Installing dependencies..."
  yellow "(this will need sudo access)"
  yellow "(also, please read what the script is doing)"
  set -o xtrace
  sleep 5
  # Essential dependencies
  sudo apt-get install libtool build-essential autoconf
  # Needed by various secondary scripts
  sudo apt-get install pv doxygen ant
  # We need gcovr 3, and Ubuntu only installs gcovr 2
  sudo pip install gcovr
  # Needed for creating the training set
  sudo pip install python-levenshtein
  set +o xtrace
else
  yellow ""
  yellow "COULD NOT AUTOMATICALLY INSTALL DEPENDENCIES!"
  yellow ""
fi

# Check to make sure requisite programs are there
echo "Checking programs..."
ensureCmd libtoolize
ensureCmd aclocal
ensureCmd autoheader
ensureCmd autoconf
ensureCmd automake
ensureCmd pv
ensureCmd make
ensureCmd doxygen
ensureCmd gcovr
ensureCmd ant
ensureCmd wget

echo "Downloading CoreNLP + models..."
if [ ! -e stanford-corenlp-models-current.jar ]; then
  wget http://nlp.stanford.edu/software/stanford-corenlp-models-current.jar
fi
if [ ! -e stanford-corenlp-caseless-models-current.jar ]; then
  wget http://nlp.stanford.edu/software/stanford-corenlp-caseless-models-current.jar
fi
if [ ! -e stanford-corenlp.jar ]; then
  wget http://central.maven.org/maven2/edu/stanford/nlp/stanford-corenlp/3.5.2/stanford-corenlp-3.5.2.jar
fi

green "Everyting is OK!"


text:
class BinaryTree < Tree

  def initialize(*args)
    super()
    case args.length
    when 0
      @key = nil
      @left = nil
      @right = nil
    when 1
      @key = args[0]
      @left = BinaryTree.new
      @right = BinaryTree.new
    when 3
      @key = args[0]
      @left = args[1]
      @right = args[2]
    else
      raise ArgumentError
    end
  end

  def purge
    @key = nil
    @left = nil
    @right = nil
  end

  def left
    raise StateError if empty?
    @left
  end

  def right
    raise StateError if empty?
    @right
  end

  def left
    raise StateError if empty?
    @left
  end

  def right
    raise StateError if empty?
    @right
  end

  def compareTo(bt)
    assert { is_a?(obj.type) }
    if empty?
      if bt.empty?
        return 0
      else
        return -1
      end
    elsif bt.empty?
      return 1
    else
      result = @key <=> bt._key
      result = @left <=> bt._left if result == 0
      result = @right <=> bt._right if result == 0
      return result
    end
  end

end


text:
import * as React from 'react';
import clsx from 'clsx';
import Image from 'next/image';
import { ProjectMetadata } from '~/types/projects';
import { Container } from '~/components/layout';
import { PageMetaItem } from '~/components/page';

export interface ProjectHeaderProps extends React.ComponentPropsWithoutRef<'header'> {
  project: ProjectMetadata;
}

export const ProjectHeader = React.forwardRef<HTMLDivElement, ProjectHeaderProps>(
  ({ className, style, project, ...rest }, ref) => {
    const { header_image, title, description, tags, project_url } = project;

    return (

        <Container className="space-y-12">
          {header_image ? (

              <Image
                loading="lazy"
                src={header_image}
                alt={title}
                layout="fill"
                objectFit="cover"
              />

          ) : null}

            {tags ? (

                {tags.map(tag => (
                  <PageMetaItem key={tag}>{tag}</PageMetaItem>
                ))}

            ) : null}

              {project_url ? (

                    {title} →

              ) : (

{title}

              )}

{description}

        </Container>

    );
  }
);

ProjectHeader.displayName = 'ProjectHeader';

export default ProjectHeader;


text:
<?php

/*
 * (c) Sajjad Hashemian <wolaws@gmail.com>
 */

namespace Sijad\Links\Command;

use Flarum\User\User;

class CreateLink
{
    /**
     * The user performing the action.
     *
     * @var User
     */
    public $actor;

    /**
     * The attributes of the new link.
     *
     * @var array
     */
    public $data;

    /**
     * @param User $actor The user performing the action.
     * @param array $data The attributes of the new link.
     */
    public function __construct(User $actor, array $data)
    {
        $this->actor = $actor;
        $this->data = $data;
    }
}


text:
use aptos_types::transaction::EntryABI;
use std::{ffi::OsStr, fs, io::Read, path::Path};

pub mod golang;
pub mod rust;

/// Internals shared between languages.
mod common;

fn get_abi_paths(dir: &Path) -> std::io::Result<Vec<String>> {
    let mut abi_paths = Vec::new();
    if dir.is_dir() {
        for entry in fs::read_dir(dir)? {
            let entry = entry?;
            let path = entry.path();
            if path.is_dir() {
                abi_paths.append(&mut get_abi_paths(&path)?);
            } else if let Some("abi") = path.extension().and_then(OsStr::to_str) {
                abi_paths.push(path.to_str().unwrap().to_string());
            }
        }
    }
    Ok(abi_paths)
}

/// Read all ABI files the specified directories. This supports both new and old `EntryABI`s.
pub fn read_abis(dir_paths: &[impl AsRef<Path>]) -> anyhow::Result<Vec<EntryABI>> {
    let mut abis = Vec::<EntryABI>::new();
    for dir in dir_paths.iter() {
        for path in get_abi_paths(dir.as_ref())? {
            let mut buffer = Vec::new();
            let mut f = std::fs::File::open(path)?;
            f.read_to_end(&mut buffer)?;
            abis.push(bcs::from_bytes(&buffer)?);
        }
    }

    // Sort functions by (module, function) lexicographical order
    #[allow(clippy::unnecessary_sort_by)]
    abis.sort_by(|a, b| {
        let a0 = match a {
            EntryABI::EntryFunction(sf) => sf.module_name().to_string(),
            _ => "".to_owned(),
        };
        let b0 = match b {
            EntryABI::EntryFunction(sf) => sf.module_name().to_string(),
            _ => "".to_owned(),
        };

        (a0, a.name()).cmp(&(b0, b.name()))
    });
    Ok(abis)
}

/// How to copy ABI-generated source code for a given language.
pub trait SourceInstaller {
    type Error;

    /// Create a module exposing the transaction builders for the given ABIs.
    fn install_transaction_builders(
        &self,
        name: &str,
        abis: &[EntryABI],
    ) -> std::result::Result<(), Self::Error>;
}


text:
package Launcher;

public class Launcher {

}


text:
const HttpStatus = require('http-status-codes');

const build = status => {
    return (ctx, message) => {
        ctx.status = status
        ctx.body = message || {message: HttpStatus.getStatusText(status)}
        return ctx
    }
}

module.exports = {
    accepted: build(HttpStatus.ACCEPTED), // 202
    badGateway: build(HttpStatus.BAD_GATEWAY), // 502
    badRequest: build(HttpStatus.BAD_REQUEST), // 400
    conflict: build(HttpStatus.CONFLICT), // 409
    continue: build(HttpStatus.CONTINUE), // 100
    created: build(HttpStatus.CREATED), // 201
    expectationFailed: build(HttpStatus.EXPECTATION_FAILED), // 417
    failedDependency: build(HttpStatus.FAILED_DEPENDENCY), // 424
    forbidden: build(HttpStatus.FORBIDDEN), // 403
    gatewayTimeout: build(HttpStatus.GATEWAY_TIMEOUT), // 504
    gone: build(HttpStatus.GONE), // 410
    httpVersionNotSupported: build(HttpStatus.HTTP_VERSION_NOT_SUPPORTED), // 505
    imATeapot: build(HttpStatus.IM_A_TEAPOT), // 418
    insufficientSpaceOnResource: build(HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE), // 419
    insufficientStorage: build(HttpStatus.INSUFFICIENT_STORAGE), // 507
    internalServerError: build(HttpStatus.INTERNAL_SERVER_ERROR), // 500
    lengthRequired: build(HttpStatus.LENGTH_REQUIRED), // 411
    locked: build(HttpStatus.LOCKED), // 423
    methodFailure: build(HttpStatus.METHOD_FAILURE), // 420
    methodNotAllowed: build(HttpStatus.METHOD_NOT_ALLOWED), // 405
    movedPermanently: build(HttpStatus.MOVED_PERMANENTLY), // 301
    movedTemporarily: build(HttpStatus.MOVED_TEMPORARILY), // 302
    multiStatus: build(HttpStatus.MULTI_STATUS), // 207
    multipleChoices: build(HttpStatus.MULTIPLE_CHOICES), // 300
    networkAuthenticationRequired: build(HttpStatus.NETWORK_AUTHENTICATION_REQUIRED), // 511
    noContent: build(HttpStatus.NO_CONTENT), // 204
    nonAuthoritativeInformation: build(HttpStatus.NON_AUTHORITATIVE_INFORMATION), // 203
    notAcceptable: build(HttpStatus.NOT_ACCEPTABLE), // 406
    notFound: build(HttpStatus.NOT_FOUND), // 404
    notImplemented: build(HttpStatus.NOT_IMPLEMENTED), // 501
    notModified: build(HttpStatus.NOT_MODIFIED), // 304
    ok: build(HttpStatus.OK), // 200
    partialContent: build(HttpStatus.PARTIAL_CONTENT), // 206
    paymentRequired: build(HttpStatus.PAYMENT_REQUIRED), // 402
    permanentRedirect: build(HttpStatus.PERMANENT_REDIRECT), // 308
    preconditionFailed: build(HttpStatus.PRECONDITION_FAILED), // 412
    preconditionRequired: build(HttpStatus.PRECONDITION_REQUIRED), // 428
    processing: build(HttpStatus.PROCESSING), // 102
    proxyAuthenticationRequired: build(HttpStatus.PROXY_AUTHENTICATION_REQUIRED), // 407
    requestHeaderFieldsTooLarge: build(HttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE), // 431
    requestTimeout: build(HttpStatus.REQUEST_TIMEOUT), // 408
    requestTooLong: build(HttpStatus.REQUEST_TOO_LONG), // 413
    requestUriTooLong: build(HttpStatus.REQUEST_URI_TOO_LONG), // 414
    requestedRangeNotSatisfiable: build(HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE), // 416
    resetContent: build(HttpStatus.RESET_CONTENT), // 205
    seeOther: build(HttpStatus.SEE_OTHER), // 303
    serviceUnavailable: build(HttpStatus.SERVICE_UNAVAILABLE), // 503
    switchingProtocols: build(HttpStatus.SWITCHING_PROTOCOLS), // 101
    temporaryRedirect: build(HttpStatus.TEMPORARY_REDIRECT), // 307
    tooManyRequests: build(HttpStatus.TOO_MANY_REQUESTS), // 429
    unauthorized: build(HttpStatus.UNAUTHORIZED), // 401
    unprocessableEntity: build(HttpStatus.UNPROCESSABLE_ENTITY), // 422
    unsupportedMediaType: build(HttpStatus.UNSUPPORTED_MEDIA_TYPE), // 415
    useProxy: build(HttpStatus.USE_PROXY) // 305
}


text:
package org.studentcard.database.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Zhou Shengyun <GGGZ-1101-28@Live.cn>
 */
@Embeddable
public class RefundRecordPK implements Serializable {

    @Basic(optional = false)
    @NotNull
    @Column(name = "StudentID")
    private int studentID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "RefundTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date refundTime;

    public RefundRecordPK() {
    }

    public RefundRecordPK(int studentID, Date refundTime) {
        this.studentID = studentID;
        this.refundTime = refundTime;
    }

    public int getStudentID() {
        return studentID;
    }

    public void setStudentID(int studentID) {
        this.studentID = studentID;
    }

    public Date getRefundTime() {
        return refundTime;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) studentID;
        hash += (refundTime != null ? refundTime.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RefundRecordPK)) {
            return false;
        }
        RefundRecordPK other = (RefundRecordPK) object;
        if (this.studentID != other.studentID) {
            return false;
        }
        if ((this.refundTime == null && other.refundTime != null) || (this.refundTime != null && !this.refundTime.equals(other.refundTime))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.studentcard.database.model.RefundRecordPK[ studentID=" + studentID + ", refundTime=" + refundTime + " ]";
    }

}


text:
class CreateProfiles < ActiveRecord::Migration
  def change
    create_table :profiles do |t|
      t.integer :user_id
      t.string :name
      t.date :birthday
      t.text :bio
      t.string :color
      t.string :twitter

      t.timestamps
    end
  end
end


text:
package com.wakeup.qcloud.request;

import static com.google.common.collect.Maps.newHashMap;

import java.util.List;
import java.util.Map;

import com.wakeup.qcloud.domain.ProfileItemDO;
import com.wakeup.qcloud.response.ProfilePortraitSetResponse;

/**
 * 设置资料
https://www.qcloud.com/document/product/269/1640
 * @since 2017年3月4日
 * @author kalman03
 */
public class ProfilePortraitSetRequest extends AbstractQCloudIMRequest<ProfilePortraitSetResponse> {

	private static final long serialVersionUID = -7973614575899011644L;
	/**
	 * 	必填	需要设置该Identifier的资料。
	 */
	private String fromAccount;
	/**
	 * 待设置的用户的资料对象数组,数组中每一个对象都包含了Tag和Value
	 */
	private List<ProfileItemDO> profileItems;

	@Override
	public String getApiName() {
		return "profile/portrait_set";
	}

	@Override
	public Map<String, Object> getTextParams() {
		Map<String, Object> map = newHashMap();
		map.put("From_Account", fromAccount);
		map.put("ProfileItem", profileItems);
		return map;
	}

	@Override
	public Class<ProfilePortraitSetResponse> getResponseClass() {
		return ProfilePortraitSetResponse.class;
	}

	public String getFromAccount() {
		return fromAccount;
	}

	public void setFromAccount(String fromAccount) {
		this.fromAccount = fromAccount;
	}

	public List<ProfileItemDO> getProfileItems() {
		return profileItems;
	}

	public void setProfileItems(List<ProfileItemDO> profileItems) {
		this.profileItems = profileItems;
	}
}


text:
<?php

namespace Lunr\Gravity\Database\MySQL\Tests;

use Lunr\Gravity\Database\MySQL\MySQLQueryEscaper;
use Lunr\Halo\LunrBaseTest;
use ReflectionClass;

/**
 * This class contains the tests for the MySQLQueryEscaper class.
 *
 * @covers Lunr\Gravity\Database\MySQLQueryEscaper
 */
abstract class MySQLQueryEscaperTest extends LunrBaseTest
{

    /**
     * Mock instance of the MySQLConnection class.
     * @var MySQLConnection
     */
    protected $db;

    /**
     * Testcase Constructor.
     */
    public function setUp()
    {
        $this->db = $this->getMockBuilder('Lunr\Gravity\Database\MySQL\MySQLConnection')
                         ->disableOriginalConstructor()
                         ->getMock();

        $this->class = new MySQLQueryEscaper($this->db);

        $this->reflection = new ReflectionClass('Lunr\Gravity\Database\MySQL\MySQLQueryEscaper');
    }

    /**
     * Testcase Destructor.
     */
    public function tearDown()
    {
        unset($this->db);
        unset($this->class);
        unset($this->reflection);
    }

    /**
     * Unit Test Data Provider for invalid indices.
     *
     * @return array $indices Array of invalid indices
     */
    public function invalidIndicesProvider()
    {
        $indices   = [];
        $indices[] = [ NULL ];
        $indices[] = [ FALSE ];
        $indices[] = [ 'string' ];
        $indices[] = [ new \stdClass() ];
        $indices[] = [ [] ];

        return $indices;
    }

    /**
     * Unit Test Data Provider for valid Index Keywords.
     *
     * @return array $keywords Array of valid index keywords.
     */
    public function validIndexKeywordProvider()
    {
        $keywords   = [];
        $keywords[] = [ 'USE' ];
        $keywords[] = [ 'IGNORE' ];
        $keywords[] = [ 'FORCE' ];

        return $keywords;
    }

    /**
     * Unit Test Data Provider for valid Index use definitions.
     *
     * @return array $for Array of valid index use definitions.
     */
    public function validIndexForProvider()
    {
        $for   = [];
        $for[] = [ 'JOIN' ];
        $for[] = [ 'ORDER BY' ];
        $for[] = [ 'GROUP BY' ];
        $for[] = [ '' ];

        return $for;
    }

}

?>


text:
FROM node:0.10.36-slim
MAINTAINER Christophe Hamerling <chamerling@linagora.com>

COPY package.json /var/www/package.json
RUN cd /var/www && npm install --production

WORKDIR /var/www
CMD ['node', 'dist/server/index.js']


text:
ActiveRecord::Schema.define(version: 20160620130704) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

  create_table "admins", force: :cascade do |t|
    t.string   "email",                  default: "", null: false
    t.string   "encrypted_password",     default: "", null: false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          default: 0,  null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "username",               default: "", null: false
  end

  add_index "admins", ["email"], name: "index_admins_on_email", unique: true, using: :btree
  add_index "admins", ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true, using: :btree
  add_index "admins", ["username"], name: "index_admins_on_username", unique: true, using: :btree

  create_table "conferences", force: :cascade do |t|
    t.string   "name"
    t.integer  "year_id"
    t.datetime "date"
    t.integer  "attenders"
    t.datetime "created_at",            null: false
    t.datetime "updated_at",            null: false
    t.string   "report"
    t.string   "location"
    t.boolean  "published"
    t.date     "registration_deadline"
    t.string   "video"
    t.string   "photo"
    t.boolean  "group_event"
  end

  create_table "configurations", force: :cascade do |t|
    t.boolean "apply_date_validation"
  end

  create_table "contacts", force: :cascade do |t|
    t.string   "name"
    t.string   "surname"
    t.string   "telephone"
    t.string   "email"
    t.string   "skype"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "contacts_locations", id: false, force: :cascade do |t|
    t.integer "contact_id"
    t.integer "location_id"
  end

  add_index "contacts_locations", ["contact_id"], name: "index_contacts_locations_on_contact_id", using: :btree
  add_index "contacts_locations", ["location_id"], name: "index_contacts_locations_on_location_id", using: :btree

  create_table "event_types", force: :cascade do |t|
    t.string   "name"
    t.string   "description"
    t.datetime "default_duration"
    t.string   "color"
    t.string   "image"
    t.datetime "created_at",       null: false
    t.datetime "updated_at",       null: false
    t.boolean  "speaker_event"
    t.boolean  "groupable"
  end

  create_table "events", force: :cascade do |t|
    t.string   "title"
    t.integer  "conference_id"
    t.integer  "speaker_id"
    t.integer  "event_type_id"
    t.datetime "created_at",             null: false
    t.datetime "updated_at",             null: false
    t.text     "description"
    t.datetime "duration"
    t.integer  "position"
    t.string   "responsable"
    t.string   "video"
    t.string   "materials_file_name"
    t.string   "materials_content_type"
    t.integer  "materials_file_size"
    t.datetime "materials_updated_at"
    t.boolean  "published"
    t.string   "materials_link"
  end

  create_table "invitations", force: :cascade do |t|
    t.string   "email"
    t.string   "conference_id"
    t.string   "message_id"
    t.datetime "created_at",    null: false
    t.datetime "updated_at",    null: false
    t.string   "email_hash"
    t.string   "status"
  end

  create_table "locations", force: :cascade do |t|
    t.string   "address"
    t.float    "latitude"
    t.float    "longitude"
    t.integer  "conference_id"
    t.datetime "created_at",    null: false
    t.datetime "updated_at",    null: false
    t.string   "place_type"
    t.string   "name"
    t.string   "city"
    t.text     "how_to_find"
  end

  create_table "messages", force: :cascade do |t|
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.text     "content"
    t.integer  "version"
  end

  create_table "news", force: :cascade do |t|
    t.string   "title"
    t.text     "content"
    t.integer  "conference_id"
    t.datetime "created_at",    null: false
    t.datetime "updated_at",    null: false
  end

  create_table "reports", force: :cascade do |t|
    t.string   "report"
    t.datetime "created_at",    null: false
    t.datetime "updated_at",    null: false
    t.string   "responsable"
    t.string   "title"
    t.string   "description"
    t.integer  "conference_id"
  end

  create_table "speakers", force: :cascade do |t|
    t.string   "name"
    t.datetime "created_at",         null: false
    t.datetime "updated_at",         null: false
    t.text     "description"
    t.string   "surname"
    t.string   "email"
    t.string   "facebook"
    t.string   "linkedin"
    t.string   "site"
    t.string   "photo_file_name"
    t.string   "photo_content_type"
    t.integer  "photo_file_size"
    t.datetime "photo_updated_at"
    t.string   "position"
    t.string   "twitter"
  end

  create_table "years", force: :cascade do |t|
    t.string   "name"
    t.text     "content"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.boolean  "published"
  end

end


text:
def popularNFeatures(numFeatures, topFeatures, possibleFeatures,
                     numFeatureRequests, featureRequests):
    # we first convert everything to lowercase for consistent processing
    featureRequests = [feature.lower() for feature in featureRequests]
    possibleFeatures = [possible.lower() for possible in possibleFeatures]
    print(featureRequests)
    print(possibleFeatures)

    featureCountDict = dict()
    for featureRequest in featureRequests:
        featureDict = getFeaturesFromRequest(featureRequest, possibleFeatures)
        for key in featureDict.keys():
            if key not in featureCountDict:
                featureCountDict[key] = 0
            featureCountDict[key] += featureDict[key]
    print(featureCountDict)

    # sort the List by value and then by key alphabetically
    sortedDict = sorted(featureCountDict.items(), key=lambda k: (k[1], k[0]), reverse=True)
    print(sortedDict)

    topFeatures = sortedDict[:topFeatures]
    topFeatures = [tup[0] for tup in topFeatures]
    print(topFeatures)
    return topFeatures

def getFeaturesFromRequest(featureRequest, listOfFeatures):
    featureDict = dict()
    for feature in listOfFeatures:
        if feature in featureRequest:
            featureDict[feature] = 1
    print(featureDict)
    return featureDict

possibleFeautres = ['anacell', 'betacellular', 'cetracular', 'deltacellular', 'eurocell']
featureRequests = ['Best service by anacell', 'betacElluLar', 'anacell provides much better than all other']
popularNFeatures(5,2,possibleFeautres,5,featureRequests)


text:
\hypertarget{classcrap_1_1memory__manager}{}\section{crap\+:\+:memory\+\_\+manager Class Reference}
\label{classcrap_1_1memory__manager}\index{crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}}

{\ttfamily \#include $<$memorymanager.\+h$>$}

\subsection*{Classes}
\begin{DoxyCompactItemize}
\item
struct \hyperlink{structcrap_1_1memory__manager_1_1configuration}{configuration}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hyperlink{config__x86_8h_a5a40526b8d842e7ff731509998bb0f1c}{C\+R\+A\+P\+\_\+\+I\+N\+L\+I\+N\+E} \hyperlink{classcrap_1_1memory__manager_a93051d0ffc02d2ab63a57b2017f09d3a}{memory\+\_\+manager} (const \hyperlink{structcrap_1_1memory__manager_1_1configuration}{configuration} \&\hyperlink{unittests_2source_2configuration_8cpp_ab299729ec441e3eaf9b96a1eb763e02f}{config})
\item
\hyperlink{config__x86_8h_a5a40526b8d842e7ff731509998bb0f1c}{C\+R\+A\+P\+\_\+\+I\+N\+L\+I\+N\+E} \hyperlink{classcrap_1_1memory__manager_ada901cbb868877d6d9af948281d24f07}{$\sim$memory\+\_\+manager} (void)
\item
\hyperlink{config__x86_8h_a5a40526b8d842e7ff731509998bb0f1c}{C\+R\+A\+P\+\_\+\+I\+N\+L\+I\+N\+E} void $\ast$ \hyperlink{classcrap_1_1memory__manager_aae41530d552578aa6d78ffec96dec69e}{allocate} (uint32\+\_\+t size)
\item
\hyperlink{config__x86_8h_a5a40526b8d842e7ff731509998bb0f1c}{C\+R\+A\+P\+\_\+\+I\+N\+L\+I\+N\+E} void \hyperlink{classcrap_1_1memory__manager_a3c6568f92b8a533287697480b702e285}{deallocate} (void $\ast$ptr)
\item
\hyperlink{config__x86_8h_a5a40526b8d842e7ff731509998bb0f1c}{C\+R\+A\+P\+\_\+\+I\+N\+L\+I\+N\+E} \hyperlink{classcrap_1_1memory__stack}{memory\+\_\+stack} $\ast$ \hyperlink{classcrap_1_1memory__manager_a4bdb547c679ac3549ff4f53d308c24d4}{get\+\_\+stack} (void)
\item
\hyperlink{config__x86_8h_a5a40526b8d842e7ff731509998bb0f1c}{C\+R\+A\+P\+\_\+\+I\+N\+L\+I\+N\+E} void \hyperlink{classcrap_1_1memory__manager_a3a23f795ece223dfad4bc89af91c6743}{create\+\_\+stack} (void)
\item
\hyperlink{config__x86_8h_a5a40526b8d842e7ff731509998bb0f1c}{C\+R\+A\+P\+\_\+\+I\+N\+L\+I\+N\+E} void \hyperlink{classcrap_1_1memory__manager_a482f48449775ae5fd889881ccfb61d08}{destroy\+\_\+stack} (void)
\end{DoxyCompactItemize}

\subsection{Detailed Description}

Definition at line 47 of file memorymanager.\+h.

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classcrap_1_1memory__manager_a93051d0ffc02d2ab63a57b2017f09d3a}{}\index{crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}!memory\+\_\+manager@{memory\+\_\+manager}}
\index{memory\+\_\+manager@{memory\+\_\+manager}!crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}}
\subsubsection[{memory\+\_\+manager}]{\setlength{\rightskip}{0pt plus 5cm}crap\+::memory\+\_\+manager\+::memory\+\_\+manager (
\begin{DoxyParamCaption}
\item[{const {\bf configuration} \&}]{config}
\end{DoxyParamCaption}
)}\label{classcrap_1_1memory__manager_a93051d0ffc02d2ab63a57b2017f09d3a}

Definition at line 108 of file memorymanager.\+h.

\hypertarget{classcrap_1_1memory__manager_ada901cbb868877d6d9af948281d24f07}{}\index{crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}!````~memory\+\_\+manager@{$\sim$memory\+\_\+manager}}
\index{````~memory\+\_\+manager@{$\sim$memory\+\_\+manager}!crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}}
\subsubsection[{$\sim$memory\+\_\+manager}]{\setlength{\rightskip}{0pt plus 5cm}crap\+::memory\+\_\+manager\+::$\sim$memory\+\_\+manager (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classcrap_1_1memory__manager_ada901cbb868877d6d9af948281d24f07}

Definition at line 126 of file memorymanager.\+h.

\subsection{Member Function Documentation}
\hypertarget{classcrap_1_1memory__manager_aae41530d552578aa6d78ffec96dec69e}{}\index{crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}!allocate@{allocate}}
\index{allocate@{allocate}!crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}}
\subsubsection[{allocate}]{\setlength{\rightskip}{0pt plus 5cm}void $\ast$ crap\+::memory\+\_\+manager\+::allocate (
\begin{DoxyParamCaption}
\item[{uint32\+\_\+t}]{size}
\end{DoxyParamCaption}
)}\label{classcrap_1_1memory__manager_aae41530d552578aa6d78ffec96dec69e}

Definition at line 141 of file memorymanager.\+h.

\hypertarget{classcrap_1_1memory__manager_a3a23f795ece223dfad4bc89af91c6743}{}\index{crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}!create\+\_\+stack@{create\+\_\+stack}}
\index{create\+\_\+stack@{create\+\_\+stack}!crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}}
\subsubsection[{create\+\_\+stack}]{\setlength{\rightskip}{0pt plus 5cm}void crap\+::memory\+\_\+manager\+::create\+\_\+stack (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classcrap_1_1memory__manager_a3a23f795ece223dfad4bc89af91c6743}

Definition at line 208 of file memorymanager.\+h.

\hypertarget{classcrap_1_1memory__manager_a3c6568f92b8a533287697480b702e285}{}\index{crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}!deallocate@{deallocate}}
\index{deallocate@{deallocate}!crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}}
\subsubsection[{deallocate}]{\setlength{\rightskip}{0pt plus 5cm}void crap\+::memory\+\_\+manager\+::deallocate (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{ptr}
\end{DoxyParamCaption}
)}\label{classcrap_1_1memory__manager_a3c6568f92b8a533287697480b702e285}

Definition at line 174 of file memorymanager.\+h.

\hypertarget{classcrap_1_1memory__manager_a482f48449775ae5fd889881ccfb61d08}{}\index{crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}!destroy\+\_\+stack@{destroy\+\_\+stack}}
\index{destroy\+\_\+stack@{destroy\+\_\+stack}!crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}}
\subsubsection[{destroy\+\_\+stack}]{\setlength{\rightskip}{0pt plus 5cm}void crap\+::memory\+\_\+manager\+::destroy\+\_\+stack (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classcrap_1_1memory__manager_a482f48449775ae5fd889881ccfb61d08}

Definition at line 218 of file memorymanager.\+h.

\hypertarget{classcrap_1_1memory__manager_a4bdb547c679ac3549ff4f53d308c24d4}{}\index{crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}!get\+\_\+stack@{get\+\_\+stack}}
\index{get\+\_\+stack@{get\+\_\+stack}!crap\+::memory\+\_\+manager@{crap\+::memory\+\_\+manager}}
\subsubsection[{get\+\_\+stack}]{\setlength{\rightskip}{0pt plus 5cm}{\bf memory\+\_\+stack} $\ast$ crap\+::memory\+\_\+manager\+::get\+\_\+stack (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classcrap_1_1memory__manager_a4bdb547c679ac3549ff4f53d308c24d4}

Definition at line 201 of file memorymanager.\+h.

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
/mnt/windows/data/programming/crapengine2/source/core/include/memory/\hyperlink{memorymanager_8h}{memorymanager.\+h}\end{DoxyCompactItemize}


text:
package seelog

import (
	"strings"
	"testing"
)

func TestConfig(t *testing.T) {
	testConfig :=
		`
<seelog levels="trace, debug">
	<exceptions>
		<exception funcpattern="*getFirst*" filepattern="*" minlevel="off" />
		<exception funcpattern="*getSecond*" filepattern="*" levels="info, error" />
	</exceptions>
</seelog>
`

	conf, err := configFromReader(strings.NewReader(testConfig))
	if err != nil {
		t.Errorf("parse error: %s\n", err.Error())
		return
	}

	context, err := currentContext()
	if err != nil {
		t.Errorf("cannot get current context:" + err.Error())
		return
	}
	firstContext, err := getFirstContext()
	if err != nil {
		t.Errorf("cannot get current context:" + err.Error())
		return
	}
	secondContext, err := getSecondContext()
	if err != nil {
		t.Errorf("cannot get current context:" + err.Error())
		return
	}

	if !conf.IsAllowed(TraceLvl, context) {
		t.Errorf("error: deny trace in current context")
	}
	if conf.IsAllowed(TraceLvl, firstContext) {
		t.Errorf("error: allow trace in first context")
	}
	if conf.IsAllowed(ErrorLvl, context) {
		t.Errorf("error: allow error in current context")
	}
	if !conf.IsAllowed(ErrorLvl, secondContext) {
		t.Errorf("error: deny error in second context")
	}

	// cache test
	if !conf.IsAllowed(TraceLvl, context) {
		t.Errorf("error: deny trace in current context")
	}
	if conf.IsAllowed(TraceLvl, firstContext) {
		t.Errorf("error: allow trace in first context")
	}
	if conf.IsAllowed(ErrorLvl, context) {
		t.Errorf("error: allow error in current context")
	}
	if !conf.IsAllowed(ErrorLvl, secondContext) {
		t.Errorf("error: deny error in second context")
	}
}

func getFirstContext() (LogContextInterface, error) {
	return currentContext()
}

func getSecondContext() (LogContextInterface, error) {
	return currentContext()
}


text:
module Tito
  class Event < Base

    extend Eventable::ClassMethods

    def self.resource_path(request_type = nil)
      return "events" if request_type == :all
      nil
    end

    def path
      "#{account_slug}/#{slug}"
    end

    def put_path
      path
    end

    def post_path
      "#{account_slug}/events"
    end

    # property :title, type: :string
    # property :slug, type: :string
    # property :account_slug, type: :string
    # property :security_token, type: :string

    # def account_id
    #   attributes['account_id'] || attributes['account-id']
    # end

    # def account_id=(val)
    #   attributes['account_id'] = val
    # end

    # def security_token
    #   attributes['security_token'] || attributes['security-token']
    # end

    # def account_slug
    #   attributes['account_slug'] || attributes['account-slug']
    # end

    # class << self

    #   def get(path)
    #     parts = path.split('/')
    #     where(account_id: parts[0]).find(parts[1]).first
    #   end

    #   def path(params=nil)
    #     prefix_path = '%{account_id}'
    #     path_params = params.delete(:path) || params
    #     parts = [].unshift(prefix_path % path_params.symbolize_keys)
    #     if !params[:id]
    #       parts << 'events'
    #     end
    #     File.join(*parts)
    #     rescue KeyError
    #       raise ArgumentError, "Please make sure to include account_id"
    #   end
    # end
  end
end


text:
#ifndef XENIA_UI_IMGUI_DIALOG_H_
#define XENIA_UI_IMGUI_DIALOG_H_

#include <memory>

#include "xenia/base/threading.h"
#include "xenia/ui/imgui_drawer.h"
#include "xenia/ui/window_listener.h"

namespace xe {
namespace ui {

class ImGuiDialog : private WindowListener {
 public:
  ~ImGuiDialog();

  // Shows a simple message box containing a text message.
  // Callers can want for the dialog to close with Wait().
  // Dialogs retain themselves and will delete themselves when closed.
  static ImGuiDialog* ShowMessageBox(Window* window, std::string title,
                                     std::string body);

  // A fence to signal when the dialog is closed.
  void Then(xe::threading::Fence* fence);

 protected:
  ImGuiDialog(Window* window);

  Window* window() const { return window_; }
  ImGuiIO& GetIO();

  // Closes the dialog and returns to any waiters.
  void Close();

  virtual void OnShow() {}
  virtual void OnClose() {}
  virtual void OnDraw(ImGuiIO& io) {}

 private:
  void OnPaint(UIEvent* e) override;

  Window* window_ = nullptr;
  bool had_imgui_active_ = false;
  bool has_close_pending_ = false;
  std::vector<xe::threading::Fence*> waiting_fences_;
};

}  // namespace ui
}  // namespace xe

#endif  // XENIA_UI_IMGUI_DIALOG_H_


text:
package org.xtreemfs.common.libxtreemfs;

import java.io.IOException;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.xtreemfs.common.libxtreemfs.exceptions.AddressToUUIDNotFoundException;
import org.xtreemfs.common.libxtreemfs.exceptions.VolumeNotFoundException;
import org.xtreemfs.dir.DIRConfig;
import org.xtreemfs.dir.DIRRequestDispatcher;
import org.xtreemfs.foundation.logging.Logging;
import org.xtreemfs.foundation.pbrpc.client.RPCAuthentication;
import org.xtreemfs.foundation.pbrpc.generatedinterfaces.RPC.Auth;
import org.xtreemfs.foundation.pbrpc.generatedinterfaces.RPC.UserCredentials;
import org.xtreemfs.foundation.util.FSUtils;
import org.xtreemfs.test.SetupUtils;
import org.xtreemfs.test.TestEnvironment;

public class UUIDResolverTest extends TestCase {
    private DIRRequestDispatcher dir;

    private TestEnvironment      testEnv;

    private final DIRConfig            dirConfig;

    private UserCredentials      userCredentials;

    private final Auth                 auth = RPCAuthentication.authNone;

    /**
     *
     */
    public UUIDResolverTest() throws IOException {
        Logging.start(SetupUtils.DEBUG_LEVEL, SetupUtils.DEBUG_CATEGORIES);

        dirConfig = SetupUtils.createDIRConfig();
    }

    @Override
    @Before
    public void setUp() throws Exception {
        System.out.println("TEST: " + getClass().getSimpleName());

        FSUtils.delTree(new java.io.File(SetupUtils.TEST_DIR));

        dir = new DIRRequestDispatcher(dirConfig, SetupUtils.createDIRdbsConfig());
        dir.startup();
        dir.waitForStartup();

        testEnv = new TestEnvironment(new TestEnvironment.Services[] { TestEnvironment.Services.DIR_CLIENT,
                TestEnvironment.Services.TIME_SYNC, TestEnvironment.Services.RPC_CLIENT,
                TestEnvironment.Services.MRC, TestEnvironment.Services.OSD });
        testEnv.start();

        userCredentials = UserCredentials.newBuilder().setUsername("test").addGroups("test").build();
    }

    @Override
    @After
    public void tearDown() throws Exception {
        testEnv.shutdown();

        dir.shutdown();

        dir.waitForShutdown();
    }

    public void testUUIDResolver() throws Exception {
        final String VOLUME_NAME_1 = "foobar";
        final String VOLUME_NAME_2 = "barfoo";

        Options options = new Options();

        String dirAddress = testEnv.getDIRAddress().getHostName() + ":" + testEnv.getDIRAddress().getPort();

        ClientImplementation client = (ClientImplementation) ClientFactory.createClient(dirAddress,
                userCredentials, null, options);
        client.start();

        UUIDResolver resolver = client;

        String mrcAddress = testEnv.getMRCAddress().getHostName() + ":" + testEnv.getMRCAddress().getPort();

        // Create volumes
        client.createVolume(mrcAddress, auth, userCredentials, VOLUME_NAME_1);
        client.createVolume(mrcAddress, auth, userCredentials, VOLUME_NAME_2);

        // get and MRC UUID for the volume. Should be that from the only MRC.
        String uuidString = client.volumeNameToMRCUUID(VOLUME_NAME_1);
        assertEquals(SetupUtils.getMRC1UUID().toString(), uuidString);

        // same for the second volume
        uuidString = resolver.volumeNameToMRCUUID(VOLUME_NAME_2);
        assertEquals(SetupUtils.getMRC1UUID().toString(), uuidString);

        // should also work with snapshots
        uuidString = resolver.volumeNameToMRCUUID(VOLUME_NAME_2 + "@snapshotname");
        assertEquals(SetupUtils.getMRC1UUID().toString(), uuidString);

        // this should work if we use UUIDIterator, too.
        UUIDIterator uuidIterator = new UUIDIterator();
        client.volumeNameToMRCUUID(VOLUME_NAME_1, uuidIterator);
        assertEquals(SetupUtils.getMRC1UUID().toString(), uuidIterator.getUUID());

        // resolve MRC UUID
        String address = resolver.uuidToAddress(SetupUtils.getMRC1UUID().toString());
        assertEquals(testEnv.getMRCAddress().getHostName() + ":" + testEnv.getMRCAddress().getPort(), address);

        // resolve OSD UUID
        address = resolver.uuidToAddress(SetupUtils.createMultipleOSDConfigs(1)[0].getUUID().toString());
        assertEquals(testEnv.getOSDAddress().getHostName() + ":" + testEnv.getOSDAddress().getPort(), address);

        // resolve non existing uuid
        try {
            address = resolver.uuidToAddress("this-is-not-a-valid-uuid");
            fail("Resolve invalid uuid. Should have thrown an exception");
        } catch (AddressToUUIDNotFoundException e) {
        }

        // resolve non exsiting volume name
        try {
            uuidString = resolver.volumeNameToMRCUUID("non-existing-volume");
            fail("Volume doensn't exist! Should have thrown an exception");
        } catch (VolumeNotFoundException e) {
        }

        // resolve non existing volume with uuidIterator.
        try {
            resolver.volumeNameToMRCUUID("non-existing-volume", new UUIDIterator());
            fail("Volume doensn't exist! Should have thrown an exception");
        } catch (VolumeNotFoundException e) {
        }

        // if there is no correct connection the resolver cant resolve and
        // should throw an VolumeNotFoundException
        // Do not retry here to avoid unnecessary lengthy executions.
        options.setMaxTries(1);
        ClientImplementation clientFail = (ClientImplementation) ClientFactory.createClient(
                "doesntexists:44444", userCredentials, null, options);
        clientFail.start();
        UUIDResolver resolverFail = clientFail;
        try {
            resolverFail.volumeNameToMRCUUID("dummy-name");
            fail("There was no correct client initialization. Shouldn't " + "be able to resovle something");
        } catch (VolumeNotFoundException e) {
        }

        // should work with uuidIterator, too
        try {
            resolverFail.volumeNameToMRCUUID("dummy-name", new UUIDIterator());
            fail("There was no correct client initialization. Shouldn't " + "be able to resovle something");
        } catch (VolumeNotFoundException e) {
        }

        // shutdown the client
        client.shutdown();
    }

}


text:
static void JreStringBuilder_move(JreStringBuilder *self, jint size, jint index);

static void OutOfMemory() {
  @throw [[[JavaLangOutOfMemoryError alloc] init] autorelease];
}

static inline void NewBuffer(JreStringBuilder *sb, jint size) {
  sb->buffer_ = (jchar *)malloc(size * sizeof(jchar));
  if (__builtin_expect(sb->buffer_ == NULL, 0)) {
    OutOfMemory();
  }
  sb->bufferSize_ = size;
}

static JavaLangStringIndexOutOfBoundsException *IndexAndLength(JreStringBuilder *sb, jint index) {
  @throw [[[JavaLangStringIndexOutOfBoundsException alloc] initWithNSString:
          [NSString stringWithFormat:@"this.length=%d; index=%d", sb->count_, index
          ]] autorelease];
}

static JavaLangStringIndexOutOfBoundsException *StartEndAndLength(
    JreStringBuilder *sb, jint start, jint end) {
  @throw [[[JavaLangStringIndexOutOfBoundsException alloc] initWithNSString:
          [NSString stringWithFormat:@"this.length=%d; start=%d; length=%d", sb->count_, start,
          end - start]] autorelease];
}

@implementation JavaLangAbstractStringBuilder

- (IOSCharArray *)getValue {
  return [IOSCharArray arrayWithChars:delegate_.buffer_ count:delegate_.count_];
}

void JreStringBuilder_initWithCapacity(JreStringBuilder *sb, jint capacity) {
  NewBuffer(sb, capacity);
  sb->count_ = 0;
}

- (instancetype)initPackagePrivate {
  JavaLangAbstractStringBuilder_initPackagePrivate(self);
  return self;
}

- (instancetype)initPackagePrivateWithInt:(jint)capacity {
  JavaLangAbstractStringBuilder_initPackagePrivateWithInt_(self, capacity);
  return self;
}

- (instancetype)initWithNSString:(NSString *)string {
  JavaLangAbstractStringBuilder_initWithNSString_(self, string);
  return self;
}

void JavaLangAbstractStringBuilder_initPackagePrivate(JavaLangAbstractStringBuilder *self) {
  NewBuffer(&self->delegate_, INITIAL_CAPACITY);
}

void JavaLangAbstractStringBuilder_initPackagePrivateWithInt_(
    JavaLangAbstractStringBuilder *self, jint capacity) {
  if (capacity < 0) {
    @throw [[[JavaLangNegativeArraySizeException alloc] initWithNSString:
        JavaLangInteger_toStringWithInt_(capacity)] autorelease];
  }
  NewBuffer(&self->delegate_, capacity);
}

void JavaLangAbstractStringBuilder_initWithNSString_(
    JavaLangAbstractStringBuilder *self, NSString *string) {
  (void)nil_chk(string);
  self->delegate_.count_ = (jint)[string length];
  NewBuffer(&self->delegate_, self->delegate_.count_ + INITIAL_CAPACITY);
  [string getCharacters:self->delegate_.buffer_ range:NSMakeRange(0, self->delegate_.count_)];
}

static void EnlargeBuffer(JreStringBuilder *sb, jint min) {
  jint newSize = MAX(((sb->bufferSize_ >> 1) + sb->bufferSize_) + 2, min);
  sb->buffer_ = (jchar *)realloc(sb->buffer_, newSize * sizeof(jchar));
  if (__builtin_expect(sb->buffer_ == NULL, 0)) {
    OutOfMemory();
  }
  sb->bufferSize_ = newSize;
}

static void EnsureCapacity(JreStringBuilder *sb, jint size) {
  if (size > sb->bufferSize_) {
    EnlargeBuffer(sb, size);
  }
}

void JreStringBuilder_appendNull(JreStringBuilder *sb) {
  jint newCount = sb->count_ + 4;
  EnsureCapacity(sb, newCount);
  jchar *buf = sb->buffer_ + sb->count_;
  *(buf++) = 'n';
  *(buf++) = 'u';
  *(buf++) = 'l';
  *(buf++) = 'l';
  sb->count_ += 4;
}

void JreStringBuilder_appendBuffer(JreStringBuilder *sb, const unichar *buffer, int length) {
  int newCount = sb->count_ + length;
  EnsureCapacity(sb, newCount);
  memcpy(sb->buffer_ + sb->count_, buffer, length * sizeof(jchar));
  sb->count_ = newCount;
}

void JreStringBuilder_appendStringBuffer(JreStringBuilder *sb, JavaLangStringBuffer *toAppend) {
  if (toAppend) {
    @synchronized(toAppend) {
      JreStringBuilder_appendBuffer(sb, toAppend->delegate_.buffer_, toAppend->delegate_.count_);
    }
  } else {
    JreStringBuilder_appendNull(sb);
  }
}

void JreStringBuilder_appendCharArray(JreStringBuilder *sb, IOSCharArray *chars) {
  (void)nil_chk(chars);
  JreStringBuilder_appendBuffer(sb, chars->buffer_, chars->size_);
}

void JreStringBuilder_appendCharArraySubset(
    JreStringBuilder *sb, IOSCharArray *chars, jint offset, jint length) {
  (void)nil_chk(chars);
  IOSArray_checkRange(chars->size_, offset, length);
  JreStringBuilder_appendBuffer(sb, chars->buffer_ + offset, length);
}

void JreStringBuilder_appendChar(JreStringBuilder *sb, jchar ch) {
  EnsureCapacity(sb, sb->count_ + 1);
  sb->buffer_[sb->count_++] = ch;
}

void JreStringBuilder_appendString(JreStringBuilder *sb, NSString *string) {
  if (string == nil) {
    JreStringBuilder_appendNull(sb);
    return;
  }
  jint length = (jint)CFStringGetLength((CFStringRef)string);
  jint newCount = sb->count_ + length;
  EnsureCapacity(sb, newCount);
  CFStringGetCharacters((CFStringRef)string, CFRangeMake(0, length), sb->buffer_ + sb->count_);
  sb->count_ = newCount;
}

void JreStringBuilder_appendCharSequence(JreStringBuilder *sb, id<JavaLangCharSequence> s) {
  if (s) {
    JreStringBuilder_appendCharSequenceSubset(sb, s, 0, [s java_length]);
  } else {
    JreStringBuilder_appendNull(sb);
  }
}

void JreStringBuilder_appendCharSequenceSubset(
    JreStringBuilder *sb, id<JavaLangCharSequence> s, jint start, jint end) {
  if (s == nil) {
    s = @"null";
  }
  if ((start | end) < 0 || start > end || end > [s java_length]) {
    @throw [[[JavaLangIndexOutOfBoundsException alloc] init] autorelease];
  }
  jint length = end - start;
  jint newCount = sb->count_ + length;
  EnsureCapacity(sb, newCount);
  if ([s isKindOfClass:[NSString class]]) {
    [(NSString *)s getCharacters:sb->buffer_ + sb->count_ range:NSMakeRange(start, end - start)];
  } else if ([s isKindOfClass:[JavaLangAbstractStringBuilder class]]) {
    JavaLangAbstractStringBuilder *other = (JavaLangAbstractStringBuilder *)s;
    memcpy(sb->buffer_ + sb->count_, other->delegate_.buffer_ + start, length * sizeof(jchar));
  } else {
    jint j = sb->count_;
    for (jint i = start; i < end; i++) {
      sb->buffer_[j++] = [s charAtWithInt:i];
    }
  }
  sb->count_ = newCount;
}

void JreStringBuilder_appendInt(JreStringBuilder *sb, jint i) {
  if (i == JavaLangInteger_MIN_VALUE) {
    JreStringBuilder_appendString(sb, @"-2147483648");
    return;
  }
  jint appendedLength = (i < 0) ? JavaLangInteger_stringSizeWithInt_(-i) + 1
      : JavaLangInteger_stringSizeWithInt_(i);
  jint newCount = sb->count_ + appendedLength;
  EnsureCapacity(sb, newCount);
  JavaLangInteger_getCharsRaw(i, newCount, sb->buffer_);
  sb->count_ = newCount;
}

void JreStringBuilder_appendLong(JreStringBuilder *sb, jlong l) {
  if (l == JavaLangLong_MIN_VALUE) {
    JreStringBuilder_appendString(sb, @"-9223372036854775808");
    return;
  }
  jint appendedLength = (l < 0) ? JavaLangLong_stringSizeWithLong_(-l) + 1
      : JavaLangLong_stringSizeWithLong_(l);
  jint newCount = sb->count_ + appendedLength;
  EnsureCapacity(sb, newCount);
  JavaLangLong_getCharsRaw(l, newCount, sb->buffer_);
  sb->count_ = newCount;
}

void JreStringBuilder_appendDouble(JreStringBuilder *sb, jdouble d) {
  SunMiscFloatingDecimal_appendToWithDouble_withId_(d, (id)sb);
}

void JreStringBuilder_appendFloat(JreStringBuilder *sb, jfloat f) {
  SunMiscFloatingDecimal_appendToWithFloat_withId_(f, (id)sb);
}

- (jint)capacity {
  return delegate_.bufferSize_;
}

- (jchar)charAtWithInt:(jint)index {
  if (index < 0 || index >= delegate_.count_) {
    @throw IndexAndLength(&delegate_, index);
  }
  return delegate_.buffer_[index];
}

void JreStringBuilder_delete(JreStringBuilder *sb, jint start, jint end) {
  if (start >= 0) {
    if (end > sb->count_) {
      end = sb->count_;
    }
    if (end == start) {
      return;
    }
    if (end > start) {
      jint length = sb->count_ - end;
      if (length >= 0) {
        memmove(sb->buffer_ + start, sb->buffer_ + end, length * sizeof(jchar));
      }
      sb->count_ -= end - start;
      return;
    }
  }
  @throw StartEndAndLength(sb, start, end);
}

void JreStringBuilder_deleteCharAt(JreStringBuilder *sb, jint index) {
  if (index < 0 || index >= sb->count_) {
    @throw IndexAndLength(sb, index);
  }
  jint length = sb->count_ - index - 1;
  if (length > 0) {
    memmove(sb->buffer_ + index, sb->buffer_ + index + 1, length * sizeof(jchar));
  }
  sb->count_--;
}

- (void)ensureCapacityWithInt:(jint)min {
  if (min > delegate_.bufferSize_) {
    jint ourMin = delegate_.bufferSize_ * 2 + 2;
    EnlargeBuffer(&delegate_, MAX(ourMin, min));
  }
}

- (void)getCharsWithInt:(jint)start
                withInt:(jint)end
          withCharArray:(IOSCharArray *)dst
                withInt:(jint)dstStart {
  if (start > delegate_.count_ || end > delegate_.count_ || start > end) {
    @throw StartEndAndLength(&delegate_, start, end);
  }
  jint length = end - start;
  IOSArray_checkRange(delegate_.bufferSize_, start, length);
  (void)nil_chk(dst);
  IOSArray_checkRange(dst->size_, dstStart, length);
  memcpy(dst->buffer_ + dstStart, delegate_.buffer_ + start, length * sizeof(jchar));
}

void JreStringBuilder_insertCharArray(JreStringBuilder *sb, jint index, IOSCharArray *chars) {
  if (index < 0 || index > sb->count_) {
    @throw IndexAndLength(sb, index);
  }
  (void)nil_chk(chars);
  if (chars->size_ != 0) {
    JreStringBuilder_move(sb, chars->size_, index);
    memcpy(sb->buffer_ + index, chars->buffer_, chars->size_ * sizeof(jchar));
    sb->count_ += chars->size_;
  }
}

void JreStringBuilder_insertCharArraySubset(
    JreStringBuilder *sb, jint index, IOSCharArray *chars, jint start, jint length) {
  (void)nil_chk(chars);
  if (index >= 0 && index <= sb->count_) {
    if (start >= 0 && length >= 0 && length <= chars->size_ - start) {
      if (length != 0) {
        JreStringBuilder_move(sb, length, index);
        memcpy(sb->buffer_ + index, chars->buffer_ + start, length * sizeof(jchar));
        sb->count_ += length;
      }
      return;
    }
  }
  @throw [[[JavaLangStringIndexOutOfBoundsException alloc] initWithNSString:
      [NSString stringWithFormat:@"this.length=%d; index=%d; chars.length=%d; start=%d; length=%d",
          sb->count_, index, chars->size_, start, length]] autorelease];
}

void JreStringBuilder_insertChar(JreStringBuilder *sb, jint index, jchar ch) {
  if (index < 0 || index > sb->count_) {
    @throw [[[JavaLangArrayIndexOutOfBoundsException alloc] initWithNSString:
        [NSString stringWithFormat:@"this.length=%d; index=%d", sb->count_, index
        ]] autorelease];
  }
  JreStringBuilder_move(sb, 1, index);
  sb->buffer_[index] = ch;
  sb->count_++;
}

void JreStringBuilder_insertString(JreStringBuilder *sb, jint index, NSString *string) {
  if (index >= 0 && index <= sb->count_) {
    if (string == nil) {
      string = @"null";
    }
    jint min = (jint)[string length];
    if (min != 0) {
      JreStringBuilder_move(sb, min, index);
      [string getCharacters:sb->buffer_ + index range:NSMakeRange(0, min)];
      sb->count_ += min;
    }
  } else {
    @throw IndexAndLength(sb, index);
  }
}

void JreStringBuilder_insertCharSequence(
    JreStringBuilder *sb, jint index, id<JavaLangCharSequence> s, jint start,
    jint end) {
  if (s == nil) {
    s = @"null";
  }
  if ((index | start | end) < 0 || index > sb->count_ || start > end
      || end > [s java_length]) {
    @throw [[[JavaLangIndexOutOfBoundsException alloc] init] autorelease];
  }
  JreStringBuilder_insertString(sb, index, [[s subSequenceFrom:start to:end] description]);
}

- (jint)java_length {
  return delegate_.count_;
}

void JreStringBuilder_move(JreStringBuilder *sb, jint size, jint index) {
  jint newCount;
  if (sb->bufferSize_ - sb->count_ >= size) {
    memmove(sb->buffer_ + index + size, sb->buffer_ + index,
        (sb->count_ - index) * sizeof(jchar));
    return;
  }
  newCount = MAX(sb->count_ + size, sb->bufferSize_ * 2 + 2);
  jchar *oldBuffer = sb->buffer_;
  NewBuffer(sb, newCount);
  memcpy(sb->buffer_, oldBuffer, index * sizeof(jchar));
  memcpy(sb->buffer_ + index + size, oldBuffer + index, (sb->count_ - index) * sizeof(jchar));
  free(oldBuffer);
}

void JreStringBuilder_replace(JreStringBuilder *sb, jint start, jint end, NSString *string) {
  if (start >= 0) {
    if (end > sb->count_) {
      end = sb->count_;
    }
    if (end > start) {
      (void)nil_chk(string);
      jint stringLength = (jint)[string length];
      jint diff = end - start - stringLength;
      if (diff > 0) {
        memmove(sb->buffer_ + start + stringLength, sb->buffer_ + end,
            (sb->count_ - end) * sizeof(jchar));
      } else if (diff < 0) {
        JreStringBuilder_move(sb, -diff, end);
      }
      [string getCharacters:sb->buffer_ + start range:NSMakeRange(0, stringLength)];
      sb->count_ -= diff;
      return;
    }
    if (start == end) {
      if (string == nil) {
        @throw [[[JavaLangNullPointerException alloc]
            initWithNSString:@"string == null"] autorelease];
      }
      JreStringBuilder_insertString(sb, start, string);
      return;
    }
  }
  @throw StartEndAndLength(sb, start, end);
}

void JreStringBuilder_reverse(JreStringBuilder *sb) {
  if (sb->count_ < 2) {
    return;
  }
  jchar *buf = sb->buffer_;
  jint end = sb->count_ - 1;
  jchar frontHigh = buf[0];
  jchar endLow = buf[end];
  jboolean allowFrontSur = true, allowEndSur = true;
  for (jint i = 0, mid = sb->count_ / 2; i < mid; i++, --end) {
    jchar frontLow = buf[i + 1];
    jchar endHigh = buf[end - 1];
    jboolean surAtFront = allowFrontSur && frontLow >= (jint)0xdc00 && frontLow <= (jint)0xdfff
        && frontHigh >= (jint)0xd800 && frontHigh <= (jint)0xdbff;
    if (surAtFront && (sb->count_ < 3)) {
      return;
    }
    jboolean surAtEnd = allowEndSur && endHigh >= (jint)0xd800 && endHigh <= (jint)0xdbff
        && endLow >= (jint)0xdc00 && endLow <= (jint)0xdfff;
    allowFrontSur = allowEndSur = true;
    if (surAtFront == surAtEnd) {
      if (surAtFront) {
        buf[end] = frontLow;
        buf[end - 1] = frontHigh;
        buf[i] = endHigh;
        buf[i + 1] = endLow;
        frontHigh = buf[i + 2];
        endLow = buf[end - 2];
        i++;
        end--;
      } else {
        buf[end] = frontHigh;
        buf[i] = endLow;
        frontHigh = frontLow;
        endLow = endHigh;
      }
    } else {
      if (surAtFront) {
        buf[end] = frontLow;
        buf[i] = endLow;
        endLow = endHigh;
        allowFrontSur = false;
      } else {
        buf[end] = frontHigh;
        buf[i] = endHigh;
        frontHigh = frontLow;
        allowEndSur = false;
      }
    }
  }
  if ((sb->count_ & 1) == 1 && (!allowFrontSur || !allowEndSur)) {
    buf[end] = allowFrontSur ? endLow : frontHigh;
  }
}

- (void)setCharAtWithInt:(jint)index
                withChar:(jchar)ch {
  if (index < 0 || index >= delegate_.count_) {
    @throw IndexAndLength(&delegate_, index);
  }
  delegate_.buffer_[index] = ch;
}

- (void)setLengthWithInt:(jint)length {
  if (length < 0) {
    @throw [[[JavaLangStringIndexOutOfBoundsException alloc]
        initWithNSString:[NSString stringWithFormat:@"length < 0: %d", length]] autorelease];
  }
  EnsureCapacity(&delegate_, length);
  if (delegate_.count_ < length) {
    memset(delegate_.buffer_ + delegate_.count_, 0, (length - delegate_.count_) * sizeof(jchar));
  }
  delegate_.count_ = length;
}

- (NSString *)substringWithInt:(jint)start {
  if (start >= 0 && start <= delegate_.count_) {
    if (start == delegate_.count_) {
      return @"";
    }
    return [NSString stringWithCharacters:delegate_.buffer_ + start
                                   length:delegate_.count_ - start];
  }
  @throw IndexAndLength(&delegate_, start);
}

- (NSString *)substringWithInt:(jint)start
                       withInt:(jint)end {
  if (start >= 0 && start <= end && end <= delegate_.count_) {
    if (start == end) {
      return @"";
    }
    return [NSString stringWithCharacters:delegate_.buffer_ + start length:end - start];
  }
  @throw StartEndAndLength(&delegate_, start, end);
}

- (NSString *)description {
  return JreStringBuilder_toString(&delegate_);
}

NSString *JreStringBuilder_toString(JreStringBuilder *sb) {
  if (sb->count_ == 0) {
    return @"";
  }
  return [NSString stringWithCharacters:sb->buffer_ length:sb->count_];
}

NSString *JreStringBuilder_toStringAndDealloc(JreStringBuilder *sb) {
  if (sb->count_ == 0) {
    free(sb->buffer_);
    return @"";
  }
  NSString *result;
  jint wasted = sb->bufferSize_ - sb->count_;
  // Same test as used by the original AbstractString.java to determine whether
  // to use a shared buffer.
  if (wasted >= 256 || (wasted >= INITIAL_CAPACITY && wasted >= (sb->count_ >> 1))) {
    result = (NSString *)CFStringCreateWithCharacters(NULL, sb->buffer_, sb->count_);
    free(sb->buffer_);
  } else {
    // Don't free the buffer because we're passing it off to the CFString constructor.
    result = (NSString *)CFStringCreateWithCharactersNoCopy(
        NULL, sb->buffer_, sb->count_, kCFAllocatorMalloc);
  }
  return [result autorelease];
}

- (id<JavaLangCharSequence>)subSequenceFrom:(jint)start
                                         to:(jint)end {
  return [self substringWithInt:start withInt:end];
}

- (jint)indexOfWithNSString:(NSString *)string {
  return [self indexOfWithNSString:string withInt:0];
}

- (jint)indexOfWithNSString:(NSString *)subString
                    withInt:(jint)start {
  (void)nil_chk(subString);
  if (start < 0) {
    start = 0;
  }
  jint subCount = (jint)[subString length];
  if (subCount > 0) {
    if (subCount + start > delegate_.count_) {
      return -1;
    }
    jchar firstChar = [subString characterAtIndex:0];
    while (true) {
      jint i = start;
      jboolean found = false;
      for (; i < delegate_.count_; i++) {
        if (delegate_.buffer_[i] == firstChar) {
          found = true;
          break;
        }
      }
      if (!found || subCount + i > delegate_.count_) {
        return -1;
      }
      jint o1 = i, o2 = 0;
      while (++o2 < subCount && delegate_.buffer_[++o1] == [subString characterAtIndex:o2]) {
      }
      if (o2 == subCount) {
        return i;
      }
      start = i + 1;
    }
  }
  return (start < delegate_.count_ || start == 0) ? start : delegate_.count_;
}

- (jint)lastIndexOfWithNSString:(NSString *)string {
  return [self lastIndexOfWithNSString:string withInt:delegate_.count_];
}

- (jint)lastIndexOfWithNSString:(NSString *)subString
                        withInt:(jint)start {
  (void)nil_chk(subString);
  jint subCount = (jint)[subString length];
  if (subCount <= delegate_.count_ && start >= 0) {
    if (subCount > 0) {
      if (start > delegate_.count_ - subCount) {
        start = delegate_.count_ - subCount;
      }
      jchar firstChar = [subString characterAtIndex:0];
      while (true) {
        jint i = start;
        jboolean found = false;
        for (; i >= 0; --i) {
          if (delegate_.buffer_[i] == firstChar) {
            found = true;
            break;
          }
        }
        if (!found) {
          return -1;
        }
        jint o1 = i, o2 = 0;
        while (++o2 < subCount && delegate_.buffer_[++o1] == [subString characterAtIndex:o2]) {
        }
        if (o2 == subCount) {
          return i;
        }
        start = i - 1;
      }
    }
    return start < delegate_.count_ ? start : delegate_.count_;
  }
  return -1;
}

- (void)trimToSize {
  if (delegate_.count_ < delegate_.bufferSize_) {
    jchar *oldBuffer = delegate_.buffer_;
    NewBuffer(&delegate_, delegate_.count_);
    memcpy(delegate_.buffer_, oldBuffer, delegate_.count_ * sizeof(jchar));
    free(oldBuffer);
  }
}

// Defined in Character.java
jint JavaLangCharacter_codePointAtRaw(const jchar *seq, jint index, jint limit);
jint JavaLangCharacter_codePointBeforeRaw(const jchar *seq, jint index, jint start);
jint JavaLangCharacter_codePointCountRaw(const jchar *seq, jint offset, jint count);
jint JavaLangCharacter_offsetByCodePointsRaw(
    const jchar *seq, jint start, jint count, jint index, jint codePointOffset);

- (jint)codePointAtWithInt:(jint)index {
  if (index < 0 || index >= delegate_.count_) {
    @throw IndexAndLength(&delegate_, index);
  }
  return JavaLangCharacter_codePointAtRaw(delegate_.buffer_, index, delegate_.count_);
}

- (jint)codePointBeforeWithInt:(jint)index {
  if (index < 1 || index > delegate_.count_) {
    @throw IndexAndLength(&delegate_, index);
  }
  return JavaLangCharacter_codePointBeforeRaw(delegate_.buffer_, index, 0);
}

- (jint)codePointCountWithInt:(jint)start
                      withInt:(jint)end {
  if (start < 0 || end > delegate_.count_ || start > end) {
    @throw StartEndAndLength(&delegate_, start, end);
  }
  return JavaLangCharacter_codePointCountRaw(delegate_.buffer_, start, end - start);
}

- (jint)offsetByCodePointsWithInt:(jint)index
                          withInt:(jint)codePointOffset {
  return JavaLangCharacter_offsetByCodePointsRaw(
      delegate_.buffer_, 0, delegate_.count_, index, codePointOffset);
}

// Default methods in java.lang.CharSequence.
- (id<JavaUtilStreamIntStream>)chars {
  return JavaLangCharSequence_chars(self);
}

- (id<JavaUtilStreamIntStream>)codePoints {
  return JavaLangCharSequence_codePoints(self);
}

- (id<JavaLangAppendable>)appendWithJavaLangCharSequence:(id<JavaLangCharSequence>)cs {
  // can't call an abstract method
  [self doesNotRecognizeSelector:_cmd];
  return 0;
}

- (id<JavaLangAppendable>)appendWithJavaLangCharSequence:(id<JavaLangCharSequence>)cs
                                                 withInt:(jint)start
                                                 withInt:(jint)end {
  // can't call an abstract method
  [self doesNotRecognizeSelector:_cmd];
  return 0;
}

- (void)dealloc {
  free(delegate_.buffer_);
  [super dealloc];
}

// Suppress undeclared-selector warnings to avoid creating method bodies
// for all the abstract methods which are implemented in subclasses.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"

+ (const J2ObjcClassInfo *)__metadata {
  static J2ObjcMethodInfo methods[] = {
    { NULL, NULL, 0x0, -1, -1, -1, -1, -1, -1 },
    { NULL, NULL, 0x0, -1, 0, -1, -1, -1, -1 },
    { NULL, "I", 0x1, 1, -1, -1, -1, -1, -1 },
    { NULL, "I", 0x1, -1, -1, -1, -1, -1, -1 },
    { NULL, "V", 0x1, 2, 0, -1, -1, -1, -1 },
    { NULL, "V", 0x1, -1, -1, -1, -1, -1, -1 },
    { NULL, "V", 0x1, 3, 0, -1, -1, -1, -1 },
    { NULL, "C", 0x1, 4, 0, -1, -1, -1, -1 },
    { NULL, "I", 0x1, 5, 0, -1, -1, -1, -1 },
    { NULL, "I", 0x1, 6, 0, -1, -1, -1, -1 },
    { NULL, "I", 0x1, 7, 8, -1, -1, -1, -1 },
    { NULL, "I", 0x1, 9, 8, -1, -1, -1, -1 },
    { NULL, "V", 0x1, 10, 11, -1, -1, -1, -1 },
    { NULL, "V", 0x1, 12, 13, -1, -1, -1, -1 },
    { NULL, "LNSString;", 0x1, 14, 0, -1, -1, -1, -1 },
    { NULL, "LJavaLangCharSequence;", 0x1, 15, 8, -1, -1, -1, -1 },
    { NULL, "LNSString;", 0x1, 14, 8, -1, -1, -1, -1 },
    { NULL, "I", 0x1, 16, 17, -1, -1, -1, -1 },
    { NULL, "I", 0x1, 16, 18, -1, -1, -1, -1 },
    { NULL, "I", 0x1, 19, 17, -1, -1, -1, -1 },
    { NULL, "I", 0x1, 19, 18, -1, -1, -1, -1 },
    { NULL, "LNSString;", 0x401, 20, -1, -1, -1, -1, -1 },
    { NULL, "[C", 0x10, -1, -1, -1, -1, -1, -1 },
  };
  #pragma clang diagnostic push
  #pragma clang diagnostic ignored "-Wobjc-multiple-method-names"
  methods[0].selector = @selector(initPackagePrivate);
  methods[1].selector = @selector(initPackagePrivateWithInt:);
  methods[2].selector = @selector(java_length);
  methods[3].selector = @selector(capacity);
  methods[4].selector = @selector(ensureCapacityWithInt:);
  methods[5].selector = @selector(trimToSize);
  methods[6].selector = @selector(setLengthWithInt:);
  methods[7].selector = @selector(charAtWithInt:);
  methods[8].selector = @selector(codePointAtWithInt:);
  methods[9].selector = @selector(codePointBeforeWithInt:);
  methods[10].selector = @selector(codePointCountWithInt:withInt:);
  methods[11].selector = @selector(offsetByCodePointsWithInt:withInt:);
  methods[12].selector = @selector(getCharsWithInt:withInt:withCharArray:withInt:);
  methods[13].selector = @selector(setCharAtWithInt:withChar:);
  methods[14].selector = @selector(substringWithInt:);
  methods[15].selector = @selector(subSequenceFrom:to:);
  methods[16].selector = @selector(substringWithInt:withInt:);
  methods[17].selector = @selector(indexOfWithNSString:);
  methods[18].selector = @selector(indexOfWithNSString:withInt:);
  methods[19].selector = @selector(lastIndexOfWithNSString:);
  methods[20].selector = @selector(lastIndexOfWithNSString:withInt:);
  methods[21].selector = @selector(description);
  methods[22].selector = @selector(getValue);
  #pragma clang diagnostic pop
  static const void *ptrTable[] = {
    "I", "length", "ensureCapacity", "setLength", "charAt", "codePointAt", "codePointBefore",
    "codePointCount", "II", "offsetByCodePoints", "getChars", "II[CI", "setCharAt", "IC",
    "substring", "subSequence", "indexOf", "LNSString;", "LNSString;I", "lastIndexOf", "toString"
  };
  static const J2ObjcClassInfo _JavaLangAbstractStringBuilder = {
    "AbstractStringBuilder", "java.lang", ptrTable, methods, NULL, 7, 0x400, 23, 0, -1, -1, -1, -1,
    -1 };
  return &_JavaLangAbstractStringBuilder;
}

#pragma clang diagnostic pop

@end


text:
// Defines default validators in a separate file from the rest of the config
// system, to enable its separability from these.

(function() {
  /**
    * Ensures that data is one of a fixed set of items.
    * Also supports argument sytax: EnumValidator("Dog", "Cat", "Fish");
    *
    * @param {Array.<string>} list The list of valid values.
    */
  gadgets.config.EnumValidator = function(list) {
    var listItems = [];
    if (arguments.length > 1) {
      for (var i = 0, arg; (arg = arguments[i]); ++i) {
        listItems.push(arg);
      }
    } else {
      listItems = list;
    }
    return function(data) {
      for (var i = 0, test; (test = listItems[i]); ++i) {
        if (data === listItems[i]) {
          return true;
        }
      }
      return false;
    };
  };

  /**
   * Tests the value against a regular expression.
   * @member gadgets.config
   */
  gadgets.config.RegExValidator = function(re) {
    return function(data) {
      return re.test(data);
    };
  };

  /**
   * Validates that a value was provided.
   * @param {*} data
   */
  gadgets.config.ExistsValidator = function(data) {
    return typeof data !== 'undefined';
  };

  /**
   * Validates that a value is a non-empty string.
   * @param {*} data
   */
  gadgets.config.NonEmptyStringValidator = function(data) {
    return typeof data === 'string' && data.length > 0;
  };

  /**
   * Validates that the value is a boolean.
   * @param {*} data
   */
  gadgets.config.BooleanValidator = function(data) {
    return typeof data === 'boolean';
  };

  /**
   * Similar to the ECMAScript 4 virtual typing system, ensures that
   * whatever object was passed in is "like" the existing object.
   * Doesn't actually do type validation though, but instead relies
   * on other validators.
   *
   * This can be used recursively as well to validate sub-objects.
   *
   * @example
   *
   *  var validator = new gadgets.config.LikeValidator(
   *    "booleanField" : gadgets.config.BooleanValidator,
   *    "regexField" : new gadgets.config.RegExValidator(/foo.+/);
   *  );
   *
   *
   * @param {Object} test The object to test against.
   */
  gadgets.config.LikeValidator = function(test) {
    return function(data) {
      for (var member in test) {
        if (test.hasOwnProperty(member)) {
          var t = test[member];
          if (!t(data[member])) {
            return false;
          }
        }
      }
      return true;
    };
  };
})();