text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.uniandes.csw.turism.tests.rest;

import co.edu.uniandes.csw.auth.model.UserDTO;
import co.edu.uniandes.csw.auth.security.JWT;
import co.edu.uniandes.csw.turism.dtos.minimum.PaymentMethodDTO;
import co.edu.uniandes.csw.turism.entities.ClientEntity;
import co.edu.uniandes.csw.turism.entities.PaymentMethodEntity;
import co.edu.uniandes.csw.turism.resources.PaymentMethodResource;
import co.edu.uniandes.csw.turism.tests.Utils;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.UserTransaction;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Cookie;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.codehaus.jackson.map.ObjectMapper;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import uk.co.jemos.podam.api.PodamFactory;
import uk.co.jemos.podam.api.PodamFactoryImpl;

/**
 *
 * @author jd.cepeda
 */
@RunWith(Arquillian.class)
public class PaymentMethodTest {

    private WebTarget target;
    private final String apiPath = Utils.apiPath;
    private final String username = Utils.username;
    private final String password = Utils.password;
    PodamFactory factory = new PodamFactoryImpl();

    private final int ok = Response.Status.OK.getStatusCode();
    private final int created = Response.Status.CREATED.getStatusCode();
    private final int okWithoutContent = Response.Status.NO_CONTENT.getStatusCode();

    private final static List<PaymentMethodEntity> ORACULO = new ArrayList<>();

    private final String clientPath = "clients";
    private final String paymentMethodPath = "paymentMethods";

    ClientEntity fatherClientEntity;

    @ArquillianResource
    private URL deploymentURL;

    @Deployment
    public static WebArchive createDeployment() {
        return ShrinkWrap.create(WebArchive.class)
                // Se agrega las dependencias
                .addAsLibraries(Maven.resolver().loadPomFromFile("pom.xml")
                        .importRuntimeDependencies().resolve()
                        .withTransitivity().asFile())
                // Se agregan los compilados de los paquetes de servicios
                .addPackage(PaymentMethodResource.class.getPackage())
                // El archivo que contiene la configuracion a la base de datos.
                .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")
                // El archivo beans.xml es necesario para injeccion de dependencias.
                .addAsWebInfResource(new File("src/main/webapp/WEB-INF/beans.xml"))
                // El archivo shiro.ini es necesario para injeccion de dependencias
                .addAsWebInfResource(new File("src/main/webapp/WEB-INF/shiro.ini"))
                // El archivo web.xml es necesario para el despliegue de los servlets
                .setWebXML(new File("src/main/webapp/WEB-INF/web.xml"));
    }

    private WebTarget createWebTarget() {
        return ClientBuilder.newClient().target(deploymentURL.toString()).path(apiPath);
    }

    @PersistenceContext(unitName = "TurismPU")
    private EntityManager em;

    @Inject
    private UserTransaction utx;

    private void clearData() {
        em.createQuery("delete from PaymentMethodEntity").executeUpdate();
        em.createQuery("delete from ClientEntity").executeUpdate();
        ORACULO.clear();
    }

    /**
     * Datos iniciales para el correcto funcionamiento de las pruebas.
     *
     * @generated
     */
    public void insertData() {
        fatherClientEntity = factory.manufacturePojo(ClientEntity.class);
        fatherClientEntity.setId(1L);
        em.persist(fatherClientEntity);

        for (int i = 0; i < 3; i++) {
            PaymentMethodEntity paymentMethod = factory.manufacturePojo(PaymentMethodEntity.class);
            paymentMethod.setId(i + 1L);
            paymentMethod.setClient(fatherClientEntity);
            em.persist(paymentMethod);
            ORACULO.add(paymentMethod);
        }
    }

    /**
     * Configuración inicial de la prueba.
     *
     * @generated
     */
    @Before
    public void setUpTest() {
        try {
            utx.begin();
            clearData();
            insertData();
            utx.commit();
        } catch (Exception e) {
            e.printStackTrace();
            try {
                utx.rollback();
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
        target = createWebTarget()
                .path(clientPath)
                .path(fatherClientEntity.getId().toString())
                .path(paymentMethodPath);
    }

    /**
     * Login para poder consultar los diferentes servicios
     *
     * @param username Nombre de usuario
     * @param password Clave del usuario
     * @return Cookie con información de la sesión del usuario
     * @generated
     */
    public Cookie login(String username, String password) {
        UserDTO user = new UserDTO();
        user.setUserName(username);
        user.setPassword(password);
        user.setRememberMe(true);
        Response response = createWebTarget().path("users").path("login").request()
                .post(Entity.entity(user, MediaType.APPLICATION_JSON));
        if (response.getStatus() == ok) {
            return response.getCookies().get(JWT.cookieName);
        } else {
            return null;
        }
    }

    /**
     * Prueba para crear un PaymentMethod
     *
     * @throws java.io.IOException
     * @generated
     */
    @Test
    public void createPaymentMethodTest() throws IOException {
        PaymentMethodDTO paymentMethod = factory.manufacturePojo(PaymentMethodDTO.class);
        Cookie cookieSessionId = login(username, password);

        Response response = target
                .request().cookie(cookieSessionId)
                .post(Entity.entity(paymentMethod, MediaType.APPLICATION_JSON));

        PaymentMethodDTO paymentMethodTest = (PaymentMethodDTO) response.readEntity(PaymentMethodDTO.class);

        Assert.assertEquals(created, response.getStatus());

        Assert.assertEquals(paymentMethod.getName(), paymentMethodTest.getName());
        Assert.assertEquals(paymentMethod.getCardType(), paymentMethodTest.getCardType());
        Assert.assertEquals(paymentMethod.getCardNumber(), paymentMethodTest.getCardNumber());
        Assert.assertEquals(paymentMethod.getSecurityCode(), paymentMethodTest.getSecurityCode());
        Assert.assertEquals(paymentMethod.getExpirationMonth(), paymentMethodTest.getExpirationMonth());
        Assert.assertEquals(paymentMethod.getExpirationYear(), paymentMethodTest.getExpirationYear());

        PaymentMethodEntity entity = em.find(PaymentMethodEntity.class, paymentMethodTest.getId());
        Assert.assertNotNull(entity);
    }

    /**
     * Prueba para consultar un PaymentMethod
     *
     * @generated
     */
    @Test
    public void getPaymentMethodByIdTest() {
        Cookie cookieSessionId = login(username, password);

        PaymentMethodDTO paymentMethodTest = target
                .path(ORACULO.get(0).getId().toString())
                .request().cookie(cookieSessionId).get(PaymentMethodDTO.class);

        Assert.assertEquals(paymentMethodTest.getId(), ORACULO.get(0).getId());
        Assert.assertEquals(paymentMethodTest.getName(), ORACULO.get(0).getName());
        Assert.assertEquals(paymentMethodTest.getCardType(), ORACULO.get(0).getCardType());
        Assert.assertEquals(paymentMethodTest.getCardNumber(), ORACULO.get(0).getCardNumber());
        Assert.assertEquals(paymentMethodTest.getSecurityCode(), ORACULO.get(0).getSecurityCode());
        Assert.assertEquals(paymentMethodTest.getExpirationMonth(), ORACULO.get(0).getExpirationMonth());
        Assert.assertEquals(paymentMethodTest.getExpirationYear(), ORACULO.get(0).getExpirationYear());
    }

    /**
     * Prueba para consultar la lista de PaymentMethods
     *
     * @throws java.io.IOException
     * @generated
     */
    @Test
    public void listPaymentMethodTest() throws IOException {
        Cookie cookieSessionId = login(username, password);

        Response response = target.request().cookie(cookieSessionId).get();

        String listPaymentMethod = response.readEntity(String.class);
        List<PaymentMethodDTO> listPaymentMethodTest = new ObjectMapper().readValue(listPaymentMethod, List.class);
        Assert.assertEquals(ok, response.getStatus());
        Assert.assertEquals(3, listPaymentMethodTest.size());
    }

    /**
     * Prueba para actualizar un PaymentMethod
     *
     * @generated
     */
    @Test
    public void updatePaymentMethodTest() throws IOException {
        Cookie cookieSessionId = login(username, password);
        PaymentMethodDTO paymentMethod = new PaymentMethodDTO(ORACULO.get(0));

        PaymentMethodDTO paymentMethodChanged = factory.manufacturePojo(PaymentMethodDTO.class);

        paymentMethod.setName(paymentMethodChanged.getName());
        paymentMethod.setCardType(paymentMethodChanged.getCardType());
        paymentMethod.setCardNumber(paymentMethodChanged.getCardNumber());
        paymentMethod.setSecurityCode(paymentMethodChanged.getSecurityCode());
        paymentMethod.setExpirationMonth(paymentMethodChanged.getExpirationMonth());
        paymentMethod.setExpirationYear(paymentMethodChanged.getExpirationYear());

        Response response = target
                .path(paymentMethod.getId().toString())
                .request().cookie(cookieSessionId)
                .put(Entity.entity(paymentMethod, MediaType.APPLICATION_JSON));

        PaymentMethodDTO paymentMethodTest = (PaymentMethodDTO) response.readEntity(PaymentMethodDTO.class);

        Assert.assertEquals(ok, response.getStatus());
        Assert.assertEquals(paymentMethod.getName(), paymentMethodTest.getName());
        Assert.assertEquals(paymentMethod.getCardType(), paymentMethodTest.getCardType());
        Assert.assertEquals(paymentMethod.getCardNumber(), paymentMethodTest.getCardNumber());
        Assert.assertEquals(paymentMethod.getSecurityCode(), paymentMethodTest.getSecurityCode());
        Assert.assertEquals(paymentMethod.getExpirationMonth(), paymentMethodTest.getExpirationMonth());
        Assert.assertEquals(paymentMethod.getExpirationYear(), paymentMethodTest.getExpirationYear());
    }

    /**
     * Prueba para eliminar un PaymentMethod
     *
     * @generated
     */
    @Test
    public void deletePaymentMethodTest() {
        Cookie cookieSessionId = login(username, password);
        PaymentMethodDTO PaymentMethod = new PaymentMethodDTO(ORACULO.get(0));
        Response response = target
                .path(PaymentMethod.getId().toString())
                .request().cookie(cookieSessionId).delete();

        Assert.assertEquals(okWithoutContent, response.getStatus());
    }

}


text:
package models

import (
	"gopkg.in/mgo.v2/bson"
)

const (
	ExtendFieldInputTypeText     = "TEXT"
	ExtendFieldInputTypeTextarea = "TEXTAREA"
	ExtendFieldInputTypeSelect   = "SELECT"
	ExtendFieldInputTypeCheckbox = "CHECKBOX"
)

type ExtendField struct {
	Id          bson.ObjectId `json:"id" bson:"_id"`
	Label       string        `json:"label" bson:"label"`
	Description string        `json:"description" bson:"description"`
	Input       string        `json:"input" bson:"input"`
	Options     []string      `json:"options" bson:"options"`
	Created     int64         `json:"created" bson:"created"`
	Updated     int64         `json:"updated" bson:"updated"`
}

func NewExtendField() *ExtendField {
	now := Now().Unix()
	return &ExtendField{
		Id:      NewId(),
		Created: now,
		Updated: now,
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Pinq\Tests\Integration\Traversable;

class GroupByTest extends TraversableTest
{
    protected function _testReturnsNewInstanceOfSameTypeWithSameScheme(\Pinq\ITraversable $traversable)
    {
        return $traversable->groupBy(function () {

        });
    }

    /**
     * @dataProvider theImplementations
     */
    public function testThatExecutionIsDeferred(\Pinq\ITraversable $traversable, array $data)
    {
        $this->assertThatExecutionIsDeferred([$traversable, 'groupBy']);
    }

    /**
     * @dataProvider assocMixedValues
     */
    public function testCalledWithValueAndKeyParameters(\Pinq\ITraversable $traversable, array $data)
    {
        $this->assertThatCalledWithValueAndKeyParametersOnceForEachElementInOrder([$traversable, 'groupBy'], $data);
    }

    /**
     * @dataProvider everything
     */
    public function testThatGroupByElementReturnsCorrectTraversableType(\Pinq\ITraversable $traversable, array $data)
    {
        $groups =
                $traversable->groupBy(function ($i) {
                    return $i;
                });

        foreach ($groups as $group) {
            if ($traversable instanceof \Pinq\IQueryable) {
                $this->assertInstanceOf(\Pinq\IQueryable::ITRAVERSABLE_TYPE, $group);
            } elseif ($traversable instanceof \Pinq\IRepository) {
                $this->assertInstanceOf(\Pinq\IRepository::IREPOSITORY_TYPE, $group);
            } else {
                $this->assertInstanceOf(get_class($traversable), $group);
            }
        }
    }

    /**
     * @dataProvider oneToTen
     */
    public function testThatGroupByMultipleTest(\Pinq\ITraversable $traversable, array $data)
    {
        $groups = $traversable
                ->groupBy(function ($i) { return [$i % 2 === 0, $i % 3 === 0]; })
                ->asArray();

        $this->assertCount(4, $groups);
        $this->assertMatchesValues($groups[0], [1, 5, 7]);
        $this->assertMatchesValues($groups[1], [2, 4, 8, 10]);
        $this->assertMatchesValues($groups[2], [3, 9]);
        $this->assertMatchesValues($groups[3], [6]);
    }

    public function names()
    {
        return $this->implementationsFor(['andrew', 'sandy', 'tucker', 'tom', 'sandra', 'daniel']);
    }

    /**
     * @dataProvider names
     */
    public function testThatGroupByImplicitlyIndexesTheGroupsByTheirKey(\Pinq\ITraversable $traversable, array $data)
    {
        $groups = $traversable
                ->groupBy(function ($i) { return $i[0]; })
                ->asArray();

        $this->assertCount(4, $groups);
        $this->assertMatchesValues($groups['a'], ['andrew']);
        $this->assertMatchesValues($groups['s'], ['sandy', 'sandra']);
        $this->assertMatchesValues($groups['t'], ['tucker', 'tom']);
        $this->assertMatchesValues($groups['d'], ['daniel']);
    }

    /**
     * @dataProvider assocOneToTen
     */
    public function testThatGroupByGroupsTheElementsCorrectlyAndPreservesKeys(\Pinq\ITraversable $traversable, array $data)
    {
        $isEven =
                function ($i) {
                    return $i % 2 === 0;
                };

        //First number is odd, so the first group should be the odd group
        list($odd, $even) = $traversable->groupBy($isEven)->asArray();

        $this->assertMatches(
                $odd,
                array_filter($data, function ($i) use ($isEven) {
                    return !$isEven($i);
                }));
        $this->assertMatches($even, array_filter($data, $isEven));
    }

    /**
     * @dataProvider emptyData
     */
    public function testThatGroupByMaintainsReferences(\Pinq\ITraversable $traversable, array $data)
    {
        $data = $this->makeRefs(range(1, 10));

        $traversable = $traversable
                ->append($data)
                ->groupBy(function ($i) { return $i % 2 === 0; })
                [true]
                ->iterate(function (&$i) { $i *= 10; });

        $this->assertSame($data, [1, 20, 3, 40, 5, 60, 7, 80, 9, 100]);
    }

    /**
     * @dataProvider emptyData
     */
    public function testThatGroupByMaintainsArrayReferences(\Pinq\ITraversable $traversable, array $data)
    {
        $data = $this->makeRefs([[1], [2], [1, 2], [3, 5], [4, 2]]);

        $traversable
                ->append($data)
                ->groupBy(function ($i) { return count($i); })
                [2]
                ->iterate(function (&$i) { $i['foo'] = $i[0]; });

        $this->assertSame($data, [[1], [2], [1, 2, 'foo' => 1], [3, 5, 'foo' => 3], [4, 2, 'foo' => 4]]);
    }
}


text:
require 'spec_helper'

describe Player do
  let(:player) { Player.create!(name: 'player one', stamina: 3, tension: 5) }
  after { player.clear_shadow_data }

  it "should put data to cache after saved" do
    Redis.current.get(player.shadow_cache_key).should_not be_nil
  end

  it "should clear cached data after destroyed" do
    player.destroy
    expect(Player.find_shadow_data(player.id)).to be_nil
  end

  describe ".find_shadow_data" do
    it "should retrieve cache data as a hash" do
      Player.find_shadow_data(player.id).should be_an_instance_of Hash
    end

    it "should save data to cache first cache data not exists" do
      player.clear_shadow_data
      shadow_player = Player.find_by_shadow(player.id)
      Redis.current.get(player.shadow_cache_key).should_not be_nil
      shadow_player.should be_shadow_model
    end
  end

  describe ".find_by_shadow" do
    it "should find the model of given id from cache" do
      Player.should_not_receive(:find_by_sql)
      Player.find_by_shadow(player.id)
    end
  end

  context "the shadow model" do
    let(:shadow_player) { Player.find_by_shadow(player.id) }

    it { expect(shadow_player).to be_an_instance_of Player }
    it { expect(shadow_player).to be_shadow_model }
    it { expect(shadow_player).to be_persisted }

    it "should cannot be save or update" do
      expect{ shadow_player.save! }.to raise_error
    end

    it "should redefine the cacheable methods" do
      shadow_player.should respond_to :cacheable_method_without_shadow
      shadow_player.method(:cacheable_method).should == shadow_player.method(:cacheable_method_with_shadow)
    end

    it "should retrieve data from cache when call the cached methods" do
      shadow_player.shadow_data.should_receive(:[]).with(:cacheable_method)
      shadow_player.cacheable_method
    end

    it "should retrieve data from cache when call the cached attributes" do
      shadow_player.shadow_data.should_receive(:[]).with(:name)
      shadow_player.name
    end

    it "should cache primary key as default" do
      shadow_player.shadow_data.keys.should include(:id)
    end

    it "should have same values with the original model" do
      shadow_player.id.should == player.id
      shadow_player.name.should == player.name
      shadow_player.stamina.should == player.stamina
      shadow_player.tension.should == player.tension
      shadow_player.cacheable_method.should == player.cacheable_method
    end

    it "should can call the uncached methods as the original model" do
      shadow_player.not_cacheable_method.should == :not_cacheable_method
    end
  end

  context "shadow expiration setted" do
    before do
      Player.shadow_options[:expiration] = 10.seconds
      player.save!
    end

    after { Player.shadow_options = {} }

    it "should expire after setted expiration" do
      player.shadow_ttl.should be_between 9, 10
    end

    it "should update expiration everytime cache updated if update_expiration setted" do
      Player.shadow_options[:update_expiration] = true
      player.shadow_ttl.should be_between 9, 10
      Player.shadow_options[:expiration] = 20.seconds
      player.save!
      player.shadow_ttl.should be_between 19, 20
    end
  end

  context "shadow expireat setted" do
    before do
      Player.shadow_options[:expireat] = Time.now + 30.seconds
      player.save!
    end

    after { Player.shadow_options = {} }

    it "should expire after setted expireat" do
      player.shadow_ttl.should be_between 29, 30
    end
  end

  context "association" do
    let(:game) { Game.create!(name: 'game one') }
    let(:associated_player) { Player.create!(name: 'player one', stamina: 3, tension: 5, game_id: game.id) }
    let(:shadow_player) { Player.find_by_shadow(associated_player.id) }
    after { associated_player.clear_shadow_data }

    it "should return associated model when call the association methods" do
      shadow_player.game.should == associated_player.game
    end
  end

  context "association_only option" do
    before { Player.shadow_options[:association_only] = true }
    after { Player.shadow_options[:association_only] = false }
    it "should not cache model data seperately" do
      expect(Player.find_shadow_data(player.id)).to be_nil
    end
  end

  describe "reload" do
    let(:reloaded_model) { Player.find_by_shadow(player.id).reload }
    it "should no longer be a shadow_model" do
      expect(reloaded_model).not_to be_shadow_model
    end

    it "should reload remove the readonly attribute" do
      expect(reloaded_model).not_to be_readonly
    end
  end
end


text:
        {{each $data.para as $value}}

            <input type="text" class="parameter-name" value="{{$value.name}}" placeholder="维度名称"/>
            <select class="parameter-id">
                {{each $data.dimList as $dim}}
                <option value="{{$dim.id}}" {{if $dim.id == $value.elementId}} selected="selected" {{/if}}>{{$dim.caption}}</option>
                {{/each}}
            </select>
            <input type="text" class="parameter-default" value="{{$value.defaultValue}}" placeholder="默认值"/>
            <input type="checkbox" class="parameter-needed" {{if $value.needed == true}} checked="checked"{{/if}}}/>

        {{/each}}


text:
namespace blink {

class StyleIntrinsicLength {
  DISALLOW_NEW();

 public:
  // Style data for aspect-ratio: none | <length> | auto && <length>. none is
  // represented as an empty absl::optional.
  StyleIntrinsicLength(bool has_auto, const Length& length)
      : has_auto_(has_auto), length_(length) {}

  StyleIntrinsicLength() = default;

  bool HasAuto() const { return has_auto_; }

  const Length& GetLength() const { return length_; }

  bool operator==(const StyleIntrinsicLength& o) const {
    return has_auto_ == o.has_auto_ && length_ == o.length_;
  }

  bool operator!=(const StyleIntrinsicLength& o) const { return !(*this == o); }

 private:
  bool has_auto_ = false;
  Length length_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_STYLE_INTRINSIC_LENGTH_H_


text:
require 'spec_helper'

describe Decore::Infection do
  describe 'decorated component' do
    let :component do
      DecoratedComponent.new
    end

    it 'asserts the decorator existence' do
      component.should be_decorated
    end

    it 'instantiates the decorator' do
      component.decorator.should be_an_instance_of DecoratedComponentDecorator
    end
  end

  describe 'undecorated component' do
    let :component do
      UndecoratedComponent.new
    end

    it 'do not asserts the decorator existence' do
      component.should_not be_decorated
    end

    it 'do not instantiates the decorator' do
      expect { component.decorator }.to raise_error(NameError, /uninitialized constant UndecoratedComponentDecorator/)
    end
  end
end


text:
import static org.junit.Assert.assertNotNull;

import java.io.IOException;
import java.security.GeneralSecurityException;
import org.junit.Test;

public class TestUploadWithConversion extends BaseTest {
  @Test
  public void uploadWithConversion()
      throws IOException, GeneralSecurityException {
    String id = UploadWithConversion.uploadWithConversion();
    assertNotNull(id);
    deleteFileOnCleanup(id);
  }
}


text:
```bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report
```

## How to Run unit tests

```bash
# Karma does unit testing for components and pages
npm run unit
```


text:
//
//  NSManagedObject_Convient.h
//  CoreDataEnvirSample
//
//  Created by NicholasXu on 15/8/30.
//  Copyright (c) 2015年 Nicholas.Xu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreDataEnvir/CoreDataEnvir.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSManagedObject (CDEConevient)

+ (NSUInteger)totalCountInContext:(CoreDataEnvir*)db forConfiguration:(NSString* _Nullable)name;

#pragma mark - Inserting operations.

+ (NSFetchRequest*)newFetchRequestInContext:(CoreDataEnvir*)db;

/**
 Creating managed object on background thread.
 */
+ (instancetype)insertItemInContext:(CoreDataEnvir *)cde;

/**
 Createing managed object in specified context with filling 'block'
 */
+ (instancetype)insertItemInContext:(CoreDataEnvir *)cde fillData:(void (^)(NSManagedObject* item))fillingBlock;

#pragma mark - Fetching operations.

/**
 Fetching record items in specified context.
 */
+ (NSArray *)itemsInContext:(CoreDataEnvir *)cde;

/**
 Fetch record items by predicate.
 */
+ (NSArray *)itemsInContext:(CoreDataEnvir *)cde usingPredicate:(NSPredicate *)predicate;

/**
 Fetch record items by format string.
 */
+ (NSArray *)itemsInContext:(CoreDataEnvir *)cde withFormat:(NSString *)fmt,...;

/**
 *  Fetch items by sort descriptions.
 *
 *  @param cde              CoreDataEnvir instance.
 *  @param sortDescriptions SortDescriptions
 *  @param fmt              Predicate format.
 *
 *  @return Array of items match the condition.
 */
+ (NSArray *)itemsInContext:(CoreDataEnvir *)cde sortDescriptions:(NSArray *)sortDescriptions withFormat:(NSString *)fmt,...;

/**
 *  Fetch items addition by limited range.
 *
 *  @param cde              CoreDataEnvir instance
 *  @param sortDescriptions SortDescriptions
 *  @param offset           offset
 *  @param limitNumber       limted number
 *  @param fmt              Predicate format.
 *
 *  @return Array of items match the condition.
 */
+ (NSArray *)itemsInContext:(CoreDataEnvir *)cde sortDescriptions:(NSArray *)sortDescriptions fromOffset:(NSUInteger)offset limitedBy:(NSUInteger)limitNumber withFormat:(NSString *)fmt,...;

/**
 *  Fetch item in specified context.
 *
 *  @param cde CoreDataEnvir instance
 *
 *  @return Last item of the managed object in context.
 */
+ (instancetype)lastItemInContext:(CoreDataEnvir *)cde;

/**
 *  Fetch item in specified context through predicate.
 *
 *  @param cde       CoreDataEnvir instance
 *  @param predicate Predicate.
 *
 *  @return Last item of the managed object in context.
 */
+ (instancetype)lastItemInContext:(CoreDataEnvir *)cde usingPredicate:(NSPredicate *)predicate;

/**
 *  Fetch item in specified context through format string.
 *
 *  @param cde CoreDataEnvir object.
 *  @param fmt Predicate format string.
 *
 *  @return Last item of the managed object in context.
 */
+ (instancetype)lastItemInContext:(CoreDataEnvir *)cde withFormat:(NSString *)fmt,...;

#pragma mark - fault process.

/**
 *  Update NSManagedObject if faulted.
 *
 *  @return Updated object.
 */
- (instancetype)update;

/**
 Update NSManagedObject in specified context if faulted.

 @param cde     CoreDataEnvir object.
 */
- (instancetype)updateInContext:(CoreDataEnvir *)cde;

#pragma mark - Deleting .

/**
 *  Remove item.
 *
 *  @param cde CoreDataEnvir object.
 */
- (void)removeFrom:(CoreDataEnvir *)cde;

/**
 *  Remove item.
 */
- (void)remove;

#pragma mark - Drive to save.

/**
 *  Save db on main thread.
 *
 *  @param cde CoreDataEnvir object.
 *
 *  @return Success(YES) or failed(NO).
 */
- (BOOL)saveTo:(CoreDataEnvir *)cde;

/**
 Save db on main thread.
 */
- (BOOL)save;

/**
 *  Save db on main thread.
 *
 *  @param cde CoreDataEnvir object.
 *
 *  @return Success(YES) or failed(NO).
 */
- (BOOL)saveTo:(CoreDataEnvir *)cde forConfiguration:(NSString*)name;

@end

NS_ASSUME_NONNULL_END


text:
@interface NSString (Random)

+ (instancetype)random;

@end


text:
namespace UniversityStudentSystem.Data.Models
{
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;

    using Common;
    using CommonModels;

    public class Course : BaseModel<int>
    {
        private ICollection<User> trainers;
        private ICollection<Test> tests;
        private ICollection<CourseTask> tasks;
        private ICollection<Resource> resources;
        private ICollection<Solution> solutions;
        private ICollection<Mark> marks;

        public Course()
        {
            this.trainers = new HashSet<User>();
            this.tests = new HashSet<Test>();
            this.tasks = new HashSet<CourseTask>();
            this.resources = new HashSet<Resource>();
            this.solutions = new HashSet<Solution>();
            this.marks = new HashSet<Mark>();
        }

        [Required]
        [Index(IsUnique = true)]
        [MinLength(ModelConstants.NameMinLength)]
        [MaxLength(ModelConstants.NameMaxLength)]
        public string Name { get; set; }

        [MinLength(ModelConstants.NameMinLength)]
        [MaxLength(ModelConstants.DescriptionMaxLength)]
        public string Description { get; set; }

        public int SemesterId { get; set; }

        public virtual Semester Semester { get; set; }

        public virtual ICollection<Resource> Resources
        {
            get
            {
                return this.resources;
            }

            set
            {
                this.resources = value;
            }
        }

        public virtual ICollection<CourseTask> Tasks
        {
            get
            {
                return this.tasks;
            }

            set
            {
                this.tasks = value;
            }
        }

        public virtual ICollection<Test> Tests
        {
            get
            {
                return this.tests;
            }

            set
            {
                this.tests = value;
            }
        }

        public virtual ICollection<User> Trainers
        {
            get
            {
                return this.trainers;
            }

            set
            {
                this.trainers = value;
            }
        }

        public virtual ICollection<Solution> Solutions
        {
            get
            {
                return this.solutions;
            }

            set
            {
                this.solutions = value;
            }
        }

        public virtual ICollection<Mark> Marks
        {
            get
            {
                return this.marks;
            }

            set
            {
                this.marks = value;
            }
        }
    }
}


text:
import sys
import pandas as pd
import numpy as np
from sklearn.preprocessing import RobustScaler
from sklearn.linear_model import PassiveAggressiveClassifier
from evaluate_model import evaluate_model

dataset = sys.argv[1]
num_param_combinations = int(sys.argv[2])
random_seed = int(sys.argv[3])

np.random.seed(random_seed)

pipeline_components = [RobustScaler, PassiveAggressiveClassifier]
pipeline_parameters = {}

C_values = np.random.uniform(low=1e-10, high=10., size=num_param_combinations)
loss_values = np.random.choice(['hinge', 'squared_hinge'], size=num_param_combinations)
fit_intercept_values = np.random.choice([True, False], size=num_param_combinations)

all_param_combinations = zip(C_values, loss_values, fit_intercept_values)
pipeline_parameters[PassiveAggressiveClassifier] = \
   [{'C': C, 'loss': loss, 'fit_intercept': fit_intercept, 'random_state': 324089}
     for (C, loss, fit_intercept) in all_param_combinations]

evaluate_model(dataset, pipeline_components, pipeline_parameters)


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/blue"
     >

    <com.jiang.shanwe.swiperefresh.PullToRefreshScrollView
        xmlns:ptr="http://schemas.android.com/apk/res-auto"
        android:id="@+id/pull_refresh_scrollview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none"
        ptr:ptrAnimationStyle="flip"
        ptr:ptrMode="pullFromStart" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="16dp" >

            <RelativeLayout
                android:id="@+id/rl_city"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" >

                <TextView
                    android:id="@+id/tv_city"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:text="@string/default_text"
                    android:textColor="@color/text_color" />

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignBottom="@id/tv_city"
                    android:layout_alignTop="@id/tv_city"
                    android:layout_toRightOf="@id/tv_city"
                    android:padding="4dp"
                    android:src="@drawable/arrow" />
            </RelativeLayout>

            <TextView
                android:id="@+id/tv_release"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginBottom="16dp"
                android:text="@string/default_text"
                android:textColor="@color/text_color"
                android:textSize="12sp" />

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="@color/light_grey" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="24dp" >

                <ImageView
                    android:id="@+id/iv_now_weather"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/d00" />

                <TextView
                    android:id="@+id/tv_now_weather"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginLeft="4dp"
                    android:text="@string/default_text"
                    android:textColor="@color/text_color" />
            </LinearLayout>

            <TextView
                android:id="@+id/tv_today_temp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text="@string/default_text"
                android:textColor="@color/text_color"
                android:textSize="12sp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                android:layout_marginTop="16dp" >

                <TextView
                    android:id="@+id/tv_now_temp"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/default_text"
                    android:textColor="@color/text_color"
                    android:textSize="48sp" />

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/wireframe_light"
                    android:orientation="vertical" >

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:text="@string/pm"
                        android:textColor="@color/text_color" />

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp" >

                        <TextView
                            android:id="@+id/tv_aqi"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/default_text"
                            android:textColor="@color/text_color" />

                        <TextView
                            android:id="@+id/tv_quality"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:ems="5"
                            android:gravity="right"
                            android:text="@string/default_text"
                            android:textColor="@color/text_color" />
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/wireframe_dark"
                android:orientation="vertical" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="4dp"
                    android:text="@string/forecast"
                    android:textColor="@color/dark_grey" />

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp" >

                    <TextView
                        android:id="@+id/tv_next_three"
                        style="@style/TextViewStyle" />

                    <TextView
                        android:id="@+id/tv_next_six"
                        style="@style/TextViewStyle" />

                    <TextView
                        android:id="@+id/tv_next_nine"
                        style="@style/TextViewStyle" />

                    <TextView
                        android:id="@+id/tv_next_twelve"
                        style="@style/TextViewStyle" />

                    <TextView
                        android:id="@+id/tv_next_fifteen"
                        style="@style/TextViewStyle" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" >

                    <ImageView
                        android:id="@+id/iv_next_three"
                        style="@style/ViewStyle"
                        android:src="@drawable/d00" />

                    <ImageView
                        android:id="@+id/iv_next_six"
                        style="@style/ViewStyle"
                        android:src="@drawable/d00" />

                    <ImageView
                        android:id="@+id/iv_next_nine"
                        style="@style/ViewStyle"
                        android:src="@drawable/d00" />

                    <ImageView
                        android:id="@+id/iv_next_twelve"
                        style="@style/ViewStyle"
                        android:src="@drawable/d00" />

                    <ImageView
                        android:id="@+id/iv_next_fifteen"
                        style="@style/ViewStyle"
                        android:src="@drawable/d00" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    android:layout_marginTop="8dp" >

                    <TextView
                        android:id="@+id/tv_next_three_temp"
                        style="@style/TextViewStyle" />

                    <TextView
                        android:id="@+id/tv_next_six_temp"
                        style="@style/TextViewStyle" />

                    <TextView
                        android:id="@+id/tv_next_nine_temp"
                        style="@style/TextViewStyle" />

                    <TextView
                        android:id="@+id/tv_next_twelve_temp"
                        style="@style/TextViewStyle" />

                    <TextView
                        android:id="@+id/tv_next_fifteen_temp"
                        style="@style/TextViewStyle" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center" >

                    <TextView
                        style="@style/TextViewStyle"
                        android:layout_weight="3"
                        android:gravity="left"
                        android:paddingLeft="16dp"
                        android:text="@string/today" />

                    <ImageView
                        android:id="@+id/iv_today_weather"
                        style="@style/ViewStyle"
                        android:layout_weight="4"
                        android:src="@drawable/d00" />

                    <TextView
                        android:id="@+id/tv_today_temp_a"
                        style="@style/TextViewStyle"
                        android:layout_weight="4" />

                    <TextView
                        android:id="@+id/tv_today_temp_b"
                        style="@style/TextViewStyle"
                        android:layout_weight="4" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center" >

                    <TextView
                        android:id="@+id/tv_tommorrow"
                        style="@style/TextViewStyle"
                        android:layout_weight="3"
                        android:gravity="left"
                        android:paddingLeft="16dp" />

                    <ImageView
                        android:id="@+id/iv_tommorrow_weather"
                        style="@style/ViewStyle"
                        android:layout_weight="4"
                        android:src="@drawable/d00" />

                    <TextView
                        android:id="@+id/tv_tommorrow_temp_a"
                        style="@style/TextViewStyle"
                        android:layout_weight="4" />

                    <TextView
                        android:id="@+id/tv_tommorrow_temp_b"
                        style="@style/TextViewStyle"
                        android:layout_weight="4" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center" >

                    <TextView
                        android:id="@+id/tv_thirdday"
                        style="@style/TextViewStyle"
                        android:layout_weight="3"
                        android:gravity="left"
                        android:paddingLeft="16dp" />

                    <ImageView
                        android:id="@+id/iv_thirdday_weather"
                        style="@style/ViewStyle"
                        android:layout_weight="4"
                        android:src="@drawable/d00" />

                    <TextView
                        android:id="@+id/tv_thirdday_temp_a"
                        style="@style/TextViewStyle"
                        android:layout_weight="4" />

                    <TextView
                        android:id="@+id/tv_thirdday_temp_b"
                        style="@style/TextViewStyle"
                        android:layout_weight="4" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center" >

                    <TextView
                        android:id="@+id/tv_fourthday"
                        style="@style/TextViewStyle"
                        android:layout_weight="3"
                        android:gravity="left"
                        android:paddingLeft="16dp" />

                    <ImageView
                        android:id="@+id/iv_fourthday_weather"
                        style="@style/ViewStyle"
                        android:layout_weight="4"
                        android:src="@drawable/d00" />

                    <TextView
                        android:id="@+id/tv_fourthday_temp_a"
                        style="@style/TextViewStyle"
                        android:layout_weight="4" />

                    <TextView
                        android:id="@+id/tv_fourthday_temp_b"
                        style="@style/TextViewStyle"
                        android:layout_weight="4" />
                </LinearLayout>
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:background="@drawable/wireframe_dark"
                android:orientation="vertical" >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="4dp"
                    android:text="@string/information"
                    android:textColor="@color/dark_grey" />

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                      android:visibility="gone"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:visibility="gone"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    android:layout_marginTop="8dp" >

                    <TextView
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp"
                        android:text="@string/felt_air_temp" />

                    <TextView
                        android:id="@+id/tv_felt_air_temp"
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    android:layout_marginTop="8dp" >

                    <TextView
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp"
                        android:text="@string/humidity" />

                    <TextView
                        android:id="@+id/tv_humidity"
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    android:layout_marginTop="8dp" >

                    <TextView
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp"
                        android:text="@string/wind" />

                    <TextView
                        android:id="@+id/tv_wind"
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    android:layout_marginTop="8dp" >

                    <TextView
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp"
                        android:text="@string/uv_index" />

                    <TextView
                        android:id="@+id/tv_uv_index"
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/light_grey" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    android:layout_marginTop="8dp" >

                    <TextView
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp"
                        android:text="@string/dressing_index" />

                    <TextView
                        android:id="@+id/tv_dressing_index"
                        style="@style/TextViewStyle"
                        android:gravity="left"
                        android:paddingLeft="16dp" />
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </com.jiang.shanwe.swiperefresh.PullToRefreshScrollView>

</LinearLayout>


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

    <servlet>
        <servlet-name>OrderBrowserServlet</servlet-name>
        <servlet-class>examples.servlet.OrderBrowserServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>OrderBrowserServlet</servlet-name>
        <url-pattern>/OrderBrowserServlet</url-pattern>
    </servlet-mapping>

    <ejb-local-ref>
        <ejb-ref-name>ejb/OrderBrowser</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local>examples.stateful.OrderBrowser</local>
    </ejb-local-ref>
</web-app>


text:
package wolfogre.kh6_2;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

/**
 * Created by Jason Song(wolfogre@outlook.com) on 02/18/2016.
 */
public class GroupListViewAdapter extends BaseAdapter {
	int groupNumber;
	boolean[] isDownList;
	LayoutInflater layoutInflater;
	Activity activity;
	String gameName;

	public GroupListViewAdapter(Activity activity, String gameName){
		groupNumber = GameInfoBySharedPreferences.getGroupNumber(gameName);
		isDownList = new boolean[groupNumber];
		for(int i = 0; i < isDownList.length; ++i)
			isDownList[i] = false;
		layoutInflater = LayoutInflater.from(activity);
		this.activity = activity;
		this.gameName = gameName;
	}

	@Override
	public int getCount() {
		return groupNumber;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		ViewHolder viewHolder;
		if (convertView == null) {
			viewHolder = new ViewHolder();
			convertView = layoutInflater.inflate(R.layout.item_group_list_view, null);
			viewHolder.tvGroupName = (TextView) convertView.findViewById(R.id.tvGroupName);
			viewHolder.ivDown = (ImageView) convertView.findViewById(R.id.ivDown);
			viewHolder.lvPeople = (ListView)convertView.findViewById(R.id.lvPeople);
			viewHolder.ivAddPeople = (ImageView)convertView.findViewById(R.id.ivAddPeople);
			viewHolder.rlPeople = (RelativeLayout)convertView.findViewById(R.id.rlPeople);
			convertView.setTag(viewHolder);
		} else {
			viewHolder = (ViewHolder)convertView.getTag();
		}
		viewHolder.tvGroupName.setText("小组" + (position + 1));

		final RelativeLayout rlPeople = viewHolder.rlPeople;
		final View finalConvertView = convertView;
		viewHolder.ivDown.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				if (isDownList[position]) {
					isDownList[position] = false;
					rlPeople.setVisibility(View.INVISIBLE);
					((ImageView)v).setImageResource(R.drawable.ic_keyboard_arrow_left_black_48dp);
					AbsListView.LayoutParams lp = new AbsListView.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, 150);
					finalConvertView.setLayoutParams(lp);
				} else {
					isDownList[position] = true;
					rlPeople.setVisibility(View.VISIBLE);
					((ImageView)v).setImageResource(R.drawable.ic_keyboard_arrow_down_black_48dp);
					AbsListView.LayoutParams lp = new AbsListView.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, 800);
					finalConvertView.setLayoutParams(lp);
				}
				finalConvertView.postInvalidate();
			}
		});

		if (isDownList[position]){
			rlPeople.setVisibility(View.VISIBLE);
			viewHolder.ivDown.setImageResource(R.drawable.ic_keyboard_arrow_down_black_48dp);
			AbsListView.LayoutParams lp = new AbsListView.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, 800);
			finalConvertView.setLayoutParams(lp);
		} else {
			rlPeople.setVisibility(View.INVISIBLE);
			viewHolder.ivDown.setImageResource(R.drawable.ic_keyboard_arrow_left_black_48dp);
			AbsListView.LayoutParams lp = new AbsListView.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, 150);
			finalConvertView.setLayoutParams(lp);
		}

		viewHolder.ivAddPeople.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				new AddPeopleDialogFragment().show(activity.getFragmentManager(),
						activity.getIntent().getStringExtra(activity.getString(R.string.intent_key_game_name))
						+ "###" + position);
			}
		});

		viewHolder.lvPeople.setAdapter(new PeopleListViewAdapter(activity, position, gameName));

		return convertView;
	}

	class ViewHolder{
		TextView tvGroupName;
		ImageView ivDown;
		ListView lvPeople;
		ImageView ivAddPeople;
		RelativeLayout rlPeople;
	}
}


text:
package org.boon.slumberdb.leveldb;

import org.boon.Maps;
import org.boon.Str;
import org.boon.slumberdb.entries.Entry;
import org.boon.slumberdb.KeyValueIterable;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Map;

import static org.boon.Boon.puts;
import static org.boon.Exceptions.die;

/**
 * Created by Richard on 4/5/14.
 */
public class SimplyKyroKeyValueStoreLevelDBTest {

    private SimpleKryoKeyValueStoreLevelDB<Employee> store;
    private boolean ok;

    @Before
    public void setup() {

        File file = new File("target/test-data");
        file = file.getAbsoluteFile();
        file.mkdirs();
        file = new File(file, "employee-leveldb-rocksdb.dat");
        store = new SimpleKryoKeyValueStoreLevelDB(file.toString(), Employee.class);

    }

    @After
    public void close() {

        store.close();
    }

    @Test
    public void test() {
        store.put("123",
                new Employee("Rick", "Hightower")
        );

        Employee employee = store.load("123");
        Str.equalsOrDie("Rick", employee.getFirstName());

        Str.equalsOrDie("Hightower", employee.getLastName());
    }

    @Test
    public void testBulkPut() {

        Map<String, Employee> map = Maps.map(

                "123", new Employee("Rick", "Hightower"),
                "456", new Employee("Paul", "Tabor"),
                "789", new Employee("Jason", "Daniel")

        );

        store.putAll(map);

        Employee employee;

        employee = store.load("789");
        Str.equalsOrDie("Jason", employee.getFirstName());
        Str.equalsOrDie("Daniel", employee.getLastName());

        employee = store.load("456");
        Str.equalsOrDie("Paul", employee.getFirstName());
        Str.equalsOrDie("Tabor", employee.getLastName());

        employee = store.load("123");
        Str.equalsOrDie("Rick", employee.getFirstName());
        Str.equalsOrDie("Hightower", employee.getLastName());

    }

    @Test
    public void testBulkRemove() {

        Map<String, Employee> map = Maps.map(

                "123", new Employee("Rick", "Hightower"),
                "456", new Employee("Paul", "Tabor"),
                "789", new Employee("Jason", "Daniel")

        );

        store.putAll(map);

        Employee employee;

        employee = store.load("789");
        Str.equalsOrDie("Jason", employee.getFirstName());
        Str.equalsOrDie("Daniel", employee.getLastName());

        employee = store.load("456");
        Str.equalsOrDie("Paul", employee.getFirstName());
        Str.equalsOrDie("Tabor", employee.getLastName());

        employee = store.load("123");
        Str.equalsOrDie("Rick", employee.getFirstName());
        Str.equalsOrDie("Hightower", employee.getLastName());

        store.removeAll(map.keySet());

        employee = store.load("123");

        ok = employee == null || die();

        employee = store.load("456");

        ok = employee == null || die();

    }

    @Test
    public void testSearch() {
        for (int index = 0; index < 100; index++) {

            store.put("key." + index, new Employee("Rick" + index, "Hightower"));
        }

        KeyValueIterable<String, Employee> entries = store.search("key.50");

        int count = 0;

        for (Entry<String, Employee> entry : entries) {
            puts(entry.key(), entry.value());
            count++;
        }

        ok = (count > 20 && count < 60) || die(count);
        entries.close();
    }

    @Test
    public void testIteration() {

        for (int index = 0; index < 100; index++) {

            store.put("iter." + index, new Employee("Rick" + index, "Hightower"));
        }

        KeyValueIterable<String, Employee> entries = store.loadAll();

        int count = 0;

        for (Entry<String, Employee> entry : entries) {
            puts(entry.key(), entry.value());
            count++;
        }

        ok = (count >= 100) || die(count);

        entries.close();

    }

    @Test
    public void sillyTestForCodeCoverage() {

        KeyValueIterable<String, Employee> entries = store.loadAll();

        Iterator<Entry<String, Employee>> iterator = entries.iterator();

        try {
            while (iterator.hasNext()) {
                iterator.remove();
            }

        } catch (Exception ex) {

        }
    }

    {
        new Entry<>();
    }

    public static class Employee implements Serializable {
        String firstName;
        String lastName;
        String id;

        public Employee() {
        }

        public Employee(String firstName, String lastName) {
            this.firstName = firstName;
            this.lastName = lastName;
        }

        public String getLastName() {
            return lastName;
        }

        public void setLastName(String lastName) {
            this.lastName = lastName;
        }

        public String getFirstName() {
            return firstName;
        }

        public void setFirstName(String firstName) {
            this.firstName = firstName;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (!(o instanceof Employee)) return false;

            Employee employee = (Employee) o;

            if (firstName != null ? !firstName.equals(employee.firstName) : employee.firstName != null) return false;
            if (id != null ? !id.equals(employee.id) : employee.id != null) return false;
            if (lastName != null ? !lastName.equals(employee.lastName) : employee.lastName != null) return false;

            return true;
        }

        @Override
        public int hashCode() {
            int result = firstName != null ? firstName.hashCode() : 0;
            result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
            result = 31 * result + (id != null ? id.hashCode() : 0);
            return result;
        }

        @Override
        public String toString() {
            return "Employee{" +
                    "firstName='" + firstName + '\'' +
                    ", lastName='" + lastName + '\'' +
                    ", id='" + id + '\'' +
                    '}';
        }
    }
}


text:
<?php

namespace App\Http\Controllers\Frontend;

use Illuminate\View\View;
use App\Http\Controllers\Controller;

class PolicyController extends Controller
{
    /**
     * Blade view for the privacy statemen
     *
     * @return View
     */
    public function privacy(): View
    {
        return view('frontend.policies.privacy-disclaimer');
    }

    /**
     * Blade view for the term of service page.
     *
     * @return View
     */
    public function termsOfService(): View
    {
        return view('frontend.policies.terms-of-service');
    }
}


text:
@extends('layouts.app')

@section('content')

You are going to sign a Java Archive (JAR).

    {{ Form::open(['url' => 'signer/signJAR', 'method' => 'POST', 'class' => 'form', 'files' => true]) }}

            {{ Form::label('Select JAR Archive') }}
            {{ Form::file('jar', null, ['class' => 'form-control']) }}

Or drag and drop files below

          Just drag and drop files here

            {{ Form::label('Password') }}
            {{ Form::password('password', ['placeholder' => 'Keystore Password', 'class' => 'form-control' ]) }}

            {{ Form::token() }}
            {{ Form::submit('Submit Data', ['class' => 'btn btn-primary btn-md']) }}

    {{ Form::close() }}

@endsection


text:
/*
* Code by Folaefolc
* A Lisp-like done just to concurrence Lisp itself (kind of crazy game for me)
* Interpreted programming language, C++14 ; main purpose is for video games
* License MIT
*/

#pragma once

#define HTB_TESTS_INCLUDED


text:
shared_examples 'decrypting salted ciphertext with Ruby using password and salt' do
  context 'decrypting salted ciphertext with Ruby using password and salt' do
    let(:decryptor) { OpenSSL::Cipher::AES.new(256, :CBC).decrypt }

    # N.B. pkcs5_keyivgen is deprected
    it 'decrypts correctly' do
      decryptor.pkcs5_keyivgen(password, salt, 1)
      result = decryptor.update(encrypted)
      result << decryptor.final

      expect(result).to eq(plaintext)
    end
  end
end


text:
//---------------------------------------------------------------------
// <copyright file="PostPropertyTrackingTest.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

namespace Microsoft.Test.OData.Tests.Client.PropertyTrackingTests
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Linq;
    using Microsoft.OData.Client;
    using Microsoft.OData.Core;
    using Microsoft.Test.OData.Services.TestServices;
    using Microsoft.Test.OData.Services.TestServices.ODataWCFServiceReferencePlus;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class PostPropertyTrackingTest : ODataWCFServiceTestsBase<InMemoryEntitiesPlus>
    {
        public PostPropertyTrackingTest()
            : base(ServiceDescriptors.ODataWCFServiceDescriptor)
        {
        }

        [TestMethod]
        public void PostPartialProperties()
        {
            this.TestClientContext.MergeOption = MergeOption.OverwriteChanges;

            int expectedPropertyCount = 0;
            ODataEntry entry = null;
            this.TestClientContext.Configurations.RequestPipeline.OnEntryEnding((arg) =>
            {
                entry = arg.Entry;
                Assert.AreEqual(expectedPropertyCount, entry.Properties.Count());
            });

            //Entity of Derived type
            //Entity has a complex property of derived type
            DataServiceCollection<CustomerPlus> people =
                new DataServiceCollection<CustomerPlus>(this.TestClientContext, "People", null, null);
            var person = new CustomerPlus();
            people.Add(person);

            person.FirstNamePlus = "Nelson";
            person.LastNamePlus = "Black";
            person.NumbersPlus = new ObservableCollection<string> { };
            person.EmailsPlus = new ObservableCollection<string> { "abc@abc.com" };
            person.PersonIDPlus = 10001;
            person.CityPlus = "London";
            person.TimeBetweenLastTwoOrdersPlus = new TimeSpan(1);
            person.HomeAddressPlus = new HomeAddressPlus()
            {
                CityPlus = "Redmond",
                PostalCodePlus = "98052",
                StreetPlus = "1 Microsoft Way"
            };

            //Post entity into an entity set
            expectedPropertyCount = 8;
            this.TestClientContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

            //Validate that entire complex type was sent to server side.
            Assert.AreEqual(4, (entry.Properties.Where(p => p.Name == "HomeAddress").First().Value as ODataComplexValue).Properties.Count());

            //Post Navigation property to an entitySet
            var people1 = new DataServiceCollection<CustomerPlus>(this.TestClientContext.CustomersPlus.Where(p => p.PersonIDPlus == 10001));
            OrderPlus order = new OrderPlus();
            people1[0].OrdersPlus.Add(order);
            order.OrderIDPlus = 10001;
            order.OrderDatePlus = new DateTimeOffset(new DateTime(2011, 5, 29, 14, 21, 12));
            order.OrderShelfLifesPlus = new ObservableCollection<TimeSpan>();

            expectedPropertyCount = 3;
            this.TestClientContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

            //Validate
            var customer = this.TestClientContext.CustomersPlus.Expand(c => c.OrdersPlus).Where(p => p.PersonIDPlus == 10001).FirstOrDefault();
            Assert.IsNotNull(customer);
            Assert.AreEqual("London", ((CustomerPlus)customer).CityPlus);
            Assert.AreEqual(0, customer.NumbersPlus.Count);
            Assert.IsNull(((HomeAddressPlus)customer.HomeAddressPlus).FamilyNamePlus);
            Assert.IsNull(customer.MiddleNamePlus);
            var order1 = customer.OrdersPlus.Where(o => o.OrderIDPlus == 10001).Single();
            Assert.IsNull(order1.ShelfLifePlus);

            //Post Entity with open complex type and with contained Navigation
            DataServiceCollection<AccountPlus> accounts =
                new DataServiceCollection<AccountPlus>(this.TestClientContext);
            var account = new AccountPlus();
            accounts.Add(account);
            account.AccountIDPlus = 110;
            account.CountryRegionPlus = "CN";
            account.AccountInfoPlus = new AccountInfoPlus()
            {
                FirstNamePlus = "New",
                LastNamePlus = "Base",
                IsActivePlus = true,
            };
            var expectedMiddleName = account.AccountInfoPlus.MiddleNamePlus;

            expectedPropertyCount = 3;
            this.TestClientContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties);
            //Validate entire open complex type was sent to server side.
            Assert.AreEqual(4, (entry.Properties.Where(a => a.Name == "AccountInfo").First().Value as ODataComplexValue).Properties.Count());

            //Post Contained Navigation property
            PaymentInstrumentPlus pi = new PaymentInstrumentPlus();
            account.MyPaymentInstrumentsPlus.Add(pi);
            pi.PaymentInstrumentIDPlus = 1003;
            pi.CreatedDatePlus = DateTimeOffset.Now;
            pi.FriendlyNamePlus = "FriendlyName";

            expectedPropertyCount = 3;
            this.TestClientContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

            //Post Contained Single Navigation property
            //var gcs = new DataServiceCollection<GiftCardPlus>(this.TestClientContext, "Accounts(110)/MyGiftCard", null, null);
            GiftCardPlus gc = new GiftCardPlus();
            account.MyGiftCardPlus = gc;
            gc.GiftCardIDPlus = 10001;
            gc.GiftCardNOPlus = "10001";
            gc.AmountPlus = 2000;
            gc.ExperationDatePlus = DateTimeOffset.Now;

            expectedPropertyCount = 4;
            this.TestClientContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

            var account1 = this.TestClientContext.AccountsPlus.Expand(a => a.MyPaymentInstrumentsPlus).Expand(a => a.MyGiftCardPlus).Where(a => a.AccountIDPlus == 110).Single();
            Assert.AreEqual("CN", account1.CountryRegionPlus);
            Assert.AreEqual(expectedMiddleName, account1.AccountInfoPlus.MiddleNamePlus);
            Assert.AreEqual("Base", account1.AccountInfoPlus.LastNamePlus);
            Assert.IsTrue(account1.AccountInfoPlus.IsActivePlus);
            var pi1 = account1.MyPaymentInstrumentsPlus.Where(p => p.PaymentInstrumentIDPlus == 1003).SingleOrDefault();
            Assert.IsNotNull(pi1);
            Assert.AreEqual("FriendlyName", pi1.FriendlyNamePlus);
            Assert.IsNull(account1.MyGiftCardPlus.OwnerNamePlus);
            Assert.AreEqual(2000, account1.MyGiftCardPlus.AmountPlus);

            //Post Entity with Enum property and collection of Enum property
            DataServiceCollection<ProductPlus> products = new DataServiceCollection<ProductPlus>(this.TestClientContext);
            ProductPlus product = new ProductPlus();
            products.Add(product);
            product.NamePlus = "Apple";
            product.ProductIDPlus = 1000000;
            product.QuantityInStockPlus = 20;
            product.QuantityPerUnitPlus = "Pound";
            product.UnitPricePlus = 0.35f;
            product.DiscontinuedPlus = false;
            product.CoverColorsPlus = new ObservableCollection<ColorPlus>();
            product.SkinColorPlus = null;

            expectedPropertyCount = 8;
            this.TestClientContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

            var product2 = this.TestClientContext.ProductsPlus.Where(p => p.ProductIDPlus == 1000000).FirstOrDefault();
            Assert.IsNotNull(product2);
            Assert.AreEqual("Apple", product2.NamePlus);

            //Post Navigation property under derived singleton
            DataServiceCollection<CompanyPlus> publicCompany = new DataServiceCollection<CompanyPlus>(this.TestClientContext.PublicCompanyPlus);
            AssetPlus asset = new AssetPlus();
            (publicCompany[0] as PublicCompanyPlus).AssetsPlus.Add(asset);
            asset.AssetIDPlus = 4;
            asset.NumberPlus = 50;

            expectedPropertyCount = 2;
            this.TestClientContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

            var pc = this.TestClientContext.PublicCompanyPlus.Expand(p => (p as PublicCompanyPlus).AssetsPlus).GetValue() as PublicCompanyPlus;
            var asset2 = pc.AssetsPlus.Where(a => a.AssetIDPlus == 4).First();
            Assert.AreEqual(50, asset2.NumberPlus);
            Assert.IsNull(asset2.NamePlus);

            //Post Navigation property of Singleton
            DataServiceCollection<CompanyPlus> company = new DataServiceCollection<CompanyPlus>(this.TestClientContext.CompanyPlus);
            DepartmentPlus department = new DepartmentPlus();
            company[0].DepartmentsPlus.Add(department);
            department.DepartmentIDPlus = 10001;
            department.NamePlus = "D1";

            expectedPropertyCount = 2;
            this.TestClientContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

            var company2 = this.TestClientContext.CompanyPlus.Expand(p => p.DepartmentsPlus).GetValue();
            var department2 = company2.DepartmentsPlus.Where(d => d.DepartmentIDPlus == 10001).First();
            Assert.AreEqual("D1", department.NamePlus);
            Assert.IsNull(department.DepartmentNOPlus);
        }

        [TestMethod]
        public void PostPartialPropertiesInBatch()
        {
            var batchFlags = new SaveChangesOptions[] { SaveChangesOptions.BatchWithSingleChangeset, SaveChangesOptions.BatchWithIndependentOperations };
            foreach (var batchFlag in batchFlags)
            {
                List<ODataEntry> entries = new List<ODataEntry>();
                this.TestClientContext.Configurations.RequestPipeline.OnEntryEnding((arg) =>
                {
                    entries.Add(arg.Entry);
                });

                DataServiceCollection<CustomerPlus> people =
                    new DataServiceCollection<CustomerPlus>(this.TestClientContext, "People", null, null);
                var person = new CustomerPlus();
                people.Add(person);

                person.FirstNamePlus = "Nelson";
                person.LastNamePlus = "Black";
                person.NumbersPlus = new ObservableCollection<string> { };
                person.EmailsPlus = new ObservableCollection<string> { "abc@abc.com" };
                person.PersonIDPlus = 10001;
                person.CityPlus = "London";
                person.TimeBetweenLastTwoOrdersPlus = new TimeSpan(1);
                person.HomeAddressPlus = new HomeAddressPlus()
                {
                    CityPlus = "Redmond",
                    PostalCodePlus = "98052",
                    StreetPlus = "1 Microsoft Way"
                };

                DataServiceCollection<AccountPlus> accounts =
                    new DataServiceCollection<AccountPlus>(this.TestClientContext);
                var account = new AccountPlus();
                accounts.Add(account);
                account.AccountIDPlus = 110;
                account.CountryRegionPlus = "CN";
                account.AccountInfoPlus = new AccountInfoPlus()
                {
                    FirstNamePlus = "New",
                    LastNamePlus = "Base",
                    IsActivePlus = true,
                };

                DataServiceCollection<ProductPlus> products = new DataServiceCollection<ProductPlus>(this.TestClientContext);
                ProductPlus product = new ProductPlus();
                products.Add(product);
                product.NamePlus = "Apple";
                product.ProductIDPlus = 1000000;
                product.QuantityInStockPlus = 20;
                product.QuantityPerUnitPlus = "Pound";
                product.UnitPricePlus = 0.35f;
                product.DiscontinuedPlus = false;
                product.CoverColorsPlus = new ObservableCollection<ColorPlus>();

                //Post entity into an entity set
                this.TestClientContext.SaveChanges(SaveChangesOptions.PostOnlySetProperties | batchFlag);

                Assert.AreEqual(8, entries.Where(e => e.TypeName.Contains("CustomerPlus")).First().Properties.Count());
                Assert.AreEqual(3, entries.Where(e => e.TypeName.Contains("AccountPlus")).First().Properties.Count());
                Assert.AreEqual(7, entries.Where(e => e.TypeName.Contains("ProductPlus")).First().Properties.Count());
            }
        }

        [TestMethod]
        public void PostFullProperties()
        {
            int expectedPropertyCount = 0;
            ODataEntry entry = null;
            this.TestClientContext.Configurations.RequestPipeline.OnEntryEnding((arg) =>
            {
                entry = arg.Entry;
                Assert.AreEqual(expectedPropertyCount, entry.Properties.Count());
            });

            //Entity of Derived type
            //Entity has a complex property of derived type
            DataServiceCollection<CustomerPlus> people =
                new DataServiceCollection<CustomerPlus>(this.TestClientContext, "People", null, null);
            var person = new CustomerPlus();
            people.Add(person);

            person.FirstNamePlus = "Nelson";
            person.LastNamePlus = "Black";
            person.NumbersPlus = new ObservableCollection<string> { };
            person.EmailsPlus = new ObservableCollection<string> { "abc@abc.com" };
            person.PersonIDPlus = 10001;
            person.CityPlus = "London";
            person.TimeBetweenLastTwoOrdersPlus = new TimeSpan(1);
            person.HomeAddressPlus = new HomeAddressPlus()
            {
                CityPlus = "Redmond",
                PostalCodePlus = "98052",
                StreetPlus = "1 Microsoft Way"
            };

            //Post entity into an entity set
            expectedPropertyCount = 11;
            this.TestClientContext.SaveChanges();

            //Post Navigation property to an entitySet
            var people1 = new DataServiceCollection<CustomerPlus>(this.TestClientContext.CustomersPlus.Where(p => p.PersonIDPlus == 10001));
            OrderPlus order = new OrderPlus();
            people1[0].OrdersPlus.Add(order);
            order.OrderIDPlus = 11111111;
            order.OrderDatePlus = new DateTimeOffset(new DateTime(2011, 5, 29, 14, 21, 12));
            order.OrderShelfLifesPlus = new ObservableCollection<TimeSpan>();

            expectedPropertyCount = 6;
            this.TestClientContext.SaveChanges();
        }

        //Related Fixed When an entity's nullable enum property is set to null, Client cannot correctly serializer the entry
        [TestMethod]
        public void PostFullPropertiesInBatch()
        {
            var batchFlags = new SaveChangesOptions[] { SaveChangesOptions.BatchWithSingleChangeset, SaveChangesOptions.BatchWithIndependentOperations };
            foreach (var batchFlag in batchFlags)
            {
                List<ODataEntry> entries = new List<ODataEntry>();
                this.TestClientContext.Configurations.RequestPipeline.OnEntryEnding((arg) =>
                {
                    entries.Add(arg.Entry);
                });

                DataServiceCollection<CustomerPlus> people =
                    new DataServiceCollection<CustomerPlus>(this.TestClientContext, "People", null, null);
                var person = new CustomerPlus();
                people.Add(person);

                person.FirstNamePlus = "Nelson";
                person.LastNamePlus = "Black";
                person.NumbersPlus = new ObservableCollection<string> { };
                person.EmailsPlus = new ObservableCollection<string> { "abc@abc.com" };
                person.PersonIDPlus = 10001;
                person.CityPlus = "London";
                person.TimeBetweenLastTwoOrdersPlus = new TimeSpan(1);
                person.HomeAddressPlus = new HomeAddressPlus()
                {
                    CityPlus = "Redmond",
                    PostalCodePlus = "98052",
                    StreetPlus = "1 Microsoft Way"
                };

                DataServiceCollection<AccountPlus> accounts =
                    new DataServiceCollection<AccountPlus>(this.TestClientContext);
                var account = new AccountPlus();
                accounts.Add(account);
                account.AccountIDPlus = 110;
                account.CountryRegionPlus = "CN";

                DataServiceCollection<ProductPlus> products = new DataServiceCollection<ProductPlus>(this.TestClientContext);
                ProductPlus product = new ProductPlus();
                products.Add(product);
                product.NamePlus = "Apple";
                product.ProductIDPlus = 1000000;
                product.QuantityInStockPlus = 20;
                product.QuantityPerUnitPlus = "Pound";
                product.UnitPricePlus = 0.35f;
                product.DiscontinuedPlus = false;
                product.CoverColorsPlus = new ObservableCollection<ColorPlus>();

                //Post entity into an entity set
                this.TestClientContext.SaveChanges(batchFlag);

                Assert.AreEqual(11, entries.Where(e => e.TypeName.Contains("CustomerPlus")).First().Properties.Count());
                Assert.AreEqual(3, entries.Where(e => e.TypeName.Contains("AccountPlus")).First().Properties.Count());
                Assert.AreEqual(9, entries.Where(e => e.TypeName.Contains("ProductPlus")).First().Properties.Count());
            }
        }

        [TestMethod]
        public void PostFullPropertiesOfEntityParameterToAction()
        {
            PostPropertiesOfEntityParameterToAction(EntityParameterSendOption.SendFullProperties);
        }

        [TestMethod]
        public void PostOnlySetPropertiesOfEntityParameterToAction()
        {
            PostPropertiesOfEntityParameterToAction(EntityParameterSendOption.SendOnlySetProperties);
        }

        private void PostPropertiesOfEntityParameterToAction(EntityParameterSendOption option)
        {
            TestClientContext.EntityParameterSendOption = option;

            var customer = TestClientContext.CustomersPlus.First();

            OrderPlus order = new OrderPlus();

            var collection = new DataServiceCollection<OrderPlus>(TestClientContext, "OrdersPlus", null, null);
            collection.Add(order);

            int orderId = (new Random()).Next();
            order.OrderIDPlus = orderId;
            order.OrderShelfLifesPlus = new ObservableCollection<TimeSpan>();

            OrderPlus orderCreated = customer.PlaceOrderPlus(order).GetValue();
            Assert.AreEqual(orderId, orderCreated.OrderIDPlus);
        }
    }
}


text:
		<title>Hello Facebook</title>

Hello, Some User!

Here is your information:

Email: Some email!

Gender: Some gender!

Username: Some username!


text:
<?php
namespace Bolt\Storage;

use Bolt\Application;

/**
 *
 */
class ContentLegacyService
{
    use Entity\ContentRelationTrait;
    use Entity\ContentRouteTrait;
    use Entity\ContentSearchTrait;
    use Entity\ContentTaxonomyTrait;
    use Entity\ContentValuesTrait;

    protected $app;

    public function __construct(Application $app)
    {
        $this->app = $app;
    }

    public function initialize($entity)
    {
    }
}


text:
#define _USE_MATH_DEFINES

#include "angle.h"
#include <cmath>

namespace dewalls {

class PercentGrade : public Unit<Angle>
{
public:
    friend class Angle;

    double toBase(double quantity) const;
    double fromBase(double quantity) const;

    PercentGrade(QString name, const Angle *type);
private:
};

inline PercentGrade::PercentGrade(QString name, const Angle *type)
    : Unit<Angle>(name, type)
{

}

inline double PercentGrade::toBase(double quantity) const
{
    return atan(quantity * 0.01L);
}

inline double PercentGrade::fromBase(double quantity) const
{
    return 100L * tan(quantity);
}

} // namespace dewalls

#endif // DEWALLS_PERCENTGRADE_H


text:
class dataHeader extends Polymer.Element {
  static get is () { return 'data-header'; }

  static get properties () {
    return {
      statusText: {
        type: String,
        value: 'SUCSESS'
      }
    };
  }

  getError () {
    this.innerHTML === 'SUCSESS' ? this.innerHTML = 'ERROR' :
      this.innerHTML = 'SUCSESS';
    this.classList.toggle('error');
  }
}
window.customElements.define(dataHeader.is, dataHeader);


text:
package desktop.example.calculator;

import java.awt.Color;
import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 * Main panel for Calculator example.
 *
 * @author Cristiano Gavião
 *
 */
@SuppressWarnings("serial")
public class CalculatorPanel extends JPanel {

	private Calculator calculator = new Calculator();
	private JTextField textField = new JTextField();
	private GridBagLayout gridBagLayout = new GridBagLayout();

	public CalculatorPanel() {
		gridBagLayout.columnWidths = new int[] { 0, 0, 0, 0 };
		gridBagLayout.rowHeights = new int[] { 0, 0, 0 };
		gridBagLayout.columnWeights = new double[] { 0.0, 0.0, 1.0,
				Double.MIN_VALUE };
		gridBagLayout.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
		setLayout(gridBagLayout);
		setName("calculator_panel");
		updateCurrentValue();
		textField.setHorizontalAlignment(JTextField.RIGHT);
		textField.setEditable(false);
		textField.setBackground(Color.WHITE);
		textField.setName("result");
		add(textField, 0, 0, 3, 1, 1, 1, GridBagConstraints.BOTH,
				GridBagConstraints.NORTH, new Insets(5, 5, 5, 5));
		add(createButton('C'), 3, 0, 1, 1, 1, 1, GridBagConstraints.HORIZONTAL,
				GridBagConstraints.NORTH, new Insets(5, 5, 5, 5));

		addButtons(gridBagLayout, new char[][] { { '7', '8', '9', '+' },
				{ '4', '5', '6', '-' }, { '1', '2', '3', '*' },
				{ '0', '.', 0, '/' } });
		add(createButton('='), 2, 5, 2, 1, 1, 1, GridBagConstraints.HORIZONTAL,
				GridBagConstraints.NORTH, new Insets(5, 5, 5, 5));
	}

	public State getCurrentState()
	{
		return getCalculator().getCurrentState();
	}

	private void addButtons(GridBagLayout gridBag, char[][] chars) {
		for (int colIndex = 0; colIndex < chars.length; colIndex++) {
			char[] row = chars[colIndex];
			for (int rowIndex = 0; rowIndex < row.length; rowIndex++) {
				if (chars[colIndex][rowIndex] != 0) {
					add(createButton(row[rowIndex]), rowIndex, colIndex + 1, 1,
							1, 1, rowIndex == 3 ? 10 : 1,
							GridBagConstraints.BOTH, GridBagConstraints.CENTER,
							new Insets(5, 5, 5, 5));
				}
			}
		}
	}

	private void add(Component component, int gridx, int gridy, int gridwidth,
			int gridheight, double weightx, double weighty, int fill,
			int anchor, Insets insets) {
		GridBagConstraints constraint = new GridBagConstraints();
		constraint.gridx = gridx;
		constraint.gridy = gridy;
		constraint.gridwidth = gridwidth;
		constraint.gridheight = gridheight;
		constraint.fill = fill;
		constraint.anchor = anchor;
		constraint.weightx = weightx;
		constraint.weighty = weighty;
		if (insets != null) {
			constraint.insets = insets;
		}
		gridBagLayout.setConstraints(component, constraint);
		add(component, constraint);
	}

	private JButton createButton(final char buttonChar) {
		JButton button = new JButton(String.valueOf(buttonChar));
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent event) {
				calculator.enter(buttonChar);
				updateCurrentValue();
			}
		});
		return button;
	}

	private Calculator getCalculator() {
		return calculator;
	}

	private void updateCurrentValue() {
		textField.setText(calculator.getCurrentValue());
	}

	public static void main(String[] args) throws Exception {
		SampleUtils.show(new CalculatorPanel(), "Calculator");
	}
}


text:
/**
 * Created by vmlf on 05-05-2015.
 */
var Hoek = require('hoek');
var sqlite3 = require('sqlite3');

var internals = {
    defaults: {
        verbose: true,
        connection: ':memory:'
    },
    options: {},
    connect: function connect (cb) {

        console.log('SQLite: Connecting to ' + internals.options.connection);
        var db = new sqlite3.Database(
            internals.options.connection,
            sqlite3.OPEN_READWRITE
        );

        db.once('error', function (err) {
            cb(err, null);
        });
        db.once('open', function () {
            cb(null, this);
        });
    }
};

exports.register = function (server, options, next) {

    internals.options = Hoek.applyToDefaults(internals.defaults, options);

    if (options.verbose) {
        sqlite3.verbose();
    }

    next();
};

exports.register.attributes = {
    name: 'sqlite-data-adapter'
};

exports.execute = function execute (actionsCb, cb) {

    internals.connect(function (err, db) {

        if (err) {
            return cb(err, null);
        }
        else {
            return actionsCb(db, function (err, result) {

                db.close();
                if (err) {
                    return cb(err, null);
                }
                else {
                    return cb(null, result);
                }
            });
        }
    });
};

exports.executeQuery = function executeQuery (query, cb) {

    internals.connect(function (err, db) {

        if (err) {
            return cb(err, null);
        }
        else {
            return db.all(query, function (err, rows) {

                db.close();
                if (err) {
                    return cb(err, null);
                }
                else {
                    return cb(null, rows);
                }
            });
        }
    });
};

exports.executeQueryWithParams = function executeQuery (query, params, cb) {

    internals.connect(function (err, db) {

        if (err) {
            return cb(err, null);
        }
        else {
            return db.all(query, params, function (err, rows) {

                db.close();
                if (err) {
                    return cb(err, null);
                }
                else {
                    return cb(null, rows);
                }
            });
        }
    });
};


text:
title: "コミット時に使う英語のまとめ"
author: azu
layout: post
date : 2015-01-15T20:42
category: 雑記
tags:
    - English
    - Git
    - GitHub
    - まとめ

---

# [awesome-commit-english](https://github.com/azu/awesome-commit-english "azu/awesome-commit-english")

少し前に流行った[awesome-*](https://github.com/bayandin/awesome-awesomeness "bayandin/awesome-awesomeness")的な感じで、コミットメッセージなど使う英語のパターンについて書かれた記事のリンク集を[azu/awesome-commit-english](https://github.com/azu/awesome-commit-english "azu/awesome-commit-english")にまとめてみました。

[![edit](http://monosnap.com/image/2NoqFXIqxNsqB8qwYcs2m51euIDCr8.png)](https://github.com/azu/awesome-commit-english/edit/master/README.md "Editing awesome-commit-english/README.md at master · azu/awesome-commit-english")

GitHub上で編集して簡単にPull Requestできるので参考になる記事等ありましたら追加してみてください。

カテゴリ的なジャンル分けは適当につけたので、好きに追加していいと思います。

- [azu/awesome-commit-english](https://github.com/azu/awesome-commit-english "azu/awesome-commit-english")


text:
require "refile/sequel"

Sequel::Model.extend Refile::Sequel::Attachment

aws = {
  access_key_id: "",
  secret_access_key: "",
  region: "",
  bucket: "",
}

Refile.cache = Refile::S3.new(prefix: "cache", **aws)
Refile.store = Refile::S3.new(prefix: "store", **aws)


text:
package org.apache.giraph.io.formats;

import java.io.IOException;
import java.util.List;
import org.apache.giraph.graph.Vertex;
import org.apache.giraph.io.VertexInputFormat;
import org.apache.giraph.io.VertexReader;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;

/**
 * Sequence file vertex input format based on {@link SequenceFileInputFormat}.
 *
 * @param <I> Vertex id
 * @param <V> Vertex data
 * @param <E> Edge data
 * @param <X> Value type
 */
@SuppressWarnings("rawtypes")
public class SequenceFileVertexInputFormat<I extends WritableComparable,
    V extends Writable, E extends Writable, X extends Vertex<I, V, E, ?>>
    extends VertexInputFormat<I, V, E> {
  /** Internal input format */
  protected SequenceFileInputFormat<I, X> sequenceFileInputFormat =
    new SequenceFileInputFormat<I, X>();

  @Override
  public List<InputSplit> getSplits(JobContext context, int minSplitCountHint)
    throws IOException, InterruptedException {
    return sequenceFileInputFormat.getSplits(context);
  }

  @Override
  public VertexReader<I, V, E> createVertexReader(InputSplit split,
      TaskAttemptContext context) throws IOException {
    return new SequenceFileVertexReader<I, V, E, X>(
        sequenceFileInputFormat.createRecordReader(split, context));
  }

  /**
   * Vertex reader used with {@link SequenceFileVertexInputFormat}.
   *
   * @param <I> Vertex id
   * @param <V> Vertex data
   * @param <E> Edge data
   * @param <X> Value type
   */
  public static class SequenceFileVertexReader<I extends WritableComparable,
      V extends Writable, E extends Writable, X extends Vertex<I, V, E, ?>>
      extends VertexReader<I, V, E> {
    /** Internal record reader from {@link SequenceFileInputFormat} */
    private final RecordReader<I, X> recordReader;

    /**
     * Constructor with record reader.
     *
     * @param recordReader Reader from {@link SequenceFileInputFormat}.
     */
    public SequenceFileVertexReader(RecordReader<I, X> recordReader) {
      this.recordReader = recordReader;
    }

    @Override public void initialize(InputSplit inputSplit,
        TaskAttemptContext context) throws IOException, InterruptedException {
      recordReader.initialize(inputSplit, context);
    }

    @Override public boolean nextVertex() throws IOException,
        InterruptedException {
      return recordReader.nextKeyValue();
    }

    @Override public Vertex<I, V, E, ?> getCurrentVertex()
      throws IOException, InterruptedException {
      return recordReader.getCurrentValue();
    }

    @Override public void close() throws IOException {
      recordReader.close();
    }

    @Override public float getProgress() throws IOException,
        InterruptedException {
      return recordReader.getProgress();
    }
  }
}


text:
function print_usage {
echo "Usage:"
echo "$(basename $0) [OPTIONS]"
echo "  [-i <nxml file or directory>]: Path to the NXML file or directory to process."
echo "  [-s <num to skip>]: OPTIONAL. Number of files to skip prior to processing. Default=0"
echo "  [-n <num to process>]: OPTIONAL. Number of files to process (after any that are skipped). Default = -1 (process all)."
echo "  [-o <maven offline mode>]: OPTIONAL. If set, runs Maven in its offline mode."
echo "  [-m <maven binary>]: OPTIONAL. If set, this is used as the mvn command. By default, the script assumes mvn is on your path."
echo "  [-l <nxml list file>]: OPTIONAL. Points to a file that lists the nxml file (paths relative to the directory specified by -i)."

}

SKIP=0
NUM_TO_PROCESS=-1
MAVEN_OFFLINE=""
MAVEN_BIN=mvn
NXML_LIST_FILE=/NULL

while getopts "i:n:s:m:l:o" OPTION; do
case $OPTION in
# The input ontology file
i) NXML_DIR=$OPTARG
;;
# The number of files to skip prior to processing
s) SKIP=$OPTARG
;;
# The number of files to process (after skip)
n) NUM_TO_PROCESS=$OPTARG
;;
# If set, use the -o flag when running maven
o) MAVEN_OFFLINE=-o
;;
# If set, use the -o flag when running maven
m) MAVEN_BIN=$OPTARG
;;
# If set, use the -o flag when running maven
l) NXML_LIST_FILE=$OPTARG
;;
# HELP!
h) print_usage; exit 0
;;
esac
done

if [[ -z $NXML_DIR ]]; then
echo "missing input arguments!!!!!"
print_usage
exit 1
fi

if ! [[ -e README.md ]]; then
echo "Please run from the root of the project."
exit 1
fi

$MAVEN_BIN -version

$MAVEN_BIN $MAVEN_OFFLINE -e -f scripts/pom-convert-pmc-nxml.xml exec:exec \
-DnxmlDir=$NXML_DIR \
-Dskip=$SKIP \
-DnumToProcess=$NUM_TO_PROCESS \
-DnxmlListFile=$NXML_LIST_FILE