text:
#ifndef __ARCH_RISCV_FAULTS_HH__
#define __ARCH_RISCV_FAULTS_HH__

#include <string>

#include "cpu/thread_context.hh"
#include "sim/faults.hh"

namespace RiscvISA
{

const uint32_t FloatInexact = 1 << 0;
const uint32_t FloatUnderflow = 1 << 1;
const uint32_t FloatOverflow = 1 << 2;
const uint32_t FloatDivZero = 1 << 3;
const uint32_t FloatInvalid = 1 << 4;

enum ExceptionCode {
    INST_ADDR_MISALIGNED = 0,
    INST_ACCESS = 1,
    INST_ILLEGAL = 2,
    BREAKPOINT = 3,
    LOAD_ADDR_MISALIGNED = 4,
    LOAD_ACCESS = 5,
    STORE_ADDR_MISALIGNED = 6,
    AMO_ADDR_MISALIGNED = 6,
    STORE_ACCESS = 7,
    AMO_ACCESS = 7,
    ECALL_USER = 8,
    ECALL_SUPER = 9,
    ECALL_HYPER = 10,
    ECALL_MACH = 11
};

enum InterruptCode {
    SOFTWARE,
    TIMER
};

class RiscvFault : public FaultBase
{
  protected:
    const FaultName _name;
    const ExceptionCode _code;
    const InterruptCode _int;

    RiscvFault(FaultName n, ExceptionCode c, InterruptCode i)
        : _name(n), _code(c), _int(i)
    {}

    FaultName
    name() const
    {
        return _name;
    }

    ExceptionCode
    exception() const
    {
        return _code;
    }

    InterruptCode
    interrupt() const
    {
        return _int;
    }

    virtual void
    invoke_se(ThreadContext *tc, const StaticInstPtr &inst);

    void
    invoke(ThreadContext *tc, const StaticInstPtr &inst);
};

class UnknownInstFault : public RiscvFault
{
  public:
    UnknownInstFault() : RiscvFault("Unknown instruction", INST_ILLEGAL,
            SOFTWARE)
    {}

    void
    invoke_se(ThreadContext *tc, const StaticInstPtr &inst);
};

class UnimplementedFault : public RiscvFault
{
  private:
    const std::string instName;
  public:
    UnimplementedFault(std::string name)
        : RiscvFault("Unimplemented instruction", INST_ILLEGAL, SOFTWARE),
        instName(name)
    {}

    void
    invoke_se(ThreadContext *tc, const StaticInstPtr &inst);
};

class IllegalFrmFault: public RiscvFault
{
  private:
    const uint8_t frm;
  public:
    IllegalFrmFault(uint8_t r)
        : RiscvFault("Illegal floating-point rounding mode", INST_ILLEGAL,
                SOFTWARE),
        frm(r)
    {}

    void invoke_se(ThreadContext *tc, const StaticInstPtr &inst);
};

class BreakpointFault : public RiscvFault
{
  public:
    BreakpointFault() : RiscvFault("Breakpoint", BREAKPOINT, SOFTWARE)
    {}

    void
    invoke_se(ThreadContext *tc, const StaticInstPtr &inst);
};

class SyscallFault : public RiscvFault
{
  public:
    // TODO: replace ECALL_USER with the appropriate privilege level of the
    // caller
    SyscallFault() : RiscvFault("System call", ECALL_USER, SOFTWARE)
    {}

    void
    invoke_se(ThreadContext *tc, const StaticInstPtr &inst);
};

} // namespace RiscvISA

#endif // __ARCH_RISCV_FAULTS_HH__


text:
<?php

class Laka extends Controller
{
	function __construct()
	{
		parent::__construct();
		Session::init();
	}

	function index()
	{
		$this->view->listLaka = $this->model->getListLaka();
		$this->view->render('laka/index');
	}

	function detail($id)
	{
		$this->view->detailLaka = array_shift($this->model->getDetailLaka($id));
		$this->view->detailLoanLaka = array_shift($this->model->getDetailLoanLaka($id));
		$this->view->render('laka/detail', true);
	}

	function formAddNew()
	{
		$this->view->render('laka/formaddnew', true);
	}

	function save()
	{
		$this->model->saveDetailLaka();
	}

	function update()
	{
		$this->model->updateDetailLaka();
	}

	function lunasLoanLaka()
	{
		$this->model->lunasLoanLaka();
	}

	function delete()
	{
		$this->model->delete();
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.exciseman.appengine.endpoints;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

// [START example]
@SuppressWarnings("serial")
public class Test extends HttpServlet {

  @Override
  public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    PrintWriter out = resp.getWriter();
    out.println("Hello, Dudes");
  }
}
// [END example]


text:
package com.loiane.cursojava.aula15Exercicios;

import java.util.Scanner;

public class Exercicio01 {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		System.out.println("Digite um número inteiro:");
		int num01 = scan.nextInt();
		System.out.println("Digite outro número inteiro:");
		int num02 = scan.nextInt();

		if (num01 > num02){
			System.out.println("O maior número é: " + num01);
		} else {
			System.out.println("O maior número é: " + num02);
		}
	}

}


text:
<?php declare(strict_types=1);

namespace Gos\Bundle\WebSocketBundle\DataCollector;

use Symfony\Component\Stopwatch\StopwatchEvent;

trigger_deprecation('gos/web-socket-bundle', '3.1', 'The "%s" class is deprecated and will be removed in 4.0.', WebsocketDataCollector::class);

/**
 * @deprecated to be removed in 4.0
 */
final class WebsocketDataCollector extends WebsocketCompatibilityDataCollector
{
    private array $rawData = [];

    public function lateCollect(): void
    {
        $pusherCount = [];
        $totalPush = 0;
        $pusherDuration = [];
        $durationTotal = 0.0;

        foreach ($this->rawData as $pusherName => $durations) {
            if (!isset($pusherCount[$pusherName])) {
                $pusherCount[$pusherName] = 0;
            }

            $pusherDurationTotal = array_sum($durations);
            $pusherCount[$pusherName] += $count = \count($durations);
            $totalPush += $count;
            $pusherDuration[$pusherName] = $pusherDurationTotal;
            $durationTotal += $pusherDurationTotal;
        }

        $this->data = [
            'pusher_counts' => $pusherCount,
            'push_total' => $totalPush,
            'durations' => $pusherDuration,
            'duration_total' => $durationTotal,
        ];
    }

    /**
     * @return int[]
     */
    public function getPusherCounts(): array
    {
        return $this->data['pusher_counts'];
    }

    public function getTotalDuration(): float
    {
        return $this->data['duration_total'];
    }

    /**
     * @return float[]
     */
    public function getDurations(): array
    {
        return $this->data['durations'];
    }

    public function getPushTotal(): int
    {
        return $this->data['push_total'];
    }

    public function collectData(StopwatchEvent $event, string $pusherName): void
    {
        if (!isset($this->rawData[$pusherName])) {
            $this->rawData[$pusherName] = [];
        }

        $this->rawData[$pusherName][] = $event->getDuration();
    }

    public function reset(): void
    {
        $this->rawData = [];

        $this->data = [
            'pusher_counts' => [],
            'push_total' => 0,
            'durations' => [],
            'duration_total' => 0,
        ];
    }

    public function getName(): string
    {
        return 'websocket';
    }
}


text:
* Postgres Database + sidekick with volume data
* Load Balancer

## Info
* Easy setup with all needed data: `database_name`, `user`, `password`
* Load Balancer used to forward Postgres port for the external services.


text:
@interface MPRewardedVideoAdManager () <MPAdServerCommunicatorDelegate, MPRewardedVideoAdapterDelegate>

@property (nonatomic, strong) MPRewardedVideoAdapter *adapter;
@property (nonatomic, strong) MPAdServerCommunicator *communicator;
@property (nonatomic, strong) MPAdConfiguration *configuration;
@property (nonatomic, assign) BOOL loading;
@property (nonatomic, assign) BOOL playedAd;
@property (nonatomic, assign) BOOL ready;

@end

@implementation MPRewardedVideoAdManager

- (instancetype)initWithAdUnitID:(NSString *)adUnitID delegate:(id<MPRewardedVideoAdManagerDelegate>)delegate
{
    if (self = [super init]) {
        _adUnitID = [adUnitID copy];
        _communicator = [[MPCoreInstanceProvider sharedProvider] buildMPAdServerCommunicatorWithDelegate:self];
        _delegate = delegate;
    }

    return self;
}

- (void)dealloc
{
    [_communicator cancel];
}

- (Class)customEventClass
{
    return self.configuration.customEventClass;
}

- (BOOL)hasAdAvailable
{
    // If we've already played an ad, return NO since we allow one play per load.
    if (self.playedAd) {
        return NO;
    }
    return [self.adapter hasAdAvailable];
}

- (void)loadRewardedVideoAdWithKeywords:(NSString *)keywords location:(CLLocation *)location customerId:(NSString *)customerId
{
    // We will just tell the delegate that we have loaded an ad if we already have one ready. However, if we have already
    // played a video for this ad manager, we will go ahead and request another ad from the server so we aren't potentially
    // stuck playing ads from the same network for a prolonged period of time which could be unoptimal with respect to the waterfall.
    if (self.ready && !self.playedAd) {
        // If we already have an ad, do not set the customerId. We'll leave the customerId as the old one since the ad we currently have
        // may be tied to an older customerId.
        [self.delegate rewardedVideoDidLoadForAdManager:self];
    } else {
        // This has multiple behaviors. For ads that require us to set the customID: (outside of load), this will overwrite the ad's previously
        // set customerId. Other ads require customerId on presentation in which we will use this new id coming in when presenting the ad.
        self.customerId = customerId;
        [self loadAdWithURL:[MPAdServerURLBuilder URLWithAdUnitID:self.adUnitID
                                                         keywords:keywords
                                                         location:location
                                                          testing:NO]];
    }
}

- (void)presentRewardedVideoAdFromViewController:(UIViewController *)viewController
{
    // If we've already played an ad, don't allow playing of another since we allow one play per load.
    if (self.playedAd) {
        NSError *error = [NSError errorWithDomain:MoPubRewardedVideoAdsSDKDomain code:MPRewardedVideoAdErrorAdAlreadyPlayed userInfo:nil];
        [self.delegate rewardedVideoDidFailToPlayForAdManager:self error:error];
        return;
    }

    [self.adapter presentRewardedVideoFromViewController:viewController];
}

- (void)handleAdPlayedForCustomEventNetwork
{
    // We only need to notify the backing ad network if the ad is marked ready for display.
    if (self.ready) {
        [self.adapter handleAdPlayedForCustomEventNetwork];
    }
}

#pragma mark - Private

- (void)loadAdWithURL:(NSURL *)URL
{
    self.playedAd = NO;

    if (self.loading) {
        MPLogWarn(@"Rewarded video manager is already loading an ad. "
                  @"Wait for previous load to finish.");
        return;
    }

    MPLogInfo(@"Rewarded video manager is loading ad with MoPub server URL: %@", URL);

    self.loading = YES;
    [self.communicator loadURL:URL];
}

#pragma mark - MPAdServerCommunicatorDelegate

- (void)communicatorDidReceiveAdConfiguration:(MPAdConfiguration *)configuration
{
    self.configuration = configuration;

    MPLogInfo(@"Rewarded video ad is fetching ad network type: %@", self.configuration.networkType);

    if (self.configuration.adUnitWarmingUp) {
        MPLogInfo(kMPWarmingUpErrorLogFormatWithAdUnitID, self.adUnitID);
        self.loading = NO;
        NSError *error = [NSError errorWithDomain:MoPubRewardedVideoAdsSDKDomain code:MPRewardedVideoAdErrorAdUnitWarmingUp userInfo:nil];
        [self.delegate rewardedVideoDidFailToLoadForAdManager:self error:error];
        return;
    }

    if ([self.configuration.networkType isEqualToString:kAdTypeClear]) {
        MPLogInfo(kMPClearErrorLogFormatWithAdUnitID, self.adUnitID);
        self.loading = NO;
        NSError *error = [NSError errorWithDomain:MoPubRewardedVideoAdsSDKDomain code:MPRewardedVideoAdErrorNoAdsAvailable userInfo:nil];
        [self.delegate rewardedVideoDidFailToLoadForAdManager:self error:error];
        return;
    }

    MPRewardedVideoAdapter *adapter = [[MPInstanceProvider sharedProvider] buildRewardedVideoAdapterWithDelegate:self];

    if (!adapter) {
        NSError *error = [NSError errorWithDomain:MoPubRewardedVideoAdsSDKDomain code:MPRewardedVideoAdErrorUnknown userInfo:nil];
        [self rewardedVideoDidFailToLoadForAdapter:nil error:error];
        return;
    }

    self.adapter = adapter;
    [self.adapter getAdWithConfiguration:configuration];
}

- (void)communicatorDidFailWithError:(NSError *)error
{
    self.ready = NO;
    self.loading = NO;

    [self.delegate rewardedVideoDidFailToLoadForAdManager:self error:error];
}

#pragma mark - MPRewardedVideoAdapterDelegate

- (id<MPMediationSettingsProtocol>)instanceMediationSettingsForClass:(Class)aClass
{
    for (id<MPMediationSettingsProtocol> settings in self.mediationSettings) {
        if ([settings isKindOfClass:aClass]) {
            return settings;
        }
    }

    return nil;
}

- (void)rewardedVideoDidLoadForAdapter:(MPRewardedVideoAdapter *)adapter
{
    self.ready = YES;
    self.loading = NO;
    [self.delegate rewardedVideoDidLoadForAdManager:self];
}

- (void)rewardedVideoDidFailToLoadForAdapter:(MPRewardedVideoAdapter *)adapter error:(NSError *)error
{
    self.ready = NO;
    self.loading = NO;
    [self loadAdWithURL:self.configuration.failoverURL];
}

- (void)rewardedVideoDidExpireForAdapter:(MPRewardedVideoAdapter *)adapter
{
    self.ready = NO;
    [self.delegate rewardedVideoDidExpireForAdManager:self];
}

- (void)rewardedVideoDidFailToPlayForAdapter:(MPRewardedVideoAdapter *)adapter error:(NSError *)error
{
    [self.delegate rewardedVideoDidFailToPlayForAdManager:self error:error];
}

- (void)rewardedVideoWillAppearForAdapter:(MPRewardedVideoAdapter *)adapter
{
    [self.delegate rewardedVideoWillAppearForAdManager:self];
}

- (void)rewardedVideoDidAppearForAdapter:(MPRewardedVideoAdapter *)adapter
{
    [self.delegate rewardedVideoDidAppearForAdManager:self];
}

- (void)rewardedVideoWillDisappearForAdapter:(MPRewardedVideoAdapter *)adapter
{
    [self.delegate rewardedVideoWillDisappearForAdManager:self];
}

- (void)rewardedVideoDidDisappearForAdapter:(MPRewardedVideoAdapter *)adapter
{
    self.ready = NO;
    self.playedAd = YES;
    [self.delegate rewardedVideoDidDisappearForAdManager:self];
}

- (void)rewardedVideoDidReceiveTapEventForAdapter:(MPRewardedVideoAdapter *)adapter
{
    [self.delegate rewardedVideoDidReceiveTapEventForAdManager:self];
}

- (void)rewardedVideoWillLeaveApplicationForAdapter:(MPRewardedVideoAdapter *)adapter
{
    [self.delegate rewardedVideoWillLeaveApplicationForAdManager:self];
}

- (void)rewardedVideoShouldRewardUserForAdapter:(MPRewardedVideoAdapter *)adapter reward:(MPRewardedVideoReward *)reward
{
    [self.delegate rewardedVideoShouldRewardUserForAdManager:self reward:reward];
}

- (NSString *)rewardedVideoAdUnitId
{
    return self.adUnitID;
}

- (NSString *)rewardedVideoCustomerId
{
    return self.customerId;
}

@end


text:
package p08_pokemonTrainer.engine;

import p08_pokemonTrainer.models.Pokemon;
import p08_pokemonTrainer.models.Trainer;

import java.util.Comparator;
import java.util.Map;

public class CommandCenter {

    private static final String FIRE_ELEMENT = "Fire";
    private static final String WATER_ELEMENT = "Water";
    private static final String ELECTRICITY_ELEMENT = "Electricity";

    public CommandCenter() {
    }

    public void caughtPokemon(Map<String,Trainer> trainersDB, String tournamentLine) {
        /**input is in format "<TrainerName> <PokemonName> <PokemonElement> <PokemonHealth>"*/
        String[] tokens = tournamentLine.split("\\s+");

        String trainerName = tokens[0];
        String pokemonName = tokens[1];
        String pokemonElement = tokens[2];
        int pokemonHealth = Integer.parseInt(tokens[3]);

        Trainer trainer = new Trainer(trainerName);
        trainersDB.putIfAbsent(trainerName, trainer);

        Pokemon pokemon = new Pokemon(pokemonName, pokemonElement, pokemonHealth);
        trainersDB.get(trainerName).addPokemon(pokemon);
    }

    public void execute(Map<String,Trainer> trainersDB, String elementLine) {
        switch (elementLine) {
            case FIRE_ELEMENT:
                action(FIRE_ELEMENT, trainersDB);
                break;
            case WATER_ELEMENT:
                action(WATER_ELEMENT, trainersDB);
                break;
            case ELECTRICITY_ELEMENT:
                action(ELECTRICITY_ELEMENT, trainersDB);
                break;
        }
    }

    private void action(String element, Map<String,Trainer> trainersDB) {
        /**For every command you must check if a trainer has atleast 1 pokemon with the given element,
         * if he does he receives 1 badge, otherwise all his pokemon lose 10 health,
         * if a pokemon falls to 0 or less health he dies and must be deleted from the
         * trainer's collection. */

        trainersDB.values().forEach(trainer -> {
            if (trainer.hasAtleastOnePokemon(element)) {
                trainer.receiveBadge();
            } else {
                trainer.decreasePokemonsHealth();
            }
        });
    }

    public void print(Map<String,Trainer> trainersDB) {
        /**print all trainers
         * sorted by the amount of badges they have in descending order
         * (if two trainers have the same amount of badges they should be sorted by
         * order of appearance in the input)*/

        trainersDB.values().stream()
                .sorted(Comparator.comparing(Trainer::getNumberOfBadges, Comparator.reverseOrder()))
                .forEach(System.out::println);
    }
}


text:
import xmlrpclib
server = xmlrpclib.Server('http://127.0.0.1:8000/RPC2')
print server.getUser('moshez')


text:
title: Media Lokal berbasis Citizen Jurnalism
date: 2011-09-16 11:08:00 +07:00
nohibah: 156
inisiator: Sarinah
lokasi: Palu, Sulawesi Tengah
dana: 25 Juta Rupiah
topik: Kebebasan dan etika bermedia
lama: Januari - Juli 2012
deskripsi: Sebuah proyek yang didirikan untuk mendorong publik ditingkatan lokal untuk
  menulis dengan website sebagai pusat konsentrasi informasi dari segala jaringan.
  Media ini juga akan dibentuk dalam versi cetak untuk menjangkau komunitas yang belum
  mampu mengakses internet. Proyek ini juga ditujukan untuk pengembangan manajemen
  mandiri, pengawalan dan advokasi pengembangan media lokal berbasis citizen jurnalism
masalah: Budaya lisan yang masih dominan dalam kesadaran publik, publik yang masih
  pasif sebagai informan sehingga informasi kebanyakan bersifat top-down, dan citizen
  jurnalism masih dipandang sebelah mata
solusi: Bertindak sebagai alat pendorong agar publik menjadi aktif dalam memberikan
  informasi (sebagai jurnalis), mengadakan kampanye dan pelatihan kepada publik yang
  bertujuan membumikan citizen jurnalism, dan mengembangkan kualitas citizen jurnalism
  dari segi konten, kualitas tulisan, teknologi, media, etika dan manfaat
keberhasilan: Secara fisik, jika ada media lokal berbasis citizen jurnalism yang berwujud
  cetak dengan sirkulasi yang regular. Secara kultural, jika terjadi peningkatan kuantitatif
  maupun kualitatif partisipasi publik lokal dalam program citizen jurnalism ini
diuntungkan: Publik lokal/komunitas kota Palu dan sekitarnya
organisasi: NA
layout: hibahcmb
---

![156](/static/img/hibahcmb/156.png){: .img-responsive }{: width="350" }

### {{ page.nohibah }} - {{ page.title }}

---


text:
package org.broadinstitute.hellbender.tools.exome.orientationbiasvariantfilter;

import htsjdk.variant.variantcontext.Allele;
import htsjdk.variant.variantcontext.Genotype;
import htsjdk.variant.variantcontext.GenotypeBuilder;
import htsjdk.variant.variantcontext.VariantContext;
import htsjdk.variant.vcf.VCFConstants;
import org.broadinstitute.hellbender.engine.FeatureDataSource;
import org.broadinstitute.hellbender.tools.picard.analysis.artifacts.Transition;
import org.broadinstitute.hellbender.utils.test.BaseTest;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.io.File;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.StreamSupport;

public class OrientationBiasUtilsUnitTest extends BaseTest {
    private static final File TEST_RESOURCE_DIR = new File("src/test/resources/org/broadinstitute/hellbender/tools/exome/orientationbiasvariantfilter/");
    public static final String smallM2VcfMore = TEST_RESOURCE_DIR.getAbsolutePath() + "/small_m2_more_variants.vcf";

    @Test(dataProvider = "BasicTransitionsWithRC")
    public void testFindReverseComplementTransitions(List<Transition> transition, List<Transition> reverseComplement) {

        final List<Transition> result = OrientationBiasUtils.createReverseComplementTransitions(transition);
        IntStream.range(0, result.size()).forEachOrdered(i -> Assert.assertEquals(result.get(i), reverseComplement.get(i)));
    }

    @DataProvider(name = "BasicTransitionsWithRC")
    public Object[][] basicTransitionsWithRC() {
        return new Object[][]{
                {Collections.singletonList(Transition.transitionOf('C', 'A')), Collections.singletonList(Transition.transitionOf('G', 'T'))},
                {Collections.singletonList(Transition.transitionOf('A', 'T')), Collections.singletonList(Transition.transitionOf('T', 'A'))},
                {Arrays.asList(Transition.transitionOf('A', 'T'), Transition.transitionOf('C', 'T')), Arrays.asList(Transition.transitionOf('T', 'A'), Transition.transitionOf('G', 'A'))}
        };
    }

    @Test
    public void testCountNumTransition() {

        // Setup the test
        final FeatureDataSource<VariantContext> featureDataSource = new FeatureDataSource<>(new File(smallM2VcfMore));
        SortedSet<Transition> relevantTransitions = new TreeSet<>();
        relevantTransitions.add(Transition.transitionOf('T', 'A'));
        final List<VariantContext> variantContexts = getVariantContexts(featureDataSource);

        // Should be one, since one of the variants was filtered.
        Assert.assertEquals(OrientationBiasUtils.calculateNumTransition("TUMOR", variantContexts, relevantTransitions.first()), 1);
        Assert.assertEquals(OrientationBiasUtils.calculateNumTransition("NORMAL", variantContexts, relevantTransitions.first()), 0);
    }

    private List<VariantContext> getVariantContexts(FeatureDataSource<VariantContext> featureDataSource) {
        return StreamSupport.stream(featureDataSource.spliterator(), false).collect(Collectors.toList());
    }

    @Test
    public void testCountNumUnfiltered() {

        // Setup the test
        final FeatureDataSource<VariantContext> featureDataSource = new FeatureDataSource<>(new File(smallM2VcfMore));
        final List<VariantContext> variantContexts = getVariantContexts(featureDataSource);
        Assert.assertEquals(OrientationBiasUtils.calculateUnfilteredNonRefGenotypeCount(variantContexts, "TUMOR"), 9);
        Assert.assertEquals(OrientationBiasUtils.calculateUnfilteredNonRefGenotypeCount(variantContexts, "NORMAL"), 0);
    }

    @Test(dataProvider = "GenotypeFiltering")
    public void testUpdatingGenotypeFilter(String inFilter, String addFilter, String updatedFilter) {
        Assert.assertEquals(OrientationBiasUtils.addFilterToGenotype(inFilter, addFilter), updatedFilter);
    }

    @Test(dataProvider = "basicTransitions")
    public void testGenotypeInTransitions(Genotype g, Transition t, boolean isInTransition, boolean isInTransitionOrTransitionRC) {
        Assert.assertEquals(OrientationBiasUtils.isGenotypeInTransition(g, t), isInTransition);
        Assert.assertEquals(OrientationBiasUtils.isGenotypeInTransitionWithComplement(g, t), isInTransitionOrTransitionRC);
    }

    @DataProvider(name="basicTransitions")
    public Object [] [] basicTransitions() {

        final List<Allele> ctoTAlleles = new ArrayList<>();
        ctoTAlleles.add(Allele.create("C", true));
        ctoTAlleles.add(Allele.create("T", false));

        final List<Allele> gtoTAlleles = new ArrayList<>();
        gtoTAlleles.add(Allele.create("G", true));
        gtoTAlleles.add(Allele.create("T", false));

        final List<Allele> gtoAAlleles = new ArrayList<>();
        gtoAAlleles.add(Allele.create("G", true));
        gtoAAlleles.add(Allele.create("A", false));

        final List<Allele> gtoCAlleles = new ArrayList<>();
        gtoCAlleles.add(Allele.create("G", true));
        gtoCAlleles.add(Allele.create("C", false));

        return new Object[] [] {
                // Genotype, transition, is in transition, is in transition or transition rc
                {GenotypeBuilder.create("DUMMYSAMPLE", ctoTAlleles), Transition.CtoT, true, true },
                {GenotypeBuilder.create("DUMMYSAMPLE", gtoTAlleles), Transition.CtoT, false, false },
                {GenotypeBuilder.create("DUMMYSAMPLE", gtoAAlleles), Transition.CtoT, false, true },
                {GenotypeBuilder.create("DUMMYSAMPLE", gtoCAlleles), Transition.CtoT, false, false },
                {GenotypeBuilder.create("DUMMYSAMPLE", ctoTAlleles), Transition.AtoT, false, false },
                {GenotypeBuilder.create("DUMMYSAMPLE", gtoTAlleles), Transition.AtoT, false, false },
                {GenotypeBuilder.create("DUMMYSAMPLE", gtoAAlleles), Transition.AtoT, false, false },
                {GenotypeBuilder.create("DUMMYSAMPLE", gtoCAlleles), Transition.AtoT, false, false }
        };
    }

    @DataProvider(name = "GenotypeFiltering")
    public Object[][] genotypeFiltering() {
        return new Object[][]{
                {VCFConstants.PASSES_FILTERS_v4, "Foo", "Foo"},
                {"Foo", "Bar", "Foo;Bar"},
                {"Foo", "Bar;Baz", "Foo;Bar;Baz"},
                {"Foo;Baz", "Bar", "Foo;Baz;Bar"},
                {null, "Foo", "Foo"},
                {VCFConstants.UNFILTERED, "Foo", "Foo"},
        };
    }
}


text:
/** @docs-private */
export function getMatFormFieldPlaceholderConflictError(): Error {
  return Error('Placeholder attribute and child element were both specified.');
}

/** @docs-private */
export function getMatFormFieldDuplicatedHintError(align: string): Error {
  return Error(`A hint was already declared for 'align="${align}"'.`);
}

/** @docs-private */
export function getMatFormFieldMissingControlError(): Error {
  return Error('mat-form-field must contain a MatFormFieldControl.');
}


text:
from os import path
from setuptools import setup

README = path.join(path.dirname(path.abspath(__file__)), "README.rst")

setup(
    name="fforms",
    version="1.1.1",
    description=("Standalone HTML form validation library"),
    long_description=open(README).read(),
    author="Felipe Ochoa",
    author_email="felipeochoa@find-me-on-github.com",
    url="https://github.com/felipeochoa/fforms",
    license="MIT",
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 3 :: Only',
        'License :: OSI Approved :: MIT License',
    ],
    keywords="forms form html",
    packages=["fforms"],
    test_suite="tests",
)


text:
package com.studio4plus.homerplayer;

import android.content.Context;

import com.studio4plus.homerplayer.model.AudioBookManager;
import com.studio4plus.homerplayer.model.FileScanner;
import com.studio4plus.homerplayer.model.Storage;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

@Module
public class AudioBookManagerModule {

    private final String audioBooksDirectoryName;

    public AudioBookManagerModule(String audioBooksDirectoryName) {
        this.audioBooksDirectoryName = audioBooksDirectoryName;
    }

    @Provides @Singleton
    FileScanner provideFileScanner() {
        return new FileScanner(audioBooksDirectoryName);
    }

    @Provides @Singleton
    Storage provideStorage(Context context) {
        return new Storage(context);
    }

    @Provides @Singleton
    AudioBookManager provideAudioBookManager(FileScanner fileScanner, Storage storage) {
        return new AudioBookManager(fileScanner, storage);
    }
}


text:
from google.cloud import automl_v1

async def sample_deploy_model():
    # Create a client
    client = automl_v1.AutoMlAsyncClient()

    # Initialize request argument(s)
    request = automl_v1.DeployModelRequest(
        name="name_value",
    )

    # Make the request
    operation = client.deploy_model(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)

# [END automl_v1_generated_AutoMl_DeployModel_async]


text:
GENDARME_EXE="./gendarme/gendarme.exe"

if [ ! -e "$GENDARME_EXE" ]; then
  GENDARME_EXE="../gendarme/gendarme.exe"
  if [ ! -e "$GENDARME_EXE"  ]; then
    echo "Gendarme not found."
    exit 1
  fi
fi

echo "Gendarme found at $GENDARME_EXE"

mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.Common/bin/Debug/IdleLandsRedux.Common.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.Common.Tests/bin/Debug/IdleLandsRedux.Common.Tests.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.Contracts/bin/Debug/IdleLandsRedux.Contracts.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.Contracts.Tests/bin/Debug/IdleLandsRedux.Contracts.Tests.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.Core/bin/Debug/IdleLandsRedux.exe
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.DataAccess/bin/Debug/IdleLandsRedux.DataAccess.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.GameLogic/bin/Debug/IdleLandsRedux.GameLogic.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.GameLogic.DataEntities/bin/Debug/IdleLandsRedux.GameLogic.DataEntities.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.GameLogic.DataEntities.Tests/bin/Debug/IdleLandsRedux.GameLogic.DataEntities.Tests.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.GameLogic.Tests/bin/Debug/IdleLandsRedux.GameLogic.Tests.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.InteropPlugins/bin/Debug/IdleLandsRedux.InteropPlugins.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.InteropPlugins.Tests/bin/Debug/IdleLandsRedux.InteropPlugins.Tests.dll
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.WebService/bin/Debug/IdleLandsRedux.WebService.exe
mono $GENDARME_EXE -config ./rules.xml IdleLandsRedux.WebService.Tests/bin/Debug/IdleLandsRedux.WebService.Tests.dll

exit 0


text:
from django import forms

from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Submit
from crispy_forms.bootstrap import FormActions

from .models import BaseClient, TeamClient, TeamSubmission

password_help = """

Choose a password for cloning and submitting your code.

It will be stored inplain text
so that you and your team
 members will be able
to see it. It can be changed at any time.

"""

class TeamRepoForm(forms.ModelForm):
    base = forms.ModelChoiceField(queryset=BaseClient.objects.all(),
                                  label="Client Language")
    git_password = forms.CharField(help_text=password_help)

    class Meta:
        model = TeamClient
        fields = ('base', 'git_password')

    def __init__(self, *args, **kwargs):
        # Crispy form styling stuff
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'
        self.helper.layout = Layout(
            Fieldset(
                "Setup your team's code repository",
                'base',
                'git_password',
            ),
            FormActions(
                Submit('submit', 'Submit', css_class='button white')
            )
        )

        # Limit base repo queryset
        base_clients = kwargs.pop('base_clients', None)
        super(TeamRepoForm, self).__init__(*args, **kwargs)
        if base_clients:
            self.fields['base'].queryset = base_clients

    def clean_git_password(self):
        password = self.cleaned_data['git_password']
        if len(password) < 6:
            msg = "Password should be at least 6 characters"
            raise forms.ValidationError(msg)
        return password

class TeamPasswordForm(forms.ModelForm):
    git_password = forms.CharField(help_text=password_help)

    class Meta:
        model = TeamClient
        fields = ('git_password',)

    def __init__(self, *args, **kwargs):
        # Crispy form styling stuff
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'

        self.helper.layout = Layout(
            Fieldset(
                "Change your team's git password",
                'git_password',
            ),
            FormActions(
                Submit('submit', 'Submit', css_class='button white')
            )
        )
        super(TeamPasswordForm, self).__init__(*args, **kwargs)

    def clean_git_password(self):
        password = self.cleaned_data['git_password']
        if len(password) < 6:
            msg = "Password should be at least 6 characters"
            raise forms.ValidationError(msg)
        return password

class SubmitForm(forms.ModelForm):
    class Meta:
        model = TeamSubmission
        fields = ('name',)

    def __init__(self, *args, **kwargs):
        # Crispy form styling stuff
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-lg-2'
        self.helper.field_class = 'col-lg-8'
        self.helper.layout = Layout(
            Fieldset(
                'Submit to the arena',
                'name',
            ),
            FormActions(
                Submit('submit', 'Submit', css_class='button white')
            )
        )
        super(SubmitForm, self).__init__(*args, **kwargs)

    def validate_unique(self):
        exclude = self._get_validation_exclusions()
        exclude.remove('teamclient')

        try:
            self.instance.validate_unique(exclude=exclude)
        except forms.ValidationError, e:
            self._update_errors(e)

class AuthForm(forms.Form):
    """Used by the RepoAuthHandler to check data from API clients"""
    teamid = forms.IntegerField(required=True)
    password = forms.CharField(required=True)


text:
    x

Commit

        Commit message
        <textarea></textarea>

        <button data-action="commit">Commit</button>

    x

Pull

        From Remote
            <select id="remote">
                {% for remote in repo.remotes %}
                <option value="{{remote}}">{{remote}}</option>
                {% endfor %}
            </select>or URL

        with remote branch
            <select id="branch"></select>
        to local branch {{repo.active_branch}}

...output...

        <button data-action="openMergetool">Mergetool</button>
        <button data-action="pull">Pull</button>

    x

Push

            To Remote
            <select id="remote">
                {% for remote in repo.remotes %}
                <option value="{{remote}}">{{remote}}</option>
                {% endfor %}
            </select>or URL

            with remote branch
            <select id="branch"></select>
        from local branch {{repo.active_branch}}

...output...

        <button data-action="push">Push</button>

    x

Revert

Are you sure you want revert the changes in ?
This action can not be undone!

        <button data-action="revert">Yes, I am</button>

    x

            email:

            FACEBOOK

            name:

            gender:

            facebook:

            locale:

            timezone:

            username:

            works:

            education:

            STATISTICS

            commits:[commits]

            last-commit:[last-commit]

            first-commit:[first-commit]

        <button class="close">Close</button>

    x

Ignore File(s)

        Select the line to append in your .gitignore file:

            <input type="radio" checked name="gitignorepath" id="gitignorepath1">

            <input type="radio" name="gitignorepath" id="gitignorepath2">

            <input type="radio" name="gitignorepath" id="gitignorepath3">

        <button data-action="addtogitignore">Apply</button>

    x

Create Branch

        Name of branch
        <input type="text" name="branch" id="">

...output...

        <button data-action="createbranch">Create</button>

    x

Open Repo

        Name of repository
        <input type="text" name="branch" id="">

        Path
        <input type="file" name="directory" id="">

...output...

        <button data-action="createbranch">Create</button>

    x

MeowGit Configuration

            mergetool:
            <input type="text" name="mergetool" value="{{config.mergetool}}">

Select the default repository:

            {% for repo in config.repositories %}

                <input value="{{repo.path}}" type="radio" {% if repo.active %}checked{% endif %} name="repopath" id="repopath{{ loop.index }}">
                {{repo.name}} - {{repo.path}}

            {% endfor %}

                <input value="__none__" type="radio" name="repopath" id="repopathnone">
                None

        <button data-action="unimplemented">Save</button>


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

// @ts-ignore: This will be removed from built files and is here to make the types available during dev work
import { CookieJar } from "@types/tough-cookie";

import { AbortError, HttpError, TimeoutError } from "./Errors";
import { HttpClient, HttpRequest, HttpResponse } from "./HttpClient";
import { ILogger, LogLevel } from "./ILogger";
import { Platform, getGlobalThis, isArrayBuffer } from "./Utils";

export class FetchHttpClient extends HttpClient {
    private readonly _abortControllerType: { prototype: AbortController, new(): AbortController };
    private readonly _fetchType: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
    private readonly _jar?: CookieJar;

    private readonly _logger: ILogger;

    public constructor(logger: ILogger) {
        super();
        this._logger = logger;

        if (typeof fetch === "undefined") {
            // In order to ignore the dynamic require in webpack builds we need to do this magic
            // @ts-ignore: TS doesn't know about these names
            const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;

            // Cookies aren't automatically handled in Node so we need to add a CookieJar to preserve cookies across requests
            this._jar = new (requireFunc("tough-cookie")).CookieJar();
            this._fetchType = requireFunc("node-fetch");

            // node-fetch doesn't have a nice API for getting and setting cookies
            // fetch-cookie will wrap a fetch implementation with a default CookieJar or a provided one
            this._fetchType = requireFunc("fetch-cookie")(this._fetchType, this._jar);
        } else {
            this._fetchType = fetch.bind(getGlobalThis());
        }
        if (typeof AbortController === "undefined") {
            // In order to ignore the dynamic require in webpack builds we need to do this magic
            // @ts-ignore: TS doesn't know about these names
            const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;

            // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide
            this._abortControllerType = requireFunc("abort-controller");
        } else {
            this._abortControllerType = AbortController;
        }
    }

    /** @inheritDoc */
    public async send(request: HttpRequest): Promise<HttpResponse> {
        // Check that abort was not signaled before calling send
        if (request.abortSignal && request.abortSignal.aborted) {
            throw new AbortError();
        }

        if (!request.method) {
            throw new Error("No method defined.");
        }
        if (!request.url) {
            throw new Error("No url defined.");
        }

        const abortController = new this._abortControllerType();

        let error: any;
        // Hook our abortSignal into the abort controller
        if (request.abortSignal) {
            request.abortSignal.onabort = () => {
                abortController.abort();
                error = new AbortError();
            };
        }

        // If a timeout has been passed in, setup a timeout to call abort
        // Type needs to be any to fit window.setTimeout and NodeJS.setTimeout
        let timeoutId: any = null;
        if (request.timeout) {
            const msTimeout = request.timeout!;
            timeoutId = setTimeout(() => {
                abortController.abort();
                this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);
                error = new TimeoutError();
            }, msTimeout);
        }

        if (request.content === "") {
            request.content = undefined;
        }
        if (request.content) {
            // Explicitly setting the Content-Type header for React Native on Android platform.
            request.headers = request.headers || {};
            if (isArrayBuffer(request.content)) {
                request.headers["Content-Type"] = "application/octet-stream";
            } else {
                request.headers["Content-Type"] = "text/plain;charset=UTF-8";
            }
        }

        let response: Response;
        try {
            response = await this._fetchType(request.url!, {
                body: request.content,
                cache: "no-cache",
                credentials: request.withCredentials === true ? "include" : "same-origin",
                headers: {
                    "X-Requested-With": "XMLHttpRequest",
                    ...request.headers,
                },
                method: request.method!,
                mode: "cors",
                redirect: "follow",
                signal: abortController.signal,
            });
        } catch (e) {
            if (error) {
                throw error;
            }
            this._logger.log(
                LogLevel.Warning,
                `Error from HTTP request. ${e}.`,
            );
            throw e;
        } finally {
            if (timeoutId) {
                clearTimeout(timeoutId);
            }
            if (request.abortSignal) {
                request.abortSignal.onabort = null;
            }
        }

        if (!response.ok) {
            const errorMessage = await deserializeContent(response, "text") as string;
            throw new HttpError(errorMessage || response.statusText, response.status);
        }

        const content = deserializeContent(response, request.responseType);
        const payload = await content;

        return new HttpResponse(
            response.status,
            response.statusText,
            payload,
        );
    }

    public getCookieString(url: string): string {
        let cookies: string = "";
        if (Platform.isNode && this._jar) {
            // @ts-ignore: unused variable
            this._jar.getCookies(url, (e, c) => cookies = c.join("; "));
        }
        return cookies;
    }
}

function deserializeContent(response: Response, responseType?: XMLHttpRequestResponseType): Promise<string | ArrayBuffer> {
    let content;
    switch (responseType) {
        case "arraybuffer":
            content = response.arrayBuffer();
            break;
        case "text":
            content = response.text();
            break;
        case "blob":
        case "document":
        case "json":
            throw new Error(`${responseType} is not supported.`);
        default:
            content = response.text();
            break;
    }

    return content;
}


text:
package com.chocolatefactory.android.dailyfit.Data;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;

/**
 * Created by hyoseok on 15. 3. 2..
 */
public class Exercise extends RealmObject
{
    @PrimaryKey
    private int id;

    private String name;
    private int exerciseType;
    private int partType;

    public int getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getExerciseType() {
        return exerciseType;
    }

    public void setExerciseType(int exerciseType) {
        this.exerciseType = exerciseType;
    }

    public int getPartType() {
        return partType;
    }

    public void setPartType(int partType) {
        this.partType = partType;
    }
}


text:
#ifndef cglms_planes_h
#define cglms_planes_h

#include "../common.h"
#include "../types-struct.h"
#include "../plane.h"
#include "vec4.h"

/*
 Plane equation:  Ax + By + Cz + D = 0;

 It stored in vec4 as [A, B, C, D]. (A, B, C) is normal and D is distance
*/

/*
 Functions:
   CGLM_INLINE vec4s glms_plane_normalize(vec4s plane);
 */

/*!
 * @brief normalizes a plane
 *
 * @param[in] plane plane to normalize
 * @returns         normalized plane
 */
CGLM_INLINE
vec4s
glms_plane_normalize(vec4s plane) {
  glm_plane_normalize(plane.raw);
  return plane;
}

#endif /* cglms_planes_h */


text:
import React, { Component } from 'react'
import { Grid, Table, Ref, Segment } from 'shengnian-ui-react'

export default class RefExampleRef extends Component {
  state = {}

  handleRef = node => this.setState({ node })

  render() {
    const { node } = this.state

    return (
      <Grid columns={2}>
        <Grid.Column>
          <Ref innerRef={this.handleRef}>
            <Segment>An example node</Segment>
          </Ref>
        </Grid.Column>
        <Grid.Column>
          {node && (
            <Table>
              <Table.Body>
                <Table.Row>
                  <Table.Cell>nodeName</Table.Cell>
                  <Table.Cell>{node.nodeName}</Table.Cell>
                </Table.Row>
                <Table.Row>
                  <Table.Cell>nodeType</Table.Cell>
                  <Table.Cell>{node.nodeType}</Table.Cell>
                </Table.Row>
                <Table.Row>
                  <Table.Cell>textContent</Table.Cell>
                  <Table.Cell>{node.textContent}</Table.Cell>
                </Table.Row>
              </Table.Body>
            </Table>
          )}
        </Grid.Column>
      </Grid>
    )
  }
}


text:
package io.proleap.cobol.asg.metamodel.data.screen.impl;

import io.proleap.cobol.CobolParser.ScreenDescriptionFullClauseContext;
import io.proleap.cobol.asg.metamodel.ProgramUnit;
import io.proleap.cobol.asg.metamodel.data.screen.FullClause;
import io.proleap.cobol.asg.metamodel.impl.CobolDivisionElementImpl;

public class FullClauseImpl extends CobolDivisionElementImpl implements FullClause {

	protected ScreenDescriptionFullClauseContext ctx;

	protected FullClauseType fullClauseType;

	public FullClauseImpl(final ProgramUnit programUnit, final ScreenDescriptionFullClauseContext ctx) {
		super(programUnit, ctx);

		this.ctx = ctx;
	}

	@Override
	public FullClauseType getFullClauseType() {
		return fullClauseType;
	}

	@Override
	public void setFullClauseType(final FullClauseType fullClauseType) {
		this.fullClauseType = fullClauseType;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<carbon.widget.LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <include layout="@layout/view_debugtoolbar" />

    <carbon.widget.ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <carbon.widget.LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <carbon.widget.TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/carbon_windowPadding"
                android:layout_marginLeft="@dimen/carbon_windowPadding"
                android:layout_marginTop="@dimen/carbon_margin"
                android:layout_marginEnd="@dimen/carbon_windowPadding"
                android:layout_marginRight="@dimen/carbon_windowPadding"
                android:text="This application contains samples showing most of features of Carbon. All it needs is an Internet connection. It doesn't require any special permissions, doesn't send anything and doesn't gather any information.\n\nMost of the samples has a couple of options:\n - debug layouts\n - disable/enable views\n - display code\n\nYou can also change themes, fonts and colors to see, how the samples would look like in other styles.\n\nFeel free to break things and report found issues to me as it helps me and the other users." />

            <carbon.widget.Divider
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/carbon_margin" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?attr/colorSurface"
                android:orientation="vertical">

                <carbon.widget.FrameLayout
                    android:id="@+id/website"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/carbon_listItemHeight"
                    android:layout_marginTop="@dimen/carbon_marginHalf"
                    app:carbon_rippleColor="?attr/carbon_rippleColor">

                    <carbon.widget.ImageView
                        style="@style/carbon_ImageView.IconButton"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="@dimen/carbon_windowPadding"
                        android:layout_marginLeft="@dimen/carbon_windowPadding"
                        app:carbon_src="@drawable/ic_link_black_24dp" />

                    <carbon.widget.TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="@dimen/carbon_contentSpace"
                        android:layout_marginLeft="@dimen/carbon_contentSpace"
                        android:text="Visit website" />
                </carbon.widget.FrameLayout>

                <carbon.widget.FrameLayout
                    android:id="@+id/issue"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/carbon_listItemHeight"
                    android:layout_marginBottom="@dimen/carbon_marginHalf"
                    app:carbon_rippleColor="?attr/carbon_rippleColor">

                    <carbon.widget.ImageView
                        style="@style/carbon_ImageView.IconButton"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="@dimen/carbon_windowPadding"
                        android:layout_marginLeft="@dimen/carbon_windowPadding"
                        app:carbon_src="@drawable/ic_warning_black_24dp" />

                    <carbon.widget.TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:layout_marginStart="@dimen/carbon_contentSpace"
                        android:layout_marginLeft="@dimen/carbon_contentSpace"
                        android:text="Report issue" />
                </carbon.widget.FrameLayout>
            </LinearLayout>

            <carbon.widget.Divider
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

            <carbon.widget.TextView
                android:id="@+id/version"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/carbon_windowPadding"
                android:layout_marginLeft="@dimen/carbon_windowPadding"
                android:layout_marginTop="@dimen/carbon_margin"
                android:layout_marginEnd="@dimen/carbon_windowPadding"
                android:layout_marginRight="@dimen/carbon_windowPadding"
                android:layout_marginBottom="@dimen/carbon_marginHalf"
                android:textAppearance="?attr/carbon_textAppearanceCaption"
                tools:text="Carbon version: 0.17.0" />

            <carbon.widget.TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/carbon_windowPadding"
                android:layout_marginLeft="@dimen/carbon_windowPadding"
                android:layout_marginTop="@dimen/carbon_margin"
                android:layout_marginEnd="@dimen/carbon_windowPadding"
                android:layout_marginRight="@dimen/carbon_windowPadding"
                android:layout_marginBottom="@dimen/carbon_margin"
                android:text="@string/copyright"
                android:textAppearance="?attr/carbon_textAppearanceCaption" />
        </carbon.widget.LinearLayout>
    </carbon.widget.ScrollView>

</carbon.widget.LinearLayout>


text:
package io.github.dunwu.javaee.listener.util;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

public class ApplicationConstants {

    // 所有的 Session
    public static Map<String, HttpSession> SESSION_MAP = new HashMap<String, HttpSession>();

    // 当前登录的用户总数
    public static int CURRENT_LOGIN_COUNT = 0;

    // 历史访客总数
    public static int TOTAL_HISTORY_COUNT = 0;

    // 服务器启动时间
    public static Date START_DATE = new Date();

    // 最高在线时间
    public static Date MAX_ONLINE_COUNT_DATE = new Date();

    // 最高在线人数
    public static int MAX_ONLINE_COUNT = 0;
}


text:
#include "platan.h"

#include <QtGui>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QString locale = QLocale::system().name();

    QTranslator translator;
    translator.load(QString("platan_") + locale);
    a.installTranslator(&translator);
    platan w;
    w.show();
    return a.exec();
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Rhododendron sataense Nakai

### Remarks
null


text:
package net.hasor.rsf.serialize;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.hasor.core.XmlNode;
import net.hasor.rsf.RsfSettings;
import net.hasor.rsf.constants.RsfException;
/**
 * 序列化工厂
 * @version : 2014年9月20日
 * @author 赵永春(zyc@hasor.net)
 */
public class SerializeFactory {
    private Map<String, SerializeCoder> coderMap = new HashMap<String, SerializeCoder>();
    //
    /**获取序列化(编码/解码)器。*/
    public SerializeCoder getSerializeCoder(String codeName) {
        return this.coderMap.get(codeName);
    }
    /**注册序列化(编码/解码)器*/
    public void registerSerializeCoder(String codeName, SerializeCoder decoder) {
        this.coderMap.put(codeName, decoder);
    }
    //
    //
    public static SerializeFactory createFactory(RsfSettings settings) {
        SerializeFactory factory = new SerializeFactory();
        XmlNode[] atNode = settings.getXmlNodeArray("hasor.rsfConfig.serializeType");
        //
        for (XmlNode e : atNode) {
            List<XmlNode> serList = e.getChildren("serialize");
            for (XmlNode s : serList) {
                initSerialize(factory, s);
            }
        }
        return factory;
    }
    private static void initSerialize(SerializeFactory factory, XmlNode atNode) {
        String serializeType = atNode.getAttribute("name");
        String serializeCoder = atNode.getText().trim();
        //
        try {
            SerializeCoder coder = (SerializeCoder) Class.forName(serializeCoder).newInstance();
            factory.registerSerializeCoder(serializeType, coder);
        } catch (Exception e) {
            throw new RsfException((short) 0, e);
        }
    }
}


text:
require "tent-canonical-json/version"
require "json-pointer"
require "yajl"

class TentCanonicalJson
  REMOVE = %w[ /permissions /received_at /version/received_at /version/id ].freeze
  REMOVE_MATCHING = {
    "/mentions/~/public" => false
  }.freeze
  MOVE = {
    "/original_entity" => "/entity",
    "/mentions/~/original_entity" => "/mentions/{index}/entity",
    "/refs/~/original_entity" => "/refs/{index}/entity",
    "/version/parents/~/original_entity" => "/version/parents/{index}/entity"
  }.freeze
  REMOVE_EMPTY = %w[ /app/name /app/url /app/id /app /attachments /mentions /refs /content /licenses /version/parents /version/message /version ].freeze
  REMOVE_MATCHING_PATHS = {
    "/version/parents/~/post" => "/id",
    "/version/parents/~/entity" => "/entity",
    "/mentions/~/post" => "/id",
    "/mentions/~/entity" => "/entity",
    "/refs/~/post" => "/id",
    "/refs/~/entity" => "/entity"
  }.freeze

  def self.encode(post)
    new(post).encode
  end

  def initialize(post)
    @post = stringify_keys(post.dup)
  end

  def encode
    cleanup
    sorted_encode
  end

  private

  def cleanup
    REMOVE.each do |path|
      pointer = JsonPointer.new(@post, path)
      pointer.delete
    end

    MOVE.each_pair do |path, target_path|
      pointer = JsonPointer.new(@post, path)
      next unless pointer.exists?

      if path =~ %r{/~/}
        pointer.value.each_with_index do |value, index|
          next unless value
          target_pointer = JsonPointer.new(@post, target_path.sub('{index}', index.to_s))
          target_pointer.value = value
        end
        pointer.delete
      else
        target_pointer = JsonPointer.new(@post, target_path)
        target_pointer.value = pointer.value if pointer.value
        pointer.delete
      end
    end

    REMOVE_MATCHING.each_pair do |path, value|
      pointer = JsonPointer.new(@post, path)
      next unless pointer.exists?

      pointer.value.each_with_index do |pointer_value, index|
        next unless pointer_value == value
        delete_path = path.split('/')
        delete_path.pop
        delete_path = delete_path.join('/').sub('*', index.to_s)
        delete_pointer = JsonPointer.new(@post, delete_path)
        delete_pointer.delete
      end
    end

    REMOVE_EMPTY.each do |path|
      pointer = JsonPointer.new(@post, path)
      pointer.delete if obj_empty?(pointer.value)
    end

    REMOVE_MATCHING_PATHS.each_pair do |path, other_path|
      pointer = JsonPointer.new(@post, path)
      next unless pointer.exists?
      other_pointer = JsonPointer.new(@post, other_path)
      next unless other_pointer.exists?

      pointer.value.each_with_index do |value, index|
        delete_pointer = JsonPointer.new(@post, path.sub('*', index.to_s))
        delete_pointer.delete if value == other_pointer.value
      end
    end
  end

  def sorted_encode(hash=@post)
    sorted_keys = hash.keys.sort
    encoded_values = hash.inject({}) do |memo, (k,v)|
      memo[k] = case v
      when Hash
        sorted_encode(v)
      when Array
        json = v.map { |i|
          case i
          when Hash
            sorted_encode(i)
          else
            Yajl::Encoder.encode(i)
          end
        }.join(",")
        "[#{json}]"
      else
        Yajl::Encoder.encode(v)
      end
      memo
    end
    json = sorted_keys.map do |key|
      "#{key.to_s.inspect.gsub("\\n", "\n")}:#{encoded_values[key]}"
    end.join(",")
    "{#{json}}"
  end

  def stringify_keys(hash)
    hash.inject(Hash.new) do |new_hash, (key, val)|
      new_hash[key.to_s] = case val
      when Hash
        stringify_keys(val)
      when Array
        val.map { |v|
          case v
          when Hash
            stringify_keys(v)
          else
            v
          end
        }
      else
        val
      end
      new_hash
    end
  end

  def obj_empty?(obj)
    case obj
    when Hash
      obj.keys.empty?
    when Array
      obj.empty?
    when String
      obj == ""
    when NilClass
      true
    end
  end
end


text:
#include <linux/pm.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>

#include <asm/io.h>
#include <asm/dpmc.h>
#include <asm/irq.h>
#include <asm/gpio.h>

#ifdef CONFIG_PM_WAKEUP_GPIO_POLAR_H
#define WAKEUP_TYPE	PM_WAKE_HIGH
#endif

#ifdef CONFIG_PM_WAKEUP_GPIO_POLAR_L
#define WAKEUP_TYPE	PM_WAKE_LOW
#endif

#ifdef CONFIG_PM_WAKEUP_GPIO_POLAR_EDGE_F
#define WAKEUP_TYPE	PM_WAKE_FALLING
#endif

#ifdef CONFIG_PM_WAKEUP_GPIO_POLAR_EDGE_R
#define WAKEUP_TYPE	PM_WAKE_RISING
#endif

#ifdef CONFIG_PM_WAKEUP_GPIO_POLAR_EDGE_B
#define WAKEUP_TYPE	PM_WAKE_BOTH_EDGES
#endif

void bfin_pm_suspend_standby_enter(void)
{
#ifdef CONFIG_PM_WAKEUP_BY_GPIO
	gpio_pm_wakeup_request(CONFIG_PM_WAKEUP_GPIO_NUMBER, WAKEUP_TYPE);
#endif

#if defined(CONFIG_PM_WAKEUP_BY_GPIO) || defined(CONFIG_PM_WAKEUP_GPIO_API)
	{
		u32 flags;

		local_irq_save(flags);

		sleep_deeper(gpio_pm_setup()); /*Goto Sleep*/

		gpio_pm_restore();

		bfin_write_SIC_IWR(IWR_ENABLE_ALL);

		local_irq_restore(flags);
	}
#endif

#if defined(CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR)
	sleep_deeper(CONFIG_PM_WAKEUP_SIC_IWR);
	bfin_write_SIC_IWR(IWR_ENABLE_ALL);
#endif				/* CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR */
}

/*
 *	bfin_pm_prepare - Do preliminary suspend work.
 *	@state:		suspend state we're entering.
 *
 */
static int bfin_pm_prepare(suspend_state_t state)
{
	int error = 0;

	switch (state) {
	case PM_SUSPEND_STANDBY:
		break;

	case PM_SUSPEND_MEM:
		return -ENOTSUPP;

	default:
		return -EINVAL;
	}

	return error;
}

/*
 *	bfin_pm_enter - Actually enter a sleep state.
 *	@state:		State we're entering.
 *
 */
static int bfin_pm_enter(suspend_state_t state)
{
	switch (state) {
	case PM_SUSPEND_STANDBY:
		bfin_pm_suspend_standby_enter();
		break;

	case PM_SUSPEND_MEM:
		return -ENOTSUPP;

	default:
		return -EINVAL;
	}

	return 0;
}

/*
 *	bfin_pm_finish - Finish up suspend sequence.
 *	@state:		State we're coming out of.
 *
 *	This is called after we wake back up (or if entering the sleep state
 *	failed).
 */
static int bfin_pm_finish(suspend_state_t state)
{
	switch (state) {
	case PM_SUSPEND_STANDBY:
		break;

	case PM_SUSPEND_MEM:
		return -ENOTSUPP;

	default:
		return -EINVAL;
	}

	return 0;
}

struct pm_ops bfin_pm_ops = {
	.prepare = bfin_pm_prepare,
	.enter = bfin_pm_enter,
	.finish = bfin_pm_finish,
};

static int __init bfin_pm_init(void)
{
	pm_set_ops(&bfin_pm_ops);
	return 0;
}

__initcall(bfin_pm_init);


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

namespace Microsoft.Band.WindowsRuntime.Sensors
{
    internal class BandAccelerometerReading : BandSensorReadingBase, IBandAccelerometerReading
    {
        private readonly Band.Sensors.IBandAccelerometerReading reading;

        public BandAccelerometerReading(Band.Sensors.IBandAccelerometerReading reading)
            : base(reading)
        {
            if (reading == null)
            {
                throw new ArgumentNullException("reading");
            }

            this.reading = reading;
        }

        public double AccelerationX
        {
            get
            {
                return this.reading.AccelerationX;
            }
        }

        public double AccelerationY
        {
            get
            {
                return this.reading.AccelerationY;
            }
        }

        public double AccelerationZ
        {
            get
            {
                return this.reading.AccelerationZ;
            }
        }
    }
}


text:
package org.kie.workbench.common.dmn.client.editors.expressions.types.dtable;

import org.junit.runner.RunWith;
import org.kie.workbench.common.dmn.api.definition.HasName;
import org.kie.workbench.common.dmn.api.definition.model.OutputClause;
import org.kie.workbench.common.dmn.api.property.dmn.Name;
import org.kie.workbench.common.dmn.client.editors.expressions.types.BaseColumnHeaderMetaDataContextMenuTest;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.Silent.class)
public class OutputClauseColumnHeaderMetaDataTest extends BaseColumnHeaderMetaDataContextMenuTest<OutputClauseColumnHeaderMetaData, Name, HasName> {

    @Mock
    private HasName hasValue;

    @Mock
    private OutputClause outputClause;

    @Override
    protected OutputClauseColumnHeaderMetaData getHeaderMetaData() {
        return new OutputClauseColumnHeaderMetaData(hasValue,
                                                    outputClause,
                                                    clearValueConsumer,
                                                    setValueConsumer,
                                                    setTypeRefConsumer,
                                                    translationService,
                                                    cellEditorControls,
                                                    editor,
                                                    listSelector,
                                                    listSelectorItemsSupplier,
                                                    listSelectorItemConsumer);
    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.compute.model;

/**
 * Model definition for ScalingScheduleStatus.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Compute Engine API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class ScalingScheduleStatus extends com.google.api.client.json.GenericJson {

  /**
   * [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when
   * a schedule actually became active, not when it was planned to do so. The timestamp is an
   * RFC3339 string in RFC3339 text format.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String lastStartTime;

  /**
   * [Output Only] The next time the scaling schedule will become active. Note: this is a timestamp
   * when a schedule is planned to run, but the actual time might be slightly different. The
   * timestamp is an RFC3339 string in RFC3339 text format.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String nextStartTime;

  /**
   * [Output Only] The current state of a scaling schedule.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String state;

  /**
   * [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when
   * a schedule actually became active, not when it was planned to do so. The timestamp is an
   * RFC3339 string in RFC3339 text format.
   * @return value or {@code null} for none
   */
  public java.lang.String getLastStartTime() {
    return lastStartTime;
  }

  /**
   * [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when
   * a schedule actually became active, not when it was planned to do so. The timestamp is an
   * RFC3339 string in RFC3339 text format.
   * @param lastStartTime lastStartTime or {@code null} for none
   */
  public ScalingScheduleStatus setLastStartTime(java.lang.String lastStartTime) {
    this.lastStartTime = lastStartTime;
    return this;
  }

  /**
   * [Output Only] The next time the scaling schedule will become active. Note: this is a timestamp
   * when a schedule is planned to run, but the actual time might be slightly different. The
   * timestamp is an RFC3339 string in RFC3339 text format.
   * @return value or {@code null} for none
   */
  public java.lang.String getNextStartTime() {
    return nextStartTime;
  }

  /**
   * [Output Only] The next time the scaling schedule will become active. Note: this is a timestamp
   * when a schedule is planned to run, but the actual time might be slightly different. The
   * timestamp is an RFC3339 string in RFC3339 text format.
   * @param nextStartTime nextStartTime or {@code null} for none
   */
  public ScalingScheduleStatus setNextStartTime(java.lang.String nextStartTime) {
    this.nextStartTime = nextStartTime;
    return this;
  }

  /**
   * [Output Only] The current state of a scaling schedule.
   * @return value or {@code null} for none
   */
  public java.lang.String getState() {
    return state;
  }

  /**
   * [Output Only] The current state of a scaling schedule.
   * @param state state or {@code null} for none
   */
  public ScalingScheduleStatus setState(java.lang.String state) {
    this.state = state;
    return this;
  }

  @Override
  public ScalingScheduleStatus set(String fieldName, Object value) {
    return (ScalingScheduleStatus) super.set(fieldName, value);
  }

  @Override
  public ScalingScheduleStatus clone() {
    return (ScalingScheduleStatus) super.clone();
  }

}


text:
Ext.define('dgl.view.Gallery' ,{
    extend: 'Ext.Component',
    alias: 'widget.gallery',
	tplWriteMode:'append',
	tpl: [
		'<tpl for="shots">',
			'{[ this.applySubtemplate("galleryFigure", values ) ]}',
		'</tpl>',
    ],
    initComponent: function() {
        Ext.XTemplate.registerSubtemplate(
			'galleryFigure',
			new Ext.XTemplate(
				'
',
				'',
				'
{[ this.getField(\'title\',values) ]}
',
				'
',
				 {
					getField: function(fieldName, values) {
						return values.get(fieldName);
					}
				}
			)
		);
        this.callParent(arguments);
    },
    afterRender:function(){
    	this.getEl().on({
			'click':Ext.Function.alias(this,'onFigureClicked'),
			scope:this,
			options:{
				// filter the target element to be a descendant with the class 'clickable'
				delegate: 'figure'
			}
		})

        this.callParent(arguments);
    },
    onFigureClicked:function(e,t){
    	var fig = Ext.fly(t).up('figure')
    	this.fireEvent('detailrequest',fig.dom.dataset.galid)
    }
});


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">ASS.UI.Common</string>
    <string name="pull_to_refresh">Pull to Refresh</string>
    <string name="loading">Loading</string>
    <string name="release_to_load">Release to Load</string>
    <string name="user_center">User Center</string>

</resources>


text:
/**
 * Auxiliary classes for XMPP parsing.
 */
package org.jivesoftware.smack.parsing;


text:
<?xml version="1.0" encoding="UTF-8"?>
<deployerConfig xmlns="http://zstack.org/schema/zstack">
	<account name="TestAccount" password="password" >
		<policy name="systemAdminPolicy" policyFilePath="PolicyXml/SystemAdminPolicy.xml" />
	</account>

	<securityGroups>
		<securityGroup name="test">
			<l3NetworkRef>TestL3Network1</l3NetworkRef>
			<accountRef>TestAccount</accountRef>
			<rule>
				<type>Ingress</type>
				<protocol>TCP</protocol>
				<startPort>22</startPort>
				<endPort>100</endPort>
				<allowedCidr>0.0.0.0/0</allowedCidr>
			</rule>
			<rule>
				<type>Ingress</type>
				<protocol>UDP</protocol>
				<startPort>10</startPort>
				<endPort>10</endPort>
				<allowedCidr>192.168.0.1/0</allowedCidr>
			</rule>
		</securityGroup>
	</securityGroups>

	<zones>
		<zone name="Zone1" description="Test">
			<l2Networks>
				<l2NoVlanNetwork name="TestL2Network" description="Test"
					physicalInterface="eth0">
					<l3Networks>
						<l3BasicNetwork name="TestL3Network1" description="Test">
							<ipRange name="TestIpRange" description="Test" startIp="10.0.0.100"
								endIp="10.10.1.200" gateway="10.0.0.1" netmask="255.0.0.0" />

							<networkService provider="SecurityGroup">
								<serviceType>SecurityGroup</serviceType>
							</networkService>
						</l3BasicNetwork>
					</l3Networks>
				</l2NoVlanNetwork>
			</l2Networks>
		</zone>
	</zones>
</deployerConfig>


text:
package instance

import (
	boshlog "github.com/cloudfoundry/bosh-utils/logger"
	boshuuid "github.com/cloudfoundry/bosh-utils/uuid"

	"github.com/frodenas/bosh-google-cpi/google/address_service"
	"github.com/frodenas/bosh-google-cpi/google/instance_group_service"
	"github.com/frodenas/bosh-google-cpi/google/network_service"
	"github.com/frodenas/bosh-google-cpi/google/operation_service"
	"github.com/frodenas/bosh-google-cpi/google/subnetwork_service"
	"github.com/frodenas/bosh-google-cpi/google/target_pool_service"
	"google.golang.org/api/compute/v1"
)

const googleInstanceServiceLogTag = "GoogleInstanceService"
const googleInstanceNamePrefix = "vm"
const googleInstanceDescription = "Instance managed by BOSH"

type GoogleInstanceService struct {
	project              string
	computeService       *compute.Service
	addressService       address.Service
	instanceGroupService instancegroup.Service
	networkService       network.Service
	operationService     operation.Service
	subnetworkService    subnetwork.Service
	targetPoolService    targetpool.Service
	uuidGen              boshuuid.Generator
	logger               boshlog.Logger
}

func NewGoogleInstanceService(
	project string,
	computeService *compute.Service,
	addressService address.Service,
	instanceGroupService instancegroup.Service,
	networkService network.Service,
	operationService operation.Service,
	subnetworkService subnetwork.Service,
	targetPoolService targetpool.Service,
	uuidGen boshuuid.Generator,
	logger boshlog.Logger,
) GoogleInstanceService {
	return GoogleInstanceService{
		project:              project,
		computeService:       computeService,
		addressService:       addressService,
		instanceGroupService: instanceGroupService,
		networkService:       networkService,
		operationService:     operationService,
		subnetworkService:    subnetworkService,
		targetPoolService:    targetPoolService,
		uuidGen:              uuidGen,
		logger:               logger,
	}
}

type GoogleUserData struct {
	Server   GoogleUserDataServerName       `json:"server"`
	Registry GoogleUserDataRegistryEndpoint `json:"registry"`
	DNS      GoogleUserDataDNSItems         `json:"dns,omitempty"`
}

type GoogleUserDataServerName struct {
	Name string `json:"name"`
}

type GoogleUserDataRegistryEndpoint struct {
	Endpoint string `json:"endpoint"`
}

type GoogleUserDataDNSItems struct {
	NameServer []string `json:"nameserver,omitempty"`
}


text:
<?php

namespace directapi\services\keywordbids\models;

use directapi\components\interfaces\ICallbackValidation;
use directapi\components\Model;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;

class KeywordBidSetItem extends Model implements ICallbackValidation
{
    /**
     * @var int
     */
    public $CampaignId;

    /**
     * @var int
     */
    public $AdGroupId;

    /**
     * @var int
     */
    public $KeywordId;

    /**
     * @var int
     */
    public $SearchBid;

    /**
     * @var int
     */
    public $NetworkBid;

    /**
     * @var \directapi\common\enum\PriorityEnum
     */
    public $StrategyPriority;

    /**
     * @Assert\Callback()
     *
     * @param ExecutionContextInterface $context
     */
    public function isValid(ExecutionContextInterface $context): void
    {
        if (!$this->CampaignId && !$this->AdGroupId && !$this->KeywordId) {
            $context->buildViolation('Должно быть указано одно из следующих значений: CampaignId, AdGroupId, KeywordId')
                ->atPath('CampaignId')
                ->atPath('AdGroupId')
                ->atPath('KeywordId')
                ->addViolation();
        }
        if (!$this->SearchBid && !$this->NetworkBid && !$this->StrategyPriority) {
            $context->buildViolation('Должно быть указано одно из следующих значений: SearchBid, NetworkBid, StrategyPriority')
                ->atPath('SearchBid')
                ->atPath('NetworkBid')
                ->atPath('StrategyPriority')
                ->addViolation();
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<tnt-data-source
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/Nastel/tnt4j-streams/master/config/tnt-data-source.xsd">

    <resource-ref id="AccessLogParserCommon" type="Parser" uri="AccessLogParserCommon.xml"/>
    <resource-ref id="AccessLogParserExt" type="Parser" uri="AccessLogParserExt.xml"/>

    <stream name="FileStream" class="com.jkoolcloud.tnt4j.streams.inputs.FileLineStream">
        <property name="HaltIfNoParser" value="false"/>
        <property name="FileName" value="./tnt4j-streams-core/samples/apache-access-single-log/access.log"/>
        <property name="RestoreState" value="false"/>
        <!--<property name="RangeToStream" value="1:"/>-->

        <!--<property name="UseExecutors" value="true"/>-->
        <!--<property name="ExecutorThreadsQuantity" value="5"/>-->
        <!--<property name="ExecutorsTerminationTimeout" value="20"/>-->
        <!--<property name="ExecutorsBoundedModel" value="false"/>-->
        <!--<property name="ExecutorRejectedTaskOfferTimeout" value="20"/>-->

        <parser-ref name="AccessLogParserExt"/>
        <parser-ref name="AccessLogParserCommon"/>
    </stream>
</tnt-data-source>


text:
<title>Slalom and Gravitas Presentation</title>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href="presentation.css" rel="stylesheet"></link>
<link href="../example.css" rel="stylesheet"></link>
<link href="../box.css" rel="stylesheet"></link>

<link href="../../../gravitas.js/examples/utils/example.css" rel="stylesheet"></link>
<link href="../../../gravitas.js/examples/utils/controls.css" rel="stylesheet"></link>
<link href="../../../gravitas.js/examples/Buttons/buttons.css" rel="stylesheet"></link>
<link href="../../../gravitas.js/examples/AndroidWear/androidwear.css" rel="stylesheet"></link>
<link href="../../../gravitas.js/examples/LockScreen/windows8lock.css" rel="stylesheet"></link>
<link href="../../../gravitas.js/examples/iTunesRadio/itunesradio.css" rel="stylesheet"></link>
<link href="../../../gravitas.js/examples/FallingDialogs/fallingdialogs.css" rel="stylesheet"></link>

<link href="../../../gravitas.js/examples/FloatingActionButton/fab.css" rel="stylesheet"></link>

Ralph Thomas — UI, graphics, mobile

Spent the last six years working on WebKit and a GL ES v2-based graphics engine targeting mobile devices

Previously led UI toolkit engineering at Palm on the immediate predecessor to webOS

Gravitas

Simple physics simulations

Three basic simulations

Friction

Gravity/Constant Acceleration

Spring

Simple equations, no numerical integration

Assemble a simulation or reuse one, give it velocity and extents, then let it run!

All code and examples on github, licensed under APSLv2

Physics help touch interfaces create an intuitively real-feeling world

Physics improve coherence of interface by removing discontinuous motion

Physics communicate edges and boundaries unambiguously

All of those demos had hand-coded touch handlers

Many had hand-coded combinations of simulations

Boring, error-prone code slows iteration of design ideas

How can we do better?

Slalom

Describe how objects move and the constraints on their motion

Use linear constraints to relate objects' positions

Add motion constraints to limit range of motion with physics simulations

Can express only linear constraints currently

Needs a non-numerical constraint solver for backtracking

Lots unexplored: no complex state, no non-touch-based animations...

Clean up, documentation, releases

More examples and demos

Visual editor for constraints

Incremental path for including Slalom in existing projects

Native ports

Research: non-linear constraint solver

 ralpht@gmail.com

 http://iamralpht.github.io/


text:
//
//  LMPlayerControlView.m
//  lamiantv
//
//  Created by 李小南 on 2016/12/2.
//  Copyright © 2016年 AiPai. All rights reserved.
//

#import "LMPlayerControlView.h"
#import "MMMaterialDesignSpinner.h"
#import <Masonry.h>
#import "UIColor+Hex.h"
#import "LMPlayerStatusModel.h"

static const CGFloat LMPlayerAnimationTimeInterval             = 7.0f;
static const CGFloat LMPlayerControlBarAutoFadeOutTimeInterval = 0.35f;

@interface LMPlayerControlView ()
/** 加载loading */
@property (nonatomic, strong) MMMaterialDesignSpinner *activity;
/** 快进快退View */
@property (nonatomic, strong) UIView                  *fastView;
/** 快进快退进度progress */
@property (nonatomic, strong) UIProgressView          *fastProgressView;
/** 快进快退时间 */
@property (nonatomic, strong) UILabel                 *fastTimeLabel;
/** 快进快退ImageView */
@property (nonatomic, strong) UIImageView             *fastImageView;
/** 加载失败按钮 */
@property (nonatomic, strong) UIButton                *failBtn;
/** 重播按钮 */
@property (nonatomic, strong) UIButton                *repeatBtn;
/** 观看记录View */
@property (nonatomic, strong) UIView                  *watchrRecordView;
/** 关闭观看记录按钮 */
@property (nonatomic, strong) UIButton                *closeWatchrRecordBtn;
/** 上次观看至00:00 */
@property (nonatomic, strong) UILabel                 *watchrRecordLabel;
/** 跳转播放 */
@property (nonatomic, strong) UIButton                *jumpPlayBtn;

/** 是否显示了控制层 */
@property (nonatomic, assign, getter=isShowing) BOOL  showing;
/** 是否播放结束 */
@property (nonatomic, assign, getter=isPlayEnd) BOOL  playeEnd;
/** 播放器的参数模型 */
@property (nonatomic, strong) LMPlayerStatusModel *playerStatusModel;
@end

@implementation LMPlayerControlView

+ (instancetype)playerControlViewWithStatusModel:(LMPlayerStatusModel *)playerStatusModel {
    LMPlayerControlView *instance = [[self alloc] init];
    instance.playerStatusModel = playerStatusModel;
    return instance;
}

- (instancetype)init {
    self = [super init];

    if (self) {
        // 添加所有子控件
        [self addAllSubViews];

        // 设置子控件的响应事件
        [self makeSubViewsAction];

        // 添加子控件的约束
        [self makeSubViewsConstraints];

        self.landScapeControlView.hidden = YES;

        // 初始化时重置controlView
        [self playerResetControlView];
    }
    return self;
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [NSObject cancelPreviousPerformRequestsWithTarget:self];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self layoutIfNeeded];
}

/**
 *  添加所有子控件
 */
- (void)addAllSubViews {
    [self addSubview:self.portraitControlView];
    [self addSubview:self.landScapeControlView];
    [self addSubview:self.activity];
    [self addSubview:self.repeatBtn];
    [self addSubview:self.failBtn];

    [self addSubview:self.fastView];
    [self.fastView addSubview:self.fastImageView];
    [self.fastView addSubview:self.fastTimeLabel];
    [self.fastView addSubview:self.fastProgressView];

    [self addSubview:self.watchrRecordView];
    [self.watchrRecordView addSubview:self.closeWatchrRecordBtn];
    [self.watchrRecordView addSubview:self.watchrRecordLabel];
    [self.watchrRecordView addSubview:self.jumpPlayBtn];
}

// 设置子控件的响应事件
- (void)makeSubViewsAction {
    [self.failBtn addTarget:self action:@selector(failBtnClick:) forControlEvents:UIControlEventTouchUpInside];

    [self.repeatBtn addTarget:self action:@selector(repeatBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.closeWatchrRecordBtn addTarget:self action:@selector(closeWatchrRecordBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.jumpPlayBtn addTarget:self action:@selector(jumpPlayBtnClick:) forControlEvents:UIControlEventTouchUpInside];
}

#pragma mark - Action

/** 播放失败按钮的点击 */
- (void)failBtnClick:(UIButton *)sender {
    self.failBtn.hidden = YES;
    if ([self.delegate respondsToSelector:@selector(failButtonClick)]) {
        [self.delegate failButtonClick];
    }
}

/** 重播按钮的点击 */
- (void)repeatBtnClick:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(repeatButtonClick)]) {
        [self.delegate repeatButtonClick];
    }
}

/** 关闭播放记录按钮事件 */
- (void)closeWatchrRecordBtnClick:(UIButton *)sender {
    [self hideWatchrRecordView];
}

/** 跳转播放按钮事件 */
- (void)jumpPlayBtnClick:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(jumpPlayButtonClick:)]) {
        [self.delegate jumpPlayButtonClick:self.viewTime];
    }
    [self hideWatchrRecordView];
}

#pragma mark - Private Method

/**
 *  显示控制层
 */
- (void)showControlView {
    if (self.playerStatusModel.isFullScreen) {
        // 横屏
        self.landScapeControlView.hidden = NO;
        self.portraitControlView.hidden = YES;
    } else {
        // 竖屏
        self.portraitControlView.hidden = NO;
        self.landScapeControlView.hidden = YES;
    }

    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
}

/**
 *  隐藏控制层
 */
- (void)hideControlView {
    self.landScapeControlView.hidden = YES;
    self.portraitControlView.hidden = YES;
    if (self.playerStatusModel.isFullScreen && !self.playeEnd) {
        [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
    }
}

/**
 *  自动隐藏控制层
 */
- (void)autoFadeOutControlView {
    [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hideControl) object:nil];
    [self performSelector:@selector(hideControl) withObject:nil afterDelay:LMPlayerAnimationTimeInterval];
}

/**
 *  取消延时隐藏controlView的方法
 */
- (void)playerCancelAutoFadeOutControlView {
    [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hideControl) object:nil];
}

#pragma mark - Public method
/** 初始化时重置controlView */
- (void)playerResetControlView {
    [self.portraitControlView playerResetControlView];
    [self.landScapeControlView playerResetControlView];

    self.fastView.hidden = YES;
    self.repeatBtn.hidden = YES;
    self.failBtn.hidden = YES;
    self.backgroundColor = [UIColor clearColor];
    self.showing = NO;
    self.playeEnd = NO;
//    self.dragged = NO;

    self.watchrRecordView.hidden = YES;
    self.viewTime = 0;
}

/** 切换分辨率时 - 重置控制层 */
- (void)playerResetControlViewForResolution {
    self.fastView.hidden        = YES;
    self.backgroundColor        = [UIColor clearColor];
    self.showing                = NO;
    self.failBtn.hidden         = YES;
    self.repeatBtn.hidden       = YES;

    self.watchrRecordView.hidden = YES;
    self.viewTime = 0;
}

/**
 *  开始准备播放
 */
- (void)startReadyToPlay {
    if (self.viewTime) {
        [self showWatchrRecordView:self.viewTime];
    }

#warning 可以考虑, 在这里才加载部分UI

    // 显示controlView
    [self showControl];
}

/** 显示状态栏 */
- (void)showStatusBar {
    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
}

/** 显示控制层 */
- (void)showControl {
    if (self.isShowing) {
        [self hideControl];
        return;
    }
    [self playerCancelAutoFadeOutControlView];
    [UIView animateWithDuration:LMPlayerControlBarAutoFadeOutTimeInterval animations:^{
        [self showControlView];
    } completion:^(BOOL finished) {
        self.showing = YES;
        [self autoFadeOutControlView];
    }];
}

/** 隐藏控制层 */
- (void)hideControl {
    if (!self.isShowing) { return; }
    [self playerCancelAutoFadeOutControlView];
    [UIView animateWithDuration:LMPlayerControlBarAutoFadeOutTimeInterval animations:^{
        [self hideControlView];
    }completion:^(BOOL finished) {
        self.showing = NO;
    }];
}

/** 强行设置是否显示了控制层 */
- (void)setIsShowing:(BOOL)showing {
    self.showing = showing;
}

/** 显示观看记录层 */
- (void)showWatchrRecordView:(NSInteger)viewTime {
    NSInteger proMin = viewTime / 60; // 秒
    NSInteger proSec = viewTime % 60; // 分钟
    self.watchrRecordLabel.text = [NSString stringWithFormat:@"上次观看至 %02zd:%02zd", proMin, proSec];
    self.watchrRecordView.hidden = NO;

    [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hideWatchrRecordView) object:nil];
    [self performSelector:@selector(hideWatchrRecordView) withObject:nil afterDelay:5.0];
}

/** 隐藏观看记录层 */
- (void)hideWatchrRecordView {
    self.watchrRecordView.hidden = YES;
    self.viewTime = 0;
}

/** 显示快进视图 */
- (void)showFastView:(NSInteger)draggedTime totalTime:(NSInteger)totalTime isForward:(BOOL)forawrd {
    [self.activity stopAnimating];

    // 拖拽的时长
    NSInteger proMin = draggedTime / 60;//当前秒
    NSInteger proSec = draggedTime % 60;//当前分钟

    //duration 总时长
    NSInteger durMin = totalTime / 60;//总秒
    NSInteger durSec = totalTime % 60;//总分钟

    NSString *currentTimeStr = [NSString stringWithFormat:@"%02zd:%02zd", proMin, proSec];
    NSString *totalTimeStr   = [NSString stringWithFormat:@"%02zd:%02zd", durMin, durSec];
    CGFloat  draggedValue    = (CGFloat)draggedTime/(CGFloat)totalTime;
    NSString *timeStr        = [NSString stringWithFormat:@"%@ / %@", currentTimeStr, totalTimeStr];
    if (forawrd) {
        self.fastImageView.image = [UIImage imageNamed:@"ZFPlayer_fast_forward"];
    } else {
        self.fastImageView.image = [UIImage imageNamed:@"ZFPlayer_fast_forward"];
    }
    self.fastView.hidden           = NO;
    self.fastTimeLabel.text        = timeStr;
    self.fastProgressView.progress = draggedValue;
}

/** 隐藏快进视图 */
- (void)hideFastView {
    self.fastView.hidden = YES;
}

/** 准备开始播放, 隐藏loading */
- (void)readyToPlay {
    [self.activity stopAnimating];
    self.failBtn.hidden = YES;
}

/** 加载失败, 显示加载失败按钮 */
- (void)loadFailed {
    [self.activity stopAnimating];
    self.failBtn.hidden = NO;
}

/** 开始loading */
- (void)loading {
    [self.activity startAnimating];
    self.failBtn.hidden = YES;
    self.fastView.hidden = YES; //

#warning 有问题, 可能重播播放的是本地文件, 就不会loading(待优化)
    self.playeEnd = NO;
}

/** 播放完了, 显示重播按钮 */
- (void)playDidEnd {
    [self.activity stopAnimating];
    self.failBtn.hidden = YES;
    self.repeatBtn.hidden = NO;

    self.backgroundColor  = [UIColor colorWithRed:0 green:0 blue:0 alpha:1];
    self.playeEnd         = YES;
    self.showing          = NO;
    // 隐藏controlView
    [self playEndHideControlView];
    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
}

/**
 *  播放完成时隐藏控制层
 */
- (void)playEndHideControlView {
    if (self.playerStatusModel.isFullScreen) {
        // 横屏
        self.portraitControlView.hidden = YES;
        self.landScapeControlView.hidden = NO;

        [self.landScapeControlView playEndHideView:self.playeEnd];
    } else {
        // 竖屏
        self.landScapeControlView.hidden = YES;
        self.portraitControlView.hidden = NO;

        [self.portraitControlView playEndHideView:self.playeEnd];
    }

    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
}

#pragma mark - 添加子控件的约束
/**
 *  添加子控件的约束
 */
- (void)makeSubViewsConstraints {

    [self.portraitControlView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.leading.trailing.bottom.equalTo(self);
    }];

    [self.landScapeControlView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.leading.trailing.bottom.equalTo(self);
    }];

    [self.activity mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
        make.width.with.height.mas_equalTo(45);
    }];

    [self.repeatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
    }];

    [self.failBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
        make.width.mas_equalTo(130);
        make.height.mas_equalTo(33);
    }];

    [self.fastView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(125);
        make.height.mas_equalTo(80);
        make.center.equalTo(self);
    }];

    [self.fastImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_offset(32);
        make.height.mas_offset(32);
        make.top.mas_equalTo(5);
        make.centerX.mas_equalTo(self.fastView.mas_centerX);
    }];

    [self.fastTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.with.trailing.mas_equalTo(0);
        make.top.mas_equalTo(self.fastImageView.mas_bottom).offset(2);
    }];

    [self.fastProgressView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(12);
        make.trailing.mas_equalTo(-12);
        make.top.mas_equalTo(self.fastTimeLabel.mas_bottom).offset(10);
    }];

    [self.watchrRecordView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.width.mas_equalTo(260);
        make.height.mas_equalTo(30);
        make.left.mas_equalTo(self);
        make.right.mas_equalTo(self.watchrRecordLabel.mas_right).offset(80);
        make.bottom.mas_equalTo(self.mas_bottom).offset(-50);
    }];

    [self.closeWatchrRecordBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_offset(30);
        make.height.mas_offset(30);
        make.top.left.mas_equalTo(self.watchrRecordView);
    }];

    [self.watchrRecordLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.closeWatchrRecordBtn.mas_right);
        make.top.height.mas_equalTo(self.watchrRecordView);
//        make.width.mas_equalTo(140); // ?
    }];

    [self.jumpPlayBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.watchrRecordLabel.mas_trailing).offset(3);
        make.trailing.top.height.mas_equalTo(self.watchrRecordView);
    }];
}

#pragma mark - getter

- (LMPortraitControlView *)portraitControlView {
    if (!_portraitControlView) {
        _portraitControlView = [[LMPortraitControlView alloc] init];
    }
    return _portraitControlView;
}

- (LMLandScapeControlView *)landScapeControlView {
    if (!_landScapeControlView) {
        _landScapeControlView = [[LMLandScapeControlView alloc] init];
    }
    return _landScapeControlView;
}

- (MMMaterialDesignSpinner *)activity {
    if (!_activity) {
        _activity = [[MMMaterialDesignSpinner alloc] init];
        _activity.lineWidth = 1;
        _activity.duration  = 1;
        _activity.tintColor = [[UIColor whiteColor] colorWithAlphaComponent:0.9];
    }
    return _activity;
}

- (UIView *)fastView {
    if (!_fastView) {
        _fastView                     = [[UIView alloc] init];
        _fastView.backgroundColor     = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.8];
        _fastView.layer.cornerRadius  = 4;
        _fastView.layer.masksToBounds = YES;
    }
    return _fastView;
}

- (UIImageView *)fastImageView {
    if (!_fastImageView) {
        _fastImageView = [[UIImageView alloc] init];
    }
    return _fastImageView;
}

- (UILabel *)fastTimeLabel {
    if (!_fastTimeLabel) {
        _fastTimeLabel               = [[UILabel alloc] init];
        _fastTimeLabel.textColor     = [UIColor whiteColor];
        _fastTimeLabel.textAlignment = NSTextAlignmentCenter;
        _fastTimeLabel.font          = [UIFont systemFontOfSize:14.0];
    }
    return _fastTimeLabel;
}

- (UIProgressView *)fastProgressView {
    if (!_fastProgressView) {
        _fastProgressView                   = [[UIProgressView alloc] init];
        _fastProgressView.progressTintColor = [UIColor whiteColor];
        _fastProgressView.trackTintColor    = [[UIColor lightGrayColor] colorWithAlphaComponent:0.4];
    }
    return _fastProgressView;
}

- (UIButton *)failBtn {
    if (!_failBtn) {
        _failBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [_failBtn setTitle:@"加载失败,点击重试" forState:UIControlStateNormal];
        [_failBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _failBtn.titleLabel.font = [UIFont systemFontOfSize:14.0];
        _failBtn.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7];

//        _failBtn.backgroundColor = [UIColor redColor];
    }
    return _failBtn;
}

- (UIButton *)repeatBtn {
    if (!_repeatBtn) {
        _repeatBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_repeatBtn setImage:[UIImage imageNamed:@"ZFPlayer_repeat_video"] forState:UIControlStateNormal];
    }
    return _repeatBtn;
}

- (UIView *)watchrRecordView {
    if (!_watchrRecordView) {
        _watchrRecordView                     = [[UIView alloc] init];
        _watchrRecordView.backgroundColor     = [UIColor colorWithHexString:@"000000" alpha:0.8];
        _watchrRecordView.layer.cornerRadius  = 2;
        _watchrRecordView.layer.masksToBounds = YES;
    }
    return _watchrRecordView;
}

- (UIButton *)closeWatchrRecordBtn {
    if (!_closeWatchrRecordBtn) {
        _closeWatchrRecordBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_closeWatchrRecordBtn setImage:[UIImage imageNamed:@"btn_关闭"] forState:UIControlStateNormal];
    }
    return _closeWatchrRecordBtn;
}

- (UILabel *)watchrRecordLabel {
    if (!_watchrRecordLabel) {
        _watchrRecordLabel               = [[UILabel alloc] init];
        _watchrRecordLabel.text          = @"上次观看至88:00";
        _watchrRecordLabel.textColor     = [UIColor whiteColor];
        _watchrRecordLabel.textAlignment = NSTextAlignmentCenter;
        _watchrRecordLabel.font          = [UIFont systemFontOfSize:16.0];
    }
    return _watchrRecordLabel;
}

- (UIButton *)jumpPlayBtn {
    if (!_jumpPlayBtn) {
        _jumpPlayBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_jumpPlayBtn setTitle:@"跳转播放" forState:UIControlStateNormal];
        [_jumpPlayBtn setTitleColor:[UIColor colorWithHexString:@"#ed341c"] forState:UIControlStateNormal];
        _jumpPlayBtn.titleLabel.font = [UIFont systemFontOfSize:16.0];
    }
    return _jumpPlayBtn;
}

@end