text:
"""
homeassistant.components.media_player.squeezebox
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides an interface to the Logitech SqueezeBox API

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.squeezebox/
"""
import logging
import telnetlib
import urllib.parse

from homeassistant.components.media_player import (
    MediaPlayerDevice, SUPPORT_PAUSE, SUPPORT_SEEK, SUPPORT_VOLUME_SET,
    SUPPORT_VOLUME_MUTE, SUPPORT_PREVIOUS_TRACK, SUPPORT_NEXT_TRACK,
    SUPPORT_TURN_ON, SUPPORT_TURN_OFF,
    MEDIA_TYPE_MUSIC, DOMAIN)

from homeassistant.const import (
    CONF_HOST, CONF_USERNAME, CONF_PASSWORD,
    STATE_IDLE, STATE_PLAYING, STATE_PAUSED, STATE_OFF, STATE_UNKNOWN)

_LOGGER = logging.getLogger(__name__)

SUPPORT_SQUEEZEBOX = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | \
    SUPPORT_VOLUME_MUTE | SUPPORT_PREVIOUS_TRACK | SUPPORT_NEXT_TRACK | \
    SUPPORT_SEEK | SUPPORT_TURN_ON | SUPPORT_TURN_OFF

def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up the squeezebox platform. """
    if not config.get(CONF_HOST):
        _LOGGER.error(
            "Missing required configuration items in %s: %s",
            DOMAIN,
            CONF_HOST)
        return False

    lms = LogitechMediaServer(
        config.get(CONF_HOST),
        config.get('port', '9090'),
        config.get(CONF_USERNAME),
        config.get(CONF_PASSWORD))

    if not lms.init_success:
        return False

    add_devices(lms.create_players())

    return True

class LogitechMediaServer(object):
    """ Represents a Logitech media server. """

    def __init__(self, host, port, username, password):
        self.host = host
        self.port = port
        self._username = username
        self._password = password
        self.http_port = self._get_http_port()
        self.init_success = True if self.http_port else False

    def _get_http_port(self):
        """ Get http port from media server, it is used to get cover art. """
        http_port = None
        try:
            http_port = self.query('pref', 'httpport', '?')
            if not http_port:
                _LOGGER.error(
                    "Unable to read data from server %s:%s",
                    self.host,
                    self.port)
                return
            return http_port
        except ConnectionError as ex:
            _LOGGER.error(
                "Failed to connect to server %s:%s - %s",
                self.host,
                self.port,
                ex)
            return

    def create_players(self):
        """ Create a list of SqueezeBoxDevices connected to the LMS. """
        players = []
        count = self.query('player', 'count', '?')
        for index in range(0, int(count)):
            player_id = self.query('player', 'id', str(index), '?')
            player = SqueezeBoxDevice(self, player_id)
            players.append(player)
        return players

    def query(self, *parameters):
        """ Send request and await response from server. """
        telnet = telnetlib.Telnet(self.host, self.port)
        if self._username and self._password:
            telnet.write('login {username} {password}\n'.format(
                username=self._username,
                password=self._password).encode('UTF-8'))
            telnet.read_until(b'\n', timeout=3)
        message = '{}\n'.format(' '.join(parameters))
        telnet.write(message.encode('UTF-8'))
        response = telnet.read_until(b'\n', timeout=3)\
            .decode('UTF-8')\
            .split(' ')[-1]\
            .strip()
        telnet.write(b'exit\n')
        return urllib.parse.unquote(response)

    def get_player_status(self, player):
        """ Get ithe status of a player. """
        #   (title) : Song title
        # Requested Information
        # a (artist): Artist name 'artist'
        # d (duration): Song duration in seconds 'duration'
        # K (artwork_url): URL to remote artwork
        tags = 'adK'
        new_status = {}
        telnet = telnetlib.Telnet(self.host, self.port)
        telnet.write('{player} status - 1 tags:{tags}\n'.format(
            player=player,
            tags=tags
            ).encode('UTF-8'))
        response = telnet.read_until(b'\n', timeout=3)\
            .decode('UTF-8')\
            .split(' ')
        telnet.write(b'exit\n')
        for item in response:
            parts = urllib.parse.unquote(item).partition(':')
            new_status[parts[0]] = parts[2]
        return new_status

# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-public-methods
class SqueezeBoxDevice(MediaPlayerDevice):
    """ Represents a SqueezeBox device. """

    # pylint: disable=too-many-arguments, abstract-method
    def __init__(self, lms, player_id):
        super(SqueezeBoxDevice, self).__init__()
        self._lms = lms
        self._id = player_id
        self._name = self._lms.query(self._id, 'name', '?')
        self._status = self._lms.get_player_status(self._id)

    @property
    def name(self):
        """ Returns the name of the device. """
        return self._name

    @property
    def state(self):
        """ Returns the state of the device. """
        if 'power' in self._status and self._status['power'] == '0':
            return STATE_OFF
        if 'mode' in self._status:
            if self._status['mode'] == 'pause':
                return STATE_PAUSED
            if self._status['mode'] == 'play':
                return STATE_PLAYING
            if self._status['mode'] == 'stop':
                return STATE_IDLE
        return STATE_UNKNOWN

    def update(self):
        """ Retrieve latest state. """
        self._status = self._lms.get_player_status(self._id)

    @property
    def volume_level(self):
        """ Volume level of the media player (0..1). """
        if 'mixer volume' in self._status:
            return int(float(self._status['mixer volume'])) / 100.0

    @property
    def is_volume_muted(self):
        if 'mixer volume' in self._status:
            return self._status['mixer volume'].startswith('-')

    @property
    def media_content_id(self):
        """ Content ID of current playing media. """
        if 'current_title' in self._status:
            return self._status['current_title']

    @property
    def media_content_type(self):
        """ Content type of current playing media. """
        return MEDIA_TYPE_MUSIC

    @property
    def media_duration(self):
        """ Duration of current playing media in seconds. """
        if 'duration' in self._status:
            return int(float(self._status['duration']))

    @property
    def media_image_url(self):
        """ Image url of current playing media. """
        if 'artwork_url' in self._status:
            media_url = self._status['artwork_url']
        elif 'id' in self._status:
            media_url = ('/music/{track_id}/cover.jpg').format(
                track_id=self._status['id'])
        else:
            media_url = ('/music/current/cover.jpg?player={player}').format(
                player=self._id)

        base_url = 'http://{server}:{port}/'.format(
            server=self._lms.host,
            port=self._lms.http_port)

        return urllib.parse.urljoin(base_url, media_url)

    @property
    def media_title(self):
        """ Title of current playing media. """
        if 'artist' in self._status and 'title' in self._status:
            return '{artist} - {title}'.format(
                artist=self._status['artist'],
                title=self._status['title']
                )
        if 'current_title' in self._status:
            return self._status['current_title']

    @property
    def supported_media_commands(self):
        """ Flags of media commands that are supported. """
        return SUPPORT_SQUEEZEBOX

    def turn_off(self):
        """ turn_off media player. """
        self._lms.query(self._id, 'power', '0')
        self.update_ha_state()

    def volume_up(self):
        """ volume_up media player. """
        self._lms.query(self._id, 'mixer', 'volume', '+5')
        self.update_ha_state()

    def volume_down(self):
        """ volume_down media player. """
        self._lms.query(self._id, 'mixer', 'volume', '-5')
        self.update_ha_state()

    def set_volume_level(self, volume):
        """ set volume level, range 0..1. """
        volume_percent = str(int(volume*100))
        self._lms.query(self._id, 'mixer', 'volume', volume_percent)
        self.update_ha_state()

    def mute_volume(self, mute):
        """ mute (true) or unmute (false) media player. """
        mute_numeric = '1' if mute else '0'
        self._lms.query(self._id, 'mixer', 'muting', mute_numeric)
        self.update_ha_state()

    def media_play_pause(self):
        """ media_play_pause media player. """
        self._lms.query(self._id, 'pause')
        self.update_ha_state()

    def media_play(self):
        """ media_play media player. """
        self._lms.query(self._id, 'play')
        self.update_ha_state()

    def media_pause(self):
        """ media_pause media player. """
        self._lms.query(self._id, 'pause', '1')
        self.update_ha_state()

    def media_next_track(self):
        """ Send next track command. """
        self._lms.query(self._id, 'playlist', 'index', '+1')
        self.update_ha_state()

    def media_previous_track(self):
        """ Send next track command. """
        self._lms.query(self._id, 'playlist', 'index', '-1')
        self.update_ha_state()

    def media_seek(self, position):
        """ Send seek command. """
        self._lms.query(self._id, 'time', position)
        self.update_ha_state()

    def turn_on(self):
        """ turn the media player on. """
        self._lms.query(self._id, 'power', '1')
        self.update_ha_state()


text:
usage="Usage: yarn-daemons.sh [--config confdir] [--hosts hostlistfile] [start
|stop] command args..."

# if no args specified, show usage
if [ $# -le 1 ]; then
  echo $usage
  exit 1
fi

bin=`dirname "${BASH_SOURCE-$0}"`
bin=`cd "$bin"; pwd`

DEFAULT_LIBEXEC_DIR="$bin"/../libexec
HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR}
. $HADOOP_LIBEXEC_DIR/yarn-config.sh

exec "$bin/slaves.sh" --config $YARN_CONF_DIR cd "$HADOOP_YARN_HOME" \; "$bin/yarn-daemon.sh" --config $YARN_CONF_DIR "$@"

redpajama_set_name: RedPajamaGithub


text:
var store, env;
var run = Ember.run;

var Person = DS.Model.extend({
  name: DS.attr('string'),
  cars: DS.hasMany('car', { async: false })
});

Person.toString = function() { return "Person"; };

var Car = DS.Model.extend({
  make: DS.attr('string'),
  model: DS.attr('string'),
  person: DS.belongsTo('person', { async: false })
});

Car.toString = function() { return "Car"; };

var manager;

module("integration/record_array_manager", {
  setup: function() {
    env = setupStore({
      adapter: DS.RESTAdapter.extend()
    });
    store = env.store;

    manager = store.recordArrayManager;

    env.registry.register('model:car', Car);
    env.registry.register('model:person', Person);
  }
});

function tap(obj, methodName, callback) {
  var old = obj[methodName];

  var summary = { called: [] };

  obj[methodName] = function() {
    var result = old.apply(obj, arguments);
    if (callback) {
      callback.apply(obj, arguments);
    }
    summary.called.push(arguments);
    return result;
  };

  return summary;
}

test("destroying the store correctly cleans everything up", function() {
  var query = { };
  var person;

  run(function() {
    store.push('car', {
      id: 1,
      make: 'BMC',
      model: 'Mini Cooper',
      person: 1
    });
  });

  run(function() {
    person = store.push('person', {
      id: 1,
      name: 'Tom Dale',
      cars: [1]
    });
  });

  var filterd = manager.createFilteredRecordArray(Person, function() { return true; });
  var filterd2 = manager.createFilteredRecordArray(Person, function() { return true; });
  var all = store.peekAll('person');
  var adapterPopulated = manager.createAdapterPopulatedRecordArray(Person, query);

  var filterdSummary = tap(filterd, 'willDestroy');
  var filterd2Summary = tap(filterd2, 'willDestroy');
  var allSummary = tap(all, 'willDestroy');
  var adapterPopulatedSummary = tap(adapterPopulated, 'willDestroy');

  equal(filterdSummary.called.length, 0);
  equal(filterd2Summary.called.length, 0);
  equal(allSummary.called.length, 0);
  equal(adapterPopulatedSummary.called.length, 0);

  equal(person._internalModel._recordArrays.list.length, 3, 'expected the person to be a member of 3 recordArrays');

  Ember.run(filterd2, filterd2.destroy);
  equal(person._internalModel._recordArrays.list.length, 2, 'expected the person to be a member of 2 recordArrays');
  equal(filterd2Summary.called.length, 1);

  equal(manager.liveRecordArrays.has(all.type), true);
  Ember.run(all, all.destroy);
  equal(person._internalModel._recordArrays.list.length, 1, 'expected the person to be a member of 1 recordArrays');
  equal(allSummary.called.length, 1);
  equal(manager.liveRecordArrays.has(all.type), false);

  Ember.run(manager, manager.destroy);
  equal(person._internalModel._recordArrays.list.length, 0, 'expected the person to be a member of no recordArrays');
  equal(filterdSummary.called.length, 1);
  equal(filterd2Summary.called.length, 1);
  equal(allSummary.called.length, 1);
  equal(adapterPopulatedSummary.called.length, 1);
});

test("Should not filter a store.peekAll() array when a record property is changed", function() {
  var car;

  var populateLiveRecordArray = tap(store.recordArrayManager, 'populateLiveRecordArray');
  var updateFilterRecordArray = tap(store.recordArrayManager, 'updateFilterRecordArray');

  store.peekAll('car');

  run(function() {
    car = store.push('car', {
      id: 1,
      make: 'BMC',
      model: 'Mini Cooper',
      person: 1
    });
  });

  equal(populateLiveRecordArray.called.length, 1);
  equal(updateFilterRecordArray.called.length, 0);

  run(function() {
    car.set('model', 'Mini');
  });

  equal(populateLiveRecordArray.called.length, 1);
  equal(updateFilterRecordArray.called.length, 0);

});


text:
WebInspector.BreakpointManager = function()
{
    this._stickyBreakpoints = {};
    var breakpoints = WebInspector.settings.findSettingForAllProjects("nativeBreakpoints");
    for (var projectId in breakpoints)
        this._stickyBreakpoints[projectId] = this._validateBreakpoints(breakpoints[projectId]);

    this._breakpoints = {};
    this._domBreakpointsRestored = false;

    WebInspector.settings.addEventListener(WebInspector.Settings.Events.ProjectChanged, this._projectChanged, this);
    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);
    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);
}

WebInspector.BreakpointManager.BreakpointTypes = {
    DOM: "DOM",
    EventListener: "EventListener",
    XHR: "XHR"
}

WebInspector.BreakpointManager.Events = {
    DOMBreakpointAdded: "dom-breakpoint-added",
    EventListenerBreakpointAdded: "event-listener-breakpoint-added",
    XHRBreakpointAdded: "xhr-breakpoint-added",
    ProjectChanged: "project-changed"
}

WebInspector.BreakpointManager.prototype = {
    createDOMBreakpoint: function(nodeId, type)
    {
        this._createDOMBreakpoint(nodeId, type, true, false);
    },

    _createDOMBreakpoint: function(nodeId, type, enabled, restored)
    {
        var node = WebInspector.domAgent.nodeForId(nodeId);
        if (!node)
            return;

        var breakpointId = this._createDOMBreakpointId(nodeId, type);
        if (breakpointId in this._breakpoints)
            return;

        var breakpoint = new WebInspector.DOMBreakpoint(node, type);
        this._setBreakpoint(breakpointId, breakpoint, enabled, restored);
        if (enabled && restored)
            breakpoint._enable();

        breakpoint.view = new WebInspector.DOMBreakpointView(this, breakpointId, enabled, node, type);
        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.DOMBreakpointAdded, breakpoint.view);
    },

    createEventListenerBreakpoint: function(eventName)
    {
        this._createEventListenerBreakpoint(eventName, true, false);
    },

    _createEventListenerBreakpoint: function(eventName, enabled, restored)
    {
        var breakpointId = this._createEventListenerBreakpointId(eventName);
        if (breakpointId in this._breakpoints)
            return;

        var breakpoint = new WebInspector.EventListenerBreakpoint(eventName);
        this._setBreakpoint(breakpointId, breakpoint, enabled, restored);

        breakpoint.view = new WebInspector.EventListenerBreakpointView(this, breakpointId, enabled, eventName);
        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.EventListenerBreakpointAdded, breakpoint.view);
    },

    createXHRBreakpoint: function(url)
    {
        this._createXHRBreakpoint(url, true, false);
    },

    _createXHRBreakpoint: function(url, enabled, restored)
    {
        var breakpointId = this._createXHRBreakpointId(url);
        if (breakpointId in this._breakpoints)
            return;

        var breakpoint = new WebInspector.XHRBreakpoint(url);
        this._setBreakpoint(breakpointId, breakpoint, enabled, restored);

        breakpoint.view = new WebInspector.XHRBreakpointView(this, breakpointId, enabled, url);
        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.XHRBreakpointAdded, breakpoint.view);
    },

    _setBreakpoint: function(breakpointId, breakpoint, enabled, restored)
    {
        this._breakpoints[breakpointId] = breakpoint;
        breakpoint.enabled = enabled;
        if (restored)
            return;
        if (enabled)
            breakpoint._enable();
        this._saveBreakpoints();
    },

    _setBreakpointEnabled: function(breakpointId, enabled)
    {
        var breakpoint = this._breakpoints[breakpointId];
        if (breakpoint.enabled === enabled)
            return;
        if (enabled)
            breakpoint._enable();
        else
            breakpoint._disable();
        breakpoint.enabled = enabled;
        this._saveBreakpoints();
    },

    _removeBreakpoint: function(breakpointId)
    {
        var breakpoint = this._breakpoints[breakpointId];
        if (breakpoint.enabled)
            breakpoint._disable();
        delete this._breakpoints[breakpointId];
        this._saveBreakpoints();
    },

    breakpointViewForEventData: function(eventData)
    {
        var breakpointId;
        if (eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.DOM)
            breakpointId = this._createDOMBreakpointId(eventData.nodeId, eventData.type);
        else if (eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.EventListener)
            breakpointId = this._createEventListenerBreakpointId(eventData.eventName);
        else if (eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.XHR)
            breakpointId = this._createXHRBreakpointId(eventData.breakpointURL);
        else
            return;

        var breakpoint = this._breakpoints[breakpointId];
        if (breakpoint)
            return breakpoint.view;
    },

    _debuggerPaused: function(event)
    {
        var eventType = event.data.eventType;
        var eventData = event.data.eventData;

        if (eventType !== WebInspector.DebuggerEventTypes.NativeBreakpoint)
            return;

        var breakpointView = this.breakpointViewForEventData(eventData);
        if (!breakpointView)
            return;

        breakpointView.hit = true;
        this._lastHitBreakpointView = breakpointView;
    },

    _debuggerResumed: function(event)
    {
        if (!this._lastHitBreakpointView)
            return;
        this._lastHitBreakpointView.hit = false;
        delete this._lastHitBreakpointView;
    },

    _projectChanged: function(event)
    {
        this._breakpoints = {};
        this._domBreakpointsRestored = false;
        this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.ProjectChanged);

        var breakpoints = this._stickyBreakpoints[WebInspector.settings.projectId] || [];
        for (var i = 0; i < breakpoints.length; ++i) {
            var breakpoint = breakpoints[i];
            if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.EventListener)
                this._createEventListenerBreakpoint(breakpoint.condition.eventName, breakpoint.enabled, true);
            else if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.XHR)
                this._createXHRBreakpoint(breakpoint.condition.url, breakpoint.enabled, true);
        }

        if (!this._breakpointsPushedToFrontend) {
            InspectorBackend.setAllBrowserBreakpoints(this._stickyBreakpoints);
            this._breakpointsPushedToFrontend = true;
        }
    },

    restoreDOMBreakpoints: function()
    {
        function didPushNodeByPathToFrontend(path, nodeId)
        {
            pathToNodeId[path] = nodeId;
            pendingCalls -= 1;
            if (pendingCalls)
                return;
            for (var i = 0; i < breakpoints.length; ++i) {
                var breakpoint = breakpoints[i];
                if (breakpoint.type !== WebInspector.BreakpointManager.BreakpointTypes.DOM)
                    continue;
                var nodeId = pathToNodeId[breakpoint.condition.path];
                if (nodeId)
                    this._createDOMBreakpoint(nodeId, breakpoint.condition.type, breakpoint.enabled, true);
            }
            this._domBreakpointsRestored = true;
            this._saveBreakpoints();
        }

        var breakpoints = this._stickyBreakpoints[WebInspector.settings.projectId] || [];
        var pathToNodeId = {};
        var pendingCalls = 0;
        for (var i = 0; i < breakpoints.length; ++i) {
            if (breakpoints[i].type !== WebInspector.BreakpointManager.BreakpointTypes.DOM)
                continue;
            var path = breakpoints[i].condition.path;
            if (path in pathToNodeId)
                continue;
            pathToNodeId[path] = 0;
            pendingCalls += 1;
            InspectorBackend.pushNodeByPathToFrontend(path, didPushNodeByPathToFrontend.bind(this, path));
        }
        if (!pendingCalls)
            this._domBreakpointsRestored = true;
    },

    _saveBreakpoints: function()
    {
        var breakpoints = [];
        for (var breakpointId in this._breakpoints) {
            var breakpoint = this._breakpoints[breakpointId];
            var persistentBreakpoint = breakpoint._serializeToJSON();
            persistentBreakpoint.enabled = breakpoint.enabled;
            breakpoints.push(persistentBreakpoint);
        }
        if (!this._domBreakpointsRestored) {
            var stickyBreakpoints = this._stickyBreakpoints[WebInspector.settings.projectId] || [];
            for (var i = 0; i < stickyBreakpoints.length; ++i) {
                if (stickyBreakpoints[i].type === WebInspector.BreakpointManager.BreakpointTypes.DOM)
                    breakpoints.push(stickyBreakpoints[i]);
            }
        }
        WebInspector.settings.nativeBreakpoints = breakpoints;

        this._stickyBreakpoints[WebInspector.settings.projectId] = breakpoints;
        InspectorBackend.setAllBrowserBreakpoints(this._stickyBreakpoints);
    },

    _validateBreakpoints: function(persistentBreakpoints)
    {
        var breakpoints = [];
        var breakpointsSet = {};
        for (var i = 0; i < persistentBreakpoints.length; ++i) {
            var breakpoint = persistentBreakpoints[i];
            if (!("type" in breakpoint && "enabled" in breakpoint && "condition" in breakpoint))
                continue;
            var id = breakpoint.type + ":";
            var condition = breakpoint.condition;
            if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.DOM) {
                if (typeof condition.path !== "string" || typeof condition.type !== "number")
                    continue;
                id += condition.path + ":" + condition.type;
            } else if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.EventListener) {
                if (typeof condition.eventName !== "string")
                    continue;
                id += condition.eventName;
            } else if (breakpoint.type === WebInspector.BreakpointManager.BreakpointTypes.XHR) {
                if (typeof condition.url !== "string")
                    continue;
                id += condition.url;
            } else
                continue;
            if (id in breakpointsSet)
                continue;
            breakpointsSet[id] = true;
            breakpoints.push(breakpoint);
        }
        return breakpoints;
    },

    _createDOMBreakpointId: function(nodeId, type)
    {
        return "dom:" + nodeId + ":" + type;
    },

    _createEventListenerBreakpointId: function(eventName)
    {
        return "eventListner:" + eventName;
    },

    _createXHRBreakpointId: function(url)
    {
        return "xhr:" + url;
    }
}

WebInspector.BreakpointManager.prototype.__proto__ = WebInspector.Object.prototype;

WebInspector.DOMBreakpoint = function(node, type)
{
    this._nodeId = node.id;
    this._path = node.path();
    this._type = type;
}

WebInspector.DOMBreakpoint.prototype = {
    _enable: function()
    {
        InspectorBackend.setDOMBreakpoint(this._nodeId, this._type);
    },

    _disable: function()
    {
        InspectorBackend.removeDOMBreakpoint(this._nodeId, this._type);
    },

    _serializeToJSON: function()
    {
        var type = WebInspector.BreakpointManager.BreakpointTypes.DOM;
        return { type: type, condition: { path: this._path, type: this._type } };
    }
}

WebInspector.EventListenerBreakpoint = function(eventName)
{
    this._eventName = eventName;
}

WebInspector.EventListenerBreakpoint.prototype = {
    _enable: function()
    {
        InspectorBackend.setEventListenerBreakpoint(this._eventName);
    },

    _disable: function()
    {
        InspectorBackend.removeEventListenerBreakpoint(this._eventName);
    },

    _serializeToJSON: function()
    {
        var type = WebInspector.BreakpointManager.BreakpointTypes.EventListener;
        return { type: type, condition: { eventName: this._eventName } };
    }
}

WebInspector.XHRBreakpoint = function(url)
{
    this._url = url;
}

WebInspector.XHRBreakpoint.prototype = {
    _enable: function()
    {
        InspectorBackend.setXHRBreakpoint(this._url);
    },

    _disable: function()
    {
        InspectorBackend.removeXHRBreakpoint(this._url);
    },

    _serializeToJSON: function()
    {
        var type = WebInspector.BreakpointManager.BreakpointTypes.XHR;
        return { type: type, condition: { url: this._url } };
    }
}

WebInspector.NativeBreakpointView = function(manager, id, enabled)
{
    this._manager = manager;
    this._id = id;
    this._enabled = enabled;
    this._hit = false;
}

WebInspector.NativeBreakpointView.prototype = {
    get enabled()
    {
        return this._enabled;
    },

    set enabled(enabled)
    {
        this._manager._setBreakpointEnabled(this._id, enabled);
        this._enabled = enabled;
        this.dispatchEventToListeners("enable-changed");
    },

    get hit()
    {
        return this._hit;
    },

    set hit(hit)
    {
        this._hit = hit;
        this.dispatchEventToListeners("hit-state-changed");
    },

    remove: function()
    {
        this._manager._removeBreakpoint(this._id);
        this._onRemove();
        this.dispatchEventToListeners("removed");
    },

    _compare: function(x, y)
    {
        if (x !== y)
            return x < y ? -1 : 1;
        return 0;
    },

    _onRemove: function()
    {
    }
}

WebInspector.NativeBreakpointView.prototype.__proto__ = WebInspector.Object.prototype;

WebInspector.DOMBreakpointView = function(manager, id, enabled, node, type)
{
    WebInspector.NativeBreakpointView.call(this, manager, id, enabled);
    this._node = node;
    this._nodeId = node.id;
    this._type = type;
    node.breakpoints[this._type] = this;
}

WebInspector.DOMBreakpointView.prototype = {
    compareTo: function(other)
    {
        return this._compare(this._type, other._type);
    },

    populateLabelElement: function(element)
    {
        // FIXME: this should belong to the view, not the manager.
        var linkifiedNode = WebInspector.panels.elements.linkifyNodeById(this._nodeId);
        linkifiedNode.addStyleClass("monospace");
        element.appendChild(linkifiedNode);
        var description = document.createElement("div");
        description.className = "source-text";
        description.textContent = WebInspector.domBreakpointTypeLabel(this._type);
        element.appendChild(description);
    },

    populateStatusMessageElement: function(element, eventData)
    {
        var substitutions = [WebInspector.domBreakpointTypeLabel(this._type), WebInspector.panels.elements.linkifyNodeById(this._nodeId)];
        var formatters = {
            s: function(substitution)
            {
                return substitution;
            }
        };
        function append(a, b)
        {
            if (typeof b === "string")
                b = document.createTextNode(b);
            element.appendChild(b);
        }
        if (this._type === WebInspector.DOMBreakpointTypes.SubtreeModified) {
            var targetNode = WebInspector.panels.elements.linkifyNodeById(eventData.targetNodeId);
            if (eventData.insertion) {
                if (eventData.targetNodeId !== this._nodeId)
                    WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s.", substitutions.concat(targetNode), formatters, "", append);
                else
                    WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to that node.", substitutions, formatters, "", append);
            } else
                WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because its descendant %s was removed.", substitutions.concat(targetNode), formatters, "", append);
        } else
            WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s.", substitutions, formatters, "", append);
    },

    _onRemove: function()
    {
        delete this._node.breakpoints[this._type];
    }
}

WebInspector.DOMBreakpointView.prototype.__proto__ = WebInspector.NativeBreakpointView.prototype;

WebInspector.EventListenerBreakpointView = function(manager, id, enabled, eventName)
{
    WebInspector.NativeBreakpointView.call(this, manager, id, enabled);
    this._eventName = eventName;
}

WebInspector.EventListenerBreakpointView.eventNameForUI = function(eventName)
{
    if (!WebInspector.EventListenerBreakpointView._eventNamesForUI) {
        WebInspector.EventListenerBreakpointView._eventNamesForUI = {
            "instrumentation:setTimer": WebInspector.UIString("Set Timer"),
            "instrumentation:clearTimer": WebInspector.UIString("Clear Timer"),
            "instrumentation:timerFired": WebInspector.UIString("Timer Fired")
        };
    }
    return WebInspector.EventListenerBreakpointView._eventNamesForUI[eventName] || eventName.substring(eventName.indexOf(":") + 1);
}

WebInspector.EventListenerBreakpointView.prototype = {
    get eventName()
    {
        return this._eventName;
    },

    compareTo: function(other)
    {
        return this._compare(this._eventName, other._eventName);
    },

    populateLabelElement: function(element)
    {
        element.appendChild(document.createTextNode(this._uiEventName()));
    },

    populateStatusMessageElement: function(element, eventData)
    {
        var status = WebInspector.UIString("Paused on a \"%s\" Event Listener.", this._uiEventName());
        element.appendChild(document.createTextNode(status));
    },

    _uiEventName: function()
    {
        return WebInspector.EventListenerBreakpointView.eventNameForUI(this._eventName);
    }
}

WebInspector.EventListenerBreakpointView.prototype.__proto__ = WebInspector.NativeBreakpointView.prototype;

WebInspector.XHRBreakpointView = function(manager, id, enabled, url)
{
    WebInspector.NativeBreakpointView.call(this, manager, id, enabled);
    this._url = url;
}

WebInspector.XHRBreakpointView.prototype = {
    compareTo: function(other)
    {
        return this._compare(this._url, other._url);
    },

    populateEditElement: function(element)
    {
        element.textContent = this._url;
    },

    populateLabelElement: function(element)
    {
        var label;
        if (!this._url.length)
            label = WebInspector.UIString("Any XHR");
        else
            label = WebInspector.UIString("URL contains \"%s\"", this._url);
        element.appendChild(document.createTextNode(label));
        element.addStyleClass("cursor-auto");
    },

    populateStatusMessageElement: function(element)
    {
        var status = WebInspector.UIString("Paused on a XMLHttpRequest.");
        element.appendChild(document.createTextNode(status));
    }
}

WebInspector.XHRBreakpointView.prototype.__proto__ = WebInspector.NativeBreakpointView.prototype;

WebInspector.DOMBreakpointTypes = {
    SubtreeModified: 0,
    AttributeModified: 1,
    NodeRemoved: 2
};

WebInspector.domBreakpointTypeLabel = function(type)
{
    if (!WebInspector._DOMBreakpointTypeLabels) {
        WebInspector._DOMBreakpointTypeLabels = {};
        WebInspector._DOMBreakpointTypeLabels[WebInspector.DOMBreakpointTypes.SubtreeModified] = WebInspector.UIString("Subtree Modified");
        WebInspector._DOMBreakpointTypeLabels[WebInspector.DOMBreakpointTypes.AttributeModified] = WebInspector.UIString("Attribute Modified");
        WebInspector._DOMBreakpointTypeLabels[WebInspector.DOMBreakpointTypes.NodeRemoved] = WebInspector.UIString("Node Removed");
    }
    return WebInspector._DOMBreakpointTypeLabels[type];
}

WebInspector.domBreakpointTypeContextMenuLabel = function(type)
{
    if (!WebInspector._DOMBreakpointTypeContextMenuLabels) {
        WebInspector._DOMBreakpointTypeContextMenuLabels = {};
        WebInspector._DOMBreakpointTypeContextMenuLabels[WebInspector.DOMBreakpointTypes.SubtreeModified] = WebInspector.UIString("Break on Subtree Modifications");
        WebInspector._DOMBreakpointTypeContextMenuLabels[WebInspector.DOMBreakpointTypes.AttributeModified] = WebInspector.UIString("Break on Attributes Modifications");
        WebInspector._DOMBreakpointTypeContextMenuLabels[WebInspector.DOMBreakpointTypes.NodeRemoved] = WebInspector.UIString("Break on Node Removal");
    }
    return WebInspector._DOMBreakpointTypeContextMenuLabels[type];
}


text:
/*
    -- MAGMA (version 1.6.1) --
       Univ. of Tennessee, Knoxville
       Univ. of California, Berkeley
       Univ. of Colorado, Denver
       @date January 2015

       @precisions normal z -> s d c
       @author Hartwig Anzt
*/

//  in this file, many routines are taken from
//  the IO functions provided by MatrixMarket

#include <fstream>
#include <stdlib.h>
#include <string>
#include <sstream>
#include <iostream>
#include <ostream>
#include <assert.h>
#include <stdio.h>

#include "magmasparse_z.h"
#include "magma.h"
#include "mmio.h"

using namespace std;

/**
    Purpose
    -------

    Passes a vector to MAGMA (located on DEV).

    Arguments
    ---------

    @param[in]
    m           magma_int_t
                number of rows

    @param[in]
    n           magma_int_t
                number of columns

    @param[in]
    val         magmaDoubleComplex_ptr
                array containing vector entries

    @param[out]
    v           magma_z_vector*
                magma vector
    @param[in]
    queue       magma_queue_t
                Queue to execute in.

    @ingroup magmasparse_zaux
    ********************************************************************/

extern "C"
magma_int_t
magma_zvset_dev(
    magma_int_t m, magma_int_t n,
    magmaDoubleComplex_ptr val,
    magma_z_vector *v,
    magma_queue_t queue )
{
    v->num_rows = m;
    v->num_cols = n;
    v->nnz = m*n;
    v->memory_location = Magma_DEV;
    v->dval = val;
    v->major = MagmaColMajor;

    return MAGMA_SUCCESS;
}

/**
    Purpose
    -------

    Passes a MAGMA vector back (located on DEV).

    Arguments
    ---------

    @param[in]
    v           magma_z_vector
                magma vector

    @param[out]
    m           magma_int_t
                number of rows

    @param[out]
    n           magma_int_t
                number of columns

    @param[out]
    val         magmaDoubleComplex_ptr
                array containing vector entries

    @param[in]
    queue       magma_queue_t
                Queue to execute in.

    @ingroup magmasparse_zaux
    ********************************************************************/

extern "C"
magma_int_t
magma_zvget_dev(
    magma_z_vector v,
    magma_int_t *m, magma_int_t *n,
    magmaDoubleComplex_ptr *val,
    magma_queue_t queue )
{
    if ( v.memory_location == Magma_DEV ) {

        *m = v.num_rows;
        *n = v.num_cols;
        *val = v.dval;
    } else {
        magma_z_vector v_DEV;
        magma_z_vtransfer( v, &v_DEV, v.memory_location, Magma_DEV, queue );
        magma_zvget_dev( v_DEV, m, n, val, queue );
        magma_z_vfree( &v_DEV, queue );
    }
    return MAGMA_SUCCESS;
}


text:
<meta charset="utf-8">
<meta name="description" content="">
<meta name="csrf-token" content="{{ csrf_token() }}" />
<title>Cloud Sync</title>

<!-- load bootstrap from a cdn -->

  <link rel="stylesheet" type="text/css" href="{{asset('css/foundation.css')}}"/>
  <link rel="stylesheet" type="text/css" href="{{asset('css/normalize.css')}}"/>
  <link rel="stylesheet" type="text/css" href="{{asset('css/main.css')}}"/>
  <link rel="stylesheet" type="text/css" href="{{asset('css/login_Style.css')}}"/>
  <link rel="stylesheet" type="text/css" href="{{asset('css/Homecss.css')}}"/>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>

  <script type="text/javascript">
  $(document).ready(function(){
      if ( $( "#file-send-success" ).length ) {

          $("#file-send-success" ).fadeOut(3000);
      }

      if($('#registration-success').length){

          $('#registration-success').fadeOut(3000);
      }

  });
  </script>


text:
using UnityEngine;

// Sets up transformation matrices to scale&scroll water waves
// for the case where graphics card does not support vertex programs.

[ExecuteInEditMode]
public class LavaSimple : MonoBehaviour
{
	void Update()
	{
		if( !GetComponent<Renderer>() )
			return;
		Material mat = GetComponent<Renderer>().sharedMaterial;
		if( !mat )
			return;

		Vector4 waveSpeed = mat.GetVector( "WaveSpeed" );
		float waveScale = mat.GetFloat( "_WaveScale" );
		float t = Time.time / 40.0f;

		Vector3 offset = new Vector3( t * waveSpeed.x, t * waveSpeed.y, 0 );
		Vector3 scale = new Vector3( 1.0f/waveScale, 1.0f/waveScale, 1 );
		Matrix4x4 scrollMatrix = Matrix4x4.TRS( offset, Quaternion.identity, scale );
		mat.SetMatrix( "_WaveMatrix", scrollMatrix );

		offset = new Vector3( t * waveSpeed.z, t * waveSpeed.w, 0 );
		scrollMatrix = Matrix4x4.TRS( offset, Quaternion.identity, scale * 0.45f );
		mat.SetMatrix( "_WaveMatrix2", scrollMatrix );
	}
}


text:
<?php

use Goteo\Core\View,
    Goteo\Library\Worth,
    Goteo\Model\User,
    Goteo\Model\Invest,
    Goteo\Library\Text,
    Goteo\Model\License;

$project = $this['project'];
$personal = $this['personal'];

// cantidad de aporte
if (isset($_SESSION['invest-amount'])) {
    $amount = $_SESSION['invest-amount'];
    unset($_SESSION['invest-amount']);
} elseif (!empty($_GET['amount'])) {
    $amount = $_GET['amount'];
} else {
    $amount = 0;
}
$step = $this['step'];

$level = (int) $this['level'] ?: 3;

$worthcracy = Worth::getAll();

$licenses = array();

foreach (License::getAll() as $l) {
    $licenses[$l->id] = $l;
}

$action = ($step == 'start') ? '/user/login' : '/invest/' . $project->id;
?>

    <h<?php echo $level ?> class="title"><?php echo Text::get('invest-amount') ?></h<?php echo $level ?>>

    <form method="post" action="<?php echo $action; ?>">

    <input type="text" id="amount" name="amount" class="amount" value="<?php echo $amount ?>" /><?php echo Text::get('invest-amount-tooltip') ?>

    <h<?php echo $level ?> class="beak"><?php echo Text::get('invest-individual-header') ?></h<?php echo $level ?>>

        <h<?php echo $level+1 ?> class="title"><?php echo Text::get('project-rewards-individual_reward-title'); ?></h<?php echo $level+1 ?>>

<input class="individual_reward" type="radio" id="resign_reward" name="selected_reward" value="0" amount="0"/><?php echo Text::get('invest-resign') ?>

        <?php foreach ($project->individual_rewards as $individual) : ?>
        <li class="<?php echo $individual->icon ?><?php if ($individual->none) echo ' disabled' ?>">

            <label class="amount" for="reward_<?php echo $individual->id; ?>">
                <input type="radio" name="selected_reward" id="reward_<?php echo $individual->id; ?>" value="<?php echo $individual->id; ?>" amount="<?php echo $individual->amount; ?>" class="individual_reward" title="<?php echo htmlspecialchars($individual->reward) ?>" <?php if ($individual->none) echo 'disabled="disabled"' ?>/>
                <?php echo $individual->amount; ?> €

        	<h<?php echo $level + 2 ?> class="name"><?php echo htmlspecialchars($individual->reward) ?></h<?php echo $level + 2 ?>>

<?php echo htmlspecialchars($individual->description)?>

                <?php if ($individual->none) : // no quedan ?>
                <?php echo Text::get('invest-reward-none') ?>
                <?php elseif (!empty($individual->units)) : // unidades limitadas ?>
                <?php echo Text::get('project-rewards-individual_reward-limited'); ?>

                <?php $units = ($individual->units - $individual->taken); // resto
                echo Text::html('project-rewards-individual_reward-units_left', $units); ?>

            <?php endif; ?>

        <?php endforeach ?>

<?php
// si es el primer paso, mostramos el botón para ir a login
if ($step == 'start') : ?>

    <h<?php echo $level ?> class="beak"><?php echo Text::get('user-login-required-to_invest') ?></h<?php echo $level ?>>

        <button type="submit" class="button red" name="go-login" value=""><?php echo Text::get('imperative-register'); ?></button>

<?php echo Text::get('invest-alert-investing') ?> <?php echo $amount ?>

<?php else : ?>

    <h<?php echo $level ?> class="beak" id="address-header"><?php echo Text::get('invest-address-header') ?></h<?php echo $level ?>>

                <?php echo Text::get('invest-address-name-field') ?>

                <input type="text" id="fullname" name="fullname" value="<?php echo $personal->contract_name; ?>" />

            <?php /* Para ocultar el campo nif:  id="donation-data" style="display:none;"  */ ?>
                <?php echo Text::get('invest-address-nif-field') ?>

                <input type="text" id="nif" name="nif" value="<?php echo $personal->contract_nif; ?>" />

                <?php echo Text::get('invest-address-address-field') ?>

                <input type="text" id="address" name="address" value="<?php echo $personal->address; ?>" />

                <?php echo Text::get('invest-address-zipcode-field') ?>

                <input type="text" id="zipcode" name="zipcode" value="<?php echo $personal->zipcode; ?>" />

                <?php echo Text::get('invest-address-location-field') ?>

                <input type="text" id="location" name="location" value="<?php echo $personal->location; ?>" />

                <?php echo Text::get('invest-address-country-field') ?>

                <input type="text" id="country" name="country" value="<?php echo $personal->country; ?>" />

        <input type="checkbox" name="anonymous" value="1" /><?php echo Text::get('invest-anonymous') ?>

    <h<?php echo $level ?> class="beak"><?php echo Text::get('project-invest-continue') ?></h<?php echo $level ?>>

<input type="hidden" id="paymethod"  />

<?php if (\GOTEO_ENV != 'real') : ?>

<button type="submit" class="process pay-cash" name="method"  value="cash">CASH</button>

<?php endif; ?>

<button type="submit" class="process pay-tpv" name="method"  value="tpv">TPV</button>

<button type="submit" class="process pay-paypal" name="method"  value="paypal">PAYPAL</button>

<?php endif; ?>
</form>

<?php echo new View('view/project/widget/worth.html.php', array('worthcracy' => $worthcracy, 'level' => $_SESSION['user']->worth)) ?>

    <h<?php echo $level ?> class="beak"><?php echo Text::get('invest-social-header') ?></h<?php echo $level ?>>

        <h<?php echo $level + 1 ?> class="title"><?php echo Text::get('project-rewards-social_reward-title'); ?></h<?php echo $level + 1 ?>>

        <?php foreach ($project->social_rewards as $social) : ?>
            <li class="<?php echo $social->icon ?>">
                <h<?php echo $level + 2 ?> class="name"><?php echo htmlspecialchars($social->reward) ?></h<?php echo $level + 2 ?>

<?php echo htmlspecialchars($social->description)?>

                <?php if (!empty($social->license) && array_key_exists($social->license, $licenses)): ?>
                <div class="license <?php echo htmlspecialchars($social->license) ?>">
                    <h<?php echo $level + 3 ?>><?php echo Text::get('regular-license'); ?></h<?php echo $level + 3 ?>>
                    <a href="<?php echo htmlspecialchars($licenses[$social->license]->url) ?>" target="_blank">
                        <?php echo htmlspecialchars($licenses[$social->license]->name) ?>

                    <?php if (!empty($licenses[$social->license]->description)): ?>

<?php echo htmlspecialchars($licenses[$social->license]->description) ?>

                    <?php endif ?>

                <?php endif ?>

        <?php endforeach; ?>


text:
package com.google.testing.junit.testparameterinjector;

import com.google.common.base.Joiner;
import com.google.common.base.Throwables;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Lists;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.junit.Rule;
import org.junit.Test;
import org.junit.internal.runners.model.ReflectiveCallable;
import org.junit.internal.runners.statements.Fail;
import org.junit.internal.runners.statements.FailOnTimeout;
import org.junit.rules.MethodRule;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.MemberValueConsumer;
import org.junit.runners.model.Statement;
import org.junit.runners.model.TestClass;

/**
 * Class to substitute JUnit4 runner in JUnit4 tests, adding additional functionality.
 *
 *
See {@link TestParameterInjector} for an example implementation.
 */
abstract class PluggableTestRunner extends BlockJUnit4ClassRunner {

  /**
   * A {@link ThreadLocal} is used to handle cases where multiple tests are executing in the same
   * java process in different threads.
   *
   *
A null value indicates that the TestInfo hasn't been set yet, which would typically happen
   * if the test hasn't yet started, or the {@link PluggableTestRunner} is not the test runner.
   */
  private static final ThreadLocal<TestInfo> currentTestInfo = new ThreadLocal<>();

  private TestMethodProcessorList testMethodProcessors;

  protected PluggableTestRunner(Class<?> klass) throws InitializationError {
    super(klass);
  }

  /** Returns the TestMethodProcessorList to use. This is meant to be overridden by subclasses. */
  protected abstract TestMethodProcessorList createTestMethodProcessorList();

  /**
   * This method is run to perform optional additional operations on the test instance, right after
   * it was created.
   */
  protected void finalizeCreatedTestInstance(Object testInstance) {
    // Do nothing by default
  }

  /**
   * If true, all test methods (across different TestMethodProcessors) will be sorted in a
   * deterministic way.
   *
   *
Deterministic means that the order will not change, even when tests are added/removed or
   * between releases.
   *
   * @deprecated Override {@link #sortTestMethods} with preferred sorting strategy.
   */
  @Deprecated
  protected boolean shouldSortTestMethodsDeterministically() {
    return false; // Don't sort methods by default
  }

  /**
   * Sort test methods (across different TestMethodProcessors).
   *
   *
This should be deterministic. The order should not change, even when tests are added/removed
   * or between releases.
   */
  protected ImmutableList<FrameworkMethod> sortTestMethods(ImmutableList<FrameworkMethod> methods) {
    if (!shouldSortTestMethodsDeterministically()) {
      return methods;
    }
    return FluentIterable.from(methods)
        .toSortedList(
            (o1, o2) ->
                ComparisonChain.start()
                    .compare(o1.getName().hashCode(), o2.getName().hashCode())
                    .compare(o1.getName(), o2.getName())
                    .result());
  }

  /**
   * Returns classes used as annotations to indicate test methods.
   *
   *
Defaults to {@link Test}.
   */
  protected ImmutableList<Class<? extends Annotation>> getSupportedTestAnnotations() {
    return ImmutableList.of(Test.class);
  }

  /**
   * {@link TestRule}s that will be executed before the ones defined in the test class. This is
   * meant to be overridden by subclasses.
   */
  protected List<TestRule> getExtraTestRules() {
    return ImmutableList.of();
  }

  @Override
  protected final ImmutableList<FrameworkMethod> computeTestMethods() {
    return sortTestMethods(
        FluentIterable.from(getSupportedTestAnnotations())
            .transformAndConcat(annotation -> getTestClass().getAnnotatedMethods(annotation))
            .transformAndConcat(this::processMethod)
            .toList());
  }

  /** Implementation of a JUnit FrameworkMethod where the name and annotation list is overridden. */
  private static class OverriddenFrameworkMethod extends FrameworkMethod {

    private final TestInfo testInfo;

    public OverriddenFrameworkMethod(Method method, TestInfo testInfo) {
      super(method);
      this.testInfo = testInfo;
    }

    public TestInfo getTestInfo() {
      return testInfo;
    }

    @Override
    public String getName() {
      return testInfo.getName();
    }

    @Override
    public Annotation[] getAnnotations() {
      List<Annotation> annotations = testInfo.getAnnotations();
      return annotations.toArray(new Annotation[0]);
    }

    @Override
    public <T extends Annotation> T getAnnotation(final Class<T> annotationClass) {
      return testInfo.getAnnotation(annotationClass);
    }

    @Override
    public boolean equals(Object obj) {
      if (!(obj instanceof PluggableTestRunner.OverriddenFrameworkMethod)) {
        return false;
      }

      OverriddenFrameworkMethod other = (OverriddenFrameworkMethod) obj;
      return super.equals(other) && other.testInfo.equals(testInfo);
    }

    @Override
    public int hashCode() {
      return super.hashCode() * 37 + testInfo.hashCode();
    }
  }

  private ImmutableList<FrameworkMethod> processMethod(FrameworkMethod initialMethod) {
    return FluentIterable.from(
            getTestMethodProcessors()
                .calculateTestInfos(initialMethod.getMethod(), getTestClass().getJavaClass()))
        .transform(
            testInfo ->
                (FrameworkMethod) new OverriddenFrameworkMethod(testInfo.getMethod(), testInfo))
        .toList();
  }

  // Note: This is a copy of the parent implementation, except that instead of calling
  // #createTest(), this method calls #createTestForMethod(method).
  @Override
  protected final Statement methodBlock(final FrameworkMethod method) {
    Object testObject;
    try {
      testObject =
          new ReflectiveCallable() {
            @Override
            protected Object runReflectiveCall() throws Throwable {
              return createTestForMethod(method);
            }
          }.run();
    } catch (Throwable e) {
      return new Fail(e);
    }

    Statement statement = methodInvoker(method, testObject);
    statement = possiblyExpectingExceptions(method, testObject, statement);
    statement = withPotentialTimeoutInternal(method, testObject, statement);
    statement = withBefores(method, testObject, statement);
    statement = withAfters(method, testObject, statement);
    statement = withRules(method, testObject, statement);
    return statement;
  }

  // Note: This does the same as BlockJUnit4ClassRunner.withPotentialTimeout(), which is deprecated
  // and will soon be private.
  private Statement withPotentialTimeoutInternal(
      FrameworkMethod method, Object test, Statement next) {
    Test testAnnotation = method.getAnnotation(Test.class);
    if (testAnnotation == null) {
      return next;
    } else if (testAnnotation.timeout() <= 0) {
      return next;
    } else {
      return FailOnTimeout.builder()
          .withTimeout(testAnnotation.timeout(), TimeUnit.MILLISECONDS)
          .build(next);
    }
  }

  @Override
  protected final Statement methodInvoker(FrameworkMethod frameworkMethod, Object testObject) {
    TestInfo testInfo = ((OverriddenFrameworkMethod) frameworkMethod).getTestInfo();

    if (testInfo.getMethod().getParameterTypes().length == 0) {
      return super.methodInvoker(frameworkMethod, testObject);
    } else {
      List<Object> parameters = getTestMethodProcessors().getTestMethodParameters(testInfo);
      return new Statement() {
        @Override
        public void evaluate() throws Throwable {
          frameworkMethod.invokeExplosively(testObject, parameters.toArray());
        }
      };
    }
  }

  /** Modifies the statement with each {@link MethodRule} and {@link TestRule} */
  private Statement withRules(FrameworkMethod method, Object target, Statement statement) {
    Description testDescription = describeChild(method);
    TestClass testClass = getTestClass();

    LinkedListMultimap<Integer, Object> orderToRulesMultimap = LinkedListMultimap.create();
    MemberValueConsumer<Object> collector =
        (frameworkMember, rule) -> {
          Rule ruleAnnotation = frameworkMember.getAnnotation(Rule.class);
          int order = ruleAnnotation == null ? Rule.DEFAULT_ORDER : ruleAnnotation.order();
          if (orderToRulesMultimap.containsValue(rule)
              && rule instanceof MethodRule
              && rule instanceof TestRule) {
            // This rule was already added because it is both a MethodRule and a TestRule.
            // For legacy reasons, we need to put the new rule at the end of the list.
            orderToRulesMultimap.remove(order, rule);
          }
          orderToRulesMultimap.put(order, rule);
        };

    testClass.collectAnnotatedMethodValues(target, Rule.class, MethodRule.class, collector::accept);
    testClass.collectAnnotatedFieldValues(target, Rule.class, MethodRule.class, collector::accept);
    testClass.collectAnnotatedMethodValues(target, Rule.class, TestRule.class, collector::accept);
    testClass.collectAnnotatedFieldValues(target, Rule.class, TestRule.class, collector::accept);

    ArrayList<Integer> keys = new ArrayList<>(orderToRulesMultimap.keySet());
    Collections.sort(keys);
    ImmutableList<Object> orderedRules =
        FluentIterable.from(keys)
            .transformAndConcat(
                // Execute the rules in the reverse order of when the fields occurred. This may look
                // counter-intuitive, but that is what the default JUnit4 runner does, and there is
                // no reason to deviate from that here.
                key -> Lists.reverse(orderToRulesMultimap.get(key)))
            .toList();

    // Note: The perceived order* is the reverse of the order in which the code below applies the
    // rules to the statements because each subsequent rule wraps the previous statement.
    //
    // [*] The rule implementation can add its logic both before or after the base statement, so the
    // order depends on the rule implementation. If all rules put their logic before the base
    // statement, the order matches that of `orderedRules`.

    for (Object rule : Lists.reverse(orderedRules)) {
      if (rule instanceof TestRule) {
        statement = ((TestRule) rule).apply(statement, testDescription);
      } else if (rule instanceof MethodRule) {
        statement = ((MethodRule) rule).apply(statement, method, target);
      } else {
        throw new AssertionError(rule);
      }
    }

    // Apply extra rules
    for (TestRule testRule : getExtraTestRules()) {
      statement = testRule.apply(statement, testDescription);
    }
    statement = new ContextMethodRule().apply(statement, method, target);

    return statement;
  }

  private Object createTestForMethod(FrameworkMethod method) throws Exception {
    TestInfo testInfo = ((OverriddenFrameworkMethod) method).getTestInfo();
    Constructor<?> constructor = getTestClass().getOnlyConstructor();

    // Construct a test instance
    Object testInstance;
    if (constructor.getParameterTypes().length == 0) {
      testInstance = createTest();
    } else {
      List<Object> constructorParameters =
          getTestMethodProcessors().getConstructorParameters(constructor, testInfo);
      try {
        testInstance = constructor.newInstance(constructorParameters.toArray());
      } catch (IllegalAccessException e) {
        throw new RuntimeException(e);
      }
    }

    // Run all post processors on the newly created instance
    getTestMethodProcessors().postProcessTestInstance(testInstance, testInfo);

    finalizeCreatedTestInstance(testInstance);

    return testInstance;
  }

  @Override
  protected final void validateZeroArgConstructor(List<Throwable> errorsReturned) {
    ExecutableValidationResult validationResult =
        getTestMethodProcessors().validateConstructor(getTestClass().getOnlyConstructor());

    if (validationResult.wasValidated()) {
      errorsReturned.addAll(validationResult.validationErrors());
    } else {
      super.validateZeroArgConstructor(errorsReturned);
    }
  }

  @Override
  protected final void validateTestMethods(List<Throwable> errorsReturned) {
    List<FrameworkMethod> testMethods =
        FluentIterable.from(getSupportedTestAnnotations())
            .transformAndConcat(annotation -> getTestClass().getAnnotatedMethods(annotation))
            .toList();
    for (FrameworkMethod testMethod : testMethods) {
      ExecutableValidationResult validationResult =
          getTestMethodProcessors()
              .validateTestMethod(testMethod.getMethod(), getTestClass().getJavaClass());

      if (Modifier.isStatic(testMethod.getMethod().getModifiers())) {
        errorsReturned.add(
            new Exception(String.format("Method %s() should not be static", testMethod.getName())));
      }
      if (!Modifier.isPublic(testMethod.getMethod().getModifiers())) {
        errorsReturned.add(
            new Exception(String.format("Method %s() should be public", testMethod.getName())));
      }

      if (validationResult.wasValidated()) {
        errorsReturned.addAll(validationResult.validationErrors());
      } else {
        testMethod.validatePublicVoidNoArg(/* isStatic= */ false, errorsReturned);
      }
    }
  }

  // Fix for ParentRunner bug:
  // Overriding this method because a superclass (ParentRunner) is calling this in its constructor
  // and then throwing an InitializationError that doesn't have any of the causes in the exception
  // message.
  @Override
  protected final void collectInitializationErrors(List<Throwable> errors) {
    super.collectInitializationErrors(errors);
    if (!errors.isEmpty()) {
      throw new RuntimeException(
          String.format(
              "Found %s issues while initializing the test runner:\n\n  - %s\n\n\n",
              errors.size(),
              FluentIterable.from(errors)
                  .transform(Throwables::getStackTraceAsString)
                  .join(Joiner.on("\n\n\n  - "))));
    }
  }

  // Override this test as final because it is not (always) invoked
  @Override
  protected final Object createTest() throws Exception {
    return super.createTest();
  }

  // Override this test as final because it is not (always) invoked
  @Override
  protected final void validatePublicVoidNoArgMethods(
      Class<? extends Annotation> annotation, boolean isStatic, List<Throwable> errors) {
    super.validatePublicVoidNoArgMethods(annotation, isStatic, errors);
  }

  private synchronized TestMethodProcessorList getTestMethodProcessors() {
    if (testMethodProcessors == null) {
      testMethodProcessors = createTestMethodProcessorList();
    }
    return testMethodProcessors;
  }

  /** {@link MethodRule} that sets up the Context for each test. */
  private static class ContextMethodRule implements MethodRule {
    @Override
    public Statement apply(Statement statement, FrameworkMethod method, Object o) {
      return new Statement() {
        @Override
        public void evaluate() throws Throwable {
          currentTestInfo.set(((OverriddenFrameworkMethod) method).getTestInfo());
          try {
            statement.evaluate();
          } finally {
            currentTestInfo.set(null);
          }
        }
      };
    }
  }
}


text:
function Reference(parent, route) {
	this.parent = parent;
	this.reference = route.id;
	this.required = route.required != null ? route.required : true;
	this.fallback = route.fallback;
}

module.exports = Reference;


text:
package com.tarks.saosp;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;

import android.app.AlertDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.TextView.OnEditorActionListener;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import com.actionbarsherlock.app.SherlockActivity;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.MenuInflater;

public class schedule extends SherlockActivity implements OnItemLongClickListener {

	private ListView maListViewPerso;
	// 년,월,일
	int year;
	int month;
	int day;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.listview);

        //액션바백버튼가져오기
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

		maListViewPerso = (ListView) findViewById(R.id.listView1);

		// Création de la ArrayList qui nous permettra de remplire la listView
		ArrayList<HashMap<String, String>> listItem = new ArrayList<HashMap<String, String>>();

		// On déclare la HashMap qui contiendra les informations pour un item
		HashMap<String, String> map;

		String[] weeks = { "일", "월", "화", "수", "목", "금", "토" };
		// 날짜 불러오기
		Calendar m = Calendar.getInstance();

		year = m.get(Calendar.YEAR);
		month = m.get(Calendar.MONTH) + 1;
		day = m.get(Calendar.DATE);
		// 일정 불러오기.

		map = new HashMap<String, String>();
		map.put("title", getString(R.string.plan_month) + getString(R.string.month) + " " + getString(R.string.plan));
		map.put("n", "0");
		map.put("des", getString(R.string.school_plan_des));
		map.put("img", String.valueOf(R.drawable.calendar_icon));
		listItem.add(map);

		map = new HashMap<String, String>();
		map.put("title", getString(R.string.year_plan));
		map.put("n", "00");
		map.put("des", getString(R.string.year_plan_des));
		map.put("img", String.valueOf(R.drawable.plan_dark));
		listItem.add(map);

		for (int a = 1; a <= 31; a+=1) {
			int plan_day = getResources().getIdentifier("plan" + a, "string",
					getPackageName());

			if (String.valueOf(plan_day).matches("")){}else{
        	map = new HashMap<String, String>();
    		map.put("title", a + "일");
    		map.put("n", String.valueOf(a));
    		map.put("des",getString(plan_day));
    		listItem.add(map);
			}

		}

		// Création d'un SimpleAdapter qui se chargera de mettre les items
		// présent dans notre list (listItem) dans la vue affichageitem
		SimpleAdapter mSchedule = new SimpleAdapter(this.getBaseContext(),
				listItem, R.layout.list2, new String[] { "img", "title",
						"des" }, new int[] { R.id.img, R.id.titre,
						R.id.description });

		// On attribut à notre listView l'adapter que l'on vient de créer
		maListViewPerso.setAdapter(mSchedule);

		// 리스트 길게 클릭하면 리스트 삭제하기 위해 롱 클릭 이벤트
		maListViewPerso.setOnItemLongClickListener(this);
		// Enfin on met un écouteur d'évènement sur notre listView
		maListViewPerso.setOnItemClickListener(new OnItemClickListener() {
			@SuppressWarnings("unchecked")
			public void onItemClick(AdapterView<?> a, View v, int position,
					long id) {
				HashMap<String, String> map = (HashMap<String, String>) maListViewPerso
						.getItemAtPosition(position);

				if (map.get("n").matches("00")){

					  Intent intent = new Intent(schedule.this, webview.class);
					  intent.putExtra("url", "file:///android_asset/plan.html");
			 	    	 startActivity(intent);
				}
			}
		});

		}

	@Override
	public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2,
			long arg3) {

		// 리턴값을 무족건 true로 해야함
		return true;
	}
	//빽백키 상단액션바
	   @Override
	    public boolean onOptionsItemSelected(MenuItem item) {
	    switch (item.getItemId()) {
	        case android.R.id.home:
	            onBackPressed();
	            return true;
	        default:
	            return super.onOptionsItemSelected(item);
	    }

	   }

}


text:
#ifndef MAZEMAP_H
#define MAZEMAP_H

/*
 * Contains the robot's representation of the maze in memory.
 * Arrays of wall states determine whether or not the robot
 * can travel.
 */

#include "define.h"

// holds the state of the wall
typedef enum {
	WALL = 1,
	NOWALL = 0,
	UNKNOWN = -1
} WallState;

typedef struct {
	WallState horizWalls[MAZE_HEIGHT - 1][MAZE_WIDTH];
	WallState vertWalls[MAZE_HEIGHT][MAZE_WIDTH - 1];

} MazeMap;

// constructor
MazeMap mm_create();

//
// main methods
//

BOOL mm_is_wall(MazeMap* mazeMap, Point pos, Direction direction);
BOOL mm_is_wall_r(MazeMap* mazeMap, Point pos, Direction direction, Rotation rotation);
void mm_set_wall(MazeMap* mazeMap, BOOL state, Point pos, Direction direction);

BOOL mm_get_look_position(Point pos, Direction direction, int* xLook, int* yLook);
void mm_one_ahead_direction(Direction direction, Point* pos);

//
// helper methods
//

Direction rotation_to_direction(Direction curDirection, Rotation rotation);
Rotation direction_to_rotation(Direction curDirection, Direction targetDirection);

#endif


text:
$(function(){

  "use strict";

var galleryitem = $('.galleryItem');
var groups = {};
galleryitem.each(function() {
  var id = parseInt($(this).attr('data-group'), 10);

  if(!groups[id]) {
    groups[id] = [];
  }

  groups[id].push( this );
});

$.each(groups, function() {

  $(this).magnificPopup({
      type: 'image',
      closeOnContentClick: true,
      closeBtnInside: false,
      zoom:{enabled:true, duration:400},
      gallery: { enabled:true }
  })

});

});


text:
// --------------------------------------------------------------------------------------------------------------------
//  <copyright file="RangeBlock.cs" company="NFluent">
//   Copyright 2019 Thomas PIERRAIN & Cyrille DUPUYDAUBY
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//       http://www.apache.org/licenses/LICENSE-2.0
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace NFluent.Messages
{
    using System;
    using Helpers;

    /// <summary>
    ///     Class representing a range of value
    /// </summary>
    internal class DateTimeRangeBlock
    {
        private readonly DateTime referenceValue;
        private readonly Duration tolerance;

        /// <summary>
        ///     Constructor
        /// </summary>
        /// <param name="referenceValue">Reference value (mid point)</param>
        /// <param name="tolerance">Tolerance</param>
        /// <remarks>This represents a range of <see cref="referenceValue" /> +/- <see cref="tolerance" /></remarks>
        public DateTimeRangeBlock(DateTime referenceValue, Duration tolerance)
        {
            this.referenceValue = referenceValue;
            this.tolerance = tolerance;
        }

        public bool IsInRange(DateTime value)
        {
            var duration = new Duration((this.referenceValue - value).Duration(), TimeUnit.Nanoseconds);
            return duration <= this.tolerance;
        }

        public override string ToString()
        {
            return $"{this.referenceValue} (+/- {this.tolerance})";
        }
    }
}


text:
[![CI](https://github.com/Stampie/stampie-bundle/actions/workflows/ci.yaml/badge.svg)](https://github.com/Stampie/stampie-bundle/actions/workflows/ci.yaml)

Integrates [Stampie](https://github.com/Stampie/Stampie) with Symfony.

```bash
$ composer require stampie/stampie-bundle
```

## Usage

Add `Stampie\StampieBundle\StampieBundle()` to your `AppKernel.php` in the `registerBundles` method.

Add the configuration to `config.yml` as follows

``` yaml
stampie:
    mailer: postmark # [send_grid, postmark, mailgun, mandrill, mailjet, spark_post] are supported
    server_token: POSTMARK_API_TEST # Replace with your ServerToken for your Service
```

The HttpClient used by the bundle is configurable. By default, it uses the service `httplug.client`, which
is the name of the default HTTP client when using [HttplugBundle](https://github.com/php-http/HttplugBundle).
Using this bundle is optional. You can provide your own service integrating HTTPlug:

``` yaml
stampie:
    http_client: my_http_client
```

## StampieExtra

This bundles allows you to use [StampieExtra](https://github.com/Stampie/extra) easily:
add the extra library in your project. The integration is activated automatically to wrap the mailer
in the extra mailer dispatching events. An integration with the profiler is also provided.

If you want to enable the ImpersonateListener to send all emails to the same address, provide
a non-empty delivery address:

``` yaml
stampie:
    extra:
        delivery_address: dev@example.com
```


text:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>I need 1 Lightning Rune</title>
		<link>http://bvs.wikidot.com/forum/t-159713/i-need-1-lightning-rune</link>
		<description>Posts in the discussion thread "I need 1 Lightning Rune" - ill trade anyone for it</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 04:27:07 +0000</lastBuildDate>

					<item>
				<guid>http://bvs.wikidot.com/forum/t-159713#post-496513</guid>
				<title>Re: I need 1 Lightning Rune</title>
				<link>http://bvs.wikidot.com/forum/t-159713/i-need-1-lightning-rune#post-496513</link>
				<description></description>
				<pubDate>Mon, 01 Jun 2009 19:48:36 +0000</pubDate>
				<wikidot:authorName>neji369</wikidot:authorName>								<content:encoded>
					<![CDATA[

:(

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-159713#post-496197</guid>
				<title>Re: I need 1 Lightning Rune</title>
				<link>http://bvs.wikidot.com/forum/t-159713/i-need-1-lightning-rune#post-496197</link>
				<description></description>
				<pubDate>Mon, 01 Jun 2009 14:19:36 +0000</pubDate>
				<wikidot:authorName>Faroth</wikidot:authorName>				<wikidot:authorUserId>298298</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

Sorry, I don't have any use for the pheromones or the other stuff.

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-159713#post-495745</guid>
				<title>Re: I need 1 Lightning Rune</title>
				<link>http://bvs.wikidot.com/forum/t-159713/i-need-1-lightning-rune#post-495745</link>
				<description></description>
				<pubDate>Mon, 01 Jun 2009 04:24:25 +0000</pubDate>
				<wikidot:authorName>neji369</wikidot:authorName>								<content:encoded>
					<![CDATA[

i dont have much but ill trade 4 monochrome pheomones, 5 powerful potions,a Nightshade,and 10 crumbling minerals?

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-159713#post-495372</guid>
				<title>Re: I need 1 Lightning Rune</title>
				<link>http://bvs.wikidot.com/forum/t-159713/i-need-1-lightning-rune#post-495372</link>
				<description></description>
				<pubDate>Sun, 31 May 2009 16:34:17 +0000</pubDate>
				<wikidot:authorName>Faroth</wikidot:authorName>				<wikidot:authorUserId>298298</wikidot:authorUserId>				<content:encoded>
					<![CDATA[

I've got a spare Lightning Rune, what do you have to trade for it?

				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://bvs.wikidot.com/forum/t-159713#post-495337</guid>
				<title>I need 1 Lightning Rune</title>
				<link>http://bvs.wikidot.com/forum/t-159713/i-need-1-lightning-rune#post-495337</link>
				<description></description>
				<pubDate>Sun, 31 May 2009 15:38:37 +0000</pubDate>
				<wikidot:authorName>neji369</wikidot:authorName>								<content:encoded>
					<![CDATA[

i need it to complete my dustcloak of sneaking

				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingLeft="16dp"
                android:paddingRight="16dp"
                android:paddingTop="16dp"
                android:paddingBottom="16dp"
                tools:context="com.hfad.messenger.ReceiveMessageActivity">
  <TextView android:id="@+id/message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
</RelativeLayout>


text:
var searchData=
[
  ['professorsmodel_2ephp',['ProfessorsModel.php',['../ProfessorsModel_8php.html',1,'']]]
];


text:
/** @file  socket_utils.h
 *  @brief Socket handling utilities.
 */
/* Copyright (C) 2006,2007,2008,2015 Olly Betts
 * Copyright (C) 2008 Lemur Consulting Ltd
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 */

#ifndef XAPIAN_INCLUDED_SOCKET_UTILS_H
#define XAPIAN_INCLUDED_SOCKET_UTILS_H

#include "xapian/common/safenetdb.h"
#include "xapian/common/safeunistd.h"

#ifdef __WIN32__

#include "xapian/common/safewinsock2.h"

/// Convert an fd (which might be a socket) to a WIN32 HANDLE.
extern HANDLE fd_to_handle(int fd);

/// Close an fd, which might be a socket.
extern void close_fd_or_socket(int fd);

#else

// For INET_ADDRSTRLEN and INET6_ADDRSTRLEN.
#include <arpa/inet.h>

// There's no distinction between sockets and other fds on UNIX.
inline void close_fd_or_socket(int fd) { close(fd); }

#endif

/** Attempt to set socket-level timeouts.
 *
 *  These aren't supported by all platforms, and some platforms allow them to
 *  set but ignore them, so we can't easily report failure.
 *
 *  Also sets SO_KEEPALIVE (if supported), which should ensure a stuck
 *  connection will eventually time out, though it may take up to ~2 hours.
 */
void set_socket_timeouts(int fd, double timeout);

constexpr size_t PRETTY_IP6_LEN =
    (INET6_ADDRSTRLEN > INET_ADDRSTRLEN ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN);

int pretty_ip6(const void* p, char* buf);

#endif // XAPIAN_INCLUDED_SOCKET_UTILS_H


text:
#pragma once

#include <vector>
#include <string>
#include <map>

#include "PackageLocales.h"
#include "Config.h"

class CConfigXML;
class CPackageResource;

// Encapsulates a widget package.
//
class CPnC : public Iw3cConfig
{
public:
	CPnC();
	CPnC(CPackageLocales locales);
	~CPnC(void);

	bool Load(CPackageResource* resource, bool validate = true);
	bool LoadZip(std::wstring filepath, bool validate = true);
	CPackageResource* GetResource(void);
	void GetFaults(std::vector<std::wstring>& faults);

	// Iw3cConfig members.
	virtual bool GetId(std::wstring& id);
	virtual bool GetVersion(std::wstring& version);
	virtual bool GetWidth(size_t& width);
	virtual bool GetHeight(size_t& height);
	virtual bool GetViewModes(std::wstring& viewmodes);

	virtual bool GetName(std::wstring& name);
	virtual bool GetShortName(std::wstring& name);
	virtual bool GetDescription(std::wstring& description);

	virtual bool GetStartFile(std::wstring& name);
	virtual bool GetStartFileContentType(std::wstring& type);
	virtual bool GetStartFileEncoding(std::wstring& encoding);

	virtual bool GetAuthor(std::wstring& author);
	virtual bool GetAuthorHref(std::wstring& authorHref);
	virtual bool GetAuthorEmail(std::wstring& authorEmail);

	virtual bool GetLicense(std::wstring& license);
	virtual bool GetLicenseHref(std::wstring& licenseHref);
	virtual bool GetLicenseFile(std::wstring& licenseFile);

	virtual size_t GetIconCount();
	virtual bool GetIcon(size_t idx, std::wstring& path, int& width, int& height);

	virtual size_t GetFeatureCount();
	virtual bool GetFeature(size_t idx, std::wstring& name, bool& required, size_t& paramCount);
	virtual bool GetFeatureParam(std::wstring featureName, size_t idx, std::wstring& name, std::wstring& val);

	virtual size_t GetPreferenceCount();
	virtual bool GetPreference(size_t idx, std::wstring& name, std::wstring& val, bool& readOnly);

private:
	CPackageResource* m_packageResource;
	CPackageLocales m_locales;
	CConfigXML* m_config;
	std::vector<std::wstring> m_faults;

	// Maintain a local cache of icons as not all those in the configuration
	// will be available depending on selected locale.
	class IconInfo
	{
	public:
		std::wstring m_path;
		int m_width;
		int m_height;
	};
	typedef std::vector<IconInfo> ICON_VEC;
	ICON_VEC m_icons;

	// Fast lookup of icons we know about.
	typedef std::map<std::wstring,bool> ICON_LOOKUP;
	ICON_LOOKUP m_iconLookup;

	bool LoadPackage(bool validate);
	bool ValidatePackage();
	std::wstring FindLocaleFile(std::wstring langCode, std::wstring findPath);
	std::wstring FindFileInPackage(std::wstring findPath);
	bool ValidateImageContentType(std::wstring& filePath);
};


text:
<query id="getMemberInfoByMemberSrl" action="select">
    <tables>
        <table name="member" />
    </tables>
    <columns>
        <column name="*" />
    </columns>
    <conditions>
        <condition operation="equal" column="member_srl" var="member_srl" notnull="notnull" />
    </conditions>
</query>


text:
package com.akh.algorithms.stringAlgorithms;

import static org.junit.Assert.assertEquals;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.Test;

/**
 *  @fileName: FindFirstUniqueChar.java
 *  @author: Akhash Ramamurthy
 *  Created on: Aug 9, 2018
 *  Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.

Examples:

s = "leetcode"
return 0.

s = "loveleetcode",
return 2.
Note: You may assume the string contain only lowercase letters.
 */

public class FindFirstUniqueChar {

	public int firstUniqChar(String s) {
		if(s == null || s.length() == 0)
			return -1;

		s = s.toLowerCase();

		Map<Character, Integer> map = new HashMap<>();
		for(char c : s.toCharArray()) {
			if(map.containsKey(c))
				map.put(c, map.get(c)+1);
			else {
				map.put(c, 1);
			}
		}

		int index = -1;
		for(char c : s.toCharArray()) {
			index++;
			if(map.containsKey(c)) {
				if(map.get(c) == 1) {
					return index;
				}
			}
		}
		return -1;
	}

	@Test
	public void test_1() {
		FindFirstUniqueChar findFirstUniqueChar = new FindFirstUniqueChar();
		String s = "leetcode";
		assertEquals(0, findFirstUniqueChar.firstUniqChar(s));
	}

	@Test
	public void test_2() {
		FindFirstUniqueChar findFirstUniqueChar = new FindFirstUniqueChar();
		String s = "loveleetcode";
		assertEquals(2, findFirstUniqueChar.firstUniqChar(s));
	}

	@Test
	public void test_no_unique() {
		FindFirstUniqueChar findFirstUniqueChar = new FindFirstUniqueChar();
		String s = "aabbccdd";
		assertEquals(-1, findFirstUniqueChar.firstUniqChar(s));
	}

	@Test
	public void test_null() {
		FindFirstUniqueChar findFirstUniqueChar = new FindFirstUniqueChar();
		String s = null;
		assertEquals(-1, findFirstUniqueChar.firstUniqChar(s));
	}

	@Test
	public void test_empty_string() {
		FindFirstUniqueChar findFirstUniqueChar = new FindFirstUniqueChar();
		String s = "";
		assertEquals(-1, findFirstUniqueChar.firstUniqChar(s));
	}

	@Test
	public void test_uppercase() {
		FindFirstUniqueChar findFirstUniqueChar = new FindFirstUniqueChar();
		String s = "aaBcCdd";
		assertEquals(2, findFirstUniqueChar.firstUniqChar(s));
	}

	@Test
	public void test_number() {
		FindFirstUniqueChar findFirstUniqueChar = new FindFirstUniqueChar();
		String s = "aa1cc1111112dd";
		assertEquals(11, findFirstUniqueChar.firstUniqChar(s));
	}

}