text:
package com.xeiam.xchange.dto.marketdata;

import java.math.BigDecimal;
import java.util.Date;

import com.xeiam.xchange.currency.CurrencyPair;
import com.xeiam.xchange.utils.DateUtils;

/**
 *

 * A class encapsulating the information a "Ticker" can contain. Some fields can be empty if not provided by the exchange.
 *

 *

 * A ticker contains data representing the latest trade.
 *

 */
public final class Ticker {

  private final CurrencyPair currencyPair;
  private final BigDecimal last;
  private final BigDecimal bid;
  private final BigDecimal ask;
  private final BigDecimal high;
  private final BigDecimal low;
  private final BigDecimal vwap;
  private final BigDecimal volume;
  /**
   * the timestamp of the ticker according to the exchange's server, null if not provided
   */
  private final Date timestamp;

  /**
   * Constructor
   *
   * @param currencyPair The tradable identifier (e.g. BTC in BTC/USD)
   * @param last
   * @param bid
   * @param ask
   * @param high
   * @param low
   * @param volume 24h volume
   * @param timestamp - the timestamp of the ticker according to the exchange's server, null if not provided
   */
  private Ticker(CurrencyPair currencyPair, BigDecimal last, BigDecimal bid, BigDecimal ask, BigDecimal high, BigDecimal low, BigDecimal vwap,
      BigDecimal volume, Date timestamp) {

    this.currencyPair = currencyPair;
    this.last = last;
    this.bid = bid;
    this.ask = ask;
    this.high = high;
    this.low = low;
    this.vwap = vwap;
    this.volume = volume;
    this.timestamp = timestamp;
  }

  public CurrencyPair getCurrencyPair() {

    return currencyPair;
  }

  public BigDecimal getLast() {

    return last;
  }

  public BigDecimal getBid() {

    return bid;
  }

  public BigDecimal getAsk() {

    return ask;
  }

  public BigDecimal getHigh() {

    return high;
  }

  public BigDecimal getLow() {

    return low;
  }

  public BigDecimal getVwap() {

    return vwap;
  }

  public BigDecimal getVolume() {

    return volume;
  }

  public Date getTimestamp() {

    return timestamp;
  }

  @Override
  public String toString() {

    return "Ticker [currencyPair=" + currencyPair + ", last=" + last + ", bid=" + bid + ", ask=" + ask + ", high=" + high + ", low=" + low + ",avg="
        + vwap + ", volume=" + volume + ", timestamp=" + DateUtils.toMillisNullSafe(timestamp) + "]";
  }

  /**
   *

   * Builder to provide the following to {@link Ticker}:
   *

   *

   *
Provision of fluent chained construction interface

   *

   *
   */
  public static class Builder {

    private CurrencyPair currencyPair;
    private BigDecimal last;
    private BigDecimal bid;
    private BigDecimal ask;
    private BigDecimal high;
    private BigDecimal low;
    private BigDecimal vwap;
    private BigDecimal volume;
    private Date timestamp;

    // Prevent repeat builds
    private boolean isBuilt = false;

    public Ticker build() {

      validateState();

      Ticker ticker = new Ticker(currencyPair, last, bid, ask, high, low, vwap, volume, timestamp);

      isBuilt = true;

      return ticker;
    }

    private void validateState() {

      if (isBuilt) {
        throw new IllegalStateException("The entity has been built");
      }
    }

    public Builder currencyPair(CurrencyPair currencyPair) {

      this.currencyPair = currencyPair;
      return this;
    }

    public Builder last(BigDecimal last) {

      this.last = last;
      return this;
    }

    public Builder bid(BigDecimal bid) {

      this.bid = bid;
      return this;
    }

    public Builder ask(BigDecimal ask) {

      this.ask = ask;
      return this;
    }

    public Builder high(BigDecimal high) {

      this.high = high;
      return this;
    }

    public Builder low(BigDecimal low) {

      this.low = low;
      return this;
    }

    public Builder vwap(BigDecimal vwap) {

      this.vwap = vwap;
      return this;
    }

    public Builder volume(BigDecimal volume) {

      this.volume = volume;
      return this;
    }

    public Builder timestamp(Date timestamp) {

      this.timestamp = timestamp;
      return this;
    }

  }
}


text:
import React from "react"
import ReactDOM from "react-dom"

import {weekday} from './utils'

export default class Project extends React.Component {
  constructor (props) {
    super (props)
  }

  filteredProject () {
    if ( !this.props.searchText ) return this.props.projects

    return this.props.projects.filter((project) => {
      return project.name.indexOf(this.props.searchText) > -1 || project.description.indexOf(this.props.searchText) > -1
    })
  }

  render () {
    const projects = this.filteredProject().map((project, index) => {
      return (
        <li className={`project--list list_${index}`} key={index}>

            <i className={`fa ${project.done ? 'fa-check-square-o' : 'fa-square-o'}`} aria-hidden='true'>

              {`${project.createDate.getFullYear()}/${project.createDate.getMonth() + 1}/${project.createDate.getDate()} (${weekday[project.createDate.getDay()]})`}
              {project.createDate !== project.editDate ? ` | ${project.editDate.getFullYear()}/${project.editDate.getMonth() + 1}/${project.editDate.getDate()} (${weekday[project.editDate.getDay()]})` : ''}

              {project.name}

              {project.description}

      )
    })

    return (

        {projects}

    )
  }
}

redpajama_set_name: RedPajamaGithub


text:
@class NSArray, NSString, WCArrowDownIconStyle;

@interface WCADCanvasInfo : NSObject <NSCoding>
{
    NSArray *originalPageList;
    NSArray *adCanvasPageList;
    NSString *fromAdXml;
    NSString *shareTitle;
    NSString *shareDesc;
    NSString *shareWebUrl;
    NSString *shareThumbUrl;
    int sizeType;
    int basicWidth;
    int basicRootFontSize;
    int type;
    int subType;
    int visibleCount;
    int enterType;
    int disableShareBitSet;
    int bizId;
    int _forceStay;
    NSString *shareAppId;
    NSString *shareType;
    NSString *userInfo;
    WCArrowDownIconStyle *_arrowDownIconStyle;
}

@property(nonatomic) int forceStay; // @synthesize forceStay=_forceStay;
@property(retain, nonatomic) WCArrowDownIconStyle *arrowDownIconStyle; // @synthesize arrowDownIconStyle=_arrowDownIconStyle;
@property(retain, nonatomic) NSString *userInfo; // @synthesize userInfo;
@property(retain, nonatomic) NSString *shareType; // @synthesize shareType;
@property(retain, nonatomic) NSString *shareAppId; // @synthesize shareAppId;
@property(nonatomic) int bizId; // @synthesize bizId;
@property(nonatomic) int visibleCount; // @synthesize visibleCount;
@property(nonatomic) int disableShareBitSet; // @synthesize disableShareBitSet;
@property(nonatomic) int enterType; // @synthesize enterType;
@property(nonatomic) int subType; // @synthesize subType;
@property(nonatomic) int type; // @synthesize type;
@property(nonatomic) int basicRootFontSize; // @synthesize basicRootFontSize;
@property(nonatomic) int basicWidth; // @synthesize basicWidth;
@property(nonatomic) int sizeType; // @synthesize sizeType;
@property(retain, nonatomic) NSString *shareThumbUrl; // @synthesize shareThumbUrl;
@property(retain, nonatomic) NSString *shareWebUrl; // @synthesize shareWebUrl;
@property(retain, nonatomic) NSString *shareDesc; // @synthesize shareDesc;
@property(retain, nonatomic) NSString *shareTitle; // @synthesize shareTitle;
@property(retain, nonatomic) NSString *fromAdXml; // @synthesize fromAdXml;
@property(retain, nonatomic) NSArray *originalPageList; // @synthesize originalPageList;
- (void).cxx_destruct;
- (_Bool)hasLoadAllVisiblePages;
@property(readonly, nonatomic) NSArray *adCanvasPageList; // @synthesize adCanvasPageList;
- (void)updateAdCanvasPageListWithinMaxCount:(unsigned long long)arg1;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (id)init;

@end


text:
#include "easy_spi.h"

static EASYSPI_DATA *tempData;

void EASYSPI_Init(EASYSPI_DATA *self)
{
  self->isBusy = 0;
  self->rxCounter = 0;
  self->txCounter = 0;
  self->transceive = EASYSPI_Transceive;
}

void EASYSPI_SetUpChipSelects(EASYSPI_DATA *self)
{
  int i = 0;

  GPIO_InitTypeDef GPIO_InitStructure;

  /* SPI Chip Select */
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

  for(i = 0; i < EASYSPI_MAX_CHIP_SELECTS; i++)
  {
    /* Enable CS periph */
    RCC_AHBPeriphClockCmd(self->pinCS[i].periph, ENABLE);

    GPIO_InitStructure.GPIO_Pin = self->pinCS[i].pin;

    GPIO_Init(self->pinCS[i].port, &GPIO_InitStructure);

    EASYSPI_ChipDeselect(self, i);
  }
}

void EASYSPI_SetDefaults(EASYSPI_DATA *self)
{
  /* Clock pin */
  self->pinCLK.pin = EASY_SPI_SPIx_SCK_PIN;
  self->pinCLK.port = EASY_SPI_SPIx_SCK_GPIO_PORT;
  self->pinCLK.periph = EASY_SPI_SPIx_SCK_GPIO_CLK;
  self->pinCLK.altFunc = EASY_SPI_SPIx_SCK_AF;
  self->pinCLK.source = EASY_SPI_SPIx_SCK_SOURCE;

  /* MISO pin */
  self->pinMISO.pin = EASY_SPI_SPIx_MISO_PIN;
  self->pinMISO.port = EASY_SPI_SPIx_MISO_GPIO_PORT;
  self->pinMISO.periph = EASY_SPI_SPIx_MISO_GPIO_CLK;
  self->pinMISO.altFunc = EASY_SPI_SPIx_MISO_AF;
  self->pinMISO.source = EASY_SPI_SPIx_MISO_SOURCE;

  /* MOSI pin */
  self->pinMOSI.pin = EASY_SPI_SPIx_MOSI_PIN;
  self->pinMOSI.port = EASY_SPI_SPIx_MOSI_GPIO_PORT;
  self->pinMOSI.periph = EASY_SPI_SPIx_MOSI_GPIO_CLK;
  self->pinMOSI.altFunc = EASY_SPI_SPIx_MOSI_AF;
  self->pinMOSI.source = EASY_SPI_SPIx_MOSI_SOURCE;

  /* CS pin [0] */
  self->pinCS[0].pin = EASY_SPI_SPIx_CS_GPIO_PORT_PIN;
  self->pinCS[0].port = EASY_SPI_SPIx_CS_GPIO_PORT;
  self->pinCS[0].periph = EASY_SPI_SPIx_CS_PERIPH;

  /* SPI Perip Clock */
  self->spi = EASY_SPI_SPIx;
  self->spiPeriph = EASY_SPI_SPIx_CLK;
}

void EASYSPI_Config(EASYSPI_DATA *self)
{
  EASYSPI_SetUpChipSelects(self);

  GPIO_InitTypeDef GPIO_InitStructure;
  NVIC_InitTypeDef NVIC_InitStructure;
  SPI_InitTypeDef  SPI_InitStructure;

  /* Enable the SPI periph */
  RCC_APB2PeriphClockCmd(self->spiPeriph, ENABLE);

  /* Enable SCK, MOSI, MISO and NSS GPIO clocks */
  RCC_AHBPeriphClockCmd(self->pinCLK.periph | self->pinMISO.periph | self->pinMOSI.periph, ENABLE);

  GPIO_PinAFConfig(self->pinCLK.port, self->pinCLK.source, self->pinCLK.altFunc);
  GPIO_PinAFConfig(self->pinMOSI.port, self->pinMOSI.source, self->pinMOSI.altFunc);
  GPIO_PinAFConfig(self->pinMISO.port, self->pinMISO.source, self->pinMISO.altFunc);

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_PuPd  = GPIO_PuPd_DOWN;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  /* SPI SCK pin configuration */
  GPIO_InitStructure.GPIO_Pin = self->pinCLK.pin;
  GPIO_Init(self->pinCLK.port, &GPIO_InitStructure);

  /* SPI  MOSI pin configuration */
  GPIO_InitStructure.GPIO_Pin =  self->pinMOSI.pin;
  GPIO_Init(self->pinMOSI.port, &GPIO_InitStructure);

  /* SPI MISO pin configuration */
  GPIO_InitStructure.GPIO_Pin = self->pinMISO.pin;
  GPIO_Init(self->pinMISO.port, &GPIO_InitStructure);

  /* SPI configuration */
  SPI_I2S_DeInit(self->spi);
  SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
  SPI_InitStructure.SPI_DataSize = EASYSPI_DATASIZE;
  SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
  SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;
  SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
  SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_64;
  SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
  SPI_InitStructure.SPI_CRCPolynomial = 7;

  /* Configure the Priority Group to 1 bit */
  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);

  /* Configure the SPI interrupt priority */
  NVIC_InitStructure.NVIC_IRQChannel = SPI1_IRQn;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  NVIC_Init(&NVIC_InitStructure);

  /* Initializes the SPI communication */
  SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
  SPI_Init(self->spi, &SPI_InitStructure);

  /* Initialize the FIFO threshold */
  SPI_RxFIFOThresholdConfig(self->spi, SPI_RxFIFOThreshold_QF);

  /* Enable the Rx buffer not empty interrupt */
  SPI_I2S_ITConfig(self->spi, SPI_I2S_IT_RXNE, ENABLE);

  /* Enable the SPI Error interrupt */
  //SPI_I2S_ITConfig(self->spi, SPI_I2S_IT_ERR, ENABLE);

  /* Data transfer is performed in the SPI interrupt routine */

  /* Enable the SPI peripheral */
  SPI_Cmd(self->spi, ENABLE);
}

void EASYSPI_CleanUp(EASYSPI_DATA *self)
{
}

void EASYSPI_Idle(EASYSPI_DATA *self)
{
}

void EASYSPI_EnableTxInterrupt(EASYSPI_DATA *self)
{
  SPI_I2S_ITConfig(self->spi, SPI_I2S_IT_TXE, ENABLE);
}

void EASYSPI_DisableTxInterrupt(EASYSPI_DATA *self)
{
  SPI_I2S_ITConfig(self->spi, SPI_I2S_IT_TXE, DISABLE);
}

void EASYSPI_ChipSelect(EASYSPI_DATA *self, uint8_t index)
{
  GPIO_WriteBit(self->pinCS[index].port, self->pinCS[index].pin, Bit_RESET);
  self->lastChipSelect = index;
}

void EASYSPI_ChipDeselect(EASYSPI_DATA *self, uint8_t index)
{
  GPIO_WriteBit(self->pinCS[index].port, self->pinCS[index].pin, Bit_SET);
}

void EASYSPI_Transceive(void *self, uint8_t chip_select, uint8_t *data, uint16_t len)
{
  while(((EASYSPI_DATA*)(self))->isBusy){}

  ((EASYSPI_DATA*)(self))->rxCounter = 0;
  ((EASYSPI_DATA*)(self))->txCounter = 0;
  ((EASYSPI_DATA*)(self))->rxSize = len;
  ((EASYSPI_DATA*)(self))->txSize = len;

  ((EASYSPI_DATA*)(self))->isBusy = 1;

  ((EASYSPI_DATA*)(self))->dataBuffer = data;

  tempData = ((EASYSPI_DATA*)(self));

  EASYSPI_ChipSelect(self, chip_select);

  EASYSPI_EnableTxInterrupt(self);

  /* Waiting until TX FIFO is empty */
  while (SPI_GetTransmissionFIFOStatus(((EASYSPI_DATA*)(self))->spi) != SPI_TransmissionFIFOStatus_Empty) {}

  /* Wait busy flag */
  while (SPI_I2S_GetFlagStatus(((EASYSPI_DATA*)(self))->spi, SPI_I2S_FLAG_BSY) == SET) {}

  /* Waiting until RX FIFO is empty */
  while (SPI_GetReceptionFIFOStatus(((EASYSPI_DATA*)(self))->spi) != SPI_ReceptionFIFOStatus_Empty) {}
}

void SPI1_IRQHandler(void)
{
  if(SPI_I2S_GetFlagStatus(tempData->spi, SPI_I2S_FLAG_RXNE) == SET)
  {
    // Receive Buffer Not Empty, get the byte
    tempData->dataBuffer[tempData->rxCounter] = SPI_ReceiveData8(tempData->spi);

    /*printf("< %d: %X\n", tempData->rxCounter, tempData->dataBuffer[tempData->rxCounter]);*/

    tempData->rxCounter++;

    if(tempData->rxCounter >= tempData->rxSize)
    {
      EASYSPI_ChipDeselect(tempData, tempData->lastChipSelect);
      tempData->isBusy = 0;
    }
  }
  else if(SPI_I2S_GetFlagStatus(tempData->spi, SPI_I2S_FLAG_TXE) == SET)
  {
    // Transmit Buffer Empty, send next byte
    if(tempData->txCounter < tempData->txSize)
    {
      SPI_SendData8(tempData->spi, tempData->dataBuffer[tempData->txCounter]);

      /*printf("> %d: %X\n", tempData->txCounter, tempData->dataBuffer[tempData->txCounter]);*/

      tempData->txCounter++;
    }
    else
    {
      EASYSPI_DisableTxInterrupt(tempData);
    }
  }
}


text:
package jp.ac.keio.bio.fun.xitosbml.xitosbml;

import ij.IJ;
import jp.ac.keio.bio.fun.xitosbml.geometry.GeometryDatas;
import jp.ac.keio.bio.fun.xitosbml.util.ModelSaver;
import jp.ac.keio.bio.fun.xitosbml.util.ModelValidator;

/**
 * The class MainModelEdit, which implements "run Model Editor" function.
 * Date Created: Aug 28, 2015
 *
 * @author Kaito Ii <ii@fun.bio.keio.ac.jp>
 * @author Akira Funahashi <funa@bio.keio.ac.jp>
 */
public class MainModelEdit extends MainSBaseSpatial {

	/**
	 * Overrides ij.plugin.PlugIn#run(java.lang.String).
	 * A dialog for editing the model will be displayed.
     * Users can add, modify following SBML elements and save the model through the dialog.
	 *

     *
Species

	 *
Parameter

	 *
Advection coefficient

	 *
Diffusion coefficient

	 *
Boundary condition

	 *
Reaction

	 *

	 *
     * Once the model is saved as SBML, XitoSBML will visualize the model in 3D space,
	 * and execute a syntax validation for both SBML core and spatial extension by using
	 * SBML online validator.
     * With this plugin, users can create a reaction-diffusion model in spatial SBML format.
	 * @param arg name of the method defined in plugins.config
	 */
	@Override
	public void run(String arg) {
		try {
			document = getDocument();
		} catch (NullPointerException e){
			e.getStackTrace();
			return;
		} catch (Exception e) {
			IJ.error("Error: File is not an SBML Model");
			return;
		}

		checkSBMLDocument(document);

		addSBases();
		ModelSaver saver = new ModelSaver(document);
		saver.save();
		showDomainStructure();
		GeometryDatas gData = new GeometryDatas(model);
		visualize(gData.getSpImgList());

		print();

		ModelValidator validator = new ModelValidator(document);
		validator.validate();
	}
}


text:
[![Build Status](https://www.bitrise.io/app/5146ccd8a33bdc42.svg?token=WncwcH_9wvpVKrjDl-lq_A&branch=master)](https://www.bitrise.io/app/5146ccd8a33bdc42)
[![CI Status](http://img.shields.io/travis/WeltN24/Carlos.svg?style=flat)](https://travis-ci.org/WeltN24/Carlos)
[![Version](https://img.shields.io/cocoapods/v/Carlos.svg?style=flat)](http://cocoapods.org/pods/Carlos)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/Carlos.svg?style=flat)](http://cocoapods.org/pods/Carlos)
[![Platform](https://img.shields.io/cocoapods/p/Carlos.svg?style=flat)](http://cocoapods.org/pods/Carlos)

> A simple but flexible cache, written in Swift for `iOS 8+`, `WatchOS 2`, `tvOS` and `Mac OS X` apps. It also ships with some utility functions to easily write asynchronous code.

# Contents of this Readme

- [What is Carlos?](#what-is-carlos)
- [Installation](#installation)
- [Playground](#playground)
- [Requirements](#requirements)
- [Usage](#usage)
- [Tests](#tests)
- [Future development](#future-development)
- [Apps using Carlos](#apps-using-carlos)
- [Authors](#authors)
- [License](#license)
- [Acknowledgements](#acknowledgements)

## What is Carlos?

`Carlos` is a set of classes and functions that gives you many LEGO™-like building blocks based on the [Composite](https://en.wikipedia.org/wiki/Composite_pattern) and [Decorator](https://en.wikipedia.org/wiki/Decorator_pattern) design patterns to create and customize your cache infrastructure.
You start with a simple cache level or with one of the caches that `Carlos` provides you out-of-the-box, and then start applying its functions to build a tree structure of cache levels. The resulting root of the tree is a cache level itself, so you will be able to use it right away in your app.

For more information on how to use `Carlos`, please consult its complete [README](https://github.com/WeltN24/Carlos/blob/master/Carlos/README.md).

`Carlos` now also ships with a small set of functions that make it easier to write asynchronous code through the use of `Future`s and `Promise`s. The child framework is called `Pied Piper` and you can reda more about it [here](https://github.com/WeltN24/Carlos/blob/master/Futures/README.md).

## Installation

Information on how to integrate `Carlos` or `Pied Piper` in your project are available respectively [here](https://github.com/WeltN24/Carlos/blob/master/Carlos/README.md#installation) and [here](https://github.com/WeltN24/Carlos/blob/master/Futures/README.md#installation).

## Playground

`Carlos` and `Pied Piper` ship with 2 playgrounds for you to get to know the frameworks better.
You can find more information on how to use the playground respectively [here](https://github.com/WeltN24/Carlos/blob/master/Carlos/README.md#playground) and [here](https://github.com/WeltN24/Carlos/blob/master/Futures/README.md#playground).

## Requirements

- iOS 8.0+
- WatchOS 2+
- Mac OS X 10.9+
- Xcode 7.3+
- tvOS 9+

## Usage

To run the example project, clone the repo. You'll find sample schemes for `iOS`, `watchOS`, `Mac OS` and `tvOS`.

For detailed information about what it's possible to do with `Carlos` and `Pied Piper` please respectively have a look [here](https://github.com/WeltN24/Carlos/blob/master/Carlos/README.md#usage) and [here](https://github.com/WeltN24/Carlos/blob/master/Futures/README.md#usage).

## Tests

`Carlos` and `Pied Piper` are thouroughly tested so that the features they are designed to provide are safe for refactoring and as much as possible bug-free.

We use [Quick](https://github.com/Quick/Quick) and [Nimble](https://github.com/Quick/Nimble) instead of `XCTest` in order to have a good BDD test layout, and have more than **2300 tests** covering the codebase at the moment.

## Future development

`Carlos` and `Pied Piper` are under development and [here](https://github.com/WeltN24/Carlos/issues) you can see all the open issues. They are assigned to milestones so that you can have an idea of when a given feature will be shipped.

If you want to contribute to this repo, please:

- Create an issue explaining your problem and your solution
- Clone the repo on your local machine
- Create a branch with the issue number and a short abstract of the feature name
- Implement your solution
- Write tests (untested features won't be merged)
- When all the tests are written and green, create a pull request, with a short description of the approach taken

## Apps using Carlos

- [Die Welt Edition](https://itunes.apple.com/de/app/welt-edition-digitale-zeitung/id372746348?mt=8)

Using Carlos? Please let us know through a Pull request, we'll be happy to mention your app!

## Authors

`Carlos` and `Pied Piper` were made in-house by WeltN24

### Contributors:

Vittorio Monaco, [vittorio.monaco@weltn24.de](mailto:vittorio.monaco@weltn24.de), [@vittoriom](https://github.com/vittoriom) on Github, [@Vittorio_Monaco](https://twitter.com/Vittorio_Monaco) on Twitter

Esad Hajdarevic, @esad

## License

`Carlos` and `Pied Piper` are available under the MIT license. See the LICENSE files for more info.

## Acknowledgements

`Carlos` internally uses:

- **Crypto** (available on [Github](https://github.com/krzyzanowskim/CryptoSwift)), slightly adapted to compile with Swift 2.0.
- **ConcurrentOperation** (by [Caleb Davenport](https://github.com/calebd)), unmodified.

The **DiskCacheLevel** class is inspired by [Haneke](https://github.com/Haneke/HanekeSwift). The source code has been heavily modified, but adapting the original file has proven valuable for `Carlos` development.

`Pied Piper` internally uses:

- Some parts of `ReadWriteLock.swift` (in particular the pthread-based read-write lock) belonging to **Deferred** (available on [Github](https://github.com/bignerdranch/Deferred))


text:
package com.intellij.ide.structureView.impl.java;

import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.ide.structureView.StructureViewTreeElement;
import com.intellij.ide.structureView.impl.common.PsiTreeElementBase;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.util.PsiUtil;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import java.util.Collections;

public class ClassInitializerTreeElement extends PsiTreeElementBase<PsiClassInitializer> implements AccessLevelProvider{
  public ClassInitializerTreeElement(PsiClassInitializer initializer) {
    super(initializer);
  }

  @Override
  public String getPresentableText() {
    PsiClassInitializer initializer = getElement();
    assert initializer != null;
    String isStatic = initializer.hasModifierProperty(PsiModifier.STATIC) ? PsiModifier.STATIC + " " : "";
    return CodeInsightBundle.message("static.class.initializer", isStatic);
  }

  @Override
  public String getLocationString() {
    PsiClassInitializer initializer = getElement();
    assert initializer != null;
    PsiCodeBlock body = initializer.getBody();
    PsiElement first = body.getFirstBodyElement();
    if (first instanceof PsiWhiteSpace) first = first.getNextSibling();
    if (first == body.getRBrace()) first = null;
    if (first != null) {
      return StringUtil.first(first.getText(), 20, true);
    }
    return null;
  }

  @Override
  @NotNull
  public Collection<StructureViewTreeElement> getChildrenBase() {
    return Collections.emptyList();
  }

  @Override
  public int getAccessLevel() {
    return PsiUtil.ACCESS_LEVEL_PRIVATE;
  }

  @Override
  public int getSubLevel() {
    return 0;
  }
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars.Ribbon;

namespace CJia.Health.Tools
{
    public partial class Form1 : DevExpress.XtraBars.Ribbon.RibbonForm //Form
    {
         private object _presenter;

        /// <summary>
        /// 用户控件UI层父类构造函数
        /// </summary>
        public Form1()
        {
            _presenter = this.CreatePresenter();
        }

        /// <summary>
        /// 常见Presenter虚方法
        /// </summary>
        /// <returns></returns>
        protected virtual object CreatePresenter()
        {
            if (LicenseManager.CurrentContext.UsageMode == LicenseUsageMode.Designtime)
            {
                return null;
            }
            else
            {
                throw new NotImplementedException(string.Format("{0} 必须重载 CreatePresenter 方法.", this.GetType().FullName));
            }
        }

        /// <summary>
        /// 显示弹框信息
        /// </summary>
        /// <param name="message">要显示的内容</param>
        public void ShowMessage(string message)
        {
            MessageBox.Show(message);
        }

        /// <summary>
        /// 界面抛出警告信息
        /// </summary>
        /// <param name="message"></param>
        public void ShowWarning(string message)
        {
            Message.ShowWarning(message);
        }

        /// <summary>
        /// 关闭窗体
        /// </summary>
        public void CloseWindow()
        {
            this.ParentForm.Close();
        }
        /// <summary>
        /// 以窗口形式显示
        /// </summary>
        /// <param name="Caption"></param>
        public void ShowAsWindow(string Caption)
        {
            ShowAsWindow(Caption, this);
        }
        /// <summary>
        /// 以窗口形式显示
        /// </summary>
        /// <param name="Caption"></param>
        /// <param name="UControl"></param>
        public void ShowAsWindow(string Caption, System.Windows.Forms.Form frm)
        {
            //System.Windows.Forms.Form frmBase = new System.Windows.Forms.Form();
            //frmBase.Text = Caption;
            //frmBase.FormBorderStyle = FormBorvderStyle.FixedDialog;
            //frmBase.MaximizeBox = false;
            //frmBase.MinimizeBox = false;

            //frmBase.Size = new System.Drawing.Size(UControl.Width + 15, UControl.Height + 30);
            //frmBase.AutoSize = true;
            //frmBase.StartPosition = FormStartPosition.CenterScreen;
            //frmBase.KeyPreview = true;
            ////UControl.Dock = DockStyle.Fill;
            //frmBase.Controls.Add(UControl);
            ////UControl.Parent = frmBase;
            //UControl.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Top);
            //frmBase.ShowDialog();
        }
        /// <summary>
        /// 获取服务器系统时间
        /// </summary>
        public DateTime Sysdate
        {
            get
            {
                return DateTime.Parse(CJia.DefaultOleDb.QueryScalar("select sysdate from dual"));
            }
        }
    }
}


text:
cask "font-noto-color-emoji-compat-test" do
  version :latest
  sha256 :no_check

  url "https://github.com/google/fonts/raw/main/ofl/notocoloremojicompattest/NotoColorEmojiCompatTest-Regular.ttf",
      verified: "github.com/google/fonts/"
  name "Noto Color Emoji Compat Test"
  homepage "https://fonts.google.com/specimen/Noto+Color+Emoji+Compat+Test"

  font "NotoColorEmojiCompatTest-Regular.ttf"
end


text:
#ifndef fhiclcpp_detail_encode_extended_value_h
#define fhiclcpp_detail_encode_extended_value_h

// ======================================================================
//
// encode overload for extended_value
//
// ======================================================================

#include "boost/any.hpp"

namespace fhicl {

  class extended_value;

  namespace detail {

    boost::any
    encode( extended_value const & xval );

  }
}
#endif /* fhiclcpp_detail_encode_extended_value_h */

// Local Variables:
// mode: c++
// End:


text:
.class public abstract Lcom/android/internal/policy/impl/KeyguardViewBase;
.super Landroid/widget/FrameLayout;
.source "KeyguardViewBase.java"

# static fields
.field private static final BACKGROUND_COLOR:I = 0x70000000

.field private static final DEBUG:Z = true

.field private static final KEYGUARD_MANAGES_VOLUME:Z = true

.field private static TAG:Ljava/lang/String;

# instance fields
.field private mAudioManager:Landroid/media/AudioManager;

.field mBackgroundDrawable:Landroid/graphics/drawable/Drawable;

.field private mCallback:Lcom/android/internal/policy/impl/KeyguardViewCallback;

.field public mLockScreenIsReady:Z

.field private mTelephonyManager:Landroid/telephony/TelephonyManager;

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 50
    const-string v0, "KeyguardViewBase"

    sput-object v0, Lcom/android/internal/policy/impl/KeyguardViewBase;->TAG:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Lcom/android/internal/policy/impl/KeyguardViewCallback;)V
    .locals 1
    .parameter "context"
    .parameter "callback"

    .prologue
    .line 83
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 55
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mTelephonyManager:Landroid/telephony/TelephonyManager;

    .line 62
    new-instance v0, Lcom/android/internal/policy/impl/KeyguardViewBase$1;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/KeyguardViewBase$1;-><init>(Lcom/android/internal/policy/impl/KeyguardViewBase;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mBackgroundDrawable:Landroid/graphics/drawable/Drawable;

    .line 302
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mLockScreenIsReady:Z

    .line 84
    iput-object p2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mCallback:Lcom/android/internal/policy/impl/KeyguardViewCallback;

    .line 85
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/KeyguardViewBase;->resetBackground()V

    .line 86
    return-void
.end method

.method private interceptMediaKey(Landroid/view/KeyEvent;)Z
    .locals 6
    .parameter "event"

    .prologue
    const/4 v5, 0x0

    const/4 v3, 0x1

    .line 180
    invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I

    move-result v1

    .line 181
    .local v1, keyCode:I
    invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I

    move-result v2

    if-nez v2, :cond_7

    .line 182
    sparse-switch v1, :sswitch_data_0

    .line 267
    .end local p0
    :cond_0
    :goto_0
    const/4 v3, 0x0

    :cond_1
    :goto_1
    return v3

    .line 186
    .restart local p0
    :sswitch_0
    iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mAudioManager:Landroid/media/AudioManager;

    if-nez v2, :cond_2

    .line 187
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/KeyguardViewBase;->getContext()Landroid/content/Context;

    move-result-object v2

    const-string v4, "audio"

    invoke-virtual {v2, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/media/AudioManager;

    iput-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mAudioManager:Landroid/media/AudioManager;

    .line 188
    :cond_2
    iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mAudioManager:Landroid/media/AudioManager;

    const/high16 v4, -0x8000

    invoke-virtual {v2, p1, v4}, Landroid/media/AudioManager;->handleKeyDown(Landroid/view/KeyEvent;I)V

    .line 190
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.intent.action.MEDIA_BUTTON"

    invoke-direct {v0, v2, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 191
    .local v0, intent:Landroid/content/Intent;
    const-string v2, "android.intent.extra.KEY_EVENT"

    invoke-virtual {v0, v2, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 192
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/KeyguardViewBase;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v0, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V

    goto :goto_1

    .line 202
    .end local v0           #intent:Landroid/content/Intent;
    :sswitch_1
    iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mTelephonyManager:Landroid/telephony/TelephonyManager;

    if-nez v2, :cond_3

    .line 203
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/KeyguardViewBase;->getContext()Landroid/content/Context;

    move-result-object v2

    const-string v4, "phone"

    invoke-virtual {v2, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/telephony/TelephonyManager;

    iput-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mTelephonyManager:Landroid/telephony/TelephonyManager;

    .line 206
    :cond_3
    iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mTelephonyManager:Landroid/telephony/TelephonyManager;

    if-eqz v2, :cond_4

    iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mTelephonyManager:Landroid/telephony/TelephonyManager;

    invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getCallState()I

    move-result v2

    if-nez v2, :cond_1

    .line 217
    :cond_4
    :sswitch_2
    invoke-virtual {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewBase;->handleMediaKeyEvent(Landroid/view/KeyEvent;)V

    goto :goto_1

    .line 225
    :sswitch_3
    monitor-enter p0

    .line 226
    :try_start_0
    iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mAudioManager:Landroid/media/AudioManager;

    if-nez v2, :cond_5

    .line 227
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/KeyguardViewBase;->getContext()Landroid/content/Context;

    move-result-object v2

    const-string v4, "audio"

    invoke-virtual {v2, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/media/AudioManager;

    iput-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mAudioManager:Landroid/media/AudioManager;

    .line 230
    :cond_5
    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 233
    iget-object v4, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mAudioManager:Landroid/media/AudioManager;

    const/4 v5, 0x3

    const/16 v2, 0x18

    if-ne v1, v2, :cond_6

    move v2, v3

    :goto_2
    invoke-virtual {v4, v5, v2}, Landroid/media/AudioManager;->adjustLocalOrRemoteStreamVolume(II)V

    goto :goto_1

    .line 230
    :catchall_0
    move-exception v2

    :try_start_1
    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v2

    .line 233
    :cond_6
    const/4 v2, -0x1

    goto :goto_2

    .line 245
    :sswitch_4
    check-cast p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;

    .end local p0
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->setGlanceViewDisable()V

    goto :goto_0

    .line 249
    .restart local p0
    :cond_7
    invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I

    move-result v2

    if-ne v2, v3, :cond_0

    .line 250
    sparse-switch v1, :sswitch_data_1

    goto/16 :goto_0

    .line 262
    :sswitch_5
    invoke-virtual {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewBase;->handleMediaKeyEvent(Landroid/view/KeyEvent;)V

    goto/16 :goto_1

    .line 182
    nop

    :sswitch_data_0
    .sparse-switch
        0x3 -> :sswitch_4
        0x18 -> :sswitch_3
        0x19 -> :sswitch_3
        0x4f -> :sswitch_2
        0x55 -> :sswitch_1
        0x56 -> :sswitch_2
        0x57 -> :sswitch_2
        0x58 -> :sswitch_2
        0x59 -> :sswitch_2
        0x5a -> :sswitch_2
        0x5b -> :sswitch_0
        0x7e -> :sswitch_1
        0x7f -> :sswitch_1
        0x82 -> :sswitch_2
        0xa4 -> :sswitch_3
    .end sparse-switch

    .line 250
    :sswitch_data_1
    .sparse-switch
        0x4f -> :sswitch_5
        0x55 -> :sswitch_5
        0x56 -> :sswitch_5
        0x57 -> :sswitch_5
        0x58 -> :sswitch_5
        0x59 -> :sswitch_5
        0x5a -> :sswitch_5
        0x5b -> :sswitch_5
        0x7e -> :sswitch_5
        0x7f -> :sswitch_5
        0x82 -> :sswitch_5
    .end sparse-switch
.end method

.method private shouldEventKeepScreenOnWhileKeyguardShowing(Landroid/view/KeyEvent;)Z
    .locals 2
    .parameter "event"

    .prologue
    const/4 v0, 0x0

    .line 158
    invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I

    move-result v1

    if-eqz v1, :cond_0

    .line 168
    :goto_0
    :pswitch_0
    return v0

    .line 161
    :cond_0
    invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I

    move-result v1

    packed-switch v1, :pswitch_data_0

    .line 168
    const/4 v0, 0x1

    goto :goto_0

    .line 161
    nop

    :pswitch_data_0
    .packed-switch 0x13
        :pswitch_0
        :pswitch_0
        :pswitch_0
        :pswitch_0
    .end packed-switch
.end method

# virtual methods
.method public abstract cleanUp()V
.end method

.method public dispatchKeyEvent(Landroid/view/KeyEvent;)Z
    .locals 1
    .parameter "event"

    .prologue
    .line 147
    invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewBase;->shouldEventKeepScreenOnWhileKeyguardShowing(Landroid/view/KeyEvent;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 148
    iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mCallback:Lcom/android/internal/policy/impl/KeyguardViewCallback;

    invoke-interface {v0}, Lcom/android/internal/policy/impl/KeyguardViewCallback;->pokeWakelock()V

    .line 151
    :cond_0
    invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewBase;->interceptMediaKey(Landroid/view/KeyEvent;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 152
    const/4 v0, 0x1

    .line 154
    :goto_0
    return v0

    :cond_1
    invoke-super {p0, p1}, Landroid/widget/FrameLayout;->dispatchKeyEvent(Landroid/view/KeyEvent;)Z

    move-result v0

    goto :goto_0
.end method

.method public dispatchSystemUiVisibilityChanged(I)V
    .locals 1
    .parameter "visibility"

    .prologue
    .line 294
    invoke-super {p0, p1}, Landroid/widget/FrameLayout;->dispatchSystemUiVisibilityChanged(I)V

    .line 295
    const/high16 v0, 0x40

    invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewBase;->setSystemUiVisibility(I)V

    .line 296
    return-void
.end method

.method public getCallback()Lcom/android/internal/policy/impl/KeyguardViewCallback;
    .locals 1

    .prologue
    .line 93
    iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mCallback:Lcom/android/internal/policy/impl/KeyguardViewCallback;

    return-object v0
.end method

.method handleMediaKeyEvent(Landroid/view/KeyEvent;)V
    .locals 5
    .parameter "keyEvent"

    .prologue
    .line 271
    const-string v2, "audio"

    invoke-static {v2}, Landroid/os/ServiceManager;->checkService(Ljava/lang/String;)Landroid/os/IBinder;

    move-result-object v2

    invoke-static {v2}, Landroid/media/IAudioService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/IAudioService;

    move-result-object v0

    .line 273
    .local v0, audioService:Landroid/media/IAudioService;
    if-eqz v0, :cond_0

    .line 275
    :try_start_0
    invoke-interface {v0, p1}, Landroid/media/IAudioService;->dispatchMediaKeyEvent(Landroid/view/KeyEvent;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 282
    :goto_0
    return-void

    .line 276
    :catch_0
    move-exception v1

    .line 277
    .local v1, e:Landroid/os/RemoteException;
    const-string v2, "KeyguardViewBase"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "dispatchMediaKeyEvent threw exception "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 280
    .end local v1           #e:Landroid/os/RemoteException;
    :cond_0
    const-string v2, "KeyguardViewBase"

    const-string v3, "Unable to find IAudioService for media key event"

    invoke-static {v2, v3}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method public isGlanceViewVisible()Z
    .locals 1

    .prologue
    .line 284
    move-object v0, p0

    check-cast v0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;

    if-eqz v0, :cond_0

    .line 285
    check-cast p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;

    .end local p0
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->isGlanceScreenVisible()Z

    move-result v0

    .line 288
    :goto_0
    return v0

    .restart local p0
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public isKeyguardReady()Z
    .locals 1

    .prologue
    .line 305
    iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mLockScreenIsReady:Z

    return v0
.end method

.method public abstract onScreenTurnedOff()V
.end method

.method public abstract onScreenTurnedOn()V
.end method

.method public abstract reset()V
.end method

.method public resetBackground()V
    .locals 1

    .prologue
    .line 89
    iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewBase;->mBackgroundDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewBase;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 90
    return-void
.end method

.method public abstract show()V
.end method

.method public abstract verifyUnlock()V
.end method

.method public abstract wakeWhenReadyTq(I)V
.end method


text:
using AllGreen.Core;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using TinyIoC;
using FluentAssertions;
using AllGreen.Runner.WPF.Core.ViewModels;
using TemplateAttributes;

namespace AllGreen.Runner.WPF.Core.Tests
{
    [TestClass]
    public partial class JsMapFileMapperTests
    {
        IFileSystem _FileSystem;

        [TestInitialize]
        public void Setup()
        {
            Mock<IFileSystem> fileSystemMock = new Mock<IFileSystem>();
            fileSystemMock.Setup(fs => fs.FileExists(@"C:\Resources\file.js.map")).Returns(true);
            fileSystemMock.Setup(fs => fs.FileExists(@"C:\Resources\file1.js.map")).Returns(true);
            fileSystemMock.Setup(fs => fs.FileExists(@"C:\Resources\file2.js.map")).Returns(true);
            fileSystemMock.Setup(fs => fs.ReadAllText(@"C:\Resources\file.js.map")).Returns("{\"version\":3,\"file\":\"file.js\",\"sourceRoot\":\"\",\"sources\":[\"file.ts\"],\"names\":[],"
                + "\"mappings\":\"AAEA,gEAFgE;AAE5D,IAAA,CAAC,GAAG,EAAE,CAAC;AAAC,CAAC,IAAI,EAAE,CAAC\"}");
            fileSystemMock.Setup(fs => fs.ReadAllText(@"C:\Resources\file1.js.map")).Returns("incorrect map file format");

            _FileSystem = fileSystemMock.Object;
        }

        [DataTestMethod(@"/file.js", @"C:\Resources\file.js", 1, @"/file.ts", @"C:\Resources\file.ts", 3, 1)]
        public void Test(string inputFilename, string inputFullPath, int inputLineNumber, string outputFilename, string outputFullPath, int outputLineNumber, int outputColumnNumber)
        {
            JsMapFileMapper jsMapFileMapper = new JsMapFileMapper(_FileSystem);

            jsMapFileMapper.Map(new FileLocation(inputFilename, inputFullPath, inputLineNumber)).ShouldBeEquivalentTo(new { Filename = outputFilename, FullPath = outputFullPath, LineNumber = outputLineNumber, ColumnNumber = outputColumnNumber });
        }

        [DataTestMethod("", null, 20)]
        [DataTestMethod(@"/file1.js", @"C:\Resources\file1.js", 20)]
        [DataTestMethod(@"/file2.js", @"C:\Resources\file2.js", 20)]
        public void NotFoundTest(string inputFilename, string inputFullPath, int inputLineNumber)
        {
            JsMapFileMapper jsMapFileMapper = new JsMapFileMapper(_FileSystem);

            jsMapFileMapper.Map(new FileLocation(inputFilename, inputFullPath, inputLineNumber)).Should().BeNull();
        }

        [TestMethod]
        public void MappingNotFound()
        {
            JsMapFileMapper jsMapFileMapper = new JsMapFileMapper(_FileSystem);

            jsMapFileMapper.Map(new FileLocation(null, @"C:\Resources\file.js", 0)).Should().BeNull();
        }

        [TestMethod]
        public void ExceptionTest()
        {
            JsMapFileMapper jsMapFileMapper = new JsMapFileMapper(_FileSystem);

            jsMapFileMapper.Map(new FileLocation(null, @"C:\Resources\file.js", 3)).Should().BeNull();
        }
    }
}


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
org.apache.hadoop.hbase.security (HBase 0.94.9 API)
</TITLE>

<META NAME="date" CONTENT="2013-06-24">

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

org.apache.hadoop.hbase.security

Classes

User

Annotation Types

KerberosInfo

TokenInfo


text:
var mongoose = require('mongoose'),
    fs = require('fs'),
    _ = require('underscore'),
    async = require('async'),
    city = require('./city'),
    category = require('./category'),
    Album = require('./album'),
    restaurant = require('./restaurant');

var schemaOptions = {
    toObject: { virtuals: true },
    toJSON: { virtuals: true }
};

var postSchema = new mongoose.Schema({
    pic: {
        originalPath: String,
        originalUrl: String,
        thumbPath: String,
        thumbUrl: String
    },
    title: String,
    description: String,
    _user: { type: mongoose.Schema.ObjectId, ref : 'User' },
    _city: { type: mongoose.Schema.ObjectId, ref : 'city' },
    _restaurant: { type: mongoose.Schema.ObjectId, ref : 'restaurant' },
    _category: { type: mongoose.Schema.ObjectId, ref : 'category' },
    _item: { type: mongoose.Schema.ObjectId, ref : 'item' },
    updatedAt: { type: Date }
}, schemaOptions);

postSchema.virtual('url').get(function() {
    return "/posts/" + this._id;
});

postSchema.virtual('editUrl').get(function() {
    return this.url + '/edit';
});

postSchema.virtual('deleteUrl').get(function() {
    return this.url + '/delete';
});

postSchema.virtual('createdAt').get(function() {
    return this._id.getTimestamp();
});

postSchema.virtual('userUrl').get(function() {
    return '/users/' + String(this._user);
});

postSchema.method({
    userHasRights: function(user) {
        if (!!user && !!this._user) {
            return String(this._user._id || this._user) == String(user.id);
        }
        return false;
    }
});

postSchema.pre('save', function(next) {
    var self = this;
    self.updatedAt = new Date();

    next();
});

postSchema.post('remove', function(doc) {
    fs.unlink(doc.pic.originalPath);
    fs.unlink(doc.pic.thumbPath);
});

module.exports = mongoose.model('post', postSchema);


text:
package com.lorne.tx.mq.service.impl;

import com.lorne.tx.Constants;
import com.lorne.tx.compensate.service.CompensateService;
import com.lorne.tx.mq.handler.TransactionHandler;
import com.lorne.tx.mq.model.Request;
import com.lorne.tx.mq.service.NettyDistributeService;
import com.lorne.tx.mq.service.NettyService;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.handler.codec.LengthFieldPrepender;
import io.netty.handler.timeout.IdleStateHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * Created by lorne on 2017/6/30.
 */
@Service
public class NettyServiceImpl implements NettyService {

    @Autowired
    private NettyDistributeService nettyDistributeService;

    @Autowired
    private CompensateService compensateService;

    private TransactionHandler transactionHandler;

    private EventLoopGroup workerGroup;

    private static volatile boolean isStarting = false;

    private Logger logger = LoggerFactory.getLogger(NettyServiceImpl.class);

    @Override
    public synchronized void start() {
        if (isStarting) {
            return;
        }
        isStarting = true;
        nettyDistributeService.loadTxServer();

        String host = Constants.txServer.getHost();
        int port = Constants.txServer.getPort();
        final int heart = Constants.txServer.getHeart();
        int delay = Constants.txServer.getDelay();

        transactionHandler = new TransactionHandler(this, delay);
        workerGroup = new NioEventLoopGroup();
        try {
            Bootstrap b = new Bootstrap(); // (1)
            b.group(workerGroup); // (2)
            b.channel(NioSocketChannel.class); // (3)
            b.option(ChannelOption.SO_KEEPALIVE, true); // (4)
            b.handler(new ChannelInitializer<SocketChannel>() {
                @Override
                public void initChannel(SocketChannel ch) throws Exception {

                    ch.pipeline().addLast("timeout", new IdleStateHandler(heart, heart, heart, TimeUnit.SECONDS));

                    ch.pipeline().addLast(new LengthFieldPrepender(4, false));
                    ch.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4));

                    ch.pipeline().addLast(transactionHandler);
                }
            });
            // Start the client.
            logger.info("连接manager-socket服务-> host:" + host + ",port:" + port);
            ChannelFuture future = b.connect(host, port); // (5)

            future.addListener(new ChannelFutureListener() {
                @Override
                public void operationComplete(ChannelFuture channelFuture) throws Exception {
                    if (!channelFuture.isSuccess()) {
                        channelFuture.channel().eventLoop().schedule(new Runnable() {
                            @Override
                            public void run() {
                                isStarting = false;
                                start();
                            }
                        }, 5, TimeUnit.SECONDS);
                    }
                }
            });

        } catch (Exception e) {
            e.printStackTrace();

//            isStarting = false;
//
//            //断开重新连接机制
//            close();
//
//            if (e instanceof ConnectTimeoutException) {
//                start();
//            }
        }
    }

    @Override
    public synchronized void close() {
        if (workerGroup != null) {
            workerGroup.shutdownGracefully();
            workerGroup = null;
            TransactionHandler.net_state = false;
            isStarting = false;
        }
    }

    @Override
    public synchronized void restart() {
        close();
        start();
    }

    @Override
    public String sendMsg(Request request) {
        return transactionHandler.sendMsg(request);
    }

    @Override
    public boolean checkState() {
        if (!TransactionHandler.net_state) {
            logger.error("socket服务尚未建立连接成功,将在此等待2秒.");
            try {
                Thread.sleep(1000 * 2);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if (!TransactionHandler.net_state) {
                logger.error("socket还未连接成功,请检查TxManager服务后再试.");
                return false;
            }
        }

        return true;
    }

    @Override
    public long checkCompensate(String taskId) {
        return compensateService.countCompensateByTaskId(taskId);
    }

    @Override
    public void executeCompensate(String taskId) {
        compensateService.executeCompensateByTaskId(taskId);
    }
}


text:
if test ! $(which brew)
then
  echo "  x You should probably install Homebrew first:"
  echo "    https://github.com/mxcl/homebrew/wiki/installation"
  exit
fi

#docker
#docker-compose
#docker-machine
#docker-swarm
#duti
#gettext
#gitup
#grc
#heroku-toolbelt
#spark
#subversion

read -d '' packages <<EOF
ansible
awscli
blueutil
bdw-gc
coreutils
chronograf
dialog
dive
dnsmasq
fn
fswatch
git
git-flow
git-lfs
giter8
glances
graphviz
httpie
hub
lightbend/tools/reactive-cli
ipfs
influxdb
jq
john
kapacitor
kubernetes-cli
kubernetes-helm
leveldb
maven
mosquitto
netcat
nmap
node
pandoc
protobuf
pyqt5
python
python3
pv
pwgen
magic-wormhole
qt
s3cmd
sbt
scala
sleepwatcher
socat
scalacenter/bloop/bloop
terraform
tree
watch
wget
websocat
EOF
# Install homebrew packages
brew install $packages
# Upgrade
brew upgrade $packages

exit 0


text:
package org.qsardb.conversion.table;

import java.io.Closeable;
import java.io.IOException;
import java.util.*;
import org.qsardb.cargo.map.ValuesCargo;
import org.qsardb.evaluation.Evaluator;
import org.qsardb.evaluation.EvaluatorFactory;
import org.qsardb.model.*;

public abstract class TableExporter extends Table implements Closeable {

	private final Set<Column> columns = new LinkedHashSet<Column>();
	private final Set<Row> rows = new LinkedHashSet<Row>();

	public abstract void write() throws Exception;

	@Override
	public abstract void close() throws IOException;

	public void prepareDataSet(Qdb qdb) {
		addCompounds(qdb.getCompoundRegistry());
		loadParameters(qdb.getPropertyRegistry());
		loadParameters(qdb.getDescriptorRegistry());
	}

	public void prepareModel(Model model) {
		PredictionRegistry predRegistry = model.getQdb().getPredictionRegistry();
		Collection<Prediction> predictions = predRegistry.getByModel(model);
		prepareModelPredictions(model, predictions);
	}

	public void preparePrediction(Prediction prediction) {
		Model model = prediction.getModel();
		prepareModelPredictions(model, Collections.singleton(prediction));
	}

	private void prepareModelPredictions(Model model, Collection<Prediction> predictions) {
		Qdb qdb = model.getQdb();
		for (Prediction p: predictions) {
			Set<String> ids = loadValues(p).keySet();
			addCompounds(qdb.getCompoundRegistry().getAll(ids));
		}

		loadParameters(Arrays.asList(model.getProperty()));
		loadParameters(predictions);

		try {
			Evaluator eval = EvaluatorFactory.getInstance().getEvaluator(model);
			eval.init();
			try {
				loadParameters(eval.getDescriptors());
			} finally {
				eval.destroy();
			}
		} catch (Exception e) {
			throw new RuntimeException("Loading descriptors failed for: "+model.getId(), e);
		}
	}

	@Override
	public Iterator<Column> columns() throws Exception {
		return columns.iterator();
	}

	@Override
	public Iterator<Row> rows() throws Exception {
		return rows.iterator();
	}

	private void addCompounds(Collection<Compound> compounds) {
		for (Compound c: compounds) {
			Map<Column, Cell> values = new LinkedHashMap<Column, Cell>();
			addAttribute(c.getId(), ID_COLUMN, values);
			addAttribute(c.getName(), NAME_COLUMN, values);
			addAttribute(c.getCas(), CAS_COLUMN, values);
			addAttribute(c.getInChI(), INCHI_COLUMN, values);
			rows.add(new Row(c.getId(), values));
		}
	}

	private void addAttribute(String value, Column column, Map<Column, Cell> values) {
		if (!columns.contains(column)) {
			columns.add(column);
		}
		values.put(column, makeCell(value));
	}

	private Cell makeCell(String value) {
		return new Cell(value != null ? value : "");
	}

	private void loadParameters(Collection<? extends Parameter> params) {
		for (Parameter<?, ?> p: params) {
			Column column = new Column(p.getId());
			columns.add(column);
			Map<String, String> values = loadValues(p);
			for (Row row: rows) {
				String v = values.get(row.getId());
				row.getValues().put(column, makeCell(v));
			}
		}
	}

	private Map<String, String> loadValues(Parameter<?,?> p) {
		try {
			return p.getCargo(ValuesCargo.class).loadStringMap();
		} catch (IOException e) {
			return new HashMap<String, String>();
		}
	}

	private static final Column ID_COLUMN = new Column("ID");
	private static final Column NAME_COLUMN = new Column("Name");
	private static final Column CAS_COLUMN = new Column("CAS");
	private static final Column INCHI_COLUMN = new Column("InChi");
}


text:
Test page

    <button type="button" id="myBtn"> Click me </button>
    <textarea id="myText">Hello I'm a textbox</textarea>


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#include "UnrealEd.h"
#include "FeedbackContextEditor.h"
#include "Dialogs/SBuildProgress.h"
#include "Editor/MainFrame/Public/MainFrame.h"

/** Called to cancel the slow task activity */
DECLARE_DELEGATE( FOnCancelClickedDelegate );

/**
 * Simple "slow task" widget
 */
class SSlowTaskWidget : public SBorder
{
	/** The maximum number of secondary bars to show on the widget */
	static const int32 MaxNumSecondaryBars = 3;

	/** The width of the dialog, and horizontal padding */
	static const int32 FixedWidth = 600, FixedPaddingH = 24;

	/** The heights of the progress bars on this widget */
	static const int32 MainBarHeight = 12, SecondaryBarHeight = 3;
public:
	SLATE_BEGIN_ARGS( SSlowTaskWidget )	{ }

		/** Called to when an asset is clicked */
		SLATE_EVENT( FOnCancelClickedDelegate, OnCancelClickedDelegate )

		/** The feedback scope stack that we are presenting to the user */
		SLATE_ARGUMENT( TWeakPtr<FSlowTaskStack>, ScopeStack )

	SLATE_END_ARGS()

	/** Construct this widget */
	void Construct( const FArguments& InArgs )
	{
		OnCancelClickedDelegate = InArgs._OnCancelClickedDelegate;
		WeakStack = InArgs._ScopeStack;

		// This is a temporary widget that needs to be updated over its entire lifespan => has an active timer registered for its entire lifespan
		RegisterActiveTimer( 0.f, FWidgetActiveTimerDelegate::CreateSP( this, &SSlowTaskWidget::UpdateProgress ) );

		TSharedRef<SVerticalBox> VerticalBox = SNew(SVerticalBox)

			// Construct the main progress bar and text
			+ SVerticalBox::Slot()
			.AutoHeight()
			[
				SNew(SVerticalBox)

				+ SVerticalBox::Slot()
				.AutoHeight()
				.Padding(FMargin(0, 0, 0, 5.f))
				.VAlign(VAlign_Center)
				[
					SNew(SBox)
					.HeightOverride(24.f)
					[
						SNew(SHorizontalBox)

						+ SHorizontalBox::Slot()
						[
							SNew( STextBlock )
							.AutoWrapText(true)
							.Text( this, &SSlowTaskWidget::GetProgressText, 0 )
							// The main font size dynamically changes depending on the content
							.Font( this, &SSlowTaskWidget::GetMainTextFont )
						]

						+ SHorizontalBox::Slot()
						.Padding(FMargin(5.f, 0, 0, 0))
						.AutoWidth()
						[
							SNew( STextBlock )
							.Text( this, &SSlowTaskWidget::GetPercentageText )
							// The main font size dynamically changes depending on the content
							.Font( FSlateFontInfo( FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Light.ttf"), 14, EFontHinting::AutoLight ) )
						]
					]
				]

				+ SVerticalBox::Slot()
				.AutoHeight()
				[
					SNew(SBox)
					.HeightOverride(MainBarHeight)
					[
						SNew(SProgressBar)
						.BorderPadding(FVector2D::ZeroVector)
						.Percent( this, &SSlowTaskWidget::GetProgressFraction, 0 )
						.BackgroundImage( FEditorStyle::GetBrush("ProgressBar.ThinBackground") )
						.FillImage( FEditorStyle::GetBrush("ProgressBar.ThinFill") )
					]
				]
			]

			// Secondary progress bars
			+ SVerticalBox::Slot()
			.Padding(FMargin(0.f, 8.f, 0.f, 0.f))
			[
				SAssignNew(SecondaryBars, SVerticalBox)
			];

		if ( OnCancelClickedDelegate.IsBound() )
		{
			VerticalBox->AddSlot()
				.AutoHeight()
				.HAlign(HAlign_Center)
				.Padding(10.0f, 7.0f)
				[
					SNew(SButton)
					.Text( NSLOCTEXT("FeedbackContextProgress", "Cancel", "Cancel") )
					.HAlign(EHorizontalAlignment::HAlign_Center)
					.OnClicked(this, &SSlowTaskWidget::OnCancel)
				];
		}

		SBorder::Construct( SBorder::FArguments()
			.BorderImage(FEditorStyle::GetBrush("Menu.Background"))
			.VAlign(VAlign_Center)
			.Padding(FMargin(FixedPaddingH))
			[
				SNew(SBox).WidthOverride(FixedWidth) [ VerticalBox ]
			]
		);

		// Make sure all our bars are set up
		UpdateDynamicProgressBars();
	}

private:

	/** Active timer to update the progress bars */
	EActiveTimerReturnType UpdateProgress(double InCurrentTime, float InDeltaTime)
	{
		UpdateDynamicProgressBars();

		return EActiveTimerReturnType::Continue;
	}

	/** Updates the dynamic progress bars for this widget */
	void UpdateDynamicProgressBars()
	{
		auto ScopeStack = WeakStack.Pin();
		if (!ScopeStack.IsValid())
		{
			return;
		}

		static const double VisibleScopeThreshold = 0.5;

		DynamicProgressIndices.Empty();

		// Always show the first one
		DynamicProgressIndices.Add(0);

		for (int32 Index = 1; Index < ScopeStack->Num() && DynamicProgressIndices.Num() <= MaxNumSecondaryBars - 1; ++Index)
		{
			const auto* Scope = (*ScopeStack)[Index];

			if (Scope->Visibility == ESlowTaskVisibility::ForceVisible)
			{
				DynamicProgressIndices.Add(Index);
			}
			else if (Scope->Visibility == ESlowTaskVisibility::Default && !Scope->DefaultMessage.IsEmpty())
			{
				const auto TimeOpen = FPlatformTime::Seconds() - Scope->StartTime;
				const auto WorkDone = ScopeStack->GetProgressFraction(Index);

				// We only show visible scopes if they have been opened a while, and have a reasonable amount of work left
				if (WorkDone * TimeOpen > VisibleScopeThreshold)
				{
					DynamicProgressIndices.Add(Index);
				}
			}
		}

		// Create progress bars for anything that we haven't cached yet
		// We don't destroy old widgets, they just remain ghosted until shown again
		for (int32 Index = SecondaryBars->GetChildren()->Num() + 1; Index < DynamicProgressIndices.Num(); ++Index)
		{
			CreateSecondaryBar(Index);
		}
	}

	/** Create a progress bar for the specified index */
	void CreateSecondaryBar(int32 Index)
	{
		SecondaryBars->AddSlot()
		.Padding( 0.f, 16.f, 0.f, 0.f )
		[
			SNew(SVerticalBox)

			+ SVerticalBox::Slot()
			.Padding( 0.f, 0.f, 0.f, 4.f )
			.AutoHeight()
			[
				SNew( STextBlock )
				.Text( this, &SSlowTaskWidget::GetProgressText, Index )
				.Font( FSlateFontInfo( FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Regular.ttf"), 9, EFontHinting::AutoLight ) )
				.ColorAndOpacity( FSlateColor::UseSubduedForeground() )
			]

			+ SVerticalBox::Slot()
			.AutoHeight()
			[
				SNew(SBox)
				.HeightOverride(SecondaryBarHeight)
				[
					SNew(SBorder)
					.Padding(0)
					.BorderImage(FEditorStyle::GetBrush("NoBorder"))
					.ColorAndOpacity( this, &SSlowTaskWidget::GetSecondaryProgressBarTint, Index )
					[
						SNew(SProgressBar)
						.BorderPadding(FVector2D::ZeroVector)
						.Percent( this, &SSlowTaskWidget::GetProgressFraction, Index )
						.BackgroundImage( FEditorStyle::GetBrush("ProgressBar.ThinBackground") )
						.FillImage( FEditorStyle::GetBrush("ProgressBar.ThinFill") )
					]
				]
			]
		];
	}

private:

	/** The main text that we will display in the window */
	FText GetPercentageText() const
	{
		auto ScopeStack = WeakStack.Pin();
		if (ScopeStack.IsValid())
		{
			const float ProgressInterp = ScopeStack->GetProgressFraction(0);

			FFormatOrderedArguments Args;
			Args.Add(int(ProgressInterp * 100));

			return FText::Format(NSLOCTEXT("FeedbackContextEditor", "MainProgressDisplayText", "{0}%"), Args);
		}
		return FText();
	}

	/** Calculate the best font to display the main text with */
	FSlateFontInfo GetMainTextFont() const
	{
		TSharedRef<FSlateFontMeasure> MeasureService = FSlateApplication::Get().GetRenderer()->GetFontMeasureService();

		const int32 MaxFontSize = 14;
		FSlateFontInfo FontInfo( FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Light.ttf"), MaxFontSize, EFontHinting::AutoLight );

		const FText MainText = GetProgressText(0);
		const int32 MaxTextWidth = FixedWidth - FixedPaddingH*2;
		while( FontInfo.Size > 9 && MeasureService->Measure(MainText, FontInfo).X > MaxTextWidth )
		{
			FontInfo.Size -= 4;
		}

		return FontInfo;
	}

	/** Get the tint for a secondary progress bar */
	FLinearColor GetSecondaryProgressBarTint(int32 Index) const
	{
		auto ScopeStack = WeakStack.Pin();
		if (ScopeStack.IsValid())
		{
			if (!DynamicProgressIndices.IsValidIndex(Index) || !ScopeStack->IsValidIndex(DynamicProgressIndices[Index]))
			{
				return FLinearColor::White.CopyWithNewOpacity(0.25f);
			}
		}
		return FLinearColor::White;
	}

	/** Get the fractional percentage of completion for a progress bar */
	TOptional<float> GetProgressFraction(int32 Index) const
	{
		auto ScopeStack = WeakStack.Pin();
		if (ScopeStack.IsValid())
		{
			if (DynamicProgressIndices.IsValidIndex(Index) && ScopeStack->IsValidIndex(DynamicProgressIndices[Index]))
			{
				return ScopeStack->GetProgressFraction(DynamicProgressIndices[Index]);
			}
		}
		return TOptional<float>();
	}

	/** Get the text to display for a progress bar */
	FText GetProgressText(int32 Index) const
	{
		auto ScopeStack = WeakStack.Pin();
		if (ScopeStack.IsValid())
		{
			if (DynamicProgressIndices.IsValidIndex(Index) && ScopeStack->IsValidIndex(DynamicProgressIndices[Index]))
			{
				return (*ScopeStack)[DynamicProgressIndices[Index]]->GetCurrentMessage();
			}
		}

		return FText();
	}

	/** Called when the cancel button is clicked */
	FReply OnCancel()
	{
		OnCancelClickedDelegate.ExecuteIfBound();
		return FReply::Handled();
	}

private:

	/** Delegate to invoke if the user clicks cancel */
	FOnCancelClickedDelegate OnCancelClickedDelegate;

	/** The scope stack that we are reflecting */
	TWeakPtr<FSlowTaskStack> WeakStack;

	/** The vertical box containing the secondary progress bars */
	TSharedPtr<SVerticalBox> SecondaryBars;

	/** Array mapping progress bar index -> scope stack index. Updated every tick. */
	TArray<int32> DynamicProgressIndices;
};

/** Static integer definitions required on some builds where the linker needs access to these */
const int32 SSlowTaskWidget::MaxNumSecondaryBars;
const int32 SSlowTaskWidget::FixedWidth;
const int32 SSlowTaskWidget::FixedPaddingH;;
const int32 SSlowTaskWidget::MainBarHeight;
const int32 SSlowTaskWidget::SecondaryBarHeight;

static void TickSlate(TSharedPtr<SWindow> SlowTaskWindow)
{
	// Avoid re-entrancy by ticking the active modal window again. This can happen if thhe slow task window is open and a sibling modal window is open as well.  We only tick slate if we are the active modal window or a child of the active modal window
	if( SlowTaskWindow.IsValid() && ( FSlateApplication::Get().GetActiveModalWindow() == SlowTaskWindow || SlowTaskWindow->IsDescendantOf( FSlateApplication::Get().GetActiveModalWindow() ) ) )
	{
		// Tick Slate application
		FSlateApplication::Get().Tick();

		// Sync the game thread and the render thread. This is needed if many StatusUpdate are called
		FSlateApplication::Get().GetRenderer()->Sync();
	}
}

FFeedbackContextEditor::FFeedbackContextEditor()
	: HasTaskBeenCancelled(false)
{

}

void FFeedbackContextEditor::Serialize( const TCHAR* V, ELogVerbosity::Type Verbosity, const class FName& Category )
{
	if( !GLog->IsRedirectingTo( this ) )
	{
		GLog->Serialize( V, Verbosity, Category );
	}
}

void FFeedbackContextEditor::StartSlowTask( const FText& Task, bool bShowCancelButton )
{
	// If we are in PIE, then do not show slow dialog window, it can cause crashes
	// if there are UMG gadgets open.  This is because they will get a message during
	// an asset load and that causes an assert.
	if (GEditor != nullptr && GEditor->PlayWorld != nullptr)
	{
		return;
	}
	FFeedbackContext::StartSlowTask( Task, bShowCancelButton );

	// Attempt to parent the slow task window to the slate main frame
	TSharedPtr<SWindow> ParentWindow;
	if( FModuleManager::Get().IsModuleLoaded( "MainFrame" ) )
	{
		IMainFrameModule& MainFrame = FModuleManager::LoadModuleChecked<IMainFrameModule>( "MainFrame" );
		ParentWindow = MainFrame.GetParentWindow();
	}

	if (GIsEditor && ParentWindow.IsValid())
	{
		GSlowTaskOccurred = GIsSlowTask;

		// Don't show the progress dialog if the Build Progress dialog is already visible
		bool bProgressWindowShown = BuildProgressWidget.IsValid();

		// Don't show the progress dialog if a Slate menu is currently open
		const bool bHaveOpenMenu = FSlateApplication::Get().AnyMenusVisible();

		if( bHaveOpenMenu )
		{
			UE_LOG(LogSlate, Warning, TEXT("Prevented a slow task dialog from being summoned while a context menu was open") );
		}

		// reset the cancellation flag
		HasTaskBeenCancelled = false;

		if (!bProgressWindowShown && !bHaveOpenMenu && FSlateApplication::Get().CanDisplayWindows())
		{
			FOnCancelClickedDelegate OnCancelClicked;
			if ( bShowCancelButton )
			{
				// The cancel button is only displayed if a delegate is bound to it.
				OnCancelClicked = FOnCancelClickedDelegate::CreateRaw(this, &FFeedbackContextEditor::OnUserCancel);
			}

			const bool bFocusAndActivate = FPlatformProcess::IsThisApplicationForeground();

			TSharedRef<SWindow> SlowTaskWindowRef = SNew(SWindow)
				.SizingRule(ESizingRule::Autosized)
				.AutoCenter(EAutoCenter::PreferredWorkArea)
				.IsPopupWindow(true)
				.CreateTitleBar(true)
				.ActivateWhenFirstShown(bFocusAndActivate)
				.FocusWhenFirstShown(bFocusAndActivate);

			SlowTaskWindowRef->SetContent(
				SNew(SSlowTaskWidget)
				.ScopeStack(ScopeStack)
				.OnCancelClickedDelegate( OnCancelClicked )
			);

			SlowTaskWindow = SlowTaskWindowRef;

			const bool bSlowTask = true;
			FSlateApplication::Get().AddModalWindow( SlowTaskWindowRef, ParentWindow, bSlowTask );

			SlowTaskWindowRef->ShowWindow();

			TickSlate(SlowTaskWindow.Pin());
		}

		FPlatformSplash::SetSplashText( SplashTextType::StartupProgress, *Task.ToString() );
	}
}

void FFeedbackContextEditor::FinalizeSlowTask()
{
	auto Window = SlowTaskWindow.Pin();
	if (Window.IsValid())
	{
		Window->SetContent(SNullWidget::NullWidget);
		Window->RequestDestroyWindow();
		SlowTaskWindow.Reset();
	}

	FFeedbackContext::FinalizeSlowTask( );
}

void FFeedbackContextEditor::ProgressReported( const float TotalProgressInterp, FText DisplayMessage )
{
	// Clean up deferred cleanup objects from rendering thread every once in a while.
	static double LastTimePendingCleanupObjectsWhereDeleted;
	if( FPlatformTime::Seconds() - LastTimePendingCleanupObjectsWhereDeleted > 1 )
	{
		// Get list of objects that are pending cleanup.
		FPendingCleanupObjects* PendingCleanupObjects = GetPendingCleanupObjects();
		// Flush rendering commands in the queue.
		FlushRenderingCommands();
		// It is now safe to delete the pending clean objects.
		delete PendingCleanupObjects;
		// This is also a good time to destroy any linkers pending delete
		DeleteLoaders();
		// Keep track of time this operation was performed so we don't do it too often.
		LastTimePendingCleanupObjectsWhereDeleted = FPlatformTime::Seconds();
	}

	if (FSlateApplication::Get().CanDisplayWindows())
	{
		if (BuildProgressWidget.IsValid())
		{
			if (!DisplayMessage.IsEmpty())
			{
				BuildProgressWidget->SetBuildStatusText(DisplayMessage);
			}

			BuildProgressWidget->SetBuildProgressPercent(TotalProgressInterp * 100, 100);
			TickSlate(BuildProgressWindow.Pin());
		}
		else if (SlowTaskWindow.IsValid())
		{
			TickSlate(SlowTaskWindow.Pin());
		}
	}
	else
	{
		// Always show the top-most message
		for (auto& Scope : *ScopeStack)
		{
			const FText ThisMessage = Scope->GetCurrentMessage();
			if (!ThisMessage.IsEmpty())
			{
				DisplayMessage = ThisMessage;
				break;
			}
		}
	}

	if (FPlatformSplash::IsShown())
	{
		if (!DisplayMessage.IsEmpty())
		{
			const int32 DotCount = 4;
			const float MinTimeBetweenUpdates = 0.2f;
			static double LastUpdateTime = -100000.0;
			static int32 DotProgress = 0;
			const double CurrentTime = FPlatformTime::Seconds();
			if( CurrentTime - LastUpdateTime >= MinTimeBetweenUpdates )
			{
				LastUpdateTime = CurrentTime;
				DotProgress = ( DotProgress + 1 ) % DotCount;
			}

			FString NewDisplayMessage = DisplayMessage.ToString();
			NewDisplayMessage.RemoveFromEnd( TEXT( "..." ) );
			for( int32 DotIndex = 0; DotIndex <= DotCount; ++DotIndex )
			{
				if( DotIndex <= DotProgress )
				{
					NewDisplayMessage.AppendChar( TCHAR( '.' ) );
				}
				else
				{
					NewDisplayMessage.AppendChar( TCHAR( ' ' ) );
				}
			}
			NewDisplayMessage.Append( FString::Printf( TEXT( " %i%%" ), int(TotalProgressInterp * 100.f) ) );
			DisplayMessage = FText::FromString( NewDisplayMessage );
		}

		FPlatformSplash::SetSplashText(SplashTextType::StartupProgress, *DisplayMessage.ToString());
	}
}

/** Whether or not the user has canceled out of this dialog */
bool FFeedbackContextEditor::ReceivedUserCancel( void )
{
	const bool res = HasTaskBeenCancelled;
	HasTaskBeenCancelled = false;
	return res;
}

void FFeedbackContextEditor::OnUserCancel()
{
	HasTaskBeenCancelled = true;
}

/**
 * Show the Build Progress Window
 * @return Handle to the Build Progress Widget created
 */
TWeakPtr<class SBuildProgressWidget> FFeedbackContextEditor::ShowBuildProgressWindow()
{
	TSharedRef<SWindow> BuildProgressWindowRef = SNew(SWindow)
		.ClientSize(FVector2D(500,200))
		.IsPopupWindow(true);

	BuildProgressWidget = SNew(SBuildProgressWidget);

	BuildProgressWindowRef->SetContent( BuildProgressWidget.ToSharedRef() );

	BuildProgressWindow = BuildProgressWindowRef;

	// Attempt to parent the slow task window to the slate main frame
	TSharedPtr<SWindow> ParentWindow;

	if( FModuleManager::Get().IsModuleLoaded( "MainFrame" ) )
	{
		IMainFrameModule& MainFrame = FModuleManager::LoadModuleChecked<IMainFrameModule>( "MainFrame" );
		ParentWindow = MainFrame.GetParentWindow();
	}

	FSlateApplication::Get().AddModalWindow( BuildProgressWindowRef, ParentWindow, true );
	BuildProgressWindowRef->ShowWindow();

	BuildProgressWidget->MarkBuildStartTime();

	if (FSlateApplication::Get().CanDisplayWindows())
	{
		TickSlate(BuildProgressWindow.Pin());
	}

	return BuildProgressWidget;
}

/** Close the Build Progress Window */
void FFeedbackContextEditor::CloseBuildProgressWindow()
{
	if( BuildProgressWindow.IsValid() && BuildProgressWidget.IsValid())
	{
		BuildProgressWindow.Pin()->RequestDestroyWindow();
		BuildProgressWindow.Reset();
		BuildProgressWidget.Reset();
	}
}


text:
mirr=($(echo $(echo $MIRR_PORT | tr 'tcp://' '\n')))
mirr_host=${mirr[0]}
mirr_port=${mirr[1]}
mirr_http=http://$mirr_host:$mirr_port/

# Wait for the mirror's port to open
while true; do
    nc $mirr_host $mirr_port < /dev/null
    if [ $? -eq 0 ]; then
        break
    fi
    sleep 1
done

cd /home/sailor
mkdir temp
cd temp
cp -R ../latex-docker ./
cd latex-docker
echo $mirr_http > support/repository.txt
build_tag=$(cat support/build_tag.txt)
echo -e "\nBuilding nccts/latex:$build_tag\n"
docker build -t nccts/latex:$build_tag .


text:
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction';
import thunk from 'redux-thunk';

import App from './components/App';
import reducers from './reducers';
import 'antd/dist/antd.css';
import './styles/index.css';
import registerServiceWorker from './registerServiceWorker';

const store = createStore(
  reducers,
  composeWithDevTools(applyMiddleware(thunk))
);

ReactDOM.render(
  <Provider store={store}>
    <App />
  </Provider>,
  document.getElementById('root')
);
registerServiceWorker();


text:
"""
Active Alchemy with some custom types

Just like sqlalchemy_utils, this module contains some custom types to
save in the db
"""

import active_alchemy
from sqlalchemy.engine.url import make_url as sa_make_url
import sqlalchemy_utils as sa_utils
import flask_cloudy

class MochaDB(active_alchemy.ActiveAlchemy):
    """
    A custom ActiveAlchemy wrapper which defers the connection
    """
    def __init__(self):
        self.Model = active_alchemy.declarative_base(cls=active_alchemy.Model, name='Model')
        self.BaseModel = active_alchemy.declarative_base(cls=active_alchemy.BaseModel, name='BaseModel')
        self._initialized = False
        self._IS_OK_ = False

    def connect__(self, uri, app):
        self.uri = uri
        self.info = sa_make_url(uri)
        self.options = self._cleanup_options(
            echo=False,
            pool_size=None,
            pool_timeout=None,
            pool_recycle=None,
            convert_unicode=True,
        )

        self._initialized = True
        self._IS_OK_ = True
        self.connector = None
        self._engine_lock = active_alchemy.threading.Lock()
        self.session = active_alchemy._create_scoped_session(self, query_cls=active_alchemy.BaseQuery)

        self.Model.db, self.BaseModel.db = self, self
        self.Model._query, self.BaseModel._query = self.session.query, self.session.query

        self.init_app(app)
        active_alchemy._include_sqlalchemy(self)
        self.StorageObjectType = StorageObjectType

# ------------------------------------------------------------------------------
# StorageObjectType

class StorageObjectType(sa_utils.JSONType):
    """
    A type to store flask_cloudy Storage Object Type:
    -> https://github.com/mardix/flask-cloudy

    It provides a convenient way to store object and retrieve it as you would
    in the Mocha's storage.

    By default it will hold basic info such as name and url, size, extension
    Querying object.url, will not query the storage but use the default data
    this way it prevents certain overhead when dealing with multiple items

    Once an object is not found, it will try to connect to the storage and pull
    the file data

    If object is not found, it will return None.

    Example:
        from mocha import db

        class Image(db.Model):
            name = db.Column(db.String(255))
            image = db.Column(db.StorageObjectType)
            ...

        # Setting the object
        file = request.files.get("file")
        if file:
            upload = storage.upload(file)
            if upload is not None:
                new_img = Image.create(name="New Upload", image=upload)

        # Getting the object. By default, most keys are cached,
        # if not found it will load from the storage

        img = Image.get(1234)
        if img.image:
            url = img.image.url
            size = img.image.size
            full_url = img.image.full_url
            download_url = img.image.download_url

        # Force loading of the storage
        img.image.from_storage(my_other_storage)

        img.image.url (will get it from my_other_storage)

    """

    DEFAULT_KEYS = ["name", "size", "hash", "url", "full_url",
                    "extension", "type", "path", "provider_name"]

    def process_bind_param(self, obj, dialect):
        """Get a flask_cloudy.Object and save it as a dict"""
        value = obj or {}
        if isinstance(obj, flask_cloudy.Object):
            value = {}
            for k in self.DEFAULT_KEYS:
                value[k] = getattr(obj, k)

        return super(self.__class__, self).process_bind_param(value, dialect)

    def process_result_value(self, value, dialect):
        value = super(self.__class__, self).process_result_value(value, dialect)
        return StorageObject(value) if value else None

class StorageObject(dict):
    """
    This object will be loaded when querying the table
    It also extends dict so it can json serialized when being copied
    """

    def __init__(self, data):
        """
        :param data: dict
            name (required)
            ...
        """

        self._storage_obj = None
        self._storage_loaded = False
        self._data = data
        super(self.__class__, self).__init__(data)

    def __getattr__(self, item):
        if item in self._data and not self._storage_loaded:
            return self._data.get(item)

        if not self._storage_loaded:
            from mocha.ext import storage
            self.from_storage(storage)
        return getattr(self._storage_obj, item)

    def from_storage(self, storage):
        """
        To use a different storage
        :param storage: flask_cloudy.Storage instance
        """
        self._storage_obj = storage.get(self._data["name"])
        self._storage_loaded = True


text:
class ListenSome:
    ROBOT_LISTENER_API_VERSION = 1

    def close(self):
        self.outfile.close()


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.groovy.lang.parameterInfo;

import com.intellij.lang.parameterInfo.*;
import com.intellij.openapi.editor.Editor;
import com.intellij.psi.*;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.text.CharArrayUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes;
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile;
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.annotation.GrAnnotation;
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.annotation.GrAnnotationArgumentList;
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.annotation.GrAnnotationNameValuePair;

import java.util.Collections;
import java.util.List;
import java.util.Set;

/**
 * @author Max Medvedev
 */
public class GroovyAnnotationAttributeInfoHandler implements ParameterInfoHandlerWithTabActionSupport<GrAnnotationArgumentList, PsiAnnotationMethod, GrAnnotationNameValuePair> {

  private static final Set<Class<?>> ALLOWED_CLASSES = ContainerUtil.newHashSet(GrAnnotation.class);
  private static final Set<Class<?>> STOP_SEARCHING_CLASSES = Collections.singleton(GroovyFile.class);

  @Override
  public GrAnnotationNameValuePair @NotNull [] getActualParameters(@NotNull GrAnnotationArgumentList o) {
    return o.getAttributes();
  }

  @NotNull
  @Override
  public IElementType getActualParameterDelimiterType() {
    return GroovyTokenTypes.mCOMMA;
  }

  @NotNull
  @Override
  public IElementType getActualParametersRBraceType() {
    return GroovyTokenTypes.mRPAREN;
  }

  @NotNull
  @Override
  public Set<Class<?>> getArgumentListAllowedParentClasses() {
    return ALLOWED_CLASSES;
  }

  @NotNull
  @Override
  public Set<? extends Class<?>> getArgListStopSearchClasses() {
    return STOP_SEARCHING_CLASSES;
  }

  @NotNull
  @Override
  public Class<GrAnnotationArgumentList> getArgumentListClass() {
    return GrAnnotationArgumentList.class;
  }

  private static PsiAnnotationMethod @NotNull [] extractAnnotationMethodsFromClass(@NotNull PsiClass o) {
    if (o.isAnnotationType()) {
      PsiMethod[] methods = o.getMethods();
      if (methods.length > 0) {
        List<PsiAnnotationMethod> annotationMethods = ContainerUtil.findAll(methods, PsiAnnotationMethod.class);
        return annotationMethods.toArray(PsiAnnotationMethod.EMPTY_ARRAY);
      }
    }
    return PsiAnnotationMethod.EMPTY_ARRAY;
  }

  @Override
  public GrAnnotationArgumentList findElementForParameterInfo(@NotNull CreateParameterInfoContext context) {
    return findAnchor(context.getEditor(), context.getFile());
  }

  @Nullable
  private static GrAnnotationArgumentList findAnchor(@NotNull final Editor editor, @NotNull final PsiFile file) {
    PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
    if (element == null) return null;

    return PsiTreeUtil.getParentOfType(element, GrAnnotationArgumentList.class);
  }

  @Override
  public void showParameterInfo(@NotNull GrAnnotationArgumentList argumentList, @NotNull CreateParameterInfoContext context) {
    final GrAnnotation parent = (GrAnnotation)argumentList.getParent();

    final PsiElement resolved = parent.getClassReference().resolve();
    if (resolved instanceof PsiClass && ((PsiClass)resolved).isAnnotationType()) {
      final PsiAnnotationMethod[] methods = extractAnnotationMethodsFromClass((PsiClass)resolved);
      context.setItemsToShow(methods);
      context.showHint(argumentList, argumentList.getTextRange().getStartOffset(), this);
      final PsiAnnotationMethod currentMethod = findAnnotationMethod(context.getFile(), context.getEditor());
      if (currentMethod != null) {
        context.setHighlightedElement(currentMethod);
      }
    }
  }

  @Nullable
  private static PsiAnnotationMethod findAnnotationMethod(@NotNull PsiFile file, @NotNull Editor editor) {
    PsiNameValuePair pair = ParameterInfoUtils.findParentOfType(file, inferOffset(editor), PsiNameValuePair.class);
    if (pair == null) return null;
    final PsiReference reference = pair.getReference();
    final PsiElement resolved = reference != null ? reference.resolve() : null;
    return PsiUtil.isAnnotationMethod(resolved) ? (PsiAnnotationMethod)resolved : null;
  }

  @Override
  public GrAnnotationArgumentList findElementForUpdatingParameterInfo(@NotNull UpdateParameterInfoContext context) {
    return findAnchor(context.getEditor(), context.getFile());
  }

  @Override
  public void updateParameterInfo(@NotNull GrAnnotationArgumentList parameterOwner, @NotNull UpdateParameterInfoContext context) {
    context.setHighlightedParameter(findAnnotationMethod(context.getFile(), context.getEditor()));
  }

  private static int inferOffset(@NotNull final Editor editor) {
    CharSequence chars = editor.getDocument().getCharsSequence();
    int offset1 = CharArrayUtil.shiftForward(chars, editor.getCaretModel().getOffset(), " \t");
    final char character = chars.charAt(offset1);
    if (character == ',' || character == ')') {
      offset1 = CharArrayUtil.shiftBackward(chars, offset1 - 1, " \t");
    }
    return offset1;
  }

  @Override
  public void updateUI(@NotNull PsiAnnotationMethod p, @NotNull ParameterInfoUIContext context) {
    @NonNls StringBuilder buffer = new StringBuilder();
    final PsiType returnType = p.getReturnType();
    assert returnType != null;
    buffer.append(returnType.getPresentableText());
    buffer.append(" ");
    int highlightStartOffset = buffer.length();
    buffer.append(p.getName());
    int highlightEndOffset = buffer.length();
    buffer.append("()");

    final PsiAnnotationMemberValue defaultValue = p.getDefaultValue();
    if (defaultValue != null) {
      buffer.append(" default ");
      buffer.append(defaultValue.getText());
    }

    context.setupUIComponentPresentation(buffer.toString(), highlightStartOffset, highlightEndOffset, false, p.isDeprecated(), false, context.getDefaultParameterColor());
  }
}


text:
var error1, error2;
import('modules-skip-12.js').catch(e => error1 = e);
import('modules-skip-12.js').catch(e => error2 = e);
%PerformMicrotaskCheckpoint();

assertEquals(error1, error2);
assertInstanceof(error1, SyntaxError);


text:
{% extends "base.html" %}
{% load static %}
{% load compress %}
{% block page_title %}Mobile Response Summary{% endblock %}

{% block css_extra %}

{% endblock %}

{% block endbody %}
  {% compress js %}

  {% endcompress %}
{% endblock %}

{% block content %}

Surveys from KLP Konnect

{% include 'frontend_templates/survey_responses.html' %}
{% endblock %}


text:
namespace remoting {

IpcVideoFrameCapturer::IpcVideoFrameCapturer(
    scoped_refptr<DesktopSessionProxy> desktop_session_proxy)
    : callback_(nullptr),
      desktop_session_proxy_(desktop_session_proxy),
      capture_pending_(false),
      weak_factory_(this) {
}

IpcVideoFrameCapturer::~IpcVideoFrameCapturer() {
}

void IpcVideoFrameCapturer::Start(Callback* callback) {
  DCHECK(!callback_);
  DCHECK(callback);
  callback_ = callback;
  desktop_session_proxy_->SetVideoCapturer(weak_factory_.GetWeakPtr());
}

void IpcVideoFrameCapturer::Capture(const webrtc::DesktopRegion& region) {
  DCHECK(!capture_pending_);
  capture_pending_ = true;
  desktop_session_proxy_->CaptureFrame();
}

void IpcVideoFrameCapturer::OnCaptureCompleted(
    scoped_ptr<webrtc::DesktopFrame> frame) {
  DCHECK(capture_pending_);
  capture_pending_ = false;
  callback_->OnCaptureCompleted(frame.release());
}

}  // namespace remoting


text:
//*****************************************************************************
//
// ldopwr.h - Driver for the LDOPWR Module.
//
//*****************************************************************************

#ifndef __MSP430WARE_LDOPWR_H__
#define __MSP430WARE_LDOPWR_H__

#include "inc/hw_memmap.h"

#ifdef __MSP430_HAS_PU__

//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif

//*****************************************************************************
//
// The following are values that can be passed to the value parameter for
// functions: LDOPWR_setPort_U1_outputData(), and
// LDOPWR_setPort_U0_outputData() as well as returned by the
// LDOPWR_getPort_U1_inputData() function, the LDOPWR_getPort_U0_inputData()
// function, the LDOPWR_getPort_U1_outputData() function and the
// LDOPWR_getPort_U0_outputData() function.
//
//*****************************************************************************
#define LDOPWR_PORTU_PIN_HIGH                                            PUOUT0
#define LDOPWR_PORTU_PIN_LOW                                               0x00

//*****************************************************************************
//
// The following are values that can be passed toThe following are values that
// can be returned by the LDOPWR_isLDOInputValid() function.
//
//*****************************************************************************
#define LDOPWR_LDO_INPUT_VALID                                         LDOBGVBV
#define LDOPWR_LDO_INPUT_INVALID                                           0x00

//*****************************************************************************
//
// The following are values that can be passed toThe following are values that
// can be returned by the LDOPWR_getOverloadAutoOffStatus() function.
//
//*****************************************************************************
#define LDOPWR_AUTOOFF_ENABLED                                        OVLAOFF_H
#define LDOPWR_AUTOOFF_DISABLED                                            0x00

//*****************************************************************************
//
// The following are values that can be passed to the mask parameter for
// functions: LDOPWR_enableInterrupt(), LDOPWR_disableInterrupt(),
// LDOPWR_getInterruptStatus(), and LDOPWR_clearInterruptStatus() as well as
// returned by the LDOPWR_getInterruptStatus() function.
//
//*****************************************************************************
#define LDOPWR_LDOI_VOLTAGE_GOING_OFF_INTERRUPT                      LDOOFFIE_H
#define LDOPWR_LDOI_VOLTAGE_COMING_ON_INTERRUPT                       LDOONIE_H
#define LDOPWR_LDO_OVERLOAD_INDICATION_INTERRUPT                     LDOOVLIE_H

//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
extern void LDOPWR_unLockConfiguration(uint16_t baseAddress);

extern void LDOPWR_lockConfiguration(uint16_t baseAddress);

extern void LDOPWR_enablePort_U_inputs(uint16_t baseAddress);

extern void LDOPWR_disablePort_U_inputs(uint16_t baseAddress);

extern void LDOPWR_enablePort_U_outputs(uint16_t baseAddress);

extern void LDOPWR_disablePort_U_outputs(uint16_t baseAddress);

extern uint8_t LDOPWR_getPort_U1_inputData(uint16_t baseAddress);

extern uint8_t LDOPWR_getPort_U0_inputData(uint16_t baseAddress);

extern uint8_t LDOPWR_getPort_U1_outputData(uint16_t baseAddress);

extern uint8_t LDOPWR_getPort_U0_outputData(uint16_t baseAddress);

extern void LDOPWR_setPort_U1_outputData(uint16_t baseAddress,
                                         uint8_t value);

extern void LDOPWR_setPort_U0_outputData(uint16_t baseAddress,
                                         uint8_t value);

extern void LDOPWR_togglePort_U1_outputData(uint16_t baseAddress);

extern void LDOPWR_togglePort_U0_outputData(uint16_t baseAddress);

extern void LDOPWR_enableInterrupt(uint16_t baseAddress,
                                   uint16_t mask);

extern void LDOPWR_disableInterrupt(uint16_t baseAddress,
                                    uint16_t mask);

extern void LDOPWR_enable(uint16_t baseAddress);

extern void LDOPWR_disable(uint16_t baseAddress);

extern uint8_t LDOPWR_getInterruptStatus(uint16_t baseAddress,
                                         uint16_t mask);

extern void LDOPWR_clearInterruptStatus(uint16_t baseAddress,
                                        uint16_t mask);

extern uint8_t LDOPWR_isLDOInputValid(uint16_t baseAddress);

extern void LDOPWR_enableOverloadAutoOff(uint16_t baseAddress);

extern void LDOPWR_disableOverloadAutoOff(uint16_t baseAddress);

extern uint8_t LDOPWR_getOverloadAutoOffStatus(uint16_t baseAddress);

//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

#endif
#endif // __MSP430WARE_LDOPWR_H__


text:
@implementation TextCell

- (void)awakeFromNib {
    // Initialization code

    self.textCellView.layer.masksToBounds = NO;
    self.textCellView.layer.cornerRadius = 1;
    self.textCellView.layer.shadowOffset = CGSizeMake(0.0f, 2.0f);
    self.textCellView.layer.shadowRadius = 1;
    self.textCellView.layer.shadowOpacity = .2;

    self.textCellView.maxLines = 7;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)updateCell {
    [self.textCellView updateWithData:self.post];
}

@end