text:
#ifndef POLYGRAPH__PGL_PGLSEMX_H
#define POLYGRAPH__PGL_PGLSEMX_H

#include "xstd/Array.h"
#include "xstd/h/iosfwd.h"
#include "pgl/AddrSchemeSym.h"

class SynSymTblItem;
class TokenSym;
class ParsSym;
class PglCtx;
class IfCodeSym;
class EveryCodeSym;
class ExpressionSym;
class BoolSym;
class IntSym;
class NumSym;
class TimeSym;
class SizeSym;
class StringSym;
class StrRangeSym;
class ListSym;
class ContainerSym;
class ArraySym;
class NetAddrSym;
class NetAddrRangeSym;
class QualifSym;
class DistrSym;
class DynamicNameSym;
class MimeHeaderSym;
class PopDistrSym;
class RegExSym;

// interprets parsed PGL text
// kids interpret locale/mode-specific code such as use() function calls
class PglSemx {
	public:
		PglSemx();
		virtual ~PglSemx();

		virtual void interpret(const SynSym &s);
		static void WorkerId(int wokerId);
		static const char* WorkerIdStr();

	protected:
		void interpCode(const ParsSym &pgl);

		void interpStatementSeq(const ParsSym &pgl);
		void interpStatement(const ParsSym &pgl);

		void interpSimpleStatement(const ParsSym &pgl);

		void interpExprStatement(const ParsSym &pgl);
		void interpDeclStatement(const ParsSym &pgl);
		void interpPureDecl(const ParsSym &pgl);
		void interpCodeInitDecl(const ParsSym &pgl);
		void interpExprInitDecl(const ParsSym &pgl);

		void interpAssignment(const ParsSym &pgl);

		ExpressionSym *makeExpression(const ParsSym &pgl);
		ExpressionSym *makeBinExpr(const ExpressionSym &exp1,
			const TokenSym &op, const ExpressionSym &exp2);

		ExpressionSym *makeQuotedConstant(const TokenSym &s);
		ExpressionSym *makeTypedConst(const ParsSym &pgl);
		BoolSym *makeBool(const TokenSym &s);
		IntSym *makeInt(const TokenSym &s);
		NumSym *makeNum(const TokenSym &s);
		TimeSym *makeTime(const TokenSym &s);
		SizeSym *makeSize(const TokenSym &s);
		ExpressionSym *makeString(const TokenSym &s);
		StringSym *makeStringAtom(const TokenSym &s);
		StrRangeSym *makeStringRange(const TokenSym &s);
		NetAddrSym *makeAddrAtom(const TokenSym &s);
		NetAddrRangeSym *makeAddrRange(const TokenSym &s);
		QualifSym *makeQualif(const TokenSym &s);
		MimeHeaderSym *makeMimeHeader(const TokenSym &s);
		RegExSym *makeRegEx(const TokenSym &scopeName, const TokenSym &reSym);

		ListSym *makeList(const ParsSym &pgl);
		ArraySym *makeArray(const ParsSym &pgl, bool ofNames = false);

		ExpressionSym *makeClone(const ExpressionSym &expr, const ExpressionSym &factor);

		void checkArgs(const String &cname, int expCount, const ListSym &args);
		const ExpressionSym &extractArg(const String &cname, int idx, const ListSym &args, const String &type);
		void argsToDouble(const String &cname, const ListSym &argsIn, Array<double> &outa);
		void argsToInt(const String &cname, const ListSym &argsIn, Array<int> &outa);

		ExpressionSym *makeFuncCall(const ParsSym &pgl);
		void interpProcCall(const ParsSym &pgl);
		void interpIfCode(const ParsSym &pgl);
		void interpEveryCode(const ParsSym &pgl);
		virtual void execEveryCode(const EveryCodeSym &ecode);
		virtual ExpressionSym *callFunc(const String &cname, const ListSym &args);
		virtual void callProc(const String &cname, const ListSym &args);
		void noCall(const String &cname, const ListSym &args);

		void openContext(const String &name);
		void closeContext();

		void addListItem(ListSym &list, const ParsSym &expr);
		void addArrayItem(ArraySym &arr, bool ofNames, const ParsSym &expr, double prob = -1.0);

		void assignToOne(const ParsSym &name, const ExpressionSym &expr);
		void assignToEach(const ParsSym &lhs, const ExpressionSym &expr);
		void assignCode(const ParsSym &name, const ParsSym &code);
		void assign(SynSymTblItem *i, const SynSym &newVal, const SrcLoc &loc);

		SynSymTblItem *findDescr(const String &name); // may fail
		SynSymTblItem *getDescr(const String &name, const TokenLoc &loc);
		SynSymTblItem *declare(const String &type, const String &name, const TokenLoc &loc);
		SynSym &getSym(const String &name, const TokenLoc &loc);

		void setDefault(SynSymTblItem *i);
		bool knownType(const String &type);

		ExpressionSym *calcExtreme(const String &cname, const ListSym &args, int dir);
		DistrSym *isDistr(const String &cname, const ListSym &args);
		PopDistrSym *isPopDistr(const String &cname, const ListSym &args);
		bool isToken(const SynSym &s, int tokenId) const;
		bool isToken(const SynSym &s) const;
		bool isRule(const SynSym &s, const char *name) const;
		bool isRule(const SynSym &s) const;

		ArraySym *calcAgentAddrs(const String &cname, const ListSym &args, AddrSchemeSym::AddrCalc calc);
		ArraySym *tracedHosts(const String &cname, const ListSym &args);
		ContainerSym *genCredentials(const String &cname, int count, const String &nameSpace, const TokenLoc &loc);
		ContainerSym *selectItems(const String &cname, const ContainerSym &items, int goalCount, const TokenLoc &loc);
		ContainerSym *setAddrPort(const String &cname, const ContainerSym &items, int newPort, const TokenLoc &loc);
		RegExSym *orItems(const ContainerSym &items);
		DynamicNameSym *dynamicName(const NetAddrSym &addr, const NumSym &prob);
		ContainerSym *dynamize(const String &cname, const ContainerSym &items, const NumSym &prob);
		ostream &print(ostream &os, const ListSym &args, const unsigned int skip = 0);

		String typeName(const ParsSym &pgl) const;
		String objName(const ParsSym &pgl) const;

		SynSym *anyToAny(const SynSym &s, const String &type) const;
		int anyToInt(const SynSym &s) const;
		double anyToDouble(const SynSym &s) const;
		void noCast(const SynSym &s, const String &totype) const;
		void failedCast(const SynSym &s, const String &totype, const String &str) const;

		void mustBeDefined(const ExpressionSym *const expr, const char *const descr, const SrcLoc &defaultLoc = SrcLoc()) const;
		void unknownRhs(const ParsSym &pgl) const;

	protected:
		PglCtx *theCtx;    // current context

		static int TheWorkerId;
		static String TheWorkerIdStr;
};

#endif


text:
FactoryGirl.define do
  factory :imported_file do
    file_name "import.csv"
    modified Time.now.utc
    size 123
    rows 5

    factory :imported_file_with_error do
      error true
      error_msg "This file is junk"
    end
  end

  factory :trip_ticket do
    ch_id 1
    ch_updated_at '1 July 2013 12:00:00 UTC'
    is_originated true
    origin_trip_id 111
    appointment_time '1 August 2013 12:00:00 UTC'
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.spotify.docker.client.messages;

import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.ANY;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Strings.isNullOrEmpty;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.auto.value.AutoValue;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.annotation.Nullable;

@AutoValue
@JsonAutoDetect(fieldVisibility = ANY, getterVisibility = NONE, setterVisibility = NONE)
public abstract class HostConfig {

  @Nullable
  @JsonProperty("Binds")
  public abstract ImmutableList<String> binds();

  @Nullable
  @JsonProperty("BlkioWeight")
  public abstract Integer blkioWeight();

  @Nullable
  @JsonProperty("BlkioWeightDevice")
  public abstract ImmutableList<BlkioWeightDevice> blkioWeightDevice();

  @Nullable
  @JsonProperty("BlkioDeviceReadBps")
  public abstract ImmutableList<BlkioDeviceRate> blkioDeviceReadBps();

  @Nullable
  @JsonProperty("BlkioDeviceWriteBps")
  public abstract ImmutableList<BlkioDeviceRate> blkioDeviceWriteBps();

  @Nullable
  @JsonProperty("BlkioDeviceReadIOps")
  public abstract ImmutableList<BlkioDeviceRate> blkioDeviceReadIOps();

  @Nullable
  @JsonProperty("BlkioDeviceWriteIOps")
  public abstract ImmutableList<BlkioDeviceRate> blkioDeviceWriteIOps();

  @Nullable
  @JsonProperty("ContainerIDFile")
  public abstract String containerIdFile();

  @Nullable
  @JsonProperty("LxcConf")
  public abstract ImmutableList<LxcConfParameter> lxcConf();

  @Nullable
  @JsonProperty("Privileged")
  public abstract Boolean privileged();

  @Nullable
  @JsonProperty("PortBindings")
  public abstract ImmutableMap<String, List<PortBinding>> portBindings();

  @Nullable
  @JsonProperty("Links")
  public abstract ImmutableList<String> links();

  @Nullable
  @JsonProperty("PublishAllPorts")
  public abstract Boolean publishAllPorts();

  @Nullable
  @JsonProperty("Dns")
  public abstract ImmutableList<String> dns();

  @Nullable
  @JsonProperty("DnsOptions")
  public abstract ImmutableList<String> dnsOptions();

  @Nullable
  @JsonProperty("DnsSearch")
  public abstract ImmutableList<String> dnsSearch();

  @Nullable
  @JsonProperty("ExtraHosts")
  public abstract ImmutableList<String> extraHosts();

  @Nullable
  @JsonProperty("GroupAdd")
  public abstract ImmutableList<String> groupAdd();

  @Nullable
  @JsonProperty("VolumesFrom")
  public abstract ImmutableList<String> volumesFrom();

  @Nullable
  @JsonProperty("CapAdd")
  public abstract ImmutableList<String> capAdd();

  @Nullable
  @JsonProperty("CapDrop")
  public abstract ImmutableList<String> capDrop();

  @Nullable
  @JsonProperty("NetworkMode")
  public abstract String networkMode();

  @Nullable
  @JsonProperty("SecurityOpt")
  public abstract ImmutableList<String> securityOpt();

  @Nullable
  @JsonProperty("Devices")
  public abstract ImmutableList<Device> devices();

  @Nullable
  @JsonProperty("Memory")
  public abstract Long memory();

  @Nullable
  @JsonProperty("MemorySwap")
  public abstract Long memorySwap();

  @Nullable
  @JsonProperty("KernelMemory")
  public abstract Long kernelMemory();

  @Nullable
  @JsonProperty("MemorySwappiness")
  public abstract Integer memorySwappiness();

  @Nullable
  @JsonProperty("MemoryReservation")
  public abstract Long memoryReservation();

  @Nullable
  @JsonProperty("NanoCpus")
  public abstract Long nanoCpus();

  @Nullable
  @JsonProperty("CpuPeriod")
  public abstract Long cpuPeriod();

  @Nullable
  @JsonProperty("CpuShares")
  public abstract Long cpuShares();

  @Nullable
  @JsonProperty("CpusetCpus")
  public abstract String cpusetCpus();

  @Nullable
  @JsonProperty("CpusetMems")
  public abstract String cpusetMems();

  @Nullable
  @JsonProperty("CpuQuota")
  public abstract Long cpuQuota();

  @Nullable
  @JsonProperty("CgroupParent")
  public abstract String cgroupParent();

  @Nullable
  @JsonProperty("RestartPolicy")
  public abstract RestartPolicy restartPolicy();

  @Nullable
  @JsonProperty("LogConfig")
  public abstract LogConfig logConfig();

  @Nullable
  @JsonProperty("IpcMode")
  public abstract String ipcMode();

  @Nullable
  @JsonProperty("Ulimits")
  public abstract ImmutableList<Ulimit> ulimits();

  @Nullable
  @JsonProperty("PidMode")
  public abstract String pidMode();

  @Nullable
  @JsonProperty("ShmSize")
  public abstract Long shmSize();

  @Nullable
  @JsonProperty("OomKillDisable")
  public abstract Boolean oomKillDisable();

  @Nullable
  @JsonProperty("OomScoreAdj")
  public abstract Integer oomScoreAdj();

  @Nullable
  @JsonProperty("AutoRemove")
  public abstract Boolean autoRemove();

  /**
   * Tune container pids limit (set -1 for unlimited).
   * Only works for kernels >= 4.3
   * @return An integer indicating the pids limit.
   */
  @Nullable
  @JsonProperty("PidsLimit")
  public abstract Integer pidsLimit();

  @Nullable
  @JsonProperty("Tmpfs")
  public abstract ImmutableMap<String, String> tmpfs();

  @Nullable
  @JsonProperty("ReadonlyRootfs")
  public abstract Boolean readonlyRootfs();

  @Nullable
  @JsonProperty("StorageOpt")
  public abstract ImmutableMap<String, String> storageOpt();

  @Nullable
  @JsonProperty("Runtime")
  public abstract String runtime();

  @JsonCreator
  static HostConfig create(
      @JsonProperty("Binds") final List<String> binds,
      @JsonProperty("BlkioWeight") final Integer blkioWeight,
      @JsonProperty("BlkioWeightDevice") final List<BlkioWeightDevice> blkioWeightDevice,
      @JsonProperty("BlkioDeviceReadBps") final List<BlkioDeviceRate> blkioDeviceReadBps,
      @JsonProperty("BlkioDeviceWriteBps") final List<BlkioDeviceRate> blkioDeviceWriteBps,
      @JsonProperty("BlkioDeviceReadIOps") final List<BlkioDeviceRate> blkioDeviceReadIOps,
      @JsonProperty("BlkioDeviceWriteIOps") final List<BlkioDeviceRate> blkioDeviceWriteIOps,
      @JsonProperty("ContainerIDFile") final String containerIdFile,
      @JsonProperty("LxcConf") final List<LxcConfParameter> lxcConf,
      @JsonProperty("Privileged") final Boolean privileged,
      @JsonProperty("PortBindings") final Map<String, List<PortBinding>> portBindings,
      @JsonProperty("Links") final List<String> links,
      @JsonProperty("PublishAllPorts") final Boolean publishAllPorts,
      @JsonProperty("Dns") final List<String> dns,
      @JsonProperty("DnsOptions") final List<String> dnsOptions,
      @JsonProperty("DnsSearch") final List<String> dnsSearch,
      @JsonProperty("ExtraHosts") final List<String> extraHosts,
      @JsonProperty("GroupAdd") final List<String> groupAdd,
      @JsonProperty("VolumesFrom") final List<String> volumesFrom,
      @JsonProperty("CapAdd") final List<String> capAdd,
      @JsonProperty("CapDrop") final List<String> capDrop,
      @JsonProperty("NetworkMode") final String networkMode,
      @JsonProperty("SecurityOpt") final List<String> securityOpt,
      @JsonProperty("Devices") final List<Device> devices,
      @JsonProperty("Memory") final Long memory,
      @JsonProperty("MemorySwap") final Long memorySwap,
      @JsonProperty("MemorySwappiness") final Integer memorySwappiness,
      @JsonProperty("MemoryReservation") final Long memoryReservation,
      @JsonProperty("KernelMemory") final Long kernelMemory,
      @JsonProperty("NanoCpus") final Long nanoCpus,
      @JsonProperty("CpuPeriod") final Long cpuPeriod,
      @JsonProperty("CpuShares") final Long cpuShares,
      @JsonProperty("CpusetCpus") final String cpusetCpus,
      @JsonProperty("CpusetMems") final String cpusetMems,
      @JsonProperty("CpuQuota") final Long cpuQuota,
      @JsonProperty("CgroupParent") final String cgroupParent,
      @JsonProperty("RestartPolicy") final RestartPolicy restartPolicy,
      @JsonProperty("LogConfig") final LogConfig logConfig,
      @JsonProperty("IpcMode") final String ipcMode,
      @JsonProperty("Ulimits") final List<Ulimit> ulimits,
      @JsonProperty("PidMode") final String pidMode,
      @JsonProperty("ShmSize") final Long shmSize,
      @JsonProperty("OomKillDisable") final Boolean oomKillDisable,
      @JsonProperty("OomScoreAdj") final Integer oomScoreAdj,
      @JsonProperty("AutoRemove") final Boolean autoRemove,
      @JsonProperty("PidsLimit") final Integer pidsLimit,
      @JsonProperty("Tmpfs") final Map<String, String> tmpfs,
      @JsonProperty("ReadonlyRootfs") final Boolean readonlyRootfs,
      @JsonProperty("Runtime") final String runtime,
      @JsonProperty("StorageOpt") final Map<String, String> storageOpt) {
    return builder()
        .binds(binds)
        .blkioWeight(blkioWeight)
        .blkioWeightDevice(blkioWeightDevice)
        .blkioDeviceReadBps(blkioDeviceReadBps)
        .blkioDeviceWriteBps(blkioDeviceWriteBps)
        .blkioDeviceReadIOps(blkioDeviceReadIOps)
        .blkioDeviceWriteIOps(blkioDeviceWriteIOps)
        .containerIdFile(containerIdFile)
        .lxcConf(lxcConf)
        .privileged(privileged)
        .portBindings(portBindings)
        .links(links)
        .publishAllPorts(publishAllPorts)
        .dns(dns)
        .dnsOptions(dnsOptions)
        .dnsSearch(dnsSearch)
        .extraHosts(extraHosts)
        .groupAdd( groupAdd )
        .volumesFrom(volumesFrom)
        .capAdd(capAdd)
        .capDrop(capDrop)
        .networkMode(networkMode)
        .securityOpt(securityOpt)
        .devices(devices)
        .memory(memory)
        .memorySwap(memorySwap)
        .memorySwappiness(memorySwappiness)
        .memoryReservation(memoryReservation)
        .kernelMemory(kernelMemory)
        .nanoCpus(nanoCpus)
        .cpuPeriod(cpuPeriod)
        .cpuShares(cpuShares)
        .cpusetCpus(cpusetCpus)
        .cpusetMems(cpusetMems)
        .cpuQuota(cpuQuota)
        .cgroupParent(cgroupParent)
        .restartPolicy(restartPolicy)
        .logConfig(logConfig)
        .ipcMode(ipcMode)
        .ulimits(ulimits)
        .pidMode(pidMode)
        .shmSize(shmSize)
        .oomKillDisable(oomKillDisable)
        .oomScoreAdj(oomScoreAdj)
        .autoRemove(autoRemove)
        .pidsLimit(pidsLimit)
        .tmpfs(tmpfs)
        .readonlyRootfs(readonlyRootfs)
        .storageOpt(storageOpt)
        .runtime(runtime)
        .build();
  }

  @AutoValue
  public abstract static class LxcConfParameter {

    @JsonProperty("Key")
    public abstract String key();

    @JsonProperty("Value")
    public abstract String value();

    @JsonCreator
    static LxcConfParameter create(
        @JsonProperty("Key") final String key,
        @JsonProperty("Value") final String value) {
      return new AutoValue_HostConfig_LxcConfParameter(key, value);
    }
  }

  @AutoValue
  public abstract static class RestartPolicy {

    @JsonProperty("Name")
    public abstract String name();

    @Nullable
    @JsonProperty("MaximumRetryCount")
    public abstract Integer maxRetryCount();

    public static RestartPolicy always() {
      return new AutoValue_HostConfig_RestartPolicy("always", null);
    }

    public static RestartPolicy unlessStopped() {
      return new AutoValue_HostConfig_RestartPolicy("unless-stopped", null);
    }

    public static RestartPolicy onFailure(Integer maxRetryCount) {
      return new AutoValue_HostConfig_RestartPolicy("on-failure", maxRetryCount);
    }

    @JsonCreator
    static RestartPolicy create(
        @JsonProperty("Name") final String name,
        @JsonProperty("MaximumRetryCount") final Integer maxRetryCount) {
      return new AutoValue_HostConfig_RestartPolicy(name, maxRetryCount);
    }
  }

  public abstract Builder toBuilder();

  public static Builder builder() {
    return new AutoValue_HostConfig.Builder();
  }

  @AutoValue.Builder
  public abstract static class Builder {

    /**
     * Set the list of binds to the parameter, replacing any existing value.
     *
To append to the list instead, use one of the appendBinds() methods.

     *
     * @param binds A list of volume bindings for this container. Each volume binding is a string.
     * @return {@link Builder}
     */
    public abstract Builder binds(List<String> binds);

    /**
     * Set the list of binds to the parameter, replacing any existing value.
     *
To append to the list instead, use one of the appendBinds() methods.

     *
     * @param binds An array of volume bindings for this container. Each volume binding is a
     *              string.
     * @return {@link Builder}
     */
    public abstract Builder binds(String... binds);

    /**
     * Set the list of binds to the parameter, replacing any existing value.
     *
To append to the list instead, use one of the appendBinds() methods.

     *
     * @param binds An array of volume bindings for this container. Each volume binding is a {@link
     *              Bind} object.
     * @return {@link Builder}
     */
    public Builder binds(final Bind... binds) {
      if (binds == null || binds.length == 0) {
        return this;
      }

      return binds(toStringList(binds));
    }

    abstract ImmutableList<String> binds();

    private static List<String> toStringList(final Bind[] binds) {
      final List<String> bindStrings = Lists.newArrayList();
      for (final Bind bind : binds) {
        bindStrings.add(bind.toString());
      }
      return bindStrings;
    }

    /**
     * Append binds to the existing list in this builder. Duplicates are discarded.
     *
     * @param newBinds An iterable of volume bindings for this container. Each volume binding is a
     *                 String.
     * @return {@link Builder}
     */
    public Builder appendBinds(final Iterable<String> newBinds) {
      final List<String> list = new ArrayList<>();
      if (binds() != null) {
        list.addAll(binds());
      }
      list.addAll(Lists.newArrayList(newBinds));
      binds(copyWithoutDuplicates(list));
      return this;
    }

    /**
     * Append binds to the existing list in this builder.
     *
     * @param binds An array of volume bindings for this container. Each volume binding is a {@link
     *              Bind} object.
     * @return {@link Builder}
     */
    public Builder appendBinds(final Bind... binds) {
      appendBinds(toStringList(binds));
      return this;
    }

    /**
     * Append binds to the existing list in this builder.
     *
     * @param binds An array of volume bindings for this container. Each volume binding is a
     *              String.
     * @return {@link Builder}
     */
    public Builder appendBinds(final String... binds) {
      appendBinds(Lists.newArrayList(binds));
      return this;
    }

    private static <T> ImmutableList<T> copyWithoutDuplicates(final List<T> input) {
      final List<T> list = new ArrayList<>(input.size());
      for (final T element : input) {
        if (!list.contains(element)) {
          list.add(element);
        }
      }
      return ImmutableList.copyOf(list);
    }

    public abstract Builder blkioWeight(Integer blkioWeight);

    public abstract Builder blkioWeightDevice(List<BlkioWeightDevice> blkioWeightDevice);

    public abstract Builder blkioDeviceReadBps(List<BlkioDeviceRate> blkioDeviceReadBps);

    public abstract Builder blkioDeviceWriteBps(List<BlkioDeviceRate> blkioDeviceWriteBps);

    public abstract Builder blkioDeviceReadIOps(List<BlkioDeviceRate> blkioDeviceReadIOps);

    public abstract Builder blkioDeviceWriteIOps(List<BlkioDeviceRate> blkioDeviceWriteIOps);

    public abstract Builder containerIdFile(String containerIdFile);

    public abstract Builder lxcConf(List<LxcConfParameter> lxcConf);

    public abstract Builder lxcConf(LxcConfParameter... lxcConf);

    public abstract Builder privileged(Boolean privileged);

    public abstract Builder portBindings(Map<String, List<PortBinding>> portBindings);

    public abstract Builder links(List<String> links);

    public abstract Builder links(String... links);

    public abstract Builder publishAllPorts(Boolean publishAllPorts);

    public abstract Builder dns(List<String> dns);

    public abstract Builder dns(String... dns);

    public abstract Builder dnsOptions(List<String> dnsOptions);

    public abstract Builder dnsOptions(String... dnsOptions);

    public abstract Builder dnsSearch(List<String> dnsSearch);

    public abstract Builder dnsSearch(String... dnsSearch);

    public abstract Builder extraHosts(List<String> extraHosts);

    public abstract Builder extraHosts(String... extraHosts);

    public abstract Builder groupAdd(List<String> groupAdd);

    public abstract Builder groupAdd(String... groupAdd);

    public abstract Builder volumesFrom(List<String> volumesFrom);

    public abstract Builder volumesFrom(String... volumesFrom);

    public abstract Builder capAdd(List<String> capAdd);

    public abstract Builder capAdd(String... capAdd);

    public abstract Builder capDrop(List<String> capDrop);

    public abstract Builder capDrop(String... capDrop);

    public abstract Builder networkMode(String networkMode);

    public abstract Builder securityOpt(List<String> securityOpt);

    public abstract Builder securityOpt(String... securityOpt);

    public abstract Builder devices(List<Device> devices);

    public abstract Builder devices(Device... devices);

    public abstract Builder memory(Long memory);

    public abstract Builder memorySwap(Long memorySwap);

    public abstract Builder memorySwappiness(Integer memorySwappiness);

    public abstract Builder kernelMemory(Long kernelMemory);

    public abstract Builder memoryReservation(Long memoryReservation);

    public abstract Builder nanoCpus(Long nanoCpus);

    public abstract Builder cpuPeriod(Long cpuPeriod);

    public abstract Builder cpuShares(Long cpuShares);

    public abstract Builder cpusetCpus(String cpusetCpus);

    public abstract Builder cpusetMems(String cpusetMems);

    public abstract Builder cpuQuota(Long cpuQuota);

    public abstract Builder cgroupParent(String cgroupParent);

    public abstract Builder restartPolicy(RestartPolicy restartPolicy);

    public abstract Builder logConfig(LogConfig logConfig);

    public abstract Builder ipcMode(String ipcMode);

    public abstract Builder ulimits(List<Ulimit> ulimits);

    public abstract Builder pidMode(String pidMode);

    /**
     * Set the PID (Process) Namespace mode for the container.
     * Use this method to join another container's PID namespace. To use the host
     * PID namespace, use {@link #hostPidMode()}.
     *
     * @param container Join the namespace of this container (Name or ID)
     * @return Builder
     */
    public Builder containerPidMode(final String container) {
      pidMode("container:" + container);
      return this;
    }

    /**
     * Set the PID (Process) Namespace mode for the container.
     * Use this method to use the host's PID namespace. To use another container's
     * PID namespace, use {@link #containerPidMode(String)}.
     *
     * @return {@link Builder}
     */
    public Builder hostPidMode() {
      pidMode("host");
      return this;
    }

    public abstract Builder shmSize(Long shmSize);

    public abstract Builder oomKillDisable(Boolean oomKillDisable);

    public abstract Builder oomScoreAdj(Integer oomScoreAdj);

    /**
     * Only works for Docker API version >= 1.25.
     * @param autoRemove Whether to automatically remove the container when it exits
     * @return {@link Builder}
     */
    public abstract Builder autoRemove(Boolean autoRemove);

    public abstract Builder pidsLimit(Integer pidsLimit);

    public abstract Builder tmpfs(Map<String, String> tmpfs);

    public abstract Builder readonlyRootfs(Boolean readonlyRootfs);

    public abstract Builder storageOpt(Map<String, String> tmpfs);

    public abstract Builder runtime(String runtime);

    // Validation of property values using AutoValue requires we split the build method into two.
    // AutoValue implements this package-private method.
    // See https://github.com/google/auto/blob/master/value/userguide/builders-howto.md#validate.
    abstract HostConfig autoBuild();

    public HostConfig build() {
      final HostConfig hostConfig = autoBuild();
      validateExtraHosts(hostConfig.extraHosts());
      return hostConfig;
    }
  }

  private static void validateExtraHosts(final List<String> extraHosts) {
    if (extraHosts != null) {
      for (final String extraHost : extraHosts) {
        checkArgument(extraHost.contains(":"),
            "extra host arg '%s' must contain a ':'", extraHost);
      }
    }
  }

  @AutoValue
  public abstract static class Bind {

    public abstract String to();

    public static BuilderTo to(final String to) {
      return BuilderTo.create(to);
    }

    public abstract String from();

    public static BuilderFrom from(final String from) {
      return BuilderFrom.create(from);
    }

    public static BuilderFrom from(final Volume volumeFrom) {
      return BuilderFrom.create(volumeFrom);
    }

    public abstract Boolean readOnly();

    @Nullable
    public abstract Boolean noCopy();

    @Nullable
    public abstract Boolean selinuxLabeling();

    public static Builder builder() {
      return new AutoValue_HostConfig_Bind.Builder().readOnly(false);
    }

    @SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
    public String toString() {
      if (isNullOrEmpty(to())) {
        return "";
      } else if (isNullOrEmpty(from())) {
        return to();
      }

      final String bind = from() + ":" + to();

      final List<String> options = new ArrayList<>();
      if (readOnly()) {
        options.add("ro");
      }
      //noinspection ConstantConditions
      if (noCopy() != null && noCopy()) {
        options.add("nocopy");
      }

      if (selinuxLabeling() != null) {
        // shared
        if (Boolean.TRUE.equals(selinuxLabeling())) {
          options.add("z");
        } else {
          options.add("Z");
        }
      }

      final String optionsValue = Joiner.on(',').join(options);

      return (optionsValue.isEmpty()) ? bind : bind + ":" + optionsValue;
    }

    @AutoValue
    public abstract static class BuilderTo {

      public abstract String to();

      public static BuilderTo create(final String to) {
        return new AutoValue_HostConfig_Bind_BuilderTo(to);
      }

      public Builder from(final String from) {
        return builder().to(to()).from(from);
      }

      public Builder from(final Volume volumeFrom) {
        return builder().to(to()).from(volumeFrom);
      }
    }

    @AutoValue
    public abstract static class BuilderFrom {

      public abstract String from();

      public static BuilderFrom create(final String from) {
        return new AutoValue_HostConfig_Bind_BuilderFrom(from);
      }

      public static BuilderFrom create(final Volume volumeFrom) {
        return new AutoValue_HostConfig_Bind_BuilderFrom(
            checkNotNull(volumeFrom.name(), "Volume name"));
      }

      public Builder to(final String to) {
        return builder().to(to).from(from());
      }
    }

    @AutoValue.Builder
    public abstract static class Builder {

      public abstract Builder to(String to);

      public abstract Builder from(String from);

      public Builder from(final Volume volumeFrom) {
        from(checkNotNull(volumeFrom.name(), "Volume name"));
        return this;
      }

      public abstract Builder readOnly(Boolean readOnly);

      public abstract Builder noCopy(Boolean noCopy);

      /**
       * Turn on automatic SELinux labeling of the host file or directory being
       * mounted into the container.
       * @param sharedContent True if this bind mount content is shared among multiple
       *     containers (mount option "z"); false if private and unshared (mount option "Z")
       * @return {@link Builder}
       */
      public abstract Builder selinuxLabeling(Boolean sharedContent);

      public abstract Bind build();
    }
  }

  @AutoValue
  public abstract static class Ulimit {

    @JsonProperty("Name")
    public abstract String name();

    @JsonProperty("Soft")
    public abstract Long soft();

    @JsonProperty("Hard")
    public abstract Long hard();

    public static Builder builder() {
      return new AutoValue_HostConfig_Ulimit.Builder();
    }

    @AutoValue.Builder
    public abstract static class Builder {

      public abstract Builder name(String name);

      public abstract Builder soft(Long soft);

      public abstract Builder hard(Long hard);

      public abstract Ulimit build();
    }

    @JsonCreator
    public static Ulimit create(
        @JsonProperty("Name") final String name,
        @JsonProperty("Soft") final Long soft,
        @JsonProperty("Hard") final Long hard) {
      return builder()
          .name(name)
          .soft(soft)
          .hard(hard)
          .build();
    }
  }

  @AutoValue
  public abstract static class BlkioWeightDevice {

    @JsonProperty("Path")
    public abstract String path();

    @JsonProperty("Weight")
    public abstract Integer weight();

    public static Builder builder() {
      return new AutoValue_HostConfig_BlkioWeightDevice.Builder();
    }

    @JsonCreator
    static BlkioWeightDevice create(
        @JsonProperty("Path") final String path,
        @JsonProperty("Weight") final Integer weight) {
      return builder().path(path).weight(weight).build();
    }

    @AutoValue.Builder
    public abstract static class Builder {

      public abstract Builder path(final String path);

      public abstract Builder weight(final Integer weight);

      public abstract BlkioWeightDevice build();
    }
  }

  @AutoValue
  public abstract static class BlkioDeviceRate {

    @JsonProperty("Path")
    public abstract String path();

    @JsonProperty("Rate")
    public abstract Integer rate();

    @JsonCreator
    static BlkioDeviceRate create(
        @JsonProperty("Path") final String path,
        @JsonProperty("Rate") final Integer rate) {
      return builder().path(path).rate(rate).build();
    }

    public static Builder builder() {
      return new AutoValue_HostConfig_BlkioDeviceRate.Builder();
    }

    @AutoValue.Builder
    public abstract static class Builder {

      public abstract Builder path(final String path);

      public abstract Builder rate(final Integer rate);

      public abstract BlkioDeviceRate build();
    }
  }
}


text:
package org.kie.uberfire.client.resources;

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;

public interface CoreImages
        extends
        ClientBundle {

    CoreImages INSTANCE = GWT.create( CoreImages.class );

    @Source("images/open_folder.gif")
    ImageResource openedFolder();

    @Source("images/package.gif")
    ImageResource packageIcon();

    @Source("images/file.gif")
    ImageResource file();

    @Source("images/backup_large.png")
    ImageResource backupLarge();

    //A warning triangle
    @Source("images/warning-large.png")
    ImageResource warningLarge();

    @Source("images/tick.png")
    ImageResource tick();

    @Source("images/BPM_FileIcons_text.png")
    ImageResource typeTextFile();

}


text:
.class public interface abstract Lorg/apache/http/impl/bootstrap/SSLServerSetupHandler;
.super Ljava/lang/Object;
.source "SSLServerSetupHandler.java"

# virtual methods
.method public abstract initialize(Ljavax/net/ssl/SSLServerSocket;)V
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljavax/net/ssl/SSLException;
        }
    .end annotation
.end method


text:
package com.amazonaws.services.sqs.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.sqs.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.StringUtils;

/**
 * ListQueuesRequest Marshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListQueuesRequestMarshaller implements Marshaller<Request<ListQueuesRequest>, ListQueuesRequest> {

    public Request<ListQueuesRequest> marshall(ListQueuesRequest listQueuesRequest) {

        if (listQueuesRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        Request<ListQueuesRequest> request = new DefaultRequest<ListQueuesRequest>(listQueuesRequest, "AmazonSQS");
        request.addParameter("Action", "ListQueues");
        request.addParameter("Version", "2012-11-05");
        request.setHttpMethod(HttpMethodName.POST);

        if (listQueuesRequest.getQueueNamePrefix() != null) {
            request.addParameter("QueueNamePrefix", StringUtils.fromString(listQueuesRequest.getQueueNamePrefix()));
        }

        if (listQueuesRequest.getNextToken() != null) {
            request.addParameter("NextToken", StringUtils.fromString(listQueuesRequest.getNextToken()));
        }

        if (listQueuesRequest.getMaxResults() != null) {
            request.addParameter("MaxResults", StringUtils.fromInteger(listQueuesRequest.getMaxResults()));
        }

        return request;
    }

}


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

using System;
using System.Collections.Generic;

public static class Generics
{
	public class MyArray<T>
	{
		public class NestedClass<Y>
		{
			public T Item1;
			public Y Item2;
		}

		public enum NestedEnum
		{
			A,
			B
		}

		private T[] arr;

		public MyArray(int capacity)
		{
			this.arr = new T[capacity];
		}

		public void Size(int capacity)
		{
			Array.Resize<T>(ref this.arr, capacity);
		}

		public void Grow(int capacity)
		{
			if (capacity >= this.arr.Length)
			{
				this.Size(capacity);
			}
		}
	}

	public interface IInterface
	{
		void Method1<T>() where T : class;
		void Method2<T>() where T : class;
	}

	public abstract class Base : Generics.IInterface
	{
		// constraints must be repeated on implicit interface implementation
		public abstract void Method1<T>() where T : class;

		// constraints must not be specified on explicit interface implementation
		void Generics.IInterface.Method2<T>()
		{
		}
	}

	public class Derived : Generics.Base
	{
		// constraints are inherited automatically and must not be specified
		public override void Method1<T>()
		{
		}
	}

	private const Generics.MyArray<string>.NestedEnum enumVal = Generics.MyArray<string>.NestedEnum.A;
	private static Type type1 = typeof(List<>);
	private static Type type2 = typeof(Generics.MyArray<>);
	private static Type type3 = typeof(List<>.Enumerator);
	private static Type type4 = typeof(Generics.MyArray<>.NestedClass<>);
	private static Type type5 = typeof(List<int>[]);
	private static Type type6 = typeof(Generics.MyArray<>.NestedEnum);

	public static void MethodWithConstraint<T, S>() where T : class, S where S : ICloneable, new()
	{
	}

	public static void MethodWithStructConstraint<T>() where T : struct
	{
	}

	public static Dictionary<string, string>.KeyCollection.Enumerator GetEnumerator(Dictionary<string, string> d, Generics.MyArray<string>.NestedClass<int> nc)
	{
		// Tests references to inner classes in generic classes
		return d.Keys.GetEnumerator();
	}
}


text:
#ifndef rtkSimplexSpectralProjectionsDecompositionImageFilter_h
#define rtkSimplexSpectralProjectionsDecompositionImageFilter_h

#include <itkImageToImageFilter.h>
#include <itkAmoebaOptimizer.h>
#include "rtkSchlomka2008NegativeLogLikelihood.h"
#include "rtkDualEnergyNegativeLogLikelihood.h"

namespace rtk
{
/** \class SimplexSpectralProjectionsDecompositionImageFilter
 * \brief Decomposition of spectral projection images into material projections
 *
 * See the reference paper: "Experimental feasibility of multi-energy photon-counting
 * K-edge imaging in pre-clinical computed tomography", Schlomka et al, PMB 2008
 *
 * \author Cyril Mory
 *
 * \ingroup RTK ReconstructionAlgorithm
 */

template <typename DecomposedProjectionsType,
          typename MeasuredProjectionsType,
          typename IncidentSpectrumImageType = itk::VectorImage<float, 2>,
          typename DetectorResponseImageType = itk::Image<float, 2>,
          typename MaterialAttenuationsImageType = itk::Image<float, 2>>
class ITK_TEMPLATE_EXPORT SimplexSpectralProjectionsDecompositionImageFilter
  : public itk::ImageToImageFilter<DecomposedProjectionsType, DecomposedProjectionsType>
{
public:
  ITK_DISALLOW_COPY_AND_MOVE(SimplexSpectralProjectionsDecompositionImageFilter);

  /** Standard class type alias. */
  using Self = SimplexSpectralProjectionsDecompositionImageFilter;
  using Superclass = itk::ImageToImageFilter<DecomposedProjectionsType, DecomposedProjectionsType>;
  using Pointer = itk::SmartPointer<Self>;
  using ConstPointer = itk::SmartPointer<const Self>;

  /** Some convenient type alias. */
  using InputImageType = DecomposedProjectionsType;
  using OutputImageType = DecomposedProjectionsType;

  /** Convenient information */
  using ThresholdsType = itk::VariableLengthVector<double>;
  using MeanAttenuationInBinType = itk::VariableSizeMatrix<double>;
  using DetectorResponseType = vnl_matrix<double>;
  using MaterialAttenuationsType = vnl_matrix<double>;
  using CostFunctionType = ProjectionsDecompositionNegativeLogLikelihood;

  /** Standard New method. */
  itkNewMacro(Self);

  /** Runtime information support. */
  itkTypeMacro(SimplexSpectralProjectionsDecompositionImageFilter, ImageToImageFilter);

  /** Set/Get the input material-decomposed stack of projections (only used for initialization) */
  void
  SetInputDecomposedProjections(const DecomposedProjectionsType * DecomposedProjections);
  typename DecomposedProjectionsType::ConstPointer
  GetInputDecomposedProjections();

  /** Set/Get the input stack of measured projections (to be decomposed in materials) */
  void
  SetInputMeasuredProjections(const MeasuredProjectionsType * SpectralProjections);
  typename MeasuredProjectionsType::ConstPointer
  GetInputMeasuredProjections();

  /** Set/Get the detector response as an image */
  void
  SetDetectorResponse(const DetectorResponseImageType * DetectorResponse);
  typename DetectorResponseImageType::ConstPointer
  GetDetectorResponse();

  /** Set/Get the material attenuations as an image */
  void
  SetMaterialAttenuations(const MaterialAttenuationsImageType * MaterialAttenuations);
  typename MaterialAttenuationsImageType::ConstPointer
  GetMaterialAttenuations();

  /** Set/Get the incident spectrum input images */
  void
  SetInputIncidentSpectrum(const IncidentSpectrumImageType * IncidentSpectrum);
  void
  SetInputSecondIncidentSpectrum(const IncidentSpectrumImageType * SecondIncidentSpectrum);
  typename IncidentSpectrumImageType::ConstPointer
  GetInputIncidentSpectrum();
  typename IncidentSpectrumImageType::ConstPointer
  GetInputSecondIncidentSpectrum();

  /** Get / Set the number of iterations. Default is 300. */
  itkGetMacro(NumberOfIterations, unsigned int);
  itkSetMacro(NumberOfIterations, unsigned int);

  itkSetMacro(NumberOfEnergies, unsigned int);
  itkGetMacro(NumberOfEnergies, unsigned int);

  itkSetMacro(NumberOfMaterials, unsigned int);
  itkGetMacro(NumberOfMaterials, unsigned int);

  itkSetMacro(OptimizeWithRestarts, bool);
  itkGetMacro(OptimizeWithRestarts, bool);

  itkSetMacro(Thresholds, ThresholdsType);
  itkGetMacro(Thresholds, ThresholdsType);

  itkSetMacro(NumberOfSpectralBins, unsigned int);
  itkGetMacro(NumberOfSpectralBins, unsigned int);

  itkSetMacro(OutputInverseCramerRaoLowerBound, bool);
  itkGetMacro(OutputInverseCramerRaoLowerBound, bool);

  itkSetMacro(OutputFischerMatrix, bool);
  itkGetMacro(OutputFischerMatrix, bool);

  itkSetMacro(LogTransformEachBin, bool);
  itkGetMacro(LogTransformEachBin, bool);

  itkSetMacro(GuessInitialization, bool);
  itkGetMacro(GuessInitialization, bool);

  itkSetMacro(IsSpectralCT, bool);
  itkGetMacro(IsSpectralCT, bool);

protected:
  SimplexSpectralProjectionsDecompositionImageFilter();
  ~SimplexSpectralProjectionsDecompositionImageFilter() override = default;

  void
  GenerateOutputInformation() override;

  void
  GenerateInputRequestedRegion() override;

  void
  BeforeThreadedGenerateData() override;
  void
  DynamicThreadedGenerateData(const typename DecomposedProjectionsType::RegionType & outputRegionForThread) override;

  /**  Create the Output */
  using DataObjectPointerArraySizeType = itk::ProcessObject::DataObjectPointerArraySizeType;
  using Superclass::MakeOutput;
  itk::DataObject::Pointer
  MakeOutput(DataObjectPointerArraySizeType idx) override;

  /** The inputs should not be in the same space so there is nothing
   * to verify. */
  void
  VerifyInputInformation() const override
  {}

  /** Parameters */
  MaterialAttenuationsType m_MaterialAttenuations;
  DetectorResponseType     m_DetectorResponse;
  ThresholdsType           m_Thresholds;
  MeanAttenuationInBinType m_MeanAttenuationInBin;
  bool                     m_OutputInverseCramerRaoLowerBound;
  bool                     m_OutputFischerMatrix;
  bool                     m_LogTransformEachBin;
  bool                     m_GuessInitialization;
  bool                     m_IsSpectralCT; // If not, it is dual energy CT
  bool                     m_OptimizeWithRestarts;
  unsigned int             m_NumberOfIterations;
  unsigned int             m_NumberOfMaterials;
  unsigned int             m_NumberOfEnergies;
  unsigned int             m_NumberOfSpectralBins;

}; // end of class

} // end namespace rtk

#ifndef ITK_MANUAL_INSTANTIATION
#  include "rtkSimplexSpectralProjectionsDecompositionImageFilter.hxx"
#endif

#endif


text:
An Easy, Fast and Lightweight web based report publishing tool based on .NET 4 and SQL Server

# License
Apache License Version 2.0

# Inspiration
Basically I needed a lightweight web application to share any required ad-hoc queries.
I managed to find some based on PHP and MySql but I had no luck with C#/Sql Server so I decided to build one myself.

# How it works
Navigate to /publisher.aspx and fill in the details of your query. Details include:
server/instance name, catalog, db username, db password and the sql query itself.<br/>

After hitting save the data is stored in the project's database (so it can be used later) and a url is given to the user.
This URL can be distributed and accessed directly. On the report page one finds basic report
functionality like filter, pagination and sorting.

# Requirements
+ IIS 6 or 7
+ SQL Server 2008 or later

# Installation
+ So first, create a virtual directory in IIS and point it to the root of the project
+ Go to your SQL Server and create a new database
+ Grap the file named database.sql and execute it against you newly created database
+ Go to web.config file in the root directory and modify the connection string to match yours
+ Lastly, go to you browser and navigate to your virtual directory eg. http://localhost:8080/publisher.aspx
+ If the web page shows, your installation was successful

# Current Limitations
Currently the data is being transferred as a whole to the browser, that means that if the query returns x number of rows
all will be transferred to the clients browser and then cut off for pagination. This is because the current pagination works on the client side.
All data will be displayed in tabular format.

# TODO
+ Add download to CSV
+ Add API for automatic creation of reports
+ Ability to display graphs
+ Ability to display geographic maps

Buy me a beer using Bitcoin
## [163anEKNWhuRuv1srtPcvzEw7iLPQnz1qr](bitcoin:163anEKNWhuRuv1srtPcvzEw7iLPQnz1qr)


text:
console.log('hello js');

$(document).ready(function() {

  var input = document.getElementsByTagName('input')[0];
  var s = Snap('#svg');

  var celeb = Snap.load('doc/img/media_stroke.svg', function (f) {
    var l = (f.select('#mainLayer'));

    function inputVal() {
      this.number =
        $('input');
          var change = input.addEventListener('change', function() {
            var value = this.value

            console.log(value);

            var aLoop = function(r) {
              var slowR = r=== 2 ? 7 : 2
                magentaC.animate({r:r},1200, function() {
                  orangeC.animate({r:r},500, function() {
                    cyanP.animate({r:r},1000, function() {

                    aLoop(slowR)

                    }); // closing cyan
                  }); // closing orange
                }); // closing magenta
            }; // closing aLoop function

            aLoop(1); // invoke aLoop with a start value

            function showHide() {
              if (value > 1) {
                magentaC.attr({visibility: "visible"});
                magentaP.attr({visibility: "visible"});

              } else if (value < 5) {
                magentaC.attr({visibility: "hidden"});
                magentaP.attr({visibility: "hidden"});
              }

              if (value > 5) {
                yellowC.attr({visibility: "visible"});
                yellowE.attr({visibility: "visible"});

              } else if (value < 10) {
                yellowC.attr({visibility: "hidden"});
                yellowE.attr({visibility: "hidden"});
              }

              if (value > 10) {
                cyanC.attr({visibility: "visible"});
                cyanE.attr({visibility: "visible"});
                cyanP.attr({visibility: "visible"});

              } else if (value < 15) {
                cyanC.attr({visibility: "hidden"});
                cyanE.attr({visibility: "hidden"});
                cyanP.attr({visibility: "hidden"});
              }

              if (value > 15) {
                orangeC.attr({visibility: "visible"});
                orangeE.attr({visibility: "visible"});

              } else if (value < 20) {
                orangeC.attr({visibility: "hidden"});
                orangeE.attr({visibility: "hidden"});
              }

              if (value > 20) {
                blueC.attr({visibility: "visible"});
                blueE.attr({visibility: "visible"});

              } else if (value < 25) {
                blueC.attr({visibility: "hidden"});
                blueE.attr({visibility: "hidden"});
              }

              if (value > 25) {
                purpleC.attr({visibility: "visible"});
                purpleE.attr({visibility: "visible"});

              } else if (value < 30) {
                purpleC.attr({visibility: "hidden"});
                purpleE.attr({visibility: "hidden"});
              }

              if (value > 30) {
                lightPinkC.attr({visibility: "visible"});
                lightPinkE.attr({visibility: "visible"});

              } else if (value < 35){
                lightPinkC.attr({visibility: "hidden"});
                lightPinkE.attr({visibility: "hidden"});
              }

              if (value > 35) {
                pinkC.attr({visibility: "visible"});
                pinkE.attr({visibility: "visible"});

              } else if (value < 40) {
                pinkC.attr({visibility: "hidden"});
                pinkE.attr({visibility: "hidden"});
              }

              if (value > 40) {
                whiteC.attr({visibility: "visible"});
                whiteE.attr({visibility: "visible"});

              } else if (value < 45) {
                whiteC.attr({visibility: "hidden"});
                whiteE.attr({visibility: "hidden"});
              }

              if (value > 45) {
                brownP.attr({visibility: "visible"});

              } else if (value < 50) {
                brownP.attr({visibility: "hidden"});
              }

              if (value > 50) {
                navyP.attr({visibility: "visible"});
                navyE.attr({visibility: "visible"});

              } else if (value < 55) {
                navyP.attr({visibility: "hidden"});
                navyE.attr({visibility: "hidden"});
              }

              if (value >= 50) {
                yellowP.attr({visibility: "visible"});

              } else if (value < 50) {
                yellowP.attr({visibility: "hidden"});
              }

            } // closing showHide

            showHide();
            aLoop(1);

          }, false); // closing change eventListener

    }// closing iputValue function

    inputVal();

        var g =(f.select('g'));
        var path =(f.select('path'));

        var magentaC = f.selectAll("circle[fill='#B93293']").attr({visibility: "hidden"});
        var magentaP = f.selectAll("path[fill='#B93293']").attr({visibility: "hidden"});

        var whiteC = f.selectAll("circle[fill='#FFFFFF']").attr({visibility: "hidden"});
        var whiteE = f.selectAll("ellipse[fill='#FFFFFF']").attr({visibility: "hidden"});

        var yellowC = f.selectAll("circle[fill='#FEDD10']").attr({visibility: "hidden"});
        var yellowE = f.selectAll("ellipse[fill='#FEDD10']").attr({visibility: "hidden"});
        var yellowP = f.selectAll("path[fill='#FEDD10']").attr({visibility: "hidden"});

        var brownP = f.selectAll("path[fill='#331F08']").attr({visibility: "hidden"});

        var cyanC = f.selectAll("circle[fill='#02BDE4']").attr({visibility: "hidden"});
        var cyanE = f.selectAll("ellipse[fill='#02BDE4']").attr({visibility: "hidden"});
        var cyanP = f.selectAll("path[fill='#02BDE4']").attr({visibility: "hidden"});

        var orangeC = f.selectAll("circle[fill='#F37E2F']").attr({visibility: "hidden"});
        var orangeE = f.selectAll("ellipse[fill='#F37E2F']").attr({visibility: "hidden"});

        var blueC = f.selectAll("circle[fill='#71CEE3']").attr({visibility: "hidden"});
        var blueE = f.selectAll("ellipse[fill='#71CEE3']").attr({visibility: "hidden"});

        var purpleC = f.selectAll("circle[fill='#6F2B8B']").attr({visibility: "hidden"});
        var purpleE = f.selectAll("ellipse[fill='#6F2B8B']").attr({visibility: "hidden"});

        var lightPinkC = f.selectAll("circle[fill='#F8B9CD']").attr({visibility: "hidden"});
        var lightPinkE = f.selectAll("ellipse[fill='#F8B9CD']").attr({visibility: "hidden"});

        var pinkC = f.selectAll("circle[fill='#E41564']").attr({visibility: "hidden"});
        var pinkE = f.selectAll("ellipse[fill='#E41564']").attr({visibility: "hidden"});

        var navyP = f.selectAll("path[fill='#233B77']").attr({visibility: "hidden"});
        var navyE = f.selectAll("ellipse[fill='#233B77']").attr({visibility: "hidden"});

        s.append(l);

  }); // closing celeb load svg function

}); // closing document ready function


text:
var xml = require('../lib/xmltemplates');
var _ = require('lodash');

function handleRange (req, res, obj) {
	var range = null;
	if (req.headers['range']) {
		var r = req.headers['range'].replace('bytes=', '').split('-');
		range = {startPos: parseInt(r[0])};
		range.endPos = obj.size;
		if (r[1] !== '') {
			range.endPos = parseInt(r[1]);
		}
		res.setHeader('Content-Range', "bytes " + range.startPos+'-'+range.endPos+'/'+obj.size);
		res.status(206);
	}
	return range
}

function returnFoundFile (s3obj, req, res, next) {
	res.setHeader('Content-Type', s3obj.contentType);
	res.setHeader('Accept-Ranges', 'bytes');
	res.setHeader('Content-Length', s3obj.size);
	res.setHeader('Etag', s3obj.md5);
	res.setHeader('Last-Modified', new Date(s3obj.modifiedDate).toUTCString());
	var noneMatch = req.headers['if-none-match'];
	if (noneMatch && (noneMatch === s3obj.md5 || noneMatch === '*')) {
		res.send(304);
		return next();
	}
	var modifiedSince = req.headers['if-modified-since'];
	if (modifiedSince) {
		var time = new Date(modifiedSince);
		var modifiedDate = new Date(s3obj.modifiedDate);
		if (time >= modifiedDate) {
			res.send(304);
			return next();
		}
	}
	var range = handleRange(req, res, s3obj);
	res.status(200)
	if (req.method === 'HEAD') {
		res.end();
		return next();
	}
	var reader = s3obj.getFileReadStream(range);
	reader.pipe(res);
	return next();
}

module.exports = function bucketsctrl (server, models) {
	function getBuckets (req, res, next) {
		models.Bucket.find({}, function (err, buckets) {
			next.ifError(err);
			res.status(200);
			res.setHeader('content-type', 'text/xml');
			res.send(xml.buildBuckets(buckets));
			return next();
		});
	}

	function bucketExists (req, res, next) {
		models.Bucket.findOne({name: req.bucket}, function (err, bucket) {
			next.ifError(err);
			if (!bucket) {
				res.setHeader('content-type', 'text/xml');
				res.status(404);
				res.end(xml.buildBucketNotFound(req.bucket));
				return next(false);
			} else {
				req.bucket = bucket;
				return next();
			}
		});
	}

	function getBucket (req, res, next) {
		var options = {
			marker: req.query.marker || null,
			prefix: req.query.prefix || null,
			maxKeys: parseInt(req.query['max-keys']) || 1000,
			delimiter: req.query.delimiter || null
		};
		models.S3Object.find({bucket: req.bucket.id}, function (err, objects) {
			next.ifError(err);

			var inx = _.find(objects, {key: 'index.html'});
			if (inx && !res.awsclient) {
				return returnFoundFile(inx, req, res, next);
			}

			res.setHeader('content-type', 'text/xml');
			res.status(200);
			res.end(xml.buildBucketQuery(options, objects));
			return next();
		});
	}

	function putBucket (req, res, next) {
		var bucketName = req.bucket;
		var template;
		if ((/^[a-z0-9]+(-[a-z0-9]+)*$/.test(bucketName) === false)) {
			res.setHeader('content-type', 'text/xml');
			template = xml.buildError('InvalidBucketName',
				'Bucket names can contain lowercase letters, numbers, and hyphens. ' +
				'Each label must start and end with a lowercase letter or a number.');
			res.send(400, template);
			return next();
		}
		if (bucketName.length < 3 || bucketName.length > 63) {
			res.setHeader('content-type', 'text/xml');
			template = xml.buildError('InvalidBucketName',
				'The bucket name must be between 3 and 63 characters.');
			res.send(400, template);
			return next();
		}
		models.Bucket.findOne({name: bucketName}, function (err, bucket) {
			next.ifError(err);
			if (bucket) {
				res.setHeader('content-type', 'text/xml');
				var template = xml.buildError('BucketAlreadyExists',
					'The requested bucket already exists');
				res.send(409, template);
				return next();
			}
			var b = models.Bucket({name: bucketName});
			b.save(function (err, bucket) {
				if (err) {
					var template = templateBuilder.buildError('InternalError',
						'We encountered an internal error. Please try again.');
					res.send(500, template);
					return next();
				}
				res.setHeader('Location', bucket.name+'.'+server.s3hostname);
				res.send(200);
				return next();
			});
		});
	}

	function deleteBucket (req, res, next) {
		models.S3Object.find({bucket: req.bucket.id}, function (err, objects) {
			next.ifError(err);
			if (objects.length > 0) {
				res.setHeader('content-type', 'text/xml');
				res.send(409, xml.buildBucketNotEmpty(req.bucket.name));
				return next();
			}
			req.bucket.remove(function (err, bucket) {
				res.send(204);
			});
		});
	}

	return {
		getBuckets: getBuckets,
		getBucket: getBucket,
		putBucket: putBucket,
		deleteBucket: deleteBucket,
		bucketExists: bucketExists
	};
};


text:
<?php

class Html
{
    /**
     * Preferred order of attributes
     *
     * @var array
     */
    public static $attribute_order = array (
        'action', 'method', 'type', 'id', 'name', 'value',
        'href', 'src', 'width', 'height', 'cols', 'rows',
        'size', 'maxlength', 'rel', 'media', 'accept-charset',
        'accept', 'tabindex', 'accesskey', 'alt', 'title', 'class',
        'style', 'selected', 'checked', 'readonly', 'disabled',
    );

	/**
	 * The registered custom macros.
	 *
	 * @var array
	 */
	public static $macros = array();

    /**
     * Protected constructor since this is a static class.
     *
     * @access  protected
     */
    protected function __construct()
    {
        // Nothing here
    }

    /**
     * Registers a custom macro.
     *
     *
     *
     *      // Registering a Html macro
     *      Html::macro('my_element', function() {
     *          return '<element id="monstra">';
     *      });
     *
     *      // Calling a custom Html macro
     *      echo Html::my_element();
     *
     *
     *      // Registering a Html macro with parameters
     *      Html::macro('my_element', function($id = '') {
     *      	return '<element id="'.$id.'">';
     *      });
     *
     *      // Calling a custom Html macro with parameters
     *      echo Html::my_element('monstra');
     *
     *
     *
     * @param string  $name  Name
     * @param Closure $macro Macro
     */
    public static function macro($name, $macro)
    {
        Html::$macros[$name] = $macro;
    }

    /**
     * Convert special characters to HTML entities. All untrusted content
     * should be passed through this method to prevent XSS injections.
     *
     *
     *		echo Html::chars($username);
     *
     *
     * @param  string  $value         String to convert
     * @param  boolean $double_encode Encode existing entities
     * @return string
     */
    public static function chars($value, $double_encode = true)
    {
        return htmlspecialchars((string) $value, ENT_QUOTES, 'utf-8', $double_encode);
    }

    /**
     * Compiles an array of HTML attributes into an attribute string.
     * Attributes will be sorted using Html::$attribute_order for consistency.
     *
     *
     *		echo '
'.$content.'
';
     *
     *
     * @param  array  $attributes Attribute list
     * @return string
     */
    public static function attributes(array $attributes = null)
    {
        if (empty($attributes)) return '';

        // Init var
        $sorted = array();

        foreach (Html::$attribute_order as $key) {

            if (isset($attributes[$key])) {
                // Add the attribute to the sorted list
                $sorted[$key] = $attributes[$key];
            }

        }

        // Combine the sorted attributes
        $attributes = $sorted + $attributes;

        $compiled = '';
        foreach ($attributes as $key => $value) {

            if ($value === NULL) {
                // Skip attributes that have NULL values
                continue;
            }

            if (is_int($key)) {
                // Assume non-associative keys are mirrored attributes
                $key = $value;
            }

            // Add the attribute value
            $compiled .= ' '.$key.'="'.Html::chars($value).'"';
        }

        return $compiled;
    }

    /**
     * Create br tags
     *
     *
     *	 	echo Html::br(2);
     *
     *
     * @param  integer $num Count of line break tag
     * @return string
     */
    public static function br($num = 1)
    {
        return str_repeat("
",(int) $num);
    }

    /**
     * Create
     *
     *
     *		echo Html::nbsp(2);
     *
     *
     * @param  integer $num Count of
     * @return string
     */
    public static function nbsp($num = 1)
    {
        return str_repeat(" ", (int) $num);
    }

    /**
     * Create an arrow
     *
     *
     *		echo Html::arrow('right');
     *
     *
     * @param  string  $direction Arrow direction [up,down,left,right]
     * @param  boolean $render    If this option is true then render html object else return it
     * @return string
     */
    public static function arrow($direction)
    {
        switch ($direction) {
            case "up": 	  $output = '↑'; break;
            case "down":  $output = '↓'; break;
            case "left":  $output = '←'; break;
            case "right": $output = '→'; break;
        }

           return $output;
    }

    /**
     * Create HTML link anchor.
     *
     *
     *		echo Html::anchor('About', 'http://sitename.com/about');
     *
     *
     * @param string $title Anchor title
     * @param string $url   Anchor url
      * @param array  $attributes Anchor attributes
      * @uses  Html::attributes
      * @return string
     */
    public static function anchor($title, $url = null, array $attributes = null)
    {
        // Add link
        if ($url !== null) $attributes['href'] = $url;
        return ''.$title.'';
    }

    /**
     * Create HTML <h> tag
     *
     *
     *		echo Html::heading('Title', 1);
     *
     *
     * @param string  $title      Text
     * @param integer $h          Number [1-6]
     * @param array   $attributes Heading attributes
     * @uses  Html::attributes
     * @return string
     */
    public static function heading($title, $h = 1, array $attributes = null)
    {
        $output = '<h'.(int) $h.Html::attributes($attributes).'>'.$title.'</h'.(int) $h.'>';

        return $output;
    }

    /**
     * Generate document type declarations
     *
     *
     *		echo Html::doctype('html5');
     *
     *
     * @param  string $type Doctype to generated
     * @return mixed
     */
    public static function doctype($type = 'html5')
    {
        $doctypes = array('xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
                  'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
                  'xhtml1-trans'  => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
                  'xhtml1-frame'  => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
                  'html5'	  => '<!DOCTYPE html>',
                  'html4-strict'  => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
                  'html4-trans'	  => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
                  'html4-frame'	  => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">');

        if (isset($doctypes[$type])) return $doctypes[$type]; else return false;

    }

    /**
     * Create image
     *
     *
     *  	echo Html::image('data/files/pic1.jpg');
     *
     *
     * @param array  $attributes Image attributes
     * @param string $file       File
     * @uses  Url::base
     * @return string
     */
    public static function image($file, array $attributes = null)
    {
        if (strpos($file, '://') === FALSE) {
            $file = Url::base().'/'.$file;
        }

        // Add the image link
        $attributes['src'] = $file;
        $attributes['alt'] = (isset($attributes['alt'])) ? $attributes['alt'] : pathinfo($file, PATHINFO_FILENAME);

        return '';
    }

	/**
	 * Obfuscate an e-mail address to prevent spam-bots from sniffing it.
     *
     *
     *  	echo Html::email('gelato@monstra.org');
     *
     *
	 * @param  string  $email
	 * @return string
	 */
	 public static function email($email)
	 {
	     return str_replace('@', '@', Html::obfuscate($email));
	 }

    /**
	 * Obfuscate a string to prevent spam-bots from sniffing it.
	 *
     * This method obfuscate the value, randomly convert each
     * letter to its entity or hexadecimal representation, keeping a
     * bot from sniffing the randomly obfuscated letters.
     *
     *
     *  	echo Html::obfuscate('gelato@monstra.org');
     *
     *
	 * @param  string  $value
	 * @return string
	 */
	public static function obfuscate($value)
	{
		$safe = '';

		foreach (str_split($value) as $letter) {
			switch (rand(1, 3)) {
				case 1:
					$safe .= '&#'.ord($letter).';';
				break;
				case 2:
					$safe .= '&#x'.dechex(ord($letter)).';';
				break;
				case 3:
					$safe .= $letter;
			}
		}

		return $safe;
	}

    /**
     * Convert html to plain text
     *
     *
     *  	echo Html::toText('test');
     *
     *
     * @param  string $str String
     * @return string
     */
    public static function toText($str)
    {
        return htmlspecialchars($str, ENT_QUOTES, 'utf-8');
    }

    /**
     * Dynamically handle calls to custom macros.
     *
     * @param  string $method
     * @param  array  $parameters
     * @return mixed
     */
    public static function __callStatic($method, $parameters)
    {
        if (isset(Html::$macros[$method])) {
            return call_user_func_array(Html::$macros[$method], $parameters);
        }

        throw new RuntimeException("Method [$method] does not exist.");
    }

}


text:
<?php
// Text
$_['text_title']           = 'Klarna Account';
$_['text_pay_month']       = 'Klarna Account - Pay from %s/month ';
$_['text_information']     = 'Klarna Account Information';
$_['text_additional']      = 'Klarna Account requires some additional information before they can proccess your order.';
$_['text_wait']            = 'Please wait!';
$_['text_male']            = 'Male';
$_['text_female']          = 'Female';
$_['text_year']            = 'Year';
$_['text_month']           = 'Month';
$_['text_day']             = 'Day';
$_['text_payment_option']  = 'Payment options';
$_['text_single_payment']  = 'Single Payment';
$_['text_monthly_payment'] = '%s - %s per month';
$_['text_comment']         = "Klarna's Invoice ID: %s\n%s/%s: %.4f";

// Entry
$_['entry_gender']         = 'Gender:';
$_['entry_pno']            = 'Personal Number:
Please enter your Social Security number here.';
$_['entry_dob']            = 'Date of Birth:';
$_['entry_phone_no']       = 'Phone number:
Please enter your phone number.';
$_['entry_street']         = 'Street:
Please note that delivery can only take place to the registered address when paying with Klarna.';
$_['entry_house_no']       = 'House No.:
Please enter your house number.';
$_['entry_house_ext']      = 'House Ext.:
Please submit your house extension here. E.g. A, B, C, Red, Blue ect.';
$_['entry_company']        = 'Company Registration Number:
Please enter your Company\'s registration number';

// Error
$_['error_deu_terms']      = 'You must agree to Klarna\'s privacy policy (Datenschutz)';
$_['error_address_match']  = 'Billing and Shipping addresses must match if you want to use Klarna Payments';
$_['error_network']        = 'Error occurred while connecting to Klarna. Please try again later.';
?>


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Events;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Services;

namespace Umbraco.Core.PropertyEditors.ValueConverters
{
    [DefaultPropertyValueConverter]
    [PropertyValueType(typeof(IEnumerable<string>))]
    [PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
    public class TagsValueConverter : PropertyValueConverterBase
    {
        private readonly IDataTypeService _dataTypeService;

        //TODO: Remove this ctor in v8 since the other one will use IoC
        public TagsValueConverter()
            : this(ApplicationContext.Current.Services.DataTypeService)
        {
        }

        public TagsValueConverter(IDataTypeService dataTypeService)
        {
            if (dataTypeService == null) throw new ArgumentNullException("dataTypeService");
            _dataTypeService = dataTypeService;
        }

        public override bool IsConverter(PublishedPropertyType propertyType)
        {
            if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters)
            {
                return propertyType.PropertyEditorAlias.InvariantEquals(Constants.PropertyEditors.TagsAlias);
            }
            return false;
        }

        public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
        {
            // if Json storage type deserialzie and return as string array
            if (JsonStorageType(propertyType.DataTypeId))
            {
                var jArray = JsonConvert.DeserializeObject<JArray>(source.ToString());
                return jArray.ToObject<string[]>();
            }

            // Otherwise assume CSV storage type and return as string array
            var csvTags =
                source.ToString()
                    .Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();
            return csvTags;
        }

        public override object ConvertSourceToObject(PublishedPropertyType propertyType, object source, bool preview)
        {
            if (source == null)
            {
                return null;
            }
            return (string[]) source;
        }

        /// <summary>
        /// Discovers if the tags data type is storing its data in a Json format
        /// </summary>
        /// <param name="dataTypeId">
        /// The data type id.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        private bool JsonStorageType(int dataTypeId)
        {
            // GetPreValuesCollectionByDataTypeId is cached at repository level;
            // still, the collection is deep-cloned so this is kinda expensive,
            // better to cache here + trigger refresh in DataTypeCacheRefresher

            return Storages.GetOrAdd(dataTypeId, id =>
            {
                var preValue = _dataTypeService.GetPreValuesCollectionByDataTypeId(id)
                    .PreValuesAsDictionary
                    .FirstOrDefault(x => string.Equals(x.Key, "storageType", StringComparison.InvariantCultureIgnoreCase))
                    .Value;

                return preValue != null && preValue.Value.InvariantEquals("json");
            });
        }

        private static readonly ConcurrentDictionary<int, bool> Storages = new ConcurrentDictionary<int, bool>();

        internal static void ClearCaches()
        {
            Storages.Clear();
        }
    }
}


text:
namespace ray {
namespace api {

template <typename ReturnType>
class TaskCaller {
 public:
  TaskCaller();

  TaskCaller(RayRuntime *runtime, RemoteFunctionPtrHolder ptr,
             std::vector<std::unique_ptr<::ray::TaskArg>> &&args);

  ObjectRef<ReturnType> Remote();

 private:
  RayRuntime *runtime_;
  RemoteFunctionPtrHolder ptr_;
  std::vector<std::unique_ptr<::ray::TaskArg>> args_;
};

// ---------- implementation ----------

template <typename ReturnType>
TaskCaller<ReturnType>::TaskCaller() {}

template <typename ReturnType>
TaskCaller<ReturnType>::TaskCaller(RayRuntime *runtime, RemoteFunctionPtrHolder ptr,
                                   std::vector<std::unique_ptr<::ray::TaskArg>> &&args)
    : runtime_(runtime), ptr_(ptr), args_(std::move(args)) {}

template <typename ReturnType>
ObjectRef<ReturnType> TaskCaller<ReturnType>::Remote() {
  auto returned_object_id = runtime_->Call(ptr_, args_);
  return ObjectRef<ReturnType>(returned_object_id);
}
}  // namespace api
}  // namespace ray


text:
using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using EasyApi.Utils;

namespace EasyApi.Http
{
	internal class AsyncHttpClient : System.Net.Http.HttpClient
	{
		[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The created handler is disposed by the caller.")]
		private static HttpClientHandler CreateHandlerFrom(HttpClientOptions options)
		{
			Argument.IsNotNull(options, nameof(options));

			return new HttpClientHandler
			{
				Credentials = null,
				UseDefaultCredentials = false,
				Proxy = null,
				UseProxy = false,
				UseCookies = false,
				AllowAutoRedirect = options.AllowAutoRedirect,
				AutomaticDecompression = options.AutomaticDecompression
					? HttpClient.DefaultDecompressionMethods
					: DecompressionMethods.None
			};
		}

		[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The created handler is disposed by the caller.")]
		public AsyncHttpClient(HttpClientOptions options)
			: base(CreateHandlerFrom(options), disposeHandler: true)
		{
			Timeout = options.RequestTimeout;
			DefaultRequestHeaders.UserAgent.ParseAdd(options.UserAgent);
		}

		private bool IsTimeoutException(OperationCanceledException exception, TimeSpan requestDuration)
		{
			if (exception.CancellationToken.IsCancellationRequested)
			{
				return false;
			}

			if (Timeout == System.Threading.Timeout.InfiniteTimeSpan)
			{
				return false;
			}

			return requestDuration >= Timeout;
		}

		public async Task<HttpResponseMessage> SendRequestAsync(HttpRequestMessage request)
		{
			Argument.IsNotNull(request, nameof(request));

			var requestStartedOn = DateTime.UtcNow;
			try
			{
				return await SendAsync(request).ConfigureAwait(false);
			}
			catch (OperationCanceledException ex) when (IsTimeoutException(ex, DateTime.UtcNow - requestStartedOn))
			{
				throw HttpClient.RequestTimeoutException(ex);
			}
			finally
			{
				request.Dispose();
			}
		}
	}
}


text:
/*
 * Sets up the model with client-side metadata
 * and any other model extensions we need (none so far)
 */
(function (){
    'use strict';
    angular.module('app').factory('model', ['$log','$q','breeze','config', service]);

    function service($log, $q, breeze, config){
        var model =  {
            setModel: setModel
        };
        return model;
        //////////////////////

        function setModel(manager) {
            // could do more to the model but we don't in this example
            return getMetadata(manager);
        }

        function getMetadata(manager) {
            if(config.hasServerMetadata){
                // Get metadata from the server
                return manager.metadataStore
                    .fetchMetadata(manager.dataService)
                    .then(function(){return manager;})
                    .catch(metadataFetchFailed);

            } else {
                // Get metadata from the client
                addClientMetadata(manager);
                return $q.when(manager) ;
            }

            function metadataFetchFailed(error){
                var err = 'Metadata fetch failed.\nIs the server running?';
                $log.error(err+'\n'+ error);
                return $q.reject(err);
            }
        }

        function addClientMetadata(manager) {
            var DT = breeze.DataType;
            var store = manager.metadataStore;
            var helper = new breeze.config.MetadataHelper(
                'Model',
                breeze.AutoGeneratedKeyType.Identity);

            // Associate the metadata with the manager's data service
            store.addDataService(manager.dataService);

            addTodoItemType();

            function addTodoItemType() {
                var entityType = {
                    name: "TodoItem",
                    defaultResourceName: "TodoItem",
                    dataProperties: {
                        id:       { type: DT.Guid },
                        text:     { max: 50, required: true  },
                        complete: { type: DT.Boolean, required: true }
                    }
                };

                helper.addTypeToStore(store, entityType);

                return entityType;
            }
        }
    }
})();


text:
using namespace swift;

// Instantiate template members.
template class llvm::LoopBase<SILBasicBlock, SILLoop>;
template class llvm::LoopInfoBase<SILBasicBlock, SILLoop>;

void SILLoop::dump() const {
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
  print(llvm::dbgs());
#endif
}

SILLoopInfo::SILLoopInfo(SILFunction *F, DominanceInfo *DT) : Dominance(DT) {
  LI.analyze(*Dominance);
}

bool SILLoop::canDuplicate(SILInstruction *I) const {
  // The deallocation of a stack allocation must be in the loop, otherwise the
  // deallocation will be fed by a phi node of two allocations.
  if (I->isAllocatingStack()) {
    for (auto *UI : cast<SingleValueInstruction>(I)->getUses()) {
      if (UI->getUser()->isDeallocatingStack()) {
        if (!contains(UI->getUser()->getParent()))
          return false;
      }
    }
    return true;
  }

  // CodeGen can't build ssa for objc methods.
  if (auto *Method = dyn_cast<MethodInst>(I)) {
    if (Method->getMember().isForeign) {
      for (auto *UI : Method->getUses()) {
        if (!contains(UI->getUser()))
          return false;
      }
    }
    return true;
  }

  // We can't have a phi of two openexistential instructions of different UUID.
  if (isa<OpenExistentialAddrInst>(I) || isa<OpenExistentialRefInst>(I) ||
      isa<OpenExistentialMetatypeInst>(I) ||
      isa<OpenExistentialValueInst>(I) || isa<OpenExistentialBoxInst>(I) ||
      isa<OpenExistentialBoxValueInst>(I)) {
    SingleValueInstruction *OI = cast<SingleValueInstruction>(I);
    for (auto *UI : OI->getUses())
      if (!contains(UI->getUser()))
        return false;
    return true;
  }

  if (auto *Dealloc = dyn_cast<DeallocStackInst>(I)) {
    // The matching alloc_stack must be in the loop.
    if (auto *Alloc = dyn_cast<AllocStackInst>(Dealloc->getOperand()))
        return contains(Alloc->getParent());
    return false;
  }

  // The entire coroutine execution must be within the loop.
  // Note that we don't have to worry about the reverse --- a loop which
  // contains an end_apply or abort_apply of an external begin_apply ---
  // because that wouldn't be structurally valid in the first place.
  if (auto BAI = dyn_cast<BeginApplyInst>(I)) {
    for (auto UI : BAI->getTokenResult()->getUses()) {
      auto User = UI->getUser();
      assert(isa<EndApplyInst>(User) || isa<AbortApplyInst>(User));
      if (!contains(User))
        return false;
    }
    return true;
  }

  if (isa<ThrowInst>(I))
    return false;

  if (isa<BeginAccessInst>(I))
    return false;

  assert(I->isTriviallyDuplicatable() &&
    "Code here must match isTriviallyDuplicatable in SILInstruction");
  return true;
}

void SILLoopInfo::verify() const {
  LI.verify(*Dominance);
}


text:
// Copyright 2014 Vladimir Alyamkin. All Rights Reserved.

#pragma once

#include "VaOceanTypes.generated.h"

/** Phillips spectrum configuration */
USTRUCT()
struct FSpectrumData
{
	GENERATED_USTRUCT_BODY()

	/** The size of displacement map. Must be power of 2. */
	UPROPERTY(BlueprintReadOnly, Category = Ocean)
	int32 DispMapDimension;

	/** The side length (world space) of square patch. Typical value is 1000 ~ 2000. */
	UPROPERTY(EditDefaultsOnly, Category = Ocean)
	float PatchLength;

	/** Adjust the time interval for simulation (controls the simulation speed) */
	UPROPERTY(EditDefaultsOnly, Category = Ocean)
	float TimeScale;

	/** Amplitude for transverse wave. Around 1.0 (not the world space height). */
	UPROPERTY(EditDefaultsOnly, Category = Ocean)
	float WaveAmplitude;

	/** Wind direction. Normalization not required */
	UPROPERTY(EditDefaultsOnly, Category = Ocean)
	FVector2D WindDirection;

	/** The bigger the wind speed, the larger scale of wave crest. But the wave scale can be no larger than PatchLength.
	Around 100 ~ 1000 */
	UPROPERTY(EditDefaultsOnly, Category = Ocean)
	float WindSpeed;

	/** This value damps out the waves against the wind direction. Smaller value means higher wind dependency. */
	UPROPERTY(EditDefaultsOnly, Category = Ocean)
	float WindDependency;

	/** The amplitude for longitudinal wave. Higher value creates pointy crests. Must be positive. */
	UPROPERTY(EditDefaultsOnly, Category = Ocean)
	float ChoppyScale;

	/** Defaults */
	FSpectrumData()
	{
		DispMapDimension = 512;		// Not editable because of FFT shader config
		PatchLength = 2000.0f;
		TimeScale = 0.8f;
		WaveAmplitude = 0.35f;
		WindDirection = FVector2D(0.8f, 0.6f);
		WindSpeed = 600.0f;
		WindDependency = 0.07f;
		ChoppyScale = 1.3f;
	}
};


text:
using System;
using System.Collections.Generic;
using System.Text;
using DBlog.Data;
using NHibernate;

namespace DBlog.TransitData
{
    public class TransitReferrerHostRollup : TransitObject
    {
        private string mName;

        public string Name
        {
            get
            {
                return mName;
            }
            set
            {
                mName = value;
            }
        }

        private string mRollup;

        public string Rollup
        {
            get
            {
                return mRollup;
            }
            set
            {
                mRollup = value;
            }
        }

        public TransitReferrerHostRollup()
        {

        }

        public TransitReferrerHostRollup(DBlog.Data.ReferrerHostRollup o)
            : base(o.Id)
        {
            Rollup = o.Rollup;
            Name = o.Name;
        }

        public ReferrerHostRollup GetReferrerHostRollup(ISession session)
        {
            ReferrerHostRollup referrerhostrollup = (Id != 0)
                ? (ReferrerHostRollup) session.Load(typeof(ReferrerHostRollup), Id)
                : new ReferrerHostRollup();
            referrerhostrollup.Name = Name;
            referrerhostrollup.Rollup = Rollup;
            return referrerhostrollup;
        }
    }
}


text:
"""Graph neural network model.

Implements a basic GraphNetwork (Battaglia et al., 2018) with explicit node,
edge, and global state updates using a fully connected neural network as
described in https://arxiv.org/abs/1806.01261. The input node and edge features
are encoded using a linear layer.

On the OGBG leaderboard:
https://ogb.stanford.edu/docs/leader_graphprop/#ogbg-molpcba, the model is the
closest to the GIN+Virtual Node (Xu et al., 2018) model, and it reaches
equivalent performance on the ogbg-molpcba dataset.
"""
from typing import Tuple

from flax import linen as nn
from init2winit.model_lib import base_model
from init2winit.model_lib import model_utils
import jax.numpy as jnp
import jraph
from ml_collections.config_dict import config_dict

# small hparams used for unit tests
DEFAULT_HPARAMS = config_dict.ConfigDict(
    dict(
        rng_seed=-1,
        model_dtype='float32',
        latent_dim=256,
        optimizer='adam',
        hidden_dims=(256,),
        batch_size=256,
        lr_hparams={
            'base_lr': 0.01,
            'schedule': 'constant'
        },
        opt_hparams={
            'beta1': 0.9,
            'beta2': 0.999,
            'epsilon': 1e-8,
            'weight_decay': 0.0,
        },
        activation_function='relu',
        l2_decay_factor=.0005,
        l2_decay_rank_threshold=2,
        num_message_passing_steps=5,
        normalizer='layer_norm',
        dropout_rate=0.1,
        total_accumulated_batch_size=None,
        grad_clip=None,
    ))

def _make_embed(latent_dim):

  def make_fn(inputs):
    return nn.Dense(features=latent_dim)(inputs)

  return make_fn

def _make_mlp(hidden_dims, maybe_normalize_fn, dropout, activation=nn.relu):
  """Creates a MLP with specified dimensions."""

  @jraph.concatenated_args
  def make_fn(inputs):
    x = inputs
    for dim in hidden_dims:
      x = nn.Dense(features=dim)(x)
      x = maybe_normalize_fn()(x)
      x = activation(x)
      x = dropout(x)
    return x

  return make_fn

class GNN(nn.Module):
  """Defines a graph network.

  The model assumes the input data is a jraph.GraphsTuple without global
  variables. The final prediction will be encoded in the globals.
  """
  num_outputs: int
  latent_dim: int
  hidden_dims: Tuple[int]
  normalizer: str
  dropout_rate: float
  num_message_passing_steps: int
  activation_function: str

  @nn.compact
  def __call__(self, graph, train):
    maybe_normalize_fn = model_utils.get_normalizer(self.normalizer, train)
    dropout = nn.Dropout(rate=self.dropout_rate, deterministic=not train)
    activation = model_utils.ACTIVATIONS[self.activation_function]

    graph = graph._replace(
        globals=jnp.zeros([graph.n_node.shape[0], self.num_outputs]))

    embedder = jraph.GraphMapFeatures(
        embed_node_fn=_make_embed(self.latent_dim),
        embed_edge_fn=_make_embed(self.latent_dim))
    graph = embedder(graph)

    for _ in range(self.num_message_passing_steps):
      net = jraph.GraphNetwork(
          update_edge_fn=_make_mlp(
              self.hidden_dims,
              maybe_normalize_fn=maybe_normalize_fn,
              dropout=dropout,
              activation=activation),
          update_node_fn=_make_mlp(
              self.hidden_dims,
              maybe_normalize_fn=maybe_normalize_fn,
              dropout=dropout,
              activation=activation),
          update_global_fn=_make_mlp(
              self.hidden_dims,
              maybe_normalize_fn=maybe_normalize_fn,
              dropout=dropout,
              activation=activation))

      graph = net(graph)

    # Map globals to represent the final result
    decoder = jraph.GraphMapFeatures(embed_global_fn=nn.Dense(self.num_outputs))
    graph = decoder(graph)

    return graph.globals

class GNNModel(base_model.BaseModel):
  """Defines the model for the graph network."""

  def get_fake_inputs(self, hps):
    """Helper method solely for the purpose of initializing the model."""
    assert 'input_node_shape' in hps and 'input_edge_shape' in hps
    graph = jraph.GraphsTuple(
        n_node=jnp.asarray([1]),
        n_edge=jnp.asarray([1]),
        nodes=jnp.ones((1,) + hps.input_node_shape),
        edges=jnp.ones((1,) + hps.input_edge_shape),
        globals=jnp.zeros((1,) + hps.output_shape),
        senders=jnp.asarray([0]),
        receivers=jnp.asarray([0]))
    # We need to wrap the GraphsTuple in a list so that it can be passed as
    # *inputs to the model init function.
    return [graph]

  def build_flax_module(self):
    return GNN(
        num_outputs=self.hps['output_shape'][-1],
        latent_dim=self.hps['latent_dim'],
        hidden_dims=self.hps['hidden_dims'],
        normalizer=self.hps['normalizer'],
        dropout_rate=self.hps['dropout_rate'],
        num_message_passing_steps=self.hps['num_message_passing_steps'],
        activation_function=self.hps['activation_function'],)


text:
package org.terasology.rendering;

import org.lwjgl.LWJGLUtil;
import org.lwjgl.Sys;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GL20;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.asset.AssetManager;
import org.terasology.asset.AssetType;
import org.terasology.asset.AssetUri;
import org.terasology.asset.Assets;
import org.terasology.registry.CoreRegistry;
import org.terasology.rendering.assets.material.Material;
import org.terasology.rendering.assets.material.MaterialData;
import org.terasology.rendering.assets.shader.Shader;
import org.terasology.rendering.assets.texture.Texture;
import org.terasology.rendering.opengl.GLSLMaterial;
import org.terasology.rendering.shader.ShaderParameters;
import org.terasology.rendering.shader.ShaderParametersBlock;
import org.terasology.rendering.shader.ShaderParametersChunk;
import org.terasology.rendering.shader.ShaderParametersCombine;
import org.terasology.rendering.shader.ShaderParametersDebug;
import org.terasology.rendering.shader.ShaderParametersDefault;
import org.terasology.rendering.shader.ShaderParametersHdr;
import org.terasology.rendering.shader.ShaderParametersLightBufferPass;
import org.terasology.rendering.shader.ShaderParametersLightGeometryPass;
import org.terasology.rendering.shader.ShaderParametersLightShaft;
import org.terasology.rendering.shader.ShaderParametersOcDistortion;
import org.terasology.rendering.shader.ShaderParametersParticle;
import org.terasology.rendering.shader.ShaderParametersPost;
import org.terasology.rendering.shader.ShaderParametersPrePost;
import org.terasology.rendering.shader.ShaderParametersSSAO;
import org.terasology.rendering.shader.ShaderParametersShadowMap;
import org.terasology.rendering.shader.ShaderParametersSky;
import org.terasology.rendering.shader.ShaderParametersSobel;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * Provides support for loading and applying shaders.
 *
 * @author Benjamin Glatzel
 */
public class ShaderManagerLwjgl implements ShaderManager {

    private static final Logger logger = LoggerFactory.getLogger(ShaderManagerLwjgl.class);

    private GLSLMaterial activeMaterial;
    private GLSLMaterial defaultShaderProgram;
    private GLSLMaterial defaultTexturedShaderProgram;

    public ShaderManagerLwjgl() {
        logger.info("Loading Terasology shader manager...");
        logger.info("LWJGL: {} / {}", Sys.getVersion(), LWJGLUtil.getPlatformName());
        logger.info("GL_VENDOR: {}", GL11.glGetString(GL11.GL_VENDOR));
        logger.info("GL_RENDERER: {}", GL11.glGetString(GL11.GL_RENDERER));
        logger.info("GL_VERSION: {}", GL11.glGetString(GL11.GL_VERSION));
        logger.info("SHADING_LANGUAGE VERSION: {}", GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION));

        String extStr = GL11.glGetString(GL11.GL_EXTENSIONS);

        // log shader extensions in smaller packages,
        // because the full string can be extremely long
        int extsPerLine = 8;

        // starting with OpenGL 3.0, extensions can also listed using
        // GL_NUM_EXTENSIONS and glGetStringi(GL_EXTENSIONS, idx)
        String[] exts = extStr.split(" ");
        if (exts.length > 0) {
            StringBuilder bldr = new StringBuilder(exts[0]);
            for (int i = 1; i < exts.length; i++) {
                if (i % extsPerLine == 0) {
                    logger.info("EXTENSIONS: {}", bldr.toString());
                    bldr.setLength(0);
                } else {
                    bldr.append(" ");
                }
                bldr.append(exts[i]);
            }
            if (bldr.length() > 0) {
                logger.info("EXTENSIONS: {}", bldr.toString());
            }
        }
    }

    @Override
    public void initShaders() {
        defaultShaderProgram = prepareAndStoreShaderProgramInstance("default", new ShaderParametersDefault());
        defaultTexturedShaderProgram = prepareAndStoreShaderProgramInstance("defaultTextured", new ShaderParametersDefault());

        // TODO: Find a better way to do this
        prepareAndStoreShaderProgramInstance("post", new ShaderParametersPost());
        prepareAndStoreShaderProgramInstance("ssao", new ShaderParametersSSAO());
        prepareAndStoreShaderProgramInstance("lightshaft", new ShaderParametersLightShaft());
        prepareAndStoreShaderProgramInstance("sobel", new ShaderParametersSobel());
        prepareAndStoreShaderProgramInstance("prePost", new ShaderParametersPrePost());
        prepareAndStoreShaderProgramInstance("combine", new ShaderParametersCombine());
        prepareAndStoreShaderProgramInstance("highp", new ShaderParametersDefault());
        prepareAndStoreShaderProgramInstance("blur", new ShaderParametersDefault());
        prepareAndStoreShaderProgramInstance("down", new ShaderParametersDefault());
        prepareAndStoreShaderProgramInstance("hdr", new ShaderParametersHdr());
        prepareAndStoreShaderProgramInstance("sky", new ShaderParametersSky());
        prepareAndStoreShaderProgramInstance("chunk", new ShaderParametersChunk());
        prepareAndStoreShaderProgramInstance("particle", new ShaderParametersParticle());
        prepareAndStoreShaderProgramInstance("block", new ShaderParametersBlock());
        prepareAndStoreShaderProgramInstance("shadowMap", new ShaderParametersShadowMap());
        prepareAndStoreShaderProgramInstance("debug", new ShaderParametersDebug());
        prepareAndStoreShaderProgramInstance("ocDistortion", new ShaderParametersOcDistortion());
        prepareAndStoreShaderProgramInstance("lightBufferPass", new ShaderParametersLightBufferPass());
        prepareAndStoreShaderProgramInstance("lightGeometryPass", new ShaderParametersLightGeometryPass());
        prepareAndStoreShaderProgramInstance("simple", new ShaderParametersDefault());
        prepareAndStoreShaderProgramInstance("ssaoBlur", new ShaderParametersDefault());
    }

    @Override
    public void setActiveMaterial(Material material) {
        // TODO: is this the best way to convert the material to the lwjgl version?  Do we need more checks?
        GLSLMaterial glslMaterial = (GLSLMaterial) material;
        if (!glslMaterial.equals(activeMaterial)) {
            activeMaterial = glslMaterial;
        }
    }

    @Override
    public void bindTexture(int slot, Texture texture) {
        if (activeMaterial != null && !activeMaterial.isDisposed()) {
            GL13.glActiveTexture(GL13.GL_TEXTURE0 + slot);
            // TODO: Need to be cubemap aware, only need to clear bind when switching from cubemap to 2D and vice versa,
            // TODO: Don't bind if already bound to the same
            GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture.getId());
            GL13.glActiveTexture(GL13.GL_TEXTURE0);
        }
    }

    @Override
    public Material getActiveMaterial() {
        return activeMaterial;
    }

    @Override
    public void recompileAllShaders() {
        for (Shader shader : CoreRegistry.get(AssetManager.class).listLoadedAssets(AssetType.SHADER, Shader.class)) {
            shader.recompile();
        }

        for (Material material : CoreRegistry.get(AssetManager.class).listLoadedAssets(AssetType.MATERIAL, Material.class)) {
            material.recompile();
        }

        activeMaterial = null;
    }

    private GLSLMaterial prepareAndStoreShaderProgramInstance(String title, ShaderParameters params) {
        String uri = "engine:" + title;
        Shader shader = Assets.getShader(uri);
        checkNotNull(shader, "Failed to resolve %s", uri);
        shader.recompile();
        GLSLMaterial material = Assets.generateAsset(new AssetUri(AssetType.MATERIAL, "engine:prog." + title), new MaterialData(shader), GLSLMaterial.class);
        material.setShaderParameters(params);

        return material;
    }

    /**
     * Enables the default shader program.
     */
    @Override
    public void enableDefault() {
        defaultShaderProgram.enable();
    }

    /**
     * Enables the default shader program.
     */
    @Override
    public void enableDefaultTextured() {
        defaultTexturedShaderProgram.enable();
    }

    @Override
    public void disableShader() {
        GL20.glUseProgram(0);
        activeMaterial = null;
    }

}


text:
<?php
/**
* Rss_model.php   model for a generic Customer
*
* Used to show how to do CRUD in CodeIgnitor
*
* @package ITC 260 CodeIgnitor - Gig Central
* @subpackage CONTROLLER
* @author Patricia Barker <patriciabethbarker@gmail.com>
* @version 1.0 2015/05/26
* @link http://www.tcbcommercialproperties.com/sandbox/ci/
* @license http://www.apache.org/licenses/LICENSE-2.0
* @see controllers/Rss.php
* @see views/rss/index.php
* @see index.php
* @todo none
*/

/**
 * Rss model for our Gig Central Project
 *
 * @see Rss_model
 * @todo none
 */

class Rss_model extends CI_Model {
    public function get_stories()
    {
      $data = [];
      //returns a string
      $rawFile = file_get_contents('http://news.google.com/?output=rss');
      //must be used to parse string to xml object
      $xml = simplexml_load_string($rawFile);
      //assigns xml object for each item to array item
      foreach ($xml->channel->item as $story) {
          $data["newsItem"][] = $story;
      }
      //returns whole array
      return $data;
    }//end get_stories() method
}//end Rss_model