text:
/**
 * @author Dan Nuffer
 */

#include "OW_config.h"
#include "OW_CppIndicationProviderIFC.hpp"
#include "OW_CIMOMEnvironment.hpp"
#include "OW_IndicationRepLayerMediator.hpp"

namespace OW_NAMESPACE
{

// This class is responsible for coordinating with IndicationRepLayer when
// subscriptions are created.  IndicationReplayer creates lifecycle indications
// for any changes caused by intrinsic method calls.
class provindIndicationRepLayer : public CppIndicationProviderIFC
{
public:
	// Indication provider methods
	virtual void activateFilter(const ProviderEnvironmentIFCRef &, const WQLSelectStatement &, const String & eventType, const String&, const StringArray&, bool)
	{
		CIMOMEnvironmentRef ce(CIMOMEnvironment::instance());
		ce->getIndicationRepLayerMediator()->addSubscription(eventType);
	}
	virtual void deActivateFilter(const ProviderEnvironmentIFCRef &, const WQLSelectStatement &, const String & eventType, const String&, const StringArray&, bool )
	{
		CIMOMEnvironmentRef ce(CIMOMEnvironment::instance());
		ce->getIndicationRepLayerMediator()->deleteSubscription(eventType);
	}
	virtual void getIndicationProviderInfo(IndicationProviderInfo& info)
	{
		// all the life-cycle indications that may be generated by
		// IndicationRepLayer
		info.addInstrumentedClass("CIM_InstCreation");
		info.addInstrumentedClass("CIM_InstModification");
		info.addInstrumentedClass("CIM_InstDeletion");
		info.addInstrumentedClass("CIM_InstRead");
		info.addInstrumentedClass("CIM_InstMethodCall");
		info.addInstrumentedClass("CIM_ClassCreation");
		info.addInstrumentedClass("CIM_ClassModification");
		info.addInstrumentedClass("CIM_ClassDeletion");
		// IndicationRepLayer doesn't directly generate these, but they are
		// base classes of the ones it does generate.  We need to report these
		// so that if someone has a query like "SELECT * FROM CIM_Indication"
		// we will be called.
		info.addInstrumentedClass("CIM_ClassIndication");
		info.addInstrumentedClass("CIM_InstIndication");
		info.addInstrumentedClass("CIM_Indication");
	}
};
} // end namespace OW_NAMESPACE

OW_PROVIDERFACTORY(OpenWBEM::provindIndicationRepLayer, owprovindIndicationRepLayer)


text:
import {selectorRegExpFactory} from './helper';

// TODO: hard coded for now
// TODO: build from preboot config
// consider declarative config via <preboot minify="true"></preboot>
export var prebootScript = `
  <preboot>
    <link rel="stylesheet" type="text/css" href="/preboot/preboot.css">
    <script src="/preboot/preboot.js"></script>
    <script>preboot.start()</script>
  </preboot>
`;
// Inject Angular for the developer
export var angularScript = `
  <!-- Browser polyfills -->
  <script src="/bower_components/traceur-runtime/traceur-runtime.min.js"></script>
  <!-- SystemJS -->
  <script src="/bower_components/system.js/dist/system.js"></script>
  <!-- Angular2: Bundle -->
  <script src="/web_modules/angular2.dev.js"></script>
  <script src="/web_modules/router.dev.js"></script>
  <script type="text/javascript">
    System.config({
      "baseURL": "/",
      "defaultJSExtensions": true,
      "map": {
        "*": "*.js",
        "angular2": "node_modules/angular2",
        "rx": "node_modules/rx/dist/rx.min"
      },
      'meta': {
        // auto-detection fails to detect properly
        "rx": {
          "format": "cjs" //https://github.com/systemjs/builder/issues/123
        }
      }
    });
  </script>
`;

export var bootstrapButton = `
  <div id="bootstrapButton">
    <style>
     #bootstrapButton {
      z-index:999999999;
      position: absolute;
      background-color: rgb(255, 255, 255);
      padding: 0.5em;
      border-radius: 3px;
      border: 1px solid rgb(207, 206, 206);
     }
    </style>
    <button onclick="bootstrap()">
      Bootstrap Angular2 Client
    </button>
  </div>
`;

export function bootstrapFunction(appUrl) {
  return `
  <script>
    function bootstrap() {
      if (this.bootstraped) return;
      this.bootstraped = true;
      System.import("${ appUrl }").
        then(function(module) {
          return module.main();
        }).
        then(function() {
          preboot.complete();
          document.body.className += ' angularready';
          var $bootstrapButton = document.getElementById("bootstrapButton");
          if ($bootstrapButton) { $bootstrapButton.remove(); }
        });
    }
  </script>
`;
};

export var bootstrapApp = `
  <script>
    setTimeout(function() {
      bootstrap();
    });
  </script>
`;

export function buildScripts(scripts, appUrl) {
  // figure out what scripts to inject
  return (scripts === false ? '' : (
      (scripts.preboot === true ? prebootScript : '') +
      (scripts.angular === true ? angularScript : '') +
      (scripts.bootstrapButton === true ? angularScript : '') +
      (scripts.bootstrapFunction === true ? bootstrapFunction(appUrl || '') : '') +
      (scripts.bootstrapApp === true ? angularScript : '')
    )
  );
}

// TODO: find better ways to configure the App initial state
// to pay off this technical debt
// currently checking for explicit values
export function buildClientScripts(html, options) {
  return html.
    replace(
      selectorRegExpFactory('preboot'),
      ((options.preboot === false) ? '' : prebootScript)
    ).
    replace(
      selectorRegExpFactory('angular'),
      ((options.angular === false) ? '' : '$1' + angularScript + '$3')
    ).
    replace(
      selectorRegExpFactory('bootstrap'),
      '$1' +
      ((options.bootstrap === false) ? (
        bootstrapButton +
        bootstrapFunction(options.componentUrl)
      ) : (
        (
          (options.client === undefined || options.server === undefined) ?
          '' : (options.client === false) ? '' : bootstrapButton
        ) +
        bootstrapFunction(options.componentUrl) +
        ((options.client === false) ? '' : bootstrapApp)
      )) +
      '$3'
    );
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="TRACE" packages="com.github.omkreddy.log4j2.appender">
	<Appenders>
		<Console name="console" target="SYSTEM_OUT">
			<PatternLayout pattern="%m%n" />
		</Console>
		<Kafka name="KAFKALOGGER1" topic="TEST-TOPIC" enable="true">
			<Property name="bootstrap.servers">localhost:9091</Property>
			<PatternLayout pattern="%5p [%d{ISO8601}] :  %m%n" />
		</Kafka>
	</Appenders>

	<Loggers>
	    <Logger name="org.apache.kafka" level="INFO">
			<AppenderRef ref="console"/>
		</Logger>
		<Root level="info">
			<AppenderRef ref="KAFKALOGGER1" />
		</Root>
	</Loggers>
</Configuration>


text:
package wuyi.model.po;

// Generated May 5, 2015 9:16:55 PM by Hibernate Tools 4.3.1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Customer generated by hbm2java
 */
@Entity
@Table(name = "customer", catalog = "wuyitech")
public class Customer implements java.io.Serializable {

	private Long id;
	private CustomerLevel customerLevel;
	private LivingArea livingArea;
	private String uid;
	private String name;
	private String nickName;
	private String phone;
	private String sex;
	private String password;
	private String role;
	private Date createDate;
	private Date updateDate;
	private String state;
	private String imageUrl;
	private String customerState;
	private Set<BonusCard> bonusCards = null;
	private Set<Comment> comments = null;
	private Set<RewardAccount> rewardAccounts = new HashSet<RewardAccount>(0);
	private Set<PromotionCustomerRelation> promotionCustomerRelations = new HashSet<PromotionCustomerRelation>(
			0);
	private Set<CustomerCollectGoods> customerCollectGoodses = new HashSet<CustomerCollectGoods>(
			0);
	private Set<PropertyRequest> propertyRequests = new HashSet<PropertyRequest>(
			0);
	private Set<PropertyFee> propertyFees = new HashSet<PropertyFee>(0);
	private Set<OrderInfo> orderInfos = new HashSet<OrderInfo>(0);
	private Set<HouseMessage> houseMessages = new HashSet<HouseMessage>(0);
	private Set<Feedback> feedbacks = new HashSet<Feedback>(0);
	private Set<FeePaymentRequest> feePaymentRequests = new HashSet<FeePaymentRequest>(
			0);
	private Set<Complaint> complaints = new HashSet<Complaint>(0);

	public Customer() {
	}

	public Customer(String uid, String phone, String password) {
		this.uid = uid;
		this.phone = phone;
		this.password = password;
	}

	public Customer(CustomerLevel customerLevel, LivingArea livingArea,
			String uid, String name, String nickName, String phone, String sex,
			String password, String role, Date createDate, Date updateDate,
			String state, String imageUrl, String customerState,
			Set<BonusCard> bonusCards, Set<Comment> comments,
			Set<RewardAccount> rewardAccounts,
			Set<PromotionCustomerRelation> promotionCustomerRelations,
			Set<CustomerCollectGoods> customerCollectGoodses,
			Set<PropertyRequest> propertyRequests,
			Set<PropertyFee> propertyFees, Set<OrderInfo> orderInfos,
			Set<HouseMessage> houseMessages, Set<Feedback> feedbacks,
			Set<FeePaymentRequest> feePaymentRequests, Set<Complaint> complaints) {
		this.customerLevel = customerLevel;
		this.livingArea = livingArea;
		this.uid = uid;
		this.name = name;
		this.nickName = nickName;
		this.phone = phone;
		this.sex = sex;
		this.password = password;
		this.role = role;
		this.createDate = createDate;
		this.updateDate = updateDate;
		this.state = state;
		this.imageUrl = imageUrl;
		this.customerState = customerState;
		this.bonusCards = bonusCards;
		this.comments = comments;
		this.rewardAccounts = rewardAccounts;
		this.promotionCustomerRelations = promotionCustomerRelations;
		this.customerCollectGoodses = customerCollectGoodses;
		this.propertyRequests = propertyRequests;
		this.propertyFees = propertyFees;
		this.orderInfos = orderInfos;
		this.houseMessages = houseMessages;
		this.feedbacks = feedbacks;
		this.feePaymentRequests = feePaymentRequests;
		this.complaints = complaints;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

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

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_level_id")
	public CustomerLevel getCustomerLevel() {
		return this.customerLevel;
	}

	public void setCustomerLevel(CustomerLevel customerLevel) {
		this.customerLevel = customerLevel;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "living_area_id")
	public LivingArea getLivingArea() {
		return this.livingArea;
	}

	public void setLivingArea(LivingArea livingArea) {
		this.livingArea = livingArea;
	}

	@Column(name = "uid", nullable = false, length = 45)
	public String getUid() {
		return this.uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	@Column(name = "name", length = 50)
	public String getName() {
		return this.name;
	}

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

	@Column(name = "nick_name", length = 200)
	public String getNickName() {
		return this.nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Column(name = "phone", nullable = false, length = 13)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "sex", length = 2)
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "password", nullable = false, length = 45)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "role", length = 45)
	public String getRole() {
		return this.role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@Column(name = "state", length = 45)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "image_url")
	public String getImageUrl() {
		return this.imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	@Column(name = "customer_state", length = 45)
	public String getCustomerState() {
		return this.customerState;
	}

	public void setCustomerState(String customerState) {
		this.customerState = customerState;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<BonusCard> getBonusCards() {
		return this.bonusCards;
	}

	public void setBonusCards(Set<BonusCard> bonusCards) {
		this.bonusCards = bonusCards;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<Comment> getComments() {
		return this.comments;
	}

	public void setComments(Set<Comment> comments) {
		this.comments = comments;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<RewardAccount> getRewardAccounts() {
		return this.rewardAccounts;
	}

	public void setRewardAccounts(Set<RewardAccount> rewardAccounts) {
		this.rewardAccounts = rewardAccounts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<PromotionCustomerRelation> getPromotionCustomerRelations() {
		return this.promotionCustomerRelations;
	}

	public void setPromotionCustomerRelations(
			Set<PromotionCustomerRelation> promotionCustomerRelations) {
		this.promotionCustomerRelations = promotionCustomerRelations;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<CustomerCollectGoods> getCustomerCollectGoodses() {
		return this.customerCollectGoodses;
	}

	public void setCustomerCollectGoodses(
			Set<CustomerCollectGoods> customerCollectGoodses) {
		this.customerCollectGoodses = customerCollectGoodses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<PropertyRequest> getPropertyRequests() {
		return this.propertyRequests;
	}

	public void setPropertyRequests(Set<PropertyRequest> propertyRequests) {
		this.propertyRequests = propertyRequests;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<PropertyFee> getPropertyFees() {
		return this.propertyFees;
	}

	public void setPropertyFees(Set<PropertyFee> propertyFees) {
		this.propertyFees = propertyFees;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<OrderInfo> getOrderInfos() {
		return this.orderInfos;
	}

	public void setOrderInfos(Set<OrderInfo> orderInfos) {
		this.orderInfos = orderInfos;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<HouseMessage> getHouseMessages() {
		return this.houseMessages;
	}

	public void setHouseMessages(Set<HouseMessage> houseMessages) {
		this.houseMessages = houseMessages;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<Feedback> getFeedbacks() {
		return this.feedbacks;
	}

	public void setFeedbacks(Set<Feedback> feedbacks) {
		this.feedbacks = feedbacks;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<FeePaymentRequest> getFeePaymentRequests() {
		return this.feePaymentRequests;
	}

	public void setFeePaymentRequests(Set<FeePaymentRequest> feePaymentRequests) {
		this.feePaymentRequests = feePaymentRequests;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<Complaint> getComplaints() {
		return this.complaints;
	}

	public void setComplaints(Set<Complaint> complaints) {
		this.complaints = complaints;
	}

}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.camunda.bpm.engine.impl.jobexecutor;

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

import org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse;
import org.camunda.bpm.engine.impl.bpmn.parser.EventSubscriptionDeclaration;
import org.camunda.bpm.engine.impl.jobexecutor.ProcessEventJobHandler.EventSubscriptionJobConfiguration;
import org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
import org.camunda.bpm.engine.impl.persistence.entity.MessageEntity;
import org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.camunda.bpm.engine.impl.pvm.PvmActivity;
import org.camunda.commons.utils.EnsureUtil;

/**
 *
Describes and creates jobs for handling an event asynchronously.
 * These jobs are created in the context of an {@link EventSubscriptionEntity} and are of type {@link MessageEntity}.

 *
 * @author Thorben Lindhauer
 */
public class EventSubscriptionJobDeclaration extends JobDeclaration<EventSubscriptionEntity, MessageEntity> {

  private static final long serialVersionUID = 1L;

  protected EventSubscriptionDeclaration eventSubscriptionDeclaration;

  public EventSubscriptionJobDeclaration(EventSubscriptionDeclaration eventSubscriptionDeclaration) {
    super(ProcessEventJobHandler.TYPE);
    EnsureUtil.ensureNotNull("eventSubscriptionDeclaration", eventSubscriptionDeclaration);
    this.eventSubscriptionDeclaration = eventSubscriptionDeclaration;
  }

  protected MessageEntity newJobInstance(EventSubscriptionEntity eventSubscription) {

    MessageEntity message = new MessageEntity();

    // initialize job
    message.setActivityId(eventSubscription.getActivityId());
    message.setExecutionId(eventSubscription.getExecutionId());
    message.setProcessInstanceId(eventSubscription.getProcessInstanceId());

    ProcessDefinitionEntity processDefinition = eventSubscription.getProcessDefinition();

    if (processDefinition != null) {
      message.setProcessDefinitionId(processDefinition.getId());
      message.setProcessDefinitionKey(processDefinition.getKey());
    }

    // TODO: support payload
    // if(payload != null) {
    //   message.setEventPayload(payload);
    // }

    return message;
  }

  public String getEventType() {
    return eventSubscriptionDeclaration.getEventType();
  }

  public String getEventName() {
    return eventSubscriptionDeclaration.getUnresolvedEventName();
  }

  public String getActivityId() {
    return eventSubscriptionDeclaration.getActivityId();
  }

  protected ExecutionEntity resolveExecution(EventSubscriptionEntity context) {
    return context.getExecution();
  }

  protected JobHandlerConfiguration resolveJobHandlerConfiguration(EventSubscriptionEntity context) {
    return new EventSubscriptionJobConfiguration(context.getId());
  }

  @SuppressWarnings("unchecked")
  public static List<EventSubscriptionJobDeclaration> getDeclarationsForActivity(PvmActivity activity) {
    Object result = activity.getProperty(BpmnParse.PROPERTYNAME_EVENT_SUBSCRIPTION_JOB_DECLARATION);
    if (result != null) {
      return (List<EventSubscriptionJobDeclaration>) result;
    } else {
      return Collections.emptyList();
    }
  }

  /**
   * Assumes that an activity has at most one declaration of a certain eventType.
   */
  public static EventSubscriptionJobDeclaration findDeclarationForSubscription(EventSubscriptionEntity eventSubscription) {
    List<EventSubscriptionJobDeclaration> declarations = getDeclarationsForActivity(eventSubscription.getActivity());

    for (EventSubscriptionJobDeclaration declaration : declarations) {
      if (declaration.getEventType().equals(eventSubscription.getEventType())) {
        return declaration;
      }
    }

    return null;
  }

}


text:
package com.codeborne.selenide.webdriver;

import com.codeborne.selenide.Browser;
import com.codeborne.selenide.Config;
import com.codeborne.selenide.WebDriverProvider;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;

import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import java.io.File;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

@ParametersAreNonnullByDefault
public class DefaultDriverFactory extends AbstractDriverFactory {
  @Override
  public void setupWebdriverBinary() {
  }

  @Override
  @CheckReturnValue
  @Nonnull
  public WebDriver create(Config config, Browser browser, @Nullable Proxy proxy, @Nullable File browserDownloadsFolder) {
    return createInstanceOf(config.browser(), config, browser, proxy, browserDownloadsFolder);
  }

  @CheckReturnValue
  @Nonnull
  private WebDriver createInstanceOf(String className, Config config, Browser browser,
                                     @Nullable Proxy proxy, @Nullable File browserDownloadsFolder) {
    Class<?> clazz = classOf(config.browser());

    if (WebDriverProvider.class.isAssignableFrom(clazz)) {
      Capabilities capabilities = createCapabilities(config, browser, proxy, browserDownloadsFolder);
      return createInstanceOf(WebDriverProvider.class, clazz).createDriver(new DesiredCapabilities(capabilities));
    }
    else if (DriverFactory.class.isAssignableFrom(clazz)) {
      DriverFactory factory = createInstanceOf(DriverFactory.class, clazz);
      if (config.driverManagerEnabled()) {
        factory.setupWebdriverBinary();
      }
      return factory.create(config, browser, proxy, browserDownloadsFolder);
    }
    else {
      Capabilities capabilities = createCapabilities(config, browser, proxy, browserDownloadsFolder);
      return createWebDriver(className, capabilities);
    }
  }

  @Override
  @CheckReturnValue
  @Nonnull
  public MutableCapabilities createCapabilities(Config config, Browser browser,
                                                @Nullable Proxy proxy, @Nullable File browserDownloadsFolder) {
    Class<?> clazz = classOf(config.browser());

    if (DriverFactory.class.isAssignableFrom(clazz)) {
      DriverFactory factory = createInstanceOf(DriverFactory.class, clazz);
      return factory.createCapabilities(config, browser, proxy, browserDownloadsFolder);
    }

    return createCommonCapabilities(config, browser, proxy);
  }

  private Class<?> classOf(String className) {
    try {
      return Class.forName(className);
    }
    catch (ClassNotFoundException e) {
      throw new IllegalArgumentException("Class not found: " + className, e);
    }
  }

  private WebDriver createWebDriver(String className, Capabilities capabilities) {
    try {
      Constructor<?> constructor = Class.forName(className).getConstructor(Capabilities.class);
      return (WebDriver) constructor.newInstance(capabilities);
    }
    catch (Exception e) {
      throw new IllegalArgumentException("Failed to create WebDriver of type " + className, e);
    }
  }

  @SuppressWarnings({"unchecked", "unused"})
  private <T> T createInstanceOf(Class<T> resultClass, Class<?> clazz) {
    try {
      Constructor<?> constructor = clazz.getDeclaredConstructor();
      constructor.setAccessible(true);
      return (T) constructor.newInstance();
    }
    catch (InvocationTargetException e) {
      throw runtime(e.getTargetException());
    }
    catch (Exception invalidClassName) {
      throw new IllegalArgumentException(invalidClassName);
    }
  }

  private RuntimeException runtime(Throwable exception) {
    return exception instanceof RuntimeException ? (RuntimeException) exception : new RuntimeException(exception);
  }
}


text:
package org.apache.spark.sql.execution

import java.util.HashMap

import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.errors._
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.plans.physical._
import org.apache.spark.sql.execution.metric.SQLMetrics

/**
 * :: DeveloperApi ::
 * Groups input data by `groupingExpressions` and computes the `aggregateExpressions` for each
 * group.
  * 通过`groupingExpressions`对组输入数据,并为每个组计算`aggregateExpressions`
 *
 * @param partial if true then aggregation is done partially on local data without shuffling to
 *                ensure all values where `groupingExpressions` are equal are present.
  *                如果为true,则聚合部分地在本地数据上完成而不进行混洗以确保存在"groupingExpressions"相等的所有值
 * @param groupingExpressions expressions that are evaluated to determine grouping.
 * @param aggregateExpressions expressions that are computed for each group.
 * @param child the input data source.
 */
@DeveloperApi
case class Aggregate(
    partial: Boolean,
    groupingExpressions: Seq[Expression],
    aggregateExpressions: Seq[NamedExpression],
    child: SparkPlan)
  extends UnaryNode {

  override private[sql] lazy val metrics = Map(
    "numInputRows" -> SQLMetrics.createLongMetric(sparkContext, "number of input rows"),
    "numOutputRows" -> SQLMetrics.createLongMetric(sparkContext, "number of output rows"))

  override def requiredChildDistribution: List[Distribution] = {
    if (partial) {
      UnspecifiedDistribution :: Nil//列表结尾为Nil
    } else {//列表结尾为Nil
      if (groupingExpressions == Nil) {
        AllTuples :: Nil//列表结尾为Nil
      } else {//列表结尾为Nil
        ClusteredDistribution(groupingExpressions) :: Nil//列表结尾为Nil
      }
    }
  }

  override def output: Seq[Attribute] = aggregateExpressions.map(_.toAttribute)

  /**
   * An aggregate that needs to be computed for each row in a group.
    * 需要为组中的每一行计算的聚合
   *
   * @param unbound Unbound version of this aggregate, used for result substitution.
    *                此聚合的未绑定版本,用于结果替换
   * @param aggregate A bound copy of this aggregate used to create a new aggregation buffer.
    *                  用于创建新聚合缓冲区的此聚合的绑定副本
   * @param resultAttribute An attribute used to refer to the result of this aggregate in the final
   *                        output.
    *                        用于在最终输出中引用此聚合的结果的属性
   */
  case class ComputedAggregate(
      unbound: AggregateExpression1,
      aggregate: AggregateExpression1,
      resultAttribute: AttributeReference)

  /** A list of aggregates that need to be computed for each group.
    * 需要为每个组计算的聚合列表*/
  private[this] val computedAggregates = aggregateExpressions.flatMap { agg =>
    agg.collect {
      case a: AggregateExpression1 =>
        ComputedAggregate(
          a,
          BindReferences.bindReference(a, child.output),
          AttributeReference(s"aggResult:$a", a.dataType, a.nullable)())
    }
  }.toArray

  /** The schema of the result of all aggregate evaluations
    * 所有聚合评估结果的模式*/
  private[this] val computedSchema = computedAggregates.map(_.resultAttribute)

  /** Creates a new aggregate buffer for a group.
    * 为组创建新的聚合缓冲区 */
  private[this] def newAggregateBuffer(): Array[AggregateFunction1] = {
    val buffer = new Array[AggregateFunction1](computedAggregates.length)
    var i = 0
    while (i < computedAggregates.length) {
      buffer(i) = computedAggregates(i).aggregate.newInstance()
      i += 1
    }
    buffer
  }

  /** Named attributes used to substitute grouping attributes into the final result.
    * 用于将分组属性替换为最终结果的命名属性*/
  private[this] val namedGroups = groupingExpressions.map {
    case ne: NamedExpression => ne -> ne.toAttribute
    case e => e -> Alias(e, s"groupingExpr:$e")().toAttribute
  }

  /**
   * A map of substitutions that are used to insert the aggregate expressions and grouping
   * expression into the final result expression.
    * 用于插入聚合表达式并将表达式分组到最终结果表达式中的替换映射
   */
  private[this] val resultMap =
    (computedAggregates.map { agg => agg.unbound -> agg.resultAttribute } ++ namedGroups).toMap

  /**
   * Substituted version of aggregateExpressions expressions which are used to compute final
   * output rows given a group and the result of all aggregate computations.
    * aggregateExpressions表达式的替换版本,用于计算给定组的最终输出行和所有聚合计算的结果
   */
  private[this] val resultExpressions = aggregateExpressions.map { agg =>
    agg.transform {
      case e: Expression if resultMap.contains(e) => resultMap(e)
    }
  }

  protected override def doExecute(): RDD[InternalRow] = attachTree(this, "execute") {
    val numInputRows = longMetric("numInputRows")
    val numOutputRows = longMetric("numOutputRows")
    if (groupingExpressions.isEmpty) {
      child.execute().mapPartitions { iter =>
        val buffer = newAggregateBuffer()
        var currentRow: InternalRow = null
        while (iter.hasNext) {
          currentRow = iter.next()
          numInputRows += 1
          var i = 0
          while (i < buffer.length) {
            buffer(i).update(currentRow)
            i += 1
          }
        }
        val resultProjection = new InterpretedProjection(resultExpressions, computedSchema)
        val aggregateResults = new GenericMutableRow(computedAggregates.length)

        var i = 0
        while (i < buffer.length) {
          aggregateResults(i) = buffer(i).eval(EmptyRow)
          i += 1
        }

        numOutputRows += 1
        Iterator(resultProjection(aggregateResults))
      }
    } else {
      child.execute().mapPartitions { iter =>
        val hashTable = new HashMap[InternalRow, Array[AggregateFunction1]]
        val groupingProjection = new InterpretedMutableProjection(groupingExpressions, child.output)

        var currentRow: InternalRow = null
        while (iter.hasNext) {
          currentRow = iter.next()
          numInputRows += 1
          val currentGroup = groupingProjection(currentRow)
          var currentBuffer = hashTable.get(currentGroup)
          if (currentBuffer == null) {
            currentBuffer = newAggregateBuffer()
            hashTable.put(currentGroup.copy(), currentBuffer)
          }

          var i = 0
          while (i < currentBuffer.length) {
            currentBuffer(i).update(currentRow)
            i += 1
          }
        }

        new Iterator[InternalRow] {
          private[this] val hashTableIter = hashTable.entrySet().iterator()
          private[this] val aggregateResults = new GenericMutableRow(computedAggregates.length)
          private[this] val resultProjection =
            new InterpretedMutableProjection(
              resultExpressions, computedSchema ++ namedGroups.map(_._2))
          private[this] val joinedRow = new JoinedRow

          override final def hasNext: Boolean = hashTableIter.hasNext

          override final def next(): InternalRow = {
            val currentEntry = hashTableIter.next()
            val currentGroup = currentEntry.getKey
            val currentBuffer = currentEntry.getValue
            numOutputRows += 1

            var i = 0
            while (i < currentBuffer.length) {
              // Evaluating an aggregate buffer returns the result.  No row is required since we
              // already added all rows in the group using update.
              aggregateResults(i) = currentBuffer(i).eval(EmptyRow)
              i += 1
            }
            resultProjection(joinedRow(aggregateResults, currentGroup))
          }
        }
      }
    }
  }
}


text:
package org.drools.base.extractors;

import java.util.Vector;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

import org.drools.Address;
import org.drools.Person;
import org.drools.base.ClassFieldAccessorCache;
import org.drools.base.ClassFieldAccessorStore;
import org.drools.core.util.ClassUtils;
import org.drools.rule.MVELDialectRuntimeData;
import org.drools.spi.InternalReadAccessor;
import org.drools.util.ClassLoaderUtil;

public class MVELClassFieldExtractorTest {

    ClassFieldAccessorStore store = new ClassFieldAccessorStore();
    MVELClassFieldReader    extractor;
    private final Person[]  person   = new Person[2];
    private final Address[] business = new Address[2];
    private final Address[] home     = new Address[2];

    @Before
    public void setUp() throws Exception {
        store.setClassFieldAccessorCache( new ClassFieldAccessorCache( Thread.currentThread().getContextClassLoader() ) );
        store.setEagerWire( true );

        extractor = ( MVELClassFieldReader ) store.getMVELReader(  Person.class.getPackage().getName(),
                                                                   Person.class.getName(),
                                                                   "addresses['home'].street",
                                                                   true );
        MVELDialectRuntimeData data = new MVELDialectRuntimeData();
        data.addImport( Person.class.getSimpleName(), Person.class );
        data.onAdd( null, ClassLoaderUtil.getClassLoader( null, getClass(), false ) );

        extractor.compile( data );

        person[0] = new Person( "bob",
                                30 );
        business[0] = new Address( "Business Street",
                                   "999",
                                   null );
        home[0] = new Address( "Home Street",
                               "555",
                               "55555555" );
        person[0].getAddresses().put( "business",
                                      business[0] );
        person[0].getAddresses().put( "home",
                                      home[0] );

        person[1] = new Person( "mark",
                                35 );
        business[1] = new Address( "Another Business Street",
                                   "999",
                                   null );
        home[1] = new Address( "Another Home Street",
                               "555",
                               "55555555" );
        person[1].getAddresses().put( "business",
                                      business[1] );
        person[1].getAddresses().put( "home",
                                      home[1] );

    }

    @Test
    public void testGetBooleanValue() {
        try {
            this.extractor.getBooleanValue( null,
                                            this.person[0] );
            fail( "Should have throw an exception" );
        } catch ( final Exception e ) {
            // success
        }
    }

    @Test
    public void testGetByteValue() {
        try {
            this.extractor.getByteValue( null,
                                         this.person[0] );
            fail( "Should have throw an exception" );
        } catch ( final Exception e ) {
            // success
        }
    }

    @Test
    public void testGetCharValue() {
        try {
            this.extractor.getCharValue( null,
                                         this.person[0] );
            fail( "Should have throw an exception" );
        } catch ( final Exception e ) {
            // success
        }
    }

    @Test
    public void testGetDoubleValue() {
        try {
            this.extractor.getDoubleValue( null,
                                           this.person[0] );
            fail( "Should have throw an exception" );
        } catch ( final Exception e ) {
            // success
        }
    }

    @Test
    public void testGetFloatValue() {
        try {
            this.extractor.getFloatValue( null,
                                          this.person[0] );
            fail( "Should have throw an exception" );
        } catch ( final Exception e ) {
            // success
        }
    }

    @Test
    public void testGetIntValue() {
        try {
            this.extractor.getIntValue( null,
                                        this.person[0] );
            fail( "Should have throw an exception" );
        } catch ( final Exception e ) {
            // success
        }
    }

    @Test
    public void testGetLongValue() {
        try {
            this.extractor.getLongValue( null,
                                         this.person[0] );
            fail( "Should have throw an exception" );
        } catch ( final Exception e ) {
            // success
        }
    }

    @Test
    public void testGetShortValue() {
        try {
            this.extractor.getShortValue( null,
                                          this.person[0] );
            fail( "Should have throw an exception" );
        } catch ( final Exception e ) {
            // success
        }
    }

    @Test
    public void testGetValue() {
        try {
            assertEquals( home[0].getStreet(),
                                 this.extractor.getValue( null,
                                                          this.person[0] ) );
            assertTrue( this.extractor.getValue( null,
                                                        this.person[0] ) instanceof String );
        } catch ( final Exception e ) {
            fail( "Should not throw an exception" );
        }
    }

    @Test
    public void testIsNullValue() {
        try {
            assertFalse( this.extractor.isNullValue( null,
                                                     this.person[0] ) );

            MVELClassFieldReader nullExtractor =  ( MVELClassFieldReader ) store.getMVELReader(  Person.class.getPackage().getName(),
                                                                       Person.class.getName(),
                                                                       "addresses['business'].phone",
                                                                       true );
            MVELDialectRuntimeData data = new MVELDialectRuntimeData();
            data.addImport( Person.class.getSimpleName(), Person.class );
            data.onAdd( null, ClassLoaderUtil.getClassLoader( null, getClass(), false ) );

            nullExtractor.compile( data );
//
//            InternalReadAccessor nullExtractor = store.getReader( Person.class,
//                                                                  "addresses['business'].phone",
//                                                                  getClass().getClassLoader() );
            assertTrue( nullExtractor.isNullValue( null,
                                                   this.person[0] ) );
        } catch ( final Exception e ) {
            fail( "Should not throw an exception" );
        }
    }

    @Test
    public void testMultithreads() {
        final int THREAD_COUNT = 30;

        try {
            final Vector errors = new Vector();

            final Thread t[] = new Thread[THREAD_COUNT];
            for ( int j = 0; j < 10; j++ ) {
                for ( int i = 0; i < t.length; i++ ) {
                    final int ID = i;
                    t[i] = new Thread() {
                        public void run() {
                            try {
                                final int ITERATIONS = 300;
                                for ( int k = 0; k < ITERATIONS; k++ ) {
                                    String value = (String) extractor.getValue( null,
                                                                                person[ID % 2] );
                                    if ( !home[ID % 2].getStreet().equals( value ) ) {
                                        errors.add( "THREAD(" + ID + "): Wrong value at iteration " + k + ". Value='" + value + "'\n" );
                                    }
                                }
                            } catch ( Exception ex ) {
                                ex.printStackTrace();
                                errors.add( ex );
                            }
                        }

                    };
                    t[i].start();
                }
                for ( int i = 0; i < t.length; i++ ) {
                    t[i].join();
                }
            }
            if ( !errors.isEmpty() ) {
                fail( " Errors occured during execution\n" + errors.toString()  );
            }
        } catch ( InterruptedException e ) {
            e.printStackTrace();
            fail( "Unexpected exception running test: " + e.getMessage() );
        }
    }

}


text:
package io.sarl.eclipse.launching.shortcuts;

import org.eclipse.xtext.xbase.ui.launching.JavaElementDelegateMainLaunch;

/** Delegate dedicated to SARL for breaking down the multiple adapter (from SARL and Xtend) issue.
 *
 * @author $Author: sgalland$
 * @version $FullVersion$
 * @mavengroupid $GroupId$
 * @mavenartifactid $ArtifactId$
 */
public class SarlJavaElementDelegateMainLaunch extends JavaElementDelegateMainLaunch {
	//
}


text:
enum Ensure {
   Absent
   Present
}

$tgtName = 'vEng.local.lab'
$configName = 'vmw'

Configuration $configName
{
    param(
    [System.Management.Automation.PSCredential]$Credential
    )

    Import-DscResource -ModuleName vSphereDSC

    Node $AllNodes.NodeName
    {
        $number = 0
        foreach($datacenter in $Node.Datacenters)
        {
            $number++
            $dcName = "Datacenter$number"
            VmwDatacenter $dcName
            {
                Name = $datacenter.DatacenterName
                Path = $datacenter.Path
                Ensure = $datacenter.Ensure
                vServer = $Allnodes.Server
                vCredential = $Allnodes.Credential
            }
        }
    }
}

#region VCSA Account
$vcUser = '<your VCSA user>'
$vcPswd = '<your VCSA user password>'
$sVcCred = @{
    TypeName = 'System.Management.Automation.PSCredential'
    ArgumentList = $vcUser,(ConvertTo-SecureString -String $vcPswd -AsPlainText -Force)
}
$vcCred = New-Object @sVcCred
#endregion

$ConfigData = @{
    AllNodes = @(
        @{
            NodeName = '*'
            Server = 'vcsa.local.lab'
            Credential = $vcCred
            PSDscAllowPlainTextPassword=$true
            PSDscAllowDomainUser = $true
        },
        @{
            NodeName = $configName
            Datacenters = @(
                @{
                    DatacenterName = 'DC2'
                    Path = '/Folder3'
                    Ensure = [Ensure]::Present
                },
                @{
                    DatacenterName = 'DC3'
                    Path = '/'
                    Ensure = [Ensure]::Present
                }
            )
        }
    )
}

. "$(Split-Path $MyInvocation.MyCommand.Path)\..\..\Tools\Get-TargetGuid.ps1"
$guid = Get-TargetGuid -TargetName $tgtName

Invoke-Expression  "$($configName) -ConfigurationData `$configData -OutputPath '.\DSC'"

$pullShare = '\\pull\DSCService\Configuration\'
$mof = ".\DSC\$($configName).mof"
$tgtMof = "$pullshare\$guid.mof"

Copy-Item -Path $mof -Destination $tgtMof
New-DSCChecksum $tgtMof -Force

# For testing with Start-DscCOnfiguration
Copy-Item -Path $mof -Destination ".\DSC\$($tgtName.Split('.')[0]).mof"


text:
require File.expand_path("../spec_helper", __FILE__)

describe "Table" do

  before :each do
    browser.goto(WatirSpec.files + "/tables.html")
  end

  # Exists
  describe "#exists?" do
    it "returns true if the table exists" do
      browser.table(:id, 'axis_example').should exist
      browser.table(:id, /axis_example/).should exist
      browser.table(:index, 1).should exist
      browser.table(:xpath, "//table[@id='axis_example']").should exist
    end

    it "returns the first table if given no args" do
      browser.table.should exist
    end

    it "returns true if the element exists (default how = :id)" do
      browser.table("axis_example").should exist
    end

    it "returns false if the table does not exist" do
      browser.table(:id, 'no_such_id').should_not exist
      browser.table(:id, /no_such_id/).should_not exist
      browser.table(:index, 1337).should_not exist
      browser.table(:xpath, "//table[@id='no_such_id']").should_not exist
    end

    it "checks the tag name when locating by xpath" do
      browser.table(:xpath, "//table//td").should_not exist
      browser.table(:xpath, "//table").should exist
    end

    it "raises TypeError when 'what' argument is invalid" do
      lambda { browser.table(:id, 3.14).exists? }.should raise_error(TypeError)
    end

    it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
      lambda { browser.table(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
    end
  end

  describe "#locate" do
    it "is not nil for existing tables" do
      browser.table(:id, 'axis_example').locate.should_not be_nil
    end
  end

  # Other
  describe "#to_a" do
    it "returns a two-dimensional array representation of the table" do
      browser.table(:id, 'inner').to_a.should == [["Table 2, Row 1, Cell 1", "Table 2, Row 1, Cell 2"]]
    end
  end

  describe "#click" do
    it "fires the table's onclick event" do
      browser.table(:id, 'inner').click
      messages.first.should == 'table'
    end
  end

  describe "#row_count" do
    bug "WTR-354", :watir do
      it "counts the number of rows correctly" do
        browser.table(:id, 'inner').row_count.should == 1
        browser.table(:id, 'outer').row_count.should == 3
      end
    end

    it "raises an UnknownObjectException if the table doesn't exist" do
      lambda { browser.table(:id, 'no_such_id').row_count }.should raise_error(UnknownObjectException)
      lambda { browser.table(:index, 1337).row_count }.should raise_error(UnknownObjectException)
    end
  end

  describe "#row_values" do
    it "gets row values" do
      browser.table(:id, 'outer').row_values(1).should == ["Table 1, Row 1, Cell 1", "Table 1, Row 1, Cell 2"]
      browser.table(:id, 'inner').row_values(1).should == ["Table 2, Row 1, Cell 1", "Table 2, Row 1, Cell 2"]
      browser.table(:id, 'outer').row_values(3).should == ["Table 1, Row 3, Cell 1", "Table 1, Row 3, Cell 2"]
    end
  end

  describe "#column_count" do
    it "counts the number of columns correctly" do
      browser.table(:id, 'inner').column_count.should == 2
      browser.table(:id, 'outer').column_count.should == 2
    end

    it "raises an UnknownObjectException if the table doesn't exist" do
      lambda { browser.table(:id, 'no_such_id').column_count }.should raise_error(UnknownObjectException)
      lambda { browser.table(:index, 1337).column_count }.should raise_error(UnknownObjectException)
    end
  end

  describe "#column_values" do
    it "gets column values" do
      browser.table(:id, 'inner').column_values(1).should == ["Table 2, Row 1, Cell 1"]
      browser.table(:id, 'outer').column_values(1).should == ["Table 1, Row 1, Cell 1", "Table 1, Row 2, Cell 1", "Table 1, Row 3, Cell 1"]
    end

    it "raises UnknownCellException when trying to locate non-existing cell" do
      lambda { browser.table(:id, 'inner').column_values(1337) }.should raise_error(UnknownCellException)
    end
  end

  describe "#[]" do
    it "returns the nth child row" do
      browser.table(:id, 'outer')[1].id.should == "outer_first"
      browser.table(:id, 'inner')[1].id.should == "inner_first"
      browser.table(:id, 'outer')[3].id.should == "outer_last"
    end
    it "raises UnknownRowException if the index is out of bounds" do
      lambda { browser.table(:id, 'outer')[1337] }.should raise_error(UnknownRowException)
    end
  end

  describe "#child_row" do
    it "returns the nth child row" do
      browser.table(:id, 'outer').child_row(1).id.should == "outer_first"
      browser.table(:id, 'inner').child_row(1).id.should == "inner_first"
      browser.table(:id, 'outer').child_row(3).id.should == "outer_last"
    end
    it "raises UnknownRowException if the index is out of bounds" do
      lambda { browser.table(:id, 'outer').child_row(1337) }.should raise_error(UnknownRowException)
    end
  end

  describe "#child_cell" do
    it "returns the nth child row" do
      browser.table(:id, 'outer').child_cell(5).text.should == "Table 1, Row 3, Cell 1"
    end
    it "raises UnknownCellException if the index is out of bounds" do
      lambda { browser.table(:id, 'outer').child_cell(1337) }.should raise_error(UnknownCellException)
    end
  end

  describe "#each" do
    it "iterates through the table's rows" do
      ids = ["outer_first", "outer_second", "outer_last"]
      browser.table(:id, 'outer').each_with_index do |r, idx|
        r.id.should == ids[idx]
      end
    end
  end

  describe "#body" do
    it "returns the correct instance of TableBody" do
      body = browser.table(:index, 1).body(:id, 'first')
      body.should be_instance_of(TableBody)
      body[1][1].text.should == "March 2008"
    end
  end

  describe "#bodies" do
    it "returns the correct instance of TableBodies" do
      bodies = browser.table(:index, 1).bodies
      bodies.should be_instance_of(TableBodies)
      bodies[1].id.should == "first"
      bodies[2].id.should == "second"
    end
  end

end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Flora, Jena 63: 284 (1880)

#### Original name
Opegrapha pyrenocarpoides Müll. Arg.

### Remarks
null


text:
<?php

namespace PhpAbac\Cache\Item;

use Psr\Cache\CacheItemInterface;

use PhpAbac\Cache\Exception\ExpiredCacheException;

class MemoryCacheItem implements CacheItemInterface
{
    /** @var string **/
    protected $key;
    /** @var mixed **/
    protected $value;
    /** @var int **/
    protected $defaultLifetime = 3600;
    /** @var \DateTime **/
    protected $expiresAt;
    /** @var string **/
    protected $driver = 'memory';

    public function __construct(string $key, int $ttl = null)
    {
        $this->key = $key;
        $this->expiresAfter($ttl);
    }

    public function set($value): MemoryCacheItem
    {
        $this->value = $value;

        return $this;
    }

    public function isHit(): bool
    {
        return $this->expiresAt >= new \DateTime();
    }

    public function getKey(): string
    {
        return $this->key;
    }

    public function get()
    {
        if (!$this->isHit()) {
            throw new ExpiredCacheException('Cache item is expired');
        }
        return $this->value;
    }

    public function expiresAfter($time): MemoryCacheItem
    {
        $lifetime = ($time !== null) ? $time : $this->defaultLifetime;

        $this->expiresAt = (new \DateTime())->setTimestamp(time() + $lifetime);

        return $this;
    }

    public function expiresAt($expiration): MemoryCacheItem
    {
        $this->expiresAt =
            ($expiration === null)
            ? (new \DateTime())->setTimestamp(time() + $this->defaultLifetime)
            : $expiration
        ;
        return $this;
    }

    public function getExpirationDate(): \DateTime
    {
        return $this->expiresAt;
    }

    public function getDriver(): string
    {
        return $this->driver;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/C:/Users/Administrator/Desktop/ONOFFZONE6/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values-w360dp/values-w360dp.xml -->
    <eat-comment/>
    <integer name="abc_max_action_buttons">3</integer>
</resources>


text:
/**
 * @generated SignedSource<<4f8f0deacfb570f74589357ad459c48f>>
 * @lightSyntaxTransform
 * @nogrep
 */

/* tslint:disable */
/* eslint-disable */
// @ts-nocheck

import { Fragment, ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type SettingsSavesRoute_me$data = {
  readonly name: string | null;
  readonly " $fragmentType": "SettingsSavesRoute_me";
};
export type SettingsSavesRoute_me$key = {
  readonly " $data"?: SettingsSavesRoute_me$data;
  readonly " $fragmentSpreads": FragmentRefs<"SettingsSavesRoute_me">;
};

const node: ReaderFragment = {
  "argumentDefinitions": [],
  "kind": "Fragment",
  "metadata": null,
  "name": "SettingsSavesRoute_me",
  "selections": [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "name",
      "storageKey": null
    }
  ],
  "type": "Me",
  "abstractKey": null
};

(node as any).hash = "1982b79a39acf2359161c14affbb6914";

export default node;


text:
"""The VFS back-end CLI arguments helper."""

from plaso.cli import tools
from plaso.cli.helpers import interface
from plaso.cli.helpers import manager
from plaso.lib import errors

class VFSBackEndArgumentsHelper(interface.ArgumentsHelper):
  """VFS back-end CLI arguments helper."""

  NAME = 'vfs_backend'
  DESCRIPTION = 'dfVFS back-end command line arguments.'

  _SUPPORTED_VFS_BACK_ENDS = [
      'auto', 'fsext', 'fshfs', 'fsntfs', 'tsk', 'vsgpt']

  @classmethod
  def AddArguments(cls, argument_group):
    """Adds command line arguments to an argument group.

    This function takes an argument parser or an argument group object and adds
    to it all the command line arguments this helper supports.

    Args:
      argument_group (argparse._ArgumentGroup|argparse.ArgumentParser):
          argparse group.
    """
    argument_group.add_argument(
        '--vfs_back_end', '--vfs-back-end', dest='vfs_back_end',
        choices=cls._SUPPORTED_VFS_BACK_ENDS, action='store', metavar='TYPE',
        default='auto', help=(
            'The preferred dfVFS back-end: "auto", "fsext", "fshfs", "fsntfs", '
            '"tsk" or "vsgpt".'))

  @classmethod
  def ParseOptions(cls, options, configuration_object):
    """Parses and validates options.

    Args:
      options (argparse.Namespace): parser options.
      configuration_object (CLITool): object to be configured by the argument
          helper.

    Raises:
      BadConfigObject: when the configuration object is of the wrong type.
    """
    if not isinstance(configuration_object, tools.CLITool):
      raise errors.BadConfigObject(
          'Configuration object is not an instance of CLITool')

    vfs_back_end = cls._ParseStringOption(options, 'vfs_back_end')

    setattr(configuration_object, '_vfs_back_end', vfs_back_end)

manager.ArgumentHelperManager.RegisterHelper(VFSBackEndArgumentsHelper)


text:
@interface RateViewController : RootViewController

@end


text:
'use strict';

module.exports = function(container, config) {
  container.factory(() => {
    return { name: 'factory-one' };
  });
};


text:
<?xml version = '1.0' encoding = 'UTF-8'?>
<database-platform>
   <name>Informix</name>
   <runtime-platform-class>org.eclipse.persistence.platform.database.InformixPlatform</runtime-platform-class>
   <supports-native-sequencing>true</supports-native-sequencing>
   <database-types>
      <database-type>
         <name>BLOB</name>
         <jdbc-type>BLOB</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>BOOLEAN</name>
         <jdbc-type>BOOLEAN</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>BYTE</name>
         <jdbc-type>BINARY</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>CHAR</name>
         <jdbc-type>CHAR</jdbc-type>
         <allows-size>true</allows-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>CLOB</name>
         <jdbc-type>CLOB</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>DATE</name>
         <jdbc-type>DATE</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>DATETIME</name>
         <jdbc-type>TIMESTAMP</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>DECIMAL</name>
         <jdbc-type>DECIMAL</jdbc-type>
         <allows-size>true</allows-size>
         <allows-sub-size>true</allows-sub-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>DISTINCT</name>
         <jdbc-type>DISTINCT</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>DOUBLE PRECISION</name>
         <jdbc-type>DOUBLE</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>FLOAT</name>
         <jdbc-type>FLOAT</jdbc-type>
         <allows-size>true</allows-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>INT8</name>
         <jdbc-type>BIGINT</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>INTEGER</name>
         <jdbc-type>INTEGER</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>INTERVAL DAY TO SECOND</name>
         <jdbc-type>OTHER</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>INTERVAL YEAR TO MONTH</name>
         <jdbc-type>OTHER</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>LIST</name>
         <jdbc-type>ARRAY</jdbc-type>
      </database-type>
      <database-type>
         <name>LVARCHAR</name>
         <jdbc-type>LONGVARCHAR</jdbc-type>
         <allows-size>true</allows-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>MONEY</name>
         <jdbc-type>DECIMAL</jdbc-type>
         <allows-size>true</allows-size>
         <allows-sub-size>true</allows-sub-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>MULTISET</name>
         <jdbc-type>ARRAY</jdbc-type>
      </database-type>
      <database-type>
         <name>NCHAR</name>
         <jdbc-type>CHAR</jdbc-type>
         <allows-size>true</allows-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>NUMERIC</name>
         <jdbc-type>NUMERIC</jdbc-type>
         <allows-size>true</allows-size>
         <allows-sub-size>true</allows-sub-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>NVARCHAR</name>
         <jdbc-type>VARCHAR</jdbc-type>
         <allows-size>true</allows-size>
         <allows-sub-size>true</allows-sub-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>OPAQUE</name>
         <jdbc-type>JAVA_OBJECT</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>REAL</name>
         <jdbc-type>REAL</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>ROW</name>
         <jdbc-type>STRUCT</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>SERIAL</name>
         <jdbc-type>INTEGER</jdbc-type>
         <allows-size>true</allows-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>SERIAL8</name>
         <jdbc-type>BIGINT</jdbc-type>
         <allows-size>true</allows-size>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>SET</name>
         <jdbc-type>ARRAY</jdbc-type>
      </database-type>
      <database-type>
         <name>SMALLFLOAT</name>
         <jdbc-type>REAL</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>SMALLINT</name>
         <jdbc-type>SMALLINT</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>TEXT</name>
         <jdbc-type>LONGVARCHAR</jdbc-type>
         <allows-null>true</allows-null>
      </database-type>
      <database-type>
         <name>VARCHAR</name>
         <jdbc-type>VARCHAR</jdbc-type>
         <allows-size>true</allows-size>
         <allows-sub-size>true</allows-sub-size>
         <allows-null>true</allows-null>
      </database-type>
   </database-types>
   <jdbc-mappings>
      <jdbc-mapping>
         <jdbc-type>ARRAY</jdbc-type>
         <database-type>LIST</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>BIGINT</jdbc-type>
         <database-type>INT8</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>BINARY</jdbc-type>
         <database-type>BYTE</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>BIT</jdbc-type>
         <database-type>BOOLEAN</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>BLOB</jdbc-type>
         <database-type>BLOB</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>BOOLEAN</jdbc-type>
         <database-type>BOOLEAN</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>CHAR</jdbc-type>
         <database-type>CHAR</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>CLOB</jdbc-type>
         <database-type>CLOB</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>DATALINK</jdbc-type>
         <database-type>VARCHAR</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>DATE</jdbc-type>
         <database-type>DATE</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>DECIMAL</jdbc-type>
         <database-type>DECIMAL</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>DISTINCT</jdbc-type>
         <database-type>DISTINCT</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>DOUBLE</jdbc-type>
         <database-type>DOUBLE PRECISION</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>FLOAT</jdbc-type>
         <database-type>FLOAT</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>INTEGER</jdbc-type>
         <database-type>INTEGER</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>JAVA_OBJECT</jdbc-type>
         <database-type>OPAQUE</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>LONGNVARCHAR</jdbc-type>
         <database-type>TEXT</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>LONGVARBINARY</jdbc-type>
         <database-type>BYTE</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>LONGVARCHAR</jdbc-type>
         <database-type>TEXT</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>NCHAR</jdbc-type>
         <database-type>CHAR</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>NCLOB</jdbc-type>
         <database-type>CLOB</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>NUMERIC</jdbc-type>
         <database-type>NUMERIC</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>NVARCHAR</jdbc-type>
         <database-type>VARCHAR</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>OTHER</jdbc-type>
         <database-type>VARCHAR</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>REAL</jdbc-type>
         <database-type>REAL</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>REF</jdbc-type>
         <database-type>VARCHAR</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>ROWID</jdbc-type>
         <database-type>NUMERIC</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>SMALLINT</jdbc-type>
         <database-type>SMALLINT</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>SQLXML</jdbc-type>
         <database-type>TEXT</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>STRUCT</jdbc-type>
         <database-type>ROW</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>TIME</jdbc-type>
         <database-type>DATETIME</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>TIMESTAMP</jdbc-type>
         <database-type>DATETIME</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>TINYINT</jdbc-type>
         <database-type>SMALLINT</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>VARBINARY</jdbc-type>
         <database-type>BYTE</database-type>
      </jdbc-mapping>
      <jdbc-mapping>
         <jdbc-type>VARCHAR</jdbc-type>
         <database-type>VARCHAR</database-type>
      </jdbc-mapping>
   </jdbc-mappings>
</database-platform>


text:
import alt from "../../alt";

class BranchesScreenshotViewerActions {

    constructor() {
        this.generateActions(
            "open",
            "close",
            "goToPrevious",
            "goToNext"
        );
    }
}

export default alt.createActions(BranchesScreenshotViewerActions);


text:
using System.IO;
using System.Web.Mvc;

namespace WebExtras.Mvc.Core
{
  /// <summary>
  /// Offline rendering of MVC views
  /// </summary>
  public static class ViewRendererControllerExtension
  {
    #region GetRenderedPartialView

    /// <summary>
    /// Renders a given partial view with the given model and returns
    /// it's generated HTML content
    /// </summary>
    /// <param name="c">The controller</param>
    /// <param name="partialViewName">Partial View to be rendered</param>
    /// <param name="model">View model</param>
    /// <returns>Rendered HTML content</returns>
    public static MvcHtmlString GetRenderedPartialView(this ControllerBase c, string partialViewName, object model)
    {
      c.ViewData.Model = model;

      string content;
      var view = ViewEngines.Engines.FindPartialView(c.ControllerContext, partialViewName);
      using (var writer = new StringWriter())
      {
        var context = new ViewContext(c.ControllerContext, view.View, c.ViewData, c.TempData, writer);
        view.View.Render(context, writer);
        writer.Flush();
        content = writer.ToString();
      }

      return MvcHtmlString.Create(content);
    }

    #endregion GetRenderedPartialView

    #region GetRenderedView

    /// <summary>
    /// Renders a given view with the given master page and view model and returns
    /// the generated HTML content
    /// </summary>
    /// <param name="c">The controller</param>
    /// <param name="viewName">View to be rendered</param>
    /// <param name="masterPageName">Master page to be used to render the view</param>
    /// <param name="model">View model</param>
    /// <returns>Rendered HTML content</returns>
    public static MvcHtmlString GetRenderedView(this ControllerBase c, string viewName, string masterPageName, object model)
    {
      c.ViewData.Model = model;

      string content;
      var view = ViewEngines.Engines.FindView(c.ControllerContext, viewName, masterPageName);
      using (var writer = new StringWriter())
      {
        var context = new ViewContext(c.ControllerContext, view.View, c.ViewData, c.TempData, writer);
        view.View.Render(context, writer);
        writer.Flush();
        content = writer.ToString();
      }

      return MvcHtmlString.Create(content);
    }

    /// <summary>
    /// Renders a view with the given view model and returns the
    /// generated HTML content
    /// </summary>
    /// <param name="c">The controller</param>
    /// <param name="viewName">View to be rendered</param>
    /// <param name="model">View mode</param>
    /// <returns>Rendered HTML content</returns>
    public static MvcHtmlString GetRenderedView(this ControllerBase c, string viewName, object model)
    {
      c.ViewData.Model = model;

      string content;
      var view = ViewEngines.Engines.FindView(c.ControllerContext, viewName, null);
      using (var writer = new StringWriter())
      {
        var context = new ViewContext(c.ControllerContext, view.View, c.ViewData, c.TempData, writer);
        view.View.Render(context, writer);
        writer.Flush();
        content = writer.ToString();
      }

      return MvcHtmlString.Create(content);
    }

    #endregion GetRenderedView
  }
}


text:
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from dnd.dnd_paginator import DndPaginator
from dnd.filters import RuleFilter
from dnd.menu import menu_item, MenuItem, submenu_item
from dnd.views import permanent_redirect_object
from dnd.models import Rule
from dnd.views import is_3e_edition

@menu_item(MenuItem.RULEBOOKS)
@submenu_item(MenuItem.Rulebooks.RULES)
def rule_list(request):
    f = RuleFilter(request.GET, queryset=Rule.objects.all())

    form_submitted = 1 if '_filter' in request.GET else 0

    paginator = DndPaginator(f.qs, request)

    return render_to_response('dnd/rules/rule_list.html',
                              {
                                  'request': request,
                                  'rule_list': paginator.items(),
                                  'paginator': paginator,
                                  'filter': f,
                                  'form_submitted': form_submitted,
                              }, context_instance=RequestContext(request), )

@menu_item(MenuItem.RULEBOOKS)
@submenu_item(MenuItem.Rulebooks.RULES)
def rule_detail(request, rulebook_slug, rulebook_id, rule_slug, rule_id):
    rule = get_object_or_404(
        Rule.objects.select_related('rulebook', 'rulebook__dnd_edition'),
        pk=rule_id)
    if (rule.slug != rule_slug or
                unicode(rule.rulebook.id) != rulebook_id or
                rule.rulebook.slug != rulebook_slug):
        return permanent_redirect_object(request, rule)

    return render_to_response('dnd/rules/rule_detail.html',
                              {
                                  'rule': rule,
                                  'rulebook': rule.rulebook,
                                  'request': request,
                                  'i_like_it_url': request.build_absolute_uri(),
                                  'inaccurate_url': request.build_absolute_uri(),
                                  'display_3e_warning': is_3e_edition(rule.rulebook.dnd_edition),
                              }, context_instance=RequestContext(request), )


text:
<?php

namespace PayPal\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for BMButtonSearchReq StructType
 * @subpackage Structs
 * @author WsdlToPhp <contact@wsdltophp.com>
 */
class BMButtonSearchReq extends AbstractStructBase
{
    /**
     * The BMButtonSearchRequest
     * Meta information extracted from the WSDL
     * - ref: ns:BMButtonSearchRequest
     * @var \PayPal\StructType\BMButtonSearchRequestType
     */
    public $BMButtonSearchRequest;
    /**
     * Constructor method for BMButtonSearchReq
     * @uses BMButtonSearchReq::setBMButtonSearchRequest()
     * @param \PayPal\StructType\BMButtonSearchRequestType $bMButtonSearchRequest
     */
    public function __construct(\PayPal\StructType\BMButtonSearchRequestType $bMButtonSearchRequest = null)
    {
        $this
            ->setBMButtonSearchRequest($bMButtonSearchRequest);
    }
    /**
     * Get BMButtonSearchRequest value
     * @return \PayPal\StructType\BMButtonSearchRequestType|null
     */
    public function getBMButtonSearchRequest()
    {
        return $this->BMButtonSearchRequest;
    }
    /**
     * Set BMButtonSearchRequest value
     * @param \PayPal\StructType\BMButtonSearchRequestType $bMButtonSearchRequest
     * @return \PayPal\StructType\BMButtonSearchReq
     */
    public function setBMButtonSearchRequest(\PayPal\StructType\BMButtonSearchRequestType $bMButtonSearchRequest = null)
    {
        $this->BMButtonSearchRequest = $bMButtonSearchRequest;
        return $this;
    }
}


text:
layout: page
title: Perez 35th Anniversary
date: 2016-05-24
author: Susan Howell
tags: weekly links, java
status: published
summary: In imperdiet euismod sem, sit amet.
banner: images/banner/leisure-02.jpg
booking:
  startDate: 10/16/2017
  endDate: 10/20/2017
  ctyhocn: HSVALHX
  groupCode: P3A
published: true
---
Vestibulum est erat, pellentesque a aliquam sit amet, dapibus vitae massa. Ut a molestie diam. Nulla varius libero euismod orci finibus, in commodo urna sagittis. Morbi auctor, erat in commodo rutrum, metus ante consequat metus, id blandit metus sapien vitae lectus. Cras porta imperdiet feugiat. Vestibulum eget gravida lectus, in fermentum mauris. Aenean eu magna semper, efficitur purus id, fringilla ex. Proin in ligula erat. Nulla facilisi. Sed vel faucibus neque. Suspendisse potenti. Suspendisse sodales, ex ut interdum gravida, nibh lectus accumsan risus, gravida accumsan urna nunc sit amet odio.

* Integer auctor ligula quis pellentesque mollis
* Integer nec lacus ut ligula egestas dictum
* Sed sollicitudin erat sit amet nulla cursus, non convallis risus aliquet
* Fusce tristique dolor a tortor sagittis, non posuere urna condimentum
* Cras et risus sit amet tortor hendrerit imperdiet
* Donec vitae libero a diam molestie lacinia.

Etiam libero neque, sodales porttitor tellus sed, accumsan aliquet nulla. Etiam aliquam dui rhoncus lacus porttitor, ut posuere risus varius. Cras malesuada, libero eleifend feugiat dignissim, arcu erat auctor tortor, ac blandit erat elit in libero. In tristique quam orci. Praesent neque mauris, congue ac libero eget, mollis lacinia justo. Morbi sem eros, facilisis eget dapibus aliquam, vulputate id sapien. Nulla facilisi. Vivamus mollis tempor dapibus. Nam massa eros, pulvinar at vulputate a, feugiat nec mi. Phasellus orci arcu, euismod eget ultrices in, pretium ac ipsum.


text:
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2015, OpenNebula Project (OpenNebula.org), C12G Labs        */
/*                                                                            */
/* 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.                                             */
/* -------------------------------------------------------------------------- */

#ifndef TRANSFER_MANAGER_H_
#define TRANSFER_MANAGER_H_

#include "MadManager.h"
#include "ActionManager.h"
#include "VirtualMachinePool.h"
#include "LifeCycleManager.h"
#include "TransferManagerDriver.h"

using namespace std;

extern "C" void * tm_action_loop(void *arg);

class TransferManager : public MadManager, public ActionListener
{
public:

    TransferManager(
    	VirtualMachinePool *      	_vmpool,
        HostPool *                	_hpool,
        vector<const Attribute*>&   _mads):
            MadManager(_mads),
            vmpool(_vmpool),
            hpool(_hpool)
    {
        am.addListener(this);
    };

    ~TransferManager(){};

    enum Actions
    {
        PROLOG,
        PROLOG_MIGR,
        PROLOG_RESUME,
        PROLOG_ATTACH,
        EPILOG,
        EPILOG_STOP,
        EPILOG_DELETE,
        EPILOG_DELETE_PREVIOUS,
        EPILOG_DELETE_STOP,
        EPILOG_DELETE_BOTH,
        EPILOG_DETACH,
        CHECKPOINT,
        DRIVER_CANCEL,
        SAVEAS_HOT,
        SNAPSHOT_CREATE,
        SNAPSHOT_REVERT,
        SNAPSHOT_DELETE,
        FINALIZE
    };

    /**
     *  Triggers specific actions to the Information Manager. This function
     *  wraps the ActionManager trigger function.
     *    @param action the IM action
     *    @param vid VM unique id. This is the argument of the passed to the
     *    invoked action.
     */
    virtual void trigger(
        Actions action,
        int     vid);

    /**
     *  This functions starts the associated listener thread, and creates a
     *  new thread for the Information Manager. This thread will wait in
     *  an action loop till it receives ACTION_FINALIZE.
     *    @return 0 on success.
     */
    int start();

    /**
     *  Loads Virtual Machine Manager Mads defined in configuration file
     *   @param uid of the user executing the driver. When uid is 0 the nebula
     *   identity will be used. Otherwise the Mad will be loaded through the
     *   sudo application.
     */
    int load_mads(int uid);

    /**
     *  Gets the thread identification.
     *    @return pthread_t for the manager thread (that in the action loop).
     */
    pthread_t get_thread_id() const
    {
        return tm_thread;
    };

    /**
     * Inserts a transfer command in the xfs stream
     *
     * @param vm The VM
     * @param disk Disk to transfer
     * @param disk_index Disk index
     * @param system_tm_mad The Transfer Manager for the system datastore
     * @param opennebula_hostname The front-end hostname
     * @param xfr Stream where the transfer command will be written
     * @param error Error reason, if any
     *
     * @return 0 on success
     */
    int prolog_transfer_command(
            VirtualMachine *        vm,
            const VectorAttribute * disk,
            string&                 system_tm_mad,
            string&                 opennebula_hostname,
            ostream&                xfr,
            ostringstream&          error);

    /**
     * Inserts a transfer command in the xfs stream
     *
     * @param vm The VM
     * @param disk Disk to transfer
     * @param disk_index Disk index
     * @param xfr Stream where the transfer command will be written
     */
    void epilog_transfer_command(
            VirtualMachine *        vm,
            const VectorAttribute * disk,
            ostream&                xfr);
    /**
     * Inserts a transfer command in the xfs stream, for live migration
     *
     * @param vm The VM
     * @param xfr Stream where the transfer command will be written
     */
    void migrate_transfer_command(
        VirtualMachine *        vm,
        ostream&                xfr);

    /**
     *  This function generates the the epilog_delete sequence for current,
     *  front-end and previous hosts.
     *    @param vm pointer to VM, locked
     *    @param xfr stream to write the commands
     *    @param local true to delete the front-end
     *    @param previous true to delete the previous host
     *
     *    @return 0 on success
     */
    int epilog_delete_commands(VirtualMachine *vm,
                               ostream&        xfr,
                               bool            local,
                               bool            previous);
private:
    /**
     *  Thread id for the Transfer Manager
     */
    pthread_t               tm_thread;

    /**
     *  Pointer to the Virtual Machine Pool, to access VMs
     */
    VirtualMachinePool *    vmpool;

    /**
     *  Pointer to the Host Pool, to access hosts
     */
    HostPool *              hpool;

    /**
     *  Action engine for the Manager
     */
    ActionManager   		am;

    /**
     *  Generic name for the TransferManager driver
     */
     static const char *  transfer_driver_name;

    /**
     *  Returns a pointer to a Transfer Manager driver.
     *    @param name of an attribute of the driver (e.g. its type)
     *    @param value of the attribute
     *    @return the TM driver owned by uid with attribute name equal to value
     *    or 0 in not found
     */
    const TransferManagerDriver * get(
        const string&   name,
        const string&   value)
    {
        return static_cast<const TransferManagerDriver *>
               (MadManager::get(0,name,value));
    };

    /**
     *  Returns a pointer to a Transfer Manager driver. The driver is
     *  searched by its name.
     *    @param name the name of the driver
     *    @return the TM driver owned by uid with attribute name equal to value
     *    or 0 in not found
     */
    const TransferManagerDriver * get(
        const string&   name)
    {
        string _name("NAME");
        return static_cast<const TransferManagerDriver *>
               (MadManager::get(0,_name,name));
    };

    /**
     *  Returns a pointer to a Transfer Manager driver. The driver is
     *  searched by its name.
     *    @return the TM driver for the Transfer Manager
     */
    const TransferManagerDriver * get()
    {
        string _name("NAME");
        return static_cast<const TransferManagerDriver *>
               (MadManager::get(0,_name,transfer_driver_name));
    };

    /**
     *  Function to execute the Manager action loop method within a new pthread
     * (requires C linkage)
     */
    friend void * tm_action_loop(void *arg);

    /**
     *  The action function executed when an action is triggered.
     *    @param action the name of the action
     *    @param arg arguments for the action function
     */
    void do_action(
        const string &  action,
        void *          arg);

    /**
     *  This function starts the prolog sequence
     */
    void prolog_action(int vid);

    /**
     *  This function starts the prolog migration sequence
     */
    void prolog_migr_action(int vid);

    /**
     *  This function starts the prolog resume sequence
     */
    void prolog_resume_action(int vid);

    /**
     *  This function starts the prolog attach sequence
     */
    void prolog_attach_action(int vid);

    /**
     *  This function starts the epilog sequence
     */
    void epilog_action(int vid);

    /**
     *  This function starts the epilog_stop sequence
     */
    void epilog_stop_action(int vid);

    /**
     *  This function starts the epilog_delete sequence in the current host
     *    @param vid the Virtual Machine ID
     */
    void epilog_delete_action(int vid)
    {
        epilog_delete_action(false, vid);
    }

    /**
     *  This function starts the epilog_delete_stop sequence on the local host
     *  i.e. the front-end (the VM is not running)
     *    @param vid the Virtual Machine ID
     */
    void epilog_delete_stop_action(int vid)
    {
        epilog_delete_action(true, vid);
    }

    /**
     *  This function starts the epilog_delete sequence on the previous host
     *    @param vid the Virtual Machine ID
     */
    void epilog_delete_previous_action(int vid);

    /**
     *  This function starts the epilog_delete sequence on the current and
     *  previous hosts
     *    @param vid the Virtual Machine ID
     */
    void epilog_delete_both_action(int vid);

    /**
     *  This function starts the epilog_delete sequence
     */
    void epilog_delete_action(bool local, int vid);

    /**
     *  This function starts the epilog detach sequence
     */
    void epilog_detach_action(int vid);

    /**
     *  This function starts the epilog sequence
     */
    void checkpoint_action(int vid);

    /**
     * This function cancels the operation being performed by the driver
     */
    void driver_cancel_action(int vid);

    /**
     * This function starts the saveas of the given disk
     */
    void saveas_hot_action(int vid);

    /**
     * This function performs a generic snapshot action
     */
    void do_snapshot_action(int vid, const char * action);

    /**
     * This function takes an snapshot of a disk
     */
    void snapshot_create_action(int vid);

    /**
     * This function takes an snapshot of a disk
     */
    void snapshot_revert_action(int vid);

    /**
     * This function deletes an snapshot of a disk
     */
    void snapshot_delete_action(int vid);
};

#endif /*TRANSFER_MANAGER_H*/


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

namespace ElectronicObserver.Resource.Record {

	/// <summary>
	/// 敵艦隊編成のレコードです。
	/// </summary>
	[DebuggerDisplay( "{Record.Count} Records" )]
	public class EnemyFleetRecord : RecordBase {

		[DebuggerDisplay( "[{ID}] : {FleetName}" )]
		public class EnemyFleetElement : RecordElementBase {

			public int FleetID { get; set; }

			public string FleetName { get; set; }

			public int Formation { get; set; }

			public int[] FleetMember { get; set; }

			public EnemyFleetElement()
				: base() { }

			public EnemyFleetElement( string line )
				: base( line ) { }

			public EnemyFleetElement( int fleetID, string fleetName, int formation, int[] fleetMember )
				: base() {
				FleetID = fleetID;
				FleetName = fleetName;
				Formation = formation;
				FleetMember = fleetMember;
			}

			public override void LoadLine( string line ) {

				string[] elem = line.Split( ",".ToCharArray() );
				if ( elem.Length < 4 ) throw new ArgumentException( Properties.Resources.Record_ItemLost );

				FleetID = int.Parse( elem[0] );
				FleetName = elem[1];
				Formation = int.Parse( elem[2] );

				FleetMember = new int[elem.Length - 3];
				for ( int i = 3; i < elem.Length; i++ ) {
					FleetMember[i - 3] = int.Parse( elem[i] );
				}
			}

			public override string SaveLine() {

				StringBuilder sb = new StringBuilder();

				sb.AppendFormat( "{0},{1},{2}", FleetID, FleetName, Formation );

				foreach ( int i in FleetMember ) {
					sb.AppendFormat( ",{0}", i );
				}

				return sb.ToString();
			}
		}

		public Dictionary<int, EnemyFleetElement> Record { get; private set; }

		public EnemyFleetRecord()
			: base() {
			Record = new Dictionary<int, EnemyFleetElement>();
		}

		public EnemyFleetElement this[int i] {
			get {
				return Record.ContainsKey( i ) ? Record[i] : null;
			}
			set {
				if ( !Record.ContainsKey( i ) ) {
					Record.Add( i, value );
				} else {
					Record[i] = value;
				}
			}
		}

		public void Update( EnemyFleetElement elem ) {
			this[elem.FleetID] = elem;
		}

		protected override void LoadLine( string line ) {
			Update( new EnemyFleetElement( line ) );
		}

		protected override string SaveLines() {

			StringBuilder sb = new StringBuilder();

			var list = Record.Values.ToList();
			list.Sort( ( e1, e2 ) => e1.FleetID - e2.FleetID );

			foreach ( var elem in list ) {
				sb.AppendLine( elem.SaveLine() );
			}

			return sb.ToString();
		}

		protected override void ClearRecord() {
			Record.Clear();
		}

		protected override string RecordHeader {
			get { return Properties.Resources.RecordEnemyFleet_RecordHeader; }
		}

		public override string FileName {
			get { return "EnemyFleetRecord.csv"; }
		}
	}
}


text:
package pl.mw.collection;

public class ItemNotFound extends RuntimeException {
}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.hibernate.test.legacy">
   <class name="CompositeIdId">
      <composite-id>
         <key-property name="system"/>
         <key-property name="id"/>
      </composite-id>
      <property name="name"/>

      <component name="composite">
      	<property name="foo"/>
      	<property name="bar"/>
      </component>
      <loader query-ref="loadC"/>
   </class>

   <sql-query name="loadC">
      <return alias="c" class="CompositeIdId"/>
      select system as {c.system}, id as {c.id}, name as {c.name}, foo as {c.composite.foo}, bar as {c.composite.bar} from CompositeIdId where system=? and id=?
   </sql-query>

</hibernate-mapping>


text:
using System;
using System.Collections.Generic;
using System.Linq;

using Duality;
using Duality.Components;
using Duality.Resources;
using Duality.Drawing;

namespace DualStickSpaceShooter
{
	[RequiredComponent(typeof(Transform))]
	public class SpawnPoint : Component, ICmpMessageListener, ICmpInitializable
	{
		private static int lastVisitedIndex = -1;
		public static int LastVisitedIndex
		{
			get { return lastVisitedIndex; }
			set { lastVisitedIndex = value; }
		}
		public static Vector3 SpawnPos
		{
			get
			{
				if (lastVisitedIndex == -1) return Vector3.Zero;

				SpawnPoint spawnPoint = Scene.Current.FindComponents<SpawnPoint>().FirstOrDefault(s => s.SpawnIndex == lastVisitedIndex);
				if (spawnPoint == null) return Vector3.Zero;

				Vector3 spawnPos = spawnPoint.GameObj.Transform.Pos;
				spawnPos = new Vector3(spawnPos.Xy);
				return spawnPos;
			}
		}

		private bool activated = false;
		private int index = 0;

		public int SpawnIndex
		{
			get { return this.index; }
			set { this.index = value; }
		}

		private void ChangeParticleEffect()
		{
			ParticleEffect effect = this.GameObj.GetComponent<ParticleEffect>();
			if (effect != null)
			{
				foreach (ParticleEmitter emitter in effect.Emitters)
				{
					emitter.MinColor = emitter.MinColor.WithValue(1.0f);
					emitter.MaxColor = emitter.MaxColor.WithValue(1.0f);
				}
			}
		}

		void ICmpMessageListener.OnMessage(GameMessage msg)
		{
			if (this.activated) return;

			TriggerEnteredMessage entered = msg as TriggerEnteredMessage;
			if (entered != null)
			{
				Ship ship = entered.GameObj.GetComponent<Ship>();
				if (ship != null && ship.Owner != null)
				{
					this.activated = true;
					lastVisitedIndex = this.index;

					this.ChangeParticleEffect();
				}
			}
		}
		void ICmpInitializable.OnActivate()
		{
			if (this.index == lastVisitedIndex || this.activated)
			{
				this.ChangeParticleEffect();
			}
		}
		void ICmpInitializable.OnDeactivate() {}
	}
}


text:
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
    Created on : 11.09.2015, 13:22:01
    Author     : DamirDiz
*/
/* ==========================================================================
Mixins
========================================================================== */
.category-box-container {
  margin: 0 auto;
  max-width: 1180px;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: row;
          flex-direction: row;
  -webkit-flex-wrap: wrap;
          flex-wrap: wrap;
  -webkit-justify-content: space-around;
          justify-content: space-around;
  -webkit-align-content: flex-start;
          align-content: flex-start;
  -webkit-align-items: flex-start;
          align-items: flex-start;
  padding: 10px; }
  .category-box-container .category-box {
    box-sizing: border-box;
    width: 366.66667px;
    background: #F7F7F7;
    height: 200px;
    font-size: 12px;
    margin: 10px;
    position: relative;
    overflow: hidden; }
    .category-box-container .category-box h1 {
      font-size: 30px;
      line-height: 140%;
      color: white;
      font-family: Sunday;
      margin: 0; }
    .category-box-container .category-box .category-box-content {
      position: absolute;
      top: 0px;
      left: 0px;
      width: 100%;
      height: 100%;
      z-index: 3; }
      .category-box-container .category-box .category-box-content .category-box-content-holder {
        position: relative;
        top: 50%;
        -webkit-transform: translateY(-50%);
                transform: translateY(-50%);
        padding: 0px 20px; }
        .category-box-container .category-box .category-box-content .category-box-content-holder .project-count {
          border-top: 1px solid rgba(255, 255, 255, 0.5);
          text-align: center;
          margin: 10px 70px;
          padding-top: 10px;
          display: block;
          font-size: 14px;
          color: rgba(255, 255, 255, 0.8); }
    .category-box-container .category-box .category-box-imageholder {
      position: absolute;
      left: 0px;
      top: 0px;
      width: 100%;
      height: 100%;
      background-size: cover;
      background-repeat: no-repeat;
      background-position: 50% 50%;
      -webkit-transform: scale(1.1);
              transform: scale(1.1);
      -webkit-filter: blur(3px) brightness(100%);
              filter: blur(3px) brightness(100%);
      z-index: 1;
      transition: all 0.2s ease-in-out; }
    .category-box-container .category-box:hover .category-box-imageholder {
      -webkit-transform: scale(1.2);
              transform: scale(1.2); }


text:
<?php

namespace Jarisoft\Model;

require_once 'src/Jarisoft/Model/EventManagerInterface.php';

use Jarisoft\Resources\EventListener;
use Jarisoft\Resources\Event;

/**
 * This class handles events and (un)subscibe EventListener.
 *
 * This class implements Jarisoft\Model\EventManagerInterface and handles events in order to
 * dispatch them to all EventListener. Use the functions add- or removeEventListener to
 * subscribe or unsubscribe objects from listening for events.
 *
 * @since 0.0.1
 * @author jakob
 * @see Event
 *
 */
class EventManager implements \EventManagerInterface
{

    /* array holds all eventListener */
    private $eventListener;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->eventListener = array();
    }

    /*
     * (non-PHPdoc)
     * @see EventManagerInterface::addEventListener()
     */
    public function addEventListener(EventListener $eventListener)
    {
        $this->eventListener[] = $eventListener;
    }

    /*
     * (non-PHPdoc)
     * @see EventManagerInterface::removeEventListener()
     */
    public function removeEventListener(EventListener $listener)
    {
        $key = array_search($listener, $this->eventListener, true);
        if (FALSE !== $key) {
            unset($this->eventListener[$key]);
        }
    }

    /*
     * (non-PHPdoc)
     * @see EventManagerInterface::notifyListener()
     */
    public function notifyListener(Event $event)
    {
        foreach ($this->eventListener as $listener) {

            $event->setEventMessage($event->getEventMessage() . "<br>");
            echo $event->getEventMessage();
            $listener->processEvent($event);
        }
    }
}


text:
package org.vertx.java.http.eventbusbridge.unit;

import static org.junit.Assert.*;

import java.io.IOException;
import java.io.InputStream;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

import org.glassfish.jersey.internal.util.Base64;
import org.junit.Test;
import org.vertx.java.http.eventbusbridge.model.EventBusBridgeRequest;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * Tests unmarshalling of EventBusBridgeRequest objects.
 *
 * @author j2ro
 *
 */
public class EventBusBridgeRequestTest {

	@Test
	public void testUnmarshallingFromXml() throws JAXBException, IOException {
		JAXBContext jaxbContext = JAXBContext.newInstance(EventBusBridgeRequest.class);
		Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
		InputStream input = getClass().getResourceAsStream("/unit/test-request.xml");
		EventBusBridgeRequest request = (EventBusBridgeRequest) jaxbUnmarshaller.unmarshal(input);
		assertEquals("testaddress", request.getAddress());
		assertEquals(Base64.decodeAsString("SGVsbG8gV29ybGQ="), new String(request.getMessage()));
		assertEquals("http://www.test.com/response", request.getResponseUrl());
		assertEquals("String", request.getEventBusMessageType().toString());
		assertEquals("application/xml", request.getResponseMediaType().toString());
	}

	@Test
	public void testUnmarshallingFromJson() throws JsonParseException, JsonMappingException, IOException {
		ObjectMapper mapper = new ObjectMapper();
		InputStream input = getClass().getResourceAsStream("/unit/test-request.json");
		EventBusBridgeRequest request = mapper.readValue(input, EventBusBridgeRequest.class);
		assertEquals("testaddress", request.getAddress());
		assertEquals(Base64.decodeAsString("SGVsbG8gV29ybGQ="), new String(request.getMessage()));
		assertEquals("http://www.test.com/response", request.getResponseUrl());
		assertEquals("String", request.getEventBusMessageType().toString());
		assertEquals("application/json", request.getResponseMediaType().toString());
	}
}


text:
                    <button id="userButton" type="button" class="btn btn-link" uib-dropdown-toggle>
                        {{::user.username}}New User
                    </button>

Manage User Profile

Logout

                    <button id="alertsButton" type="button" class="btn btn-link" ng-click="getChangeLogs()" uib-dropdown-toggle>

                        {{newLogCount()}}
                    </button>

                                    {{::changeLog.user}}
                                    {{::getRelativeTime(changeLog.lastUpdated)}}

                                {{::changeLog.message}}

                                    See All Change Logs

                    <button type="button" class="btn btn-link" ng-click="dumpDB()"></button>