text:
/* config.h.  Generated from config.h.in by configure.  */
/* config.h.in.  Generated from configure.in by autoheader.  */
#ifndef _CONFIG_H_
#define _CONFIG_H_

/* ONLY EDIT acconfig.h, NEVER config.h or config.h.in!
 * config.h MAY BE OVERWRITTEN BY make, config.h.in by autoheader! */

/* Define your Target here. Currently defined are TARGET_LINUX (any
 * architecture), TARGET_BSD (experimental; tested on FreeBSD, hopefully
 * works for other BSD variants) and TARGET_CYGWIN. */
#define TARGET TARGET_LINUX

/* change the #undef to #define if you do not want to compile with special
 * ISDN support for Linux. Note that the ISDN support will not compile ok on
 * unpatched kernerls earlier than 2.2.12 (if you did apply newer isdn patches,
 * it may work fine). This is not on by default because it will cause compile
 * problems on some systems */
/* #undef ISDN_SUPPORT */

/* The following regulates the IP Protocol support. Supported types are IPv4
 * and IPv6 (aka IPng). You may enable either or both of these protocols.
 * Enabling in this context means that support for the respective protocol
 * will be in the binary. When running the binary, one of the protocols may
 * be activated via command line switches. Note that activating both IPv4 and
 * IPv6 is pointless (and will not work because two UDP and two TCP threads
 * will be started that concur for ports). Because of that, it is not allowed.
 * When pdnsd runs with IPv6 activated it should be able to service queries
 * from IPv6 as well as from IPv4 hosts, provided that you host is configured
 * properly.
 * For each of the protocols there are two options: ENABLE_IPV4 and ENABLE_IPV6
 * control whether support for the respective protocol is available in the
 * binary. DEFAULT_IPV4 selects which protocol is enabled on pdnsd
 * startup by default. 1 means IPv4, while 0 means IPv6. If support for
 * a protocol was included in the executable, you can specify command line
 * parameters to activate or deactivate that protocol (the options are -4 and
 * -6), but it makes more sense to use the run_ipv4=on/off option in the
 * configuration file.
 * Make your choice. Note that IPv6 support is experimental in pdnsd.
 * In normal operation, you will currently only need IPv4. */
#define ENABLE_IPV4 1
#define DEFAULT_IPV4 1
#undef ENABLE_IPV6

/* In all pdnsd versions before 1.0.6, DNS queries were always done over
 * TCP. Now, you have the choice. You can control that behaviour using
 * the -m command line switch, and you can give a preset here. There
 * are 3 different modes:
 * UDP_ONLY: This is undoubtedly the fastest query method, because
 *       no TCP negotiation needs to be done.
 * TCP_ONLY: This is slower than uo, but generally more secure
 *       against DNS spoofing. Note that some name servers on the
 *       internet do not support TCP queries, notably dnscache.
 * TCP_UDP: TCP, then UDP. If the TCP query fails with a "connection refused"-
 *       error or times out, the query is retried using UDP.
 * UDP_TCP: UDP, then TCP. If the UDP reply is truncated (i.e. the tc flag is set),
 *       the query is retried using TCP. */
#define M_PRESET TCP_ONLY

/* In addition to choosing the presets, you may also completely disable
 * one of the protocols (TCP for preset UDP_ONLY and UDP for preset TCP_ONLY).
 * This saves some executable space. */
/* #undef NO_UDP_QUERIES */
/* #undef NO_TCP_QUERIES */

/* With the following option, you can disable the TCP server functionality
 * of pdnsd. Nearly no program does TCP queries, so you probably can do
 * this safely and save some executable space and one thread.
 * You also can turn off the TCP server at runtime with the --notcp option. */
/* #undef NO_TCP_SERVER */

/* By undefining the following, you can disable the UDP source address
 * discovery code. This is not recommended, but you may need it when
 * running into compilation problems. */
#define SRC_ADDR_DISC 1

/* NO_POLL specifies not to use poll(2), but select(2) instead. If you are
 * unsure about what this means, just leave this as it is.*/
/* #undef NO_POLL */

/* Define this for "hard" RFC 2181 compliance: this RFC states that
 * implementations should discard answers whose RR sets have multiple
 * different time stamps. While correct answers are generated, incorrect
 * ones are normally tolerated and corrected. Full RFC compliance is
 * however only achieved by deactivating this behaviour and thus being
 * intolerant. */
/* #undef RFC2181_ME_HARDER */

/* Define this to the device you want to use for getting random numbers.
 * Leave this undefined if you wand to use the standard C library random
 * function, which basically should be sufficient.
 * Linux and FreeBSD have two random number devices: /dev/random and
 * /dev/urandom. /dev/urandom might be less secure in some cases, but
 * should still be more than sufficient. The use of /dev/random is
 * discouraged, as reading from this device blocks when new random bits
 * need to be gathered. */
/* #undef RANDOM_DEVICE */
#define R_DEFAULT 1
/* #undef R_RANDOM */
/* #undef R_ARC4RANDOM */
/*#define RANDOM_DEVICE "/dev/urandom"*/

/* Designate which database manager to use for cacheing.
 * default: native; others: gdbm */
#define CACHE_DBM DBM_NATIVE

#define CONFDIR "/data/data/com.github.shadowsocks"

#define CACHEDIR "/data/data/com.github.shadowsocks"

#define TEMPDIR "/data/data/com.github.shadowsocks/cache";

/* This is for various debugging facilities that produce debug output and
 * double-check some values. You can enable debug messages with the -g option.
 * Normally, you can switch this off safely by setting the number after DEBUG
 * to 0. This will increase speed (although only marginally), save space
 * in the executable (only about 12kB) and some stack space per thread
 * (which may be significant if you have many threads running simultaneously).
 * However, it may be an aid when debugging config files.
 * The only defined debug levels by now are in the range 0 - 9.
 * Define this to 9 if you want hex dumps of all the queries and replies pdnsd
 * receives (you must also call pdnsd with -v9 to actually see the hex dumps).
 * When in doubt, leave it defined to 1. */
#define DEBUG 1

/* This defines the default verbosity of informational messages you will get.
   This has nothing to to with the debug option (-g), but may be set with -v
   option. 0 is for normal operation, up to 3 for debugging.
   Unlike the debug messages, these messages will also be written to the syslog.*/
#define VERBOSITY 0

/* Redefine this if you want another hash size.
 * The number of hash buckets is computed as power of two (1<<HASH_SZ);
 * so e.g. HASH_SZ set to 10 yields 1024 hash rows.
 * HASH_SZ may not be bigger than 32 (if you set it even close to that value,
 * you are nuts.) */
#define HASH_SZ 10

/* Set this to debug the hash tables. Turn this off normally, or you will get
 * flooded with diagnostic messages */
/* #undef DEBUG_HASH */

/* Define if you have working C99 Variadic macro support */
#define CPP_C99_VARIADIC_MACROS 1

/* Define as int if socklen_t typedef is missing */
/* #undef socklen_t */

/* Lock the UDP socket before using it? */
/* #undef SOCKET_LOCKING */

/* Default TCP timeout when receiving queries */
#define TCP_TIMEOUT 5

/* Allow subsequent TCP queries on one connection? */
/* #undef TCP_SUBSEQ */

/* Default value for parallel query number */
#define PAR_QUERIES   4

/* Maximum number of IP addresses used per nameserver obtained from NS records. */
#define MAXNAMESERVIPS 3

/* These are the possible targets. Normally no need to touch these
 * definitions. */
#define TARGET_LINUX  0
#define TARGET_BSD    1
#define TARGET_CYGWIN 2

/* Assume the Native POSIX Thread Library instead of LinuxThreads ? */
#define THREADLIB_NPTL 1

/* If we are using LinuxThreads, implement the fix needed for newer glibcs ? */
/* #undef THREADLIB_LINUXTHREADS2 */

/* The following is needed for using LinuxThreads. Better don't touch. */
#define _REENTRANT 1
#define _THREAD_SAFE 1

/* It appears the newer versions of gcc won't convert a pointer to char into
   a pointer to unsigned char and vice versa without complaining.
   By using casts these warning messages can be suppressed, but at the cost
   of losing some type safety.
   Define charp and ucharp to be empty if you are a developer and find type
   safety more important.
   Leave the definitions unchanged to avoid distracting warning messages. */
#define charp (char *)
#define ucharp (unsigned char *)

/* pdnsd version. DO NOT TOUCH THIS! It is replaced automatically by the
 * contents of ./version */
#define VERSION "1.2.9a-par"

#endif

/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
   systems. This function is required for `alloca.c' support on those systems.
   */
/* #undef CRAY_STACKSEG_END */

/* Define to 1 if using `alloca.c'. */
/* #undef C_ALLOCA */

/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1

/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
   */
#define HAVE_ALLOCA_H 1

/* Define to 1 if you have the `asprintf' function. */
#define HAVE_ASPRINTF 1

/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */

/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1

/* Define to 1 if you have the `getline' function. */
#if defined(__aarch64__) || defined(__x86_64__)
#define HAVE_GETLINE 1
#endif

/* Define to 1 if you have the `getpwnam_r' function. */
//#define HAVE_GETPWNAM_R 1

/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you have the `inet_ntop' function. */
#define HAVE_INET_NTOP 1

/* Define to 1 if you have the `inet_pton' function. */
#define HAVE_INET_PTON 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the `pthread' library (-lpthread). */
#define HAVE_LIBPTHREAD 1

/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `mempcpy' function. */
//#define HAVE_MEMPCPY 1

/* Define to 1 if you have the `mkfifo' function. */
#define HAVE_MKFIFO 1

/* Define to 1 if you have the `nanosleep' function. */
#define HAVE_NANOSLEEP 1

/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1

/* Define to 1 if you have the <net/if.h> header file. */
#define HAVE_NET_IF_H 1

/* Define to 1 if you have the `poll' function. */
#define HAVE_POLL 1

/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1

/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1

/* Define to 1 if you have the `socket' function. */
#define HAVE_SOCKET 1

/* Define to 1 if the system has the type `socklen_t'. */
#define HAVE_SOCKLEN_T 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the `stpcpy' function. */
#if defined(__aarch64__) || defined(__x86_64__)
#define HAVE_STPCPY 1
#endif

/* Define to 1 if you have the `stpncpy' function. */
//#define HAVE_STPNCPY 1

/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1

/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the `strlcpy' function. */
/* #undef HAVE_STRLCPY */

/* Define to 1 if you have the `strndup' function. */
#define HAVE_STRNDUP 1

/* Define to 1 if the system has the type `struct ifreq'. */
#define HAVE_STRUCT_IFREQ 1

/* Define to 1 if the system has the type `struct in6_addr'. */
#define HAVE_STRUCT_IN6_ADDR 1

/* Define to 1 if the system has the type `struct in_pktinfo'. */
#define HAVE_STRUCT_IN_PKTINFO 1

/* Define to 1 if you have the <syslog.h> header file. */
#define HAVE_SYSLOG_H 1

/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1

/* Define to 1 if you have the <sys/poll.h> header file. */
#define HAVE_SYS_POLL_H 1

/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#define HAVE_SYS_WAIT_H 1

/* Define to 1 if you have the `uname' function. */
#define HAVE_UNAME 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to 1 if you have the `vasprintf' function. */
#define HAVE_VASPRINTF 1

/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1

/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1

/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define PACKAGE_NAME ""

/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""

/* Define to the version of this package. */
#define PACKAGE_VERSION ""

/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void

/* If using the C implementation of alloca, define if you know the
   direction of stack growth for your system; otherwise it will be
   automatically deduced at runtime.
	STACK_DIRECTION > 0 => grows toward higher addresses
	STACK_DIRECTION < 0 => grows toward lower addresses
	STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1

/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */

/* Enable extensions on AIX 3, Interix.  */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
/* Enable GNU extensions on systems that have them.  */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* Enable threading extensions on Solaris.  */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
/* Enable extensions on HP NonStop.  */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
/* Enable general extensions on Solaris.  */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif

/* Define to 1 if on MINIX. */
/* #undef _MINIX */

/* Define to 2 if the system does not provide POSIX.1 features except with
   this defined. */
/* #undef _POSIX_1_SOURCE */

/* Define to 1 if you need to in order for `stat' and other things to work. */
/* #undef _POSIX_SOURCE */

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */


text:
/**
 * http://usejsdoc.org/
 */
/**
 * UtilsFactory
 *  @public
 * @class
 */
const path = require('path');
const Logger = require(path.join(browser.params.UTILS_ROOT_DIR, 'logger'));
const Assert = require(path.join(browser.params.UTILS_ROOT_DIR, 'assert'));
const PtorElement = require(path.join(browser.params.UTILS_ROOT_DIR, 'ptor-element'));
const PtorWait = require(path.join(browser.params.UTILS_ROOT_DIR, 'ptor-wait'));

class UtilsFactory {
  /**
   * @constructor
   */
  constructor() {

  }

/**
 * getAllUtils
 * Gets all necessary protractor framework (and more..) utils
 * @public
 * @returns {Object} utils - JSON object that holds all framework necessary instantiated modules
 */
  getAllUtils() {
    const utils = {};
    utils.logger = new Logger().winstonLogger;
    utils.assert = new Assert().chaiExpect;
    utils.ptorElement = new PtorElement();
    utils.ptorWait = new PtorWait();
    return utils;
  }

/**
 * getFrameworkUtils
 * Gets logger and assert utils
 * @public
 * @returns {Object} utils - JSON object that holds logger and assert modules
 */
  getFrameworkUtils() {
    const fwUtils = {};
    fwUtils.logger = new Logger();
    fwUtils.assert = new Assert();
    return fwUtils;
  }

}
module.exports = UtilsFactory;

redpajama_set_name: RedPajamaGithub


text:
class ContentPermissions;

namespace content {
class BrowserContext;
class RenderProcessHost;
class WebContents;
struct FrameNavigateParams;
struct LoadCommittedDetails;
}

namespace extension_web_request_api_helpers {
struct EventResponseDelta;
}

namespace net {
class URLRequest;
}

namespace extensions {

class Extension;

// Representation of a condition in the Declarative Content API. A condition
// consists of a set of predicates on the page state, all of which must be
// satisified for the condition to be fulfilled.
struct ContentCondition {
 public:
  ContentCondition(
      scoped_ptr<DeclarativeContentPageUrlPredicate> page_url_predicate,
      scoped_ptr<DeclarativeContentCssPredicate> css_predicate,
      scoped_ptr<DeclarativeContentIsBookmarkedPredicate>
          is_bookmarked_predicate);
  ~ContentCondition();

  scoped_ptr<DeclarativeContentPageUrlPredicate> page_url_predicate;
  scoped_ptr<DeclarativeContentCssPredicate> css_predicate;
  scoped_ptr<DeclarativeContentIsBookmarkedPredicate> is_bookmarked_predicate;

 private:
  DISALLOW_COPY_AND_ASSIGN(ContentCondition);
};

// Defines the interface for a predicate factory. Temporary, until we can
// introduce an interface to be implemented by the trackers that returns a
// ContentPredicate.
template <class T>
using PredicateFactory =
    base::Callback<scoped_ptr<T>(const Extension* extension,
                                 const base::Value& value,
                                 std::string* error)>;

// Factory function that instantiates a ContentCondition according to the
// description |condition| passed by the extension API.  |condition| should be
// an instance of declarativeContent.PageStateMatcher.
scoped_ptr<ContentCondition> CreateContentCondition(
    const Extension* extension,
    const PredicateFactory<DeclarativeContentCssPredicate>&
        css_predicate_factory,
    const PredicateFactory<DeclarativeContentIsBookmarkedPredicate>&
        is_bookmarked_predicate_factory,
    const PredicateFactory<DeclarativeContentPageUrlPredicate>&
        page_url_predicate_factory,
    const base::Value& condition,
    std::string* error);

// The ChromeContentRulesRegistry is responsible for managing
// the internal representation of rules for the Declarative Content API.
//
// Here is the high level overview of this functionality:
//
// api::events::Rule consists of conditions and actions, these are
// represented as a ContentRule with ContentConditions and ContentRuleActions.
//
// The evaluation of URL related condition attributes (host_suffix, path_prefix)
// is delegated to a URLMatcher, because this is capable of evaluating many
// of such URL related condition attributes in parallel.
//
// A note on incognito support: separate instances of ChromeContentRulesRegistry
// are created for incognito and non-incognito contexts. The incognito instance,
// however, is only responsible for applying rules registered by the incognito
// side of split-mode extensions to incognito tabs. The non-incognito instance
// handles incognito tabs for spanning-mode extensions, plus all non-incognito
// tabs.
class ChromeContentRulesRegistry
    : public ContentRulesRegistry,
      public content::NotificationObserver,
      public DeclarativeContentConditionTrackerDelegate {
 public:
  // For testing, |ui_part| can be NULL. In that case it constructs the
  // registry with storage functionality suspended.
  ChromeContentRulesRegistry(content::BrowserContext* browser_context,
                             RulesCacheDelegate* cache_delegate);

  // ContentRulesRegistry:
  void MonitorWebContentsForRuleEvaluation(
      content::WebContents* contents) override;
  void DidNavigateMainFrame(
      content::WebContents* tab,
      const content::LoadCommittedDetails& details,
      const content::FrameNavigateParams& params) override;

  // RulesRegistry:
  std::string AddRulesImpl(
      const std::string& extension_id,
      const std::vector<linked_ptr<api::events::Rule>>& rules) override;
  std::string RemoveRulesImpl(
      const std::string& extension_id,
      const std::vector<std::string>& rule_identifiers) override;
  std::string RemoveAllRulesImpl(const std::string& extension_id) override;

  // content::NotificationObserver:
  void Observe(int type,
               const content::NotificationSource& source,
               const content::NotificationDetails& details) override;

  // DeclarativeContentConditionTrackerDelegate:
  void RequestEvaluation(content::WebContents* contents) override;
  bool ShouldManageConditionsForBrowserContext(
      content::BrowserContext* context) override;

  // Returns true if this object retains no allocated data. Only for debugging.
  bool IsEmpty() const;

  // TODO(wittman): Remove once DeclarativeChromeContentRulesRegistry no longer
  // depends on concrete condition implementations. At that point
  // DeclarativeChromeContentRulesRegistryTest.ActiveRulesDoesntGrow will be
  // able to use a test condition object and not need to depend on force setting
  // matching CSS seleectors.
  void UpdateMatchingCssSelectorsForTesting(
      content::WebContents* contents,
      const std::vector<std::string>& matching_css_selectors);

  // Returns the number of active rules.
  size_t GetActiveRulesCountForTesting();

 protected:
  ~ChromeContentRulesRegistry() override;

 private:
  // The internal declarative rule representation. Corresponds to a declarative
  // API rule: https://developer.chrome.com/extensions/events.html#declarative.
  struct ContentRule {
   public:
    ContentRule(const Extension* extension,
                ScopedVector<const ContentCondition> conditions,
                ScopedVector<const ContentAction> actions,
                int priority);
    ~ContentRule();

    const Extension* extension;
    ScopedVector<const ContentCondition> conditions;
    ScopedVector<const ContentAction> actions;
    int priority;

   private:
    DISALLOW_COPY_AND_ASSIGN(ContentRule);
  };

  // Specifies what to do with evaluation requests.
  // TODO(wittman): Try to eliminate the need for IGNORE after refactoring to
  // treat all condition evaluation consistently. Currently RemoveRulesImpl only
  // updates the CSS selectors after the rules are removed, which is too late
  // for evaluation.
  enum EvaluationDisposition {
    EVALUATE_REQUESTS,  // Evaluate immediately.
    DEFER_REQUESTS,  // Defer for later evaluation.
    IGNORE_REQUESTS  // Ignore.
  };

  class EvaluationScope;
  struct RendererContentMatchData;

  // Creates a ContentRule for |extension| given a json definition.  The format
  // of each condition and action's json is up to the specific ContentCondition
  // and ContentAction.  |extension| may be NULL in tests.  If |error| is empty,
  // the translation was successful and the returned rule is internally
  // consistent.
  scoped_ptr<const ContentRule> CreateRule(
      const Extension* extension,
      const PredicateFactory<DeclarativeContentCssPredicate>&
          css_predicate_factory,
      const PredicateFactory<DeclarativeContentIsBookmarkedPredicate>&
          is_bookmarked_predicate_factory,
      const PredicateFactory<DeclarativeContentPageUrlPredicate>&
          page_url_predicate_factory,
      const api::events::Rule& api_rule,
      std::string* error);

  // True if this object is managing the rules for |context|.
  bool ManagingRulesForBrowserContext(content::BrowserContext* context);

  std::set<const ContentRule*> GetMatches(
      const RendererContentMatchData& renderer_data,
      bool is_incognito_renderer) const;

  // Updates the condition evaluator with the current watched CSS selectors.
  void UpdateCssSelectorsFromRules();

  // Returns true if all predicates in |condition| evaluate to true.
  bool IsConditionFulfilled(
      const ContentCondition& condition,
      const RendererContentMatchData& renderer_data) const;

  // Evaluates the conditions for |tab| based on the tab state and matching CSS
  // selectors.
  void EvaluateConditionsForTab(content::WebContents* tab);

  // Returns true if a rule created by |extension| should be evaluated for an
  // incognito renderer.
  bool ShouldEvaluateExtensionRulesForIncognitoRenderer(
      const Extension* extension) const;

  using ExtensionRuleIdPair = std::pair<const Extension*, std::string>;
  using RuleAndConditionForURLMatcherId =
      std::map<url_matcher::URLMatcherConditionSet::ID,
               std::pair<const ContentRule*, const ContentCondition*>>;
  using RulesMap = std::map<ExtensionRuleIdPair, linked_ptr<const ContentRule>>;

  // Map that tells us which ContentRules and ContentConditions may
  // match for a URLMatcherConditionSet::ID returned by the |url_matcher_|.
  RuleAndConditionForURLMatcherId rule_and_conditions_for_match_id_;

  // Set of conditions that participate in URL matching. Supports early-out
  // during evaluation of conditions that have failing URL matches.
  std::set<const ContentCondition*> url_matcher_conditions_;

  RulesMap content_rules_;

  // Maps a WebContents to the set of rules that match on that WebContents.
  // This lets us call Revert as appropriate. Note that this is expected to have
  // a key-value pair for every WebContents the registry is tracking, even if
  // the value is the empty set.
  std::map<content::WebContents*, std::set<const ContentRule*>> active_rules_;

  // Responsible for tracking declarative content page URL condition state.
  DeclarativeContentPageUrlConditionTracker page_url_condition_tracker_;

  // Responsible for tracking declarative content CSS condition state.
  DeclarativeContentCssConditionTracker css_condition_tracker_;

  // Responsible for tracking declarative content bookmarked condition state.
  DeclarativeContentIsBookmarkedConditionTracker
      is_bookmarked_condition_tracker_;

  // Specifies what to do with evaluation requests.
  EvaluationDisposition evaluation_disposition_;

  // Contains WebContents which require rule evaluation. Only used while
  // |evaluation_disposition_| is DEFER.
  std::set<content::WebContents*> evaluation_pending_;

  // Manages our notification registrations.
  content::NotificationRegistrar registrar_;

  DISALLOW_COPY_AND_ASSIGN(ChromeContentRulesRegistry);
};

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULES_REGISTRY_H_


text:
const path = require('path');

const fileNames = {
  bundle: 'bundle.scss',
  bundleManifest: 'bundle.json',
  critical: 'critical.scss',
  entry: 'index.js',
  favicon: 'favicon.ico',
  fontLoader: 'fontLoader.js',
  fonts: 'fonts.scss',
  render: 'render.js',
  stats: 'stats.json',
  sw: 'swRegister.js'
};

const srcPath = path.resolve(__dirname, '../src');
const outputPath = path.resolve(__dirname, '../clientBuild');
const outputPathServer = path.resolve(__dirname, '../serverBuild');
const src = file => path.join(srcPath, file);
const out = file => path.join(outputPath, file);
const outServer = file => path.join(outputPathServer, file);

module.exports = {
  paths: {
    entry: src(fileNames.entry),
    critical: src(fileNames.critical),
    bundle: src(fileNames.bundle),
    bundleManifest: out(fileNames.bundleManifest),
    fonts: src(fileNames.fonts),
    favicon: src(fileNames.favicon),
    fontLoader: out(fileNames.fontLoader),
    render: outServer(fileNames.render),
    stats: out(fileNames.stats),
    sw: out(fileNames.sw),
    output: outputPath,
    outputServer: outputPathServer,
    src: srcPath
  },
  vendors: {
    dev: [
      'react-hot-loader'
    ],
    production: [
      'axios',
      'firebase/app',
      'firebase/auth',
      'history',
      'lodash.merge',
      'lodash.union',
      'normalizr',
      'prop-types',
      're-reselect',
      'react',
      'react-dom',
      'react-helmet',
      'react-redux',
      'react-router-dom',
      'react-router-redux',
      'react-universal-component',
      'redux',
      'redux-saga',
      'regenerator-runtime/runtime',
      'reselect'
    ]
  },
  fileNames
};


text:
package org.project.openbaton.nubomedia.paas.core.openshift;

import com.google.gson.Gson;
import org.project.openbaton.nubomedia.paas.core.openshift.builders.MessageBuilderFactory;
import org.project.openbaton.nubomedia.paas.exceptions.openshift.UnauthorizedException;
import org.project.openbaton.nubomedia.paas.model.openshift.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by maa on 06.10.15.
 */
@Service
public class SecretManager {

  @Autowired private Gson mapper;
  @Autowired private RestTemplate template;
  private Logger logger;
  private String secretSuffix;
  private String saSuffix;

  @PostConstruct
  private void init() {
    this.logger = LoggerFactory.getLogger(this.getClass());
    this.secretSuffix = "/secrets";
    this.saSuffix = "/serviceaccounts/builder";
  }

  public String createSecret(
      String baseURL, String namespace, String privateKey, HttpHeaders authHeader)
      throws UnauthorizedException {

    SecretConfig message = MessageBuilderFactory.getSecretMessage(namespace, privateKey);
    logger.debug("message " + mapper.toJson(message, SecretConfig.class));
    HttpEntity<String> secretEntity =
        new HttpEntity<>(mapper.toJson(message, SecretConfig.class), authHeader);
    ResponseEntity<String> responseEntity =
        template.exchange(
            baseURL + namespace + secretSuffix, HttpMethod.POST, secretEntity, String.class);

    logger.debug("response entity " + responseEntity.toString());
    SecretConfig response = mapper.fromJson(responseEntity.getBody(), SecretConfig.class);
    String secretName = response.getMetadata().getName();

    responseEntity = this.updateBuilder(baseURL, secretName, authHeader, namespace, true);
    if (responseEntity.getStatusCode() != HttpStatus.OK)
      logger.debug("Error updating builder account " + response.toString());

    if (responseEntity.getStatusCode().equals(HttpStatus.UNAUTHORIZED)) {

      throw new UnauthorizedException("Invalid or expired token");
    }

    return secretName;
  }

  public HttpStatus deleteSecret(
      String baseURL, String secretName, String namespace, HttpHeaders authHeader)
      throws UnauthorizedException {
    HttpEntity<String> deleteEntity = new HttpEntity<>("", authHeader);
    ResponseEntity<String> entity =
        template.exchange(
            baseURL + namespace + secretSuffix + "/" + secretName,
            HttpMethod.DELETE,
            deleteEntity,
            String.class);

    if (entity.getStatusCode() != HttpStatus.OK)
      logger.debug("Error deleting secret " + secretName + " response " + entity.toString());

    if (entity.getStatusCode().equals(HttpStatus.UNAUTHORIZED)) {

      throw new UnauthorizedException("Invalid or expired token");
    }

    entity = this.updateBuilder(baseURL, secretName, authHeader, namespace, false);

    if (entity.getStatusCode() != HttpStatus.OK)
      logger.debug("Error updating builder account " + entity.toString());

    if (entity.getStatusCode().equals(HttpStatus.UNAUTHORIZED)) {

      throw new UnauthorizedException("Invalid or expired token");
    }

    return entity.getStatusCode();
  }

  //BETA!!!!
  public List<String> getSecretList(String baseURL, String namespace, HttpHeaders authHeader)
      throws UnauthorizedException {

    List<String> res = new ArrayList<>();
    String url = baseURL + namespace + saSuffix;
    HttpEntity<String> builderEntity = new HttpEntity<>(authHeader);
    ResponseEntity<String> serviceAccountBuilder =
        template.exchange(url, HttpMethod.GET, builderEntity, String.class);

    if (serviceAccountBuilder.getStatusCode() != HttpStatus.OK)
      logger.debug("Error updating builder account " + serviceAccountBuilder.toString());

    if (serviceAccountBuilder.getStatusCode().equals(HttpStatus.UNAUTHORIZED)) {

      throw new UnauthorizedException("Invalid or expired token");
    }

    ServiceAccount serviceAccount =
        mapper.fromJson(serviceAccountBuilder.getBody(), ServiceAccount.class);
    for (SecretID secretID : serviceAccount.getSecrets()) {
      if (secretID.getName().contains(namespace)) {
        res.add(secretID.getName());
      }
    }

    return res;
  }

  private ResponseEntity<String> updateBuilder(
      String baseURL, String secretName, HttpHeaders authHeader, String namespace, boolean add) {
    String URL = baseURL + namespace + saSuffix;
    HttpEntity<String> builderEntity = new HttpEntity<>(authHeader);
    ResponseEntity<String> serviceAccount =
        template.exchange(URL, HttpMethod.GET, builderEntity, String.class);

    logger.debug("Builder account " + serviceAccount.getBody());

    ServiceAccount builder = mapper.fromJson(serviceAccount.getBody(), ServiceAccount.class);
    List<SecretID> secrets = builder.getSecrets();
    List<SecretID> newSecrets;

    if (add) {
      newSecrets = this.addSecret(secrets, secretName);

    } else {
      newSecrets = this.removeSecret(secrets, secretName);
    }

    builder.setSecrets(newSecrets);
    builderEntity = new HttpEntity<>(mapper.toJson(builder, ServiceAccount.class), authHeader);
    serviceAccount = template.exchange(URL, HttpMethod.PUT, builderEntity, String.class);

    logger.debug("New builder account " + serviceAccount.getBody());

    return serviceAccount;
  }

  private List<SecretID> removeSecret(List<SecretID> secrets, String secretName) {

    for (SecretID sec : secrets) {
      if (sec.getName().equals(secretName)) secrets.remove(sec);
    }

    return secrets;
  }

  private List<SecretID> addSecret(List<SecretID> secrets, String secretName) {

    secrets.add(new SecretID(secretName));

    return secrets;
  }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Mosquera, Lado, Estrada-Torres, Beltrán Tejera & Wrigley de Basanta, An. Jard. bot. Madr. 60(1): 4 (2003)

#### Original name
Licea succulenticola Mosquera, Lado, Estrada & Beltrán-Tej., 2003

### Remarks
null


text:
titleBreadcrumb: Designprinciper
...

Designelement
=================
Här beskriver jag de nya teman jag skapat, som du hittar i [temaväljaren](theme-selector).

##Theme 1
Här använder jag mig av ett foto på en åskstorm som bakgrundsbild. Den täcker hela bakgrunden och
är fixerad på samma ställe oavsett om du scrollar eller inte. Innehållet på sidan täcker hela
bredden av webbläsaren. Navbaren är nu placerad längst till vänster istället för längst
upp, och sidebaren har flyttats längst till höger, men Innehållet i main är fortfarande placerad
i mitten av sidan. Navbaren är också fixerad på samma ställe även om du scrollar ner för att man
lätt ska kunna byta sida. Jag har ingen egen bakgrund för main, utan bakgrundsbilden fungerar
som bakgrund för alla element, men jag tycker att all text ändå är tydlig att läsa.

##Theme 2
Här använder jag en mindre bild som repeteras för att täcka hela bakgrunden. Alla elementens
egna bakgrunder har en mörkare färg, men är transparenta så att trämönstret finns i dem också.
Alla de olika delarna av sidan är omgiven av en border som jag tycker passar bra till
bakgrundsmönstret. Linjerna som bordern skapar tycker jag bidrar till en bättre design.

##Theme 3
Här använder jag mig av små bilder som är inlagda med hjälp av background-propertyn i CSS.
Jag använder två bilder som båda föreställer en fågel färgad som en siluett, och de finns i headern
och för h1-taggen. Jag har använt en gradient av färger till breadcrumben och det element i
sidebaren som visar användaren vilket sida den är inne på. De element som har en gradient har fått färger
som återspeglar färgerna i flashen.


text:
var once = require('./once');

describe('Function/once', function () {
  it('should execute a function only one time', function () {
    var num = 0;
    var canOnlyFireOnce = once(function () {
      return num += 1;
    });

    expect(canOnlyFireOnce()).toBe(1);

    expect(canOnlyFireOnce()).toBe(1);

    expect(function () {
      once(null)();
    }).toThrow('Expected a function for first argument');
  });
});


text:
namespace TrainingPlanner.View.Forms
{
  partial class PaceForm
  {
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
      if (disposing && (components != null))
      {
        components.Dispose();
      }
      base.Dispose(disposing);
    }

    #region Windows Form Designer generated code

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      this.label1 = new System.Windows.Forms.Label();
      this.txtEasy = new System.Windows.Forms.MaskedTextBox();
      this.txtBase = new System.Windows.Forms.MaskedTextBox();
      this.txtMarathon = new System.Windows.Forms.MaskedTextBox();
      this.txtHalfmarathon = new System.Windows.Forms.MaskedTextBox();
      this.txtThreshold = new System.Windows.Forms.MaskedTextBox();
      this.txtTenk = new System.Windows.Forms.MaskedTextBox();
      this.txtFivek = new System.Windows.Forms.MaskedTextBox();
      this.label2 = new System.Windows.Forms.Label();
      this.label3 = new System.Windows.Forms.Label();
      this.label4 = new System.Windows.Forms.Label();
      this.label5 = new System.Windows.Forms.Label();
      this.label6 = new System.Windows.Forms.Label();
      this.label7 = new System.Windows.Forms.Label();
      this.butSaveChanges = new System.Windows.Forms.Button();
      this.butDiscardChanges = new System.Windows.Forms.Button();
      this.label8 = new System.Windows.Forms.Label();
      this.txtSteady = new System.Windows.Forms.MaskedTextBox();
      this.SuspendLayout();
      //
      // label1
      //
      this.label1.AutoSize = true;
      this.label1.Location = new System.Drawing.Point(12, 15);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(30, 13);
      this.label1.TabIndex = 0;
      this.label1.Text = "Easy";
      //
      // txtEasy
      //
      this.txtEasy.Location = new System.Drawing.Point(86, 12);
      this.txtEasy.Mask = "##:##";
      this.txtEasy.Name = "txtEasy";
      this.txtEasy.Size = new System.Drawing.Size(37, 20);
      this.txtEasy.TabIndex = 7;
      this.txtEasy.TextChanged += new System.EventHandler(this.PaceValueChanged);
      //
      // txtBase
      //
      this.txtBase.Location = new System.Drawing.Point(86, 38);
      this.txtBase.Mask = "##:##";
      this.txtBase.Name = "txtBase";
      this.txtBase.Size = new System.Drawing.Size(37, 20);
      this.txtBase.TabIndex = 8;
      this.txtBase.TextChanged += new System.EventHandler(this.PaceValueChanged);
      //
      // txtMarathon
      //
      this.txtMarathon.Location = new System.Drawing.Point(86, 90);
      this.txtMarathon.Mask = "##:##";
      this.txtMarathon.Name = "txtMarathon";
      this.txtMarathon.Size = new System.Drawing.Size(37, 20);
      this.txtMarathon.TabIndex = 9;
      this.txtMarathon.TextChanged += new System.EventHandler(this.PaceValueChanged);
      //
      // txtHalfmarathon
      //
      this.txtHalfmarathon.Location = new System.Drawing.Point(86, 142);
      this.txtHalfmarathon.Mask = "##:##";
      this.txtHalfmarathon.Name = "txtHalfmarathon";
      this.txtHalfmarathon.Size = new System.Drawing.Size(37, 20);
      this.txtHalfmarathon.TabIndex = 10;
      this.txtHalfmarathon.TextChanged += new System.EventHandler(this.PaceValueChanged);
      //
      // txtThreshold
      //
      this.txtThreshold.Location = new System.Drawing.Point(86, 116);
      this.txtThreshold.Mask = "##:##";
      this.txtThreshold.Name = "txtThreshold";
      this.txtThreshold.Size = new System.Drawing.Size(37, 20);
      this.txtThreshold.TabIndex = 11;
      this.txtThreshold.TextChanged += new System.EventHandler(this.PaceValueChanged);
      //
      // txtTenk
      //
      this.txtTenk.Location = new System.Drawing.Point(86, 168);
      this.txtTenk.Mask = "##:##";
      this.txtTenk.Name = "txtTenk";
      this.txtTenk.Size = new System.Drawing.Size(37, 20);
      this.txtTenk.TabIndex = 12;
      this.txtTenk.TextChanged += new System.EventHandler(this.PaceValueChanged);
      //
      // txtFivek
      //
      this.txtFivek.Location = new System.Drawing.Point(86, 194);
      this.txtFivek.Mask = "##:##";
      this.txtFivek.Name = "txtFivek";
      this.txtFivek.Size = new System.Drawing.Size(37, 20);
      this.txtFivek.TabIndex = 13;
      this.txtFivek.TextChanged += new System.EventHandler(this.PaceValueChanged);
      //
      // label2
      //
      this.label2.AutoSize = true;
      this.label2.Location = new System.Drawing.Point(12, 41);
      this.label2.Name = "label2";
      this.label2.Size = new System.Drawing.Size(31, 13);
      this.label2.TabIndex = 14;
      this.label2.Text = "Base";
      //
      // label3
      //
      this.label3.AutoSize = true;
      this.label3.Location = new System.Drawing.Point(12, 93);
      this.label3.Name = "label3";
      this.label3.Size = new System.Drawing.Size(52, 13);
      this.label3.TabIndex = 15;
      this.label3.Text = "Marathon";
      //
      // label4
      //
      this.label4.AutoSize = true;
      this.label4.Location = new System.Drawing.Point(12, 145);
      this.label4.Name = "label4";
      this.label4.Size = new System.Drawing.Size(70, 13);
      this.label4.TabIndex = 16;
      this.label4.Text = "Halfmarathon";
      //
      // label5
      //
      this.label5.AutoSize = true;
      this.label5.Location = new System.Drawing.Point(12, 119);
      this.label5.Name = "label5";
      this.label5.Size = new System.Drawing.Size(54, 13);
      this.label5.TabIndex = 17;
      this.label5.Text = "Threshold";
      //
      // label6
      //
      this.label6.AutoSize = true;
      this.label6.Location = new System.Drawing.Point(12, 171);
      this.label6.Name = "label6";
      this.label6.Size = new System.Drawing.Size(25, 13);
      this.label6.TabIndex = 18;
      this.label6.Text = "10k";
      //
      // label7
      //
      this.label7.AutoSize = true;
      this.label7.Location = new System.Drawing.Point(12, 197);
      this.label7.Name = "label7";
      this.label7.Size = new System.Drawing.Size(19, 13);
      this.label7.TabIndex = 19;
      this.label7.Text = "5k";
      //
      // butSaveChanges
      //
      this.butSaveChanges.Location = new System.Drawing.Point(12, 220);
      this.butSaveChanges.Name = "butSaveChanges";
      this.butSaveChanges.Size = new System.Drawing.Size(111, 23);
      this.butSaveChanges.TabIndex = 20;
      this.butSaveChanges.Text = "Save Changes";
      this.butSaveChanges.UseVisualStyleBackColor = true;
      this.butSaveChanges.Click += new System.EventHandler(this.butSaveChanges_Click);
      //
      // butDiscardChanges
      //
      this.butDiscardChanges.DialogResult = System.Windows.Forms.DialogResult.Cancel;
      this.butDiscardChanges.Location = new System.Drawing.Point(12, 249);
      this.butDiscardChanges.Name = "butDiscardChanges";
      this.butDiscardChanges.Size = new System.Drawing.Size(111, 23);
      this.butDiscardChanges.TabIndex = 21;
      this.butDiscardChanges.Text = "Discard Changes";
      this.butDiscardChanges.UseVisualStyleBackColor = true;
      this.butDiscardChanges.Click += new System.EventHandler(this.butDiscardChanges_Click);
      //
      // label8
      //
      this.label8.AutoSize = true;
      this.label8.Location = new System.Drawing.Point(12, 67);
      this.label8.Name = "label8";
      this.label8.Size = new System.Drawing.Size(40, 13);
      this.label8.TabIndex = 23;
      this.label8.Text = "Steady";
      //
      // txtSteady
      //
      this.txtSteady.Location = new System.Drawing.Point(86, 64);
      this.txtSteady.Mask = "##:##";
      this.txtSteady.Name = "txtSteady";
      this.txtSteady.Size = new System.Drawing.Size(37, 20);
      this.txtSteady.TabIndex = 22;
      //
      // PaceForm
      //
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.CancelButton = this.butDiscardChanges;
      this.ClientSize = new System.Drawing.Size(135, 282);
      this.Controls.Add(this.label8);
      this.Controls.Add(this.txtSteady);
      this.Controls.Add(this.butDiscardChanges);
      this.Controls.Add(this.butSaveChanges);
      this.Controls.Add(this.label7);
      this.Controls.Add(this.label6);
      this.Controls.Add(this.label5);
      this.Controls.Add(this.label4);
      this.Controls.Add(this.label3);
      this.Controls.Add(this.label2);
      this.Controls.Add(this.txtFivek);
      this.Controls.Add(this.txtTenk);
      this.Controls.Add(this.txtThreshold);
      this.Controls.Add(this.txtHalfmarathon);
      this.Controls.Add(this.txtMarathon);
      this.Controls.Add(this.txtBase);
      this.Controls.Add(this.txtEasy);
      this.Controls.Add(this.label1);
      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
      this.Name = "PaceForm";
      this.Text = "Paces";
      this.ResumeLayout(false);
      this.PerformLayout();

    }

    #endregion

    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.MaskedTextBox txtEasy;
    private System.Windows.Forms.MaskedTextBox txtBase;
    private System.Windows.Forms.MaskedTextBox txtMarathon;
    private System.Windows.Forms.MaskedTextBox txtHalfmarathon;
    private System.Windows.Forms.MaskedTextBox txtThreshold;
    private System.Windows.Forms.MaskedTextBox txtTenk;
    private System.Windows.Forms.MaskedTextBox txtFivek;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.Label label4;
    private System.Windows.Forms.Label label5;
    private System.Windows.Forms.Label label6;
    private System.Windows.Forms.Label label7;
    private System.Windows.Forms.Button butSaveChanges;
    private System.Windows.Forms.Button butDiscardChanges;
    private System.Windows.Forms.Label label8;
    private System.Windows.Forms.MaskedTextBox txtSteady;
  }
}


text:
using LNF.DataAccess;

namespace LNF.Impl.Repository.Scheduler
{
    public class ReservationOnTheFly : IDataItem
    {
        public ReservationOnTheFly() { }
        public virtual int ReservationOnTheFlyID { get; set; }
        public virtual Reservation Reservation { get; set; }
        public virtual string CardNumber { get; set; }
        public virtual string OnTheFlyName { get; set; }
        public virtual string IPAddress { get; set; }
        public virtual string CardReaderName { get; set; }
    }
}


text:
#ifndef __LUCENE_ANALYSIS_STOP_ANALYZER__
#define __LUCENE_ANALYSIS_STOP_ANALYZER__

#import  "LCAnalyzer.h"

#ifdef HAVE_UKTEST
#import  <UnitKit/UnitKit.h>
@interface LCStopAnalyzer: LCAnalyzer <UKTest>
#else
@interface LCStopAnalyzer: LCAnalyzer
#endif
{
	NSSet *stopWords;
	NSArray *ENGLISH_STOP_WORDS;
}

- (id) initWithStopWords: (NSArray *) sw;

@end

#endif /* __LUCENE_ANALYSIS_STOP_ANALYZER__ */


text:
'use strict';

/**
 * This contains all the core commands that kalabox can run on every machine
 */

module.exports = function(kbox) {

  // Prints out the kbox version.
  kbox.tasks.add(function(task) {
    task.path = ['version'];
    task.description = 'Display the kbox version';
    task.func = function() {
      console.log(kbox.core.config.getGlobalConfig().version);
    };
  });

};


text: this is file 51


text:
title: Jeff Atwood
summary: Developer, co-founder of Stack Overflow
categories:
- developer
- mac
- windows
---

### Who are you, and what do you do?

I'm Jeff Atwood, co-founder of [Stack Overflow][stack-overflow] and long time blogger at [codinghorror.com](https://blog.codinghorror.com/ "Jeff's website."). Since 2013 I've been working on [Discourse][], an open source discussion platform.

I came to be a programmer, a writer, an entrepreneur, and a father, in that order. I am still at least three of those things.

### What hardware do you use?

I try to live by the golden rule: always have at least five computers within a ten foot range of where you are at any given time. Here's what I use regularly:

- [iPhone 7][iphone-7]
- [Surface Pro 4][surface-pro-4]
- [MacBook][macbook.2] (2016)
- [iPad Pro][ipad-pro] 12.9"
- Custom [i7-7700k][core-i7-7700k] desktop, 32GB DDR4-3200, [Samsung 960 Pro NVMe SSD][nvme-ssd-960-pro], [GeForce 1080 Ti][geforce-gtx-1080-ti] with triple 4k monitors

I was never a big Apple fan, but the way they made such [dramatic jumps in mobile performance](https://blog.codinghorror.com/the-pc-is-over/ "Jeff's post on mobile performance.") over the last 4-5 years, plus their unexpected turn into world class mobile hardware security ... has kinda turned me into a believer. Apple has always been good at closed ecosystems, haven't they? And for better or worse, we live in the era of [the ultimate closed ecosystems](https://blog.codinghorror.com/serving-at-the-pleasure-of-the-king/ "Jeff's post on walled gardens.").

The Surface Pro is probably my preferred device at any given time if I have to pick just one. They've really perfected the tablet keyboard in the last version and I love the form factor. I just ordered the new Surface Pro, too, though you definitely need to go with the i5 or i7 to have a meaningful performance difference between this and the latest [iOS][] hardware.

I apologize for the lack of [Android][] here, because although the OS has improved dramatically in the last 2 years, I've really struggled to find hardware I like that runs Android. Everything is Qualcomm, and Qualcomm is... not so good lately. That said, I love the Google ecosystem and I set my Mom up with the [Nexus 9][nexus-9] and [Pixel phone][pixel]. I sure hope one day Google will make their own mobile hardware like Apple does.

### And what software?

I guess it's true, every other version of Windows is the good one: [Windows XP][windows-xp] good, [Vista][windows-vista] bad, [Windows 7][windows-7] good, [Windows 8][windows-8] bad, [Windows 10][windows-10] good. While Stack Overflow was mostly a .net and Windows platform, it's true that Linux is a big part of my life now with Discourse -- and the big news is that, in Windows 10, Microsoft has internalized Linux on Windows! I can launch a real [Bash][] shell with a real Linux right in Windows, with (almost) no virtualization overhead.

In a stunning plot twist, it turns out that Microsoft was the one to finally make it the year of Linux on the Desktop. That's right, you no longer need to pick iOS if you want kinda-sorta-Unix on a modern GUI that won't make your eyes bleed. Well, not too much, anyway.

That said, I'm not an OS bigot, I use [OS X][macos] (albeit very, very lightly), Linux, Android, and iOS regularly alongside Windows. Diversity is good for the soul.

My favorite software of all time happens works on every platform: the web browser. Modern versions of [Edge][edge.2], [Chrome][], [Firefox][], and [Safari][] are all my huckleberry and I love them like I love my kids. For development I use [Visual Studio Code][visual-studio-code], which is built using browser technology and works everywhere, and has become remarkably great in the last year as they keep iterating on it. I also need a clipboard history tool installed wherever I go, because the world was built on the back of the humble cut and paste.

### What would be your dream setup?

I dreamt for _years_ about high DPI displays, and those finally happened, even on desktop, thank God. I recently purchased an OLED television and the quality of the colors and the depth of the dynamic range -- blacks that are infinitely black -- blew my freaking mind. So now I'm desperate for OLED displays on my phone, my tablet, and my desktop and laptop and everywhere else.

I guess I want everything I have now, but with 8k OLED high DPI screens. I also believe the world where your smartphone is indistinguishable from your laptop, performance wise, is nearly upon us, so I'd like that too. Let my smartphone be my mobile device and I can just plug a keyboard and my fancy OLED screen into it.

[android]: https://developers.google.com/android/?csw=1 "A mobile phone platform."
[bash]: http://www.gnu.org/software/bash/ "A terminal shell."
[chrome]: https://www.google.com/intl/en/chrome/browser/ "A WebKit-based browser, where each tab runs in its own thread."
[core-i7-7700k]: https://ark.intel.com/products/97129/Intel-Core-i7-7700K-Processor-8M-Cache-up-to-4_50-GHz "A computer processor."
[discourse]: https://www.discourse.org/ "An open-source discussion platform."
[edge.2]: https://www.microsoft.com/en-us/windows/microsoft-edge "A web browser."
[firefox]: https://www.mozilla.org/en-US/firefox/new/ "A cross-platform open-source web browser."
[geforce-gtx-1080-ti]: https://www.nvidia.com/en-us/geforce/products/10series/geforce-gtx-1080-ti/ "A graphics card."
[ios]: https://www.apple.com/ios/ios-10/ "A mobile operating system."
[ipad-pro]: https://en.wikipedia.org/wiki/IPad_Pro "An iOS tablet."
[iphone-7]: https://en.wikipedia.org/wiki/IPhone_7 "A 4.7 inch iOS smartphone."
[macbook.2]: https://en.wikipedia.org/wiki/MacBook_(2015_version) "A very thin 12 inch laptop."
[macos]: https://en.wikipedia.org/wiki/MacOS "An operating system for Mac hardware."
[nexus-9]: http://www.google.com/nexus/9/ "An 8.9 inch Android tablet."
[nvme-ssd-960-pro]: https://www.samsung.com/semiconductor/minisite/ssd/product/consumer/ssd960.html "A solid state hard drive."
[pixel]: https://store.google.com/product/pixel_phone "A 5 inch Android smartphone."
[safari]: https://www.apple.com/safari/ "A fast web browser."
[stack-overflow]: https://stackoverflow.com/ "A developer community."
[surface-pro-4]: https://en.wikipedia.org/wiki/Surface_Pro_4 "A Windows tablet."
[visual-studio-code]: https://code.visualstudio.com/ "A development IDE."
[windows-10]: https://en.wikipedia.org/wiki/Windows_10 "An operating system."
[windows-7]: https://en.wikipedia.org/wiki/Windows_7 "An operating system."
[windows-8]: https://en.wikipedia.org/wiki/Windows_8 "An operating system for PC and tablet computers."
[windows-vista]: https://en.wikipedia.org/wiki/Windows_Vista "A desktop operating system."
[windows-xp]: https://en.wikipedia.org/wiki/Windows_XP "An operating system for x86 computers."


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title>Python: class Resource</title>

class Resource(__builtin__.object)

<tt>   </tt>
<tt>A class for interacting with a resource.
 </tt>

Methods defined here:

__init__(self)

insert = method(self, **kwargs)

<tt>Inserts a response for the specified submission in the specified topic within the specified series.

Args:

  seriesId: integer, The decimal ID of the Series. (required)

  topicId: integer, The decimal ID of the Topic within the Series. (required)

  parentSubmissionId: integer, The decimal ID of the parent Submission within the Series. (required)

  body: object, The request body. (required)

  anonymous: boolean, Set to true to mark the new submission as anonymous.</tt>

list = method(self, **kwargs)

<tt>Lists or searches the responses for the specified submission within the specified series and returns the search results.

Args:

  sort: string, Sort order.

  seriesId: integer, The decimal ID of the Series. (required)

  author: string, Restricts the results to submissions by a specific author.

  submissionId: integer, The decimal ID of the Submission within the Series. (required)

  q: string, Search query.

  max_results: integer, Maximum number of results to return.

  hasAttachedVideo: boolean, Specifies whether to restrict to submissions that have videos attached.

  start_index: integer, Index of the first result to be retrieved.</tt>

Data descriptors defined here:

__dict__

<tt>dictionary for instance variables (if defined)</tt>

__weakref__

<tt>list of weak references to the object (if defined)</tt>


text:
using System;
using Gwen.Input;
using Newtonsoft.Json;

namespace Gwen.Control
{
    /// <summary>
    /// Tab header.
    /// </summary>
    [JsonObject(MemberSerialization.OptIn)]
    [JsonConverter(typeof(Serialization.GwenConverter))]
    public class TabButton : Button
    {
        private ControlBase page;
        private TabControl control;

        /// <summary>
        /// Indicates whether the tab is active.
        /// </summary>
        public bool IsActive { get { return page != null && page.IsVisible; } }

        // todo: remove public access
        public TabControl TabControl
        {
            get { return control; }
            set
            {
                if (value == control) return;
                if (control != null)
                    control.OnLoseTab(this);
                control = value;
            }
        }

        /// <summary>
        /// Interior of the tab.
        /// </summary>
        public ControlBase Page { get { return page; } set { page = value; } }

        /// <summary>
        /// Determines whether the control should be clipped to its bounds while rendering.
        /// </summary>
        protected override bool shouldClip
        {
            get { return false; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TabButton"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TabButton(ControlBase parent)
            : base(parent)
        {
            DragAndDrop_SetPackage(true, "TabButtonMove");
            Alignment = Pos.Top | Pos.Left;
            TextPadding = new Padding(5, 3, 3, 3);
            Padding = Padding.Two;
            KeyboardInputEnabled = true;
        }

        public override void DragAndDrop_StartDragging(DragDrop.Package package, int x, int y)
        {
            IsHidden = true;
        }

        public override void DragAndDrop_EndDragging(bool success, int x, int y)
        {
            IsHidden = false;
            IsDepressed = false;
        }

        public override bool DragAndDrop_ShouldStartDrag()
        {
            return control.AllowReorder;
        }

        /// <summary>
        /// Renders the control using specified skin.
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void render(Skin.SkinBase skin)
        {
            skin.DrawTabButton(this, IsActive, control.TabStrip.Dock);
        }

        /// <summary>
        /// Handler for Down Arrow keyboard event.
        /// </summary>
        /// <param name="down">Indicates whether the key was pressed or released.</param>
        /// <returns>
        /// True if handled.
        /// </returns>
        protected override bool onKeyDown(bool down)
        {
            onKeyRight(down);
            return true;
        }

        /// <summary>
        /// Handler for Up Arrow keyboard event.
        /// </summary>
        /// <param name="down">Indicates whether the key was pressed or released.</param>
        /// <returns>
        /// True if handled.
        /// </returns>
        protected override bool onKeyUp(bool down)
        {
            onKeyLeft(down);
            return true;
        }

        /// <summary>
        /// Handler for Right Arrow keyboard event.
        /// </summary>
        /// <param name="down">Indicates whether the key was pressed or released.</param>
        /// <returns>
        /// True if handled.
        /// </returns>
        protected override bool onKeyRight(bool down)
        {
            if (down)
            {
                var count = Parent.Children.Count;
                int me = Parent.Children.IndexOf(this);
                if (me + 1 < count)
                {
                    var nextTab = Parent.Children[me + 1];
                    TabControl.OnTabPressed(nextTab, EventArgs.Empty);
                    InputHandler.KeyboardFocus = nextTab;
                }
            }

            return true;
        }

        /// <summary>
        /// Handler for Left Arrow keyboard event.
        /// </summary>
        /// <param name="down">Indicates whether the key was pressed or released.</param>
        /// <returns>
        /// True if handled.
        /// </returns>
        protected override bool onKeyLeft(bool down)
        {
            if (down)
            {
                var count = Parent.Children.Count;
                int me = Parent.Children.IndexOf(this);
                if (me - 1 >= 0)
                {
                    var prevTab = Parent.Children[me - 1];
                    TabControl.OnTabPressed(prevTab, EventArgs.Empty);
                    InputHandler.KeyboardFocus = prevTab;
                }
            }

            return true;
        }

        /// <summary>
        /// Updates control colors.
        /// </summary>
        public override void UpdateColors()
        {
            if (IsActive)
            {
                if (IsDisabled)
                {
                    TextColor = Skin.Colors.Tab.Active.Disabled;
                    return;
                }
                if (IsDepressed)
                {
                    TextColor = Skin.Colors.Tab.Active.Down;
                    return;
                }
                if (IsHovered)
                {
                    TextColor = Skin.Colors.Tab.Active.Hover;
                    return;
                }

                TextColor = Skin.Colors.Tab.Active.Normal;
            }

            if (IsDisabled)
            {
                TextColor = Skin.Colors.Tab.Inactive.Disabled;
                return;
            }
            if (IsDepressed)
            {
                TextColor = Skin.Colors.Tab.Inactive.Down;
                return;
            }
            if (IsHovered)
            {
                TextColor = Skin.Colors.Tab.Inactive.Hover;
                return;
            }

            TextColor = Skin.Colors.Tab.Inactive.Normal;
        }
    }
}


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

namespace Test_NUnit.Linq_101_Samples
{
    [global::System.AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
    sealed class Linq101SamplesModifiedAttribute : Attribute
    {
        readonly string description;
        public Linq101SamplesModifiedAttribute(string description)
        {
            this.description = description;
        }

        public string PositionalString { get; private set; }
    }
}


text:
package net.wigle.wigleandroid.model;

/**
 * rank user. not thread-safe.
 */
public final class RankUser {
    private final long rank;
    private final long rankDiff;
    private final String username;
    private final long monthWifiGps;
    private final long totalWifiGps;
    private final long totalCellGps;

    public RankUser(final long rank, final long rankDiff, final String username, final long monthWifiGps,
                    final long totalWifiGps, final long totalCellGps) {
        this.rank = rank;
        this.rankDiff = rankDiff;
        this.username = username;
        this.monthWifiGps = monthWifiGps;
        this.totalWifiGps = totalWifiGps;
        this.totalCellGps = totalCellGps;
    }

    public long getRank() {
        return rank;
    }

    public long getRankDiff() {
        return rankDiff;
    }

    public String getUsername() {
        return username;
    }

    public long getMonthWifiGps() {
        return monthWifiGps;
    }

    public long getTotalWifiGps() {
        return totalWifiGps;
    }

    public long getTotalCellGps() {
        return totalCellGps;
    }
}


text:
/**
 * Provides the AssetManager class in the GQE namespace which is responsible
 * for managing all IAssetHandler classes and providing application wide
 * Asset management facilities.
 *
 * @file include/GQE/Core/classes/AssetManager.hpp
 * @author Ryan Lindeman
 * @date 20100723 - Initial Release
 * @date 20110110 - Added ability to get sf::Sound from SoundAsset
 * @date 20110127 - Moved to GQE Core library and include directory
 * @date 20110131 - Added class and method argument documentation
 * @date 20110218 - Added new Config asset type
 * @date 20110218 - Change to system include style
 * @date 20110627 - Remove extra , from enum and extra ; from namespace
 * @date 20120503 - Redo AssetManager to be more flexible and use RAII techniques
 */
#ifndef   CORE_ASSET_MANAGER_HPP_INCLUDED
#define   CORE_ASSET_MANAGER_HPP_INCLUDED

#include <map>
#include <typeinfo>
#include <GQE/Core/interfaces/TAssetHandler.hpp>
#include <GQE/Core/Core_types.hpp>

namespace GQE
{
  /// Provides centralized game asset manager class for managing game assets.
  class GQE_API AssetManager
  {
    public:
      /**
       * AssetManager constructor
       */
      AssetManager();

      /**
       * AssetManager deconstructor
       */
      virtual ~AssetManager();

      /**
       * GetHandler is responsible for returning an TAssetHandler derived
       * class that was previously registered under typeid(TYPE).name() of the
       * TYPE provided which can then be used to obtain Asset references by
       * Asset ID.
       */
      template<class TYPE>
      TAssetHandler<TYPE>& GetHandler() const
      {
        // The TAssetHandler<TYPE> derived class that will be returned
        TAssetHandler<TYPE>* anResult = NULL;

        // Iterator to the asset if found
        std::map<const typeAssetHandlerID, IAssetHandler*>::const_iterator iter;

        // Try to find the asset using theAssetID as the key
        iter = mHandlers.find(typeid(TYPE).name());

        // Found asset? increment the count and return the reference
        if(iter != mHandlers.end())
        {
          // Cast the IAssetHandler address found into TAssetHandler
          anResult = static_cast<TAssetHandler<TYPE>*>(iter->second);
        }

        // Make sure we aren't returning NULL at this point
        if(anResult == NULL)
        {
          FLOG(StatusAppMissingAsset) << "AssetManager::GetHandler("
            << typeid(TYPE).name() << ") not found!" << std::endl;
        }

        // Return the TAssetHandler addres or Null if something went wrong
        return *anResult;
      }

      /**
       * GetHandler is responsible for returning an IAssetHandler derived
       * class that was previously registered under theAssetHandlerID provided
       * which can then be used to obtain Asset references by Asset ID.
       * @param[in] theAssetHandlerID to retrieve
       */
      IAssetHandler& GetHandler(const typeAssetHandlerID theAssetHandlerID) const;

      /**
       * RegisterHandler is responsible for registering an IAssetHandler
       * derived class with the AssetManager. These handlers are used to manage
       * various asset types used by game states and other entities.
       * @param[in] theAssetHandler pointer to register
       */
      void RegisterHandler(IAssetHandler* theAssetHandler);

      /**
       * LoadAllAssets is responsible for loading all unloaded assets for every
       * IAssetHandler derived class registered, typically from the
       * IState::DoInit() method.
       * @return true if all assets load successfully, false otherwise
       */
      bool LoadAllAssets(void);

    private:
      // Constants
      ///////////////////////////////////////////////////////////////////////////

      // Variables
      ///////////////////////////////////////////////////////////////////////////
      /// Map to hold all IAssetHandler derived classes that manage assets
      std::map<const typeAssetHandlerID, IAssetHandler*> mHandlers;

      /**
       * AssetManager copy constructor is private because we do not allow copies
       * of our class
       */
      AssetManager(const AssetManager&); // Intentionally undefined

      /**
       * Our assignment operator is private because we do not allow copies
       * of our class
       */
      AssetManager& operator=(const AssetManager&); // Intentionally undefined
  }; // class AssetManager
} // namespace GQE

#endif // CORE_ASSET_MANAGER_HPP_INCLUDED

/**
 * @class GQE::AssetManager
 * @ingroup Core
 * The AssetManager class provides a central class for managing game
 * application assets.  Assets might include but are not limited to:
 * Fonts, Images, Music, Sounds, etc.  The AssetManager collects a
 * list of requested game assets and allows the background loading of
 * these assets as necessary.  The AssetManager can also load these
 * assets in the foreground if specified.  The AssetManager also
 * manages the removal of shared assets as soon as it becomes clear that
 * the game asset is no longer in use by using internal reference counts
 * for each game asset requested.
 *
 * Copyright (c) 2010-2011 Ryan Lindeman
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */


text:
package com.geecat.movie.model;

public class Movie {
//private String name;

}


text:
import logging
import os
import pickle
import stat
import time
from time import sleep
try:
  from flask import Flask, render_template, request
except ImportError as e:
  raise Exception(
      "Please run impala-pip install -r $IMPALA_HOME/infra/python/deps/extended-test-"
      "requirements.txt:\n{0}".format(str(e)))
from schedule_item import ScheduleItem
from controller import PATH_TO_REPORTS, PATH_TO_SCHEDULE
from threading import Thread
from tests.comparison.query_profile import DefaultProfile
from tests.comparison.db_types import (
     Boolean,
     Char,
     Decimal,
     Float,
     Int,
     TYPES,
     Timestamp)

MAX_REPORT_AGE = 21 * 24 * 3600 # 21 days
SLEEP_LENGTH = 20 * 60 # 20 min

LOG = logging.getLogger('leopard.front_end')

app = Flask(__name__)
app.reports = {}

ASSETS = {'bootstrap_css': 'css/bootstrap.min.css',
    'hljs_css': 'css/default.css',
    'favicon': 'favicon.ico',
    'bootstrap_js': 'js/bootstrap.min.js',
    'hljs_js': 'js/highlight.pack.js'}

@app.route('/reports/<report_id>')
def show_report(report_id):
  '''Renders a report as HTML. '''

  if report_id not in app.reports:
    with open(os.path.join(PATH_TO_REPORTS, report_id), 'r') as f:
      app.reports[report_id] = pickle.load(f)

  report = app.reports[report_id]

  def get_next_id():
    '''Generates all natural numbers. '''
    i = 0
    while True:
      yield str(i)
      i += 1

  gen = get_next_id()

  # Generate HTML for displaying the crashes
  outer_crashes_list = []
  for first_impala_frame in report.grouped_stacks:
    crashes_list = []
    # results are sorted on the length of the query SQL
    for result in sorted(report.grouped_stacks[first_impala_frame],
        key = lambda result: len(result['test_sql'])):
      inner_id = next(gen)
      inner_title = 'Lines in Stack: {0}'.format(
          len(result['formatted_stack'].split('\n')))
      content = ('
Impala Query:

{0}
'
          '
Stack:

{1}
').format(
              result['test_sql'], result['formatted_stack'][:50000])
      crashes_list.append((inner_id, inner_title, content))
    id = next(gen)
    title = first_impala_frame
    outer_crashes_list.append((id, title, crashes_list))

  # Generate HTML for displaying result row count mismatches
  row_count_list = []
  for result in sorted(report.grouped_results['row_counts'],
      key = lambda result: len(result['test_sql'])):
    id = next(gen)
    title = 'Impala Rows: {0}, Postgres Rows: {1}'.format(
        result['test_row_count'], result['ref_row_count'])
    content = ('
Impala Query:

{0}
'
        '
Postgres Query:

{1}
').format(
        result['test_sql'], result['ref_sql'])
    row_count_list.append((id, title, content))

  # Generate HTML for displaying result content mismatches
  mismatch_list = []
  for result in sorted(report.grouped_results['mismatch'],
      key = lambda result: len(result['test_sql'])):
    id = next(gen)
    title = 'Query Length: {0}'.format(len(result['test_sql']))
    content = ('
Impala Query:

{0}
'
        '
Postgres Query:

{1}
'
        '
Mismatch Impala Row:

{2}
'
        '
Mismatch Postgres Row:

{3}
').format(
        result['test_sql'],
        result['ref_sql'],
        result['mismatch_test_row'],
        result['mismatch_ref_row'])
    mismatch_list.append((id, title, content))

  return render_template(
      'report.template',
      assets=ASSETS,
      report=report,
      outer_crashes_list=outer_crashes_list,
      row_count_list=row_count_list,
      mismatch_list=mismatch_list)

@app.route('/start_run', methods=['POST', 'GET'])
def start_run():
  '''Method that receives POST requests and gernerates a schedule item.'''

  if request.method != 'POST': return 'fail'

  if 'time_limit' in request.form:
    # This is a custom run because time_limit item is present only in the custom_run form.
    # Values will be extracted from the form and a new profile will be generated.

    new_profile = DefaultProfile()

    # Bounds
    new_profile._bounds['MAX_NESTED_QUERY_COUNT'] = (
        int(request.form['max_nested_query_count_from']),
        int(request.form['max_nested_query_count_to']))
    new_profile._bounds['MAX_NESTED_EXPR_COUNT'] = (
        int(request.form['max_nested_expr_count_from']),
        int(request.form['max_nested_expr_count_to']))
    new_profile._bounds['SELECT_ITEM_COUNT'] = (
        int(request.form['select_item_count_from']),
        int(request.form['select_item_count_to']))
    new_profile._bounds['WITH_TABLE_COUNT'] = (
        int(request.form['with_table_count_from']),
        int(request.form['with_table_count_to']))
    new_profile._bounds['TABLE_COUNT'] = (
        int(request.form['table_count_from']),
        int(request.form['table_count_to']))
    new_profile._bounds['ANALYTIC_LEAD_LAG_OFFSET'] = (
        int(request.form['analytic_lead_lag_offset_from']),
        int(request.form['analytic_lead_lag_offset_to']))
    new_profile._bounds['ANALYTIC_WINDOW_OFFSET'] = (
        int(request.form['analytic_window_offset_from']),
        int(request.form['analytic_window_offset_to']))

    # Select Item Category
    new_profile._weights['SELECT_ITEM_CATEGORY']['AGG'] = int(
        request.form['select_agg'])
    new_profile._weights['SELECT_ITEM_CATEGORY']['ANALYTIC'] = int(
        request.form['select_analytic'])
    new_profile._weights['SELECT_ITEM_CATEGORY']['BASIC'] = int(
        request.form['select_basic'])

    # Types
    new_profile._weights['TYPES'][Boolean] = int(request.form['types_boolean'])
    new_profile._weights['TYPES'][Char] = int(request.form['types_char'])
    new_profile._weights['TYPES'][Decimal] = int(request.form['types_decimal'])
    new_profile._weights['TYPES'][Float] = int(request.form['types_float'])
    new_profile._weights['TYPES'][Int] = int(request.form['types_int'])
    new_profile._weights['TYPES'][Timestamp] = int(request.form['types_timestamp'])

    # Join
    new_profile._weights['JOIN']['INNER'] = int(request.form['join_inner'])
    new_profile._weights['JOIN']['LEFT'] = int(request.form['join_left'])
    new_profile._weights['JOIN']['RIGHT'] = int(request.form['join_right'])
    new_profile._weights['JOIN']['FULL_OUTER'] = int(request.form['join_full_outer'])
    new_profile._weights['JOIN']['CROSS'] = int(request.form['join_cross'])

    # Optional Query Clauses Probabilities
    new_profile._probabilities['OPTIONAL_QUERY_CLAUSES']['WITH'] = float(
        request.form['optional_with'])
    new_profile._probabilities['OPTIONAL_QUERY_CLAUSES']['FROM'] = float(
        request.form['optional_from'])
    new_profile._probabilities['OPTIONAL_QUERY_CLAUSES']['WHERE'] = float(
        request.form['optional_where'])
    new_profile._probabilities['OPTIONAL_QUERY_CLAUSES']['GROUP_BY'] = float(
        request.form['optional_group_by'])
    new_profile._probabilities['OPTIONAL_QUERY_CLAUSES']['HAVING'] = float(
        request.form['optional_having'])
    new_profile._probabilities['OPTIONAL_QUERY_CLAUSES']['UNION'] = float(
        request.form['optional_union'])
    new_profile._probabilities['OPTIONAL_QUERY_CLAUSES']['ORDER_BY'] = float(
        request.form['optional_order_by'])

    # Optional Analytic Clauses Probabilities
    new_profile._probabilities['OPTIONAL_ANALYTIC_CLAUSES']['PARTITION_BY'] = float(
        request.form['optional_analytic_partition_by'])
    new_profile._probabilities['OPTIONAL_ANALYTIC_CLAUSES']['ORDER_BY'] = float(
        request.form['optional_analytic_order_by'])
    new_profile._probabilities['OPTIONAL_ANALYTIC_CLAUSES']['WINDOW'] = float(
        request.form['optional_analytic_window'])

    # Misc Probabilities
    new_profile._probabilities['MISC']['INLINE_VIEW'] = float(
        request.form['misc_inline_view'])
    new_profile._probabilities['MISC']['SELECT_DISTINCT'] = float(
        request.form['misc_select_distinct'])
    new_profile._probabilities['MISC']['SCALAR_SUBQUERY'] = float(
        request.form['misc_scalar_subquery'])
    new_profile._probabilities['MISC']['UNION_ALL'] = float(
        request.form['misc_union_all'])

    # Analytic Designs
    new_profile._flags['ANALYTIC_DESIGNS']['TOP_LEVEL_QUERY_WITHOUT_LIMIT'] = \
        'analytic_designs_top_level_no_limit' in request.form
    new_profile._flags['ANALYTIC_DESIGNS']['DETERMINISTIC_ORDER_BY'] = \
        'analytic_designs_deterministic_order_by' in request.form
    new_profile._flags['ANALYTIC_DESIGNS']['NO_ORDER_BY'] = \
        'analytic_designs_no_order_by' in request.form
    new_profile._flags['ANALYTIC_DESIGNS']['ONLY_SELECT_ITEM'] = \
        'analytic_designs_only_select_item' in request.form
    new_profile._flags['ANALYTIC_DESIGNS']['UNBOUNDED_WINDOW'] = \
        'analytic_designs_unbounded_window' in request.form
    new_profile._flags['ANALYTIC_DESIGNS']['RANK_FUNC'] = \
        'analytic_designs_rank_func' in request.form

    schedule_item = ScheduleItem(
        run_name = request.form['run_name'],
        query_profile = new_profile,
        time_limit_sec = int(request.form['time_limit']),
        git_command = request.form['git_command'],
        parent_job = '')
  else:
    # Run based on previous run
    schedule_item = ScheduleItem(
        run_name = request.form['run_name'],
        query_profile = DefaultProfile(),
        time_limit_sec = 24 * 3600, # Default time limit is 24 hours
        git_command = request.form['git_command'],
        parent_job = request.form['report_id'])

  schedule_item.save_pickle()

  return 'success'

@app.route("/custom_run")
def custom_run():
  '''Render the custom run page.
  '''
  return render_template(
      'custom_run.template',
      assets=ASSETS)

def reload_reports():
  '''Reload reports in the reports directory every 20 minutes. Loaded reports are placed
  into app.reports. This allows new reports to appear on the front page. Only reports
  from the past 7 days are loaded. This method should be run in a separate thread.
  '''
  while True:
    new_reports = {}
    try:
      report_ids = os.listdir(PATH_TO_REPORTS)
    except EnvironmentError as e:
      report_ids = []
      LOG.warn('{0}: {1}'.format(e.filename, e.strerror))
    for report_id in report_ids:
      file_age = time.time() - os.stat(
          os.path.join(PATH_TO_REPORTS, report_id))[stat.ST_MTIME]
      if file_age < MAX_REPORT_AGE:
        # We want this report
        if report_id in app.reports:
          new_reports[report_id] = app.reports[report_id]
        else:
          with open(os.path.join(PATH_TO_REPORTS, report_id), 'r') as f:
            new_reports[report_id] = pickle.load(f)
    app.reports = new_reports
    sleep(SLEEP_LENGTH)

@app.route("/")
def front_page():
  '''Renders the front page as HTML.
  '''

  try:
    schedule_item_ids = os.listdir(PATH_TO_SCHEDULE)
  except EnvironmentError as e:
    schedule_item_ids = []
    LOG.warn('{0}: {1}'.format(e.filename, e.strerror))

  schedule_items = []

  for schedule_item_id in schedule_item_ids:
    schedule_items.append(pickle.load(
      open(os.path.join(PATH_TO_SCHEDULE, schedule_item_id), 'r')))

  return render_template(
      'index.template',
      assets=ASSETS,
      reports=sorted(
          app.reports.items(), key=lambda (k, report): report.run_date, reverse=True),
      schedule_items=schedule_items)

if __name__ == '__main__':
  logging.basicConfig(
      format='%(asctime)s %(levelname)s [%(name)s.%(threadName)s:%(lineno)s]: '
             '%(message)s',
      level=logging.INFO)
  thread = Thread(name='reload_reports', target=reload_reports)
  thread.daemon = True
  thread.start()
  app.run(host='0.0.0.0', debug=False)


text:
import { ng } from '../../utils/process';
import { replaceInFile } from '../../utils/fs';
import { getGlobalVariable } from '../../utils/env';

export default function() {
  // Skip this in Appveyor tests.
  if (getGlobalVariable('argv').appveyor) {
    return Promise.resolve();
  }

  return Promise.resolve()
    .then(() => replaceInFile('src/app/app.component.ts',
      '@Component({',
      '@Component({ moduleId: module.id,'))
    .then(() => ng('build'));
}


text:
layout: post
title: Dr Jekyll's Bootstrap
date: 2015-08-20 00:00:00
homepage: https://github.com/drjekyllthemes/jekyll-bootstrap-theme
download: https://github.com/drjekyllthemes/jekyll-bootstrap-theme/archive/gh-pages.zip
demo: http://drjekyllthemes.github.io/jekyll-bootstrap-theme/
author: Gerald Bauer
thumbnail: drjekyll-bootstrap.png
license: Public Domain
---


text: Open Source projects


text:
module Azure::Batch::Mgmt::V2018_12_01
  module Models
    #
    # The network configuration for a pool.
    #
    class NetworkConfiguration

      include MsRestAzure

      # @return [String] The ARM resource identifier of the virtual network
      # subnet which the compute nodes of the pool will join. This is of the
      # form
      # /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.
      # The virtual network must be in the same region and subscription as the
      # Azure Batch account. The specified subnet should have enough free IP
      # addresses to accommodate the number of nodes in the pool. If the subnet
      # doesn't have enough free IP addresses, the pool will partially allocate
      # compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch'
      # service principal must have the 'Classic Virtual Machine Contributor'
      # Role-Based Access Control (RBAC) role for the specified VNet. The
      # specified subnet must allow communication from the Azure Batch service
      # to be able to schedule tasks on the compute nodes. This can be verified
      # by checking if the specified VNet has any associated Network Security
      # Groups (NSG). If communication to the compute nodes in the specified
      # subnet is denied by an NSG, then the Batch service will set the state
      # of the compute nodes to unusable. For pools created via
      # virtualMachineConfiguration the Batch account must have
      # poolAllocationMode userSubscription in order to use a VNet. If the
      # specified VNet has any associated Network Security Groups (NSG), then a
      # few reserved system ports must be enabled for inbound communication.
      # For pools created with a virtual machine configuration, enable ports
      # 29876 and 29877, as well as port 22 for Linux and port 3389 for
      # Windows. For pools created with a cloud service configuration, enable
      # ports 10100, 20100, and 30100. Also enable outbound connections to
      # Azure Storage on port 443. For more details see:
      # https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration
      attr_accessor :subnet_id

      # @return [PoolEndpointConfiguration] The configuration for endpoints on
      # compute nodes in the Batch pool. Pool endpoint configuration is only
      # supported on pools with the virtualMachineConfiguration property.
      attr_accessor :endpoint_configuration

      #
      # Mapper for NetworkConfiguration class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'NetworkConfiguration',
          type: {
            name: 'Composite',
            class_name: 'NetworkConfiguration',
            model_properties: {
              subnet_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'subnetId',
                type: {
                  name: 'String'
                }
              },
              endpoint_configuration: {
                client_side_validation: true,
                required: false,
                serialized_name: 'endpointConfiguration',
                type: {
                  name: 'Composite',
                  class_name: 'PoolEndpointConfiguration'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
NSString * const kIPHRequestLocationErrorDomain = @"com.iPhuanLib.error.location.request";

@interface IPHCLLocationManager : CLLocationManager

@property (nonatomic, assign) BOOL needReverseGeocodeLocation;
@property (nonatomic, assign) BOOL hasGetLocation;
@property (nonatomic, copy) IPHLocateCompletionHandler completionHandler;

- (void)executeBlockWithError:(NSError *)error;

@end

@implementation IPHCLLocationManager

- (void)executeBlockWithError:(NSError *)error {
    if (_completionHandler) {
        _completionHandler(error);
    }
}

@end

@interface IPHLocationManager ()<CLLocationManagerDelegate>
@property (nonatomic, readwrite, strong) CLLocation *location;
@property (nonatomic, readwrite, strong) CLPlacemark *placemark;
@property (nonatomic, readwrite, assign) CLLocationCoordinate2D coordinate;
@property (nonatomic, readwrite, copy) NSString *address;
@property (nonatomic, readwrite, copy) NSString *city;
@property (nonatomic, strong) NSMutableArray *locationManagers;
@property (nonatomic, strong) CLLocationManager *requestAuthorizationManager;

@end

@implementation IPHLocationManager

+ (IPHLocationManager *)sharedManager {
    static IPHLocationManager *sharedLocationManager = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedLocationManager = [[self alloc] init];
        sharedLocationManager.requestAuthorizationType = IPHRequestAuthorizationTypeWhenInUse;
        sharedLocationManager.desiredAccuracy = kCLLocationAccuracyBest;
        sharedLocationManager.distanceFilter = 100.0f;
    });

    return sharedLocationManager;
}

- (CLLocationCoordinate2D)coordinate{
    if (_location) {
        return _location.coordinate;
    }
    return kCLLocationCoordinate2DInvalid;
}

- (NSMutableArray *)locationManagers{
    if (_locationManagers == nil) {
        _locationManagers =  [NSMutableArray arrayWithCapacity:5];
    }
    return _locationManagers;
}

#pragma mark - Public methods

- (void)requestAuthorizationOnly {
    if (self.authorizationStatus == IPHAuthorizationStatusNotDetermined) {
        if (_requestAuthorizationType == IPHRequestAuthorizationTypeWhenInUse) {
            [self.requestAuthorizationManager requestWhenInUseAuthorization];
        } else {
            [self.requestAuthorizationManager requestAlwaysAuthorization];
        }
    }
}

- (void)requestLocation{
    [self p_requestLocationNeedReverseGeocodeLocation:NO completionHandler:nil];
}

- (void)requestLocationWithCompletionHandler:(IPHRequestLocationCompletionHandler)completionHandler{
    [self p_requestLocationNeedReverseGeocodeLocation:NO completionHandler:^(NSError *error){
        if (completionHandler) {
            completionHandler(self.location, error);
        }
    }];}

- (void)requestCoordinateWithCompletionHandler:(IPHRequestCoordinateCompletionHandler)completionHandler{
    [self p_requestLocationNeedReverseGeocodeLocation:NO completionHandler:^(NSError *error){
        if (completionHandler) {
            completionHandler(self.coordinate, error);
        }
    }];
}

- (void)requestReversedGeocodeLocation {
    [self p_requestLocationNeedReverseGeocodeLocation:YES completionHandler:nil];
}

- (void)requestAddressWithCompletionHandler:(IPHRequestAddressCompletionHandler)completionHandler{
    [self p_requestLocationNeedReverseGeocodeLocation:YES completionHandler:^(NSError *error){
        if (completionHandler) {
            completionHandler(_address, error);
        }
    }];
}

- (void)requestCityWithCompletionHandler:(IPHRequestCityCompletionHandler)completionHandler{
    [self p_requestLocationNeedReverseGeocodeLocation:YES completionHandler:^(NSError *error){
        if (completionHandler) {
            completionHandler(_city, error);
        }
    }];
}

- (void)requestCoordinateAndAddressCompletionHandler:(IPHRequestCoordinateAndAddressCompletionHandler)completionHandler{
    [self p_requestLocationNeedReverseGeocodeLocation:YES completionHandler:^(NSError *error){
        if (completionHandler) {
            completionHandler(self.coordinate, _address, error);
        }
    }];

}

#pragma mark - Private methods

- (void)p_requestLocationNeedReverseGeocodeLocation:(BOOL)isNeed completionHandler:(IPHLocateCompletionHandler)completionHandler{
    if (![IPHCLLocationManager locationServicesEnabled]) {
        [self p_executeBlock:completionHandler withLocalizedDescription:@"Location services disabled"];
        return;
    }

    if (self.authorizationStatus == IPHAuthorizationStatusDenied) {
        [self p_executeBlock:completionHandler withLocalizedDescription:@"Location services refused"];
        return;
    }

    IPHCLLocationManager *locationManager = [[IPHCLLocationManager alloc] init];
    if (self.authorizationStatus == IPHAuthorizationStatusNotDetermined) {
        if (_requestAuthorizationType == IPHRequestAuthorizationTypeWhenInUse) {
            [locationManager requestWhenInUseAuthorization];
        } else {
            [locationManager requestAlwaysAuthorization];
        }
    }

    locationManager.delegate = self;
    locationManager.desiredAccuracy = self.desiredAccuracy;
    locationManager.distanceFilter = self.distanceFilter;

    locationManager.needReverseGeocodeLocation = isNeed;
    locationManager.completionHandler = completionHandler;

    [locationManager startUpdatingLocation];
    [self.locationManagers addObject:locationManager];
}

- (void)p_executeBlock:(IPHLocateCompletionHandler)completionHandler withLocalizedDescription:(NSString *)description{
    if (completionHandler) {
        NSDictionary *userInfo = @{NSLocalizedDescriptionKey:description};
        NSError *error = [NSError errorWithDomain:kIPHRequestLocationErrorDomain code:-1 userInfo:userInfo];
        completionHandler(error);
    }
}

#pragma mark - CLLocationManagerDelegate

- (void)locationManager:(CLLocationManager *)manager
     didUpdateLocations:(NSArray<CLLocation *> *)locations{
    IPHCLLocationManager *locationManager = (IPHCLLocationManager *)manager;

    // 如果已经获取了位置则return掉,防止多次调用
    if (locationManager.hasGetLocation) {
        return;
    }

    [self.locationManagers removeObject:manager];

    [locationManager stopUpdatingLocation];

    CLLocation *availableLocation = nil;

    //当横向精度为负数时说明获取的位置无效
    for (int index = (int)locations.count - 1; index >= 0; index--) {
        CLLocation *location = [locations objectAtIndex:index];
        if (location.horizontalAccuracy > 0) {
            availableLocation = location;
            break;
        }
    }
    if (!availableLocation) {
        [self p_executeBlock:locationManager.completionHandler withLocalizedDescription:@"Invalid location"];
        return;
    }

    self.location = availableLocation;
    locationManager.hasGetLocation = YES;

    if (!locationManager.needReverseGeocodeLocation) {
        [locationManager executeBlockWithError:nil];
        return;
    }

    CLGeocoder *geocoder = [[CLGeocoder alloc] init];
    [geocoder reverseGeocodeLocation:availableLocation completionHandler:^(NSArray *placemarks, NSError *error) {
        if ([placemarks count] > 0) {
            self.placemark = [placemarks objectAtIndex:0];

            NSString *address = _placemark.name;
            if (IPHIsAvailableString(address)) {
                NSString *administrativeArea = IPHUnNilString(_placemark.administrativeArea);
                if ([_placemark.locality isEqualToString:_placemark.administrativeArea]) {
                    administrativeArea = @"";
                }
                address = [NSString stringWithFormat:@"%@%@%@%@%@%@%@",
                           IPHUnNilString(_placemark.country),
                           administrativeArea,
                           IPHUnNilString(_placemark.subAdministrativeArea),
                           IPHUnNilString(_placemark.locality),
                           IPHUnNilString(_placemark.subLocality),
                           IPHUnNilString(_placemark.thoroughfare),
                           IPHUnNilString(_placemark.subThoroughfare)];
            }
            self.city = _placemark.locality;
            self.address = address;
            [locationManager executeBlockWithError:nil];
        }else{
            [locationManager executeBlockWithError:error];
        }
    }];
}

- (void)locationManager:(CLLocationManager *)manager
       didFailWithError:(NSError *)error{
    IPHCLLocationManager *locationManager = (IPHCLLocationManager *)manager;
    [self.locationManagers removeObject:manager];
    [locationManager stopUpdatingLocation];
    [locationManager executeBlockWithError:error];
}

#pragma mark - Get

- (IPHAuthorizationStatus)authorizationStatus {
    CLAuthorizationStatus authStatus = [IPHCLLocationManager authorizationStatus];
    if (authStatus == kCLAuthorizationStatusNotDetermined) {
        return IPHAuthorizationStatusNotDetermined;
    } else if (authStatus == kCLAuthorizationStatusRestricted || authStatus == kCLAuthorizationStatusDenied) {
        return IPHAuthorizationStatusDenied;
    } else {
        return IPHAuthorizationStatusAuthorized;
    }
}

- (BOOL)isAuthorizationAuthorized {
    return self.authorizationStatus == IPHAuthorizationStatusAuthorized;
}

- (CLLocationManager *)requestAuthorizationManager {
    if (_requestAuthorizationManager == nil) {
        _requestAuthorizationManager = [[CLLocationManager alloc] init];
    }
    return _requestAuthorizationManager;
}

@end


text:
package com.adobe.dp.fb2;

public class FB2FormatException extends Exception {

	public static final long serialVersionUID = 0;

	public FB2FormatException(String msg) {
		super(msg);
	}

}


text:
package org.aheroboy.service.domain.management;

import org.aheroboy.service.domain.Dutiable;
import org.aheroboy.service.domain.conf.Configuration;

/**
 * Created by sgyang on 30/07/16.
 */
public interface Gossip extends Dutiable {
    public void install(Configuration conf);
}