text:
package com.orientechnologies.orient.server.distributed;

import com.orientechnologies.orient.core.db.ODatabasePool;
import com.orientechnologies.orient.core.db.OrientDBConfig;
import org.junit.Ignore;

/**
 * Test case to check the right management of distributed exception while a server is starting.
 * Derived from the test provided by Gino John for issue http://www.prjhub.com/#/issues/6449.
 *
 * <p>3 nodes, the test is started after the 1st node is up & running. The test is composed by
 * multiple (8) parallel threads that update the same records 20,000 times.
 *
 * @author Luca Garulli (l.garulli--(at)--orientdb.com)
 */
@Ignore
public class HARemoteGraphIT extends HALocalGraphIT {
  @Override
  protected String getDatabaseURL(final ServerRun server) {
    return "remote:localhost:2424;localhost:2425;localhost:2426/" + getDatabaseName();
  }

  @Override
  public String getDatabaseName() {
    return "HARemoteGraphIT";
  }

  protected ODatabasePool getGraphFactory(final ServerRun server) {
    if (graphReadFactory == null) {
      graphReadFactory =
          new ODatabasePool(
              "remote:localhost:2424;localhost:2425;localhost:2426/",
              getDatabaseName(),
              "admin",
              "admin",
              OrientDBConfig.defaultConfig());
    }
    return graphReadFactory;
  }
}


text:
{% extends "appbuilder/base.html" %}
{% import 'appbuilder/general/lib.html' as lib %}

{% block content %}
{{ lib.panel_begin(title) }}

{% block show_form %}
    {{ widgets.get('show')()|safe }}
{% endblock show_form %}

{% block related_views %}
    {% if related_views %}
        {% for view in related_views %}
            {% call lib.accordion_tag(view.__class__.__name__,view.title, False) %}
                {{ widgets.get('related_views')[loop.index - 1](pk = pk)|safe }}
            {% endcall %}
        {% endfor %}
    {% endif %}
{% endblock related_views %}

{{ lib.panel_end() }}

{% endblock %}

{% block add_tail_js %}
<script src="{{url_for('appbuilder.static',filename='js/ab_keep_tab.js')}}"></script>
{% endblock %}

redpajama_set_name: RedPajamaGithub


text:
layout: post
date: 2015-12-13
title: "Atelier Aimée Style 22 Sleeveless Chapel Train Mermaid/Trumpet"
category: Atelier Aimée
tags: [Atelier Aimée,Mermaid/Trumpet,Chapel Train,Sleeveless]
---
### Atelier Aimée Style 22
Just **$589.99**
###   Sleeveless Chapel Train Mermaid/Trumpet

BRANDS	Atelier Aimée

Silhouette	Mermaid/Trumpet

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/atelier-aimee/40733-atelier-aimee-style-22.html](https://www.readybrides.com/en/atelier-aimee/40733-atelier-aimee-style-22.html)


text:
package org.bricolages.streaming.stream.processor;
import java.util.Objects;
import lombok.*;

public class BooleanColumnProcessor extends SingleColumnProcessor {
    static public BooleanColumnProcessor build(ProcessorParams params, ProcessorContext ctx) {
        return new BooleanColumnProcessor(params);
    }

    public BooleanColumnProcessor(ProcessorParams params) {
        super(params);
    }

    @Override
    public Object processValue(Object value) throws ProcessorException {
        if (value == null) return null;
        if (value instanceof Boolean) {
            return value;
        }
        else if (value instanceof String) {
            if (Objects.equals(value, "true") || Objects.equals(value, "t")) {
                return true;
            }
            else if (Objects.equals(value, "false") || Objects.equals(value, "f")) {
                return false;
            }
            else {
                throw new ProcessorException("not a boolean: " + value);
            }
        }
        else {
            throw new ProcessorException("not a boolean: " + value);
        }
    }
}


text:
``helper.string.check`` --- Check
=================================

.. warning::
   This package is not documented yet.

.. automodule:: dp_tornado.helper.string.check
    :members:
    :undoc-members:
    :show-inheritance:


text:
package com.herokuapp.soliduxample.solidus.models;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * Created by Roberto Morelos on 3/6/17.
 *
 */
public class Classification implements Serializable {

    @SerializedName("taxon_id")
    @Expose
    private Integer taxonId;
    @SerializedName("position")
    @Expose
    private Integer position;
    @SerializedName("taxon")
    @Expose
    private Taxon taxon;

    public Integer getTaxonId() {
        return taxonId;
    }

    public void setTaxonId(Integer taxonId) {
        this.taxonId = taxonId;
    }

    public Integer getPosition() {
        return position;
    }

    public void setPosition(Integer position) {
        this.position = position;
    }

    public Taxon getTaxon() {
        return taxon;
    }

    public void setTaxon(Taxon taxon) {
        this.taxon = taxon;
    }
}


text:
using System.IO;
using Grpc.Core;
#if USE_GRPC_NET_CLIENT
using Grpc.Net.Client;
#endif
using MagicOnion.Unity;
using MessagePack;
using MessagePack.Resolvers;
using UnityEngine;

namespace Assets.Scripts
{
    class InitialSettings
    {
        [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
        static void RegisterResolvers()
        {
            // NOTE: Currently, CompositeResolver doesn't work on Unity IL2CPP build. Use StaticCompositeResolver instead of it.
            StaticCompositeResolver.Instance.Register(
                MagicOnion.Resolvers.MagicOnionResolver.Instance,
                MessagePack.Resolvers.GeneratedResolver.Instance,
                BuiltinResolver.Instance,
                PrimitiveObjectResolver.Instance
            );

            MessagePackSerializer.DefaultOptions = MessagePackSerializer.DefaultOptions
                .WithResolver(StaticCompositeResolver.Instance);
        }

        [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
        public static void OnRuntimeInitialize()
        {
            // Initialize gRPC channel provider when the application is loaded.
            GrpcChannelProviderHost.Initialize(new DefaultGrpcChannelProvider(new GrpcCCoreChannelOptions(new[]
            {
                // send keepalive ping every 5 second, default is 2 hours
                new ChannelOption("grpc.keepalive_time_ms", 5000),
                // keepalive ping time out after 5 seconds, default is 20 seconds
                new ChannelOption("grpc.keepalive_timeout_ms", 5 * 1000),
            })));

            // NOTE: If you want to use self-signed certificate for SSL/TLS connection
            //var cred = new SslCredentials(File.ReadAllText(Path.Combine(Application.streamingAssetsPath, "server.crt")));
            //GrpcChannelProviderHost.Initialize(new DefaultGrpcChannelProvider(new GrpcCCoreChannelOptions(channelCredentials: cred)));

            // Use Grpc.Net.Client instead of C-core gRPC library.
            //GrpcChannelProviderHost.Initialize(new GrpcNetClientGrpcChannelProvider(new GrpcChannelOptions() { HttpHandler = ... }));
        }
    }
}


text:
class Calendar
  class Division
    attr_reader :slug, :title
    alias :to_param :slug

    def initialize(slug, data = {})
      @slug = slug
      @title = data.delete("title") || slug.underscore.humanize
      @data = data
    end

    def years
      @years ||= @data.map { |year, events| Year.new(year, self, events) if year =~ /\A\d{4}\z/ }.compact
    end

    def year(name)
      yr = years.find {|y| y.to_s == name }
      raise CalendarNotFound unless yr
      yr
    end

    def events
      years.map(&:events).flatten(1)
    end

    def upcoming_event
      @upcoming_event ||= begin
        year = years.find {|y| y.upcoming_event }
        year.upcoming_event if year
      end
    end

    def upcoming_events_by_year
      self.years.each_with_object({}) do |year, results|
        results[year] = year.upcoming_events if year.upcoming_events.any?
      end
    end

    def past_events_by_year
      self.years.reverse.each_with_object({}) do |year, results|
        results[year] = year.past_events.reverse if year.past_events.any?
      end
    end

    def show_bunting?
      upcoming_event and upcoming_event.date.today? and upcoming_event.bunting == "true"
    end

    def as_json(options = {})
      {
        "division" => @slug,
        "events" => events,
      }
    end
  end
end


text:
import io from 'socket.io-client';

let socket = io('http://localhost:8080');
let listeners = [];

socket.on('connect', function() {
    listeners.forEach((listener) => listener('connect'));
});
socket.on('disconnect', function() {
    listeners.forEach((listener) => listener('disconnect'));
});
socket.on('connect_error', function() {
    listeners.forEach((listener) => listener(undefined, 'disconnect'));
});
socket.on('progress', (data) => {
    listeners.forEach((listener) => listener(data, 'progress'));
});
socket.on('start', (data) => {
    listeners.forEach((listener) => listener(data, 'start'))
});
socket.on('end', (data) => {
    listeners.forEach((listener) => listener(data, 'end'))
});

const addListener = (listener) => {
    listeners.push(listener);
};

const isConnected = () => {
    return socket.connected;
};

const removeAllListeners = () => {
    listeners = [];
};

const requestCancel = (uuid) => {
    console.log('Trying to cancel some shit...');
    socket.emit('cancel', uuid);
};

module.exports = {
    addListener: addListener,
    removeAllListeners: removeAllListeners,
    requestCancel: requestCancel,
    isConnected: isConnected
};


text:
var assert = require('assert');
var H = require('../test_harness.js');

describe('#query formatting', function() {

  it('should format query strings correctly', function(done) {
    var str = H.lib.formatQuery('SELECT ?? FROM ?? WHERE ??=?', ['name', 'default', 'id', 'frank']);
    assert(str === "SELECT `name` FROM `default` WHERE `id`='frank'", 'query should be correct');
    done();
  });

});


text:
// INFORM message handler class.
// Copyright (C) 2010 Lex Li
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using System;
using Lextm.SharpSnmpLib.Messaging;

namespace Lextm.SharpSnmpLib.Pipeline
{
    /// <summary>
    /// Message handler for INFORM.
    /// </summary>
    public sealed class InformRequestMessageHandler : IMessageHandler
    {
        /// <summary>
        /// Handles the specified message.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="store">The object store.</param>
        /// <returns></returns>
        public void Handle(ISnmpContext context, ObjectStore store)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (store == null)
            {
                throw new ArgumentNullException("store");
            }

            InvokeMessageReceived(new InformRequestMessageReceivedEventArgs(context.Sender, (InformRequestMessage)context.Request, context.Binding));
            context.CopyRequest(ErrorCode.NoError, 0);
        }

        /// <summary>
        /// Occurs when a message is received.
        /// </summary>
        public event EventHandler<InformRequestMessageReceivedEventArgs> MessageReceived;

        /// <summary>
        /// Invokes the message received.
        /// </summary>
        /// <param name="e">The <see cref="Lextm.SharpSnmpLib.Pipeline.InformRequestMessageReceivedEventArgs"/> instance containing the event data.</param>
        private void InvokeMessageReceived(InformRequestMessageReceivedEventArgs e)
        {
            var handler = MessageReceived;
            if (handler != null)
            {
                handler(this, e);
            }
        }
    }
}


text:
<?php

namespace Mautic\CoreBundle\IpLookup;

/**
 * Class MaxmindLookup
 */
class MaxmindLookup extends AbstractRemoteDataLookup
{
    /**
     * @return string
     */
    public function getAttribution()
    {
        return 'MaxMind Precision Services is a pay per query lookup service that offers solutions with multiple levels of accuracy and details.';
    }

    /**
     * @return array
     */
    protected function getHeaders()
    {
        return array('Authorization' => 'Basic ' . base64_encode($this->auth));
    }

    /**
     * @return string
     */
    protected function getUrl()
    {
        $url = "https://geoip.maxmind.com/geoip/v2.1/";

        switch ($this->getName()) {
            case 'maxmind_country':
                $url .= 'country';
                break;
            case 'maxmind_precision':
                $url .= 'city';
                break;
            case 'maxmind_omni':
                $url .= 'insights';
                break;
        }

        $url .= "/{$this->ip}";

        return $url;
    }

    /**
     * @param $response
     */
    protected function parseResponse($response)
    {
        $data = json_decode($response);

        if ($data) {
            if (empty($data->error)) {
                if (isset($data->postal)) {
                    $this->zipcode = $data->postal->code;
                }
                $this->country = $data->country->names->en;
                $this->city    = $data->city->names->en;

                if (isset($data->subdivisions[0])) {
                    if (count($data->subdivisions) > 1) {
                        // Use the first listed as the country and second as state
                        // UK -> England -> Winchester
                        $this->country = $data->subdivisions[0]->names->en;
                        $this->region  = $data->subdivisions[1]->names->en;
                    } else {
                        $this->region = $data->subdivisions[0]->names->en;
                    }
                }

                $this->latitude  = $data->location->latitude;
                $this->longitude = $data->location->longitude;
                $this->timezone  = $data->location->time_zone;

                if (isset($data->traits->isp)) {
                    $this->isp = $data->traits->isp;
                }

                if (isset($data->traits->organization)) {
                    $this->organization = $data->traits->organization;
                }
            } elseif (null !== $this->logger) {
                $this->logger->warning('IP LOOKUP: ' . $data->error);
            }
        }
    }
}


text:
<KinBody name="milk_chocolate">
  <Body type="static">
    <Geom type="trimesh">
      <Data>milk_chocolate_padded.iv</Data>
      <Render>milk_chocolate.iv</Render>
    </Geom>
  </Body>
</KinBody>


text:
// Copyright 2013 Serge Eby
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.t5.contrib.jongo;

import org.bson.types.ObjectId;

import java.util.List;

public interface JongoCrudRepository<T> {

    /**
     *
     * @param t collection object to persist
     * @return the persisted collection object
     */
     T create(T t);

    /**
     *
     * @param oid object identifier
     * @return the collection object
     */
     T get(ObjectId oid);

    /**
     * Update existing object
     * @param t the object to update
     * @return the collection object
     */
     T update(T t);

    /**
     * Deletes an object given an oid
     * @param oid  the object identifier
     * @param <T> object type
     */
     <T> void delete(ObjectId oid);

    /**
     *
     * @param query
     * @param parameters
     * @return the list of objects matching the search criteria
     */
     List<T> findAll(String query, Object... parameters);

    /**
     * @param query
     * @param parameters
     * @return an object matching the search criteria
     */
     T findOne(String query, Object... parameters);

    /**
     *
     * @param t
     * @param query
     * @param parameters
     * @return  the updated object
     */
     T update(T t, String query, Object... parameters);
}


text:
from pybindxml import reader
import unittest

class Tests_v311(unittest.TestCase):
    def setUp(self):
        self.xml_obj = reader.BindXmlReader(xml_filepath='testdata/bindxml-v3_11.xml')
        self.xml_obj.get_stats()

    def test_objectCreation(self):
        """Ensure we can create the BindXmlReader object, and properly read the XML."""
        self.assertEqual(type(self.xml_obj), reader.BindXmlReader)
        self.assertEqual(type(self.xml_obj.stats), reader.XmlV36)

    def test_ExpectedZoneCount(self):
        """Ensure we are parsing the expected number of zones in the XML file."""
        self.assertEqual(len(list(self.xml_obj.stats.zone_stats.keys())), 164)

    def test_ZoneStats(self):
        """Ensure we can read various levels of stats for a particular zone."""
        dom1 = self.xml_obj.stats.zone_stats['2.10.10.in-addr.arpa']
        self.assertEqual(dom1['_default']['serial'], '255')
        self.assertEqual(dom1['_default']['QrySuccess']['value'], 2)

    def test_MemoryStats(self):
        """Ensure the memory stats we're expecting are populated."""
        memory_stats = self.xml_obj.stats.memory_stats
        self.assertEqual({'totaluse': 82593966,
                          'inuse': 12033486,
                          'blocksize': 39583744,
                          'contextsize': 6975712,
                          'malloced': 52616462,
                          'lost': 0},
                         memory_stats)

    def test_QueryStats(self):
        """Ensure we are counting the number of queries expectedly."""
        query_stats = self.xml_obj.stats.query_stats
        self.assertEqual(query_stats['A'], 2265)
        self.assertEqual(query_stats['QUERY'], 3073)

if __name__ == '__main__':
    unittest.main()


text:
class SpiDevice {
  public:
    SpiDevice();

    void begin();
    void begin(byte selectPin);

    // TODO: Make these private (or protected) in the final library?
    void deselect();
    void select();

    byte transfer(volatile byte data);
    void transfer_bulk(const uint8_t* srcptr, unsigned long int length);

  private:
    void _initPins();
    void _initSpi();

    byte _selectPin;

};

#endif


text:
function plot_updateMenus(hFig)

% Remove all checkmarks
hChecked = findobj(hFig, 'Checked', 'On');
for i = 1:numel(hChecked), hChecked(i).Checked = 'off'; end

% Update individual menus ------------------------------------------------------

for i = 1:numel(hFig.UserData.PC)

    % Label
    hFig.UserData.PC{i}.U.hMenu.Label = sprintf('%s (%.1f%%)', hFig.UserData.PC{i}.label, hFig.UserData.PC{i}.U.percentOfVisiblePoints);

    % Visible
    hMenuVisible = findobj(hFig.UserData.PC{i}.U.hMenu, 'Label', 'Visible');
    if hFig.UserData.PC{i}.U.Visible, hMenuVisible.Checked = 'On'; end

    % Color
    % Note: name of attribute and unicolor name can be the same (e.g. red)
    hMenuColor = findobj(hFig.UserData.PC{i}.U.hMenu, 'Label', 'Color');
    if ~ischar(hFig.UserData.PC{i}.U.p.Color) && numel(hFig.UserData.PC{i}.U.p.Color) == 3 % if 'Color' is defined as three RGB values (Unicolor)
        parent2search4Color{i} = hMenuColor.Children(2); % Menu entry 'Unicolor'
        for j = 1:size(hFig.UserData.colors,1)
            if isequal(hFig.UserData.PC{i}.U.p.Color, hFig.UserData.colors{j,1})
                label2search4Color{i} = hFig.UserData.colors{j,2};
                break;
            else
                label2search4Color{i} = 'custom';
            end
        end
    elseif ischar(hFig.UserData.PC{i}.U.p.Color) && strcmp(hFig.UserData.PC{i}.U.p.Color(1:2), 'A.') % if 'Color' is defined as attribute (Attribute)
        parent2search4Color{i} = hMenuColor.Children(1); % Menu entry 'Attribute'
        label2search4Color{i} = hFig.UserData.PC{i}.U.p.Color(3:end);
    end
    hMenuColorSelected = findobj(hMenuColor, 'Label', label2search4Color{i}, 'Parent', parent2search4Color{i});
    if ~isempty(hMenuColorSelected), hMenuColorSelected.Checked = 'On'; end

    % MarkerSize
    hMenuMarkerSize = findobj(hFig.UserData.PC{i}.U.hMenu, 'Label', 'MarkerSize');
    hMenuMarkerSizeSelected = findobj(hMenuMarkerSize, 'Label', num2str(hFig.UserData.PC{i}.U.p.MarkerSize));
    if ~isempty(hMenuMarkerSizeSelected), hMenuMarkerSizeSelected.Checked = 'On'; end
    MarkerSize(i) = hFig.UserData.PC{i}.U.p.MarkerSize; % MarkerSize of each PC

    % ColormapName
    hMenuColormapName = findobj(hFig.UserData.PC{i}.U.hMenu, 'Label', 'ColormapName');
    hMenuColormapNameSelected = findobj(hMenuColormapName, 'Label', hFig.UserData.PC{i}.U.p.ColormapName);
    if ~isempty(hMenuColormapNameSelected), hMenuColormapNameSelected.Checked = 'On'; end
    ColormapName{i} = hFig.UserData.PC{i}.U.p.ColormapName; % ColormapName of each PC

    % Plot normals
    hMenuPlotNormals = findobj(hFig.UserData.PC{i}.U.hMenu, 'Label', 'Plot normals');
    if hFig.UserData.PC{i}.U.plotNormals, hMenuPlotNormals.Checked = 'On'; end

end

% Update for menu of all PCs ---------------------------------------------------

% Color
for i = 1:numel(parent2search4Color), parentLabel{i} = parent2search4Color{i}.Label; end % save labels of parents for comparison
if numel(unique(label2search4Color)) == 1 && numel(unique(parentLabel)) == 1 % if all PCs have the same Color
    hMenuColor = findobj(hFig.UserData.hMenuAll, 'Label', 'Color');
    if strcmp(parentLabel{1}, 'Unicolor')
        parent2search4Color = hMenuColor.Children(2);
    elseif strcmp(parentLabel{1}, 'Attribute')
        parent2search4Color = hMenuColor.Children(1);
    end
    hMenuColorSelected = findobj(hMenuColor, 'Label', label2search4Color{1}, 'Parent', parent2search4Color);
    if ~isempty(hMenuColorSelected), hMenuColorSelected.Checked = 'On'; end
end

% Markersize
if numel(unique(MarkerSize)) == 1 % if all PCs have the same MarkerSize
    hMenuMarkerSize = findobj(hFig.UserData.hMenuAll, 'Label', 'MarkerSize');
    hMenuMarkerSizeSelected = findobj(hMenuMarkerSize, 'Label', num2str(MarkerSize(1)));
    if ~isempty(hMenuMarkerSizeSelected), hMenuMarkerSizeSelected.Checked = 'On'; end
end

% ColormapName
if numel(unique(ColormapName)) == 1 % if all PCs have the same ColormapName
    hMenuColormapName = findobj(hFig.UserData.hMenuAll, 'Label', 'ColormapName');
    hMenuColormapNameSelected = findobj(hMenuColormapName, 'Label', ColormapName{1});
    if ~isempty(hMenuColormapNameSelected), hMenuColormapNameSelected.Checked = 'On'; end
end

end


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});

exports.default = function (controller) {

	/**
  * HANDLE DASHBOARD HERE
  */

	// joined a channel => make sure they want dashboard functionality
	controller.on(['channel_joined', 'group_joined'], function (bot, message) {

		var BotSlackUserId = bot.identity.id;

		console.log('\n\n\n yo joined the channel or group. (bot id is ' + BotSlackUserId + '):');
		console.log(message);

		var type = message.type;
		var _message$channel = message.channel;
		var id = _message$channel.id;
		var creator = _message$channel.creator;
		var members = _message$channel.members;
		var name = _message$channel.name;

		var botToken = bot.config.token;
		bot = _index.bots[botToken];

		// create channel record
		_models2.default.Channel.findOrCreate({
			where: { ChannelId: id }
		}).spread(function (channel, created) {
			var ChannelId = channel.ChannelId;
			var tz = channel.tz;

			var config = {
				ChannelId: ChannelId,
				BotSlackUserId: BotSlackUserId
			};

			_models2.default.User.find({
				where: { SlackUserId: creator }
			}).then(function (user) {

				var promise = [];
				if (user && user.TeamId) {
					promise.push(channel.update({
						TeamId: user.TeamId
					}));
				}

				Promise.all(promise).then(function () {

					// delete all teamPulseMessages for now and then create new one
					// when inviting for the first time
					_models2.default.Channel.find({
						where: { ChannelId: ChannelId }
					}).then(function (channel) {
						var ChannelId = channel.ChannelId;
						var tz = channel.tz;
						var TeamId = channel.TeamId;

						_models2.default.Team.find({
							where: ['"Team"."TeamId" = ?', TeamId]
						}).then(function (team) {
							var accessToken = team.accessToken;

							if (!accessToken) {
								console.log('\n\n\n ERROR... NO ACCESS TOKEN FOR BOT: ' + accessToken);
								return;
							}

							bot.api.channels.history({
								token: accessToken,
								channel: ChannelId
							}, function (err, response) {

								if (!err) {
									var messages = response.messages;

									messages.forEach(function (message) {

										// user is `SlackUserId`
										var user = message.user;
										var attachments = message.attachments;
										var ts = message.ts;

										// find the message of the team pulse

										if (user == BotSlackUserId && attachments && attachments[0].callback_id == _constants.constants.dashboardCallBackId) {
											bot.api.chat.delete({
												ts: ts,
												channel: ChannelId
											});
										}
									});

									if (tz) {
										// give a little time for all things to delete
										setTimeout(function () {
											controller.trigger('setup_dashboard_flow', [bot, config]);
										}, 500);
									} else {

										console.log('\n\n\n creator is: ' + creator + ' \n\n\n');

										var timezoneConfig = {
											CreatorSlackUserId: creator,
											ChannelId: ChannelId
										};
										controller.trigger('get_timezone_for_dashboard_flow', [bot, timezoneConfig]);
									}
								}
							});
						});
					});
				});
			});
		});
	});

	// this is set up for dashboard flow when tz does not exist
	controller.on('get_timezone_for_dashboard_flow', function (bot, config) {
		var CreatorSlackUserId = config.CreatorSlackUserId;
		var ChannelId = config.ChannelId;

		bot.startPrivateConversation({ user: CreatorSlackUserId }, function (err, convo) {

			convo.dashboardConfirm = {
				ChannelId: ChannelId
			};

			// right now we cannot handle confirmation of dashboard because
			// we don't have channels:write permission
			askTimeZoneForChannelDashboard(convo);

			// now trigger dashboard intro
			convo.on('end', function (convo) {

				// only way to get here is if timezone got updated.
				// now we can handle dashboard flow
				var _convo$dashboardConfi = convo.dashboardConfirm;
				var ChannelId = _convo$dashboardConfi.ChannelId;
				var neverMind = _convo$dashboardConfi.neverMind;

				if (neverMind) {
					return;
				}

				controller.trigger('setup_dashboard_flow', [bot, config]);
			});
		});
	});

	controller.on('setup_dashboard_flow', function (bot, config) {
		var ChannelId = config.ChannelId;
		var BotSlackUserId = config.BotSlackUserId;
		var tz = config.tz;

		// introduction message

		bot.send({
			channel: ChannelId,
			text: 'Hi! I\'m Toki, your team\'s sidekick to make Slack work for you and your collective attention\nI\'ll set up and manage a dashboard here of your team\'s statuses each day. If you ever need a refresher on how I work, just say `/explain` and I\'d love to go into more detail!'
		}, function () {

			(0, _slackHelpers.updateDashboardForChannelId)(bot, ChannelId);
		});
	});
};

var _index = require('../index');

var _momentTimezone = require('moment-timezone');

var _momentTimezone2 = _interopRequireDefault(_momentTimezone);

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

var _models = require('../../../app/models');

var _models2 = _interopRequireDefault(_models);

var _dotenv = require('dotenv');

var _dotenv2 = _interopRequireDefault(_dotenv);

var _constants = require('../../lib/constants');

var _messageHelpers = require('../../lib/messageHelpers');

var _sessions = require('../sessions');

var _slackHelpers = require('../../lib/slackHelpers');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function askTimeZoneForChannelDashboard(convo) {
	var text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
	var ChannelId = convo.dashboardConfirm.ChannelId;

	if (text == '') {
		text = 'Thanks for inviting me to <#' + ChannelId + '>! I\'ll introduce myself and set up a dashboard there of your team\'s priorities once I get which timezone you want <#' + ChannelId + '> to operate in :raised_hands:';
	}

	convo.ask({
		text: text,
		attachments: _constants.timeZoneAttachments
	}, [{
		pattern: _constants.utterances.noAndNeverMind,
		callback: function callback(response, convo) {
			convo.dashboardConfirm.neverMind = true;
			convo.say('Okay! If you want me to set up a dashboard in <#' + ChannelId + '> in the future, please `/remove` me then `/invite` me in <#' + ChannelId + '> again :wave:');
			convo.next();
		}
	}, {
		default: true,
		callback: function callback(response, convo) {
			var text = response.text;

			var timeZoneObject = false;
			switch (text) {
				case (text.match(_constants.utterances.eastern) || {}).input:
					timeZoneObject = _constants.timeZones.eastern;
					break;
				case (text.match(_constants.utterances.central) || {}).input:
					timeZoneObject = _constants.timeZones.central;
					break;
				case (text.match(_constants.utterances.mountain) || {}).input:
					timeZoneObject = _constants.timeZones.mountain;
					break;
				case (text.match(_constants.utterances.pacific) || {}).input:
					timeZoneObject = _constants.timeZones.pacific;
					break;
				case (text.match(_constants.utterances.other) || {}).input:
					timeZoneObject = _constants.timeZones.other;
					break;
				default:
					break;
			}

			if (!timeZoneObject) {
				convo.say("I didn't get that :thinking_face:");
				askTimeZoneForChannelDashboard(convo, 'Which timezone do you want the channel in?');
				convo.next();
			} else if (timeZoneObject == _constants.timeZones.other) {
				convo.say('Sorry!');
				convo.say("Right now I'm only able to work in these timezones. If you want to demo Toki, just pick one of these timezones for now. I'll try to get your timezone included as soon as possible!");
				askTimeZoneForChannelDashboard(convo, 'Which timezone do you want to go with for now?');
				convo.next();
			} else {
				// success!!

				var _timeZoneObject = timeZoneObject;
				var tz = _timeZoneObject.tz;

				console.log(timeZoneObject);
				_models2.default.Channel.update({
					tz: tz
				}, {
					where: { ChannelId: ChannelId }
				}).then(function (user) {
					convo.say('Great! If your timezone for <#' + ChannelId + '> changes, you can always `update settings`');
					convo.next();
				});
			}
		}
	}]);
}
//# sourceMappingURL=index.js.map


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:minHeight="@dimen/height_block_base"
  android:background="?cardBackground">
  <LinearLayout
    android:id="@+id/btn__search_point"
    android:layout_width="0dp"
    android:layout_weight="1"
    android:layout_height="match_parent"
    android:gravity="center_vertical"
    android:background="?clickableBackground">
    <ImageView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:src="@drawable/ic_search"
      android:tint="?colorAccent"
      android:layout_marginStart="@dimen/margin_base"
      android:layout_marginLeft="@dimen/margin_base"
      android:layout_marginEnd="@dimen/margin_base"
      android:layout_marginRight="@dimen/margin_base"/>
    <TextView
      android:id="@+id/tv__message"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center_vertical"
      android:textAppearance="@style/MwmTextAppearance.Body3"
      android:layout_marginRight="@dimen/margin_base"
      android:layout_marginEnd="@dimen/margin_base"
      android:layout_marginTop="@dimen/routing_action_panel_margin_vert"
      android:layout_marginBottom="@dimen/routing_action_panel_margin_vert"
      android:textColor="?colorAccent"
      tools:text="Add start point to plan a route."/>
  </LinearLayout>
  <LinearLayout
    android:id="@+id/btn__my_position_use"
    android:orientation="horizontal"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:gravity="center_vertical"
    android:background="?clickableBackground"
    android:visibility="gone"
    tools:visibility="visible">
    <View
      android:layout_width="1dp"
      android:layout_height="match_parent"
      android:layout_marginBottom="@dimen/margin_half"
      android:layout_marginTop="@dimen/margin_half"
      android:background="?dividerHorizontal"/>
    <ImageView
      android:id="@+id/iv__icon"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_margin="@dimen/margin_base"
      android:src="@drawable/ic_my_location"
      tools:tint="?colorAccent"/>
  </LinearLayout>
</LinearLayout>


text:
from PathFilter import PathFilter

## A PathFilter which removes leaf items.
class LeafPathFilter( PathFilter ) :

	def __init__( self, userData={} ) :

		PathFilter.__init__( self, userData )

	def _filter( self, paths ) :

		return [ p for p in paths if not p.isLeaf() ]


text:
/**
 * app path
 */
const { app } = require('electron')
const constants = require('./runtime-constants')
module.exports = {
  appPath: app.getPath('appData'),
  ...constants
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>LiveEquipd</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href='https://fonts.googleapis.com/css?family=Oxygen:400,300,700' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Lora' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="bower_components/angular-ui-notification/dist/angular-ui-notification.css">
    <link rel="stylesheet" href="resources/stylesheets/app.css">
    <link rel="stylesheet" href="resources/stylesheets/login.css">
    <link rel="stylesheet" href="resources/stylesheets/home.css">
    <link rel="stylesheet" href="resources/stylesheets/add-product.css">
    <link rel="stylesheet" href="resources/stylesheets/product.css">
    <link rel="stylesheet" href="resources/stylesheets/prod-detail.css">
    <link rel="stylesheet" href="resources/stylesheets/product-cart.css">
    <link rel="stylesheet" href="resources/stylesheets/view-order.css">

<loading class="loading-indicator"></loading>


text:
/*
 * File:    mocklib_common.c
 * Author:  Maciej Gajdzica
 * Brief:   Functions used internally by generated mocks.
 *
 * Date:    13.08.2017
 */

#include <stdint.h>
#include <stddef.h>

#include "mocklib_utlib_defines.h"

#include "mocklib.h"
#include "mocklib_internal.h"
#include "mocklib_expfun.h"
#include "mocklib_malloc.h"
#include "mocklib_common.h"

mocklib_expdata_t mocklib_common_expdata_create_and_check(void)
{
    mocklib_expdata_t expdata = NULL;

    expdata = mocklib_expdata_create();

    if (NULL == expdata)
    {
        UTLIB_TEST_FAIL_MSG("Cannot create expected function data");
    }

    return expdata;
}

void * mocklib_common_internal_create_and_check(size_t size)
{
    void *internal = NULL;

    internal = MOCKLIB_MALLOC(size);

     if (NULL == internal)
     {
         UTLIB_TEST_FAIL_MSG("Cannot create expected function internal data");
     }

    return internal;
}

void mocklib_common_funtype_check(mocklib_expdata_t expdata, mocklib_funtype_t funtype_exp)
{
    if (funtype_exp != mocklib_expdata_funtype_get(expdata))
    {
        UTLIB_TEST_FAIL_MSG("Function called out of order");
    }
}

void * mocklib_common_internal_get_and_check(mocklib_expdata_t expdata)
{
    void *internal = NULL;

    internal = mocklib_expdata_internal_get(expdata);
    if (NULL == internal)
    {
        UTLIB_TEST_FAIL_MSG("Missing expected function data");
    }

    return internal;
}

void mocklib_common_cb_check(void *cb)
{
    if (NULL == cb)
    {
        UTLIB_TEST_FAIL_MSG("Invalid callback function");
    }
}

void mocklib_common_err_if_mode_not_basic(mocklib_mode_t mode)
{
    if (MOCKLIB_MODE_BASIC != mode)
    {
        UTLIB_TEST_FAIL_MSG("Expect function shall be called only in basic mode");
    }
}

void mocklib_common_err_if_mode_not_trace(mocklib_mode_t mode)
{
    if (MOCKLIB_MODE_TRACE != mode)
    {
        UTLIB_TEST_FAIL_MSG("Expect function shall be called only in trace mode");
    }
}

void mocklib_common_err_if_mode_not_cb(mocklib_mode_t mode)
{
    if (MOCKLIB_MODE_CALLBACK != mode)
    {
        UTLIB_TEST_FAIL_MSG("Expect function shall be called only in callback mode");
    }
}


text:
<?php

/* @var $this \yii\web\View */
/* @var $content string */

//use yii\helpers\Html;
//use yii\bootstrap\Nav;
//use yii\bootstrap\NavBar;
//use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use yii\helpers\Html;

AppAsset::register($this);
?>

<?php $this->beginPage() ?>
    <!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <?php $this->head() ?>

    <?php $this->beginBody() ?>

                        <form method="get" action="<?= \yii\helpers\Url::to(['category/search']) ?>">
                            <input type="text" placeholder="ПОИСК" name="q">
                        </form>

<a href="<?= \yii\helpers\Url::to(['/admin']) ?>">Админка

                        <?php if (!Yii::$app->user->isGuest): ?>

<a href="<?= yii\helpers\Url::to(['/site/logout']) ?>"> <?= Yii::$app->user->identity['username'] ?> (Выход)

                        <?php endif; ?>

            <a href="<?= yii\helpers\Url::home() ?> "><?= Html::img("@web/images/logo.png", ['id' => 'logo','class'=>'text-center']) ?>

                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                            Toggle navigation

                        </button>

                                <a href="<?= \yii\helpers\Url::to(['category/index'])?>">ГЛАВНАЯ

                                <a href="<?= \yii\helpers\Url::to(['/category/categ']) ?>">КАТЕГОРИИ

                                <a href="<?= \yii\helpers\Url::to(['/site/contact']) ?>">ОБРАТНАЯ СВЯЗЬ

    <?= $content ?>

 Справочник - Мой Владикавказ © 2016

        <?php $this->endBody() ?>

<?php $this->endPage() ?>


text:
<?php

/**
 * Calculate items and address amounts including/excluding tax
 */
namespace Magento\Tax\Model\Sales\Total\Quote;

use Magento\Quote\Model\Quote\Address;
use Magento\Quote\Api\Data\ShippingAssignmentInterface;

class Subtotal extends CommonTaxCollector
{
    /**
     * Calculate tax on product items. The result will be used to determine shipping
     * and discount later.
     *
     * @param \Magento\Quote\Model\Quote $quote
     * @param ShippingAssignmentInterface $shippingAssignment
     * @param Address\Total $total
     * @return $this
     */
    public function collect(
        \Magento\Quote\Model\Quote $quote,
        \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment,
        \Magento\Quote\Model\Quote\Address\Total $total
    ) {
        $items = $shippingAssignment->getItems();
        if (!$items) {
            return $this;
        }

        $store = $quote->getStore();
        $priceIncludesTax = $this->_config->priceIncludesTax($store);

        //Setup taxable items
        $itemDataObjects = $this->mapItems($shippingAssignment, $priceIncludesTax, false);
        $quoteDetails = $this->prepareQuoteDetails($shippingAssignment, $itemDataObjects);
        $taxDetails = $this->taxCalculationService
            ->calculateTax($quoteDetails, $store->getStoreId());

        $itemDataObjects = $this->mapItems($shippingAssignment, $priceIncludesTax, true);
        $baseQuoteDetails = $this->prepareQuoteDetails($shippingAssignment, $itemDataObjects);
        $baseTaxDetails = $this->taxCalculationService
            ->calculateTax($baseQuoteDetails, $store->getStoreId());

        $itemsByType = $this->organizeItemTaxDetailsByType($taxDetails, $baseTaxDetails);

        if (isset($itemsByType[self::ITEM_TYPE_PRODUCT])) {
            $this->processProductItems($shippingAssignment, $itemsByType[self::ITEM_TYPE_PRODUCT], $total);
        }

        return $this;
    }

    /**
     * @param \Magento\Quote\Model\Quote $quote
     * @param Address\Total $total
     * @return null
     * @codeCoverageIgnore
     */
    public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total)
    {
        return null;
    }
}


text:
<!DOCTYPE html>

  <title>existential.io</title>
  <link href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
        rel="stylesheet">
  <link href="ss/app.css" rel="stylesheet">

      existential.io

      A guided canvas to draw your data into - directly, dynamically, simply.

        About

        Source

          <button type="button" class="close" data-dismiss="modal"
                  aria-hidden="true">×</button>

About existential.io

Why do this?

Visualizing data is a powerful way to discover meaning. Current
            methods are lackluster because none allow for both direct
            manipulation of visuals and dynamic loading of data. Drawing by
            hand is direct but means a new drawing for every set of data.
            Writing code creates dynamic visuals but requires programming
            knowledge and blind manipulation of symbols.

How does it work?

It doesn't yet - so stay tuned!

            Built for

              Rails Rumble 2013
            as Draw Your Data

Data

input

                    1
                    2
                    3
                    4
                    5
                    6

                    4
                    8
                    6
                    2
                    7
                    5

Steps

select a tool by shortcut or click

        <canvas id="guided-canvas" width="800px" height="400px">
          Your browser is not supported.
        </canvas>

Draw

rect

r

line

d

circle

c

Adjust

move

x

scale

s

rotate

e

Flow

loop

l


text:
//
//  Vertex.cpp
//
// Sketchup C++ Wrapper for C API
// MIT License
//
// Copyright (c) 2017 Tom Kaneko
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//

// Macro for getting rid of unused variables commonly for assert checking
#define _unused(x) ((void)(x))

#include "SUAPI-CppWrapper/model/Vertex.hpp"

#include <cassert>
#include <stdexcept>

namespace CW {
/******************************
** Private Static Methods *****
*******************************/
SUVertexRef Vertex::copy_reference(const Vertex& other) {
  // As vertices cannot be "copied", we simply pass the existing reference.
  return other.ref();
}

/******************************
** Constructors / Destructor **
*******************************/
Vertex::Vertex():
  Entity()
{}

Vertex::Vertex(SUVertexRef vertex):
  Entity(SUVertexToEntity(vertex), true)
{}

Vertex::Vertex(const Vertex& other):
  Entity(other, SUVertexToEntity(copy_reference(other)))
{}

Vertex::~Vertex() {
  // Vertices cannot be released, as they are elements that are attached to something else.
}

Vertex& Vertex::operator=(const Vertex& other) {
  // Simply assign the other vertex to this object.
  m_entity = other.m_entity;
  Entity::operator=(other);
  return (*this);
}

/*******************
** Public Methods **
********************/
Point3D Vertex::position() const {
  if (!(*this)) {
    throw std::logic_error("CW::Vertex::position(): Vertex is null");
  }
  SUPoint3D point;
  SUResult res = SUVertexGetPosition(this->ref(), &point);
  assert(res == SU_ERROR_NONE); _unused(res);
  return Point3D(point);
}

Vertex::operator SUVertexRef() const {
  return this->ref();
}

SUVertexRef Vertex::ref() const {
  return SUVertexFromEntity(m_entity);
}

Vertex::operator SUPoint3D() const {
  return position();
}

Vertex::operator Point3D() const {
  return position();
}

} /* namespace CW */


text:
namespace ExamSystem.Backend.Web.PubnubCore
{
    using System;
    using System.Linq;

    using PubNubMessaging.Core;

    public class NotificationService : INotificationService
    {
        private Pubnub pub;

        public NotificationService()
        {
            string publishKey = "pub-c-c693309f-b4aa-46ad-b8c2-b586283d5ac5";
            string subscribeKey = "sub-c-71fcc204-3f55-11e4-8637-02ee2ddab7fe";
            this.pub = new Pubnub(publishKey, subscribeKey);
            this.pub.Origin = "pubsub.pubnub.com";
            this.pub.Subscribe("exam-system", (obj) => { }, (obj) => { }, (obj) => { });
        }

        public bool Send(string message)
        {
            if (string.IsNullOrWhiteSpace(message))
            {
                return false;
            }

            try
            {
                this.pub.Publish<string>("exam-system", message, (obj) => { }, (obj) => { });
            }
            catch (Exception ex)
            {
                return false;
            }

            return true;
        }
    }
}


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

namespace System.Web.Http
{
    public static class ApiControllerExtensions
    {
        public static IHttpActionResult AccessDenied(this ApiController controller)
        {
            if (controller == null) throw new ArgumentNullException("controller");

            return new AccessDeniedResult(controller.Request);
        }
    }
}


text:
FactoryGirl.define do
  factory :pet do
    type ""
    name "MyString"
    photo "MyString"
    size "MyString"
    household_id 1
    allergies "MyString"
    vet_id 1
    age "MyString"
    feeding "MyString"
    notes "MyString"
    behavior_id 1
    supply_id 1
  end
end


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

    Copyright 2015 Atos
    Contact: Atos <roman.sosa@atos.net>

       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at

           http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>eu.modaclouds.sla.core</groupId>
	<artifactId>parent</artifactId>
	<packaging>pom</packaging>
	<version>0.5.0</version>
	<name>SLA parent</name>

	<modules>
		<module>sla-repository</module>
		<module>sla-tools</module>
		<module>sla-enforcement</module>
		<module>sla-personalization</module>
		<module>sla-service</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<maven-jar-plugin-version>2.4</maven-jar-plugin-version>
		<maven-compiler-plugin-version>2.4</maven-compiler-plugin-version>
		<maven-failsafe-plugin-version>2.8.1</maven-failsafe-plugin-version>
		<maven-war-plugin-version>2.4</maven-war-plugin-version>
		<cobertura-maven-plugin-version>2.3</cobertura-maven-plugin-version>

		<jersey-version>1.18.1</jersey-version>
		<spring-version>3.2.4.RELEASE</spring-version>
		<hibernate-version>4.2.7.Final</hibernate-version>
		<slf4j-version>1.7.7</slf4j-version>
		<commons-httpclient-version>3.1</commons-httpclient-version>
		<jackson-version>2.4.5</jackson-version>
		<java-mail-version>1.5.4</java-mail-version>
	</properties>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${maven-compiler-plugin-version}</version>
					<configuration>
						<source>1.6</source>
						<target>1.6</target>
					</configuration>
				</plugin>
				<plugin>
					<artifactId>maven-jar-plugin</artifactId>
					<version>${maven-jar-plugin-version}</version>
					<executions>
						<execution>
							<goals>
								<goal>test-jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>${maven-failsafe-plugin-version}</version>
					<executions>
						<execution>
							<goals>
								<goal>integration-test</goal>
								<goal>verify</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>cobertura-maven-plugin</artifactId>
					<version>${cobertura-maven-plugin-version}</version>
					<configuration>
						<formats>
							<format>html</format>
							<format>xml</format>
						</formats>
					</configuration>
					<executions>
						<execution>
							<phase>package</phase>
							<goals>
								<goal>cobertura</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>${maven-war-plugin-version}</version>
					<configuration>
						<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
					</configuration>
				</plugin>
				<plugin>
					<groupId>com.mycila</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<version>2.6</version>
					<configuration>
						<header>${project.basedir}/LICENSE-header.txt</header>
						<properties>
							<organization>Atos</organization>
							<year>2015</year>
							<owner>Atos</owner>
							<email>roman.sosa@atos.net</email>
						</properties>
						<excludes>
							<exclude>**/README.md</exclude>
							<exclude>src/test/resources/**</exclude>
							<exclude>src/main/resources/**</exclude>
							<exclude>samples/**</exclude>
							<exclude>docs/**</exclude>
							<exclude>bin/**</exclude>
							<exclude>LICENSE.txt</exclude>
							<exclude>configuration.properties</exclude>
						</excludes>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>check</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

			</plugins>
		</pluginManagement>
	</build>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j-version}</version>
		</dependency>
	</dependencies>
</project>


text:
require 'spec_helper'

describe Wisper::Testing do
  it 'has a version number' do
    expect(Wisper::Testing::VERSION).not_to be nil
  end

  before(:each) do
    Wisper.configuration.broadcasters.clear
    described_class._forget
  end

  let(:publisher_class) { Class.new { include Wisper::Publisher } }
  let(:publisher)  { publisher_class.new }
  let(:subscriber) { double('Subscriber') }

  describe '#fake!' do
    it 'ensures listener does not receive events' do
      Wisper.configuration.broadcaster(:default, Wisper::Broadcasters::SendBroadcaster.new)

      described_class.fake!

      event_name = 'foobar'

      publisher.subscribe(subscriber)

      expect(subscriber).not_to receive(event_name)
      expect(subscriber).to respond_to(event_name)

      publisher.send(:broadcast, event_name)
    end

    it 'sets fake broadcaster for all broadcaster keys' do
      Wisper.configuration.broadcaster(:default, double)
      Wisper.configuration.broadcaster(:async,   double)

      described_class.fake!

      expect(Wisper.configuration.broadcasters[:default]).to an_instance_of(Wisper::Testing::FakeBroadcaster)
      expect(Wisper.configuration.broadcasters[:async]).to an_instance_of(Wisper::Testing::FakeBroadcaster)
    end

    it 'returns self' do
      expect(Wisper::Testing.fake!).to eq Wisper::Testing
    end
  end

  describe "#fake" do
    it "#fake!s for the duration of the block only" do
      Wisper.configuration.broadcaster(:default, Wisper::Broadcasters::SendBroadcaster.new)
      publisher.subscribe(subscriber)
      event_name = 'foobar'

      blk = -> { publisher.send(:broadcast, event_name) }

      expect(subscriber).not_to receive(event_name)
      expect { |blk| described_class.fake(&blk) }.to yield_with_no_args
      expect(described_class).to_not be_enabled
    end
  end

  describe '#inline!' do
    it 'ensures all events are broadcast synchronously' do
      Wisper.configuration.broadcaster(:default, double.as_null_object)
      Wisper.configuration.broadcaster(:async,   double.as_null_object)

      described_class.inline!

      event_name = 'foobar'

      publisher.subscribe(subscriber)

      expect(subscriber).to receive(event_name)

      publisher.send(:broadcast, event_name)
    end

    it 'uses default broadcaster for all events' do
      Wisper.configuration.broadcaster(:default, double)
      Wisper.configuration.broadcaster(:async,   double)

      described_class.inline!

      expect(Wisper.configuration.broadcasters[:default]).to an_instance_of(Wisper::Testing::InlineBroadcaster)
      expect(Wisper.configuration.broadcasters[:async]).to an_instance_of(Wisper::Testing::InlineBroadcaster)
    end

    it 'returns self' do
      expect(Wisper::Testing.inline!).to eq Wisper::Testing
    end
  end

  describe '#restore!' do
    it 'restores all broadcasters' do
      default_broadcaster = double
      async_broadcaster = double

      Wisper.configuration.broadcaster(:default, default_broadcaster)
      Wisper.configuration.broadcaster(:async,   async_broadcaster)

      Wisper::Testing.fake!

      Wisper::Testing.restore!

      expect(Wisper.configuration.broadcasters[:default]).to eq default_broadcaster
      expect(Wisper.configuration.broadcasters[:async]).to eq async_broadcaster
    end

    describe 'when fake! or inline! have never been called' do
      it 'is a no-op' do
        default_broadcaster = double
        async_broadcaster = double

        Wisper.configuration.broadcaster(:default, default_broadcaster)
        Wisper.configuration.broadcaster(:async,   async_broadcaster)

        Wisper::Testing.restore!

        expect(Wisper.configuration.broadcasters[:default]).to eq default_broadcaster
        expect(Wisper.configuration.broadcasters[:async]).to eq async_broadcaster
      end
    end

    it 'returns self' do
      expect(Wisper::Testing.restore!).to eq Wisper::Testing
    end
  end

  describe '#enabled?' do
    it 'returns false' do
      expect(described_class.enabled?).to eq false
    end

    describe 'when faking' do
      it 'returns true' do
        described_class.fake!
        expect(described_class.enabled?).to eq true
      end

      describe 'and then restored' do
        it 'returns false' do
          described_class.fake!
          described_class.restore!
          expect(described_class.enabled?).to eq false
        end
      end
    end

    describe 'when inline' do
      it 'returns true' do
        described_class.inline!
        expect(described_class.enabled?).to eq true
      end

      describe 'and then restored' do
        it 'returns false' do
          described_class.inline!
          described_class.restore!
          expect(described_class.enabled?).to eq false
        end
      end
    end
  end
end


text:
require 'spec_helper'

describe WodsController do

end


text:
using System;

using NUnit.Framework;

using Org.BouncyCastle.Math;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Digests;
using Org.BouncyCastle.Crypto.Signers;
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Encodings;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Utilities.Encoders;
using Org.BouncyCastle.Utilities.Test;

namespace Org.BouncyCastle.Crypto.Tests
{
    /// <summary>Test based on FIPS 186-2, Appendix 5, an example of DSA.</summary>
    [TestFixture]
    public class DsaTest
		: SimpleTest
    {
		public override string Name
        {
			get { return "DSA"; }
        }

		internal IBigInteger pValue = new BigInteger("8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8324f0d7882e5d0762fc5b7210eafc2e9adac32ab7aac49693dfbf83724c2ec0736ee31c80291", 16);
        internal IBigInteger qValue = new BigInteger("c773218c737ec8ee993b4f2ded30f48edace915f", 16);

		public override void PerformTest()
        {
			byte[] k1 = Hex.Decode("d5014e4b60ef2ba8b6211b4062ba3224e0427dd3");
			byte[] k2 = Hex.Decode("345e8d05c075c3a508df729a1685690e68fcfb8c8117847e89063bca1f85d968fd281540b6e13bd1af989a1fbf17e06462bf511f9d0b140fb48ac1b1baa5bded");

			SecureRandom random = FixedSecureRandom.From(k1, k2);

			byte[] keyData = Hex.Decode("b5014e4b60ef2ba8b6211b4062ba3224e0427dd3");

			SecureRandom keyRandom = FixedSecureRandom.From(keyData, keyData);

			IBigInteger r = new BigInteger("68076202252361894315274692543577577550894681403");
            IBigInteger s = new BigInteger("1089214853334067536215539335472893651470583479365");
            DsaParametersGenerator pGen = new DsaParametersGenerator();

            pGen.Init(512, 80, random);

            DsaParameters parameters = pGen.GenerateParameters();
            DsaValidationParameters pValid = parameters.ValidationParameters;

            if (pValid.Counter != 105)
            {
                Fail("Counter wrong");
            }

            if (!pValue.Equals(parameters.P) || !qValue.Equals(parameters.Q))
            {
                Fail("p or q wrong");
            }

            DsaKeyPairGenerator dsaKeyGen = new DsaKeyPairGenerator();
            DsaKeyGenerationParameters genParam = new DsaKeyGenerationParameters(keyRandom, parameters);

            dsaKeyGen.Init(genParam);

            IAsymmetricCipherKeyPair pair = dsaKeyGen.GenerateKeyPair();

            ParametersWithRandom param = new ParametersWithRandom(pair.Private, keyRandom);

            DsaSigner dsa = new DsaSigner();

            dsa.Init(true, param);

			byte[] message = new BigInteger("968236873715988614170569073515315707566766479517").ToByteArrayUnsigned();
			IBigInteger[] sig = dsa.GenerateSignature(message);

			if (!r.Equals(sig[0]))
            {
                Fail("r component wrong." + SimpleTest.NewLine
					+ " expecting: " + r + SimpleTest.NewLine
					+ " got      : " + sig[0]);
            }

            if (!s.Equals(sig[1]))
            {
                Fail("s component wrong." + SimpleTest.NewLine
					+ " expecting: " + s + SimpleTest.NewLine
					+ " got      : " + sig[1]);
            }

			dsa.Init(false, pair.Public);

            if (!dsa.VerifySignature(message, sig[0], sig[1]))
            {
                Fail("verification fails");
            }
        }

        public static void Main(
            string[] args)
        {
            RunTest(new DsaTest());
        }

		[Test]
        public void TestFunction()
        {
            string resultText = Perform().ToString();

			Assert.AreEqual(Name + ": Okay", resultText);
        }
    }
}


text:
package com.lingju.model.dao;

import android.text.TextUtils;
import android.util.Log;

import com.google.gson.JsonArray;
import com.lingju.assistant.entity.RobotConstant;
import com.lingju.common.repository.SyncDao;
import com.lingju.lbsmodule.location.Address;
import com.lingju.model.BaiduAddress;
import com.lingju.model.BaiduAddressDao;
import com.lingju.robot.AndroidChatRobotBuilder;

import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.query.WhereCondition;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import io.reactivex.Single;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;

/**
 * Created by Ken on 2016/12/21.
 */
public class BaiduNaviDao implements SyncDao<com.lingju.context.entity.Address> {

    private static BaiduNaviDao instance;
    private BaiduAddressDao mAddressDao;

    private BaiduNaviDao() {
        if (DaoManager.get() != null && DaoManager.get().getDaoSession() != null) {

        }
        mAddressDao = DaoManager.get().getDaoSession().getBaiduAddressDao();
        try {
            mAddressDao = DaoManager.get().getDaoSession().getBaiduAddressDao();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public synchronized static BaiduNaviDao getInstance() {
        if (instance == null) {
            instance = new BaiduNaviDao();
        }
        return instance;
    }

    /**
     * 获取指定数量的常用(已收藏)地址
     *
     * @param list
     * @param number 指定数量 <=0则搜索全部
     **/
    public void getFavorList(List<BaiduAddress> list, int number) {
        if (list == null) {
            return;
        }
        list.clear();
        QueryBuilder<BaiduAddress> queryBuilder = mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.Recyle.eq(0), BaiduAddressDao.Properties.FavoritedTime.isNotNull())
                .orderDesc(BaiduAddressDao.Properties.FavoritedTime);
        if (number > 0) {
            queryBuilder = queryBuilder.limit(number);
        }
        list.addAll(queryBuilder.list());
    }

    /**
     * 获取指定数量搜索历史记录
     *
     * @param list   待填充的数据集合
     * @param number 指定数量 <=0则搜索全部
     **/
    public void getHistoryList(List<BaiduAddress> list, int number) {
        if (list == null) {
            return;
        }
        list.clear();
        QueryBuilder<BaiduAddress> queryBuilder = mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.Disable.eq(0),
                BaiduAddressDao.Properties.SearchKeyWord.isNotNull())
                .orderDesc(BaiduAddressDao.Properties.Created);
        if (number > 0) {
            queryBuilder = queryBuilder.limit(number);
        }
        list.addAll(queryBuilder.list());
    }

    /**
     * @param name
     * @param lat
     * @param lng
     * @return
     */
    public BaiduAddress find(String name, Double lat, Double lng) {

        return mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.Name.eq(name),
                BaiduAddressDao.Properties.Latitude.eq(lat), BaiduAddressDao.Properties.Longitude.eq(lng)).limit(1).unique();

    }

    /**
     * 获取更多的历史记录,如之前已获取了N页记录,则当前获取N+1页的记录,
     * 如果之前获取数量不满N页但大于(N-navi)页,则当前只尝试获取N页记录。保证
     * 获取到数据是新的
     *
     * @param list    之前已获取的记录
     * @param perPage 每页的记录数量
     * @return <0 list没有更新,数据库没有新的记录,=0 list有更新,已获取所有符合条件的记录, >0 数据库仍有未读的记录
     */
    public int getMoreHistoryList(List<BaiduAddress> list, int perPage) {
        if (list == null || perPage <= 0) {
            throw new NullPointerException("list is null or perPage<=0");
        }
        int limit = list.size();
        int total = (int) getHistoryCount();
        if (total == limit)
            return -1;
        list.clear();
        System.out.println("limit" + limit + "perPage" + perPage + "total" + total);
        limit = perPage * (limit / perPage + 1);
        if (limit > total)
            limit = total;
        System.out.println("limit" + limit + "perPage" + perPage + "total" + total);
        List<BaiduAddress> historys = mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.Disable.eq(0),
                BaiduAddressDao.Properties.SearchKeyWord.isNotNull())
                .orderDesc(BaiduAddressDao.Properties.Created)
                .limit(limit).list();
        list.addAll(historys);
        return total - limit;
    }

    /**
     * 获取历史搜索地址的记录的总数
     **/
    public long getHistoryCount() {
        return mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.Disable.eq(0),
                BaiduAddressDao.Properties.SearchKeyWord.isNotNull()).count();
    }

    /**
     * 获取家或单位地址
     **/
    public BaiduAddress getHomeOrCompanyAddress(String remark) {
        List<BaiduAddress> addressList = getRemarkAddress(remark);
        if (addressList.size() > 0) {
            return addressList.get(0);
        }
        return null;
    }

    /**
     * 获取指定标记的地址记录
     **/
    public List<BaiduAddress> getRemarkAddress(String remark) {
        return mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.Remark.eq(remark)).list();
    }

    /**
     * 插入一条地址记录
     **/
    public void insertAddress(BaiduAddress address) {
        if (address.getFavoritedTime() != null)
            address.setSynced(false);
        if (address.getId() != null) {
            updateAddress(address);
        } else {
            if (!TextUtils.isEmpty(address.getName())) {
                BaiduAddress ba = findBySKAndName(address.getSearchKeyWord(), address.getName());
                if (ba != null) {
                    address.setCreated(new Date());
                    address.setUpdate(ba);
                    updateAddress(address);
                    return;
                }
            }
            mAddressDao.insert(address);
        }
    }

    /**
     * 修改一条地址记录
     **/
    public void updateAddress(BaiduAddress address) {
        mAddressDao.update(address);
    }

    /**
     * 查询最新插入的地址记录
     **/
    public BaiduAddress findNewCreated() {
        return mAddressDao.queryBuilder().orderDesc(BaiduAddressDao.Properties.Id).limit(1).unique();
    }

    /**
     * 根据指定搜索关键词和地址描述搜索地址
     **/
    public BaiduAddress findBySKAndName(String searchkeyWord, String name) {
        QueryBuilder<BaiduAddress> queryBuilder = mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.Name.eq(name));
        if (!TextUtils.isEmpty(searchkeyWord)) {
            queryBuilder = queryBuilder.where(BaiduAddressDao.Properties.SearchKeyWord.eq(searchkeyWord));
        }
        return queryBuilder.limit(1).unique();
    }

    /**
     * 清除搜索历史记录
     **/
    public void removeHistoryAddress() {
        List<BaiduAddress> list = mAddressDao.queryBuilder().list();
        for (BaiduAddress address : list) {
            if (address.getFavoritedTime() != null) {    //若已收藏,则只去除搜索标记,保留记录
                address.setSearchKeyWord(null);
                mAddressDao.update(address);
            } else {
                mAddressDao.delete(address);    //若未收藏则直接删除记录
            }
        }
    }

    /**
     * 将Address对象信息填充到BaiduAddress对象中
     **/
    public BaiduAddress get(Address address) {
        BaiduAddress temp = new BaiduAddress();
        temp.setName(address.getAddressDetail());
        temp.setAddress(address.getAddressDetail());
        temp.setLatitude(address.getLatitude());
        temp.setLongitude(address.getLongitude());
        temp.setCreated(new Date());
        BaiduAddress baiduAddress = get(temp);
        return baiduAddress == null ? temp : baiduAddress;
    }

    /**
     * 根据指定地址名称或经纬度查询地址
     **/
    public BaiduAddress get(BaiduAddress baiduAddress) {
        DecimalFormat df = new DecimalFormat("0.0000");
        WhereCondition andCondition = mAddressDao.queryBuilder().and(BaiduAddressDao.Properties.Latitude.like(df.format(baiduAddress.getLatitude()) + "%"),
                BaiduAddressDao.Properties.Longitude.like(df.format(baiduAddress.getLongitude()) + "%"));
        return mAddressDao.queryBuilder().whereOr(BaiduAddressDao.Properties.Address.eq(baiduAddress.getAddress())
                , andCondition).orderDesc(BaiduAddressDao.Properties.FavoritedTime).limit(1).unique();
    }

    /**
     * 查询最近一次搜索的地址
     **/
    public BaiduAddress getLastSearchedAddress() {
        return mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.SearchKeyWord.isNotNull())
                .orderDesc(BaiduAddressDao.Properties.Created).limit(1).unique();
    }

    /**
     * 移除家或单位标记
     **/
    public void removeHomeOrCompany(String remark) {
        if (TextUtils.isEmpty(remark)) {
            return;
        }
        List<BaiduAddress> addressList = getRemarkAddress(remark);
        for (BaiduAddress address : addressList) {
            if (remark.equals("家") || remark.equals("单位"))
                address.setSynced(false);
            address.setRemark(null);
            insertAddress(address);
        }
    }

    /**
     * 移除地址
     */
    public void removeAddress(String remark) {
        if (TextUtils.isEmpty(remark)) {
            return;
        }
        BaiduAddress remarkAddress = getHomeOrCompanyAddress(remark);
        mAddressDao.delete(remarkAddress);
    }

    /**
     * 同步收藏地址
     **/
    public void sync() {
        Single.just(0)
                .observeOn(Schedulers.io())
                .doOnSuccess(new Consumer<Integer>() {
                    @Override
                    public void accept(Integer integer) throws Exception {
                        AndroidChatRobotBuilder.get().robot().actionTargetAccessor().sync(instance);
                    }
                })
                .subscribe();
    }

    @Override
    public int getTargetId() {
        return RobotConstant.ACTION_ADDRESS;
    }

    @Override
    public Class<com.lingju.context.entity.Address> getTargetClass() {
        return com.lingju.context.entity.Address.class;
    }

    @Override
    public long getLastTimestamp() {
        long t = 0;
        BaiduAddress address = mAddressDao.queryBuilder().orderDesc(BaiduAddressDao.Properties.Timestamp).limit(1).unique();
        if (address != null)
            t = address.getTimestamp();
        return t;
    }

    @Override
    public boolean mergeServerData(JsonArray jsonArray) {
        return false;
    }

    @Override
    public boolean mergeServerData(List<com.lingju.context.entity.Address> list) {
        if (list != null && list.size() > 0) {
            mergeAddressData(list);
            AndroidChatRobotBuilder.get().robot().actionTargetAccessor().syncUpdate(this);
        }
        return true;
    }

    @Override
    public List<com.lingju.context.entity.Address> getUnSyncLocalData(int i) {
        List<com.lingju.context.entity.Address> syncList = new ArrayList<>();
        List<BaiduAddress> list = new ArrayList<>();
        getFavorList(list, 0);
        for (BaiduAddress ba : list) {
            if (!ba.getSynced()) {
                com.lingju.context.entity.Address address = new com.lingju.context.entity.Address();
                address.setName(ba.getName());
                address.setDetailedaddress(ba.getAddress());
                address.setLatitude(ba.getLatitude());
                address.setLongitude(ba.getLongitude());
                address.setAlias(ba.getRemark());
                address.setCity(ba.getCity());
                address.setTelephone(ba.getPhoneNum());
                address.setUid(ba.getUid());
                address.setSynced(ba.getSynced());
                address.setRecyle(ba.getRecyle());
                address.setTimestamp(ba.getTimestamp());
                address.setLid(ba.getId().intValue());
                address.setSid(ba.getSid());
                syncList.add(address);
            }
        }
        return syncList;
    }

    @Override
    public int getUnsyncLocalDataCount() {
        return (int) mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.Synced.eq(false)).count();
    }

    @Override
    public JsonArray getUnSyncLocalDataAsJsonArray(int i) {
        return null;
    }

    private void mergeAddressData(List<com.lingju.context.entity.Address> list) {
        List<BaiduAddress> addresses = new ArrayList<>();
        for (com.lingju.context.entity.Address address : list) {
            Log.i("LingJu", "BaiduNaviDao mergeAddressData()>>> " + address.getLid() + " " + address.getName() + " " + address.getTimestamp());
            BaiduAddress ba = mAddressDao.queryBuilder().where(BaiduAddressDao.Properties.Id.eq(address.getLid())).limit(1).unique();
            if (ba == null)
                ba = new BaiduAddress();
            ba.setName(address.getName());
            ba.setAddress(address.getDetailedaddress());
            ba.setUid(address.getUid());
            ba.setPhoneNum(address.getTelephone());
            ba.setRemark(address.getAlias());
            ba.setLatitude(address.getLatitude());
            ba.setLongitude(address.getLongitude());
            ba.setCity(ba.getCity());
            ba.setSynced(true);
            ba.setFavoritedTime(new Date(address.getTimestamp()));
            ba.setTimestamp(address.getTimestamp());
            ba.setRecyle(address.getRecyle());
            ba.setSid(address.getSid());
            addresses.add(ba);
        }
        mAddressDao.insertOrReplaceInTx(addresses);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">

    <display-name>odata4</display-name>

    <listener>
        <listener-class>org.teiid.oauth.keycloak.Bootstrap</listener-class>
    </listener>

    <filter>
       <filter-name>AuthFilter</filter-name>
       <filter-class>org.teiid.oauth.keycloak.AuthFilter</filter-class>
    </filter>

    <filter>
       <filter-name>ODataFilter</filter-name>
       <filter-class>org.teiid.olingo.web.ODataFilter</filter-class>
       <!--
        In cloud environment or if under a proxy, update the below url with address of the proxy to generate
        odata links correctly.
       <init-param>
            <param-name>proxy-base-uri</param-name>
            <param-value>http://{host}</param-value>
       </init-param>
       -->

       <!--
       When using in context per VDB use these values to define the VDB name and version
       <init-param>
            <param-name>vdb-name</param-name>
            <param-value>vdbname</param-value>
       </init-param>
       <init-param>
            <param-name>vdb-version</param-name>
            <param-value>version</param-value>
       </init-param>
        -->

       <init-param>
            <param-name>batch-size</param-name>
            <param-value>256</param-value>
       </init-param>
       <init-param>
            <param-name>skiptoken-cache-time</param-name>
            <param-value>300000</param-value>
       </init-param>
       <init-param>
            <param-name>local-transport-name</param-name>
            <param-value>odata</param-value>
       </init-param>
       <init-param>
            <param-name>PassthroughAuthentication</param-name>
            <param-value>false</param-value>
       </init-param>
       <!--
       <init-param>
            <param-name>charset</param-name>
            <param-value>UTF-8</param-value>
       </init-param>
        -->
       <!--
       <init-param>
            <param-name>invalid-xml10-character-replacement</param-name>
             <param-value>?</param-value>
       </init-param>
       -->
    </filter>

    <filter-mapping>
       <filter-name>AuthFilter</filter-name>
       <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
       <filter-name>ODataFilter</filter-name>
       <url-pattern>/*</url-pattern>
    </filter-mapping>

    <servlet>
        <servlet-name>auth</servlet-name>
        <servlet-class>org.teiid.oauth.keycloak.AuthServlet</servlet-class>
    </servlet>

    <servlet>
        <servlet-name>odata4</servlet-name>
        <servlet-class>org.teiid.olingo.web.ODataServlet</servlet-class>
    </servlet>

    <servlet>
        <servlet-name>static</servlet-name>
        <servlet-class>org.teiid.olingo.web.StaticContentServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>odata4</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>static</servlet-name>
        <url-pattern>/static/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>auth</servlet-name>
        <url-pattern>/keycloak/*</url-pattern>
    </servlet-mapping>

    <security-role>
        <description>security role</description>
        <role-name>odata</role-name>
    </security-role>

    <security-constraint>
        <display-name>Require valid user</display-name>
        <web-resource-collection>
            <web-resource-name>Teiid OData Application</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>odata</role-name>
        </auth-constraint>
    </security-constraint>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Teiid Rest Application</web-resource-name>
            <url-pattern>/static/*</url-pattern>
        </web-resource-collection>
    </security-constraint>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Teiid Rest Application</web-resource-name>
            <url-pattern>/keycloak/*</url-pattern>
        </web-resource-collection>
    </security-constraint>

    <login-config>
        <auth-method>KEYCLOAK</auth-method>
        <realm-name>Teiid OData Application</realm-name>
    </login-config>
</web-app>


text:
    {% if invoice.merged_invoice %}
        **** Note: This invoice has been merged with another invoice. View the merged invoices here ****
    {% endif %}

    Annual Auction {{ invoice.year }}

    {{ invoice.invoice_date }}

        Invoice Number: {{ invoice.id }}

        Bid Number: {{ invoice.attendee.bid_number }}

        Bidder Name: {{ invoice.attendee }}

        Bidder Table: {{ invoice.attendee.table_assignment }}

            Item Number

            Item Description

            Price

        {% for item in invoice.items.all %}

            {{ item.item_number }}

            {{ item.description }}

            {{ item.selling_price }}

        {% endfor %}

            Invoice Total
            ${{ invoice.total_amount }}

            Sold to:
            {{ invoice.paid_for_by }}

            Payment Method:  {{ invoice.payment_type }}

            Thank you for supporting the Wildlife Center of Virginia!

<form action="{% url 'update_invoice' invoice.id %}" method="get">
    {% csrf_token %}
    <input type="hidden" value="{{ invoice }}" name="invoice"/>
    <input type="submit" value="Update" name="update_invoice" id="submit" />
</form>

{% if invoice.paid_for_by %}

{% endif %}

{% if error %}

No Attendee information found for attendee with ID {{ id }}

{% endif %}


text:
require 'travis/build/addons/apt'

module Travis
  module Build
    class Addons
      class AptPackages
        SUPER_USER_SAFE = true

        class << self
          def new(script, sh, data, config)
            ::Travis::Build::Addons::Apt.new(script, sh, data, { packages: config })
          end
        end
      end
    end
  end
end


text:
layout: base
title:  'Statistics of appos in UD_Turkish-Atis'
udver: '2'
---

## Treebank Statistics: UD_Turkish-Atis: Relations: `appos`

This relation is universal.

1 nodes (0%) are attached to their parents as `appos`.

1 instances of `appos` (100%) are left-to-right (parent precedes child).
Average distance between parent and child is 2.

The following 1 pairs of parts of speech are connected with `appos`: <tt>PROPN</tt>-<tt>ADP</tt> (1; 100% instances).

~~~ conllu
# visual-style 7	bgColor:blue
# visual-style 7	fgColor:white
# visual-style 5	bgColor:blue
# visual-style 5	fgColor:white
# visual-style 5 7 appos	color:blue
1	Washington	washington	PROPN	_	Case=Nom|Number=Sing	3	nmod	_	_
2	DC'den	dc	PROPN	_	Case=Abl|Number=Sing	1	flat	_	_
3	Denver	denver	PROPN	_	Case=Nom|Number=Sing	8	obl	_	_
4	Colorado'ya	colorado	PROPN	_	Case=Dat|Number=Sing	3	flat	_	_
5	United	united	PROPN	_	Case=Nom|Number=Sing	8	obl	_	_
6	Airlines	airlines	PROPN	_	Case=Nom|Number=Sing	5	flat	_	_
7	ile	ile	ADP	_	_	5	appos	_	_
8	uçmak	uç	NOUN	_	Case=Nom|Number=Sing|Person=3	9	xcomp	_	_
9	istiyorum	iste	VERB	_	Aspect=Prog|Mood=Ind|Number=Sing|Person=1|Polarity=Pos|Tense=Pres|VerbForm=Fin	0	root	_	_

~~~


text:
'use strict';
var path = require('path');
var chalk = require('chalk');
var os = require('os');
var marked = require('marked');
var TerminalRenderer = require('marked-terminal');
var fs = require('fs');
var Q = require('q');

marked.setOptions({renderer: new TerminalRenderer()});

var convertInput = function(parameters) {
    var args = Array.prototype.slice.call(parameters);
    args = args.map(function(value, index) {
        if (typeof value === 'object') {
            try {
                return JSON.stringify(value);
            } catch (e) {
                return value.toString();
            }
        }
        return value;
    });
    return args;
};

var wrapperPromise = function(promise) {
    promise.success = function(fn) {
        promise.then(function(data) {
            fn(data);
        });
        return promise;
    };

    promise.error = function(fn) {
        promise.then(null, function(err) {
            fn(err);
        });
        return promise;
    };

};

var Utils = {
    repeat: function(ch, sz) {
        return new Array(sz + 1).join(ch);
    },
    length: function(str) {
        var len = 0;
        for (var i = 0; i < str.length; i++) {
            if (str.charCodeAt(i) > 256) {
                len += 2;
                continue;
            }
            len += 1;
        }
        return len;
    },
    logger: {
        success: function() {
            var args = convertInput(arguments);
            console.log(chalk.bold.green.apply(undefined, args));
        },
        info: function() {
            var args = convertInput(arguments);
            console.log(chalk.white.apply(undefined, args));
        },
        warn: function() {
            var args = convertInput(arguments);
            console.log(chalk.bold.yellow.apply(undefined, args));
        },
        error: function() {
            var args = convertInput(arguments);
            console.log(chalk.bold.red.apply(undefined, args));
        }
    },
    printFile: function(filePath) {
        console.log(marked(fs.readFileSync(filePath, {
            encoding: 'utf8'
        })));
    },
    deferred: function() {
        var deferred = Q.defer();
        var promise = deferred.promise;
        wrapperPromise(promise);
        return deferred;
    },
    promiseWith: function(value) {
        var promise = Q.fcall(function() {
            return value;
        });
        wrapperPromise(promise);
        return promise;
    }
};

module.exports = Utils;