text:
import * as actionCreators from './action-creators';

// import _debug from './debug'; const debug = _debug('orchestrators');

export const updateFilter = async (dispatch, id, attribute, nextState) => {
    dispatch(actionCreators.updateFilter(id, attribute, nextState));
};

export const updateSortBy = async (dispatch, id, event) => {
    dispatch(actionCreators.updateSortBy(id, event.target.value));
};


text:
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>How to Gardner</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />

How to Gardner

The Home of Gardnering

Hi I'm Steve. I'm a Gardner

      I write software at Zapier. I used to
      play saxophone a lot. Now I chase a couple of toddlers around the world
      with the most beautiful neuroscientist storyteller in the world. We love
      to tell stories for our kids with
      Mixtums. You can also see what I'm up to
      right now

You can find me at any of these fine socials

GitHub

LinkedIn

Twitter

redpajama_set_name: RedPajamaGithub


text:
#include <iostream>
#include <stdlib.h>

// Need to override adaptor classes for toolkit test harness, so include
// test harness headers before dali headers.
#include <dali-toolkit-test-suite-utils.h>

#include <dali.h>
#include <dali-toolkit/dali-toolkit.h>

#include <dali-toolkit/internal/controls/scrollable/item-view/grid-layout.h>

using namespace Dali;
using namespace Toolkit;

namespace
{
const unsigned int TOTAL_ITEM_NUMBER = 200;
const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";

// Implementation of ItemFactory for providing actors to ItemView
class TestItemFactory : public ItemFactory
{
public:

  /**
   * Constructor
   * @param application class, stored as reference
   */
  TestItemFactory()
  {
  }

  /**
   * Virtual destructor.
   */
  virtual ~TestItemFactory()
  {
  }

public: // From ItemFactory

  /**
   * Query the number of items available from the factory.
   * The maximum available item has an ID of GetNumberOfItems() - 1.
   */
  virtual unsigned int GetNumberOfItems()
  {
    return TOTAL_ITEM_NUMBER;
  }

  /**
   * Create an Actor to represent a visible item.
   * @param itemId
   * @return the created actor.
   */
  virtual Actor NewItem(unsigned int itemId)
  {
    // Create a renderable actor for this item
    return ImageView::New( TEST_IMAGE_FILE_NAME );
  }
};

}

int UtcDaliItemLayoutCheckPropertiesSetBeforeActivateLayout(void)
{
  ToolkitTestApplication application;

  TestItemFactory factory;
  ItemView view = ItemView::New(factory);

  Property::Map gridLayoutProperty;
  gridLayoutProperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::GRID) );

  //Set the column of grid-layout.
  gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_COLUMN_NUMBER, Dali::Property::Value(6) );

  Property::Array layoutArray;

  layoutArray.PushBack(gridLayoutProperty);

  view.SetProperty( ItemView::Property::LAYOUT, layoutArray );

  Dali::Toolkit::Internal::GridLayout* gridLayout = dynamic_cast<Dali::Toolkit::Internal::GridLayout*>(view.GetLayout(0).Get());

  Dali::Integration::Scene scene = application.GetScene();
  Vector3 stageSize(scene.GetSize());

  //Check if the number of columns is equals to 6 which is set before.
  DALI_TEST_EQUALS(gridLayout->GetNumberOfColumns(), 6, TEST_LOCATION );
  view.ActivateLayout(0, stageSize, 0.0f);
  END_TEST;

}


text:
package org.knowm.xchange.bitfinex.v1;

import java.io.IOException;
import javax.ws.rs.Consumes;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.knowm.xchange.bitfinex.v1.dto.BitfinexExceptionV1;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexAccountFeesResponse;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexBalanceHistoryRequest;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexBalanceHistoryResponse;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexBalancesRequest;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexBalancesResponse;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexDepositAddressRequest;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexDepositAddressResponse;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexDepositWithdrawalHistoryRequest;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexDepositWithdrawalHistoryResponse;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexMarginInfosRequest;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexMarginInfosResponse;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexTradingFeeResponse;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexTradingFeesRequest;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexWithdrawalRequest;
import org.knowm.xchange.bitfinex.v1.dto.account.BitfinexWithdrawalResponse;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexAccountInfosResponse;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexActiveCreditsRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexActivePositionsResponse;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexCancelAllOrdersRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexCancelOfferRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexCancelOrderMultiRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexCancelOrderMultiResponse;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexCancelOrderRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexCreditResponse;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexFundingTradeResponse;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexNewOfferRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexNewOrderMultiRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexNewOrderMultiResponse;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexNewOrderRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexNonceOnlyRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexOfferStatusRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexOfferStatusResponse;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexOrderStatusRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexOrderStatusResponse;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexOrdersHistoryRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexPastFundingTradesRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexPastTradesRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexReplaceOrderRequest;
import org.knowm.xchange.bitfinex.v1.dto.trade.BitfinexTradeResponse;
import si.mazi.rescu.ParamsDigest;

@Path("v1")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface BitfinexAuthenticated extends Bitfinex {

  @POST
  @Path("account_infos")
  BitfinexAccountInfosResponse[] accountInfos(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexNonceOnlyRequest accountInfosRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("account_fees")
  BitfinexAccountFeesResponse accountFees(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexNonceOnlyRequest accountInfosRequest)
      throws IOException;

  @POST
  @Path("order/new")
  BitfinexOrderStatusResponse newOrder(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexNewOrderRequest newOrderRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("order/new/multi")
  BitfinexNewOrderMultiResponse newOrderMulti(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexNewOrderMultiRequest newOrderMultiRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("offer/new")
  BitfinexOfferStatusResponse newOffer(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexNewOfferRequest newOfferRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("balances")
  BitfinexBalancesResponse[] balances(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexBalancesRequest balancesRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("account_infos")
  BitfinexTradingFeeResponse[] tradingFees(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexTradingFeesRequest tradingFeeRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("order/cancel")
  BitfinexOrderStatusResponse cancelOrders(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexCancelOrderRequest cancelOrderRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("order/cancel/all")
  BitfinexOrderStatusResponse cancelAllOrders(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexCancelAllOrdersRequest cancelAllOrdersRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("order/cancel/multi")
  BitfinexCancelOrderMultiResponse cancelOrderMulti(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexCancelOrderMultiRequest cancelOrderRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("order/cancel/replace")
  BitfinexOrderStatusResponse replaceOrder(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexReplaceOrderRequest newOrderRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("offer/cancel")
  BitfinexOfferStatusResponse cancelOffer(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexCancelOfferRequest cancelOfferRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("orders")
  BitfinexOrderStatusResponse[] activeOrders(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexNonceOnlyRequest nonceOnlyRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("orders/hist")
  BitfinexOrderStatusResponse[] ordersHist(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexOrdersHistoryRequest ordersHistoryRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("offers")
  BitfinexOfferStatusResponse[] activeOffers(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexNonceOnlyRequest nonceOnlyRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("positions")
  BitfinexActivePositionsResponse[] activePositions(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexNonceOnlyRequest nonceOnlyRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("order/status")
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  BitfinexOrderStatusResponse orderStatus(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexOrderStatusRequest orderStatusRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("offer/status")
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  BitfinexOfferStatusResponse offerStatus(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexOfferStatusRequest offerStatusRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("mytrades")
  BitfinexTradeResponse[] pastTrades(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexPastTradesRequest pastTradesRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("mytrades_funding")
  BitfinexFundingTradeResponse[] pastFundingTrades(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexPastFundingTradesRequest bitfinexPastFundingTradesRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("credits")
  BitfinexCreditResponse[] activeCredits(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexActiveCreditsRequest activeCreditsRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("margin_infos")
  BitfinexMarginInfosResponse[] marginInfos(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexMarginInfosRequest marginInfosRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("withdraw")
  BitfinexWithdrawalResponse[] withdraw(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexWithdrawalRequest withdrawalRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("deposit/new")
  BitfinexDepositAddressResponse requestDeposit(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexDepositAddressRequest depositRequest)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("history/movements")
  BitfinexDepositWithdrawalHistoryResponse[] depositWithdrawalHistory(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexDepositWithdrawalHistoryRequest request)
      throws IOException, BitfinexExceptionV1;

  @POST
  @Path("history")
  BitfinexBalanceHistoryResponse[] balanceHistory(
      @HeaderParam("X-BFX-APIKEY") String apiKey,
      @HeaderParam("X-BFX-PAYLOAD") ParamsDigest payload,
      @HeaderParam("X-BFX-SIGNATURE") ParamsDigest signature,
      BitfinexBalanceHistoryRequest balanceHistoryRequest)
      throws IOException, BitfinexExceptionV1;
}


text:
package io.strimzi.systemtest.enums;

public enum ClusterOperatorRBACType {
    CLUSTER,
    NAMESPACE
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.springframework.social.samples</groupId>
	<artifactId>spring-social-popup</artifactId>
	<name>Spring Social Popup</name>
	<packaging>war</packaging>
	<version>1.0.0</version>
	<properties>
		<java-version>1.6</java-version>
		<org.springframework.social-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social-version>
		<org.springframework.social.facebook-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social.facebook-version>
		<org.springframework.social.twitter-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social.twitter-version>
		<org.springframework-version>3.2.3.RELEASE</org.springframework-version>
		<org.springframework.security-version>3.1.4.RELEASE</org.springframework.security-version>
		<org.slf4j-version>1.7.5</org.slf4j-version>
	</properties>
	<dependencies>
		<!-- Spring -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${org.springframework-version}</version>
			<exclusions>
				<!-- Exclude Commons Logging in favor of SLF4j -->
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				 </exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>${org.springframework-version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${org.springframework-version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
			<version>${org.springframework-version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>${org.springframework-version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-web</artifactId>
			<version>${org.springframework.security-version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-taglibs</artifactId>
			<version>${org.springframework.security-version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-config</artifactId>
			<version>${org.springframework.security-version}</version>
		</dependency>
		<dependency>
		    <groupId>org.springframework.social</groupId>
		    <artifactId>spring-social-core</artifactId>
	        <version>${org.springframework.social-version}</version>
	    </dependency>
		<dependency>
		    <groupId>org.springframework.social</groupId>
		    <artifactId>spring-social-facebook</artifactId>
	        <version>${org.springframework.social.facebook-version}</version>
	    </dependency>
		<dependency>
		    <groupId>org.springframework.social</groupId>
		    <artifactId>spring-social-twitter</artifactId>
	        <version>${org.springframework.social.twitter-version}</version>
	    </dependency>
		<dependency>
		    <groupId>org.springframework.social</groupId>
		    <artifactId>spring-social-web</artifactId>
	        <version>${org.springframework.social-version}</version>
	    </dependency>

		<!-- JSR 303 with Hibernate Validator -->
		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<version>1.0.0.GA</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-validator</artifactId>
			<version>4.1.0.Final</version>
		</dependency>

		<!-- Logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${org.slf4j-version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
			<version>${org.slf4j-version}</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>${org.slf4j-version}</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.16</version>
			<scope>runtime</scope>
		</dependency>

		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>1.3.159</version>
	    </dependency>

		<!-- CGLIB, only required and used for @Configuration usage -->
		<dependency>
			<groupId>cglib</groupId>
			<artifactId>cglib-nodep</artifactId>
			<version>2.2</version>
		</dependency>

		<!-- Apache Tiles -->
		<dependency>
			<groupId>org.apache.tiles</groupId>
			<artifactId>tiles-jsp</artifactId>
			<version>2.2.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.tiles</groupId>
			<artifactId>tiles-el</artifactId>
			<version>2.2.2</version>
		</dependency>

		<!-- @Inject -->
		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
			<version>1</version>
		</dependency>

		<!-- Servlet -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>jsp-api</artifactId>
			<version>2.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp.jstl</groupId>
			<artifactId>jstl-api</artifactId>
			<version>1.2</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.web</groupId>
			<artifactId>jstl-impl</artifactId>
			<version>1.2</version>
		</dependency>
	</dependencies>
	<repositories>
		<repository>
			<id>org.springframework.maven.release</id>
			<name>Spring Maven Release Repository</name>
			<url>http://repo.springsource.org/libs-release-local</url>
			<releases><enabled>true</enabled></releases>
			<snapshots><enabled>false</enabled></snapshots>
		</repository>
		<!-- For testing against latest Spring snapshots -->
		<repository>
			<id>org.springframework.maven.snapshot</id>
			<name>Spring Maven Snapshot Repository</name>
			<url>http://repo.springsource.org/libs-snapshot-local</url>
			<releases><enabled>false</enabled></releases>
			<snapshots><enabled>true</enabled></snapshots>
		</repository>
		<!-- For developing against latest Spring milestones -->
		<repository>
			<id>org.springframework.maven.milestone</id>
			<name>Spring Maven Milestone Repository</name>
			<url>http://repo.springsource.org/libs-milestone-local</url>
			<snapshots><enabled>false</enabled></snapshots>
		</repository>
	</repositories>
	<build>
		<resources>
			<resource>
				<directory>src/main/java</directory>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>${java-version}</source>
					<target>${java-version}</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.1.1</version>
				<configuration>
					<warName>spring-social-popup</warName>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>tomcat-maven-plugin</artifactId>
				<version>1.1</version>
			</plugin>
		</plugins>
	</build>
</project>


text:
package swim.eval

import scala.collection.Seq
import scala.annotation.tailrec
import fuel.util.TRandom
import fuel.func.StochasticSelection
import fuel.Preamble.RndApply

/**
  * Lexicase selection by Spector et al. Applicable to test-based problems.
  *
  * Iteratively selects a random test and keeps only the solutions that pass it.
  * It does so until only one solution is left, and that solution is the outcome of selection.
  *
  * Note: Here E stands for one objective, not entire evaluation.
  *
  * For details on lexicase seleciton, see:
  * Helmuth, T.; Spector, L. & Matheson, J., "Solving Uncompromising Problems with
  * Lexicase Selection", IEEE Transactions on Evolutionary Computation, 2015, 19, 630-643
  *
  */
class LexicaseSelection[S, E](o: Ordering[E])(implicit rand: TRandom)
    extends StochasticSelection[S, Seq[E]](rand) {
  def apply(pop: Seq[(S, Seq[E])]) = {
    @tailrec def sel(sols: Seq[(S, Seq[E])], cases: IndexedSeq[Int]): (S, Seq[E]) =
      if (sols.size == 1) sols(0)
      else if(cases.isEmpty) sols(rand)
      else {
        val theCase = cases.head
        val ord = new Ordering[(S, Seq[E])] {
          override def compare(a: (S, Seq[E]), b: (S, Seq[E])) = o.compare(a._2(theCase), b._2(theCase))
        }
        val best = sols.min(ord)
        sel(sols.filter(s => ord.compare(s, best) <= 0), cases.tail)
      }
    // assumes nonempty pop
    val t = rand.shuffle(0.until(pop(0)._2.size).toIndexedSeq)
    val r = sel(pop, t)
    r
  }
}

/** EXPERIMENTAL
 *  TODO: E is dummy here; ideally, this should be rewritten without E whatsoever,
 *  but this requires redefinition of Selection trait
 */

class LexicaseSelectionNoEval[S,E](o: Seq[Ordering[S]])(implicit rand: TRandom)
    extends StochasticSelection[S,Seq[E]](rand) {
  def apply(pop: Seq[(S, Seq[E])]) = {
    @tailrec def sel(sols: Seq[(S,Seq[E])], cases: Seq[Ordering[S]]): (S,Seq[E]) =
      if (sols.size == 1) sols(0)
      else if(cases.isEmpty) sols(rand)
      else {
        val ord = cases(rand)
        val best = sols.minBy(_._1)(ord)
        sel(sols.filter(s => ord.compare(s._1, best._1) <= 0), cases.diff(List(ord)))
      }
    // assumes nonempty pop
    sel(pop, o)
  }
}


text:
import { push } from 'connected-react-router';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { fetch } from 'app/actions/TagActions';
import { selectTagById } from 'app/reducers/tags';
import loadingIndicator from 'app/utils/loadingIndicator';
import withPreparedDispatch from 'app/utils/withPreparedDispatch';
import TagDetail from './components/TagDetail';

function mapStateToProps(state, props) {
  const { tagId } = props.match.params;
  return {
    tag: selectTagById(state, {
      tagId,
    }),
  };
}

const mapDispatchToProps = {
  push,
  fetch,
};
export default compose(
  withPreparedDispatch('fetchTagDetail', ({ match: { params } }, dispatch) =>
    dispatch(fetch(params.tagId))
  ),
  connect(mapStateToProps, mapDispatchToProps),
  loadingIndicator(['tag.tag'])
)(TagDetail);


text:
import * as nls from 'vs/nls';
import { alert } from 'vs/base/browser/ui/aria/aria';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions';
import { TabFocus } from 'vs/editor/common/config/commonEditorConfig';
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';

export class ToggleTabFocusModeAction extends EditorAction {

	public static readonly ID = 'editor.action.toggleTabFocusMode';

	constructor() {
		super({
			id: ToggleTabFocusModeAction.ID,
			label: nls.localize({ key: 'toggle.tabMovesFocus', comment: ['Turn on/off use of tab key for moving focus around VS Code'] }, "Toggle Tab Key Moves Focus"),
			alias: 'Toggle Tab Key Moves Focus',
			precondition: undefined,
			kbOpts: {
				kbExpr: null,
				primary: KeyMod.CtrlCmd | KeyCode.KEY_M,
				mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_M },
				weight: KeybindingWeight.EditorContrib
			}
		});
	}

	public run(accessor: ServicesAccessor, editor: ICodeEditor): void {
		const oldValue = TabFocus.getTabFocusMode();
		const newValue = !oldValue;
		TabFocus.setTabFocusMode(newValue);
		if (newValue) {
			alert(nls.localize('toggle.tabMovesFocus.on', "Pressing Tab will now move focus to the next focusable element"));
		} else {
			alert(nls.localize('toggle.tabMovesFocus.off', "Pressing Tab will now insert the tab character"));
		}
	}
}

registerEditorAction(ToggleTabFocusModeAction);


text:
export class ErrorType {
  public messageArgs: string[] = [];

  constructor (
    public code: string,
    public messageKey: string,
    public statusCode: number
  ) {}

  public withArgs (...args: string[]): ErrorType {
    this.messageArgs = args;
    return this;
  }
}


text:
require File.dirname(__FILE__) + '/../spec_helper'

describe "Custom Fields" do

  dataset :pages, :custom_fields

  before do
    @page = pages(:first)
  end

  describe "<r:custom_fields:value />" do

    it "<r:custom_fields:value /> renders the value" do
      @page.should render("<r:custom_fields:value name='a_cf_on_first_page' />").as("a_cf_on_first_page_value")
    end

    it "<r:custom_fields name='first_cf'><r:value /></r:custom_fields> renders value if 'name' attribute is on parent tag" do
      @page.should render("<r:custom_fields name='a_cf_on_first_page'><r:value /></r:custom_fields>").as("a_cf_on_first_page_value")
    end

    it "errors with 'name attribute required'" do
      @page.should render("<r:custom_fields:value />").with_error("'name' attribute required")
    end

    it "errors with 'name attribute required' if 'name' attribute is not on parent tag either" do
      @page.should render("<r:custom_fields><r:value /></r:custom_fields>").with_error("'name' attribute required")
    end

    it "<r:custom_fields:value name='test_cf' default_value='default_cf_value' /> renders the default value" do
      @page.should render("<r:custom_fields:value name='test_cf' default_value='default_cf_value' />").as("default_cf_value")
    end
  end

  describe "<r:custom_fields:if_matches>...</r:custom_fields:if_matches>" do

    it "<r:custom_fields:if_matches>...</r:custom_fields:if_matches> renders the contained block if the custom_field value matches the pattern" do
      @page.should render("<r:custom_fields:if_matches pattern='first' name='a_cf_on_first_page'>true</r:custom_fields:if_matches>").as("true")
    end

    it "<r:custom_fields:if_matches>...</r:custom_fields:if_matches> renders the contained block if the custom_field value matches the pattern and the 'name' attribute is on parent tag" do
      @page.should render("<r:custom_fields name='a_cf_on_first_page'><r:if_matches pattern='first'>true</r:if_matches></r:custom_fields>").as("true")
    end

    it "errors with 'pattern' attribute not found" do
      @page.should render("<r:custom_fields:if_matches>true</r:custom_fields:if_matches>").with_error("'pattern' attribute required")
    end

    it "errors with 'name' attribute required" do
      @page.should render("<r:custom_fields:if_matches pattern='test'>true</r:custom_fields:if_matches>").with_error("'name' attribute required")
    end

    it "errors with 'name' attribute required if 'name' not found on parent tag" do
      @page.should render("<r:custom_fields><r:if_matches pattern='test'>true</r:if_matches></r:custom_fields>").with_error("'name' attribute required")
    end
  end

  describe "<r:custom_fields:unless_matches>...</r:custom_fields:unless_matches>" do

    it "<r:custom_fields:unless_matches>...</r:custom_fields:unless_matches> renders the contained block if custom_field value does not match the pattern" do
      @page.should render("<r:custom_fields:unless_matches pattern='second' name='a_cf_on_first_page'>true</r:custom_fields:unless_matches>").as("true")
    end

    it "<r:custom_fields:unless_matches>...</r:custom_fields:unless_matches> renders the contained block if the custom_field value does not match the pattern and the 'name' attribute is on parent tag" do
      @page.should render("<r:custom_fields name='another_cf_on_first_page'><r:unless_matches pattern='second'>true</r:unless_matches></r:custom_fields>").as("true")
    end

    it "errors with 'pattern' attribute not found" do
      @page.should render("<r:custom_fields:unless_matches>true</r:custom_fields:unless_matches>").with_error("'pattern' attribute required")
    end

    it "errors with 'name' attribute required" do
      @page.should render("<r:custom_fields:unless_matches pattern='test'>true</r:custom_fields:unless_matches>").with_error("'name' attribute required")
    end

    it "errors with 'name' attribute required if 'name' not found on parent tag" do
      @page.should render("<r:custom_fields><r:unless_matches pattern='test'>true</r:unless_matches></r:custom_fields>").with_error("'name' attribute required")
    end
  end

  describe "<r:custom_fields:each>...</r:custom_fields:each>" do

    it "<r:custom_fields:each>...</r:custom_fields:each> renders the custom_fields of the current page" do
      @page.should render(page_custom_fields_each_tag).as("a_cf_on_first_page_value another_cf_on_first_page_value ")
    end

    it "limits the number of custom_fields when given the limit attribute" do
      @page.should render(page_custom_fields_each_tag(%{limit='1'})).as("a_cf_on_first_page_value ")
    end

    it "limits and offsets the custom_fields when given limit and offset attributes" do
      @page.should render(page_custom_fields_each_tag(%{limit='1' offset='1'})).as("another_cf_on_first_page_value ")
    end

    it "changes the sort order when given the order attribute" do
      @page.should render(page_custom_fields_each_tag(%{order='DESC'})).as("another_cf_on_first_page_value a_cf_on_first_page_value ")
    end

    it "sorts by the given attribute" do
      @page.should render(page_custom_fields_each_tag(%{by='value'})).as("a_cf_on_first_page_value another_cf_on_first_page_value ")
    end

    it "sort by the 'by' attribute according to the 'order' attribute" do
      @page.should render(page_custom_fields_each_tag(%{by='value' order='DESC'})).as("another_cf_on_first_page_value a_cf_on_first_page_value ")
    end
  end

  def page_custom_fields_each_tag(attr = nil)
    attr = ' ' + attr unless attr.nil?
    "<r:custom_fields:each#{attr}><r:value /> </r:custom_fields:each>"
  end
end


text:
import collections
import re

from os_brick import initiator
from os_brick.initiator import connector
from oslo_config import cfg
from oslo_log import log as logging

from nova import exception
from nova.i18n import _
from nova import utils
from nova.virt.libvirt.volume import fs

LOG = logging.getLogger(__name__)
CONF = cfg.CONF

VzShare = collections.namedtuple('VzShare',
                                 ['cluster_name', 'mds_list', 'password'])

class LibvirtVZStorageVolumeDriver(fs.LibvirtBaseFileSystemVolumeDriver):
    """Class implements libvirt part of volume driver for VzStorage."""

    SHARE_FORMAT_REGEX = r'(?:(\S+):/)?([a-zA-Z0-9_-]+)(?::(\S+))?$'
    SHARE_LOCK_NAME = "vz_share-%s"

    def __init__(self, connection):
        super(LibvirtVZStorageVolumeDriver, self).__init__(connection)

        # Check for duplicate options:
        # -c - cluster name
        # -l - log file, includes %(cluster_name)s, so it's handled as a
        #      separate config parameter
        # -C - SSD cache file, the same thing with %(cluster_name)s
        # -u, -g, -m - there are default values for these options, so
        #              they're separate config parameters
        cfg_opts_set = set(CONF.libvirt.vzstorage_mount_opts)
        invalid_opts_set = set(('-c', '-l', '-C', '-u', '-g', '-m',))
        invalid_cfg_opts = cfg_opts_set.intersection(invalid_opts_set)

        if invalid_cfg_opts:
            msg = (_("You can't use %s options in vzstorage_mount_opts "
                     "configuration parameter.") %
                     ', '.join(invalid_cfg_opts))
            raise exception.InternalError(msg)

        # Call the factory here so we can support
        # more than x86 architectures.
        self.connector = connector.InitiatorConnector.factory(
            initiator.VZSTORAGE, utils.get_root_helper(),
            vzstorage_mount_point_base=CONF.libvirt.vzstorage_mount_point_base)

    def _get_mount_point_base(self):
        return CONF.libvirt.vzstorage_mount_point_base

    def get_config(self, connection_info, disk_info):
        """Returns xml for libvirt."""
        conf = super(LibvirtVZStorageVolumeDriver,
                     self).get_config(connection_info, disk_info)

        conf.source_type = 'file'
        conf.driver_cache = 'writethrough'
        conf.source_path = connection_info['data']['device_path']
        conf.driver_format = connection_info['data'].get('format', 'raw')
        return conf

    def _parse_vz_share(self, vz_share):
        m = re.match(self.SHARE_FORMAT_REGEX, vz_share)
        if not m:
            msg = _("Valid share format is "
                    "[mds[,mds1[...]]:/]clustername[:password]")
            raise exception.InvalidVolume(msg)

        if m.group(1):
            mds_list = m.group(1).split(',')
        else:
            mds_list = None

        return VzShare(cluster_name=m.group(2),
                       mds_list=mds_list,
                       password=m.group(3))

    def _get_mount_opts(self, vz_share):
        cluster_name = self._parse_vz_share(vz_share).cluster_name

        # pstorage-mount man page:
        # https://static.openvz.org/vz-man/man1/pstorage-mount.1.gz.html
        mount_opts = ['-u', CONF.libvirt.vzstorage_mount_user,
                      '-g', CONF.libvirt.vzstorage_mount_group,
                      '-m', CONF.libvirt.vzstorage_mount_perms,
                      '-l', (CONF.libvirt.vzstorage_log_path %
                             {'cluster_name': cluster_name})]

        if CONF.libvirt.vzstorage_cache_path:
            mount_opts.extend(['-C', (CONF.libvirt.vzstorage_cache_path %
                                      {'cluster_name': cluster_name})])
        mount_opts.extend(CONF.libvirt.vzstorage_mount_opts)

        return ' '.join(mount_opts)

    def connect_volume(self, connection_info, instance):
        """Attach the volume to instance_name."""
        vz_share = connection_info['data']['export']
        share_lock = self.SHARE_LOCK_NAME % vz_share

        @utils.synchronized(share_lock)
        def _connect_volume(connection_info, instance):
            LOG.debug("Calling os-brick to mount vzstorage")
            connection_info['data']['options'] = self._get_mount_opts(vz_share)
            device_info = self.connector.connect_volume(
                connection_info['data'])
            LOG.debug("Attached vzstorage volume %s", device_info)
            connection_info['data']['device_path'] = device_info['path']

        return _connect_volume(connection_info, instance)

    def disconnect_volume(self, connection_info, instance):
        """Detach the volume from instance_name."""
        LOG.debug("calling os-brick to detach Vzstorage Volume",
                instance=instance)
        self.connector.disconnect_volume(connection_info['data'], None)
        LOG.debug("Disconnected Vzstorage Volume", instance=instance)


text:
/*
 * vim:ts=4:sw=4:expandtab
 *
 * i3 - an improved dynamic tiling window manager
 * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
 *
 * i3-input/main.c: Utility which lets the user input commands and sends them
 *                  to i3.
 *
 */
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <err.h>
#include <stdint.h>
#include <getopt.h>
#include <limits.h>

#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h>
#include <xcb/xcb_keysyms.h>

#include <X11/keysym.h>

#include "keysym2ucs.h"

#include "i3-input.h"

#include "libi3.h"

/* IPC format string. %s will be replaced with what the user entered, then
 * the command will be sent to i3 */
static char *format;

static char *socket_path;
static int sockfd;
static xcb_key_symbols_t *symbols;
static bool modeswitch_active = false;
static xcb_window_t win;
static xcb_pixmap_t pixmap;
static xcb_gcontext_t pixmap_gc;
static xcb_char2b_t glyphs_ucs[512];
static char *glyphs_utf8[512];
static int input_position;
static i3Font font;
static i3String *prompt;
static int prompt_offset = 0;
static int limit;
xcb_window_t root;
xcb_connection_t *conn;
xcb_screen_t *root_screen;
static xcb_get_input_focus_cookie_t focus_cookie;

/*
 * Having verboselog(), errorlog() and debuglog() is necessary when using libi3.
 *
 */
void verboselog(char *fmt, ...) {
    va_list args;

    va_start(args, fmt);
    vfprintf(stdout, fmt, args);
    va_end(args);
}

void errorlog(char *fmt, ...) {
    va_list args;

    va_start(args, fmt);
    vfprintf(stderr, fmt, args);
    va_end(args);
}

void debuglog(char *fmt, ...) {
}

/*
 * Restores the X11 input focus to whereever it was before.
 * This is necessary because i3-input's window has override_redirect=1
 * (→ unmanaged by the window manager) and thus i3-input changes focus itself.
 * This function is called on exit().
 *
 */
static void restore_input_focus(void) {
    xcb_generic_error_t *error;
    xcb_get_input_focus_reply_t *reply = xcb_get_input_focus_reply(conn, focus_cookie, &error);
    if (error != NULL) {
        fprintf(stderr, "[i3-input] ERROR: Could not restore input focus (X error %d)\n", error->error_code);
        return;
    }
    xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, reply->focus, XCB_CURRENT_TIME);
    xcb_flush(conn);
}

/*
 * Concats the glyphs (either UCS-2 or UTF-8) to a single string, suitable for
 * rendering it (UCS-2) or sending it to i3 (UTF-8).
 *
 */
static uint8_t *concat_strings(char **glyphs, int max) {
    uint8_t *output = calloc(max + 1, 4);
    uint8_t *walk = output;
    for (int c = 0; c < max; c++) {
        printf("at %c\n", glyphs[c][0]);
        /* if the first byte is 0, this has to be UCS2 */
        if (glyphs[c][0] == '\0') {
            memcpy(walk, glyphs[c], 2);
            walk += 2;
        } else {
            strcpy((char *)walk, glyphs[c]);
            walk += strlen(glyphs[c]);
        }
    }
    printf("output = %s\n", output);
    return output;
}

/*
 * Handles expose events (redraws of the window) and rendering in general. Will
 * be called from the code with event == NULL or from X with event != NULL.
 *
 */
static int handle_expose(void *data, xcb_connection_t *conn, xcb_expose_event_t *event) {
    printf("expose!\n");

    /* re-draw the background */
    xcb_rectangle_t border = {0, 0, 500, font.height + 8}, inner = {2, 2, 496, font.height + 8 - 4};
    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {get_colorpixel("#FF0000")});
    xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &border);
    xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {get_colorpixel("#000000")});
    xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &inner);

    /* restore font color */
    set_font_colors(pixmap_gc, get_colorpixel("#FFFFFF"), get_colorpixel("#000000"));

    /* draw the prompt … */
    if (prompt != NULL) {
        draw_text(prompt, pixmap, pixmap_gc, 4, 4, 492);
    }
    /* … and the text */
    if (input_position > 0) {
        i3String *input = i3string_from_ucs2(glyphs_ucs, input_position);
        draw_text(input, pixmap, pixmap_gc, prompt_offset + 4, 4, 492);
        i3string_free(input);
    }

    /* Copy the contents of the pixmap to the real window */
    xcb_copy_area(conn, pixmap, win, pixmap_gc, 0, 0, 0, 0, /* */ 500, font.height + 8);
    xcb_flush(conn);

    return 1;
}

/*
 * Deactivates the Mode_switch bit upon release of the Mode_switch key.
 *
 */
static int handle_key_release(void *ignored, xcb_connection_t *conn, xcb_key_release_event_t *event) {
    printf("releasing %d, state raw = %d\n", event->detail, event->state);

    xcb_keysym_t sym = xcb_key_press_lookup_keysym(symbols, event, event->state);
    if (sym == XK_Mode_switch) {
        printf("Mode switch disabled\n");
        modeswitch_active = false;
    }

    return 1;
}

static void finish_input() {
    char *command = (char *)concat_strings(glyphs_utf8, input_position);

    /* count the occurences of %s in the string */
    int c;
    int len = strlen(format);
    int cnt = 0;
    for (c = 0; c < (len - 1); c++)
        if (format[c] == '%' && format[c + 1] == 's')
            cnt++;
    printf("occurences = %d\n", cnt);

    /* allocate space for the output */
    int inputlen = strlen(command);
    char *full = calloc(1,
                        strlen(format) - (2 * cnt) /* format without all %s */
                            + (inputlen * cnt)     /* replaced %s */
                            + 1);                  /* trailing NUL */
    char *dest = full;
    for (c = 0; c < len; c++) {
        /* if this is not % or it is % but without a following 's',
         * just copy the character */
        if (format[c] != '%' || (c == (len - 1)) || format[c + 1] != 's')
            *(dest++) = format[c];
        else {
            strncat(dest, command, inputlen);
            dest += inputlen;
            /* skip the following 's' of '%s' */
            c++;
        }
    }

    /* prefix the command if a prefix was specified on commandline */
    printf("command = %s\n", full);

    restore_input_focus();

    xcb_aux_sync(conn);

    ipc_send_message(sockfd, strlen(full), 0, (uint8_t *)full);

    free(full);

#if 0
    free(command);
    return 1;
#endif
    exit(0);
}

/*
 * Handles keypresses by converting the keycodes to keysymbols, then the
 * keysymbols to UCS-2. If the conversion succeeded, the glyph is saved in the
 * internal buffers and displayed in the input window.
 *
 * Also handles backspace (deleting one character) and return (sending the
 * command to i3).
 *
 */
static int handle_key_press(void *ignored, xcb_connection_t *conn, xcb_key_press_event_t *event) {
    printf("Keypress %d, state raw = %d\n", event->detail, event->state);

    /* See the documentation of xcb_key_symbols_get_keysym for this one.
     * Basically: We get either col 0 or col 1, depending on whether shift is
     * pressed. */
    int col = (event->state & XCB_MOD_MASK_SHIFT);

    /* If modeswitch is currently active, we need to look in group 2 or 3,
     * respectively. */
    if (modeswitch_active)
        col += 2;

    xcb_keysym_t sym = xcb_key_press_lookup_keysym(symbols, event, col);
    if (sym == XK_Mode_switch) {
        printf("Mode switch enabled\n");
        modeswitch_active = true;
        return 1;
    }

    if (sym == XK_Return)
        finish_input();

    if (sym == XK_BackSpace) {
        if (input_position == 0)
            return 1;

        input_position--;
        free(glyphs_utf8[input_position]);

        handle_expose(NULL, conn, NULL);
        return 1;
    }
    if (sym == XK_Escape) {
        restore_input_focus();
        exit(0);
    }

    /* TODO: handle all of these? */
    printf("is_keypad_key = %d\n", xcb_is_keypad_key(sym));
    printf("is_private_keypad_key = %d\n", xcb_is_private_keypad_key(sym));
    printf("xcb_is_cursor_key = %d\n", xcb_is_cursor_key(sym));
    printf("xcb_is_pf_key = %d\n", xcb_is_pf_key(sym));
    printf("xcb_is_function_key = %d\n", xcb_is_function_key(sym));
    printf("xcb_is_misc_function_key = %d\n", xcb_is_misc_function_key(sym));
    printf("xcb_is_modifier_key = %d\n", xcb_is_modifier_key(sym));

    if (xcb_is_modifier_key(sym) || xcb_is_cursor_key(sym))
        return 1;

    printf("sym = %c (%d)\n", sym, sym);

    /* convert the keysym to UCS */
    uint16_t ucs = keysym2ucs(sym);
    if ((int16_t)ucs == -1) {
        fprintf(stderr, "Keysym could not be converted to UCS, skipping\n");
        return 1;
    }

    xcb_char2b_t inp;
    inp.byte1 = (ucs & 0xff00) >> 2;
    inp.byte2 = (ucs & 0x00ff) >> 0;

    printf("inp.byte1 = %02x, inp.byte2 = %02x\n", inp.byte1, inp.byte2);
    /* convert it to UTF-8 */
    char *out = convert_ucs2_to_utf8(&inp, 1);
    printf("converted to %s\n", out);

    glyphs_ucs[input_position] = inp;
    glyphs_utf8[input_position] = out;
    input_position++;

    if (input_position == limit)
        finish_input();

    handle_expose(NULL, conn, NULL);
    return 1;
}

int main(int argc, char *argv[]) {
    format = strdup("%s");
    socket_path = getenv("I3SOCK");
    char *pattern = sstrdup("-misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1");
    int o, option_index = 0;

    static struct option long_options[] = {
        {"socket", required_argument, 0, 's'},
        {"version", no_argument, 0, 'v'},
        {"limit", required_argument, 0, 'l'},
        {"prompt", required_argument, 0, 'P'},
        {"prefix", required_argument, 0, 'p'},
        {"format", required_argument, 0, 'F'},
        {"font", required_argument, 0, 'f'},
        {"help", no_argument, 0, 'h'},
        {0, 0, 0, 0}};

    char *options_string = "s:p:P:f:l:F:vh";

    while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) {
        switch (o) {
            case 's':
                FREE(socket_path);
                socket_path = strdup(optarg);
                break;
            case 'v':
                printf("i3-input " I3_VERSION);
                return 0;
            case 'p':
                /* This option is deprecated, but will still work in i3 v4.1, 4.2 and 4.3 */
                fprintf(stderr, "i3-input: WARNING: the -p option is DEPRECATED in favor of the -F (format) option\n");
                FREE(format);
                sasprintf(&format, "%s%%s", optarg);
                break;
            case 'l':
                limit = atoi(optarg);
                break;
            case 'P':
                i3string_free(prompt);
                prompt = i3string_from_utf8(optarg);
                break;
            case 'f':
                FREE(pattern);
                pattern = strdup(optarg);
                break;
            case 'F':
                FREE(format);
                format = strdup(optarg);
                break;
            case 'h':
                printf("i3-input " I3_VERSION "\n");
                printf("i3-input [-s <socket>] [-F <format>] [-l <limit>] [-P <prompt>] [-f <font>] [-v]\n");
                printf("\n");
                printf("Example:\n");
                printf("    i3-input -F 'workspace \"%%s\"' -P 'Switch to workspace: '\n");
                return 0;
        }
    }

    printf("using format \"%s\"\n", format);

    int screen;
    conn = xcb_connect(NULL, &screen);
    if (!conn || xcb_connection_has_error(conn))
        die("Cannot open display\n");

    if (socket_path == NULL)
        socket_path = root_atom_contents("I3_SOCKET_PATH", conn, screen);

    if (socket_path == NULL)
        socket_path = "/tmp/i3-ipc.sock";

    sockfd = ipc_connect(socket_path);

    /* Request the current InputFocus to restore when i3-input exits. */
    focus_cookie = xcb_get_input_focus(conn);

    root_screen = xcb_aux_get_screen(conn, screen);
    root = root_screen->root;

    symbols = xcb_key_symbols_alloc(conn);

    font = load_font(pattern, true);
    set_font(&font);

    if (prompt != NULL)
        prompt_offset = predict_text_width(prompt);

    /* Open an input window */
    win = xcb_generate_id(conn);
    xcb_create_window(
        conn,
        XCB_COPY_FROM_PARENT,
        win,                          /* the window id */
        root,                         /* parent == root */
        50, 50, 500, font.height + 8, /* dimensions */
        0,                            /* X11 border = 0, we draw our own */
        XCB_WINDOW_CLASS_INPUT_OUTPUT,
        XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
        XCB_CW_BACK_PIXEL | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK,
        (uint32_t[]) {
            0, /* back pixel: black */
            1, /* override redirect: don't manage this window */
            XCB_EVENT_MASK_EXPOSURE});

    /* Map the window (make it visible) */
    xcb_map_window(conn, win);

    /* Create pixmap */
    pixmap = xcb_generate_id(conn);
    pixmap_gc = xcb_generate_id(conn);
    xcb_create_pixmap(conn, root_screen->root_depth, pixmap, win, 500, font.height + 8);
    xcb_create_gc(conn, pixmap_gc, pixmap, 0, 0);

    /* Set input focus (we have override_redirect=1, so the wm will not do
     * this for us) */
    xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, win, XCB_CURRENT_TIME);

    /* Grab the keyboard to get all input */
    xcb_flush(conn);

    /* Try (repeatedly, if necessary) to grab the keyboard. We might not
     * get the keyboard at the first attempt because of the keybinding
     * still being active when started via a wm's keybinding. */
    xcb_grab_keyboard_cookie_t cookie;
    xcb_grab_keyboard_reply_t *reply = NULL;

    int count = 0;
    while ((reply == NULL || reply->status != XCB_GRAB_STATUS_SUCCESS) && (count++ < 500)) {
        cookie = xcb_grab_keyboard(conn, false, win, XCB_CURRENT_TIME, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
        reply = xcb_grab_keyboard_reply(conn, cookie, NULL);
        usleep(1000);
    }

    if (reply->status != XCB_GRAB_STATUS_SUCCESS) {
        fprintf(stderr, "Could not grab keyboard, status = %d\n", reply->status);
        restore_input_focus();
        exit(-1);
    }

    xcb_flush(conn);

    xcb_generic_event_t *event;
    while ((event = xcb_wait_for_event(conn)) != NULL) {
        if (event->response_type == 0) {
            fprintf(stderr, "X11 Error received! sequence %x\n", event->sequence);
            continue;
        }

        /* Strip off the highest bit (set if the event is generated) */
        int type = (event->response_type & 0x7F);

        switch (type) {
            case XCB_KEY_PRESS:
                handle_key_press(NULL, conn, (xcb_key_press_event_t *)event);
                break;

            case XCB_KEY_RELEASE:
                handle_key_release(NULL, conn, (xcb_key_release_event_t *)event);
                break;

            case XCB_EXPOSE:
                handle_expose(NULL, conn, (xcb_expose_event_t *)event);
                break;
        }

        free(event);
    }

    return 0;
}


text:
extern "C" {
  const char *__asan_default_suppressions() { return "FooBar"; }
}
// CHECK: AddressSanitizer: failed to parse suppressions
int main() {}


text:
<?php

namespace backend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\models\City;

/**
 * CitySearch represents the model behind the search form about `backend\models\City`.
 */
class CitySearch extends City
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'integer'],
            [['name', 'code', 'description', 'country_name', 'latitude', 'longitude'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = City::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
        ]);

        $query->andFilterWhere(['like', 'name', $this->name])
            ->andFilterWhere(['like', 'code', $this->code])
            ->andFilterWhere(['like', 'description', $this->description])
            ->andFilterWhere(['like', 'country_name', $this->country_name])
            ->andFilterWhere(['like', 'latitude', $this->latitude])
            ->andFilterWhere(['like', 'longitude', $this->longitude]);

        return $dataProvider;
    }
}


text:
package info.bitrich.xchangestream.cexio.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;

public class CexioWebSocketOrderBookSubscribeResponse {
  @JsonProperty public final Date timestamp;

  @JsonProperty public final List<List<BigDecimal>> bids;

  @JsonProperty public final List<List<BigDecimal>> asks;

  @JsonProperty public final String pair;

  @JsonProperty public final BigInteger id;

  public CexioWebSocketOrderBookSubscribeResponse(
      @JsonProperty(value = "timestamp", required = false) Date timestamp,
      @JsonProperty(value = "time", required = false) Date time,
      @JsonProperty("bids") List<List<BigDecimal>> bids,
      @JsonProperty("asks") List<List<BigDecimal>> asks,
      @JsonProperty("pair") String pair,
      @JsonProperty("id") BigInteger id) {
    if (timestamp == null && time == null) {
      throw new IllegalArgumentException("Both time and timestamp cannot be null");
    }
    this.timestamp = timestamp != null ? timestamp : time;
    this.bids = bids;
    this.asks = asks;
    this.pair = pair;
    this.id = id;
  }
}


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/*
 * Copyright 2017 IBM International Business Machines Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 	http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* IBM_PROLOG_END_TAG                                                     */
/**
 * @file buffer_parameters.H
 * @brief definitions for fapi2 buffer parameter types
 */

#ifndef __FAPI2_BUFFER_PARAM__
#define __FAPI2_BUFFER_PARAM__

#include <stdint.h>

namespace fapi2
{
/// @cond
/// @brief Traits of buffer parameters - things passed in
/// @tparam T is the type of i_value (typically an integral type)
template<typename T>
class parameterTraits
{
    public:
        // Why constexpr functions? Enums are hard to do math on, and
        // static const doesn't work without -O1 (or greater.) That might
        // be a bug in g++ but this works just the same.
        constexpr static T mask(void)
        {
            return T(~0);
        }

        constexpr static uint32_t byte_length(void)
        {
            return sizeof(T);
        }

        constexpr static uint32_t bit_length(void)
        {
            return sizeof(T) * 8;
        }

        template<typename U>
        inline static void write_element(void* i_data, T i_value, uint32_t i_offset)
        {
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
            T* ptr = (T*)i_data + (i_offset ^ ((sizeof(U) / sizeof(T)) - 1));
#else
            T* ptr = (T*)i_data + i_offset;
#endif
            *ptr = i_value;
        }
};
/// @endcond
}

#endif


text:
using System;
using NakedFramework.Architecture.Adapter;
using NakedFramework.Architecture.Component;
using NakedFramework.Architecture.Facet;
using NakedFramework.Architecture.SpecImmutable;

namespace NakedFramework.Metamodel.Facet;

[Serializable]
public sealed class TypeOfFacetInferredFromArray : TypeOfFacetInferredAbstract, ITypeOfFacet {
    private TypeOfFacetInferredFromArray() { }

    public static TypeOfFacetInferredFromArray Instance { get; } = new();

    #region ITypeOfFacet Members

    public override Type GetValue(INakedObjectAdapter collection) => collection.Object.GetType().GetElementType();

    public override IObjectSpecImmutable GetValueSpec(INakedObjectAdapter collection, IMetamodel metamodel) => (IObjectSpecImmutable)metamodel.GetSpecification(GetValue(collection));

    #endregion
}

// Copyright (c) Naked Objects Group Ltd.


text:
import React from 'react';
import { graphql } from 'react-relay';
import { compose, withPropsOnChange } from 'recompose';
import { connect } from 'react-redux';
import Query from '@ncigdc/modern_components/Query';
import { parseFilterParam } from '@ncigdc/utils/uri';
import withRouter from '@ncigdc/utils/withRouter';
import { parse } from 'query-string';

const entityType = 'Files';

export default (Component: ReactClass<*>) =>
  compose(
    withRouter,
    withPropsOnChange(
      ['location'],
      ({ location: { search }, defaultFilters = null }) => {
        const q = parse(search);
        const filters = parseFilterParam(q.filters, defaultFilters);
        return {
          filters,
        };
      },
    ),
    connect((state, props) => ({
      userSelectedFacets: state.customFacets[entityType],
    })),
    withPropsOnChange(
      ['userSelectedFacets', 'filters'],
      ({ userSelectedFacets, filters }) => {
        return {
          variables: {
            filters,
            repoFileCustomFacetFields: userSelectedFacets
              .map(({ field }) => field)
              .join(','),
          },
        };
      },
    ),
  )((props: Object) => {
    return (
      <Query
        parentProps={props}
        minHeight={578}
        variables={props.variables}
        Component={Component}
        query={graphql`
          query FileAggregations_relayQuery(
            $filters: FiltersArgument
            $repoFileCustomFacetFields: [String]!
          ) {
            viewer {
              repository {
                files {
                  facets(facets: $repoFileCustomFacetFields, filters: $filters)
                  aggregations(
                    filters: $filters
                    aggregations_filter_themselves: false
                  ) {
                    data_category {
                      buckets {
                        doc_count
                        key
                      }
                    }
                    data_type {
                      buckets {
                        doc_count
                        key
                      }
                    }
                    experimental_strategy {
                      buckets {
                        doc_count
                        key
                      }
                    }
                    analysis__workflow_type {
                      buckets {
                        doc_count
                        key
                      }
                    }
                    data_format {
                      buckets {
                        doc_count
                        key
                      }
                    }
                    platform {
                      buckets {
                        doc_count
                        key
                      }
                    }
                    access {
                      buckets {
                        doc_count
                        key
                      }
                    }
                  }
                }
              }
            }
          }
        `}
      />
    );
  });


text:
/*
 * storage.cpp
 *
 *  Created on: Dec 10, 2013
 *      Author: Ryler Hockenbury
 *
 *  Read and write from EEPROM
 */

#include "storage.h"

void Storage::writePidPValue(float value, int address) {
	writeFloat(value, address);
}

void Storage::writePidIValue(float value, int address) {
	writeFloat(value, address);
}

void Storage::writePidDValue(float value, int address) {
	writeFloat(value, address);
}

void Storage::writeRadioSmoothFactorValue(float value, int address){
	writeFloat(value, address);
}

/*
 * Methods to read values will use default values if
 * the USE_DEFAULT_VALUES is set, or no value is stored
 */

float Storage::readPidPValue(int address) {
	float value;

	#ifdef USE_DEFAULT_VALUES
		value = PID_P;
		writePidPValue(value);
	#else
		value = readFloat(address);
		if(value == 0x0 || value == 0xFFFFFFFF) {
			value = PID_P;
			writePidPValue(value);
		}
	#endif

	return value;
}

float Storage::readPidIValue(int address) {
	float value;

	#ifdef USE_DEFAULT_VALUES
		value = PID_I;
		writePidPValue(value);
	#else
		value = readFloat(address);
		if(value == 0x0 || value == 0xFFFFFFFF) {
			value = PID_I;
			writePidIValue(value);
		}
	#endif

	return value;
}

float Storage::readPidDValue(int address) {
	float value;

	#ifdef USE_DEFAULT_VALUES
		value = PID_D;
		writePidPValue(value);
	#else
		value = readFloat(address);
		if(value == 0x0 || value == 0xFFFFFFFF) {
			value = PID_D;
			writePidDValue(value);
		}
	#endif

	return value;
}

float Storage::readRadioSmoothFactorValue(int address) {
	float value;

	#ifdef USE_DEFAULT_VALUES
		value = RADIO_SMOOTH_FACTOR;
		writePidPValue(value);
	#else
		value = readFloat(address);
		if(value == 0x0 || value == 0xFFFFFFFF) {
			value = PID_D;
			writePidDValue(value);
		}
	#endif

	return value;
}

/*
 * Utility method to read a float from an address
 */
float Storage::readFloat(int address) {
	union floatStore {
		byte floatByte[4];
		unsigned short floatUShort[2];
		float floatVal;
	} floatOut;

	for (int i = 0; i < 4; i++) {
		floatOut.floatByte[i] = EEPROM.read(address + i);
	}

	return floatOut.floatVal;
}

/*
 * Utility method to write a float to an address
 */
void Storage::writeFloat(float value, int address) {
	union floatStore {
		byte floatByte[4];
		unsigned short floatUShort[2];
		float floatVal;
	} floatIn;

	floatIn.floatVal = value;

	for (int i = 0; i < 4; i++) {
		EEPROM.write(address + i, floatIn.floatByte[i]);
	}
}

/*
 * Utility method to read a long from an address
 */
long Storage::readLong(int address) {
    union longStore {
    	byte longByte[4];
    	unsigned short longUShort[2];
    	long longVal;
    } longOut;

    for (byte i = 0; i < 4; i++) {
      longOut.longByte[i] = EEPROM.read(address + i);
    }

    return longOut.longVal;
}

/*
 * Utility method to write a long to an address
 */
void Storage::writeLong(long value, int address) {
    union longStore {
    	byte longByte[4];
    	unsigned short longUShort[2];
    	long longVal;
    } longIn;

    longIn.longVal = value;

    for (int i = 0; i < 4; i++) {
      EEPROM.write(address + i, longIn.longByte[i]);
    }
}


text:
rp_module_id="prboom-plus"
rp_module_desc="Doom/Doom II engine - Enhanced PRBoom Port"
rp_module_licence="https://github.com/coelckers/prboom-plus"
rp_module_section="exp"

function depends_prboom-plus() {
    getDepends libsdl2-dev libsdl2-net-dev libsdl2-image-dev libpcre3-dev libsdl2-mixer-dev libfluidsynth-dev libportmidi-dev libmad0-dev libdumb1-dev libvorbis-dev
}

function sources_prboom-plus() {
    gitPullOrClone "$md_build" https://github.com/coelckers/prboom-plus.git
}

function build_prboom-plus() {
    cd prboom2
#    ./bootstrap
#    ./configure
    cmake .
    make
    md_ret_require="$md_build/prboom2/prboom-plus"

}

function install_prboom-plus() {
    md_ret_files=(
        'prboom2/prboom-plus'
        'prboom2/prboom-plus.wad'
    )
}

function game_data_prboom-plus() {
    if [[ ! -f "$romdir/ports/doom/doom1.wad" ]]; then
        # download doom 1 shareware
        wget -nv -O "$romdir/ports/doom/doom1.wad" "$__archive_url/doom1.wad"
        chown $user:$user "$romdir/ports/doom/doom1.wad"
    fi
}

function _add_games_prboom-plus() {
    local cmd="$1"
    declare -A games=(
        ['doom1']="Doom"
        ['doom2']="Doom 2"
        ['tnt']="TNT - Evilution"
        ['plutonia']="The Plutonia Experiment"
    )
    local game
    local wad
    for game in "${!games[@]}"; do
        wad="$romdir/ports/doom/$game.wad"
        if [[ -f "$wad" ]]; then
            addPort "$md_id" "doom" "${games[$game]}" "$cmd" "$wad"
        fi
    done
}

function add_games_prboom-plus() {
    _add_games_prboom-plus "pushd $md_inst; $md_inst/prboom-plus -iwad %ROM%; popd"
}

function configure_prboom-plus() {
    setConfigRoot "ports"

    mkRomDir "ports/doom"
    moveConfigDir "$home/.prboom-plus" "$md_conf_root/prboom-plus"

    [[ "$md_mode" == "install" ]] && game_data_prboom-plus

    add_games_prboom-plus

    cp prboom-plus.wad "$romdir/ports/doom/"
    chown $user:$user "$romdir/ports/doom/prboom-plus.wad"
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Project2.GameObjects.Abstract;
using Project2.GameObjects.PhysicsPuzzles;
using SharpDX;

namespace Project2.GameObjects.LevelPieces
{
    /// <summary>
    /// End zone piece contains a end zone object in the centre of a flat plane
    /// </summary>
    class EndZone : LevelPlane
    {
        public ModelPhysicsObject endGoal;
        public EndZone(Project2Game game, Level level, Vector3 position)
            : base(game, level, position, SlopeType.Flat)
        {
            var endPuzzle = new EndGoal(game, this,
                position + new Vector3(Level.PreferedTileWidth/2.0f, 0, Level.PreferedTileHeight/2.0f));
            AddChild(endPuzzle);
            this.endGoal = endPuzzle.obelisk;
        }
    }
}


text:
var exported_pi;
var relative_being_exported;

// For IE8 and Safari, we need to use downloadify

//  For downliadify to support Safari and IE downloading
function load_export_downloadify(){
	var lng = window.i18n.lng();

	Downloadify.create('export_downloadify',{
		filename: function(){
			if (exported_pi.name != null || exported_pi.name != "") exported_filename = exported_pi.name + "_Health_History.xml";
			else exported_filename = "Exported_Family_Member_Health_History.xml";
			return exported_filename;
		},
		data: function(){
			return make_export_string(exported_pi);
		},
		onComplete: function(){ alert('Your File Has Been Saved!'); },
		onCancel: function(){ alert('You have cancelled the saving of this file.'); },
		onError: function(){ alert('You must put something in the File Contents or there will be nothing to save!'); },
		swf: '../downloadify/media/downloadify.swf',
		downloadImage: '../downloadify/images/download_copyfamily_'+lng+'.png',
		width: 200,
		height: 32,
		transparent: true,
		append: false
	});
}

function build_copy_for_family_member_dialog() {
	give_instructions();

	var ua = navigator.userAgent.toLowerCase();
	var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
	if(!isAndroid) {
		relative_select = create_family_member_select();
		relative_select.on("change", bind_relative_select_change);
	} else {
		$("#copy_for_family_member").append($("
")
			.append($.t("fhh_js.android")));
	}
}

function bind_relative_select_change() {
	relative_being_exported = $(this).val();

// Need to check if exported member has gender, name, and date of birth
	if (personal_information[relative_being_exported].name == null
	 || personal_information[relative_being_exported].name == "") {
		alert($.t("fhh_export.relative_no_name"));
		return;
	}
	if (personal_information[relative_being_exported].gender == null
	 || personal_information[relative_being_exported].gender == "") {
		alert($.t("fhh_export.relative_no_gender"));
		return;
	}
	if (personal_information[relative_being_exported].date_of_birth == null
	 || personal_information[relative_being_exported].date_of_birth == "") {
		alert($.t("fhh_export.relative_no_dob"));
		return;
	}

	// Deep Copy of the information

	var my_gender = personal_information.gender

  if (relative_being_exported.substring(0,7) == 'brother') pi = export_brother_or_sister(relative_being_exported, my_gender);
  else if (relative_being_exported.substring(0,6) == 'sister') pi = export_brother_or_sister(relative_being_exported, my_gender);
  else if (relative_being_exported.substring(0,6) == 'father') pi = export_father(relative_being_exported, my_gender);
  else if (relative_being_exported.substring(0,6) == 'mother') pi = export_mother(relative_being_exported, my_gender);
  else if (relative_being_exported.substring(0,3) == 'son') pi = export_son_or_daughter(relative_being_exported, my_gender);
  else if (relative_being_exported.substring(0,8) == 'daughter') pi = export_son_or_daughter(relative_being_exported, my_gender);

	exported_pi = pi; // global to pass data to export
	var xml_document = make_export_string(pi);
	var filename = make_filename(pi);

	var a = document.createElement('a');

	if (typeof a.download != "undefined") {
		$("#export_to_relative").remove();
		$("#export_downloadify").remove();
		var export_button = $("" + $.t("fhh_js.export") + "");
		// var export_button = $("<button id='export_to_relative' >" + $.t("fhh_js.export") + "</button>");
		export_button.on("click", function () {
			$("#copy_for_family_member").empty().dialog("close");
		});
		$("#copy_for_family_member").append("  ").append(export_button);
		save_document($("#export_to_relative"), xml_document, filename);
	} else {
		$("#export_downloadify").remove();
		var export_downloadify = $("
" + $.t("fhh_js.export") + "
");
		$("#copy_for_family_member").append("  ").append(export_downloadify);
		load_export_downloadify();
	}

}

function export_brother_or_sister(relative_being_exported, my_gender) {
	var pi = new Object();
	set_personal_information_based_on_relative(pi, personal_information[relative_being_exported]);

	var my_information_as_a_relative = get_personal_information_of_relative (personal_information) ;

	if (my_gender == 'MALE') my_relationship = 'brother';
	else my_relationship = 'sister';

	var i = 0;
	while (pi[my_relationship + "_" + i] != null) i++;

	new_relationship = my_relationship + "_" + i;
	pi[new_relationship] = my_information_as_a_relative;

	move_single_relative(pi, 'paternal_grandfather', 'paternal_grandfather');
	move_single_relative(pi, 'paternal_grandmother', 'paternal_grandmother');
	move_single_relative(pi, 'maternal_grandfather', 'maternal_grandfather');
	move_single_relative(pi, 'maternal_grandmother', 'maternal_grandmother');
	move_single_relative(pi, 'father', 'father');
	move_single_relative(pi, 'mother', 'mother');
	move_relatives(pi, 'brother', 'brother', 'except', relative_being_exported);
	move_relatives(pi, 'sister', 'sister', 'except', relative_being_exported);
	move_relatives(pi, 'paternal_uncle', 'paternal_uncle');
	move_relatives(pi, 'paternal_aunt', 'paternal_aunt');
	move_relatives(pi, 'maternal_uncle', 'maternal_uncle');
	move_relatives(pi, 'maternal_aunt', 'maternal_aunt');
	move_relatives(pi, 'paternal_cousin', 'paternal_cousin');
	move_relatives(pi, 'maternal_cousin', 'maternal_cousin');
	move_relatives(pi, 'paternal_halfbrother', 'paternal_halfbrother');
	move_relatives(pi, 'paternal_halfsister', 'paternal_halfsister');
	move_relatives(pi, 'maternal_halfbrother', 'maternal_halfbrother');
	move_relatives(pi, 'maternal_halfsister', 'maternal_halfsister');
//	move_relatives(pi, 'nephew', 'nephew');
//	move_relatives(pi, 'niece', 'niece');
	move_nieces_to_daughters_or_nieces(pi,  personal_information[relative_being_exported].id);
	move_nephews_to_sons_or_nephews(pi,  personal_information[relative_being_exported].id);
	move_relatives(pi, 'son', 'nephew', 'add_parent_id', my_information_as_a_relative.id);
	move_relatives(pi, 'daughter', 'niece', 'add_parent_id', my_information_as_a_relative.id);

	return pi;
}

function export_father(relative_being_exported, my_gender) {
	var pi = new Object();
	set_personal_information_based_on_relative(pi, personal_information[relative_being_exported]);

	var my_information_as_a_relative = get_personal_information_of_relative (personal_information) ;

	if (my_gender == 'MALE') my_relationship = 'son';
	else my_relationship = 'daughter';

	var i = 0;
	while (pi[my_relationship + "_" + i] != null) i++;

	new_relationship = my_relationship + "_" + i;
	pi[new_relationship] = my_information_as_a_relative;

	move_single_relative(pi, 'paternal_grandfather', 'father');
	move_single_relative(pi, 'paternal_grandmother', 'mother');
	move_relatives(pi, 'brother', 'son');
	move_relatives(pi, 'sister', 'daughter');
	move_relatives(pi, 'paternal_uncle', 'brother');
	move_relatives(pi, 'paternal_aunt', 'sister');
	move_relatives(pi, 'paternal_cousin', 'niece/nephew');
	move_relatives(pi, 'son', 'grandson', 'add_parent_id', my_information_as_a_relative.id);
	move_relatives(pi, 'daughter', 'granddaughter', 'add_parent_id', my_information_as_a_relative.id);
	move_relatives(pi, 'paternal_halfbrother', 'son');
	move_relatives(pi, 'paternal_halfsister', 'daughter');
	move_relatives(pi, 'nephew', 'grandson');
	move_relatives(pi, 'niece', 'granddaughter');

	pi.paternal_grandfather = new Object(); pi.paternal_grandfather.gender = 'MALE';
	pi.paternal_grandmother = new Object(); pi.paternal_grandmother.gender = 'FEMALE';
	pi.maternal_grandfather = new Object(); pi.maternal_grandfather.gender = 'MALE';
	pi.maternal_grandmother = new Object(); pi.maternal_grandmother.gender = 'FEMALE';

	return pi;
}

function export_mother(relative_being_exported, my_gender) {
	var pi = new Object();
	set_personal_information_based_on_relative(pi, personal_information[relative_being_exported]);

	var my_information_as_a_relative = get_personal_information_of_relative (personal_information) ;

	if (my_gender == 'MALE') my_relationship = 'son';
	else my_relationship = 'daughter';

	var i = 0;
	while (pi[my_relationship + "_" + i] != null) i++;

	new_relationship = my_relationship + "_" + i;
	pi[new_relationship] = my_information_as_a_relative;

	move_single_relative(pi, 'maternal_grandfather', 'father');
	move_single_relative(pi, 'maternal_grandmother', 'mother');
	move_relatives(pi, 'brother', 'son');
	move_relatives(pi, 'sister', 'daughter');
	move_relatives(pi, 'maternal_uncle', 'brother');
	move_relatives(pi, 'maternal_aunt', 'sister');
	move_relatives(pi, 'maternal_cousin', 'niece/nephew');
	move_relatives(pi, 'son', 'grandson','add_parent_id', my_information_as_a_relative.id);
	move_relatives(pi, 'daughter', 'granddaughter', 'add_parent_id', my_information_as_a_relative.id);
	move_relatives(pi, 'maternal_halfbrother', 'son');
	move_relatives(pi, 'maternal_halfsister', 'daughter');
	move_relatives(pi, 'nephew', 'grandson');
	move_relatives(pi, 'niece', 'granddaughter');

	pi.paternal_grandfather = new Object(); pi.paternal_grandfather.gender = 'MALE';
	pi.paternal_grandmother = new Object(); pi.paternal_grandmother.gender = 'FEMALE';
	pi.maternal_grandfather = new Object(); pi.maternal_grandfather.gender = 'MALE';
	pi.maternal_grandmother = new Object(); pi.maternal_grandmother.gender = 'FEMALE';

	return pi;
}

function export_son_or_daughter(relative_being_exported, my_gender) {
	var pi = new Object();
	set_personal_information_based_on_relative(pi, personal_information[relative_being_exported]);

	var my_information_as_a_relative = get_personal_information_of_relative (personal_information) ;

	if (my_gender == 'MALE') my_relationship = 'father';
	else my_relationship = 'mother';

// Nephew, Nieces, Aunts, Uncles, Granparents, Cousins all drop off
	if (my_gender == 'MALE') {
		pi.father = my_information_as_a_relative;
		pi.father.gender = 'MALE';
		pi.mother = new Object(); pi.mother.gender = 'FEMALE';
		move_single_relative(pi, 'father', 'paternal_grandfather');
		move_single_relative(pi, 'mother', 'paternal_grandmother');
		move_relatives(pi, 'brother', 'paternal_uncle');
		move_relatives(pi, 'sister', 'paternal_aunt');
		move_relatives(pi, 'son', 'brother', 'except', relative_being_exported);
		move_relatives(pi, 'daughter', 'sister', 'except', relative_being_exported);
		move_relatives(pi, 'paternal_halfbrother', 'paternal_uncle');
		move_relatives(pi, 'paternal_halfsister', 'paternal_aunt');

		move_relatives(pi, 'grandson', 'niece/nephew', 'except_descendants', pi.id);
		move_relatives(pi, 'granddaughter', 'niece/nephew', 'except_descendants', pi.id);
		move_relatives(pi, 'grandson', 'son', 'only_descendants', pi.id);
		move_relatives(pi, 'granddaughter', 'daughter', 'only_descendants', pi.id);

		pi.maternal_grandfather = new Object(); pi.maternal_grandfather.gender = 'MALE';
		pi.maternal_grandmother = new Object(); pi.maternal_grandmother.gender = 'FEMALE';

	} else {
		pi.mother = my_information_as_a_relative;
		pi.father = new Object();
		pi.father.gender = 'MALE';
		pi.mother.gender = 'FEMALE';
		move_single_relative(pi, 'father', 'maternal_grandfather');
		move_single_relative(pi, 'mother', 'maternal_grandmother');
		move_relatives(pi, 'brother', 'maternal_uncle');
		move_relatives(pi, 'sister', 'maternal_aunt');
		move_relatives(pi, 'son', 'brother', 'except', relative_being_exported);
		move_relatives(pi, 'daughter', 'sister', 'except', relative_being_exported);
		move_relatives(pi, 'maternal_halfbrother', 'maternal_uncle');
		move_relatives(pi, 'maternal_halfsister', 'maternal_aunt');

		move_relatives(pi, 'grandson', 'niece/nephew', 'except_descendants', pi.id);
		move_relatives(pi, 'granddaughter', 'niece/nephew', 'except_descendants', pi.id);
		move_relatives(pi, 'grandson', 'son', 'only_descendants', pi.id);
		move_relatives(pi, 'granddaughter', 'daughter', 'only_descendants', pi.id);

		pi.paternal_grandfather = new Object(); pi.paternal_grandfather.gender = 'MALE';
		pi.paternal_grandmother = new Object(); pi.paternal_grandmother.gender = 'FEMALE';
	}

	return pi;
}

// Special Cases:
//   For copying siblings, we cannot copy the exported relative as a sibling
//   For brothers/sisters we need to copy nieces/nephews of the exported relative as sons/daughters and sons/daughters become nieces

function move_relatives(pi, from, to, special_type, special_value) {
	var num_to_move = find_first_available_relative_location(pi, to);
	var i = 0;
	while (personal_information[from + "_" + i] != null ) {
		if ( special_type == 'except' && (from + "_" + i) == special_value) {i++; continue;}  // Skip copying the exported sibling
		if ( special_type == 'except_descendants' && personal_information[from + "_" + i].parent_id == special_value) {
			i++; continue;
		}
		if ( special_type == 'only_descendants' && personal_information[from + "_" + i].parent_id != special_value) {
			i++; continue;
		}
		if ( special_type == 'only_if_parent_moved' && !is_parent_in_new_pedigree(personal_information[from + "_" + i].parent_id) ) {
			i++; continue;
		}

		// Because half-siblings have nieces and nephews that should not move if their parent
		// is not part of the move we need to exclude them
		if (to == 'grandson' || to == 'granddaughter') {
			var parent_id = personal_information[from + '_' + i].parent_id;
			if (!is_in_new_pedigree_as_child(pi, parent_id)&& parent_id != null) {
				i++; continue;
			}
		}
		if (to == 'niece/nephew') {
			if (personal_information[from + "_" + i].gender == 'MALE') {
				pi['nephew' + '_' + num_to_move] = JSON.parse(JSON.stringify(personal_information[from + '_' + i]));
			} else {
				pi['niece' + '_' + num_to_move] = JSON.parse(JSON.stringify(personal_information[from + '_' + i]));
			}
		} else {
			pi[to + '_' + num_to_move] = JSON.parse(JSON.stringify(personal_information[from + '_' + i]));
		}

	// Adds Id of proband as parents of his children
		if (special_type == 'add_parent_id') {
			pi[to + "_" + num_to_move].parent_id = special_value;
		}

		num_to_move = find_first_available_relative_location(pi, to);
		i++;
	}
}
// Special function that checks to see if an id is already in the new pedigree as son or daughter
function is_in_new_pedigree_as_child(pi, id_to_check) {
	var i = 0;
	while (pi["son_" + i] != null ) {
		if (pi["son_" + i].id == id_to_check) return true;
		i++;
	}
	i=0;
	while (pi["daughter_" + i] != null ) {
		if (pi["daughter_" + i].id == id_to_check) return true;
		i++;
	}
	return false;
}

// If nieces are of the exported parent, then we need to move them to daughters else leave them as nieces
function move_nieces_to_daughters_or_nieces(pi, parent_id) {
	var i = 0;
	while (personal_information["niece_" + i] != null ) {
		if (personal_information["niece_" + i].parent_id == parent_id) {
			daughter_num_to_move = find_first_available_relative_location(pi, 'daughter');
			pi['daughter_' + daughter_num_to_move] = JSON.parse(JSON.stringify(personal_information["niece_" + i]));
		} else {
			niece_num_to_move = find_first_available_relative_location(pi, 'niece');
			pi['niece_' + niece_num_to_move] = JSON.parse(JSON.stringify(personal_information["niece_" + i]));
		}
		i++;
	}
}

// If nephews are of the exported parent, then we need to move them to sons else leave them as nephews
function move_nephews_to_sons_or_nephews(pi, parent_id) {
	var i = 0;
	while (personal_information["nephew_" + i] != null ) {
		if (personal_information["nephew_" + i].parent_id == parent_id) {
			son_num_to_move = find_first_available_relative_location(pi, 'son');
			pi['son_' + son_num_to_move] = JSON.parse(JSON.stringify(personal_information["nephew_" + i]));
		} else {
			nephew_num_to_move = find_first_available_relative_location(pi, 'nephew');
			pi['nephew_' + nephew_num_to_move] = JSON.parse(JSON.stringify(personal_information["nephew_" + i]));
		}
		i++;
	}
}
function move_single_relative(pi, from, to) {
		pi[to] = JSON.parse(JSON.stringify(personal_information[from]));
}

function find_first_available_relative_location (pi, relationship) {
	var i=0;
	while (pi[relationship + "_" + i] != null) i++;
	return i;
}

function get_personal_information_of_relative (pi) {
	pi_of_relative = new Object();
	pi_of_relative.id = pi.id;
	pi_of_relative.name = pi.name;
	pi_of_relative.gender = pi.gender;
	pi_of_relative.date_of_birth = pi.date_of_birth;
	pi_of_relative.ethnicity = pi.ethnicity;
	pi_of_relative.race = pi.race;
	pi_of_relative.twin_status = pi.twin_status;
	pi_of_relative.adopted = pi.adopted;
	if (pi['Health History'] != null) pi_of_relative['Health History'] = JSON.parse(JSON.stringify(pi['Health History']));

	return 	pi_of_relative;
}

function set_personal_information_based_on_relative(pi, relative) {
	pi.id = relative.id;
	pi.name = relative.name;
	pi.date_of_birth = relative.date_of_birth;
	pi.gender = relative.gender;
	pi.ethnicity = relative.ethnicity;
	pi.race = relative.race;
	pi.twin_status = relative.twin_status;
	pi.adopted = relative.adopted;
	delete(pi.height);
	delete(pi.height_unit);
	delete(pi.weight);
	delete(pi.weight_unit);
	delete(pi.physically_active);

	if (relative['Health History'] != null) pi['Health History'] = JSON.parse(JSON.stringify(relative['Health History']));
}

function make_export_string(pi) {
//	doc = document.implementation.createDocument("urn:hl7-org:v3", "FamilyHistory", null);
	var root = doc.createElement("FamilyHistory");
	add_root_information(root);
	root.appendChild(add_personal_history(pi));

	var str = '';
	str = str + '';
	str = str + '';
	str = str + '';
	str = str + '';
	str = str + '';

	var str = serializeXmlNode(root)
	return(str);
}

function make_filename(pi) {
	var filename = "family_health_history.xml";
	if (pi && pi.name) {
		filename = pi.name.replace(/ /g,"_") + "_Health_History.xml";
	}
	return filename
}

function give_instructions() {
	$("#copy_for_family_member").empty().append($("
")
			.append($("
")
				.append("	"
							+ "" + $.t("fhh_js.export_instructions") + "	"))
			.append($("
")
				.append("" + $.t("fhh_js.export_instructions2") + "	"))
			.append($("
")
				.append("" + $.t("fhh_js.export_instructions3") + "	")));
}

function create_family_member_select() {
	$("#copy_for_family_member").append("" + $.t("fhh_js.choose_relative") + ":  ");
	var relative_select = $("<SELECT id='choose_a_relative'></SELECT>");
	relative_select.append("<OPTION>" + $.t("fhh_js.please_select_relative") + " </OPTION>");
	$("#copy_for_family_member").append(relative_select);

	$.each(personal_information, function (key, item) {
    var temp = key.substring(0,4);
    if(temp == 'brot' || temp == 'sist' || temp == 'fath' || temp == 'moth' || temp == 'daug' || temp == 'son_') {
    	var relative_name = item.name;
    	if (relative_name == null || relative_name == "") relative_name = $.t("fhh_js." + get_relationship_from_relationship_id(key));
    	relative_select.append("<OPTION value='" + key + "'>" + relative_name + "</OPTION>");
    }
	});
	return relative_select;
}


text:
@interface ZJScreenAdaptation : NSObject
//扩展函数适配Rect
CGRect CGRectMakeEx(CGFloat x, CGFloat y, CGFloat width, CGFloat height);
//扩展适应Size
CGSize CGSizeMakeEx(CGFloat width, CGFloat height);
//扩展点
CGPoint CGPointMakeEx(CGFloat x, CGFloat y);

//适配高度
double heightEx(double height);
//适配宽度
double widthEx(double width);
@end


text:
/*************************************************************************/
/*  sem_osx.cpp                                                          */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                    http://www.godotengine.org                         */
/*************************************************************************/
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur.                 */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/
#include "sem_osx.h"

#include <unistd.h>
#include <fcntl.h>

void cgsem_init(cgsem_t *cgsem)
{
	int flags, fd, i;

	pipe(cgsem->pipefd);

	/* Make the pipes FD_CLOEXEC to allow them to close should we call
	 * execv on restart. */
	for (i = 0; i < 2; i++) {
		fd = cgsem->pipefd[i];
		flags = fcntl(fd, F_GETFD, 0);
		flags |= FD_CLOEXEC;
		fcntl(fd, F_SETFD, flags);
	}
}

void cgsem_post(cgsem_t *cgsem)
{
	const char buf = 1;

	write(cgsem->pipefd[1], &buf, 1);
}

void cgsem_wait(cgsem_t *cgsem)
{
	char buf;

	read(cgsem->pipefd[0], &buf, 1);
}

void cgsem_destroy(cgsem_t *cgsem)
{
	close(cgsem->pipefd[1]);
	close(cgsem->pipefd[0]);
}

#include "os/memory.h"
#include <errno.h>

Error SemaphoreOSX::wait() {

	cgsem_wait(&sem);
	return OK;
}

Error SemaphoreOSX::post() {

	cgsem_post(&sem);

	return OK;
}
int SemaphoreOSX::get() const {

	return 0;
}

Semaphore *SemaphoreOSX::create_semaphore_osx() {

	return memnew( SemaphoreOSX );
}

void SemaphoreOSX::make_default() {

	create_func=create_semaphore_osx;
}

SemaphoreOSX::SemaphoreOSX() {

	cgsem_init(&sem);
}

SemaphoreOSX::~SemaphoreOSX() {

	cgsem_destroy(&sem);
}


text:
package com.superscholar.android.adapter;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by Administrator on 2017/2/21.
 * MainActivity的ViewPager适配器
 */

public class ContentAdapter extends PagerAdapter {
    private List<View> views;

    public ContentAdapter(List<View> views) {
        this.views=views;
    }

    @Override
    public int getCount() {
        return views.size();
    }

    @Override
    public boolean isViewFromObject(View arg0, Object arg1) {
        return arg0==arg1;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        View view = views.get(position);
        container.addView(view);
        return view;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(views.get(position));
    }
}


text:
import sbt._

object ProjectDef {

  def inDirectory(_name: String) =
    Project(_name, file(_name))

}


text:
from OpenGLCffi.GLES2 import params
@params(api='gles2', prms=['samples', 'fixedsamplelocations'])
def glRasterSamplesEXT(samples, fixedsamplelocations):
	pass

@params(api='gles2', prms=['n', 'v'])
def glCoverageModulationTableNV(n, v):
	pass

@params(api='gles2', prms=['bufsize', 'v'])
def glGetCoverageModulationTableNV(bufsize, v):
	pass

@params(api='gles2', prms=['components'])
def glCoverageModulationNV(components):
	pass


text:
(function () {
  "use strict";

  angular
    .module("mnPoorMansAlertsService", [
      'ui.router',
      'ui.bootstrap',
      'mnHelper'
    ])
    .factory("mnPoorMansAlertsService", mnPoorMansAlertsFactory);

  function mnPoorMansAlertsFactory($http, $state, $uibModal, mnHelper, $timeout) {
    var alerts = [];
    var modal;
    var modalDeferId;

    var mnPoorMansAlerts = {
      maybeShowAlerts: maybeShowAlerts,
      postAlertsSilenceURL: postAlertsSilenceURL
    };

    return mnPoorMansAlerts;

    function postAlertsSilenceURL(alertsSilenceURL) {
      return $http({
        method: "POST",
        url: alertsSilenceURL,
        timeout: 5000,
        data: ''
      });
    }

    function maybeShowAlerts(poolDefault) {
      if ($state.params.disablePoorMansAlerts) {
        return;
      }
      alerts = getStampedAlerts(poolDefault.alerts);
      if (!alerts.length) {
        return;
      }
      if (modalDeferId) {
        $timeout.cancel(modalDeferId);
      }
      if (modal) {
        modal.dismiss();
        modal = null;
        modalDeferId = $timeout(function () { //we need this in order to allow uibModal close backdrop
          modal = doShowAlerts(poolDefault.alertsSilenceURL, alerts);
        }, 0);
      } else {
        modal = doShowAlerts(poolDefault.alertsSilenceURL, alerts);
      }
    }

    function doShowAlerts(alertsSilenceURL, alerts) {
      return $uibModal.open({
        templateUrl: "app-classic/mn_admin/mn_poor_mans_alerts/mn_poor_mans_alerts.html",
        controller: "mnPoorMansAlertsController as poorMansCtl",
        resolve: {
          alertsSilenceURL: mnHelper.wrapInFunction(alertsSilenceURL),
          alerts: mnHelper.wrapInFunction(alerts)
        }
      });
    }

    function getStampedAlerts(newRawAlerts) {
      var oldStampedAlerts = alerts;
      if (!newRawAlerts) {
        return oldStampedAlerts;
      }
      var i;
      if (oldStampedAlerts.length > newRawAlerts.length) {
        oldStampedAlerts = [];
      }
      for (i = 0; i < oldStampedAlerts.length; i++) {
        if (oldStampedAlerts[i][1] != newRawAlerts[i]) {
          break;
        }
      }
      var rv = (i == oldStampedAlerts.length) ? _.clone(oldStampedAlerts) : [];
      _.each(newRawAlerts.slice(rv.length), function (msg) {
        rv.push([new Date(), msg]);
      });
      return rv;
    }
  }
})();


text:
#ifndef HCUBE_EVALUATIONSET_H_INCLUDED
#define HCUBE_EVALUATIONSET_H_INCLUDED

#include "HCUBE_Defines.h"

#include "Experiments/HCUBE_Experiment.h"

namespace HCUBE
{
    /**
    * EvaluationSet holds a group of individuals that are evaluated sequentially
    */
    class EvaluationSet
    {
    public:
    protected:
        bool running;
        shared_ptr<Experiment> experiment;
        shared_ptr<NEAT::GeneticGeneration> generation;
        vector<shared_ptr<NEAT::GeneticIndividual> >::iterator individualIterator;
        int individualCount;
        bool finished;

    public:
        EvaluationSet(
            shared_ptr<Experiment> _experiment,
            shared_ptr<NEAT::GeneticGeneration> _generation,
            vector<shared_ptr<NEAT::GeneticIndividual> >::iterator _individualIterator,
            int _individualCount
        )
                :
                running(false),
                experiment(_experiment),
                generation(_generation),
                individualIterator(_individualIterator),
                individualCount(_individualCount),
                finished(false)
        {}

        virtual ~EvaluationSet()
        {}

        /**
        * Group the individuals based on the experiment (some experiments support more than one individual per
        * evaluation) and then sequentially evaluate each group.
        */
        virtual void run();

        bool isFinished()
        {
            return finished;
        }

        /**
        * Returns if the EvaluationSet is running
        */
        bool getRunning()
        {
            return running;
        }

        void setRunning(bool _running)
        {
            running = _running;
        }
    protected:
    };
}

#endif // HCUBE_EVALUATIONSET_H_INCLUDED


text:
FROM gcr.io/gcp-runtimes/ubuntu_16_0_4

ENV KUBECTL_VERSION v1.12.8
ENV KUBECTL_URL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl
RUN curl -O "${KUBECTL_URL}"
RUN chmod +x kubectl
RUN mv kubectl /usr/bin/kubectl

COPY ./skaffold /usr/bin/skaffold
RUN chmod +x /usr/bin/skaffold

COPY ./test-build /test-build
COPY ./skaffold.yaml ./skaffold.yaml


text:
Instructions for this application----

--Go to root directory of project: server.js
--Run 'npm install' to install necessary packages
--To install mongo: https://docs.mongodb.com/manual/administration/install-community/
--Run 'mongod' to start mongo service in a new command window
--Use nodemon server.js to run on express
--View the application on localhost:3000
--Only the registration button as yet has functionality
--Try to enter a user into the database and review the profile
--Then look at the list of members and see the new member at the bottom
--There is a working carousel at the bottom of the index page


text:
import alt from '../alt';
import immutableUtil from 'alt/utils/ImmutableUtil';
import Immutable from 'immutable';
import DashboardActions from '../actions/dashboard_actions';

class DashboardStore {
  constructor() {
    this.state = Immutable.fromJS({
      salesStats: []
    });

    this.bindListeners({
      handleUpdateSalesStats: DashboardActions.UPDATE_SALES_STATS,
      handleFetchSalesStats: DashboardActions.FETCH_SALES_STATS
    });
  }

  handleUpdateSalesStats(salesStats) {
    this.setState(this.state.setIn(['salesStates', salesStates]));
  }

  handleFetchSalesStats() {
    this.setState(this.state.setIn(['salesStates', Immutable.List()]));
  }
}

export default alt.createStore(immutableUtil(DashboardStore), 'DashboardStore');