text:
namespace Kodiak
{

// Forward declarations
class VertexShaderResource;
class HullShaderResource;
class DomainShaderResource;
class GeometryShaderResource;
class PixelShaderResource;
class ComputeShaderResource;

class IShader
{
public:
	virtual uint32_t GetPerViewDataSize() const = 0;
	virtual uint32_t GetPerObjectDataSize() const = 0;
	virtual const struct ShaderReflection::Signature& GetSignature() const = 0;
	virtual ShaderType GetType() const = 0;
	virtual bool IsReady() const = 0;
	virtual void Wait() = 0;
};

class VertexShader : public IShader
{
public:
	// Reflection info
	uint32_t GetPerViewDataSize() const final override;
	uint32_t GetPerObjectDataSize() const final override;
	const struct ShaderReflection::Signature& GetSignature() const final override;
	ShaderType GetType() const final override { return ShaderType::Vertex; }

	static std::shared_ptr<VertexShader> Load(const std::string& path);
	static std::shared_ptr<VertexShader> LoadImmediate(const std::string& path);
	void AddPostLoadCallback(std::function<void()> callback);
	bool IsReady() const final override;
	void Wait() final override;

	VertexShaderResource* GetResource() { return m_resource.get(); }

private:
	std::shared_ptr<VertexShaderResource> m_resource;
};

class HullShader : public IShader
{
public:
	// Reflection info
	uint32_t GetPerViewDataSize() const final override;
	uint32_t GetPerObjectDataSize() const final override;
	const struct ShaderReflection::Signature& GetSignature() const final override;
	ShaderType GetType() const final override { return ShaderType::Hull; }

	static std::shared_ptr<HullShader> Load(const std::string& path);
	static std::shared_ptr<HullShader> LoadImmediate(const std::string& path);
	void AddPostLoadCallback(std::function<void()> callback);
	bool IsReady() const final override;
	void Wait() final override;

	HullShaderResource* GetResource() { return m_resource.get(); }

private:
	std::shared_ptr<HullShaderResource> m_resource;
};

class DomainShader : public IShader
{
public:
	// Reflection info
	uint32_t GetPerViewDataSize() const final override;
	uint32_t GetPerObjectDataSize() const final override;
	const struct ShaderReflection::Signature& GetSignature() const final override;
	ShaderType GetType() const final override { return ShaderType::Domain; }

	static std::shared_ptr<DomainShader> Load(const std::string& path);
	static std::shared_ptr<DomainShader> LoadImmediate(const std::string& path);
	void AddPostLoadCallback(std::function<void()> callback);
	bool IsReady() const final override;
	void Wait() final override;

	DomainShaderResource* GetResource() { return m_resource.get(); }

private:
	std::shared_ptr<DomainShaderResource> m_resource;
};

class GeometryShader : public IShader
{
public:
	// Reflection info
	uint32_t GetPerViewDataSize() const final override;
	uint32_t GetPerObjectDataSize() const final override;
	const struct ShaderReflection::Signature& GetSignature() const final override;
	ShaderType GetType() const final override { return ShaderType::Geometry; }

	static std::shared_ptr<GeometryShader> Load(const std::string& path);
	static std::shared_ptr<GeometryShader> LoadImmediate(const std::string& path);
	void AddPostLoadCallback(std::function<void()> callback);
	bool IsReady() const final override;
	void Wait() final override;

	GeometryShaderResource* GetResource() { return m_resource.get(); }

private:
	std::shared_ptr<GeometryShaderResource> m_resource;
};

class PixelShader : public IShader
{
public:
	// Reflection info
	uint32_t GetPerViewDataSize() const final override;
	uint32_t GetPerObjectDataSize() const final override;
	const struct ShaderReflection::Signature& GetSignature() const final override;
	ShaderType GetType() const final override { return ShaderType::Pixel; }

	static std::shared_ptr<PixelShader> Load(const std::string& path);
	static std::shared_ptr<PixelShader> LoadImmediate(const std::string& path);
	void AddPostLoadCallback(std::function<void()> callback);
	bool IsReady() const final override;
	void Wait() final override;

	PixelShaderResource* GetResource() { return m_resource.get(); }

private:
	std::shared_ptr<PixelShaderResource> m_resource;
};

class ComputeShader : public IShader
{
public:
	// Reflection info
	uint32_t GetPerViewDataSize() const final override;
	uint32_t GetPerObjectDataSize() const final override;
	const struct ShaderReflection::Signature& GetSignature() const final override;
	ShaderType GetType() const final override { return ShaderType::Compute; }

	static std::shared_ptr<ComputeShader> Load(const std::string& path);
	static std::shared_ptr<ComputeShader> LoadImmediate(const std::string& path);
	void AddPostLoadCallback(std::function<void()> callback);
	bool IsReady() const final override;
	void Wait() final override;

	ComputeShaderResource* GetResource() { return m_resource.get(); }

private:
	std::shared_ptr<ComputeShaderResource> m_resource;
};

} // namespace Kodiak


text:
<!DOCTYPE html>

                Warning

Warning message.

    <panel:warning heading="Warning" icon="warning-sign">

Warning message.

    </panel:warning>

redpajama_set_name: RedPajamaGithub


text:
from django.db import models

class RessourcePublishedManager(models.Manager):
    """Manager for Ressource model"""
    def get_queryset(self):
        return super(RessourcePublishedManager, self).get_queryset().filter(publish=True)

class GalleryPublishedManager(models.Manager):
    """Manager for Gallery model"""
    def get_queryset(self):
        return super(GalleryPublishedManager, self).get_queryset().filter(publish=True)

class AlbumPublishedManager(models.Manager):
    """Manager for Album model"""
    def get_queryset(self):
        return super(AlbumPublishedManager, self).get_queryset().filter(publish=True)


text:
package io.strimzi.systemtest;

import io.strimzi.test.TestUtils;

import java.time.Duration;

/**
 * Interface for keep global constants used across system tests.
 */
public interface Constants {
    long TIMEOUT_FOR_RESOURCE_RECOVERY = Duration.ofMinutes(6).toMillis();
    long TIMEOUT_FOR_MIRROR_MAKER_COPY_MESSAGES_BETWEEN_BROKERS = Duration.ofMinutes(7).toMillis();
    long TIMEOUT_FOR_LOG = Duration.ofMinutes(2).toMillis();
    long POLL_INTERVAL_FOR_RESOURCE_READINESS = Duration.ofSeconds(1).toMillis();
    long POLL_INTERVAL_FOR_RESOURCE_DELETION = Duration.ofSeconds(5).toMillis();
    long WAIT_FOR_ROLLING_UPDATE_INTERVAL = Duration.ofSeconds(5).toMillis();

    long TIMEOUT_FOR_SEND_RECEIVE_MSG = Duration.ofSeconds(60).toMillis();
    long TIMEOUT_FOR_CLUSTER_STABLE = Duration.ofMinutes(20).toMillis();

    long TIMEOUT_TEARDOWN = Duration.ofSeconds(10).toMillis();
    long GLOBAL_TIMEOUT = Duration.ofMinutes(5).toMillis();
    long GLOBAL_TIMEOUT_SHORT = Duration.ofMinutes(2).toMillis();
    long GLOBAL_CMD_CLIENT_TIMEOUT = Duration.ofMinutes(5).toMillis();
    long GLOBAL_STATUS_TIMEOUT = Duration.ofMinutes(3).toMillis();
    long GLOBAL_POLL_INTERVAL = Duration.ofSeconds(1).toMillis();
    long GLOBAL_POLL_INTERVAL_MEDIUM = Duration.ofSeconds(10).toMillis();
    long PRODUCER_TIMEOUT = Duration.ofSeconds(25).toMillis();

    long GLOBAL_TRACING_POLL = Duration.ofSeconds(30).toMillis();

    long API_CRUISE_CONTROL_POLL = Duration.ofSeconds(5).toMillis();
    long API_CRUISE_CONTROL_TIMEOUT = Duration.ofMinutes(10).toMillis();
    long GLOBAL_CRUISE_CONTROL_TIMEOUT = Duration.ofMinutes(2).toMillis();

    long OLM_UPGRADE_INSTALL_PLAN_TIMEOUT = Duration.ofMinutes(15).toMillis();
    long OLM_UPGRADE_INSTALL_PLAN_POLL = Duration.ofMinutes(1).toMillis();

    long GLOBAL_CLIENTS_POLL = Duration.ofSeconds(15).toMillis();
    long GLOBAL_CLIENTS_TIMEOUT = Duration.ofMinutes(2).toMillis();
    long GLOBAL_CLIENTS_EXCEPT_ERROR_TIMEOUT = Duration.ofSeconds(10).toMillis();

    long CO_OPERATION_TIMEOUT_DEFAULT = Duration.ofMinutes(5).toMillis();
    long CO_OPERATION_TIMEOUT_SHORT = Duration.ofSeconds(30).toMillis();
    long CO_OPERATION_TIMEOUT_MEDIUM = Duration.ofMinutes(2).toMillis();
    long RECONCILIATION_INTERVAL = Duration.ofSeconds(30).toMillis();
    long SAFETY_RECONCILIATION_INTERVAL = (RECONCILIATION_INTERVAL + Duration.ofSeconds(10).toMillis()) * 2;
    long LOGGING_RELOADING_INTERVAL = Duration.ofSeconds(30).toMillis();
    long CC_LOG_CONFIG_RELOAD = Duration.ofSeconds(5).toMillis();

    // Keycloak
    long KEYCLOAK_DEPLOYMENT_POLL = Duration.ofSeconds(5).toMillis();
    long KEYCLOAK_DEPLOYMENT_TIMEOUT = Duration.ofMinutes(10).toMillis();

    // stability count ensures that after some reconciliation we have some additional time
    int GLOBAL_STABILITY_OFFSET_COUNT = 20;
    // it is replacement instead of checking logs for reconciliation using dynamic waiting on some change for some period of time
    int GLOBAL_RECONCILIATION_COUNT = (int) ((RECONCILIATION_INTERVAL / GLOBAL_POLL_INTERVAL) + GLOBAL_STABILITY_OFFSET_COUNT);

    long THROTTLING_EXCEPTION_TIMEOUT = Duration.ofMinutes(10).toMillis();

    // sometimes each call `curl -X GET http://localhost:8083/connectors` could take in maximum 13s, and we do 50 calls; meaning (13s * 50)/60 ~= 11m
    long KAFKA_CONNECTOR_STABILITY_TIMEOUT = Duration.ofMinutes(12).toMillis();

    /**
     * Scraper pod labels
     */
    String SCRAPER_LABEL_KEY = "user-test-app";
    String SCRAPER_LABEL_VALUE = "scraper";

    String SCRAPER_NAME = "scraper";

    /**
     * Constants for Kafka clients labels
     */
    String KAFKA_CLIENTS_LABEL_KEY = "user-test-app";
    String KAFKA_ADMIN_CLIENT_LABEL_KEY = "user-test-admin-app";
    String KAFKA_CLIENTS_LABEL_VALUE = "kafka-clients";
    String KAFKA_ADMIN_CLIENT_LABEL_VALUE = "kafka-clients";
    String KAFKA_BRIDGE_CLIENTS_LABEL_VALUE = "kafka-clients";

    String STRIMZI_DEPLOYMENT_NAME = "strimzi-cluster-operator";
    String ALWAYS_IMAGE_PULL_POLICY = "Always";
    String IF_NOT_PRESENT_IMAGE_PULL_POLICY = "IfNotPresent";

    /**
     * Drain Cleaner related constants
     */
    String DRAIN_CLEANER_DEPLOYMENT_NAME = "strimzi-drain-cleaner";
    String DRAIN_CLEANER_NAMESPACE = "strimzi-drain-cleaner";

    /**
     * Constants for specific ports
     */
    int COMPONENTS_METRICS_PORT = 9404;
    int CLUSTER_OPERATOR_METRICS_PORT = 8080;
    int USER_OPERATOR_METRICS_PORT = 8081;
    int TOPIC_OPERATOR_METRICS_PORT = 8080;
    int KAFKA_BRIDGE_METRICS_PORT = 8080;
    int JMX_PORT = 9999;

    String DEPLOYMENT = "Deployment";
    String DEPLOYMENT_TYPE = "deployment-type";
    String SERVICE = "Service";
    String CONFIG_MAP = "ConfigMap";
    String SERVICE_ACCOUNT = "ServiceAccount";
    String CLUSTER_ROLE = "ClusterRole";
    String CLUSTER_ROLE_BINDING = "ClusterRoleBinding";
    String CUSTOM_RESOURCE_DEFINITION = "CustomResourceDefinition";
    String CUSTOM_RESOURCE_DEFINITION_SHORT = "Crd";
    String ROLE_BINDING = "RoleBinding";
    String ROLE = "Role";
    String DEPLOYMENT_CONFIG = "DeploymentConfig";
    String SECRET = "Secret";
    String KAFKA_EXPORTER_DEPLOYMENT = "KafkaWithExporter";
    String KAFKA_CRUISE_CONTROL_DEPLOYMENT = "KafkaWithCruiseControl";
    String STATEFUL_SET = "StatefulSet";
    String POD = "Pod";
    String NETWORK_POLICY = "NetworkPolicy";
    String JOB = "Job";
    String VALIDATION_WEBHOOK_CONFIG = "ValidatingWebhookConfiguration";

    /**
     * Kafka Bridge JSON encoding with JSON embedded format
     */
    String KAFKA_BRIDGE_JSON_JSON = "application/vnd.kafka.json.v2+json";
    String DEFAULT_SINK_FILE_PATH = "/tmp/test-file-sink.txt";

    int HTTP_BRIDGE_DEFAULT_PORT = 8080;
    int HTTPS_KEYCLOAK_DEFAULT_NODE_PORT = 32481;

    /**
     * Basic paths to examples
     */
    String PATH_TO_PACKAGING_EXAMPLES = TestUtils.USER_PATH + "/../packaging/examples";
    String PATH_TO_PACKAGING_INSTALL_FILES = TestUtils.USER_PATH + "/../packaging/install";

    /**
     * File paths for metrics YAMLs
     */
    String PATH_TO_KAFKA_METRICS_CONFIG = PATH_TO_PACKAGING_EXAMPLES + "/metrics/kafka-metrics.yaml";

    String METRICS_CONFIG_YAML_NAME = "metrics-config.yml";
    String METRICS_CONFIG_JSON_NAME = "metrics-config.json";

    String PATH_TO_KAFKA_CONNECT_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/connect/kafka-connect.yaml";
    String PATH_TO_KAFKA_CONNECT_METRICS_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/metrics/kafka-connect-metrics.yaml";
    String PATH_TO_KAFKA_BRIDGE_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/bridge/kafka-bridge.yaml";
    String PATH_TO_KAFKA_REBALANCE_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/cruise-control/kafka-rebalance-full.yaml";
    String PATH_TO_KAFKA_CRUISE_CONTROL_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/cruise-control/kafka-cruise-control.yaml";
    String PATH_TO_KAFKA_EPHEMERAL_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/kafka/kafka-ephemeral.yaml";
    String PATH_TO_KAFKA_PERSISTENT_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/kafka/kafka-persistent.yaml";
    String PATH_TO_KAFKA_CRUISE_CONTROL_METRICS_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/metrics/kafka-cruise-control-metrics.yaml";
    String PATH_TO_KAFKA_TOPIC_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/topic/kafka-topic.yaml";
    String PATH_TO_KAFKA_CONNECTOR_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/connect/source-connector.yaml";
    String PATH_TO_KAFKA_MIRROR_MAKER_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/mirror-maker/kafka-mirror-maker.yaml";
    String PATH_TO_KAFKA_MIRROR_MAKER_2_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/mirror-maker/kafka-mirror-maker-2.yaml";
    String PATH_TO_KAFKA_MIRROR_MAKER_2_METRICS_CONFIG = Constants.PATH_TO_PACKAGING_EXAMPLES + "/metrics/kafka-mirror-maker-2-metrics.yaml";

    /**
     * Feature gate related constants
     */
    String USE_STRIMZI_POD_SET = "+UseStrimziPodSets";
    String USE_STRIMZI_STATEFULSETS = "-UseStrimziPodSets";
    String USE_KRAFT_MODE = "+UseKRaft";

    /**
     * Default value which allows execution of tests with any tags
     */
    String DEFAULT_TAG = "all";

    /**
     * Tag for acceptance tests, which can be triggered manually for each push/pr/merge on Azure
     */
    String ACCEPTANCE = "acceptance";

    /**
     * Tag for regression tests which are stable.
     */
    String REGRESSION = "regression";

    /**
     * Tag for upgrade tests.
     */
    String UPGRADE = "upgrade";

    /**
     * Tag for olm upgrade tests
     */
    String OLM_UPGRADE = "olmupgrade";

    /**
     * Tag for smoke tests
     */
    String SMOKE = "smoke";

    /**
     * Tag for sanity tests
     */
    String SANITY = "sanity";

    /**
     * Tag for tests, which results are not 100% reliable on all testing environments.
     */
    String FLAKY = "flaky";

    /**
     * Tag for scalability tests
     */
    String SCALABILITY = "scalability";

    /**
     * Tag for tests, which are working only on specific environment and we usually don't want to execute them on all environments.
     */
    String SPECIFIC = "specific";

    /**
     * Tag for tests, which are using NodePort.
     */
    String NODEPORT_SUPPORTED = "nodeport";

    /**
     * Tag for tests, which are using LoadBalancer.
     */
    String LOADBALANCER_SUPPORTED = "loadbalancer";

    /**
     * Tag for tests, which are using NetworkPolicies.
     */
    String NETWORKPOLICIES_SUPPORTED = "networkpolicies";

    /**
     * Tag for Prometheus tests
     */
    String PROMETHEUS = "prometheus";

    /**
     * Tag for Tracing tests
     */
    String TRACING = "tracing";

    /**
     * Tag for Helm tests
     */
    String HELM = "helm";

    /**
     * Tag for oauth tests
     */
    String OAUTH = "oauth";

    /**
     * Tag for recovery tests
     */
    String RECOVERY = "recovery";

    /**
     * Tag for tests which deploys KafkaConnector resource
     */
    String CONNECTOR_OPERATOR = "connectoroperator";

    /**
     * Tag for tests which deploys KafkaConnect resource
     */
    String CONNECT = "connect";

    /**
     * Tag for tests which deploys KafkaMirrorMaker resource
     */
    String MIRROR_MAKER = "mirrormaker";

    /**
     * Tag for tests which deploys KafkaMirrorMaker2 resource
     */
    String MIRROR_MAKER2 = "mirrormaker2";

    /**
     * Tag for tests which deploys any of KafkaConnect, KafkaConnector, KafkaMirrorMaker2
     */
    String CONNECT_COMPONENTS = "connectcomponents";

    /**
     * Tag for tests which deploys KafkaBridge resource
     */
    String BRIDGE = "bridge";

    /**
     * Tag for tests which use internal Kafka clients (used clients in cluster)
     */
    String INTERNAL_CLIENTS_USED = "internalclients";

    /**
     * Tag for tests which use external Kafka clients (called from test code)
     */
    String EXTERNAL_CLIENTS_USED = "externalclients";

    /**
     * Tag for tests where metrics are used
     */
    String METRICS = "metrics";

    /**
     * Tag for tests where cruise control used
     */
    String CRUISE_CONTROL = "cruisecontrol";

    /**
     * Tag for tests where mainly dynamic configuration is used
     */
    String DYNAMIC_CONFIGURATION = "dynamicconfiguration";

    /**
     * Tag for tests which contains rolling update of resource
     */
    String ROLLING_UPDATE = "rollingupdate";

    /**
     * Tag for tests where OLM is used for deploying CO
     */
    String OLM = "olm";

    String ISOLATED_TEST = "isolatedtest";
    String PARALLEL_TEST = "paralleltest";
    /**
     * Tag for tests which executing in parallel namespaces
     */
    String PARALLEL_NAMESPACE = "parallelnamespace";
    // label for test case used for parallel execution of test suites
    String PARALLEL_SUITE = "parallelsuite";
    // label for test case used for isolation of test suites
    String ISOLATED_SUITE = "isolatedsuite";

    /**
     * Constants for filtering and matching our test suites names
     */
    String ISOLATED = "Isolated";
    String ST = "ST";

    String TEST_CASE_NAME_LABEL = "test.case";
    String TEST_SUITE_NAME_LABEL = "test.suite";

    /**
     * Cruise Control related parameters
     */
    String CRUISE_CONTROL_NAME = "Cruise Control";
    String CRUISE_CONTROL_CONTAINER_NAME = "cruise-control";
    String CRUISE_CONTROL_CONFIGURATION_ENV = "CRUISE_CONTROL_CONFIGURATION";
    String CRUISE_CONTROL_CAPACITY_FILE_PATH = "/tmp/capacity.json";
    String CRUISE_CONTROL_CONFIGURATION_FILE_PATH = "/tmp/cruisecontrol.properties";
    String CRUISE_CONTROL_LOG_FILE_PATH = "/opt/cruise-control/custom-config/log4j2.properties";

    /**
     * Default listeners names
     */
    String PLAIN_LISTENER_DEFAULT_NAME = "plain";
    String TLS_LISTENER_DEFAULT_NAME = "tls";
    String EXTERNAL_LISTENER_DEFAULT_NAME = "external";

    /**
     * Loadbalancer finalizer config
     */
    String LOAD_BALANCER_CLEANUP = "service.kubernetes.io/load-balancer-cleanup";

    // main namespace for Cluster Operator deployment
    String INFRA_NAMESPACE = "infra-namespace";
    String METRICS_SECOND_NAMESPACE = "second-metrics-cluster-test";

    /**
     * Auxiliary variables for storing data across our tests
     */
    String NAMESPACE_KEY = "NAMESPACE_NAME";
    String PREPARE_OPERATOR_ENV_KEY = "PREPARE_OPERATOR_ENV";

    /**
     * Auxiliary variable for cluster operator deployment
     */
    String WATCH_ALL_NAMESPACES = "*";

    String CLUSTER_KEY = "CLUSTER_NAME";
    String TOPIC_KEY = "TOPIC_NAME";
    String STREAM_TOPIC_KEY = "STREAM_TOPIC_NAME";
    String SCRAPER_KEY = "SCRAPER_NAME";
    String PRODUCER_KEY = "PRODUCER_NAME";
    String CONSUMER_KEY = "CONSUMER_NAME";
    String ADMIN_KEY = "ADMIN_NAME";
    String USER_NAME_KEY = "USER_NAME";
    String SCRAPER_POD_KEY = "SCRAPER_POD_NAME";
    String KAFKA_TRACING_CLIENT_KEY = "KAFKA_TRACING_CLIENT";
    String KAFKA_SELECTOR = "KAFKA_SELECTOR";
    String ZOOKEEPER_SELECTOR = "ZOOKEEPER_SELECTOR";
    String ENTITY_OPERATOR_NAME = "ENTITY_OPERATOR_NAME";
}


text:
Rails.application.routes.draw do
  root 'portfolio#index'

  resource :portfolio, controller: :portfolio, only: [:show]

  controller :user do
    get 'summary'
  end

  devise_for :users

  devise_for :admin
  namespace :admin do
    resource :portfolio, controller: :portfolio, only: [:show, :update] do
      member do
        get 'growth'
        get 'transactions'
      end
    end

    resource :summaries, only: [:show] do
      member do
        get 'user/:user_id', action: 'user', as: 'user'
        get 'year/:year',    action: 'year', as: 'year'
      end
    end

    resources :investments, only: [:show] do
      member do
        get 'prices'
      end
    end

    resources :tax_docs, only: [:index, :show] do
      member do
        get 'form_1065'
        get 'schedule_d'
        get 'schedule_k'
      end
    end
  end

  mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
end


text:
#ifndef QFUNCTIONS_VXWORKS_H
#define QFUNCTIONS_VXWORKS_H
#ifdef Q_OS_VXWORKS

#include <unistd.h>
#include <pthread.h>
#include <dirent.h>
#include <signal.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/times.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
#ifndef QT_NO_IPV6IFNAME
#include <net/if.h>
#endif

QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE

#ifdef QT_BUILD_CORE_LIB
QT_MODULE(Core)
#endif

QT_END_NAMESPACE
QT_END_HEADER

#ifndef RTLD_LOCAL
#define RTLD_LOCAL  0
#endif

#ifndef NSIG
#define NSIG _NSIGS
#endif

#ifdef __cplusplus
extern "C" {
#endif

// isascii is missing (sometimes!!)
#ifndef isascii
inline int isascii(int c)  { return (c & 0x7f); }
#endif

// no lfind() - used by the TIF image format
void *lfind(const void* key, const void* base, size_t* elements, size_t size,
            int (*compare)(const void*, const void*));

// no rand_r(), but rand()
// NOTE: this implementation is wrong for multi threaded applications,
// but there is no way to get it right on VxWorks (in kernel mode)
int rand_r(unsigned int * /*seedp*/);

// no usleep() support
int usleep(unsigned int);

// gettimeofday() is declared, but is missing from the library.
// It IS however defined in the Curtis-Wright X11 libraries, so
// we have to make the symbol 'weak'
int gettimeofday(struct timeval *tv, void /*struct timezone*/ *) __attribute__((weak));

// neither getpagesize() or sysconf(_SC_PAGESIZE) are available
int getpagesize();

// symlinks are not supported (lstat is now just a call to stat - see qplatformdefs.h)
int symlink(const char *, const char *);
ssize_t readlink(const char *, char *, size_t);

// there's no truncate(), but ftruncate() support...
int truncate(const char *path, off_t length);

// VxWorks doesn't know about passwd & friends.
// in order to avoid patching the unix fs path everywhere
// we introduce some dummy functions that simulate a single
// 'root' user on the system.

uid_t getuid();
gid_t getgid();
uid_t geteuid();

struct passwd {
    char   *pw_name;       /* user name */
    char   *pw_passwd;     /* user password */
    uid_t   pw_uid;        /* user ID */
    gid_t   pw_gid;        /* group ID */
    char   *pw_gecos;      /* real name */
    char   *pw_dir;        /* home directory */
    char   *pw_shell;      /* shell program */
};

struct group {
    char   *gr_name;       /* group name */
    char   *gr_passwd;     /* group password */
    gid_t   gr_gid;        /* group ID */
    char  **gr_mem;        /* group members */
};

struct passwd *getpwuid(uid_t uid);
struct group *getgrgid(gid_t gid);

#ifdef __cplusplus
} // extern "C"
#endif

#endif // Q_OS_VXWORKS
#endif // QFUNCTIONS_VXWORKS_H


text:
package org.elasticsearch.action.admin.cluster.node.info;

import org.elasticsearch.action.FailedNodeException;
import org.elasticsearch.action.support.nodes.BaseNodesResponse;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContentFragment;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.http.HttpInfo;
import org.elasticsearch.ingest.IngestInfo;
import org.elasticsearch.monitor.jvm.JvmInfo;
import org.elasticsearch.monitor.os.OsInfo;
import org.elasticsearch.monitor.process.ProcessInfo;
import org.elasticsearch.search.aggregations.support.AggregationInfo;
import org.elasticsearch.threadpool.ThreadPoolInfo;
import org.elasticsearch.transport.TransportInfo;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public class NodesInfoResponse extends BaseNodesResponse<NodeInfo> implements ToXContentFragment {

    public NodesInfoResponse(StreamInput in) throws IOException {
        super(in);
    }

    public NodesInfoResponse(ClusterName clusterName, List<NodeInfo> nodes, List<FailedNodeException> failures) {
        super(clusterName, nodes, failures);
    }

    @Override
    protected List<NodeInfo> readNodesFrom(StreamInput in) throws IOException {
        return in.readList(NodeInfo::new);
    }

    @Override
    protected void writeNodesTo(StreamOutput out, List<NodeInfo> nodes) throws IOException {
        out.writeList(nodes);
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        builder.startObject("nodes");
        for (NodeInfo nodeInfo : getNodes()) {
            builder.startObject(nodeInfo.getNode().getId());

            builder.field("name", nodeInfo.getNode().getName());
            builder.field("transport_address", nodeInfo.getNode().getAddress().toString());
            builder.field("host", nodeInfo.getNode().getHostName());
            builder.field("ip", nodeInfo.getNode().getHostAddress());

            builder.field("version", nodeInfo.getVersion());
            builder.field("build_flavor", nodeInfo.getBuild().flavor().displayName());
            builder.field("build_type", nodeInfo.getBuild().type().displayName());
            builder.field("build_hash", nodeInfo.getBuild().hash());
            if (nodeInfo.getTotalIndexingBuffer() != null) {
                builder.humanReadableField("total_indexing_buffer", "total_indexing_buffer_in_bytes", nodeInfo.getTotalIndexingBuffer());
            }

            builder.startArray("roles");
            for (DiscoveryNodeRole role : nodeInfo.getNode().getRoles()) {
                builder.value(role.roleName());
            }
            builder.endArray();

            if (nodeInfo.getNode().getAttributes().isEmpty() == false) {
                builder.startObject("attributes");
                for (Map.Entry<String, String> entry : nodeInfo.getNode().getAttributes().entrySet()) {
                    builder.field(entry.getKey(), entry.getValue());
                }
                builder.endObject();
            }

            if (nodeInfo.getSettings() != null) {
                builder.startObject("settings");
                Settings settings = nodeInfo.getSettings();
                settings.toXContent(builder, params);
                builder.endObject();
            }

            if (nodeInfo.getInfo(OsInfo.class) != null) {
                nodeInfo.getInfo(OsInfo.class).toXContent(builder, params);
            }
            if (nodeInfo.getInfo(ProcessInfo.class) != null) {
                nodeInfo.getInfo(ProcessInfo.class).toXContent(builder, params);
            }
            if (nodeInfo.getInfo(JvmInfo.class) != null) {
                nodeInfo.getInfo(JvmInfo.class).toXContent(builder, params);
            }
            if (nodeInfo.getInfo(ThreadPoolInfo.class) != null) {
                nodeInfo.getInfo(ThreadPoolInfo.class).toXContent(builder, params);
            }
            if (nodeInfo.getInfo(TransportInfo.class) != null) {
                nodeInfo.getInfo(TransportInfo.class).toXContent(builder, params);
            }
            if (nodeInfo.getInfo(HttpInfo.class) != null) {
                nodeInfo.getInfo(HttpInfo.class).toXContent(builder, params);
            }
            if (nodeInfo.getInfo(PluginsAndModules.class) != null) {
                nodeInfo.getInfo(PluginsAndModules.class).toXContent(builder, params);
            }
            if (nodeInfo.getInfo(IngestInfo.class) != null) {
                nodeInfo.getInfo(IngestInfo.class).toXContent(builder, params);
            }
            if (nodeInfo.getInfo(AggregationInfo.class) != null) {
                nodeInfo.getInfo(AggregationInfo.class).toXContent(builder, params);
            }

            builder.endObject();
        }
        builder.endObject();
        return builder;
    }

    @Override
    public String toString() {
        try {
            XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint();
            builder.startObject();
            toXContent(builder, EMPTY_PARAMS);
            builder.endObject();
            return Strings.toString(builder);
        } catch (IOException e) {
            return "{ \"error\" : \"" + e.getMessage() + "\"}";
        }
    }
}


text:
Sandbox for Love2D made with 💕 and Lua

# Installation

## MacOSX

* Download [Love2D](https://love2d.org/#download)
* Put the .app file in your Applications folder (`~/Applications`)
* Edit your `.profile` or `.bash_profile` to make an alias for the app:

```bash
alias love="/Applications/love.app/Contents/MacOS/love"
```

# Running Love2D

* Clone the sandbox repo: `git clone git@github.com:supermitch/love2D-sandbox.git`
* Navigate to the repo's root folder (where this README lives)
* To run a game type: `love <folder_name>`


text:
Duthie Bot
===============
Originally written as a [Discord](https://discordapp.com/) webhook powered by a series of [PHP scripts](http://php.net/), **Duthie Bot** has been reinvented as a [Discord](https://discordapp.com/) bot written in [Node.js](https://nodejs.org/). Providing features such as game updates, news tracking, and daily star reporting, **Duthie Bot** is the perfect addition to your [LeagueGaming.com](https://www.leaguegaming.com), [MyVirtualGaming.com](https://vghl.myvirtualgaming.com/), or [TheSPNHL.com](https://thespnhl.com) EA NHL team server.

The first iteration of **Duthie Bot** was a simple project for a simple low-volume use case. As interest grew, the need for a better solution became more and more apparent. In version 2, **Duthie Bot** has gone through some major performance improvements including a transition from filesystem storage to [sqlite3](https://www.sqlite.org/index.html) and a complete refactor of how the data mining scripts work.

Dependencies
============
 * [node.js](https://nodejs.org/) >= 6.11.3
 * [discord.js](//github.com/hydrabolt/discord.js) >= 11.2.1
 * [sqlite3](//github.com/mapbox/node-sqlite3) >= 4.0.0
 * [cron](//github.com/kelektiv/node-cron) >= 1.3.0
 * [moment](https://momentjs.com/) >= 2.22.0
 * [moment-timezone](https://momentjs.com/timezone/) >= 0.5.14
 * [request](//github.com/request/request) >= 2.83.0
 * [xml2json](//github.com/buglabs/node-xml2json) >= 0.11.2

How to Use
==========
To get started using **Duthie Bot**, you'll first need to authorize it to use your server. To accomplish this, go to https://discordapp.com/oauth2/authorize?&client_id=356076231185268746&scope=bot&permissions=0, select the server you're adding it to, and click "Authorize".

Once **Duthie Bot** has been added to your server, you will need to grant it permission to "Read Message" and "Send Messages" for any channel(s) you want it to have access to. Once **Duthie Bot** is able to read and send messages, you can begin configuring your update watchers.

Configuration
=============
From a channel **Duthie Bot** has access to, send the message `-duthie help` to get started, or read the [Commands](#commands) section below.

Commands
========
#### List
Lists the set of data available to your server.
```vb
# SYNTAX
  -duthie list <mode>[ type= <type>][ league=<league>][ team=<team>][ channel=<channel>]

# MODE (required)
  There are currently three supported list modes:
      * leagues       - list all leagues supported by Duthie Bot
      * teams         - list all teams in actively supported leagues
      * watchers      - list all watchers on your server

# TYPE (optional, mode=watchers)
  When listing the watchers on your server, you can provide any valid watcher type to filter the output on. The valid watcher types are:
      * all (default) - an alias for all other types: bidding, contract, draft, games, news, trades, waivers
      * all-news      - an alias for all other news types: bidding, contract, draft, news, trades, waivers
      * bids          - announces any winning bids that match your league and/or team filters
      * contracts     - announces any new contracts that match your league and/or team filters
      * daily-stars   - announces any of the previous day's daily stars that match your league and/or team filters
      * draft         - announces any new draft picks that match your league and/or team filters
      * games         - announces any updated game scores that match your league and/or team filters
      * news          - announces any news items that don't fit any other type, passes through the Duthie Bot news filter, and that matches your league and/or team filters
      * trades        - announces any trades that match your league and/or team filters
      * waivers       - announces any players placed on or claimed off waivers that match your league and/or team filters

# LEAGUE (optional, mode=teams,watchers)
  When listing teams or watchers, you can provide any league to filter the output on. See -duthie list leagues for a list of valid leagues.
  If specifying a league by name, be sure to wrap it in quotes (ex: "LGHL PSN") or remove any spaces (ex: LGHLPSN).

# TEAM (optional, mode=watchers)
  When listing watchers, you can provide any team to filter the output on. See -duthie list teams for a list of valid teams.

  If specifying a team by name, be sure to wrap it in quotes (ex: "Columbus Blue Jackets") or remove any spaces (ex: ColumbusBlueJackets).

# CHANNEL (optional, mode=watchers)
  When listing watchers, you can provide any channel to filter the output on.
```

#### Ping
Sends a ping to **Duthie Bot** to make sure it's parsing and responding to messages
```vb
# SYNTAX
  -duthie ping
```

#### Unwatch
Removes a watcher from your server's **Duthie Bot** data.
```vb
# SYNTAX
  -duthie unwatch type=<type>[ league=<league>][ team=<team>][ channel=<channel>]

# TYPE (required)
  There are currently nine valid types:
      * all         - an alias for all other types: bidding, contract, draft, games, news, trades, waivers
      * all-news    - an alias for all other news types: bidding, contract, draft, news, trades, waivers
      * bids        - announces any winning bids that match your league and/or team filters
      * contracts   - announces any new contracts that match your league and/or team filters
      * daily-stars - announces any of the previous day's daily stars that match your league and/or team filters
      * draft       - announces any new draft picks that match your league and/or team filters
      * games       - announces any updated game scores that match your league and/or team filters
      * news        - announces any news items that don't fit any other type, passes through the Duthie Bot news filter, and that matches your league and/or team filters
      * trades      - announces any trades that match your league and/or team filters
      * waivers     - announces any players placed on or claimed off waivers that match your league and/or team filters

# LEAGUE (optional)
  The league argument is optional when deregistering a watcher. If omitted, all watchers that match the other arguments will be removed. To specify a league, simple enter the league's id or name found on LeagueGaming.com. For a list of valid leagues, see -duthie list leagues.

  If specifying a league by name, be sure to wrap it in quotes (ex: "LGHL PSN") or remove any spaces (ex: LGHLPSN).

# TEAM (optional)
  The team argument is optional when deregistering a watcher. If omitted, all watchers that match the other arguments will be removed. To specify a team, simple enter the team's id or name found on LeagueGaming.com. For a list of valid teams, see -duthie list teams.

  If specifying a team by name, be sure to wrap it in quotes (ex: "Toronto Maple Leafs") or remove any spaces (ex: TorontoMapleLeafs).

# CHANNEL (optional)
  The channel argument is optional when deregistering a watcher. If omitted, the current channel will be used. To specify all channel, use `channel=*`.

  If specifying a team by name, be sure to wrap it in quotes (ex: "Toronto Maple Leafs") or remove any spaces (ex: TorontoMapleLeafs).
```

#### Watch
Adds a watcher to your server's **Duthie Bot** data.
```vb
# SYNTAX
  -duthie watch type=<type> league=<league>[ team=<team>][ channel=<channel>]

# TYPE (required)
  There are currently nine valid types:
      * all         - an alias for all other types: bidding, contract, draft, games, news, trades, waivers
      * all-news    - an alias for all other news types: bidding, contract, draft, news, trades, waivers
      * bids        - announces any winning bids that match your league and/or team filters
      * contracts   - announces any new contracts that match your league and/or team filters
      * daily-stars - announces any of the previous day's daily stars that match your league and/or team filters
      * draft       - announces any new draft picks that match your league and/or team filters
      * games       - announces any updated game scores that match your league and/or team filters
      * news        - announces any news items that don't fit any other type, passes through the Duthie Bot news filter, and that matches your league and/or team filters
      * trades      - announces any trades that match your league and/or team filters
      * waivers     - announces any players placed on or claimed off waivers that match your league and/or team filters

# LEAGUE (required)
  To register a watcher with Duthie Bot, you must specify a supported league from LeagueGaming.com. Duthie Bot does not support leagueless watchers at this time. To specify a league, simply enter the league's id or name found on LeagueGaming.com. For a list of valid leagues, see -duthie list leagues.

  If specifying a league by name, be sure to wrap it in quotes (ex: "LGHL PSN") or remove any spaces (ex: LGHLPSN).

# TEAM (optional)
  The team argument is optional for all types except games. Duthie Bot does not support teamless game watchers. To specify a team, simply enter the team's id or name found on LeagueGaming.com. For a list of valid teams, see -duthie list teams.

  If specifying a team by name, be sure to wrap it in quotes (ex: "Columbus Blue Jackets") or remove any spaces (ex: ColumbusBlueJackets).

# CHANNEL (optional)
  If you want messages from this watcher sent to a specific channel, tag it at the end of the command. If none are specified, messages will be sent to the server's default channel.
```

License
=======
MIT


text:
<?xml version="1.0" encoding="utf-8"?>

<!--

-->

<manifest
	xmlns:android="http://schemas.android.com/apk/res/android"
	package="uk.co.sinjakli.trivial"
	android:versionCode="2"
	android:versionName="1.0.1">
	<application
		android:icon="@drawable/icon"
		android:label="@string/app_name">
		<activity
			android:name=".HomeActivity"
			android:label="@string/app_name">
			<intent-filter>
				<action
					android:name="android.intent.action.MAIN" />
				<category
					android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity>
		<activity
			android:name=".QuizActivity" android:label="@string/app_name"></activity>
	<activity android:name="QuizEndActivity" android:label="@string/app_name"></activity>
</application>
	<uses-sdk
		android:minSdkVersion="4" />
</manifest>


text:
package cognitosynciface

import (
	"github.com/awslabs/aws-sdk-go/service/cognitosync"
)

// CognitoSyncAPI is the interface type for cognitosync.CognitoSync.
type CognitoSyncAPI interface {
	BulkPublish(*cognitosync.BulkPublishInput) (*cognitosync.BulkPublishOutput, error)

	DeleteDataset(*cognitosync.DeleteDatasetInput) (*cognitosync.DeleteDatasetOutput, error)

	DescribeDataset(*cognitosync.DescribeDatasetInput) (*cognitosync.DescribeDatasetOutput, error)

	DescribeIdentityPoolUsage(*cognitosync.DescribeIdentityPoolUsageInput) (*cognitosync.DescribeIdentityPoolUsageOutput, error)

	DescribeIdentityUsage(*cognitosync.DescribeIdentityUsageInput) (*cognitosync.DescribeIdentityUsageOutput, error)

	GetBulkPublishDetails(*cognitosync.GetBulkPublishDetailsInput) (*cognitosync.GetBulkPublishDetailsOutput, error)

	GetIdentityPoolConfiguration(*cognitosync.GetIdentityPoolConfigurationInput) (*cognitosync.GetIdentityPoolConfigurationOutput, error)

	ListDatasets(*cognitosync.ListDatasetsInput) (*cognitosync.ListDatasetsOutput, error)

	ListIdentityPoolUsage(*cognitosync.ListIdentityPoolUsageInput) (*cognitosync.ListIdentityPoolUsageOutput, error)

	ListRecords(*cognitosync.ListRecordsInput) (*cognitosync.ListRecordsOutput, error)

	RegisterDevice(*cognitosync.RegisterDeviceInput) (*cognitosync.RegisterDeviceOutput, error)

	SetIdentityPoolConfiguration(*cognitosync.SetIdentityPoolConfigurationInput) (*cognitosync.SetIdentityPoolConfigurationOutput, error)

	SubscribeToDataset(*cognitosync.SubscribeToDatasetInput) (*cognitosync.SubscribeToDatasetOutput, error)

	UnsubscribeFromDataset(*cognitosync.UnsubscribeFromDatasetInput) (*cognitosync.UnsubscribeFromDatasetOutput, error)

	UpdateRecords(*cognitosync.UpdateRecordsInput) (*cognitosync.UpdateRecordsOutput, error)
}


text:
<!DOCTYPE html>

		<title>Welcome to Angular.js</title>

			<input type="text" data-two-way-bind="firstName" />

			<input type="text" data-two-way-bind="lastName" />


text:
package org.apache.ambari.view.hive20;

import org.apache.ambari.view.hive20.persistence.utils.Indexed;

public class TestBean implements Indexed {
  public String someData;
  public String id;

  @Override
  public String getId() {
    return id;
  }

  @Override
  public void setId(String id) {
    this.id = id;
  }
}


text:
var expect = require('chai').expect;

var create = require('../lib/metadata').create;

describe('metadata creation', function() {

    it('should return null for null', function(done) {
        var result = create(null);
        expect(result).to.equal(null);
        done();
    });

    it('should return null for non http / https', function(done) {
        var result = create('httbiscuit://stuff');
        expect(result).to.equal(null);
        done();
    });

    it('should place root items inside root directory', function(done) {
        var result = create('http://www.slapdash.com');

        expect(result.directory).to.equal('http/www.slapdash.com');
        expect(result.fileName).to.equal('www.slapdash.com');
        expect(result.fileKey).to.equal('www.slapdash.com_21f5c9a33630696c0a200922f35df460');
        done();
    });

    it('should handle non root items (by slash) correctly', function(done) {
       var result = create('http://www.slapdash.com/item');

        expect(result.directory).to.equal('http/www.slapdash.com');
        expect(result.fileName).to.equal('item');
        expect(result.fileKey).to.equal('item_44eb2557837a13f07ba239aab731d727');
        done();
    });

    it('should handle non root items (by hash) correctly', function(done) {
        var result = create('http://www.slapdash.com/ontology#someItem');

        expect(result.directory).to.equal('http/www.slapdash.com/ontology');
        expect(result.fileName).to.equal('someItem');
        expect(result.fileKey).to.equal('someItem_530ed38cc4a8241efd3ab1bdab849675');
        done();
    });

});


text:
'use strict';

var nodevk = require('../lib/nodevk');

var code = process.argv[2];

if (code == null)
{
	var msg = 'Follow this URL, then copy the code from the address bar.\n'+
			  'Note, that the code is one-time use,'+
			  'because we dont store the access token.\n';
	console.log(
		msg+nodevk.getCodeURL({
			appId: '4769438',
			scope: ['notify']
		}));
	process.exit();
}

nodevk.getAccessTokenFromCode({
	appId: '4769438',
	appSecret: 'LpjFGDnO0fqBQ1q7Aw34',

	code: code
},
function doRequest(res)
{
	var query =
	{
		method: 'users.search',
		token: res.access_token,
		params:
		{
			q: 'Vasya Pupkin'
		}
	};

	query.dryRun = true;
	console.log(nodevk.execMethod(query));

	query.dryRun = false;
	nodevk.execMethod(query, console.log);
});


text:
require 'abstract_unit'
require 'fixtures/topic'
require 'fixtures/developer'
require 'fixtures/reply'

class Topic; def after_find() end end
class Developer; def after_find() end end
class SpecialDeveloper < Developer; end

class TopicManualObserver
  include Singleton

  attr_reader :action, :object, :callbacks

  def initialize
    Topic.add_observer(self)
    @callbacks = []
  end

  def update(callback_method, object)
    @callbacks << { "callback_method" => callback_method, "object" => object }
  end

  def has_been_notified?
    !@callbacks.empty?
  end
end

class TopicaObserver < ActiveRecord::Observer
  def self.observed_class() Topic end

  attr_reader :topic

  def after_find(topic)
    @topic = topic
  end
end

class TopicObserver < ActiveRecord::Observer
  attr_reader :topic

  def after_find(topic)
    @topic = topic
  end
end

class MultiObserver < ActiveRecord::Observer
  attr_reader :record

  def self.observed_class() [ Topic, Developer ] end

  cattr_reader :last_inherited
  @@last_inherited = nil

  def observed_class_inherited_with_testing(subclass)
    observed_class_inherited_without_testing(subclass)
    @@last_inherited = subclass
  end

  alias_method_chain :observed_class_inherited, :testing

  def after_find(record)
    @record = record
  end
end

class LifecycleTest < Test::Unit::TestCase
  fixtures :topics, :developers

  def test_before_destroy
    assert_equal 2, Topic.count
    Topic.find(1).destroy
    assert_equal 0, Topic.count
  end

  def test_after_save
    ActiveRecord::Base.observers = :topic_manual_observer
    ActiveRecord::Base.instantiate_observers

    topic = Topic.find(1)
    topic.title = "hello"
    topic.save

    assert TopicManualObserver.instance.has_been_notified?
    assert_equal :after_save, TopicManualObserver.instance.callbacks.last["callback_method"]
  end

  def test_observer_update_on_save
    ActiveRecord::Base.observers = TopicManualObserver
    ActiveRecord::Base.instantiate_observers

    topic = Topic.find(1)
    assert TopicManualObserver.instance.has_been_notified?
    assert_equal :after_find, TopicManualObserver.instance.callbacks.first["callback_method"]
  end

  def test_auto_observer
    topic_observer = TopicaObserver.instance

    topic = Topic.find(1)
    assert_equal topic.title, topic_observer.topic.title
  end

  def test_inferred_auto_observer
    topic_observer = TopicObserver.instance

    topic = Topic.find(1)
    assert_equal topic.title, topic_observer.topic.title
  end

  def test_observing_two_classes
    multi_observer = MultiObserver.instance

    topic = Topic.find(1)
    assert_equal topic.title, multi_observer.record.title

    developer = Developer.find(1)
    assert_equal developer.name, multi_observer.record.name
  end

  def test_observing_subclasses
    multi_observer = MultiObserver.instance

    developer = SpecialDeveloper.find(1)
    assert_equal developer.name, multi_observer.record.name

    klass = Class.new(Developer)
    assert_equal klass, multi_observer.last_inherited

    developer = klass.find(1)
    assert_equal developer.name, multi_observer.record.name
  end

  def test_invalid_observer
    assert_raise(ArgumentError) { Topic.observers = Object.new; Topic.instantiate_observers }
  end
end


text:
namespace v8 {
namespace internal {
namespace compiler {

class V8_EXPORT_PRIVATE MoveOptimizer final {
 public:
  MoveOptimizer(Zone* local_zone, InstructionSequence* code);
  void Run();

 private:
  typedef ZoneVector<MoveOperands*> MoveOpVector;
  typedef ZoneVector<Instruction*> Instructions;

  InstructionSequence* code() const { return code_; }
  Zone* local_zone() const { return local_zone_; }
  Zone* code_zone() const { return code()->zone(); }
  MoveOpVector& local_vector() { return local_vector_; }

  // Consolidate moves into the first gap.
  void CompressGaps(Instruction* instr);

  // Attempt to push down to the last instruction those moves that can.
  void CompressBlock(InstructionBlock* block);

  // Consolidate moves into the first gap.
  void CompressMoves(ParallelMove* left, MoveOpVector* right);

  // Push down those moves in the gap of from that do not change the
  // semantics of the from instruction, nor the semantics of the moves
  // that remain behind.
  void MigrateMoves(Instruction* to, Instruction* from);

  void RemoveClobberedDestinations(Instruction* instruction);

  const Instruction* LastInstruction(const InstructionBlock* block) const;

  // Consolidate common moves appearing accross all predecessors of a block.
  void OptimizeMerge(InstructionBlock* block);
  void FinalizeMoves(Instruction* instr);

  Zone* const local_zone_;
  InstructionSequence* const code_;
  MoveOpVector local_vector_;

  DISALLOW_COPY_AND_ASSIGN(MoveOptimizer);
};

}  // namespace compiler
}  // namespace internal
}  // namespace v8

#endif  // V8_COMPILER_MOVE_OPTIMIZER_


text:
.icon-logo {
	background-image: url('png/logo.png');
	background-repeat: no-repeat;
}


text:
package org.apache.ambari.logsearch.solr.model;

import org.apache.ambari.logsearch.model.response.ComponentTypeLogData;
import org.apache.solr.client.solrj.beans.Field;

import static org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.COMPONENT;

public class SolrComponentTypeLogData implements ComponentTypeLogData {

  @Field(COMPONENT)
  private String type;

  @Override
  public String getType() {
    return this.type;
  }

  @Override
  public void setType(String type) {
    this.type = type;
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~     Copyright 2016-2026 TinyZ
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>okra</artifactId>
        <groupId>org.ogcs</groupId>
        <version>1.0.1</version>
    </parent>
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <okra.version>2.0.0</okra.version>
    </properties>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>okra-core</artifactId>
    <packaging>jar</packaging>
    <version>${okra.version}</version>

    <issueManagement>
        <system>Github Issue</system>
        <url>https://github.com/ogcs/Okra/issues</url>
    </issueManagement>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>TinyZ.</name>
            <email>tinyzzh815@gmail.com</email>
        </developer>
    </developers>

    <build>
        <plugins>
            <!-- 设置源文件编码方式 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!--<configuration>
                    <defaultLibBundleDir>lib</defaultLibBundleDir>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>-->
            </plugin>
            <!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <!--<configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>com.sysware.HelloWorld</mainClass>
                        </manifest>
                    </archive>
                </configuration>-->
            </plugin>
            <!-- 拷贝依赖的jar包到lib目录 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.parent.basedir}/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- 解决资源文件的编码问题 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <!-- 打包source文件为jar文件(源码,可选) -->
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <configuration>
                    <attach>true</attach>
                    <!--<encoding>UTF-8</encoding>-->
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-all</artifactId>
        </dependency>
        <dependency>
            <groupId>com.lmax</groupId>
            <artifactId>disruptor</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.flex.blazeds</groupId>
            <artifactId>flex-messaging-core</artifactId>
            <version>4.7.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flex.blazeds</groupId>
            <artifactId>flex-messaging-common</artifactId>
            <version>4.7.2</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
    </dependencies>

</project>


text:
'use strict';

// Declare app level module which depends on filters, and services
angular.module('myApp', [
  'ngRoute',
  'myApp.filters',
  'myApp.services',
  'myApp.directives',
  'myApp.controllers'
]).
config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: 'TaskController'});
  $routeProvider.otherwise({redirectTo: '/view1'});
}]);


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2017] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

package EnsEMBL::REST::EnsemblModel::ExternalDB;

=pod

=head1 NAME

EnsEMBL::REST::EnsemblModel::ExternalDB

=head1 DESCRIPTION

Provides access to all external DBs in a given database. Please use the
C<EnsEMBL::REST::EnsemblModel::ExternalDB::get_ExternalDBs()> method
to populate the object.

=cut

use Moose;
use Bio::EnsEMBL::Utils::Scalar qw/assert_ref/;

=head2 ATTRIBUTES

=over 8

=item id - Integer Internal ID of the ExternalDB

=item name - String Name for the ExternalDB. Used in any endpoint when an external_db param is requested

=item release - Maybe[String] Optional release information of the ExternalDB

=item display_name - String Human readable name of the ExternalDB

=item description - Maybe[String] Verbose description of the ExternalDB

=back

=cut

has 'id'            => ( isa => 'Int', is => 'ro', required => 1);
has 'name'          => ( isa => 'Str', is => 'ro', required => 1 );
has 'release'       => ( isa => 'Maybe[Str]', is => 'ro', required => 1 );
has 'display_name'  => ( isa => 'Str', is => 'ro', required => 1 );
has 'description'   => ( isa => 'Maybe[Str]', is => 'ro', required => 1 );

=head2 get_ExternalDBs

  Args [1]    : DBAdaptor DBAdaptor to lookup external dbs in. Must be a core-like schema
  Args [2]    : String Filter pattern to apply to the query. Supports SQL like statements
  Example     : my $external_dbs = EnsEMBL::REST::EnsemblModel::ExternalDB->get_ExternalDBs($dba);
                my $go_external_dbs = EnsEMBL::REST::EnsemblModel::ExternalDB->get_ExternalDBs($dba, 'GO%');
  Description : Finds all external DBs in the given species' core database
  Returntype  : ArrayRef of ExternalDB objects
  Exceptions  : SQL based exceptions

=cut

sub get_ExternalDBs {
  my ($class, $dba, $filter, $feature) = @_;
  assert_ref($dba, 'Bio::EnsEMBL::DBSQL::DBAdaptor', 'DBAdaptor');
  $filter ||= '%';
  my $sql = <<'SQL';
select distinct e.external_db_id, e.db_name, e.db_release, e.db_display_name, e.description
from external_db e where db_name like ?
SQL
  if ($feature) {
    my @dbis = @{ $dba->dbc->sql_helper->execute_simple(-SQL => "select distinct external_db_id from $feature where external_db_id is not null") };
    my $list = join( ',', @dbis );
    $sql .= " and e.external_db_id in ($list)";
  }
  my $results = $dba->dbc->sql_helper->execute(-SQL => $sql, -PARAMS => [$filter], -CALLBACK => sub {
    my ($row) = @_;
    my ($id, $name, $release, $display_name, $description) = @{$row};
    return $class->new(
      id => $id, name => $name, release => $release,
      display_name => $display_name, description => $description
    );
  });
  return $results;
}

=head2 summary_as_hash

  Example     : my $hash = $obj->summary_as_hash();
  Description : Converts the current object into an unblessed hash fit for
                serialisation purposes
  Returntype  : HashRef Basic representation of the current object

=cut

sub summary_as_hash {
  my ($self) = @_;
  return {
    name          => $self->name(),
    release       => $self->release(),
    display_name  => $self->display_name(),
    description   => $self->description()
  };
}

1;


text:
package models

import (
	"fmt"
	"time"

	"github.com/gernest/wuxia/db"
)

//Session stores http session information.
type Session struct {
	Key       string `store:"key"`
	Data      []byte `store:"data"`
	CreatedOn time.Time
	UpdatedOn time.Time
	ExpiresOn time.Time `store:"expires_on"`
}

//CreateSession creates a new database record for the session s object. This
//sets CreatedOn and UpdatedOn fieds to time.Now().
func CreateSession(store *db.DB, s *Session) error {
	q := store.CreateSession(SessionTable)
	_, err := ExecModel(store, s, q)
	if err != nil {
		return err
	}
	return nil
}

//FindSessionByKey queries the databse for session with key field key.
func FindSessionByKey(store *db.DB, s *Session) (*Session, error) {
	q := store.FindSessionByKey(SessionTable)
	err := QueryRowModel(store, s, q).Scan(
		&s.Key,
		&s.Data,
		&s.CreatedOn,
		&s.UpdatedOn,
		&s.ExpiresOn,
	)
	if err != nil {
		return nil, err
	}
	return s, nil
}

//Count counts the number of rows in a table named table.
func Count(store *db.DB, table string) (int, error) {
	query := "SELECT count() FROM %s;"
	query = fmt.Sprintf(query, table)
	var rst int
	err := store.QueryRow(query).Scan(&rst)
	return rst, err
}

//UpdateSession updates a ratabase record for session whose key matches key.
//Only two fields are updated, the data and updated_on field.
func UpdateSession(store *db.DB, s *Session) error {
	q := store.UpdateSession(SessionTable)
	_, err := ExecModel(store, s, q)
	if err != nil {
		return err
	}
	return nil
}

//DeleteSession deletes a session record which matches key.
func DeleteSession(store *db.DB, s *Session) error {
	q := store.DeleteSession(SessionTable)
	_, err := ExecModel(store, s, q)
	if err != nil {
		return err
	}
	return nil
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Cron
{
/* CREATE USER DIRECTORY
************************************************************************************/
   public function create($user_id)
   {
      $command = "cd /home/labpetri/users/".PHP_EOL;
      exec($command);
      unset($command);
      $command = "mkdir /home/labpetri/users/{$user_id}".PHP_EOL;
      exec($command);
      unset($command);
      $command = "mkdir /home/labpetri/users/{$user_id}/research".PHP_EOL;
      exec($command);
   }
}