text:
namespace autofill {

namespace {

const char kAppLocale[] = "en-US";
const AutofillManager::AutofillDownloadManagerState kDownloadState =
    AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER;

class TestAutofillManager : public AutofillManager {
 public:
  TestAutofillManager(AutofillDriver* driver,
                      AutofillManagerDelegate* delegate)
      : AutofillManager(driver, delegate, kAppLocale, kDownloadState),
        autofill_enabled_(true) {
  }
  virtual ~TestAutofillManager() {}

  virtual bool IsAutofillEnabled() const OVERRIDE { return autofill_enabled_; }

  void set_autofill_enabled(bool autofill_enabled) {
    autofill_enabled_ = autofill_enabled;
  }

 private:
  bool autofill_enabled_;

  DISALLOW_COPY_AND_ASSIGN(TestAutofillManager);
};

class CustomTestAutofillManagerDelegate : public TestAutofillManagerDelegate {
  public:
    CustomTestAutofillManagerDelegate() : should_simulate_success_(true) {}

    virtual ~CustomTestAutofillManagerDelegate() {}

    virtual void ShowRequestAutocompleteDialog(
        const FormData& form,
        const GURL& source_url,
        const base::Callback<void(const FormStructure*)>& callback) OVERRIDE {
      if (should_simulate_success_) {
        FormStructure form_structure(form);
        callback.Run(&form_structure);
      } else {
        callback.Run(NULL);
      }
    }

    void set_should_simulate_success(bool should_simulate_success) {
      should_simulate_success_ = should_simulate_success;
    }

  private:
    // Enable testing the path where a callback is called without a
    // valid FormStructure.
    bool should_simulate_success_;

    DISALLOW_COPY_AND_ASSIGN(CustomTestAutofillManagerDelegate);
};

class TestContentAutofillDriver : public ContentAutofillDriver {
 public:
  TestContentAutofillDriver(content::WebContents* contents,
                            AutofillManagerDelegate* delegate)
      : ContentAutofillDriver(contents, delegate, kAppLocale, kDownloadState) {
    SetAutofillManager(make_scoped_ptr<AutofillManager>(
        new TestAutofillManager(this, delegate)));
  }
  virtual ~TestContentAutofillDriver() {}

  TestAutofillManager* mock_autofill_manager() {
    return static_cast<TestAutofillManager*>(autofill_manager());
  }

  using ContentAutofillDriver::DidNavigateMainFrame;

  DISALLOW_COPY_AND_ASSIGN(TestContentAutofillDriver);
};

}  // namespace

class RequestAutocompleteManagerTest :
    public content::RenderViewHostTestHarness {
 public:
  RequestAutocompleteManagerTest() {}

  virtual void SetUp() OVERRIDE {
    content::RenderViewHostTestHarness::SetUp();

    driver_.reset(
        new TestContentAutofillDriver(web_contents(), &manager_delegate_));
    request_autocomplete_manager_.reset(
        new RequestAutocompleteManager(driver_.get()));
  }

  virtual void TearDown() OVERRIDE {
    // Reset the driver now to cause all pref observers to be removed and avoid
    // crashes that otherwise occur in the destructor.
    driver_.reset();
    content::RenderViewHostTestHarness::TearDown();
  }

  // Searches for an |AutofillMsg_RequestAutocompleteResult| message in the
  // queue of sent IPC messages. If none is present, returns false. Otherwise,
  // extracts the first |AutofillMsg_RequestAutocompleteResult| message, fills
  // the output parameter with the value of the message's parameter, and
  // clears the queue of sent messages.
  bool GetAutocompleteResultMessage(
      blink::WebFormElement::AutocompleteResult* result) {
    const uint32 kMsgID = AutofillMsg_RequestAutocompleteResult::ID;
    const IPC::Message* message =
        process()->sink().GetFirstMessageMatching(kMsgID);
    if (!message)
      return false;
    Tuple2<blink::WebFormElement::AutocompleteResult, FormData> autofill_param;
    AutofillMsg_RequestAutocompleteResult::Read(message, &autofill_param);
    *result = autofill_param.a;
    process()->sink().ClearMessages();
    return true;
  }

 protected:
  CustomTestAutofillManagerDelegate manager_delegate_;
  scoped_ptr<TestContentAutofillDriver> driver_;
  scoped_ptr<RequestAutocompleteManager> request_autocomplete_manager_;

  DISALLOW_COPY_AND_ASSIGN(RequestAutocompleteManagerTest);
};

TEST_F(RequestAutocompleteManagerTest, OnRequestAutocompleteSuccess) {
  blink::WebFormElement::AutocompleteResult result;
  request_autocomplete_manager_->OnRequestAutocomplete(FormData(), GURL());
  EXPECT_TRUE(GetAutocompleteResultMessage(&result));
  EXPECT_EQ(result, blink::WebFormElement::AutocompleteResultSuccess);
}

TEST_F(RequestAutocompleteManagerTest, OnRequestAutocompleteCancel) {
  blink::WebFormElement::AutocompleteResult result;
  manager_delegate_.set_should_simulate_success(false);
  request_autocomplete_manager_->OnRequestAutocomplete(FormData(), GURL());
  EXPECT_TRUE(GetAutocompleteResultMessage(&result));
  EXPECT_EQ(result, blink::WebFormElement::AutocompleteResultErrorCancel);
}

TEST_F(RequestAutocompleteManagerTest,
       OnRequestAutocompleteWithAutofillDisabled) {
  blink::WebFormElement::AutocompleteResult result;
  driver_->mock_autofill_manager()->set_autofill_enabled(false);
  request_autocomplete_manager_->OnRequestAutocomplete(FormData(), GURL());
  EXPECT_TRUE(GetAutocompleteResultMessage(&result));
  EXPECT_EQ(result, blink::WebFormElement::AutocompleteResultSuccess);
}

}  // namespace autofill


text:
<?php

namespace Tests\AppBundle\Factory\Common\Choices\Bool;

use AppBundle\Entity\Main\Advert;
use AppBundle\Factory\Common\Choices\Enum\AdvertLocationsFactory;
use PHPUnit\Framework\TestCase;

class AdvertLocationsFactoryTest extends TestCase {

	const INVALID_VALUE = - 1;

	const TWIG_FUNCTION = 'advertLocationName';

	/**
	 *
	 * @var AdvertLocationsFactory
	 */
	protected $factory;

	protected function setUp() {
		$this->factory = new AdvertLocationsFactory();
	}

	public function testGetFunctions() {
		$result = $this->factory->getFunctions();

		$this->assertArrayHasKey(self::TWIG_FUNCTION, $result);
	}

	public function testGetItems() {
		$result = $this->factory->getItems();

		$this->assertContains(Advert::FEATURED_LOCATION, $result);
		$this->assertContains(Advert::SIDE_LOCATION, $result);
		$this->assertContains(Advert::TEXT_LOCATION, $result);
		$this->assertContains(Advert::TOP_LOCATION, $result);
	}

	public function testGetInvalidLabel() {
		$result = $this->factory->getItemLabel(self::INVALID_VALUE);

		$this->assertFalse($result);
	}
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.3.5.4_2-12gs
description: >
    Strict mode - checking access to non-strict function caller from
    non-strict function (eval includes strict directive prologue)
flags: [noStrict]
features: [caller]
---*/

eval("\"use strict\";\ngNonStrict();");

function gNonStrict() {
    return gNonStrict.caller;
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Angular Grid With Infinite Scroll</title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">

    <link rel="stylesheet" href="css/normalize.css">

    <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.0.4/angular-material.css'>

        <link rel="stylesheet" href="css/style.css">

  <md-toolbar class="md-whiteframe-z2">

      <button class="md-button md-icon-button">
        <md-icon>
          <svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
            <path d="M0 0h24v24H0z" fill="none"/>
            <path d="M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"/>
          </svg>
        </md-icon>
      </button>

        Angular Grid with Infinite Scroll

  </md-toolbar>

  <md-content id="content-scroller">

Description

Executes method on the controller when the user approaches the bottom of the page as they scroll.

Usage

Add the infinite-scroll attribute to the element that you have applied angular-grid to specifying the method on your controller to execute as the user approaches the bottom of the angular grid. If angular grid is being scrolled within a div set to overflow scroll or auto, add the infinite-scroll-container attribute specifying the selector of the element being scrolled.

Example

<md-content id="content-scroller">
  <div
    class="cards-wrap"
    angular-grid="vm.shots"
    grid-width="300"
    gutter-size="12"

    angular-grid-id="shots"
    infinite-scroll-container="#content-scroller"
    infinite-scroll="vm.loadMoreShots()">
    <div class="card" ng-repeat="shot in vm.shots track by shot.id">
      [...]
    </div>
  </div>
</md-content>

Demo

{{::shot.title}}

          <md-progress-circular md-mode="indeterminate" md-diameter="64" class="progress-swatch"></md-progress-circular>

  </md-content>


text:
package org.dbflute.intro.app.logic.playsql.migration.info.ref;

import java.util.List;

/**
 * @author cabos
 */
public class PlaysqlMigrationCheckedZipReturn {

    // ===================================================================================
    //                                                                           Attribute
    //                                                                           =========
    private String fileName;
    private List<PlaysqlMigrationAlterSqlReturn> checkedSqlList;

    // ===================================================================================
    //                                                                         Constructor
    //                                                                         ===========
    public PlaysqlMigrationCheckedZipReturn(String fileName, List<PlaysqlMigrationAlterSqlReturn> checkedSqlList) {
        this.fileName = fileName;
        this.checkedSqlList = checkedSqlList;
    }

    // ===================================================================================
    //                                                                            Accessor
    //                                                                            ========
    public String getFileName() {
        return fileName;
    }

    public List<PlaysqlMigrationAlterSqlReturn> getCheckedSqlList() {
        return checkedSqlList;
    }
}


text:
package reseller.pages;

import net.serenitybdd.core.pages.WebElementFacade;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

/**
 * Created by rusu on 3/27/15.
 */
public class ModalAddCustomerOrg extends BasePage {

    /* Locator */
    private By insertOrganizationNameLocator = By.name("orgName");
    private By insertAddress1Locator = By.name("street1");
    private By insertAddress2Locator = By.name("street2");
    private By insertCityLocator = By.name("city");
    private By insertZipCodeLocator = By.name("zipCode");
    private By insertEmailLocator = By.name("email");
    private By insertFirstNameLocator = By.name("firstName");
    private By insertLastNameLocator = By.name("lastName");
    private By chooseAllowLocator = By.id("usadEnabledCheckBox");
    private By inviteCustomerButtonLocator = By.cssSelector("button.btt-add-customer");
    private By selectMarketSegmentLocator = By.name("marketSegment");
    private By selectCountryLocator = By.name("country");
    private By insertStateLocator = By.name("region");

    public ModalAddCustomerOrg(WebDriver driver) {
        super(driver);
    }

    /* WebElements */
    public WebElementFacade insertOrganizationName() {
        return find(insertOrganizationNameLocator);
    }

    public WebElementFacade insertAddress1() {
        return find(insertAddress1Locator);
    }

    public WebElementFacade insertAddress2() {
        return find(insertAddress2Locator);
    }

    public WebElementFacade insertCity() {
        return find(insertCityLocator);
    }

    public WebElementFacade insertState() {
        return find(insertStateLocator);
    }

    public WebElementFacade insertZipCode() {
        return find(insertZipCodeLocator);
    }

    public WebElementFacade insertEmail() {
        return find(insertEmailLocator);
    }

    public WebElementFacade insertFirstName() {
        return find(insertFirstNameLocator);
    }

    public WebElementFacade insertLastName() {
        return find(insertLastNameLocator);
    }

    public WebElementFacade chooseAllow() {
        return find(chooseAllowLocator);
    }

    public WebElementFacade inviteCustomerButton() {
        return find(inviteCustomerButtonLocator);
    }

    public WebElementFacade selectMarketSegment() {
        return find(selectMarketSegmentLocator);
    }

    public WebElementFacade selectCountry() {
        return find(selectCountryLocator);
    }

    /* Methods */
    public void setOrganizationName(String orgName) {
        insertOrganizationName().type(orgName);
    }

    public void setAddress1(String adr1) {
        insertAddress1().type(adr1);
    }

    public void setAddress2(String adr2) {
        insertAddress2().type(adr2);
    }

    public void setCity(String city) {
        insertCity().type(city);
    }

    public void setZipCode(String zipCode) {
        insertZipCode().type(zipCode);
    }

    public void setEmail(String email) {
        insertEmail().type(email);
    }

    public void setFirstName(String firstName) {
        insertFirstName().type(firstName);
    }

    public void setLastName(String lastName) {
        insertLastName().type(lastName);
    }

    public void setChooseAllow() {
        click_me(chooseAllow(), chooseAllowLocator);
    }

    public void clickInviteCustomerButton() {
        click_me(inviteCustomerButton(), inviteCustomerButtonLocator);
    }

    public void setSelectMarketSegment(int index) {
        selectMarketSegment().selectByIndex(index);
    }

    public void setCountry(int index) {
        selectCountry().selectByIndex(index);
    }

    public void setState(int indexState) {
        insertState().selectByIndex(indexState);
    }
}


text:
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.SubstationStandard.Enumerations;

namespace TTC2017.SmartGrids.SubstationStandard.Dataclasses
{

    /// <summary>
    /// The public interface for ValWithTrans
    /// </summary>
    [DefaultImplementationTypeAttribute(typeof(ValWithTrans))]
    [XmlDefaultImplementationTypeAttribute(typeof(ValWithTrans))]
    public interface IValWithTrans : IModelElement
    {

        /// <summary>
        /// The posVal property
        /// </summary>
        Nullable<int> PosVal
        {
            get;
            set;
        }

        /// <summary>
        /// The transInd property
        /// </summary>
        Nullable<bool> TransInd
        {
            get;
            set;
        }

        /// <summary>
        /// Gets fired before the PosVal property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> PosValChanging;

        /// <summary>
        /// Gets fired when the PosVal property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> PosValChanged;

        /// <summary>
        /// Gets fired before the TransInd property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> TransIndChanging;

        /// <summary>
        /// Gets fired when the TransInd property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> TransIndChanged;
    }
}


text:
package kubelet

import (
	"fmt"
	"testing"
	"time"

	cadvisorapiv2 "github.com/google/cadvisor/info/v2"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"k8s.io/kubernetes/pkg/client/record"
	cadvisortest "k8s.io/kubernetes/pkg/kubelet/cadvisor/testing"
	"k8s.io/kubernetes/pkg/kubelet/container"
	containertest "k8s.io/kubernetes/pkg/kubelet/container/testing"
	"k8s.io/kubernetes/pkg/util"
)

var zero time.Time

func newRealImageManager(policy ImageGCPolicy) (*realImageManager, *containertest.FakeRuntime, *cadvisortest.Mock) {
	fakeRuntime := &containertest.FakeRuntime{}
	mockCadvisor := new(cadvisortest.Mock)
	return &realImageManager{
		runtime:      fakeRuntime,
		policy:       policy,
		imageRecords: make(map[string]*imageRecord),
		cadvisor:     mockCadvisor,
		recorder:     &record.FakeRecorder{},
	}, fakeRuntime, mockCadvisor
}

// Accessors used for thread-safe testing.
func (im *realImageManager) imageRecordsLen() int {
	im.imageRecordsLock.Lock()
	defer im.imageRecordsLock.Unlock()
	return len(im.imageRecords)
}
func (im *realImageManager) getImageRecord(name string) (*imageRecord, bool) {
	im.imageRecordsLock.Lock()
	defer im.imageRecordsLock.Unlock()
	v, ok := im.imageRecords[name]
	vCopy := *v
	return &vCopy, ok
}

// Returns the name of the image with the given ID.
func imageName(id int) string {
	return fmt.Sprintf("image-%d", id)
}

// Make an image with the specified ID.
func makeImage(id int, size int64) container.Image {
	return container.Image{
		ID:   imageName(id),
		Size: size,
	}
}

// Make a container with the specified ID. It will use the image with the same ID.
func makeContainer(id int) *container.Container {
	return &container.Container{
		ID:    container.ContainerID{"test", fmt.Sprintf("container-%d", id)},
		Image: imageName(id),
	}
}

func TestDetectImagesInitialDetect(t *testing.T) {
	manager, fakeRuntime, _ := newRealImageManager(ImageGCPolicy{})
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		makeImage(1, 2048),
	}
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				makeContainer(1),
			},
		},
	}

	startTime := time.Now().Add(-time.Millisecond)
	err := manager.detectImages(zero)
	assert := assert.New(t)
	require.NoError(t, err)
	assert.Equal(manager.imageRecordsLen(), 2)
	noContainer, ok := manager.getImageRecord(imageName(0))
	require.True(t, ok)
	assert.Equal(zero, noContainer.firstDetected)
	assert.Equal(zero, noContainer.lastUsed)
	withContainer, ok := manager.getImageRecord(imageName(1))
	require.True(t, ok)
	assert.Equal(zero, withContainer.firstDetected)
	assert.True(withContainer.lastUsed.After(startTime))
}

func TestDetectImagesWithNewImage(t *testing.T) {
	// Just one image initially.
	manager, fakeRuntime, _ := newRealImageManager(ImageGCPolicy{})
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		makeImage(1, 2048),
	}
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				makeContainer(1),
			},
		},
	}

	err := manager.detectImages(zero)
	assert := assert.New(t)
	require.NoError(t, err)
	assert.Equal(manager.imageRecordsLen(), 2)

	// Add a new image.
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		makeImage(1, 1024),
		makeImage(2, 1024),
	}

	detectedTime := zero.Add(time.Second)
	startTime := time.Now().Add(-time.Millisecond)
	err = manager.detectImages(detectedTime)
	require.NoError(t, err)
	assert.Equal(manager.imageRecordsLen(), 3)
	noContainer, ok := manager.getImageRecord(imageName(0))
	require.True(t, ok)
	assert.Equal(zero, noContainer.firstDetected)
	assert.Equal(zero, noContainer.lastUsed)
	withContainer, ok := manager.getImageRecord(imageName(1))
	require.True(t, ok)
	assert.Equal(zero, withContainer.firstDetected)
	assert.True(withContainer.lastUsed.After(startTime))
	newContainer, ok := manager.getImageRecord(imageName(2))
	require.True(t, ok)
	assert.Equal(detectedTime, newContainer.firstDetected)
	assert.Equal(zero, noContainer.lastUsed)
}

func TestDetectImagesContainerStopped(t *testing.T) {
	manager, fakeRuntime, _ := newRealImageManager(ImageGCPolicy{})
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		makeImage(1, 2048),
	}
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				makeContainer(1),
			},
		},
	}

	err := manager.detectImages(zero)
	assert := assert.New(t)
	require.NoError(t, err)
	assert.Equal(manager.imageRecordsLen(), 2)
	withContainer, ok := manager.getImageRecord(imageName(1))
	require.True(t, ok)

	// Simulate container being stopped.
	fakeRuntime.AllPodList = []*container.Pod{}
	err = manager.detectImages(time.Now())
	require.NoError(t, err)
	assert.Equal(manager.imageRecordsLen(), 2)
	container1, ok := manager.getImageRecord(imageName(0))
	require.True(t, ok)
	assert.Equal(zero, container1.firstDetected)
	assert.Equal(zero, container1.lastUsed)
	container2, ok := manager.getImageRecord(imageName(1))
	require.True(t, ok)
	assert.Equal(zero, container2.firstDetected)
	assert.True(container2.lastUsed.Equal(withContainer.lastUsed))
}

func TestDetectImagesWithRemovedImages(t *testing.T) {
	manager, fakeRuntime, _ := newRealImageManager(ImageGCPolicy{})
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		makeImage(1, 2048),
	}
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				makeContainer(1),
			},
		},
	}

	err := manager.detectImages(zero)
	assert := assert.New(t)
	require.NoError(t, err)
	assert.Equal(manager.imageRecordsLen(), 2)

	// Simulate both images being removed.
	fakeRuntime.ImageList = []container.Image{}
	err = manager.detectImages(time.Now())
	require.NoError(t, err)
	assert.Equal(manager.imageRecordsLen(), 0)
}

func TestFreeSpaceImagesInUseContainersAreIgnored(t *testing.T) {
	manager, fakeRuntime, _ := newRealImageManager(ImageGCPolicy{})
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		makeImage(1, 2048),
	}
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				makeContainer(1),
			},
		},
	}

	spaceFreed, err := manager.freeSpace(2048, time.Now())
	assert := assert.New(t)
	require.NoError(t, err)
	assert.EqualValues(1024, spaceFreed)
	assert.Len(fakeRuntime.ImageList, 1)
}

func TestFreeSpaceRemoveByLeastRecentlyUsed(t *testing.T) {
	manager, fakeRuntime, _ := newRealImageManager(ImageGCPolicy{})
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		makeImage(1, 2048),
	}
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				makeContainer(0),
				makeContainer(1),
			},
		},
	}

	// Make 1 be more recently used than 0.
	require.NoError(t, manager.detectImages(zero))
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				makeContainer(1),
			},
		},
	}
	require.NoError(t, manager.detectImages(time.Now()))
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{},
		},
	}
	require.NoError(t, manager.detectImages(time.Now()))
	require.Equal(t, manager.imageRecordsLen(), 2)

	spaceFreed, err := manager.freeSpace(1024, time.Now())
	assert := assert.New(t)
	require.NoError(t, err)
	assert.EqualValues(1024, spaceFreed)
	assert.Len(fakeRuntime.ImageList, 1)
}

func TestFreeSpaceTiesBrokenByDetectedTime(t *testing.T) {
	manager, fakeRuntime, _ := newRealImageManager(ImageGCPolicy{})
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
	}
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				makeContainer(0),
			},
		},
	}

	// Make 1 more recently detected but used at the same time as 0.
	require.NoError(t, manager.detectImages(zero))
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		makeImage(1, 2048),
	}
	require.NoError(t, manager.detectImages(time.Now()))
	fakeRuntime.AllPodList = []*container.Pod{}
	require.NoError(t, manager.detectImages(time.Now()))
	require.Equal(t, manager.imageRecordsLen(), 2)

	spaceFreed, err := manager.freeSpace(1024, time.Now())
	assert := assert.New(t)
	require.NoError(t, err)
	assert.EqualValues(2048, spaceFreed)
	assert.Len(fakeRuntime.ImageList, 1)
}

func TestFreeSpaceImagesAlsoDoesLookupByRepoTags(t *testing.T) {
	manager, fakeRuntime, _ := newRealImageManager(ImageGCPolicy{})
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		{
			ID:       "5678",
			RepoTags: []string{"potato", "salad"},
			Size:     2048,
		},
	}
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				{
					ID:    container.ContainerID{"test", "c5678"},
					Image: "salad",
				},
			},
		},
	}

	spaceFreed, err := manager.freeSpace(1024, time.Now())
	assert := assert.New(t)
	require.NoError(t, err)
	assert.EqualValues(1024, spaceFreed)
	assert.Len(fakeRuntime.ImageList, 1)
}

func TestGarbageCollectBelowLowThreshold(t *testing.T) {
	policy := ImageGCPolicy{
		HighThresholdPercent: 90,
		LowThresholdPercent:  80,
	}
	manager, _, mockCadvisor := newRealImageManager(policy)

	// Expect 40% usage.
	mockCadvisor.On("DockerImagesFsInfo").Return(cadvisorapiv2.FsInfo{
		Usage:    400,
		Capacity: 1000,
	}, nil)

	assert.NoError(t, manager.GarbageCollect())
}

func TestGarbageCollectCadvisorFailure(t *testing.T) {
	policy := ImageGCPolicy{
		HighThresholdPercent: 90,
		LowThresholdPercent:  80,
	}
	manager, _, mockCadvisor := newRealImageManager(policy)

	mockCadvisor.On("DockerImagesFsInfo").Return(cadvisorapiv2.FsInfo{}, fmt.Errorf("error"))
	assert.NotNil(t, manager.GarbageCollect())
}

func TestGarbageCollectBelowSuccess(t *testing.T) {
	policy := ImageGCPolicy{
		HighThresholdPercent: 90,
		LowThresholdPercent:  80,
	}
	manager, fakeRuntime, mockCadvisor := newRealImageManager(policy)

	// Expect 95% usage and most of it gets freed.
	mockCadvisor.On("DockerImagesFsInfo").Return(cadvisorapiv2.FsInfo{
		Usage:    950,
		Capacity: 1000,
	}, nil)
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 450),
	}

	assert.NoError(t, manager.GarbageCollect())
}

func TestGarbageCollectNotEnoughFreed(t *testing.T) {
	policy := ImageGCPolicy{
		HighThresholdPercent: 90,
		LowThresholdPercent:  80,
	}
	manager, fakeRuntime, mockCadvisor := newRealImageManager(policy)

	// Expect 95% usage and little of it gets freed.
	mockCadvisor.On("DockerImagesFsInfo").Return(cadvisorapiv2.FsInfo{
		Usage:    950,
		Capacity: 1000,
	}, nil)
	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 50),
	}

	assert.NotNil(t, manager.GarbageCollect())
}

func TestGarbageCollectImageNotOldEnough(t *testing.T) {
	policy := ImageGCPolicy{
		HighThresholdPercent: 90,
		LowThresholdPercent:  80,
		MinAge:               time.Minute * 1,
	}
	fakeRuntime := &containertest.FakeRuntime{}
	mockCadvisor := new(cadvisortest.Mock)
	manager := &realImageManager{
		runtime:      fakeRuntime,
		policy:       policy,
		imageRecords: make(map[string]*imageRecord),
		cadvisor:     mockCadvisor,
		recorder:     &record.FakeRecorder{},
	}

	fakeRuntime.ImageList = []container.Image{
		makeImage(0, 1024),
		makeImage(1, 2048),
	}
	// 1 image is in use, and another one is not old enough
	fakeRuntime.AllPodList = []*container.Pod{
		{
			Containers: []*container.Container{
				makeContainer(1),
			},
		},
	}

	fakeClock := util.NewFakeClock(time.Now())
	t.Log(fakeClock.Now())
	require.NoError(t, manager.detectImages(fakeClock.Now()))
	require.Equal(t, manager.imageRecordsLen(), 2)
	// no space freed since one image is in used, and another one is not old enough
	spaceFreed, err := manager.freeSpace(1024, fakeClock.Now())
	assert := assert.New(t)
	require.NoError(t, err)
	assert.EqualValues(0, spaceFreed)
	assert.Len(fakeRuntime.ImageList, 2)

	// move clock by minAge duration, then 1 image will be garbage collected
	fakeClock.Step(policy.MinAge)
	spaceFreed, err = manager.freeSpace(1024, fakeClock.Now())
	require.NoError(t, err)
	assert.EqualValues(1024, spaceFreed)
	assert.Len(fakeRuntime.ImageList, 1)
}


text:
using Halforbit.DataStores.DocumentStores.CosmosDb.Implementation;
using Halforbit.DataStores.Tests;
using Halforbit.ObjectTools.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;

namespace Halforbit.DataStores.DocumentStores.CosmosDb.Tests
{
    public class CosmosDbDataStorePartitionedTests : UniversalIntegrationTest
    {
        protected override string ConfigPrefix => "Halforbit.DataStores.DocumentStores.CosmosDb.Tests.Partitioned.";

        [Fact, Trait("Type", "Integration")]
        public async Task TestCosmosDbPartitioned()
        {
            var testKey = new PartitionedTestValue.Key(
                partitionId: Guid.NewGuid(),
                accountId: Guid.NewGuid());

            var testValueA = new PartitionedTestValue(
                partitionId: testKey.PartitionId.Value,
                accountId: testKey.AccountId.Value,
                message: "Hello, world!");

            var testValueB = new PartitionedTestValue(
                partitionId: testKey.PartitionId.Value,
                accountId: testKey.AccountId.Value,
                message: "Kthx, world!");

            var dataStore = new CosmosDbDataStore<PartitionedTestValue.Key, PartitionedTestValue>(
                connectionString: GetConfig("ConnectionString"),
                databaseId: GetConfig("DatabaseId"),
                containerId: GetConfig("CollectionId"),
                keyMap: "{PartitionId}|test-values/{AccountId}");

            ClearDataStore(dataStore);

            TestDataStore(
                dataStore,
                testKey,
                testValueA,
                testValueB);

            TestQuery(dataStore);

            ClearDataStore(dataStore);

            await TestBatch(dataStore);
        }

        [Fact, Trait("Type", "Integration")]
        public async Task RunBulkApiTests()
        {
            var ds = new CosmosDbDataStore<PartitionedTestValue.Key, PartitionedTestValue>(
                connectionString: GetConfig("ConnectionString"),
                databaseId: GetConfig("DatabaseId"),
                containerId: GetConfig("CollectionId"),
                keyMap: "{PartitionId}|test-values/{AccountId}");

            ClearDataStore(ds);

            await TestBulkApi(ds,
                (keyGen, dataGen) =>
                {
                    var partitionId = (keyGen / 100).ToGuid();
                    var accountId = keyGen.ToGuid();

                    return new KeyValuePair<PartitionedTestValue.Key, PartitionedTestValue>(new PartitionedTestValue.Key(partitionId, accountId),
                        new PartitionedTestValue(partitionId, accountId, $"Test: {dataGen}"));
                });
        }

        static void TestQuery(IDataStore<PartitionedTestValue.Key, PartitionedTestValue> dataStore)
        {
            var values = new[]
            {
                new PartitionedTestValue(Guid.NewGuid(), Guid.NewGuid(), "abc"),

                new PartitionedTestValue(Guid.NewGuid(), Guid.NewGuid(), "bcd"),

                new PartitionedTestValue(Guid.NewGuid(), Guid.NewGuid(), "cde")
            };

            foreach (var value in values)
            {
                dataStore.Create(new PartitionedTestValue.Key(value.PartitionId, value.AccountId), value).Wait();
            }

            using (var session = dataStore.StartQuery())
            {
                var result = session.Query()
                    .Where(v => v.Message.Contains("b"))
                    .ToList();

                Assert.Equal(2, result.Count);

                var result2 = session
                    .Query(k => k.PartitionId == values[0].PartitionId)
                    .ToList();

                Assert.Single(result2);
            }

            ClearDataStore(dataStore);
        }

        static async Task TestBatch(
            IDataStore<PartitionedTestValue.Key, PartitionedTestValue> dataStore)
        {
            var allIds = Enumerable
                .Range(0, 1000)
                .Select(i => Guid.NewGuid())
                .ToList();

            var results = (await dataStore
                .BatchQuery(allIds, (b, q) => q.Where(r => b.Contains(r.AccountId))))
                .ToList();
        }
    }

    public class PartitionedTestValue : Document, IEquatable<PartitionedTestValue>
    {
        public PartitionedTestValue(
            Guid partitionId = default,
            Guid accountId = default,
            string message = default)
        {
            AccountId = accountId.OrNewGuidIfDefault();

            PartitionId = partitionId;

            Message = message;
        }

        public Guid PartitionId { get; }

        public Guid AccountId { get; }

        public string Message { get; }

        public bool Equals(
            PartitionedTestValue other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            return PartitionId.Equals(other.PartitionId) && AccountId.Equals(other.AccountId) && Message == other.Message;
        }

        public override bool Equals(
            object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != this.GetType())
            {
                return false;
            }

            return Equals((PartitionedTestValue) obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = PartitionId.GetHashCode();
                hashCode = (hashCode * 397) ^ AccountId.GetHashCode();
                hashCode = (hashCode * 397) ^ (Message != null ? Message.GetHashCode() : 0);
                return hashCode;
            }
        }

        public static bool operator ==(
            PartitionedTestValue left,
            PartitionedTestValue right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(
            PartitionedTestValue left,
            PartitionedTestValue right)
        {
            return !Equals(left, right);
        }

        public class Key : UniversalIntegrationTest.ITestKey, IEquatable<Key>
        {
            public Key(
                Guid? partitionId,
                Guid? accountId)
            {
                PartitionId = partitionId;

                AccountId = accountId;
            }

            public Guid? PartitionId { get; }

            public Guid? AccountId { get; }

            public bool Equals(
                Key other)
            {
                if (ReferenceEquals(null, other))
                {
                    return false;
                }

                if (ReferenceEquals(this, other))
                {
                    return true;
                }

                return Nullable.Equals(PartitionId, other.PartitionId) && Nullable.Equals(AccountId, other.AccountId);
            }

            public override bool Equals(
                object obj)
            {
                if (ReferenceEquals(null, obj))
                {
                    return false;
                }

                if (ReferenceEquals(this, obj))
                {
                    return true;
                }

                if (obj.GetType() != this.GetType())
                {
                    return false;
                }

                return Equals((Key) obj);
            }

            public override int GetHashCode()
            {
                unchecked
                {
                    return (PartitionId.GetHashCode() * 397) ^ AccountId.GetHashCode();
                }
            }

            public static bool operator ==(
                Key left,
                Key right)
            {
                return Equals(left, right);
            }

            public static bool operator !=(
                Key left,
                Key right)
            {
                return !Equals(left, right);
            }
        }
    }
}


text: require 'math_rocks/math_rocks'


text:
module.exports = function ({ gradients, variants }) {
  return function ({ addUtilities, e }) {
    const utilities = Object.keys(gradients).map((name) => {
      const [start, end] = gradients[name];

      return {
        [`.bg-gradient-${e(name)}`]: {
          backgroundImage: `linear-gradient(to right, ${start}, ${end})`
        }
      };
    });

    addUtilities(utilities, variants);
  };
};


text:
@protocol SellerInfoModel <NSObject>

@end

@interface SellerInfoModel : JSONModel

@property (nonatomic, copy) NSString *seller_id;    // 商户id
@property (nonatomic, copy) NSString *logo;         // 商户logo地址
@property (nonatomic, copy) NSString *name;         // 商户名称
@property (nonatomic, copy) NSString *url;          // 商户店铺地址

@end


text:
@extends('app')

@section('content')

{{ $channel->name }}

{{$site->url}} - {{$channel->public}}

{{ $channel->current_users() }}

{{ str_plural('Subscriber', $channel->current_users()) }}

{{ $channel->max_connections }}

Max Connections

{{ $channel->events_fired() }}

{{ str_plural('Event', $channel->events_fired()) }} Fired

{{ ucwords($channel->refreshes) }}

Auto Refreshes

			id}}/channels/{{$channel->id}}/regenerate" class="btn btn-warning btn-block swal">Regenerate Token

			id}}/channels/{{$channel->id}}/toggle" class="btn btn-warning btn-block swal">Toggle Auto-refresh

		@if($channel->name !== 'public')

				id}}/channels/{{$channel->id}}/delete" class="btn btn-danger btn-block swal">Delete Channel

		@endif

			id}}/channels">Back to Channel Management

@endsection

@section('javascript')
	@parent

@endsection


text:
// @generated
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: src/com/facebook/buck/remoteexecution/proto/metadata.proto

package com.facebook.buck.remoteexecution.proto;

/**
 *

 * Information about the job that generated an action. Unknown fields can simply be left empty.
 *

 *
 * Protobuf type {@code facebook.remote_execution.ClientJobInfo}
 */
@javax.annotation.Generated(value="protoc", comments="annotations:ClientJobInfo.java.pb.meta")
public  final class ClientJobInfo extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:facebook.remote_execution.ClientJobInfo)
    ClientJobInfoOrBuilder {
private static final long serialVersionUID = 0L;
  // Use ClientJobInfo.newBuilder() to construct.
  private ClientJobInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private ClientJobInfo() {
    deploymentStage_ = "";
    instanceId_ = "";
    groupId_ = "";
    clientSideTenant_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private ClientJobInfo(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            deploymentStage_ = s;
            break;
          }
          case 18: {
            java.lang.String s = input.readStringRequireUtf8();

            instanceId_ = s;
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();

            groupId_ = s;
            break;
          }
          case 34: {
            java.lang.String s = input.readStringRequireUtf8();

            clientSideTenant_ = s;
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.facebook.buck.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_ClientJobInfo_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.facebook.buck.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_ClientJobInfo_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.facebook.buck.remoteexecution.proto.ClientJobInfo.class, com.facebook.buck.remoteexecution.proto.ClientJobInfo.Builder.class);
  }

  public static final int DEPLOYMENT_STAGE_FIELD_NUMBER = 1;
  private volatile java.lang.Object deploymentStage_;
  /**
   *

   * Deployment stage of the job producing this action (e.g. prod).
   *

   *
   * string deployment_stage = 1;
   */
  public java.lang.String getDeploymentStage() {
    java.lang.Object ref = deploymentStage_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      deploymentStage_ = s;
      return s;
    }
  }
  /**
   *

   * Deployment stage of the job producing this action (e.g. prod).
   *

   *
   * string deployment_stage = 1;
   */
  public com.google.protobuf.ByteString
      getDeploymentStageBytes() {
    java.lang.Object ref = deploymentStage_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      deploymentStage_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int INSTANCE_ID_FIELD_NUMBER = 2;
  private volatile java.lang.Object instanceId_;
  /**
   *

   * Job identifier.
   *

   *
   * string instance_id = 2;
   */
  public java.lang.String getInstanceId() {
    java.lang.Object ref = instanceId_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      instanceId_ = s;
      return s;
    }
  }
  /**
   *

   * Job identifier.
   *

   *
   * string instance_id = 2;
   */
  public com.google.protobuf.ByteString
      getInstanceIdBytes() {
    java.lang.Object ref = instanceId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      instanceId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int GROUP_ID_FIELD_NUMBER = 3;
  private volatile java.lang.Object groupId_;
  /**
   *

   * Job group identifier (aka nonce), if it's part of group of jobs.
   *

   *
   * string group_id = 3;
   */
  public java.lang.String getGroupId() {
    java.lang.Object ref = groupId_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      groupId_ = s;
      return s;
    }
  }
  /**
   *

   * Job group identifier (aka nonce), if it's part of group of jobs.
   *

   *
   * string group_id = 3;
   */
  public com.google.protobuf.ByteString
      getGroupIdBytes() {
    java.lang.Object ref = groupId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      groupId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CLIENT_SIDE_TENANT_FIELD_NUMBER = 4;
  private volatile java.lang.Object clientSideTenant_;
  /**
   *

   * Job tenant.
   *

   *
   * string client_side_tenant = 4;
   */
  public java.lang.String getClientSideTenant() {
    java.lang.Object ref = clientSideTenant_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      clientSideTenant_ = s;
      return s;
    }
  }
  /**
   *

   * Job tenant.
   *

   *
   * string client_side_tenant = 4;
   */
  public com.google.protobuf.ByteString
      getClientSideTenantBytes() {
    java.lang.Object ref = clientSideTenant_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      clientSideTenant_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getDeploymentStageBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deploymentStage_);
    }
    if (!getInstanceIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_);
    }
    if (!getGroupIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, groupId_);
    }
    if (!getClientSideTenantBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, clientSideTenant_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getDeploymentStageBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, deploymentStage_);
    }
    if (!getInstanceIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_);
    }
    if (!getGroupIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, groupId_);
    }
    if (!getClientSideTenantBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, clientSideTenant_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.facebook.buck.remoteexecution.proto.ClientJobInfo)) {
      return super.equals(obj);
    }
    com.facebook.buck.remoteexecution.proto.ClientJobInfo other = (com.facebook.buck.remoteexecution.proto.ClientJobInfo) obj;

    if (!getDeploymentStage()
        .equals(other.getDeploymentStage())) return false;
    if (!getInstanceId()
        .equals(other.getInstanceId())) return false;
    if (!getGroupId()
        .equals(other.getGroupId())) return false;
    if (!getClientSideTenant()
        .equals(other.getClientSideTenant())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + DEPLOYMENT_STAGE_FIELD_NUMBER;
    hash = (53 * hash) + getDeploymentStage().hashCode();
    hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER;
    hash = (53 * hash) + getInstanceId().hashCode();
    hash = (37 * hash) + GROUP_ID_FIELD_NUMBER;
    hash = (53 * hash) + getGroupId().hashCode();
    hash = (37 * hash) + CLIENT_SIDE_TENANT_FIELD_NUMBER;
    hash = (53 * hash) + getClientSideTenant().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.facebook.buck.remoteexecution.proto.ClientJobInfo prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *

   * Information about the job that generated an action. Unknown fields can simply be left empty.
   *

   *
   * Protobuf type {@code facebook.remote_execution.ClientJobInfo}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:facebook.remote_execution.ClientJobInfo)
      com.facebook.buck.remoteexecution.proto.ClientJobInfoOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.facebook.buck.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_ClientJobInfo_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.facebook.buck.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_ClientJobInfo_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.facebook.buck.remoteexecution.proto.ClientJobInfo.class, com.facebook.buck.remoteexecution.proto.ClientJobInfo.Builder.class);
    }

    // Construct using com.facebook.buck.remoteexecution.proto.ClientJobInfo.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      deploymentStage_ = "";

      instanceId_ = "";

      groupId_ = "";

      clientSideTenant_ = "";

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.facebook.buck.remoteexecution.proto.RemoteExecutionMetadataProto.internal_static_facebook_remote_execution_ClientJobInfo_descriptor;
    }

    @java.lang.Override
    public com.facebook.buck.remoteexecution.proto.ClientJobInfo getDefaultInstanceForType() {
      return com.facebook.buck.remoteexecution.proto.ClientJobInfo.getDefaultInstance();
    }

    @java.lang.Override
    public com.facebook.buck.remoteexecution.proto.ClientJobInfo build() {
      com.facebook.buck.remoteexecution.proto.ClientJobInfo result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.facebook.buck.remoteexecution.proto.ClientJobInfo buildPartial() {
      com.facebook.buck.remoteexecution.proto.ClientJobInfo result = new com.facebook.buck.remoteexecution.proto.ClientJobInfo(this);
      result.deploymentStage_ = deploymentStage_;
      result.instanceId_ = instanceId_;
      result.groupId_ = groupId_;
      result.clientSideTenant_ = clientSideTenant_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.facebook.buck.remoteexecution.proto.ClientJobInfo) {
        return mergeFrom((com.facebook.buck.remoteexecution.proto.ClientJobInfo)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.facebook.buck.remoteexecution.proto.ClientJobInfo other) {
      if (other == com.facebook.buck.remoteexecution.proto.ClientJobInfo.getDefaultInstance()) return this;
      if (!other.getDeploymentStage().isEmpty()) {
        deploymentStage_ = other.deploymentStage_;
        onChanged();
      }
      if (!other.getInstanceId().isEmpty()) {
        instanceId_ = other.instanceId_;
        onChanged();
      }
      if (!other.getGroupId().isEmpty()) {
        groupId_ = other.groupId_;
        onChanged();
      }
      if (!other.getClientSideTenant().isEmpty()) {
        clientSideTenant_ = other.clientSideTenant_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.facebook.buck.remoteexecution.proto.ClientJobInfo parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.facebook.buck.remoteexecution.proto.ClientJobInfo) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object deploymentStage_ = "";
    /**
     *

     * Deployment stage of the job producing this action (e.g. prod).
     *

     *
     * string deployment_stage = 1;
     */
    public java.lang.String getDeploymentStage() {
      java.lang.Object ref = deploymentStage_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deploymentStage_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * Deployment stage of the job producing this action (e.g. prod).
     *

     *
     * string deployment_stage = 1;
     */
    public com.google.protobuf.ByteString
        getDeploymentStageBytes() {
      java.lang.Object ref = deploymentStage_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        deploymentStage_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * Deployment stage of the job producing this action (e.g. prod).
     *

     *
     * string deployment_stage = 1;
     */
    public Builder setDeploymentStage(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

      deploymentStage_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Deployment stage of the job producing this action (e.g. prod).
     *

     *
     * string deployment_stage = 1;
     */
    public Builder clearDeploymentStage() {

      deploymentStage_ = getDefaultInstance().getDeploymentStage();
      onChanged();
      return this;
    }
    /**
     *

     * Deployment stage of the job producing this action (e.g. prod).
     *

     *
     * string deployment_stage = 1;
     */
    public Builder setDeploymentStageBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      deploymentStage_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object instanceId_ = "";
    /**
     *

     * Job identifier.
     *

     *
     * string instance_id = 2;
     */
    public java.lang.String getInstanceId() {
      java.lang.Object ref = instanceId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        instanceId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * Job identifier.
     *

     *
     * string instance_id = 2;
     */
    public com.google.protobuf.ByteString
        getInstanceIdBytes() {
      java.lang.Object ref = instanceId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        instanceId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * Job identifier.
     *

     *
     * string instance_id = 2;
     */
    public Builder setInstanceId(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

      instanceId_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Job identifier.
     *

     *
     * string instance_id = 2;
     */
    public Builder clearInstanceId() {

      instanceId_ = getDefaultInstance().getInstanceId();
      onChanged();
      return this;
    }
    /**
     *

     * Job identifier.
     *

     *
     * string instance_id = 2;
     */
    public Builder setInstanceIdBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      instanceId_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object groupId_ = "";
    /**
     *

     * Job group identifier (aka nonce), if it's part of group of jobs.
     *

     *
     * string group_id = 3;
     */
    public java.lang.String getGroupId() {
      java.lang.Object ref = groupId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        groupId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * Job group identifier (aka nonce), if it's part of group of jobs.
     *

     *
     * string group_id = 3;
     */
    public com.google.protobuf.ByteString
        getGroupIdBytes() {
      java.lang.Object ref = groupId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        groupId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * Job group identifier (aka nonce), if it's part of group of jobs.
     *

     *
     * string group_id = 3;
     */
    public Builder setGroupId(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

      groupId_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Job group identifier (aka nonce), if it's part of group of jobs.
     *

     *
     * string group_id = 3;
     */
    public Builder clearGroupId() {

      groupId_ = getDefaultInstance().getGroupId();
      onChanged();
      return this;
    }
    /**
     *

     * Job group identifier (aka nonce), if it's part of group of jobs.
     *

     *
     * string group_id = 3;
     */
    public Builder setGroupIdBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      groupId_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object clientSideTenant_ = "";
    /**
     *

     * Job tenant.
     *

     *
     * string client_side_tenant = 4;
     */
    public java.lang.String getClientSideTenant() {
      java.lang.Object ref = clientSideTenant_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        clientSideTenant_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * Job tenant.
     *

     *
     * string client_side_tenant = 4;
     */
    public com.google.protobuf.ByteString
        getClientSideTenantBytes() {
      java.lang.Object ref = clientSideTenant_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        clientSideTenant_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * Job tenant.
     *

     *
     * string client_side_tenant = 4;
     */
    public Builder setClientSideTenant(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

      clientSideTenant_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Job tenant.
     *

     *
     * string client_side_tenant = 4;
     */
    public Builder clearClientSideTenant() {

      clientSideTenant_ = getDefaultInstance().getClientSideTenant();
      onChanged();
      return this;
    }
    /**
     *

     * Job tenant.
     *

     *
     * string client_side_tenant = 4;
     */
    public Builder setClientSideTenantBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      clientSideTenant_ = value;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:facebook.remote_execution.ClientJobInfo)
  }

  // @@protoc_insertion_point(class_scope:facebook.remote_execution.ClientJobInfo)
  private static final com.facebook.buck.remoteexecution.proto.ClientJobInfo DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.facebook.buck.remoteexecution.proto.ClientJobInfo();
  }

  public static com.facebook.buck.remoteexecution.proto.ClientJobInfo getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ClientJobInfo>
      PARSER = new com.google.protobuf.AbstractParser<ClientJobInfo>() {
    @java.lang.Override
    public ClientJobInfo parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new ClientJobInfo(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<ClientJobInfo> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ClientJobInfo> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.facebook.buck.remoteexecution.proto.ClientJobInfo getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Approve.EntityBase;
using System.Drawing;
using System.Linq;
using ProjectData;
using ProjectBLL;
using System.Data;
using Approve.RuleCenter;
using System.Text;
using System.Collections;

public partial class audit_XM_qyBadCF : System.Web.UI.Page
{
    RCenter rc = new RCenter(); Share sh = new Share();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ShowInfo();
        }
    }
    private void ShowInfo()
    {
        string sql = "select * from demo_qy_localChuFaRecord where 1=1 ";
        this.Pager1.className = "dbShare";
        this.Pager1.sql = sql;
        this.Pager1.pagecount = 20;
        this.Pager1.controltopage = "DG_List";
        this.Pager1.controltype = "DataGrid";
        this.Pager1.dataBind();
    }

    protected void DG_List_ItemDataBound(object sender, DataGridItemEventArgs e)
    {
        if (e.Item.ItemIndex > -1)
        {
            string spid = EConvert.ToString(DataBinder.Eval(e.Item.DataItem, "id"));
            e.Item.Cells[0].Text = (e.Item.ItemIndex + 1 + this.Pager1.pagecount * (this.Pager1.curpage - 1)).ToString();

            e.Item.Cells[3].Text = "" + e.Item.Cells[3].Text + "";
        }
    }
}


text:
package com.bj58.spat.gaea.server.deploy.bytecode;

public class TestEntity {

	private int id;

	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}
}


text:
package org.apache.mahout.classifier.sgd;

import org.apache.commons.cli2.CommandLine;
import org.apache.commons.cli2.Group;
import org.apache.commons.cli2.Option;
import org.apache.commons.cli2.builder.ArgumentBuilder;
import org.apache.commons.cli2.builder.DefaultOptionBuilder;
import org.apache.commons.cli2.builder.GroupBuilder;
import org.apache.commons.cli2.commandline.Parser;
import org.apache.commons.cli2.util.HelpFormatter;
import org.apache.mahout.classifier.sgd.AdaptiveLogisticRegression.Wrapper;
import org.apache.mahout.ep.State;
import org.apache.mahout.math.SequentialAccessSparseVector;
import org.apache.mahout.math.Vector;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

public final class RunAdaptiveLogistic {

  private static String inputFile;
  private static String modelFile;
  private static String outputFile;
  private static String idColumn;
  private static boolean maxScoreOnly;

  private RunAdaptiveLogistic() {
  }

  public static void main(String[] args) throws Exception {
    mainToOutput(args, new PrintWriter(System.out, true));
  }

  static void mainToOutput(String[] args, PrintWriter output) throws Exception {
    if (!parseArgs(args)) {
      return;
    }
    AdaptiveLogisticModelParameters lmp = AdaptiveLogisticModelParameters
        .loadFromFile(new File(modelFile));

    CsvRecordFactory csv = lmp.getCsvRecordFactory();
    csv.setIdName(idColumn);

    AdaptiveLogisticRegression lr = lmp.createAdaptiveLogisticRegression();

    State<Wrapper, CrossFoldLearner> best = lr.getBest();
    if (best == null) {
      output.printf("%s\n",
          "AdaptiveLogisticRegression has not be trained probably.");
      return;
    }
    CrossFoldLearner learner = best.getPayload().getLearner();

    BufferedReader in = TrainAdaptiveLogistic.open(inputFile);
    BufferedWriter out = new BufferedWriter(new FileWriter(outputFile));

    out.write(idColumn + ",target,score");
    out.newLine();

    String line = in.readLine();
    csv.firstLine(line);
    line = in.readLine();
    Map<String, Double> results = new HashMap<String, Double>();
    int k = 0;
    while (line != null) {
      Vector v = new SequentialAccessSparseVector(lmp.getNumFeatures());
      csv.processLine(line, v, false);
      Vector scores = learner.classifyFull(v);
      results.clear();
      if (maxScoreOnly) {
        results.put(csv.getTargetLabel(scores.maxValueIndex()),
            scores.maxValue());
      } else {
        for (int i = 0; i < scores.size(); i++) {
          results.put(csv.getTargetLabel(i), scores.get(i));
        }
      }

      for (Map.Entry<String,Double> entry : results.entrySet()) {
        out.write(csv.getIdString(line) + ',' + entry.getKey() + ',' + entry.getValue());
        out.newLine();
      }
      k++;
      if (k % 100 == 0) {
        output.printf(Locale.ENGLISH, "%d records processed \n", k);
      }
      line = in.readLine();
    }
    out.flush();
    out.close();
    output.printf(Locale.ENGLISH, "%d records processed totally.\n", k);
  }

  private static boolean parseArgs(String[] args) {
    DefaultOptionBuilder builder = new DefaultOptionBuilder();

    Option help = builder.withLongName("help")
      .withDescription("print this list").create();

    Option quiet = builder.withLongName("quiet")
      .withDescription("be extra quiet").create();

    ArgumentBuilder argumentBuilder = new ArgumentBuilder();
    Option inputFileOption = builder
      .withLongName("input")
      .withRequired(true)
      .withArgument(
          argumentBuilder.withName("input").withMaximum(1)
            .create())
      .withDescription("where to get training data").create();

    Option modelFileOption = builder
      .withLongName("model")
      .withRequired(true)
      .withArgument(
          argumentBuilder.withName("model").withMaximum(1)
            .create())
      .withDescription("where to get the trained model").create();

    Option outputFileOption = builder
      .withLongName("output")
      .withRequired(true)
      .withDescription("the file path to output scores")
      .withArgument(argumentBuilder.withName("output").withMaximum(1).create())
      .create();

    Option idColumnOption = builder
      .withLongName("idcolumn")
      .withRequired(true)
      .withDescription("the name of the id column for each record")
      .withArgument(argumentBuilder.withName("idcolumn").withMaximum(1).create())
      .create();

    Option maxScoreOnlyOption = builder
      .withLongName("maxscoreonly")
      .withDescription("only output the target label with max scores")
      .create();

    Group normalArgs = new GroupBuilder()
      .withOption(help).withOption(quiet)
      .withOption(inputFileOption).withOption(modelFileOption)
      .withOption(outputFileOption).withOption(idColumnOption)
      .withOption(maxScoreOnlyOption)
      .create();

    Parser parser = new Parser();
    parser.setHelpOption(help);
    parser.setHelpTrigger("--help");
    parser.setGroup(normalArgs);
    parser.setHelpFormatter(new HelpFormatter(" ", "", " ", 130));
    CommandLine cmdLine = parser.parseAndHelp(args);

    if (cmdLine == null) {
      return false;
    }

    inputFile = getStringArgument(cmdLine, inputFileOption);
    modelFile = getStringArgument(cmdLine, modelFileOption);
    outputFile = getStringArgument(cmdLine, outputFileOption);
    idColumn = getStringArgument(cmdLine, idColumnOption);
    maxScoreOnly = getBooleanArgument(cmdLine, maxScoreOnlyOption);
    return true;
  }

  private static boolean getBooleanArgument(CommandLine cmdLine, Option option) {
    return cmdLine.hasOption(option);
  }

  private static String getStringArgument(CommandLine cmdLine, Option inputFile) {
    return (String) cmdLine.getValue(inputFile);
  }

}


text:
package cmd

import (
	bosherr "github.com/cloudfoundry/bosh-utils/errors"

	boshdir "github.com/cloudfoundry/bosh-cli/director"
	boshtpl "github.com/cloudfoundry/bosh-cli/director/template"
	boshui "github.com/cloudfoundry/bosh-cli/ui"
)

type DeployCmd struct {
	ui              boshui.UI
	deployment      boshdir.Deployment
	releaseUploader ReleaseUploader
}

type ReleaseUploader interface {
	UploadReleases([]byte) ([]byte, error)
}

func NewDeployCmd(
	ui boshui.UI,
	deployment boshdir.Deployment,
	releaseUploader ReleaseUploader,
) DeployCmd {
	return DeployCmd{ui, deployment, releaseUploader}
}

func (c DeployCmd) Run(opts DeployOpts) error {
	tpl := boshtpl.NewTemplate(opts.Args.Manifest.Bytes)

	bytes, err := tpl.Evaluate(opts.VarFlags.AsVariables(), opts.OpsFlags.AsOp(), boshtpl.EvaluateOpts{})
	if err != nil {
		return bosherr.WrapErrorf(err, "Evaluating manifest")
	}

	err = c.checkDeploymentName(bytes)
	if err != nil {
		return err
	}

	bytes, err = c.releaseUploader.UploadReleases(bytes)
	if err != nil {
		return err
	}

	deploymentDiff, err := c.deployment.Diff(bytes, opts.NoRedact)
	if err != nil {
		return err
	}

	diff := NewDiff(deploymentDiff.Diff)
	diff.Print(c.ui)

	err = c.ui.AskForConfirmation()
	if err != nil {
		return err
	}

	updateOpts := boshdir.UpdateOpts{
		RecreatePersistentDisks: opts.RecreatePersistentDisks,
		Recreate:                opts.Recreate,
		Fix:                     opts.Fix,
		SkipDrain:               opts.SkipDrain,
		DryRun:                  opts.DryRun,
		Canaries:                opts.Canaries,
		MaxInFlight:             opts.MaxInFlight,
		Diff:                    deploymentDiff,
	}

	return c.deployment.Update(bytes, updateOpts)
}

func (c DeployCmd) checkDeploymentName(bytes []byte) error {
	manifest, err := boshdir.NewManifestFromBytes(bytes)
	if err != nil {
		return bosherr.WrapErrorf(err, "Parsing manifest")
	}

	if manifest.Name != c.deployment.Name() {
		errMsg := "Expected manifest to specify deployment name '%s' but was '%s'"
		return bosherr.Errorf(errMsg, c.deployment.Name(), manifest.Name)
	}

	return nil
}


text:
package com.jetbrains.python.debugger.pydev;

import com.jetbrains.python.console.pydev.PydevCompletionVariant;
import com.jetbrains.python.debugger.PyDebuggerException;
import com.jetbrains.python.debugger.PydevXmlUtils;
import org.jetbrains.annotations.NotNull;

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

public class GetCompletionsCommand extends AbstractFrameCommand {

  private final String myActionToken;
  private List<PydevCompletionVariant> myCompletions = null;

  public GetCompletionsCommand(final RemoteDebugger debugger,
                               String threadId,
                               String frameId,
                               final String myActionToken) {
    super(debugger, GET_COMPLETIONS, threadId, frameId);
    this.myActionToken = myActionToken;
  }

  @Override
  public boolean isResponseExpected() {
    return true;
  }

  @Override
  protected long getResponseTimeout() {
    return RemoteDebugger.SHORT_TIMEOUT;
  }

  @Override
  protected void processResponse(@NotNull ProtocolFrame response) throws PyDebuggerException {
    super.processResponse(response);
    try {
      myCompletions = PydevXmlUtils.xmlToCompletions(response.getPayload(), myActionToken);
    }
    catch (Exception e) {
      throw new PyDebuggerException("cant obtain completions", e);
    }
  }

  @Override
  protected void buildPayload(Payload payload) {
    super.buildPayload(payload);
    payload.add("FRAME").add(myActionToken);
  }

  @NotNull
  public List<PydevCompletionVariant> getCompletions() {
    if (myCompletions != null) {
      return myCompletions;
    }
    else {
      return new ArrayList<>();
    }
  }
}


text:
@interface ToastViewController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, copy) NSArray *dataSource;

@end

@implementation ToastViewController

#pragma mark - lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];

    [self.view addSubview:self.tableView];
}

- (void)viewWillLayoutSubviews
{
    [super viewWillLayoutSubviews];

    self.tableView.frame = self.view.frame;
}

#pragma mark - UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.dataSource.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *reuseIdentifier = @"UITableViewCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    }
    cell.textLabel.text = self.dataSource[indexPath.row];
    return cell;
}

#pragma mark - UITableViewDelegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

    NSString *message = @"3秒后消失";

    if (0 == indexPath.row)
    {
        [self zb_showWithMessage:message];
    }
    else if (1 == indexPath.row)
    {
        message = @"无网络连接";
        [self zb_showNoNetworkWithMessage:message];
    }
    else if (2 == indexPath.row)
    {
        [self zb_showSuccessWithMessage:message];
    }
    else if (3 == indexPath.row)
    {
        [self zb_showErrorWithMessage:message];
    }
    else if (4 == indexPath.row)
    {
        [self zb_showWarningWithMessage:message];
    }
}

#pragma mark - super

- (NSString *)title
{
    return NSStringFromClass(self.class);
}

#pragma mark - getter

- (UITableView *)tableView
{
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
        _tableView.backgroundColor = [UIColor clearColor];
        _tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectZero];
        _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _tableView.dataSource = self;
        _tableView.delegate = self;
    }
    return _tableView;
}

- (NSArray *)dataSource
{
    if (!_dataSource) {
        _dataSource = @[@"only message",
                        @"no network image and message",
                        @"success image and message",
                        @"error image and message",
                        @"warning image and message"];
    }
    return _dataSource;
}

@end


text:
package freja.di.config.empty;

import freja.di.Configuration;
import freja.di.Container;

/**
 * ‰½'às'í'È'¢ Configuration ƒIƒuƒWƒFƒNƒg'Å'·B
 * @author SiroKuro
 */
public class EmptyConfiguration implements Configuration {
	/**
	 * EmptyConfiguration '̃Cƒ"ƒXƒ^ƒ"ƒX'Å'·B
	 */
	public static final EmptyConfiguration INSTANCE = new EmptyConfiguration();

	protected EmptyConfiguration() {
		;
	}

	/**
	 * ‰½'às'¢'Ü'¹'ñB
	 */
	@Override
	public void config(Container container) {
		;
	}
}


text:
package taip.commons.security;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * Authorisation information.
 *
 * @author Laura Asoltanei <laura.asoltanei@gmail.com>
 */
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
@XmlRootElement(name = "authorisation")
public class Authorisation {
    /**
     * User name.
     */
    private String username = "";
    /**
     * List of roles.
     */
    private List<String> roles = new ArrayList<String>();

    /**
     * Default constructor.
     */
    public Authorisation() {
    }

    /**
     * Set username and roles.
     *
     * @param username Username
     * @param roles    Roles
     */
    public Authorisation(String username, List<String> roles) {
        this.username = username;
        safeSetRoles(roles);
    }

    /**
     * Set username and roles.
     *
     * @param username Username
     * @param roles    Roles
     */
    public Authorisation(String username, Set<String> roles) {
        this.username = username;
        safeSetRoles(roles);
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public List<String> getRoles() {
        return roles;
    }

    /**
     * Set roles and initialise the member with empty array in case of param 'null'.
     *
     * @param roles List of roles.
     */
    public void setRoles(List<String> roles) {
        safeSetRoles(roles);
    }

    /**
     * Set roles and initialise the member with empty array in case of param
     * null.
     *
     * @param roles List of roles.
     */
    public void setRoles(Set<String> roles) {
        safeSetRoles(roles);
    }

    /**
     * Convenience method for adding roles.
     *
     * @param roles List of roles
     */
    protected final void safeSetRoles(List<String> roles) {
        this.roles = roles == null ? new ArrayList<String>() : roles;
    }

    /**
     * Convenience method for adding roles.
     *
     * @param roles Set of roles
     */
    protected final void safeSetRoles(Set<String> roles) {
        this.roles.clear();
        if (roles != null) {
            this.roles.addAll(roles);
        }
    }
}


text:
from django.test import TestCase
from django.contrib.gis import geos

from spillway.query import GeoQuerySet
from .models import Location

class GeoQuerySetTestCase(TestCase):
    def setUp(self):
        self.srid = 3857
        # Simplification tolerance in meters for EPSG 3857.
        self.tol = 10000
        # Buffer radius in degrees for EPSG 4326.
        self.radius = 2
        Location.add_buffer((0, 0), self.radius)
        self.qs = Location.objects.all()

    def test_extent(self):
        ex = self.qs.extent(self.srid)
        self.assertEqual(len(ex), 4)
        self.assertLess(ex[0], -180)

    def test_filter_geometry(self):
        qs = self.qs.filter_geometry(contains=self.qs[0].geom.centroid)
        self.assertEqual(qs.count(), 1)

    def test_scale(self):
        sqs = self.qs.scale(0.5, 0.5, format='wkt')
        for obj, source in zip(sqs, self.qs):
            geom = geos.GEOSGeometry(obj.wkt)
            self.assertLess(geom.area, source.geom.area)

    def test_simplify(self):
        sqs = self.qs.all().simplify(self.radius)
        for obj, source in zip(sqs, self.qs):
            self.assertNotEqual(obj.geom, source.geom)
            self.assertLess(obj.geom.num_coords, source.geom.num_coords)

    def test_simplify_transform(self):
        sqs = self.qs.all().simplify(srid=self.srid)
        self.assertNotEqual(sqs[0].geom, self.qs[0].geom)
        self.assertNotEqual(sqs[0].geom.srid, self.qs[0].geom.srid)
        self.assertEqual(sqs[0].geom.srid, self.srid)

    def test_simplify_geojson(self):
        sqs = self.qs.simplify(self.tol, srid=self.srid,
                               format='geojson', precision=2)
        geom = geos.GEOSGeometry(sqs[0].geojson, self.srid)
        source = self.qs[0].geom
        self.assertNotEqual(geom, source)
        self.assertEqual(geom.srid, source.srid)
        self.assertLess(geom.num_coords, source.num_coords)

    def test_simplify_kml(self):
        sqs = self.qs.simplify(self.radius, format='kml')
        self.assertTrue(sqs[0].kml.startswith('<Polygon>'))
        self.assertNotIn('<coordinates></coordinates>', sqs[0].kml)
        self.assertXMLNotEqual(sqs[0].kml, self.qs[0].geom.kml)

    def test_transform(self):
        sql = self.qs._transform(self.srid)
        col = '"%s"."%s"' % (self.qs.model._meta.db_table,
                             self.qs.geo_field.column)
        expected = 'Transform(%s, %s)' % (col, self.srid)
        self.assertEqual(sql, expected)
        self.assertEqual(self.qs.query.get_context('transformed_srid'),
                         self.srid)