text:
/* eslint-disable no-useless-escape */

import timm from 'timm';
import isEqual from 'lodash/isEqual';
import { constants as k } from 'storyboard-core';

const mainStoryPathStr = (fServer) => (fServer ? 'records/1' : 'records/0');

const buildMainStory = (fServer) => {
  const idx = fServer ? 1 : 0;
  const id = `main_${idx}`;
  const story = {
    id,
    storyId: id,
    pathStr: mainStoryPathStr(fServer),
    fStoryObject: true,
    t: new Date().getTime(),
    src: 'main',
    title: fServer ? 'Server' : 'Client',
    fServer,
    lastAction: 'CREATED',
    fOpen: true,
    fMain: true,
    status: undefined,
    fExpanded: true,
    fHierarchical: true,
    records: [],
    numRecords: 0,
  };
  return story;
};

const buildInitialState = (localHubId) => ({
  localHubId,
  mainStory: {
    fWrapper: true,
    fOpen: true,
    fExpanded: true,
    fHierarchical: true,
    records: [buildMainStory(false), buildMainStory(true)],
  },
  openStories: {},
  closedStories: {},
  quickFind: '',
});

// ---------------------------------------------
// Reducer
// ---------------------------------------------
const reducer = (state0, action, settings = {}) => {
  const state = state0 != null ? state0 : buildInitialState();

  // Clean up the main story after connecting
  // (we don't want to carry over logs from a previous page)
  if (action.type === 'CX_CONNECTED') return buildInitialState(action.hubId);
  if (action.type === 'CLEAR_LOGS') return buildInitialState();

  if (action.type === 'RECORDS_RECEIVED') return rxRecords(state, action, settings);

  if (action.type === 'FORGET') return forgetRecords(state, action, settings);

  if (action.type === 'TOGGLE_EXPANDED') {
    if (action.pathStr == null) return state;
    const path = (`mainStory/${action.pathStr}/fExpanded`).split('/');
    return timm.updateIn(state, path, (fExpanded) => !fExpanded);
  }

  if (action.type === 'TOGGLE_HIERARCHICAL') {
    if (action.pathStr == null) return state;
    const path = (`mainStory/${action.pathStr}/fHierarchical`).split('/');
    return timm.updateIn(state, path, (fHierarchical) => !fHierarchical);
  }

  if (action.type === 'TOGGLE_ATTACHMENT') {
    let { pathStr } = action;
    const { recordId } = action;
    if (pathStr == null || recordId == null) return state;
    pathStr = `mainStory/${pathStr}`;
    const story = timm.getIn(state, pathStr.split('/'));
    if (story == null) return state;
    const recordPathStr = findRecord(story, recordId, !story.fHierarchical, pathStr);
    if (recordPathStr == null) return state;
    const recordPath = recordPathStr.split('/');
    const record = timm.getIn(state, recordPath);
    recordPath.push('objExpanded');
    return timm.setIn(state, recordPath, !record.objExpanded);
  }

  if (action.type === 'EXPAND_ALL_STORIES') return expandCollapseAll(state, true);
  if (action.type === 'COLLAPSE_ALL_STORIES') return expandCollapseAll(state, false);

  if (action.type === 'QUICK_FIND') {
    const { txt } = action;
    let quickFind;
    if (txt.length) {
      quickFind = txt.replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, '\\$1');
      quickFind = `(${quickFind})`;
    } else {
      quickFind = '';
    }
    return timm.set(state, 'quickFind', quickFind);
  }

  return state;
};

// ---------------------------------------------
// Adding records
// ---------------------------------------------
const rxRecords = (state0, action, settings) => {
  let state = state0;
  const { records, fPastRecords, fShorthandForDuplicates } = action;
  const options = timm.merge(settings, { fPastRecords, fShorthandForDuplicates });
  const newStories = [];
  for (let i = 0, len = records.length; i < len; i++) {
    const record = records[i];
    if (record.signalType) continue;
    if (record.fStory) {
      const [tempState, pathStr] = rxStory(state, record, options);
      state = tempState;
      if (pathStr) newStories.push(pathStr);
    } else {
      state = rxLog(state, record, options);
    }
  }

  // Don't expand stories that are already closed upon reception
  for (let j = 0, len1 = newStories.length; j < len1; j++) {
    const pathStr = newStories[j];
    const fOpen = timm.getIn(state, (`mainStory/${pathStr}/fOpen`).split('/'));
    if (fOpen) continue;
    state = timm.setIn(state, (`mainStory/${pathStr}/fExpanded`).split('/'), false);
  }
  return state;
};

const rxStory = (state0, record0, options) => {
  let state = state0;
  let record = record0;
  const { fPastRecords, fDiscardRemoteClientLogs } = options;
  const { storyId, fServer, hubId } = record;
  const { localHubId } = state;
  let newStoryPathStr = null;

  // We ignore root stories (beginning by '*') when they are server-side
  // OR they belong to our local hub
  if (storyId[0] === '*') {
    if (fServer || hubId === localHubId) return [state, newStoryPathStr];
    const title = record.title.replace('ROOT STORY', 'REMOTE CLIENT');
    record = timm.set(record, 'title', title);
  }

  // We also ignore stories (not only root ones) when they belong to a remote
  // client and the user doesn't want to see them
  if (fDiscardRemoteClientLogs && (!fServer) && (hubId !== localHubId)) {
    return [state, newStoryPathStr];
  }

  // Check whether we already have a story object for this `storyId`
  // and update it with this record. Normally we only
  // check in our list of open stories, except if we know
  // that we're receiving past records
  const { openStories } = state;
  let pathStr = openStories[storyId];
  if (pathStr == null && fPastRecords) pathStr = state.closedStories[storyId];
  let rootStoryIdx;
  if (pathStr != null) {
    state = updateStory(state, pathStr, record);
    state = addLog(state, pathStr, record, options).state;
    rootStoryIdx = pathStr.split('/')[1];

  // It's a new story. Look for the *most suitable parent* and create
  // a new child story object. The *most suitable parent* is
  // obtained as the first client-side parent, or otherwise the first
  // server-side parent
  } else {
    const { parents } = record;
    if (parents != null && parents.length) {
      let parentStoryId = parents.find((o) => o[0] === 'c');
      if (parentStoryId == null) parentStoryId = parents[0];
      pathStr = openStories[parentStoryId];
      if (pathStr == null && fPastRecords) pathStr = state.closedStories[parentStoryId];
    }
    if (pathStr == null) pathStr = mainStoryPathStr(fServer);
    [state, newStoryPathStr] = addStory(state, pathStr, record, options);
    state = addLog(state, newStoryPathStr, record, options).state;
    rootStoryIdx = newStoryPathStr.split('/')[1];
  }

  // Increment counter
  state = timm.updateIn(state, ['mainStory', 'records', rootStoryIdx, 'numRecords'],
    (o) => o + 1);

  // We return the new state, as well as the path of the new story (if any)
  return [state, newStoryPathStr];
};

const updateStory = (state0, pathStr, record) => {
  let state = state0;
  const { fOpen, title, status, action, storyId } = record;
  const path = `mainStory/${pathStr}`.split('/');
  const prevStory = timm.getIn(state, path);
  const nextStory = timm.merge(prevStory, { fOpen, title, status, lastAction: action });
  state = timm.setIn(state, path, nextStory);
  if (!nextStory.fOpen) {
    state = timm.setIn(state, ['openStories', storyId], undefined);
    state = timm.setIn(state, ['closedStories', storyId], pathStr);
  }
  return state;
};

const addStory = (state0, parentStoryPathStr, record, options) => {
  let state = state0;
  const { fCollapseAllNewStories } = options;
  const parentRecordsPath = `mainStory/${parentStoryPathStr}/records`.split('/');
  const parentRecords = timm.getIn(state, parentRecordsPath);
  const pathStr = `${parentStoryPathStr}/records/${parentRecords.length}`;
  const story = timm.merge(record, {
    pathStr,
    records: [],
    fStoryObject: true,
    lastAction: record.action,
    fExpanded: !fCollapseAllNewStories,
    fHierarchical: true,
  });
  delete story.fStory;
  delete story.action;
  state = timm.setIn(state, `mainStory/${pathStr}`.split('/'), story);
  const pathSeg = story.fOpen ? 'openStories' : 'closedStories';
  state = timm.setIn(state, [pathSeg, story.storyId], pathStr);
  return [state, pathStr];
};

const rxLog = (state0, record, options) => {
  let state = state0;
  const { localHubId } = state;
  const { storyId, fServer, hubId } = record;
  const { fDiscardRemoteClientLogs } = options;
  if (fDiscardRemoteClientLogs && (!fServer) && hubId !== localHubId) return state;
  const pathStr = state.openStories[storyId] != null
    ? state.openStories[storyId]
    : mainStoryPathStr(fServer);
  const { state: tmpState, fDuplicate } = addLog(state, pathStr, record, options);
  state = tmpState;
  if (!fDuplicate) {
    const rootStoryIdx = pathStr.split('/')[1];
    state = timm.updateIn(state, ['mainStory', 'records', rootStoryIdx, 'numRecords'],
      (o) => o + 1);
  }
  return state;
};

const addLog = (state0, pathStr, record0, options) => {
  let state = state0;
  let record = record0;
  const { fPastRecords, fExpandAllNewAttachments, fShorthandForDuplicates = true } = options;
  const path = `mainStory/${pathStr}/records`.split('/');
  record = timm.set(record, 'objExpanded', !!fExpandAllNewAttachments);
  let fDuplicate = false;
  let nextRecords;
  state = timm.updateIn(state, path, (prevRecords) => {
    // Handle duplicates when including past records
    if (fPastRecords) {
      const { storyId, id } = record;
      if (prevRecords.find((o) => o.storyId === storyId && o.id === id)) {
        return prevRecords;
      }
    }

    // Handle consecutive repetitions
    if (fShorthandForDuplicates && !record.fStory) {
      const idx = prevRecords.length - 1;
      const prevLastRecord = prevRecords[idx];
      if (prevLastRecord != null &&
        prevLastRecord.msg === record.msg &&
        prevLastRecord.src === record.src &&
        isEqual(prevLastRecord.obj, record.obj)
      ) {
        fDuplicate = true;
        const repetitions = prevLastRecord.repetitions || 0;
        const nextLastRecord = timm.merge(prevLastRecord, {
          repetitions: repetitions + 1,
          tLastRepetition: record.t,
        });
        nextRecords = timm.replaceAt(prevRecords, idx, nextLastRecord);
      }
    }

    // Normal case
    if (nextRecords == null) nextRecords = timm.addLast(prevRecords, record);
    return nextRecords;
  });

  // Flag stories containing warnings and errors
  const fWarn = record.level === k.LEVEL_STR_TO_NUM.WARN;
  const fError = record.level >= k.LEVEL_STR_TO_NUM.ERROR;
  if (fWarn || fError) {
    const recurPath = [].concat(path);
    while (true) {  // eslint-disable-line no-constant-condition
      recurPath.pop();  // recurPath is now the story path
      const story = timm.getIn(state, recurPath);
      if (story.fMain) break;
      if (fWarn && !story.fHasWarning) {
        state = timm.setIn(state, recurPath.concat(['fHasWarning']), true);
      }
      if (fError && !story.fHasError) {
        state = timm.setIn(state, recurPath.concat(['fHasError']), true);
      }
      recurPath.pop();
    }
  }

  return { state, fDuplicate };
};

// ---------------------------------------------
// Forgetting records
// ---------------------------------------------
const forgetRecords = (state0, action, settings) => {
  let state = state0;
  const { pathStr } = action;
  const { maxRecords, forgetHysteresis } = settings;
  const path = `mainStory/${pathStr}`.split('/');
  const prevStory = timm.getIn(state, path);
  const { numRecords } = prevStory;
  const targetForget = Math.ceil((numRecords - maxRecords) + (maxRecords * forgetHysteresis));
  const { nextStory, numForgotten, updatedStoryPaths } =
    forgetRecursively(prevStory, targetForget, {}, prevStory.pathStr);
  nextStory.numRecords = numRecords - numForgotten;
  state = timm.setIn(state, path, nextStory);
  const openStories = updateStoryPaths(state.openStories, updatedStoryPaths);
  const closedStories = updateStoryPaths(state.closedStories, updatedStoryPaths);
  state = timm.merge(state, { openStories, closedStories });
  return state;
};

/* eslint-disable no-param-reassign */
const forgetRecursively = (prevStory, targetForget, updatedStoryPaths, storyPathStr) => {
  let numForgotten = 0;
  const nextRecords = [];
  const prevRecords = prevStory.records;
  const prevRecordsLen = prevRecords.length;

  // Forget records
  let idx = 0;
  while (idx < prevRecordsLen) {
    const prevRecord = prevRecords[idx];
    const fEnoughForgotten = numForgotten >= targetForget;

    // Action records are never forgotten
    if (prevRecord.fStory) {
      nextRecords.push(prevRecord);

    // Stories
    } else if (prevRecord.fStoryObject) {
      // Closed story objects are forgotten as a whole
      if (!fEnoughForgotten && !prevRecord.fOpen) {
        numForgotten += numStoryRecords(prevRecord);
        const storyIds = collectChildStoryIds(prevRecord);
        for (let i = 0; i < storyIds.length; i++) {
          updatedStoryPaths[storyIds[i]] = null;
        }
        updatedStoryPaths[prevRecord.storyId] = null;

      // Other cases: open stories, or enough forgotten. Copy at least some records
      } else {
        const childPathStr = `${storyPathStr}/records/${nextRecords.length}`;
        const targetChildForget = fEnoughForgotten ? 0 : targetForget - numForgotten;
        const result = forgetRecursively(prevRecord, targetChildForget,
          updatedStoryPaths, childPathStr);
        const nextChildStory = timm.set(result.nextStory, 'pathStr', childPathStr);
        nextRecords.push(nextChildStory);
        numForgotten += result.numForgotten;
        updatedStoryPaths[prevRecord.storyId] = childPathStr;
      }

    // Normal logs
    } else if (fEnoughForgotten) {
      nextRecords.push(prevRecord);
    } else {
      numForgotten += 1;
    }

    idx += 1;
  }

  const nextStory = timm.set(prevStory, 'records', nextRecords);
  return { nextStory, numForgotten, updatedStoryPaths };
};
/* eslint-enable no-param-reassign */

const numStoryRecords = (story) => {
  const { records } = story;
  let num = 0;
  for (let i = 0; i < records.length; i++) {
    const record = records[i];
    if (record.fStoryObject) num += numStoryRecords(record);
    else num += 1;
  }
  return num;
};

const collectChildStoryIds = (story, storyIds = []) => {
  const { records } = story;
  for (let i = 0; i < records.length; i++) {
    const record = records[i];
    if (!record.fStoryObject) continue;
    storyIds.push(record.storyId);
    collectChildStoryIds(record, storyIds);
  }
  return storyIds;
};

const updateStoryPaths = (storyHash0, updatedStoryPaths) => {
  let storyHash = storyHash0;
  const storyIds = Object.keys(updatedStoryPaths);
  for (let i = 0; i < storyIds.length; i++) {
    const storyId = storyIds[i];
    let pathStr = updatedStoryPaths[storyId];
    if (storyHash[storyId] != null) {
      if (pathStr === null) pathStr = undefined;
      storyHash = timm.set(storyHash, storyId, pathStr);
    }
  }
  return storyHash;
};

// ---------------------------------------------
// Expand/collapse all
// ---------------------------------------------
const expandCollapseAll = (state, fExpanded) => {
  // Returns a new subtree, expanding/collapsing child stories
  const expandCollapse = (prevStory) => {
    const nextRecords = prevStory.records.map(expandCollapseRecord);
    const nextStory = timm.set(prevStory, 'records', nextRecords);
    if (!(nextStory.fWrapper || nextStory.fMain)) {
      nextStory.fExpanded = fExpanded;  // in-place since it is always a new object
    }
    return nextStory;
  };

  // Returns:
  // - For normal records (logs): the same record
  // - For story objects: the expanded/collapsed record
  const expandCollapseRecord = (prevRecord) => {
    if (!prevRecord.fStoryObject) return prevRecord;
    return expandCollapse(prevRecord);
  };

  // Run recursive algorithm
  return timm.set(state, 'mainStory', expandCollapse(state.mainStory));
};

// ---------------------------------------------
// Helpers
// ---------------------------------------------
const findRecord = (story, recordId, fRecurse, pathStr) => {
  const { records } = story;
  for (let idx = 0; idx < records.length; idx++) {
    const record = records[idx];
    if (record.id === recordId) return `${pathStr}/records/${idx}`;
    if (record.fStoryObject && fRecurse) {
      const res = findRecord(record, recordId, fRecurse, `${pathStr}/records/${idx}`);
      if (res != null) return res;
    }
  }
  return null;
};

// ---------------------------------------------
// API
// ---------------------------------------------
export default reducer;


text:
<?php
/**
 * The production database settings. These get merged with the global settings.
 */
return array(
	'default' => array(
		'type'        => 'mysqli',
		'connection'  => array(
			'hostname'   => getenv('RDS_HOSTNAME'),
			'port'       => getenv('RDS_PORT'),
			'database'   => getenv('RDS_DB_NAME'),
			'username'   => getenv('RDS_USERNAME'),
			'password'   => getenv('RDS_PASSWORD'),
		)
	),
);

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace ACopyLib.Exceptions
{
    public class NotValidDataException: Exception
    {
        public NotValidDataException()
        {
        }

        public NotValidDataException(string message)
            : base(message)
        {
        }
    }
}


text:
module CloudFoundry
  class Client
    # CloudFoundry::Client Exceptions.
    module Exception
      # CloudFoundry Client Exception: Authorization Error.
      class AuthError < RuntimeError; end
      # CloudFoundry Client Exception: Bad Parameters.
      class BadParams < RuntimeError; end
      # CloudFoundry Client Exception: Bad Response Received.
      class BadResponse < RuntimeError; end

      # CloudFoundry Cloud Exception: Bad Request.
      class BadRequest < RuntimeError; end
      # CloudFoundry Cloud Exception: Forbidden.
      class Forbidden < RuntimeError; end
      # CloudFoundry Cloud Exception: Not Found.
      class NotFound < RuntimeError; end
      # CloudFoundry Cloud Exception: Server Error.
      class ServerError < RuntimeError; end
      # CloudFoundry Cloud Exception: Bad Gateway.
      class BadGateway < RuntimeError; end
    end
  end
end


text:
<!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="style-util.html">
<link rel="import" href="settings.html">

<script>

  Polymer.StyleTransformer = (function() {

    var styleUtil = Polymer.StyleUtil;
    var settings = Polymer.Settings;

    /* Transforms ShadowDOM styling into ShadyDOM styling

     * scoping:

        * elements in scope get scoping selector class="x-foo-scope"
        * selectors re-written as follows:

          div button -> div.x-foo-scope button.x-foo-scope

     * :host -> scopeName

     * :host(...) -> scopeName...

     * ::content -> ' '

     * ::shadow, /deep/: processed similar to ::content

     * :host-context(...): scopeName..., ... scopeName

    */
    var api = {

      // Given a node and scope name, add a scoping class to each node
      // in the tree. This facilitates transforming css into scoped rules.
      dom: function(node, scope, useAttr, shouldRemoveScope) {
        this._transformDom(node, scope || '', useAttr, shouldRemoveScope);
      },

      _transformDom: function(node, selector, useAttr, shouldRemoveScope) {
        if (node.setAttribute) {
          this.element(node, selector, useAttr, shouldRemoveScope);
        }
        var c$ = Polymer.dom(node).childNodes;
        for (var i=0; i<c$.length; i++) {
          this._transformDom(c$[i], selector, useAttr, shouldRemoveScope);
        }
      },

      element: function(element, scope, useAttr, shouldRemoveScope) {
        if (useAttr) {
          if (shouldRemoveScope) {
            element.removeAttribute(SCOPE_NAME);
          } else {
            element.setAttribute(SCOPE_NAME, scope);
          }
        } else {
          // note: if using classes, we add both the general 'style-scope' class
          // as well as the specific scope. This enables easy filtering of all
          // `style-scope` elements
          if (scope) {
            // note: svg on IE does not have classList so fallback to class
            if (element.classList) {
              if (shouldRemoveScope) {
                element.classList.remove(SCOPE_NAME);
                element.classList.remove(scope);
              } else {
                element.classList.add(SCOPE_NAME);
                element.classList.add(scope);
              }
            } else if (element.getAttribute) {
              var c = element.getAttribute(CLASS);
              if (shouldRemoveScope) {
                if (c) {
                  element.setAttribute(CLASS, c.replace(SCOPE_NAME, '')
                    .replace(scope, ''));
                }
              } else {
                element.setAttribute(CLASS, (c ? c + ' ' : '') +
                  SCOPE_NAME + ' ' + scope);
              }
            }
          }
        }
      },

      elementStyles: function(element, callback) {
        var styles = element._styles;
        var cssText = '';
        var cssBuildType = element.__cssBuild;
        for (var i=0, l=styles.length, s; (i<l) && (s=styles[i]); i++) {
          var rules = styleUtil.rulesForStyle(s);
          // no need to shim selectors if settings.useNativeShadow, also
          // a shady css build will already have transformed selectors
          // NOTE: This method may be called as part of static or property shimming.
          // When there is a targeted build it will not be called for static shimming,
          // but when the property shim is used it is called and should opt out of
          // static shimming work when a proper build exists.
          cssText += (settings.useNativeShadow || cssBuildType === 'shady') ?
            styleUtil.toCssText(rules, callback) :
            this.css(rules, element.is, element.extends, callback,
            element._scopeCssViaAttr) + '\n\n';
        }
        return cssText.trim();
      },

      // Given a string of cssText and a scoping string (scope), returns
      // a string of scoped css where each selector is transformed to include
      // a class created from the scope. ShadowDOM selectors are also transformed
      // (e.g. :host) to use the scoping selector.
      css: function(rules, scope, ext, callback, useAttr) {
        var hostScope = this._calcHostScope(scope, ext);
        scope = this._calcElementScope(scope, useAttr);
        var self = this;
        return styleUtil.toCssText(rules, function(rule) {
          if (!rule.isScoped) {
            self.rule(rule, scope, hostScope);
            rule.isScoped = true;
          }
          if (callback) {
            callback(rule, scope, hostScope);
          }
        });
      },

      _calcElementScope: function (scope, useAttr) {
        if (scope) {
          return useAttr ?
            CSS_ATTR_PREFIX + scope + CSS_ATTR_SUFFIX :
            CSS_CLASS_PREFIX + scope;
        } else {
          return '';
        }
      },

      _calcHostScope: function(scope, ext) {
        return ext ? '[is=' +  scope + ']' : scope;
      },

      rule: function (rule, scope, hostScope) {
        this._transformRule(rule, this._transformComplexSelector,
          scope, hostScope);
      },

      // transforms a css rule to a scoped rule.
      _transformRule: function(rule, transformer, scope, hostScope) {
        // NOTE: save transformedSelector for subsequent matching of elements
        // against selectors (e.g. when calculating style properties)
        rule.selector = rule.transformedSelector =
          this._transformRuleCss(rule, transformer, scope, hostScope);
      },

      _transformRuleCss: function(rule, transformer, scope, hostScope) {
        var p$ = rule.selector.split(COMPLEX_SELECTOR_SEP);
        // we want to skip transformation of rules that appear in keyframes,
        // because they are keyframe selectors, not element selectors.
        if (!styleUtil.isKeyframesSelector(rule)) {
          for (var i=0, l=p$.length, p; (i<l) && (p=p$[i]); i++) {
            p$[i] = transformer.call(this, p, scope, hostScope);
          }
        }
        return p$.join(COMPLEX_SELECTOR_SEP);
      },

      _transformComplexSelector: function(selector, scope, hostScope) {
        var stop = false;
        var hostContext = false;
        var self = this;
        selector = selector.trim();
        selector = selector.replace(CONTENT_START, HOST + ' $1');
        selector = selector.replace(SIMPLE_SELECTOR_SEP, function(m, c, s) {
          if (!stop) {
            var info = self._transformCompoundSelector(s, c, scope, hostScope);
            stop = stop || info.stop;
            hostContext = hostContext || info.hostContext;
            c = info.combinator;
            s = info.value;
          } else {
            s = s.replace(SCOPE_JUMP, ' ');
          }
          return c + s;
        });
        if (hostContext) {
          selector = selector.replace(HOST_CONTEXT_PAREN,
            function(m, pre, paren, post) {
              return pre + paren + ' ' + hostScope + post +
                COMPLEX_SELECTOR_SEP + ' ' + pre + hostScope + paren + post;
             });
        }
        return selector;
      },

      _transformCompoundSelector: function(selector, combinator, scope, hostScope) {
        // replace :host with host scoping class
        var jumpIndex = selector.search(SCOPE_JUMP);
        var hostContext = false;
        if (selector.indexOf(HOST_CONTEXT) >=0) {
          hostContext = true;
        } else if (selector.indexOf(HOST) >=0) {
          selector = this._transformHostSelector(selector, hostScope);
        // replace other selectors with scoping class
        } else if (jumpIndex !== 0) {
          selector = scope ? this._transformSimpleSelector(selector, scope) :
            selector;
        }
        // remove left-side combinator when dealing with ::content.
        if (selector.indexOf(CONTENT) >= 0) {
          combinator = '';
        }
        // process scope jumping selectors up to the scope jump and then stop
        // e.g. .zonk ::content > .foo ==> .zonk.scope > .foo
        var stop;
        if (jumpIndex >= 0) {
          selector = selector.replace(SCOPE_JUMP, ' ');
          stop = true;
        }
        return {value: selector, combinator: combinator, stop: stop,
          hostContext: hostContext};
      },

      _transformSimpleSelector: function(selector, scope) {
        var p$ = selector.split(PSEUDO_PREFIX);
        p$[0] += scope;
        return p$.join(PSEUDO_PREFIX);
      },

      // :host(...) -> scopeName...
      _transformHostSelector: function(selector, hostScope) {
        var m = selector.match(HOST_PAREN);
        var paren = m && m[2].trim() || '';
        if (paren) {
          if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) {
            // paren starts with a type selector
            var typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];
            // if the type selector is our hostScope then avoid pre-pending it
            if (typeSelector === hostScope) {
              return paren;
            // otherwise, this selector should not match in this scope so
            // output a bogus selector.
            } else {
              return SELECTOR_NO_MATCH;
            }
          } else {
            // make sure to do a replace here to catch selectors like:
            // `:host(.foo)::before`
            return selector.replace(HOST_PAREN, function(m, host, paren) {
              return hostScope + paren;
            });
          }
        // if no paren, do a straight :host replacement.
        // TODO(sorvell): this should not strictly be necessary but
        // it's needed to maintain support for `:host[foo]` type selectors
        // which have been improperly used under Shady DOM. This should be
        // deprecated.
        } else {
          return selector.replace(HOST, hostScope);
        }
      },

      documentRule: function(rule) {
        // reset selector in case this is redone.
        rule.selector = rule.parsedSelector;
        this.normalizeRootSelector(rule);
        if (!settings.useNativeShadow) {
          this._transformRule(rule, this._transformDocumentSelector);
        }
      },

      normalizeRootSelector: function(rule) {
        if (rule.selector === ROOT) {
          rule.selector = 'html';
        }
      },

      _transformDocumentSelector: function(selector) {
        return selector.match(SCOPE_JUMP) ?
          this._transformComplexSelector(selector, SCOPE_DOC_SELECTOR) :
          this._transformSimpleSelector(selector.trim(), SCOPE_DOC_SELECTOR);
      },

      SCOPE_NAME: 'style-scope'
    };

    var SCOPE_NAME = api.SCOPE_NAME;
    var SCOPE_DOC_SELECTOR = ':not([' + SCOPE_NAME + '])' +
      ':not(.' + SCOPE_NAME + ')';
    var COMPLEX_SELECTOR_SEP = ',';
    var SIMPLE_SELECTOR_SEP = /(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g;
    var SIMPLE_SELECTOR_PREFIX = /[[.:#*]/;
    var HOST = ':host';
    var ROOT = ':root';
    // NOTE: this supports 1 nested () pair for things like
    // :host(:not([selected]), more general support requires
    // parsing which seems like overkill
    var HOST_PAREN = /(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/;
    var HOST_CONTEXT = ':host-context';
    var HOST_CONTEXT_PAREN = /(.*)(?::host-context)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))(.*)/;
    var CONTENT = '::content';
    var SCOPE_JUMP = /::content|::shadow|\/deep\//;
    var CSS_CLASS_PREFIX = '.';
    var CSS_ATTR_PREFIX = '[' + SCOPE_NAME + '~=';
    var CSS_ATTR_SUFFIX = ']';
    var PSEUDO_PREFIX = ':';
    var CLASS = 'class';
    var CONTENT_START = new RegExp('^(' + CONTENT + ')');
    var SELECTOR_NO_MATCH = 'should_not_match';

    // exports
    return api;

  })();

</script>


text:
#region LGPL License

#endregion

using System;
using System.Collections;

using Axiom.Graphics;

namespace Axiom.Core {
    /// <summary>
    ///     Enumerates the SceneManager classes available to applications.
    /// </summary>
    /// <remarks>
    ///     As described in the SceneManager class, SceneManagers are responsible
    ///     for organizing the scene and issuing rendering commands to the
    ///     RenderSystem. Certain scene types can benefit from different
    ///     rendering approaches, and it is intended that subclasses will
    ///     be created to special case this.
    ///     <p/>
    ///     In order to give applications easy access to these implementations,
    ///     the Root object has a GetSceneManager method to retrieve a SceneManager
    ///     which is appropriate to the scene type. However, this is the class
    ///     which implements this behavior and defines the scene types, because
    ///     it is intended that the Root class is not customized by everybody
    ///     (and it may be restricted access in the future).
    /// </remarks>
    // TODO: Class name no longer matches file name.
    public sealed class SceneManagerEnumerator {
        #region Singleton implementation

        /// <summary>
        ///     Singleton instance of this class.
        /// </summary>
        private static SceneManagerEnumerator instance = new SceneManagerEnumerator();

        /// <summary>
        ///     Internal constructor.  This class cannot be instantiated externally.
        /// </summary>
        internal SceneManagerEnumerator() {
            if (instance == null) {
                instance = this;

                // by default, use the standard scene manager.
                defaultSceneManager = new SceneManager("Default Scene Manager");

                // by default, all scenetypes use the default Scene Manager.  Note: These can be overridden by plugins.
                SetSceneManager(SceneType.Generic, defaultSceneManager);
                SetSceneManager(SceneType.ExteriorClose, defaultSceneManager);
                SetSceneManager(SceneType.ExteriorFar, defaultSceneManager);
                SetSceneManager(SceneType.Interior, defaultSceneManager);
                SetSceneManager(SceneType.Overhead, defaultSceneManager);
            }
        }

        /// <summary>
        ///     Gets the singleton instance of this class.
        /// </summary>
        public static SceneManagerEnumerator Instance {
            get {
                return instance;
            }
        }

        #endregion Singleton implementation

		#region Fields and Properties

        /// <summary>
        ///     Standard scene manager for default management.
        /// </summary>
        private SceneManager defaultSceneManager;
        /// <summary>
        ///     Collection of loaded scene managers, keyed by scene type.
        /// </summary>
        private Hashtable sceneManagers = new Hashtable();

		public SceneManager this[SceneType type]
		{
			set
			{
				sceneManagers[type] = value;

				// Set rendersystem, incase this is set after the rendersystem has already been selected
				// value.TargetRenderSystem = Root.Instance.RenderSystem;
			}
			get
			{

				if (sceneManagers[type] == null)
				{
					throw new AxiomException("Cannot find scene manager for type '{0}'", type);
				}

				return (SceneManager)sceneManagers[type];
			}
		}

        #endregion Fields

        #region Methods

        /// <summary>
        ///     Gets a reference to the scene manager of the specified type.
        /// </summary>
        /// <param name="type">Type of scene manager to retrieve.</param>
        /// <returns>A reference to the scene manager of the specified type.</returns>
        public SceneManager GetSceneManager(SceneType type) {
            return this[type];
        }

        /// <summary>
        ///     Notifies all SceneManagers of the destination rendering system.
        /// </summary>
        /// <param name="system">Current destination render system.</param>
        public void SetRenderSystem(RenderSystem system) {
            // loop through each scene manager and set the new render system
            foreach(SceneManager sceneManager in sceneManagers.Values) {
                sceneManager.TargetRenderSystem = system;
            }
        }

        /// <summary>
        ///     Sets a scene manager implementation for the given type.
        /// </summary>
        /// <param name="type">Type of scene this manager implements.</param>
        /// <param name="manager">Reference to the scene manager.</param>
        public void SetSceneManager(SceneType type, SceneManager manager) {
           this[type] = manager;
        }

        /// <summary>
        ///     Shuts down all registered scene managers.
        /// </summary>
        public void ShutdownAll() {
            // clear the scene of each registered scene manager
            foreach (SceneManager manager in sceneManagers.Values) {
                manager.ClearScene();
            }
        }

        #endregion
    }
}


text:
package org.spongepowered.common.mixin.tracker.server.level;

import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.spongepowered.api.event.CauseStackManager;
import org.spongepowered.api.item.inventory.ItemStackSnapshot;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.common.bridge.world.entity.PlatformEntityBridge;
import org.spongepowered.common.bridge.world.level.LevelBridge;
import org.spongepowered.common.event.SpongeCommonEventFactory;
import org.spongepowered.common.event.tracking.PhaseTracker;
import org.spongepowered.common.item.util.ItemStackUtil;
import org.spongepowered.common.mixin.tracker.world.entity.player.PlayerMixin_Tracker;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

@Mixin(ServerPlayer.class)
public abstract class ServerPlayerMixin_Tracker extends PlayerMixin_Tracker {

    /**
     * @author gabizou - June 4th, 2016
     * @author i509VCB - February 17th, 2020 - 1.14.4
     * @author gabizou - December 31st, 2021 - 1.16.5
     * @reason We inject a construct event for the item drop and conveniently
     * can redirect the super call.
     */
    @Redirect(
        method = "drop",
        at = @At(
            value = "INVOKE",
            target = "Lnet/minecraft/world/entity/player/Player;drop(Lnet/minecraft/world/item/ItemStack;ZZ)Lnet/minecraft/world/entity/item/ItemEntity;"
        )
    )
    @Nullable
    private ItemEntity tracker$throwItemDrop(
        final Player thisPlayer, final ItemStack droppedItem, final boolean dropAround, final boolean traceItem
    ) {
        if (droppedItem.isEmpty()) {
            return null;
        }
        if (((PlatformEntityBridge) this).bridge$isFakePlayer()) {
            return super.shadow$drop(droppedItem, dropAround, traceItem);
        }
        if (((LevelBridge) this.level).bridge$isFake()) {
            return super.shadow$drop(droppedItem, dropAround, traceItem);
        }

        final double posX1 = this.shadow$getX();
        final double posY1 = this.shadow$getEyeY() - (double) 0.3F;
        final double posZ1 = this.shadow$getZ();
        // Now the real fun begins.
        final ItemStack item;
        final ItemStackSnapshot snapshot = ItemStackUtil.snapshotOf(droppedItem);
        final List<ItemStackSnapshot> original = new ArrayList<>();
        original.add(snapshot);

        try (final CauseStackManager.StackFrame frame = PhaseTracker.getCauseStackManager().pushCauseFrame()) {

            item = SpongeCommonEventFactory.throwDropItemAndConstructEvent(
                (ServerPlayer) (Object) this, posX1, posY1, posZ1, snapshot, original, frame);

            if (item == null || item.isEmpty()) {
                return null;
            }

            // Here is where we would potentially perform item pre-merging (merge the item stacks with previously captured item stacks
            // and only if those stacks can be stacked (count increased). Otherwise, we'll just continue to throw the entity item.
            // For now, due to refactoring a majority of all of this code, pre-merging is disabled entirely.

            final ItemEntity itemEntity = new ItemEntity(this.level, posX1, posY1, posZ1, item);
            itemEntity.setPickUpDelay(40);

            if (traceItem) {
                itemEntity.setThrower(this.shadow$getUUID());
            }

            final Random random = this.shadow$getRandom();
            if (dropAround) {
                final float f = random.nextFloat() * 0.5F;
                final float f1 = random.nextFloat() * ((float) Math.PI * 2F);
                itemEntity.setDeltaMovement(-Mth.sin(f1) * f, 0.2F, Mth.cos(f1) * f);
            } else {
                final float f8 = Mth.sin(this.xRot * ((float) Math.PI / 180F));
                final float f2 = Mth.cos(this.xRot * ((float) Math.PI / 180F));
                final float f3 = Mth.sin(this.yRot * ((float) Math.PI / 180F));
                final float f4 = Mth.cos(this.yRot * ((float) Math.PI / 180F));
                final float f5 = this.random.nextFloat() * ((float) Math.PI * 2F);
                final float f6 = 0.02F * this.random.nextFloat();
                itemEntity.setDeltaMovement(
                    (double) (-f3 * f2 * 0.3F) + Math.cos(f5) * (double) f6,
                    (-f8 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F),
                    (double) (f4 * f2 * 0.3F) + Math.sin(f5) * (double) f6
                );
            }
            return itemEntity;
        }
    }
}


text:
package com.classic.android.http.cookie;

import java.util.List;

import okhttp3.Cookie;
import okhttp3.HttpUrl;

@SuppressWarnings({"unused", "WeakerAccess"}) public interface CookieStore {

    void add(HttpUrl uri, List<Cookie> cookie);

    List<Cookie> get(HttpUrl uri);

    List<Cookie> getCookies();

    boolean remove(HttpUrl uri, Cookie cookie);

    boolean removeAll();
}


text:
<?php
session_start();
require "config.php";
?>

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

        <?php
            //print_r($_SESSION);

            //*****************************************

            //user credentials
            $loggedin = false;
            if(isset($_SESSION['username']) && isset($_SESSION['password']))
            {
                $username = $_SESSION['username'];
                $password = $_SESSION['password'];
                $result = mysql_query("select * from users where (users_username = '".$username."' or users_email = '".$username."') and (users_password = '".$password."')");
                if(mysql_num_rows($result) != 0)
                {
                    //printf("Logout
Welcome ".$username."
");
                    $row = mysql_fetch_array($result);
                    printf("Logout
Welcome ".$username.' '."
");
                    $loggedin = true;
                }
                else
                {
                    printf('

Login Register

');
                }
            }
            else
            {
                printf('

Login Register

');
            }

            //Print the posts on the screen
            $result = mysql_query("select * from posts");

            while ($row = mysql_fetch_array($result))
            {
                $title = $row['posts_title'];
                $content = $row['posts_content'];
                $date = $row['posts_date'];
                $username = $row['posts_username'];
                printf("
$title
");
                printf("
$username $date
");
                printf("
$content
");
                printf("
");
            }
            if($loggedin)
            {
                printf("
Add a post!
");
                printf('<form name=post_form action=add_post.php method="get">');
                printf('<input type=text value="Title here" name=title>
');
                printf("<textArea name=post></textArea>
");
                printf('<input type=submit value="Add Post">');
                printf('</form>');
            }

        ?>


text:
/**
 *
 */
var uiMenuList = {
	'title' : 'ui:menuList',
	'description' : 'A menu component that contains menu items.This component is nested in a ui:menu component and can be used together with a ui:menuTriggerLink component. Clicking the menu trigger displays the container with menu items.',
	"selected" : false,
	'attributes' : [
			{
				'name' : 'aura:id',
				'type' : 'String',
				'description' : 'Component ID',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'autoPosition',
				'type' : 'Boolean',
				'description' : 'Move the popup target up when there is not enough space at the bottom to display. Note: even if autoPosition is set to false, popup will still position the menu relative to the trigger. To override default positioning, use manualPosition attribute.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : [ '', 'false', 'true' ]
			},

			{
				'name' : 'class',
				'type' : 'String',
				'description' : 'A CSS style to be attached to the component. This style is added in addition to base styles output by the component.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'closeOnClickOutside',
				'type' : 'Boolean',
				'description' : 'Close target when user clicks or taps outside of the target',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : [ '', 'false', 'true' ]
			},
			{
				'name' : 'closeOnTabKey',
				'type' : 'Boolean',
				'description' : 'Indicates whether to close the target list on tab key or not.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : [ '', 'false', 'true' ]
			},
			{
				'name' : 'curtain',
				'type' : 'Boolean',
				'description' : 'Whether or not to apply an overlay under the target.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : [ '', 'false', 'true' ]
			},
			{
				'name' : 'menuItems',
				'type' : 'List',
				'description' : 'A list of menu items set explicitly using instances of the Java class: aura.components.ui.MenuItem.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'visible',
				'type' : 'Boolean',
				'description' : 'Controls the visibility of the menu. The default is false, which hides the menu.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : [ '', 'false', 'true' ]
			},
			{
				'name' : 'dblclick',
				'type' : 'Event',
				'description' : 'The event fired when the user double-clicks the component.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'mouseover',
				'type' : 'Event',
				'description' : 'The event fired when the user moves the mouse pointer over the component.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'mouseout',
				'type' : 'Event',
				'description' : 'The event fired when the user moves the mouse pointer away from the component.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'mouseup',
				'type' : 'Event',
				'description' : 'The event fired when the user releases the mouse button over the component.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'mousemove',
				'type' : 'Event',
				'description' : 'The event fired when the user moves the mouse pointer over the component.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'click',
				'type' : 'Event',
				'description' : 'The event fired when the user clicks on the component.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'mousedown',
				'type' : 'Event',
				'description' : 'The event fired when the user clicks a mouse button over the component.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'menuExpand',
				'type' : 'Event',
				'description' : 'The event fired when the menu list displays.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'menuSelect',
				'type' : 'Event',
				'description' : 'The event fired when the user select a menu item.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'menuCollapse',
				'type' : 'Event',
				'description' : 'The event fired when the menu list collapses.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			},
			{
				'name' : 'menuFocusChange',
				'type' : 'Event',
				'description' : 'The event fired when the menu list focus changed from one menuItem to another menuItem.',
				'value' : '',
				'isRequired' : false,
				'isMultiValued' : false,
				'validValues' : []
			}

	],
	'nodes' : []
};


text:
var cdb = require('cartodb.js');
var ViewFactory = require('../common/view_factory');
var randomQuote = require('../common/view_helpers/random_quote');
var LikeView = require('../common/views/likes/view');
var MapCardPreview = require('../common/views/mapcard_preview');
var Visualizations = require('./feed_collection');

module.exports = cdb.core.View.extend({
  tagName: 'div',

  _PAGE: 1,
  _ITEMS_PER_PAGE: 8,

  _SMALL_WIDTH: 544,

  _CARD_HEIGHT: 170,
  _LOADER_TITLE: 'Loading visualizations',

  events: {
    'click .js-more': '_onClickMore'
  },

  initialize: function() {
    _.bindAll(this, '_initLike', '_fetchLike', '_onFetchError', '_onWindowResize', '_renderStaticMaps');

    this.maps = [];

    this._initTemplates();
    this._initModels();
    this._initBindings();
  },

  render: function() {
    this.$el.html(this.template());
    this._renderLoader();
    this._fetchItems({ page: this._PAGE });

    return this;
  },

  _onWindowResize: function() {
    var width = $(window).width();

    if (width <= this._SMALL_WIDTH) {
      this.model.set('size', 'small');
    } else {
      this.model.set('size', 'big');
    }

    this._renderStaticMaps();
  },

  _initTemplates: function() {
    this.template = cdb.templates.getTemplate('user_feed/template');
    this.mapTemplate = cdb.templates.getTemplate('user_feed/map_item_template');
    this.datasetTemplate = cdb.templates.getTemplate('user_feed/dataset_item_template');
    this.loaderTemplatePath = 'user_feed/loading';
    this.emptyTemplatePath = 'user_feed/empty';
    this.errorTemplatePath = 'user_feed/error';
  },

  _initModels: function() {
    var size = 'big';
    var wWidth = $(window).width();

    if (wWidth <= this._SMALL_WIDTH) {
      size = 'small';
    }

    this.model = new cdb.core.Model({
      vis_count: 0,
      type: '',
      size: size,
      page: 0,
      order_by: 'likes'
    });

    this.collection = new Visualizations();
    this.collection.bind('reset', this._renderVisualizations, this);
  },

  _initBindings: function() {
    var self = this;

    this.model.bind('change:show_more', this._onChangeShowMore, this);
    this.model.bind('change:show_loader', this._onChangeShowLoader, this);
    this.model.bind('change:show_mast', this._onChangeShowMast, this);
    this.model.bind('change:vis_count', this._onChangeVisCount, this);

    $(window).bind('resize', this._onWindowResize);
  },

  _onChangeVisCount: function() {
    if (this.model.get('vis_count') >= this.collection.total_entries) {
      this.model.set({ show_more: false });
    } else {
      this.model.set({ show_more: true });
    }
  },

  _onChangeShowMast: function() {
    if (this.model.get('show_mast')) {
      this.$('.js-mast').removeClass('is-hidden');
    } else {
      this.$('.js-mast').addClass('is-hidden');
    }
  },

  _onChangeShowLoader: function() {
    if (this.model.get('show_loader')) {
      this.loader.show();
    } else {
      this.loader.hide();
    }
  },

  _onChangeShowMore: function() {
    this.$('.js-more').toggleClass('is-hidden', !this.model.get('show_more'));
  },

  _renderLoader: function() {
    this.loader = ViewFactory.createByTemplate(this.loaderTemplatePath, {
      title: this._LOADER_TITLE,
      quote: randomQuote()
    });

    this.$el.append(this.loader.render().$el);
  },

  _renderError: function() {
    this.error = ViewFactory.createByTemplate(this.errorTemplatePath, {
    });

    this.$el.append(this.error.render().$el);
  },

  _renderEmpty: function() {
    this.empty = ViewFactory.createByTemplate(this.emptyTemplatePath, {
      name: config.user_name
    });

    this.$el.append(this.empty.render().$el);
  },

  _getDatasetSize: function(item) {
    var size = item.get('table').size;
    return size ? cdb.Utils.readablizeBytes(size, true).split(' ') : 0;
  },

  _getGeometryType: function(geomTypes) {
    if (geomTypes && geomTypes.length > 0) {
      var types = ['point', 'polygon', 'line', 'raster'];
      var geomType = geomTypes[0];

      return _.find(types, function(type) {
        return geomType.toLowerCase().indexOf(type) !== -1;
      });

    } else {
      return null;
    }
  },

  _renderVisualizations: function() {

    if (this.collection.length === 0) {
      this.model.set({ show_loader: false });
      this._renderEmpty();
      return;
    }

    this.model.set({ vis_count: this.model.get('vis_count') + this.collection.length, show_loader: false, show_more: true, show_filters: true, show_mast: true });

    this.collection.each(function(item) {
      var template = item.get('type') === 'derived' ? this.mapTemplate : this.datasetTemplate;
      var geomType = (item.get('table') && item.get('table').geometry_types) ? this._getGeometryType(item.get('table').geometry_types) : null;

      var owner = item.get('permission').owner;

      var el = template({
        vis: item.attributes,
        datasetSize: this._getDatasetSize(item),
        username: owner.username,
        avatar_url: owner.avatar_url,
        table_count: owner.table_count,
        maps_count: owner.maps_count,
        geomType: geomType,
        account_host: config.account_host,
        base_url: cdb.config.get('url_prefix')
      });

      this.$('.js-items').append(el);

      var $item = this.$('.js-items').find('[data-vis-id="' + item.get('id') + '"]');

      if (item.get('type') === 'derived') {
        this.maps.push(item);
      }

      if (item.get('type') === 'derived' && !item.get('rendered_' + this.model.get('size'))) {
        this._renderStaticMap(item, $item);
      }

      this._initLike(item, $item.find('.js-like'));

    }, this);

  },

  _renderStaticMaps: function() {
    _.each(this.maps, function(item) {
      if (!item.get('rendered_' + this.model.get('size'))) {
        var $item = this.$('.js-items').find('[data-vis-id="' + item.get('id') + '"]');
        this._renderStaticMap(item, $item);
      }
    }, this);
  },

  _renderStaticMap: function(vis, $el) {

    var visId = vis.get('id');
    var username = vis.get('permission').owner.username;

    var width = 540;

    if (this.model.get('size') === 'small') {
      width = 288;
    }

    var className = 'is-' + this.model.get('size');

    if (visId && username) {

      vis.set('rendered_' + this.model.get('size'), true);

      new MapCardPreview({
        el: $el.find('.js-header'),
        width: width,
        height: this._CARD_HEIGHT,
        account_host: config.maps_api_template.replace(/https?:\/\/{user}\./, ''),
        username: username,
        visId: visId,
        className: className
      }).load();
    }
  },

  _getLikesEndpoint: function(vis) {
    return '/api/v1/viz/' + vis.get('id') + '/like';
  },

  _initLike: function(vis, $el) {
    var likeable = this.options.authenticatedUser && this.options.authenticatedUser.get('username');

    var likeModel = cdb.admin.Like.newByVisData({
      likeable: false,
      show_label: true,
      vis_id: vis.get('id'),
      likes: vis.get('likes')
    });

    var url = this._getLikesEndpoint(vis);

    if (likeable) {
      this._fetchLike(likeModel, url);
    } else {
      this.options.authenticatedUser.bind('change', function() {
        this._fetchLike(likeModel, url);
      }, this);
    }

    var likeView = new LikeView({
      el: $el,
      model: likeModel
    });

    likeView.render();

  },

  _fetchLike: function(model, url) {
    if (this.options.authenticatedUser.get('username')) {
      model.bind('loadModelCompleted', function() {
        model.set('likeable', true);
      });
      model.url = url;
      model.sync = Backbone.withCORS;
      model.fetch();
    }
  },

  _fetchItems: function(params) {
    var data = _.extend({
      types: 'table,derived',
      privacy: 'public',
      exclude_shared: 'true',
      per_page: this._ITEMS_PER_PAGE,
      order: 'updated_at'
    }, params);

    this.collection.fetch({
      data: data,
      error: this._onFetchError
    });
  },

  _onFetchError: function() {
    this.model.set({ show_loader: false });
    this._renderError();
  },

  _onClickMore: function(e) {
    this.killEvent(e);
    this.model.set({ show_more: false, show_loader: true });
    this._fetchItems({ page: ++this._PAGE });
  }
});


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Poponax houghii Britton & Rose

### Remarks
null


text:
import {Component} from '@angular/core';
import {AllMips} from "../all-mips";

@Component({
  selector: 'mip-arrows',
  templateUrl: 'arrows/arrows.component.html'
})
export class ArrowsComponent {
  private _speed: number = 24;
  get speed() {
    return this._speed;
  }
  set speed(val: number) {
    this._speed = Math.round(val);
  }

  private _turnSpeed: number = 16;
  get turnSpeed() {
    return this._turnSpeed;
  }
  set turnSpeed(val: number) {
    this._turnSpeed = Math.round(val);
  }

  public moveForward() {
    AllMips.moveForward(this.speed);
  }

  public moveBack() {
    AllMips.moveBack(this.speed);
  }

  public turnLeft() {
    AllMips.turnLeft(this.speed, this.turnSpeed);
  }

  public turnRight() {
    AllMips.turnRight(this.speed, this.turnSpeed);
  }
  constructor() {

  }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>vcshelp — VCS 2.4.1 documentation</title>

    <link rel="stylesheet" href="../../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../../_static/globe.png"/>
    <link rel="top" title="VCS 2.4.1 documentation" href="../../index.html" />
    <link rel="up" title="Miscellaneous Modules" href="misc.html" />
    <link rel="prev" title="utils" href="utils.html" />

Navigation

          index

          modules |

          previous |

VCS 2.4.1 documentation »

VCS »

Miscellaneous Modules »

vcshelp¶

# VCS help module

vcs.vcshelp.objecthelp(*arg)[source]¶

Print the documentation of each object in the argument list.
Prints a blank line if no documentation.

<col class="field-name" />
<col class="field-body" />

Example:

>>> objects = [ vcs.get3d_scalar(), vcs.getcolormap(), vcs.getboxfill() ]
>>> for object in objects:
...     vcs.objecthelp(object)

Parameters:
arg (VCS object, or list of vcs objects) – Instance(s) of VCS object(s) to display the documentation for.
Multiple objects should be comma-delimited.

Previous topic

utils

This Page

Show Source

Quick search

    <form class="search" action="../../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

Navigation

          index

          modules |

          previous |

VCS 2.4.1 documentation »

VCS »

Miscellaneous Modules »

        © Copyright 2016, LLNL.
      Created using Sphinx 1.4.6.


text:
<?php
/**
 * What you need partial
 */
?>

    How We Can Help

We are never quick to seek a plea bargain if our clients would be
        better served in the courtroom.

Highly rated attorneys- We are recognized throughout the legal community for our success
        in resolving all types of criminal charges.

Voted Super Lawyers

10.0 "Perfect" AVVO Rating†

Top 100 Trial Lawyers

Three Former Assistant Prosecuting Attorneys (St. Charles, County, Missouri)

Over 20,000 Clients Have Trusted Us!

Aggressive Representation


text:
module.exports = {
  TOKEN: "INSERT BOT TOKEN"
}


text:
<?php

namespace Zend\I18n\Translator\Plural;

use Zend\I18n\Exception;

/**
 * Plural rule parser.
 *
 * This plural rule parser is implemented after the article "Top Down Operator
 * Precedence" described in <http://javascript.crockford.com/tdop/tdop.html>.
 */
class Parser
{
    /**
     * String to parse.
     *
     * @var string
     */
    protected $string;

    /**
     * Current lexer position in the string.
     *
     * @var integer
     */
    protected $currentPos;

    /**
     * Current token.
     *
     * @var Symbol
     */
    protected $currentToken;

    /**
     * Table of symbols.
     *
     * @var array
     */
    protected $symbolTable = array();

    /**
     * Create a new plural parser.
     *
     */
    public function __construct()
    {
        $this->populateSymbolTable();
    }

    /**
     * Populate the symbol table.
     *
     * @return void
     */
    protected function populateSymbolTable()
    {
        // Ternary operators
        $this->registerSymbol('?', 20)->setLeftDenotationGetter(
            function (Symbol $self, Symbol $left) {
                $self->first  = $left;
                $self->second = $self->parser->expression();
                $self->parser->advance(':');
                $self->third  = $self->parser->expression();
                return $self;
            }
        );
        $this->registerSymbol(':');

        // Boolean operators
        $this->registerLeftInfixSymbol('||', 30);
        $this->registerLeftInfixSymbol('&&', 40);

        // Equal operators
        $this->registerLeftInfixSymbol('==', 50);
        $this->registerLeftInfixSymbol('!=', 50);

        // Compare operators
        $this->registerLeftInfixSymbol('>', 50);
        $this->registerLeftInfixSymbol('<', 50);
        $this->registerLeftInfixSymbol('>=', 50);
        $this->registerLeftInfixSymbol('<=', 50);

        // Add operators
        $this->registerLeftInfixSymbol('-', 60);
        $this->registerLeftInfixSymbol('+', 60);

        // Multiply operators
        $this->registerLeftInfixSymbol('*', 70);
        $this->registerLeftInfixSymbol('/', 70);
        $this->registerLeftInfixSymbol('%', 70);

        // Not operator
        $this->registerPrefixSymbol('!', 80);

        // Literals
        $this->registerSymbol('n')->setNullDenotationGetter(
            function (Symbol $self) {
                return $self;
            }
        );
        $this->registerSymbol('number')->setNullDenotationGetter(
            function (Symbol $self) {
                return $self;
            }
        );

        // Parentheses
        $this->registerSymbol('(')->setNullDenotationGetter(
            function (Symbol $self) {
                $expression = $self->parser->expression();
                $self->parser->advance(')');
                return $expression;
            }
        );
        $this->registerSymbol(')');

        // Eof
        $this->registerSymbol('eof');
    }

    /**
     * Register a left infix symbol.
     *
     * @param  string  $id
     * @param  integer $leftBindingPower
     * @return void
     */
    protected function registerLeftInfixSymbol($id, $leftBindingPower)
    {
        $this->registerSymbol($id, $leftBindingPower)->setLeftDenotationGetter(
            function (Symbol $self, Symbol $left) use ($leftBindingPower) {
                $self->first  = $left;
                $self->second = $self->parser->expression($leftBindingPower);
                return $self;
            }
        );
    }

    /**
     * Register a right infix symbol.
     *
     * @param  string  $id
     * @param  integer $leftBindingPower
     * @return void
     */
    protected function registerRightInfixSymbol($id, $leftBindingPower)
    {
        $this->registerSymbol($id, $leftBindingPower)->setLeftDenotationGetter(
            function (Symbol $self, Symbol $left) use ($leftBindingPower) {
                $self->first  = $left;
                $self->second = $self->parser->expression($leftBindingPower - 1);
                return $self;
            }
        );
    }

    /**
     * Register a prefix symbol.
     *
     * @param  string  $id
     * @param  integer $leftBindingPower
     * @return void
     */
    protected function registerPrefixSymbol($id, $leftBindingPower)
    {
        $this->registerSymbol($id, $leftBindingPower)->setNullDenotationGetter(
            function (Symbol $self) use ($leftBindingPower) {
                $self->first  = $self->parser->expression($leftBindingPower);
                $self->second = null;
                return $self;
            }
        );
    }

    /**
     * Register a symbol.
     *
     * @param  string  $id
     * @param  integer $leftBindingPower
     * @return Symbol
     */
    protected function registerSymbol($id, $leftBindingPower = 0)
    {
        if (isset($this->symbolTable[$id])) {
            $symbol = $this->symbolTable[$id];
            $symbol->leftBindingPower = max(
                $symbol->leftBindingPower,
                $leftBindingPower
            );
        } else {
            $symbol = new Symbol($this, $id, $leftBindingPower);
            $this->symbolTable[$id] = $symbol;
        }

        return $symbol;
    }

    /**
     * Get a new symbol.
     *
     * @param string $id
     */
    protected function getSymbol($id)
    {
        if (!isset($this->symbolTable[$id])) {
            // Unkown symbol exception
        }

        return clone $this->symbolTable[$id];
    }

    /**
     * Parse a string.
     *
     * @param  string $string
     * @return array
     */
    public function parse($string)
    {
        $this->string       = $string . "\0";
        $this->currentPos   = 0;
        $this->currentToken = $this->getNextToken();

        return $this->expression();
    }

    /**
     * Parse an expression.
     *
     * @param  integer $rightBindingPower
     * @return Symbol
     */
    public function expression($rightBindingPower = 0)
    {
        $token              = $this->currentToken;
        $this->currentToken = $this->getNextToken();
        $left               = $token->getNullDenotation();

        while ($rightBindingPower < $this->currentToken->leftBindingPower) {
            $token              = $this->currentToken;
            $this->currentToken = $this->getNextToken();
            $left               = $token->getLeftDenotation($left);
        }

        return $left;
    }

    /**
     * Advance the current token and optionally check the old token id.
     *
     * @param  string $id
     * @return void
     * @throws Exception\ParseException
     */
    public function advance($id = null)
    {
        if ($id !== null && $this->currentToken->id !== $id) {
            throw new Exception\ParseException(sprintf(
                'Expected token with id %s but received %s',
                $id, $this->currentToken->id
            ));
        }

        $this->currentToken = $this->getNextToken();
    }

    /**
     * Get the next token.
     *
     * @return array
     * @throws Exception\ParseException
     */
    protected function getNextToken()
    {
        while ($this->string[$this->currentPos] === ' ' || $this->string[$this->currentPos] === "\t") {
            $this->currentPos++;
        }

        $result = $this->string[$this->currentPos++];
        $value  = null;

        switch ($result) {
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                while (ctype_digit($this->string[$this->currentPos])) {
                    $result .= $this->string[$this->currentPos++];
                }

                $id    = 'number';
                $value = (int) $result;
                break;

            case '=':
            case '&':
            case '|':
                if ($this->string[$this->currentPos] === $result) {
                    $this->currentPos++;
                    $id = $result . $result;
                } else {
                    // Yield error
                }
                break;

            case '!':
            case '<':
            case '>':
                if ($this->string[$this->currentPos] === '=') {
                    $this->currentPos++;
                    $result .= '=';
                }

                $id = $result;
                break;

            case '*':
            case '/':
            case '%':
            case '+':
            case '-':
            case 'n':
            case '?':
            case ':':
            case '(':
            case ')':
                $id = $result;
                break;

            case ';':
            case "\n":
            case "\0":
                $id = 'eof';
                $this->currentPos--;
                break;

            default:
                throw new Exception\ParseException(sprintf(
                    'Found invalid character "%s" in input stream',
                    $result
                ));
                break;
        }

        $token = $this->getSymbol($id);
        $token->value = $value;

        return $token;
    }
}


text:
a simple tickets system for laravel 5.2+ which integrates with Laravel default users system.

##Features:
1. Users can create tickets, keep track of their tickets status, giving comments, and close (resolve) their own tickets.
2. Fluent admin panel.
3. Localization (English, Farsi).

##Requirements
**First make sure you have got this Laravel setup working:**

1. [Laravel 5.2](http://laravel.com/docs/5.2#installation)
2. [Users table](http://laravel.com/docs/5.2/authentication)
3. Bootstrap 3+

## Installation :

Install Irticket package
```shell
composer require amin101/irticket:1.*
```

Add this line on your `config/app.php` in Service Providers section.
```php
Amin101\Irticket\IrticketServiceProvider::class
```
Run this code to publish migrations and assets
```shell
php artisan vendor:publish
```
Run three migrations
```shell
php artisan migrate
```

##Views
after publishing , irticket views files are under `resources/views/vendor/irticket` path. feel free to edit `app.blade.php` to fit it to your site template structure.
just dont forget to add `@yield('content')` .


text:
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: daviddjian
 * Date: 31/07/13
 * Time: 19:25
 * To change this template use File | Settings | File Templates.
 */

namespace SmtpValidatorEmail\Mx;

class Mx
{
    public $mxs = array();

    /**
     * Queries the DNS server for domain MX entries
     *
     * @param string $domain The domain MX entries
     *
     * @return array         MX hosts and their weights
     */
    public function getEntries($domain)
    {
        $hosts  = array();
        $weight = array();

        getmxrr($domain, $hosts, $weight);

        // sort MX priorities
        foreach ($hosts as $k => $host) {
            $this->mxs[$host] = $weight[$k];
        }

        asort($this->mxs);

        // add the hostname with 0 weight (RFC 2821)
        $this->mxs[$domain] = 0;

        return $this->mxs;
    }
}


text:
require 'rails_helper'

RSpec.describe IngestEphemeraService, :admin_set do
  subject { described_class.new(folder, user, project.name, logger) }
  let(:folder) { Rails.root.join('spec', 'fixtures', 'lae_migration', 'folders', '0003d') }
  let(:fileset1) { FactoryGirl.build(:file_set) }
  let(:fileset2) { FactoryGirl.build(:file_set) }
  let(:user) { FactoryGirl.create(:admin) }
  let(:project) { FactoryGirl.create(:ephemera_project) }
  let(:logger) { Logger.new(nil) }
  let(:genres) { Vocabulary.find_or_create_by(label: 'LAE Genres') }
  let(:subjects) { Vocabulary.find_or_create_by(label: 'LAE Subjects') }
  let(:postcards) { VocabularyTerm.find_or_create_by(label: 'Postcards', vocabulary: genres) }
  let(:museums) { VocabularyTerm.find_or_create_by(label: 'Museums', vocabulary: subjects) }
  let(:ingest_service) { instance_double('IngestService') }

  before do
    allow(IngestService).to receive(:new).and_return(ingest_service)
    allow(ingest_service).to receive(:ingest_file).and_return(fileset1, fileset2)
    postcards
    museums
  end

  describe "#ingest" do
    context "with a valid folder" do
      let(:ingested) { EphemeraFolder.last }

      it "ingests an ephemera folder" do
        expect { subject.ingest }.to change { EphemeraFolder.count }.by(1)
        expect(ingested.title).to eq(["En negro y blanco. Del Cordobazo al juicio a las juntas."])
        expect(ingested.file_sets.length).to eq(2)
        expect(ingested.genre.first).to eq(postcards.id.to_s)
        expect(ingested.subject.first).to eq(museums.id.to_s)
      end
    end

    context "when the folder doesn't exist" do
      let(:folder) { Rails.root.join('spec', 'fixtures', 'bogus') }
      let(:logger) { instance_double('Logger') }

      before do
        allow(logger).to receive(:warn)
      end

      it "logs an error" do
        expect { subject.ingest }.not_to change { EphemeraFolder.count }
        expect(logger).to have_received(:warn).with("Error: No such file or directory @ rb_sysopen - #{folder}/foxml")
      end
    end
  end

  describe "#lookup" do
    it "finds genres" do
      graph = RDF::Graph.new
      graph << [RDF::URI.new, RDF::Vocab::DC.format, "Postcards"]
      expect(subject.lookup(graph, RDF::Vocab::DC.format, "LAE Genres")).to eq([postcards.id.to_s])
    end
    it "finds subjects" do
      graph = RDF::Graph.new
      graph << [RDF::URI.new, RDF::Vocab::DC.subject, "Museums"]
      expect(subject.lookup(graph, RDF::Vocab::DC.subject, nil)).to eq([museums.id.to_s])
    end
    it "handles missing data" do
      graph = RDF::Graph.new
      graph << [RDF::URI.new, RDF::Vocab::DC.format, "Flyers"]
      expect(subject.lookup(graph, RDF::Vocab::DC.format, "LAE Genres")).to eq([nil])
    end
    it "handles missing data" do
      graph = RDF::Graph.new
      graph << [RDF::URI.new, RDF::Vocab::DC.subject, ""]
      expect(subject.lookup(graph, RDF::Vocab::DC.subject, nil)).to eq([nil])
    end
  end
end