text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="7e5520b2-0b81-449b-bd5b-d72470a14e85" name="Default Changelist" comment="">
      <change beforePath="$PROJECT_DIR$/LICENSE" beforeDir="false" afterPath="$PROJECT_DIR$/LICENSE" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
    </list>
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/prompter.go">
          <provider selected="true" editor-type-id="text-editor" />
        </entry>
      </file>
      <file pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/README.md">
          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
            <state split_layout="FIRST">
              <first_editor relative-caret-position="585">
                <caret line="84" lean-forward="true" selection-start-line="84" selection-end-line="84" />
              </first_editor>
              <second_editor />
            </state>
          </provider>
        </entry>
      </file>
      <file pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/LICENSE">
          <provider selected="true" editor-type-id="text-editor">
            <state>
              <caret column="5" selection-start-column="5" selection-end-column="5" />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindInProjectRecents">
    <findStrings>
      <find>posse</find>
    </findStrings>
  </component>
  <component name="GOROOT" path="/opt/google/go/1.11" />
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/README.md" />
        <option value="$PROJECT_DIR$/LICENSE" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds" extendedState="6">
    <option name="x" value="1500" />
    <option name="y" value="42" />
    <option name="width" value="1500" />
    <option name="height" value="1860" />
  </component>
  <component name="ProjectLevelVcsManager">
    <ConfirmationsSetting value="1" id="Add" />
  </component>
  <component name="ProjectView">
    <navigator proportions="" version="1">
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <expand>
            <path>
              <item name="tardy" type="b2602c69:ProjectViewProjectNode" />
              <item name="tardy" type="462c0819:PsiDirectoryNode" />
            </path>
          </expand>
          <select />
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="go.gopath.indexing.explicitly.defined" value="true" />
    <property name="go.sdk.automatically.set" value="true" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="42" width="3000" height="1860" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Favorites" side_tool="true" />
      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25" />
      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
      <window_info anchor="bottom" id="Docker" show_stripe_button="false" />
      <window_info anchor="bottom" id="Database Changes" />
      <window_info anchor="bottom" id="Version Control" />
      <window_info anchor="bottom" id="Terminal" />
      <window_info anchor="bottom" id="Event Log" side_tool="true" />
      <window_info anchor="bottom" id="Message" order="0" />
      <window_info anchor="bottom" id="Find" order="1" />
      <window_info anchor="bottom" id="Run" order="2" />
      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
      <window_info anchor="bottom" id="TODO" order="6" />
      <window_info anchor="right" id="Database" />
      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="version" value="1" />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/prompter.go">
      <provider selected="true" editor-type-id="text-editor" />
    </entry>
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
        <state split_layout="FIRST">
          <first_editor relative-caret-position="585">
            <caret line="84" lean-forward="true" selection-start-line="84" selection-end-line="84" />
          </first_editor>
          <second_editor />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/LICENSE">
      <provider selected="true" editor-type-id="text-editor">
        <state>
          <caret column="5" selection-start-column="5" selection-end-column="5" />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
class AddCommentsClosedToTopics < ActiveRecord::Migration
  def change
    add_column :topics, :comments_closed, :boolean, null: false, default: false
  end
end

redpajama_set_name: RedPajamaGithub


text:
/*
 Route360° JavaScript API v0.2.1 (c426fca), a JS library for leaflet maps. http://route360.net
 (c) 2014 Henning Hollburg and Daniel Gerber, (c) 2014 Motion Intelligence GmbH
*/
(function (window, document, undefined) {r360.photonPlaceAutoCompleteControl = function (options) {
    return new r360.PhotonPlaceAutoCompleteControl(options);
};

r360.PhotonPlaceAutoCompleteControl = L.Control.extend({

    initialize: function(options){

        this.options = JSON.parse(JSON.stringify(r360.config.photonPlaceAutoCompleteOptions));

        if ( typeof options !== "undefined" ) {

            if ( _.has(options, 'position'))    this.options.position    = options.position;
            if ( _.has(options, 'label'))       this.options.label       = options.label;
            if ( _.has(options, 'country'))     this.options.country     = options.country;
            if ( _.has(options, 'reset'))       this.options.reset       = options.reset;
            if ( _.has(options, 'reverse'))     this.options.reverse     = options.reverse;
            if ( _.has(options, 'placeholder')) this.options.placeholder = options.placeholder;
            if ( _.has(options, 'width'))       this.options.width       = options.width;
            if ( _.has(options, 'maxRows'))     this.options.maxRows     = options.maxRows;
            if ( _.has(options, 'image'))       this.options.image       = options.image;
            if ( _.has(options, 'index'))       this.options.index       = options.index;
            if ( _.has(options, 'options')) {

                 this.options.options    = options.options;
                 this.options.travelType = _.has(this.options.options, 'init') ? this.options.options.init : 'walk';
            }
        }
    },

    onAdd: function(map){

        var that = this;
        var i18n            = r360.config.i18n;
        var countrySelector =  "";
        var nameContainer   = L.DomUtil.create('div', that._container);
        that.options.map    = map;
        that.options.id     = $(map._container).attr("id") + r360.Util.generateId(10);

        map.on("resize", that.onResize.bind(that));

        // calculate the width in dependency to the number of buttons attached to the field
        var width = that.options.width;
        // if ( that.options.reset ) width += 44;
        // if ( that.options.reverse ) width += 37;
        var style = 'style="width:'+ width +'px;"';

        that.options.input =
            '
 \
                <input id="autocomplete-'+that.options.id+'" style="color: black;width:'+width+'" \
                type="text" class="form-control r360-autocomplete" placeholder="' + that.options.placeholder + '" onclick="this.select()">';

        if ( that.options.image ) {

            that.options.input +=
                ' \
                     \
                 ';
        }

        var optionsHtml = [];
        // if ( that.options.options ) {

            that.options.input +=
                ' \
                    <button class="btn btn-autocomplete" type="button" title="' + i18n.get('settings') + '"></button> \
                ';

            optionsHtml.push('
');
            optionsHtml.push('
');

            if ( that.options.options && that.options.options.walk )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'walk' ? 'active' : '') +
                    '" travel-type="walk"> Walkzu Fuß</button>');

            if ( that.options.options && that.options.options.bike )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'bike' ? 'active' : '') +
                    '" travel-type="bike"> BikeFahrrad</button>');

            if ( that.options.options && that.options.options.hirebike )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'hirebike' ? 'active' : '') +
                    '" travel-type="hirebike"> \
                             Hire BikeLeihfahrrad\
                        </button>');

            if ( that.options.options && that.options.options.transit )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'transit' ? 'active' : '') +
                    '" travel-type="transit"> TransitÖPNV</button>');

            if ( that.options.options && that.options.options.car )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'car' ? 'active' : '') +
                    '" travel-type="car"> CarAuto</button>');

            optionsHtml.push('
');
            optionsHtml.push('
');
        // }

        // add a reset button to the input field
        // if ( that.options.reset ) {

             that.options.input +=
                ' \
                    <button class="btn btn-autocomplete" type="button" title="' + i18n.get('reverse') + '"></button> \
                ';

            that.options.input +=
                ' \
                    <button class="btn btn-autocomplete" type="button" title="' + i18n.get('reset') + '"></button> \
                ';
        // }
        // if ( that.options.reverse ) {

        // }

        that.options.input += '
';
        if ( that.options.options ) that.options.input += optionsHtml.join('');

        // add the control to the map
        $(nameContainer).append(that.options.input);

        $(nameContainer).find('#' + that.options.id + '-reset').click(function(){ that.options.onReset(); });
        $(nameContainer).find('#' + that.options.id + '-reverse').click(function(){ that.options.onReverse(); });
        $(nameContainer).find('#' + that.options.id + '-options-button').click(
            function(){
                // slide in or out on the click of the options button
                $('#' + that.options.id + '-options').slideToggle();
            });

        $(nameContainer).find('.travel-type-button').click(function(){

            $(nameContainer).find('.travel-type-button').removeClass('active');
            $(this).addClass('active');

            setTimeout(function() {
                  $('#' + that.options.id + '-options').slideToggle();
            }, 300);

            that.options.travelType = $(this).attr('travel-type');
            that.options.onTravelTypeChange();
        });

        // no click on the map, if click on container
        L.DomEvent.disableClickPropagation(nameContainer);

        if ( _.has(that.options, 'country' ) ) countrySelector += " AND country:" + that.options.country;

        $(nameContainer).find("#autocomplete-" + that.options.id).autocomplete({

            source: function( request, response ) {

                that.source = this;

                var requestElements = request.term.split(" ");
                var numbers = new Array();
                var requestString = "";
                var numberString = "";

                for(var i = 0; i < requestElements.length; i++){

                    if(requestElements[i].search(".*[0-9].*") != -1)
                        numbers.push(requestElements[i]);
                    else
                        requestString += requestElements[i] + " ";
                }

                if ( numbers.length > 0 ) {
                    numberString += " OR ";

                    for(var j = 0; j < numbers.length; j++){
                        var n = "(postcode : " + numbers[j] + " OR housenumber : " + numbers[j] + " OR street : " + numbers[j] + ") ";
                        numberString +=  n;
                    }
                }

                console.log(that.options.map.getCenter());

                $.ajax({
                    url: that.options.serviceUrl,
                    // dataType: "jsonp",
                    // jsonp: 'json.wrf',
                    async: false,
                    data: {
                      // wt:'json',
                      // indent : true,
                      // rows: that.options.maxRows,
                      // qt: 'en',
                      // q:  "(" + requestString + numberString + ")" + countrySelector
                      q : requestString,
                      limit : that.options.maxRows
                      // lat : that.options.map.getCenter().lat,
                      // lon : that.options.map.getCenter().lng
                    },
                    success: function( data ) {

                        var places = new Array();
                        response( $.map( data.features, function( feature ) {

                            if ( feature.osm_key == "boundary" ) return;

                            var place           = {};
                            var firstRow        = [];
                            var secondRow       = [];
                            place.name          = feature.properties.name;
                            place.city          = feature.properties.city;
                            place.street        = feature.properties.street;
                            place.housenumber   = feature.properties.housenumber;
                            place.country       = feature.properties.country;
                            place.postalCode    = feature.properties.postcode;
                            if (place.name)       firstRow.push(place.name);
                            if (place.city)       firstRow.push(place.city);
                            if (place.street)     secondRow.push(place.street);
                            if (place.housenumber) secondRow.push(place.housenumber);
                            if (place.postalCode) secondRow.push(place.postalCode);
                            if (place.city)       secondRow.push(place.city);

                            // only show country if undefined
                            // if ( !_.has(that.options, 'country') && place.country )
                                secondRow.push(place.country);

                            // if same looking object is in list already: return
                            if ( _.contains(places, firstRow.join() + secondRow.join()) ) return;
                            else places.push(firstRow.join() + secondRow.join());

                            return {
                                label       : firstRow.join(", "),
                                value       : firstRow.join(", "),
                                firstRow    : firstRow.join(", "),
                                secondRow   : secondRow.join(" "),
                                term        : request.term,
                                index       : that.options.index,
                                latlng      : new L.LatLng(feature.geometry.coordinates[1], feature.geometry.coordinates[0])
                            }
                        }));
                    }
                });
            },
            minLength: 2,

            select: function( event, ui ) {
                that.options.value = ui.item;
                that.options.onSelect(ui.item);
            }
        })
        .data("ui-autocomplete")._renderItem = function( ul, item ) {

            // this has been copied from here: https://github.com/angular-ui/bootstrap/blob/master/src/typeahead/typeahead.js
            // thank you angular bootstrap team
            function escapeRegexp(queryToEscape) {
                return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
            }

            var highlightedFirstRow =
                item.term ? (item.firstRow).replace(new RegExp(escapeRegexp(item.term), 'gi'), '$&') : item.firstRow;

            var highlightedSecondRow =
                item.term ? (item.secondRow).replace(new RegExp(escapeRegexp(item.term), 'gi'), '$&') : item.secondRow;

            var html = ""+ highlightedFirstRow + "
  " + highlightedSecondRow + "";

            return $( "
" ).append(html).appendTo(ul);
        };

        this.onResize();

        return nameContainer;
    },

    onSelect: function(onSelect){

        this.options.onSelect = onSelect;
    },

    onReset: function(onReset){

        this.options.onReset = onReset;
    },

    onReverse: function(onReverse){

       this.options.onReverse = onReverse;
    },

    onTravelTypeChange: function(onTravelTypeChange){

        this.options.onTravelTypeChange = onTravelTypeChange;
    },

    reset : function(){

        this.options.value = {};
        this.setFieldValue("");
    },

    update : function(latLng, fieldValue) {

        this.setLatLng(latLng);
        this.setFieldValue(fieldValue);
    },

    setLatLng : function(latLng) {

        this.options.value.latlng = latLng
    },

    setFieldValue : function(value){

        var that = this;
        $("#autocomplete-" + that.options.id).val(value);
    },

    getFieldValue : function(){

        var that = this;
        return $("#autocomplete-" + that.options.id).val();
    },

    getTravelType : function(){

        return this.options.travelType;
    },

    setValue : function(value){
        this.options.value = value;
    },

    getValue : function(){
        return this.options.value;
    },

    getIndex : function(){
        return this.options.index;
    },

    onResize: function(){

        var that = this;
        if ( this.options.map.getSize().x < 550) $(that.options.input).css({'width':'45px'});
        else $(that.options.input).css({'width':''});
    }
})

r360.placeAutoCompleteControl = function (options) {
    return new r360.PlaceAutoCompleteControl(options);
};

r360.PlaceAutoCompleteControl = L.Control.extend({

    initialize: function(options){

        this.options = JSON.parse(JSON.stringify(r360.config.defaultPlaceAutoCompleteOptions));

        if ( typeof options !== "undefined" ) {

            if ( _.has(options, 'position'))      this.options.position      = options.position;
            if ( _.has(options, 'label'))         this.options.label         = options.label;
            if ( _.has(options, 'country'))       this.options.country       = options.country;
            if ( _.has(options, 'reset'))         this.options.reset         = options.reset;
            if ( _.has(options, 'reverse'))       this.options.reverse       = options.reverse;
            if ( _.has(options, 'placeholder'))   this.options.placeholder   = options.placeholder;
            if ( _.has(options, 'width'))         this.options.width         = options.width;
            if ( _.has(options, 'maxRows'))       this.options.maxRows       = options.maxRows;
            if ( _.has(options, 'showOnStartup')) this.options.showOnStartup = options.showOnStartup;
            if ( _.has(options, 'image'))         this.options.image         = options.image;
            if ( _.has(options, 'index'))         this.options.index         = options.index;
            if ( _.has(options, 'autoHide'))      this.options.autoHide      = options.autoHide;
            if ( _.has(options, 'options')) {

                 this.options.options    = options.options;
                 this.options.travelType = _.has(this.options.options, 'init') ? this.options.options.init : 'walk';
            }
        }
    },

    toggleOptions : function(container){

        var that = this;

        if ( typeof container == 'undefined' )
            $('#' + that.options.id + '-options').slideToggle();
        else
            $(container).find('#' + that.options.id + '-options').slideToggle();
    },

    onAdd: function(map){

        var that = this;
        var i18n            = r360.config.i18n;
        var countrySelector =  "";
        var nameContainer   = L.DomUtil.create('div', that._container);
        that.options.map    = map;
        that.options.id     = $(map._container).attr("id") + r360.Util.generateId(10);

        // $(nameContainer).addClass("r360-box-shadow");

        map.on("resize", that.onResize.bind(that));

        // calculate the width in dependency to the number of buttons attached to the field
        var width = that.options.width;
        // if ( that.options.reset ) width += 44;
        // if ( that.options.reverse ) width += 37;
        var style = 'style="width:'+ width +'px;"';

        that.options.input =
            '
 \
                <input id="autocomplete-'+that.options.id+'" style="color: black;widthe:'+width+'" \
                type="text" class="form-control r360-autocomplete" placeholder="' + that.options.placeholder + '" onclick="this.select()">';

        if ( that.options.image ) {

            that.options.input +=
                ' \
                     \
                 ';
        }

        var optionsHtml = [];
        // if ( that.options.options ) {

            that.options.input +=
                ' \
                    <button id="'+that.options.id+'-options-btn" class="btn btn-autocomplete" type="button" title="' + i18n.get('settings') + '"></button> \
                ';

            optionsHtml.push('
');
            optionsHtml.push('
');

            if ( that.options.options && that.options.options.walk )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'walk' ? 'active' : '') +
                    '" travel-type="walk"> WalkGåzu Fuß</button>');

            if ( that.options.options && that.options.options.bike )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'bike' ? 'active' : '') +
                    '" travel-type="bike"> BikeSykleFahrrad</button>');

            if ( that.options.options && that.options.options.rentbike )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'rentbike' ? 'active' : '') +
                    '" travel-type="rentbike"> \
                             Hire BikeBysykkelLeihfahrrad\
                        </button>');

            if ( that.options.options && that.options.options.rentandreturnbike )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'rentandreturnbike' ? 'active' : '') +
                    '" travel-type="rentandreturnbike"> \
                             Hire & Return BikeBysykkelLeihfahrrad\
                        </button>');

            if ( that.options.options && that.options.options.ebike )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'ebike' ? 'active' : '') +
                    '" travel-type="ebike"> E-BikeElsykkelE-Fahrrad</button>');

            if ( that.options.options && that.options.options.transit )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'transit' ? 'active' : '') +
                    '" travel-type="transit"> TransitTODOÖPNV</button>');

            if ( that.options.options && that.options.options.car )
                optionsHtml.push('<button type="button" class="btn btn-default travel-type-button '
                    + (this.options.travelType == 'car' ? 'active' : '') +
                    '" travel-type="car"> CarTODOAuto</button>');

            optionsHtml.push('
');
            optionsHtml.push('
');
        // }

        // add a reset button to the input field
        // if ( that.options.reset ) {

             that.options.input +=
                ' \
                    <button id="'+that.options.id+'-reverse-button" class="btn btn-autocomplete" type="button" title="' + i18n.get('reverse') + '"></button> \
                ';

            that.options.input +=
                ' \
                    <button id="'+that.options.id+'-reset-button" class="btn btn-autocomplete" type="button" title="' + i18n.get('reset') + '"></button> \
                ';
        // }
        // if ( that.options.reverse ) {

        // }

        that.options.input += '
';
        if ( that.options.options ) that.options.input += optionsHtml.join('');

        // add the control to the map
        $(nameContainer).append(that.options.input);

        $(nameContainer).find('#' + that.options.id + '-reset').click(function(){ that.options.onReset(); });
        $(nameContainer).find('#' + that.options.id + '-reverse').click(function(){ that.options.onReverse(); });
        $(nameContainer).find('#' + that.options.id + '-options-button').click(
            function(){
                // slide in or out on the click of the options button
                $('#' + that.options.id + '-options').slideToggle();
            });

        $(nameContainer).find('.travel-type-button').click(function(){

            $(nameContainer).find('.travel-type-button').removeClass('active');
            $(this).addClass('active');

            if ( that.options.autoHide ) {

                setTimeout(function() {
                    $('#' + that.options.id + '-options').slideToggle();
                }, 300);
            }

            that.options.travelType = $(this).attr('travel-type');
            that.options.onTravelTypeChange();
        });

        // no click on the map, if click on container
        L.DomEvent.disableClickPropagation(nameContainer);

        if ( _.has(that.options, 'country' ) ) countrySelector += " AND country:" + that.options.country;

        $(nameContainer).find("#autocomplete-" + that.options.id).autocomplete({

            source: function( request, response ) {

                that.source = this;

                var requestElements = request.term.split(" ");
                var numbers = new Array();
                var requestString = "";
                var numberString = "";

                for(var i = 0; i < requestElements.length; i++){

                    if(requestElements[i].search(".*[0-9].*") != -1)
                        numbers.push(requestElements[i]);
                    else
                        requestString += requestElements[i] + " ";
                }

                if ( numbers.length > 0 ) {
                    numberString += " OR ";

                    for(var j = 0; j < numbers.length; j++){
                        var n = "(postcode : " + numbers[j] + " OR housenumber : " + numbers[j] + " OR street : " + numbers[j] + ") ";
                        numberString +=  n;
                    }
                }

                // delay: 150,

                $.ajax({
                    url: that.options.serviceUrl,
                    dataType: "jsonp",
                    jsonp: 'json.wrf',
                    async: false,
                    data: {
                      wt:'json',
                      indent : true,
                      rows: that.options.maxRows,
                      qt: 'en',
                      q:  "(" + requestString + numberString + ")" + countrySelector
                    },
                    success: function( data ) {

                        var places = new Array();
                        response( $.map( data.response.docs, function( item ) {

                            if ( item.osm_key == "boundary" ) return;

                            var latlng = item.coordinate.split(',');
                            var place           = {};
                            var firstRow        = [];
                            var secondRow       = [];
                            place.name          = item.name;
                            place.city          = item.city;
                            place.street        = item.street;
                            place.housenumber   = item.housenumber;
                            place.country       = item.country;
                            place.postalCode    = item.postcode;
                            if (place.name)       firstRow.push(place.name);
                            if (place.city)       firstRow.push(place.city);
                            if (place.street)     secondRow.push(place.street);
                            if (place.housenumber) secondRow.push(place.housenumber);
                            if (place.postalCode) secondRow.push(place.postalCode);
                            if (place.city)       secondRow.push(place.city);

                            // only show country if undefined
                            if ( !_.has(that.options, 'country') && place.country ) secondRow.push(place.country);

                            // if same looking object is in list already: return
                            if ( _.contains(places, firstRow.join() + secondRow.join()) ) return;
                            else places.push(firstRow.join() + secondRow.join());

                            return {
                                label       : firstRow.join(", "),
                                value       : firstRow.join(", "),
                                firstRow    : firstRow.join(", "),
                                secondRow   : secondRow.join(" "),
                                term        : request.term,
                                index       : that.options.index,
                                latlng      : new L.LatLng(latlng[0], latlng[1])
                            }
                        }));
                    }
                });
            },
            minLength: 2,

            select: function( event, ui ) {
                that.options.value = ui.item;
                that.options.onSelect(ui.item);
            }
        })
        .data("ui-autocomplete")._renderItem = function( ul, item ) {

            // this has been copied from here: https://github.com/angular-ui/bootstrap/blob/master/src/typeahead/typeahead.js
            // thank you angular bootstrap team
            function escapeRegexp(queryToEscape) {
                return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
            }

            var highlightedFirstRow =
                item.term ? (item.firstRow).replace(new RegExp(escapeRegexp(item.term), 'gi'), '$&') : item.firstRow;

            var highlightedSecondRow =
                item.term ? (item.secondRow).replace(new RegExp(escapeRegexp(item.term), 'gi'), '$&') : item.secondRow;

            var html = ""+ highlightedFirstRow + "
  " + highlightedSecondRow + "";

            return $( "
" ).append(html).appendTo(ul);
        };

        this.onResize();

        return nameContainer;
    },

    onSelect: function(onSelect){

        this.options.onSelect = onSelect;
    },

    onReset: function(onReset){

        this.options.onReset = onReset;
    },

    onReverse: function(onReverse){

       this.options.onReverse = onReverse;
    },

    onTravelTypeChange: function(onTravelTypeChange){

        this.options.onTravelTypeChange = onTravelTypeChange;
    },

    updateI18n : function(source) {

        var that = this;
        $("#autocomplete-" + that.options.id).attr("placeholder", r360.config.i18n.get(source ? 'placeholderSrc' : 'placeholderTrg'));
        $('#' + that.options.id + '-reverse-button').attr('title', r360.config.i18n.get('reverse'));
        $('#' + that.options.id + '-reset-button').attr('title', r360.config.i18n.get('reset'));
        $('#' + that.options.id + '-options-btn').attr('title', r360.config.i18n.get('settings'));

    },

    reset : function(){

        this.options.value = {};
        this.setFieldValue("");
    },

    update : function(latLng, fieldValue) {

        this.setLatLng(latLng);
        this.setFieldValue(fieldValue);
    },

    setLatLng : function(latLng) {

        this.options.value.latlng = latLng
    },

    setFieldValue : function(value){

        var that = this;
        $("#autocomplete-" + that.options.id).val(value);
    },

    getFieldValue : function(){

        var that = this;
        return $("#autocomplete-" + that.options.id).val();
    },

    getTravelType : function(){

        return this.options.travelType;
    },

    setValue : function(value){
        this.options.value = value;
    },

    getValue : function(){
        return this.options.value;
    },

    getIndex : function(){
        return this.options.index;
    },

    onResize: function(){

        var that = this;
        if ( this.options.map.getSize().x < 550) $(that.options.input).css({'width':'45px'});
        else $(that.options.input).css({'width':''});
    }
})

/*
 *
 */
r360.TravelStartDateControl = L.Control.extend({

    options: {
        position: 'topright',
        dateFormat: "yy-mm-dd",
        minDate: 0
    },

    initialize: function (options) {
        L.Util.setOptions(this, options);
    },

    onChange: function (func){
        this.options.onChange = func;
    },

    onAdd: function (map) {
        var that = this;
        that.options.map = map;

        var dateContainer = L.DomUtil.create('div', 'startDatePicker', this._container);

        that.datepicker = $('
');

        $(dateContainer).append(that.datepicker);

        var options = {

            onSelect: function() { that.options.onChange(that.getValue()); },
            firstDay: 1
        }

        var i18n = r360.config.i18n;

        if ( i18n.language != 'en' ) {

            options.monthNames  = i18n.monthNames[i18n.language];
            options.dayNames    = i18n.dayNames[i18n.language];
            options.dayNamesMin = i18n.dayNamesMin[i18n.language];
        }

        $(that.datepicker).datepicker(options);

        L.DomEvent.disableClickPropagation(dateContainer);

        return dateContainer;
    },

    getValue : function() {
        var that = this;
        var date = $(that.datepicker).datepicker({ dateFormat: 'dd-mm-yy' }).val()
        var splitDate = date.split('/');
        var yyyymmdd = splitDate[2] + '' + splitDate[0] + '' + splitDate[1];
        return yyyymmdd;
    }
});

r360.travelStartDateControl = function () {
    return new r360.TravelStartDateControl();
};

/*
 *
 */
r360.TravelStartTimeControl = L.Control.extend({
    options: {
        position    : 'topright',
        range       : false,
        min         : 0,
        max         : 1440 * 60, // start time is now in seconds
        step        : 10 * 60, // start time is now in seconds
        initValue   : 480 * 60, // start time is now in seconds
        value       : 0
    },

    /*
     *
     */
    initialize: function (options) {

        this.options.value = r360.Util.getHoursAndMinutesInSeconds();
        L.Util.setOptions(this, options);
    },

    /*
     *
     */
    onSlideStop: function (func){

        this.options.slideStop = func;
    },

    /*
     *
     */
    minToString: function(minutes){

        minutes = minutes / 60;
        var hours = Math.floor(minutes / 60);
        var min = minutes - (hours * 60);
        if ( hours > 24 ) hours -= 24;
        if ( hours < 10 ) hours = '0' + hours;
        if ( min < 10 ) min = '0' + min;
        if ( min == 0 ) min = '00';
        return ( hours + ':' + min);
    },

    /*
     *
     */
    onAdd: function (map) {

        var that = this;

        that.options.map = map;
        that.options.mapId = $(map._container).attr("id");

        map.on("resize", this.onResize.bind(this));
        // Create a control sliderContainer with a jquery ui slider
        var sliderContainer = L.DomUtil.create('div', 'startTimeSlider', this._container);

        that.miBox = $('
', {"class" : "mi-box"});
        that.startTimeInfo = $('
');
        that.label = $('');
        that.slider = $('
');

        $(sliderContainer).append(that.miBox.append(that.startTimeInfo.append(that.label)).append(that.slider))

        $(that.label).text(r360.config.i18n.get('departure') + ': '+
            that.minToString(this.options.value) + ' ' + r360.Util.getTimeFormat(that.options.value));

        $(that.slider).slider({
            range:  that.options.range,
            value:  that.options.value,
            min:    that.options.min,
            max:    that.options.max,
            step:   that.options.step,

            slide: function (e, ui) {

                $(that.label).text(r360.config.i18n.get('departure') + ': ' +
                    that.minToString(ui.value) + ' ' + r360.Util.getTimeFormat(ui.value));

                that.options.value = ui.value;
            },
            stop: function(e, ui){

                that.options.slideStop(ui.value);
            }
        });

        this.onResize();
       /*
        prevent map click when clicking on slider
        */
        L.DomEvent.disableClickPropagation(sliderContainer);

        return sliderContainer;
    },

    /*
     *
     */
    onResize: function(){

        if ( this.options.map.getSize().x < 550 ) {

            this.removeAndAddClass(this.miBox, 'leaflet-traveltime-slider-container-max', 'leaflet-traveltime-slider-container-min');
            this.removeAndAddClass(this.startTimeInfo, 'travel-time-info-max', 'travel-time-info-min');
            this.removeAndAddClass(this.slider, 'leaflet-traveltime-slider-max', 'leaflet-traveltime-slider-min');
        }
        else {
            this.removeAndAddClass(this.miBox, 'leaflet-traveltime-slider-container-min', 'leaflet-traveltime-slider-container-max');
            this.removeAndAddClass(this.startTimeInfo, 'travel-time-info-min', 'travel-time-info-max');
            this.removeAndAddClass(this.slider, 'leaflet-traveltime-slider-min', 'leaflet-traveltime-slider-max');
        }
    },

    /*
     *
     */
    removeAndAddClass: function(id,oldClass,newClass){

        $(id).addClass(newClass);
        $(id).removeClass(oldClass);
    },

    /*
     *
     */
    getValue : function() {
        return this.options.value;
    }
});

r360.travelStartTimeControl = function () {
    return new r360.TravelStartTimeControl();
};

/*
 *
 */
r360.TravelTimeControl = L.Control.extend({

    /**
      * ...
      *
      * @param {Object} [options] The typical JS options array.
      * @param {Number} [options.position]
      * @param {Number} [options.initValue]
      * @param {Number} [options.label]
      * @param {Array}  [options.travelTimes] Each element of this arrays has to contain a "time" and a "color" field.
      *     An example would be: { time : 600  , color : "#006837"}. The color needs to be specified in HEX notation.
      * @param {Number} [options.icon]
      */
    initialize: function (travelTimeControlOptions) {

        // use the default options
        this.options = JSON.parse(JSON.stringify(r360.config.defaultTravelTimeControlOptions));

        // overwrite default options if possible
        if ( typeof travelTimeControlOptions !== "undefined" ) {

            if ( _.has(travelTimeControlOptions, "position") )    this.options.position     = travelTimeControlOptions.position;
            if ( _.has(travelTimeControlOptions, "unit") )        this.options.unit         = travelTimeControlOptions.unit;
            if ( _.has(travelTimeControlOptions, "initValue") )   this.options.initValue    = travelTimeControlOptions.initValue;
            if ( _.has(travelTimeControlOptions, "label") )       this.options.label        = travelTimeControlOptions.label;
            if ( _.has(travelTimeControlOptions, "travelTimes") ) this.options.travelTimes  = travelTimeControlOptions.travelTimes;
            if ( _.has(travelTimeControlOptions, "icon") )        this.options.icon         = travelTimeControlOptions.icon;
        }

        this.options.maxValue   = _.max(this.options.travelTimes, function(travelTime){ return travelTime.time; }).time / 60;
        this.options.step       = (this.options.travelTimes[1].time - this.options.travelTimes[0].time)/60;
    },

    /*
     *
     */
    onAdd: function (map) {
        var that = this;
        this.options.map = map;
        map.on("resize", this.onResize.bind(this));

        var sliderColors = "";
        var percent = 100 / this.options.travelTimes.length;
        for(var i = 0; i < this.options.travelTimes.length; i++){
            if(i == 0)
                sliderColors += '

';
            else if(i < this.options.travelTimes.length -1)
                sliderColors += '

';
            else if(i == this.options.travelTimes.length -1)
                sliderColors += '

';
        }

        // started to remove jQuery dependency here
        // this.options.miBox = L.DomUtil.create("r360-box", "mi-box");
        // this.options.travelTimeInfo = L.DomUtil.create("travelTimeInfo");
        // this.options.travelTimeControl = L.DomUtil.create("travelTimeControl", "no-border");
        // this.options.travelTimeControlHandle = L.DomUtil.create("travelTimeControlHandle", "ui-slider-handle");

        // this.options.labelSpan = L.DomUtil.create("labelSpan");
        // this.options.labelSpan.innerHTML = this.options.label;

        // if ( this.options.icon != 'undefined' ) {

        //     this.options.iconHTML = new Image;
        //     this.options.iconHTML.src = "picture.gif";
        // }

        // this.options.travelTimeSpan = L.DomUtil.create("travelTimeSpan");
        // this.options.travelTimeSpan.innerHTML = this.options.initValue;
        // var unitSpan = L.DomUtil.create("unitSpan");
        // unitSpan.innerHTML = "min";

        // this.options.sliderContainer.innerHTML += this.options.miBox;
        // this.options.miBox.innerHTML += this.options.travelTimeInfo;
        // this.options.miBox.innerHTML += this.options.travelTimeControl;
        // this.options.travelTimeControl.innerHTML =+ travelTimeControlHandle;

        // Create a control sliderContainer with a jquery ui slider
        this.options.sliderContainer = L.DomUtil.create('div', this._container);

        this.options.miBox = $('
', {"class" : "mi-box"});
        this.options.travelTimeInfo = $('
');
        this.options.travelTimeSlider = $('
', {"class" : "no-border"}).append(sliderColors);
        var travelTimeSliderHandle = $('
', {"class" : "ui-slider-handle"});
        this.options.labelSpan = this.options.label;

        if ( _.has(this.options, 'icon') && this.options.icon !== 'undefined' ) this.options.iconHTML = $('', {"src" : this.options.icon})

        this.options.travelTimeSpan = $('', {"text" : this.options.initValue });
        var unitSpan = $('', {"text" : this.options.unit});

        $(this.options.sliderContainer).append(this.options.miBox);
        this.options.miBox.append(this.options.travelTimeInfo);
        this.options.miBox.append(this.options.travelTimeSlider);
        this.options.travelTimeSlider.append(travelTimeSliderHandle);
        this.options.travelTimeInfo.append(this.options.iconHTML).append(this.options.labelSpan).append(": ").append(this.options.travelTimeSpan).append(unitSpan);

        $(this.options.travelTimeSlider).slider({
            range:  false,
            value:  that.options.initValue,
            min:    0,
            max:    that.options.maxValue,
            step:   that.options.step,

            slide: function (e, ui) {
                if ( ui.value == 0) return false;
                $(that.options.travelTimeSpan).text(ui.value);
            },
            stop: function(e, ui){
                var travelTimes = new Array()
                for(var i = 0; i < ui.value; i+= that.options.step)
                    travelTimes.push(that.options.travelTimes[i/that.options.step]);
                that.options.onSlideStop(travelTimes);
            }
        });
        this.onResize();

        /*
        prevent map click when clicking on slider
        */
        L.DomEvent.disableClickPropagation(this.options.sliderContainer);

        return this.options.sliderContainer;
    },

    /*
     *
     */
    onResize: function(){

        if ( this.options.map.getSize().x < 550 ){
            this.removeAndAddClass(this.options.miBox, 'leaflet-traveltime-slider-container-max', 'leaflet-traveltime-slider-container-min');
            this.removeAndAddClass(this.options.travelTimeInfo, 'travel-time-info-max', 'travel-time-info-min');
            this.removeAndAddClass(this.options.travelTimeSlider, 'leaflet-traveltime-slider-max', 'leaflet-traveltime-slider-min');
        }
        else {

            this.removeAndAddClass(this.options.miBox, 'leaflet-traveltime-slider-container-min', 'leaflet-traveltime-slider-container-max');
            this.removeAndAddClass(this.options.travelTimeInfo, 'travel-time-info-min', 'travel-time-info-max');
            this.removeAndAddClass(this.options.travelTimeSlider, 'leaflet-traveltime-slider-min', 'leaflet-traveltime-slider-max');
        }
    },

    /*
     *
     */
    removeAndAddClass: function(id,oldClass,newClass){
        $(id).addClass(newClass);
        $(id).removeClass(oldClass);
    },

    /*
     *
     */
    onSlideStop: function (onSlideStop) {
        var options = this.options;
        options.onSlideStop = onSlideStop;
    },

    /**
     * [setValue description]
     * @param {[type]} value [description]
     */
    setValue: function(value) {

        $(this.options.travelTimeSlider).slider('value', value);
        $(this.options.travelTimeSpan).text(value);
    },

    /*
     *
     */
    getValues : function() {
        var options = this.options;
        var travelTimes = new Array()

        for(var i = 0; i < $(this.options.travelTimeSlider).slider("value"); i+= options.step)
            travelTimes.push(options.travelTimes[i/options.step].time);

        return travelTimes;
    },

    /**
     * [getMaxValue Returns the maximum selected value in seconds,
     *              internally it used the getValues method and returns the maximum.]
     *
     * @return {[Number]}
     */
    getMaxValue : function() {

        return _.max(this.getValues());
    }
});

r360.travelTimeControl = function (options) {
    return new r360.TravelTimeControl(options);
};

r360.waitControl = function (options) {
    return new L.Control.WaitControl(options);
};

L.Control.WaitControl = L.Control.extend({

    options: {
        position : 'topleft'
    },

    initialize: function (options) {
        L.Util.setOptions(this, options);
    },

    onAdd: function (map) {
        this.options.map = map;
        this.options.mapId = $(map._container).attr("id");

        var waitContainer = L.DomUtil.create('div', 'leaflet-control-wait');
        $(waitContainer).append(
            '
 \
                 '+ (typeof this.options.text != 'undefined' ? this.options.text : r360.config.i18n.get('wait') ) +  '\

');

        return waitContainer;
    },

    updateText : function(html) {

        $('#wait-control-'+this.options.mapId).html(' ' + html);
        $("span[lang][lang!='"+r360.config.i18n.language+"']").hide();
    },

    show : function(){

        $('#wait-control-'+this.options.mapId).show();
    },

    hide : function(){

        $('#wait-control-'+this.options.mapId).hide();
    }
});

r360.htmlControl = function (options) {
    return new L.Control.HtmlControl(options);
};

L.Control.HtmlControl = L.Control.extend({

    options: {
        position: 'topleft',
    },

    initialize: function (options) {
        L.Util.setOptions(this, options);
    },

    onAdd: function (map) {

        // in case of multiple maps per page
        this.options.id  = $(map._container).attr("id") + r360.Util.generateId();

        var htmlContainer = L.DomUtil.create('div', 'leaflet-control-html');
        $(htmlContainer).append('

');

        $(htmlContainer).on('mouseover', function(){ map.scrollWheelZoom.disable(); });
        $(htmlContainer).on('mouseout' , function(){ map.scrollWheelZoom.enable(); });

        return htmlContainer;
    },

    setHtml : function(html) {
        $('#html-control-'+this.options.id).html(html);
    },

    show : function(){

        $('#html-control-'+this.options.id).show();
    },

    hide : function(){

        $('#html-control-'+this.options.id).hide();
    },

    toggle : function(){

        $('#html-control-'+this.options.id).toggle();
    }
});

r360.RadioButtonControl = L.Control.extend({

    initialize: function (options) {

        this.options = JSON.parse(JSON.stringify(r360.config.defaultRadioOptions));

        if ( typeof options !== 'undefined') {

            if ( typeof options.position !== 'undefined' ) this.options.position = options.position;
            if ( typeof options.buttons  !== 'undefined' ) this.options.buttons  = options.buttons;
            if ( typeof options.onChange !== 'undefined' ) this.options.onChange = options.onChange;
        }
        else alert("No buttons supplied!");
    },

    onAdd: function (map) {

        var that = this;

        this.options.map    = map;
        var buttonContainer = L.DomUtil.create('div', this._container);
        this.options.input  = this.getRadioButtonHTML();
        $(buttonContainer).append(this.options.input);

        $(this.options.input).buttonset({}).change(function(){

            that.options.checked = $("input[name='r360_radiobuttongroup_" + that.options.buttonGroupId + "']:checked").attr("key");
            that.options.onChange(that.options.checked);
        });

        $(this.options.input).each(function(index){

            $(this).tooltip({
                open: function( event, ui ) {
                    $("[lang='de'], [lang='en'], [lang='no']").hide();
                    $("[lang='"+r360.config.i18n.language+"']").show();
                },
                content: function () {
                      return $(this).attr('title');
                },
                position: {
                    my: "center top+10",
                    at: "center bottom",
                    using: function( position, feedback ) {
                        $( this ).css( position );
                        $( "
" )
                        .addClass( "arrow top" )
                        .addClass( feedback.vertical )
                        .addClass( feedback.horizontal )
                        .appendTo( this );
                    }
                }
            });
        });

        // prevent map click when clicking on slider
        L.DomEvent.addListener(buttonContainer, 'click', L.DomEvent.stopPropagation);

        return buttonContainer;
    },

    onChange: function (func){
        this.options.onChange = func;
    },

    setValue: function(key) {

        $("input[name='r360_radiobuttongroup_" + this.options.buttonGroupId + "']:checked").next().removeClass("ui-state-active");
        var a = $("input[name='r360_radiobuttongroup_" + this.options.buttonGroupId + "'][key='"+key+"']");
        a.attr("checked", true);
        a.addClass('checked');
        a.next().addClass( "ui-state-active" );
        this.options.checked = key;
    },

    getValue: function(){

        return this.options.checked;
    },

    getRadioButtonHTML: function(){

        var that = this;

        // generate an ID for the complete button group
        that.options.buttonGroupId = r360.Util.generateId(5);

        var div = $('
', { id : that.options.buttonGroupId });
        div.addClass('r360-box-shadow');

        // add each button to the group
        _.each(that.options.buttons, function(button){

            // generate a unique id for each button
            var id = r360.Util.generateId();

            var input = $('<input/>', {
                "type" : 'radio',
                "id"   : 'r360_' + id,
                "value": button.key,
                "key"  : button.key,
                "name" : 'r360_radiobuttongroup_' + that.options.buttonGroupId
            });

            var label = $('', {
                "for"  : 'r360_' + id,
                "html" : button.label
            });

            // make the button selected (default buttin)
            if ( button.checked ) {

                that.options.checked = button.key;
                input.attr({"checked" : "checked"})
            };
            // add a tooltip if one was provided
            if ( typeof button.tooltip != 'undefined' )
                label.attr({"title" : button.tooltip});//
                //{

            //     label.tooltip({
            //         content: "asd",
            //         position: {
            //             my: "center top+10",
            //             at: "center bottom",
            //             using: function( position, feedback ) {
            //                 $( this ).css( position );
            //                 $( "
" )
            //                 .addClass( "arrow top" )
            //                 .addClass( feedback.vertical )
            //                 .addClass( feedback.horizontal )
            //                 .appendTo( this );
            //             }
            //         }
            //     });
            // }

            div.append(input);
            div.append(label);
        });

        return div;
    },
});

r360.radioButtonControl = function (options) {
    return new r360.RadioButtonControl(options);
};

r360.CheckboxButtonControl = L.Control.extend({

    initialize: function (options) {

        this.options = JSON.parse(JSON.stringify(r360.config.defaultRadioOptions));
        this.options.checked = {};

        if ( typeof options !== 'undefined') {

            if ( typeof options.position !== 'undefined' ) this.options.position = options.position;
            if ( typeof options.buttons  !== 'undefined' ) this.options.buttons  = options.buttons;
            if ( typeof options.onChange !== 'undefined' ) this.options.onChange = options.onChange;
        }
        else alert("No buttons supplied!");
    },

    onAdd: function (map) {

        var that = this;

        this.options.map    = map;
        var buttonContainer = L.DomUtil.create('div', this._container);
        this.options.input  = this.getCheckboxButtonHTML();
        $(buttonContainer).append(this.options.input);

        $(this.options.input).buttonset({}).change(function(){

            $("input:checkbox[name='r360_checkboxbuttongroup_" + that.options.buttonGroupId + "']").each(function() {

                if ( $(this).is(':checked') ) that.options.checked[$(this).attr('key')] = true;
                else  that.options.checked[$(this).attr('key')] = false;
            });

            that.options.onChange(that.options.checked);
        });

        $(this.options.input).each(function(){

            $(this).tooltip({
                open: function( event, ui ) {
                    $("[lang='de'], [lang='en'], [lang='no']").hide();
                    $("[lang='"+r360.config.i18n.language+"']").show();
                },
                content: function () {
                      return $(this).attr('title');
                },
                position: {
                    my: "center top+10",
                    at: "center bottom",
                    using: function( position, feedback ) {
                        $( this ).css( position );
                        $( "
" )
                        .addClass( "arrow top" )
                        .addClass( feedback.vertical )
                        .addClass( feedback.horizontal )
                        .appendTo( this );
                    }
                }
            });
        });

        // prevent map click when clicking on slider
        L.DomEvent.addListener(buttonContainer, 'click', L.DomEvent.stopPropagation);

        return buttonContainer;
    },

    onChange: function (func){

        this.options.onChange = func;
    },

    getValue: function(){

        return this.options.checked;
    },

    getId: function(){

        return this.id;
    },

    getCheckboxButtonHTML: function(){

        var that = this;

        // generate an ID for the complete button group
        that.options.buttonGroupId = r360.Util.generateId(5);
        that.id = that.options.buttonGroupId;

        var div = $('
', { id : that.options.buttonGroupId });
        div.addClass('r360-box-shadow');

        // add each button to the group
        _.each(that.options.buttons, function(button){

            // generate a unique id for each button
            var id = r360.Util.generateId();

            var input = $('<input/>', {
                "type" : 'checkbox',
                "id"   : 'r360_' + id,
                "value": button.key,
                "key"  : button.key,
                "name" : 'r360_checkboxbuttongroup_' + that.options.buttonGroupId
            });

            var label = $('', {
                "for"  : 'r360_' + id,
                "html" : !_.isUndefined(button.icon) ? button.icon + " " + button.label : "" + button.label
            });

            // make the button selected (default buttin)
            if ( button.checked ) {

                that.options.checked[button.key] = true;
                input.attr({"checked" : "checked"})
            };
            // add a tooltip if one was provided
            if ( typeof button.tooltip != 'undefined' ) label.attr({"title" : button.tooltip});

            div.append(input);
            div.append(label);
        });

        return div;
    },
});

r360.checkboxButtonControl = function (options) {
    return new r360.CheckboxButtonControl(options);
};

/*
 *
 */
r360.LeafletPolygonLayer = L.Class.extend({

    /**
      * This methods initializes the polygon layer's stroke width and polygon opacity.
      * It uses the default values, and in case the options contain other values, the
      * default values are overwritten.
      *
      * @method send
      *
      * @param {Object} [options] The typical JS options array.
      * @param {Number} [options.opacity] Defines the opacity of the polygons.
      *     Higher values mean that the polygon is less opaque.
      * @param {Number} [options.strokeWidth] Defines the strokewidth of the polygons boundaries.
      *     Since we have degenerated polygons (they can have no area), the stroke width defines the
      *     thickness of a polygon. Thicker polygons are not as informative as thinner ones.
      */
    initialize: function (options) {

        // set default parameters
        this.opacity           = r360.config.defaultPolygonLayerOptions.opacity;
        this.strokeWidth       = r360.config.defaultPolygonLayerOptions.strokeWidth;
        this.tolerance         = r360.config.defaultPolygonLayerOptions.tolerance;
        this.extendWidthX      = r360.config.defaultPolygonLayerOptions.strokeWidth / 2;
        this.extendWidthY      = r360.config.defaultPolygonLayerOptions.strokeWidth / 2;
        this.backgroundColor   = r360.config.defaultPolygonLayerOptions.backgroundColor;
        this.backgroundOpacity = r360.config.defaultPolygonLayerOptions.backgroundOpacity;

        // overwrite defaults with optional parameters
        if ( typeof options != 'undefined' ) {

            if ( typeof options.opacity        != 'undefined') this.opacity      = options.opacity;
            if ( typeof options.strokeWidth    != 'undefined') this.strokeWidth  = options.strokeWidth;
            if ( typeof options.inverse        != 'undefined') this.inverse      = options.inverse;
            if ( typeof options.tolerance      != 'undefined') this.tolerance    = options.tolerance;
            if ( typeof options.extendWidthX   != 'undefined') this.extendWidthX = options.extendWidthX;
            if ( typeof options.extendWidthY   != 'undefined') this.extendWidthY = options.extendWidthY;
        }
    },

    /**
     * [setInverse Sets this layer to the inverse representation, meaning only reachable parts are displayed
     *     and the rest is greyed out.]
     * @param {[type]} inverse [true or false]
     */
    setInverse: function(inverse){
        this.inverse = inverse;
    },

    /**
     * @return {[type]} [returns the current state of this layer]
     */
    getInverse: function(){
        return this.inverse;
    },

    /**
     * [getBoundingBox3857 returns a boundingbox (in web mercator) from the left bottom to the top right of this layer]
     * @return {[type]} [description]
     */
    getBoundingBox3857 : function(){

        return this.multiPolygons[0].getBoundingBox3857();
    },

    /**
     * [getBoundingBox4326 returns a boundingbox (in wgs84) from the left bottom to the top right of this layer]
     * @return {[type]} [description]
     */
    getBoundingBox4326 : function(){

        return this.multiPolygons[0].getBoundingBox4326();
    },

    /*
     *
     */
    onAdd: function (map) {

        this.map = map;

        // create a DOM element with a unique ID to have multiple maps on one page
        this.element = L.DomUtil.create('div', 'r360-leaflet-polygon-layer-' + $(map._container).attr("id") + ' leaflet-zoom-hide');
        $(this.element).attr("id", "canvas" + $(this.map._container).attr("id"));

        // we append the layer to the overlay pane at the last position
        this.map.getPanes().overlayPane.appendChild(this.element);

        // add a view redraw event listener for updating layer's position
        // zoom in/out, panning
        this.map.on('moveend', this.draw, this);

        // repaint layer
        this.draw();
    },

    /**
     * [fitMap adjust the map to fit the complete polygon with maximum zoom level]
     * @return {[type]} [description]
     */
    fitMap: function(){

        // we have to transform the r360.latLngBounds to a L.latLngBounds since the map object
        // only knows the leaflet version
        var bounds = this.getBoundingBox4326();
        var sw = bounds.getSouthWest(), ne = bounds.getNorthEast();

        this.map.fitBounds(L.latLngBounds(L.latLng({ lat : sw.lat, lng : sw.lng}), L.latLng({ lat : ne.lat, lng : ne.lng})));
    },

    /**
     * [clearAndAddLayers clears the polygons from this layer and adds the new ones. If fitMap is not undefined wesvg
     *     also adjust the map bounds/zoom to show the polygons as big as possible.]
     * @param  {[type]} multiPolygons [description]
     * @return {[type]}                  [description]
     */
    clearAndAddLayers : function(multiPolygons, fitMap){

        this.clearLayers();
        this.addLayer(multiPolygons);

        if ( typeof fitMap !== 'undefined' ) this.fitMap();

        return this;
    },

    /**
     * [addLayer description]
     * @param {[type]} multiPolygons [description]
     */
    addLayer : function(multiPolygons) {

        this.multiPolygons = multiPolygons;

        // paint them
        this.draw();
    },

    /**
     * [addTo Adds this layer to the given map]
     * @param {[type]} map [the leaflet map on which the layer should be drawn]
     */
    addTo: function (map) {

        map.addLayer(this);
        return this;
    },

    /**
     * [onRemove description]
     * @param  {[type]} map [description]
     * @return {[type]}     [description]
     */
    onRemove: function (map) {

        // remove layer's DOM elements and listeners
        map.getPanes().overlayPane.removeChild(this.element);
        map.off('viewreset', this.draw, this);
    },

    /**
     * [createSvgData Creates the SVG representation of a given polygon]
     * @param  {[type]} polygon [description]
     * @return {[type]}         [description]
     */
    createSvgData: function(polygon){

        var bounds = r360.PolygonUtil.extendBounds(this.getMapPixelBounds(), this.extendWidthX, this.extendWidthY);
        return r360.SvgUtil.createSvgData(polygon, {
            bounds      : bounds,
            scale       : Math.pow(2, this.map._zoom) * 256,
            tolerance   : this.tolerance,
            pixelOrigin : this.map.getPixelOrigin(),
            offset      : this.offset
        });
    },

    /**
     * [getMapPixelBounds description]
     * @return {[type]} [description]
     */
    getMapPixelBounds : function(){

        var bounds = this.map.getPixelBounds();
        return { max : { x : bounds.max.x, y : bounds.max.y }, min : { x : bounds.min.x, y : bounds.min.y } };
    },

    /**
     * [clearLayers Remove all child nodes of this layer from the DOM and initializes the layer.]
     */
    clearLayers: function(){

        $('#canvas'+ $(this.map._container).attr("id")).empty();
    },

    setStrokeWidth: function(strokeWidth){

        this.strokeWidth = strokeWidth;
    },

    /*
     *
     */
    draw: function () {

        if ( typeof this.multiPolygons !== 'undefined' ) {

            this.svgWidth  = this.map.getSize().x + this.extendWidthX;
            this.svgHeight = this.map.getSize().y + this.extendWidthY;

            // calculate the offset in between map and svg in order to translate
            var svgPosition    = $('#svg_'+ $(this.map._container).attr("id")).offset();
            var mapPosition    = $(this.map._container).offset();

            if ( typeof this.offset == 'undefined' )
                this.offset = { x : 0 , y : 0 };

            // adjust the offset after map panning / zooming
            if ( typeof svgPosition != 'undefined' ) {
                this.offset.x += (mapPosition.left - svgPosition.left) - this.extendWidthX/2;
                this.offset.y += (mapPosition.top - svgPosition.top) - this.extendWidthY/2;
            }

            // clear layer from previous drawings
            $('#canvas'+ $(this.map._container).attr("id")).empty();

            var gElements = [];

            // go through each multipolygon (represents each travel time)
            for ( var i = 0 ; i < this.multiPolygons.length ;  i++){

                var multiPolygon = this.multiPolygons[i], svgData = [];

                // add each polygon for the given travel time
                for ( var j = 0; j < multiPolygon.polygons.length; j++)
                    svgData.push(this.createSvgData(multiPolygon.polygons[j]));

                if ( svgData.length != 0 )
                    gElements.push(r360.SvgUtil.getGElement(svgData, {
                        color             : !this.inverse ? multiPolygon.getColor() : 'black',
                        opacity           : !this.inverse ? 1 : multiPolygon.getOpacity(),
                        strokeWidth       : this.strokeWidth
                    }));
            }

            var options = {
                id                : $(this.map._container).attr("id"),
                offset            : this.offset,
                svgHeight         : this.svgHeight,
                svgWidth          : this.svgWidth,
                backgroundColor   : this.backgroundColor,
                backgroundOpacity : this.backgroundOpacity,
                opacity           : this.opacity,
                strokeWidth       : this.strokeWidth
            };

            // add the svg string to the container
            $('#canvas'+ $(this.map._container).attr("id")).append(!this.inverse ? r360.SvgUtil.getNormalSvgElement(gElements, options)
                                                                                : r360.SvgUtil.getInverseSvgElement(gElements, options));
        }
    }
});

r360.leafletPolygonLayer = function (options) {
    return new r360.LeafletPolygonLayer(options);
};

/*
 *
 */
r360.LeafletUtil = {

    /*
     * Convenients method to generate a Leaflet marker with the
     * specified marker color. For available colors look at 'dist/images'
     *
     * @method getMarker
     * @param {Object} [latlon] The coordinate
     * @param {Number} [latlon.lat] The latitude of the coordinate.
     * @param {Number} [latlon.lng] The longitude of the coordinate.
     * @param {Object} [options] The options for the marker
     * @param {Number} [options.color] The color for the marker icon.
     */
    getMarker : function(latlng, options){

        var color = r360.has(options, 'color') ? '-' + options.color : '-blue';

        options.icon = L.icon({
            iconSize     : [25, 41], // size of the icon
            iconUrl      : options.iconPath + 'marker-icon' + color + '.png',
            iconAnchor   : [12, 41], // point of the icon which will correspond to marker's location

            shadowSize   : [41, 41], // size of the shadow
            shadowUrl    : options.iconPath + 'marker-shadow.png',
            shadowAnchor : [41 / 3, 41], // point of the shadow which will correspond to marker's location

            popupAnchor  : [0, -35]  // point from which the popup should open relative to the iconAnchor
        });

        return L.marker(latlng, options);
    },

    fadeIn : function(layer, route, drawingTime, fadingType, options, onClick){

        if ( typeof drawingTime == 'undefined' ) drawingTime = 0;
        if ( typeof fadingType  == 'undefined')  fadingType  = 'travelTime';

        fadePathSegment(0);

        function fadePathSegment(z){

            // calculate fading time for segment
            segment = route.routeSegments[z];
            percent = fadingType == "travelTime" ? segment.getTravelTime() / route.getTravelTime() : segment.getDistance() / route.getDistance();

            timeToDraw = percent * drawingTime;

            // transfer don't have a linestring, just a point
            if ( segment.getType() != "TRANSFER" ) {
                fader(segment, timeToDraw, options, z);
            }
            else {

                if ( typeof options === 'undefined' || options.paintTransfer || (typeof options !== 'undefined' && !r360.has(options, 'paintTransfer') ))
                    addTransferSegment(segment, options);

                if(++z < route.routeSegments.length)
                    fadePathSegment(z);
            }
        }

        function addTransferSegment(segment, options){

            addCircularMarker(segment.points[0], segment, options);

            // if inter station transfer -> involves two stops -> we need a second circle
            if( segment.points.length > 1 && segment.points[0].lat !=  segment.points[1].lat && segment.points[0].lng !=  segment.points[1].lng )
                 addCircularMarker(segment.points[1], segment, options);
        }

        function addCircularMarker(latLng, segment, options) {
            var marker = L.circleMarker(latLng, {
                    color:          !r360.isUndefined(options) && r360.has(options, 'transferColor')      ? options.transferColor       : segment.getColor(),
                    fillColor:      !r360.isUndefined(options) && r360.has(options, 'transferHaloColor')  ? options.transferHaloColor   : typeof segment.getHaloColor() !== 'undefined' ? segment.getHaloColor() : '#9D9D9D',
                    fillOpacity:    !r360.isUndefined(options) && r360.has(options, 'transferFillOpacity')? options.transferFillOpacity : 1,
                    opacity:        !r360.isUndefined(options) && r360.has(options, 'transferOpacity')    ? options.transferOpacity     : 1,
                    stroke:         !r360.isUndefined(options) && r360.has(options, 'transferStroke')     ? options.transferStroke      : true,
                    weight:         !r360.isUndefined(options) && r360.has(options, 'transferWeight')     ? options.transferWeight      : 4,
                    radius:         !r360.isUndefined(options) && r360.has(options, 'transferRadius')     ? options.transferRadius      : 8
                });

            var popup = !r360.isUndefined(options) && r360.has(options, 'popup') ? options.popup : "INSERT_TEXT";

            if ( typeof segment !== 'undefined') {

                var variable = !_.contains(['walk', 'transit', 'source', 'target', 'bike', 'car'], segment.startname) ? segment.startname : '';
                variable = variable == '' && !_.contains(['walk', 'transit', 'source', 'target', 'bike', 'car'], segment.endname) ? segment.endname : variable;

                popup = popup.replace('INSERT_TEXT', variable);
            }

            if ( !r360.isUndefined(options) && r360.has(options, 'popup') ) {

                marker.bindPopup(popup)
                marker.on('mouseover', function(){ marker.openPopup(); })
            }

            marker.addTo(layer);
            marker.bringToFront();
        }

        function fader(segment, millis, options, z){

            var polylineOptions         = {};
            polylineOptions.color       = !r360.isUndefined(options) && r360.has(options, 'color')    ? options.color   : segment.getColor();
            polylineOptions.opacity     = !r360.isUndefined(options) && r360.has(options, 'opacity' ) ? options.opacity : 0.8;
            polylineOptions.weight      = !r360.isUndefined(options) && r360.has(options, 'weight' )  ? options.weight  : 5;

            if ( segment.getType() != "TRANSIT" && (segment.getType() == "WALK") )  {

                polylineOptions.color     = !r360.isUndefined(options) && r360.has(options, 'walkColor' )     ? options.walkColor     : '#006F35';
                polylineOptions.weight    = !r360.isUndefined(options) && r360.has(options, 'walkWeight' )    ? options.walkWeight : 7;
                polylineOptions.dashArray = !r360.isUndefined(options) && r360.has(options, 'walkDashArray' ) ? options.walkDashArray : "1, 10";
            }

            var polylineHaloOptions     = {};
            polylineHaloOptions.weight  = !r360.isUndefined(options) && r360.has(options, 'haloWeight' )  ? options.haloWeight  : 10;
            polylineHaloOptions.opacity = !r360.isUndefined(options) && r360.has(options, 'haloOpacity' ) ? options.haloOpacity : 0.7;
            polylineHaloOptions.color   = !r360.isUndefined(options) && r360.has(options, 'haloColor')    ? options.haloColor   : typeof segment.getHaloColor() !== 'undefined' ? segment.getHaloColor() : '#9D9D9D';

            // 15ms for one peace. So if we want do draw the segment in 1 sec we need 66 pieces
            var pieces      = millis / 15;
            var choppedLine = chopLineString(segment.getPoints(), pieces);
            var haloLine    = L.polyline(choppedLine[0], polylineHaloOptions).addTo(layer);
            var polyLine    = L.polyline(choppedLine[0], polylineOptions).addTo(layer);

            // add event listener
            haloLine.on('click', onClick);
            polyLine.on('click', onClick);

            fadeLine(polyLine, haloLine, choppedLine, 1, z)
        };

        /*
        function is recalling itself every 25ms
        if you want the line to be drawn in one second you need to add a chopped line in (roughly) 40 pieces
        When line is drawn fadePathSegment is called in order to draw the next segment.
        */

        function fadeLine(polyLine, haloLine, choppedLine, i, z){

            var latlngs = polyLine.getLatLngs();

            for ( var j = 0 ; j < choppedLine[i].length ; j++ )
                latlngs.push(choppedLine[i][j])

            if ( latlngs.length != 0 ) {
                haloLine.setLatLngs(latlngs);
                polyLine.setLatLngs(latlngs);
            }

            if ( ++i < choppedLine.length ) {
                setTimeout(function(){
                    fadeLine(polyLine, haloLine, choppedLine, i, z);
                }, 15);
            }else{
                if(++z < route.routeSegments.length)
                   fadePathSegment(z);
            }
        }

        /*
        chops a linestring in a chosen number of equal pieces
        */

        function chopLineString(latlngs, pieces){

            var length          = 0;
            var steps           = 1 / pieces;
            var percentSoFar    = 0;
            var segmentDistance;
            var segmentPercent;
            var newLatLngs  = new Array();

            for(var i = 1; i < latlngs.length; i++){
                length += latlngs[i-1].distanceTo(latlngs[i]);
            }

            var part        = new Array();

            for(var i = 0; i < latlngs.length -1; i++){

                part.push(latlngs[i]);

                segmentDistance  = latlngs[i].distanceTo(latlngs[i + 1]);
                segmentPercent   = segmentDistance / length;
                percentSoFar    += segmentPercent;

                if(percentSoFar >= steps){
                    while(percentSoFar >= steps){
                        percent = ((steps - (percentSoFar - segmentPercent))/segmentPercent);
                        part.push(interpolatePoint(latlngs[i],latlngs[i + 1],percent));
                        steps += 1 / pieces;

                        newLatLngs.push(part);
                        part        = new Array();
                    }
                }
            }

            newLatLngs.push(part);
            part    = new Array();
            part.push(latlngs[latlngs.length -1]);
            newLatLngs.push(part);
            return newLatLngs;
        };

        function interpolatePoint(latlng1, latlng2, percent){

            var project, unproject, tempmap;

            /*
                ugly hack. shall be redone when working with projected coordinates
            */
            if(typeof layer.project != "undefined"){
                tempmap = layer;
            }else{
                tempmap = layer._map;
            }
            var p1 = tempmap.project(latlng1);
            var p2 = tempmap.project(latlng2);

            var xNew = (p2.x - p1.x) * percent + p1.x;
            var yNew = (p2.y - p1.y) * percent + p1.y;
            var newPoint = new r360.point(xNew, yNew);

            var latlng = tempmap.unproject(L.point(newPoint.x, newPoint.y));

            return latlng;
        };
    }
};

}(window, document));


text:
<?php

namespace SclNominetEpp\Response\Info;

use SclNominetEpp\Nameserver;
use SimpleXMLElement;

/**
 * This class interprets XML for a Nominet EPP host:info command response.
 *
 * @author Merlyn Cooper <merlyn.cooper@hotmail.co.uk>
 */
class Host extends AbstractInfo
{
    const TYPE = 'host';
    const VALUE_NAME = 'name';

    public function __construct()
    {
        parent::__construct(
            self::TYPE,
            new Nameserver(),
            self::VALUE_NAME
        );
    }

    /**
     *
     * @param  SimpleXMLElement $infData
     * @return string
     */
    public function statusArrPopulate(SimpleXMLElement $infData)
    {
        if (null === $infData->status) {
            return "no status";
        }
        foreach ($infData->status as $s) {
            if (null !== $s->attributes()->s) {
                $this->object->addStatus($s->attributes()->s);
            } else {
                $this->object->addStatus('ok');
            }
        }
    }

    /**
     * ipCheck finds, for all addresses in host,
     * the addresses which are ip "v4" and ip "v6" and
     * associates them to the host object,
     * If there is no "ip" attribute it defaults to "v4".
     *
     * @param SimpleXMLElement $infData
     */
    public function ipCheck(SimpleXMLElement $infData)
    {
        if (!isset($infData->addr)) {
            return;
        }

        foreach ($infData->addr as $address) {
            $type = 'v4';
            if (isset($address->attributes()->ip)) {
                $type = $address->attributes()->ip;
            }
            if ('v6' == $type) {
                $this->object->setIpv6($address);
            } else {
                $this->object->setIpv4($address);
            }
        }
    }

    public function getHost()
    {
        return $this->object;
    }

    protected function addInfData(SimpleXMLElement $infData)
    {
        $this->object->setHostName($infData->name);
        $this->statusArrPopulate($infData);
        $this->ipCheck($infData); // sets ipv4 and ipv6:- $this->object->setIpv4 and setIpv6
        $this->object->setCreatorID($infData->crID);
        $this->object->setUpID($infData->upID);
    }

    protected function setValue(SimpleXMLElement $name)
    {
        $this->object->setHostName((string)$name);
    }

    protected function addExtensionData(SimpleXMLElement $extension = null)
    {

    }
}


text:
<?php

/**
 * Test: Drago\Http\ExtraSession
 */

declare(strict_types=1);

use Drago\Http\ExtraSession;
use Nette\Http;
use Tester\Assert;

require __DIR__ . '/../bootstrap.php';

$section = 'section';
$request = new Http\RequestFactory;
$session = new Http\Session($request->fromGlobals(), new Http\Response);
$class = new ExtraSession($session, $section);

Assert::type($class->getSession(), $session);
Assert::type($class->getSessionSection(), $session->getSection($section));


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Blog | Post">
    <meta name="author" content="Alex">

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="../stylesheets/default.css">

    <link rel="shortcut icon" href="http://placehold.it/16x16/1abc9c&ext=P" >
    <link rel="icon" type="image/gif" href="hhttp://placehold.it/16x16/1abc9c&text=P" >

    <title>Values | Happiness </title>

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
            Toggle navigation

          </button>
          Alex Green

About Me

Blog

Projects

Contact

Values

What Makes You Happy?

July 12th, 2015

      Looking at the list of options - I would have to say what has been a part of my life when I was the happiest are Adventure, Close Relationships, and Location.

    Rating how I live up to each of these

    Adventure - 4

    Close Relationships - 4

    Location - 4

    Close relationships are important to me because I think sharing your experiences and adventures with someone makes them so much more enjoyable.  I love sharing my passions with someone.  Hobbies are great - sharing them with someone is even better.

      If I start feeling down at DBC I know I just have to look at the adventures I've had - and how I even ended up at DBC - this should help me realize that if I have made it this far I can push through the rest. 9 intense weeks away from normality is nothing compared to the other times I've been away from what I would consider normal.

Contact Me

              <form class="form-horizontal">

    Name

      <input type="text" class="form-control input-lg" id="Name" placeholder="Name">

    Email

      <input type="Email" class="form-control input-lg" id="Email" placeholder="Email">

    Message

     <textarea class="form-control" id="Message" placeholder="Love? Hate? Let me hear it."rows="3"></textarea>

      <button type="submit" class="btn btn-primary btn-lg pull-right input-lg">Send</button>

</form>

Copyright - All Right Reserved 2015


text:
from gtts import gTTS
import sys

print(sys.version)

blabla = ("You have been a good boy Have a lollipop")
tts = gTTS(text=blabla, lang='en-US')
tts.save("/tmp/test.mp3")


text:
require 'spec_helper'

describe 'neutron::plugins::ml2::networking_ansible_host' do
  let (:title) do
    'myhostname'
  end

  shared_examples 'neutron::plugins::ml2::networking_ansible_host' do
    let :params do
      {
        :ansible_network_os => 'openvswitch',
        :ansible_host       => '192.0.2.10',
        :ansible_user       => 'neutron',
      }
    end

    context 'without credential' do
      it { should raise_error(Puppet::Error) }
    end

    context 'with both ssh pass and ssh key file set' do
      before do
        params.merge!({
          :ansible_ssh_pass             => 'secrete',
          :ansible_ssh_private_key_file => '/var/lib/neutron/.ssh/id_rsa',
        })
      end

      it { should raise_error(Puppet::Error) }
    end

    context 'with ssh pass' do
      before do
        params.merge!({
          :ansible_ssh_pass => 'secrete'
        })
      end

      it 'configures the host' do
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_network_os')\
          .with_value('openvswitch')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_host')\
          .with_value('192.0.2.10')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_user')\
          .with_value('neutron')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_ssh_pass')\
          .with_value('secrete').with_secret(true)
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_ssh_private_key_file')\
          .with_value('<SERVICE DEFAULT>')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/mac')\
          .with_value('<SERVICE DEFAULT>')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/manage_vlans')\
          .with_value('<SERVICE DEFAULT>')
      end
    end

    context 'with ssh key file' do
      before do
        params.merge!({
          :ansible_ssh_private_key_file => '/var/lib/neutron/.ssh/id_rsa'
        })
      end

      it 'configures the host' do
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_network_os')\
          .with_value('openvswitch')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_host')\
          .with_value('192.0.2.10')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_user')\
          .with_value('neutron')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_ssh_pass')\
          .with_value('<SERVICE DEFAULT>').with_secret(true)
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_ssh_private_key_file')\
          .with_value('/var/lib/neutron/.ssh/id_rsa')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/mac')\
          .with_value('<SERVICE DEFAULT>')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/manage_vlans')\
          .with_value('<SERVICE DEFAULT>')
      end
    end

    context 'with parameters' do
      before do
        params.merge!({
          :ansible_ssh_pass => 'secrete',
          :mac              => '00:00:5e:00:53:01',
          :manage_vlans     => false,
        })
      end

      it 'configures the host' do
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_network_os')\
          .with_value('openvswitch')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_host')\
          .with_value('192.0.2.10')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_user')\
          .with_value('neutron')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_ssh_pass')\
          .with_value('secrete').with_secret(true)
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/ansible_ssh_private_key_file')\
          .with_value('<SERVICE DEFAULT>')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/mac')\
          .with_value('00:00:5e:00:53:01')
        is_expected.to contain_neutron_plugin_ml2('ansible:myhostname/manage_vlans')\
          .with_value(false)
      end
    end
  end

  on_supported_os({
    :supported_os => OSDefaults.get_supported_os
  }).each do |os,facts|
    context "on #{os}" do
      let (:facts) do
        facts.merge!(OSDefaults.get_facts())
      end

      it_behaves_like 'neutron::plugins::ml2::networking_ansible_host'
    end
  end
end


text:
package com.b2international.snowowl.snomed.datastore.request;

import java.util.Map;

import com.b2international.snowowl.snomed.core.domain.Acceptability;
import com.b2international.snowowl.snomed.core.domain.AssociationType;
import com.b2international.snowowl.snomed.core.domain.CaseSignificance;
import com.b2international.snowowl.snomed.core.domain.DescriptionInactivationIndicator;
import com.google.common.collect.Multimap;

/**
 * @since 4.5
 */
public final class SnomedDescriptionUpdateRequestBuilder extends BaseSnomedComponentUpdateRequestBuilder<SnomedDescriptionUpdateRequestBuilder, SnomedDescriptionUpdateRequest> {

	private Map<String, Acceptability> acceptability;
	private Multimap<AssociationType, String> associationTargets;
	private CaseSignificance caseSignificance;
	private DescriptionInactivationIndicator inactivationIndicator;
	private String languageCode;
	private String typeId;
	private String term;

	SnomedDescriptionUpdateRequestBuilder(String componentId) {
		super(componentId);
	}

	public SnomedDescriptionUpdateRequestBuilder setAcceptability(Map<String, Acceptability> acceptability) {
		this.acceptability = acceptability;
		return getSelf();
	}

	public SnomedDescriptionUpdateRequestBuilder setAssociationTargets(Multimap<AssociationType, String> associationTargets) {
		this.associationTargets = associationTargets;
		return getSelf();
	}

	public SnomedDescriptionUpdateRequestBuilder setCaseSignificance(CaseSignificance caseSignificance) {
		this.caseSignificance = caseSignificance;
		return getSelf();
	}

	public SnomedDescriptionUpdateRequestBuilder setInactivationIndicator(DescriptionInactivationIndicator inactivationIndicator) {
		this.inactivationIndicator = inactivationIndicator;
		return getSelf();
	}

	public SnomedDescriptionUpdateRequestBuilder setTypeId(String typeId) {
		this.typeId = typeId;
		return getSelf();
	}

	public SnomedDescriptionUpdateRequestBuilder setTerm(String term) {
		this.term = term;
		return getSelf();
	}

	public SnomedDescriptionUpdateRequestBuilder setLanguageCode(String languageCode) {
		this.languageCode = languageCode;
		return getSelf();
	}

	@Override
	protected SnomedDescriptionUpdateRequest create(String componentId) {
		return new SnomedDescriptionUpdateRequest(componentId);
	}

	@Override
	protected void init(SnomedDescriptionUpdateRequest req) {
		super.init(req);
		req.setAcceptability(acceptability);
		req.setAssociationTargets(associationTargets);
		req.setCaseSignificance(caseSignificance);
		req.setInactivationIndicator(inactivationIndicator);
		req.setLanguageCode(languageCode);
		req.setTypeId(typeId);
		req.setTerm(term);
	}

}


text:
<template name="newsHeader">

    {{#if equals currentPage "feed"}}
    News

      Sort By:
      <select name="sort" onchange="Meteor.newsFilter.change()">
        <option name="general" value="general" id="general">
          General
        </option>
        <option name="bossKO" value="bossKO" id="bossKO">
          Boss Kills
        </option>
      </select>

    {{/if}}
    {{#if equals currentPage "article"}}
    {{#each posts}}
    {{title}}

      {{date}}

    {{/each}}
    {{/if}}
    {{#if equals currentPage "streams"}}
    LIVE STREAMS
    {{/if}}

</template>


text:
module Iptablez

  # Shortcut to get the bin path for `iptables`.
  # @return [String]
  def self.bin_path
    # @todo Which will fire for ever command to determine iptables path.
    # Maybe, cache this value and allow the method to be re-called when needed.
    o, e, s = Open3.capture3("which", "iptables")
    return o.strip if s.success?
    raise e
  end

  # Shortcut to get the version number for `iptables`.
  # @return [String]
  def self.version
    Commands::Version.number
  end

  # @todo Document this.
  def self.parse
    Parser
  end

  # @todo Document this.
  def self.tables
    Tables.defaults
  end

  # Shortcut to list the rules found in a chain of a given +name+ or
  # if no chain is specifcied, list all of the chains.
  # @example Basic Usage
  #   Iptablez.list
  #   # => []
  # @example Basic Usage with a Block
  #   Iptablez.list(chain: "INPUT") do |line|
  #     puts line # each line
  #   end
  def self.list(chain: false)
    if chain
      Commands::List.chain(name: chain)
    else
      Commands::List.all
    end
  end

  # Shortcut to list all of the chains.
  # @example Basic Usage
  #   Iptablez.chains
  #   # => ["INPUT", "FORWARD", "OUTPUT", "dogs", "cats"]
  # @example Basic Usage with a Block
  #   Iptablez.chains { |chain| puts chain }
  # @return [Array]
  def self.chains
    Chains.all.each { |chain| yield chain } if block_given?
    Chains.all
  end

end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cenangium vernicosum Fuckel

### Remarks
null


text:
package com.github.fedorchuck.jsqlb.postgresql.datatypes;

import com.github.fedorchuck.jsqlb.postgresql.PGDataTypes;
import lombok.EqualsAndHashCode;
import lombok.Getter;

/**
 * Time of day (no time zone)
 *
 * @author Volodymyr Fedorchuk.
 */
@Getter
@EqualsAndHashCode
public class TIME implements PGDataTypes {

    private final String name = "TIME";

    private final int capacity = 0;
}


text:
/**
 * This is an example that shows of the widgets present in
 * Guichan. The example uses the Allegro back end.
 */

#include <guichan.hpp>
#include <iostream>

// Here we store a global Gui object.  We make it global
// so it's easily accessable. Of course, global variables
// should normally be avioded when it comes to OOP, but
// this examples is not an example that shows how to make a
// good and clean C++ application but merely an example
// that shows how to use Guichan.
namespace globals
{
    gcn::Gui* gui;
}

// Include code to set up an Allegro application with Guichan.
// The allegro.hpp file is responsible for creating and deleting
// the global Gui object.
#include "allegro.hpp"
// Include code to set up a Guichan GUI with all the widgets
// of Guichan. The code populates the global Gui object.
#include "widgets.hpp"

int main(int argc, char **argv)
{
    try
    {
        allegro::init();
        widgets::init();
        allegro::run();
        widgets::halt();
        allegro::halt();
    }
    /*
     * Catch all Guichan exceptions
     */
    catch (gcn::Exception e)
    {
        std::cerr << e.getMessage() << std::endl;
        return 1;
    }
    /*
     * Catch all Std exceptions
     */
    catch (std::exception e)
    {
        std::cerr << "Std exception: " << e.what() << std::endl;
        return 1;
    }
    /*
     * Catch all Unknown exceptions
     */
    catch (...)
    {
        std::cerr << "Unknown exception" << std::endl;
        return 1;
    }

    return 0;
}
END_OF_MAIN()


text:
package so.ontolog.formula.ast.expr;

import so.ontolog.data.type.TypeSpec;
import so.ontolog.formula.ast.ASTSymbol;
import so.ontolog.formula.ast.ASTToken;
import so.ontolog.formula.runtime.QName;

/**
 *

 * @author Ikchan Kwon
 *
 */
public abstract class AbstractASTSymbol extends AbstractASTExpr implements ASTSymbol {
	private static final long serialVersionUID = -4030999049758000792L;

	protected final QName qname;

	public AbstractASTSymbol(ASTToken token, TypeSpec typeSpec, QName qname) {
		super(token, typeSpec);
		this.qname = qname;
	}

	public QName qname() {
		return qname;
	}

}