text:
package com.cmssp.model.entity;

import com.google.gson.Gson;

import java.util.List;

/**
 * Created by Administrator on 2016/11/21.
 * 经脉
 */
public class ChannelEntity{
    public long id = -1L;
    public String name = "";
    public String pic = "";
    public String effect = "";
    public String visc = "";
    public String time = "";
    public String shichen = "";
    public String ext_data = "";

    public List<PointEntity> points;

    public String getShowTime(){
        if(shichen.equals("") || shichen == null){
            return "";
        }
        return shichen+"("+time+")";
    }

    public String toString(){
        Gson gson = new Gson();
        return gson.toJson(this , ChannelEntity.class);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

interface ApiDBDriver {
	public function getRoutesFromDB();
}

?>


text:
package org.apache.hadoop.hive.ql.plan;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
import org.apache.hadoop.hive.ql.exec.FileSinkOperator;
import org.apache.hadoop.hive.ql.exec.TableScanOperator;
import org.apache.hadoop.hive.ql.exec.Operator;
import org.apache.hadoop.hive.ql.exec.OperatorUtils;
import org.apache.hadoop.hive.ql.exec.Utilities;
import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
import org.apache.hadoop.hive.ql.io.AcidUtils;
import org.apache.hadoop.hive.ql.io.HiveInputFormat;
import org.apache.hadoop.hive.ql.optimizer.physical.BucketingSortingCtx.BucketCol;
import org.apache.hadoop.hive.ql.optimizer.physical.BucketingSortingCtx.SortCol;
import org.apache.hadoop.hive.ql.parse.SplitSample;
import org.apache.hadoop.hive.ql.plan.Explain.Level;
import org.apache.hadoop.hive.serde.serdeConstants;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
import org.apache.hadoop.mapred.JobConf;

import com.google.common.collect.Interner;

/**
 * MapWork represents all the information used to run a map task on the cluster.
 * It is first used when the query planner breaks the logical plan into tasks and
 * used throughout physical optimization to track map-side operator plans, input
 * paths, aliases, etc.
 *
 * ExecDriver will serialize the contents of this class and make sure it is
 * distributed on the cluster. The ExecMapper will ultimately deserialize this
 * class on the data nodes and setup it's operator pipeline accordingly.
 *
 * This class is also used in the explain command any property with the
 * appropriate annotation will be displayed in the explain output.
 */
@SuppressWarnings({"serial"})
public class MapWork extends BaseWork {

  // use LinkedHashMap to make sure the iteration order is
  // deterministic, to ease testing
  private LinkedHashMap<String, ArrayList<String>> pathToAliases = new LinkedHashMap<String, ArrayList<String>>();

  private LinkedHashMap<String, PartitionDesc> pathToPartitionInfo = new LinkedHashMap<String, PartitionDesc>();

  private LinkedHashMap<String, Operator<? extends OperatorDesc>> aliasToWork = new LinkedHashMap<String, Operator<? extends OperatorDesc>>();

  private LinkedHashMap<String, PartitionDesc> aliasToPartnInfo = new LinkedHashMap<String, PartitionDesc>();

  private HashMap<String, SplitSample> nameToSplitSample = new LinkedHashMap<String, SplitSample>();

  // If this map task has a FileSinkOperator, and bucketing/sorting metadata can be
  // inferred about the data being written by that operator, these are mappings from the directory
  // that operator writes into to the bucket/sort columns for that data.
  private final Map<String, List<BucketCol>> bucketedColsByDirectory =
      new HashMap<String, List<BucketCol>>();
  private final Map<String, List<SortCol>> sortedColsByDirectory =
      new HashMap<String, List<SortCol>>();

  private Path tmpHDFSPath;

  private Path tmpPathForPartitionPruning;

  private String inputformat;

  private String indexIntermediateFile;

  private Integer numMapTasks;
  private Long maxSplitSize;
  private Long minSplitSize;
  private Long minSplitSizePerNode;
  private Long minSplitSizePerRack;

  //use sampled partitioning
  private int samplingType;

  public static final int SAMPLING_ON_PREV_MR = 1;  // todo HIVE-3841
  public static final int SAMPLING_ON_START = 2;    // sampling on task running

  // the following two are used for join processing
  private boolean leftInputJoin;
  private String[] baseSrc;
  private List<String> mapAliases;

  private boolean mapperCannotSpanPartns;

  // used to indicate the input is sorted, and so a BinarySearchRecordReader shoudl be used
  private boolean inputFormatSorted = false;

  private boolean useBucketizedHiveInputFormat;

  private boolean dummyTableScan = false;

  // used for dynamic partitioning
  private Map<String, List<TableDesc>> eventSourceTableDescMap =
      new LinkedHashMap<String, List<TableDesc>>();
  private Map<String, List<String>> eventSourceColumnNameMap =
      new LinkedHashMap<String, List<String>>();
  private Map<String, List<String>> eventSourceColumnTypeMap =
      new LinkedHashMap<String, List<String>>();
  private Map<String, List<ExprNodeDesc>> eventSourcePartKeyExprMap =
      new LinkedHashMap<String, List<ExprNodeDesc>>();

  private boolean doSplitsGrouping = true;

  private VectorizedRowBatch vectorizedRowBatch;

  // bitsets can't be correctly serialized by Kryo's default serializer
  // BitSet::wordsInUse is transient, so force dumping into a lower form
  private byte[] includedBuckets;

  /** Whether LLAP IO will be used for inputs. */
  private String llapIoDesc;

  public MapWork() {}

  public MapWork(String name) {
    super(name);
  }

  @Explain(displayName = "Path -> Alias", explainLevels = { Level.EXTENDED })
  public LinkedHashMap<String, ArrayList<String>> getPathToAliases() {
    return pathToAliases;
  }

  public void setPathToAliases(
      final LinkedHashMap<String, ArrayList<String>> pathToAliases) {
    this.pathToAliases = pathToAliases;
  }

  /**
   * This is used to display and verify output of "Path -> Alias" in test framework.
   *
   * QTestUtil masks "Path -> Alias" and makes verification impossible.
   * By keeping "Path -> Alias" intact and adding a new display name which is not
   * masked by QTestUtil by removing prefix.
   *
   * Notes: we would still be masking for intermediate directories.
   *
   * @return
   */
  @Explain(displayName = "Truncated Path -> Alias", explainLevels = { Level.EXTENDED })
  public Map<String, ArrayList<String>> getTruncatedPathToAliases() {
    Map<String, ArrayList<String>> trunPathToAliases = new LinkedHashMap<String,
        ArrayList<String>>();
    Iterator<Entry<String, ArrayList<String>>> itr = this.pathToAliases.entrySet().iterator();
    while (itr.hasNext()) {
      final Entry<String, ArrayList<String>> entry = itr.next();
      String origiKey = entry.getKey();
      String newKey = PlanUtils.removePrefixFromWarehouseConfig(origiKey);
      ArrayList<String> value = entry.getValue();
      trunPathToAliases.put(newKey, value);
    }
    return trunPathToAliases;
  }

  @Explain(displayName = "Path -> Partition", explainLevels = { Level.EXTENDED })
  public LinkedHashMap<String, PartitionDesc> getPathToPartitionInfo() {
    return pathToPartitionInfo;
  }

  public void setPathToPartitionInfo(
      final LinkedHashMap<String, PartitionDesc> pathToPartitionInfo) {
    this.pathToPartitionInfo = pathToPartitionInfo;
  }

  /**
   * Derive additional attributes to be rendered by EXPLAIN.
   * TODO: this method is relied upon by custom input formats to set jobconf properties.
   *       This is madness? - This is Hive Storage Handlers!
   */
  public void deriveExplainAttributes() {
    if (pathToPartitionInfo != null) {
      for (Map.Entry<String, PartitionDesc> entry : pathToPartitionInfo.entrySet()) {
        entry.getValue().deriveBaseFileName(entry.getKey());
      }
    }
    MapredLocalWork mapLocalWork = getMapRedLocalWork();
    if (mapLocalWork != null) {
      mapLocalWork.deriveExplainAttributes();
    }
  }

  public void deriveLlap(Configuration conf) {
    boolean hasLlap = false, hasNonLlap = false, hasAcid = false;
    // Assume the IO is enabled on the daemon by default. We cannot reasonably check it here.
    boolean isLlapOn = HiveConf.getBoolVar(conf, ConfVars.LLAP_IO_ENABLED, llapMode),
        canWrapAny = isLlapOn && HiveInputFormat.canWrapAnyForLlap(conf, this);
    boolean hasPathToPartInfo = (pathToPartitionInfo != null && !pathToPartitionInfo.isEmpty());
    if (canWrapAny && hasPathToPartInfo) {
      assert isLlapOn;
      for (PartitionDesc part : pathToPartitionInfo.values()) {
        boolean isUsingLlapIo = HiveInputFormat.canWrapForLlap(part.getInputFileFormatClass());
        if (isUsingLlapIo) {
          if (part.getTableDesc() != null &&
              AcidUtils.isTablePropertyTransactional(part.getTableDesc().getProperties())) {
            hasAcid = true;
          } else {
            hasLlap = true;
          }
        } else {
          hasNonLlap = true;
        }
      }
    }

    // check if the column types that are read are supported by LLAP IO
    for (Map.Entry<String, Operator<? extends OperatorDesc>> entry : aliasToWork.entrySet()) {
      if (hasLlap) {
        final String alias = entry.getKey();
        Operator<? extends OperatorDesc> op = entry.getValue();
        PartitionDesc partitionDesc = aliasToPartnInfo.get(alias);
        if (op instanceof TableScanOperator && partitionDesc != null &&
            partitionDesc.getTableDesc() != null) {
          final TableScanOperator tsOp = (TableScanOperator) op;
          final List<String> readColumnNames = tsOp.getNeededColumns();
          final Properties props = partitionDesc.getTableDesc().getProperties();
          final List<TypeInfo> typeInfos = TypeInfoUtils.getTypeInfosFromTypeString(
              props.getProperty(serdeConstants.LIST_COLUMN_TYPES));
          final List<String> allColumnTypes = TypeInfoUtils.getTypeStringsFromTypeInfo(typeInfos);
          final List<String> allColumnNames = Utilities.getColumnNames(props);
          hasLlap = Utilities.checkLlapIOSupportedTypes(readColumnNames, allColumnNames,
              allColumnTypes);
        }
      }
    }

    llapIoDesc = deriveLlapIoDescString(
        isLlapOn, canWrapAny, hasPathToPartInfo, hasLlap, hasNonLlap, hasAcid);
  }

  private static String deriveLlapIoDescString(boolean isLlapOn, boolean canWrapAny,
      boolean hasPathToPartInfo, boolean hasLlap, boolean hasNonLlap, boolean hasAcid) {
    if (!isLlapOn) return null; // LLAP IO is off, don't output.
    if (!canWrapAny) return "no inputs"; // Cannot use with input formats.
    if (!hasPathToPartInfo) return "unknown"; // No information to judge.
    if (hasAcid) return "may be used (ACID table)";
    return (hasLlap ? (hasNonLlap ? "some inputs" : "all inputs") : "no inputs");
  }

  public void internTable(Interner<TableDesc> interner) {
    if (aliasToPartnInfo != null) {
      for (PartitionDesc part : aliasToPartnInfo.values()) {
        if (part == null) {
          continue;
        }
        part.intern(interner);
      }
    }
    if (pathToPartitionInfo != null) {
      for (PartitionDesc part : pathToPartitionInfo.values()) {
        part.intern(interner);
      }
    }
  }

  /**
   * @return the aliasToPartnInfo
   */
  public LinkedHashMap<String, PartitionDesc> getAliasToPartnInfo() {
    return aliasToPartnInfo;
  }

  /**
   * @param aliasToPartnInfo
   *          the aliasToPartnInfo to set
   */
  public void setAliasToPartnInfo(
      LinkedHashMap<String, PartitionDesc> aliasToPartnInfo) {
    this.aliasToPartnInfo = aliasToPartnInfo;
  }

  public LinkedHashMap<String, Operator<? extends OperatorDesc>> getAliasToWork() {
    return aliasToWork;
  }

  public void setAliasToWork(
      final LinkedHashMap<String, Operator<? extends OperatorDesc>> aliasToWork) {
    this.aliasToWork = aliasToWork;
  }

  @Explain(displayName = "Split Sample", explainLevels = { Level.EXTENDED })
  public HashMap<String, SplitSample> getNameToSplitSample() {
    return nameToSplitSample;
  }

  @Explain(displayName = "LLAP IO")
  public String getLlapIoDesc() {
    return llapIoDesc;
  }

  public void setNameToSplitSample(HashMap<String, SplitSample> nameToSplitSample) {
    this.nameToSplitSample = nameToSplitSample;
  }

  public Integer getNumMapTasks() {
    return numMapTasks;
  }

  public void setNumMapTasks(Integer numMapTasks) {
    this.numMapTasks = numMapTasks;
  }

  @SuppressWarnings("nls")
  public void addMapWork(String path, String alias, Operator<?> work,
      PartitionDesc pd) {
    ArrayList<String> curAliases = pathToAliases.get(path);
    if (curAliases == null) {
      assert (pathToPartitionInfo.get(path) == null);
      curAliases = new ArrayList<String>();
      pathToAliases.put(path, curAliases);
      pathToPartitionInfo.put(path, pd);
    } else {
      assert (pathToPartitionInfo.get(path) != null);
    }

    for (String oneAlias : curAliases) {
      if (oneAlias.equals(alias)) {
        throw new RuntimeException("Multiple aliases named: " + alias
            + " for path: " + path);
      }
    }
    curAliases.add(alias);

    if (aliasToWork.get(alias) != null) {
      throw new RuntimeException("Existing work for alias: " + alias);
    }
    aliasToWork.put(alias, work);
  }

  public boolean isInputFormatSorted() {
    return inputFormatSorted;
  }

  public void setInputFormatSorted(boolean inputFormatSorted) {
    this.inputFormatSorted = inputFormatSorted;
  }

  public void resolveDynamicPartitionStoredAsSubDirsMerge(HiveConf conf, Path path,
      TableDesc tblDesc, ArrayList<String> aliases, PartitionDesc partDesc) {
    pathToAliases.put(path.toString(), aliases);
    pathToPartitionInfo.put(path.toString(), partDesc);
  }

  /**
   * For each map side operator - stores the alias the operator is working on
   * behalf of in the operator runtime state. This is used by reduce sink
   * operator - but could be useful for debugging as well.
   */
  private void setAliases() {
    if(aliasToWork == null) {
      return;
    }
    for (String oneAlias : aliasToWork.keySet()) {
      aliasToWork.get(oneAlias).setAlias(oneAlias);
    }
  }

  @Explain(displayName = "Execution mode", explainLevels = { Level.USER, Level.DEFAULT, Level.EXTENDED })
  public String getExecutionMode() {
    if (vectorMode) {
      if (llapMode) {
        if (uberMode) {
          return "vectorized, uber";
        } else {
          return "vectorized, llap";
        }
      } else {
        return "vectorized";
      }
    } else if (llapMode) {
      return uberMode? "uber" : "llap";
    }
    return null;
  }

  @Override
  public void replaceRoots(Map<Operator<?>, Operator<?>> replacementMap) {
    LinkedHashMap<String, Operator<?>> newAliasToWork = new LinkedHashMap<String, Operator<?>>();

    for (Map.Entry<String, Operator<?>> entry: aliasToWork.entrySet()) {
      newAliasToWork.put(entry.getKey(), replacementMap.get(entry.getValue()));
    }

    setAliasToWork(newAliasToWork);
  }

  @Override
  @Explain(displayName = "Map Operator Tree", explainLevels = { Level.USER, Level.DEFAULT, Level.EXTENDED })
  public Set<Operator<? extends OperatorDesc>> getAllRootOperators() {
    Set<Operator<?>> opSet = new LinkedHashSet<Operator<?>>();

    for (Operator<?> op : getAliasToWork().values()) {
      opSet.add(op);
    }
    return opSet;
  }

  @Override
  public Operator<? extends OperatorDesc> getAnyRootOperator() {
    return aliasToWork.isEmpty() ? null : aliasToWork.values().iterator().next();
  }

  public void mergeAliasedInput(String alias, String pathDir, PartitionDesc partitionInfo) {
    ArrayList<String> aliases = pathToAliases.get(pathDir);
    if (aliases == null) {
      aliases = new ArrayList<String>(Arrays.asList(alias));
      pathToAliases.put(pathDir, aliases);
      pathToPartitionInfo.put(pathDir, partitionInfo);
    } else {
      aliases.add(alias);
    }
  }

  public void initialize() {
    setAliases();
  }

  public Long getMaxSplitSize() {
    return maxSplitSize;
  }

  public void setMaxSplitSize(Long maxSplitSize) {
    this.maxSplitSize = maxSplitSize;
  }

  public Long getMinSplitSize() {
    return minSplitSize;
  }

  public void setMinSplitSize(Long minSplitSize) {
    this.minSplitSize = minSplitSize;
  }

  public Long getMinSplitSizePerNode() {
    return minSplitSizePerNode;
  }

  public void setMinSplitSizePerNode(Long minSplitSizePerNode) {
    this.minSplitSizePerNode = minSplitSizePerNode;
  }

  public Long getMinSplitSizePerRack() {
    return minSplitSizePerRack;
  }

  public void setMinSplitSizePerRack(Long minSplitSizePerRack) {
    this.minSplitSizePerRack = minSplitSizePerRack;
  }

  public String getInputformat() {
    return inputformat;
  }

  public void setInputformat(String inputformat) {
    this.inputformat = inputformat;
  }

  public boolean isUseBucketizedHiveInputFormat() {
    return useBucketizedHiveInputFormat;
  }

  public void setUseBucketizedHiveInputFormat(boolean useBucketizedHiveInputFormat) {
    this.useBucketizedHiveInputFormat = useBucketizedHiveInputFormat;
  }

  public void setMapperCannotSpanPartns(boolean mapperCannotSpanPartns) {
    this.mapperCannotSpanPartns = mapperCannotSpanPartns;
  }

  public boolean isMapperCannotSpanPartns() {
    return this.mapperCannotSpanPartns;
  }

  public String getIndexIntermediateFile() {
    return indexIntermediateFile;
  }

  public ArrayList<String> getAliases() {
    return new ArrayList<String>(aliasToWork.keySet());
  }

  public ArrayList<Operator<?>> getWorks() {
    return new ArrayList<Operator<?>>(aliasToWork.values());
  }

  public ArrayList<String> getPaths() {
    return new ArrayList<String>(pathToAliases.keySet());
  }

  public ArrayList<PartitionDesc> getPartitionDescs() {
    return new ArrayList<PartitionDesc>(aliasToPartnInfo.values());
  }

  public Path getTmpHDFSPath() {
    return tmpHDFSPath;
  }

  public void setTmpHDFSPath(Path tmpHDFSPath) {
    this.tmpHDFSPath = tmpHDFSPath;
  }

  public Path getTmpPathForPartitionPruning() {
    return this.tmpPathForPartitionPruning;
  }

  public void setTmpPathForPartitionPruning(Path tmpPathForPartitionPruning) {
    this.tmpPathForPartitionPruning = tmpPathForPartitionPruning;
  }

  public void mergingInto(MapWork mapWork) {
    // currently, this is sole field affecting mergee task
    mapWork.useBucketizedHiveInputFormat |= useBucketizedHiveInputFormat;
  }

  @Explain(displayName = "Path -> Bucketed Columns", explainLevels = { Level.EXTENDED })
  public Map<String, List<BucketCol>> getBucketedColsByDirectory() {
    return bucketedColsByDirectory;
  }

  @Explain(displayName = "Path -> Sorted Columns", explainLevels = { Level.EXTENDED })
  public Map<String, List<SortCol>> getSortedColsByDirectory() {
    return sortedColsByDirectory;
  }

  public void addIndexIntermediateFile(String fileName) {
    if (this.indexIntermediateFile == null) {
      this.indexIntermediateFile = fileName;
    } else {
      this.indexIntermediateFile += "," + fileName;
    }
  }

  public int getSamplingType() {
    return samplingType;
  }

  public void setSamplingType(int samplingType) {
    this.samplingType = samplingType;
  }

  @Explain(displayName = "Sampling", explainLevels = { Level.EXTENDED })
  public String getSamplingTypeString() {
    return samplingType == 1 ? "SAMPLING_ON_PREV_MR" :
        samplingType == 2 ? "SAMPLING_ON_START" : null;
  }

  @Override
  public void configureJobConf(JobConf job) {
    for (PartitionDesc partition : aliasToPartnInfo.values()) {
      PlanUtils.configureJobConf(partition.getTableDesc(), job);
    }
    Collection<Operator<?>> mappers = aliasToWork.values();
    for (FileSinkOperator fs : OperatorUtils.findOperators(mappers, FileSinkOperator.class)) {
      PlanUtils.configureJobConf(fs.getConf().getTableInfo(), job);
    }
  }

  public void setDummyTableScan(boolean dummyTableScan) {
    this.dummyTableScan = dummyTableScan;
  }

  public boolean getDummyTableScan() {
    return dummyTableScan;
  }

  public void setEventSourceTableDescMap(Map<String, List<TableDesc>> map) {
    this.eventSourceTableDescMap = map;
  }

  public Map<String, List<TableDesc>> getEventSourceTableDescMap() {
    return eventSourceTableDescMap;
  }

  public void setEventSourceColumnNameMap(Map<String, List<String>> map) {
    this.eventSourceColumnNameMap = map;
  }

  public Map<String, List<String>> getEventSourceColumnNameMap() {
    return eventSourceColumnNameMap;
  }

  public Map<String, List<String>> getEventSourceColumnTypeMap() {
    return eventSourceColumnTypeMap;
  }

  public Map<String, List<ExprNodeDesc>> getEventSourcePartKeyExprMap() {
    return eventSourcePartKeyExprMap;
  }

  public void setEventSourcePartKeyExprMap(Map<String, List<ExprNodeDesc>> map) {
    this.eventSourcePartKeyExprMap = map;
  }

  public void setDoSplitsGrouping(boolean doSplitsGrouping) {
    this.doSplitsGrouping = doSplitsGrouping;
  }

  public boolean getDoSplitsGrouping() {
    return this.doSplitsGrouping;
  }

  public boolean isLeftInputJoin() {
    return leftInputJoin;
  }

  public void setLeftInputJoin(boolean leftInputJoin) {
    this.leftInputJoin = leftInputJoin;
  }

  public String[] getBaseSrc() {
    return baseSrc;
  }

  public void setBaseSrc(String[] baseSrc) {
    this.baseSrc = baseSrc;
  }

  public List<String> getMapAliases() {
    return mapAliases;
  }

  public void setMapAliases(List<String> mapAliases) {
    this.mapAliases = mapAliases;
  }

  public BitSet getIncludedBuckets() {
    return includedBuckets != null ? BitSet.valueOf(includedBuckets) : null;
  }

  public void setIncludedBuckets(BitSet includedBuckets) {
    // see comment next to the field
    this.includedBuckets = includedBuckets.toByteArray();
  }

  public void setVectorizedRowBatch(VectorizedRowBatch vectorizedRowBatch) {
    this.vectorizedRowBatch = vectorizedRowBatch;
  }

  public VectorizedRowBatch getVectorizedRowBatch() {
    return vectorizedRowBatch;
  }
}


text:
@interface ImageFetcher(Private)
-(BOOL) isConnected;

@end

@implementation ImageFetcher

- (id)init:(NSImageView *)iThumb{
	self = [super init];
	radioThumb = [iThumb retain];
	return self;
}

- (void)dealloc
{
	[radioThumb release];
	[super dealloc];
}

- (void)main
{
	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
	if([self isConnected]){
		NSImage *twitSourceImg = [[NSImage alloc] initWithContentsOfURL:
								  [NSURL URLWithString:[NSString stringWithFormat:@"http://api.twitter.com/1/users/profile_image/%@.json?size=bigger",[[NSUserDefaults standardUserDefaults] stringForKey:@"twitSource"]]]];

		if (twitSourceImg != nil) {
			[radioThumb setImage:twitSourceImg];
		}
	}else{
		NSBundle *bundle = [NSBundle mainBundle];
		NSImage *twitSourceImg = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"defaultpic"]];
		NSLog(@"no net image %@",twitSourceImg);
		[radioThumb setImage:twitSourceImg];
	}

	[pool release];
}

- (BOOL) isConnected
{
    Boolean success;
    BOOL connected;
    SCNetworkConnectionFlags status;

    success = SCNetworkCheckReachabilityByName("www.twitter.com",
											   &status);

    connected = success && (status & kSCNetworkFlagsReachable) && !(status &
																	kSCNetworkFlagsConnectionRequired);

    if (!connected)
    {
        NSLog(@"No net");
    }else{
        NSLog(@"Net OK");
	}

	return connected;
}

@end


text:
<?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.appleframework.jms</groupId>
		<artifactId>apple-jms</artifactId>
		<version>1.0.0-SNAPSHOT</version>
	</parent>
	<artifactId>apple-jms-kafka</artifactId>
	<name>apple-jms-kafka</name>
	<url>http://mvnrepo.appleframework.com</url>

	<dependencies>

		<dependency>
			<groupId>com.appleframework.jms</groupId>
			<artifactId>apple-jms-core</artifactId>
			<version>${project.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.kafka</groupId>
			<artifactId>kafka-clients</artifactId>
			<version>2.7.0</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
  			<groupId>com.google.code.gson</groupId>
  			<artifactId>gson</artifactId>
  			<scope>provided</scope>
		</dependency>

	</dependencies>
</project>


text:
layout: study
title: 'Hit and Miss: Thanks for subscribing!'
---

Thanks for subscribing!

	I'm honoured that you're willing to give me some space in your inbox each week. You should
	receive a copy of the last letter automatically. If you'd like to read more,
	you can check out the archive.

	Have a great week!

	—Lucas


text:
activate :autoprefixer do |prefix|
  prefix.browsers = "last 2 versions"
end

# Layouts
# https://middlemanapp.com/basics/layouts/

# Per-page layout changes
page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false

###
## Asset settings
###

# Sprockets asset compilation
activate :sprockets
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'

# Reload the browser automatically whenever files change
configure :development do
  activate :livereload, no_swf: true
end

# With alternative layout
# page '/path/to/file.html', layout: 'other_layout'

# Proxy pages
# https://middlemanapp.com/advanced/dynamic-pages/

# proxy(
#   '/this-page-has-no-template.html',
#   '/template-file.html',
#   locals: {
#     which_fake_page: 'Rendering a fake page with a local variable'
#   },
# )

# Helpers
# Methods defined in the helpers block are available in templates
# https://middlemanapp.com/basics/helper-methods/

# helpers do
#   def some_helper
#     'Helping'
#   end
# end

# Build-specific configuration
# https://middlemanapp.com/advanced/configuration/#environment-specific-settings

configure :build do
  activate :minify_css
  activate :minify_javascript
end


text:
"""Config flow for OwnTracks."""
import secrets

from homeassistant import config_entries
from homeassistant.const import CONF_WEBHOOK_ID

from .const import DOMAIN  # noqa pylint: disable=unused-import
from .helper import supports_encryption

CONF_SECRET = "secret"
CONF_CLOUDHOOK = "cloudhook"

class OwnTracksFlow(config_entries.ConfigFlow, domain=DOMAIN):
    """Set up OwnTracks."""

    VERSION = 1

    async def async_step_user(self, user_input=None):
        """Handle a user initiated set up flow to create OwnTracks webhook."""
        if self._async_current_entries():
            return self.async_abort(reason="single_instance_allowed")

        if user_input is None:
            return self.async_show_form(step_id="user")

        webhook_id, webhook_url, cloudhook = await self._get_webhook_id()

        secret = secrets.token_hex(16)

        if supports_encryption():
            secret_desc = f"The encryption key is {secret} (on Android under preferences -> advanced)"
        else:
            secret_desc = "Encryption is not supported because nacl is not installed."

        return self.async_create_entry(
            title="OwnTracks",
            data={
                CONF_WEBHOOK_ID: webhook_id,
                CONF_SECRET: secret,
                CONF_CLOUDHOOK: cloudhook,
            },
            description_placeholders={
                "secret": secret_desc,
                "webhook_url": webhook_url,
                "android_url": "https://play.google.com/store/apps/details?id=org.owntracks.android",
                "ios_url": "https://itunes.apple.com/us/app/owntracks/id692424691?mt=8",
                "docs_url": "https://www.home-assistant.io/integrations/owntracks/",
            },
        )

    async def async_step_import(self, user_input):
        """Import a config flow from configuration."""
        if self._async_current_entries():
            return self.async_abort(reason="single_instance_allowed")
        webhook_id, _webhook_url, cloudhook = await self._get_webhook_id()
        secret = secrets.token_hex(16)
        return self.async_create_entry(
            title="OwnTracks",
            data={
                CONF_WEBHOOK_ID: webhook_id,
                CONF_SECRET: secret,
                CONF_CLOUDHOOK: cloudhook,
            },
        )

    async def _get_webhook_id(self):
        """Generate webhook ID."""
        webhook_id = self.hass.components.webhook.async_generate_id()
        if self.hass.components.cloud.async_active_subscription():
            webhook_url = await self.hass.components.cloud.async_create_cloudhook(
                webhook_id
            )
            cloudhook = True
        else:
            webhook_url = self.hass.components.webhook.async_generate_url(webhook_id)
            cloudhook = False

        return webhook_id, webhook_url, cloudhook


text:
require_dependency "renalware/snippets"

module Renalware
  module System
    class MessagePolicy < BasePolicy
      def new?
        user_is_super_admin?
      end

      def create?
        user_is_super_admin?
      end

      def destroy?
        user_is_super_admin?
      end
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!--===========-->
    <!-- Main Theme-->
    <!--===========-->
    <style name="Theme.Tachiyomi" parent="Theme.Base">
        <!-- Attributes specific for SDK 21 and up  -->
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@color/colorPrimaryDark</item>
        <item name="android:navigationBarColor">@color/colorPrimaryDark</item>
        <item name="android:alertDialogTheme">@style/Theme.AlertDialog.Light</item>
    </style>

    <!--============-->
    <!-- Dark Theme -->
    <!--============-->
    <style name="Theme.Tachiyomi.Dark" parent="Theme.Base.Dark">
        <!-- Attributes specific for SDK 21 and up  -->
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@color/colorPrimaryDark</item>
        <item name="android:navigationBarColor">@color/colorPrimaryDark</item>
        <item name="android:alertDialogTheme">@style/Theme.AlertDialog.Dark</item>
    </style>
</resources>


text:
#include <QVariant>
#include <QString>
#include <OGRE/OgreSceneManager.h>
#include <boost/lexical_cast.hpp>
#include <pluginlib/class_list_macros.h>
#include <rviz/display_context.h>
#include "rviz/EnvironmentDisplay.h"
#include "util/ros_conversions.h"

using boost::lexical_cast;

static QString const kDefaultFrame = "map";

namespace or_rviz {
namespace rviz {

EnvironmentDisplay::EnvironmentDisplay()
{
}

EnvironmentDisplay::~EnvironmentDisplay()
{
}

void EnvironmentDisplay::onInitialize()
{
    property_environment_ = new ::rviz::EnumProperty(
        "Environment", QString(), "OpenRAVE environment",
        this, SLOT(EnvironmentChangeSlot())
    );
    property_frame_ = new ::rviz::TfFrameProperty(
        "World Frame", ::rviz::TfFrameProperty::FIXED_FRAME_STRING,
        "OpenRAVE world frame", this, context_->getFrameManager(),
        true, SLOT(FrameChangeSlot())
    );

    property_shadows_ = new ::rviz::BoolProperty("Enable Shadows", false, "Enable shadows", this, SLOT(LightChangeSlot()));
    property_cameralight_ = new ::rviz::BoolProperty("Camera Light", true, "Enable Camera Light", this, SLOT(LightChangeSlot()));
    property_keylight_ = new ::rviz::BoolProperty("Key Light", true, "Enable Key Light", this, SLOT(LightChangeSlot()));
    property_filllight_ = new ::rviz::BoolProperty("Fill Light", true, "Enable Fill Light", this, SLOT(LightChangeSlot()));
    property_backlight_= new ::rviz::BoolProperty("Back Light", true, "Enable Back Light", this, SLOT(LightChangeSlot()));

    property_bodies_ = new ::rviz::Property("Bodies", QVariant(), "", this);
}

void EnvironmentDisplay::set_environment(OpenRAVE::EnvironmentBasePtr const &env)
{
    BOOST_ASSERT(env);

    RAVELOG_DEBUG("Switching to Environment(%d)\n",
        OpenRAVE::RaveGetEnvironmentId(env));

    env_ = env;
    int const id = OpenRAVE::RaveGetEnvironmentId(env_);
    property_environment_->setStringStd(lexical_cast<std::string>(id));

    // Listen for bodies added and removed from the environment.
    env_callback_handle_ = env->RegisterBodyCallback(
        boost::bind(&EnvironmentDisplay::BodyCallback, this, _1, _2)
    );

    // Manually add the existing set of bodies in the environment. The callback
    // will not be called for these because they already exist.
    body_properties_.clear();

    std::vector<OpenRAVE::KinBodyPtr> bodies;
    env_->GetBodies(bodies);

    for (OpenRAVE::KinBodyPtr const &body : bodies) {
        BodyCallback(body, 1);
    }
}

void EnvironmentDisplay::EnvironmentSync()
{
    // Build a list of all environments IDs.
    std::list<OpenRAVE::EnvironmentBasePtr> envs;
    OpenRAVE::RaveGetEnvironments(envs);

    std::set<int> new_environment_ids;
    for (OpenRAVE::EnvironmentBasePtr const &env : envs) {
        int const id = OpenRAVE::RaveGetEnvironmentId(env);
        new_environment_ids.insert(id);
    }

    // Update the dropdown menu.
    if (new_environment_ids != environment_ids_) {
        property_environment_->clearOptions();
        for (int const &id : new_environment_ids) {
            property_environment_->addOptionStd(
                lexical_cast<std::string>(id), id);
        }

        int const current_id = property_environment_->getOptionInt();
        if (!new_environment_ids.count(current_id)) {
            RAVELOG_WARN("Currently viewing environment ID %d, which no"
                         " longer exists.\n", current_id);
        }

        environment_ids_ = new_environment_ids;
    }
}

boost::signals2::connection EnvironmentDisplay::RegisterFrameChangeCallback(
    boost::function<FrameChangeCallback> const &callback)
{
    return frame_callbacks_.connect(callback);
}

boost::signals2::connection EnvironmentDisplay::RegisterEnvironmentChangeCallback(
    boost::function<EnvironmentChangeCallback> const &callback)
{
    return env_changed_callbacks_.connect(callback);
}

/*
 * Slots
 */
void EnvironmentDisplay::FrameChangeSlot()
{
    frame_callbacks_(property_frame_->getFrameStd());
}

void EnvironmentDisplay::LightChangeSlot()
{
    bool shadows = property_shadows_->getBool();
    bool cam = property_cameralight_->getBool();
    bool key = property_keylight_->getBool();
    bool fill = property_filllight_->getBool();
    bool back = property_backlight_->getBool();

    scene_manager_->setShadowTechnique(shadows ? Ogre::SHADOWTYPE_STENCIL_ADDITIVE : Ogre::SHADOWTYPE_NONE);

    Ogre::Light* mainDirectional = scene_manager_->getLight( "MainDirectional" );
    Ogre::Light* keyLight = scene_manager_->getLight( "KeyLight" );
    Ogre::Light* fillLight = scene_manager_->getLight( "FillLight" );
    Ogre::Light* backLight = scene_manager_->getLight( "BackLight" );
    mainDirectional->setVisible(cam);
    keyLight->setVisible(key);
    fillLight->setVisible(fill);
    backLight->setVisible(back);
}

void EnvironmentDisplay::EnvironmentChangeSlot()
{
    int const id = property_environment_->getOptionInt();
    OpenRAVE::EnvironmentBasePtr changed_env = OpenRAVE::RaveGetEnvironment(id);

    if (changed_env) {
        env_changed_callbacks_(changed_env);
    } else {
        RAVELOG_WARN("Attempted to switch to environment with non-existent"
                     " ID %d.\n", id);
    }
}

/*
 * Private
 */
void EnvironmentDisplay::BodyCallback(OpenRAVE::KinBodyPtr body, int flag)
{
    // Body was remove.
    if (flag == 1) {
        body_properties_[body.get()] = new ::rviz::Property(
            QString::fromStdString(body->GetName()),
            QVariant(), "", property_bodies_
        );
    }
    // Body was added.
    else if (flag == 0) {
        auto it = body_properties_.find(body.get());

        if (it != body_properties_.end()) {
            delete property_bodies_->takeChild(it->second);
            body_properties_.erase(it);
        } else {
            RAVELOG_WARN("Received removal event for unknown body '%s'.\n",
                body->GetName().c_str()
            );
        }
    } else {
        RAVELOG_WARN("Unkonwn RegisterBodyCallback flag %d.\n", flag);
    }
}

}
}

// Tell pluginlib about this class.  It is important to do this in
// global scope, outside our package's namespace.
PLUGINLIB_EXPORT_CLASS(or_rviz::rviz::EnvironmentDisplay, ::rviz::Display)


text:
package com.yingt.uimain.skin.entity;

import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;

import com.yingt.uimain.skin.loader.SkinManager;

public class BackgroundAttr extends SkinAttr {

	@Override
	public void apply(View view) {

		if(RES_TYPE_NAME_COLOR.equals(attrValueTypeName)){
			view.setBackgroundColor(SkinManager.getInstance().getColor(attrValueRefId));
			Log.i("attr", "_________________________________________________________");
			Log.i("attr", "apply as color");
		}else if(RES_TYPE_NAME_DRAWABLE.equals(attrValueTypeName)){
			Drawable bg = SkinManager.getInstance().getDrawable(attrValueRefId);
			view.setBackground(bg);
			Log.i("attr", "_________________________________________________________");
			Log.i("attr", "apply as drawable");
			Log.i("attr", "bg.toString()  " + bg.toString());

			Log.i("attr", this.attrValueRefName + " 是否可变换状态? : " + bg.isStateful());
		}
	}
}


text:
module org.apache.causeway.viewer.restfulobjects.rendering {
    exports org.apache.causeway.viewer.restfulobjects.rendering.service.conneg;
    exports org.apache.causeway.viewer.restfulobjects.rendering.service.swagger;
    exports org.apache.causeway.viewer.restfulobjects.rendering.service.valuerender;
    exports org.apache.causeway.viewer.restfulobjects.rendering.util;
    exports org.apache.causeway.viewer.restfulobjects.rendering.domainobjects;
    exports org.apache.causeway.viewer.restfulobjects.rendering;
    exports org.apache.causeway.viewer.restfulobjects.rendering.service.swagger.internal;
    exports org.apache.causeway.viewer.restfulobjects.rendering.domaintypes;
    exports org.apache.causeway.viewer.restfulobjects.rendering.service.acceptheader;
    exports org.apache.causeway.viewer.restfulobjects.rendering.service;

    requires org.apache.causeway.viewer.restfulobjects.applib;
    requires com.fasterxml.jackson.core;
    requires com.fasterxml.jackson.databind;
    requires jakarta.activation;
    requires java.annotation;
    requires java.inject;
    requires java.sql;
    requires java.ws.rs;
    requires java.xml.bind;
    requires lombok;
    requires org.apache.causeway.applib;
    requires org.apache.causeway.commons;
    requires org.apache.causeway.core.config;
    requires org.apache.causeway.core.metamodel;
    requires org.apache.causeway.core.runtime;
    requires org.apache.causeway.schema;
    requires org.apache.logging.log4j;
    requires org.joda.time;
    requires spring.beans;
    requires spring.context;
    requires spring.core;
    requires io.swagger.v3.oas.models;
    requires io.swagger.v3.core;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textColor="?attr/pingTextColor"
    android:typeface="monospace"
    android:textSize="@dimen/text_size_small"/>


text:
layout: post
title: Get Out
date: '2003-04-01 13:16:15 -0700'
mt_id: 134
blog_id: 1
post_id: 134
basename: get-out
---

Get Out is the local Tribune newspaper's entertainment guide for east metro Phoenix. It recently had its annual dining options issue and it was both thorough and accurate.

If you're a Valley resident, you should check it and the restaurants it highlights out.


text:
using Entitas;

namespace Entitas {

    public partial class Entity {

        public ViewObjectComponent viewObject { get { return (ViewObjectComponent)GetComponent(CoreComponentIds.ViewObject); } }
        public bool hasViewObject { get { return HasComponent(CoreComponentIds.ViewObject); } }

        public Entity AddViewObject(string newName) {
            var component = CreateComponent<ViewObjectComponent>(CoreComponentIds.ViewObject);
            component.name = newName;
            return AddComponent(CoreComponentIds.ViewObject, component);
        }

        public Entity ReplaceViewObject(string newName) {
            var component = CreateComponent<ViewObjectComponent>(CoreComponentIds.ViewObject);
            component.name = newName;
            ReplaceComponent(CoreComponentIds.ViewObject, component);
            return this;
        }

        public Entity RemoveViewObject() {
            return RemoveComponent(CoreComponentIds.ViewObject);
        }
    }
}

    public partial class CoreMatcher {

        static IMatcher _matcherViewObject;

        public static IMatcher ViewObject {
            get {
                if(_matcherViewObject == null) {
                    var matcher = (Matcher)Matcher.AllOf(CoreComponentIds.ViewObject);
                    matcher.componentNames = CoreComponentIds.componentNames;
                    _matcherViewObject = matcher;
                }

                return _matcherViewObject;
            }
        }
    }


text:
'''
Copyright (c) 2014, Rishi Desai
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
import socket
import time
import math
import pickle
class Joystick:

    sessionStarted = False
    port = 8081
    joyData=[]
    #s = socket.socket(socket.AF_INET, socket.Sock_DGRAM)
    def __init__(self, s=None):
        if s is None:
            self.s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
            self.s.bind(("", Joystick.port))
        else:
            self.s = s
    def connect(self):
        data, addr = self.s.recvfrom(1024)
        Joystick.sessionStarted = pickle.loads(data)
        return Joystick.sessionStarted
    def isConnected(self):
        return Joystick.joyData[0]
    def setData(self):
        data, addr = self.s.recvfrom(1024)
        Joystick.joyData = pickle.loads(data)
        print Joystick.joyData[0]

    def getJoyOneYAxis(self):
        #data, addr = s.recvfrom(1024)
	   #print Joystick.joyData[0]
    	return Joystick.joyData[1]
    def getJoyTwoYAxis(self):
        #data, addr = s.recvfrom(1024)
        return Joystick.joyData[2]
    def getButtonVal(self):
        #data, addr = s.recvfrom(1024)
        return Joystick.joyData[3]


text:
'use strict';

/*!
 * Collection
 * https://github.com/kobezzza/Collection
 *
 * Released under the MIT license
 * https://github.com/kobezzza/Collection/blob/master/LICENSE
 */

import { Collection } from '../core';
import { isArray, isFunction } from '../helpers/types';
import { any } from '../helpers/gcc';

/**
 * Returns true if in the collection exists at least one element which matches by the specified condition
 *
 * @see Collection.prototype.forEach
 * @param {($$CollectionFilter|$$CollectionSingleBase)=} [opt_filter] - function filter or an array of functions
 * @param {?$$CollectionSingleBase=} [opt_params] - additional parameters
 * @return {(boolean|!Promise<boolean>)}
 */
Collection.prototype.some = function (opt_filter, opt_params) {
	let p = opt_params || {};

	if (!isArray(opt_filter) && !isFunction(opt_filter)) {
		p = opt_filter || p;
		opt_filter = null;
	}

	this._initParams(p, opt_filter);
	p = any(Object.assign(Object.create(this.p), p, {mult: false, result: false}));

	const
		returnVal = any(this.forEach(() => p.result = true, p));

	if (returnVal !== this) {
		return returnVal;
	}

	return p.result;
};


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wz_comments', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('page_id', false, true)->comment('页面ID');
            $table->integer('user_id', false, true)->comment('评论人');
            $table->text('content')->nullable()->comment('评论内容');
            $table->integer('reply_to_id', false, true)->comment('回复的ID');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wz_comments');
    }
}


text:
package org.hisp.dhis.option;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

import org.apache.commons.collections4.CollectionUtils;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.IdScheme;
import org.hisp.dhis.common.MetadataObject;
import org.hisp.dhis.common.ValueType;
import org.hisp.dhis.common.VersionedObject;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

/**
 * @author Lars Helge Overland
 */
@JacksonXmlRootElement( localName = "optionSet", namespace = DxfNamespaces.DXF_2_0 )
public class OptionSet
    extends BaseIdentifiableObject
    implements VersionedObject, MetadataObject
{
    private List<Option> options = new ArrayList<>();

    private ValueType valueType;

    private int version;

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    public OptionSet()
    {
    }

    public OptionSet( String name, ValueType valueType )
    {
        this.name = name;
        this.valueType = valueType;
    }

    public OptionSet( String name, ValueType valueType, List<Option> options )
    {
        this.name = name;
        this.valueType = valueType;
        this.options = options;
    }

    // -------------------------------------------------------------------------
    // Logic
    // -------------------------------------------------------------------------

    public void addOption( Option option )
    {
        if ( option.getSortOrder() == null )
        {
            this.options.add( option );
        }
        else
        {
            boolean added = false;
            final int size = this.options.size();
            for ( int i = 0; i < size; i++ )
            {
                Option thisOption = this.options.get( i );
                if ( thisOption.getSortOrder() == null || thisOption.getSortOrder() > option.getSortOrder() )
                {
                    this.options.add( i, option );
                    added = true;
                    break;
                }
            }
            if ( !added )
            {
                this.options.add( option );
            }
        }
        option.setOptionSet( this );
    }

    public void removeAllOptions()
    {
        options.clear();
    }

    public void removeOption( Option option )
    {
        if ( !CollectionUtils.isEmpty( options ) )
        {
            options.remove( option );
        }
    }

    @Override
    public int increaseVersion()
    {
        return ++version;
    }

    public boolean hasAllOptions( Collection<String> optionCodes )
    {
        for ( String code : optionCodes )
        {
            if ( getOptionByCode( code ) == null )
            {
                return false;
            }
        }
        return true;
    }

    public List<String> getOptionValues()
    {
        return options.stream().filter( Objects::nonNull ).map( Option::getName ).collect( Collectors.toList() );
    }

    public List<String> getOptionCodes()
    {
        return options.stream().filter( Objects::nonNull ).map( Option::getCode ).collect( Collectors.toList() );
    }

    public Set<String> getOptionCodesAsSet()
    {
        return options.stream().filter( Objects::nonNull ).map( Option::getCode ).collect( Collectors.toSet() );
    }

    public Option getOptionByCode( String code )
    {
        for ( Option option : options )
        {
            if ( option != null && option.getCode().equals( code ) )
            {
                return option;
            }
        }

        return null;
    }

    public Option getOptionByUid( String uid )
    {
        for ( Option option : options )
        {
            if ( option != null && option.getUid().equals( uid ) )
            {
                return option;
            }
        }

        return null;
    }

    public Map<String, String> getOptionCodePropertyMap( IdScheme idScheme )
    {
        return options.stream().filter( Objects::nonNull )
            .collect( Collectors.toMap( Option::getCode, o -> o.getPropertyValue( idScheme ) ) );
    }

    // -------------------------------------------------------------------------
    // Getters and setters
    // -------------------------------------------------------------------------

    @JsonProperty
    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
    @JacksonXmlElementWrapper( localName = "options", namespace = DxfNamespaces.DXF_2_0 )
    @JacksonXmlProperty( localName = "option", namespace = DxfNamespaces.DXF_2_0 )
    public List<Option> getOptions()
    {
        return options;
    }

    @JsonSetter( contentNulls = Nulls.SKIP )
    public void setOptions( List<Option> options )
    {
        this.options = options;
    }

    @JsonProperty
    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
    public ValueType getValueType()
    {
        return valueType;
    }

    public void setValueType( ValueType valueType )
    {
        this.valueType = valueType;
    }

    @Override
    @JsonProperty
    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
    public int getVersion()
    {
        return version;
    }

    @Override
    public void setVersion( int version )
    {
        this.version = version;
    }

}


text:
package org.apache.maven.report.projectinfo.stubs;

import java.util.Arrays;
import java.util.List;

import org.apache.maven.project.MavenProject;

/**
 * @author ltheussl
 * @version $Id$
 */
public class ModulesStub
    extends ProjectInfoProjectStub
{
    @Override
    protected String getPOM()
    {
        return "modules-plugin-config.xml";
    }

    @Override
    public List<MavenProject> getCollectedProjects()
    {
        return Arrays.<MavenProject>asList( new SubProject1Stub(), new SubProject2Stub() );
    }
}


text:
<?php

if(!defined('BASEPATH'))
exit('No direct script access allowed');

?>

<?php

if(!defined('BASEPATH'))
exit('No direct script access allowed');

//User Management Controller

class User extends CI_Controller{

	function __construct(){
		parent::__construct();
		$this->load->helper('form_helper');
		$this->load->library("Aauth");
	}

	function index(){
		redirect('/');
	}

	function login(){

		if($this->aauth->login($this->input->post('username'), $this->input->post('password'))){
			redirect('dashboard');
		} else{
			$data['error'] = 'login_error';
			$this->load->view('user/login_view', @$data);
		}
	}
	public function logout(){

		$this->aauth->logout();
		redirect('/');
	}

	public function pm(){
		if($this->input->post('msg')&&$this->input->post('sendto')&&$this->input->post('subject')){
			//var_dump($this->aauth->get_user()->id.'  '.$sendto);
			$res=$this->aauth->send_pm($this->aauth->get_user()->id,$this->input->post('sendto'),$this->input->post('subject'),$this->input->post('msg'));
			//$res=$this->aauth->send_pm(2,1,'Hi bro. i need you',' can you gimme your credit card?');
			if($res){
				$this->load->view('alerts/success',array('msg'=>'Message Sent'));
				echo '

';
				//echo $this->aauth->hash_password('Damith', 1);

			}
			else{
				//var_dump();
				$this->load->view('alerts/error',array('msg'=>$this->aauth->get_errors_array()[0]));
				echo '

';
			}
		}
		else{
			$data['users']=$this->aauth->list_users();
			//var_dump($this->aauth->list_users());
			//$this->aauth->send_pm(2, 3, 'Message subject', 'Msg body');
			$this->load->view('user/pm_compose',$data);
		}

	}
	public function getpm($read=false){
		$data['pms']=$this->aauth->list_pms(50,0,$this->aauth->get_user_id());
		//var_dump($data);
		$this->load->view('user/pm_view',$data);
	}
	public function viewpm($id=1,$delete=false){
		if(!$delete){

			echo '
'.$this->aauth->get_pm($id)[0]->title.'
';
			echo $this->aauth->get_pm($id)[0]->message;
		}
		else{

			$res=$this->aauth->delete_pm($id);
			if($res){
				$this->load->view('alerts/success',array('msg'=>'Message Deleted
'));
			}
			else{
				$this->load->view('alerts/error',array('msg'=>'Message Delete Failed
'));
			}
		}

	}

	public function add(){
		if(!$this->input->post()){

			$this->load->view('user/add');
		}
		else{
			$res=@$this->aauth->create_user($this->input->post('email'), $this->input->post('password'), $this->input->post('username'));
			//$this->aauth->add_member();
			if(!$res)
			{
				$data['msg']=$res;
				$this->load->view('alerts/error',$data);
				echo '

';
			}
			else {
				$data['msg']="User Profile was Successfully Created";
				$this->load->view('alerts/success',$data);
				echo '

';
			}

		}

	}

	public function assign(){
		if(!$this->input->post()){
			$data['groups']=$this->aauth->list_groups();
			$data['priv']=$this->aauth->list_perms();
			$data['users']=$this->aauth->list_users();
			$this->load->view('user/assign',$data);
			//$this->aauth->add_member(2,2);
			//$this->aauth->add_member(2,1);
		}
		else{
			$exgroups=$this->aauth->get_user_groups($this->input->post('id'));
			foreach($exgroups as $exgroup){
				echo $this->aauth->remove_member($this->input->post('id'),$exgroup->id);
				//echo $exgroup->id;
			}
			$this->aauth->assign_company($this->input->post('id'),$this->input->post('department'));

			/*$groups=$this->aauth->get_user_groups($this->input->post('gro'));
			foreach($exgroups as $exroup){
				$this->aauth->remove_member($this->input->post('id'),$exgroup->id);
			}
			*/
			//echo $this->input->post('id')." ".$this->input->post('department');
		//die();
			/*$this->aauth->add_member($this->input->post('id'),$this->input->post('department'));
			//var_dump();*/
			foreach($this->aauth->list_perms() as $experm){
			$query="delete from aauth_perm_to_user where  user_id='".$this->input->post('id')."' and perm_id='".$experm->id."'";
			$this->db->query($query);
			}

			foreach($this->input->post('role') as $perm){
				$act=$this->aauth->allow_user($this->input->post('id'),$perm);
				//echo($perm);
				$this->aauth->print_errors();
				if($act)
				{
					$data['msg']=lang('change_permission');
					$this->load->view('alerts/success',$data);
					echo('

');
				}
				else
				{
					$data['msg']=lang('change_permission');
					$this->load->view('alerts/error',$data);
					echo('

');
				}
			}
			//var_dump($this->aauth->get_user_groups($this->input->post('id')));
			//var_dump($this->aauth->($this->input->post('id')));

		}
	}

	public function add_inst(){

	}
	public function add_perm(){

	}

	public function delete($uid=FALSE)
	{
		//echo $uid;
		//die();
		if($uid==FALSE||$uid==1)
		{
			redirect("/dashboard?error=Cannot Delete Admin");

		}
		else
		{
			$this->aauth->delete_user($uid);
			header('location:'.$_SERVER['HTTP_REFERER']);
		}
	}
	public function test()
	{
		echo $this->aauth->hash_password('ucsc@123',1);
		echo $this->aauth->print_errors();
		echo $this->aauth->print_infos();

	}

}
?>


text:
package org.apache.oodt.commons.spring.postprocessor;

//OODT imports
import org.apache.oodt.commons.spring.SpringSetIdInjectionType;

//Spring imports
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 *
 * @author bfoster
 * @version $Revision$
 *
 *
Describe your class here
.
 */
public class SetIdBeanPostProcessor implements BeanPostProcessor {

    public Object postProcessAfterInitialization(Object bean, String beanName)
            throws BeansException {
        if (bean instanceof SpringSetIdInjectionType) {
          ((SpringSetIdInjectionType) bean).setId(beanName);
        }
        return bean;
    }

    public Object postProcessBeforeInitialization(Object bean, String beanName)
            throws BeansException {
        return bean;
    }

}


text:
set -eu
mkdir -p perl-lib/lib
cp src/perl/*.pm perl-lib/lib
cp src/perl/fill-* src/perl/tab-to-vcf src/perl/vcf-* perl-lib
# Fix naming scheme of package to make Builder happy
sed -i.bak 's/Vcf.pm.  Module/Vcf - Module/' perl-lib/lib/Vcf.pm
cp $RECIPE_DIR/Build.PL perl-lib
cd perl-lib
perl Build.PL
perl ./Build
perl ./Build test
perl ./Build install --installdirs site

chmod +rx $PREFIX/bin/vcf-compare
chmod +rx $PREFIX/bin/fill-an-ac
chmod +rx $PREFIX/bin/vcf-to-tab
chmod +rx $PREFIX/bin/fill-aa
chmod +rx $PREFIX/bin/vcf-convert
chmod +rx $PREFIX/bin/vcf-fix-newlines
chmod +rx $PREFIX/bin/vcf-merge
chmod +rx $PREFIX/bin/fill-ref-md5
chmod +rx $PREFIX/bin/vcf-indel-stats
chmod +rx $PREFIX/bin/vcf-fix-ploidy
chmod +rx $PREFIX/bin/vcf-isec
chmod +rx $PREFIX/bin/vcf-stats
chmod +rx $PREFIX/bin/vcf-subset
chmod +rx $PREFIX/bin/vcf-phased-join
chmod +rx $PREFIX/bin/vcf-query
chmod +rx $PREFIX/bin/vcf-consensus
chmod +rx $PREFIX/bin/vcf-shuffle-cols
chmod +rx $PREFIX/bin/vcf-validator
chmod +rx $PREFIX/bin/vcf-contrast
chmod +rx $PREFIX/bin/vcf-haplotypes
chmod +rx $PREFIX/bin/vcf-tstv
chmod +rx $PREFIX/bin/vcf-sort
chmod +rx $PREFIX/bin/vcf-concat
chmod +rx $PREFIX/bin/vcf-annotate
chmod +rx $PREFIX/bin/tab-to-vcf
chmod +rx $PREFIX/bin/fill-fs


text:
for ip in  `cat /letv/cloudland/app_jobs/build-cluster/ip-list-cloud.txt`

do

  echo 'IP is: '$ip

  rsync -avz /etc/hosts root@$ip:/etc/hosts

done


text:
<?php
/*!
* Hybridauth
* https://hybridauth.github.io | https://github.com/hybridauth/hybridauth
*  (c) 2017 Hybridauth authors | https://hybridauth.github.io/license.html
*/

namespace Hybridauth\Provider;

use Hybridauth\Adapter\OAuth2;
use Hybridauth\Exception\UnexpectedApiResponseException;
use Hybridauth\Data;
use Hybridauth\User;

/**
 * StackExchange OAuth2 provider adapter.
 *
 * Example:
 *
 *   $config = [
 *       'callback' => Hybridauth\HttpClient\Util::getCurrentUrl(),
 *       'keys' => ['id' => '', 'secret' => ''],
 *       'site' => 'stackoverflow' // required parameter to call getUserProfile()
 *       'api_key' => '...' // that thing to receive a higher request quota.
 *   ];
 *
 *   $adapter = new Hybridauth\Provider\StackExchange($config);
 *
 *   try {
 *       $adapter->authenticate();
 *
 *       $userProfile = $adapter->getUserProfile();
 *       $tokens = $adapter->getAccessToken();
 *   } catch (\Exception $e ){
 *       echo $e->getMessage() ;
 *   }
 */
class StackExchange extends OAuth2
{
    /**
     * {@inheritdoc}
     */
    protected $scope = null;

    /**
     * {@inheritdoc}
     */
    protected $apiBaseUrl = 'https://api.stackexchange.com/2.2/';

    /**
     * {@inheritdoc}
     */
    protected $authorizeUrl = 'https://stackexchange.com/oauth';

    /**
     * {@inheritdoc}
     */
    protected $accessTokenUrl = 'https://stackexchange.com/oauth/access_token';

    /**
     * {@inheritdoc}
     */
    protected $apiDocumentation = 'https://api.stackexchange.com/docs/authentication';

    /**
     * {@inheritdoc}
     */
    protected function initialize()
    {
        parent::initialize();

        $apiKey = $this->config->get('api_key');

        $this->apiRequestParameters = ['key' => $apiKey];
    }

    /**
     * {@inheritdoc}
     */
    public function getUserProfile()
    {
        $site = $this->config->get('site');

        $response = $this->apiRequest('me', 'GET', [
            'site' => $site,
            'access_token' => $this->getStoredData('access_token'),
        ]);

        if (!$response || !isset($response->items) || !isset($response->items[0])) {
            throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
        }

        $data = new Data\Collection($response->items[0]);

        $userProfile = new User\Profile();

        $userProfile->identifier = strval($data->get('user_id'));
        $userProfile->displayName = $data->get('display_name');
        $userProfile->photoURL = $data->get('profile_image');
        $userProfile->profileURL = $data->get('link');
        $userProfile->region = $data->get('location');
        $userProfile->age = $data->get('age');

        return $userProfile;
    }
}


text:
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}

-- |
-- Module      :  Pact.Types.Advice
-- Copyright   :  (C) 2021 Stuart Popejoy
-- License     :  BSD-style (see the file LICENSE)
-- Maintainer  :  Stuart Popejoy <stuart@kadena.io>
--
-- Advise user functions in runtime for performance, coverage etc.
--

module Pact.Types.Advice
  ( Advice(..)
  , AdviceContext(..)
  , advise
  , DbContext(..)
  , advisePactDb
  ) where

import Control.Monad.IO.Class
import Data.Default
import Data.Text (Text)

import Pact.Types.Hash
import Pact.Types.Info
import Pact.Types.Persistence
import Pact.Types.Term

-- | Enum indicating which Db operation is running.
data DbContext =
    DbRead
  | DbWrite
  | DbKeys
  | DbTxIds
  | DbCreateUserTable
  | DbGetUserTableInfo
  | DbBeginTx
  | DbCommitTx
  | DbRollbackTx
  | DbGetTxLog
  deriving (Eq,Show,Enum,Bounded)

-- | Type of advised operation. GADT indicates the "intermediate return value" type of
-- the bracketed operation.
data AdviceContext r where
    -- | Advise on user function, return result
    AdviceUser :: !(Def Ref,[Term Name]) -> AdviceContext (Term Name)
    -- | Advise on native, return result
    AdviceNative :: !NativeDefName -> AdviceContext (Term Name)
    -- | Transaction execution wrapper
    AdviceTx :: !PactHash -> AdviceContext ()
    -- | Db operation
    AdviceDb :: !DbContext -> AdviceContext ()
    -- | Module or interface install/upgrade, returns loaded module data.
    AdviceModule :: !(ModuleDef (Term Name)) -> AdviceContext (ModuleData Ref)
    -- | Arbitrary advice.
    AdviceOther :: !Text -> AdviceContext Text

instance Show (AdviceContext r) where
  show AdviceUser {} = "AdviceUser"
  show AdviceNative {} = "AdviceNative"
  show AdviceTx {} = "AdviceTx"
  show AdviceDb {} = "AdviceDb"
  show AdviceModule {} = "AdviceModule"
  show AdviceOther {} = "AdviceOther"

-- | Bracket some Pact operation.
newtype Advice = Advice {
  -- | Callback for advising a pact operation. '_advise i ctx op'
  -- gives source info in 'i', advice context in 'ctx', and 'op'
  -- as the bracketed action. The implementation is expected to
  -- execute 'op' whose return value '(r,a)' contains the ultimate
  -- return value in 'a', with 'r' available for inspection.
  _advise :: forall m r a . MonadIO m
    => Info
    -> AdviceContext r
    -> m (r, a)
    -> m a
  }

instance Default Advice where def = Advice defAdvice
instance Show Advice where show _ = "Advice"
instance Semigroup Advice where
  Advice f <> Advice g =
    Advice $ \i ctx act -> f i ctx $! g i ctx $ do
      (r,a) <- act
      return (r,(r,a))
instance Monoid Advice where
  mempty = def

advise :: MonadIO m => Info -> Advice -> AdviceContext r -> m (r,a) -> m a
advise i (Advice f) ctx act = f i ctx act

defAdvice :: MonadIO m => Info -> AdviceContext r -> m (r,a) -> m a
defAdvice _ _ a = snd <$> a
{-# INLINE defAdvice #-}

-- | Instrument some 'PactDb' with advice.
advisePactDb :: Advice -> PactDb a -> PactDb a
advisePactDb pt PactDb{..} = PactDb
  { _readRow = \d k e -> perf' DbRead $ _readRow d k e
  , _writeRow = \w d k v e -> perf' DbWrite $ _writeRow w d k v e
  , _keys = \d e -> perf' DbKeys $ _keys d e
  , _txids = \t i e -> perf' DbTxIds $ _txids t i e
  , _createUserTable = \t m e -> perf' DbCreateUserTable $ _createUserTable t m e
  , _getUserTableInfo = \t e -> perf' DbGetUserTableInfo $ _getUserTableInfo t e
  , _beginTx = \m e -> perf' DbBeginTx $ _beginTx m e
  , _commitTx = \e -> perf' DbCommitTx $ _commitTx e
  , _rollbackTx = \e -> perf' DbRollbackTx $ _rollbackTx e
  , _getTxLog = \d i e -> perf' DbGetTxLog $ _getTxLog d i e
  }
  where
    perf' :: DbContext -> IO a -> IO a
    perf' t act = advise def pt (AdviceDb t) $ ((),) <$> act


text:
/* eslint-disable require-jsdoc */

const Constants = require('../constants');
const {Baidu, BrowserId, OperaMini, Puffin, UCBrowserNew, UCBrowserOld, Useragent, Wap} = require('./Header/');

class Header {
  static analyseHeaders() {
    /* Analyse the main useragent header */
    let header;
    if ((header = Header.getHeader.call(this, 'User-Agent'))) {
      Header.analyseUserAgent.call(this, header);
    }

    /* Analyse secondary useragent headers */

    if ((header = Header.getHeader.call(this, 'X-Original-User-Agent'))) {
      Header.additionalUserAgent.call(this, header);
    }

    if ((header = Header.getHeader.call(this, 'X-Device-User-Agent'))) {
      Header.additionalUserAgent.call(this, header);
    }

    if ((header = Header.getHeader.call(this, 'Device-Stock-UA'))) {
      Header.additionalUserAgent.call(this, header);
    }

    if ((header = Header.getHeader.call(this, 'X-OperaMini-Phone-UA'))) {
      Header.additionalUserAgent.call(this, header);
    }

    if ((header = Header.getHeader.call(this, 'X-UCBrowser-Device-UA'))) {
      Header.additionalUserAgent.call(this, header);
    }

    /* Analyse browser specific headers */

    if ((header = Header.getHeader.call(this, 'X-OperaMini-Phone'))) {
      Header.analyseOperaMiniPhone.call(this, header);
    }

    if ((header = Header.getHeader.call(this, 'X-UCBrowser-Phone-UA'))) {
      Header.analyseOldUCUserAgent.call(this, header);
    }

    if ((header = Header.getHeader.call(this, 'X-UCBrowser-UA'))) {
      Header.analyseNewUCUserAgent.call(this, header);
    }

    if ((header = Header.getHeader.call(this, 'X-Puffin-UA'))) {
      Header.analysePuffinUserAgent.call(this, header);
    }

    if ((header = Header.getHeader.call(this, 'Baidu-FlyFlow'))) {
      Header.analyseBaiduHeader.call(this, header);
    }

    /* Analyse Android WebView browser ids */

    if ((header = Header.getHeader.call(this, 'X-Requested-With'))) {
      Header.analyseBrowserId.call(this, header);
    }

    /* Analyse WAP profile header */

    if ((header = Header.getHeader.call(this, 'X-Wap-Profile'))) {
      Header.analyseWapProfile.call(this, header);
    }

    return this;
  }

  static analyseUserAgent(header) {
    new Useragent(header, this.data, this.options);
  }

  static analyseBaiduHeader(header) {
    new Baidu(header, this.data);
  }

  static analyseOperaMiniPhone(header) {
    new OperaMini(header, this.data);
  }

  static analyseBrowserId(header) {
    new BrowserId(header, this.data);
  }

  static analysePuffinUserAgent(header) {
    new Puffin(header, this.data);
  }

  static analyseNewUCUserAgent(header) {
    new UCBrowserNew(header, this.data);
  }

  static analyseOldUCUserAgent(header) {
    new UCBrowserOld(header, this.data);
  }

  static analyseWapProfile(header) {
    new Wap(header, this.data);
  }

  static additionalUserAgent(ua) {
    const Parser = require('../Parser');
    const extra = new Parser(ua);

    if (extra.device.type !== Constants.deviceType.DESKTOP) {
      if (extra.os.name) {
        this.data.os = extra.os;
      }

      if (extra.device.identified) {
        this.data.device = extra.device;
      }
    }
  }

  static getHeader(h) {
    /* Find the header that matches */
    for (let header of Object.keys(this.headers)) {
      if (h.toLowerCase() === header.toLowerCase()) {
        /* And return the first 1024 bytes */
        return (this.headers[header] || '').substring(0, 1024);
      }
    }
  }
}

module.exports = Header;


text:
package server

import (
	"os"
	"reflect"
	"testing"

	"k8s.io/apimachinery/pkg/apimachinery/announced"
	"k8s.io/apimachinery/pkg/apimachinery/registered"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/apiserver/pkg/apis/example"
	exampleinstall "k8s.io/apiserver/pkg/apis/example/install"
	examplev1 "k8s.io/apiserver/pkg/apis/example/v1"
	"k8s.io/apiserver/pkg/storage/storagebackend"
)

var (
	registry = registered.NewOrDie(os.Getenv("KUBE_API_VERSIONS"))
	announce = make(announced.APIGroupFactoryRegistry)
)

func init() {
	exampleinstall.Install(announce, registry, scheme)
}

type fakeNegotiater struct {
	serializer, streamSerializer runtime.Serializer
	framer                       runtime.Framer
	types, streamTypes           []string
}

func (n *fakeNegotiater) SupportedMediaTypes() []runtime.SerializerInfo {
	var out []runtime.SerializerInfo
	for _, s := range n.types {
		info := runtime.SerializerInfo{Serializer: n.serializer, MediaType: s, EncodesAsText: true}
		for _, t := range n.streamTypes {
			if t == s {
				info.StreamSerializer = &runtime.StreamSerializerInfo{
					EncodesAsText: true,
					Framer:        n.framer,
					Serializer:    n.streamSerializer,
				}
			}
		}
		out = append(out, info)
	}
	return out
}

func (n *fakeNegotiater) UniversalDeserializer() runtime.Decoder {
	return n.serializer
}

func (n *fakeNegotiater) EncoderForVersion(serializer runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder {
	return n.serializer
}

func (n *fakeNegotiater) DecoderToVersion(serializer runtime.Decoder, gv runtime.GroupVersioner) runtime.Decoder {
	return n.serializer
}

func TestDefaultStorageFactory(t *testing.T) {
	ns := &fakeNegotiater{types: []string{"test/test"}}
	f := NewDefaultStorageFactory(storagebackend.Config{}, "test/test", ns, NewDefaultResourceEncodingConfig(registry), NewResourceConfig())
	f.AddCohabitatingResources(example.Resource("test"), schema.GroupResource{Resource: "test2", Group: "2"})
	called := false
	testEncoderChain := func(e runtime.Encoder) runtime.Encoder {
		called = true
		return e
	}
	f.AddSerializationChains(testEncoderChain, nil, example.Resource("test"))
	f.SetEtcdLocation(example.Resource("*"), []string{"/server2"})
	f.SetEtcdPrefix(example.Resource("test"), "/prefix_for_test")

	config, err := f.NewConfig(example.Resource("test"))
	if err != nil {
		t.Fatal(err)
	}
	if config.Prefix != "/prefix_for_test" || !reflect.DeepEqual(config.ServerList, []string{"/server2"}) {
		t.Errorf("unexpected config %#v", config)
	}
	if !called {
		t.Errorf("expected encoder chain to be called")
	}
}

func TestUpdateEtcdOverrides(t *testing.T) {
	registry := registered.NewOrDie(os.Getenv("KUBE_API_VERSIONS"))
	announced := make(announced.APIGroupFactoryRegistry)
	exampleinstall.Install(announced, registry, scheme)

	testCases := []struct {
		resource schema.GroupResource
		servers  []string
	}{
		{
			resource: schema.GroupResource{Group: example.GroupName, Resource: "resource"},
			servers:  []string{"http://127.0.0.1:10000"},
		},
		{
			resource: schema.GroupResource{Group: example.GroupName, Resource: "resource"},
			servers:  []string{"http://127.0.0.1:10000", "http://127.0.0.1:20000"},
		},
		{
			resource: schema.GroupResource{Group: example.GroupName, Resource: "resource"},
			servers:  []string{"http://127.0.0.1:10000"},
		},
	}

	defaultEtcdLocation := []string{"http://127.0.0.1"}
	for i, test := range testCases {
		defaultConfig := storagebackend.Config{
			Prefix:     "/registry",
			ServerList: defaultEtcdLocation,
			Copier:     scheme,
		}
		storageFactory := NewDefaultStorageFactory(defaultConfig, "", codecs, NewDefaultResourceEncodingConfig(registry), NewResourceConfig())
		storageFactory.SetEtcdLocation(test.resource, test.servers)

		var err error
		config, err := storageFactory.NewConfig(test.resource)
		if err != nil {
			t.Errorf("%d: unexpected error %v", i, err)
			continue
		}
		if !reflect.DeepEqual(config.ServerList, test.servers) {
			t.Errorf("%d: expected %v, got %v", i, test.servers, config.ServerList)
			continue
		}

		config, err = storageFactory.NewConfig(schema.GroupResource{Group: examplev1.GroupName, Resource: "unlikely"})
		if err != nil {
			t.Errorf("%d: unexpected error %v", i, err)
			continue
		}
		if !reflect.DeepEqual(config.ServerList, defaultEtcdLocation) {
			t.Errorf("%d: expected %v, got %v", i, defaultEtcdLocation, config.ServerList)
			continue
		}

	}
}


text:
<?php

$db = new pdo('sqlite::memory:');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$db->query('CREATE TABLE IF NOT EXISTS foobar (id INT AUTO INCREMENT, name TEXT)');

$db->query('INSERT INTO foobar VALUES (NULL, "1")');
$db->query('INSERT INTO foobar VALUES (NULL, "2")');
$db->query('INSERT INTO foobar VALUES (NULL, "10")');

$db->sqliteCreateCollation('MYCOLLATE', function($a, $b) { return strnatcmp($a, $b); });

$result = $db->query('SELECT name FROM foobar ORDER BY name COLLATE MYCOLLATE');
foreach ($result as $row) {
	echo $row['name'] . "\n";
}

$result = $db->query('SELECT name FROM foobar ORDER BY name');
foreach ($result as $row) {
  echo $row['name'] . "\n";
}

$db->query('DROP TABLE foobar');

?>


text:
package polyfunic.backend

import polyfunic._

case object LaTeX {

  def branchPoint( branches : Int ) : String => String = branches match {
    case 0 => (s => "\\AxiomC{" + s + "}" )
    case 1 => (s => "\\UnaryInfC{" + s + "}" )
    case 2 => (s => "\\BinaryInfC{" + s + "}" )
    case 3 => (s => "\\TrinaryInfC{" + s + "}" ) // should be ternary, but bussproofs :(
    case 4 => (s => "\\QuaternaryInfC{" + s + "}" )
    case 5 => (s => "\\QuinaryInfC{" + s + "}" )
    case _ => throw new Exception("This backend does not support superquinary inference rules")
  }

  def name(t : ScalaType) : String = t match {
    case Fun(Nil,b)     => name(b)
    case Fun(List(a),b) => name(a) + "\\rightarrow " + name(b)
    case Fun(as,b)      => "(" + (as.map(name) mkString ",") + ")\\rightarrow " + name(b)
    case Named(n)       => n.toUpperCase
  }

  def sequent( s : SequentLike ) : String = "$" + s.lhs.map(name).mkString(",") + "\\vdash " + name(s.rhs) + "$"

  def rightLabel(t : ScalaType, ix : Int) : String = "\\RightLabel{\\scriptsize($" + name(t) + "-R_{" + ix + "}$)}"
  def rightLabel(t : ScalaType) : String = "\\RightLabel{\\scriptsize($" + name(t) + "-R$)}"
  val rightLabelFun : String = "\\RightLabel{\\scriptsize($\\rightarrow -R$)}"
  def leftLabel(t : ScalaType) : String = "\\RightLabel{\\scriptsize($" + name(t) + "-L$)}"
  val leftLabelFun : String = "\\RightLabel{\\scriptsize($\\rightarrow -L$)}"

  def body( pt : ProofTreeLike ) : List[String] = pt.branches.flatMap(body) ++ (pt match {
    case (pt : ProofTreeRightNamed) =>
      List( rightLabel(pt.root.rhs, pt.idx)
          , branchPoint(pt.branches.size)( sequent(pt.root) )
          )
    case (pt : ProofTreeRightFun)   =>
      List( rightLabelFun
          , branchPoint(pt.branches.size)( sequent(pt.root) )
          )
    case (pt : ProofTree)           =>
      List( pt.root.focus match { case (t : Named) => leftLabel(t); case _ => leftLabelFun }
          , branchPoint(pt.branches.size)( sequent(pt.root) )
          )
    case (pt : ProofTreeAxiom)      =>
      List( branchPoint(pt.branches.size)( sequent(pt.root) )
          )
  })

  /**
   * Generates LaTeX/bussproofs output from the given proof tree.
   */
  def apply( pt : ProofTreeLike ) : String = "\\begin{prooftree}\n" + (body(pt) mkString "\n") + "\n\\end{prooftree}"

}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
   <item android:state_selected="true" android:drawable="@drawable/ic_menu_more_pressed" />
   <item android:state_pressed="true" android:state_selected="false" android:drawable="@drawable/ic_menu_more_pressed" />
   <item android:state_selected="false" android:drawable="@drawable/ic_menu_more" />
</selector>


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using namasdev.Tipos;
using System.Collections.Generic;

namespace namasdev.Core.UnitTests.Tipos
{
    [TestClass]
    public class StringExtensionesTest
    {
        private const string CADENA_CON_ACENTOS_Y_ESPECIALES = "aáä eéë iíï oóö uúü ñ AÁÄ EÉË IÍÏ OÓÖ UÚÜ Ñ";
        private const string CADENA_SIN_ACENTOS_Y_ESPECIALES = "aaa eee iii ooo uuu n AAA EEE III OOO UUU N";

        private const string CADENA_CON_CARACTERES_NO_ALFANUMERICOS = "0aA¡!¿?+_-|.,:bB1";
        private const string CADENA_SIN_CARACTERES_NO_ALFANUMERICOS = "0aAbB1";

        private const string CADENA = "abcde12345";
        private const string SUFIJO_TRUNCADO = "...";

        private const string SEPARADOR_CLAVE_VALOR = ": ";
        private const string SEPARADOR_ITEM = ", ";

        private const string CADENA_SIN_CAPITALIZACION = "aAbB Cc. d'D";
        private const string CADENA_CON_CAPITALIZACION = "Aabb Cc. D'd";

        #region ReemplazarAcentosYCaracteresEspecialesPorEquivalentes

        [TestMethod]
        public void ReemplazarAcentosYCaracteresEspecialesPorEquivalentes_ValorNullOCadenaVaciaOEspacios_DevuelveCadenaVacia()
        {
            string stringNull = null;
            string resNull = stringNull.ReemplazarAcentosYCaracteresEspecialesPorEquivalentes();

            string resCadenaVacia = String.Empty.ReemplazarAcentosYCaracteresEspecialesPorEquivalentes();
            string resEspacios = "    ".ReemplazarAcentosYCaracteresEspecialesPorEquivalentes();

            Assert.AreEqual(
                expected: String.Empty,
                actual: resNull,
                message: "null");

            Assert.AreEqual(
                expected: String.Empty,
                actual: resCadenaVacia,
                message: "String.Empty");

            Assert.AreEqual(
                expected: String.Empty,
                actual: resEspacios,
                message: "Espacios");
        }

        [TestMethod]
        public void ReemplazarAcentosYCaracteresEspecialesPorEquivalentes_ValorConAcentosYCaracteresEspeciales_ResultadoOk()
        {
            string res = CADENA_CON_ACENTOS_Y_ESPECIALES.ReemplazarAcentosYCaracteresEspecialesPorEquivalentes();

            Assert.AreEqual(
                expected: CADENA_SIN_ACENTOS_Y_ESPECIALES,
                actual: res);
        }

        [TestMethod]
        public void ReemplazarAcentosYCaracteresEspecialesPorEquivalentes_ValorSinAcentosYCaracteresEspeciales_ResultadoOk()
        {
            string res = CADENA_SIN_ACENTOS_Y_ESPECIALES.ReemplazarAcentosYCaracteresEspecialesPorEquivalentes();

            Assert.AreEqual(
                expected: CADENA_SIN_ACENTOS_Y_ESPECIALES,
                actual: res);
        }

        #endregion

        #region QuitarCaracteresNoAlfanumericos

        [TestMethod]
        public void QuitarCaracteresNoAlfanumericos_ValorNullOCadenaVaciaOEspacios_DevuelveCadenaVacia()
        {
            string stringNull = null;
            string resNull = stringNull.QuitarCaracteresNoAlfanumericos();

            string resCadenaVacia = String.Empty.QuitarCaracteresNoAlfanumericos();
            string resEspacios = "    ".QuitarCaracteresNoAlfanumericos();

            Assert.AreEqual(
                expected: String.Empty,
                actual: resNull,
                message: "null");

            Assert.AreEqual(
                expected: String.Empty,
                actual: resCadenaVacia,
                message: "String.Empty");

            Assert.AreEqual(
                expected: String.Empty,
                actual: resEspacios,
                message: "Espacios");
        }

        [TestMethod]
        public void QuitarCaracteresNoAlfanumericos_ValorConCaracteresNoAlfanumericos_ResultadoOk()
        {
            string res = CADENA_CON_CARACTERES_NO_ALFANUMERICOS.QuitarCaracteresNoAlfanumericos();

            Assert.AreEqual(
                expected: CADENA_SIN_CARACTERES_NO_ALFANUMERICOS,
                actual: res);
        }

        [TestMethod]
        public void QuitarCaracteresNoAlfanumericos_ValorSinCaracteresNoAlfanumericos_ResultadoOk()
        {
            string res = CADENA_SIN_CARACTERES_NO_ALFANUMERICOS.QuitarCaracteresNoAlfanumericos();

            Assert.AreEqual(
                expected: CADENA_SIN_CARACTERES_NO_ALFANUMERICOS,
                actual: res);
        }

        #endregion

        #region Truncar

        [TestMethod]
        public void Truncar_ValorNullOCadenaVaciaOEspacios_DevuelveCadenaVacia()
        {
            ushort tamaño = 10;

            string stringNull = null;
            string resNull = stringNull.Truncar(tamaño);
            string resCadenaVacia = String.Empty.Truncar(tamaño);
            string resEspacios = "    ".Truncar(tamaño);

            Assert.AreEqual(
                expected: String.Empty,
                actual: resNull,
                message: "null");

            Assert.AreEqual(
                expected: String.Empty,
                actual: resCadenaVacia,
                message: "String.Empty");

            Assert.AreEqual(
                expected: String.Empty,
                actual: resEspacios,
                message: "Espacios");
        }

        [TestMethod]
        public void Truncar_TamañoMayorALargoDeCadena_ResultadoOk()
        {
            ushort tamaño = (ushort)(CADENA.Length + 5);

            string res = CADENA.Truncar(tamaño);

            Assert.AreEqual(
                expected: CADENA,
                actual: res);
        }

        [TestMethod]
        public void Truncar_TamañoMenorALargoDeCadena_ResultadoOk()
        {
            ushort tamaño = (ushort)(CADENA.Length);

            string res = (CADENA + CADENA).Truncar(tamaño);

            Assert.AreEqual(
                expected: CADENA,
                actual: res);
        }

        [TestMethod]
        public void Truncar_TamañoIgualALargoDeCadena_ResultadoOk()
        {
            ushort tamaño = (ushort)CADENA.Length;

            string res = CADENA.Truncar(tamaño);

            Assert.AreEqual(
                expected: CADENA,
                actual: res);
        }

        [TestMethod]
        public void Truncar_TamañoMayorALargoDeCadenaYSufijo_ResultadoOk()
        {
            ushort tamaño = (ushort)(CADENA.Length + 5);

            string res = CADENA.Truncar(tamaño,
                sufijo: SUFIJO_TRUNCADO);

            Assert.AreEqual(
                expected: CADENA,
                actual: res);
        }

        [TestMethod]
        public void Truncar_TamañoMenorALargoDeCadenaYSufijo_ResultadoOk()
        {
            ushort tamaño = (ushort)(CADENA.Length);

            string res = (CADENA + CADENA).Truncar(tamaño,
                sufijo: SUFIJO_TRUNCADO);

            Assert.AreEqual(
                expected: CADENA + SUFIJO_TRUNCADO,
                actual: res);
        }

        [TestMethod]
        public void Truncar_TamañoIgualALargoDeCadenaYSufijo_ResultadoOk()
        {
            ushort tamaño = (ushort)CADENA.Length;

            string res = CADENA.Truncar(tamaño,
                sufijo: SUFIJO_TRUNCADO);

            Assert.AreEqual(
                expected: CADENA,
                actual: res);
        }

        #endregion

        #region CrearTextoDesdeDiccionario

        [TestMethod,
        ExpectedException(typeof(ArgumentNullException))]
        public void CrearTextoDesdeDiccionario_DiccionarioNull_ArrojaExcepcion()
        {
            Dictionary<string, string> diccionario = null;
            diccionario.CrearTextoDesdeDiccionario();
        }

        [TestMethod]
        public void CrearTextoDesdeDiccionario_DiccionarioVacio_DevuelveCadenaVacia()
        {
            var diccionario = new Dictionary<string, string>();

            string res = diccionario.CrearTextoDesdeDiccionario();

            Assert.AreEqual(
                expected: String.Empty,
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeDiccionario_DiccionarioCon1Elemento_ResultadoOk()
        {
            string clave = "A",
                valor = "123";

            var diccionario = new Dictionary<string, string>
            {
                { clave, valor }
            };

            string res = diccionario.CrearTextoDesdeDiccionario();

            Assert.AreEqual(
                expected: clave + ": " + valor,
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeDiccionario_DiccionarioCon3Elementos_ResultadoOk()
        {
            string clave1 = "A",
                clave2 = "B",
                clave3 = "C",
                valor1 = "123",
                valor2 = "456",
                valor3 = "789";

            var diccionario = new Dictionary<string, string>
            {
                { clave1, valor1 },
                { clave2, valor2 },
                { clave3, valor3 }
            };

            string res = diccionario.CrearTextoDesdeDiccionario();

            Assert.AreEqual(
                expected: GenerarTextoDiccionario(SEPARADOR_CLAVE_VALOR, SEPARADOR_ITEM, clave1, valor1, clave2, valor2, clave3, valor3),
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeDiccionario_DiccionarioCon3ElementosConSeparadorClaveValorEspecificado_ResultadoOk()
        {
            string clave1 = "A",
                clave2 = "B",
                clave3 = "C",
                valor1 = "123",
                valor2 = "456",
                valor3 = "789",
                separadorClaveValor = ")";

            var diccionario = new Dictionary<string, string>
            {
                { clave1, valor1 },
                { clave2, valor2 },
                { clave3, valor3 }
            };

            string res = diccionario.CrearTextoDesdeDiccionario(
                separadorClaveValor: separadorClaveValor);

            Assert.AreEqual(
                expected: GenerarTextoDiccionario(separadorClaveValor, SEPARADOR_ITEM, clave1, valor1, clave2, valor2, clave3, valor3),
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeDiccionario_DiccionarioCon3ElementosConSeparadorClaveValorYSeparadorItemEspecificados_ResultadoOk()
        {
            string clave1 = "A",
                clave2 = "B",
                clave3 = "C",
                valor1 = "123",
                valor2 = "456",
                valor3 = "789",
                separadorClaveValor = ")",
                separadorItem = ". ";

            var diccionario = new Dictionary<string, string>
            {
                { clave1, valor1 },
                { clave2, valor2 },
                { clave3, valor3 }
            };

            string res = diccionario.CrearTextoDesdeDiccionario(
                separadorClaveValor: separadorClaveValor,
                separadorItemLista: separadorItem);

            Assert.AreEqual(
                expected: GenerarTextoDiccionario(separadorClaveValor, separadorItem, clave1, valor1, clave2, valor2, clave3, valor3),
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeDiccionario_DiccionarioCon3ElementosConSeparadorClaveValorNull_ResultadoOk()
        {
            string clave1 = "A",
                clave2 = "B",
                clave3 = "C",
                valor1 = "123",
                valor2 = "456",
                valor3 = "789",
                separadorClaveValor = null;

            var diccionario = new Dictionary<string, string>
            {
                { clave1, valor1 },
                { clave2, valor2 },
                { clave3, valor3 }
            };

            string res = diccionario.CrearTextoDesdeDiccionario(
                separadorClaveValor: separadorClaveValor);

            Assert.AreEqual(
                expected: GenerarTextoDiccionario(separadorClaveValor, SEPARADOR_ITEM, clave1, valor1, clave2, valor2, clave3, valor3),
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeDiccionario_DiccionarioCon3ElementosConSeparadorClaveValorYSeparadorItemNull_ResultadoOk()
        {
            string clave1 = "A",
                clave2 = "B",
                clave3 = "C",
                valor1 = "123",
                valor2 = "456",
                valor3 = "789",
                separadorClaveValor = null,
                separadorItem = null;

            var diccionario = new Dictionary<string, string>
            {
                { clave1, valor1 },
                { clave2, valor2 },
                { clave3, valor3 }
            };

            string res = diccionario.CrearTextoDesdeDiccionario(
                separadorClaveValor: separadorClaveValor,
                separadorItemLista: separadorItem);

            Assert.AreEqual(
                expected: GenerarTextoDiccionario(separadorClaveValor, separadorItem, clave1, valor1, clave2, valor2, clave3, valor3),
                actual: res);
        }

        private string GenerarTextoDiccionario<TClave, TValor>(string separadorClaveValor, string separadorItem, TClave clave1, TValor valor1, TClave clave2, TValor valor2, TClave clave3, TValor valor3)
        {
            return String.Format("{2}{0}{3}{1}{4}{0}{5}{1}{6}{0}{7}",
                separadorClaveValor, separadorItem,
                clave1, valor1, clave2, valor2, clave3, valor3);
        }

        #endregion

        #region CrearTextoDesdeLista

        [TestMethod,
        ExpectedException(typeof(ArgumentNullException))]
        public void CrearTextoDesdeLista_ListaNull_ArrojaExcepcion()
        {
            List<string> lista = null;
            lista.CrearTextoDesdeLista();
        }

        [TestMethod]
        public void CrearTextoDesdeLista_ListaVacia_DevuelveCadenaVacia()
        {
            var lista = new List<string>();

            string res = lista.CrearTextoDesdeLista();

            Assert.AreEqual(
                expected: String.Empty,
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeLista_ListaCon1Elemento_ResultadoOk()
        {
            string valor = "123";

            var lista = new List<string> { valor };

            string res = lista.CrearTextoDesdeLista();

            Assert.AreEqual(
                expected: valor,
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeLista_ListaCon3Elementos_ResultadoOk()
        {
            string valor1 = "123",
                valor2 = "456",
                valor3 = "789";

            var lista = new List<string> { valor1, valor2, valor3 };

            string res = lista.CrearTextoDesdeLista();

            Assert.AreEqual(
                expected: GenerarTextoLista(SEPARADOR_ITEM, valor1, valor2, valor3),
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeLista_ListaCon3ElementosConSeparadorEspecificado_ResultadoOk()
        {
            string valor1 = "123",
                valor2 = "456",
                valor3 = "789",
                separador = ". ";

            var lista = new List<string> { valor1, valor2, valor3 };

            string res = lista.CrearTextoDesdeLista(
                separador: separador);

            Assert.AreEqual(
                expected: GenerarTextoLista(separador, valor1, valor2, valor3),
                actual: res);
        }

        [TestMethod]
        public void CrearTextoDesdeLista_ListaCon3ElementosVaciosYUnoConValor_DevuelveTextoConUnoSolo()
        {
            string valor1 = "123",
                valor2 = "",
                valor3 = null,
                valor4 = "   ";

            var lista = new List<string> { valor1, valor2, valor3, valor4 };

            string res = lista.CrearTextoDesdeLista(
                eliminarVacios: true);

            Assert.AreEqual(
                expected: valor1,
                actual: res);
        }

        private string GenerarTextoLista<T>(string separadorItem, T valor1, T valor2, T valor3)
        {
            return String.Format("{1}{0}{2}{0}{3}",
                separadorItem,
                valor1, valor2, valor3);
        }

        #endregion

        #region Capitalizar

        [TestMethod,
        ExpectedException(typeof(ArgumentNullException))]
        public void Capitalizar_ValorNull_ArrojaExcepcion()
        {
            string stringNull = null;
            stringNull.Capitalizar();
        }

        [TestMethod]
        public void Capitalizar_ValorCadenaVacia_DevuelveCadenaVacia()
        {
            string res = String.Empty.Capitalizar();

            Assert.AreEqual(
                expected: String.Empty,
                actual: res);
        }

        [TestMethod]
        public void Capitalizar_ValorCadenaSinCapitalizacion_ResultadoOk()
        {
            string res = CADENA_SIN_CAPITALIZACION.Capitalizar();

            Assert.AreEqual(
                expected: CADENA_CON_CAPITALIZACION,
                actual: res);
        }

        [TestMethod]
        public void Capitalizar_ValorCadenaConCapitalizacion_DevuelveMismaCadena()
        {
            string res = CADENA_CON_CAPITALIZACION.Capitalizar();

            Assert.AreEqual(
                expected: CADENA_CON_CAPITALIZACION,
                actual: res);
        }

        #endregion
    }
}


text:
import ApplicationSerializer from './application';

export default ApplicationSerializer.extend({

  serialize(...args) {
    const json = ApplicationSerializer.prototype.serialize.apply(this, args);

    return {
      waivers: json.waives,
      totalRecords: json.waives.length,
    };
  }
});


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>FreeCodeCamp | Map Data Across the Globe</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <link rel="stylesheet" href="dist/mapdata.css">

Meteorite Landings

Scroll to zoom in/out, click to drag

    <canvas width="960" height="500"></canvas>

Built by Zack Ward. Source on GitHub.


text:
package jj.execution;

import java.util.concurrent.TimeUnit;

import jj.execution.DelayedExecutor.CancelKey;

/**
 * @author jason
 *
 */
public abstract class DelayedTask<ExecutionType extends DelayedExecutor> extends JJTask<ExecutionType> {

	protected DelayedTask(String name) {
		super(name);
	}

	protected long delay() {
		return 0;
	}

	// package friendly for testing.
	/** DON'T TOUCH THIS */
	volatile CancelKey cancelKey;

	protected void addRunnableToExecutor(ExecutionType executor, Runnable runnable) {
		cancelKey = executor.submit(runnable, delay(), TimeUnit.MILLISECONDS);
	}

	public CancelKey cancelKey() {
		return cancelKey;
	}

	private volatile boolean willRepeat = false;

	/**
	 * invoke this during the run if the task should be
	 * scheduled again
	 */
	protected final void repeat() {
		willRepeat = true;
		promise().then(this);
	}

	public boolean willRepeat() {
		return willRepeat;
	}
}