text:
package org.stajistics.session;

import java.io.Serializable;
import java.util.Collection;
import java.util.Set;

import org.stajistics.StatsKey;
import org.stajistics.StatsKeyMatcher;
import org.stajistics.util.ServiceLifeCycle;

/**
 * Manages the lifecycle of StatsSession instances.
 *
 * @author The Stajistics Project
 */
public interface StatsSessionManager extends Serializable,ServiceLifeCycle {

    /**
     * Get the total number of {@link StatsSession} instance being managed.
     *
     * @return The number of {@link StatsSession} instances.
     */
    int getSessionCount();

    /**
     * Get the Set of {@link StatsKey}s that are associated with the
     * {@link StatsSession}s being managed.
     *
     * @return A Set of {@link StatsKey}s, or an empty Set if there are none.
     */
    Set<StatsKey> getKeys();

    /**
     * Get the Set of matching {@link StatsKey}s that are associated with the
     * {@link StatsSession}s being managed. The passed <tt>keyMatcher</tt> is used to
     * select the desired keys.
     * @param keyMatcher The key matcher with which to filter results.
     * @return A Set of {@link StatsKey}s, or an empty Set if there are none.
     */
    Set<StatsKey> getKeys(StatsKeyMatcher keyMatcher);

    /**
     * Get all {@link StatsSession}s being managed.
     *
     * @return A Collection of {@link StatsSession}s, or an empty Collection if there are none.
     */
    Collection<StatsSession> getSessions();

    /**
     * Get any {@link StatsSession}s being managed where it's key is matched by the given matcher.
     *
     * @param keyMatcher The key matcher with which to select session keys.
     * @return A Collection of {@link StatsSession}s, or an empty Collection if there are none.
     */
    Collection<StatsSession> getSessions(StatsKeyMatcher keyMatcher);

    /**
     * Get the {@link StatsSession} being managed for the given <tt>key</tt>.
     *
     * @param key The key for which to return the associated {@link StatsSession}.
     * @return The {@link StatsSession} associated with the given <tt>key</tt> or <tt>null</tt>
     *         if not found.
     */
    StatsSession getSession(StatsKey key);

    /**
     * Get the {@link StatsSession} being managed for the given <tt>key</tt>, or if the session
     * does not exist, create it and return it.
     *
     * @param key The key for which to return the associated {@link StatsSession}.
     * @return The {@link StatsSession} associated with the given <tt>key</tt>, never <tt>null</tt>.
     */
    StatsSession getOrCreateSession(StatsKey key);

    /**
     * Remove the {@link StatsSession} being managed that is associated with the given <tt>key</tt>.
     *
     * @param key The key for which to remove the {@link StatsSession}.
     * @return The {@link StatsSession} instance that was removed, or <tt>null</tt> if not found.
     */
    StatsSession remove(StatsKey key);

    /**
     * Remove the given <tt>session</tt> instance from this manager.
     *
     * @param session The {@link StatsSession} instance to remove.
     * @return <tt>true</tt> if <tt>session</tt> was found and removed, <tt>false</tt> if not found.
     */
    boolean remove(StatsSession session);

    /**
     * Remove all {@link StatsSession} instances from this manager.
     */
    void clear();

    /**
     * Call {@link StatsSession#clear()} on each {@link StatsSession} instance known to this manager.
     */
    void clearAllSessions();

}


text:
package msfp05;

public interface Stack<E> {
	public void push(E elem);

	public E pop();

}

redpajama_set_name: RedPajamaGithub


text:
<assembly
	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
	<id>include-dependencies</id>
	<formats>
		<format>jar</format>
	</formats>
	<files>
		<file>
			<source>${basedir}/src/main/resources/log4j.properties</source>
		</file>
	</files>
	<includeBaseDirectory>false</includeBaseDirectory>
	<dependencySets>
		<dependencySet>
			<unpack>true</unpack>
			<scope>runtime</scope>
			<useProjectArtifact>false</useProjectArtifact>
		</dependencySet>
	</dependencySets>
</assembly>


text:
#ifndef _LINUX_SUSPEND_H
#define _LINUX_SUSPEND_H

#include <linux/swap.h>
#include <linux/notifier.h>
#include <linux/init.h>
#include <linux/pm.h>
#include <linux/mm.h>
#include <linux/freezer.h>
#include <asm/errno.h>

#ifdef CONFIG_VT
extern void pm_set_vt_switch(int);
#else
static inline void pm_set_vt_switch(int do_switch)
{
}
#endif

#ifdef CONFIG_VT_CONSOLE_SLEEP
extern int pm_prepare_console(void);
extern void pm_restore_console(void);
#else
static inline int pm_prepare_console(void)
{
	return 0;
}

static inline void pm_restore_console(void)
{
}
#endif

typedef int __bitwise suspend_state_t;

#define PM_SUSPEND_ON		((__force suspend_state_t) 0)
#define PM_SUSPEND_FREEZE	((__force suspend_state_t) 1)
#define PM_SUSPEND_STANDBY	((__force suspend_state_t) 2)
#define PM_SUSPEND_MEM		((__force suspend_state_t) 3)
#define PM_SUSPEND_MIN		PM_SUSPEND_FREEZE
#define PM_SUSPEND_MAX		((__force suspend_state_t) 4)

enum suspend_stat_step {
	SUSPEND_FREEZE = 1,
	SUSPEND_PREPARE,
	SUSPEND_SUSPEND,
	SUSPEND_SUSPEND_LATE,
	SUSPEND_SUSPEND_NOIRQ,
	SUSPEND_RESUME_NOIRQ,
	SUSPEND_RESUME_EARLY,
	SUSPEND_RESUME
};

struct suspend_stats {
	int	success;
	int	fail;
	int	failed_freeze;
	int	failed_prepare;
	int	failed_suspend;
	int	failed_suspend_late;
	int	failed_suspend_noirq;
	int	failed_resume;
	int	failed_resume_early;
	int	failed_resume_noirq;
#define	REC_FAILED_NUM	2
	int	last_failed_dev;
	char	failed_devs[REC_FAILED_NUM][40];
	int	last_failed_errno;
	int	errno[REC_FAILED_NUM];
	int	last_failed_step;
	enum suspend_stat_step	failed_steps[REC_FAILED_NUM];
};

extern struct suspend_stats suspend_stats;

static inline void dpm_save_failed_dev(const char *name)
{
	strlcpy(suspend_stats.failed_devs[suspend_stats.last_failed_dev],
		name,
		sizeof(suspend_stats.failed_devs[0]));
	suspend_stats.last_failed_dev++;
	suspend_stats.last_failed_dev %= REC_FAILED_NUM;
}

static inline void dpm_save_failed_errno(int err)
{
	suspend_stats.errno[suspend_stats.last_failed_errno] = err;
	suspend_stats.last_failed_errno++;
	suspend_stats.last_failed_errno %= REC_FAILED_NUM;
}

static inline void dpm_save_failed_step(enum suspend_stat_step step)
{
	suspend_stats.failed_steps[suspend_stats.last_failed_step] = step;
	suspend_stats.last_failed_step++;
	suspend_stats.last_failed_step %= REC_FAILED_NUM;
}

/**
 * struct platform_suspend_ops - Callbacks for managing platform dependent
 *	system sleep states.
 *
 * @valid: Callback to determine if given system sleep state is supported by
 *	the platform.
 *	Valid (ie. supported) states are advertised in /sys/power/state.  Note
 *	that it still may be impossible to enter given system sleep state if the
 *	conditions aren't right.
 *	There is the %suspend_valid_only_mem function available that can be
 *	assigned to this if the platform only supports mem sleep.
 *
 * @begin: Initialise a transition to given system sleep state.
 *	@begin() is executed right prior to suspending devices.  The information
 *	conveyed to the platform code by @begin() should be disregarded by it as
 *	soon as @end() is executed.  If @begin() fails (ie. returns nonzero),
 *	@prepare(), @enter() and @finish() will not be called by the PM core.
 *	This callback is optional.  However, if it is implemented, the argument
 *	passed to @enter() is redundant and should be ignored.
 *
 * @prepare: Prepare the platform for entering the system sleep state indicated
 *	by @begin().
 *	@prepare() is called right after devices have been suspended (ie. the
 *	appropriate .suspend() method has been executed for each device) and
 *	before device drivers' late suspend callbacks are executed.  It returns
 *	0 on success or a negative error code otherwise, in which case the
 *	system cannot enter the desired sleep state (@prepare_late(), @enter(),
 *	and @wake() will not be called in that case).
 *
 * @prepare_late: Finish preparing the platform for entering the system sleep
 *	state indicated by @begin().
 *	@prepare_late is called before disabling nonboot CPUs and after
 *	device drivers' late suspend callbacks have been executed.  It returns
 *	0 on success or a negative error code otherwise, in which case the
 *	system cannot enter the desired sleep state (@enter() will not be
 *	executed).
 *
 * @enter: Enter the system sleep state indicated by @begin() or represented by
 *	the argument if @begin() is not implemented.
 *	This callback is mandatory.  It returns 0 on success or a negative
 *	error code otherwise, in which case the system cannot enter the desired
 *	sleep state.
 *
 * @wake: Called when the system has just left a sleep state, right after
 *	the nonboot CPUs have been enabled and before device drivers' early
 *	resume callbacks are executed.
 *	This callback is optional, but should be implemented by the platforms
 *	that implement @prepare_late().  If implemented, it is always called
 *	after @prepare_late and @enter(), even if one of them fails.
 *
 * @finish: Finish wake-up of the platform.
 *	@finish is called right prior to calling device drivers' regular suspend
 *	callbacks.
 *	This callback is optional, but should be implemented by the platforms
 *	that implement @prepare().  If implemented, it is always called after
 *	@enter() and @wake(), even if any of them fails.  It is executed after
 *	a failing @prepare.
 *
 * @suspend_again: Returns whether the system should suspend again (true) or
 *	not (false). If the platform wants to poll sensors or execute some
 *	code during suspended without invoking userspace and most of devices,
 *	suspend_again callback is the place assuming that periodic-wakeup or
 *	alarm-wakeup is already setup. This allows to execute some codes while
 *	being kept suspended in the view of userland and devices.
 *
 * @end: Called by the PM core right after resuming devices, to indicate to
 *	the platform that the system has returned to the working state or
 *	the transition to the sleep state has been aborted.
 *	This callback is optional, but should be implemented by the platforms
 *	that implement @begin().  Accordingly, platforms implementing @begin()
 *	should also provide a @end() which cleans up transitions aborted before
 *	@enter().
 *
 * @recover: Recover the platform from a suspend failure.
 *	Called by the PM core if the suspending of devices fails.
 *	This callback is optional and should only be implemented by platforms
 *	which require special recovery actions in that situation.
 */
struct platform_suspend_ops {
	int (*valid)(suspend_state_t state);
	int (*begin)(suspend_state_t state);
	int (*prepare)(void);
	int (*prepare_late)(void);
	int (*enter)(suspend_state_t state);
	void (*wake)(void);
	void (*finish)(void);
	bool (*suspend_again)(void);
	void (*end)(void);
	void (*recover)(void);
};

#ifdef CONFIG_SUSPEND
/**
 * suspend_set_ops - set platform dependent suspend operations
 * @ops: The new suspend operations to set.
 */
extern void suspend_set_ops(const struct platform_suspend_ops *ops);
extern int suspend_valid_only_mem(suspend_state_t state);
extern void freeze_wake(void);

/**
 * arch_suspend_disable_irqs - disable IRQs for suspend
 *
 * Disables IRQs (in the default case). This is a weak symbol in the common
 * code and thus allows architectures to override it if more needs to be
 * done. Not called for suspend to disk.
 */
extern void arch_suspend_disable_irqs(void);

/**
 * arch_suspend_enable_irqs - enable IRQs after suspend
 *
 * Enables IRQs (in the default case). This is a weak symbol in the common
 * code and thus allows architectures to override it if more needs to be
 * done. Not called for suspend to disk.
 */
extern void arch_suspend_enable_irqs(void);

extern int pm_suspend(suspend_state_t state);
#else /* !CONFIG_SUSPEND */
#define suspend_valid_only_mem	NULL

static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}
static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
static inline void freeze_wake(void) {}
#endif /* !CONFIG_SUSPEND */

/* struct pbe is used for creating lists of pages that should be restored
 * atomically during the resume from disk, because the page frames they have
 * occupied before the suspend are in use.
 */
struct pbe {
	void *address;		/* address of the copy */
	void *orig_address;	/* original address of a page */
	struct pbe *next;
};

/* mm/page_alloc.c */
extern void mark_free_pages(struct zone *zone);

/**
 * struct platform_hibernation_ops - hibernation platform support
 *
 * The methods in this structure allow a platform to carry out special
 * operations required by it during a hibernation transition.
 *
 * All the methods below, except for @recover(), must be implemented.
 *
 * @begin: Tell the platform driver that we're starting hibernation.
 *	Called right after shrinking memory and before freezing devices.
 *
 * @end: Called by the PM core right after resuming devices, to indicate to
 *	the platform that the system has returned to the working state.
 *
 * @pre_snapshot: Prepare the platform for creating the hibernation image.
 *	Called right after devices have been frozen and before the nonboot
 *	CPUs are disabled (runs with IRQs on).
 *
 * @finish: Restore the previous state of the platform after the hibernation
 *	image has been created *or* put the platform into the normal operation
 *	mode after the hibernation (the same method is executed in both cases).
 *	Called right after the nonboot CPUs have been enabled and before
 *	thawing devices (runs with IRQs on).
 *
 * @prepare: Prepare the platform for entering the low power state.
 *	Called right after the hibernation image has been saved and before
 *	devices are prepared for entering the low power state.
 *
 * @enter: Put the system into the low power state after the hibernation image
 *	has been saved to disk.
 *	Called after the nonboot CPUs have been disabled and all of the low
 *	level devices have been shut down (runs with IRQs off).
 *
 * @leave: Perform the first stage of the cleanup after the system sleep state
 *	indicated by @set_target() has been left.
 *	Called right after the control has been passed from the boot kernel to
 *	the image kernel, before the nonboot CPUs are enabled and before devices
 *	are resumed.  Executed with interrupts disabled.
 *
 * @pre_restore: Prepare system for the restoration from a hibernation image.
 *	Called right after devices have been frozen and before the nonboot
 *	CPUs are disabled (runs with IRQs on).
 *
 * @restore_cleanup: Clean up after a failing image restoration.
 *	Called right after the nonboot CPUs have been enabled and before
 *	thawing devices (runs with IRQs on).
 *
 * @recover: Recover the platform from a failure to suspend devices.
 *	Called by the PM core if the suspending of devices during hibernation
 *	fails.  This callback is optional and should only be implemented by
 *	platforms which require special recovery actions in that situation.
 */
struct platform_hibernation_ops {
	int (*begin)(void);
	void (*end)(void);
	int (*pre_snapshot)(void);
	void (*finish)(void);
	int (*prepare)(void);
	int (*enter)(void);
	void (*leave)(void);
	int (*pre_restore)(void);
	void (*restore_cleanup)(void);
	void (*recover)(void);
};

#ifdef CONFIG_HIBERNATION
/* kernel/power/snapshot.c */
extern void __register_nosave_region(unsigned long b, unsigned long e, int km);
static inline void __init register_nosave_region(unsigned long b, unsigned long e)
{
	__register_nosave_region(b, e, 0);
}
static inline void __init register_nosave_region_late(unsigned long b, unsigned long e)
{
	__register_nosave_region(b, e, 1);
}
extern int swsusp_page_is_forbidden(struct page *);
extern void swsusp_set_page_free(struct page *);
extern void swsusp_unset_page_free(struct page *);
extern unsigned long get_safe_page(gfp_t gfp_mask);

extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
extern int hibernate(void);
#ifdef CONFIG_MTK_HIBERNATION
extern int pre_hibernate(void);
extern int mtk_hibernate(void);
extern int mtk_hibernate_abort(void);
#endif
extern bool system_entering_hibernation(void);
#else /* CONFIG_HIBERNATION */
static inline void register_nosave_region(unsigned long b, unsigned long e) {}
static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}
static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
static inline void swsusp_set_page_free(struct page *p) {}
static inline void swsusp_unset_page_free(struct page *p) {}

static inline void hibernation_set_ops(const struct platform_hibernation_ops *ops) {}
static inline int hibernate(void) { return -ENOSYS; }
static inline bool system_entering_hibernation(void) { return false; }
#endif /* CONFIG_HIBERNATION */

/* Hibernation and suspend events */
#define PM_HIBERNATION_PREPARE	0x0001 /* Going to hibernate */
#define PM_POST_HIBERNATION	0x0002 /* Hibernation finished */
#define PM_SUSPEND_PREPARE	0x0003 /* Going to suspend the system */
#define PM_POST_SUSPEND		0x0004 /* Suspend finished */
#define PM_RESTORE_PREPARE	0x0005 /* Going to restore a saved image */
#define PM_POST_RESTORE		0x0006 /* Restore failed */

extern struct mutex pm_mutex;

#ifdef CONFIG_PM_SLEEP
void save_processor_state(void);
void restore_processor_state(void);

/* kernel/power/main.c */
extern int register_pm_notifier(struct notifier_block *nb);
extern int unregister_pm_notifier(struct notifier_block *nb);

#define pm_notifier(fn, pri) {				\
	static struct notifier_block fn##_nb =			\
		{ .notifier_call = fn, .priority = pri };	\
	register_pm_notifier(&fn##_nb);			\
}

/* drivers/base/power/wakeup.c */
extern bool events_check_enabled;

extern bool pm_wakeup_pending(void);
extern bool pm_get_wakeup_count(unsigned int *count, bool block);
extern bool pm_save_wakeup_count(unsigned int count);
extern void pm_wakep_autosleep_enabled(bool set);
extern void pm_get_active_wakeup_sources(char *pending_sources, size_t max);
static inline void lock_system_sleep(void)
{
	current->flags |= PF_FREEZER_SKIP;
	mutex_lock(&pm_mutex);
}

static inline void unlock_system_sleep(void)
{
	/*
	 * Don't use freezer_count() because we don't want the call to
	 * try_to_freeze() here.
	 *
	 * Reason:
	 * Fundamentally, we just don't need it, because freezing condition
	 * doesn't come into effect until we release the pm_mutex lock,
	 * since the freezer always works with pm_mutex held.
	 *
	 * More importantly, in the case of hibernation,
	 * unlock_system_sleep() gets called in snapshot_read() and
	 * snapshot_write() when the freezing condition is still in effect.
	 * Which means, if we use try_to_freeze() here, it would make them
	 * enter the refrigerator, thus causing hibernation to lockup.
	 */
	current->flags &= ~PF_FREEZER_SKIP;
	mutex_unlock(&pm_mutex);
}

#else /* !CONFIG_PM_SLEEP */

static inline int register_pm_notifier(struct notifier_block *nb)
{
	return 0;
}

static inline int unregister_pm_notifier(struct notifier_block *nb)
{
	return 0;
}

#define pm_notifier(fn, pri)	do { (void)(fn); } while (0)

static inline bool pm_wakeup_pending(void) { return false; }

static inline void lock_system_sleep(void) {}
static inline void unlock_system_sleep(void) {}

#endif /* !CONFIG_PM_SLEEP */

#ifdef CONFIG_PM_SLEEP_DEBUG
extern bool pm_print_times_enabled;
#else
#define pm_print_times_enabled	(false)
#endif

enum {
	TOI_CAN_HIBERNATE,
	TOI_CAN_RESUME,
	TOI_RESUME_DEVICE_OK,
	TOI_NORESUME_SPECIFIED,
	TOI_SANITY_CHECK_PROMPT,
	TOI_CONTINUE_REQ,
	TOI_RESUMED_BEFORE,
	TOI_BOOT_TIME,
	TOI_NOW_RESUMING,
	TOI_IGNORE_LOGLEVEL,
	TOI_TRYING_TO_RESUME,
	TOI_LOADING_ALT_IMAGE,
	TOI_STOP_RESUME,
	TOI_IO_STOPPED,
	TOI_NOTIFIERS_PREPARE,
	TOI_CLUSTER_MODE,
	TOI_BOOT_KERNEL,
};

#ifdef CONFIG_TOI

/* Used in init dir files */
extern unsigned long toi_state;
#define set_toi_state(bit) (set_bit(bit, &toi_state))
#define clear_toi_state(bit) (clear_bit(bit, &toi_state))
#define test_toi_state(bit) (test_bit(bit, &toi_state))
extern int toi_running;

#define test_action_state(bit) (test_bit(bit, &toi_bkd.toi_action))
extern int try_tuxonice_hibernate(void);
#ifdef CONFIG_TOI_ENHANCE
extern int toi_abort_hibernate(void);
extern int toi_hibernate_fatalerror(void);
#endif

#else /* !CONFIG_TOI */

#define toi_state		(0)
#define set_toi_state(bit) do { } while (0)
#define clear_toi_state(bit) do { } while (0)
#define test_toi_state(bit) (0)
#define toi_running (0)

static inline int try_tuxonice_hibernate(void) { return 0; }
#define test_action_state(bit) (0)
#ifdef CONFIG_TOI_ENHANCE
static inline int toi_abort_hibernate(void) { return 0; }
static inline int toi_hibernate_fatalerror(void) { return 0; }
#endif

#endif /* CONFIG_TOI */

#ifdef CONFIG_HIBERNATION
#ifdef CONFIG_TOI
extern void try_tuxonice_resume(void);
#else
#define try_tuxonice_resume() do { } while (0)
#endif

extern int resume_attempted;
extern int software_resume(void);

static inline void check_resume_attempted(void)
{
	if (resume_attempted)
		return;

	software_resume();
}
#else
#define check_resume_attempted() do { } while (0)
#define resume_attempted (0)
#endif

#ifdef CONFIG_PM_AUTOSLEEP

/* kernel/power/autosleep.c */
void queue_up_suspend_work(void);

#else /* !CONFIG_PM_AUTOSLEEP */

static inline void queue_up_suspend_work(void) {}

#endif /* !CONFIG_PM_AUTOSLEEP */

#ifdef CONFIG_ARCH_SAVE_PAGE_KEYS
/*
 * The ARCH_SAVE_PAGE_KEYS functions can be used by an architecture
 * to save/restore additional information to/from the array of page
 * frame numbers in the hibernation image. For s390 this is used to
 * save and restore the storage key for each page that is included
 * in the hibernation image.
 */
unsigned long page_key_additional_pages(unsigned long pages);
int page_key_alloc(unsigned long pages);
void page_key_free(void);
void page_key_read(unsigned long *pfn);
void page_key_memorize(unsigned long *pfn);
void page_key_write(void *address);

#else /* !CONFIG_ARCH_SAVE_PAGE_KEYS */

static inline unsigned long page_key_additional_pages(unsigned long pages)
{
	return 0;
}

static inline int  page_key_alloc(unsigned long pages)
{
	return 0;
}

static inline void page_key_free(void) {}
static inline void page_key_read(unsigned long *pfn) {}
static inline void page_key_memorize(unsigned long *pfn) {}
static inline void page_key_write(void *address) {}

#endif /* !CONFIG_ARCH_SAVE_PAGE_KEYS */

#endif /* _LINUX_SUSPEND_H */


text:
package org.fcrepo.kernel.modeshape.services;

import org.fcrepo.kernel.api.services.ExternalContentService;

import com.google.common.annotations.VisibleForTesting;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.HttpClientConnectionManager;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.stereotype.Component;

import javax.inject.Inject;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;

/**
 * @author cabeer
 */
@Component
public class ExternalContentServiceImpl implements ExternalContentService {

    @Inject
    private HttpClientConnectionManager connManager;

    /**
     * Retrieve the content at the URI using the global connection pool.
     * @param sourceUri the source uri
     * @return the content at the URI using the global connection pool
     * @throws IOException if IO exception occurred
     */
    @SuppressWarnings("resource")
    @Override
    public InputStream retrieveExternalContent(final URI sourceUri) throws IOException {
        final HttpGet httpGet = new HttpGet(sourceUri);
        final CloseableHttpClient client = getCloseableHttpClient();
        final HttpResponse response = client.execute(httpGet);
        return response.getEntity().getContent();
    }

    @VisibleForTesting
    protected CloseableHttpClient getCloseableHttpClient() {
        return HttpClients.createMinimal(connManager);
    }

    @VisibleForTesting
    protected void setConnManager(final HttpClientConnectionManager connManager) {
        this.connManager = connManager;
    }
}


text:
package org.apache.ddlutils.io.converters;

/**
 * Interface for classes that convert between strings and sql data types.
 *
 * @version $Revision: 289996 $
 */
public interface SqlTypeConverter
{
    /**
     * Converts the given textual representation to an instance of the target type.
     *
     * @param textRep     The textual representation
     * @param sqlTypeCode The target sql type code, one of the constants in {@link java.sql.Types}
     * @return The corresponding object
     */
    public Object convertFromString(String textRep, int sqlTypeCode) throws ConversionException;

    /**
     * Converts the given object to a string representation.
     *
     * @param obj         The object
     * @param sqlTypeCode The corresponding source type code
     * @return The textual representation
     */
    public String convertToString(Object obj, int sqlTypeCode) throws ConversionException;
}


text:
package io.github.jeddict.jaxb.spec;

import java.util.List;

/**
 *
 * @author Gaurav Gupta
 */
public interface JaxbVariableTypeHandler {

    /**
     * @return the jaxbVariableType
     */
    public JaxbVariableType getJaxbVariableType();

    public List<JaxbVariableType> getJaxbVariableList();

    /**
     * @param jaxbVariableType the jaxbVariableType to set
     */
    public void setJaxbVariableType(JaxbVariableType jaxbVariableType);

    /**
     * @return the jaxbMetadata
     */
    public JaxbMetadata getJaxbMetadata();

    /**
     * @param jaxbMetadata the jaxbMetadata to set
     */
    public void setJaxbMetadata(JaxbMetadata jaxbMetadata);

}


text:
  <button type="button" class="btn btn-default" data-bind="text: text"></button>
  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">

    {{I.t("voc.ToggleDrop")}}
  </button>


text:
package org.odk.collect.android.widgets2.string;

import android.content.Context;

import org.javarosa.core.model.data.StringData;
import org.javarosa.form.api.FormEntryPrompt;
import org.odk.collect.android.widgets2.common.Appearance;
import org.odk.collect.android.widgets2.common.TypedWidget;
import org.odk.collect.android.widgets2.common.TypedWidgetFactory;

/**
 * A {@link TypedWidgetFactory} that creates {@link StringData} widgets.
 */
public class StringWidgetFactory extends TypedWidgetFactory<StringData> {

    public TypedWidget<StringData> create(
            Context context, FormEntryPrompt prompt, Appearance appearance, boolean forceReadOnly) {

        // Currently, there are no typed string widgets.

        return null;
    }
}


text:
import logging
import requests

from oslo.config import cfg
from akanda.rug.openstack.common import jsonutils

AKANDA_ULA_PREFIX = 'fdca:3ba5:a17a:acda::/64'
AKANDA_MGT_SERVICE_PORT = 5000
AKANDA_BASE_PATH = '/v1/'

LOG = logging.getLogger(__name__)

def _mgt_url(host, port, path):
    if ':' in host:
        host = '[%s]' % host
    return 'http://%s:%s%s' % (host, port, path)

def _get_proxyless_session():
    s = requests.Session()
    # ignore any proxy setting because we should have a direct connection
    s.trust_env = False
    return s

def is_alive(host, port):
    path = AKANDA_BASE_PATH + 'firewall/rules'
    try:
        s = _get_proxyless_session()
        r = s.get(_mgt_url(host, port, path), timeout=cfg.CONF.alive_timeout)
        if r.status_code == 200:
            return True
    except Exception as e:
        LOG.debug('is_alive for %s failed: %s', host, str(e))
    return False

def get_interfaces(host, port):
    path = AKANDA_BASE_PATH + 'system/interfaces'
    s = _get_proxyless_session()
    r = s.get(_mgt_url(host, port, path), timeout=30)
    return r.json().get('interfaces', [])

def update_config(host, port, config_dict):
    path = AKANDA_BASE_PATH + 'system/config'
    headers = {'Content-type': 'application/json'}

    s = _get_proxyless_session()
    r = s.put(
        _mgt_url(host, port, path),
        data=jsonutils.dumps(config_dict),
        headers=headers,
        timeout=cfg.CONF.config_timeout)

    if r.status_code != 200:
        raise Exception('Config update failed: %s' % r.text)
    else:
        return r.json()

def read_labels(host, port):
    path = AKANDA_BASE_PATH + 'firewall/labels'
    s = _get_proxyless_session()
    r = s.post(_mgt_url(host, port, path), timeout=30)
    return r.json().get('labels', [])


text:
class AddCounterCacheToServicos < ActiveRecord::Migration
  def change
    add_column :servicos, :reviews_count, :integer
  end
end


text:
    <title>Using $http.get to read binary data</title>

Using $http.get to read binary data

        Download

    Click the following button to fetch the same image dynamically:

    <button ng-click="fetch()">fetch</button>

{{info}}


text:
class GKDLLCLASS GkGameText :
	public GkGameEntity
{
public:
	static const int GameTextAlignment_Right = 0,
					 GameTextAlignment_Center = 1,
					 GameTextAlignment_Left = 2;

	GkAnimatedFont *animatedFont;
	wchar_t *text;
	int textLength, textWidth;
	int *textTextureIndices;

	int x, y;
	bool visible, active, loop;
	float framesPerSecond, currentFrame;
	int textAlignment;
	int characterSpacing;
	int maxWidth;

	GkGameText::GkGameText(GkAnimatedFont *animatedFont, int x = 0, int y = 0, int characterSpacing = 0, int textAlignment = GameTextAlignment_Right, int maxWidth = 0, float framesPerSecond = 0.0f);
	GkGameText::~GkGameText(void);

	bool GkGameText::SetText(const wchar_t *text);
	void GkGameText::Process(GkGame *game);
	void GkGameText::Draw(GkGame *game);
};


text:
package com.sleepycat.je.txn;

import com.sleepycat.je.log.Loggable;

/**
 * This class writes out a transaction commit or transaction end record.
 */
public class TxnAbort extends TxnEnd {
    public TxnAbort(long id, long lastLsn, int masterId) {
        super(id, lastLsn, masterId);
    }

    /**
     * For constructing from the log.
     */
    public TxnAbort() {
    }

    /*
     * Log support
     */

    protected String getTagName() {
        return "TxnAbort";
    }

    /**
     * @see Loggable#logicalEquals
     */
    public boolean logicalEquals(Loggable other) {

        if (!(other instanceof TxnAbort))
            return false;

        return (id == ((TxnAbort) other).id);
    }
}


text:
;(function ( $, doc ) {
  'use strict';

  var $win = $(window);
  var $html = $('html');
  var scrollTimeout;  // global for any pending scrollTimeout

  $win.scroll(function () {
    if ( scrollTimeout ) {
      // clear the timeout, if one is pending
      clearTimeout(scrollTimeout);
      scrollTimeout = null;
    }
    scrollTimeout = setTimeout(scrollHandler, 200);
  });

  var scrollHandler = function () {
    if ( $win.scrollTop() >= 200 && !$html.hasClass('show-back-to-top') ) {
      $html.addClass('show-back-to-top');
    }
    else if ( $win.scrollTop() <= 200 ) {
      $html.removeClass('show-back-to-top');
    }
  };

  if ( $win.scrollTop() >= 200 ) {
    $html.addClass('show-back-to-top');
  }

  scrollHandler();

  $('.back-to-top').on('click', function () {
    var $targetNode = $(this).attr('href').split('h1')[1];
    $('h1' + $targetNode).attr('tabindex', '-1');
    $html.removeClass('show-back-to-top');
    $('h1' + $targetNode).focus();
  });

})( jQuery, this.document );


text:
package org.wso2.appcloud.provisioning.runtime.test;

import io.fabric8.kubernetes.api.model.Namespace;
import io.fabric8.kubernetes.api.model.extensions.Deployment;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.testng.Assert;
import org.testng.annotations.*;
import org.wso2.appcloud.provisioning.runtime.beans.DeploymentLogs;
import org.wso2.appcloud.provisioning.runtime.beans.LogQuery;
import org.wso2.appcloud.provisioning.runtime.KubernetesRuntimeProvisioningService;
import org.wso2.appcloud.provisioning.runtime.RuntimeProvisioningException;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class LoggingTest {

    private static final Log log = LogFactory.getLog(LoggingTest.class);

    public static TestUtils testUtils;
    KubernetesRuntimeProvisioningService afKubClient;
    Deployment deployment;
    Namespace namespace;

    @BeforeClass
    public void initialize() throws RuntimeProvisioningException {
        log.info("Starting Logging test case");
        testUtils = new TestUtils();
        namespace = testUtils.createNamespace();
        deployment = testUtils.createDeployment();
    }

    /**
     * Test getting snapshot logs of containers
     *
     * @throws RuntimeProvisioningException
     */

    @Test(groups = {"org.wso2.carbon.appfactory.provisioning.runtime" }, description = "Kub get snapshot logs")
    public void testSnapshotLogs() throws RuntimeProvisioningException, InterruptedException {

        DeploymentLogs deploymentLogs;
        Map<String, String> selector = new HashMap<>();
        selector.put("app", "My-JAXRS");
        afKubClient = new KubernetesRuntimeProvisioningService(testUtils.getAppCtx());

        //Initially waits until deployment successful
        log.info("Waiting for deployment to complete : " + deployment.getMetadata().getName());
        Thread.sleep(60000);
        int counter;
        //todo get the upper bound value from a config
        for (counter = 0; counter < 10; counter++) {
            if (testUtils.getPodStatus(namespace, selector)) {
                log.info("Pod status : Running");

                //Waiting until tomcat starts
                log.info("Waiting until server startup complete ");
                Thread.sleep(10000);

                deploymentLogs = afKubClient.getRuntimeLogs(null);
                Map<String, String> logs = deploymentLogs.getDeploymentLogs();

                for (Map.Entry<String, String> logEntry : logs.entrySet()) {
                    String logSegment = logEntry.getValue();
                    Assert.assertTrue(logSegment.indexOf("Starting service Catalina") > 0);
                }
                break;
            } else {
                log.info("Pod status : Pending");
                log.info("Retrying until deployment complete : " + deployment.getMetadata().getName());
                //If deployment is not successful check again in 30 seconds
                Thread.sleep(30000);
            }
            if (counter == 9) {
                log.info("Pods didn't start Running during the retrying period");
                Assert.assertTrue(false);
            }
        }
    }

    /**
     * Test getting logs with specific number of records by querying in deployed containers
     *
     * @throws RuntimeProvisioningException
     */
    @Test(dependsOnMethods = "testSnapshotLogs", groups = {"org.wso2.carbon.appfactory.provisioning.runtime" },
            description = "Kub snapshot logs with querying records count")
    public void testLogsWithQueryRecords() throws RuntimeProvisioningException, InterruptedException {

        DeploymentLogs deploymentLogs;
        Map<String, String> selector = new HashMap<>();
        selector.put("app", "My-JAXRS");
        afKubClient = new KubernetesRuntimeProvisioningService(testUtils.getAppCtx());
        LogQuery query = new LogQuery(false, 1000, -1);

        //Initially waits until deployment successful
        log.info("Waiting for deployment to complete : " + deployment.getMetadata().getName());
        Thread.sleep(60000);
        //todo get the upper bound value from a config
        int counter;
        for (counter = 0; counter < 10; counter++) {
            if (testUtils.getPodStatus(namespace, selector)) {
                log.info("Pod status : Running");

                //Waiting until tomcat starts
                log.info("Waiting until server startup complete ");
                Thread.sleep(10000);

                deploymentLogs = afKubClient.getRuntimeLogs(query);
                Map<String, String> logs = deploymentLogs.getDeploymentLogs();

                for (Map.Entry<String, String> logEntry : logs.entrySet()) {
                    String logSegment = logEntry.getValue();
                    Assert.assertTrue(logSegment.indexOf("Starting service Catalina") > 0);
                }
                break;
            } else {
                log.info("Pod status : Pending");
                log.info("Retrying until deployment complete : " + deployment.getMetadata().getName());
                //If deployment is not successful check again in 30 seconds
                Thread.sleep(30000);
            }
            if (counter == 9) {
                log.info("Pods didn't start Running during the retrying period");
                Assert.assertTrue(false);
            }
        }
    }

    /**
     * Test getting logs in a specific duration by querying in deployed containers
     *
     * @throws RuntimeProvisioningException
     */
    @Test(dependsOnMethods = "testLogsWithQueryRecords", groups = {"org.wso2.carbon.appfactory.provisioning.runtime" },
            description = "Kub snapshot logs with querying duration")
    public void testLogsWithQueryDuration() throws RuntimeProvisioningException, InterruptedException {

        DeploymentLogs deploymentLogs;
        Map<String, String> selector = new HashMap<>();
        selector.put("app", "My-JAXRS");
        afKubClient = new KubernetesRuntimeProvisioningService(testUtils.getAppCtx());
        LogQuery query = new LogQuery(false, -1, 1);

        //Initially waits until deployment successful
        log.info("Waiting for deployment to complete : " + deployment.getMetadata().getName());
        Thread.sleep(60000);
        //todo get the upper bound value from a config
        int counter;
        for (counter = 0; counter < 10; counter++) {
            if (testUtils.getPodStatus(namespace, selector)) {
                log.info("Pod status : Running");

                //Waiting until tomcat starts
                log.info("Waiting until server startup complete ");
                Thread.sleep(10000);

                deploymentLogs = afKubClient.getRuntimeLogs(query);
                Map<String, String> logs = deploymentLogs.getDeploymentLogs();

                for (Map.Entry<String, String> logEntry : logs.entrySet()) {
                    String logSegment = logEntry.getValue();
                    Assert.assertTrue(logSegment.indexOf("Starting service Catalina") > 0);
                }
                break;
            } else {
                log.info("Pod status : Pending");
                log.info("Retrying until deployment complete : " + deployment.getMetadata().getName());
                //If deployment is not successful check again in 30 seconds
                Thread.sleep(30000);
            }
            if (counter == 9) {
                log.info("Pods didn't start Running during the retrying period");
                Assert.assertTrue(false);
            }
        }
    }

    /**
     * Test log streaming in deployed containers
     *
     * @throws RuntimeProvisioningException
     */
    // @Test(groups = {"org.wso2.carbon.appfactory.provisioning.runtime" }, description = "Kub Logging")
    public void testLogStream() throws RuntimeProvisioningException, InterruptedException {

        LogQuery query = new LogQuery(true, -1, 1);
        Map<String, String> selector = new HashMap<>();
        selector.put("app", "My-JAXRS");

        //Initially waits until deployment successful
        Thread.sleep(30000);
        for (int i = 0; i < 5; i++) {
            if (testUtils.getPodStatus(namespace, selector)) {
                afKubClient.streamRuntimeLogs();
            } else {
                //If deployment is not successful check again in 30 seconds
                Thread.sleep(30000);
            }

            //todo add assertions
        }
    }

    //@AfterClass
    private void cleanup() throws InterruptedException {
        log.info("Cleaning up the namespace");
        testUtils.deleteNamespace();
        Thread.sleep(30000);
    }
}


text:
from performanceplatform.client import DataSet
import logging

class Pusher(object):
    def __init__(self, target_data_set_config, options):
        self.data_set_client = DataSet.from_config(target_data_set_config)
        self.chunk_size = options.get('chunk-size', 100)
        self.empty_data_set = options.get('empty-data-set', False)

    def push(self, data):
        if data:
            if self.empty_data_set:
                self.data_set_client.empty_data_set()
            self.data_set_client.post(
                data, chunk_size=self.chunk_size)
        else:
            logging.info("Doing nothing - no data to push")


text:
<?php
/**
 * Hendle every http errors.
 *
 * @author	Iskandar Soesman <k4ndar@yahoo.com>
 * @link	http://panadaframework.com/
 * @license	http://www.opensource.org/licenses/bsd-license.php
 * @since	version 1.0.0
 * @package	Resources
 */
namespace Resources;

class HttpException extends \Exception
{
    public function __construct($message = null, $code = 0, Exception $previous = null)
    {
        set_exception_handler( array($this, 'main') );
        parent::__construct($message, $code, $previous);
    }

    public function __toString()
    {
        return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
    }

    public function main($exception)
    {
        self::outputError($exception);
    }

    public static function outputError($exception)
    {

        if (PHP_SAPI == 'cli') {
            echo $exception->getMessage()
                ."\nFile: ".$exception->getFile()
                    ." on line ".$exception->getLine()
                ."\n\n".$exception->getTraceAsString()
                ."\n";
            // exit with an error code
            exit(1);
        }

        // Write the error to log file
        @error_log('Error 404 Page Not Found: '.$_SERVER['REQUEST_URI']);

        header('HTTP/1.1 404 Not Found', true, 500);
        \Resources\Controller::outputError(
              'errors/404'
            , array('message' => $exception->getMessage())
            );
    }
}


text:
/**
 * External dependencies
 */
import type { GifResource } from '@googleforcreators/media';
import type {
  SequenceMediaElement,
  ElementType,
} from '@googleforcreators/elements';

export interface GifElement extends SequenceMediaElement {
  resource: GifResource;
  type: ElementType.Gif;
}


text:
package goldilocks.util.web;

import org.apache.commons.lang3.exception.ExceptionUtils;

final class GenericClientException extends RuntimeException implements ClientException {

    private static final long serialVersionUID = -2961366309897992305L;
    private final String messageId;

    private final int status;

    public GenericClientException(String messageId, int status) {
        super(messageId);
        this.messageId = messageId;
        this.status = status;
    }

    public GenericClientException(String message, String messageId, int status) {
        super(message);
        this.messageId = messageId;
        this.status = status;
    }

    public GenericClientException(String message, Throwable cause, String messageId, int status) {
        super(message, cause);
        this.messageId = messageId;
        this.status = status;
    }

    public GenericClientException(Throwable cause, String messageId, int status) {
        super(messageId, cause);
        this.messageId = messageId;
        this.status = status;
    }

    public String getExceptionType() {
        Throwable root = ExceptionUtils.getRootCause(this);
        if (root == null) {
            root = this;
        }
        return root.getClass().getName();
    }

    @Override
    public String getMessageId() {
        return messageId;
    }

    @Override
    public int getStatus() {
        return status;
    }

    @Override
    public String toString() {
        return String.format("%s [status=%s, messageId=%s, exceptionType=%s, message=%s]", getClass().getSimpleName(), getStatus(),
                getMessageId(), getExceptionType(), getMessage());
    }

}


text:
<?xml version="1.0"?>
<!DOCTYPE document [
  <!ENTITY project SYSTEM "project.xml">
]>
<document url="mbean-names.html">

  &project;

  <properties>
    <author email="craigmcc@apache.org">Craig McClanahan</author>
    <author email="amyroh@apache.org">Amy Roh</author>
    <title>Tomcat MBean Names</title>
    <revision>$Id: mbean-names.xml 512 2008-03-17 16:52:59Z jfrederic.clere@jboss.com $</revision>
  </properties>

We will be using JMX MBeans as the technology for
    implementing manageability of Tomcat.

One of the key concepts of JMX (and JSR-77) is that each management
    bean has a unique name in the MBeanServer's registry, and that
    management applications can utilize these names to retrieve the MBean
    of interest to them for a particular management operation.
    This document proposes a naming convention for MBeans that allows easy
    calculation of the name for a particular MBean.  For background
    information on JMX MBean names, see the Java Management Extensions
    Instrumentation and Agent Specification, version 1.0, section 6.
    In particular, we will be discussing the String Representation of
    ObjectName instances.

Tomcat's servlet container implementation, called Catalina, can be
represented as a hierarchy of objects that contain references to each other.
The object hierarchy can be represented as a tree, or (isomorphically) based
on the nesting of configuration elements in the conf/server.xml
file that is traditionally used to configure Tomcat stand-alone.

The valid component nestings for Catalina are depicted in the following
table, with columns that contain the following values:

Pattern - Nesting pattern of XML elements (in the
    conf/server.xml file) used to configure this component.

Cardinality - Minimum and maximum number of occurrences of
    this element at this nesting position, which also corresponds to the
    minimum and maximum number of Catalina components.

Identifier - Name of the JavaBeans property of this component
    that represents the unique identifier (within the nested hierarchy),
    if any.

MBean ObjectName - The portion of the MBean object name that
    appears after the domain name.  For now, it should be
    assumed that all of these MBeans appear in the default JMX domain.

In the MBean ObjectName descriptions, several types of symbolic
expressions are utilized to define variable text that is replaced by
corresponding values:

${GROUP} - One of the standard MBean names of the specified
    "group" category.  For example, the expression ${REALM}
    represents the values like JDBCRealm and JAASRealm
    that identify the various MBeans for possible Realm components.

${name} - Replaced by the value of property name
    from the current component.

${parent.name} - Replaced by the value of property
    name from a parent of the current component, with the
    parent's type identified by parent.

${###} - An arbitrary numeric identifier that preserves
    order but has no other particular meaning.  In general, the server will
    assign numeric values to existing instances with large gaps into which
    new items can be configured if desired.

    Pattern
    Cardinality
    Identifier
    MBean ObjectName

    Server
    1..1
    (none)
    type=${SERVER}

    Server / Listener
    0..n
    (none)
    type=${LISTENER}, sequence=${###}

    Server / Service
    1..n
    name
    type=${SERVICE}, name=${name}

    Server / Service / Connector
    1..n
    address, port
    type=${CONNECTOR}, service=${service}, port=${port},
        address=${address}

    Server / Service / Connector / Factory
    0..1
    (none)
    (Only defined explicitly for an SSL connector, but can be treated
        as part of the connector component)

    Server / Service / Connector / Listener
    0..n
    (none)
    type=${LISTENER}, sequence=${###}, service=${service},
        port=${connector.port}, address=${connector.address}

    Server / Service / Engine
    1..1
    (none)
    type=${ENGINE}, service=${service.name}

    Server / Service / Engine / Host
    1..n
    name
    type=${HOST}, host=${name},
        service=${service.name}

    Server / Service / Engine / Host / Context
    1..n
    path
    type=${CONTEXT}, path=${path}, host=${host.name},
        service=${service.name}

    Server / Service / Engine / Host / Context / InstanceListener
    0..n
    (none)
    type=${INSTANCE-LISTENER}, sequence=${###}, path=${context.path},
        host=${host.name}, service=${service.name}

    Server / Service / Engine / Host / Context / Listener
    0..n
    (none)
    type=${LISTENER}, sequence=${###}, path=${context.path},
        host=${host.name}, service=${service.name}

    Server / Service / Engine / Host / Context / Loader
    0..1
    (none)
    type=${LOADER}, path=${context.path}, host=${host.name},
        service=${service.name}

    Server / Service / Engine / Host / Context / Manager
    0..1
    (none)
    type=${MANAGER}, path=${context.path}, host=${host.name},
        service=${service.name}

    Server / Service / Engine / Host / Context / Realm
    0..1
    (none)
    type=${REALM}, path=${context.path}, host=${host.name},
        service=${service.name}

    Server / Service / Engine / Host / Context / Resources
    0..1
    (none)
    type=${RESOURCES}, path=${context.path}, host=${host.name},
        service=${service.name}

    Server / Service / Engine / Host / Context / Valve
    0..n
    (none)
    type=${VALVE}, sequence=${###}, path=${context.path},
        host=${host.name}, service=${service.name}

    Server / Service / Engine / Host / Context / Wrapper
    0..n
    (none)
    j2eeType=Servlet,name=${name},
        WebModule=//${host.name}/${context.name},
        J2EEApplication=${context.J2EEApplication},
        J2EEServer=${context.J2EEServer}

    Server / Service / Engine / Host / Context / WrapperLifecycle
    0..n
    (none)
    type=${WRAPPER-LIFECYCLE}, sequence=${###}, path=${context.path},
        host=${host.name}, service=${service.name}

    Server / Service / Engine / Host / Context / WrapperListener
    0..n
    (none)
    type=${WRAPPER-LISTENER}, sequence=${###}, path=${context.path},
        host=${host.name}, service=${service.name}

    Server / Service / Engine / Host / Listener
    0..n
    (none)
    type=${LISTENER}, sequence=${###}, host=${host.name},
        service=${service.name}

    Server / Service / Engine / Host / Realm
    0..1
    (none)
    type=${REALM}, host=${host.name},
        service=${service.name}

    Server / Service / Engine / Host / Valve
    0..n
    (none)
    type=${VALVE}, sequence=${###},
        host=${host.name}, service=${service.name}

    Server / Service / Engine / Listener
    0..n
    (none)
    type=${LISTENER}, sequence=${###}
        (FIXME - disambiguate from Server / Service /
        Listener)

    Server / Service / Engine / Realm
    0..1
    (none)
    type=${REALM}, service=${service.name}

    Server / Service / Engine / Valve
    0..n
    (none)
    type=${VALVE}, sequence=${###},
        service=${service.name}

    Server / Service / Listener
    0..n
    (none)
    type=${LISTENER}, sequence=${###}
        (FIXME - disambiguate from Server / Service /
        Engine / Listener)

The following MBean names shall be defined in the resource file
/org/apache/catalina/mbeans/mbeans-descriptors.xml (and
therefore available for use within the Administration/Configuration
web application for Tomcat):

    MBean Name
    Group Name
    Catalina Interface
    Implementation Class

    AccessLogValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.valves.AccessLogValve

    BasicAuthenticator
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.authenticator.BasicAuthenticator

    CertificatesValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.valves.CertificatesValve

    ContextConfig
    LISTENER
    org.apache.catalina.LifecycleListener
    org.apache.catalina.startup.ContextConfig

    ContextEnvironment
    RESOURCES
    org.apache.catalina.deploy.ContextEnvironment
    org.apache.catalina.deploy.ContextEnvironment

    ContextResource
    RESOURCES
    org.apache.catalina.deploy.ContextResource
    org.apache.catalina.deploy.ContextResource

    ContextResourceLink
    RESOURCES
    org.apache.catalina.deploy.ContextResourceLink
    org.apache.catalina.deploy.ContextResourceLink

    CoyoteConnector
    CONNECTOR
    org.apache.catalina.Connector
    org.apache.coyote.tomcat4.CoyoteConnector

    DigestAuthenticator
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.authenticator.DigestAuthenticator

    EngineConfig
    LISTENER
    org.apache.catalina.LifecycleListener
    org.apache.catalina.startup.EngineConfig

    ErrorReportValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.valves.ErrorReportValve

    ErrorDispatcherValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.valves.ErrorDispatcherValve

    FormAuthenticator
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.authenticator.FormAuthenticator

    Group
    GROUP
    org.apache.catalina.Group
    org.apache.catalina.Group

    HostConfig
    LISTENER
    org.apache.catalina.LifecycleListener
    org.apache.catalina.startup.HostConfig

    HttpConnector10
    CONNECTOR
    org.apache.catalina.Connector
    org.apache.catalina.connector.http10.HttpConnector

    HttpConnector11
    CONNECTOR
    org.apache.catalina.Connector
    org.apache.catalina.connector.http.HttpConnector

    JAASRealm
    REALM
    org.apache.catalina.Realm
    org.apache.catalina.realm.JAASRealm

    JDBCRealm
    REALM
    org.apache.catalina.Realm
    org.apache.catalina.realm.JDBCRealm

    JDBCUserDatabase
    USERDATABASE
    org.apache.catalina.users.JDBCUserDatabase
    org.apache.catalina.users.JDBCUserDatabase

    JNDIRealm
    REALM
    org.apache.catalina.Realm
    org.apache.catalina.realm.JNDIRealm

    MBeanFactory

    org.apache.catalina.mbeans.MBeanFactory

    MemoryRealm
    REALM
    org.apache.catalina.Realm
    org.apache.catalina.realm.MemoryRealm

    MemoryUserDatabase
    USERDATABASE
    org.apache.catalina.users.MemoryUserDatabase
    org.apache.catalina.users.MemoryUserDatabase

    NamingContextListener
    LISTENER
    org.apache.catalina.LifecycleListener
    org.apache.catalina.core.NamingContextListener

    NamingResources
    RESOURCES
    org.apache.catalina.deploy.NamingResources
    org.apache.catalina.deploy.NamingResources

    NonLoginAuthenticator
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.authenticator.NonLoginAuthenticator

    PersistentManager
    MANAGER
    org.apache.catalina.Manager
    org.apache.catalina.session.PersistentManager

    RemoteAddrValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.valves.RemoteAddrValve

    RemoteHostValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.valves.RemoteHostValve

    RequestDumperValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.valves.RequestDumperValve

    Role
    ROLE
    org.apache.catalina.Role
    org.apache.catalina.Role

    SingleSignOn
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.valves.SingleSignOn

    SSLAuthenticator
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.authenticator.SSLAuthenticator

    StandardContext
    CONTEXT
    org.apache.catalina.Context
    org.apache.catalina.core.StandardContext

    StandardContextValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.core.StandardContextValve

    StandardEngine
    ENGINE
    org.apache.catalina.Engine
    org.apache.catalina.core.StandardEngine

    StandardEngineValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.core.StandardEngineValve

    StandardHost
    HOST
    org.apache.catalina.Host
    org.apache.catalina.core.StandardHost

    StandardHostValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.core.StandardHostValve

    StandardManager
    MANAGER
    org.apache.catalina.Manager
    org.apache.catalina.session.StandardManager

    StandardServer
    SERVER
    org.apache.catalina.Server
    org.apache.catalina.core.StandardServer

    StandardService
    SERVICE
    org.apache.catalina.Service
    org.apache.catalina.core.StandardService

    StandardWrapper
    WRAPPER
    org.apache.catalina.Wrapper
    org.apache.catalina.core.StandardWrapper

    StandardWrapperValve
    VALVE
    org.apache.catalina.Valve
    org.apache.catalina.core.StandardWrapperValve

    User
    USER
    org.apache.catalina.User
    org.apache.catalina.User

    UserDatabaseRealm
    REALM
    org.apache.catalina.Realm
    org.apache.catalina.realm.UserDatabaseRealm

    WebappLoader
    LOADER
    org.apache.catalina.Loader
    org.apache.catalina.loader.WebappLoader

The managed objects in the JSR-77 object hierarchy correspond
to the specified MBean names or groups as follows:

    JSR-77 Managed Object
    MBean Name or Group
    Comments

    J2EEServer
    ${SERVICE}

    Node
    ${SERVICE}
    Tomcat supports a single node only.

    Port
    ${CONNECTOR}

    Servlet
    ${WRAPPER}

    WebModule
    ${CONTEXT}

The deployment objects in the JSR-88 API object hierarchy correspond
to the specified MBean names or groups as follows:

    JSR-88 API Object
    MBean Name or Group
    Comments

    DeployableObject
    ${CONTEXT}
    Context deployment info plus the corresponding WAR file

    Target
    ${HOST}

</document>


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

  angular
    .module('lulu-imageboard')
    .directive('liPostAttachmentsList', factory)
  ;

  factory.$inject = [];

  function factory() {
    PostAttachmentsList.$inject = ['$scope'];

    function PostAttachmentsList($scope) {
      this.attachment = $scope.attachment;
    }

    return {
      replace: true,
      restrict: 'E',
      controller: PostAttachmentsList,
      templateUrl: 'modules/post/directive/PostAttachmentsList/template.html',
      scope: {
        'attachments': '='
      }
    };

  }
})(angular);


text:
main: main.o MyFunctions.o
	gcc -O3 -Werror=vla -fopenmp -g -o main main.o MyFunctions.o -lm

# individual source files

MyFunctions.o: MyFunctions.c MyHeader.h
	gcc -Werror=vla -fopenmp -g -c -lm MyFunctions.c

main.o: main.c MyHeader.h
	gcc -O3 -Werror=vla -fopenmp -g -c main.c

clean:
	rm -f *.o *~ main


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

namespace ArchiveStation.Bean
{
    public class ArchiveResult : BaseBean
    {

    }

    public class ImportArchiveResult : BaseBean
    {
        public ImportResult Data { get; set; }
    }

    public class ArchivePageResult : BaseBean
    {
        public Page<ArchiveBean> Data { get; set; }
    }

    public class ArchiveBean
    {
        public int id { get; set; }
        public string idx { get; set; }
        public string manager { get; set; }
        public string title { get; set; }
        public string number { get; set; }
        public string pages { get; set; }
        public string remark { get; set; }
        public string operateman { get; set; }
        public DateTime operatetime { get; set; }

        public string position { get; set; }

        public int status { get; set; }

        public string statusname { get; set; }

        public string boxname { get; set; }
        public string boxnumber { get; set; }
        public string boxrfid { get; set; }
    }

    public class ArchiveListResult : BaseBean
    {
        public List<ArchiveBean> Data { get; set; }
    }
}


text:
<?php

namespace Rebond\Forms\Core;

use Rebond\Models\Core\Role;
use Rebond\Repository\Core\PermissionRepository;
use Rebond\Repository\Core\RolePermissionRepository;
use Rebond\Services\Form;

class RoleForm extends BaseRoleForm
{
    /**
     * @param Role $model = null
     * @param string $unique
     */
    public function __construct($model = null, $unique = '')
    {
        parent::__construct($model, $unique);
        $this->init();
    }

    public function init()
    {
    }

    public function buildPermissions()
    {
        $options = [];
        $options['clearSelect'] = true;
        $options['select'][] = PermissionRepository::getList(['id', 'title']);
        $options['where'][] = 'permission.status IN (0,1)';
        $options['order'][] = 'permission.title';
        $items = PermissionRepository::loadAll($options);

        $options['clearSelect'] = true;
        $options['select'][] = RolePermissionRepository::getList(['permission_id']);
        $permissions = RolePermissionRepository::loadAllByRoleId($this->getModel()->getId());
        $selectedValues = [];
        foreach ($permissions as $permission) {
            $selectedValues[] = $permission->getPermissionId();
        }
        return Form::buildCheckboxList('permission' . $this->unique, $items, 'id', 'title', $selectedValues);
    }
}


text:
using System;

namespace OpenCube.IO.FileSystem
{
	/// <summary>
	/// Basic implementation for the <see cref="IFileSystemEntryMetadata"/>.
	/// </summary>
	public class FileSystemEntryMetadata
		: IFileSystemEntryMetadata
	{
		private readonly DateTime? _createdAt;
		private readonly DateTime? _lastChangedAt;
		private readonly bool? _isCompressed;
		private readonly bool? _isReadOnly;

		/// <summary>
		/// Initializes a new instance of the <see cref="FileSystemEntryMetadata"/> class.
		/// </summary>
		/// <param name="createdAt">The date and time the entry is created.</param>
		/// <param name="lastChangedAt">The date and time the entry was lasted changed.</param>
		/// <param name="isCompressed">If the entry is compressed.</param>
		/// <param name="isReadOnly">If the entry is read-only.</param>
		public FileSystemEntryMetadata(DateTime? createdAt, DateTime? lastChangedAt, bool? isCompressed, bool? isReadOnly)
		{
			_createdAt = createdAt;
			_lastChangedAt = lastChangedAt;
			_isCompressed = isCompressed;
			_isReadOnly = isReadOnly;
		}

		/// <summary>
		/// Gets when the file or folder was created, or <c>null</c> when unknown or not supported by the source of the meta data.
		/// </summary>
		public DateTime? CreatedAt
		{
			get { return _createdAt; }
		}

		/// <summary>
		/// Gets when the file or folder has changed for the last time, or <c>null</c> when unknown or not supported by the source of the meta data.
		/// </summary>
		public DateTime? LastChangedAt
		{
			get { return _lastChangedAt; }
		}

		/// <summary>
		/// Gets if this file or folder is compressed, or <c>null</c> when unknown or not supported by the source of the meta data.
		/// </summary>
		/// <remarks>This can be native file system compression, or when the file or folder is inside a zip file. It does not matter.
		/// It might even be 'double' compressed. It's all transparent. You only get to know if it is compressed or not.</remarks>
		public bool? IsCompressed
		{
			get { return _isCompressed; }
		}

		/// <summary>
		/// Gets if this file or folder is read only, or <c>null</c> when unknown or not supported by the source of the meta data.
		/// </summary>
		/// <remarks>This can be native file system read only, a read-only attribute, inside a zip file. It does not matter.
		/// You only get to know if it is read only or not.</remarks>
		public bool? IsReadOnly
		{
			get { return _isReadOnly; }
		}
	}
}


text:
var ready = function(fn) {
  if (document.readyState != 'loading') {
    fn();
  } else if (document.addEventListener) {
    document.addEventListener('DOMContentLoaded', fn);
  } else {
    document.attachEvent('onreadystatechange', function() {
      if (document.readyState != 'loading') {
        fn();
      }
    });
  }

  return;
};

/**
 * If loaded DOM elements
 **/
ready(function() {
  var cookiebar = new Cookiebar({
    debug: 1,
    content: {
      description: "Honlapunk ún. sütiket (cookie) használ, hogy biztosítani tudja a személyre szabott, felhasználóbarát böngészést. Az így gyűjtött adatok névtelenek, azokból nem készülnek felhasználói profilok, illetve nem kerülnek további felhasználásra. Az OK-ra kattintva Ön hozzájárul a sütik használatához.",
      link: "@icetee/cookiebar",
      href: "https://github.com/icetee/cookiebar",
      button: "OK"
    },
    onAccept: function () {
      console.log("Cookie accepted");
    }
  });
});


text:
/**
 * Module dependencies.
 */

var Node = require('./node');

/**
 * Initialize a new `Block` with an optional `node`.
 *
 * @param {Node} node
 * @api public
 */

var Block = module.exports = function Block(node){
  this.nodes = [];
  if (node) this.push(node);
};

/**
 * Inherit from `Node`.
 */

Block.prototype.__proto__ = Node.prototype;

/**
 * Replace the nodes in `other` with the nodes
 * in `this` block.
 *
 * @param {Block} other
 * @api private
 */

Block.prototype.replace = function(other){
  other.nodes = this.nodes;
};

/**
 * Pust the given `node`.
 *
 * @param {Node} node
 * @return {Number}
 * @api public
 */

Block.prototype.push = function(node){
  return this.nodes.push(node);
};

/**
 * Check if this block is empty.
 *
 * @return {Boolean}
 * @api public
 */

Block.prototype.isEmpty = function(){
  return 0 == this.nodes.length;
};

/**
 * Unshift the given `node`.
 *
 * @param {Node} node
 * @return {Number}
 * @api public
 */

Block.prototype.unshift = function(node){
  return this.nodes.unshift(node);
};

/**
 * Return the "last" block, or the first `yield` node.
 *
 * @return {Block}
 * @api private
 */

Block.prototype.includeBlock = function(){
  var ret = this
    , node;

  for (var i = 0, len = this.nodes.length; i < len; ++i) {
    node = this.nodes[i];
    if (node.yield) return node;
    else if (node.includeBlock) ret = node.includeBlock();
    else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock();
  }

  return ret;
};


text:
import { Injectable } from '@angular/core';

import { FirebaseService, AFSQuery } from './firebase.service';
import { AngularFirestore } from '../../../node_modules/@angular/fire/firestore';
import { switchMap } from 'rxjs/operators';
import { combineLatest } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class ContactService extends FirebaseService {

  constructor(afs: AngularFirestore) {
    super(afs);
  }

  getContacts(userId: string, filter?: {startAt: any, limit: number}) {
    const query = new AFSQuery();
    if (filter) {
      query.startAt = filter.startAt;
      query.limit = filter.limit;
    }

    return this.collection(`users/${userId}/contacts`, query).pipe(
      switchMap(contacts => {
        return combineLatest(contacts.map((c: any) => this.doc(`users/${c.id}`)));
      }));
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginLeft="10dp"
              android:layout_marginRight="10dp"
              android:orientation="vertical">
    <TextView
        android:id="@+id/type_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:padding="5dp"
        android:textColor="@drawable/record_title_text"
        android:textSize="16sp" />
</LinearLayout>


text:
Simple Restful web app to manage projects and related tasks. Uses
* Python
  - bottle: web microframeword
  - peewee: ORM
  - passlib: password encryption library
* Web
  - Bootstrap 4: UI
  - Jquery: DOM & AJAX
  - Director: client side routing
  - Mustache: client side templates


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package net.ili.base.entities.hr.attendance;

import java.sql.Date;
import net.ili.base.entities.IdEntity;

/**
 * 请假信息
 *
 * @author Weir
 */
public class Leave extends IdEntity {

    private static final long serialVersionUID = -3401469623138039073L;

    private Date beginDate;
    private Date endDate;
    private String status;
    //批准
    private Boolean approved;
    //事由
    private String reason;
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for C:\xampp\htdocs\monitor\application/controllers/mahasiswa/teko.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

C:\xampp\htdocs\monitor\application /

controllers /

mahasiswa /

teko.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

100.00%

1 / 1

100.00%

4 / 4

      <acronym title="Change Risk Anti-Patterns (CRAP) Index">CRAP</acronym>

100.00%

15 / 15

      Teko

100.00%

1 / 1

100.00%

4 / 4

      4

100.00%

15 / 15

       __construct()

100.00%

1 / 1

      1

100.00%

3 / 3

       index()

100.00%

1 / 1

      1

100.00%

4 / 4

       profile()

100.00%

1 / 1

      1

100.00%

4 / 4

       jadwal()

100.00%

1 / 1

      1

100.00%

4 / 4

1
	<?php

2
	defined('BASEPATH') OR exit('No direct script access allowed');

3

4
	class Teko extends CI_Controller {

5
	    function __construct()

6
	    {

7
	        parent::__construct();

8
	            $this->load->helper('url');

9
	            //$this->load->library('url');

10

11
	    }

12

13
	    public function index()

14
	    {

15
	        //$this->load->helper('url');

16
	        $this->load->model('list_mhs');

17
	        $datasis['data'] = $this->list_mhs->toto()->result();

18
	        $this->load->view('mhs/home', $datasis);

19
	        //$this->load->view('home');

20
	    }

21

22
	    public function profile(){

23
	        $this->load->model('list_mhs');

24
	        $datasis['data'] = $this->list_mhs->toto()->result();

25
	        $this->load->view('mhs/profile',$datasis);

26
	        //$this->load->view('profile');

27
	    }

28

29
	    public function jadwal(){

30
	        $this->load->model('list_mhs');

31
	        $datajad['dataj'] = $this->list_mhs->ambil_jadwal()->result();

32
	        $this->load->view('mhs/jadwal',$datajad);

33

34
	    }

35
	}

Legend

     Executed
     Not Executed
     Dead Code

     Generated by PHP_CodeCoverage 1.2.11 using PHP 7.1.9 and PHPUnit 3.7.21 at Tue Oct 17 16:34:32 CEST 2017.


text:
package com.flipkart.foxtrot.common.query;

/**
 * User: Santanu Sinha (santanu.sinha@flipkart.com)
 * Date: 14/03/14
 * Time: 2:22 PM
 */
public interface FilterOperator {
    //All
    public static final String equals = "equals";
    public static final String not_equals = "not_equals";
    public static final String any = "any";
    public static final String in = "in";
    public static final String exists = "exists";
    public static final String missing = "missing";

    //Numeric
    public static final String less_than = "less_than";
    public static final String less_equal = "less_equal";
    public static final String greater_than = "greater_than";
    public static final String greater_equal = "greater_equal";

    public static final String between = "between";

    //String
    public static final String contains = "contains";

    //Date time
    public static final String last = "last";
}


text:
<bill session="110" type="hr" number="621" updated="2009-01-09T09:09:29-05:00">
	<status><introduced date="1186113600" datetime="2007-08-03"/></status>

	<introduced date="1186113600" datetime="2007-08-03"/>
	<titles>
		<title type="official" as="introduced">Recognizing the community development block grant program of the Department of Housing and Urban Development, and its role as the Nation's largest and most visible source of financial assistance to support State- and local government-directed neighborhood revitalization, housing rehabilitation, and economic development activities.</title>
	</titles>
	<sponsor id="400422"/>
	<cosponsors>

	</cosponsors>
	<actions>
		<action date="1186113600" datetime="2007-08-03"><text>Referred to the House Committee on Financial Services.</text></action>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>

	8/3/2007--Introduced.
Supports the goals of the community development block grant (CDBG) program of the Department of Housing and Urban Development. Recognizes the importance of the CDBG program in reducing poverty and strengthening communities in the United States. Urges states and entitlement communities to review their allocations of CDBG funds to ensure that special emphasis is placed on using such funds to eliminate poverty.

</bill>


text:
{% extends "lostnfound/base.html" %}
{% block content %}

 Thank you for registering your item {{item.name}}

 Please print the QR code below and attach it to your item.

{% load static %}

{% endblock %}


text:
namespace vixl {

class Disassembler: public DecoderVisitor {
 public:
  Disassembler();
  Disassembler(char* text_buffer, int buffer_size);
  virtual ~Disassembler();
  char* GetOutput();

  // Declare all Visitor functions.
  #define DECLARE(A)  void Visit##A(Instruction* instr);
  VISITOR_LIST(DECLARE)
  #undef DECLARE

 protected:
  virtual void ProcessOutput(Instruction* instr);

 private:
  void Format(Instruction* instr, const char* mnemonic, const char* format);
  void Substitute(Instruction* instr, const char* string);
  int SubstituteField(Instruction* instr, const char* format);
  int SubstituteRegisterField(Instruction* instr, const char* format);
  int SubstituteImmediateField(Instruction* instr, const char* format);
  int SubstituteLiteralField(Instruction* instr, const char* format);
  int SubstituteBitfieldImmediateField(Instruction* instr, const char* format);
  int SubstituteShiftField(Instruction* instr, const char* format);
  int SubstituteExtendField(Instruction* instr, const char* format);
  int SubstituteConditionField(Instruction* instr, const char* format);
  int SubstitutePCRelAddressField(Instruction* instr, const char* format);
  int SubstituteBranchTargetField(Instruction* instr, const char* format);
  int SubstituteLSRegOffsetField(Instruction* instr, const char* format);
  int SubstitutePrefetchField(Instruction* instr, const char* format);
  int SubstituteBarrierField(Instruction* instr, const char* format);

  inline bool RdIsZROrSP(Instruction* instr) const {
    return (instr->Rd() == kZeroRegCode);
  }

  inline bool RnIsZROrSP(Instruction* instr) const {
    return (instr->Rn() == kZeroRegCode);
  }

  inline bool RmIsZROrSP(Instruction* instr) const {
    return (instr->Rm() == kZeroRegCode);
  }

  inline bool RaIsZROrSP(Instruction* instr) const {
    return (instr->Ra() == kZeroRegCode);
  }

  bool IsMovzMovnImm(unsigned reg_size, uint64_t value);

  void ResetOutput();
  void AppendToOutput(const char* string, ...) PRINTF_CHECK(2, 3);

  char* buffer_;
  uint32_t buffer_pos_;
  uint32_t buffer_size_;
  bool own_buffer_;
};

class PrintDisassembler: public Disassembler {
 public:
  explicit PrintDisassembler(FILE* stream) : stream_(stream) { }
  ~PrintDisassembler() { }

 protected:
  virtual void ProcessOutput(Instruction* instr);

 private:
  FILE *stream_;
};
}  // namespace vixl

#endif  // VIXL_A64_DISASM_A64_H


text:
"""Calculate the RI's for each AWS service."""

from __future__ import absolute_import

from collections import defaultdict
import datetime

import boto3

from check_reserved_instances.calculate import calc_expiry_time

# instance IDs/name to report with unreserved instances
instance_ids = defaultdict(list)

# reserve expiration time to report with unused reservations
reserve_expiry = defaultdict(list)

def create_boto_session(account):
    """Set up the boto3 session to connect to AWS.

    Args:
        account (dict): The AWS Account to scan as loaded from the
            configuration file.

    Returns:
        The authenticated boto3 session.

    """
    aws_access_key_id = account['aws_access_key_id']
    aws_secret_access_key = account['aws_secret_access_key']
    aws_role_arn = account['aws_role_arn']
    region = account['region']
    aws_profile = account['aws_profile']

    if aws_role_arn:
        sts_client = boto3.client('sts', region_name=region)
        creds = sts_client.assume_role(
            RoleArn=aws_role_arn, RoleSessionName='check-reserved-instances')
        aws_access_key_id = creds['Credentials']['AccessKeyId']
        aws_secret_access_key = creds['Credentials']['SecretAccessKey']
        aws_session_token = creds['Credentials']['SessionToken']
        session = boto3.Session(
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            aws_session_token=aws_session_token,
            region_name=region,
            profile_name=aws_profile,
        )
    else:
        session = boto3.Session(
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
            region_name=region,
            profile_name=aws_profile,
        )

    return session

def calculate_ec2_ris(session, results):
    """Calculate the running/reserved instances in EC2.

    This function is unique as it performs both checks for both VPC-launched
    instances, and EC2-Classic instances. Classic and VPC
    instances/reservations are treated separately in the report.

    Args:
        session (:boto3:session.Session): The authenticated boto3 session.
        results (dict): Global results in dictionary format to be appended.

    Returns:
        A dictionary of the running/reserved instances for both VPC and Classic
        instances.

    """
    ec2_conn = session.client('ec2')

    # check to see if account is VPC-only (affects reserved instance reporting)
    account_is_vpc_only = (
        [{'AttributeValue': 'VPC'}] == ec2_conn.describe_account_attributes(
            AttributeNames=['supported-platforms'])['AccountAttributes'][0]
        ['AttributeValues'])

    paginator = ec2_conn.get_paginator('describe_instances')
    page_iterator = paginator.paginate(
        Filters=[{'Name': 'instance-state-name', 'Values': ['running']}])

    # Loop through running EC2 instances and record their AZ, type, and
    # Instance ID or Name Tag if it exists.
    for page in page_iterator:
        for reservation in page['Reservations']:
            for instance in reservation['Instances']:
                # Ignore spot instances
                if 'SpotInstanceRequestId' not in instance:
                    az = instance['Placement']['AvailabilityZone']
                    instance_type = instance['InstanceType']
                    # Check for 'skip reservation' tag and name tag
                    found_skip_tag = False
                    instance_name = None
                    if 'Tags' in instance:
                        for tag in instance['Tags']:
                            if tag['Key'] == 'NoReservation' and len(
                                tag['Value']) > 0 and tag[
                                    'Value'].lower() == 'true':
                                found_skip_tag = True
                            if tag['Key'] == 'Name' and len(tag['Value']) > 0:
                                instance_name = tag['Value']

                    # If skip tag is not found, increment running instances
                    # count and add instance name/ID
                    if not found_skip_tag:
                        # not in vpc
                        if not instance.get('VpcId'):
                            results['ec2_classic_running_instances'][(
                                instance_type,
                                az)] = results[
                                'ec2_classic_running_instances'].get(
                                (instance_type, az), 0) + 1
                            instance_ids[(instance_type, az)].append(
                                instance['InstanceId'] if not instance_name
                                else instance_name)
                        else:
                            # inside vpc
                            results['ec2_vpc_running_instances'][
                                (instance_type,
                                 az)] = results[
                                'ec2_vpc_running_instances'].get(
                                (instance_type, az), 0) + 1
                            instance_ids[(instance_type, az)].append(
                                instance['InstanceId'] if not instance_name
                                else instance_name)

    # Loop through active EC2 RIs and record their AZ and type.
    for reserved_instance in ec2_conn.describe_reserved_instances(
            Filters=[{'Name': 'state', 'Values': ['active']}])[
            'ReservedInstances']:
        # Detect if an EC2 RI is a regional benefit RI or not
        if reserved_instance['Scope'] == 'Availability Zone':
            az = reserved_instance['AvailabilityZone']
        else:
            az = 'All'

        instance_type = reserved_instance['InstanceType']
        # check if VPC/Classic reserved instance
        if account_is_vpc_only or 'VPC' in reserved_instance.get(
                'ProductDescription'):
            results['ec2_vpc_reserved_instances'][(
                instance_type, az)] = results[
                'ec2_vpc_reserved_instances'].get(
                (instance_type, az), 0) + reserved_instance['InstanceCount']
        else:
            results['ec2_classic_reserved_instances'][(
                instance_type, az)] = results[
                'ec2_classic_reserved_instances'].get(
                (instance_type, az), 0) + reserved_instance['InstanceCount']

        reserve_expiry[(instance_type, az)].append(calc_expiry_time(
            expiry=reserved_instance['End']))

    return results

def calculate_elc_ris(session, results):
    """Calculate the running/reserved instances in ElastiCache.

    Args:
        session (:boto3:session.Session): The authenticated boto3 session.
        results (dict): Global results in dictionary format to be appended.

    Returns:
        A dictionary of the running/reserved instances for ElastiCache nodes.

    """
    elc_conn = session.client('elasticache')

    paginator = elc_conn.get_paginator('describe_cache_clusters')
    page_iterator = paginator.paginate()
    # Loop through running ElastiCache instance and record their engine,
    # type, and name.
    for page in page_iterator:
        for instance in page['CacheClusters']:
            if instance['CacheClusterStatus'] == 'available':
                engine = instance['Engine']
                instance_type = instance['CacheNodeType']

                results['elc_running_instances'][(
                    instance_type, engine)] = results[
                    'elc_running_instances'].get(
                        (instance_type, engine), 0) + instance['NumCacheNodes']
                instance_ids[(instance_type, engine)].append(
                    instance['CacheClusterId'])

    paginator = elc_conn.get_paginator('describe_reserved_cache_nodes')
    page_iterator = paginator.paginate()
    # Loop through active ElastiCache RIs and record their type and engine.
    for page in page_iterator:
        for reserved_instance in page['ReservedCacheNodes']:
            if reserved_instance['State'] == 'active':
                engine = reserved_instance['ProductDescription']
                instance_type = reserved_instance['CacheNodeType']

                results['elc_reserved_instances'][(instance_type, engine)] = (
                    results['elc_reserved_instances'].get((
                        instance_type, engine), 0) + reserved_instance[
                        'CacheNodeCount'])

                # No end datetime is returned, so calculate from 'StartTime'
                # (a `DateTime`) and 'Duration' in seconds (integer)
                expiry_time = reserved_instance[
                    'StartTime'] + datetime.timedelta(
                        seconds=reserved_instance['Duration'])

                reserve_expiry[(instance_type, engine)].append(
                    calc_expiry_time(expiry=expiry_time))

    return results

def calculate_rds_ris(session, results):
    """Calculate the running/reserved instances in RDS.

    Args:
        session (:boto3:session.Session): The authenticated boto3 session.
        results (dict): Global results in dictionary format to be appended.

    Returns:
        A dictionary of the running/reserved instances for RDS instances.

    """
    rds_conn = session.client('rds')

    paginator = rds_conn.get_paginator('describe_db_instances')
    page_iterator = paginator.paginate()

    # Loop through running RDS instances and record their Multi-AZ setting,
    # type, and Name
    for page in page_iterator:
        for instance in page['DBInstances']:
            az = instance['MultiAZ']
            instance_type = instance['DBInstanceClass']
            results['rds_running_instances'][(
                instance_type, az)] = results['rds_running_instances'].get(
                    (instance_type, az), 0) + 1
            instance_ids[(instance_type, az)].append(
                instance['DBInstanceIdentifier'])

    paginator = rds_conn.get_paginator('describe_reserved_db_instances')
    page_iterator = paginator.paginate()
    # Loop through active RDS RIs and record their type and Multi-AZ setting.
    for page in page_iterator:
        for reserved_instance in page['ReservedDBInstances']:
            if reserved_instance['State'] == 'active':
                az = reserved_instance['MultiAZ']
                instance_type = reserved_instance['DBInstanceClass']
                results['rds_reserved_instances'][(
                    instance_type, az)] = results[
                    'rds_reserved_instances'].get(
                    (instance_type, az), 0) + reserved_instance[
                    'DBInstanceCount']

                # No end datetime is returned, so calculate from 'StartTime'
                # (a `DateTime`) and 'Duration' in seconds (integer)
                expiry_time = reserved_instance[
                    'StartTime'] + datetime.timedelta(
                        seconds=reserved_instance['Duration'])

                reserve_expiry[(instance_type, az)].append(calc_expiry_time(
                    expiry=expiry_time))

    return results


text:
package com.gilt.gfc.kinesis.publisher

case class PartitionKey(value: String) extends AnyVal


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" />

  <title>Index of /lghtml/lawstat/version2/01746</title>

Index of /lghtml/lawstat/version2/01746

 Parent Directory

<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" />


text:
#ifndef __MPPC_ENC_H
#define __MPPC_ENC_H

#include <freerdp/api.h>
#include <freerdp/types.h>

#define PROTO_RDP_40 1
#define PROTO_RDP_50 2

struct rdp_mppc_enc
{
	int   protocol_type;    /* PROTO_RDP_40, PROTO_RDP_50 etc */
	char* historyBuffer;    /* contains uncompressed data */
	char* outputBuffer;     /* contains compressed data */
	char* outputBufferPlus;
	int   historyOffset;    /* next free slot in historyBuffer */
	int   buf_len;          /* length of historyBuffer, protocol dependant */
	int   bytes_in_opb;     /* compressed bytes available in outputBuffer */
	int   flags;            /* PACKET_COMPRESSED, PACKET_AT_FRONT, PACKET_FLUSHED etc */
	int   flagsHold;
	int   first_pkt;        /* this is the first pkt passing through enc */
	uint16* hash_table;
};

FREERDP_API boolean compress_rdp(struct rdp_mppc_enc* enc, uint8* srcData, int len);
FREERDP_API boolean compress_rdp_4(struct rdp_mppc_enc* enc, uint8* srcData, int len);
FREERDP_API boolean compress_rdp_5(struct rdp_mppc_enc* enc, uint8* srcData, int len);
FREERDP_API struct rdp_mppc_enc* mppc_enc_new(int protocol_type);
FREERDP_API void mppc_enc_free(struct rdp_mppc_enc* enc);

#endif