text:
{% extends "rosetta/base.html" %}
{% load i18n static %}

{% block pagetitle %}{{block.super}} - {% trans "Language selection" %}{% endblock %}

{% block breadcumbs %}

{% trans "Home" %} › {% trans "Language selection" %}

    {% if do_session_warn %}
{% trans "Couldn't load the specified language file. This usually happens when using the Encrypted Cookies Session Storage backend on Django 1.4 or higher.
Setting ROSETTA_STORAGE_CLASS = 'rosetta.storage.CacheRosettaStorage' in your settings file should fix this." %}
{% endif %}
{% endblock %}

{% block main %}

{% trans "Filter" %}:

{% trans "Project" %}

{% trans "Third party" %}

Django

{% trans "All" %}

    {% if has_pos %}

    {% for lid,language,pos in languages %}
    {% if pos %}

{{language}}

                        {% trans "Application" %}
                        {% trans "Progress"%}
                        {% trans "Messages" %}
                        {% trans "Translated" %}
                        {% trans "Fuzzy"%}
                        {% trans "Obsolete"%}
                        {% trans "File" %}

                    {% for app,path,po in pos %}

                        {{ app|title }}
                        {{po.percent_translated}}%
                        {% with po.untranslated_entries|length as len_untranslated_entries %}
                        {{po.translated_entries|length|add:len_untranslated_entries}}
                        {% endwith %}
                        {{po.translated_entries|length}}
                        {{po.fuzzy_entries|length}}
                        {{po.obsolete_entries|length}}
                        {{ path }}

                    {% endfor %}

    {% endif %}
    {% endfor %}
    {% else %}

{% trans "Nothing to translate!" %}

{% trans "You haven't specified any languages in your settings file, or haven't yet generated a batch of translation catalogs." %}

{% blocktrans with "http://docs.djangoproject.com/en/dev/topics/i18n/#topics-i18n" as i18n_doc_link  %}Please refer to Django's I18N documentation for a guide on how to set up internationalization for your project.{% endblocktrans %}

    {% endif %}
{% endblock %}


text:
define(["require", "exports"], function (require, exports) {
    var DefaultEventStrategy = (function () {
        function DefaultEventStrategy() {
            this.delegatedEvents = {};
        }
        DefaultEventStrategy.prototype.ensureDelegatedEvent = function (eventName) {
            if (this.delegatedEvents[eventName]) {
                return;
            }
            this.delegatedEvents[eventName] = true;
            document.addEventListener(eventName, this.handleDelegatedEvent.bind(this), false);
        };
        DefaultEventStrategy.prototype.handleCallbackResult = function (result) {
            //todo: coroutine via result?
        };
        DefaultEventStrategy.prototype.handleDelegatedEvent = function (event) {
            event = event || window.event;
            var target = event.target || event.srcElement, callback;
            while (target && !callback) {
                if (target.delegatedEvents) {
                    callback = target.delegatedEvents[event.type];
                }
                if (!callback) {
                    target = target.parentNode;
                }
            }
            if (callback) {
                this.handleCallbackResult(callback(event));
            }
        };
        DefaultEventStrategy.prototype.createDirectEventCallback = function (callback) {
            var _this = this;
            return function (event) {
                _this.handleCallbackResult(callback(event));
            };
        };
        DefaultEventStrategy.prototype.subscribeToDelegatedEvent = function (target, targetEvent, callback) {
            var lookup = target.delegatedEvents || (target.delegatedEvents = {});
            this.ensureDelegatedEvent(targetEvent);
            lookup[targetEvent] = callback;
            return function () {
                lookup[targetEvent] = null;
            };
        };
        DefaultEventStrategy.prototype.subscribeToDirectEvent = function (target, targetEvent, callback) {
            var directEventCallback = this.createDirectEventCallback(callback);
            target.addEventListener(targetEvent, directEventCallback, false);
            return function () {
                target.removeEventListener(targetEvent, directEventCallback);
            };
        };
        DefaultEventStrategy.prototype.subscribe = function (target, targetEvent, callback, delegate) {
            if (delegate) {
                return this.subscribeToDirectEvent(target, targetEvent, callback);
            }
            else {
                return this.subscribeToDelegatedEvent(target, targetEvent, callback);
            }
        };
        return DefaultEventStrategy;
    })();
    var EventManager = (function () {
        function EventManager() {
            this.elementHandlerLookup = {};
            this.eventStrategyLookup = {};
            this.registerElementConfig({
                tagName: 'input',
                properties: {
                    value: ['change', 'input'],
                    checked: ['change', 'input']
                }
            });
            this.registerElementConfig({
                tagName: 'textarea',
                properties: {
                    value: ['change', 'input']
                }
            });
            this.registerElementConfig({
                tagName: 'select',
                properties: {
                    value: ['change']
                }
            });
            this.registerElementConfig({
                tagName: 'content editable',
                properties: {
                    value: ['change', 'input', 'blur', 'keyup', 'paste'],
                }
            });
            this.defaultEventStrategy = new DefaultEventStrategy();
        }
        EventManager.prototype.registerElementConfig = function (config) {
            var tagName = config.tagName.toLowerCase(), properties = config.properties, propertyName;
            this.elementHandlerLookup[tagName] = {};
            for (propertyName in properties) {
                if (properties.hasOwnProperty(propertyName)) {
                    this.registerElementPropertyConfig(tagName, propertyName, properties[propertyName]);
                }
            }
        };
        EventManager.prototype.registerElementPropertyConfig = function (tagName, propertyName, events) {
            this.elementHandlerLookup[tagName][propertyName] = {
                subscribe: function (target, callback) {
                    events.forEach(function (changeEvent) {
                        target.addEventListener(changeEvent, callback, false);
                    });
                    return function () {
                        events.forEach(function (changeEvent) {
                            target.removeEventListener(changeEvent, callback);
                        });
                    };
                }
            };
        };
        EventManager.prototype.registerElementHandler = function (tagName, handler) {
            this.elementHandlerLookup[tagName.toLowerCase()] = handler;
        };
        EventManager.prototype.registerEventStrategy = function (eventName, strategy) {
            this.eventStrategyLookup[eventName] = strategy;
        };
        EventManager.prototype.getElementHandler = function (target, propertyName) {
            var tagName, lookup = this.elementHandlerLookup;
            if (target.tagName) {
                tagName = target.tagName.toLowerCase();
                if (lookup[tagName] && lookup[tagName][propertyName]) {
                    return lookup[tagName][propertyName];
                }
                if (propertyName === 'textContent' || propertyName === 'innerHTML') {
                    return lookup['content editable']['value'];
                }
            }
            return null;
        };
        EventManager.prototype.addEventListener = function (target, targetEvent, callback, delegate) {
            return (this.eventStrategyLookup[targetEvent] || this.defaultEventStrategy)
                .subscribe(target, targetEvent, callback, delegate);
        };
        return EventManager;
    })();
    exports.EventManager = EventManager;
});

redpajama_set_name: RedPajamaGithub


text:
COMMENT=		"dynamic link library for Haskell"

V=			0.9.10
DISTNAME=		hs-plugins-${V}
CATEGORIES=		devel
MAINTAINER=		Don Stewart <dons@openbsd.org>
HOMEPAGE= 		http://www.cse.unsw.edu.au/~dons/hs-plugins/
MASTER_SITES=		${HOMEPAGE}

MODULES=		ghc
CONFIGURE_STYLE=	gnu dest

# LGPL
PERMIT_PACKAGE_CDROM=	Yes
PERMIT_PACKAGE_FTP=	Yes
PERMIT_DISTFILES_CDROM=	Yes
PERMIT_DISTFILES_FTP=	Yes

.include <bsd.port.mk>


text:
module Jobs

  class Tl3Promotions < Jobs::Scheduled
    daily at: 4.hours

    def execute(args)
      # Demotions
      demoted_user_ids = []
      User.real.where(trust_level: TrustLevel[3], trust_level_locked: false).find_each do |u|
        # Don't demote too soon after being promoted
        next if u.on_tl3_grace_period?

        if Promotion.tl3_lost?(u)
          demoted_user_ids << u.id
          Promotion.new(u).change_trust_level!(TrustLevel[2])
        end
      end

      # Promotions
      User.real.where(trust_level: TrustLevel[2],
                      trust_level_locked: false)
               .where.not(id: demoted_user_ids).find_each do |u|
        Promotion.new(u).review_tl2
      end
    end
  end

end


text:
require "uri"
require "pathname"
require "dry/configurable"
require "dry/inflector"

require_relative "constants"

module Hanami
  # Hanami app config
  #
  # @since 2.0.0
  class Config
    include Dry::Configurable

    # @!attribute [rw] root
    #   Sets the root for the app or slice.
    #
    #   For the app, this defaults to `Dir.pwd`. For slices detected in `slices/` `config/slices/`,
    #   this defaults to `slices/[slice_name]/`.
    #
    #   Accepts a string path and will return a `Pathname`.
    #
    #   @return [Pathname]
    #
    #   @api public
    #   @since 2.0.0
    setting :root, constructor: ->(path) { Pathname(path) if path }

    # @!attribute [rw] inflector
    #   Sets the app's inflector.
    #
    #   This expects a `Dry::Inflector` (or compatible) inflector instance.
    #
    #   To configure custom inflection rules without having to assign a whole inflector, see
    #   {#inflections}.
    #
    #   @return [Dry::Inflector]
    #
    #   @see #inflections
    #
    #   @api public
    #   @since 2.0.0
    setting :inflector, default: Dry::Inflector.new

    # @!attribute [rw] settings_store
    #   Sets the store used to retrieve {Hanami::Settings} values.
    #
    #   Defaults to an instance of {Hanami::Settings::EnvStore}.
    #
    #   @return [#fetch]
    #
    #   @see Hanami::Settings
    #   @see Hanami::Settings::EnvStore#fetch
    #
    #   @api public
    #   @since 2.0.0
    setting :settings_store, default: Hanami::Settings::EnvStore.new

    # @!attribute [rw] slices
    #   Sets the slices to load when the app is preared or booted.
    #
    #   Defaults to `nil`, which will load all slices. Set this to an array of slice names to load
    #   only those slices.
    #
    #   This attribute is also populated from the `HANAMI_SLICES` environment variable.
    #
    #   @example
    #     config.slices = ["admin", "search"]
    #
    #   @example
    #     ENV["HANAMI_SLICES"] # => "admin,search"
    #     config.slices # => ["admin", "search"]
    #
    #   @return [Array<String>, nil]
    #
    #   @api public
    #   @since 2.0.0
    setting :slices

    # @!attribute [rw] shared_app_component_keys
    #   Sets the keys for the components to be imported from the app into all other slices.
    #
    #   You should append items to this array, since the default shared components are essential for
    #   slices to operate within the app.
    #
    #   @example
    #     config.shared_app_component_keys += ["shared_component_a", "shared_component_b"]
    #
    #   @return [Array<String>]
    #
    #   @api public
    #   @since 2.0.0
    setting :shared_app_component_keys, default: %w[
      inflector
      logger
      notifications
      rack.monitor
      routes
      settings
    ]

    # @!attribute [rw] no_auto_register_paths
    #   Sets the paths to skip from container auto-registration.
    #
    #   Defaults to `["entities"]`.
    #
    #   @return [Array<String>] array of relative paths
    #
    #   @api public
    #   @since 2.0.0
    setting :no_auto_register_paths, default: %w[entities]

    # @!attribute [rw] base_url
    #   Sets the base URL for app's web server.
    #
    #   This is passed to the {Slice::ClassMethods#router router} and used for generating links.
    #
    #   Defaults to `"http://0.0.0.0:2300"`. String values passed are turned into `URI` instances.
    #
    #   @return [URI]
    #
    #   @see Slice::ClassMethods#router
    #
    #   @api public
    #   @since 2.0.0
    setting :base_url, default: "http://0.0.0.0:2300", constructor: ->(url) { URI(url) }

    # Returns the app or slice's {Hanami::SliceName slice_name}.
    #
    # This is useful for default config values that depend on this name.
    #
    # @return [Hanami::SliceName]
    #
    # @api private
    # @since 2.0.0
    attr_reader :app_name

    # Returns the app's environment.
    #
    # @example
    #   config.env # => :development
    #
    # @return [Symbol]
    #
    # @see #environment
    #
    # @api private
    # @since 2.0.0
    attr_reader :env

    # Returns the app's actions config, or a null config if hanami-controller is not bundled.
    #
    # @example When hanami-controller is bundled
    #   config.actions.default_request_format # => :html
    #
    # @example When hanami-controller is not bundled
    #   config.actions.default_request_format # => NoMethodError
    #
    # @return [Hanami::Config::Actions, Hanami::Config::NullConfig]
    #
    # @api public
    # @since 2.0.0
    attr_reader :actions

    # Returns the app's middleware stack, or nil if hanami-router is not bundled.
    #
    # Use this to configure middleware that should apply to all routes.
    #
    # @example
    #   config.middleware.use :body_parser, :json
    #   config.middleware.use MyCustomMiddleware
    #
    # @return [Hanami::Slice::Routing::Middleware::Stack, nil]
    #
    # @api public
    # @since 2.0.0
    attr_reader :middleware

    # @api private
    # @since 2.0.0
    alias_method :middleware_stack, :middleware

    # Returns the app's router config, or a null config if hanami-router is not bundled.
    #
    # @example When hanami-router is bundled
    #   config.router.resolver # => Hanami::Slice::Routing::Resolver
    #
    # @example When hanami-router is not bundled
    #   config.router.resolver # => NoMethodError
    #
    # @return [Hanami::Config::Router, Hanami::Config::NullConfig]
    #
    # @api public
    # @since 2.0.0
    attr_reader :router

    # Returns the app's views config, or a null config if hanami-view is not bundled.
    #
    # This is NOT RELEASED as of 2.0.0.
    #
    # @api private
    attr_reader :views

    # Returns the app's assets config.
    #
    # This is NOT RELEASED as of 2.0.0.
    #
    # @api private
    attr_reader :assets

    # @api private
    def initialize(app_name:, env:)
      @app_name = app_name
      @env = env

      # Apply default values that are only knowable at initialize-time (vs require-time)
      self.root = Dir.pwd
      load_from_env

      @logger = Config::Logger.new(env: env, app_name: app_name)

      # TODO: Make assets config dependent
      require "hanami/assets/app_config"
      @assets = Hanami::Assets::AppConfig.new

      @actions = load_dependent_config("hanami-controller") {
        require_relative "config/actions"
        Actions.new
      }

      @router = load_dependent_config("hanami-router") {
        require_relative "config/router"
        @middleware = Slice::Routing::Middleware::Stack.new
        Router.new(self)
      }

      @views = load_dependent_config("hanami-view") {
        require_relative "config/views"
        Views.new
      }

      yield self if block_given?
    end

    # @api private
    def initialize_copy(source)
      super

      @app_name = app_name.dup

      @assets = source.assets.dup
      @actions = source.actions.dup
      @middleware = source.middleware.dup
      @router = source.router.dup.tap do |router|
        router.instance_variable_set(:@base_config, self)
      end
      @views = source.views.dup
    end
    private :initialize_copy

    # Finalizes the config.
    #
    # This is called when the app or slice is prepared. After this, no further changes to config can
    # be made.
    #
    # @api private
    def finalize!
      # Finalize nested configs
      assets.finalize!
      actions.finalize!
      views.finalize!
      logger.finalize!
      router.finalize!

      use_body_parser_middleware

      super
    end

    # Configures the app's custom inflections.
    #
    # You should call this one time only. Subsequent calls will override previously configured
    # inflections.
    #
    # @example
    #   config.inflections do |inflections|
    #     inflections.acronym "WNBA"
    #   end
    #
    # @see https://dry-rb.org/gems/dry-inflector
    #
    # @return [Dry::Inflector] the configured inflector
    #
    # @api public
    # @since 2.0.0
    def inflections(&block)
      self.inflector = Dry::Inflector.new(&block)
    end

    # Disabling this to permit distinct documentation for `#logger` vs `#logger=`
    #
    # rubocop:disable Style/TrivialAccessors

    # Returns the logger config.
    #
    # Use this to configure various options for the default `Dry::Logger::Dispatcher` logger instance.
    #
    # @example
    #   config.logger.level = :debug
    #
    # @return [Hanami::Config::Logger]
    #
    # @see Hanami::Config::Logger
    #
    # @api public
    # @since 2.0.0
    def logger
      @logger
    end

    # Sets the app's logger instance.
    #
    # This entirely replaces the default `Dry::Logger::Dispatcher` instance that would have been
    #
    # @see #logger_instance
    #
    # @api public
    # @since 2.0.0
    def logger=(logger_instance)
      @logger_instance = logger_instance
    end

    # rubocop:enable Style/TrivialAccessors

    # Returns the configured logger instance.
    #
    # Unless you've replaced the logger with {#logger=}, this returns a `Dry::Logger::Dispatcher` configured
    # with the options configured through {#logger}.
    #
    # This configured logger is registered in all app and slice containers as `"logger"`. For
    # typical usage, you should access the logger via this component, not directly from config.
    #
    # @example Accessing the logger component
    #   Hanami.app["logger"] # => #<Dry::Logger::Dispatcher>
    #
    # @example Injecting the logger as a dependency
    #   module MyApp
    #     class MyClass
    #       include Deps["logger"]
    #
    #       def my_method
    #         logger.info("hello")
    #       end
    #     end
    #   end
    #
    # @return [Dry::Logger::Dispatcher]
    #
    # @see #logger
    # @see Hanami::Config::Logger
    #
    # @api public
    # @since 2.0.0
    def logger_instance
      @logger_instance || logger.instance
    end

    private

    def load_from_env
      self.slices = ENV["HANAMI_SLICES"]&.split(",")&.map(&:strip)
    end

    SUPPORTED_MIDDLEWARE_PARSERS = %i[json].freeze
    private_constant :SUPPORTED_MIDDLEWARE_PARSERS

    def use_body_parser_middleware
      return unless Hanami.bundled?("hanami-controller")

      return if actions.formats.empty?
      return if middleware.stack["/"].map(&:first).any? { |klass| klass == "Hanami::Middleware::BodyParser" }

      parsers = SUPPORTED_MIDDLEWARE_PARSERS & actions.formats.values
      return if parsers.empty?

      middleware.use(
        :body_parser,
        [parsers.to_h { |parser_format|
          [parser_format, actions.formats.mime_types_for(parser_format)]
        }]
      )
    end

    def load_dependent_config(gem_name)
      if Hanami.bundled?(gem_name)
        yield
      else
        require_relative "config/null_config"
        NullConfig.new
      end
    end

    def method_missing(name, *args, &block)
      if config.respond_to?(name)
        config.public_send(name, *args, &block)
      else
        super
      end
    end

    def respond_to_missing?(name, _incude_all = false)
      config.respond_to?(name) || super
    end
  end
end


text:
define([
  'gui/GuiTR',
  'editor/Remesh',
  'render/shaders/ShaderBase'
], function (TR, Remesh, ShaderBase) {

  'use strict';

  var GuiScene = function (guiParent, ctrlGui) {
    this._main = ctrlGui._main; // main application
    this._hideMeshes = [];
    this._cbToggleShowHide = this.toggleShowHide.bind(this, true);
    this.init(guiParent);
  };

  GuiScene.prototype = {
    /** Initialize */
    init: function (guiParent) {
      var menu = guiParent.addMenu(TR('sceneTitle'));

      // scene
      menu.addButton(TR('sceneReset'), this._main, 'clearScene' /*, 'CTRL+ALT+N'*/ );
      menu.addButton(TR('sceneAddSphere'), this._main, 'addSphere');
      menu.addButton(TR('sceneAddCube'), this._main, 'addCube');

      // selection stuffs
      menu.addTitle(TR('sceneSelection'));
      menu.addCheckbox(TR('contourShow'), this._main._showContour, this.onShowContour.bind(this));
      this._ctrlIsolate = menu.addCheckbox(TR('renderingIsolate'), false, this.showHide.bind(this));
      this._ctrlIsolate.setVisibility(false);
      this._ctrlMerge = menu.addButton(TR('sceneMerge'), this, 'merge');
      this._ctrlMerge.setVisibility(false);

      // extra
      menu.addTitle(TR('renderingExtra'));
      menu.addCheckbox(TR('renderingGrid'), this._main._showGrid, this.onShowGrid.bind(this));
      menu.addCheckbox(TR('renderingSymmetryLine'), ShaderBase.showSymmetryLine, this.onShowSymmetryLine.bind(this));

      this.addEvents();
    },
    updateMesh: function () {
      var nbMeshes = this._main.getMeshes().length;
      var nbSelected = this._main.getSelectedMeshes().length;
      this._ctrlIsolate.setVisibility(nbMeshes !== nbSelected && nbSelected >= 1);
      this._ctrlMerge.setVisibility(nbSelected > 1);
    },
    merge: function () {
      var main = this._main;
      var selMeshes = main.getSelectedMeshes();
      if (selMeshes.length < 2) return;

      var newMesh = Remesh.mergeMeshes(selMeshes, main.getMesh() || selMeshes[0]);
      main.removeMeshes(selMeshes);
      main.getStates().pushStateAddRemove(newMesh, selMeshes.slice());
      main.getMeshes().push(newMesh);
      main.setMesh(newMesh);
    },
    addEvents: function () {
      var cbKeyDown = this.onKeyDown.bind(this);
      window.addEventListener('keydown', cbKeyDown, false);
      this.removeCallback = function () {
        window.removeEventListener('keydown', cbKeyDown, false);
      };
    },
    removeEvents: function () {
      if (this.removeCallback) this.removeCallback();
    },
    onKeyDown: function (event) {
      if (event.handled === true)
        return;
      event.stopPropagation();
      if (!this._main._focusGui)
        event.preventDefault();
      var key = event.which;
      if (key === 73) { // I
        this.toggleShowHide();
        event.handled = true;
      }
    },
    toggleShowHide: function (ignoreCB) {
      this._ctrlIsolate.setValue(!this._ctrlIsolate.getValue(), !!ignoreCB);
    },
    showHide: function (bool) {
      if (bool) this.isolate();
      else this.showAll();
    },
    isolate: function () {
      var main = this._main;
      var selMeshes = main.getSelectedMeshes();
      var meshes = main.getMeshes();
      if (meshes.length === selMeshes.length || meshes.length < 2) {
        this._ctrlIsolate.setValue(false, true);
        return;
      }

      var hMeshes = this._hideMeshes;
      hMeshes.length = 0;
      for (var i = 0; i < meshes.length; ++i) {
        var id = main.getIndexSelectMesh(meshes[i]);
        if (id < 0) {
          hMeshes.push(meshes[i]);
          meshes.splice(i--, 1);
        }
      }

      main.getStates().pushStateRemove(hMeshes.slice());
      main.getStates().pushStateCustom(this._cbToggleShowHide, this._cbToggleShowHide, true);
    },
    showAll: function () {
      var main = this._main;
      var meshes = main.getMeshes();
      var hMeshes = this._hideMeshes;
      for (var i = 0, nbAdd = hMeshes.length; i < nbAdd; ++i) {
        meshes.push(hMeshes[i]);
      }
      main.getStates().pushStateAdd(hMeshes.slice());
      main.getStates().pushStateCustom(this._cbToggleShowHide, this._cbToggleShowHide, true);
      hMeshes.length = 0;
    },
    onShowSymmetryLine: function (val) {
      ShaderBase.showSymmetryLine = val;
      this._main.render();
    },
    onShowGrid: function (bool) {
      var main = this._main;
      main._showGrid = bool;
      main.render();
    },
    onShowContour: function (bool) {
      var main = this._main;
      main._showContour = bool;
      main.render();
    }
  };

  return GuiScene;
});


text:
import numpy as np
import mdtraj

from pyemma.coordinates.util import patches
from pyemma.coordinates.data.interface import ReaderInterface
from pyemma.coordinates.data.featurizer import MDFeaturizer
from pyemma import config

__author__ = 'noe, marscher'
__all__ = ['FeatureReader']

class FeatureReader(ReaderInterface):

    """
    Reads features from MD data.

    To select a feature, access the :attr:`featurizer` and call a feature
    selecting method (e.g) distances.

    Parameters
    ----------
    trajectories: list of strings
        paths to trajectory files

    topologyfile: string
        path to topology file (e.g. pdb)

    Examples
    --------

    Iterator access:

    >>> reader = FeatureReader('mytraj.xtc', 'my_structure.pdb') # doctest: +SKIP
    >>> chunks = [] # doctest: +SKIP
    >>> for itraj, X in reader: # doctest: +SKIP
    ...     chunks.append(X) # doctest: +SKIP

    """

    def __init__(self, trajectories, topologyfile=None, chunksize=100, featurizer=None):
        assert (topologyfile is not None) or (featurizer is not None), \
            "Needs either a topology file or a featurizer for instantiation"

        super(FeatureReader, self).__init__(chunksize=chunksize)

        # files
        if isinstance(trajectories, basestring):
            trajectories = [trajectories]
        self.trajfiles = trajectories
        self.topfile = topologyfile

        # featurizer
        if topologyfile and featurizer:
            self._logger.warning("Both a topology file and a featurizer were given as arguments. "
                                 "Only featurizer gets respected in this case.")
        if not featurizer:
            self.featurizer = MDFeaturizer(topologyfile)
        else:
            self.featurizer = featurizer
            self.topfile = featurizer.topologyfile

        # Check that the topology and the files in the filelist can actually work together
        self._assert_toptraj_consistency()

        # iteration
        self._mditer = None
        # current lag time
        self._curr_lag = 0
        # time lagged iterator
        self._mditer2 = None

        self.__set_dimensions_and_lenghts()
        self._parametrized = True

    def __set_dimensions_and_lenghts(self):
        self._ntraj = len(self.trajfiles)
        # lookups pre-computed lengths, or compute it on the fly and store it in db.
        if config['use_trajectory_lengths_cache'] == 'True':
            from pyemma.coordinates.data.traj_info_cache import TrajectoryInfoCache
            for traj in self.trajfiles:
                self._lengths.append(TrajectoryInfoCache[traj])
        else:
            for traj in self.trajfiles:
                with mdtraj.open(traj, mode='r') as fh:
                    self._lengths.append(len(fh))

        # number of trajectories/data sets
        if self._ntraj == 0:
            raise ValueError("no valid data")

        # note: dimension is a custom impl in this class

    def describe(self):
        """
        Returns a description of this transformer

        :return:
        """
        return ["Feature reader with following features"] + self.featurizer.describe()

    def dimension(self):
        """
        Returns the number of output dimensions

        :return:
        """
        if len(self.featurizer.active_features) == 0:
            # special case: Cartesian coordinates
            return self.featurizer.topology.n_atoms * 3
        else:
            # general case
            return self.featurizer.dimension()

    def _create_iter(self, filename, skip=0, stride=1):
        return patches.iterload(filename, chunk=self.chunksize,
                                top=self.topfile, skip=skip, stride=stride)

    def _close(self):
        try:
            if self._mditer:
                self._mditer.close()
            if self._mditer2:
                self._mditer2.close()
        except:
            self._logger.exception("something went wrong closing file handles")

    def _reset(self, stride=1):
        """
        resets the chunk reader
        """
        self._itraj = 0
        self._curr_lag = 0
        if len(self.trajfiles) >= 1:
            self._t = 0
            self._mditer = self._create_iter(self.trajfiles[0], stride=stride)

    def _next_chunk(self, lag=0, stride=1):
        """
        gets the next chunk. If lag > 0, we open another iterator with same chunk
        size and advance it by one, as soon as this method is called with a lag > 0.

        :return: a feature mapped vector X, or (X, Y) if lag > 0
        """
        chunk = self._mditer.next()
        shape = chunk.xyz.shape

        if lag > 0:
            if self._curr_lag == 0:
                # lag time or trajectory index changed, so open lagged iterator
                if __debug__:
                    self._logger.debug("open time lagged iterator for traj %i with lag %i"
                                       % (self._itraj, lag))
                self._curr_lag = lag
                self._mditer2 = self._create_iter(self.trajfiles[self._itraj],
                                                  skip=self._curr_lag,
                                                  stride=stride)
            try:
                adv_chunk = self._mditer2.next()
            except StopIteration:
                # When _mditer2 ran over the trajectory end, return empty chunks.
                adv_chunk = mdtraj.Trajectory(np.empty((0, shape[1], shape[2]), np.float32), chunk.topology)
            except RuntimeError as e:
                if "seek error" in str(e):
                    raise RuntimeError("Trajectory %s too short for lag time %i" %
                                       (self.trajfiles[self._itraj], lag))

        self._t += shape[0]

        if (self._t >= self.trajectory_length(self._itraj, stride=stride) and
                self._itraj < len(self.trajfiles) - 1):
            if __debug__:
                self._logger.debug('closing current trajectory "%s"'
                                   % self.trajfiles[self._itraj])
            self._close()

            self._t = 0
            self._itraj += 1
            self._mditer = self._create_iter(self.trajfiles[self._itraj], stride=stride)
            # we open self._mditer2 only if requested due lag parameter!
            self._curr_lag = 0

        if (self._t >= self.trajectory_length(self._itraj, stride=stride) and
                self._itraj == len(self.trajfiles) - 1):
            if __debug__:
                self._logger.debug('closing last trajectory "%s"'
                                   % self.trajfiles[self._itraj])
            self._mditer.close()
            if self._curr_lag != 0:
                self._mditer2.close()

        # map data
        if lag == 0:
            if len(self.featurizer.active_features) == 0:
                shape_2d = (shape[0], shape[1] * shape[2])
                return chunk.xyz.reshape(shape_2d)
            else:
                return self.featurizer.map(chunk)
        else:
            if len(self.featurizer.active_features) == 0:
                shape_Y = adv_chunk.xyz.shape

                X = chunk.xyz.reshape((shape[0], shape[1] * shape[2]))
                Y = adv_chunk.xyz.reshape((shape_Y[0], shape_Y[1] * shape_Y[2]))
            else:
                X = self.featurizer.map(chunk)
                Y = self.featurizer.map(adv_chunk)
            return X, Y

    def parametrize(self, stride=1):
        if self.in_memory:
            self._map_to_memory(stride)

    def _assert_toptraj_consistency(self):
        r""" Check if the topology and the trajfiles of the reader have the same n_atoms"""
        with mdtraj.open(self.trajfiles[0],'r') as fh:
            xyz, __, __, __ = fh.read(n_frames=1)
        assert xyz.shape[1] == self.featurizer.topology.n_atoms, "Mismatch in the number of atoms between the topology" \
                                                                " and the first trajectory file, %u vs %u"% \
                                                                (self.featurizer.topology.n_atoms, xyz.shape[1])


text:
<!DOCTYPE html>
<meta charset="utf-8">
<head>

    <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js" charset="utf-8"></script>
    <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
    <link rel="stylesheet" href="/disasters.css" type="text/css" />

</head>
<body>

</body>
<script src="/app.js" charset="utf-8"></script>


text:
from django.db import connection
from django.conf import settings
from django.db import models
try:
    from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
except ImportError:
    from django.contrib.contenttypes.generic import GenericForeignKey, GenericRelation
from django.contrib import contenttypes
from django.core.cache import cache

from denorm.fields import SumField
from denorm import denormalized, depend_on_related, CountField, CacheKeyField, cached

settings.DENORM_MODEL = 'test_app.RealDenormModel'

class FailingTriggersModelA(models.Model):
    order = models.SmallIntegerField(default=0)  # Fails for SQLite
    SomeWeirdName = models.CharField(max_length=255)  # Fails for PostgreSQL

class FailingTriggersModelB(models.Model):
    a = models.ForeignKey(FailingTriggersModelA)

    @denormalized(models.TextField)
    @depend_on_related(FailingTriggersModelA)
    def SomeWeirdName(self):
        return self.a.SomeWeirdName

class CachedModelA(models.Model):
    b = models.ForeignKey('CachedModelB')

    @cached(cache)
    @depend_on_related('CachedModelB')
    def cached_data(self):
        return {
            'upper': self.b.data.upper(),
            'lower': self.b.data.lower(),
        }

class CachedModelB(models.Model):
    data = models.CharField(max_length=255)

class AbstractDenormModel(models.Model):
    # Skip feature test main model.
    text = models.TextField()

    @denormalized(models.TextField)
    def ham(self):
        return u"Ham and %s" % self.text

    class Meta:
        abstract = True
        app_label = 'test_app'

class DenormModel(AbstractDenormModel):
    @denormalized(models.TextField)
    def spam(self):
        return u"Spam and %s" % self.text

    class Meta(AbstractDenormModel.Meta):
        swappable = 'DENORM_MODEL'

class RealDenormModel(AbstractDenormModel):
    @denormalized(models.TextField)
    def eggs(self):
        return u"Eggs and %s" % self.text

    class Meta(AbstractDenormModel.Meta):
        pass

class Tag(models.Model):
    name = models.CharField(max_length=255)

    content_type = models.ForeignKey(contenttypes.models.ContentType)
    object_id = models.PositiveIntegerField()
    content_object = GenericForeignKey('content_type', 'object_id')

class TaggedModel(models.Model):
    tags = GenericRelation(Tag)

    @denormalized(models.TextField)
    @depend_on_related(Tag)
    def tags_string(self):
        return ', '.join(sorted([t.name for t in self.tags.all()]))

    class Meta:
        abstract = True

class Forum(TaggedModel):
    title = models.CharField(max_length=255)

    # Simple count() aggregate
    post_count = CountField('post_set')

    cachekey = CacheKeyField()
    cachekey.depend_on_related('Post')

    @denormalized(models.CharField, max_length=255)
    @depend_on_related('Post')
    def author_names(self):
        return ', '.join((m.author_name for m in self.post_set.all()))

    @denormalized(models.ManyToManyField, 'Member', blank=True)
    @depend_on_related('Post')
    def authors(self):
        return [m.author for m in self.post_set.all() if m.author]

    # let's say this forums supports subforums, sub-subforums and so forth
    # so we can test depend_on_related('self') (for tree structures).
    parent_forum = models.ForeignKey('self', blank=True, null=True)

    @denormalized(models.TextField)
    @depend_on_related('self', type='forward')
    def path(self):
        if self.parent_forum:
            return self.parent_forum.path + self.title + '/'
        else:
            return '/' + self.title + '/'

class Post(TaggedModel):
    forum = models.ForeignKey(Forum, blank=True, null=True)
    author = models.ForeignKey('Member', blank=True, null=True)
    response_to = models.ForeignKey('self', blank=True, null=True, related_name='responses')
    title = models.CharField(max_length=255, blank=True)

    # Brings down the forum title
    @denormalized(models.CharField, max_length=255)
    @depend_on_related(Forum)
    def forum_title(self):
        return self.forum.title

    @denormalized(models.CharField, max_length=255)
    @depend_on_related('Member', foreign_key="author")
    def author_name(self):
        if self.author:
            return self.author.name
        else:
            return ''

    @denormalized(models.PositiveIntegerField)
    @depend_on_related('self', type='backward')
    def response_count(self):
        # Work around odd issue during testing with PostgresDB
        if not self.pk:
            return 0
        rcount = self.responses.count()
        rcount += sum((x.response_count for x in self.responses.all()))
        return rcount

class Attachment(models.Model):
    forum_as_object = False

    post = models.ForeignKey(Post, blank=True, null=True)

    cachekey = CacheKeyField()
    cachekey.depend_on_related('Post')

    @denormalized(models.ForeignKey, Forum, blank=True, null=True)
    @depend_on_related(Post)
    def forum(self):
        if self.post and self.post.forum:
            if self.forum_as_object:
                # if forum_as_object is set, return forum denorm as an object
                return self.post.forum
            else:
                # otherwise, return as a primary key
                return self.post.forum.pk
        return None

class Member(models.Model):
    first_name = models.CharField(max_length=255)
    name = models.CharField(max_length=255)
    bookmarks = models.ManyToManyField('Post', blank=True)

    cachekey = CacheKeyField()
    cachekey.depend_on_related('Post', foreign_key='bookmarks')

    @denormalized(models.CharField, max_length=255)
    def full_name(self):
        return u"%s %s" % (self.first_name, self.name)

    @denormalized(models.TextField, null=True, blank=True)
    @depend_on_related('Post', foreign_key="bookmarks")
    def bookmark_titles(self):
        if self.id:
            return '\n'.join([p.title for p in self.bookmarks.all()])

class SkipPost(models.Model):
    # Skip feature test main model.
    text = models.TextField()

class SkipComment(models.Model):
    post = models.ForeignKey(SkipPost)
    text = models.TextField()
    created_on = models.DateTimeField(auto_now_add=True)
    updated_on = models.DateTimeField(auto_now=True, null=True, blank=True)

    class Meta:
        abstract = True

class SkipCommentWithoutSkip(SkipComment):
    # Skip feature test model without a skip parameter on an updatable field.
    # he updatable field will not be skipped.
    @denormalized(models.TextField)
    @depend_on_related(SkipPost)
    def post_text(self):
        return self.post.text

class SkipCommentWithSkip(SkipComment):
    # Skip feature test model with a skip parameter on an updatable field.
    @denormalized(models.TextField, skip=('updated_on',))
    @depend_on_related(SkipPost)
    def post_text(self):
        return self.post.text

class SkipCommentWithAttributeSkip(SkipComment):
    @denormalized(models.TextField)
    @depend_on_related(SkipPost)
    def post_text(self):
        return self.post.text

    denorm_always_skip = ('updated_on',)

if connection.vendor != "sqlite":
    class FilterSumModel(models.Model):
        # Simple count() aggregate
        active_item_sum = SumField('counts', field='active_item_count', filter={'age__gte': 18})

    class FilterSumItem(models.Model):
        parent = models.ForeignKey(FilterSumModel, related_name='counts')
        age = models.IntegerField(default=18)
        active_item_count = models.PositiveIntegerField(default=False)

    class FilterCountModel(models.Model):
        # Simple count() aggregate
        active_item_count = CountField('items', filter={'active__exact': True}, exclude={'text': ''})

    class FilterCountItem(models.Model):
        parent = models.ForeignKey(FilterCountModel, related_name='items')
        active = models.BooleanField(default=False)
        text = models.CharField(max_length=10, default='')


text:
function [start, len] = truncateTailsOfRange(startIn, lenIn)
% TRUNCATETAILSOFRANGE Will remove a fractional portion of ends of a range
%
% With a given range of start and length, the PORTION will be removed from
% the beginning and the end

    PORTION = 0.15;

    start = startIn + round(lenIn * PORTION);
    len = round(lenIn * (1.0 - PORTION)) + startIn - start;
end


text:
require 'tzinfo/timezone_definition'

module TZInfo
  module Definitions
    module Etc
      module GMT__m__1
        include TimezoneDefinition

        timezone 'Etc/GMT-1' do |tz|
          tz.offset :o0, 3600, 0, :'GMT-1'

        end
      end
    end
  end
end


text:
docker build -t yodemo:latest demo7-share
docker images | grep yodemo

# Run container
docker run --rm -it yodemo:latest

# Save image
docker save yodemo:latest > demo7-share/yodemo.tar

# Delete image
docker rmi yodemo:latest
docker images | grep yodemo

# Load image
docker load -i demo7-share/yodemo.tar
docker images | grep yodemo

# Run container
docker run --rm -it yodemo:latest


text:
module Rack
  class Taint
    class Railtie < Rails::Railtie
      initializer 'rack.taint.configure_rails_initialization' do |app|
        app.middleware.insert_before(Rack::Runtime, Rack::Taint)
      end
    end
  end
end


text:
class PropsClient
: public org::freedesktop::DBus::PropsGSDemo_proxy,
  public DBus::IntrospectableProxy,
  public DBus::PropertiesProxy,
  public DBus::ObjectProxy
{
public:

	PropsClient(DBus::Connection &connection, const char *path, const char *name);

	void MessageChanged(const std::string& message);

	void DataChanged(const double& data);
};

#endif//__DEMO_PROPS_SERVER_H


text:
export interface ProgressCallback {
	(progress:any):any;
}

// --- Generic promise
export declare class TPromise<V> {

	constructor(init:(complete: (value:V)=>void, error:(err:any)=>void, progress:ProgressCallback)=>void, oncancel?: any);

    // removing this method fixes the error squiggle.....
	public then<U>(success?: (value:V)=>TPromise<U>, error?: (err:any)=>TPromise<U>, progress?:ProgressCallback): TPromise<U>;
}

//// [exportedInterfaceInaccessibleInCallbackInModule.js]
define(["require", "exports"], function (require, exports) {
    "use strict";
    exports.__esModule = true;
});


text:
package io.opentracing.contrib.jdbi;

import io.opentracing.Span;
import io.opentracing.Tracer;
import org.skife.jdbi.v2.SQLStatement;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.TimingCollector;

/**
 * OpenTracingCollector is a JDBI TimingCollector that creates OpenTracing Spans for each JDBI SQLStatement.
 *
 *
Example usage:
 *
{@code
 * io.opentracing.Tracer tracer = ...;
 * DBI dbi = ...;
 *
 * // One time only: bind OpenTracing to the DBI instance as a TimingCollector.
 * dbi.setTimingCollector(new OpenTracingCollector(tracer));
 *
 * // Elsewhere, anywhere a `Handle` is available:
 * Handle handle = ...;
 * Span parentSpan = ...;  // optional
 *
 * // Create statements as usual with your `handle` instance.
 *  Query<Map<String, Object>> statement = handle.createQuery("SELECT COUNT(*) FROM accounts");
 *
 * // If a parent Span is available, establish the relationship via setParent.
 * OpenTracingCollector.setParent(statement, parent);
 *
 * // Use JDBI as per usual, and Spans will be created for every SQLStatement automatically.
 * List<Map<String, Object>> results = statement.list();
 * }

 */
@SuppressWarnings("WeakerAccess")
public class OpenTracingCollector implements TimingCollector {
    public final static String PARENT_SPAN_ATTRIBUTE_KEY = "io.opentracing.parent";

    private final Tracer tracer;
    private final SpanDecorator spanDecorator;
    private final ActiveSpanSource activeSpanSource;
    private final TimingCollector next;

    public OpenTracingCollector(Tracer tracer) {
        this(tracer, SpanDecorator.DEFAULT);
    }

    /**
     * @param tracer the OpenTracing tracer to trace JDBI calls.
     * @param next a timing collector to "chain" to. When collect is called on
     *             this TimingCollector, collect will also be called on 'next'
     */
    @SuppressWarnings("unused")
    public OpenTracingCollector(Tracer tracer, TimingCollector next) {
        this(tracer, SpanDecorator.DEFAULT, null, null);
    }

    public OpenTracingCollector(Tracer tracer, SpanDecorator spanDecorator) {
        this(tracer, spanDecorator, null);
    }

    public OpenTracingCollector(Tracer tracer, ActiveSpanSource spanSource) {
        this(tracer, SpanDecorator.DEFAULT, spanSource);
    }

    public OpenTracingCollector(Tracer tracer, SpanDecorator spanDecorator, ActiveSpanSource activeSpanSource) {
        this(tracer, spanDecorator, activeSpanSource, null);
    }

    /**
     * @param tracer the OpenTracing tracer to trace JDBI calls.
     * @param spanDecorator the SpanDecorator used to name and decorate spans.
     *                      @see SpanDecorator
     * @param activeSpanSource a source that can provide the currently active
     *                         span when creating a child span.
     *                         @see ActiveSpanSource
     * @param next a timing collector to "chain" to. When collect is called on
     *             this TimingCollector, collect will also be called on 'next'
     */
    public OpenTracingCollector(Tracer tracer, SpanDecorator spanDecorator, ActiveSpanSource activeSpanSource, TimingCollector next) {
        this.tracer = tracer;
        this.spanDecorator = spanDecorator;
        this.activeSpanSource = activeSpanSource;
        this.next = next;
    }

    public void collect(long elapsedNanos, StatementContext statementContext) {
        long nowMicros = System.currentTimeMillis() * 1000;
        Tracer.SpanBuilder builder = tracer
                .buildSpan(spanDecorator.generateOperationName(statementContext))
                .withStartTimestamp(nowMicros - (elapsedNanos / 1000));
        Span parent = (Span)statementContext.getAttribute(PARENT_SPAN_ATTRIBUTE_KEY);
        if (parent == null && this.activeSpanSource != null) {
            parent = this.activeSpanSource.activeSpan(statementContext);
        }
        if (parent != null) {
            builder = builder.asChildOf(parent);
        }
        Span collectSpan = builder.start();
        spanDecorator.decorateSpan(collectSpan, elapsedNanos, statementContext);
        try {
            collectSpan.log("SQL query finished", statementContext.getRawSql());
        } finally {
            collectSpan.finish(nowMicros);
        }

        if (next != null) {
            next.collect(elapsedNanos, statementContext);
        }
    }

    /**
     * Establish an explicit parent relationship for the (child) Span associated with a SQLStatement.
     *
     * @param statement the JDBI SQLStatement which will act as the child of `parent`
     * @param parent the parent Span for `statement`
     */
    public static void setParent(SQLStatement<?> statement, Span parent) {
        statement.getContext().setAttribute(PARENT_SPAN_ATTRIBUTE_KEY, parent);
    }

    /**
     * SpanDecorator allows the OpenTracingCollector user to control the precise naming and decoration of OpenTracing
     * Spans emitted by the collector.
     *
     * @see OpenTracingCollector#OpenTracingCollector(Tracer, SpanDecorator)
     */
    public interface SpanDecorator {
        SpanDecorator DEFAULT = new SpanDecorator() {
            public String generateOperationName(StatementContext ctx) {
                return "DBI Statement";
            }

            @Override
            public void decorateSpan(Span jdbiSpan, long elapsedNanos, StatementContext ctx) {
                // (by default, do nothing)
            }
        };

        /**
         * Transform an DBI StatementContext into an OpenTracing Span operation name.
         *
         * @param ctx the StatementContext passed to TimingCollector.collect()
         * @return an operation name suitable for the associated OpenTracing Span
         */
        String generateOperationName(StatementContext ctx);

        /**
         * Decorate the given span with additional tags or logs. Implementations may or may not need to refer
         * to the StatementContext.
         *
         * @param jdbiSpan the JDBI Span to decorate (before `finish` is called)
         * @param elapsedNanos the elapsedNanos passed to TimingCollector.collect()
         * @param ctx the StatementContext passed to TimingCollector.collect()
         */
        void decorateSpan(Span jdbiSpan, long elapsedNanos, StatementContext ctx);
    }

    /**
     * An abstract API that allows the OpenTracingCollector to customize how parent Spans are discovered.
     *
     * For instance, if Spans are stored in a thread-local variable, an ActiveSpanSource could access them like so:
     *
Example usage:
     *
{@code
     * public class SomeClass {
     *     // Thread local variable containing each thread's ID
     *     private static final ThreadLocal activeSpan =
     *         new ThreadLocal() {
     *             protected Integer initialValue() {
     *                 return null;
     *             }
     *         };
     * };
     *
     * ... elsewhere ...
     * ActiveSpanSource spanSource = new ActiveSpanSource() {
     *     public Span activeSpan(StatementContext ctx) {
     *         // (In this example we ignore `ctx` entirely)
     *         return activeSpan.get();
     *     }
     * };
     * OpenTracingCollector otColl = new OpenTracingCollector(tracer, spanSource);
     * ...
     * }

     */
    public interface ActiveSpanSource {
        /**
         * Get the active Span (to use as a parent for any DBI Spans). Implementations may or may not need to refer
         * to the StatementContext.
         *
         * @param ctx the StatementContext that needs to be collected and traced
         * @return the currently active Span (for this thread, etc), or null if no such Span could be found.
         */
        Span activeSpan(StatementContext ctx);
    }
}


text:
#pragma once
#include <aws/appmesh/AppMesh_EXPORTS.h>
#include <aws/appmesh/AppMeshRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Http
{
    class URI;
} //namespace Http
namespace AppMesh
{
namespace Model
{

  /**
   */
  class AWS_APPMESH_API DescribeVirtualGatewayRequest : public AppMeshRequest
  {
  public:
    DescribeVirtualGatewayRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "DescribeVirtualGateway"; }

    Aws::String SerializePayload() const override;

    void AddQueryStringParameters(Aws::Http::URI& uri) const override;

    /**
     *
The name of the service mesh that the gateway route resides in.

     */
    inline const Aws::String& GetMeshName() const{ return m_meshName; }

    /**
     *
The name of the service mesh that the gateway route resides in.

     */
    inline bool MeshNameHasBeenSet() const { return m_meshNameHasBeenSet; }

    /**
     *
The name of the service mesh that the gateway route resides in.

     */
    inline void SetMeshName(const Aws::String& value) { m_meshNameHasBeenSet = true; m_meshName = value; }

    /**
     *
The name of the service mesh that the gateway route resides in.

     */
    inline void SetMeshName(Aws::String&& value) { m_meshNameHasBeenSet = true; m_meshName = std::move(value); }

    /**
     *
The name of the service mesh that the gateway route resides in.

     */
    inline void SetMeshName(const char* value) { m_meshNameHasBeenSet = true; m_meshName.assign(value); }

    /**
     *
The name of the service mesh that the gateway route resides in.

     */
    inline DescribeVirtualGatewayRequest& WithMeshName(const Aws::String& value) { SetMeshName(value); return *this;}

    /**
     *
The name of the service mesh that the gateway route resides in.

     */
    inline DescribeVirtualGatewayRequest& WithMeshName(Aws::String&& value) { SetMeshName(std::move(value)); return *this;}

    /**
     *
The name of the service mesh that the gateway route resides in.

     */
    inline DescribeVirtualGatewayRequest& WithMeshName(const char* value) { SetMeshName(value); return *this;}

    /**
     *
The AWS IAM account ID of the service mesh owner. If the account ID is not
     * your own, then it's the ID of the account that shared the mesh with your
     * account. For more information about mesh sharing, see Working
     * with shared meshes.

     */
    inline const Aws::String& GetMeshOwner() const{ return m_meshOwner; }

    /**
     *
The AWS IAM account ID of the service mesh owner. If the account ID is not
     * your own, then it's the ID of the account that shared the mesh with your
     * account. For more information about mesh sharing, see Working
     * with shared meshes.

     */
    inline bool MeshOwnerHasBeenSet() const { return m_meshOwnerHasBeenSet; }

    /**
     *
The AWS IAM account ID of the service mesh owner. If the account ID is not
     * your own, then it's the ID of the account that shared the mesh with your
     * account. For more information about mesh sharing, see Working
     * with shared meshes.

     */
    inline void SetMeshOwner(const Aws::String& value) { m_meshOwnerHasBeenSet = true; m_meshOwner = value; }

    /**
     *
The AWS IAM account ID of the service mesh owner. If the account ID is not
     * your own, then it's the ID of the account that shared the mesh with your
     * account. For more information about mesh sharing, see Working
     * with shared meshes.

     */
    inline void SetMeshOwner(Aws::String&& value) { m_meshOwnerHasBeenSet = true; m_meshOwner = std::move(value); }

    /**
     *
The AWS IAM account ID of the service mesh owner. If the account ID is not
     * your own, then it's the ID of the account that shared the mesh with your
     * account. For more information about mesh sharing, see Working
     * with shared meshes.

     */
    inline void SetMeshOwner(const char* value) { m_meshOwnerHasBeenSet = true; m_meshOwner.assign(value); }

    /**
     *
The AWS IAM account ID of the service mesh owner. If the account ID is not
     * your own, then it's the ID of the account that shared the mesh with your
     * account. For more information about mesh sharing, see Working
     * with shared meshes.

     */
    inline DescribeVirtualGatewayRequest& WithMeshOwner(const Aws::String& value) { SetMeshOwner(value); return *this;}

    /**
     *
The AWS IAM account ID of the service mesh owner. If the account ID is not
     * your own, then it's the ID of the account that shared the mesh with your
     * account. For more information about mesh sharing, see Working
     * with shared meshes.

     */
    inline DescribeVirtualGatewayRequest& WithMeshOwner(Aws::String&& value) { SetMeshOwner(std::move(value)); return *this;}

    /**
     *
The AWS IAM account ID of the service mesh owner. If the account ID is not
     * your own, then it's the ID of the account that shared the mesh with your
     * account. For more information about mesh sharing, see Working
     * with shared meshes.

     */
    inline DescribeVirtualGatewayRequest& WithMeshOwner(const char* value) { SetMeshOwner(value); return *this;}

    /**
     *
The name of the virtual gateway to describe.

     */
    inline const Aws::String& GetVirtualGatewayName() const{ return m_virtualGatewayName; }

    /**
     *
The name of the virtual gateway to describe.

     */
    inline bool VirtualGatewayNameHasBeenSet() const { return m_virtualGatewayNameHasBeenSet; }

    /**
     *
The name of the virtual gateway to describe.

     */
    inline void SetVirtualGatewayName(const Aws::String& value) { m_virtualGatewayNameHasBeenSet = true; m_virtualGatewayName = value; }

    /**
     *
The name of the virtual gateway to describe.

     */
    inline void SetVirtualGatewayName(Aws::String&& value) { m_virtualGatewayNameHasBeenSet = true; m_virtualGatewayName = std::move(value); }

    /**
     *
The name of the virtual gateway to describe.

     */
    inline void SetVirtualGatewayName(const char* value) { m_virtualGatewayNameHasBeenSet = true; m_virtualGatewayName.assign(value); }

    /**
     *
The name of the virtual gateway to describe.

     */
    inline DescribeVirtualGatewayRequest& WithVirtualGatewayName(const Aws::String& value) { SetVirtualGatewayName(value); return *this;}

    /**
     *
The name of the virtual gateway to describe.

     */
    inline DescribeVirtualGatewayRequest& WithVirtualGatewayName(Aws::String&& value) { SetVirtualGatewayName(std::move(value)); return *this;}

    /**
     *
The name of the virtual gateway to describe.

     */
    inline DescribeVirtualGatewayRequest& WithVirtualGatewayName(const char* value) { SetVirtualGatewayName(value); return *this;}

  private:

    Aws::String m_meshName;
    bool m_meshNameHasBeenSet;

    Aws::String m_meshOwner;
    bool m_meshOwnerHasBeenSet;

    Aws::String m_virtualGatewayName;
    bool m_virtualGatewayNameHasBeenSet;
  };

} // namespace Model
} // namespace AppMesh
} // namespace Aws


text:
package org.apache.camel.component.test;

import java.net.URI;
import java.util.HashMap;
import java.util.Map;

import org.apache.camel.Endpoint;
import org.apache.camel.impl.UriEndpointComponent;
import org.apache.camel.util.CamelContextHelper;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.UnsafeUriCharactersEncoder;

/**
 * Test Component.
 *
 * @version
 */
public class TestComponent extends UriEndpointComponent {

    public TestComponent() {
        super(TestEndpoint.class);
    }

    public Endpoint createEndpoint(String uri) throws Exception {
        // lets not use the normal parameter handling so that all parameters are sent to the nested endpoint

        ObjectHelper.notNull(getCamelContext(), "camelContext");
        URI u = new URI(UnsafeUriCharactersEncoder.encode(uri));
        String path = u.getSchemeSpecificPart();
        if (path.startsWith("//")) {
            path = path.substring(2);
        }

        return createEndpoint(uri, path, new HashMap<String, Object>());
    }

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        Long timeout = getAndRemoveParameter(parameters, "timeout", Long.class);
        Endpoint endpoint = CamelContextHelper.getMandatoryEndpoint(getCamelContext(), remaining);

        TestEndpoint answer = new TestEndpoint(uri, this, endpoint);
        if (timeout != null) {
            answer.setTimeout(timeout);
        }
        return answer;
    }

}


text:
PSSHRQ23 ;WOIFO/AV,TS,SG - Parses out drugsNotChecked and DrugDoseCheck XML ;09/20/07
 ;;1.0;PHARMACY DATA MANAGEMENT;**136**;9/30/97;Build 89
 ;
 ; @authors - Alex Vazquez, Tim Sabat, Steve Gordon
 ; @date    - September 19, 2007
 ; @version - 1.0
 ;
 QUIT
 ;;
DRGNTCK(DOCHAND,NODE,BASE) ;
 ; @DESC Handles the drugsNotChecked section
 ;
 ; @DOCHAND Handle to XML document
 ; @NODE Node associated with XML element
 ; @BASE Base of output global
 ;
 ; @RETURNS Nothing
 ;
 NEW HASH
 ;
 ; Read error into hash variable
 DO NOTREAD(DOCHAND,NODE,.HASH)
 ;
 ; Write hashed variable to output global
 DO NOTWRITE(.HASH,BASE)
 ;
 QUIT
 ;;
NOTREAD(DOCHAND,NODE,HASH) ;
 ; @DESC Handles reading drugsNotChecked section of the XML document
 ;
 ; @DOCHAND Handle to XML document
 ; @NODE Node associated with drugsNotChecked XML element
 ; @HASH ByRef, Hash used to store response
 ;
 ; @RETURNS Variables in hash
 ;
 NEW PSS
 ;
 SET PSS("child")=0
 SET PSS("count")=0
 ;
 FOR  SET PSS("child")=$$CHILD^MXMLDOM(DOCHAND,NODE,PSS("child")) QUIT:PSS("child")<1  DO
 . SET HASH(PSS("count"),"reason")=$$VALUE^MXMLDOM(DOCHAND,PSS("child"),"status")
 . SET HASH(PSS("count"),"reasonCode")=""
 . SET HASH(PSS("count"),"reasonText")=""
 . SET HASH(PSS("count"),"reasonSource")="PEPS" ; Always PEPS if returned from XML
 . ; Get drug element of drugNotChecked
 . ; No need to iterate over drug subelements because only 1 possible
 . DO PARSEDRG^PSSHRCOM(DOCHAND,$$CHILD^MXMLDOM(DOCHAND,PSS("child")),.HASH,PSS("count"))
 . SET PSS("count")=PSS("count")+1
 . QUIT
 QUIT
 ;;
NOTWRITE(HASH,BASE) ;
 ; @DESC Handles writing drugsNotChecked section of the XML document and
 ; and drugs pulled by validation logic as uncheckable (i.e. no gcn).
 ;
 ; @HASH ByRef, Hash used to store response
 ; @BASE Base of output global
 ;
 ; @RETURNS Nothing. Stores values in output global.
 ;
 NEW I,DATASTR,MESSAGE,PSS,PSSHASH
 S PSSHASH("Base")=BASE  ;FOR NEXTEX CALL
 S I=""
 F  S I=$O(HASH(I)) Q:I=""  D
 .S PSS("PharmOrderNo")=HASH(I,"orderNumber")  ;for nextex call below
 .S MESSAGE=$$GCNREASN^PSSHRVL1(HASH(I,"ien"),HASH(I,"drugName"),HASH(I,"orderNumber"),1)
 .Q:+$P(MESSAGE,U,3)=1
 .S REASON=$P(MESSAGE,U,2),MESSAGE=$P(MESSAGE,U)
 .S DATASTR=HASH(I,"gcn")_U_HASH(I,"vuid")_U_HASH(I,"ien")_U_HASH(I,"drugName")_U_HASH(I,"cprsOrderNumber")
 .S DATASTR=DATASTR_U_HASH(I,"package")_U_MESSAGE_U_U_HASH(I,"reasonSource")_U_REASON
 .S ^TMP($J,BASE,"OUT","EXCEPTIONS",HASH(I,"orderNumber"),$$NEXTEX^PSSHRVL1(.PSS,.PSSHASH))=DATASTR
 Q
 ;
WRTNODE(I,SUB,HASH) ;
 ;sets up the error node for a message
 ;inputs:
 ;  I-Counter for the hash array
 ;  SUB-subscript--either drugdrug, therapy or dose
 ;  HASH-array containing the information for the global
 ;outputs: ^TMP error global
 ;
 N NODECNT,NODE
 ;
 SET NODE="^TMP($JOB,BASE,""OUT"",SUB,""ERROR"",HASH(I,""orderNumber""))"
 ;gets next error number
 S NODECNT=$O(@NODE@(":"),-1)+1
 SET NODE="^TMP($JOB,BASE,""OUT"",SUB,""ERROR"",HASH(I,""orderNumber""),NODECNT)"
 ;I $G(HASH(I,"severity"))="Information" Q   ;If severity="information" don't save
 SET @NODE@(0)=HASH(I,"drugName")_"^"_HASH(I,"ien")_"^"_HASH(I,"cprsOrderNumber")_"^"_HASH(I,"package")
 SET @NODE@("SEV")=$G(HASH(I,"severity"))
 SET @NODE@("TYPE")=$G(HASH(I,"type"))
 ;SET @NODE@("NAME")=HASH(I,"drugName")
 SET @NODE@("TEXT")=HASH(I,"text")
 ;Message node to display to user
 S @NODE@("MSG")=HASH(I,"msg")
 QUIT
 ;
NEXTCNT(BASE,ORDR) ;
 ; @DESC Returns the next counter for the exceptions output global
 ;
 ; @ORDR Order number being counted on
 ;
 ; @RETURNS The next counter for the exceptions output global
 ;
 NEW I
 ;
 SET I=0
 SET I=$ORDER(^TMP($JOB,BASE,"OUT","EXCEPTIONS",ORDR,I),-1)
 SET I=I+1
 QUIT I
 ;;
DRGDOSE(DOCHAND,NODE,BASE) ;
 ; @DESC Handles the drugDoseChecks element
 ;
 ; @DOCHAND Handle to XML document
 ; @NODE Node associated with XML element
 ; @BASE name to use for return global
 ;
 ; @RETURNS Nothing
 ;
 NEW PSS,MSGHASH,DOSEHASH,PSMSGCNT
 ;
 SET PSS("child")=0
 SET PSS("doseCount")=0
 SET PSMSGCNT=0
 ;
 FOR  SET PSS("child")=$$CHILD^MXMLDOM(DOCHAND,NODE,PSS("child")) QUIT:PSS("child")<1  DO
 . SET PSS("childName")=$$NAME^MXMLDOM(DOCHAND,PSS("child"))
 . ;
 . ; Delegate to appropriate function
 . ; xml can have message at the drugDoseChecks level and at the drugDoseCheck level.
 . SET:PSS("childName")="message" PSMSGCNT=PSMSGCNT+1
 . DO:PSS("childName")="message" MSGREAD(DOCHAND,PSS("child"),.MSGHASH,PSMSGCNT)
 . ;
 . SET:PSS("childName")="drugDoseCheck" PSS("doseCount")=PSS("doseCount")+1
 . DO:PSS("childName")="drugDoseCheck" DOSEREAD(DOCHAND,PSS("child"),.DOSEHASH,PSS("doseCount"),.MSGHASH,PSMSGCNT,BASE)
 . ;
 . QUIT
 ; Write to globals  .MSGHASH AND DOSEHASH ARE SET IN DOSEREAD
 DO MSGWRITE^PSSHRQ21(.MSGHASH,BASE,"DOSE")
 DO DOSEWRIT(.DOSEHASH,BASE)
 ;
 QUIT
 ;;
MSGREAD(DOCHAND,NODE,HASH,COUNT) ;
 ; @DESC Handles parsing message section
 ;
 ; @DOCHAND Handle to XML document
 ; @NODE Node associated with XML element
 ; @COUNT Count of message sections
 ; @HASH Where to store info
 ;
 ; @RETURNS Nothing
 ;
 ; Parse the message and store in hash
 DO PARSEMSG^PSSHRCOM(DOCHAND,NODE,.HASH,COUNT)
 ;
 QUIT
 ;
DOSEREAD(DOCHAND,NODE,HASH,COUNT,MSGHASH,MSGCNT,BASE) ;
 ;
 ; @DESC Reads in the drugDoseCheck XML element
 ;
 ; @DOCHAND Handle to XML document
 ; @NODE Node associated with XML element
 ; @BASE Name for return array
 ; @MSGHASH-array of messages about drug
 ; @MSGCNT-a counter on the messages (they can occur at the drugDosechecks or drugDoseCheck level)
 ; @RETURNS Nothing, values stored in hash
 ;
 NEW PSS
 S PSS("messageCount")=MSGCNT
 ;
 ; need drugname and drugien for return node, get them first
 SET PSS("child")=0
 FOR  SET PSS("child")=$$CHILD^MXMLDOM(DOCHAND,NODE,PSS("child")) QUIT:PSS("child")<1  DO
 . SET PSS("childName")=$$NAME^MXMLDOM(DOCHAND,PSS("child"))
 . ;
 . ;
 . I PSS("childName")="message" D  Q
 . .S PSS("messageCount")=PSS("messageCount")+1
 . .D MSGREAD(DOCHAND,PSS("child"),.MSGHASH,PSS("messageCount"))
 . ;
 . DO:PSS("childName")="drug"
 . . DO PARSEDRG^PSSHRCOM(DOCHAND,PSS("child"),.HASH,COUNT)
 . . QUIT
 . DO:PSS("childName")="singleDoseStatus"
 . . SET HASH(COUNT,"singleDoseStatus")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 .  DO:PSS("childName")="singleDoseStatusCode"
 . . SET HASH(COUNT,"singleDoseStatusCode")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="singleDoseMessage"
 . . SET HASH(COUNT,"singleDoseMessage")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . ;Need both message and code (5) for the "unable to check" condition"
 . . I HASH(COUNT,"singleDoseStatusCode")=5 D MSG(.HASH,COUNT,"S")
 . . QUIT
 . DO:PSS("childName")="singleDoseMax"
 . . SET HASH(COUNT,"singleDoseMax")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="rangeDoseStatus"
 . . SET HASH(COUNT,"rangeDoseStatus")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="rangeDoseStatusCode"
 . . SET HASH(COUNT,"rangeDoseStatusCode")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="rangeDoseMessage"
 . . SET HASH(COUNT,"rangeDoseMessage")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . ;Need both message and code (5) for the "unable to check" condition"
 . . I HASH(COUNT,"rangeDoseStatusCode")=5,HASH(COUNT,"chemoInjectable")="false" D MSG(.HASH,COUNT,"R")
 . . QUIT
 . DO:PSS("childName")="rangeDoseLow"
 . . SET HASH(COUNT,"rangeDoseLow")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="rangeDoseHigh"
 . . SET HASH(COUNT,"rangeDoseHigh")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="doseHigh"
 . . SET HASH(COUNT,"doseHigh")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="doseHighUnit"
 . . SET HASH(COUNT,"doseHighUnit")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="doseLow"
 . . SET HASH(COUNT,"doseLow")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="doseLowUnit"
 . . SET HASH(COUNT,"doseLowUnit")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="doseRouteDescription"
 . . SET HASH(COUNT,"doseRouteDescription")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="doseFormHigh"
 . . SET HASH(COUNT,"doseFormHigh")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="doseFormHighUnit"
 . . SET HASH(COUNT,"doseFormHighUnit")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="doseFormLow"
 . . SET HASH(COUNT,"doseFormLow")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="doseFormLowUnit"
 . . SET HASH(COUNT,"doseFormLowUnit")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="chemoInjectable"
 . . SET HASH(COUNT,"chemoInjectable")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 .
 . DO:PSS("childName")="dailyDoseStatus"
 . . SET HASH(COUNT,"dailyDoseStatus")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 .  DO:PSS("childName")="dailyDoseStatusCode"
 . . SET HASH(COUNT,"dailyDoseStatusCode")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="dailyDoseMessage"
 . . SET HASH(COUNT,"dailyDoseMessage")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . ;Need both message and code (5) for the "unable to check" condition"
 . . I HASH(COUNT,"dailyDoseStatusCode")=5,HASH(COUNT,"chemoInjectable")="true" D MSG(.HASH,COUNT,"D")
 . . QUIT
 .
 . DO:PSS("childName")="maxDailyDoseStatus"
 . . SET HASH(COUNT,"maxDailyDoseStatus")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 .  DO:PSS("childName")="maxDailyDoseStatusCode"
 . . SET HASH(COUNT,"maxDailyDoseStatusCode")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 . DO:PSS("childName")="maxDailyDoseMessage"
 . . SET HASH(COUNT,"maxDailyDoseMessage")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . ;Need both message and code (5) for the "unable to check" condition"
 . . ;I HASH(COUNT,"maxDailyDoseStatusCode")=5 D MSG(.HASH,COUNT,"M")
 . . QUIT
 .
 . DO:PSS("childName")="maxLifetimeDose"
 . . SET HASH(COUNT,"maxLifetimeDose")=$$GETTEXT^PSSHRCOM(DOCHAND,PSS("child"))
 . . QUIT
 .
 . QUIT
 ;
 QUIT
 ;;
MSG(HASH,COUNT,TYPE) ;
 ;INPUTS:
 ;  HASH-array of data
 ;  COUNT-Current subscript of the HASH array
 ;  TYPE-Either "R" for Daily dose Range or "S" for maximum single dose
 ;
 ;returns: ^TMP error global
 N MSG,REASON
 S MSG=$$DOSEMSG^PSSHRVL1(HASH(COUNT,"drugName"),TYPE)
 D
 .I TYPE="R" D  Q
 ..S REASON=$G(HASH(COUNT,"rangeDoseMessage"))
 .I TYPE="S" D  Q
 ..S REASON=$G(HASH(COUNT,"singleDoseMessage"))
 .I TYPE="D" D  Q
 ..S REASON=$G(HASH(COUNT,"dailyDoseMessage"))
 .I TYPE="M" D  Q
 ..S REASON=$G(HASH(COUNT,"maxDailyDoseMessage"))
 S HASH(COUNT,"msg")=MSG
 S HASH(COUNT,"text")=REASON
 D WRTNODE(COUNT,"DOSE",.HASH)
 Q
 ;
DOSEWRIT(HASH,BASE) ;
 ; @DESC Handles writing the drug dose output global
 ;
 ; @HASH Variable containing drug dose values
 ; @BASE Base of output global
 ;
 ; @RETURNS Nothing
 ;
 NEW I,NODE,QT,IEN
 ;get dose form flag
 ;
 SET QT=""""
 SET I=""
 FOR  SET I=$ORDER(HASH(I)) QUIT:I=""!('I)  DO
 . SET NODE="^TMP($JOB,BASE,""OUT"",""DOSE"",HASH(I,""orderNumber""),HASH(I,""drugName""))"
 . SET IEN=HASH(I,"ien")
 . ;
 . ; Single values
 . I $$CHKVAL(.HASH,I,"singleDoseStatus") SET @NODE@("SINGLE","STATUS",IEN)=HASH(I,"singleDoseStatus")
 . I $$CHKVAL(.HASH,I,"singleDoseStatusCode") SET @NODE@("SINGLE","STATUSCODE",IEN)=HASH(I,"singleDoseStatusCode")
 . I $$CHKVAL(.HASH,I,"singleDoseMessage") SET @NODE@("SINGLE","MESSAGE",IEN)=HASH(I,"singleDoseMessage")
 . I $$CHKVAL(.HASH,I,"singleDoseMax") SET @NODE@("SINGLE","MAX",IEN)=HASH(I,"singleDoseMax")
 . ; Range values
 . I $$CHKVAL(.HASH,I,"rangeDoseLow") SET @NODE@("RANGE","LOW",IEN)=HASH(I,"rangeDoseLow")
 . I $$CHKVAL(.HASH,I,"rangeDoseHigh") SET @NODE@("RANGE","HIGH",IEN)=HASH(I,"rangeDoseHigh")
 . I $$CHKVAL(.HASH,I,"rangeDoseStatus") SET @NODE@("RANGE","STATUS",IEN)=HASH(I,"rangeDoseStatus")
 . I $$CHKVAL(.HASH,I,"rangeDoseStatusCode") SET @NODE@("RANGE","STATUSCODE",IEN)=HASH(I,"rangeDoseStatusCode")
 . I $$CHKVAL(.HASH,I,"rangeDoseMessage") SET @NODE@("RANGE","MESSAGE",IEN)=HASH(I,"rangeDoseMessage")
 . ;set general dose form data
 . I $$CHKVAL(.HASH,I,"doseFormHigh") SET @NODE@("GENERAL","DOSEFORMHIGH",IEN)=HASH(I,"doseFormHigh")
 . I $$CHKVAL(.HASH,I,"doseFormHighUnit") SET @NODE@("GENERAL","DOSEFORMHIGHUNIT",IEN)=HASH(I,"doseFormHighUnit")
 . I $$CHKVAL(.HASH,I,"doseFormLow") SET @NODE@("GENERAL","DOSEFORMLOW",IEN)=HASH(I,"doseFormLow")
 . I $$CHKVAL(.HASH,I,"doseFormLowUnit") SET @NODE@("GENERAL","DOSEFORMLOWUNIT",IEN)=HASH(I,"doseFormLowUnit")
 . ; General subscript values
 . SET @NODE@("GENERAL","DOSEHIGH",IEN)=HASH(I,"doseHigh")
 . SET @NODE@("GENERAL","DOSEHIGHUNIT",IEN)=HASH(I,"doseHighUnit")
 . SET @NODE@("GENERAL","DOSELOW",IEN)=HASH(I,"doseLow")
 . SET @NODE@("GENERAL","DOSELOWUNIT",IEN)=HASH(I,"doseLowUnit")
 . SET @NODE@("GENERAL","DOSEROUTEDESCRIPTION",IEN)=HASH(I,"doseRouteDescription")
 . SET @NODE@("GENERAL","MESSAGE",IEN)=$$BUILDMSG(I,.HASH)
 . ; "CHEMO" value, if any
 . I $$CHKVAL(.HASH,I,"chemoInjectable") SET @NODE@("CHEMO")=HASH(I,"chemoInjectable")
 . ; Daily values
 . I $$CHKVAL(.HASH,I,"dailyDoseStatus") SET @NODE@("DAILY","STATUS",IEN)=HASH(I,"dailyDoseStatus")
 . I $$CHKVAL(.HASH,I,"dailyDoseStatusCode") SET @NODE@("DAILY","STATUSCODE",IEN)=HASH(I,"dailyDoseStatusCode")
 . I $$CHKVAL(.HASH,I,"dailyDoseMessage") SET @NODE@("DAILY","MESSAGE",IEN)=HASH(I,"dailyDoseMessage")
 . ; Max Daily values
 . I $$CHKVAL(.HASH,I,"maxDailyDoseStatus") SET @NODE@("DAILYMAX","STATUS",IEN)=HASH(I,"maxDailyDoseStatus")
 . I $$CHKVAL(.HASH,I,"maxDailyDoseStatusCode") SET @NODE@("DAILYMAX","STATUSCODE",IEN)=HASH(I,"maxDailyDoseStatusCode")
 . I $$CHKVAL(.HASH,I,"maxDailyDoseMessage") SET @NODE@("DAILYMAX","MESSAGE",IEN)=HASH(I,"maxDailyDoseMessage")
 . ; general maximum life  time dose
 . I $$CHKVAL(.HASH,I,"maxLifetimeDose") SET @NODE@("GENERAL","MAXLIFETIMEDOSE",IEN)=HASH(I,"maxLifetimeDose")
 . QUIT
 ;
 QUIT
 ;;
CHKVAL(HASH,I,SUB) ;
 ;INPUTS: HASH array (by ref)
 ;        I-Index of current array
 ;        SUB-subscript
 ;Returns: If node has value
 ;
 Q $L($G(HASH(I,SUB)))
 ;
BUILDMSG(COUNT,HASH) ;
 ; @DESC Builds the drug dose message value from values in HASH
 ;
 ; @COUNT Counter used to access values in hash
 ; @HASH Variable containing drug dose values
 ;
 ; @RETURNS Message in format:
 ; General dosing range for '[DRUG NAME]' [ROUTE DESCRIPTION]:
 ; [DOSELOW] [DOSELOWUNIT] to [DOSEHIGH] [DOSEHIGHUNIT].
 ; The low and High values can be from either the standard or from the doseForm information
 ;
 ;
 NEW MSG,DOSEFORM
 ;
 ;get doseform flag--whether to use the doseform or other dosing information
 S DOSEFORM=$P(^TMP($J,BASE,"IN","DOSE",HASH(COUNT,"orderNumber")),U,14)
 SET MSG="General dosing range for "
 SET MSG=MSG_HASH(COUNT,"drugName")
 SET MSG=MSG_$S($G(HASH(COUNT,"doseRouteDescription"))'="":" ("_HASH(COUNT,"doseRouteDescription")_"):",1:":")
 I 'DOSEFORM D
 .SET MSG=MSG_" "_$$FORMATNM(HASH(COUNT,"doseLow"))
 .SET MSG=MSG_" "_HASH(COUNT,"doseLowUnit")
 .SET MSG=MSG_" to"
 .SET MSG=MSG_" "_$$FORMATNM(HASH(COUNT,"doseHigh"))
 .SET MSG=MSG_" "_HASH(COUNT,"doseHighUnit")
 ;
 I DOSEFORM D
 .SET MSG=MSG_" "_$$FORMATNM(HASH(COUNT,"doseFormLow"))
 .SET MSG=MSG_" "_HASH(COUNT,"doseFormLowUnit")
 .SET MSG=MSG_" to"
 .SET MSG=MSG_" "_$$FORMATNM(HASH(COUNT,"doseFormHigh"))
 .SET MSG=MSG_" "_HASH(COUNT,"doseFormHighUnit")
 QUIT MSG
 ;;
FORMATNM(NUM) ;
 ; @DESC Formats the number into a valid value. Removes trailing
 ; zeroes if decimal place is equal to 0.
 ;
 ; @NUM Number to be formatted
 ;
 ; @RETURNS A formatted number.
 ;
 NEW DECIMAL,FORMATED
 S NUM=$TR(NUM,",","")
 S FORMATED=$FN(+NUM,"+")
 S:+FORMATED>=0 FORMATED=$E(FORMATED,2,999)   ; remove the + sign
 Q FORMATED
 ;;


text:
class AppListControllerDelegate;
class Profile;

namespace extensions {
class ContextMenuMatcher;
}

namespace app_list {

class AppContextMenuDelegate;

class AppContextMenu : public ui::SimpleMenuModel::Delegate {
 public:
  AppContextMenu(AppContextMenuDelegate* delegate,
                 Profile* profile,
                 const std::string& app_id,
                 AppListControllerDelegate* controller);
  ~AppContextMenu() override;

  // Note this could return NULL if corresponding extension is gone.
  ui::MenuModel* GetMenuModel();

  void set_is_platform_app(bool is_platform_app) {
    is_platform_app_ = is_platform_app;
  }
  void set_is_search_result(bool is_search_result) {
    is_search_result_ = is_search_result;
  }
  void set_is_in_folder(bool is_in_folder) {
    is_in_folder_ = is_in_folder;
  }

 private:
  // ui::SimpleMenuModel::Delegate overrides:
  bool IsItemForCommandIdDynamic(int command_id) const override;
  base::string16 GetLabelForCommandId(int command_id) const override;
  bool IsCommandIdChecked(int command_id) const override;
  bool IsCommandIdEnabled(int command_id) const override;
  bool GetAcceleratorForCommandId(int command_id,
                                  ui::Accelerator* accelerator) override;
  void ExecuteCommand(int command_id, int event_flags) override;

  AppContextMenuDelegate* delegate_;
  Profile* profile_;
  const std::string app_id_;
  AppListControllerDelegate* controller_;
  bool is_platform_app_;
  bool is_search_result_;
  bool is_in_folder_;

  scoped_ptr<ui::SimpleMenuModel> menu_model_;
  scoped_ptr<extensions::ContextMenuMatcher> extension_menu_items_;

  DISALLOW_COPY_AND_ASSIGN(AppContextMenu);
};

}  // namespace app_list

#endif  // CHROME_BROWSER_UI_APP_LIST_APP_CONTEXT_MENU_H_


text:
OBJDIR=/usr/bin

all: install

install:
	test -d $(OBJDIR) || mkdir -p $(OBJDIR)
	install -o root -g root ./kdecclist $(OBJDIR)/kdecclist
	install -o root -g root ./kdeccpair $(OBJDIR)/kdeccpair
	install -o root -g root ./kdeccunpair $(OBJDIR)/kdeccunpair
	install -o root -g root ./kdeccping $(OBJDIR)/kdeccping

uninstall:
	rm -f $(OBJDIR)/kdecclist
	rm -f $(OBJDIR)/kdeccpair
	rm -f $(OBJDIR)/kdeccunpair
	rm -f $(OBJDIR)/kdeccping


text:
package com.auidbook.drawables;

import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;

/**
 * Drawable that handles multiple lines of text.
 *
 * @author Ian G. Clifton
 */
public class BetterTextDrawable extends Drawable {

    private static final int TEXT_COLOR = 0xFF311B92;

    private final TextPaint mPaint = new TextPaint(new Paint(Paint.ANTI_ALIAS_FLAG));
    private final String mText;
    private StaticLayout mStaticLayout;

    public BetterTextDrawable(String text) {
        mText = text;
        mPaint.setColor(TEXT_COLOR);
        mPaint.setTextSize(100);
        mStaticLayout = new StaticLayout(mText, mPaint, (int) mPaint.measureText(mText), Layout.Alignment.ALIGN_NORMAL, 1, 0, false);
    }

    @Override
    public int getIntrinsicHeight() {
        return mStaticLayout.getHeight();
    }

    @Override
    public int getIntrinsicWidth() {
        return mStaticLayout.getWidth();
    }

    @Override
    public void draw(Canvas canvas) {
        mStaticLayout.draw(canvas);
    }

    @Override
    public void setAlpha(int alpha) {
        mPaint.setAlpha(alpha);
        invalidateSelf();
    }

    @Override
    public void setColorFilter(ColorFilter cf) {
        mPaint.setColorFilter(cf);
        invalidateSelf();
    }

    @Override
    public int getOpacity() {
        return PixelFormat.TRANSLUCENT;
    }

    @Override
    protected void onBoundsChange(Rect bounds) {
        mStaticLayout = new StaticLayout(mText, mPaint, bounds.width(), Layout.Alignment.ALIGN_NORMAL, 1, 0, false);
    }
}


text:
require 'rails'

module PulseToolbox
  module Sensor
    # Registeres an initializer which creates sensors and subscribes to
    # process_action.action_controller notification
    class Initializer < ::Rails::Railtie
      initializer "register_request_sensors", after: :load_config_initializers do
        if PulseToolbox.redis
          ActiveSupport::Notifications.subscribe "process_action.action_controller" do |name, start, finish, id, payload|
            total_time = (finish - start) * 1000
            PulseToolbox::Sensor::Manager.log_request(total_time, payload)
          end
        else
          Rails.logger.error("PulseToolbox.redis is not defined. Sensors cannot be created")
        end
      end
    end
  end
end


text:
require "test_helper"

class PolicyGroupTest < ActiveSupport::TestCase
  test "should be invalid without a name" do
    policy_group = build(:policy_group, name: "")
    assert_not policy_group.valid?
  end

  test "should be valid without an email" do
    policy_group = build(:policy_group, email: "")
    assert policy_group.valid?
  end

  test "should be valid without a unique email" do
    existing_policy_group = create(:policy_group)
    new_policy_group = build(:policy_group, email: existing_policy_group.email)
    assert new_policy_group.valid?
  end

  test "should be invalid without a valid email" do
    policy_group = build(:policy_group, email: "invalid-email")
    assert_not policy_group.valid?
  end

  test "should allow a description" do
    policy_group = build(:policy_group, description: "policy-group-description")
    assert_equal "policy-group-description", policy_group.description
  end

  should_not_accept_footnotes_in(:description)

  test "publishes to the publishing API" do
    policy_group = create(:policy_group)
    Whitehall::PublishingApi.expects(:publish).with(policy_group).once
    policy_group.publish_to_publishing_api
  end

  test "#access_limited? returns false" do
    policy_group = FactoryBot.build(:policy_group)
    assert_not policy_group.access_limited?
  end

  test "#access_limited_object returns nil" do
    policy_group = FactoryBot.build(:policy_group)
    assert_nil policy_group.access_limited_object
  end

  test "is always publicly visible" do
    policy_group = FactoryBot.build(:policy_group)
    assert policy_group.publicly_visible?
  end

  test "is never unpublished" do
    policy_group = FactoryBot.build(:policy_group)
    assert_not policy_group.unpublished?
  end

  test "never has unpublished edition" do
    policy_group = FactoryBot.build(:policy_group)
    assert_nil policy_group.unpublished_edition
  end

  test "is always accessible" do
    policy_group = FactoryBot.build(:policy_group)
    assert policy_group.accessible_to?(nil)
  end

  test "populates dependencies when contacts are included in description" do
    contact_1 = FactoryBot.create(:contact)
    contact_2 = FactoryBot.create(:contact)
    policy_group = FactoryBot.create(
      :policy_group,
      description: "Some text with two contacts: [Contact:#{contact_1.id}] [Contact:#{contact_2.id}]",
    )

    assert_equal policy_group.depended_upon_contacts, [contact_1, contact_2]
  end

  test "updates dependencies when contacts are removed from the description" do
    contact_1 = FactoryBot.create(:contact)
    contact_2 = FactoryBot.create(:contact)
    policy_group = FactoryBot.create(
      :policy_group,
      description: "Some text with two contacts: [Contact:#{contact_1.id}] [Contact:#{contact_2.id}]",
    )

    policy_group.update!(description: "Some text with a single contact: [Contact:#{contact_2.id}]")

    assert_equal policy_group.depended_upon_contacts, [contact_2]
  end

  test "updates dependencies when contacts are added to the description" do
    contact_1 = FactoryBot.create(:contact)
    policy_group = FactoryBot.create(
      :policy_group,
      description: "Some text with a single contact: [Contact:#{contact_1.id}]",
    )

    contact_2 = FactoryBot.create(:contact)
    policy_group.update!(description: "Some text with two contacts: [Contact:#{contact_1.id}] [Contact:#{contact_2.id}]")

    assert_equal policy_group.depended_upon_contacts, [contact_1, contact_2]
  end

  test "deletes dependencies when policy group is deleted" do
    contact = FactoryBot.create(:contact)
    policy_group = FactoryBot.create(
      :policy_group,
      description: "Some text with a single contact: [Contact:#{contact.id}]",
    )

    policy_group.destroy!

    assert_empty policy_group.depended_upon_contacts
  end
end


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>Bares & Lugares</title>

	<link rel="shortcut icon" href="/favicon.ico" />

	<link rel="stylesheet" type="text/css" href="../../css/normalize.css">
	<link rel="stylesheet" type="text/css" href="../../css/skeleton.css">

	<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.5.8/slick.css"/>
	<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.5.8/slick-theme.css"/>

	<link rel="stylesheet" type="text/css" href="../../css/main.css">

Home

Restaurantes

Recetas

Contacto

Nosotros

		    <form class="navbar-form" role="search">

				    <input type="text" class="form-control" placeholder="Buscar">

				</form>

			  	Vasitos de turrón y chocolate
			  	Un postre sencillo y elegante
			  	<button>Ver receta</button>

			  	Gadhus
			  	Imaginación sin límites
			  	<button>Ver reportaje</button>

2015 - Made with ♥


text:
std::wstring                            g_audioPath;
std::wstring                            g_beatmapPath;

std::map<std::wstring, std::wstring>    g_songCached;
std::mutex                              g_songMutex;

NamedPipe                               g_namedPipe
;

//
// Proxy Á¤ÀǺÎ. (#define À¸·Î Á¤ÀǵǾîÀÖÀ½.)
//      MAKE_PROXY_DEF(module, function, proxy)
//      HookEngine<decltype(proxy)> proxy__hk = HookEngine<decltype(proxy)>(module, function, proxy)
// EXAMPLE :
//      MAKE_PROXY_DEF(NAME_KERNEL_DLL, "ReadFile", proxyReadFile);
//      ==> HookEngine< decltype(proxyReadFile) > proxyReadFile__hk = HookEngine< decltype(proxy) >(module, function, proxy);
//

MAKE_PROXY_DEF(NAME_KERNEL_DLL, "ReadFile",                 proxyReadFile);
MAKE_PROXY_DEF(NAME_BASS_DLL,   "BASS_ChannelPlay",         proxyBASS_ChannelPlay);
MAKE_PROXY_DEF(NAME_BASS_DLL,   "BASS_ChannelSetPosition",  proxyBASS_ChannelSetPosition);
MAKE_PROXY_DEF(NAME_BASS_DLL,   "BASS_ChannelSetAttribute", proxyBASS_ChannelSetAttribute);
MAKE_PROXY_DEF(NAME_BASS_DLL,   "BASS_ChannelPause",        proxyBASS_ChannelPause);

void Start()
{
    BeginHook();                                // Begin Hooking Method.
    EngineHook(proxyReadFile);                      // ReadFile Hook.
    EngineHook(proxyBASS_ChannelPlay);              // ChannelPlay Hook.
    EngineHook(proxyBASS_ChannelSetPosition);       // ChannelSetPosition Hook.
    EngineHook(proxyBASS_ChannelSetAttribute);      // ChannelSetAttribute Hook.
    EngineHook(proxyBASS_ChannelPause);             // ChannelPause Hook.
    EndHook();                                  // End Hooking Method.

    g_namedPipe.Start(NAME_NAMED_PIPE);
}

void Stop()
{
    BeginHook();                                // Begin Hooking Method.
    EngineUnhook(proxyReadFile);                    // ReadFile Unhook.
    EngineUnhook(proxyBASS_ChannelPlay);            // ChannelPlay Unhook.
    EngineUnhook(proxyBASS_ChannelSetPosition);     // ChannelSetPostion Unhook.
    EngineUnhook(proxyBASS_ChannelSetAttribute);    // ChannelSetAttribute Unhook.
    EngineUnhook(proxyBASS_ChannelPause);           // ChannelPause Unhook.
    EndHook();                                  // End Hooking Method.

    g_namedPipe.Stop();
}

//
// TODO : currentTime°ú tempo°¡ ¹«¾ùÀ» ÀǹÌÇÏ´ÂÁö ¾Ë¼ö ¾ø½À´Ï´Ù.
//        ÁÖ¼®À¸·Î Á¤ÀÇ ºÎŹµå¸³´Ï´Ù.
//
void Notify(double currentTime, float tempo)
{
    wchar_t message[MAX_MESSAGE_LENGTH];

    FILETIME ft;
    GetSystemTimeAsFileTime(&ft);

    // Áö±Ý ¹«¾ùÀ» Ç÷¹ÀÌÇÏ°íÀÖ´ÂÁö proxyReadFile ¿¡¼ ¾ò¾î³½ °ªÀ» Ŭ¶óÀ̾ðÆ®·Î Àü¼ÛÇÕ´Ï´Ù.
    g_songMutex.lock();
    swprintf(message, L"%llx|%s|%lf|%f|%s\n",
        ((long long)ft.dwHighDateTime << 32) + ft.dwLowDateTime,
        g_audioPath.c_str(),
        currentTime,
        tempo,
        g_beatmapPath.c_str());
    g_songMutex.unlock();

    g_namedPipe.PushMessage(std::wstring(message));
}

BOOL WINAPI proxyReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
{
    if (!SelectProxy(proxyReadFile).OriginalFunction(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped))
    {
        return FALSE;
    }

    TCHAR nameTmpFilePath[MAX_PATH];

    DWORD dwTmpFilePathLength = GetFinalPathNameByHandle(hFile, nameTmpFilePath, MAX_PATH, VOLUME_NAME_DOS);
    DWORD dwFilePosition = SetFilePointer(hFile, 0, NULL, FILE_CURRENT) - (*lpNumberOfBytesRead);

    // ¾ÕÀÇ //?/¸¦ Á¦°ÅÇϱâÀ§ÇØ 4ºÎÅÍ ½ÃÀÛÇÔ.
    TCHAR* nameFile = &nameTmpFilePath[4];
    DWORD  dwFilePathLength = dwTmpFilePathLength - 4;

    // Áö±Ý Àд ÆÄÀÏÀÌ ºñÆ®¸Ê ÆÄÀÏÀÌ°í ¾ÕºÎºÐÀ» Àоú´Ù¸é À½¾Ç ÆÄÀÏ °æ·Î ¾ò±â:
    // ÆÄÀÏ À̸§ÀÌ Æ÷ÇÔµÈ Path ³¡ºÎºÐ 4±ÛÀÚ¸¦ ÀÚ¸§. 4±ÛÀÚ¿Í  .osu¸¦ ºñ±³ÇÏ¿© ÀÌ ÆÄÀÏÀÌ osu ÆÄÀÏÀÎÁö È®ÀÎÇÔ
    if (wcsncmp(L".osu", &nameFile[dwFilePathLength - 4], 4) == 0 && dwFilePosition == 0)
    {
        // .osu ÆÄÀÏÀº UTF-8(Multibyte) ÀÎÄÚµù
        // strtokÀº ¼Ò½º¸¦ º¯ÇüÇϹǷΠ¸ÕÀú strdup¸¦ ÀÌ¿ëÇؼ ±ÛÀÚ¸¦ º¹»çÇÔ.
        LPSTR buffer = strdup((const char*)(lpBuffer));

        // for¹®À» ÀÌ¿ëÇؼ ÁÙ¸¶´Ù strtokÀ¸·Î À߶ó³¿.
        for (LPSTR line = strtok(buffer, "\n"); line != NULL; line = strtok(NULL, "\n"))
        {
            // Àß¶ó³½ ÁÙ¿¡ TokenÀÌ ÀÖ´ÂÁö È®ÀÎÇÏ°í ¾Æ´Ò°æ¿ì¿¡´Â continueÇÔ.
            if (strnicmp(line, AUDIO_FILE_INFO_TOKEN, strlen(AUDIO_FILE_INFO_TOKEN)) != 0)
            {
                continue;
            }

            TCHAR nameAudioFile[MAX_PATH];
            mbstowcs(nameAudioFile, &line[strlen(AUDIO_FILE_INFO_TOKEN)], MAX_PATH);
            StrTrimW(nameAudioFile, L" \r");

            TCHAR pathAudioFile[MAX_PATH];
            wcscpy(pathAudioFile, nameFile);

            // pathAudioFile¿¡¼ ÆÄÀϸíÀ» Áö¿ó´Ï´Ù.
            PathRemoveFileSpecW(pathAudioFile);

            // ÆÄÀϸíÀÌ Áö¿öÁø PathÀÎ pathAudioFile¿¡ nameAudioFileºÙ¿©, ¿ÏÀüÇÑ Path¸¦ ¸¸µì´Ï´Ù.
            PathCombineW(pathAudioFile, pathAudioFile, nameAudioFile);

            g_songMutex.lock();
            g_beatmapPath  = (std::wstring(nameFile));
            g_audioPath    = (std::wstring(pathAudioFile));

            if (g_songCached.find(g_audioPath) == g_songCached.end())
            {
                g_songCached.insert(
                    std::pair<std::wstring, std::wstring>(pathAudioFile, nameFile));
            }

            g_songMutex.unlock();

            break;
        }

        // strdup¸¦ ÀÌ¿ëÇØ º¹»çÇÑ ¹®ÀÚ¿ÀÇ ¸Þ¸ð¸®¸¦ ÇØÁ¦½Ãŵ´Ï´Ù.
        free(buffer);
    }
    else
    {
        // BeatmapÀ» ´Ù½Ã ºÒ·¯¿ÀÁö ¾Ê°í Osu³»ºÎÀÇ ¸Þ¸ð¸® Cache¿¡¼ ºÒ·¯¿Ã¶§°¡ Àִµ¥.
        // ±×·²°æ¿ì¿¡´Â AudioÆÄÀϸ¸ ÀÐÀ¸´Ï ±âÁ¸¿¡ µ¿ÀÏÇÑ BeatmapÀÇ AudioÆÄÀÏÀÌ ±âÁ¸¿¡
        // ÀÐÈùÀûÀÌ ÀÖ´ÂÁö È®ÀÎÇÏ°í ÇöÀç ½ÇÇàµÇ°íÀÖ´Â °îÀ» Áö±Ý ÀÐÀº AudioFileÀ¸·Î ¹Ù²Û´Ù.
        g_songMutex.lock();
        auto cachedInfo = g_songCached.find(nameFile);

        if (cachedInfo != g_songCached.end())
        {
            g_audioPath   = cachedInfo->first;
            g_beatmapPath = cachedInfo->second;
        }

        g_songMutex.unlock();
    }
    return TRUE;

}

BOOL WINAPI proxyBASS_ChannelPlay(DWORD handle, BOOL restart)
{
    if (!SelectProxy(proxyBASS_ChannelPlay).OriginalFunction(handle, restart))
    {
        return FALSE;
    }

    BASS_CHANNELINFO info;
    BASS_ChannelGetInfo(handle, &info);

    if (info.ctype & BASS_CTYPE_STREAM)
    {
        double currentTime = BASS_ChannelBytes2Seconds(handle, BASS_ChannelGetPosition(handle, BASS_POS_BYTE));
        float currentTempo = 0;
        BASS_ChannelGetAttribute(handle, BASS_ATTRIB_TEMPO, &currentTempo);

        Notify(currentTime, currentTempo);
    }
    return TRUE;

}

BOOL WINAPI proxyBASS_ChannelSetPosition(DWORD handle, QWORD pos, DWORD mode)
{
    if (!SelectProxy(proxyBASS_ChannelSetPosition).OriginalFunction(handle, pos, mode))
    {
        return FALSE;
    }

    BASS_CHANNELINFO info;
    BASS_ChannelGetInfo(handle, &info);

    if (info.ctype & BASS_CTYPE_STREAM)
    {
        double currentTime = BASS_ChannelBytes2Seconds(handle, pos);
        float currentTempo = 0;
        BASS_ChannelGetAttribute(handle, BASS_ATTRIB_TEMPO, &currentTempo);
        // ÁÖÀÇ!! pos°¡ ÀÏÁ¤ ÀÌÇÏÀÏ ¶§,
        // Àç»ýÇϸé proxyBASS_ChannelPlay´ë½Å ÀÌ ÇÔ¼ö°¡ È£ÃâµÇ°í,
        // BASS_ChannelIsActive °ªÀº BASS_ACTIVE_PAUSEDÀÓ.
        if (BASS_ChannelIsActive(handle) == BASS_ACTIVE_PAUSED)
        {
            currentTempo = -100;
        }

        Notify(currentTime, currentTempo);
    }

    return TRUE;
}

BOOL WINAPI proxyBASS_ChannelSetAttribute(DWORD handle, DWORD attrib, float value)
{
    if (!SelectProxy(proxyBASS_ChannelSetAttribute).OriginalFunction(handle, attrib, value))
    {
        return FALSE;
    }
    BASS_CHANNELINFO info;
    BASS_ChannelGetInfo(handle, &info);

    if ((info.ctype & BASS_CTYPE_STREAM) && attrib == BASS_ATTRIB_TEMPO)
    {
        double currentTime = BASS_ChannelBytes2Seconds(handle, BASS_ChannelGetPosition(handle, BASS_POS_BYTE));

        Notify(currentTime, value);
    }

    return TRUE;
}

BOOL WINAPI proxyBASS_ChannelPause(DWORD handle)
{
    if (!SelectProxy(proxyBASS_ChannelPause).OriginalFunction(handle))
    {
        return FALSE;
    }

    BASS_CHANNELINFO info;
    BASS_ChannelGetInfo(handle, &info);
    if (info.ctype & BASS_CTYPE_STREAM)
    {
        double currentTime = BASS_ChannelBytes2Seconds(handle, BASS_ChannelGetPosition(handle, BASS_POS_BYTE));

        Notify(currentTime, -100);
    }

    return TRUE;
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
    switch (fdwReason)
    {
    case DLL_PROCESS_ATTACH:
        //
        // LoaderLockÀÇ µ¥µå¶ôÀ» ¸·±â À§Çؼ ½º·¹µå·Î È£ÃâÇÑ´Ù.
        //
        CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Start, 0, 0, 0);
        break;
    case DLL_PROCESS_DETACH:
        Stop();
        break;
    }
    return TRUE;
}


text:
layout: none
published: true
title: Ke 16.11. tunnille
tags: rub11-12.2 läksyt
---
**PAKOLLISET:**

Tee digikirjasta opintokortin eka rivi verbitehtävistä.

**PLUSSA:**
Teemavihkon s. 7 alaosan viestit. 1-4 plussapistettä panostuksesta riippuen.

**POISSAOLIJAT:**

Tee s. 28 alaosan tehtävä. Kuuntele ja täytä dialogi kompisar + vänner ja täytä teemavihkon sanastoon puuttuvat. Pyydä seuraavalla tunnilla muistiinpanot.


text:
#ifndef CSFVIDEOCONTROLWRAPPER_H_
#define CSFVIDEOCONTROLWRAPPER_H_

#include "CC_Common.h"
#include "CSFVideoControl.h"

#if __cplusplus

#include <string>
#include <vector>

namespace CSF
{
    typedef void *VideoWindowHandle;

	DECLARE_PTR(VideoControlWrapper);
	class ECC_API VideoControlWrapper : public VideoControl
	{
	public:
		VideoControlWrapper(VideoControl * videoControl){_realVideoControl = videoControl;};

		virtual void setVideoMode( bool enable );

		// window type is platform-specific
		virtual void setPreviewWindow( VideoWindowHandle window, int top, int left, int bottom, int right, RenderScaling style );
		virtual void showPreviewWindow( bool show );

		// device names are in UTF-8 encoding
		virtual std::vector<std::string> getCaptureDevices();

		virtual std::string getCaptureDevice();
		virtual bool setCaptureDevice( const std::string& name );

		virtual void setVideoControl( VideoControl * videoControl ){_realVideoControl = videoControl;};

	private:
		VideoControl * _realVideoControl;
	};

} // namespace

#endif // __cplusplus

#endif /* CSFVIDEOCONTROLWRAPPER_H_ */