text:
class CreateFollowingTags < ActiveRecord::Migration
  def change
    create_table :following_tags do |t|
      t.references :user, null: false, index: true
      t.references :tag, null: false, index: true
      t.foreign_key :users, dependent: :delete

      t.timestamps
    end

    add_index :following_tags, [:user_id, :tag_id], unique: true
  end
end

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Runtime.CompilerServices;

using Xunit;

namespace System.Runtime.CompilerServices.Tests
{
    public class ConditionalWeakTableTests
    {
        [Fact]
        public static void Add()
        {
            ConditionalWeakTable<object, object> cwt = new ConditionalWeakTable<object, object>();
            object key = new object();
            object value = new object();
            object obj = null;

            cwt.Add(key, value);

            Assert.True(cwt.TryGetValue(key, out value));
            Assert.Equal(value, cwt.GetOrCreateValue(key));
            Assert.Equal(value, cwt.GetValue(key, k => new object()));

            WeakReference<object> wrValue = new WeakReference<object>(value, false);
            WeakReference<object> wrkey = new WeakReference<object>(key, false);
            key = null;
            value = null;

            GC.Collect();

            // key and value must be collected
            Assert.False(wrValue.TryGetTarget(out obj));
            Assert.False(wrkey.TryGetTarget(out obj));
        }

        [Fact]
        public static void GetOrCreateValue()
        {
            ConditionalWeakTable<object, object> cwt = new ConditionalWeakTable<object, object>();
            object key = new object();
            object obj = null;

            object value = cwt.GetOrCreateValue(key);

            Assert.True(cwt.TryGetValue(key, out value));
            Assert.Equal(value, cwt.GetValue(key, k => new object()));

            WeakReference<object> wrValue = new WeakReference<object>(value, false);
            WeakReference<object> wrkey = new WeakReference<object>(key, false);
            key = null;
            value = null;

            GC.Collect();

            // key and value must be collected
            Assert.False(wrValue.TryGetTarget(out obj));
            Assert.False(wrkey.TryGetTarget(out obj));
        }

        [Fact]
        public static void GetValue()
        {
            ConditionalWeakTable<object, object> cwt = new ConditionalWeakTable<object, object>();
            object key = new object();
            object obj = null;

            object value = cwt.GetValue(key, k => new object());

            Assert.True(cwt.TryGetValue(key, out value));
            Assert.Equal(value, cwt.GetOrCreateValue(key));

            WeakReference<object> wrValue = new WeakReference<object>(value, false);
            WeakReference<object> wrkey = new WeakReference<object>(key, false);
            key = null;
            value = null;

            GC.Collect();

            // key and value must be collected
            Assert.False(wrValue.TryGetTarget(out obj));
            Assert.False(wrkey.TryGetTarget(out obj));
        }
    }
}


text:
$(function () {
  $(".datetimepicker").datetimepicker({
    stepMinute: 5,
    controlType: "select",
    timeFormat: "h:mm TT",
    dateFormat: "D, M d yy at",
  });
});


text:
package com.jeeplus.web.service.system;

import com.jeeplus.web.entities.system.SysLogEntity;

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

/**
 * 系统日志
 * @author:yuzp17311
 * @version:v1.0
 * @date: 2017-03-30 11:22.
 */
public interface SysLogService {

    SysLogEntity queryObject(Long id);

    List<SysLogEntity> queryList(Map<String, Object> map);

    int queryTotal(Map<String, Object> map);

    void save(SysLogEntity sysLog);

    void update(SysLogEntity sysLog);

    void delete(Long id);

    void deleteBatch(Long[] ids);

}


text:
package com.googlecode.rockit.exception;

import org.antlr.runtime.Token;

public class Messages {
	public static String printDatabaseExceptionError(String sqlQuery, String message){
		return "\n===========================================================================\n"
		+"RockIt terminated with an error in the SQL Query. There are two reasons for this error:\n"
		+"(a) The most common reason for this is that your model is too large. In this case you will get timeout errors or 'SQLException: Incorrect key file for table' errors.\n"
		+"    Either your -data file contains too many entries or your -input file contains formulas with too many variables (more than 3 variables might be already critical)\n"
		+"    Please make your -data file much smaller (not more than 20 entries) and try again.\n\n"
		+"(b) If you still get an SQL Error (typically saying 'You have an error in your SQL syntax'), this is presumably a bug.\n"
		+"    Please generate a ticket at https://code.google.com/p/rockit/issues/list and upload your MLN and data file. \n"
		+"    Furthermore, please post the following error messages into the ticket:"
		+ "\n - Query " + sqlQuery +"\n - Message " + message +
		"\nThank you for your help in improving RockIt.\n===========================================================================\n";
	}

	public static String printParseExceptionError(String individualMessage){
		return "\n===========================================================================\n"+
	    "RockIt terminated with a parse exception either in your -input or -data file. \n"+
	    "\nPlease also check for messages like 'line X:Y ...' (where X is the line number and Y the position within the line) above and address them first.\n"+
	    "---------------------------------------------------------\n"+
	    individualMessage+
	    "\n---------------------------------------------------------\n"+
	    "If you are not able to identify your parsing error, please generate a ticket at https://code.google.com/p/rockit/issues/list, upload your MLN and data file in this ticket, and post the error message. "+
	    "\n===========================================================================\n";
	}

	public static String printTokenDetails(Token token){
		return token.getText() + " at line " + token.getLine() + " and position " + token.getCharPositionInLine();
	}

}


text:
package com.synedge.oss.client.config.policy;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author Paul van Assen
 */
@Data
@NoArgsConstructor(access = AccessLevel.PACKAGE)
@AllArgsConstructor
public class PullOrigins implements Serializable {
    private boolean gzip;
    private String primaryOriginId;
    private String secondaryOriginId;
}


text:
import { composeWithTracker } from 'react-komposer';
import { Meteor } from 'meteor/meteor';
import { CommunitiesItems } from '../../components/communities/communities-items';
import { Loading } from '../../components/loading';

import { Communities } from '../../../api/communities/communities';

const composer = (props, onData) => {

  const options = {};

  if (props.user && props.user.communityIds && Meteor.subscribe('communities-search', props).ready()) {

    if (props.searchQuery && props.sort == "most-relevant")
      options.sort = { score: { $meta: 'textScore' } };
    else if (props.sort == "largest-first")
      options.sort = { count: -1 };
    else if (props.sort == "smallest-first")
      options.sort = { count: 1 };

    const communities = Communities.find({_id: {$in: props.user.communityIds} }, options).fetch();

    onData(null, {
      communities: communities,
      props: props,
    });

  } else {
    onData(null, {
      communities: [],
      props: props
    });
  }
};

export default MyCommunitiesItems = composeWithTracker(composer, Loading)(CommunitiesItems);


text:
'use strict';

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

var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _Node2 = require('../Node');

var _Node3 = _interopRequireDefault(_Node2);

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

var SwitchCase = function (_Node) {
    (0, _inherits3.default)(SwitchCase, _Node);

    function SwitchCase(childNodes) {
        (0, _classCallCheck3.default)(this, SwitchCase);
        return (0, _possibleConstructorReturn3.default)(this, (SwitchCase.__proto__ || (0, _getPrototypeOf2.default)(SwitchCase)).call(this, 'SwitchCase', childNodes));
    }

    (0, _createClass3.default)(SwitchCase, [{
        key: '_acceptChildren',
        value: function _acceptChildren(children) {
            var test = null;

            if (children.isToken('Keyword', 'case')) {
                children.passToken();
                children.skipNonCode();

                test = children.passExpression();
                children.skipNonCode();
            } else {
                children.passToken('Keyword', 'default');
                children.skipNonCode();
            }

            children.passToken('Punctuator', ':');
            children.skipNonCode();

            var consequent = [];

            while (!children.isEnd) {
                consequent.push(children.passStatement());
                children.skipNonCode();
            }

            children.assertEnd();

            this.test = test;
            this.consequent = consequent;
        }
    }]);
    return SwitchCase;
}(_Node3.default);

exports.default = SwitchCase;
//# sourceMappingURL=SwitchCase.js.map


text:
from __future__ import absolute_import

import datetime

from django.utils import timezone
from uuid import uuid4

from sentry.api.endpoints.organization_releases import ReleaseSerializerWithProjects
from sentry.api.serializers import serialize
from sentry.models import (Commit, CommitAuthor,
    Release, ReleaseCommit, ReleaseProject, TagValue, User, UserEmail,)
from sentry.testutils import TestCase

class ReleaseSerializerTest(TestCase):
    def test_simple(self):
        user = self.create_user()
        project = self.create_project()
        project2 = self.create_project(organization=project.organization)
        release = Release.objects.create(
            organization_id=project.organization_id,
            version=uuid4().hex
        )
        release.add_project(project)
        release.add_project(project2)
        ReleaseProject.objects.filter(
            release=release,
            project=project
        ).update(new_groups=1)
        ReleaseProject.objects.filter(
            release=release,
            project=project2
        ).update(new_groups=1)
        tag1 = TagValue.objects.create(
            project=project,
            key='sentry:release',
            value=release.version,
            first_seen=timezone.now(),
            last_seen=timezone.now(),
            times_seen=5,
        )
        tag2 = TagValue.objects.create(
            project=project2,
            key='sentry:release',
            value=release.version,
            first_seen=timezone.now() - datetime.timedelta(days=2),
            last_seen=timezone.now() - datetime.timedelta(days=1),
            times_seen=5,
        )
        commit_author = CommitAuthor.objects.create(
            name='stebe',
            email='stebe@sentry.io',
            organization_id=project.organization_id,
        )
        commit = Commit.objects.create(
            organization_id=project.organization_id,
            repository_id=1,
            key='abc',
            author=commit_author,
            message='waddap',
        )
        ReleaseCommit.objects.create(
            organization_id=project.organization_id,
            project_id=project.id,
            release=release,
            commit=commit,
            order=1,
        )

        result = serialize(release, user)
        assert result['version'] == release.version
        assert result['shortVersion'] == release.version
        # should be sum of all projects
        assert result['newGroups'] == 2
        # should be tags from all projects
        assert result['firstEvent'] == TagValue.objects.get(id=tag2.id).first_seen
        assert result['lastEvent'] == TagValue.objects.get(id=tag1.id).last_seen
        assert result['commitCount'] == 1
        assert result['authors'] == [{'name': 'stebe', 'email': 'stebe@sentry.io'}]

        result = serialize(release, user, project=project)
        # should be groups from one project
        assert result['newGroups'] == 1
        # should be tags from one project
        assert result['firstEvent'] == TagValue.objects.get(id=tag1.id).first_seen
        assert result['lastEvent'] == TagValue.objects.get(id=tag1.id).last_seen

        # Make sure a sha1 value gets truncated
        release.version = '0' * 40
        result = serialize(release, user)
        assert result['shortVersion'] == '0' * 12

    def test_no_tag_data(self):
        user = self.create_user()
        project = self.create_project()
        release = Release.objects.create(
            organization_id=project.organization_id,
            version=uuid4().hex,
        )
        release.add_project(project)
        commit_author = CommitAuthor.objects.create(
            name='stebe',
            email='stebe@sentry.io',
            organization_id=project.organization_id,
        )
        commit = Commit.objects.create(
            organization_id=project.organization_id,
            repository_id=1,
            key='abc',
            author=commit_author,
            message='waddap',
        )
        ReleaseCommit.objects.create(
            organization_id=project.organization_id,
            project_id=project.id,
            release=release,
            commit=commit,
            order=1,
        )

        result = serialize(release, user)
        assert result['version'] == release.version
        assert not result['firstEvent']
        assert not result['lastEvent']

    def test_get_user_from_email(self):
        user = User.objects.create(email='stebe@sentry.io')
        UserEmail.get_primary_email(user=user)
        project = self.create_project()
        self.create_member(user=user, organization=project.organization)
        release = Release.objects.create(
            organization_id=project.organization_id,
            version=uuid4().hex,
            new_groups=1,
        )
        release.add_project(project)
        commit_author = CommitAuthor.objects.create(
            name='stebe',
            email='stebe@sentry.io',
            organization_id=project.organization_id,
        )
        commit = Commit.objects.create(
            organization_id=project.organization_id,
            repository_id=1,
            key='abc',
            author=commit_author,
            message='waddap',
        )
        ReleaseCommit.objects.create(
            organization_id=project.organization_id,
            project_id=project.id,
            release=release,
            commit=commit,
            order=1,
        )

        result = serialize(release, user)
        result_author = result['authors'][0]
        assert int(result_author['id']) == user.id
        assert result_author['email'] == user.email
        assert result_author['username'] == user.username

    def test_get_single_user_from_email(self):
        """
        Tests that the first useremail will be used to
        associate a user with a commit author email
        """
        user = User.objects.create(email='stebe@sentry.io')
        otheruser = User.objects.create(email='adifferentstebe@sentry.io')
        UserEmail.objects.create(email='stebe@sentry.io', user=otheruser)
        project = self.create_project()
        self.create_member(user=user, organization=project.organization)
        self.create_member(user=otheruser, organization=project.organization)
        release = Release.objects.create(
            organization_id=project.organization_id,
            version=uuid4().hex,
            new_groups=1,
        )
        release.add_project(project)
        commit_author = CommitAuthor.objects.create(
            name='stebe',
            email='stebe@sentry.io',
            organization_id=project.organization_id,
        )
        commit = Commit.objects.create(
            organization_id=project.organization_id,
            repository_id=1,
            key='abc',
            author=commit_author,
            message='waddap',
        )
        ReleaseCommit.objects.create(
            organization_id=project.organization_id,
            project_id=project.id,
            release=release,
            commit=commit,
            order=1,
        )

        result = serialize(release, user)
        assert len(result['authors']) == 1
        result_author = result['authors'][0]
        assert int(result_author['id']) == user.id
        assert result_author['email'] == user.email
        assert result_author['username'] == user.username

    def test_select_user_from_appropriate_org(self):
        """
        Tests that a user not belonging to the organization
        is not returned as the author
        """
        user = User.objects.create(email='stebe@sentry.io')
        email = UserEmail.objects.get(user=user, email='stebe@sentry.io')
        otheruser = User.objects.create(email='adifferentstebe@sentry.io')
        otheremail = UserEmail.objects.create(email='stebe@sentry.io', user=otheruser)
        project = self.create_project()
        self.create_member(user=otheruser, organization=project.organization)
        release = Release.objects.create(
            organization_id=project.organization_id,
            version=uuid4().hex,
            new_groups=1,
        )
        release.add_project(project)
        commit_author = CommitAuthor.objects.create(
            name='stebe',
            email='stebe@sentry.io',
            organization_id=project.organization_id,
        )
        commit = Commit.objects.create(
            organization_id=project.organization_id,
            repository_id=1,
            key='abc',
            author=commit_author,
            message='waddap',
        )
        ReleaseCommit.objects.create(
            organization_id=project.organization_id,
            project_id=project.id,
            release=release,
            commit=commit,
            order=1,
        )

        assert email.id < otheremail.id
        result = serialize(release, user)
        assert len(result['authors']) == 1
        result_author = result['authors'][0]
        assert int(result_author['id']) == otheruser.id
        assert result_author['email'] == otheruser.email
        assert result_author['username'] == otheruser.username

    def test_no_commit_author(self):
        user = User.objects.create(email='stebe@sentry.io')
        otheruser = User.objects.create(email='adifferentstebe@sentry.io')
        project = self.create_project()
        self.create_member(user=otheruser, organization=project.organization)
        release = Release.objects.create(
            organization_id=project.organization_id,
            version=uuid4().hex,
            new_groups=1,
        )
        release.add_project(project)
        commit = Commit.objects.create(
            organization_id=project.organization_id,
            repository_id=1,
            key='abc',
            message='waddap',
        )
        ReleaseCommit.objects.create(
            organization_id=project.organization_id,
            project_id=project.id,
            release=release,
            commit=commit,
            order=1,
        )

        result = serialize(release, user)
        assert result['authors'] == []

    def test_deduplicate_users(self):
        """
        Tests that the same user is not returned more than once
        if there are commits associated with multiple of their
        emails
        """
        user = User.objects.create(email='stebe@sentry.io')
        email = UserEmail.objects.get(user=user, email='stebe@sentry.io')
        otheremail = UserEmail.objects.create(email='alsostebe@sentry.io', user=user)
        project = self.create_project()
        self.create_member(user=user, organization=project.organization)
        release = Release.objects.create(
            organization_id=project.organization_id,
            version=uuid4().hex,
            new_groups=1,
        )
        release.add_project(project)
        commit_author1 = CommitAuthor.objects.create(
            name='stebe',
            email=email.email,
            organization_id=project.organization_id,
        )
        commit_author2 = CommitAuthor.objects.create(
            name='stebe',
            email=otheremail.email,
            organization_id=project.organization_id,
        )
        commit1 = Commit.objects.create(
            organization_id=project.organization_id,
            repository_id=1,
            key='abc',
            author=commit_author1,
            message='waddap',
        )
        commit2 = Commit.objects.create(
            organization_id=project.organization_id,
            repository_id=1,
            key='cde',
            author=commit_author2,
            message='oh hi',
        )
        ReleaseCommit.objects.create(
            organization_id=project.organization_id,
            project_id=project.id,
            release=release,
            commit=commit1,
            order=1,
        )
        ReleaseCommit.objects.create(
            organization_id=project.organization_id,
            project_id=project.id,
            release=release,
            commit=commit2,
            order=2,
        )
        result = serialize(release, user)
        assert len(result['authors']) == 1
        assert result['authors'][0]['email'] == 'stebe@sentry.io'

class ReleaseRefsSerializerTest(TestCase):
    def test_simple(self):
        # test bad refs
        data = {
            'version': 'a' * 40,
            'projects': ['earth'],
            'refs': [None]
        }

        serializer = ReleaseSerializerWithProjects(data=data)

        assert not serializer.is_valid()
        assert serializer.errors == {
            'refs': [u'Incorrect type. Expected value, but got null'],
        }

        # test good refs
        data = {
            'version': 'a' * 40,
            'projects': ['earth'],
            'refs': [{
                'repository': 'my-repo',
                'commit': 'b' * 40,
            }]
        }

        serializer = ReleaseSerializerWithProjects(data=data)

        assert serializer.is_valid()


text:
namespace net {

namespace test {

static const QuicGuid kTestGuid = 42;
static const int kTestPort = 123;

// Returns the test peer IP address.
IPAddressNumber TestPeerIPAddress();

// Upper limit on versions we support.
QuicVersion QuicVersionMax();

// Lower limit on versions we support.
QuicVersion QuicVersionMin();

// Returns an address for 127.0.0.1.
IPAddressNumber Loopback4();

void CompareCharArraysWithHexError(const std::string& description,
                                   const char* actual,
                                   const int actual_len,
                                   const char* expected,
                                   const int expected_len);

bool DecodeHexString(const base::StringPiece& hex, std::string* bytes);

// Returns the length of a QuicPacket that is capable of holding either a
// stream frame or a minimal ack frame.  Sets |*payload_length| to the number
// of bytes of stream data that will fit in such a packet.
size_t GetPacketLengthForOneStream(
    QuicVersion version,
    bool include_version,
    QuicSequenceNumberLength sequence_number_length,
    InFecGroup is_in_fec_group,
    size_t* payload_length);

// Returns QuicConfig set to default values.
QuicConfig DefaultQuicConfig();

// Returns a version vector consisting of |version|.
QuicVersionVector SupportedVersions(QuicVersion version);

template<typename SaveType>
class ValueRestore {
 public:
  ValueRestore(SaveType* name, SaveType value)
      : name_(name),
        value_(*name) {
    *name_ = value;
  }
  ~ValueRestore() {
    *name_ = value_;
  }

 private:
  SaveType* name_;
  SaveType value_;

  DISALLOW_COPY_AND_ASSIGN(ValueRestore);
};

class MockFramerVisitor : public QuicFramerVisitorInterface {
 public:
  MockFramerVisitor();
  virtual ~MockFramerVisitor();

  MOCK_METHOD1(OnError, void(QuicFramer* framer));
  // The constructor sets this up to return false by default.
  MOCK_METHOD1(OnProtocolVersionMismatch, bool(QuicVersion version));
  MOCK_METHOD0(OnPacket, void());
  MOCK_METHOD1(OnPublicResetPacket, void(const QuicPublicResetPacket& header));
  MOCK_METHOD1(OnVersionNegotiationPacket,
               void(const QuicVersionNegotiationPacket& packet));
  MOCK_METHOD0(OnRevivedPacket, void());
  // The constructor sets this up to return true by default.
  MOCK_METHOD1(OnUnauthenticatedHeader, bool(const QuicPacketHeader& header));
  // The constructor sets this up to return true by default.
  MOCK_METHOD1(OnUnauthenticatedPublicHeader, bool(
      const QuicPacketPublicHeader& header));
  MOCK_METHOD1(OnPacketHeader, bool(const QuicPacketHeader& header));
  MOCK_METHOD1(OnFecProtectedPayload, void(base::StringPiece payload));
  MOCK_METHOD1(OnStreamFrame, bool(const QuicStreamFrame& frame));
  MOCK_METHOD1(OnAckFrame, bool(const QuicAckFrame& frame));
  MOCK_METHOD1(OnCongestionFeedbackFrame,
               bool(const QuicCongestionFeedbackFrame& frame));
  MOCK_METHOD1(OnFecData, void(const QuicFecData& fec));
  MOCK_METHOD1(OnRstStreamFrame, bool(const QuicRstStreamFrame& frame));
  MOCK_METHOD1(OnConnectionCloseFrame,
               bool(const QuicConnectionCloseFrame& frame));
  MOCK_METHOD1(OnGoAwayFrame, bool(const QuicGoAwayFrame& frame));
  MOCK_METHOD1(OnWindowUpdateFrame, bool(const QuicWindowUpdateFrame& frame));
  MOCK_METHOD1(OnBlockedFrame, bool(const QuicBlockedFrame& frame));
  MOCK_METHOD0(OnPacketComplete, void());

 private:
  DISALLOW_COPY_AND_ASSIGN(MockFramerVisitor);
};

class NoOpFramerVisitor : public QuicFramerVisitorInterface {
 public:
  NoOpFramerVisitor() {}

  virtual void OnError(QuicFramer* framer) OVERRIDE {}
  virtual void OnPacket() OVERRIDE {}
  virtual void OnPublicResetPacket(
      const QuicPublicResetPacket& packet) OVERRIDE {}
  virtual void OnVersionNegotiationPacket(
      const QuicVersionNegotiationPacket& packet) OVERRIDE {}
  virtual void OnRevivedPacket() OVERRIDE {}
  virtual bool OnProtocolVersionMismatch(QuicVersion version) OVERRIDE;
  virtual bool OnUnauthenticatedHeader(const QuicPacketHeader& header) OVERRIDE;
  virtual bool OnUnauthenticatedPublicHeader(
      const QuicPacketPublicHeader& header) OVERRIDE;
  virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE;
  virtual void OnFecProtectedPayload(base::StringPiece payload) OVERRIDE {}
  virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE;
  virtual bool OnAckFrame(const QuicAckFrame& frame) OVERRIDE;
  virtual bool OnCongestionFeedbackFrame(
      const QuicCongestionFeedbackFrame& frame) OVERRIDE;
  virtual void OnFecData(const QuicFecData& fec) OVERRIDE {}
  virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) OVERRIDE;
  virtual bool OnConnectionCloseFrame(
      const QuicConnectionCloseFrame& frame) OVERRIDE;
  virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE;
  virtual bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) OVERRIDE;
  virtual bool OnBlockedFrame(const QuicBlockedFrame& frame) OVERRIDE;
  virtual void OnPacketComplete() OVERRIDE {}

 private:
  DISALLOW_COPY_AND_ASSIGN(NoOpFramerVisitor);
};

class FramerVisitorCapturingPublicReset : public NoOpFramerVisitor {
 public:
  FramerVisitorCapturingPublicReset();
  virtual ~FramerVisitorCapturingPublicReset();

  virtual void OnPublicResetPacket(
      const QuicPublicResetPacket& packet) OVERRIDE;

  const QuicPublicResetPacket public_reset_packet() {
    return public_reset_packet_;
  }

 private:
  QuicPublicResetPacket public_reset_packet_;
};

class FramerVisitorCapturingFrames : public NoOpFramerVisitor {
 public:
  FramerVisitorCapturingFrames();
  virtual ~FramerVisitorCapturingFrames();

  // Reset the visitor to it's initial state.
  void Reset();

  // NoOpFramerVisitor
  virtual void OnVersionNegotiationPacket(
      const QuicVersionNegotiationPacket& packet) OVERRIDE;
  virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE;
  virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE;
  virtual bool OnAckFrame(const QuicAckFrame& frame) OVERRIDE;
  virtual bool OnCongestionFeedbackFrame(
      const QuicCongestionFeedbackFrame& frame) OVERRIDE;
  virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) OVERRIDE;
  virtual bool OnConnectionCloseFrame(
      const QuicConnectionCloseFrame& frame) OVERRIDE;
  virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE;

  size_t frame_count() const { return frame_count_; }
  QuicPacketHeader* header() { return &header_; }
  const std::vector<QuicStreamFrame>* stream_frames() const {
    return &stream_frames_;
  }
  const std::vector<string*>& stream_data() const {
    return stream_data_;
  }
  QuicAckFrame* ack() { return ack_.get(); }
  QuicCongestionFeedbackFrame* feedback() { return feedback_.get(); }
  QuicRstStreamFrame* rst() { return rst_.get(); }
  QuicConnectionCloseFrame* close() { return close_.get(); }
  QuicGoAwayFrame* goaway() { return goaway_.get(); }
  QuicVersionNegotiationPacket* version_negotiation_packet() {
    return version_negotiation_packet_.get();
  }

 private:
  size_t frame_count_;
  QuicPacketHeader header_;
  std::vector<QuicStreamFrame> stream_frames_;
  std::vector<std::string*> stream_data_;
  scoped_ptr<QuicAckFrame> ack_;
  scoped_ptr<QuicCongestionFeedbackFrame> feedback_;
  scoped_ptr<QuicRstStreamFrame> rst_;
  scoped_ptr<QuicConnectionCloseFrame> close_;
  scoped_ptr<QuicGoAwayFrame> goaway_;
  scoped_ptr<QuicVersionNegotiationPacket> version_negotiation_packet_;

  DISALLOW_COPY_AND_ASSIGN(FramerVisitorCapturingFrames);
};

class MockConnectionVisitor : public QuicConnectionVisitorInterface {
 public:
  MockConnectionVisitor();
  virtual ~MockConnectionVisitor();

  MOCK_METHOD1(OnStreamFrames, bool(const std::vector<QuicStreamFrame>& frame));
  MOCK_METHOD1(OnWindowUpdateFrames,
               void(const std::vector<QuicWindowUpdateFrame>& frame));
  MOCK_METHOD1(OnBlockedFrames,
               void(const std::vector<QuicBlockedFrame>& frame));
  MOCK_METHOD1(OnRstStream, void(const QuicRstStreamFrame& frame));
  MOCK_METHOD1(OnGoAway, void(const QuicGoAwayFrame& frame));
  MOCK_METHOD2(OnConnectionClosed, void(QuicErrorCode error, bool from_peer));
  MOCK_METHOD0(OnWriteBlocked, void());
  MOCK_METHOD0(OnCanWrite, void());
  MOCK_CONST_METHOD0(HasPendingWrites, bool());
  MOCK_CONST_METHOD0(HasPendingHandshake, bool());
  MOCK_METHOD1(OnSuccessfulVersionNegotiation,
               void(const QuicVersion& version));
  MOCK_METHOD0(OnConfigNegotiated, void());

 private:
  DISALLOW_COPY_AND_ASSIGN(MockConnectionVisitor);
};

class MockHelper : public QuicConnectionHelperInterface {
 public:
  MockHelper();
  virtual ~MockHelper();
  virtual const QuicClock* GetClock() const OVERRIDE;
  virtual QuicRandom* GetRandomGenerator() OVERRIDE;
  virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) OVERRIDE;
  void AdvanceTime(QuicTime::Delta delta);

 private:
  MockClock clock_;
  MockRandom random_generator_;
};

class MockConnection : public QuicConnection {
 public:
  // Uses a MockHelper, GUID of 42, and 127.0.0.1:123.
  explicit MockConnection(bool is_server);

  // Uses a MockHelper, GUID of 42.
  MockConnection(IPEndPoint address, bool is_server);

  // Uses a MockHelper, and 127.0.0.1:123
  MockConnection(QuicGuid guid, bool is_server);

  // Uses a Mock helper, GUID of 42, and 127.0.0.1:123.
  MockConnection(bool is_server, const QuicVersionVector& supported_versions);

  virtual ~MockConnection();

  // If the constructor that uses a MockHelper has been used then this method
  // will advance the time of the MockClock.
  void AdvanceTime(QuicTime::Delta delta);

  MOCK_METHOD3(ProcessUdpPacket, void(const IPEndPoint& self_address,
                                      const IPEndPoint& peer_address,
                                      const QuicEncryptedPacket& packet));
  MOCK_METHOD1(SendConnectionClose, void(QuicErrorCode error));
  MOCK_METHOD2(SendConnectionCloseWithDetails, void(QuicErrorCode error,
                                                    const string& details));
  MOCK_METHOD3(SendRstStream, void(QuicStreamId id,
                                   QuicRstStreamErrorCode error,
                                   QuicStreamOffset bytes_written));
  MOCK_METHOD3(SendGoAway, void(QuicErrorCode error,
                                QuicStreamId last_good_stream_id,
                                const string& reason));
  MOCK_METHOD0(OnCanWrite, void());

  void ProcessUdpPacketInternal(const IPEndPoint& self_address,
                                const IPEndPoint& peer_address,
                                const QuicEncryptedPacket& packet) {
    QuicConnection::ProcessUdpPacket(self_address, peer_address, packet);
  }

  virtual bool OnProtocolVersionMismatch(QuicVersion version) OVERRIDE {
    return false;
  }

 private:
  scoped_ptr<QuicPacketWriter> writer_;
  scoped_ptr<QuicConnectionHelperInterface> helper_;

  DISALLOW_COPY_AND_ASSIGN(MockConnection);
};

class PacketSavingConnection : public MockConnection {
 public:
  explicit PacketSavingConnection(bool is_server);

  PacketSavingConnection(bool is_server,
                         const QuicVersionVector& supported_versions);

  virtual ~PacketSavingConnection();

  virtual bool SendOrQueuePacket(EncryptionLevel level,
                                 const SerializedPacket& packet,
                                 TransmissionType transmission_type) OVERRIDE;

  std::vector<QuicPacket*> packets_;
  std::vector<QuicEncryptedPacket*> encrypted_packets_;

 private:
  DISALLOW_COPY_AND_ASSIGN(PacketSavingConnection);
};

class MockSession : public QuicSession {
 public:
  explicit MockSession(QuicConnection* connection);
  virtual ~MockSession();
  MOCK_METHOD2(OnConnectionClosed, void(QuicErrorCode error, bool from_peer));
  MOCK_METHOD1(CreateIncomingDataStream, QuicDataStream*(QuicStreamId id));
  MOCK_METHOD0(GetCryptoStream, QuicCryptoStream*());
  MOCK_METHOD0(CreateOutgoingDataStream, QuicDataStream*());
  MOCK_METHOD6(WritevData,
               QuicConsumedData(QuicStreamId id,
                                const struct iovec* iov,
                                int count,
                                QuicStreamOffset offset,
                                bool fin,
                                QuicAckNotifier::DelegateInterface*));
  MOCK_METHOD2(OnStreamHeaders, void(QuicStreamId stream_id,
                                     base::StringPiece headers_data));
  MOCK_METHOD2(OnStreamHeadersPriority, void(QuicStreamId stream_id,
                                             QuicPriority priority));
  MOCK_METHOD3(OnStreamHeadersComplete, void(QuicStreamId stream_id,
                                             bool fin,
                                             size_t frame_len));
  MOCK_METHOD3(SendRstStream, void(QuicStreamId stream_id,
                                   QuicRstStreamErrorCode error,
                                   QuicStreamOffset bytes_written));
  MOCK_METHOD0(IsCryptoHandshakeConfirmed, bool());

  using QuicSession::ActivateStream;

 private:
  DISALLOW_COPY_AND_ASSIGN(MockSession);
};

class TestSession : public QuicSession {
 public:
  TestSession(QuicConnection* connection, const QuicConfig& config);
  virtual ~TestSession();

  MOCK_METHOD1(CreateIncomingDataStream, QuicDataStream*(QuicStreamId id));
  MOCK_METHOD0(CreateOutgoingDataStream, QuicDataStream*());

  void SetCryptoStream(QuicCryptoStream* stream);

  virtual QuicCryptoStream* GetCryptoStream();

 private:
  QuicCryptoStream* crypto_stream_;
  DISALLOW_COPY_AND_ASSIGN(TestSession);
};

class MockPacketWriter : public QuicPacketWriter {
 public:
  MockPacketWriter();
  virtual ~MockPacketWriter();

  MOCK_METHOD4(WritePacket,
               WriteResult(const char* buffer,
                           size_t buf_len,
                           const IPAddressNumber& self_address,
                           const IPEndPoint& peer_address));
  MOCK_CONST_METHOD0(IsWriteBlockedDataBuffered, bool());
  MOCK_CONST_METHOD0(IsWriteBlocked, bool());
  MOCK_METHOD0(SetWritable, void());
};

class MockSendAlgorithm : public SendAlgorithmInterface {
 public:
  MockSendAlgorithm();
  virtual ~MockSendAlgorithm();

  MOCK_METHOD2(SetFromConfig, void(const QuicConfig& config, bool is_server));
  MOCK_METHOD1(SetMaxPacketSize, void(QuicByteCount max_packet_size));
  MOCK_METHOD2(OnIncomingQuicCongestionFeedbackFrame,
               void(const QuicCongestionFeedbackFrame&,
                    QuicTime feedback_receive_time));
  MOCK_METHOD2(OnPacketAcked,
               void(QuicPacketSequenceNumber, QuicByteCount));
  MOCK_METHOD2(OnPacketLost, void(QuicPacketSequenceNumber, QuicTime));
  MOCK_METHOD5(OnPacketSent,
               bool(QuicTime sent_time, QuicPacketSequenceNumber, QuicByteCount,
                    TransmissionType, HasRetransmittableData));
  MOCK_METHOD1(OnRetransmissionTimeout, void(bool));
  MOCK_METHOD2(OnPacketAbandoned, void(QuicPacketSequenceNumber sequence_number,
                                      QuicByteCount abandoned_bytes));
  MOCK_METHOD4(TimeUntilSend, QuicTime::Delta(QuicTime now, TransmissionType,
                                              HasRetransmittableData,
                                              IsHandshake));
  MOCK_CONST_METHOD0(BandwidthEstimate, QuicBandwidth(void));
  MOCK_METHOD1(UpdateRtt, void(QuicTime::Delta rtt_sample));
  MOCK_CONST_METHOD0(SmoothedRtt, QuicTime::Delta(void));
  MOCK_CONST_METHOD0(RetransmissionDelay, QuicTime::Delta(void));
  MOCK_CONST_METHOD0(GetCongestionWindow, QuicByteCount());

 private:
  DISALLOW_COPY_AND_ASSIGN(MockSendAlgorithm);
};

class TestEntropyCalculator :
      public QuicReceivedEntropyHashCalculatorInterface {
 public:
  TestEntropyCalculator();
  virtual ~TestEntropyCalculator();

  virtual QuicPacketEntropyHash EntropyHash(
      QuicPacketSequenceNumber sequence_number) const OVERRIDE;
};

class MockEntropyCalculator : public TestEntropyCalculator {
 public:
  MockEntropyCalculator();
  virtual ~MockEntropyCalculator();

  MOCK_CONST_METHOD1(
      EntropyHash,
      QuicPacketEntropyHash(QuicPacketSequenceNumber sequence_number));
};

class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor {
 public:
  virtual ~TestDecompressorVisitor() {}
  virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE;
  virtual void OnDecompressionError() OVERRIDE;

  string data() { return data_; }
  bool error() { return error_; }

 private:
  string data_;
  bool error_;
};

class MockAckNotifierDelegate : public QuicAckNotifier::DelegateInterface {
 public:
  MockAckNotifierDelegate();

  MOCK_METHOD0(OnAckNotification, void());

 protected:
  // Object is ref counted.
  virtual ~MockAckNotifierDelegate();
};

}  // namespace test
}  // namespace net

#endif  // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_


text:
extern crate bindgen;
#[cfg(feature = "logging")]
extern crate env_logger;
#[macro_use]
#[cfg(feature = "logging")]
extern crate log;
extern crate clap;

use bindgen::clang_version;
use std::env;
use std::panic;

#[macro_use]
#[cfg(not(feature = "logging"))]
mod log_stubs;

mod options;
use options::builder_from_flags;

pub fn main() {
    #[cfg(feature = "logging")]
    env_logger::init();

    let bind_args: Vec<_> = env::args().collect();

    let version = clang_version();
    let expected_version = if cfg!(feature = "testing_only_libclang_9") {
        Some((9, 0))
    } else if cfg!(feature = "testing_only_libclang_5") {
        Some((5, 0))
    } else if cfg!(feature = "testing_only_libclang_4") {
        Some((4, 0))
    } else if cfg!(feature = "testing_only_libclang_3_9") {
        Some((3, 9))
    } else if cfg!(feature = "testing_only_libclang_3_8") {
        Some((3, 8))
    } else {
        None
    };

    info!(
        "Clang Version: {}, parsed: {:?}",
        version.full, version.parsed
    );

    if expected_version.is_some() {
        assert_eq!(version.parsed, version.parsed);
    }

    match builder_from_flags(bind_args.into_iter()) {
        Ok((builder, output, verbose)) => {
            let builder_result = panic::catch_unwind(|| {
                builder.generate().expect("Unable to generate bindings")
            });

            if builder_result.is_err() {
                if verbose {
                    print_verbose_err();
                }
                std::process::exit(1);
            }

            let bindings = builder_result.unwrap();
            bindings.write(output).expect("Unable to write output");
        }
        Err(error) => {
            println!("{}", error);
            std::process::exit(1);
        }
    };
}

fn print_verbose_err() {
    println!("Bindgen unexpectedly panicked");
    println!(
        "This may be caused by one of the known-unsupported \
         things (https://rust-lang.github.io/rust-bindgen/cpp.html), \
         please modify the bindgen flags to work around it as \
         described in https://rust-lang.github.io/rust-bindgen/cpp.html"
    );
    println!(
        "Otherwise, please file an issue at \
         https://github.com/rust-lang/rust-bindgen/issues/new"
    );
}


text:
// Copyright (C) 2008 The Android Open Source Project
//
// 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 com.google.gerrit.server.git;

import com.google.common.base.Function;
import com.google.common.collect.Ordering;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.server.notedb.ChangeNotes;
import com.google.gerrit.server.project.ChangeControl;

import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;

import java.util.List;

/** Extended commit entity with code review specific metadata. */
public class CodeReviewCommit extends RevCommit {
  /**
   * Default ordering when merging multiple topologically-equivalent commits.
   *

   * Operates only on these commits and does not take ancestry into account.
   *

   * Use this in preference to the default order, which comes from {@link
   * AnyObjectId} and only orders on SHA-1.
   */
  public static final Ordering<CodeReviewCommit> ORDER = Ordering.natural()
      .onResultOf(new Function<CodeReviewCommit, Integer>() {
        @Override
        public Integer apply(CodeReviewCommit in) {
          return in.getPatchsetId() != null
              ? in.getPatchsetId().getParentKey().get()
              : null;
        }
      }).nullsFirst();

  public static RevWalk newRevWalk(Repository repo) {
    return new CodeReviewRevWalk(repo);
  }

  public static RevWalk newRevWalk(ObjectReader reader) {
    return new CodeReviewRevWalk(reader);
  }

  static CodeReviewCommit revisionGone(ChangeControl ctl) {
    return error(ctl, CommitMergeStatus.REVISION_GONE);
  }

  static CodeReviewCommit noPatchSet(ChangeControl ctl) {
    return error(ctl, CommitMergeStatus.NO_PATCH_SET);
  }

  /**
   * Create an error commit.
   *

   * Should only be used for error statuses such that there is no possible
   * non-zero commit on which we could call {@link
   * #setStatusCode(CommitMergeStatus)}, enumerated in the methods above.
   *
   * @param ctl control for change that caused this error
   * @param s status
   * @return new commit instance
   */
  private static CodeReviewCommit error(ChangeControl ctl,
      CommitMergeStatus s) {
    CodeReviewCommit r = new CodeReviewCommit(ObjectId.zeroId());
    r.setControl(ctl);
    r.statusCode = s;
    return r;
  }

  private static class CodeReviewRevWalk extends RevWalk {
    private CodeReviewRevWalk(Repository repo) {
      super(repo);
    }

    private CodeReviewRevWalk(ObjectReader reader) {
      super(reader);
    }

    @Override
    protected RevCommit createCommit(AnyObjectId id) {
      return new CodeReviewCommit(id);
    }
  }

  /**
   * Unique key of the PatchSet entity from the code review system.
   *

   * This value is only available on commits that have a PatchSet represented in
   * the code review system.
   */
  private PatchSet.Id patchsetId;

  /** Change control for the change owner. */
  private ChangeControl control;

  /**
   * The result status for this commit.
   *

   * Only valid if {@link #patchsetId} is not null.
   */
  private CommitMergeStatus statusCode;

  /** Commits which are missing ancestors of this commit. */
  List<CodeReviewCommit> missing;

  public CodeReviewCommit(final AnyObjectId id) {
    super(id);
  }

  public ChangeNotes notes() {
    return getControl().getNotes();
  }

  public CommitMergeStatus getStatusCode() {
    return statusCode;
  }

  public void setStatusCode(CommitMergeStatus statusCode) {
    this.statusCode = statusCode;
  }

  public PatchSet.Id getPatchsetId() {
    return patchsetId;
  }

  public void setPatchsetId(PatchSet.Id patchsetId) {
    this.patchsetId = patchsetId;
  }

  public void copyFrom(final CodeReviewCommit src) {
    control = src.control;
    patchsetId = src.patchsetId;
    statusCode = src.statusCode;
    missing = src.missing;
  }

  public Change change() {
    return getControl().getChange();
  }

  public ChangeControl getControl() {
    return control;
  }

  public void setControl(ChangeControl control) {
    this.control = control;
  }
}


text:
<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>
	<artifactId>pinball-game-physics</artifactId>
	<name>comet - pinball - game - physics</name>
	<packaging>jar</packaging>

	<parent>
		<groupId>ch.m02.comet</groupId>
		<artifactId>pinball-game</artifactId>
		<version>1.1.0-SNAPSHOT</version>
	</parent>

	<dependencies>
		<dependency>
			<groupId>ch.m02.comet</groupId>
			<artifactId>pinball-game-core</artifactId>
			<version>${project.version}</version>
		</dependency>

		<dependency>
			<groupId>com.badlogic</groupId>
			<artifactId>gdx</artifactId>
			<version>${gdx.version}</version>
		</dependency>

		<!-- Test -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>


text:
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os

from ansible.errors import AnsibleParserError, AnsibleError
from ansible.module_utils._text import to_native
from ansible.module_utils.six import string_types
from ansible.playbook.attribute import FieldAttribute
from ansible.playbook.base import Base
from ansible.playbook.collectionsearch import CollectionSearch
from ansible.playbook.helpers import load_list_of_roles
from ansible.playbook.role.requirement import RoleRequirement

__all__ = ['RoleMetadata']

class RoleMetadata(Base, CollectionSearch):
    '''
    This class wraps the parsing and validation of the optional metadata
    within each Role (meta/main.yml).
    '''

    _allow_duplicates = FieldAttribute(isa='bool', default=False)
    _dependencies = FieldAttribute(isa='list', default=list)
    _galaxy_info = FieldAttribute(isa='GalaxyInfo')

    def __init__(self, owner=None):
        self._owner = owner
        super(RoleMetadata, self).__init__()

    @staticmethod
    def load(data, owner, variable_manager=None, loader=None):
        '''
        Returns a new RoleMetadata object based on the datastructure passed in.
        '''

        if not isinstance(data, dict):
            raise AnsibleParserError("the 'meta/main.yml' for role %s is not a dictionary" % owner.get_name())

        m = RoleMetadata(owner=owner).load_data(data, variable_manager=variable_manager, loader=loader)
        return m

    def _load_dependencies(self, attr, ds):
        '''
        This is a helper loading function for the dependencies list,
        which returns a list of RoleInclude objects
        '''

        roles = []
        if ds:
            if not isinstance(ds, list):
                raise AnsibleParserError("Expected role dependencies to be a list.", obj=self._ds)

            for role_def in ds:
                if isinstance(role_def, string_types) or 'role' in role_def or 'name' in role_def:
                    roles.append(role_def)
                    continue
                try:
                    # role_def is new style: { src: 'galaxy.role,version,name', other_vars: "here" }
                    def_parsed = RoleRequirement.role_yaml_parse(role_def)
                    if def_parsed.get('name'):
                        role_def['name'] = def_parsed['name']
                    roles.append(role_def)
                except AnsibleError as exc:
                    raise AnsibleParserError(to_native(exc), obj=role_def, orig_exc=exc)

        current_role_path = None
        if self._owner:
            current_role_path = os.path.dirname(self._owner._role_path)

        try:
            return load_list_of_roles(roles, play=self._owner._play, current_role_path=current_role_path, variable_manager=self._variable_manager,
                                      loader=self._loader)
        except AssertionError as e:
            raise AnsibleParserError("A malformed list of role dependencies was encountered.", obj=self._ds, orig_exc=e)

    def _load_galaxy_info(self, attr, ds):
        '''
        This is a helper loading function for the galaxy info entry
        in the metadata, which returns a GalaxyInfo object rather than
        a simple dictionary.
        '''

        return ds

    def serialize(self):
        return dict(
            allow_duplicates=self._allow_duplicates,
            dependencies=self._dependencies
        )

    def deserialize(self, data):
        setattr(self, 'allow_duplicates', data.get('allow_duplicates', False))
        setattr(self, 'dependencies', data.get('dependencies', []))


text:
from dataclasses import dataclass

import numpy as np
import pandas as pd
from sklearn.decomposition import PCA

from obp.dataset import OpenBanditDataset

@dataclass
class OBDWithInteractionFeatures(OpenBanditDataset):
    context_set: str = "1"

    def pre_process(self) -> None:

        if self.context_set == "1":
            super().pre_process()
        elif self.context_set == "2":
            self._pre_process_context_set_2()

    def _pre_process_context_set_1(self) -> None:
        """Create Context Set 1 (c.f., Section 5.2)"""

        user_cols = self.data.columns.str.contains("user_feature")
        self.context = pd.get_dummies(
            self.data.loc[:, user_cols], drop_first=True
        ).values

    def _pre_process_context_set_2(self) -> None:
        """Create Context Set 2 (c.f., Section 5.2)"""

        super().pre_process()
        affinity_cols = self.data.columns.str.contains("affinity")
        Xaffinity = self.data.loc[:, affinity_cols].values
        self.context = PCA(n_components=30).fit_transform(
            np.c_[self.context, Xaffinity]
        )


text:
using System;
using System.IO;

namespace NClang.Tests
{
	public static class ClangTestHelpers
	{
		public static void WithTranslationUnit (Action<ClangIndex,ClangTranslationUnit> test, string testFullName, string content = null)
		{
			string filename = testFullName;
			content = content ?? @"
#include <stdio.h>

void main () {
	printf (""hello world"");
}
";
			File.WriteAllText (filename, content);
			var idx = ClangService.CreateIndex ();
			var tu = idx.CreateTranslationUnitFromSourceFile (filename, new string [0], new ClangUnsavedFile [0]);
			try {
				test (idx, tu);
			} finally {
				File.Delete (filename);
				tu.Dispose ();
				idx.Dispose ();
			}
		}
	}
}


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>CMAKE_VS_MSBUILD_COMMAND — CMake 3.7.2 Documentation</title>

    <link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
    <link rel="top" title="CMake 3.7.2 Documentation" href="../index.html" />
    <link rel="up" title="cmake-variables(7)" href="../manual/cmake-variables.7.html" />
    <link rel="next" title="CMAKE_VS_NsightTegra_VERSION" href="CMAKE_VS_NsightTegra_VERSION.html" />
    <link rel="prev" title="CMAKE_VS_INTEL_Fortran_PROJECT_VERSION" href="CMAKE_VS_INTEL_Fortran_PROJECT_VERSION.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.7.2 Documentation »

cmake-variables(7) »

CMAKE_VS_MSBUILD_COMMAND¶

The generators for Visual Studio 10 2010 and above set this
variable to the MSBuild.exe command installed with the corresponding
Visual Studio version.

This variable is not defined by other generators even if MSBuild.exe
is installed on the computer.

The CMAKE_VS_DEVENV_COMMAND is also provided for the
non-Express editions of Visual Studio.
See also the CMAKE_MAKE_PROGRAM variable.

Previous topic

CMAKE_VS_INTEL_Fortran_PROJECT_VERSION

Next topic

CMAKE_VS_NsightTegra_VERSION

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          next |

          previous |

    CMake »

    3.7.2 Documentation »

cmake-variables(7) »

        © Copyright 2000-2016 Kitware, Inc. and Contributors.
      Created using Sphinx 1.4a0+.


text:
using System.Data.SqlClient;
using System.Linq;
using System.Windows;
using JetBrains.Annotations;
using SIM.Instances;
using SIM.Tool.Base;
using Sitecore.Diagnostics.Base;

namespace SIM.Tool.Windows.MainWindowComponents.Buttons
{
  public class CopyMarketingDefinitionTablesButton : InstanceOnlyButton
  {
    [UsedImplicitly]
    public CopyMarketingDefinitionTablesButton()
    {
    }

    #region Public methods

    public override void OnClick(Window mainWindow, Instance instance)
    {
      WindowHelper.LongRunningTask(() => Process(instance), "Copying definitions", mainWindow);
    }

    #endregion

    #region Private methods

    private static void Process(Instance instance)
    {
      var connectionStrings = instance.Configuration.ConnectionStrings;

      var primary = connectionStrings.FirstOrDefault(x => x.Name == "reporting");
      Assert.IsNotNull(primary, nameof(primary));

      var secondary = connectionStrings.FirstOrDefault(x => x.Name == "reporting.secondary");
      Assert.IsNotNull(secondary, nameof(secondary));

      var tablesNames = new[] {"CampaignActivityDefinitions", "GoalDefinitions", "OutcomeDefinitions", "MarketingAssetDefinitions", "Taxonomy_TaxonEntity", "Taxonomy_TaxonEntityFieldDefinition", "Taxonomy_TaxonEntityFieldValue"};

      using (var connection = new SqlConnection(primary.Value))
      {
        connection.Open();

        using (var connection2 = new SqlConnection(secondary.Value))
        {
          connection2.Open();
          foreach (var tableName in tablesNames)
          {
            using (var command = new SqlCommand("DELETE FROM [" + tableName + "]", connection2))
            {
              command.ExecuteNonQuery();
            }
          }
        }

        using (var command = connection.CreateCommand())
        {
          using (var copy = new SqlBulkCopy(secondary.Value))
          {
            foreach (var tableName in tablesNames)
            {
              copy.DestinationTableName = tableName;
              command.CommandText = "SELECT * FROM [" + tableName + "]";

              using (SqlDataReader reader = command.ExecuteReader())
              {
                copy.WriteToServer(reader);
              }
            }
          }
        }
      }
    }

    #endregion
  }
}


text:
title: PapljIfExpr - aesi-intellij
---

[aesi-intellij](../../index.html) / [org.metaborg.paplj.psi](../index.html) / [PapljIfExpr](.)

# PapljIfExpr

`interface PapljIfExpr : `[`PapljExpr`](../-paplj-expr/index.html)

### Functions

| [getBraceL](get-brace-l.html) | `abstract fun getBraceL(): PsiElement` |
| [getBraceR](get-brace-r.html) | `abstract fun getBraceR(): PsiElement` |
| [getExprList](get-expr-list.html) | `abstract fun getExprList(): `[`MutableList`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)`<`[`PapljExpr`](../-paplj-expr/index.html)`>` |
| [getKElse](get-k-else.html) | `abstract fun getKElse(): PsiElement` |
| [getKIf](get-k-if.html) | `abstract fun getKIf(): PsiElement` |

### Inherited Functions

| [getExpr](../-paplj-expr/get-expr.html) | `abstract fun getExpr(): `[`PapljExpr`](../-paplj-expr/index.html)`?` |

### Inheritors

| [PapljIfExprImpl](../../org.metaborg.paplj.psi.impl/-paplj-if-expr-impl/index.html) | `open class PapljIfExprImpl : `[`PapljExprImpl`](../../org.metaborg.paplj.psi.impl/-paplj-expr-impl/index.html)`, PapljIfExpr` |


text:
#pragma once

// CPrefSheet

class CPrefSheet : public CPropertySheet
{
	DECLARE_DYNAMIC(CPrefSheet)

public:
	CPrefSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	CPrefSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	virtual ~CPrefSheet();

protected:
	DECLARE_MESSAGE_MAP()
public:
	virtual INT_PTR DoModal();
};


text:
The program for learning foreign words.

## Screenshots

## Install

* **Note: requires a node version >= 7 and an npm version >= 4.**
* **If you have installation or compilation issues with this project, please see [our debugging guide](https://github.com/chentsulin/electron-react-boilerplate/issues/400)**

First, clone the repo via git:

```bash
git clone https://github.com/denq/electron-react-lex.git
```

And then install dependencies with yarn.

```bash
$ cd electron-react-lex
$ yarn
```
**Note**: If you can't use [yarn](https://github.com/yarnpkg/yarn) for some reason, try `npm install`.

## Run

Start the app in the `dev` environment. This starts the renderer process in [**hot-module-replacement**](https://webpack.js.org/guides/hmr-react/) mode and starts a server that sends hot updates to the renderer process:

```bash
$ npm run dev
```

Run these two commands __simultaneously__ in different console tabs:

```bash
$ npm run start-renderer-dev
$ npm run start-main-dev
```

## Packaging

To package apps for the local platform:

```bash
$ npm run package
```
For win:
```
$ npm run package -- --win
```

To package apps for all platforms:

First, refer to [Multi Platform Build](https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build) for dependencies.

Then,
```bash
$ npm run package-all
```

To package apps with options:

```bash
$ npm run package -- --[option]
```


text:
package io.reactivex.rxjava3.core;

import io.reactivex.rxjava3.annotations.NonNull;

/**
 * Convenience interface and callback used by the {@link Observable#to} operator to turn an {@link Observable} into another
 * value fluently.
 * <p>History: 2.1.7 - experimental
 * @param <T> the upstream type
 * @param <R> the output type
 * @since 2.2
 */
@FunctionalInterface
public interface ObservableConverter<@NonNull T, @NonNull R> {
    /**
     * Applies a function to the upstream {@link Observable} and returns a converted value of type {@code R}.
     *
     * @param upstream the upstream {@code Observable} instance
     * @return the converted value
     */
    R apply(@NonNull Observable<T> upstream);
}


text:
//---------------------------------------------------------------------------//
//!
//! \file   MonteCarlo_ParticleEventDispatcher_def.hpp
//! \author Alex Robinson
//! \brief  Particle event dispatcher base class definition.
//!
//---------------------------------------------------------------------------//

#ifndef FACEMC_PARTICLE_EVENT_DISPATCHER_DEF_HPP
#define FACEMC_PARTICLE_EVENT_DISPATCHER_DEF_HPP

// FRENSIE Includes
#include "Utility_ContractException.hpp"

namespace MonteCarlo{

// Constructor
template<typename EntityHandle, typename Observer>
ParticleEventDispatcher<EntityHandle,Observer>::ParticleEventDispatcher(
						 const EntityHandle entity_id )
  : d_entity_id( entity_id )
{ /* ... */ }

// Attach an observer to the dispatcher
template<typename EntityHandle, typename Observer>
void ParticleEventDispatcher<EntityHandle,Observer>::attachObserver(
				const ModuleTraits::InternalEstimatorHandle id,
				Teuchos::RCP<Observer>& observer )
{
  // Make sure the observer has not been attached yet
  testPrecondition( d_observer_map.find( id ) == d_observer_map.end() );

  if( d_observer_map.find( id ) == d_observer_map.end() )
    d_observer_map[id] = observer;
}

// Detach an observer from the dispatcher
template<typename EntityHandle, typename Observer>
void ParticleEventDispatcher<EntityHandle,Observer>::detachObserver(
			       const ModuleTraits::InternalEstimatorHandle id )
{
  d_observer_map.erase( id );
}

// Get the entity id corresponding to this particle event dispatcher
template<typename EntityHandle, typename Observer>
inline EntityHandle
ParticleEventDispatcher<EntityHandle,Observer>::getId() const
{
  return d_entity_id;
}

// Get the number of attached observers
template<typename EntityHandle, typename Observer>
unsigned
ParticleEventDispatcher<EntityHandle,Observer>::getNumberOfObservers() const
{
  return d_observer_map.size();
}

// Get the observer map
template<typename EntityHandle, typename Observer>
inline typename ParticleEventDispatcher<EntityHandle,Observer>::ObserverIdMap&
ParticleEventDispatcher<EntityHandle,Observer>::observer_id_map()
{
  return d_observer_map;
}

} // end MonteCarlo namespace

#endif // end FACEMC_PARTICLE_EVENT_DISPATCHER_DEF_HPP

//---------------------------------------------------------------------------//
// end MonteCarlo_ParticleEventDispatcher_def.hpp
//---------------------------------------------------------------------------//


text:
$('.user_lists.new').ready(function(){
	console.log("user_lists new");

	// Tracks user input field.
	var countInputField = 1;

	//Gets user input field for restaurant
	var restaurantArray = [];

	var wrapper = $('.input-wrapper-field');

	// Add new restaurant form.
	$('#addInputButton').on('click', function(e) {
		e.preventDefault();

		if (countInputField < MAXINPUTFIELD) {
			wrapper.append('
'+
												'
' +
													'
' +
														'<input id="restaurantInput'+ countInputField+1 +'" name="restaurants[]" placeholder="Restaurant" type="text" class="restaurant validate">' +
													'
' +
													'
' +
														''+
															'' +
														'' +
													'
' +
												'
' +
											'
');
			countInputField++;
		}
	});

	// Remove functionality
	$('body').on('click', 'a.removeInputButton', function(e) {
		e.preventDefault();
		$(this).parent('div').parent('div').parent('div').remove();
		countInputField--;
	});

	//Submit data to backend server with AJAX request
	$('#submitList').on('click', function(e) {
		// e.preventDefault();

		$.each($(".restaurant"), function(k, v) {
			getRestaurant = $(this).val();
			restaurantArray.push(getRestaurant);
		});

		var getListParams = {
			list: {
				title: $('#title').val(),
				description: $('#description').val()
			}
		};

		submitListener();

		// $.ajax({
		// 	method: 'POST',
		// 	url: 'http://localhost:3000/api/user/lists',
		// 	data: getListParams
		// }).success(function(data) {
		// 	console.log(data);
		// });

		// for (var i = 0; i < countInputField; i++) {
		// 	$.ajax({
		// 		method: "POST",
		// 		beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))},
		// 		url: "http://localhost:3000/api/restaurants",
		// 		data: {
		// 			restaurants: {
		// 				name: $('#restaurantInput1').val()
		// 			}
		// 		}
		// 	}).success(function(data) {
		// 		console.log(data);
		// 	});
		// // }

		// var getRestaurantParams = {
		// 	restaurant: restaurantArray
		// };

		// countInputField = 1;
		// restaurantArray = [];
	});
});

	var submitList = function() {
		var getListParams = {
			list: {
				title: $('#title').val(),
				description: $('#description').val()
			}
		}

		$.ajax({
			url: '/api/user/lists',
			data: getListParams,
			success: function(){
				console.log('sent list')
			},
			error: function(resp) {
				console.log(resp)
			}
		});
	}

	var submitRestaurants = function() {
		var getRestParams = {
			restaurants: {
			name: $('#restaurantInput1').val()
		}
	}

	$.ajax({
		url: '/api/restaurants',
		data: getRestParams,
		success: function(){
			console.log('restaurants sent')
		},

		error: function(resp) {
			console.log(resp)
		}
	});
}

  var submitListener = function() {
    $('#submitList').on('click', function(e){
      submitList();
      submitRestaurants();
    })
  }


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
GPSCallback
</TITLE>

<META NAME="date" CONTENT="2013-02-15">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

fi.vtt.routinelibrary.datasources

Interface GPSCallback

public interface GPSCallback

GPS callback interface, implemented by InternalRoutine.

See Also:
InternalRoutine

Method Summary

 void
failedToGetLocation(java.lang.String reasonStringIncoming)

          Called by GPS when the timer times out and no GPS was available.

 void
newLocation(double latitudeDoubleIncoming,
            double longitudeDoubleIncoming)

          Called by GPS when a GPS is available.

Method Detail

failedToGetLocation

void failedToGetLocation(java.lang.String reasonStringIncoming)

Called by GPS when the timer times out and no GPS was available.

Parameters:
reasonStringIncoming - The reason of failure.

newLocation

void newLocation(double latitudeDoubleIncoming,
                 double longitudeDoubleIncoming)

Called by GPS when a GPS is available.

Parameters:
latitudeDoubleIncoming - The latitude.
longitudeDoubleIncoming - The longitude.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
@implementation BMValueTransformer {
}

@synthesize converterTarget = _converterTarget, converterSelector = _converterSelector, inverseConverterTarget = _inverseConverterTarget, inverseConverterSelector = _inverseConverterSelector;

+ (Class)transformedValueClass {
	return [NSObject class];
}

+ (BOOL)allowsReverseTransformation {
	return YES;
}

- (id)initWithConverterTarget:(id)theConverterTarget converterSelector:(SEL)theConverterSelector
				inverseTarget:(id)theInverseTarget inverseSelector:(SEL)theInverseSelector {

	if ((self = [super init])) {
		_converterTarget = theConverterTarget;
		_converterSelector = theConverterSelector;
		_inverseConverterTarget = theInverseTarget;
		_inverseConverterSelector = theInverseSelector;
	}
	return self;
}

- (id)transformedValue:(id)value {
	id transformedValue = value;
	if (self.converterSelector != nil) {
		id ct = self.converterTarget;
		if (!ct) ct = value;
		BM_IGNORE_SELECTOR_LEAK_WARNING(
		transformedValue = [ct performSelector:self.converterSelector withObject:value];
		)
	}
	return transformedValue;
}

- (id)reverseTransformedValue:(id)value {
	id transformedValue = value;
	if (self.inverseConverterSelector != nil) {
		id ct = self.inverseConverterTarget;
		if (!ct) ct = value;
		BM_IGNORE_SELECTOR_LEAK_WARNING(
		transformedValue = [ct performSelector:self.inverseConverterSelector withObject:value];
		)
	}
	return transformedValue;
}

@end


text:
class DateTime
  def to_unixtime
    self.to_i
  end
end

class Time
  def to_unixtime
    self.to_i
  end
end

class ActiveSupport::TimeWithZone
  def to_unixtime
    self.to_i
  end
end

class NilClass
  def to_unixtime
    nil
  end
end


text:
package com.hundsun.jresplus.web.contain.async;

import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.StringEscapeUtils;
import org.apache.velocity.context.InternalContextAdapter;
import org.apache.velocity.exception.MethodInvocationException;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.apache.velocity.runtime.Renderable;

import com.alibaba.fastjson.JSON;
import com.hundsun.jresplus.common.util.ArrayUtil;
import com.hundsun.jresplus.web.contain.ResponseStringWriterWrapper;
import com.hundsun.jresplus.web.velocity.eventhandler.DirectOutput;

/**
 *
 * @author LeoHu copy by sagahl copy by eyeieye
 *
 */
public class AsynchronContainTask implements DirectOutput, Renderable {
	public static final String AsynchronContainTaskName = "asyncContainContext";
	private String divId;
	private ResponseStringWriterWrapper responseStringWriter;

	private Set<String> js;
	private StringBuilder jsCode = new StringBuilder();
	private Set<String> css;
	private boolean hasCss = false;

	public boolean hasCss() {
		return this.hasCss;
	}

	public AsynchronContainTask(String divId,
			ResponseStringWriterWrapper responseStringWriter) {
		super();
		this.divId = divId;
		this.responseStringWriter = responseStringWriter;
	}

	public String getDivPlaceholder() {
		return "

";
	}

	public void writeTo(Writer writer) throws IOException {
		String result = responseStringWriter.getStringWriter().toString();
		writer.write("{\"html\":\"");
		StringEscapeUtils.escapeJavaScript(writer, result);
		writer.write("\",\"id\":\"");
		writer.write(this.getDivId());
		writer.write("\",\"css\":");
		if (ArrayUtil.isEmpty(css)) {
			writer.write("[]");
		} else {
			writer.write(JSON.toJSONString(css));
		}
		writer.write(",\"js\":");
		if (ArrayUtil.isEmpty(js)) {
			writer.write("[]");
		} else {
			writer.write(JSON.toJSONString(js));
		}
		writer.write(",\"jsCode\":\"");
		if (this.jsCode.length() < 1) {
			writer.write("");
		} else {
			writer.write(this.jsCode.toString());
		}
		writer.write("\"}");
	}

	public void addJsCode(String jsCode) throws IOException {
		StringWriter sw = new StringWriter();
		StringEscapeUtils.escapeJavaScript(sw, jsCode);
		this.jsCode.append(sw);
	}

	public AsynchronContainTask addJs(String js) {
		if (this.js == null) {
			this.js = new HashSet<String>();
		}
		this.js.add(js);
		return this;
	}

	public AsynchronContainTask addCss(String css) {
		if (this.css == null) {
			this.css = new HashSet<String>();
		}
		this.css.add(css);
		this.hasCss = true;
		return this;
	}

	public boolean render(InternalContextAdapter arg0, Writer writer)
			throws IOException, MethodInvocationException, ParseErrorException,
			ResourceNotFoundException {
		writer.write("");
		return true;
	}

	public Set<String> getJs() {
		return js;
	}

	public Set<String> getCss() {
		return css;
	}

	public String getDivId() {
		return divId;
	}

	public void setDivId(String divId) {
		this.divId = divId;
	}

	public ResponseStringWriterWrapper getResponseStringWriter() {
		return responseStringWriter;
	}

	public void setResponseStringWriter(
			ResponseStringWriterWrapper responseStringWriter) {
		this.responseStringWriter = responseStringWriter;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                xmlns:tools="http://schemas.android.com/tools"
                android:id="@+id/parent_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fitsSystemWindows="true"
                tools:context=".MainActivity">

    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        tools:context=".MainActivity">

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <View
                android:layout_width="match_parent"
                android:layout_height="64dp"
                android:background="@color/light_gray"
                app:layout_scrollFlags="scroll|enterAlways"/>

        </android.support.design.widget.AppBarLayout>

        <android.support.v4.widget.NestedScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipToPadding="false"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

            <TextView
                android:clipToPadding="false"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/random_text"
                android:textSize="18sp"/>
        </android.support.v4.widget.NestedScrollView>
    </android.support.design.widget.CoordinatorLayout>

    <com.arlib.floatingsearchview.FloatingSearchView
        android:id="@+id/floating_search_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:floatingSearch_close_search_on_keyboard_dismiss="false"
        app:floatingSearch_dimBackground="false"
        app:floatingSearch_dismissOnOutsideTouch="true"
        app:floatingSearch_leftActionMode="showHamburger"
        app:floatingSearch_menu="@menu/menu_search_view"
        app:floatingSearch_searchBarMarginLeft="@dimen/search_view_inset"
        app:floatingSearch_searchBarMarginRight="@dimen/search_view_inset"
        app:floatingSearch_searchBarMarginTop="@dimen/search_view_inset"
        app:floatingSearch_searchHint="Search..."
        app:floatingSearch_showSearchKey="true"
        app:floatingSearch_suggestionsListAnimDuration="250"/>
</RelativeLayout>


text:
package toothpick.configuration;

import toothpick.Scope;

/**
 * Checks that TP scope forest is actually a tree. If a new created scope is a new root outside of
 * the first created tree, it will throw a {@link MultipleRootException}.
 */
class MultipleRootScopeCheckOnConfiguration implements MultipleRootScopeCheckConfiguration {
  private Scope rootScope;

  @Override
  public synchronized void checkMultipleRootScopes(Scope newRootScope) {
    if (rootScope == null && newRootScope != null) {
      rootScope = newRootScope;
      return;
    }

    if (newRootScope == rootScope) {
      return;
    }

    throw new MultipleRootException(newRootScope);
  }

  @Override
  public synchronized void onScopeForestReset() {
    rootScope = null;
  }
}


text:
<!doctype html>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<link rel="stylesheet" href="css/nosingle.css"/>
<title>404</title>

Not Found

点击重试


text:
cask :v1 => 'voodoopad' do
  version :latest
  sha256 :no_check

  url 'https://plausible.coop/static/download/VoodooPad.zip'
  homepage 'https://plausible.coop/voodoopad/'
  license :unknown    # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder

  app 'VoodooPad.app'
end


text:
<?php

namespace Magento\Setup\Test\Unit\Module\Di\Code\Scanner;

class DirectoryScannerTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Magento\Setup\Module\Di\Code\Scanner\DirectoryScanner
     */
    protected $_model;

    /**
     * @var string
     */
    protected $_testDir;

    protected function setUp()
    {
        $this->_model = new \Magento\Setup\Module\Di\Code\Scanner\DirectoryScanner();
        $this->_testDir = str_replace('\\', '/', realpath(__DIR__ . '/../../') . '/_files');
    }

    public function testScan()
    {
        $filePatterns = [
            'php' => '/.*\.php$/',
            'etc' => '/\/app\/etc\/.*\.xml$/',
            'config' => '/\/etc\/(config([a-z0-9\.]*)?|adminhtml\/system)\.xml$/',
            'view' => '/\/view\/[a-z0-9A-Z\/\.]*\.xml$/',
            'design' => '/\/app\/design\/[a-z0-9A-Z\/\.]*\.xml$/',
        ];

        $actual = $this->_model->scan($this->_testDir, $filePatterns);
        $expected = [
            'php' => [
                $this->_testDir . '/additional.php',
                $this->_testDir . '/app/bootstrap.php',
                $this->_testDir . '/app/code/Magento/SomeModule/Helper/Test.php',
                $this->_testDir . '/app/code/Magento/SomeModule/Model/Test.php',
            ],
            'config' => [
                $this->_testDir . '/app/code/Magento/SomeModule/etc/adminhtml/system.xml',
                $this->_testDir . '/app/code/Magento/SomeModule/etc/config.xml',
            ],
            'view' => [$this->_testDir . '/app/code/Magento/SomeModule/view/frontend/default.xml'],
            'design' => [$this->_testDir . '/app/design/adminhtml/Magento/backend/layout.xml'],
            'etc' => [$this->_testDir . '/app/etc/additional.xml', $this->_testDir . '/app/etc/config.xml'],
        ];
        $this->assertEquals(sort($expected['php']), sort($actual['php']), 'Incorrect php files list');
        $this->assertEquals(sort($expected['config']), sort($actual['config']), 'Incorrect config files list');
        $this->assertEquals(sort($expected['view']), sort($actual['view']), 'Incorrect view files list');
        $this->assertEquals(sort($expected['design']), sort($actual['design']), 'Incorrect design files list');
        $this->assertEquals(sort($expected['etc']), sort($actual['etc']), 'Incorrect etc files list');
    }
}


text:
<?php

namespace Axis\S1\Twig\Extension\Helpers;

/**
 * Text helpers.
 *
 * @package    AxisTwigPlugin
 */
class TextHelper extends \Twig_Extension
{
  public function getFunctions()
  {
    return array(
      'truncate_text'      => new \Twig_Function_Function('truncate_text'),
      'highlight_text'     => new \Twig_Function_Function('highlight_text'),
      'excerpt_text'       => new \Twig_Function_Function('excerpt_text'),
      'wrap_text'          => new \Twig_Function_Function('wrap_text'),
      'simple_format_text' => new \Twig_Function_Function('simple_format_text'),
      'auto_link_text'     => new \Twig_Function_Function('auto_link_text'),
      'strip_links_text'   => new \Twig_Function_Function('strip_links_text'),
    );
  }

  public function getName()
  {
    return 'text_helper';
  }
}


text:
*`s`*
=

**Release status: *alpha***

A high-performance, anonymous URL shortener built using Redis + Node.js with a API-backed design.

[Demo](http://s.goel.im)

### Features

- **High performance** - mean response time for `POST` methods is 40ms
- **Anonymous** - No user data is stored, only timestamps of hits on links are stored for analtics
- **Extendible** - The code is very simple and minimal to make it easier to extend it's features as needed.

### Quickstart
    $ brew install redis
    $ npm install
    $ redis-server
    $ node app

### Performance

`s` uses Redis as the primary data store which provides excellent performance even at scale. Below are the benchmark results with 10,000 `POST` requests (10 concurrent connections).

    This is ApacheBench, Version 2.3 <$Revision: 655654 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/

    Benchmarking s.goel.im (be patient)
    Completed 1000 requests
    Completed 2000 requests
    Completed 3000 requests
    Completed 4000 requests
    Completed 5000 requests
    Completed 6000 requests
    Completed 7000 requests
    Completed 8000 requests
    Completed 9000 requests
    Completed 10000 requests
    Finished 10000 requests

    Server Software:        MochiWeb/1.0
    Server Hostname:        s.goel.im
    Server Port:            80

    Document Path:          /new
    Document Length:        409 bytes

    Concurrency Level:      10
    Time taken for tests:   170.267 seconds
    Complete requests:      10000
    Failed requests:        12
     (Connect: 0, Receive: 0, Length: 12, Exceptions: 0)
    Write errors:           0
    Non-2xx responses:      9993
    Total transferred:      6163636 bytes
    Total POSTed:           1810724
    HTML transferred:       4085092 bytes
    Requests per second:    58.73 [#/sec] (mean)
    Time per request:       170.267 [ms] (mean)
    Time per request:       17.027 [ms] (mean, across all concurrent requests)
    Transfer rate:          35.35 [Kbytes/sec] received
                          10.39 kb/s sent
                          45.74 kb/s total

    Connection Times (ms)
                min  mean[+/-sd] median   max
    Connect:       67   71  22.6     68    1070
    Processing:    69  100  48.5     78     746
    Waiting:        0   99  48.5     78     746
    Total:        137  170  56.8    148    1277

    Percentage of the requests served within a certain time (ms)
    50%    148
    66%    164
    75%    179
    80%    191
    90%    223
    95%    262
    98%    331
    99%    394
    100%   1277 (longest request)

### Dependencies

- Node.js (the server)
- Express.js (lightweight framework on top of node)
- Redis (simple key-value data store)
- Angular.js (for client side JS)
- Jade (HTML rendering engine)

### Develop locally

Start the redis server

    $ redis-server

Start the node app

    $ node app

### Deploy on Heroku

    $ heroku create                     // create a heroku app
    $ heroku addons:add redistogo       // add the redistogo addon
    $ foreman start                     // start the foreman server to test locally
    $ git push heroku master            // to the moon

If you have any issues, please find help in the [Heroku Help](https://devcenter.heroku.com/) center first. If that doesn't help, [create an issue](https://github.com/karan/s/issues) and I'll see if there's something I can help with.

### API end points

#### Shorten a URL

`POST /new`

Generates a new short URL for the given long url.

**Parameters**

| Name | Type | Description |
| ---- | ---- | ----------- |
| `long_url` | `string` | **Required.** The URL to be shortened.

**Response**

    {
      "status": "success",
      "short_id": "dLC",
      "short_url": "http://localhost:8000/dLC",
      "long_url": "https://news.ycombinator.com/item?id=7202182"
    }

#### Get the long URL

Redirects to the long URL of the passed short URL, if exists. Also increases the hit counter and pushes the hit timestamp.

`GET /:slug`

### License

MIT

Basically, you can do whatever you want as long as you include the original copyright.


text:
RSpec.describe Karafka::Extensions::StdoutListener do
  subject(:listener) { Karafka::Instrumentation::StdoutListener.new }

  let(:event) { Dry::Events::Event.new(rand.to_s, payload) }
  let(:time) { rand }
  let(:topic) { instance_double(Karafka::Routing::Topic, name: topic_name) }
  let(:topic_name) { rand.to_s }

  describe '#on_backends_sidekiq_process' do
    subject(:trigger) { listener.on_backends_sidekiq_process(event) }

    let(:payload) { { caller: caller, time: time } }
    let(:params_batch) { [1] }
    let(:count) { params_batch.size }
    let(:message) do
      "Scheduling of #{count} messages to Sidekiq on topic #{topic_name} took #{time} ms"
    end
    let(:caller) do
      instance_double(
        Karafka::BaseConsumer,
        params_batch: params_batch,
        topic: topic
      )
    end

    it 'expect logger to log proper message' do
      expect(Karafka.logger).to receive(:info).with(message)
      trigger
    end
  end

  describe '#on_backends_sidekiq_base_worker_perform' do
    subject(:trigger) { listener.on_backends_sidekiq_base_worker_perform(event) }

    let(:time) { rand }
    let(:payload) { { caller: self, time: time, consumer: consumer } }
    let(:params_batch) { [1] }
    let(:count) { params_batch.size }
    let(:message) do
      "Sidekiq processing of topic #{topic_name} with #{count} messages took #{time} ms"
    end
    let(:consumer) do
      instance_double(
        Karafka::BaseConsumer,
        params_batch: params_batch,
        topic: topic
      )
    end

    it 'expect logger to log proper message' do
      expect(Karafka.logger).to receive(:info).with(message)
      trigger
    end
  end
end


text:
package WAD;
import java.util.ArrayList;

public class ServicioComparador{
	private ArrayList palabras;

	//Constructor
	private ServicioComparador(ArrayList p){
		palabras = p;
	}

	//Obteniendo una instancia
	public static ServicioComparador obtInstancia(ArrayList p){
		ServicioComparador sc = new ServicioComparador(p);
		return sc;
	}

	//buscar palabras similares
	public ArrayList buscarPalabras(String prefijo){
		ArrayList similares = new ArrayList();
		String prefijoMayus = prefijo.toUpperCase();

		for(int i = 0; i < palabras.size(); i++){
			String palabra = (String)palabras.get(i);
			String palabraMayus = palabra.toUpperCase();

			if(palabraMayus.startsWith(prefijoMayus))
				similares.add(palabra);
		}
		return similares;
	}
}


text:
[![CI Status](http://img.shields.io/travis/yanghaipeng/YYAppCommonKit.svg?style=flat)](https://travis-ci.org/yanghaipeng/YYAppCommonKit)
[![Version](https://img.shields.io/cocoapods/v/YYAppCommonKit.svg?style=flat)](http://cocoapods.org/pods/YYAppCommonKit)
[![License](https://img.shields.io/cocoapods/l/YYAppCommonKit.svg?style=flat)](http://cocoapods.org/pods/YYAppCommonKit)
[![Platform](https://img.shields.io/cocoapods/p/YYAppCommonKit.svg?style=flat)](http://cocoapods.org/pods/YYAppCommonKit)

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

YYAppCommonKit is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "YYAppCommonKit"
```

## Author

yanghaipeng, yanghaipeng@yy.com

## License

YYAppCommonKit is available under the MIT license. See the LICENSE file for more info.


text:
/*
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
 */

#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

#ifndef __GTK_INVISIBLE_H__
#define __GTK_INVISIBLE_H__

#include <gtk/gtkwidget.h>

G_BEGIN_DECLS

#define GTK_TYPE_INVISIBLE		(gtk_invisible_get_type ())
#define GTK_INVISIBLE(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_INVISIBLE, GtkInvisible))
#define GTK_INVISIBLE_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_INVISIBLE, GtkInvisibleClass))
#define GTK_IS_INVISIBLE(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_INVISIBLE))
#define GTK_IS_INVISIBLE_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_INVISIBLE))
#define GTK_INVISIBLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_INVISIBLE, GtkInvisibleClass))

typedef struct _GtkInvisible              GtkInvisible;
typedef struct _GtkInvisiblePrivate       GtkInvisiblePrivate;
typedef struct _GtkInvisibleClass         GtkInvisibleClass;

struct _GtkInvisible
{
  GtkWidget widget;

  /*< private >*/
  GtkInvisiblePrivate *priv;
};

struct _GtkInvisibleClass
{
  GtkWidgetClass parent_class;

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
};

GType gtk_invisible_get_type (void) G_GNUC_CONST;

GtkWidget* gtk_invisible_new            (void);
GtkWidget* gtk_invisible_new_for_screen (GdkScreen    *screen);
void	   gtk_invisible_set_screen	(GtkInvisible *invisible,
					 GdkScreen    *screen);
GdkScreen* gtk_invisible_get_screen	(GtkInvisible *invisible);

G_END_DECLS

#endif /* __GTK_INVISIBLE_H__ */


text:
@interface TestKVODetailViewController ()

@property (strong, readwrite, nonatomic) NSString *tapcount;
@end

@implementation TestKVODetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    UIButton * button = [UIButton buttonWithType:UIButtonTypeSystem];
    [button setTitle:self.tapcount forState:UIControlStateNormal];
    button.frame = CGRectMake(100, 100, 150, 50);
    button.center = CGPointMake(self.view.bounds.size.width/2, self.view.bounds.size.height/2);
    [button addTarget:self action:@selector(buttonTap:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
}

-(IBAction)buttonTap:(id)sender
{
    UIButton * button = (UIButton *)sender;
    NSString *string = button.titleLabel.text;
    string = [NSString stringWithFormat:@"%d",string.intValue + 1];
    [button setTitle:string forState:UIControlStateNormal];
//    [self setValue:string forKey:@"tapcount"];
    self.tapcount = string;

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
layout: model
title: Visual NER on 10K Filings (SEC)
author: John Snow Labs
name: visualner_10kfilings
date: 2022-09-21
tags: [en, licensed]
task: OCR Object Detection
language: en
edition: Visual NLP 4.0.0
spark_version: 3.2
supported: true
annotator: VisualDocumentNERv21
article_header:
  type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

This model is a Visual NER team aimed to extract the main key points in the summary page of SEC 10 K filings (Annual reports).

## Predicted Entities

`REGISTRANT`, `ADDRESS`, `PHONE`, `DATE`, `EMPLOYERIDNB`, `EXCHANGE`, `STATE`, `STOCKCLASS`, `STOCKVALUE`, `TRADINGSYMBOL`, `FILENUMBER`

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/ocr/visualner_10kfilings_en_4.0.0_3.2_1663769328577.zip){:.button.button-orange.button-orange-trans.arr.button-icon}

## How to use

<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}
```python
binary_to_image = BinaryToImage()\
    .setOutputCol("image") \
    .setImageType(ImageType.TYPE_3BYTE_BGR)

img_to_hocr = ImageToHocr()\
    .setInputCol("image")\
    .setOutputCol("hocr")\
    .setIgnoreResolution(False)\
    .setOcrParams(["preserve_interword_spaces=0"])

tokenizer = HocrTokenizer()\
    .setInputCol("hocr")\
    .setOutputCol("token")

doc_ner = VisualDocumentNerV21()\
    .pretrained("visualner_10kfilings", "en", "clinical/models")\
    .setInputCols(["token", "image"])\
    .setOutputCol("entities")

draw = ImageDrawAnnotations() \
    .setInputCol("image") \
    .setInputChunksCol("entities") \
    .setOutputCol("image_with_annotations") \
    .setFontSize(10) \
    .setLineWidth(4)\
    .setRectColor(Color.red)

# OCR pipeline
pipeline = PipelineModel(stages=[
    binary_to_image,
    img_to_hocr,
    tokenizer,
    doc_ner,
    draw
])

import pkg_resources
bin_df = spark.read.format("binaryFile").load('data/t01.jpg')
bin_df.show()

results = pipeline.transform(bin_df).cache()

res = results.collect()

## since pyspark2.3 doesn't have element_at, 'getItem' is involked
path_array = f.split(results['path'], '/')

# from pyspark2.4
# results.withColumn("filename", f.element_at(f.split("path", "/"), -1)) \

results.withColumn('filename', path_array.getItem(f.size(path_array)- 1)) \
    .withColumn("exploded_entities", f.explode("entities")) \
    .select("filename", "exploded_entities") \
    .show(truncate=False)

```

</div>

## Results

```bash
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|filename|exploded_entities                                                                                |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|t01.jpg |{named_entity, 712, 716, OTHERS, {confidence -> 96, width -> 74, x -> 1557, y -> 416, word -> Ended, token -> ended, height -> 18}, []}                   |
|t01.jpg |{named_entity, 718, 724, DATE-B, {confidence -> 96, width -> 97, x -> 1639, y -> 416, word -> January, token -> january, height -> 24}, []}               |
|t01.jpg |{named_entity, 726, 727, DATE-I, {confidence -> 95, width -> 34, x -> 1743, y -> 416, word -> 31,, token -> 31, height -> 22}, []}                        |
|t01.jpg |{named_entity, 730, 733, DATE-I, {confidence -> 96, width -> 54, x -> 1785, y -> 416, word -> 2021, token -> 2021, height -> 18}, []}                     |
|t01.jpg |{named_entity, 735, 744, OTHERS, {confidence -> 91, width -> 143, x -> 1372, y -> 472, word -> Commission, token -> commission, height -> 18}, []}        |
|t01.jpg |{named_entity, 746, 749, OTHERS, {confidence -> 96, width -> 36, x -> 1523, y -> 472, word -> file, token -> file, height -> 18}, []}                     |
|t01.jpg |{named_entity, 751, 756, OTHERS, {confidence -> 92, width -> 96, x -> 1568, y -> 472, word -> number:, token -> number, height -> 18}, []}                |
|t01.jpg |{named_entity, 759, 761, FILENUMBER-B, {confidence -> 92, width -> 119, x -> 1675, y -> 472, word -> 001-39495, token -> 001, height -> 18}, []}          |
|t01.jpg |{named_entity, 769, 773, REGISTRANT-B, {confidence -> 92, width -> 136, x -> 1472, y -> 558, word -> ASANA,, token -> asana, height -> 31}, []}           |
|t01.jpg |{named_entity, 776, 778, REGISTRANT-I, {confidence -> 95, width -> 72, x -> 1620, y -> 558, word -> INC., token -> inc, height -> 25}, []}
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
```

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|visualner_10kfilings|
|Type:|ocr|
|Compatibility:|Visual NLP 4.0.0+|
|License:|Licensed|
|Edition:|Official|
|Language:|en|
|Size:|744.4 MB|

## References

SEC 10k filings


text:
import scala.language.dynamics

class A extends Dynamic {
  def applyDynamic(method: String): B = new B(method)
}
class B(method: String) {
  def apply(x: Int) = s"$method(x: Int) called with x = $x"
  def apply(x: String) = s"""$method(x: String) called with x = "$x""""
}

object Test {
  def main(args: Array[String]): Unit = {
    val x = new A
    println(x.bippy(42))
    println(x.bippy("42"))
  }
}


text:
CircularRangeSeekBar
====================

Screenshot:

![Imgur](Screenshot_0.1.png)

Used in
-------

 - [Locale/Tasker Twilight Plug-in](https://play.google.com/store/apps/details?id=com.terdelle.twilight)

Please let me know if you want your porject on this list.