text:
require "active_support/core_ext/hash/keys"
require "active_support/core_ext/hash/reverse_merge"

# Definitions
# ============================================================================

# Abstract generalization of {ActiveSupport::HashWithIndifferentAccess}.
# Extends {Hash} and provides simple hooks for handling keys and values
# on write.
#
#
class NRSER::Stash < ::Hash

  # Construction
  # ==========================================================================

  def initialize(constructor = {})
    if constructor.respond_to?(:to_hash)
      super()
      update(constructor)

      hash = constructor.to_hash
      self.default = hash.default if hash.default
      self.default_proc = hash.default_proc if hash.default_proc
    else
      super(constructor)
    end
  end

  # Instance Methods
  # ==========================================================================

  # @!group Internal Interface
  # --------------------------------------------------------------------------

  # Save {Hash#[]=} as {#_raw_put} for directly writing keys and values.
  #
  # @!visibility protected
  #
  alias_method :_raw_put, :[]=
  protected :_raw_put

  # Save {Hash#update} as {#_raw_update} for directly writing many key/value
  # pairs.
  #
  # @!visibility protected
  #
  # @note
  #   This is a hold-over from {HashWithIndifferentAccess}; not currently in
  #   use. Note sure if it will be kept around.
  #
  alias_method :_raw_update, :update
  protected :_raw_update

  # Save {Hash#key?} direct querying of key presence.
  #
  # @!visibility protected
  #
  alias_method :_raw_key?, :key?
  protected :_raw_key?

  protected
  # ========================================================================

    # A wrapper for {#_raw_put} that converts keys and values first.
    #
    # @todo
    #   Note sure if I want to keep this yet...
    #
    def _convert_and_put key, value
      _raw_put convert_key(key), convert_value(value, for: :assignment)
    end

  public # end protected ***************************************************

  # @!endgroup Internal Interface # ******************************************

  # @!group The Stuff You Care About
  # --------------------------------------------------------------------------
  #
  # Most of the class is overriding {::Hash} methods to hook into these
  # methods correctly... they are what you most likely care about.
  #

  # Convert an external key to the internal representation.
  #
  # @param [*] key
  #   The externally provided key.
  #
  # @return [*]
  #   The key to use internally.
  #
  def convert_key key
    key
  end

  def convert_value value, options = {}
    value
  end

  def put key, value
    _convert_and_put key, value
  end

  def []= key, value
    put key, value
  end

  # @!endgroup The Stuff You Care About # ************************************

  alias_method :store, :[]=

  def set_defaults(target)
    if default_proc
      target.default_proc = default_proc.dup
    else
      target.default = default
    end
  end

  # Returns +true+ so that <tt>Array#extract_options!</tt> finds members of
  # this class.
  def extractable_options?
    true
  end

  def self.[] *args
    new.merge! ::Hash[*args]
  end

  # Updates the receiver in-place, merging in the hash passed as argument:
  #
  #   hash_1 = ActiveSupport::HashWithIndifferentAccess.new
  #   hash_1[:key] = 'value'
  #
  #   hash_2 = ActiveSupport::HashWithIndifferentAccess.new
  #   hash_2[:key] = 'New Value!'
  #
  #   hash_1.update(hash_2) # => {"key"=>"New Value!"}
  #
  # The argument can be either an
  # <tt>ActiveSupport::HashWithIndifferentAccess</tt> or a regular +Hash+.
  # In either case the merge respects the semantics of indifferent access.
  #
  # If the argument is a regular hash with keys +:key+ and +"key"+ only one
  # of the values end up in the receiver, but which one is unspecified.
  #
  # When given a block, the value for duplicated keys will be determined
  # by the result of invoking the block with the duplicated key, the value
  # in the receiver, and the value in +other_hash+. The rules for duplicated
  # keys follow the semantics of indifferent access:
  #
  #   hash_1[:key] = 10
  #   hash_2['key'] = 12
  #   hash_1.update(hash_2) { |key, old, new| old + new } # => {"key"=>22}
  #
  # @param [Proc<(KEY, CURRENT, UPDATE) => VALUE>] block
  #   Optional block to handle key conflicts.
  #
  # @return [self]
  #
  def update other_hash, &block
    other_hash.to_hash.each_pair do |key, value|
      key = convert_key key
      if block && _raw_key?( key )
        value = yield key, _raw_get( key ), value
      end
      put key, value
    end
    self
  end

  alias_method :merge!, :update

  # Checks the hash for a key matching the argument passed in:
  #
  #   hash = ActiveSupport::HashWithIndifferentAccess.new
  #   hash['key'] = 'value'
  #   hash.key?(:key)  # => true
  #   hash.key?('key') # => true
  def key? key
    _raw_key? convert_key( key )
  end

  alias_method :include?, :key?
  alias_method :has_key?, :key?
  alias_method :member?, :key?

  alias_method :_raw_get, :[]

  # Same as <tt>Hash#[]</tt> where the key passed as argument can be
  # either a string or a symbol:
  #
  #   counters = ActiveSupport::HashWithIndifferentAccess.new
  #   counters[:foo] = 1
  #
  #   counters['foo'] # => 1
  #   counters[:foo]  # => 1
  #   counters[:zoo]  # => nil
  def [] key
    _raw_get convert_key( key )
  end

  # Same as <tt>Hash#fetch</tt> where the key passed as argument can be
  # either a string or a symbol:
  #
  #   counters = ActiveSupport::HashWithIndifferentAccess.new
  #   counters[:foo] = 1
  #
  #   counters.fetch('foo')          # => 1
  #   counters.fetch(:bar, 0)        # => 0
  #   counters.fetch(:bar) { |key| 0 } # => 0
  #   counters.fetch(:zoo)           # => KeyError: key not found: "zoo"
  def fetch key, *extras
    super convert_key(key), *extras
  end

  # Same as <tt>Hash#dig</tt> where the key passed as argument can be
  # either a string or a symbol:
  #
  #   counters = ActiveSupport::HashWithIndifferentAccess.new
  #   counters[:foo] = { bar: 1 }
  #
  #   counters.dig('foo', 'bar')     # => 1
  #   counters.dig(:foo, :bar)       # => 1
  #   counters.dig(:zoo)             # => nil
  def dig *args
    args[0] = convert_key( args[0] ) if args.size > 0
    super *args
  end

  # Same as <tt>Hash#default</tt> where the key passed as argument can be
  # either a string or a symbol:
  #
  #   hash = ActiveSupport::HashWithIndifferentAccess.new(1)
  #   hash.default                   # => 1
  #
  #   hash = ActiveSupport::HashWithIndifferentAccess.new { |hash, key| key }
  #   hash.default                   # => nil
  #   hash.default('foo')            # => 'foo'
  #   hash.default(:foo)             # => 'foo'
  def default(*args)
    super(*args.map { |arg| convert_key(arg) })
  end

  # Returns an array of the values at the specified indices:
  #
  #   hash = ActiveSupport::HashWithIndifferentAccess.new
  #   hash[:a] = 'x'
  #   hash[:b] = 'y'
  #   hash.values_at('a', 'b') # => ["x", "y"]
  def values_at(*indices)
    indices.collect { |key| self[convert_key(key)] }
  end

  # Returns a shallow copy of the hash.
  #
  #   hash = ActiveSupport::HashWithIndifferentAccess.new({ a: { b: 'b' } })
  #   dup  = hash.dup
  #   dup[:a][:c] = 'c'
  #
  #   hash[:a][:c] # => "c"
  #   dup[:a][:c]  # => "c"
  def dup
    self.class.new(self).tap do |new_hash|
      set_defaults(new_hash)
    end
  end

  # This method has the same semantics of +update+, except it does not
  # modify the receiver but rather returns a new hash with indifferent
  # access with the result of the merge.
  def merge(hash, &block)
    dup.update(hash, &block)
  end

  # Like +merge+ but the other way around: Merges the receiver into the
  # argument and returns a new hash with indifferent access as result:
  #
  #   hash = ActiveSupport::HashWithIndifferentAccess.new
  #   hash['a'] = nil
  #   hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1}
  def reverse_merge(other_hash)
    super(self.class.new(other_hash))
  end

  # Same semantics as +reverse_merge+ but modifies the receiver in-place.
  def reverse_merge!(other_hash)
    replace(reverse_merge(other_hash))
  end

  # Replaces the contents of this hash with other_hash.
  #
  #   h = { "a" => 100, "b" => 200 }
  #   h.replace({ "c" => 300, "d" => 400 }) # => {"c"=>300, "d"=>400}
  def replace(other_hash)
    super(self.class.new(other_hash))
  end

  # Removes the specified key from the hash.
  def delete(key)
    super(convert_key(key))
  end

  # def stringify_keys!; self end
  # def deep_stringify_keys!; self end
  # def stringify_keys; dup end
  # def deep_stringify_keys; dup end
  # undef :symbolize_keys!
  # undef :deep_symbolize_keys!
  # def symbolize_keys; to_hash.symbolize_keys! end
  # def deep_symbolize_keys; to_hash.deep_symbolize_keys! end
  # def to_options!; self end

  def select(*args, &block)
    return to_enum(:select) unless block_given?
    dup.tap { |hash| hash.select!(*args, &block) }
  end

  def reject(*args, &block)
    return to_enum(:reject) unless block_given?
    dup.tap { |hash| hash.reject!(*args, &block) }
  end

  def transform_values(*args, &block)
    return to_enum(:transform_values) unless block_given?
    dup.tap { |hash| hash.transform_values!(*args, &block) }
  end

  def compact
    dup.tap(&:compact!)
  end

  # Convert to a regular hash with string keys.
  def to_hash
    _new_hash = ::Hash.new
    set_defaults(_new_hash)

    each do |key, value|
      _new_hash[key] = convert_value(value, for: :to_hash)
    end
    _new_hash
  end

end

redpajama_set_name: RedPajamaGithub


text:
require "toaster/model/automation"
require "toaster/model/task_execution"
require "toaster/model/run_attribute"
require "toaster/state/system_state"
require "toaster/util/timestamp"
require "toaster/util/util"

module Toaster
  class AutomationRun < ActiveRecord::Base

    @@current_run = nil

    belongs_to :user
    belongs_to :automation
    has_many :task_executions, :autosave => true, :dependent => :destroy
    has_many :run_attributes, :autosave => true, :dependent => :destroy

    # FIELDS:
    #  :uuid, :machine_id, :automation, :start_time,
    #  :end_time, :success, :error_details, :attributes

    def initialize(attr_hash)
      if !attr_hash[:uuid]
        attr_hash[:uuid] = Util.generate_short_uid()
      end
      if !attr_hash[:start_time]
        attr_hash[:start_time] = TimeStamp.now.to_i
      end
      if !attr_hash[:machine_id]
        attr_hash[:machine_id] = Util.get_machine_id()
      end
      super(attr_hash)
    end

    # used in the context of a currently active run
    def self.get_current
      return @@current_run
    end
    # used in the context of a currently active run
    def self.set_current(run)
      run.save
      @@current_run = run
    end

    def get_flat_attributes()
      KeyValuePair.get_as_hash(run_attributes)
    end

    def get_executed_tasks()
      result = []
      task_executions.each do |exec|
        result << exec.task
      end
      return result
    end

    def get_num_task_executions()
      return task_executions.size
    end

    def get_task_execution(task)
      task_executions().each do |e|
        if e.task.uuid == task.uuid
          return e
        end
      end
    end

    def task_execution_index(task_exec)
      task_executions().each_with_index do |e,idx|
        if e.uuid == task_exec.uuid
          return idx
        end
      end
      return nil
    end

    def duration
      return nil if !end_time || !start_time
      return end_time - start_time
    end

    def self.find(criteria={})
      DB.find_activerecord(AutomationRun, criteria)
    end

  end
end


text:
package com.nike.cerberus.server.config.guice;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import okhttp3.OkHttpClient;

import javax.inject.Named;
import javax.inject.Singleton;
import java.util.concurrent.TimeUnit;

/**
 * Guice module for some OneLogin related classes
 */
public class OneLoginGuiceModule extends AbstractModule {

    public static final String ONE_LOGIN_OBJECT_MAPPER_NAME = "OneLoginObjectMapper";

    private static final int DEFAULT_TIMEOUT = 15;

    private static final TimeUnit DEFAULT_TIMEOUT_UNIT = TimeUnit.SECONDS;

    @Override
    protected void configure() {
    }

    @Provides
    @Singleton
    @Named(ONE_LOGIN_OBJECT_MAPPER_NAME)
    public ObjectMapper getObjectMapper() {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.findAndRegisterModules();
        objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
        objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
        objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
        objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
        objectMapper.enable(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS);
        objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
        return objectMapper;
    }

    @Provides
    @Singleton
    public OkHttpClient getOkHttpClient() {
        return new OkHttpClient.Builder()
                .connectTimeout(DEFAULT_TIMEOUT, DEFAULT_TIMEOUT_UNIT)
                .writeTimeout(DEFAULT_TIMEOUT, DEFAULT_TIMEOUT_UNIT)
                .readTimeout(DEFAULT_TIMEOUT, DEFAULT_TIMEOUT_UNIT)
                .build();
    }

}


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>Rugaciuni Crestin Ortodoxe</title>
<link href="jquery-mobile/jquery.mobile.theme-1.0.min.css" rel="stylesheet" type="text/css"/>
<link href="jquery-mobile/jquery.mobile.structure-1.0.min.css" rel="stylesheet" type="text/css"/>
<link href="style.css" rel="stylesheet" type="text/css">

Rugaciuni Crestin Ortodoxe

Colectie de rugaciuni Crestin Ortodoxe ce se pot citi la diverse trebuinte

Rugaciuni ortodoxe - Casatorie

Rugaciunea sotiei pentru sotul ei

Rugaciunea sotilor unul pentru altul

Rugaciune pentru casatorie

Rugaciunile nasilor

Rugaciunea sotului pentru sotia sa

Rugaciuni la felurite trebuinte

                    	Rugaciune la vreme de ispita

                    	Rugaciune pentru impacare

                    	Rugaciune pentru binefacerile primite de la Dumnezeu

                    	Rugaciune pentru frati si surori

                    	Rugaciune la inceperea lucrului

                    	Rugaciune care se citeste in fiecare post

                    	Rugaciune dupa sfarsitul lucrului

                    	Rugaciune la ziua numelui

                    	Rugaciune la vreme de calatorie

                    	Rugaciune la necazuri si suparari

Rugaciuni si Paraclise

                    	Paraclisul Sfantului Grigorie Palama

                    	Paraclisul Maicii Domnului

                    	Paraclisul Icoanei Preasfintei Nascatoare de Dumnezeu

                    	Al doilea Paraclis catre Prea-Sfanta Nascatoare de Dumnezeu

Plansurile Sfantului Efrem Sirul

                    	Rugaciunea Sfantului Efrem Sirul care se rosteste in Postul Mare

                    	Plansul de miercuri seara - Sfantul Efrem Sirul

                    	Plansul de duminica seara - Sfantul Efrem Sirul

                    	Plansul de vineri seara - Sfantul Efrem Sirul

                    	Plansul de sambata seara - Sfantul Efrem Sirul

                    	Plansul de marti seara - Sfantul Efrem Sirul

                    	Plansul de joi seara - Sfantul Efrem Sirul

                    	Plansul de luni seara - Sfantul Efrem Sirul

Rugaciuni ortodoxe masa

                    	Rugaciunea la masa de dimineata

                    	Rugaciunea la masa de pranz

                    	Rugaciunea la masa de seara

Rugaciuni - Farmece si deochi

                    	Rugaciune pentru deochi

                    	Rugaciune pentru casa suparata de duhuri rele

                    	Rugaciune impotriva farmecelor si bantuirii duhurilor rele

Rugaciuni la biserica

                    	Rugaciune cand intrii in biserica

                    	Rugaciune la icoana Maicii Domnului

                    	Rugaciune la icoana Mantuitorului

                    	Rugaciune la iesirea din Biserica

Rugaciuni la boala si suferinta

                    	Rugaciune la timp de boala

                    	Rugaciune pentru bolnavul care nu poate dormi

Rugaciuni ortodoxe

                    	Psalmul 50 (al lui David)

                    	Cele 10 porunci Dumnezeiesti

                    	Tatal nostru

                    	Rugaciuni spovedanie

                    	Crezul sau Simbolul credintei

                    	Rugaciunile de dimineata

Rugaciuni pentru Impartasire

                    	Rugaciunile Inaintea Sfintei Impartasanii

                    	Rugaciune dupa Impartasire

Rugaciunile copiilor

                    	Rugaciune pentru frati si surori

                    	Rugaciune catre Ingerul Pazitor

                    	Rugaciunea copilului de dimineata

                    	Rugaciunea copilulului inainte de culcare


text:
package edu.cmu.sphinx.linguist.acoustic.tiedstate.HTK;

public class SingleHMM {
	private final HMMState[] states;
	private String name;
	public float[][] trans;
	// index of the transition macro
	private int transidx = -1; // in case the transitions is a macro
	// index of the transition in the transition pool
	public int trIdx = -1;
	private int nbEmittingStates;
	public HMMSet hmmset;

	public SingleHMM(int nbStates) {
		name = "";
		states = new HMMState[nbStates];
		nbEmittingStates = 0;
	}

	public void setName(String s) {
		name = s;
	}

	public String getName() {
		return name;
	}

	public String getBaseName() {
		int m = name.indexOf('-');
		if (m < 0)
			m = -1;
		String b = name.substring(m + 1);
		m = b.indexOf('+');
		if (m < 0)
			m = b.length();
		return b.substring(0, m);
	}

	public String getLeft() {
		int m = name.indexOf('-');
		if (m < 0)
			return "-";
		return name.substring(0, m);
	}

	public String getRight() {
		int m = name.indexOf('+');
		if (m < 0)
			return "-";
		return name.substring(m + 1);
	}

	public void setState(int idx, HMMState st) {
		if (states[idx] == null && st != null)
			nbEmittingStates++;
		states[idx] = st;
	}

	public boolean isEmitting(int idx) {
		return (states[idx] != null);
	}

	public void setTrans(float[][] tr) {
		trans = tr;
	}

	public void setTrans(int i) {
		trans = null;
		transidx = i;
	}

	public int getTransIdx() {
		return transidx;
	}

	public float getTrans(int i, int j) {
		if (trans == null) {
			trans = hmmset.transitions.get(transidx);
		}
		return trans[i][j];
	}

	/**
	 * may return null if the state is non-emitting
	 *

	 * @return the HMM state
	 */
	public HMMState getState(int idx) {
		return states[idx];
	}

	public int getNstates() {
		return states.length;
	}

	public int getNbEmittingStates() {
		return nbEmittingStates;

	}
}


text:
from django.test import TestCase
from django.conf import settings
from restclients.nws import NWS
from restclients.exceptions import DataFailureException
from vm.v1.viewmodels import Endpoint

class NWSTestEndpoint(TestCase):

    def _assert_endpoint_matches(self, endpoint):
        self.assertEquals('780f2a49-2118-4969-9bef-bbd38c26970a', endpoint.endpoint_id)
        self.assertEquals('/notification/v1/endpoint/780f2a49-2118-4969-9bef-bbd38c26970a', endpoint.endpoint_uri)
        self.assertEquals('222-222-3333', endpoint.endpoint_address)
        self.assertEquals('AT&T', endpoint.carrier)
        self.assertEquals('sms', endpoint.protocol)
        self.assertEquals('javerage', endpoint.get_user_net_id())
        self.assertEquals('sdf', endpoint.get_owner_net_id())
        self.assertEquals(False, endpoint.active)

    def test_create_endpoint(self):
        with self.settings(
                RESTCLIENTS_NWS_DAO_CLASS='restclients.dao_implementation.nws.File'):
            nws = NWS()
            endpoint = nws.get_endpoint_by_endpoint_id("780f2a49-2118-4969-9bef-bbd38c26970a")
            endpoint.endpoint_id = None
            endpoint.endpoint_uri = None

            response_status = nws.create_new_endpoint(endpoint)
            self.assertEquals(201, response_status)

    def test_endpoint_endpoint_id(self):
        with self.settings(
                RESTCLIENTS_NWS_DAO_CLASS='restclients.dao_implementation.nws.File'):
            nws = NWS()
            endpoint = nws.get_endpoint_by_endpoint_id("780f2a49-2118-4969-9bef-bbd38c26970a")
            self._assert_endpoint_matches(endpoint)

    def test_endpoint_search_by_subscriber_id(self):
        with self.settings(
                RESTCLIENTS_NWS_DAO_CLASS='restclients.dao_implementation.nws.File'):
            nws = NWS()
            endpoints = nws.get_endpoints_by_subscriber_id("javerage")
            self.assertEquals(len(endpoints), 2)

            endpoint = endpoints[0]
            self._assert_endpoint_matches(endpoint)

    def test_endpoint_search_by_endpoint_address(self):
        with self.settings(
                RESTCLIENTS_NWS_DAO_CLASS='restclients.dao_implementation.nws.File'):
            nws = NWS()
            endpoint = nws.get_endpoint_by_address("222-222-3333")
            self._assert_endpoint_matches(endpoint)

    def test_endpoint_by_subscriber_id_protocol(self):
        with self.settings(
                RESTCLIENTS_NWS_DAO_CLASS='restclients.dao_implementation.nws.File'):
            nws = NWS()
            endpoint = nws.get_endpoint_by_subscriber_id_and_protocol("javerage", "sms")
            self._assert_endpoint_matches(endpoint)


text:
namespace feed {

BASE_DECLARE_FEATURE(kInterestFeedContentSuggestions);
BASE_DECLARE_FEATURE(kInterestFeedV2);
BASE_DECLARE_FEATURE(kInterestFeedV2Autoplay);
BASE_DECLARE_FEATURE(kInterestFeedV2Hearts);
BASE_DECLARE_FEATURE(kInterestFeedV2Scrolling);

extern const base::FeatureParam<std::string> kDisableTriggerTypes;
extern const base::FeatureParam<int> kSuppressRefreshDurationMinutes;
extern const base::FeatureParam<int> kTimeoutDurationSeconds;
extern const base::FeatureParam<bool> kThrottleBackgroundFetches;
extern const base::FeatureParam<bool> kOnlySetLastRefreshAttemptOnSuccess;

// TODO(b/213622639): The following two features are obsolete and should be
// removed.
// Determines whether conditions should be reached before enabling the upload of
// click and view actions in the feed (e.g., the user needs to view X cards).
// For example, this is needed when the notice card is at the second position in
// the feed.
BASE_DECLARE_FEATURE(kInterestFeedV1ClicksAndViewsConditionalUpload);
BASE_DECLARE_FEATURE(kInterestFeedV2ClicksAndViewsConditionalUpload);

// Feature that allows the client to automatically dismiss the notice card based
// on the clicks and views on the notice card.
#if BUILDFLAG(IS_IOS)
BASE_DECLARE_FEATURE(kInterestFeedNoticeCardAutoDismiss);
#endif

// Feature that allows users to keep up with and consume web content.
BASE_DECLARE_FEATURE(kWebFeed);

// Use the new DiscoFeed endpoint.
BASE_DECLARE_FEATURE(kDiscoFeedEndpoint);

// Feature that enables xsurface to provide the metrics reporting state to an
// xsurface feed.
BASE_DECLARE_FEATURE(kXsurfaceMetricsReporting);

// Whether to log reliability events.
BASE_DECLARE_FEATURE(kReliabilityLogging);

// Feature that enables sticky header when users scroll down.
BASE_DECLARE_FEATURE(kFeedHeaderStickToTop);

// Feature that enables refreshing feeds triggered by the users.
BASE_DECLARE_FEATURE(kFeedInteractiveRefresh);

// Feature that shows placeholder cards instead of a loading spinner at first
// load.
BASE_DECLARE_FEATURE(kFeedLoadingPlaceholder);

// Param allowing animations to be disabled when showing the placeholder on
// instant start.
extern const base::FeatureParam<bool>
    kEnableFeedLoadingPlaceholderAnimationOnInstantStart;

// Feature that allows tuning the size of the image memory cache. Value is a
// percentage of the maximum size calculated for the device.
BASE_DECLARE_FEATURE(kFeedImageMemoryCacheSizePercentage);

// Feature that enables clearing the image memory cache when the feed is
// destroyed.
BASE_DECLARE_FEATURE(kFeedClearImageMemoryCache);

// Feature that enables showing a callout to help users return to the top of the
// feeds quickly.
BASE_DECLARE_FEATURE(kFeedBackToTop);

// Feature that enables StAMP cards in the feed.
BASE_DECLARE_FEATURE(kFeedStamp);

// Feature that provides the user assistance in discovering the web feed.
BASE_DECLARE_FEATURE(kWebFeedAwareness);

// Feature that provides the user assistance in using the web feed.
BASE_DECLARE_FEATURE(kWebFeedOnboarding);

// Feature that enables sorting by different heuristics in the web feed.
BASE_DECLARE_FEATURE(kWebFeedSort);

// Feature that causes the "open in new tab" menu item to appear on feed items
// on Start Surface.
BASE_DECLARE_FEATURE(kEnableOpenInNewTabFromStartSurfaceFeed);

// Feature that causes the WebUI version of the Feed to be enabled.
BASE_DECLARE_FEATURE(kWebUiFeed);
extern const base::FeatureParam<std::string> kWebUiFeedUrl;
extern const base::FeatureParam<bool> kWebUiDisableContentSecurityPolicy;

std::string GetFeedReferrerUrl();

// Personalize feed for unsigned users.
BASE_DECLARE_FEATURE(kPersonalizeFeedUnsignedUsers);

// Personalize feed for signed in users who haven't enabled sync.
BASE_DECLARE_FEATURE(kPersonalizeFeedNonSyncUsers);

// Returns the consent level needed to request a personalized feed.
signin::ConsentLevel GetConsentLevelNeededForPersonalizedFeed();

// Feature that enables tracking the acknowledgement state for the info cards.
BASE_DECLARE_FEATURE(kInfoCardAcknowledgementTracking);

// Feature that enables the Crow feature.
// Owned by the CwF team but located here until it makes sense to create a crow
// component, since it is being used in the feed component.
BASE_DECLARE_FEATURE(kShareCrowButton);

// When enabled, schedule a background refresh for a feed sometime after the
// last user engagement with that feed.
BASE_DECLARE_FEATURE(kFeedCloseRefresh);
// On each qualifying user engagement, schedule a background refresh this many
// minutes out.
extern const base::FeatureParam<int> kFeedCloseRefreshDelayMinutes;
// If true, schedule the refresh only when the user scrolls or interacts. If
// false, schedule only when the feed surface is opened to content.
extern const base::FeatureParam<bool> kFeedCloseRefreshRequireInteraction;

// When enabled, no view cache is used.
BASE_DECLARE_FEATURE(kFeedNoViewCache);
// When enabled, replace all items.
BASE_DECLARE_FEATURE(kFeedReplaceAll);

// When enabled, play the feed video via inline playback.
BASE_DECLARE_FEATURE(kFeedVideoInlinePlayback);

// When enabled, compute Good Visits locally and log them to a histogram.
BASE_DECLARE_FEATURE(kClientGoodVisits);
// The maximum time between sequential interactions with the feed that are
// considered as a single visit.
extern const base::FeatureParam<base::TimeDelta> kVisitTimeout;
// A feed visit is "good" if the user spends at least this much time in the feed
// and scrolls at least once.
extern const base::FeatureParam<base::TimeDelta> kGoodTimeInFeed;
// A feed visit is "good" if the user spends at least this much time in an
// article.
extern const base::FeatureParam<base::TimeDelta> kLongOpenTime;
// When calculating time spent in feed for good visits, drop periods of
// viewport-stable feed viewing shorter than this.
extern const base::FeatureParam<base::TimeDelta>
    kMinStableContentSliceVisibilityTime;
// When calculating time spent in feed for good visits, cap long periods of
// viewport-stable feed viewing to this time.
extern const base::FeatureParam<base::TimeDelta>
    kMaxStableContentSliceVisibilityTime;
// Minimum slice exposure needed for counting time in feed for good visits.
extern const base::FeatureParam<double> kSliceVisibleExposureThreshold;
// Minimum slice coverage of viewport needed for counting time in feed for good
// visits.
extern const base::FeatureParam<double> kSliceVisibleCoverageThreshold;

// When enabled, allow tagging experiments with only an experiment ID.
BASE_DECLARE_FEATURE(kFeedExperimentIDTagging);

// When enabled, allow show sign in command to request a user signs in / syncs.
BASE_DECLARE_FEATURE(kFeedShowSignInCommand);

// When enabled, depending on params selected, enable different
// performance-oriented features in Feed.
BASE_DECLARE_FEATURE(kFeedPerformanceStudy);

// When enabled, allows the server to unilaterally alter capabilities sent
// by the client, primarily to retroactively work around bugs.
BASE_DECLARE_FEATURE(kSyntheticCapabilities);

}  // namespace feed

#endif  // COMPONENTS_FEED_FEED_FEATURE_LIST_H_


text:
var example = require("example");

a = new example.intSum(0);
b = new example.doubleSum(100.0);

// Use the objects.  They should be callable just like a normal
// javascript function.

for (i=1;i<=100;i++)
    a.call(i);                // Note: function call
    b.call(Math.sqrt(i));     // Note: function call

console.log(a.result());
console.log(b.result());


text:
/* $Id$ */

package org.apache.fop.fo.properties;

import java.util.Locale;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

public class CommonHyphenationTestCase {

    private final String lang = "en";

    @Test
    public void testToLocaleNull() {
        Locale locale = CommonHyphenation.toLocale(null, null);
        assertNull(locale);
        locale = CommonHyphenation.toLocale("none", null);
        assertNull(locale);
        locale = CommonHyphenation.toLocale("NoNe", "US");
        assertNull(locale);
    }

    @Test
    public void testToLocaleWithJustLanguage() {
        Locale locale = new Locale(lang);
        assertEquals(locale, CommonHyphenation.toLocale(lang, null));
        assertEquals(locale, CommonHyphenation.toLocale(lang, "none"));
        assertEquals(locale, CommonHyphenation.toLocale(lang, "NONE"));
    }

    @Test
    public void testToLocaleWithLanguageAndCountry() {
        Locale locale = new Locale(lang, "US");
        assertEquals(locale, CommonHyphenation.toLocale(lang, "US"));
        assertEquals(locale, CommonHyphenation.toLocale(lang, "us"));
    }

}


text:
package org.apache.cassandra.utils.concurrent;

import java.lang.ref.ReferenceQueue;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.cassandra.concurrent.NamedThreadFactory;

// default implementation; can be hidden and proxied (like we do for SSTableReader)
final class RefCountedImpl implements RefCounted
{
    private final Ref sharedRef;
    private final GlobalState state;

    public RefCountedImpl(Tidy tidy)
    {
        this.state = new GlobalState(tidy);
        sharedRef = new Ref(this.state, true);
        globallyExtant.add(this.state);
    }

    /**
     * see {@link RefCounted#tryRef()}
     */
    public Ref tryRef()
    {
        return state.ref() ? new Ref(state, false) : null;
    }

    /**
     * see {@link RefCounted#sharedRef()}
     */
    public Ref sharedRef()
    {
        return sharedRef;
    }

    // the object that manages the actual cleaning up; this does not reference the RefCounted.Impl
    // so that we can detect when references are lost to the resource itself, and still cleanup afterwards
    // the Tidy object MUST not contain any references to the object we are managing
    static final class GlobalState
    {
        // we need to retain a reference to each of the PhantomReference instances
        // we are using to track individual refs
        private final ConcurrentLinkedQueue<Ref.State> locallyExtant = new ConcurrentLinkedQueue<>();
        // the number of live refs
        private final AtomicInteger counts = new AtomicInteger();
        // the object to call to cleanup when our refs are all finished with
        private final Tidy tidy;

        GlobalState(Tidy tidy)
        {
            this.tidy = tidy;
        }

        void register(Ref.State ref)
        {
            locallyExtant.add(ref);
        }

        // increment ref count if not already tidied, and return success/failure
        boolean ref()
        {
            while (true)
            {
                int cur = counts.get();
                if (cur < 0)
                    return false;
                if (counts.compareAndSet(cur, cur + 1))
                    return true;
            }
        }

        // release a single reference, and cleanup if no more are extant
        void release(Ref.State ref)
        {
            locallyExtant.remove(ref);
            if (-1 == counts.decrementAndGet())
            {
                globallyExtant.remove(this);
                tidy.tidy();
            }
        }

        int count()
        {
            return 1 + counts.get();
        }

        public String toString()
        {
            return tidy.name();
        }
    }

    private static final Set<GlobalState> globallyExtant = Collections.newSetFromMap(new ConcurrentHashMap<GlobalState, Boolean>());
    static final ReferenceQueue<Object> referenceQueue = new ReferenceQueue<>();
    private static final ExecutorService EXEC = Executors.newFixedThreadPool(1, new NamedThreadFactory("Reference-Reaper"));
    static
    {
        EXEC.execute(new Runnable()
        {
            public void run()
            {
                try
                {
                    while (true)
                    {
                        Object obj = referenceQueue.remove();
                        if (obj instanceof Ref.State)
                        {
                            ((Ref.State) obj).release(true);
                        }
                    }
                }
                catch (InterruptedException e)
                {
                }
                finally
                {
                    EXEC.execute(this);
                }
            }
        });
    }
}


text:
package com.ctrip.platform.dal.dao.datasource.cluster;

import com.ctrip.platform.dal.dao.helper.Delegate;

import java.sql.*;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Executor;

/**
 * @author c7ch23en
 */
public abstract class ConnectionDelegate implements Connection, Delegate<Connection> {

    public Statement createStatement() throws SQLException {
        return getDelegated().createStatement();
    }

    public PreparedStatement prepareStatement(String sql) throws SQLException {
        return getDelegated().prepareStatement(sql);
    }

    public CallableStatement prepareCall(String sql) throws SQLException {
        return getDelegated().prepareCall(sql);
    }

    public String nativeSQL(String sql) throws SQLException {
        return getDelegated().nativeSQL(sql);
    }

    public void setAutoCommit(boolean autoCommit) throws SQLException {
        getDelegated().setAutoCommit(autoCommit);
    }

    public boolean getAutoCommit() throws SQLException {
        return getDelegated().getAutoCommit();
    }

    public void commit() throws SQLException {
        getDelegated().commit();
    }

    public void rollback() throws SQLException {
        getDelegated().rollback();
    }

    public void close() throws SQLException {
        getDelegated().close();
    }

    public boolean isClosed() throws SQLException {
        return getDelegated().isClosed();
    }

    public DatabaseMetaData getMetaData() throws SQLException {
        return getDelegated().getMetaData();
    }

    public void setReadOnly(boolean readOnly) throws SQLException {
        getDelegated().setReadOnly(readOnly);
    }

    public boolean isReadOnly() throws SQLException {
        return getDelegated().isReadOnly();
    }

    public void setCatalog(String catalog) throws SQLException {
        getDelegated().setCatalog(catalog);
    }

    public String getCatalog() throws SQLException {
        return getDelegated().getCatalog();
    }

    public void setTransactionIsolation(int level) throws SQLException {
        getDelegated().setTransactionIsolation(level);
    }

    public int getTransactionIsolation() throws SQLException {
        return getDelegated().getTransactionIsolation();
    }

    public SQLWarning getWarnings() throws SQLException {
        return getDelegated().getWarnings();
    }

    public void clearWarnings() throws SQLException {
        getDelegated().clearWarnings();
    }

    public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
        return getDelegated().createStatement(resultSetType, resultSetConcurrency);
    }

    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
        return getDelegated().prepareStatement(sql, resultSetType, resultSetConcurrency);
    }

    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
        return getDelegated().prepareCall(sql, resultSetType, resultSetConcurrency);
    }

    public Map<String, Class<?>> getTypeMap() throws SQLException {
        return getDelegated().getTypeMap();
    }

    public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
        getDelegated().setTypeMap(map);
    }

    public void setHoldability(int holdability) throws SQLException {
        getDelegated().setHoldability(holdability);
    }

    public int getHoldability() throws SQLException {
        return getDelegated().getHoldability();
    }

    public Savepoint setSavepoint() throws SQLException {
        return getDelegated().setSavepoint();
    }

    public Savepoint setSavepoint(String name) throws SQLException {
        return getDelegated().setSavepoint(name);
    }

    public void rollback(Savepoint savepoint) throws SQLException {
        getDelegated().rollback(savepoint);
    }

    public void releaseSavepoint(Savepoint savepoint) throws SQLException {
        getDelegated().releaseSavepoint(savepoint);
    }

    public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
        return getDelegated().createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
    }

    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
        return getDelegated().prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
    }

    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
        return getDelegated().prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
    }

    public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
        return getDelegated().prepareStatement(sql, autoGeneratedKeys);
    }

    public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
        return getDelegated().prepareStatement(sql, columnIndexes);
    }

    public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
        return getDelegated().prepareStatement(sql, columnNames);
    }

    public Clob createClob() throws SQLException {
        return getDelegated().createClob();
    }

    public Blob createBlob() throws SQLException {
        return getDelegated().createBlob();
    }

    public NClob createNClob() throws SQLException {
        return getDelegated().createNClob();
    }

    public SQLXML createSQLXML() throws SQLException {
        return getDelegated().createSQLXML();
    }

    public boolean isValid(int timeout) throws SQLException {
        return getDelegated().isValid(timeout);
    }

    public void setClientInfo(String name, String value) throws SQLClientInfoException {
        getDelegated().setClientInfo(name, value);
    }

    public void setClientInfo(Properties properties) throws SQLClientInfoException {
        getDelegated().setClientInfo(properties);
    }

    public String getClientInfo(String name) throws SQLException {
        return getDelegated().getClientInfo(name);
    }

    public Properties getClientInfo() throws SQLException {
        return getDelegated().getClientInfo();
    }

    public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
        return getDelegated().createArrayOf(typeName, elements);
    }

    public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
        return getDelegated().createStruct(typeName, attributes);
    }

    public void setSchema(String schema) throws SQLException {
        getDelegated().setSchema(schema);
    }

    public String getSchema() throws SQLException {
        return getDelegated().getSchema();
    }

    public void abort(Executor executor) throws SQLException {
        getDelegated().abort(executor);
    }

    public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
        getDelegated().setNetworkTimeout(executor, milliseconds);
    }

    public int getNetworkTimeout() throws SQLException {
        return getDelegated().getNetworkTimeout();
    }

    public <T> T unwrap(Class<T> iface) throws SQLException {
        return getDelegated().unwrap(iface);
    }

    public boolean isWrapperFor(Class<?> iface) throws SQLException {
        return getDelegated().isWrapperFor(iface);
    }

}


text:
#ifndef EventDispatcher_h
#define EventDispatcher_h

#include <wtf/Forward.h>
#include <wtf/Vector.h>

namespace WebCore {

class Event;
class EventContext;
class EventDispatchMediator;
class EventTarget;
class FrameView;
class Node;
class PlatformKeyboardEvent;
class PlatformMouseEvent;
class PlatformWheelEvent;

enum EventDispatchBehavior {
    RetargetEvent,
    StayInsideShadowDOM
};

class EventDispatcher {
public:
    static bool dispatchEvent(Node*, const EventDispatchMediator&);
    static void dispatchScopedEvent(Node*, PassRefPtr<Event>);

    static void dispatchSimulatedClick(Node*, PassRefPtr<Event> underlyingEvent, bool sendMouseEvents, bool showPressedLook);

    bool dispatchEvent(PassRefPtr<Event>);
    PassRefPtr<EventTarget> adjustRelatedTarget(Event*, PassRefPtr<EventTarget>);
    Node* node() const;

private:
    EventDispatcher(Node*);

    PassRefPtr<EventTarget> adjustToShadowBoundaries(PassRefPtr<Node> relatedTarget, const Vector<Node*> relatedTargetAncestors);
    EventDispatchBehavior determineDispatchBehavior(Event*);
    void ensureEventAncestors(Event*);
    const EventContext* topEventContext();

    Vector<EventContext> m_ancestors;
    RefPtr<Node> m_node;
    RefPtr<EventTarget> m_originalTarget;
    RefPtr<FrameView> m_view;
    bool m_ancestorsInitialized;
};

inline Node* EventDispatcher::node() const
{
    return m_node.get();
}

}

#endif


text:
typedef struct
{
    int pos;
    int size;
    char literal;
} Tuple;

ByteArray lz77_encode(const string &str);
string lz77_decode(const ByteArray &data);

#endif


text:
//========================================================================
// GLFW 3.3 macOS - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2002-2006 Marcus Geelnard
// Copyright (c) 2006-2019 Camilla Löwy <elmindreda@glfw.org>
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//    claim that you wrote the original software. If you use this software
//    in a product, an acknowledgment in the product documentation would
//    be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
//    be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
//    distribution.
//
//========================================================================

//-----------------------------------------------
//
//	[Siv3D]
//
//	Copyright (c) 2008-2019 Ryo Suzuki
//	Copyright (c) 2016-2019 OpenSiv3D Project
//
//	Licensed under the MIT License.
//
//-----------------------------------------------

#include "internal.h"

#include <stdlib.h>
#include <limits.h>
#include <math.h>

#include <IOKit/graphics/IOGraphicsLib.h>
#include <ApplicationServices/ApplicationServices.h>

// Get the name of the specified display, or NULL
//
static char* getDisplayName(CGDirectDisplayID displayID)
{
    io_iterator_t it;
    io_service_t service;
    CFDictionaryRef info;

    if (IOServiceGetMatchingServices(kIOMasterPortDefault,
                                     IOServiceMatching("IODisplayConnect"),
                                     &it) != 0)
    {
        // This may happen if a desktop Mac is running headless
        return NULL;
    }

    while ((service = IOIteratorNext(it)) != 0)
    {
        info = IODisplayCreateInfoDictionary(service,
                                             kIODisplayOnlyPreferredName);

        CFNumberRef vendorIDRef =
            CFDictionaryGetValue(info, CFSTR(kDisplayVendorID));
        CFNumberRef productIDRef =
            CFDictionaryGetValue(info, CFSTR(kDisplayProductID));
        if (!vendorIDRef || !productIDRef)
        {
            CFRelease(info);
            continue;
        }

        unsigned int vendorID, productID;
        CFNumberGetValue(vendorIDRef, kCFNumberIntType, &vendorID);
        CFNumberGetValue(productIDRef, kCFNumberIntType, &productID);

        if (CGDisplayVendorNumber(displayID) == vendorID &&
            CGDisplayModelNumber(displayID) == productID)
        {
            // Info dictionary is used and freed below
            break;
        }

        CFRelease(info);
    }

    IOObjectRelease(it);

    if (!service)
    {
        _glfwInputError(GLFW_PLATFORM_ERROR,
                        "Cocoa: Failed to find service port for display");
        return NULL;
    }

    CFDictionaryRef names =
        CFDictionaryGetValue(info, CFSTR(kDisplayProductName));

    CFStringRef nameRef;

    if (!names || !CFDictionaryGetValueIfPresent(names, CFSTR("en_US"),
                                                 (const void**) &nameRef))
    {
        // This may happen if a desktop Mac is running headless
        CFRelease(info);
        return NULL;
    }

    const CFIndex size =
        CFStringGetMaximumSizeForEncoding(CFStringGetLength(nameRef),
                                          kCFStringEncodingUTF8);
    char* name = calloc(size + 1, 1);
    CFStringGetCString(nameRef, name, size, kCFStringEncodingUTF8);

    CFRelease(info);
    return name;
}

// Check whether the display mode should be included in enumeration
//
static GLFWbool modeIsGood(CGDisplayModeRef mode)
{
    uint32_t flags = CGDisplayModeGetIOFlags(mode);

    if (!(flags & kDisplayModeValidFlag) || !(flags & kDisplayModeSafeFlag))
        return GLFW_FALSE;
    if (flags & kDisplayModeInterlacedFlag)
        return GLFW_FALSE;
    if (flags & kDisplayModeStretchedFlag)
        return GLFW_FALSE;

#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
    if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
        CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
    {
        CFRelease(format);
        return GLFW_FALSE;
    }

    CFRelease(format);
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
    return GLFW_TRUE;
}

// Convert Core Graphics display mode to GLFW video mode
//
static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode,
                                            CVDisplayLinkRef link)
{
    GLFWvidmode result;
    result.width = (int) CGDisplayModeGetWidth(mode);
    result.height = (int) CGDisplayModeGetHeight(mode);
    result.refreshRate = (int) round(CGDisplayModeGetRefreshRate(mode));

    if (result.refreshRate == 0)
    {
        const CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(link);
        if (!(time.flags & kCVTimeIsIndefinite))
            result.refreshRate = (int) (time.timeScale / (double) time.timeValue);
    }

#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
    if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)
    {
        result.redBits = 5;
        result.greenBits = 5;
        result.blueBits = 5;
    }
    else
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
    {
        result.redBits = 8;
        result.greenBits = 8;
        result.blueBits = 8;
    }

#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
    CFRelease(format);
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
    return result;
}

// Starts reservation for display fading
//
static CGDisplayFadeReservationToken beginFadeReservation(void)
{
    CGDisplayFadeReservationToken token = kCGDisplayFadeReservationInvalidToken;

    if (CGAcquireDisplayFadeReservation(5, &token) == kCGErrorSuccess)
    {
        CGDisplayFade(token, 0.3,
                      kCGDisplayBlendNormal,
                      kCGDisplayBlendSolidColor,
                      0.0, 0.0, 0.0,
                      TRUE);
    }

    return token;
}

// Ends reservation for display fading
//
static void endFadeReservation(CGDisplayFadeReservationToken token)
{
    if (token != kCGDisplayFadeReservationInvalidToken)
    {
        CGDisplayFade(token, 0.5,
                      kCGDisplayBlendSolidColor,
                      kCGDisplayBlendNormal,
                      0.0, 0.0, 0.0,
                      FALSE);
        CGReleaseDisplayFadeReservation(token);
    }
}

// Finds and caches the NSScreen corresponding to the specified monitor
//
GLFWbool refreshMonitorScreen(_GLFWmonitor* monitor)
{
    if (monitor->ns.screen)
        return GLFW_TRUE;

    for (NSScreen* screen in [NSScreen screens])
    {
        NSNumber* displayID = [screen deviceDescription][@"NSScreenNumber"];

        // HACK: Compare unit numbers instead of display IDs to work around
        //       display replacement on machines with automatic graphics
        //       switching
        if (monitor->ns.unitNumber == CGDisplayUnitNumber([displayID unsignedIntValue]))
        {
            monitor->ns.screen = screen;
            return GLFW_TRUE;
        }
    }

    _glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to find a screen for monitor");
    return GLFW_FALSE;
}

//-----------------------------------------------
//
//	[Siv3D]
//
GLFWAPI void glfwGetMonitorRect_Siv3D(GLFWmonitor* handle, int* xpos, int* ypos, int* w, int* h)
{
	_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
	assert(monitor != NULL);

	_GLFW_REQUIRE_INIT();

	const CGRect bounds = CGDisplayBounds(monitor->ns.displayID);

	if (xpos)
		*xpos = (int) bounds.origin.x;
	if (ypos)
		*ypos = (int) bounds.origin.y;
	if (w)
		*w = (int) bounds.size.width;
	if (h)
		*h = (int) bounds.size.height;
}

GLFWAPI void glfwGetMonitorInfo_Siv3D(GLFWmonitor* handle, uint32_t* displayID, uint32_t* unitNumber,
									  int* xpos, int* ypos, int* w, int* h,
									  int* wx, int* wy, int* ww, int* wh)
{
	_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
	assert(monitor != NULL);

	_GLFW_REQUIRE_INIT();

	if (displayID)
		*displayID = monitor->ns.displayID;

	if (unitNumber)
		*unitNumber = monitor->ns.unitNumber;

	const CGRect bounds = CGDisplayBounds(monitor->ns.displayID);

	if (xpos)
		*xpos = (int) bounds.origin.x;
	if (ypos)
		*ypos = (int) bounds.origin.y;
	if (w)
		*w = (int) bounds.size.width;
	if (h)
		*h = (int) bounds.size.height;

	NSScreen *result = NULL;
	bool isPrimary = true;

	for (NSScreen *screen in [NSScreen screens])
	{
		if ([[[screen deviceDescription] valueForKey:@"NSScreenNumber"] intValue] == monitor->ns.displayID)
		{
			result = screen;
			break;
		}

		isPrimary = false;
	}

	if (result)
	{
		NSRect frame = [result frame];
		NSRect visibleFrame = [result visibleFrame];
		CGRect rect = NSRectToCGRect(visibleFrame);

		if(isPrimary)
		{
			rect.origin.y = frame.size.height - visibleFrame.origin.y - visibleFrame.size.height;
		}
		else
		{
			NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0];
			const float primaryScreenHeight = [primaryScreen frame].size.height;
			rect.origin.y = primaryScreenHeight - rect.origin.y - rect.size.height;
		}

		if (wx)
			*wx = (int) rect.origin.x;
		if (wy)
			*wy = (int) rect.origin.y;
		if (ww)
			*ww = (int) rect.size.width;
		if (wh)
			*wh = (int) rect.size.height;
	}
	else
	{// 取得に失敗することがある原因を調べる [Siv3D ToDo]
		if (wx)
			*wx = (int) bounds.origin.x;
		if (wy)
			*wy = (int) bounds.origin.y;
		if (ww)
			*ww = (int) bounds.size.width;
		if (wh)
			*wh = (int) bounds.size.height;
	}
}
//
//-----------------------------------------------

//////////////////////////////////////////////////////////////////////////
//////                       GLFW internal API                      //////
//////////////////////////////////////////////////////////////////////////

// Poll for changes in the set of connected monitors
//
void _glfwPollMonitorsNS(void)
{
    uint32_t i, j, displayCount, disconnectedCount;
    CGDirectDisplayID* displays;
    _GLFWmonitor** disconnected = NULL;

    CGGetOnlineDisplayList(0, NULL, &displayCount);
    displays = calloc(displayCount, sizeof(CGDirectDisplayID));
    CGGetOnlineDisplayList(displayCount, displays, &displayCount);

    for (i = 0;  i < _glfw.monitorCount;  i++)
        _glfw.monitors[i]->ns.screen = nil;

    disconnectedCount = _glfw.monitorCount;
    if (disconnectedCount)
    {
        disconnected = calloc(_glfw.monitorCount, sizeof(_GLFWmonitor*));
        memcpy(disconnected,
               _glfw.monitors,
               _glfw.monitorCount * sizeof(_GLFWmonitor*));
    }

    for (i = 0;  i < displayCount;  i++)
    {
        _GLFWmonitor* monitor;
        const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]);

        if (CGDisplayIsAsleep(displays[i]))
            continue;

        for (j = 0;  j < disconnectedCount;  j++)
        {
            // HACK: Compare unit numbers instead of display IDs to work around
            //       display replacement on machines with automatic graphics
            //       switching
            if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber)
            {
                disconnected[j] = NULL;
                break;
            }
        }

        const CGSize size = CGDisplayScreenSize(displays[i]);
        char* name = getDisplayName(displays[i]);
        if (!name)
            name = _glfw_strdup("Unknown");

        monitor = _glfwAllocMonitor(name, size.width, size.height);
        monitor->ns.displayID  = displays[i];
        monitor->ns.unitNumber = unitNumber;

        free(name);

        _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST);
    }

    for (i = 0;  i < disconnectedCount;  i++)
    {
        if (disconnected[i])
            _glfwInputMonitor(disconnected[i], GLFW_DISCONNECTED, 0);
    }

    free(disconnected);
    free(displays);
}

// Change the current video mode
//
void _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired)
{
    CFArrayRef modes;
    CFIndex count, i;
    CVDisplayLinkRef link;
    CGDisplayModeRef native = NULL;
    GLFWvidmode current;
    const GLFWvidmode* best;

    best = _glfwChooseVideoMode(monitor, desired);
    _glfwPlatformGetVideoMode(monitor, &current);
    if (_glfwCompareVideoModes(&current, best) == 0)
        return;

    CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);

    modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
    count = CFArrayGetCount(modes);

    for (i = 0;  i < count;  i++)
    {
        CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
        if (!modeIsGood(dm))
            continue;

        const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link);
        if (_glfwCompareVideoModes(best, &mode) == 0)
        {
            native = dm;
            break;
        }
    }

    if (native)
    {
        if (monitor->ns.previousMode == NULL)
            monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);

        CGDisplayFadeReservationToken token = beginFadeReservation();
        CGDisplaySetDisplayMode(monitor->ns.displayID, native, NULL);
        endFadeReservation(token);
    }

    CFRelease(modes);
    CVDisplayLinkRelease(link);
}

// Restore the previously saved (original) video mode
//
void _glfwRestoreVideoModeNS(_GLFWmonitor* monitor)
{
    if (monitor->ns.previousMode)
    {
        CGDisplayFadeReservationToken token = beginFadeReservation();
        CGDisplaySetDisplayMode(monitor->ns.displayID,
                                monitor->ns.previousMode, NULL);
        endFadeReservation(token);

        CGDisplayModeRelease(monitor->ns.previousMode);
        monitor->ns.previousMode = NULL;
    }
}

//////////////////////////////////////////////////////////////////////////
//////                       GLFW platform API                      //////
//////////////////////////////////////////////////////////////////////////

void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor)
{
}

void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
{
    @autoreleasepool {

    const CGRect bounds = CGDisplayBounds(monitor->ns.displayID);

    if (xpos)
        *xpos = (int) bounds.origin.x;
    if (ypos)
        *ypos = (int) bounds.origin.y;

    } // autoreleasepool
}

void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
                                         float* xscale, float* yscale)
{
    @autoreleasepool {

    if (!refreshMonitorScreen(monitor))
        return;

    const NSRect points = [monitor->ns.screen frame];
    const NSRect pixels = [monitor->ns.screen convertRectToBacking:points];

    if (xscale)
        *xscale = (float) (pixels.size.width / points.size.width);
    if (yscale)
        *yscale = (float) (pixels.size.height / points.size.height);

    } // autoreleasepool
}

void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
                                     int* xpos, int* ypos,
                                     int* width, int* height)
{
    @autoreleasepool {

    if (!refreshMonitorScreen(monitor))
        return;

    const NSRect frameRect = [monitor->ns.screen visibleFrame];

    if (xpos)
        *xpos = frameRect.origin.x;
    if (ypos)
        *ypos = _glfwTransformYNS(frameRect.origin.y + frameRect.size.height - 1);
    if (width)
        *width = frameRect.size.width;
    if (height)
        *height = frameRect.size.height;

    } // autoreleasepool
}

GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
{
    @autoreleasepool {

    CFArrayRef modes;
    CFIndex found, i, j;
    GLFWvidmode* result;
    CVDisplayLinkRef link;

    *count = 0;

    CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);

    modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
    found = CFArrayGetCount(modes);
    result = calloc(found, sizeof(GLFWvidmode));

    for (i = 0;  i < found;  i++)
    {
        CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
        if (!modeIsGood(dm))
            continue;

        const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link);

        for (j = 0;  j < *count;  j++)
        {
            if (_glfwCompareVideoModes(result + j, &mode) == 0)
                break;
        }

        // Skip duplicate modes
        if (i < *count)
            continue;

        (*count)++;
        result[*count - 1] = mode;
    }

    CFRelease(modes);
    CVDisplayLinkRelease(link);
    return result;

    } // autoreleasepool
}

void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode)
{
    @autoreleasepool {

    CGDisplayModeRef displayMode;
    CVDisplayLinkRef link;

    CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);

    displayMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);
    *mode = vidmodeFromCGDisplayMode(displayMode, link);
    CGDisplayModeRelease(displayMode);

    CVDisplayLinkRelease(link);

    } // autoreleasepool
}

GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
{
    @autoreleasepool {

    uint32_t i, size = CGDisplayGammaTableCapacity(monitor->ns.displayID);
    CGGammaValue* values = calloc(size * 3, sizeof(CGGammaValue));

    CGGetDisplayTransferByTable(monitor->ns.displayID,
                                size,
                                values,
                                values + size,
                                values + size * 2,
                                &size);

    _glfwAllocGammaArrays(ramp, size);

    for (i = 0; i < size; i++)
    {
        ramp->red[i]   = (unsigned short) (values[i] * 65535);
        ramp->green[i] = (unsigned short) (values[i + size] * 65535);
        ramp->blue[i]  = (unsigned short) (values[i + size * 2] * 65535);
    }

    free(values);
    return GLFW_TRUE;

    } // autoreleasepool
}

void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
{
    @autoreleasepool {

    int i;
    CGGammaValue* values = calloc(ramp->size * 3, sizeof(CGGammaValue));

    for (i = 0;  i < ramp->size;  i++)
    {
        values[i]                  = ramp->red[i] / 65535.f;
        values[i + ramp->size]     = ramp->green[i] / 65535.f;
        values[i + ramp->size * 2] = ramp->blue[i] / 65535.f;
    }

    CGSetDisplayTransferByTable(monitor->ns.displayID,
                                ramp->size,
                                values,
                                values + ramp->size,
                                values + ramp->size * 2);

    free(values);

    } // autoreleasepool
}

//////////////////////////////////////////////////////////////////////////
//////                        GLFW native API                       //////
//////////////////////////////////////////////////////////////////////////

GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* handle)
{
    _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
    _GLFW_REQUIRE_INIT_OR_RETURN(kCGNullDirectDisplay);
    return monitor->ns.displayID;
}


text:
import numpy as np
from scipy.integrate import odeint
import copy
import time
# CAUTION HERE #
# IT IS IMPORTANT THAT THE USER IS AWARE THAT THE EXTERNAL MODEL (RUN METHOD)
# NEEDS TO BE THREAD-SAFE!!!!!
# IN CASE IT IS NOT, THE USER NEEDS TO SET A LOCK SYSTEM!!!!!
import threading
localLock = threading.RLock()

def initialize(self, runInfo, inputs):
  self.N                       = 10 # number of points to discretize
  self.L                       = 1.0 # lenght of the rod
  self.X                       = np.linspace(0, self.L, self.N) # position along the rod
  self.h                       = self.L / (self.N - 1) # discretization step
  self.initialTemperatures     = 150.0 * np.ones(self.X.shape) # initial temperature
  self.shapeToUse              = copy.deepcopy(self.X.shape)
  self.timeDiscretization      = np.linspace(0.0, 100.0, 10)

def odeFuncion(u, t, xshape, N, h, k):
  dudt     = np.zeros(xshape)
  dudt[0] = 0 # constant at boundary condition
  dudt[-1] = 0
  # now for the internal nodes
  for i in range(1, N-1):
    dudt[i] = k * (u[i + 1] - 2*u[i] + u[i - 1]) / h**2
  return dudt

def run(self, Input):
  global localLock
  self.initialTemperatures[0]  = self.anAliasForLeftTemperatureInHeatTransfer  # one boundary condition
  self.initialTemperatures[-1] = self.anAliasForRightTemperatureInHeatTransferr # the other boundary condition
  with localLock:
    solution = odeint(odeFuncion, self.initialTemperatures, self.timeDiscretization, args=copy.deepcopy((self.shapeToUse,self.N,self.h,self.anAliasForKInHeatTransfer)),full_output = 1)
    self.anAliasForSolutionInHeatTransfer = solution[0][-1,5]


text:
<?php

namespace Amadeus\Client\Struct\Offer\ConfirmHotel;

/**
 * TattooReference
 *
 * @package Amadeus\Client\Struct\Offer\ConfirmHotel
 * @author Dieter Devlieghere <dermikagh@gmail.com>
 */
class TattooReference
{
    const SEGMENT_NAME_AIR = "AIR";

    const SEGMENT_NAME_HOTEL_AUX = "HHL";

    /**
     *
     * 700 no active itinerary
     * 701 Coupon notification
     * 702 Active* (*To indicate the queue is designated for use whether it currently has any items.
     *              When not present, the default status is non-active)
     * 703 Queue placement is inhibited
     * 704 Queue level notification
     * 705 Queue being printed
     * 706 Sub-queue present
     * 707 On hold
     * A Add
     * AC Accrual
     * AL Aiport control
     * ALL Allocated
     * AVA Available
     * B Flown/used
     * BD Boarded
     * C Change
     * CK Checked in
     * CLO Closed
     * D Reprint
     * DB Deboarded
     * DN Denied boarding
     * E Exchanged/reissued
     * F Critical free text
     * G Non air segment
     * I Original Issue (Open for Use)
     * IF Information only
     * INU In use
     * IO Irregular operations
     * K Confirmed, effective, working, firm, etc
     * LIM Limitations on use
     * NAV Not available
     * NC Not checked in
     * NS Infant, no seat
     * OF Offloaded
     * OK Confirmed
     * OLD Replaced item
     * OPE Open
     * P Provisional, draft proposed subject to change, etc
     * PAV Partial Availability - Specified sub-elements only
     * PE Print Exchange
     * PR Printed
     * PRF Preferred
     * PRP Proposed/Intended Allocation
     * R Request
     * RD Redemption
     * REP Replacement
     * REV Revised
     * RF Refunded
     * RQ Requested
     * S Suspended
     * SA Space Available
     * SB Standby
     * SRV Serviceable
     * T Ticketed
     * UNS Unserviceable
     * V Void
     * WL Waitlisted
     * X Cancel
     *
     * @var string
     */
    public $status;

    /**
     * @var Reference
     */
    public $reference;

    /**
     * self::SEGMENT_NAME_*
     *
     * AIR Air segment
     * HHL Automated Hotel auxiliary segment
     *
     * @var string
     */
    public $segmentName;

    /**
     * TattooReference constructor.
     *
     * @param int $number
     * @param string $qualifier
     * @param string $segName
     */
    public function __construct(
        $number,
        $qualifier = Reference::QUAL_OFFER_TATTOO,
        $segName = self::SEGMENT_NAME_HOTEL_AUX
    ) {
        $this->reference = new Reference($number, $qualifier);
        $this->segmentName = $segName;
    }
}


text:
<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Eliot Profiler Analysis</title>
    <link rel="stylesheet" href="/static/bundle.css">


text:
<?php
/**
 * [PHPFOX_HEADER]
 */

defined('PHPFOX') or exit('NO DICE!');

Phpfox::getLibClass('phpfox.database.interface');

/**
 * Parent class for all SQL drivers. Each driver needs to interact
 * with this class in case any modifications need to be done to a query.
 *
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: dba.class.php 4550 2012-07-23 08:28:41Z Miguel_Espinoza $
 */
abstract class Phpfox_Database_Dba implements Phpfox_Database_Interface
{
	/**
	 * Array of all the parts of a query we are going to execute
	 *
	 * @see self::execute()
	 * @var array
	 */
	protected $_aQuery = array();

	/**
	 * Array of all the words that cannot be used
	 * when creating a database table or field. This is only
	 * used in development mode.
	 *
	 * @var array
	 */
	protected $_aWords = array();

	/**
	 * Holds all the data that has been filtered when inserting or updating
	 * information directly from a from posted by an end user.
	 *
	 * @var array
	 */
	private $_aData = array();

	/**
	 * Array of all the SQL unions.
	 *
	 * @var array
	 */
	private $_aUnions = array();

	/**
	 * Class constructor. If we are in development mode we store
	 * all the words that cannot be used when creating tables or fields.
	 *
	 */
	public function __construct()
	{
		if (PHPFOX_DEBUG && !defined('PHPFOX_INSTALLER') && !PHPFOX_OPEN_BASE_DIR)
		{
			if (file_exists(PHPFOX_DIR_DEV . 'include/sql-list'))
			{
				$oCache = Phpfox::getLib('cache');
				$sCacheId = $oCache->set('sql_reserved_list');
				if (!($this->_aWords = $oCache->get($sCacheId)))
				{
					$aFile = file(PHPFOX_DIR_DEV . 'include/sql-list');
					foreach ($aFile as $sLine)
					{
						$sLine = trim($sLine);
						$aParts = explode('=>', $sLine);
						$sWord = trim($aParts[0]);

						if (empty($sWord) || (is_array($this->_aWords) && in_array($sWord, $this->_aWords)))
						{
							continue;
						}

						$this->_aWords[] = $sWord;
					}
					$oCache->save($sCacheId, $this->_aWords);
				}
			}
		}
	}

    /**
     * Returns one field from a row using a slave connection
     *
     * @param string $sSql SQL query
     * @return resource SQL resource
     */
    public function getSlaveField($sSql)
    {
		$this->_bIsSlave = true;

    	return $this->_getField($sSql, $this->_hSlave);
    }

    /**
     * Returns one row using a slave connection
     *
     * @param string $sSql SQL query
     * @param bool $bAssoc True to return an associative array
     * @return resource SQL resource
     */
    public function getSlaveRow($sSql, $bAssoc = true)
    {
    	$this->_bIsSlave = true;

    	return $this->_getRow($sSql, $bAssoc, $this->_hSlave);
    }

    /**
     * Returns several rows using a slave connection
     *
     * @param string $sSql SQL query
     * @param bool $bAssoc True to return an associative array
     * @return resource SQL resource
     */
    public function getSlaveRows($sSql, $bAssoc = true)
    {
    	$this->_bIsSlave = true;

    	return $this->_getRows($sSql, $bAssoc, $this->_hSlave);
    }

    /**
     * Returns one row
     *
     * @param string $sSql SQL query
     * @param bool $bAssoc True to return an associative array
     * @return resource SQL resource
     */
    public function getRow($sSql, $bAssoc = true)
    {
    	return $this->_getRow($sSql, $bAssoc, $this->_hMaster);
    }

    /**
     * Returns several rows
     *
     * @param string $sSql SQL query
     * @param bool $bAssoc True to return an associative array
     * @return resource SQL resource
     */
    public function getRows($sSql, $bAssoc = true)
    {
    	return $this->_getRows($sSql, $bAssoc, $this->_hMaster);
    }

    /**
     * Returns one field from a row
     *
     * @param string $sSql SQL query
     * @return resource SQL resource
     */
    public function getField($sSql)
    {
		return $this->_getField($sSql, $this->_hMaster);
    }

    /**
     * Stores the SELECT part of a query
     *
     * @see self::execute()
     * @param string $sSelect Select part of an SQL query
     * @return object Returns own object
     */
	public function select($sSelect)
	{
		if (!isset($this->_aQuery['select']))
		{
			$this->_aQuery['select'] = 'SELECT ';
		}

		$this->_aQuery['select'] .= $sSelect;

		return $this;
	}

    /**
     * Stores the WHERE part of a query
     * Example using a string method:
     *
     * ->where('user_id = 1')
     *
     * Example using an array method:
     *
     * $aCond = array();
     * $aCond[] = 'AND user_id = 1';
     * $aCond[] = 'AND email = \'foo@bar.com\'';
     * ->where($aCond)
     *
     *
     * @see self::execute()
     * @param mixed $aConds Can be a string of the WHERE part of an SQL query or an array or all the parts of an SQL query.
     * @return object Returns own object
     */
	public function where($aConds)
	{
		$this->_aQuery['where'] = '';
		if (is_array($aConds) && count($aConds))
		{
			foreach ($aConds as $sValue)
			{
				$this->_aQuery['where'] .= $sValue . ' ';
			}
			$this->_aQuery['where'] = "WHERE " . trim(preg_replace("/^(AND|OR)(.*?)/i", "", trim($this->_aQuery['where'])));
		}
		else
		{
			if (!empty($aConds))
			{
				$this->_aQuery['where'] .= 'WHERE ' . $aConds;
			}
		}

		return $this;
	}

    /**
     * Stores the FROM part of a query
     *
     * @see self::execute()
     * @param string $sTable Table to query
     * @param string $sAlias Optional usage of alias can be passed here
     * @return object Returns own object
     */
	public function from($sTable, $sAlias = '')
	{
		if (PHPFOX_DEBUG && in_array(strtoupper($sAlias), $this->_aWords))
		{
			Phpfox_Error::trigger('The alias "' . $sAlias . '" is a reserved SQL word. Use another alias to resolve this problem.', E_USER_ERROR);
		}

		$this->_aQuery['table'] = 'FROM ' . $sTable . ($sAlias ? ' AS ' . $sAlias : '');

		return $this;
	}

    /**
     * Stores the ORDER part of a query
     *
     * @see self::execute()
     * @param string $sOrder SQL ORDER BY command
     * @return object Returns own object
     */
	public function order($sOrder)
	{
		if (!empty($sOrder))
		{
			$this->_aQuery['order'] = 'ORDER BY ' . $sOrder;
		}

		return $this;
	}

    /**
     * Stores the GROUP BY part of a query
     *
     * @see self::execute()
     * @param string $sGroup SQL GROUP BY command
     * @return object Returns own object
     */
	public function group($sGroup)
	{
		$this->_aQuery['group'] = 'GROUP BY ' . $sGroup;

		return $this;
	}

    /**
     * Stores the HAVING part of a query
     *
     * @see self::execute()
     * @param string $sHaving SQL HAVING command
     * @return object Returns own object
     */
	public function having($sHaving)
	{
		$this->_aQuery['having'] = 'HAVING ' . $sHaving;

		return $this;
	}

	/**
	 * Creates a LEFT JOIN for an SQL query.
	 * Example of left joining tables:
	 *
	 * Phpfox::getLib('database')->select('*')
	 * 		->from('user', 'u')
	 * 		->leftJoin('user_info', 'ui', 'ui.user_id = u.user_id')
	 * 		->execute('getRows');
	 *
	 *
	 * @see self::_join()
	 * @param string $sTable Table to join
	 * @param string $sAlias Alias to use to identify the table and make it unique
	 * @param mixed $mParam Can be a string or an array of how to link the tables. This is usually a string that contains the part found with an SQL ON(__STRING__)
	 * @return object Returns own object
	 */
	public function leftJoin($sTable, $sAlias, $mParam = null)
	{
		$this->_join('LEFT JOIN', $sTable, $sAlias, $mParam);

		return $this;
	}

	/**
	 * Creates a INNER JOIN for an SQL query.
	 * Example of left joining tables:
	 *
	 * Phpfox::getLib('database')->select('*')
	 * 		->from('user', 'u')
	 * 		->innerJoin('user_info', 'ui', 'ui.user_id = u.user_id')
	 * 		->execute('getRows');
	 *
	 *
	 * @see self::_join()
	 * @param string $sTable Table to join
	 * @param string $sAlias Alias to use to identify the table and make it unique
	 * @param mixed $mParam Can be a string or an array of how to link the tables. This is usually a string that contains the part found with an SQL ON(__STRING__)
	 * @return object Returns own object
	 */
	public function innerJoin($sTable, $sAlias, $mParam = null)
	{
		$this->_join('INNER JOIN', $sTable, $sAlias, $mParam);

		return $this;
	}

	/**
	 * Creates a JOIN for an SQL query.
	 * Example of left joining tables:
	 *
	 * Phpfox::getLib('database')->select('*')
	 * 		->from('user', 'u')
	 * 		->join('user_info', 'ui', 'ui.user_id = u.user_id')
	 * 		->execute('getRows');
	 *
	 *
	 * @see self::_join()
	 * @param string $sTable Table to join
	 * @param string $sAlias Alias to use to identify the table and make it unique
	 * @param mixed $mParam Can be a string or an array of how to link the tables. This is usually a string that contains the part found with an SQL ON(__STRING__)
	 * @return object Returns own object
	 */
	public function join($sTable, $sAlias, $mParam = null)
	{
		$this->_join('JOIN', $sTable, $sAlias, $mParam);

		return $this;
	}

    /**
     * Stores the LIMIT/OFFSET part of a query. It can also be used
     * to create a pagination if params 2 and 3 and filled otherwise
     * it bahaves just as a limit on the SQL query.
     *
     * @see self::execute()
     * @param int $iPage If $sLimit and $iCnt are NULL then this value is the LIMIT on the SQL query. However if $sLimit and $iCnt are not NULL then this value is the current page we are on.
     * @param string $sLimit Is how many to limit per query
     * @param int $iCnt Is how many rows there are in this query
     * @return object Returns own object
     */
	public function limit($iPage, $sLimit = null, $iCnt = null, $bReturn = false)
	{
		if ($sLimit === null && $iCnt === null && $iPage !== null)
		{
			$this->_aQuery['limit'] = 'LIMIT ' . $iPage;

			return $this;
		}

		$iOffset = ($iCnt === null ? $iPage : Phpfox::getLib('pager')->getOffset($iPage, $sLimit, $iCnt));

		$this->_aQuery['limit'] = ($sLimit ? 'LIMIT ' . $sLimit : '') . ($iOffset ? ' OFFSET ' . $iOffset : '');

		if ($bReturn === true)
		{
			return $this->_aQuery['limit'];
		}

		return $this;
	}

	/**
	 * Build a UNION call.
	 *
	 * @return object Return self.
	 */
	public function union()
	{
		$this->_aUnions[] = $this->execute(null, array('union_no_check' => true));

		return $this;
	}

	/**
	 * Build a UNION FROM call.
	 *
	 * @param string $sAlias FROM alias name.
	 * @return object Return self.
	 */
	public function unionFrom($sAlias)
	{
		$this->_aQuery['union_from'] = $sAlias;

		return $this;
	}

	/**
	 * Define that this is a joined count
	 *
	 * @return object Return self.
	 */
	public function joinCount()
	{
		$this->_aQuery['join_count'] = true;

		return $this;
	}

	/**
	 * Performs the final SQL query with all the information we have gathered from various
	 * other methods in this class. Via this method you can perform all tasks from getting
	 * a single field from a row, to just one row or a list of rows.
	 *
	 * @see self::getRow()
	 * @see self::getRows()
	 * @see self::getField()
	 * @param string $sType The command we plan to execute. It can also be NULL or empty and will simply return the SQL query itself without executing it.
	 * @param array $aParams Any special commands that we need to run can be passed here. Mainly used if we were to cache the actual query.
	 * @return mixed Depending on the command you ran this can return various things, usually an array but it all depends on what you executed.
	 */
	public function execute($sType = null, $aParams = array())
	{
		$sSql = '';
		if (isset($this->_aQuery['select']))
		{
			$sSql .= $this->_aQuery['select'] . "\n";
		}

		if (isset($this->_aQuery['join_count']))
		{
			$sSql .= 'SELECT (';
		}

		if (isset($this->_aQuery['table']))
		{
			$sSql .= $this->_aQuery['table'] . "\n";
		}

		if (isset($this->_aQuery['union_from']))
		{
			$sSql .= "FROM(\n";
		}

		if (!isset($aParams['union_no_check']) && count($this->_aUnions))
		{
			$iUnionCnt = 0;
			foreach ($this->_aUnions as $sUnion)
			{
				$iUnionCnt++;
				if ($iUnionCnt != 1)
				{
					$sSql .= (isset($this->_aQuery['join_count']) ? ' + ' : ' UNION ');
				}

				$sSql .= '(' . $sUnion . ')';
			}
		}

		if (isset($this->_aQuery['join_count']))
		{
			$sSql .= ') AS total_count';
		}

		if (isset($this->_aQuery['union_from']))
		{
			$sSql .= ") AS " . $this->_aQuery['union_from'] . "\n";
		}

		$sSql .= (isset($this->_aQuery['join']) ? $this->_aQuery['join'] . "\n" : '');
		$sSql .= (isset($this->_aQuery['where']) ? $this->_aQuery['where'] . "\n" : '');
		$sSql .= (isset($this->_aQuery['group']) ? $this->_aQuery['group'] . "\n" : '');
		$sSql .= (isset($this->_aQuery['having']) ? $this->_aQuery['having'] . "\n" : '');
		$sSql .= (isset($this->_aQuery['order']) ? $this->_aQuery['order'] . "\n" : '');
		$sSql .= (isset($this->_aQuery['limit']) ? $this->_aQuery['limit'] . "\n" : '');
		$sSql .= '/* OO Query */';

		if (method_exists($this, '_execute'))
		{
			$sSql = $this->_execute();
		}

		$this->_aQuery = array();
		if (!isset($aParams['union_no_check']))
		{
			$this->_aUnions = array();
		}

		$bDoCache = false;
		if (isset($aParams['cache']) && $aParams)
		{
			$bDoCache = true;
			$oCache = Phpfox::getLib('cache');
		}

		if ($bDoCache)
		{
			$sCacheId = $oCache->set($aParams['cache_name']);
			if ((isset($aParams['cache_limit']) && ($aRows = $oCache->get($sCacheId, $aParams['cache_limit']))) || ($aRows = $oCache->get($sCacheId)))
			{
				return $aRows;
			}
		}

		if (isset($aParams['count']))
		{

		}

		$sType = strtolower($sType);
		switch($sType)
		{
			case 'getslaverows':
				$aRows = $this->getSlaveRows($sSql);
				break;
			case 'getslaverow':
				$aRows = $this->getSlaveRow($sSql);
				break;
			case 'getrow':
				$aRows = $this->getRow($sSql);
				break;
			case 'getrows':
				$aRows = $this->getRows($sSql);
				break;
			case 'getfield':
				$aRows = $this->getField($sSql);
				break;
			case 'getslavefield':
				$aRows = $this->getSlaveField($sSql);
				break;
			default:
				return $sSql;
				break;
		}

		if ($bDoCache)
		{
			$oCache->save($sCacheId, $aRows);
		}

		if (isset($aParams['free_result']))
		{
			$this->freeResult();
		}

		return $aRows;
	}

	/**
	 * We clean out the query we just ran so another query can be built
	 *
	 */
	public function clean()
	{
		$this->_aQuery = array();
	}

	/**
	 * Process data from a form a end-user posted and prepare it to be used when inserting/updating records
	 *
	 * @param array $aFields Array of rules of the fields that are allowed and the type it must be
	 * @param array $aVals  $_POST fields from a form
	 * @return object Returns own object
	 */
	public function process($aFields, $aVals)
	{
		foreach ($aFields as $mKey => $mVal)
		{
			if (is_numeric($mKey))
			{
				unset($aFields[$mKey]);

				$mKey = $mVal;
				$mVal = 'string';
			}

			if (empty($aVals[$mKey]))
			{
				$aVals[$mKey] = ($mVal == 'int' ? 0 : null);
			}

			$aFields[$mKey] = $mVal;
		}

		foreach ($aVals as $mKey => $mVal)
		{
			if (!isset($aFields[$mKey]))
			{
				continue;
			}

			$this->_aData[$mKey] = ($aFields[$mKey] == 'int' ? (int) $mVal : $mVal);
		}

		return $this;
	}

    /**
     * Performs insert of one row. Accepts values to insert as an array:
     *    'column1' => 'value1'
     *    'column2' => 'value2'
     *
     * @access	public
     * @param string  $sTable    table name
     * @param array   $aValues   column and values to insert
     * @param boolean $bEscape true - method escapes values (with "), false - not escapes
     * @return int last ID (or 0 on error)
     */
    public function insert($sTable, $aValues = array(), $bEscape = true, $bReturnQuery = false)
    {
    	if (!$aValues)
    	{
    		$aValues = $this->_aData;
    	}

    	$sValues = '';
    	foreach ($aValues as $mValue)
    	{
    		if (is_null($mValue))
    		{
    			$sValues .= "NULL, ";
    		}
    		else
    		{
    			$sValues .= "'" . ($bEscape ? $this->escape($mValue) : $mValue) . "', ";
    		}
    	}
    	$sValues = rtrim(trim($sValues), ',');

    	if ($this->_aData)
    	{
    		$this->_aData = array();
    	}

        $sSql = $this->_insert($sTable, implode(', ', array_keys($aValues)), $sValues);

        if ($hRes = $this->query($sSql))
        {
        	if ($bReturnQuery)
        	{
        		return $sSql;
        	}

            return $this->getLastId();
		}

        return 0;
    }

    /**
     * Runs an SQL query to run one SQL query and insert multiple rows. The 2nd and 3rd
     * params much match in order to inser the data correctly.
     *
     * @param string $sTable Table to insert the data
     * @param array $aFields Array of table fields
     * @param array $aValues Array of values to insert that matches the table fields
     * @return int Returns the last ID of the insert. Usually the auto_increment.
     */
    public function multiInsert($sTable, $aFields, $aValues)
    {
    	$sSql = "INSERT INTO {$sTable} (" . implode(', ', array_values($aFields)) . ") ";
    	$sSql .= " VALUES\n";
    	foreach ($aValues as $aValue)
    	{
    		$sSql .= "\n(";
    		foreach ($aValue as $mValue)
    		{
    			if (is_null($mValue))
    			{
    				$sSql .= "NULL, ";
    			}
    			else
    			{
    				$sSql .= "'" . $this->escape($mValue) . "', ";
    			}
    		}
    		$sSql = rtrim(trim($sSql), ',');
    		$sSql .= "),";
    	}
    	$sSql = rtrim($sSql, ',');

        if ($hRes = $this->query($sSql))
        {
            return $this->getLastId();
		}

    	return 0;
    }

    /**
     * Performs update of rows.
     *
     * @param string $sTable  table name
     * @param array  $aValues array of column=>new_value
     * @param string $sCond   condition (without WHERE)
     * @param boolean $bEscape true - method escapes values (with "), false - not escapes
     * @return boolean true - update successfule, false - error
     */
    public function update($sTable, $aValues = array(), $sCond = null, $bEscape = true)
    {
        if (!is_array($aValues) && count($this->_aData))
        {
            $sCond = $aValues;
        	$aValues = $this->_aData;
        	$this->_aData = array();
		}

        $sSets = '';
        foreach ($aValues as $sCol => $sValue)
        {
            $sCmd = "=";
            if (is_array($sValue))
            {
            	$sCmd = $sValue[0];
            	$sValue = $sValue[1];
            }

        	$sSets .= "{$sCol} {$sCmd} " . (is_null($sValue) ? 'NULL' : ($bEscape ? "'" . $this->escape($sValue) . "'" : $sValue)) . ", ";
        }
        $sSets[strlen($sSets)-2] = '  ';

        return $this->query($this->_update($sTable, $sSets, $sCond));
    }

    /**
     * Delete entry from the database
     *
     * @param string $sTable is the table name
     * @param string $sQuery is the query we will run
     * @return boolean true - update successfule, false - error
     */
    public function delete($sTable, $sQuery, $iLimit = null)
    {
    	if ($iLimit !== null)
    	{
    		$sQuery .= ' LIMIT ' . (int) $iLimit;
    	}

    	return $this->query("DELETE FROM {$sTable} WHERE ". $sQuery);
    }

    /**
     * Drops tables from the database
     *
     * @param string $aDrops Array of tables to drop
     * @param array $aVals Not being used at the moment.
     */
	public function dropTables($aDrops, $aVals = array())
	{
		if (!is_array($aDrops))
		{
			$aDrops = array($aDrops);
		}
		foreach ($aDrops as $sDrop)
		{
			$this->query("DROP TABLE {$sDrop}");
		}
	}

	/**
	 * Updates a int field in the database to increase or decrease its count.
	 * We usually use this to cache information about a user. Lets take for example
	 * a user has 10 friends and instead of running a query to the database to check
	 * how many friends they have we just store a static count in the database. So when
	 * they add or remove a friend we then either increase or decrease the static record.
	 *
	 * Example:
	 *
	 * Phpfox::getLib('database')->updateCounter('user_count', 'total_friend', 'user_id', 1);
	 *
	 *
	 * @param string $sTable Table to update
	 * @param string $sCounter Field we are going to be updating. This is where the static value is
	 * @param string $sField Field we need to identify the record we are going to be updating
	 * @param int $iId ID of the field we are going to be updating
	 * @param bool $bMinus False by default as we usually increase a count, if we decrease a count set this to true
	 */
	public function updateCounter($sTable, $sCounter, $sField, $iId, $bMinus = false)
	{
		$iCount = $this->select($sCounter)->from(Phpfox::getT($sTable))->where($sField . ' = ' . (int) $iId)->execute('getSlaveField');

		$this->update(Phpfox::getT($sTable), array($sCounter => ($bMinus === true ? (($iCount <= 0 ? 0 : $iCount - 1)) : ($iCount + 1))), $sField . ' = ' . (int) $iId);
	}

	/**
	 * This in practice works similar to our previous method self::updateCounter(), however
	 * instead of increasing or decreasing a field it checks the table to see how many
	 * rows there are and updates the static field with that count. This is usually only used
	 * in the AdminCP to fix broken counters.
	 *
	 * @param string $sCountTable Table to check how many rows there are
	 * @param array $aCountCond SQL conditional statement for the table we are checking
	 * @param string $sCounter Field name of the table we are updating the static count
	 * @param string $sUpdateTable Table we are going to be updating with the new count number
	 * @param array $aUpdateCond SQL conditional statment for the table we are updating
	 */
	public function updateCount($sCountTable, $aCountCond, $sCounter, $sUpdateTable, $aUpdateCond)
	{
		$iCount = $this->select('COUNT(*)')
			->from(Phpfox::getT($sCountTable))
			->where($aCountCond)
			->execute('getSlaveField');

		$this->update(Phpfox::getT($sUpdateTable), array($sCounter => $iCount), $aUpdateCond);
	}

	/**
	 * Gets all the joins made for the query.
	 *
     * @return string Returns SQL joins
	 */
	public function getJoins()
	{
		return $this->_aQuery['join'];
	}

	/**
	 * Build search params for keywords.
	 *
	 * @param string $sField Field to search
	 * @param string $sStr Keywords to use
	 * @return string Returns an SQL ready search statement
	 */
	public function searchKeywords($sField, $sStr)
	{
		if (is_array($sField))
		{
			$sQuery = '';
			$iIteration = 0;
			foreach ($sField as $sNewField)
			{
				$iIteration++;
				if ($iIteration != 1)
				{
					$sQuery .= ' OR ';
				}
				$sQuery .= $this->searchKeywords($sNewField, $sStr);
			}

			return $sQuery;
		}

		$aWords = explode(' ', $sStr);

		$sQuery = ' (';
		if (count($aWords))
		{
			$iIteration = 0;
			foreach ($aWords as $sWord)
			{
				$sWord = trim($sWord);
				if (strlen($sWord) < 4)
				{
					continue;
				}
				$iIteration++;
				if ($iIteration != 1)
				{
					$sQuery .= ' OR ';
				}
				$sQuery .= $sField . ' LIKE \'%' . Phpfox::getLib('database')->escape($sWord) . '%\'';
			}
		}

		if (!$iIteration)
		{
			return $sField . ' LIKE \'%' . Phpfox::getLib('database')->escape($sStr) . '%\' ';
		}

		$sQuery .= ') ';

		return $sQuery;
	}

	/**
	 * Performs all the joins based on information passed from JOIN methods within this class.
	 *
	 * @see self::join()
	 * @see self::leftJoin()
	 * @see self::innerJoin()
	 * @param string $sType The type of join we are going to use (LEFT JOIN, JOIN, INNER JOIM)
	 * @param string $sTable Table to join
	 * @param string $sAlias Alias to use to identify the table and make it unique
	 * @param mixed $mParam Can be a string or an array of how to link the tables. This is usually a string that contains the part found with an SQL ON(__STRING__)
	 */
	protected function _join($sType, $sTable, $sAlias, $mParam = null)
	{
		if (PHPFOX_DEBUG && in_array(strtoupper($sAlias), $this->_aWords))
		{
			Phpfox_Error::trigger('The alias "' . $sAlias . '" is a reserved SQL word. Use another alias to resolve this problem.', E_USER_ERROR);
		}

		if (!isset($this->_aQuery['join']))
		{
			$this->_aQuery['join'] = '';
		}
		$this->_aQuery['join'] .= $sType . " " . $sTable . " AS " . $sAlias;
		if (is_array($mParam))
		{
			$this->_aQuery['join'] .= "\n\tON(";
			foreach ($mParam as $sValue)
			{
				$this->_aQuery['join'] .= $sValue . " ";
			}
		}
		else
		{
			if (preg_match("/(AND|OR|=|LIKE)/", $mParam))
			{
				$this->_aQuery['join'] .= "\n\tON({$mParam}";
			}
			else
			{
				// Not supported with other drivers so we don't use this anymore
				Phpfox_Error::trigger('Not allowed to use "USING()" in SQL queries any longer.', E_USER_ERROR);
			}
		}
		$this->_aQuery['join'] = preg_replace("/^(AND|OR)(.*?)/i", "", trim($this->_aQuery['join'])) . ")\n";
	}

	/**
	 * Insert data into the database
	 *
	 * @param string $sTable Database table
	 * @param string $sFields List of fields
	 * @param string $sValues List of values
	 * @return string Returns the actual SQL query to perform
	 */
	protected function _insert($sTable, $sFields, $sValues)
	{
		return 'INSERT INTO ' . $sTable . ' '.
        	'        (' . $sFields . ')'.
            ' VALUES (' . $sValues . ')';
	}

	/**
	 * Updates data in a specific table
	 *
	 * @param string $sTable Table we are updating
	 * @param string $sSets SQL SET command
	 * @param string $sCond SQL WHERE command
	 * @return string Returns the actual SQL query to perform
	 */
	protected function _update($sTable, $sSets, $sCond)
	{
		return 'UPDATE ' . $sTable . ' SET ' . $sSets . ' WHERE ' . $sCond;
	}

    /**
     * Returns one field from a row
     *
     * @param string $sSql SQL query
     * @param resource $hLink SQL resource
     * @return mixed field value
     */
    private function _getField($sSql, &$hLink)
    {
        $sRes = '';
        $aRow = $this->getRow($sSql, false, $hLink);
        if ($aRow)
        {
            $sRes = $aRow[0];
        }
        return $sRes;
    }

	public function createTable($sName, $aFields)
	{
		$sSql = 'CREATE TABLE ' . $sName . "\n";
		$sSql .= '(' ."\n";
		$bHasPK = false;
		foreach ($aFields as $aField)
		{
			$sSql .= $aField['name'] .' ' . $aField['type'] . (isset($aField['extra']) ? ' ' .$aField['extra'] : '' ) . ",\n";
			if (isset($aField['primary_key']) && $aField['primary_key'] == true)
			{
				$bHasPK = $aField['name'];
			}
		}

		if ($bHasPK !== false)
		{
			$sSql .= 'PRIMARY KEY (`' . $bHasPK . '`)' . "\n";
		}

		$sSql .= ')';

		$this->query($sSql);
	}
}

?>


text:
import subprocess
import tensorflow as tf
import time
import sys

flags = tf.flags
flags.DEFINE_string("port1", "2222", "port of worker1")
flags.DEFINE_string("port2", "2223", "port of worker2")
flags.DEFINE_string("task", "", "internal use")
FLAGS = flags.FLAGS

# setup local cluster from flags
host = "127.0.0.1:"
cluster = {"worker": [host+FLAGS.port1, host+FLAGS.port2]}
clusterspec = tf.train.ClusterSpec(cluster).as_cluster_def()

if __name__=='__main__':
  if not FLAGS.task:  # start servers and run client

      # launch distributed service
      def runcmd(cmd): subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT)
      runcmd("python %s --task=0"%(sys.argv[0]))
      runcmd("python %s --task=1"%(sys.argv[0]))
      time.sleep(1)

      # bring down distributed service
      sess = tf.Session("grpc://"+host+FLAGS.port1)
      queue0 = tf.FIFOQueue(1, tf.int32, shared_name="queue0")
      queue1 = tf.FIFOQueue(1, tf.int32, shared_name="queue1")
      with tf.device("/job:worker/task:0"):
          add_op0 = tf.add(tf.ones([2,3]), tf.ones([2,3]))
      with tf.device("/job:worker/task:1"):
          add_op1 = tf.add(tf.ones([2,3]), tf.ones([2,3]))

      print("Running computation on server 0")
      print(sess.run(add_op0))
      print("Running computation on server 1")
      print(sess.run(add_op1))

      print("Bringing down server 0")
      sess.run(queue0.enqueue(1))
      print("Bringing down server 1")
      sess.run(queue1.enqueue(1))

  else: # Launch TensorFlow server
    server = tf.train.Server(clusterspec, config=None,
                             job_name="worker",
                             task_index=int(FLAGS.task))
    print("Starting server "+FLAGS.task)
    sess = tf.Session(server.target)
    queue = tf.FIFOQueue(1, tf.int32, shared_name="queue"+FLAGS.task)
    sess.run(queue.dequeue())
    print("Terminating server"+FLAGS.task)


text: A sample for a custom Spring Boot Health Indicator


text:
namespace shear {

namespace compiletime {
  struct no_symbol;
}

template<BOOST_PP_ENUM_BINARY_PARAMS(
    SHEAR_PRODUCTION_LIMIT,
    typename Produced, = compiletime::no_symbol BOOST_PP_INTERCEPT
  )>
class produced :
  public produced_s<
   typename compiletime::make_vector_excluding<
      compiletime::no_symbol,
      BOOST_PP_ENUM_PARAMS(SHEAR_PRODUCTION_LIMIT, Produced)
    >::type
  >
{
  public:
    typedef produced_s<
      typename compiletime::make_vector_excluding<
        compiletime::no_symbol,
        BOOST_PP_ENUM_PARAMS(SHEAR_PRODUCTION_LIMIT, Produced)
      >::type
    > base;
};

template<
  typename Source,
  BOOST_PP_ENUM_PARAMS(SHEAR_PRODUCTION_LIMIT, typename Produced)
>
struct make_production<
  Source,
  produced<BOOST_PP_ENUM_PARAMS(SHEAR_PRODUCTION_LIMIT, Produced)>
> {
  typedef typename make_production<
      Source,
      typename produced<
        BOOST_PP_ENUM_PARAMS(SHEAR_PRODUCTION_LIMIT, Produced)
      >::base
    >::type type;
};

}

#endif // SHEAR__PRODUCED_HPP