text:
@interface QJFeedUserView ()
@property(nonatomic, strong) UIImageView *avatarImageView;
@property(nonatomic, strong) UILabel *displayNameLabel;
@property(nonatomic, strong) UILabel *hintLabel;
@property(nonatomic, strong) BFPaperButton *categoryLabel;
@property(nonatomic, strong) UILabel *createdAtLabel;

@property(nonatomic, strong)UITapGestureRecognizer *tapAvatar;
@end

@implementation QJFeedUserView

- (void)setupViews {
  [self addSubview:self.avatarImageView];
  [self addSubview:self.displayNameLabel];
  [self addSubview:self.hintLabel];
  [self addSubview:self.categoryLabel];
  [self addSubview:self.createdAtLabel];
}

- (void)updateConstraintsInternal {
  [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.size.mas_equalTo(CGSizeMake(kAvatarWidth, kAvatarWidth));
    make.left.top.and.bottom.equalTo(self);
  }];

  [self.displayNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
    make.centerY.equalTo(self.avatarImageView);
    make.left.equalTo(self.avatarImageView.mas_right).with.offset(kPaddingEdge);
  }];

  [self.hintLabel mas_makeConstraints:^(MASConstraintMaker *make) {
    make.centerY.equalTo(self.displayNameLabel);
    make.left.equalTo(self.displayNameLabel.mas_right).with.offset(kInlinePaddingEdge);
  }];

  [self.categoryLabel mas_makeConstraints:^(MASConstraintMaker *make) {
    make.centerY.equalTo(self.hintLabel);
    make.left.equalTo(self.hintLabel.mas_right).with.offset(kInlinePaddingEdge);
  }];

  [self.createdAtLabel mas_makeConstraints:^(MASConstraintMaker *make) {
    make.centerY.equalTo(self);
    make.right.equalTo(self);
  }];
}

- (UIImageView *)avatarImageView {
  if (!_avatarImageView) {
    _avatarImageView = [UIImageView new];
    _avatarImageView.userInteractionEnabled = YES;
    _avatarImageView.layer.masksToBounds = YES;
    _avatarImageView.layer.cornerRadius = kAvatarWidth / 2;
    _avatarImageView.image = [UIImage imageNamed:@"placeholder_avatar"];
    _tapAvatar = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleTapDidAvatar)];
    [_avatarImageView addGestureRecognizer:_tapAvatar];
  }
  return _avatarImageView;
}

- (UILabel *)displayNameLabel {
  if (!_displayNameLabel) {
    _displayNameLabel = [UILabel new];
    _displayNameLabel.textColor = [UIColor qj_textColorPrimary];
    _displayNameLabel.font = [UIFont systemFontOfSize:18];
    _displayNameLabel.numberOfLines = 1;
    _displayNameLabel.lineBreakMode = NSLineBreakByTruncatingTail;
  }
  return _displayNameLabel;
}

- (UILabel *)hintLabel {
  if (!_hintLabel) {
    _hintLabel = [UILabel new];
    _hintLabel.textColor = [UIColor qj_textGrayColor];
    _hintLabel.font = [UIFont systemFontOfSize:14];
    _hintLabel.numberOfLines = 1;
    _hintLabel.lineBreakMode = NSLineBreakByTruncatingTail;
    _hintLabel.text = @"发布了一个";
  }
  return _hintLabel;
}

- (BFPaperButton *)categoryLabel {
  if (!_categoryLabel) {
    _categoryLabel = [BFPaperButton new];
    _categoryLabel.layer.masksToBounds = YES;
    _categoryLabel.layer.cornerRadius = 5;
    _categoryLabel.shadowColor = [UIColor clearColor];
    [_categoryLabel setTitleFont:[UIFont systemFontOfSize:12]];
    _categoryLabel.contentEdgeInsets = UIEdgeInsetsMake(3, 5, 3, 5);
    _categoryLabel.backgroundColor = [UIColor qj_accentColor];
    _categoryLabel.userInteractionEnabled = NO; //登录按钮默认不能点击
    [_categoryLabel setTitleColor:[UIColor qj_textColorPrimaryInverse] forState:UIControlStateNormal];
    [_categoryLabel setTitleColor:[UIColor qj_textColorPrimaryInverse] forState:UIControlStateHighlighted];
    [_categoryLabel setTitleColor:[UIColor qj_textColorPrimaryInverse] forState:UIControlStateSelected];
  }
  return _categoryLabel;
}

- (UILabel *)createdAtLabel {
  if (!_createdAtLabel) {
    _createdAtLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    _createdAtLabel.text = @"13分钟";
    _createdAtLabel.font = [UIFont boldSystemFontOfSize:14];
    _createdAtLabel.textColor = [UIColor qj_textGrayColor];
  }
  return _createdAtLabel;
}

- (void)configureWithData:(QJPost *)entity {
  _post = entity;
  [self.avatarImageView
      sd_setImageWithURL:[entity.userInfo toURL:kAvatarWidth height:kAvatarWidth]
        placeholderImage:[UIImage imageNamed:@"placeholder_avatar"]];

  [self.categoryLabel setTitle:entity.category.name forState:UIControlStateNormal];
  self.displayNameLabel.text = entity.userInfo.nickname;
  self.createdAtLabel.text = [self updateTimeWithSecend:entity.createdAt.integerValue];
  [super configureWithData:entity];
}

- (NSString *)updateTimeWithSecend:(NSInteger )time {
  NSString *fromPublishedTime = nil;
  NSInteger deltaTime = (NSInteger)[[NSDate date] timeIntervalSince1970] - time;
  NSInteger minites = 60;
  NSInteger hours = minites * 60;
  NSInteger days = hours * 24;
  NSInteger months = days * 30;
  NSInteger years = months * 12;

  if (deltaTime < hours) {
    fromPublishedTime = [NSString stringWithFormat:@"%ld分钟前",deltaTime / minites];
    if (deltaTime / minites < 1)  fromPublishedTime = @"刚刚";
  } else if (deltaTime < days) {
    fromPublishedTime = [NSString stringWithFormat:@"%ld小时前",deltaTime / hours];
  } else if (deltaTime < months) {
    fromPublishedTime = [NSString stringWithFormat:@"%ld天前",deltaTime / days];
  } else if (deltaTime < years) {
    fromPublishedTime = [NSString stringWithFormat:@"%ld月前",deltaTime / months];
  } else {
    fromPublishedTime = [NSString stringWithFormat:@"%ld年前",deltaTime / years];
  }
  return fromPublishedTime;
}

- (void)handleTapDidAvatar {
  if (self.delegate && [self.delegate respondsToSelector:@selector(didAvatarTapped:)]) {
    [self.delegate didAvatarTapped:_post.userInfo];
  }
}
@end


text:
.printLabel {
  box-sizing: content-box;
  font-family: 'VarelaLocal';
  width: 900px;
  height: 600px;
  margin: auto;
  border: 2px dashed black;
  padding: 0;
  background-color: white;
  color: black;
  font-weight: 900;
  font-stretch: semi-expanded;
  vertical-align: middle;
}

.printLabel div {
  margin: 10px;
  padding: 0;
  align-items: center;
}
.printLabel > div:first-child {
  margin: 20px 10px 10px 10px;
}

.printLabel i {
  margin: 5px 0;
  vertical-align: middle;
}

.printLabel input {
  width: 300px;
  height: auto;
  border: none;
  font-weight: 800;
  text-align: center;
}

.pxlg, .plg, .pmd, .psm {
  text-align: center;
}
.pxlg {
  font-size: 9rem;
  line-height: 1.1;
}
.plg {
  font-size: 6rem;
  line-height: 1.2;
}
.pmd { font-size: 3rem; }
.psm { font-size: 2.5rem; }
.pxsm { font-size: 2rem; }

.printBr {
  page-break-after: always;
  break-after: always;
}

n-print {
  display: none;
}

@media print {
  .printLabel {
     position: absolute;
     top: 0;
     left: 0;
     margin: 0;
     border: none;
     transform: rotate(180deg);
  }
  .noPrint {
    display: none;
  }
  n-print {
    display: block;
  }
  body {
    background-color: white;
  }
  a {
    color: black;
    text-decoration: none;
  }
  header, h1, header nav, footer, img,
  .taskColumn, .taskLink, .tenHeader, .Toastify {
    display: none;
  }
  .simpleContainer, .slidesLayout,
  .containerEx, .baseContainer,
  .balance {
    display: block;
  }
  .contentAreaEx, .traverseContent {
    background-color: transparent;
  }
  .slidesSlide { padding: 0; }
  .cardify > div, .autoFlex > div { box-shadow: none; }

  .alwaysPrint {
    display: block !important;
    visibility: visible !important;
  }
  .errorReport {
    background-color: white;
    color: black;
  }
  .space5x5,
  .space2vsq,
  .space1v,
  .space2v,
  .space3v,
  .space36v {
    padding: 0;
  }
  .redGlow { background-color: var(--alizarintrans); }
  .yellowGlow { background-color: var(--sunflowerfade); }
  .greenGlow { background-color: var(--emeraldtrans); }

  .redGlow, .yellowGlow, .greenGlow {
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
  }
}

.userCard {
  width: 6cm;
  height: 9cm;
}
.userCardContent {
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 10px;
  border: 15px double var(--neptuneColor);
  border-radius: 25px;
  background-color: white;
}
.userCardContent > img {
  position: relative;
  top: 5px;
  height: 1.5cm;
}
.userCardContent > n-username {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  font-weight: 600;
  margin: 5px;
  height: 4cm;
  line-height: 1.2;
  text-overflow: ellipsis;
  overflow: hidden;
}
.userCardContent > span {
  display: flex;
  align-items: flex-end;
  position: relative;
  bottom: 0px;
  margin: 0 auto;
  height: 5cm;
}

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper'

module Spree
  describe Api::OrdersController do
    render_views

    let!(:order) { create(:order) }
    let(:attributes) { [:number, :item_total, :total,
                        :state, :adjustment_total,
                        :user_id, :created_at, :updated_at,
                        :completed_at, :payment_total, :shipment_state,
                        :payment_state, :email, :special_instructions] }

    before do
      stub_authentication!
    end

    it "cannot view all orders" do
      api_get :index
      assert_unauthorized!
    end

    it "can view their own order" do
      Order.any_instance.stub :user => current_api_user
      api_get :show, :id => order.to_param
      response.status.should == 200
      json_response.should have_attributes(attributes)
    end

    # Regression test for #1992
    it "can view an order not in a standard state" do
      Order.any_instance.stub :user => current_api_user
      order.update_column(:state, 'shipped')
      api_get :show, :id => order.to_param
    end

    it "can not view someone else's order" do
      Order.any_instance.stub :user => stub_model(Spree::LegacyUser)
      api_get :show, :id => order.to_param
      assert_unauthorized!
    end

    it "cannot cancel an order that doesn't belong to them" do
      order.update_attribute(:completed_at, Time.now)
      order.update_attribute(:shipment_state, "ready")
      api_put :cancel, :id => order.to_param
      assert_unauthorized!
    end

    it "cannot add address information to an order that doesn't belong to them" do
      api_put :address, :id => order.to_param
      assert_unauthorized!
    end

    it "cannot change delivery information on an order that doesn't belong to them" do
      api_put :delivery, :id => order.to_param
      assert_unauthorized!
    end

    it "can create an order" do
      variant = create(:variant)
      api_post :create, :order => { :line_items => [{ :variant_id => variant.to_param, :quantity => 5 }] }
      response.status.should == 201
      order = Order.last
      order.line_items.count.should == 1
      order.line_items.first.variant.should == variant
      order.line_items.first.quantity.should == 5
      json_response["state"].should == "address"
    end

    it "can create an order without any parameters" do
      lambda { api_post :create }.should_not raise_error(NoMethodError)
      response.status.should == 201
      order = Order.last
      json_response["state"].should == "address"
    end

    context "working with an order" do
      before do
        Order.any_instance.stub :user => current_api_user
        create(:payment_method)
        order.next # Switch from cart to address
        order.ship_address.should be_nil
        order.state.should == "address"
      end

      def clean_address(address)
        address.delete(:state)
        address.delete(:country)
        address
      end

      let(:address_params) { { :country_id => Country.first.id, :state_id => State.first.id } }
      let(:shipping_address) { clean_address(attributes_for(:address).merge!(address_params)) }
      let(:billing_address) { clean_address(attributes_for(:address).merge!(address_params)) }
      let!(:shipping_method) { create(:shipping_method) }
      let!(:payment_method) { create(:payment_method) }

      it "can add address information to an order" do
        api_put :address, :id => order.to_param, :shipping_address => shipping_address, :billing_address => billing_address

        response.status.should == 200
        order.reload
        order.shipping_address.reload
        order.billing_address.reload
        # We can assume the rest of the parameters are set if these two are
        order.shipping_address.firstname.should == shipping_address[:firstname]
        order.billing_address.firstname.should == billing_address[:firstname]
        order.state.should == "delivery"
        json_response["shipping_methods"].should_not be_empty
      end

      it "can add just shipping address information to an order" do
        api_put :address, :id => order.to_param, :shipping_address => shipping_address
        response.status.should == 200
        order.reload
        order.shipping_address.reload
        order.shipping_address.firstname.should == shipping_address[:firstname]
        order.bill_address.should be_nil
      end

      it "cannot use an address that has no valid shipping methods" do
        shipping_method.destroy
        api_put :address, :id => order.to_param, :shipping_address => shipping_address, :billing_address => billing_address
        response.status.should == 422
        json_response["errors"]["base"].should == ["No shipping methods available for selected location, please change your address and try again."]
      end

      it "can not add invalid ship address information to an order" do
        shipping_address[:firstname] = ""
        api_put :address, :id => order.to_param, :shipping_address => shipping_address, :billing_address => billing_address

        response.status.should == 422
        json_response["errors"]["ship_address.firstname"].should_not be_blank
      end

      it "can not add invalid ship address information to an order" do
        billing_address[:firstname] = ""
        api_put :address, :id => order.to_param, :shipping_address => shipping_address, :billing_address => billing_address

        response.status.should == 422
        json_response["errors"]["bill_address.firstname"].should_not be_blank
      end

      it "can add line items" do
        api_put :update, :id => order.to_param, :order => { :line_items => [{:variant_id => create(:variant).id, :quantity => 2}] }

        response.status.should == 200
        json_response['item_total'].to_f.should_not == order.item_total.to_f
      end

      context "with a line item" do
        before do
          order.line_items << create(:line_item)
        end

        context "for delivery" do
          before do
            order.update_attribute(:state, "delivery")
          end

          it "can select a shipping method for an order" do
            order.shipping_method.should be_nil
            api_put :delivery, :id => order.to_param, :shipping_method_id => shipping_method.id
            response.status.should == 200
            order.reload
            order.state.should == "payment"
            order.shipping_method.should == shipping_method
          end

          it "cannot select an invalid shipping method for an order" do
            order.shipping_method.should be_nil
            api_put :delivery, :id => order.to_param, :shipping_method_id => '1234567890'
            response.status.should == 422
            json_response["errors"].should include("Invalid shipping method specified.")
          end
        end

        it "can empty an order" do
          api_put :empty, :id => order.to_param
          response.status.should == 200
          order.reload.line_items.should be_empty
        end
      end
    end

    context "as an admin" do
      sign_in_as_admin!

      context "with no orders" do
        before { Spree::Order.delete_all }
        it "still returns a root :orders key" do
          api_get :index
          json_response["orders"].should == []
        end
      end

      context "with two orders" do
        before { create(:order) }

        it "can view all orders" do
          api_get :index
          json_response["orders"].first.should have_attributes(attributes)
          json_response["count"].should == 2
          json_response["current_page"].should == 1
          json_response["pages"].should == 1
        end

        # Test for #1763
        it "can control the page size through a parameter" do
          api_get :index, :per_page => 1
          json_response["orders"].count.should == 1
          json_response["orders"].first.should have_attributes(attributes)
          json_response["count"].should == 1
          json_response["current_page"].should == 1
          json_response["pages"].should == 2
        end
      end

      context "search" do
        before do
          create(:order)
          Spree::Order.last.update_attribute(:email, 'spree@spreecommerce.com')
        end

        let(:expected_result) { Spree::Order.last }

        it "can query the results through a parameter" do
          api_get :index, :q => { :email_cont => 'spree' }
          json_response["orders"].count.should == 1
          json_response["orders"].first.should have_attributes(attributes)
          json_response["orders"].first["email"].should == expected_result.email
          json_response["count"].should == 1
          json_response["current_page"].should == 1
          json_response["pages"].should == 1
        end
      end

      context "can cancel an order" do
        before do
          order.completed_at = Time.now
          order.state = 'complete'
          order.shipment_state = 'ready'
          order.save!
        end

        specify do
          api_put :cancel, :id => order.to_param
          json_response["state"].should == "canceled"
        end
      end
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to Metamarkets Group Inc. (Metamarkets) under one
  ~ or more contributor license agreements. See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership. Metamarkets licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License. You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.druid.extensions</groupId>
  <artifactId>druid-lookups-cached-single</artifactId>
  <name>druid-lookups-cached-single</name>
  <description>Extension to rename Druid dimension values using lookups </description>

  <parent>
    <groupId>io.druid</groupId>
    <artifactId>druid</artifactId>
    <version>0.10.0-SNAPSHOT</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>

  <dependencies>
    <dependency>
      <groupId>io.druid</groupId>
      <artifactId>druid-api</artifactId>
      <version>${project.parent.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.druid</groupId>
      <artifactId>druid-processing</artifactId>
      <version>${project.parent.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.druid</groupId>
      <artifactId>druid-server</artifactId>
      <version>${project.parent.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.mapdb</groupId>
      <artifactId>mapdb</artifactId>
    </dependency>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>stringtemplate</artifactId>
      <version>3.2</version>
    </dependency>
    <!-- Tests -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.druid</groupId>
      <artifactId>druid-server</artifactId>
      <version>${project.parent.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.druid</groupId>
      <artifactId>druid-processing</artifactId>
      <version>${project.parent.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

  </dependencies>
</project>


text:
[palava.tv](https://palava.tv) is simplistic video communication with your friends and colleagues from within your web browser. It is build on top of the [WebRTC](https://webrtc.org/) technology. No registration or browser plugin required.

See [palavatv/palava](https://github.com/palavatv/palava) for an overview of all parts of palava.tv.

The palava portal is the single-page web application which runs palava. It is built using the [palava client](https://github.com/palavatv/palava-client), the [React](https://facebook.github.io/react/) JavaScript library, and compiled for the web by [Middleman](http://middlemanapp.com/).

**This application is not part of the palava.tv stack, anymore**

It was replaced by [palavatv/palava-web](https://github.com/palavatv/palava-web).

## Setup

Clone this directory and checkout the submodule:

    $ git clone https://github.com/palavatv/palava-portal
    $ cd palava-portal
    $ git submodule init
    $ git submodule update

Make sure you have Ruby and Bundler installed, maybe you also need to export the PATH manually

    $ ruby -v

After cloning this repo and in the new directory run:

    $ bundle install

Make also sure that you also have install nodejs and run:

    $ npm install

In another tab, start the [PalavaMachine](https://github.com/palavatv/palava-machine) or [SignalTower](https://github.com/farao/signaltower/)

Start the middleman development server on http://localhost:4567

    $ middleman

In case '$ middleman' leads to errors due to some missing components, try running '$ bundle update' and then re-run middleman.

You can build a static version of the page using:

    $ middleman build

### Configure using Environment Variables

You can set the addresses of the rtc and stun server via environment variables. The defaults are a local rtc server 'ws:localhost:4233' and the palava stun server 'stun:stun.palava.tv'. Use `ws:` for unsecured and `wss:` for ssl secured websocket connections.

    $ export PALAVA_RTC_ADDRESS="ws:some_ip:some_port"
    $ export PALAVA_STUN_ADDRESS="stun:some_ip:some_port"
    $ export PALAVA_BASE_ADDRESS="https://your.domain.com"
    $ middleman

#### Defaults

    $ PALAVA_BASE_ADDRESS="localhost:4567" PALAVA_STUN_ADDRESS="stun:stun.palava.tv" PALAVA_RTC_ADDRESS="ws:localhost:4233" middleman

#### Use with palava.tv

    $ PALAVA_BASE_ADDRESS="palava.tv" PALAVA_STUN_ADDRESS="stun:stun.palava.tv" PALAVA_RTC_ADDRESS="wss:machine.palava.tv" middleman

## Credits

MIT License. Part of the [palava project](https://palava.tv).

    Copyright (C) 2014-2020 palava e. V.  contact@palava.tv

    Copyright (C) 2013 Jan Lelis          hi@ruby.consulting
    Copyright (C) 2013 Marius Melzer      marius@rasumi.net
    Copyright (C) 2013 Stephan Thamm      stephan@innovailable.eu
    Copyright (C) 2013 Kilian Ulbrich     kilian@innovailable.eu


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

  <meta HTTP-EQUIV=CONTENT-TYPE CONTENT="text/html; charset=utf-8">
  <title>Slide 7</title>

First page Back Continue Last page Overview Graphics

Simple "Call Once" Decorator

def register(function):

	print "LOOK! ", function.__name__

	return function

@register

def print_hello():

	print "Hello"

print_hello()

print_hello()


text:
Article 1614
----
La chose doit être délivrée en l'état où elle se trouve au moment de la vente.

Depuis ce jour, tous les fruits appartiennent à l'acquéreur.


text:
<?xml version="1.0"?>
<chart caption="Sales Summary" subCaption="For the year 2010" numberPrefix="$" sformatNumberScale="1" sNumberPrefix="$" syncAxisLimits="1" rotateValues="1" showSum="0">
<!-- Data for single series chart -->
	<set label="Quarter 1" value="232400"/>
	<set label="Quarter 2" value="339800"/>
	<set label="Quarter 3" value="411900"/>
	<set label="Quarter 4" value="398400"/>
<!-- Data for multi-series stacked and combination chart -->
	<categories>
		<category label="Quarter 1"/>
		<category label="Quarter 2"/>
		<category label="Quarter 3"/>
		<category label="Quarter 4"/>
	</categories>
	<dataset seriesName="Products">
		<set value="232400"/>
		<set value="232400"/>
		<set value="339800"/>
		<set value="411900"/>
		<set value="398400"/>
<!-- Data for multi-series stacked chart - nested dataset-->
		<dataset seriesName="Product A">
			<set value="232400"/>
			<set value="232400"/>
			<set value="339800"/>
			<set value="411900"/>
			<set value="398400"/>
		</dataset>
		<dataset seriesName="Product B">
			<set value="232400"/>
			<set value="232400"/>
			<set value="339800"/>
			<set value="411900"/>
			<set value="398400"/>
		</dataset>
	</dataset>
	<dataset seriesName="Services" renderAs="line" parentYAxis="S" showValues="1" valuePosition="BELOW">
		<set value="147400"/>
		<set value="189100"/>
		<set value="219800"/>
		<set value="289100"/>
		<set value="209800"/>
<!-- Data for multi-series stacked chart - nested dataset-->
		<dataset seriesName="All Services" renderAs="line" parentYAxis="S">
			<set value="214400"/>
			<set value="214100"/>
			<set value="284800"/>
			<set value="323100"/>
			<set value="324800"/>
		</dataset>
	</dataset>
<!-- Data for multi-series stacked chart line chart - line dataset -->
	<lineset seriesName="Target Profitability" valuePosition="BELOW">
		<set value="104400"/>
		<set value="104100"/>
		<set value="144800"/>
		<set value="213100"/>
		<set value="214800"/>
	</lineset>
</chart>


text:
describe('Iuchi Rimei', function() {
    integration(function() {
        beforeEach(function() {
            this.setupTest({
                phase: 'conflict',
                player1: {
                    inPlay: ['doji-kuwanan', 'doomed-shugenja'],
                    hand: ['fine-katana', 'cloud-the-mind', 'finger-of-jade', 'height-of-fashion', 'force-of-the-river']
                },
                player2: {
                    inPlay: ['iuchi-rimei', 'hida-kisada'],
                    hand: ['ornate-fan', 'calling-in-favors']
                }
            });

            this.rimei = this.player2.findCardByName('iuchi-rimei');
            this.kisada = this.player2.findCardByName('hida-kisada');
            this.fan = this.player2.findCardByName('ornate-fan');
            this.calling = this.player2.findCardByName('calling-in-favors');

            this.kuwanan = this.player1.findCardByName('doji-kuwanan');
            this.doomed = this.player1.findCardByName('doomed-shugenja');
            this.cloud = this.player1.findCardByName('cloud-the-mind');
            this.katana = this.player1.findCardByName('fine-katana');
            this.finger = this.player1.findCardByName('finger-of-jade');
            this.fashion = this.player1.findCardByName('height-of-fashion');
            this.river = this.player1.findCardByName('force-of-the-river');

            this.player1.playAttachment(this.katana, this.doomed);
            this.player2.playAttachment(this.fan, this.doomed);
            this.player1.playAttachment(this.finger, this.kuwanan);
            this.player2.pass();
            this.player1.playAttachment(this.cloud, this.kisada);
            this.player2.pass();
            this.player1.playAttachment(this.fashion, this.kuwanan);
            this.player2.pass();
            this.player1.playAttachment(this.river, this.doomed);
        });

        it('should only allow targeting an attachment with cost 1 or less controlled by opponent', function() {
            this.player2.clickCard(this.rimei);
            expect(this.player2).toBeAbleToSelect(this.cloud);
            expect(this.player2).toBeAbleToSelect(this.finger);
            expect(this.player2).not.toBeAbleToSelect(this.fan);
            expect(this.player2).toBeAbleToSelect(this.katana);
            expect(this.player2).not.toBeAbleToSelect(this.fashion);
            expect(this.player2).toBeAbleToSelect(this.river);
        });

        it('should not allow targeting an attachment that has changed control', function() {
            this.player2.clickCard(this.calling);
            this.player2.clickCard(this.katana);
            this.player2.clickCard(this.rimei);

            this.player1.pass();

            this.player2.clickCard(this.rimei);
            expect(this.player2).toBeAbleToSelect(this.cloud);
            expect(this.player2).toBeAbleToSelect(this.finger);
            expect(this.player2).not.toBeAbleToSelect(this.fan);
            expect(this.player2).not.toBeAbleToSelect(this.katana);
        });

        it('should allow moving the attachment to another character controlled by the attachment parent', function() {
            this.player2.clickCard(this.rimei);
            this.player2.clickCard(this.cloud);
            expect(this.player2).toBeAbleToSelect(this.rimei);
            expect(this.player2).not.toBeAbleToSelect(this.kisada);
            expect(this.player2).not.toBeAbleToSelect(this.kuwanan);
            expect(this.player2).not.toBeAbleToSelect(this.doomed);

            this.player2.clickCard(this.rimei);
            expect(this.rimei.attachments.toArray()).toContain(this.cloud);
            expect(this.kisada.attachments.toArray()).not.toContain(this.cloud);

            expect(this.getChatLogs(2)).toContain('player2 uses Iuchi Rimei to move Cloud the Mind to another character');
            expect(this.getChatLogs(1)).toContain('player2 moves Cloud the Mind to Iuchi Rimei');
        });

        it('should allow moving an attachment that can only be attached to \'characters you control\'', function() {
            this.player2.clickCard(this.rimei);
            this.player2.clickCard(this.finger);
            expect(this.player2).not.toBeAbleToSelect(this.rimei);
            expect(this.player2).not.toBeAbleToSelect(this.kisada);
            expect(this.player2).not.toBeAbleToSelect(this.kuwanan);
            expect(this.player2).toBeAbleToSelect(this.doomed);
            this.player2.clickCard(this.doomed);

            expect(this.kuwanan.attachments.toArray()).not.toContain(this.finger);
            expect(this.doomed.attachments.toArray()).toContain(this.finger);

            expect(this.finger.location).toBe('play area');
        });

        it('finger of jade should not stop', function() {
            this.player2.clickCard(this.rimei);
            this.player2.clickCard(this.katana);
            expect(this.player2).toBeAbleToSelect(this.kuwanan);
            this.player2.clickCard(this.kuwanan);
            expect(this.player1).not.toHavePrompt('Triggered Abilities');

            expect(this.kuwanan.attachments.toArray()).toContain(this.katana);
            expect(this.doomed.attachments.toArray()).not.toContain(this.katana);
        });

        it('should discard newly illegal attachments', function() {
            this.player2.clickCard(this.rimei);
            this.player2.clickCard(this.river);
            expect(this.player2).toBeAbleToSelect(this.kuwanan);
            this.player2.clickCard(this.kuwanan);
            expect(this.river.location).toBe('conflict discard pile');
            expect(this.getChatLogs(3)).toContain('player2 uses Iuchi Rimei to move Force of the River to another character');
            expect(this.getChatLogs(2)).toContain('player2 moves Force of the River to Doji Kuwanan');
        });
    });
});


text:
@interface PodsDummy_Pods_Client : NSObject
@end
@implementation PodsDummy_Pods_Client
@end


text:
function encodeOptions(options) {
  var buf = [];
  if (typeof(options) == "object" && options !== null) {
    for (var name in options) {
      if (!options.hasOwnProperty(name)) {continue;}
      var value = options[name];
      if (name == "key" || name == "startkey" || name == "endkey") {
        value = JSON.stringify(value);
      }
      buf.push(encodeURIComponent(name) + "=" + encodeURIComponent(value));
    }
  }
  if (!buf.length) {
    return "";
  }
  return "?" + buf.join("&");
}

function concatArgs(array, args) {
  for (var i=0; i < args.length; i++) {
    array.push(args[i]);
  };
  return array;
};

function makePath(array) {
  var options, path;

  if (typeof array[array.length - 1] != "string") {
    // it's a params hash
    options = array.pop();
  }
  path = array.map(function(item) {return encodeURIComponent(item)}).join('/');
  if (options) {
    return path + encodeOptions(options);
  } else {
    return path;
  }
};

exports.init = function(req) {
  return {
    asset : function() {
      var p = req.path, parts = ['', p[0], p[1] , p[2]];
      return makePath(concatArgs(parts, arguments));
    },
    show : function() {
      var p = req.path, parts = ['', p[0], p[1] , p[2], '_show'];
      return makePath(concatArgs(parts, arguments));
    },
    list : function() {
      var p = req.path, parts = ['', p[0], p[1] , p[2], '_list'];
      return makePath(concatArgs(parts, arguments));
    },
    update : function() {
      var p = req.path, parts = ['', p[0], p[1] , p[2], '_update'];
      return makePath(concatArgs(parts, arguments));
    },
    limit : function(limit) {
      var query = req.query;
      var l = query.limit;
      query.limit = limit;
      var view = req.path[req.path.length - 1];
      var list = req.path[req.path.length - 2];
      var link = this.list(list, view, query);
      query.limit = l;
      return link;
    },
    older : function(key) {
      if (!typeof key == "undefined") return null;
      var query = req.query;
      query.startkey = key;
      query.skip=1;
      var view = req.path[req.path.length - 1];
      var list = req.path[req.path.length - 2];
      return this.list(list, view, query);
    },
    absolute : function(path) {
      return 'http://' + req.headers.Host + path;
    }
  }
};


text:
<?php

/**
 * \Magento\Framework\Cache\Backend\Decorator\Compression test case
 */
namespace Magento\Framework\Cache\Backend\Decorator;

class CompressionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Magento\Framework\Cache\Backend\Decorator\Compression
     */
    protected $_decorator;

    /**
     * @var string
     */
    protected $_testString = 'Any string';

    /**
     * @var array
     */
    protected static $_cacheStorage = [];

    protected function setUp()
    {
        $options = [
            'concrete_backend' => $this->getMock('Zend_Cache_Backend_File'),
            'compression_threshold' => strlen($this->_testString),
        ];
        $this->_decorator = new \Magento\Framework\Cache\Backend\Decorator\Compression($options);
    }

    protected function tearDown()
    {
        unset($this->_decorator);
        self::$_cacheStorage = [];
    }

    public function testCompressData()
    {
        $method = new \ReflectionMethod('Magento\Framework\Cache\Backend\Decorator\Compression', '_compressData');
        $method->setAccessible(true);

        $this->assertStringStartsWith('CACHE_COMPRESSION', $method->invoke($this->_decorator, $this->_testString));
    }

    public function testDecompressData()
    {
        $methodCompress = new \ReflectionMethod(
            'Magento\Framework\Cache\Backend\Decorator\Compression',
            '_compressData'
        );
        $methodCompress->setAccessible(true);

        $methodDecompress = new \ReflectionMethod(
            'Magento\Framework\Cache\Backend\Decorator\Compression',
            '_decompressData'
        );
        $methodDecompress->setAccessible(true);

        $this->assertEquals(
            $this->_testString,
            $methodDecompress->invoke(
                $this->_decorator,
                $methodCompress->invoke($this->_decorator, $this->_testString)
            )
        );
    }

    public function testIsCompressionNeeded()
    {
        $method = new \ReflectionMethod(
            'Magento\Framework\Cache\Backend\Decorator\Compression',
            '_isCompressionNeeded'
        );
        $method->setAccessible(true);

        $this->assertFalse($method->invoke($this->_decorator, $this->_testString));
        $this->assertFalse($method->invoke($this->_decorator, substr($this->_testString, 0, -1)));
        $this->assertTrue($method->invoke($this->_decorator, $this->_testString . 's'));
    }

    public function testIsDecompressionNeeded()
    {
        $prefix = 'CACHE_COMPRESSION';

        $method = new \ReflectionMethod(
            'Magento\Framework\Cache\Backend\Decorator\Compression',
            '_isDecompressionNeeded'
        );
        $method->setAccessible(true);

        $this->assertFalse($method->invoke($this->_decorator, $this->_testString));
        $this->assertFalse($method->invoke($this->_decorator, 's' . $prefix . $this->_testString));
        $this->assertTrue($method->invoke($this->_decorator, $prefix . $this->_testString));
    }

    public function testSaveLoad()
    {
        $cacheId = 'cacheId' . rand(1, 100);

        $backend = $this->getMock('Zend_Cache_Backend_File', ['save', 'load']);
        $backend->expects($this->once())->method('save')->will($this->returnCallback([__CLASS__, 'mockSave']));

        $backend->expects($this->once())->method('load')->will($this->returnCallback([__CLASS__, 'mockLoad']));

        $options = ['concrete_backend' => $backend, 'compression_threshold' => strlen($this->_testString)];

        $decorator = new \Magento\Framework\Cache\Backend\Decorator\Compression($options);

        $decorator->setOption('write_control', false);
        $decorator->setOption('automatic_cleaning_factor', 0);

        $decorator->save($this->_testString, $cacheId);

        $this->assertArrayHasKey($cacheId, self::$_cacheStorage);
        $this->assertInternalType('string', self::$_cacheStorage[$cacheId]);

        $loadedValue = $decorator->load($cacheId);

        $this->assertEquals($this->_testString, $loadedValue);
    }

    public static function mockSave($data, $cacheId)
    {
        self::$_cacheStorage[$cacheId] = $data;
        return true;
    }

    public static function mockLoad($cacheId)
    {
        return array_key_exists($cacheId, self::$_cacheStorage) ? self::$_cacheStorage[$cacheId] : false;
    }
}


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

        <title>BallotServer</title>
        <link type="text/css" rel="stylesheet" href="BallotServer.css"/>


text:
package org.apache.ignite.ml.util;

import java.util.ArrayList;
import java.util.List;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * Tests for {@link LRUCache}.
 */
public class LRUCacheTest {
    /** */
    @Test
    public void testSize() {
        LRUCache<Integer, Integer> cache = new LRUCache<>(10);
        for (int i = 0; i < 100; i++)
            cache.put(i, i);

        assertEquals(10, cache.size());
    }

    /** */
    @Test
    public void testValues() {
        LRUCache<Integer, Integer> cache = new LRUCache<>(10);
        for (int i = 0; i < 100; i++) {
            cache.get(0);
            cache.put(i, i);
        }

        assertTrue(cache.containsKey(0));

        for (int i = 91; i < 100; i++)
            assertTrue(cache.containsKey(i));
    }

    /** */
    @Test
    public void testExpirationListener() {
        List<Integer> expired = new ArrayList<>();

        LRUCache<Integer, Integer> cache = new LRUCache<>(10, expired::add);
        for (int i = 0; i < 100; i++)
            cache.put(i, i);

        for (int i = 0; i < 90; i++)
            assertEquals(i, expired.get(i).longValue());
    }
}


text:
namespace VotingSystem.Data.Repositories
{
    using System;
    using System.Linq;

    using VotingSystem.Models;

    internal class PollsRepository : GenericRepository<Poll>, IPollRepository
    {
        public PollsRepository(IVotingSystemDbContext context)
            : base(context)
        {
        }

        public IQueryable<Poll> AllActive()
        {
            return this.Context.Polls.Where(p => p.EndDate > DateTime.Now);
        }

        public IQueryable<Poll> AllByUser(string userId)
        {
            return this.Context.Polls.Where(p => p.UserId == userId);
        }
    }
}


text:
package org.xito.miglayout.layout;

/** A class that wraps a container that contains components.
 */
public interface ContainerWrapper extends ComponentWrapper
{
	/** Returns the components of the container that wrapper is wrapping.
	 * @return The components of the container that wrapper is wrapping. Never null.
	 */
	public abstract ComponentWrapper[] getComponents();

	/** Returns the number of components that this parent has.
	 * @return The number of components that this parent has.
	 */
	public abstract int getComponentCount();

	/** Returns the LayoutHandler (in Swing terms) that is handling the layout of this container.
	 * If there exist no such class the method should return the same as {@link #getComponent()}, which is the
	 * container itself.
	 * @return The layout handler instance. Never null.
	 */
	public abstract Object getLayout();

	/** Returns if this container is using left-to-right component ordering.
	 * @return If this container is using left-to-right component ordering.
	 */
	public abstract boolean isLeftToRight();

	/** Paints a cell to indicate where it is.
	 * @param x The x coordinate to start the drwaing.
	 * @param y The x coordinate to start the drwaing.
	 * @param width The width to draw/fill
	 * @param height The height to draw/fill
	 */
	public abstract void paintDebugCell(int x, int y, int width, int height);
}


text:
//------------------------------------------------------------------------
// * @filename: xVisitResultBuilderTXT.h
// *
// * @brief: 生成数据库访问结果-文本类型
// *
// * @author: XGM
// * @date: 2017/01/19
//------------------------------------------------------------------------
#pragma once

#include "xVisitResultBuilder.h"

class xVisitResultBuilderTXT : public xVisitResultBuilder
{
public:
	xVisitResultBuilderTXT(xVisitResult* pResult)
		:xVisitResultBuilder(pResult)
	{

	}

	virtual void BuildDatabase(const std::string& strName, xDatabase* pDatabase) override;
	virtual void BuildTable(const std::string& strName, xTable* pTable) override;
	virtual void BuildField(const std::string& strName, xField* pField) override;
};


text:
Out of the box, this flask extension makes it extremely easy to monitor your application using SoundCloud's Prometheus. For more on Prometheus, see their [website](https://prometheus.io).

This extension instruments every flask route and exports the following metrics:
* Histogram: `<flask_request_latency_seconds> {'endpoint', 'method'}`
* Summary: `<flask_request_count> {'endpoint','method','http_status'}`

## Installation
```
pip install flask_prometheus
```

## Basic Usage
Type the following into an interpreter:
```
from flask import Flask
from flask_prometheus import monitor

app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello'

monitor(app, port=8000)
app.run()
```

Now, naviagate `localhost:5000` a few times and then view metrics on `localhost:8000` which should look like:
```
# HELP flask_request_count Flask Request Count
# TYPE flask_request_count counter
flask_request_count{endpoint="/",http_status="200",method="GET"} 4.0
# HELP flask_request_latency_seconds Flask Request Latency
# TYPE flask_request_latency_seconds histogram
flask_request_latency_seconds_bucket{endpoint="/",le="0.005",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="0.01",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="0.025",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="0.05",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="0.075",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="0.1",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="0.25",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="0.5",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="0.75",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="1.0",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="2.5",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="5.0",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="7.5",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="10.0",method="GET"} 4.0
flask_request_latency_seconds_bucket{endpoint="/",le="+Inf",method="GET"} 4.0
flask_request_latency_seconds_count{endpoint="/",method="GET"} 4.0
flask_request_latency_seconds_sum{endpoint="/",method="GET"} 0.0010027885437011719
```

Beware, this seems to not work when the app is run in debug mode.


text:
package org.banyan.concurrent.thread.pool;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
 * 默认线程池
 * User: krisjin
 * Date: 2016/2/19
 */
public class DefaultThreadPool<Job extends Runnable> implements ThreadPool<Job> {

    /**
     * 最大工作线程大小
     */
    private static final int MAX_WORKERS_NUMBER = 10;

    /**
     * 最小工作线程大小
     */
    private static final int MIN_WORKERS_NUMBER = 1;

    /**
     * 默认工作线程大小
     */
    private static final int DEFAULT_WORKERS_NUMBER = 5;

    /**
     * Job任务列表
     */
    private final LinkedList<Job> jobs = new LinkedList<Job>();

    /**
     * 工作线程列表
     */
    private List<Worker> workerList = Collections.synchronizedList(new ArrayList<Worker>());

    private int workerNum = DEFAULT_WORKERS_NUMBER;

    public DefaultThreadPool() {
        initializeWorker(DEFAULT_WORKERS_NUMBER);
    }

    public DefaultThreadPool(int threadNum) {
        workerNum = threadNum > MAX_WORKERS_NUMBER ? MAX_WORKERS_NUMBER : threadNum < MIN_WORKERS_NUMBER ? MIN_WORKERS_NUMBER : threadNum;
        initializeWorker(workerNum);
    }

    @Override
    public void execute(Job job) {
        if (job != null) {
            synchronized (jobs) {
                //添加一个工作任务,然后进行通知
                jobs.add(job);
                jobs.notify();
            }
        }
    }

    @Override
    public void shutdown() {
        for (Worker worker : workerList) {
            worker.shutdown();
        }
    }

    @Override
    public void addWorkers(int workersNum) {
        int addNum = workersNum;
        if (workersNum + this.workerNum > MAX_WORKERS_NUMBER) {
            addNum = MAX_WORKERS_NUMBER - workersNum;
        }
        synchronized (jobs) {
            initializeWorker(workersNum);
            this.workerNum = addNum;
        }
    }

    @Override
    public void removeWorkers(int workerNum) {
        if (workerNum >= this.workerNum) {
            throw new IllegalArgumentException("can not remove beyond workerNum. now num is " + this.workerNum);
        }
        synchronized (jobs) {
            int count = 0;
            while (count < workerNum) {
                workerList.get(count).shutdown();
                count++;
            }
            this.workerNum = this.workerNum - workerNum;
        }
    }

    @Override
    public int getJobSize() {
        return jobs.size();
    }

    public void initializeWorker(int num) {
        for (int i = 0; i < num; i++) {
            Worker worker = new Worker();
            workerList.add(worker);
            Thread thread = new Thread(worker);
            thread.start();
        }
    }

    class Worker implements Runnable {
        private volatile boolean running = true;

        @Override
        public void run() {
            Job job = null;
            while (jobs.isEmpty()) {
                try {
                    jobs.wait();
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                    return;
                }
                job = jobs.removeFirst();
                if (job != null) {
                    try {
                        job.run();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        }

        public void shutdown() {
            running = false;
        }
    }
}


text:
<loading data-bind="visible: loading"></loading>
<access-denied params="isAuthenticated: isAuthenticated, isPermitted: isViewPermitted"></access-denied>

  <heading-title params="name: predictionCaption(), description: canEdit() ? '' : ko.i18n('common.readOnly', '(Read only)'), icon: 'heartbeat', theme: 'dark'"></heading-title>

          <input type="text" class="form-control" data-bind="
            placeholder: ko.i18n('predictions.newItemPlaceholder', 'New Patient Level Prediction Analysis'),
            textInput: $component.patientLevelPredictionAnalysis() && $component.patientLevelPredictionAnalysis().name,
            css: { emptyInput: !isNameFilled() },
            attr: { disabled: !canEdit() }" />

              <button class="btn btn-success"
                      data-bind="title: ko.i18n('common.save', 'Save'), click: save, enable: canSave() && !isProcessing()"></button>
              <button class="btn btn-primary"
                      data-bind="title: ko.i18n('common.close', 'Close'), click: close, enable: !isProcessing()"></button>

              <button class="btn btn-primary"
                      data-bind="title: ko.i18n('common.createACopy', 'Create a copy'), click: copy, enable: canCopy() && !isProcessing()"></button>
              <button class="btn btn-primary"
                      data-bind="title: ko.i18n('common.configureAccess', 'Configure access'), visible: isOwner, click: () => isAccessModalShown(!isAccessModalShown())">

              </button>
              <button class="btn btn-danger"
                      data-bind="title: ko.i18n('common.delete', 'Delete'), click: $component.delete, enable: canDelete() && !isProcessing()"></button>

      <name-validation params="
        hasEmptyName: !isNameFilled(),
        hasInvalidCharacters: isNameFilled() && !isNameCharactersValid(),
        hasInvalidLength: isNameFilled() && !isNameLengthValid(),
        hasDefaultName: isDefaultName(),
        analysisName: ko.i18n('components.nameValidation.plpAnalysis', 'PLP analysis'),
      "></name-validation>

  <tabs data-bind="visible: !$component.loading()" params="
    selectedTabKey: $component.selectedTabKey,
    selectTab: $component.selectTab,
    tabs: [
        {
            title: ko.i18n('predictions.tabs.specification', 'Specification'),
            key: 'specification',
            componentName: 'prediction-specification-view-edit',
            componentParams: $component.componentParams,
        },
        {
            title: $component.executionTabTitle ? ko.i18n('predictions.tabs.executions', 'Executions') : '',
            key: 'executions',
            componentName: 'analysis-execution-list',
            componentParams: $component.componentParams,
        },
        {
            title: ko.i18n('predictions.tabs.utilities', 'Utilities'),
            key: 'utilities',
            componentName: 'prediction-utilities',
            componentParams: $component.componentParams,
        },
        {
            title: ko.i18n('predictions.tabs.messages', 'Messages'),
            key: 'messages',
            componentName: 'warnings',
            componentParams: $component.warningParams,
            hasBadge: true,
            preload: true,
        },
    ]">
  </tabs>

<configure-access-modal params="
	isModalShown: $component.isAccessModalShown,
	isOwnerFn: $component.isOwnerFn,
	loadAccessListFn: $component.loadAccessList,
	grantAccessFn: $component.grantAccess,
	revokeAccessFn: $component.revokeAccess,
	loadRoleSuggestionsFn: $component.loadAccessRoleSuggestions
"></configure-access-modal>


text:
title: Keyword Datatype
short_title: Keyword
---

A field to index structured content such as email addresses, hostnames, status codes, zip codes or tags.

They are typically used for filtering (Find me all blog posts where status is published), for sorting, and for aggregations. Keyword fields are only searchable by their exact value.

If you need to index full text content such as email bodies or product descriptions, it is likely that you should rather use a text field. By default every field in the document with text value is interpreted as type `text` so you must explicitly use `keyword` if you want a field not be `text`.

If you are following the documentation examples you may notice that the field "employer" is indexed as `text` before but this time we index the field as `keyword`

{% capture req %}

```json
UPDATE /bank/1

{
  "username": {
    "_type": "keyword",
    "_value": "mlee"
  }
}
```
{% endcapture %}
{% include curl.html req=req %}

{: .note .caution }
**_Caution_**<br>
Notice we are using the same index "bank" as before, if you already indexed at this index with previous examples you are going to get a error for change types for the field  "employer" from `text` to `keyword`

## Parameters

The following parameters are accepted by _Keyword_ fields:

|---------------------------------------|-----------------------------------------------------------------------------------------|
| `_value`                              | The value for the field. (Only used at index time).                                     |
| `_index`                              | The mode the field will be indexed as: `"none"`, `"field_terms"`, `"field_values"`, `"field_all"`, `"field"`, `"global_terms"`, `"global_values"`, `"global_all"`, `"global"`, `"terms"`, `"values"`, `"all"`. (The default is `"field_all"`). |
| `_slot`                               | The slot number. (It's calculated by default).                                          |
| `_prefix`                             | The prefix the term is going to be indexed with. (It's calculated by default)           |
| `_weight`                             | The weight the term is going to be indexed with.                                        |


text:
var doneCalled;
function $DONE(argError) {

    var testError;
    var result, resultError;

    if (argError) {
        testError = argError.toString();
    }

    if (doneCalled) {
        // ? log called twice
        return;
    }
    doneCalled = true;

    //An exception is expected
    if (testDescrip.negative !== undefined) {
        //TODO - come up with a generic way of catching the error type
        //from this.onerror

        var negRegexp = new RegExp(testDescrip.negative, "i"),
            unkRegexp = /^UnknownError:/;

        if (!testError) { //no exception was thrown
            result = 'fail';
            resultError = Error('No exception was thrown; expected an error "message"' +
                                ' property matching the regular expression "' +
                                testDescrip.negative + '".');
        } else if (!negRegexp.test(testError) &&
                   !unkRegexp.test(testError)) {
            //wrong type of exception thrown
            result = 'fail';
            resultError = Error('Expected an exception with a "message"' +
                                ' property matching the regular expression "' +
                                testDescrip.negative +
                                '" to be thrown; actual was "' +
                                testError + '".');

        } else {
            result = 'pass';
            resultError = 'undefined';
        }
    } else if (testError) {
        //Exception was not expected to be thrown
        result = 'fail';
        resultError = Error('Unexpected exception, "' + testError + '" was thrown.');
    } else {
        result = 'pass';
        resultError = undefined;
    }

    testRun(testDescrip.id,
            testDescrip.path,
            testDescrip.description,
            testDescrip.code,
            result,
            resultError);

    //teardown
    testFinished();
}


text:
package org.ethereum.net;

import org.ethereum.listener.EthereumListener;
import org.ethereum.net.message.Message;
import org.ethereum.net.p2p.PingMessage;

import io.netty.channel.ChannelHandlerContext;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Queue;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentLinkedQueue;

import javax.inject.Inject;

import static org.ethereum.net.message.StaticMessages.DISCONNECT_MESSAGE;

/**
 * This class contains the logic for sending messages in a queue
 *
 * Messages open by send and answered by receive of appropriate message
 *      PING by PONG
 *      GET_PEERS by PEERS
 *      GET_TRANSACTIONS by TRANSACTIONS
 *      GET_BLOCK_HASHES by BLOCK_HASHES
 *      GET_BLOCKS by BLOCKS
 *
 * The following messages will not be answered:
 *      PONG, PEERS, HELLO, STATUS, TRANSACTIONS, BLOCKS
 *
 * @author Roman Mandeleil
 */
public class MessageQueue {

    private static final Logger logger = LoggerFactory.getLogger("net");

    private Queue<MessageRoundtrip> messageQueue = new ConcurrentLinkedQueue<>();
    private ChannelHandlerContext ctx = null;
    private final Timer timer = new Timer("MessageQueue");

    EthereumListener listener;
    boolean hasPing = false;

	@Inject
    public MessageQueue(EthereumListener listener) {
        this.listener = listener;
    }

    public void activate(ChannelHandlerContext ctx) {
        this.ctx = ctx;
        timer.scheduleAtFixedRate(new TimerTask() {
            public void run() {
                nudgeQueue();
            }
        }, 10, 10);
    }

    public void sendMessage(Message msg) {
        if (msg instanceof PingMessage) {
            if (hasPing) return;
            hasPing = true;
        }

        messageQueue.add(new MessageRoundtrip(msg));
    }

    public void disconnect() {
        ctx.writeAndFlush(DISCONNECT_MESSAGE);
        ctx.close();
    }

    public void receivedMessage(Message msg) throws InterruptedException {

        listener.trace("[Recv: " + msg + "]");

        if (messageQueue.peek() != null) {
            MessageRoundtrip messageRoundtrip = messageQueue.peek();
            Message waitingMessage = messageRoundtrip.getMsg();

            if (waitingMessage instanceof PingMessage) hasPing = false;

            if (waitingMessage.getAnswerMessage() != null
                    && msg.getClass() == waitingMessage.getAnswerMessage()) {
                messageRoundtrip.answer();
                logger.debug("Message round trip covered: [{}] ",
                        messageRoundtrip.getMsg().getClass());
            }
        }
    }

    private void removeAnsweredMessage(MessageRoundtrip messageRoundtrip) {
        if (messageRoundtrip != null && messageRoundtrip.isAnswered())
            messageQueue.remove();
    }

    private void nudgeQueue() {
        // remove last answered message on the queue
        removeAnsweredMessage(messageQueue.peek());
        // Now send the next message
        sendToWire(messageQueue.peek());
    }

    private void sendToWire(MessageRoundtrip messageRoundtrip) {

        if (messageRoundtrip != null && messageRoundtrip.getRetryTimes() == 0) {
            // TODO: retry logic || messageRoundtrip.hasToRetry()){

            Message msg = messageRoundtrip.getMsg();

            listener.onSendMessage(msg);

            ctx.writeAndFlush(msg);

            if (msg.getAnswerMessage() == null)
                messageQueue.remove();
            else {
                messageRoundtrip.incRetryTimes();
                messageRoundtrip.saveTime();
            }
        }
    }

    public void close() {
        timer.cancel();
        timer.purge();
    }
}


text:
'use strict';

var knex = require('knex');

module.exports = function database(dbConfigFile) {
  const dbConfig = dbConfigFile[process.env.NODE_ENV];

  return knex(dbConfig);
};


text:
package org.apache.sis.io;

import java.io.IOException;
import org.apache.sis.test.DependsOn;
import org.junit.Before;

import static org.junit.Assert.*;

/**
 * Tests {@link LineAppender} implementation when used for expanding tabulations to spaces.
 *
 * @author  Martin Desruisseaux (Geomatys)
 * @version 0.3
 *
 * @see LineAppender#setTabulationExpanded(boolean)
 *
 * @since 0.3
 * @module
 */
@DependsOn(LineAppenderTest.class)
public final strictfp class TabulationExpansionTest extends LineAppenderTest {
    /**
     * Creates and configure the {@link LineAppender} to test.
     */
    @Before
    @Override
    public void createLineAppender() {
        appender = new LineAppender(appender, null, true);
    }

    /**
     * Runs the test.
     *
     * @param  lineSeparator  the line separator to use in the test strings.
     * @throws IOException should never happen, since we are writing in a {@link StringBuilder}.
     */
    @Override
    void run(final String lineSeparator) throws IOException {
        final Appendable f = appender;
        if (f instanceof LineAppender) {
            assertEquals("getTabWidth", 8, ((LineAppender) f).getTabulationWidth());
        }
        assertSame(f, f.append("12\t8"   + lineSeparator));
        assertSame(f, f.append("1234\t8" + lineSeparator));
        assertSame(f, f.append("A tabulation\tin the middle."));
        assertOutputEquals("12      8" + lineSeparator
                         + "1234    8" + lineSeparator
                         + "A tabulation    in the middle.");
    }
}


text:
Tinytest.add(
  'User - not logged in',
  function (test) {
    EnableTrackingMethods();
    var methodId = RegisterMethod(function () {
      TestData.insert({aa: 10});
    });
    var client = GetMeteorClient();
    var result = client.call(methodId);
    var events = GetLastMethodEvents([0, 2]);
    var expected = [
      ['start',,{userId: null, params: '[]'}],
      ['wait',,{waitOn: []}],
      ['db',,{coll: 'tinytest-data', func: 'insert'}],
      ['complete']
    ];
    test.equal(events, expected);
    CleanTestData();
  }
);


text: this is a server project about socket


text:
using System.Threading.Tasks;

namespace AonWeb.FluentHttp.Handlers
{
    public interface IHttpHandler : IHandler<HandlerType>
    {
        Task OnSending(HttpSendingContext context);
        Task OnSent(HttpSentContext context);
        Task OnException(HttpExceptionContext context);
    }
}


text:
import React from 'react';
import RegistrationForm from 'zs-react/RegistrationForm';

export default class ExampleRegistrationForm extends React.Component {
  onSubmit = (user) => {
    console.log(user);
  }

  render() {
    return <RegistrationForm onSubmit={this.onSubmit} />
  }
}


text:
<?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;

umask(0000);

$loader = require_once __DIR__.'/app/bootstrap.php.cache';
Debug::enable();

require_once __DIR__.'/app/AppKernel.php';

$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$kernel->boot();

$container = $kernel->getContainer();
$container->enterScope('request');
$container->set('request', $request);

// all our setup is done!!!!!!

use Yoda\EventBundle\Entity\Event;

// play.php
// ...
// all our setup is done!!!!!!

$em = $container->get('doctrine')->getManager();

$user = $em
    ->getRepository('UserBundle:User')
    ->findOneBy(array('username' => 'wayne'))
;

foreach ($user->getEvents() as $event) {
    var_dump($event->getName());
}


text:
from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token

from . import views

urlpatterns = [
    url(r'^register/$', views.register, name="register"),
    url(r'^users/$', views.users, name="users"),
    url(r'^token-auth/$', obtain_jwt_token, name="token_auth"),
    url(r'^get/$', views.retrieve, name="retrieve"),
    url(r'^update/$', views.update, name="update"),
    url(r'^password_reset/$', views.password_reset, name="password_reset"),
    url(r'^confirm/(?P<activation_key>\w+)/$', views.confirm, name="confirm"),
    url(r'^resend-activation/$', views.resend_activation, name="resend_activation"),
    url(r'^update_password/(?P<password_reset_token>\w+)/$', views.update_password, name="update_password"),
    url(r'^check_password_token/(?P<password_reset_token>\w+)/$', views.check_password_token, name="check_password_token"),
]


text:
/**
 * @module ol/source/Source
 */
import {abstract} from '../util.js';
import BaseObject from '../Object.js';
import {get as getProjection} from '../proj.js';
import SourceState from './State.js';

/**
 * A function that returns a string or an array of strings representing source
 * attributions.
 *
 * @typedef {function(import("../PluggableMap.js").FrameState): (string|Array<string>)} Attribution
 */

/**
 * A type that can be used to provide attribution information for data sources.
 *
 * It represents either
 * * a simple string (e.g. `'© Acme Inc.'`)
 * * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`)
 * * a function that returns a string or array of strings ({@link module:ol/source/Source~Attribution})
 *
 * @typedef {string|Array<string>|Attribution} AttributionLike
 */

/**
 * @typedef {Object} Options
 * @property {AttributionLike} [attributions]
 * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.
 * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection.
 * @property {SourceState} [state='ready']
 * @property {boolean} [wrapX=false]
 */

/**
 * @classdesc
 * Abstract base class; normally only used for creating subclasses and not
 * instantiated in apps.
 * Base class for {@link module:ol/layer/Layer~Layer} sources.
 *
 * A generic `change` event is triggered when the state of the source changes.
 * @abstract
 * @api
 */
class Source extends BaseObject {
  /**
   * @param {Options} options Source options.
   */
  constructor(options) {

    super();

    /**
     * @private
     * @type {import("../proj/Projection.js").default}
     */
    this.projection_ = getProjection(options.projection);

    /**
     * @private
     * @type {?Attribution}
     */
    this.attributions_ = adaptAttributions(options.attributions);

    /**
     * @private
     * @type {boolean}
     */
    this.attributionsCollapsible_ = options.attributionsCollapsible !== undefined ?
      options.attributionsCollapsible : true;

    /**
     * This source is currently loading data. Sources that defer loading to the
     * map's tile queue never set this to `true`.
     * @type {boolean}
     */
    this.loading = false;

    /**
     * @private
     * @type {SourceState}
     */
    this.state_ = options.state !== undefined ?
      options.state : SourceState.READY;

    /**
     * @private
     * @type {boolean}
     */
    this.wrapX_ = options.wrapX !== undefined ? options.wrapX : false;

  }

  /**
   * Get the attribution function for the source.
   * @return {?Attribution} Attribution function.
   */
  getAttributions() {
    return this.attributions_;
  }

  /**
   * @return {boolean} Attributions are collapsible.
   */
  getAttributionsCollapsible() {
    return this.attributionsCollapsible_;
  }

  /**
   * Get the projection of the source.
   * @return {import("../proj/Projection.js").default} Projection.
   * @api
   */
  getProjection() {
    return this.projection_;
  }

  /**
   * @abstract
   * @return {Array<number>|undefined} Resolutions.
   */
  getResolutions() {
    return abstract();
  }

  /**
   * Get the state of the source, see {@link module:ol/source/State~State} for possible states.
   * @return {SourceState} State.
   * @api
   */
  getState() {
    return this.state_;
  }

  /**
   * @return {boolean|undefined} Wrap X.
   */
  getWrapX() {
    return this.wrapX_;
  }

  /**
   * Refreshes the source and finally dispatches a 'change' event.
   * @api
   */
  refresh() {
    this.changed();
  }

  /**
   * Set the attributions of the source.
   * @param {AttributionLike|undefined} attributions Attributions.
   *     Can be passed as `string`, `Array<string>`, {@link module:ol/source/Source~Attribution},
   *     or `undefined`.
   * @api
   */
  setAttributions(attributions) {
    this.attributions_ = adaptAttributions(attributions);
    this.changed();
  }

  /**
   * Set the state of the source.
   * @param {SourceState} state State.
   * @protected
   */
  setState(state) {
    this.state_ = state;
    this.changed();
  }
}

/**
 * Turns the attributions option into an attributions function.
 * @param {AttributionLike|undefined} attributionLike The attribution option.
 * @return {?Attribution} An attribution function (or null).
 */
function adaptAttributions(attributionLike) {
  if (!attributionLike) {
    return null;
  }
  if (Array.isArray(attributionLike)) {
    return function(frameState) {
      return attributionLike;
    };
  }

  if (typeof attributionLike === 'function') {
    return attributionLike;
  }

  return function(frameState) {
    return [attributionLike];
  };
}

export default Source;


text:
namespace solar {

	opengl_shader_program::opengl_shader_program(opengl_shader_program_factory& factory, const resource_address& resource_address)
		: _factory(factory)
		, _resource_address(resource_address) {
	}

	opengl_shader_program::opengl_shader_program(opengl_shader_program_factory& factory, const char* vs_embedded_code, const char* fs_embedded_code)
		: _factory(factory) {
		ASSERT(false);//todo
		UNUSED_PARAMETER(vs_embedded_code);
		UNUSED_PARAMETER(fs_embedded_code);
	}

	opengl_shader_program::~opengl_shader_program() {
	}

	const resource_address& opengl_shader_program::get_resource_address() const {
		return _resource_address;
	}

	void opengl_shader_program::load() {
		ASSERT(false);//todo
	}

	void opengl_shader_program::create_embedded() {
		ASSERT(false);//todo
	}

	void opengl_shader_program::start() {
		//null-op of opengl?
	}

	void opengl_shader_program::stop() {
		//null-op of opengl?
	}

	void opengl_shader_program::commit_param_changes() {
		//todo
	}

	void opengl_shader_program::forget_param_changes() {
		//todo
	}

	bool opengl_shader_program::set_bool(const char* name, bool value) {
		//todo
		UNUSED_PARAMETER(name);
		UNUSED_PARAMETER(value);
		return false;
	}

	bool opengl_shader_program::set_float(const char* name, float value) {
		//todo
		UNUSED_PARAMETER(name);
		UNUSED_PARAMETER(value);
		return false;
	}

	bool opengl_shader_program::set_float_array(const char* name, const float* values, unsigned int count) {
		//todo
		UNUSED_PARAMETER(name);
		UNUSED_PARAMETER(values);
		UNUSED_PARAMETER(count);
		return false;
	}

	bool opengl_shader_program::set_mat44(const char* name, const mat44& value) {
		//todo
		UNUSED_PARAMETER(name);
		UNUSED_PARAMETER(value);
		return false;
	}

	bool opengl_shader_program::set_texture(const char* name, texture* texture) {
		//todo
		UNUSED_PARAMETER(name);
		UNUSED_PARAMETER(texture);
		return false;
	}

	bool opengl_shader_program::set_platform_texture(const char* name, void* texture) {
		//todo
		UNUSED_PARAMETER(name);
		UNUSED_PARAMETER(texture);
		return false;
	}

}


text:
import { Channel } from '../src/channel.js';

const testUrl = 'http://localhost:8080/gtest/100000000000000000000000';
let channel, ingress;

describe(`Channel wraps and aggregates networking subsystem and`, function() {
  beforeAll(function() {
    ingress = jasmine.createSpy('ChannelTestIngressSpy');
    channel = new Channel(testUrl, ingress);
    // egress = jasmine.createSpy('ChannelTestEgressSpy');
  });
  afterAll(function() {
    channel.close();
  });
  it(`should take url and ingress sink function for channel instantiation`,
    function(){
      expect(channel instanceof Channel).toBeTruthy();
    }
  );
  it(`should have property pointing to a Promise of a egress function`,
    function(done) {
      expect(channel.egress instanceof Promise).toBeTruthy();
      channel.egress.then((transmitter)=>{
        expect(typeof transmitter === 'function').toBeTruthy();
        done();
      });
    }
  );
  it(`should have desctructor function to close/abort connection`, function() {
    expect(typeof channel.close === 'function').toBeTruthy();

  });
});


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Status */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'message')->widget(\yii\redactor\widgets\Redactor::className(),
        [
            'clientOptions' => [
                'imageManagerJson' => ['/redactor/upload/image-json'],
                'imageUpload' => ['/redactor/upload/image'],
                'fileUpload' => ['/redactor/upload/file'],
                'lang' => 'zh_cn',
                'plugins' => ['clips', 'fontcolor','imagemanager']
            ]
        ]
        ) ?>

    <?=
    $form->field($model, 'permissions')->dropDownList($model->getPermissions(),
        ['prompt'=>'- Choose Your Permissions -']) ?>

        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
package com.intellij.vcs.log;

import com.intellij.vcs.log.graph.PermanentGraph;
import org.jetbrains.annotations.NotNull;

public interface VcsLogUi {

  @NotNull
  VcsLogFilterUi getFilterUi();

  @NotNull
  VcsLogDataPack getDataPack();

  void addHighlighter(@NotNull VcsLogHighlighter highlighter);
  void removeHighlighter(@NotNull VcsLogHighlighter highlighter);

  void addLogListener(@NotNull VcsLogListener listener);
  void removeLogListener(@NotNull VcsLogListener listener);

  void setBranchesPanelVisible(boolean visible);

  boolean areGraphActionsEnabled();

  boolean isMultipleRoots();
  boolean isShowRootNames();

  void setBekType(@NotNull PermanentGraph.SortType bekType);
  @NotNull PermanentGraph.SortType getBekType();

  void setShowRootNames(boolean showRootNames);

  boolean isHighlightMyCommits();

  void setHighlightMyCommits(boolean state);
}


text:
![rakede](./docs/rakede-logo.png)

dev: [![Build Status](https://drone.ctfl.space/api/badges/chaostreff-flensburg/rakede/status.svg?branch=dev)](https://drone.ctfl.space/chaostreff-flensburg/rakede)
master: [![Build Status](https://drone.ctfl.space/api/badges/chaostreff-flensburg/rakede/status.svg?branch=master)](https://drone.ctfl.space/chaostreff-flensburg/rakede)

## Getting Started

``` bash
# node >= 8.0.0 needed
# if you are on an older version:
# npm i -g n && n stable

# install dependencies
$ npm install # Or yarn install

# serve with hot reload at localhost:3000
$ npm run dev

# build for production and launch server
$ npm start
```

For detailed explanation on how things work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js).

## Changelog

__0.0.0__

- Nothing to release yet

## License

Licensed under the [MIT license](LICENSE).

## Backpack

We use [backpack](https://github.com/palmerhq/backpack) to watch and build the application, so you can use the latest ES6 features (module syntax, async/await, etc.).


text:
package rangecontent

import (
	"bytes"
	"encoding/json"
	"github.com/golang/glog"
	"github.com/google/tsviewdb/src/db"
	"time"
)

func MakeSrcsJsonContent(d db.DB, b *bytes.Buffer, rawQuery string) (err error) {
	dTable, err := getDataTable(d, rawQuery)
	if err != nil {
		return err
	}

	t3 := time.Now()
	if err := json.NewEncoder(b).Encode(dTable); err != nil {
		return err
	}
	glog.V(2).Infof("PERF: JSON marshal time: %v\n", time.Now().Sub(t3))

	return nil
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
    <!-- 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
    -->
    <ModulePrefs title="Wakatime Gadget">
        <Require feature="rpc" />
        <Require feature="views" />
        <Require feature="locked-domain" />
    </ModulePrefs>
    <Content type="html"><![CDATA[
<html ng-app="wakatime">
<head>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css" />
<link href="wakatime.css" />
<!-- inject:css -->
<!-- endinject -->
</head>
<body ng-controller="WakatimeCtrl">

<script src="//plus.google.com/hangouts/_/api/v1/hangout.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js"></script>

<include src="index.html" />

<script src="wakatime.js" />
<!-- inject:js -->
<!-- endinject -->
</body>
]]>
    </Content>
</Module>


text:
/*
 * 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 io.trino.cost;

import io.trino.Session;
import io.trino.sql.planner.TypeProvider;
import io.trino.sql.planner.iterative.IterativeOptimizer;
import io.trino.sql.planner.iterative.Lookup;
import io.trino.sql.planner.plan.PlanNode;

public interface StatsCalculator
{
    /**
     * Calculate stats for the {@code node}.
     *
     * @param node The node to compute stats for.
     * @param sourceStats The stats provider for any child nodes' stats, if needed to compute stats for the {@code node}
     * @param lookup Lookup to be used when resolving source nodes, allowing stats calculation to work within {@link IterativeOptimizer}
     * @param types The type provider for all symbols in the scope.
     * @param tableStatsProvider The table stats provider.
     */
    PlanNodeStatsEstimate calculateStats(
            PlanNode node,
            StatsProvider sourceStats,
            Lookup lookup,
            Session session,
            TypeProvider types,
            TableStatsProvider tableStatsProvider);

    static StatsCalculator noopStatsCalculator()
    {
        return (node, sourceStats, lookup, ignore, types, tableStatsProvider) -> PlanNodeStatsEstimate.unknown();
    }
}


text:
package net.spy.memcached.vbucket;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipelineCoverage;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.handler.codec.http.HttpChunk;
import org.jboss.netty.handler.codec.http.HttpResponse;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;

@ChannelPipelineCoverage("one")
public class BucketUpdateResponseHandler extends SimpleChannelUpstreamHandler {

    private volatile boolean readingChunks;
    private String lastResponse;
    private ChannelFuture receivedFuture;
    private CountDownLatch latch;
    private StringBuilder partialResponse;
    private static final Logger LOGGER = Logger.getLogger(BucketUpdateResponseHandler.class.getName());

    @Override
    public void messageReceived(final ChannelHandlerContext context, final MessageEvent event) {
        ChannelFuture channelFuture = event.getFuture();
        setReceivedFuture(channelFuture);
        if (this.partialResponse == null) {
            this.partialResponse = new StringBuilder();
        }
        if (readingChunks) {
            HttpChunk chunk = (HttpChunk) event.getMessage();
            if (chunk.isLast()) {
                readingChunks = false;
            } else {
                String curChunk = chunk.getContent().toString("UTF-8");
                /*
                 * Server sends four new lines in a chunk as a sentinal between
                 * responses.
                 */
                if (curChunk.matches("\n\n\n\n")) {
                    setLastResponse(partialResponse.toString());
                    partialResponse = null;
                    getLatch().countDown();
                    if (monitor != null) {
                        monitor.invalidate();
                    }
                } else {
                    finerLog(curChunk);
                    finerLog("Chunk length is: " + curChunk.length());
                    partialResponse.append(curChunk);
                    channelFuture.setSuccess();
                }

            }
        } else {
            HttpResponse response = (HttpResponse) event.getMessage();
            logResponse(response);
        }
    }

    private void logResponse(HttpResponse response) {
        finerLog("STATUS: " + response.getStatus());
        finerLog("VERSION: " + response.getProtocolVersion());

        if (!response.getHeaderNames().isEmpty()) {
            for (String name : response.getHeaderNames()) {
                for (String value : response.getHeaders(name)) {
                    finerLog("HEADER: " + name + " = " + value);
                }
            }
            finerLog(System.getProperty("line.separator"));
        }

        if (response.getStatus().getCode() == 200 && response.isChunked()) {
            readingChunks = true;
            finerLog("CHUNKED CONTENT {");
        } else {
            ChannelBuffer content = response.getContent();
            if (content.readable()) {
                finerLog("CONTENT {");
                finerLog(content.toString("UTF-8"));
                finerLog("} END OF CONTENT");
            }
        }
    }

    /**
     * @return the lastResponse
     */
    protected String getLastResponse() {
        ChannelFuture channelFuture = getReceivedFuture();
        if (channelFuture.awaitUninterruptibly(30, TimeUnit.SECONDS)) {
            return lastResponse;
        } else { // TODO: make this work with multiple servers
            throw new ConnectionException("Cannot contact any server in the pool");
        }
    }

    /**
     * @param lastResponse the lastResponse to set
     */
    private void setLastResponse(String lastResponse) {
        this.lastResponse = lastResponse;
    }

    /**
     * @return the receivedFuture
     */
    private ChannelFuture getReceivedFuture() {
        try {
            getLatch().await();
        } catch (InterruptedException ex) {
            finerLog("Getting received future has been interrupted.");
        }
        return receivedFuture;
    }

    /**
     * @param receivedFuture the receivedFuture to set
     */
    private void setReceivedFuture(ChannelFuture receivedFuture) {
        this.receivedFuture = receivedFuture;
    }

    /**
     * @return the latch
     */
    private CountDownLatch getLatch() {
        if (this.latch == null) {
            latch = new CountDownLatch(1);
        }
        return latch;
    }

    private void finerLog(String message) {
        LOGGER.log(Level.FINER, message);
    }

    @Override
    public void handleUpstream(ChannelHandlerContext context, ChannelEvent event) throws Exception {

        if (event instanceof ChannelStateEvent) {
            LOGGER.log(Level.FINEST, "Channel state changed: " + event + "\n\n");
        }
        super.handleUpstream(context, event);
    }

    BucketMonitor monitor;

    protected void setBucketMonitor(BucketMonitor monitor) {
        this.monitor = monitor;
    }

    /* @todo we need to investigate why the exception occurs, and if there
     *       is a better solution to the problem than just shutting down the
     *       connection. For now just invalidate the BucketMonitor, and the
     *       Client manager will recreate the connection.
     */
    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
        LOGGER.log(Level.INFO, "Exception occurred: ");
        if (monitor != null) {
            monitor.invalidate();
        }
    }
}


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Validation Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines contain the default error messages used by
    | the validator class. Some of these rules have multiple versions such
    | as the size rules. Feel free to tweak each of these messages here.
    |
    */

    'accepted'             => ':attribute doit être accepté.',
    'active_url'           => ':attribute n\'est pas une URL valide.',
    'after'                => ':attribute doit être supérieur à :date.',
    'alpha'                => ':attribute ne doit contenir que des lettres.',
    'alpha_dash'           => ':attribute doit contenir uniquement des lettres, chiffres et traits d\'union.',
    'alpha_num'            => ':attribute doit contenir uniquement des chiffres et des lettres.',
    'array'                => ':attribute doit être un tableau.',
    'before'               => ':attribute doit être inférieur à :date.',
    'between'              => [
        'numeric' => ':attribute doit être compris entre :min et :max.',
        'file'    => ':attribute doit être compris entre :min et :max kilobytes.',
        'string'  => ':attribute doit être compris entre :min et :max caractères.',
        'array'   => ':attribute doit être compris entre :min et :max éléments.',
    ],
    'boolean'              => ':attribute doit être vrai ou faux.',
    'confirmed'            => ':attribute la confirmation n\'est pas valide.',
    'date'                 => ':attribute n\'est pas une date valide.',
    'date_format'          => ':attribute ne correspond pas au format :format.',
    'different'            => ':attribute et :other doivent être différents l\'un de l\'autre.',
    'digits'               => ':attribute doit être de longueur :digits.',
    'digits_between'       => ':attribute doit avoir une longueur entre :min et :max.',
    'email'                => ':attribute doit être une adresse e-mail valide.',
    'filled'               => ':attribute est un champ requis.',
    'exists'               => 'L\'attribut :attribute est invalide.',
    'image'                => ':attribute doit être une image.',
    'in'                   => 'L\'attribut :attribute est invalide.',
    'integer'              => ':attribute doit être un chiffre entier.',
    'ip'                   => ':attribute doit être une adresse IP valide.',
    'max'                  => [
        'numeric' => ':attribute ne doit pas excéder :max.',
        'file'    => ':attribute ne doit pas excéder :max kilobytes.',
        'string'  => ':attribute ne doit pas excéder :max caractères.',
        'array'   => ':attribute ne doit pas contenir plus de :max éléments.',
    ],
    'mimes'                => ':attribute doit être un fichier de type :values.',
    'min'                  => [
        'numeric' => ':attribute doit être au moins :min.',
        'file'    => ':attribute doit faire au moins :min kilobytes.',
        'string'  => ':attribute doit contenir au moins :min caractères.',
        'array'   => ':attribute doit contenir au moins :min éléments.',
    ],
    'not_in'               => 'L\'attribut sélectionné :attribute est invalide.',
    'numeric'              => ':attribute doit être un nombre.',
    'regex'                => ':attribute a un format invalide.',
    'required'             => ':attribute est un champ requis.',
    'required_if'          => ':attribute est requis si :other est :value.',
    'required_with'        => ':attribute est requis si :values est présent.',
    'required_with_all'    => ':attribute est requis si :values est présent.',
    'required_without'     => ':attribute est requis si:values n\'est pas présent.',
    'required_without_all' => ':attribute est requis si aucun des valeurs :values n\'est présente.',
    'same'                 => ':attribute et :other doivent être identiques.',
    'size'                 => [
        'numeric' => ':attribute doit avoir la taille :size.',
        'file'    => ':attribute doit peser :size kilobytes.',
        'string'  => ':attribute doit contenir :size caractères.',
        'array'   => ':attribute doit contenir :size éléments.',
    ],
    'string'               => ':attribute doit être une chaîne de caractères.',
    'timezone'             => ':attribute doit être une zone valide.',
    'unique'               => ':attribute est déjà utilisé.',
    'url'                  => ':attribute a un format invalide.',

    /*
    |--------------------------------------------------------------------------
    | Custom Validation Language Lines
    |--------------------------------------------------------------------------
    |
    | Here you may specify custom validation messages for attributes using the
    | convention "attribute.rule" to name the lines. This makes it quick to
    | specify a specific custom language line for a given attribute rule.
    |
    */

    'custom' => [
        'password-confirm' => [
            'required_with' => 'La confirmation du mot de passe est requise',
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Custom Validation Attributes
    |--------------------------------------------------------------------------
    |
    | The following language lines are used to swap attribute place-holders
    | with something more reader friendly such as E-Mail Address instead
    | of "email". This simply helps us make messages a little cleaner.
    |
    */

    'attributes' => [],

];


text:
==============================
:mod:`siphon.simplewebservice`
==============================

.. automodule:: siphon.simplewebservice
   :members:
   :special-members: __init__

======================================
:mod:`siphon.simplewebservice.wyoming`
======================================
.. automodule:: siphon.simplewebservice.wyoming
   :members:
   :special-members: __init__

======================================
:mod:`siphon.simplewebservice.iastate`
======================================
.. automodule:: siphon.simplewebservice.iastate
   :members:
   :special-members: __init__

====================================
:mod:`siphon.simplewebservice.igra2`
====================================
.. automodule:: siphon.simplewebservice.igra2
   :members:
   :special-members: __init__

===================================
:mod:`siphon.simplewebservice.acis`
===================================
.. automodule:: siphon.simplewebservice.acis
   :members:
   :special-members: __init__

===================================
:mod:`siphon.simplewebservice.ndbc`
===================================
.. automodule:: siphon.simplewebservice.ndbc
   :members:
   :special-members: __init__


text:
/**
 *
 */
package org.nww.modules.users.orm;

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

import org.nww.core.data.AbstractExtensiblePersistentObject;
import org.nww.core.utils.ApplicationContextHelper;
import org.nww.modules.profiles.orm.Profile;
import org.nww.modules.profiles.orm.ProfileManager;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.util.StringUtils;

/**
 * Basic implementation of the {@link User} interface.
 * @author mga
 *
 */
@Document(collection = "users")
public class UserImpl extends AbstractExtensiblePersistentObject implements User {

	@Indexed(unique = true)
	private String username;
	private String password;
	private int enabled;
	private List<String> roles = new ArrayList<>();
	private String profileUUID;

	@Transient
	private Profile profile;

	@Transient
	private ProfileManager profileMgr = ApplicationContextHelper.getBeanByClass(ProfileManager.class);

	/* (non-Javadoc)
	 * @see org.nww.orm.dao.users.User#getUsername()
	 */
	@Override
	public String getUsername() {
		return username;
	}

	/* (non-Javadoc)
	 * @see org.nww.orm.dao.users.User#setUsername(java.lang.String)
	 */
	@Override
	public void setUsername(String username) {
		this.username = username;
	}

	/* (non-Javadoc)
	 * @see org.nww.orm.dao.users.User#getPassword()
	 */
	@Override
	public String getPassword() {
		return password;
	}

	/* (non-Javadoc)
	 * @see org.nww.orm.dao.users.User#setPassword(java.lang.String)
	 */
	@Override
	public void setPassword(String password) {
		this.password = password;
	}

	/* (non-Javadoc)
	 * @see org.nww.orm.dao.users.User#isEnabled()
	 */
	@Override
	public int isEnabled() {
		return enabled;
	}

	/* (non-Javadoc)
	 * @see org.nww.orm.dao.users.User#setEnabled(int)
	 */
	@Override
	public void setEnabled(int enabled) {
		this.enabled = enabled;
	}

	/*
	 * (non-Javadoc)
	 * @see org.nww.modules.users.orm.User#getRoles()
	 */
	@Override
	public List<String> getRoles() {
		return this.roles;
	}

	/*
	 * (non-Javadoc)
	 * @see org.nww.modules.users.orm.User#setRoles(java.util.List)
	 */
	@Override
	public void setRoles(List<String> roles) {
		this.roles = roles;
	}

	/*
	 * (non-Javadoc)
	 * @see org.nww.modules.users.orm.User#hasRole(java.lang.String)
	 */
	@Override
	public boolean hasRole(String role) {
		if(null == roles) {
			return false;
		}

		return roles.contains(role);
	}

	/*
	 * (non-Javadoc)
	 * @see org.nww.orm.dao.users.User#getProfile()
	 */
	@Override
	public Profile getProfile() {
		if(null == this.profile) {
			this.profile = profileMgr.findOne(this.profileUUID);
		}
		return this.profile;
	}

	/*
	 * (non-Javadoc)
	 * @see org.nww.orm.dao.users.User#setProfile(org.nww.orm.dao.users.ProfileImpl)
	 */
	@Override
	public void setProfile(Profile profile) {
		this.profile = profile;
		this.profileUUID = profile.getUUID();
	}

	/*
	 * (non-Javadoc)
	 * @see org.nww.orm.dao.users.User#hasProfile()
	 */
	@Override
	public boolean hasProfile() {
		// this implementation fixes a lot of frontend problems regarding 'having no profile but setting a profile image' etc.
		// I'm not happy with this, but currently there' no better solution
		return getProfile() != null
				&& ((!StringUtils.isEmpty(getProfile().getSurename()) || !StringUtils.isEmpty(getProfile().getName()))
				|| (getProfile().hasAttribute("ProfileImageUUID")));
	}

	/*
	 * (non-Javadoc)
	 * @see org.nww.orm.users.User#getDisplayName()
	 */
	@Override
	public String getDisplayName() {
		if(isDetailedUsernameAvailable()) {
			StringBuilder dn = new StringBuilder();
			Profile p = getProfile();

			if(!StringUtils.isEmpty(p.getSurename())) {
				dn.append(p.getSurename());
			}

			if(!StringUtils.isEmpty(p.getName())) {
				if(dn.length() > 0) {
					dn.append(" ");
				}
				dn.append(p.getName());
			}

			return dn.toString();
		}

		return getUsername();
	}

	private boolean isDetailedUsernameAvailable() {
		return hasProfile() && (!StringUtils.isEmpty(getProfile().getSurename()) || !StringUtils.isEmpty(getProfile().getName()));
	}

	/*
	 * (non-Javadoc)
	 * @see org.nww.modules.users.orm.User#isAdmin()
	 */
	@Override
	public boolean isAdmin() {
		return getRoles().contains("ROLE_ADMIN");
	}
}


text:
Provides sophisticated yet easy to understand ranking system with minimum changes to the system.
Elo ranking system is heavily used in tournaments, player rankings in chess, sports, leader boards, multiplayer games, ranking of test questions, tasks etc.

Read more about it on [wiki](http://en.wikipedia.org/wiki/Elo_rating_system)

### Usage

`acts_as_elo` is very easy to use

1. Install: `gem install acts_as_elo`
2. Add `include Acts::Elo` and `acts_as_elo`
3. Call any of the 3 methods: `elo_win!`, `elo_lose!` and `elo_draw!`

### Example

```ruby

class Player
  include Acts::Elo
  acts_as_elo
end

bob, jack = Player.new, Player.new
bob.elo_rank # => 1200
jack.elo_rank # => 1200

bob.elo_win!(jack)
bob.elo_rank # => 1215
jack.elo_rank # => 1985
```

### License

Released under the MIT License. See the [LICENSE][license] file for further details.

[license]: https://github.com/tjbladez/acts_as_elo/blob/master/LICENSE


text:
package models_test

import (
	. "code.cloudfoundry.org/cli/cf/models"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("ServiceInstance", func() {
	var (
		serviceInstance ServiceInstance
	)

	BeforeEach(func() {
		serviceInstance = ServiceInstance{}
	})

	Describe("isUserProvided", func() {
		When("service instance is of non user provided type", func() {
			BeforeEach(func() {
				serviceInstance.Type = "managed_service_instance"
			})

			It("returns false", func() {
				Expect(serviceInstance.IsUserProvided()).To(BeFalse())
			})
		})

		When("service instance is of user provided type", func() {
			BeforeEach(func() {
				serviceInstance.Type = "user_provided_service_instance"
			})

			It("returns true", func() {
				Expect(serviceInstance.IsUserProvided()).To(BeTrue())
			})
		})

	})
})


text: {{+partials.standard_apps_api api:apis.experimental_bluetooth}}