text:
/**
 * ┌───────────────────┐
 * |     GridView      |
 * |   ┌───┬───┬───┐   |
 * |   | 1 | 2 | 3 |   |
 * |   ├───┼───┼───┤   |
 * |   | 4 | 5 | 6 |   |
 * |   ├───┼───┼───┤   |
 * |   | 7 | 8 | 9 |   |
 * |   └───┴───┴───┘   |
 * |                   |
 * └───────────────────┘
 *
 * ┌───────────────────┐
 * |        Row        |
 * |   ┌───┬───┬───┐   |
 * |   | 1 | 2 | 3 |   |
 * |   └───┴───┴───┘   |
 * |                   |
 * └───────────────────┘
 *
 * ┌───────────────────┐
 * |   Column / Cell   |
 * |       ┌───┐       |
 * |       | 1 |       |
 * |       └───┘       |
 * |                   |
 * └───────────────────┘
 *
 * Generic grid view. It should not be modified for each app.
 * It was written to accommodate grid based layouts.
 * It can be used to construct: Grid, Vertical, or Horizontal based scroll views.
 * Simply think of it, like any other Titanium view. E.g., Ti.UI.createView
 *
 * This module uses jQuery plugin style initalization of defaults with user options merged.
 * @link http://jquery-howto.blogspot.com/2009/01/how-to-set-default-settings-in-your.html
 *
 * This module is very similar to iOS Collection View
 * @link http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/UIElementGuidelines/UIElementGuidelines.html%23//apple_ref/doc/uid/TP40006556-CH13-SW41
 *
 * @module xcore.UI
 * @submodule GridView
 * @type public
 *
 * @param    {Object}      options            The configuration object to customize `GridView`
 * @param    {Array}       option.views       An array of Titanium views
 * @param    {Function}    option.callback    Callback function when a cell is clicked
 *
 * @return   {Ti.UI.ScrollView}               The complete `GridView`, ready to be added to any parent view
 *
 * @link http://developer.appcelerator.com/question/67631
 *
 * @example
 *  var gridView = xcore.UI.GridView({
 *    views:                [],             // An array of Titanium views (required)
 *    width:                '100%',         // Grid width
 *    height:               'auto',         // Grid height, `auto` will trigger the grid to calculate it's size
 *    cellWidth:            200,            // Cell width
 *    cellHeight:           150,            // Cell height
 *    cellPadding:          10,             // Space around each cell (top, bottom, left and right)
 *    cellMargin:           1,              // Space in between two columns (top, bottom, left and right)
 *    rowMargin:            1,              // Space in between two rows (top, bottom)
 *    rowMarginTop:         20,             // Space to the top of the row (before first column of the grid)
 *    rowMarginBottom:      20,             // Space to the bottom of the row (before last column of the grid)
 *    rowMarginLeft:        20,             // Space to the left of the row (before first column of the each row)
 *    rowMarginRight:       20,             // Space to the right of the row (after last column of the each row)
 *    columns:              3,              // Number of columns
 *    rows:                 1,              // Number of rows
 *    zIndex:               9999,           // Grid stack-level; similar to CSS
 *    bottom:               0,              // Set the grid position to bottom
 *    backgroundImage:      'images/bg.png' // Grid background image
 *    dynamicWidth:         false,          // Each cell has different width
 *    selectedStateEnabled: true,           // Toggle selected state indicator
 *  });
 *
 * @api
 * - `setSelectedState` and `setNormalState`
 *    Each view in the views array can declare `setSelectedState` and `setNormalState` method
 *    and enable `selectedStateEnabled` option to indicate currently clicked item.
 * - Call `clearSelectedState` on the gridView to clear any selected state.
 *
 * @todo
 * - Create documentation with example and it's public api
 * - maybe `dynamicWidth` should be renamed to `hasUniqueCells` to accomodate
 *   any other changes needed for dynamic layer.
 * - Feature: `carouselView.views[0].fireEvent('singletap');` prevent code like by
 *   enabling and api like this maybe `carouselView.firstElement.fireEvent('singletap');`
 *   if data || views arrays are empty... just create dummy object and send that back...
 * - Feature: move the error logic here to `GridView` from `CarouselView`
 *
 * @issues
 * - All row padding options only works for one row (Horizontal).
 * - `rowMarginTop` and `rowMarginBottom` will center the content
 *    it'll make the height bigger to accomodate the padding. It's a Hack.
 * - Adjust Grid height and width when borderColor is set...
 */
function GridView(options) {
  /*
   * Variable Declarations
   */

  // Private instance variable containing an array of views
  // objects representing the rows, cells, and columns of the grid
  var _views = {
    rows:    [],            // rows as Titanium views
    cells:   options.views, // these are already Titanium views provided by the user
    columns: []             // columns as Titanium views
  };

  // Private variables to store indexes of currently render views
  var _cellIndex   = 0;
  var _rowHeight   = 0;
  var _columHeight = 0;

  // Private variables to store reference to currently clicked cell
  var _selectedCell = null;

  var _p = function (densityPixels) {
    return densityPixels * Ti.Platform.displayCaps.dpi / 160;
  };

  /*
   * Default options
   * These will be overwritten by the user options
   */
  var defaults = {
    debug:                false,      // Set to true to see the properties of options
    width:                Ti.UI.SIZE, // Grid width
    height:               Ti.UI.SIZE, // Grid height
    contentWidth:         'auto',     // for iOS
    contentHeight:        'auto',     // for iOS
    scrollType:           'vertical', // for Android
    cellWidth:            _p(95),     // Cell width
    cellHeight:           _p(95),     // Cell height
    cellPadding:          0,          // Space around each cell (top, bottom, left and right)
    cellMargin:           _p(10),     // Space in between two columns
    rowMargin:            _p(10),     // Space in between two rows
    columns:              3,          // Number of columns
    borderWidth:          0,          // Explicitly turning off border
    rows:                 0,          // Number of rows
    views:                [],         // An array of Titanium views
    _ignoreClicks:        true,       // Ignore clicks on the grid, deal with only cell clicks, @todo THIS SHOULD be moved out of options.
    dynamicWidth:         false,      // Each cell has different width
    selectedStateEnabled: false,      // Toggle selected state indicator
    set:                  function() {
      /*
       * Layout property should not be defined by the user.
       * It is automatically defined in appropriate cases (see case 2).
       * If defined inappropriately this screws up the layout of the grid.
       * This is just housekeeping. Better safe than sorry ;)
       */
      if ('layout' in this) {
        delete this.layout;
      }

      /*
       * Case 1:
       * Number of `rows` is inappropriate: 0 or a string
       */
      if ( this.rows < 1 || (! _.isNumber(this.rows)) ) {
        this.rows = this.views.length / this.columns;
      }

      /*
       * Case 2:
       * Number of `rows` is 1
       * then, there must be enough columns to accommodate all the views
       */
      if ( this.rows === 1 ) {
        this.rows    = 1;
        this.columns = this.views.length;
        this.layout  = 'horizontal';
      }
    }
  };

  /*
   * Overwrite default options
   * with user provided ones
   * and merge them into `options`.
   */
  var options = _.extend(defaults, options);

  // Set the dynamic values
  options.set();

  /*
   * We set up the values above (no longer need it)
   * and we don't want to pass this function to
   * Titanium view so we delete it
   */
  delete options.set;

  // Create module instance and pass the final options
  var self = Ti.UI.createScrollView(options);

  /*
   * Creates single row and returns it
   * it takes the index value if we create multiple rows
   */
  var createRow = function(index) {
    var row = Ti.UI.createView({
      layout:        'horizontal',
      focusable:     false,
      top:           index * (options.cellHeight + options.rowMargin),
      height:        options.cellHeight + options.rowMargin,
      _rowIndex:     index,
      _ignoreClicks: true
    });

    return row;
  };

  /*
   * Creates single column and returns it
   * it takes the index value if we create multiple columns
   */
  var createColumn = function(index, eachCellWidth) {
    var column = Ti.UI.createView({
      left:          (index === 0) ? 0 : options.cellMargin,
      width:         (options.dynamicWidth ? eachCellWidth : options.cellWidth)  + options.cellPadding,
      height:        options.cellHeight + options.cellPadding,
      _columnIndex:  index,
      _ignoreClicks: false
    });

    // If hover state properties exists enable this functionality
    if (options.cellBackgroundColor || options.cellBackgroundSelectedColor || options.cellBackgroundImage || options.cellBackgroundSelectedImage) {
      var backgroundColor         = options.cellBackgroundColor          || 'transparent';
      var backgroundSelectedColor = options.cellBackgroundSelectedColor  || 'transparent';
      var backgroundImage         = options.cellBackgroundImage          || undefined;
      var backgroundSelectedImage = options.cellBackgroundSelectedImage  || undefined;

      column.backgroundImage = backgroundImage;
      column.backgroundColor = backgroundColor;

      if (options.cellBackgroundSelectedColor || options.cellBackgroundSelectedImage) {
        column.addEventListener('touchstart', function() {
          column.backgroundImage = backgroundSelectedImage;
          column.backgroundColor = backgroundSelectedColor;
        });

        column.addEventListener('touchend', function() {
          column.backgroundImage = backgroundImage;
          column.backgroundColor = backgroundColor;
        });

        column.addEventListener('touchmove', function() {
          column.backgroundImage = backgroundImage;
          column.backgroundColor = backgroundColor;
        });
      }
    }

    return column;
  };

  /*
   * Case 1:
   * Single row and multiple columns (horizontal)
   *
   * If only one row then skip creating the row
   * and create columns and add it to the view
   * cellIndex: (num of columns * rowIndex(y)) + columnIndex(x) = (options.columns * y) + x;
   */
  if (options.rows === 1) {
    for (var x = 0; x < options.columns; x++) {
      if (options.views[_cellIndex]) {

        // Create Border
        if (x !== 0 && options.borderColor) self.add(createBorder(1, options.borderColor, 'left'));

        options.views[_cellIndex].cellIndex = _cellIndex;
        var column = createColumn(x, options.views[_cellIndex].width);
        column.add(options.views[_cellIndex]);
        _views.columns.push(column);
        self.add(column);
        _cellIndex++;
      }
    }
  }
  /*
   * Case 2:
   * Multiple rows and columns (vertical or grid)
   */
  else {
    for (var y = 0; y < options.rows; y++) {
      var row = createRow(y);

      // Create Border
      if (y !== 0 && options.borderColor) self.add(createBorder(1, options.borderColor, 'top'));

      for (var x = 0; x < options.columns; x++) {
        if (options.views[_cellIndex]) {

          // Create Border
          if (x !== 0 && options.borderColor) self.add(createBorder(1, options.borderColor, 'left'));

          options.views[_cellIndex].cellIndex = _cellIndex;
          var column = createColumn(x, options.views[_cellIndex].width);
          column.add(options.views[_cellIndex]);
          _views.columns.push(column);
          row.add(column);
          _cellIndex++;
        }
      }
      _views.rows.push(row);
      self.add(row);
    }
  }

  /*
   * Row Padding Right
   * If paddingRight is specified add empty view to the end of all views
   *
   * Note: `height: options.cellHeight` is there to ensure that height is
   * respected when explicitly declared. Some areas may have dynamic GridView:
   * I.e., sometimes it's there and sometimes it's not. This ensures
   * that we save the declared space for the gridView.
   */
  if (options.rowMarginRight) {
    options.rowMarginTop    || (options.rowMarginTop = 0);
    options.rowMarginBottom || (options.rowMarginBottom = 0);
    self.add(Ti.UI.createView({width: options.rowMarginRight, height: options.cellHeight + options.rowMarginTop + options.rowMarginBottom}));
  }

  /*
   * Calculate the grid width and height based on the Titanium views passed using `options.views`
   * User can use `auto` keyword to automatically calculate the grid size
   */
  var setGridDimensions = function() {
    if (_views.columns.length !== 0) {
      if (options.width  === 'auto') self.width  = options.cellWidth  ? (options.cellWidth  + options.cellPadding) : _views.columns[0].toImage().width;
      if (options.height === 'auto') self.height = options.cellHeight ? (options.cellHeight + options.cellPadding) : _views.columns[0].toImage().height * options.rows;
    } else {
      if (options.width  === 'auto') self.width  = Ti.UI.SIZE;
      if (options.height === 'auto') self.height = Ti.UI.SIZE;
    }

    /*
     * Add row padding
     * Note: It's only supported if there is only one row (horizontal)
     */
    if (options.rows === 1 && _views.columns.length !== 0) {
      // Row Padding Top
      if (options.rowMarginTop) {
        //self.top = options.rowMarginTop;

        // Now update the grid width/height
        self.height += options.rowMarginTop;
      }

      // Row Padding Bottom
      if (options.rowMarginBottom) {
        //self.bottom = options.rowMarginBottom;

        // Now update the grid width/height
        self.height += options.rowMarginBottom;
      }

      // Row Padding Left
      // Change left margin to mimic padding
      if (options.rowMarginLeft) _views.columns[0].left = options.rowMarginLeft;
    }
  };

  /*
   * A function to update the grid row dimensions: top and height
   */
  var setRowDimensions = function() {
    if (_views.rows.length !== 0 && _views.columns.length !== 0) {
      _columHeight = options.cellHeight ? (options.cellHeight + options.cellPadding) : _views.columns[0].toImage().height;

      // Update all the rows
      for (var y = 0; y < _views.rows.length; y++) {
        _views.rows[y].top    = y * (_columHeight + options.rowMargin);
        _views.rows[y].height = _columHeight;
      }
    }
  };

  /*
   * A function to update the grid cell dimensions: width and height
   */
  var setCellDimensions = function(cellWidth, cellHeight) {
    options.cellWidth  = options.cellWidth || cellWidth;
    options.cellHeight = options.cellWidth || cellHeight;

    // Update cells and columns
    // Number of cells and columns are always the same
    for (var x = 0; x < _views.columns.length; x++) {
      _views.cells[x].width    = options.cellWidth;
      _views.cells[x].height   = options.cellHeight;
      _views.columns[x].width  = options.cellWidth  + options.cellPadding;
      _views.columns[x].height = options.cellHeight + options.cellPadding;
    }

    // Update rows
    setRowDimensions();
    // for (var y = 0; y < _views.rows.length; y++) {
      // _views.rows[y].top    = y * (options.cellHeight + options.rowMargin);
      // _views.rows[y].height = options.cellHeight + options.rowMargin;
    // }

    // Return the changed properties object
    return {
      cellWidth:  options.cellWidth,
      cellHeight: options.cellHeight
    };
  };

  /*
   * Attach event listener to the grid (for performance reasons)
   * instead of attaching it to every row/column/cell
   * User can listen to it using `options.callback` property
   */
  self.addEventListener('singletap', function(e) {
    var source = e.source, column = {};

    if (source._ignoreClicks) {
      return;
    }

    // Find the clicked cell
    if (typeof source.cellIndex !== 'undefined') {

    } else if (typeof source._columnIndex !== 'undefined') {
      source = source.children[0];
    } else if (typeof source.parent.cellIndex !== 'undefined') {
      source = source.parent;
    } else {
      Ti.API.error('[xcore.UI.GridView] Unable to find clicked cell.');
      Ti.API.error('Event Trace: ' + JSON.stringify(e));
      return;
    }

    column = source.parent;

    // Fire the cell callback click event
    if (options.callback) {
      options.callback({
        x:           e.x,
        y:           e.y,
        type:        e.type,
        rowIndex:    column.parent._rowIndex || 0,
        columnIndex: column._columnIndex || 0,
        cellIndex:   source.cellIndex,
        source:      source
      });
    }

    /*
     * Turn on the selected state for current cell
     * Make sure `setSelectedState` and `setNormalState` methods
     * exists for each cell.
     */
    if (options.selectedStateEnabled && source.setSelectedState && source.setNormalState) {
      // If there is a selected cell, then deselect the selected cell
      // by call its `setNormalState` method.
      if (_selectedCell !== null) { _selectedCell.setNormalState(); }

      // Now set the clicked cell to selected cell and run `setSelectedState` method
      _selectedCell = source;
      _selectedCell.setSelectedState();
    }
  });

  /**
   * A helper method to update the grid
   *
   * @method
   * @api public
   */
  self.update = function(options) {
    var cellDimensions = setCellDimensions(options.cellWidth, options.cellHeight);

    // setRowDimensions();
    // setGridDimensions();

    self.fireEvent('update', cellDimensions);
  };

  if (options.selectedStateEnabled) {
    self.clearSelectedState = function() {
      // If there is a selected cell, then deselect the selected cell
      // by calling its `setNormalState` method.
      if (_selectedCell !== null) { _selectedCell.setNormalState(); }
    };
  }

  setRowDimensions();
  setGridDimensions();

  /*
   * Function that logs all `options` values.
   * It is executed when `options.debug` is set to true,
   * the results are displayed in the console window.
   */
  var propertiesDump = function() {
    Ti.API.log('');
    Ti.API.log('[xcore.UI.GridView] Set `DEBUG` flag to `false` to turn off these logs.');
    Ti.API.log('-----------------------------------------------------------------------');
    Ti.API.log('[xcore.UI.GridView] Number of Rows:    ' + _views.rows.length);
    Ti.API.log('[xcore.UI.GridView] Number of Cells:   ' + _views.cells.length);
    Ti.API.log('[xcore.UI.GridView] Number of Columns: ' + _views.columns.length);
    Ti.API.log('[xcore.UI.GridView] Grid width:        ' + self.width);
    Ti.API.log('[xcore.UI.GridView] Grid height:       ' + self.height);
    Ti.API.log('[xcore.UI.GridView] options:           {');
    _.each(options, function(value, key, list) {
      Ti.API.log('[xcore.UI.GridView]   ' + key + ': ' + value);
    });
    Ti.API.log('[xcore.UI.GridView] };');
    Ti.API.log('-----------------------------------------------------------------------');
    Ti.API.log('');
  };

  if (options.debug) propertiesDump();

  /**
   * Gets the cell at the specified index.
   *
   * @method getCell
   * @param {Number} index [optional] index of the target cell, uses index of 0 if empty
   * @return {Ti.UI.View} Cell view if have cell, empty Ti.UI.VIEW otherwise with error property.
   * @api public
   */
  self.getCell = function(index) {
    var cell = self.views[index || 0];

    if (! cell) {
      cell = Ti.UI.createView();
      cell.error = true;
    }

    return cell;
  };

  // Return the view for further modifications and adding it to the parent view
  return self;
}

/**
 * Copied from unfinished `FlexView` module
 * Maybe this should be available under xcore namespace.
 */
function createBorder(width, color, side) {
  var borderView = ui.view({
    width:           '100%',
    height:          width,
    backgroundColor: color
  });

  if (side === 'top')    { borderView.top    = 0; }
  if (side === 'bottom') { borderView.bottom = 0; }
  if (side === 'left')   { borderView.left   = 0; borderView.width = width; borderView.height = '100%'; }
  if (side === 'right')  { borderView.right  = 0; borderView.width = width; borderView.height = '100%'; }

  return borderView;
}

module.exports = GridView;


text:
<?php

namespace App;

use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable{

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'users';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'email', 'password', 'name', 'gender', 'location', 'website', 'avatar', 'username'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token'
    ];

    public function userProfile(){
        return $this->hasMany('App\UserProfile', 'user_id');
    }

    /*
     * Check if Avatar field is null
     * @return model avatar
     */
    public function getAvatar(){
        if(is_null($this->avatar))
            return "http://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))) . "?d=mm&s=60";

        return $this->avatar;
    }
}

redpajama_set_name: RedPajamaGithub


text:
/** @module adaptermanger */

import { flatten, getBidderCodes, getDefinedParams, shuffle, timestamp } from './utils';
import { resolveStatus } from './sizeMapping';
import { processNativeAdUnitParams, nativeAdapters } from './native';
import { newBidder } from './adapters/bidderFactory';
import { ajaxBuilder } from 'src/ajax';
import { config, RANDOM } from 'src/config';
import includes from 'core-js/library/fn/array/includes';
import find from 'core-js/library/fn/array/find';

var utils = require('./utils.js');
var CONSTANTS = require('./constants.json');
var events = require('./events');
let s2sTestingModule; // store s2sTesting module if it's loaded

var _bidderRegistry = {};
exports.bidderRegistry = _bidderRegistry;
exports.aliasRegistry = {};

let _s2sConfig = {};
config.getConfig('s2sConfig', config => {
  _s2sConfig = config.s2sConfig;
});

var _analyticsRegistry = {};

/**
 * @typedef {object} LabelDescriptor
 * @property {boolean} labelAll describes whether or not this object expects all labels to match, or any label to match
 * @property {Array<string>} labels the labels listed on the bidder or adUnit
 * @property {Array<string>} activeLabels the labels specified as being active by requestBids
 */

/**
 * Returns object describing the status of labels on the adUnit or bidder along with labels passed into requestBids
 * @param bidOrAdUnit the bidder or adUnit to get label info on
 * @param activeLabels the labels passed to requestBids
 * @returns {LabelDescriptor}
 */
function getLabels(bidOrAdUnit, activeLabels) {
  if (bidOrAdUnit.labelAll) {
    return {labelAll: true, labels: bidOrAdUnit.labelAll, activeLabels};
  }
  return {labelAll: false, labels: bidOrAdUnit.labelAny, activeLabels};
}

function getBids({bidderCode, auctionId, bidderRequestId, adUnits, labels}) {
  return adUnits.reduce((result, adUnit) => {
    let {active, sizes: filteredAdUnitSizes} = resolveStatus(getLabels(adUnit, labels), adUnit.sizes);

    if (active) {
      result.push(adUnit.bids.filter(bid => bid.bidder === bidderCode)
        .reduce((bids, bid) => {
          if (adUnit.mediaTypes) {
            if (utils.isValidMediaTypes(adUnit.mediaTypes)) {
              bid = Object.assign({}, bid, {mediaTypes: adUnit.mediaTypes});
            } else {
              utils.logError(
                `mediaTypes is not correctly configured for adunit ${adUnit.code}`
              );
            }
          }

          const nativeParams =
            adUnit.nativeParams || utils.deepAccess(adUnit, 'mediaTypes.native');
          if (nativeParams) {
            bid = Object.assign({}, bid, {
              nativeParams: processNativeAdUnitParams(nativeParams),
            });
          }

          bid = Object.assign({}, bid, getDefinedParams(adUnit, [
            'mediaType',
            'renderer'
          ]));

          let {active, sizes} = resolveStatus(getLabels(bid, labels), filteredAdUnitSizes);

          if (active) {
            bids.push(Object.assign({}, bid, {
              adUnitCode: adUnit.code,
              transactionId: adUnit.transactionId,
              sizes: sizes,
              bidId: bid.bid_id || utils.getUniqueIdentifierStr(),
              bidderRequestId,
              auctionId
            }));
          }
          return bids;
        }, [])
      );
    }
    return result;
  }, []).reduce(flatten, []).filter(val => val !== '');
}

function getAdUnitCopyForPrebidServer(adUnits) {
  let adaptersServerSide = _s2sConfig.bidders;
  let adUnitsCopy = utils.deepClone(adUnits);

  adUnitsCopy.forEach((adUnit) => {
    // filter out client side bids
    adUnit.bids = adUnit.bids.filter((bid) => {
      return includes(adaptersServerSide, bid.bidder) && (!doingS2STesting() || bid.finalSource !== s2sTestingModule.CLIENT);
    }).map((bid) => {
      bid.bid_id = utils.getUniqueIdentifierStr();
      return bid;
    });
  });

  // don't send empty requests
  adUnitsCopy = adUnitsCopy.filter(adUnit => {
    return adUnit.bids.length !== 0;
  });
  return adUnitsCopy;
}

function getAdUnitCopyForClientAdapters(adUnits) {
  let adUnitsClientCopy = utils.deepClone(adUnits);
  // filter out s2s bids
  adUnitsClientCopy.forEach((adUnit) => {
    adUnit.bids = adUnit.bids.filter((bid) => {
      return !doingS2STesting() || bid.finalSource !== s2sTestingModule.SERVER;
    })
  });

  // don't send empty requests
  adUnitsClientCopy = adUnitsClientCopy.filter(adUnit => {
    return adUnit.bids.length !== 0;
  });

  return adUnitsClientCopy;
}

exports.gdprDataHandler = {
  consentData: null,
  setConsentData: function(consentInfo) {
    this.consentData = consentInfo;
  },
  getConsentData: function() {
    return this.consentData;
  }
};

exports.makeBidRequests = function(adUnits, auctionStart, auctionId, cbTimeout, labels) {
  let bidRequests = [];

  adUnits = exports.checkBidRequestSizes(adUnits);

  let bidderCodes = getBidderCodes(adUnits);
  if (config.getConfig('bidderSequence') === RANDOM) {
    bidderCodes = shuffle(bidderCodes);
  }

  let clientBidderCodes = bidderCodes;
  let clientTestAdapters = [];
  if (_s2sConfig.enabled) {
    // if s2sConfig.bidderControl testing is turned on
    if (doingS2STesting()) {
      // get all adapters doing client testing
      clientTestAdapters = s2sTestingModule.getSourceBidderMap(adUnits)[s2sTestingModule.CLIENT];
    }

    // these are called on the s2s adapter
    let adaptersServerSide = _s2sConfig.bidders;

    // don't call these client side (unless client request is needed for testing)
    clientBidderCodes = bidderCodes.filter((elm) => {
      return !includes(adaptersServerSide, elm) || includes(clientTestAdapters, elm);
    });

    let adUnitsS2SCopy = getAdUnitCopyForPrebidServer(adUnits);
    let tid = utils.generateUUID();
    adaptersServerSide.forEach(bidderCode => {
      const bidderRequestId = utils.getUniqueIdentifierStr();
      const bidderRequest = {
        bidderCode,
        auctionId,
        bidderRequestId,
        tid,
        adUnitsS2SCopy,
        bids: getBids({bidderCode, auctionId, bidderRequestId, 'adUnits': adUnitsS2SCopy, labels}),
        auctionStart: auctionStart,
        timeout: _s2sConfig.timeout,
        src: CONSTANTS.S2S.SRC
      };
      if (bidderRequest.bids.length !== 0) {
        bidRequests.push(bidderRequest);
      }
    });
  }

  // client adapters
  let adUnitsClientCopy = getAdUnitCopyForClientAdapters(adUnits);
  clientBidderCodes.forEach(bidderCode => {
    const bidderRequestId = utils.getUniqueIdentifierStr();
    const bidderRequest = {
      bidderCode,
      auctionId,
      bidderRequestId,
      bids: getBids({bidderCode, auctionId, bidderRequestId, 'adUnits': adUnitsClientCopy, labels}),
      auctionStart: auctionStart,
      timeout: cbTimeout
    };
    if (bidderRequest.bids && bidderRequest.bids.length !== 0) {
      bidRequests.push(bidderRequest);
    }
  });

  if (exports.gdprDataHandler.getConsentData()) {
    bidRequests.forEach(bidRequest => {
      bidRequest['gdprConsent'] = exports.gdprDataHandler.getConsentData();
    });
  }
  return bidRequests;
};

exports.checkBidRequestSizes = (adUnits) => {
  function isArrayOfNums(val) {
    return Array.isArray(val) && val.length === 2 && utils.isInteger(val[0]) && utils.isInteger(val[1]);
  }

  adUnits.forEach((adUnit) => {
    if (adUnit.sizes) {
      utils.logWarn('Usage of adUnits.sizes will eventually be deprecated.  Please define size dimensions within the corresponding area of the mediaTypes.<object> (eg mediaTypes.banner.sizes).');
    }

    const mediaTypes = adUnit.mediaTypes;
    if (mediaTypes && mediaTypes.banner) {
      const banner = mediaTypes.banner;
      if (banner.sizes) {
        adUnit.sizes = banner.sizes;
      } else {
        utils.logError('Detected a mediaTypes.banner object did not include sizes.  This is a required field for the mediaTypes.banner object.  Removing invalid mediaTypes.banner object from request.');
        delete adUnit.mediaTypes.banner;
      }
    }

    if (mediaTypes && mediaTypes.video) {
      const video = mediaTypes.video;
      if (video.playerSize) {
        if (Array.isArray(video.playerSize) && video.playerSize.length === 1 && video.playerSize.every(isArrayOfNums)) {
          adUnit.sizes = video.playerSize;
        } else if (isArrayOfNums(video.playerSize)) {
          let newPlayerSize = [];
          newPlayerSize.push(video.playerSize);
          utils.logInfo(`Transforming video.playerSize from ${video.playerSize} to ${newPlayerSize} so it's in the proper format.`);
          adUnit.sizes = video.playerSize = newPlayerSize;
        } else {
          utils.logError('Detected incorrect configuration of mediaTypes.video.playerSize.  Please specify only one set of dimensions in a format like: [[640, 480]]. Removing invalid mediaTypes.video.playerSize property from request.');
          delete adUnit.mediaTypes.video.playerSize;
        }
      }
    }

    if (mediaTypes && mediaTypes.native) {
      const native = mediaTypes.native;
      if (native.image && native.image.sizes && !Array.isArray(native.image.sizes)) {
        utils.logError('Please use an array of sizes for native.image.sizes field.  Removing invalid mediaTypes.native.image.sizes property from request.');
        delete adUnit.mediaTypes.native.image.sizes;
      }
      if (native.image && native.image.aspect_ratios && !Array.isArray(native.image.aspect_ratios)) {
        utils.logError('Please use an array of sizes for native.image.aspect_ratios field.  Removing invalid mediaTypes.native.image.aspect_ratios property from request.');
        delete adUnit.mediaTypes.native.image.aspect_ratios;
      }
      if (native.icon && native.icon.sizes && !Array.isArray(native.icon.sizes)) {
        utils.logError('Please use an array of sizes for native.icon.sizes field.  Removing invalid mediaTypes.native.icon.sizes property from request.');
        delete adUnit.mediaTypes.native.icon.sizes;
      }
    }
  });
  return adUnits;
}

exports.callBids = (adUnits, bidRequests, addBidResponse, doneCb) => {
  if (!bidRequests.length) {
    utils.logWarn('callBids executed with no bidRequests.  Were they filtered by labels or sizing?');
    return;
  }

  let ajax = ajaxBuilder(bidRequests[0].timeout);

  let [clientBidRequests, serverBidRequests] = bidRequests.reduce((partitions, bidRequest) => {
    partitions[Number(typeof bidRequest.src !== 'undefined' && bidRequest.src === CONSTANTS.S2S.SRC)].push(bidRequest);
    return partitions;
  }, [[], []]);

  if (serverBidRequests.length) {
    let adaptersServerSide = _s2sConfig.bidders;
    const s2sAdapter = _bidderRegistry[_s2sConfig.adapter];
    let tid = serverBidRequests[0].tid;
    let adUnitsS2SCopy = serverBidRequests[0].adUnitsS2SCopy;
    adUnitsS2SCopy.forEach((adUnitCopy) => {
      let validBids = adUnitCopy.bids.filter((bid) => {
        return find(serverBidRequests, request => {
          return request.bidderCode === bid.bidder &&
          find(request.bids, (reqBid) => reqBid.adUnitCode === adUnitCopy.code);
        });
      });
      adUnitCopy.bids = validBids;
    });

    adUnitsS2SCopy = adUnitsS2SCopy.filter(adUnitCopy => adUnitCopy.bids.length > 0);

    if (s2sAdapter) {
      let s2sBidRequest = {tid, 'ad_units': adUnitsS2SCopy};
      if (s2sBidRequest.ad_units.length) {
        let doneCbs = serverBidRequests.map(bidRequest => {
          bidRequest.start = timestamp();
          bidRequest.doneCbCallCount = 0;
          return doneCb(bidRequest.bidderRequestId)
        });

        // only log adapters that actually have adUnit bids
        let allBidders = s2sBidRequest.ad_units.reduce((adapters, adUnit) => {
          return adapters.concat((adUnit.bids || []).reduce((adapters, bid) => { return adapters.concat(bid.bidder) }, []));
        }, []);
        utils.logMessage(`CALLING S2S HEADER BIDDERS ==== ${adaptersServerSide.filter(adapter => {
          return includes(allBidders, adapter);
        }).join(',')}`);

        // fire BID_REQUESTED event for each s2s bidRequest
        serverBidRequests.forEach(bidRequest => {
          events.emit(CONSTANTS.EVENTS.BID_REQUESTED, bidRequest);
        });

        // make bid requests
        s2sAdapter.callBids(
          s2sBidRequest,
          serverBidRequests,
          addBidResponse,
          () => doneCbs.forEach(done => done()),
          ajax
        );
      }
    }
  }

  // handle client adapter requests
  clientBidRequests.forEach(bidRequest => {
    bidRequest.start = timestamp();
    // TODO : Do we check for bid in pool from here and skip calling adapter again ?
    const adapter = _bidderRegistry[bidRequest.bidderCode];
    if (adapter) {
      utils.logMessage(`CALLING BIDDER ======= ${bidRequest.bidderCode}`);
      events.emit(CONSTANTS.EVENTS.BID_REQUESTED, bidRequest);
      bidRequest.doneCbCallCount = 0;
      let done = doneCb(bidRequest.bidderRequestId);
      adapter.callBids(bidRequest, addBidResponse, done, ajax);
    } else {
      utils.logError(`Adapter trying to be called which does not exist: ${bidRequest.bidderCode} adaptermanager.callBids`);
    }
  });
}

function doingS2STesting() {
  return _s2sConfig && _s2sConfig.enabled && _s2sConfig.testing && s2sTestingModule;
}

function getSupportedMediaTypes(bidderCode) {
  let result = [];
  if (includes(exports.videoAdapters, bidderCode)) result.push('video');
  if (includes(nativeAdapters, bidderCode)) result.push('native');
  return result;
}

exports.videoAdapters = []; // added by adapterLoader for now

exports.registerBidAdapter = function (bidAdaptor, bidderCode, {supportedMediaTypes = []} = {}) {
  if (bidAdaptor && bidderCode) {
    if (typeof bidAdaptor.callBids === 'function') {
      _bidderRegistry[bidderCode] = bidAdaptor;

      if (includes(supportedMediaTypes, 'video')) {
        exports.videoAdapters.push(bidderCode);
      }
      if (includes(supportedMediaTypes, 'native')) {
        nativeAdapters.push(bidderCode);
      }
    } else {
      utils.logError('Bidder adaptor error for bidder code: ' + bidderCode + 'bidder must implement a callBids() function');
    }
  } else {
    utils.logError('bidAdaptor or bidderCode not specified');
  }
};

exports.aliasBidAdapter = function (bidderCode, alias) {
  var existingAlias = _bidderRegistry[alias];

  if (typeof existingAlias === 'undefined') {
    var bidAdaptor = _bidderRegistry[bidderCode];
    if (typeof bidAdaptor === 'undefined') {
      utils.logError('bidderCode "' + bidderCode + '" is not an existing bidder.', 'adaptermanager.aliasBidAdapter');
    } else {
      try {
        let newAdapter;
        let supportedMediaTypes = getSupportedMediaTypes(bidderCode);
        // Have kept old code to support backward compatibilitiy.
        // Remove this if loop when all adapters are supporting bidderFactory. i.e When Prebid.js is 1.0
        if (bidAdaptor.constructor.prototype != Object.prototype) {
          newAdapter = new bidAdaptor.constructor();
          newAdapter.setBidderCode(alias);
        } else {
          let spec = bidAdaptor.getSpec();
          newAdapter = newBidder(Object.assign({}, spec, { code: alias }));
          exports.aliasRegistry[alias] = bidderCode;
        }
        this.registerBidAdapter(newAdapter, alias, {
          supportedMediaTypes
        });
      } catch (e) {
        utils.logError(bidderCode + ' bidder does not currently support aliasing.', 'adaptermanager.aliasBidAdapter');
      }
    }
  } else {
    utils.logMessage('alias name "' + alias + '" has been already specified.');
  }
};

exports.registerAnalyticsAdapter = function ({adapter, code}) {
  if (adapter && code) {
    if (typeof adapter.enableAnalytics === 'function') {
      adapter.code = code;
      _analyticsRegistry[code] = adapter;
    } else {
      utils.logError(`Prebid Error: Analytics adaptor error for analytics "${code}"
        analytics adapter must implement an enableAnalytics() function`);
    }
  } else {
    utils.logError('Prebid Error: analyticsAdapter or analyticsCode not specified');
  }
};

exports.enableAnalytics = function (config) {
  if (!utils.isArray(config)) {
    config = [config];
  }

  utils._each(config, adapterConfig => {
    var adapter = _analyticsRegistry[adapterConfig.provider];
    if (adapter) {
      adapter.enableAnalytics(adapterConfig);
    } else {
      utils.logError(`Prebid Error: no analytics adapter found in registry for
        ${adapterConfig.provider}.`);
    }
  });
};

exports.getBidAdapter = function(bidder) {
  return _bidderRegistry[bidder];
};

// the s2sTesting module is injected when it's loaded rather than being imported
// importing it causes the packager to include it even when it's not explicitly included in the build
exports.setS2STestingModule = function (module) {
  s2sTestingModule = module;
};

exports.callTimedOutBidders = function(adUnits, timedOutBidders, cbTimeout) {
  timedOutBidders = timedOutBidders.map((timedOutBidder) => {
    // Adding user configured params & timeout to timeout event data
    timedOutBidder.params = utils.getUserConfiguredParams(adUnits, timedOutBidder.adUnitCode, timedOutBidder.bidder);
    timedOutBidder.timeout = cbTimeout;
    return timedOutBidder;
  });
  timedOutBidders = utils.groupBy(timedOutBidders, 'bidder');

  Object.keys(timedOutBidders).forEach((bidder) => {
    try {
      const adapter = _bidderRegistry[bidder];
      const spec = adapter.getSpec();
      if (spec && spec.onTimeout && typeof spec.onTimeout === 'function') {
        utils.logInfo(`Invoking ${bidder}.onTimeout`);
        spec.onTimeout(timedOutBidders[bidder]);
      }
    } catch (e) {
      utils.logWarn(`Error calling onTimeout of ${bidder}`);
    }
  });
}


text:
Uploader
========

A very simple tool to upload files to your system.

##### Step 1
Install the tool
```
pip install git+git://github.com/alella/uploader
```

##### Step 2
Start the service
```
$ uploader
lo: http://127.0.0.1:5050
wlp58s0: http://192.168.1.8:5050
Destination dir: /tmp
...
```
You should be now able to open the url from any system in the local network to upload files using the mentioned link. Simply drag and drop files to upload.

![](https://raw.githubusercontent.com/alella/uploader/master/demo.gif)

```
usage: uploader [-h] [-p PORT] [-d DIR]

Hosts temporary service to upload files.

optional arguments:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  Host service on this port if specified else, picks up
                        a random port
  -d DIR, --dir DIR     Stores files in specified directory. Uses local
                        directory by default
```


text:
use std::fmt;

use {Args, Context, MessagePart};

/// A message that has been localized and can be formatted in a
/// locale-aware manner.
///
/// While a `Message` can be created directly from [`MessagePart`]
/// components, it is easiest to create it from [`icu::parse`].
///
/// [`MessagePart`]: trait.MessagePart.html
/// [`icu::parse`]: icu/fn.parse.html
#[derive(Debug)]
pub struct Message {
    parts: Vec<Box<MessagePart>>,
}

impl Message {
    /// Construct a message from constituent parts.
    pub fn new(parts: Vec<Box<MessagePart>>) -> Self {
        Message { parts: parts }
    }

    /// Write a message to a stream.
    ///
    /// This shouldn't be called directly in the usual case.
    /// Use `Context::write` or `Context::format` instead.
    pub fn write_message<'f>(
        &self,
        ctx: &Context,
        stream: &mut fmt::Write,
        args: Option<&Args<'f>>,
    ) -> fmt::Result {
        for part in &self.parts {
            try!(part.apply_format(ctx, stream, args));
        }
        Ok(())
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>WebSocketListener</title>
<meta name="date" content="2014-07-23">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.java_websocket

Interface WebSocketListener

All Known Implementing Classes:

ChatServer, WebSocketAdapter, WebSocketClient, WebSocketServer

public interface WebSocketListener

Implemented by <tt>WebSocketClient</tt> and <tt>WebSocketServer</tt>.
 The methods within are called by <tt>WebSocket</tt>.
 Almost every method takes a first parameter conn which represents the source of the respective event.

Method Summary

Methods

Modifier and Type
Method and Description

java.lang.String
getFlashPolicy(WebSocket conn)

Gets the XML string that should be returned if a client requests a Flash
 security policy.

java.net.InetSocketAddress
getLocalSocketAddress(WebSocket conn)

java.net.InetSocketAddress
getRemoteSocketAddress(WebSocket conn)

void
onWebsocketClose(WebSocket ws,
                int code,
                java.lang.String reason,
                boolean remote)

Called after <tt>WebSocket#close</tt> is explicity called, or when the
 other end of the WebSocket connection is closed.

void
onWebsocketCloseInitiated(WebSocket ws,
                         int code,
                         java.lang.String reason)

send when this peer sends a close handshake

void
onWebsocketClosing(WebSocket ws,
                  int code,
                  java.lang.String reason,
                  boolean remote)

called as soon as no further frames are accepted

void
onWebsocketError(WebSocket conn,
                java.lang.Exception ex)

Called if an exception worth noting occurred.

void
onWebsocketHandshakeReceivedAsClient(WebSocket conn,
                                    ClientHandshake request,
                                    ServerHandshake response)

Called on the client side when the socket connection is first established, and the WebSocketImpl
 handshake response has been received.

ServerHandshakeBuilder
onWebsocketHandshakeReceivedAsServer(WebSocket conn,
                                    Draft draft,
                                    ClientHandshake request)

Called on the server side when the socket connection is first established, and the WebSocket
 handshake has been received.

void
onWebsocketHandshakeSentAsClient(WebSocket conn,
                                ClientHandshake request)

Called on the client side when the socket connection is first established, and the WebSocketImpl
 handshake has just been sent.

void
onWebsocketMessage(WebSocket conn,
                  java.nio.ByteBuffer blob)

Called when an entire binary frame has been received.

void
onWebsocketMessage(WebSocket conn,
                  java.lang.String message)

Called when an entire text frame has been received.

void
onWebsocketMessageFragment(WebSocket conn,
                          Framedata frame)

void
onWebsocketOpen(WebSocket conn,
               Handshakedata d)

Called after <var>onHandshakeReceived</var> returns <var>true</var>.

void
onWebsocketPing(WebSocket conn,
               Framedata f)

Called a ping frame has been received.

void
onWebsocketPong(WebSocket conn,
               Framedata f)

Called when a pong frame is received.

void
onWriteDemand(WebSocket conn)

This method is used to inform the selector thread that there is data queued to be written to the socket.

Method Detail

onWebsocketHandshakeReceivedAsServer

ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer(WebSocket conn,
                                                          Draft draft,
                                                          ClientHandshake request)
                                                            throws InvalidDataException

Called on the server side when the socket connection is first established, and the WebSocket
 handshake has been received. This method allows to deny connections based on the received handshake.

 By default this method only requires protocol compliance.

Parameters:

conn - The WebSocket related to this event

draft - The protocol draft the client uses to connect

request - The opening http message send by the client. Can be used to access additional fields like cookies.

Returns:

Returns an incomplete handshake containing all optional fields

Throws:

InvalidDataException - Throwing this exception will cause this handshake to be rejected

onWebsocketHandshakeReceivedAsClient

void onWebsocketHandshakeReceivedAsClient(WebSocket conn,
                                        ClientHandshake request,
                                        ServerHandshake response)
                                          throws InvalidDataException

Called on the client side when the socket connection is first established, and the WebSocketImpl
 handshake response has been received.

Parameters:

conn - The WebSocket related to this event

request - The handshake initially send out to the server by this websocket.

response - The handshake the server sent in response to the request.

Throws:

InvalidDataException - Allows the client to reject the connection with the server in respect of its handshake response.

onWebsocketHandshakeSentAsClient

void onWebsocketHandshakeSentAsClient(WebSocket conn,
                                    ClientHandshake request)
                                      throws InvalidDataException

Called on the client side when the socket connection is first established, and the WebSocketImpl
 handshake has just been sent.

Parameters:

conn - The WebSocket related to this event

request - The handshake sent to the server by this websocket

Throws:

InvalidDataException - Allows the client to stop the connection from progressing

onWebsocketMessage

void onWebsocketMessage(WebSocket conn,
                      java.lang.String message)

Called when an entire text frame has been received. Do whatever you want
 here...

Parameters:

conn - The <tt>WebSocket</tt> instance this event is occurring on.

message - The UTF-8 decoded message that was received.

onWebsocketMessage

void onWebsocketMessage(WebSocket conn,
                      java.nio.ByteBuffer blob)

Called when an entire binary frame has been received. Do whatever you want
 here...

Parameters:

conn - The <tt>WebSocket</tt> instance this event is occurring on.

blob - The binary message that was received.

onWebsocketMessageFragment

void onWebsocketMessageFragment(WebSocket conn,
                              Framedata frame)

onWebsocketOpen

void onWebsocketOpen(WebSocket conn,
                   Handshakedata d)

Called after <var>onHandshakeReceived</var> returns <var>true</var>.
 Indicates that a complete WebSocket connection has been established,
 and we are ready to send/receive data.

Parameters:

conn - The <tt>WebSocket</tt> instance this event is occuring on.

onWebsocketClose

void onWebsocketClose(WebSocket ws,
                    int code,
                    java.lang.String reason,
                    boolean remote)

Called after <tt>WebSocket#close</tt> is explicity called, or when the
 other end of the WebSocket connection is closed.

Parameters:

conn - The <tt>WebSocket</tt> instance this event is occuring on.

onWebsocketClosing

void onWebsocketClosing(WebSocket ws,
                      int code,
                      java.lang.String reason,
                      boolean remote)

called as soon as no further frames are accepted

onWebsocketCloseInitiated

void onWebsocketCloseInitiated(WebSocket ws,
                             int code,
                             java.lang.String reason)

send when this peer sends a close handshake

onWebsocketError

void onWebsocketError(WebSocket conn,
                    java.lang.Exception ex)

Called if an exception worth noting occurred.
 If an error causes the connection to fail onClose will be called additionally afterwards.

Parameters:

ex - The exception that occurred.

            Might be null if the exception is not related to any specific connection. For example if the server port could not be bound.

onWebsocketPing

void onWebsocketPing(WebSocket conn,
                   Framedata f)

Called a ping frame has been received.
 This method must send a corresponding pong by itself.

Parameters:

f - The ping frame. Control frames may contain payload.

onWebsocketPong

void onWebsocketPong(WebSocket conn,
                   Framedata f)

Called when a pong frame is received.

getFlashPolicy

java.lang.String getFlashPolicy(WebSocket conn)
                                throws InvalidDataException

Gets the XML string that should be returned if a client requests a Flash
 security policy.

Throws:

InvalidDataException - thrown when some data that is required to generate the flash-policy like the websocket local port could not be obtained.

onWriteDemand

void onWriteDemand(WebSocket conn)

This method is used to inform the selector thread that there is data queued to be written to the socket.

getLocalSocketAddress

java.net.InetSocketAddress getLocalSocketAddress(WebSocket conn)

getRemoteSocketAddress

java.net.InetSocketAddress getRemoteSocketAddress(WebSocket conn)

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
! hash is_wsl 2>/dev/null && is_wsl() { return 0; }
! hash is_64bits 2>/dev/null && is_64bits() { return 0; }
! hash is_windows 2>/dev/null && is_windows() { return 0; }

# Set vi keys
set -o vi

# Make backspace delete in a sane way
stty erase '^?'

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
shopt -s autocd
shopt -s globstar
shopt -s cdspell
shopt -s direxpand
shopt -s dirspell
shopt -s nocaseglob

# HISTCONTROL=ignoreboth
HISTCONTROL='erasedups:ignoreboth'
HISTFILESIZE=9999
HISTSIZE=9999
# PROMPT_COMMAND='history -a'
shopt -s histappend histverify

# Path to the bash it configuration
if [[ -d "$HOME/.bash-it" ]]; then
    export BASH_IT="$HOME/.bash-it"
elif [[ -d "$HOME/.bash_it" ]]; then
    export BASH_IT="$HOME/.bash_it"
else

    export black="\[\e[0;30m\]"
    export red="\[\e[0;31m\]"
    export green="\[\e[0;32m\]"
    export yellow="\[\e[0;33m\]"
    export blue="\[\e[0;34m\]"
    export magenta="\[\e[0;35m\]"
    export purple="\[\e[0;35m\]"
    export cyan="\[\e[0;36m\]"
    export white="\[\e[0;37m\]"
    export orange="\[\e[0;91m\]"
    export normal="\[\e[0m\]"
    export reset_color="\[\e[39m\]"

    # These colors are meant to be used with `echo -e`
    export echo_black="\033[0;30m"
    export echo_red="\033[0;31m"
    export echo_green="\033[0;32m"
    export echo_yellow="\033[0;33m"
    export echo_blue="\033[0;34m"
    export echo_magenta="\033[0;35m"
    export echo_purple="\033[0;35m"
    export echo_cyan="\033[0;36m"
    export echo_white="\033[0;37;1m"
    export echo_orange="\033[0;91m"
    export echo_normal="\033[0m"
    export echo_reset_color="\033[39m"

fi

function error_msg() {
    local msg="$1"
    if [[ $NOCOLOR -eq 0 ]]; then
        printf "${red}[X] Error:${reset_color}\t %s\n" "$msg" 1>&2
    else
        printf "[X] Error:\t %s\n" "$msg" 1>&2
    fi
}

function warn_msg() {
    local msg="$1"
    if [[ $NOCOLOR -eq 0 ]]; then
        printf "${yellow}[!] Warning:${reset_color}\t %s\n" "$msg"
    else
        printf "[!] Warning:\t %s\n" "$msg"
    fi
}

function status_msg() {
    local msg="$1"
    if [[ $NOCOLOR -eq 0 ]]; then
        printf "${green}[*] Info:${reset_color}\t %s\n" "$msg"
    else
        printf "[*] Info:\t %s\n" "$msg"
    fi
}

# location ~/.bash_it/themes/
# Load it just in case it's not defined yet
if is_windows || ! is_64bits; then
    [[ -z $BASH_IT_THEME ]] && export BASH_IT_THEME='demula'
else
    [[ -z $BASH_IT_THEME ]] && export BASH_IT_THEME='bakke'
fi

# (Advanced): Change this to the name of your remote repo if you
# cloned bash-it with a remote other than origin such as `bash-it`.
# export BASH_IT_REMOTE='bash-it'

# Your place for hosting Git repos. I use this for private repos.
# [[ -z $GIT_HOSTING ]] &&  export GIT_HOSTING='git@git.domain.com'

# Don't check mail when opening terminal.
unset MAILCHECK

# Change this to your console based IRC client of choice.
# export IRC_CLIENT='irssi'

# Set this to the command you use for todo.txt-cli
# export TODO="t"

# Set this to false to turn off version control status checking within the prompt for all themes
# [[ -z $SCM_CHECK ]] && export SCM_CHECK=true

# Set Xterm/screen/Tmux title with only a short hostname.
# Uncomment this (or set SHORT_HOSTNAME to something else),
# Will otherwise fall back on $HOSTNAME.
# export SHORT_HOSTNAME=$(hostname -s)

# Set vcprompt executable path for scm advance info in prompt (demula theme)
# https://github.com/djl/vcprompt
# export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt

# Enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).

# INFO: Use enviroment variables to avoid shellcheck errors in bash_completion file
if ! shopt -oq posix; then

    COMPLETIONS="/usr/share/bash-completion"
    if [ -f "$COMPLETIONS/bash_completion" ]; then
        # shellcheck disable=SC1091
        source "$COMPLETIONS/bash_completion"
    fi

    COMPLETIONS="/etc"
    if [ -f "$COMPLETIONS/bash_completion" ]; then
        # shellcheck disable=SC1091
        source "$COMPLETIONS/bash_completion"
    fi
fi

# # pip bash completion start
# if hash pip 2>/dev/null || hash pip2 2>/dev/null || hash pip3 2>/dev/null; then
#     hash pip 2>/dev/null && eval "$(pip completion --bash)"
#     hash pip2 2>/dev/null && eval "$(pip2 completion --bash 2>/dev/null)"
#     hash pip3 2>/dev/null && eval "$(pip3 completion --bash)"
# fi
# # pip bash completion end

if hash fzf 2>/dev/null; then
    # shellcheck disable=SC1091
    [[ -f "$HOME/.fzf.bash" ]] && source "$HOME/.fzf.bash"
fi

if [[ -f "$BASH_IT/bash_it.sh" ]]; then
    # shellcheck disable=SC1091
    source "$BASH_IT/bash_it.sh"
else

    # TODO: May migrate this logic/function to python or go to improve perfomance and better handle output
    __git_info() {
        if hash git 2>/dev/null; then
            local branch changes stash info
            # shellcheck disable=SC2063
            branch="$(git branch 2>/dev/null | command grep '^*' | awk '{$1=""; print $0}')"
            if [[ -n $branch ]]; then
                if [[ ${#branch} -gt 20 ]]; then
                    local fer_issue_br_regex="^[ ]?[A-Za-z]+[/]([A-Za-z]+-[0-9]+-?)?"
                    local issue_br_regex="^[ ]?([A-Za-z]+-[0-9]+-?)?"
                    if [[ $branch =~ $fer_issue_br_regex ]]; then
                        local index
                        index="$(echo "$branch" | command grep -oE "$fer_issue_br_regex")"
                        branch=" $(echo "$branch" | awk "{print substr(\$1,${#index})}")"
                    elif [[ $branch =~ $issue_br_regex ]]; then
                        local index
                        index="$(echo "$branch" | command grep -oE "$issue_br_regex")"
                        branch=" $(echo "$branch" | awk "{print substr(\$1,${#index})}")"
                    fi
                fi
                branch="${branch/ /}"
                changes="$(git diff --shortstat 2>/dev/null | awk '{
                    printf "%s*%d %s+%d %s-%d%s", ENVIRON["echo_yellow"], $1, ENVIRON["echo_green"], $4, ENVIRON["echo_red"], $6, ENVIRON["echo_blue"];
                }')"
                to_commit="$(git diff --cached --shortstat 2>/dev/null | awk '{
                    printf "%s*%d", ENVIRON["echo_magenta"], $1;
                }')"
                stash="$(git stash list 2>/dev/null | wc -l)"
                if [[ $stash -ne 0 ]]; then
                    stash="${echo_yellow}{$stash}"
                else
                    stash=''
                fi
                info="${echo_blue}|${echo_reset_color}"
                # TODO: Find another icon to represent git branch
                if [[ -z $NO_COOL_FONTS ]]; then
                    info="$info ${echo_white}${echo_reset_color}"
                    info="$info ${echo_blue}$branch${echo_reset_color}"
                else
                    info="$info ${echo_blue}{$branch}${echo_reset_color}"
                fi
                [[ -n $to_commit ]] && info="$info $to_commit${echo_reset_color}"
                [[ -n $changes ]] && info="$info $changes${echo_reset_color}"
                [[ -n $stash ]] && info="$info $stash${echo_reset_color}"
                info="$info ${echo_blue}|${echo_reset_color} "
                echo -e "$info"
            fi
        fi
    }

    __venv() {
        # TODO: May shoud cache the version and clear cache once we deactivate/change virtual env
        if [[ -n $VIRTUAL_ENV ]]; then
            ENV_VERSION="$(python --version | awk '{print $2}')"
            export ENV_VERSION="${ENV_VERSION%% *}"
            env_name="${VIRTUAL_ENV##*/}"
        elif [[ -n $CONDA_DEFAULT_ENV ]]; then
            ENV_VERSION="$($CONDA_PYTHON_EXE --version | awk '{print $2}')"
            export ENV_VERSION="${ENV_VERSION%% *}"
            env_name="$CONDA_DEFAULT_ENV"
        fi

        if [[ -n $ENV_VERSION ]]; then
            echo " %F{white}(${env_name} 🐍 ${ENV_VERSION})%f "
        else
            unset ENV_VERSION 2>/dev/null
        fi
    }

    __proxy() {
        # shellcheck disable=SC2154
        if [[ -n $http_proxy ]]; then
            echo -e "${echo_green}🌐${echo_reset_color} "
        fi
    }

    __user() {
        if [[ $EUID -eq 0 ]]; then
            echo -e "${echo_red}$USER${echo_reset_color} at "
        fi
    }

    __exit_code() {
        # ➤
        # ▶
        # $
        # ❯
        # »
        # ❯
        local rc="$1"
        # NOTE: ignore send to background and <CTRL-c> exit codes
        if [[ $rc -ne 0 ]] && [[ $rc -ne 148 ]] && [[ $rc -ne 130 ]]; then
            echo -e "${echo_red}❯${echo_reset_color} "
        else
            echo "❯ "
        fi
    }

    __schroot_name() {
        if [[ -n ${SCHROOT_CHROOT_NAME} ]]; then
            echo -e "${echo_red}(${SCHROOT_CHROOT_NAME})${echo_reset_color} "
        fi
    }

    __cwd() {
        local _cwd
        _cwd="$(pwd -P)"
        _cwd="${_cwd/$HOME/~}"
        if [[ ${#_cwd} -gt $((COLUMNS / 2)) ]]; then
            local i=2
            while [[ ${#_cwd} -gt $((COLUMNS / 2)) ]] || [[ -z $(echo "$_cwd" | awk -F/ "{ print substr(\$$i,1,1)}") ]]; do
                _cwd="$(echo "$_cwd" | awk -F/ "BEGIN { OFS = FS } { \$$i = substr(\$$i,1,1) } {print}")"
                i=$((i + 1))
            done
            echo -e "${echo_yellow}${_cwd}${echo_reset_color} "
        else
            echo -e "${echo_yellow}\w${echo_reset_color} "
        fi
    }

    function __cc_view() {
        if [[ -n $CLEARCASE_CMDLINE ]]; then
            echo -e "${echo_red}($(echo "$CLEARCASE_CMDLINE" | awk "{ \$2 = substr(\$2,${#USER}+5) } {print \$2}"))${echo_reset_color}"
        fi
    }

    # TODO: This function should short long components automatically
    # TODO: Add support for custom host prompt segments
    _prompt_command() {
        local EXIT_CODE="$?"

        PS1="\n"
        # PS1+="$(__schroot_name)"
        # PS1+="$(__exit_code)"
        PS1+="$(__user)"
        PS1+="${cyan}\h${reset_color}: "
        # PS1+="${yellow}\w${reset_color} "
        PS1+="$(__cwd)"
        PS1+="${magenta}J:\j${reset_color} "
        PS1+="$(__proxy)"
        PS1+="$(__venv)"
        PS1+="$(__cc_view) "
        PS1+="$(__git_info) "
        PS1+="\n$(__exit_code "$EXIT_CODE")"
        # PS1+="\n$ "
    }
    PROMPT_COMMAND=_prompt_command

fi

if hash kitty 2>/dev/null; then
    source <(kitty + complete setup bash)
fi

if hash tmux 2>/dev/null; then
    bind '"\C-a":"tmux a || tmux new -s main\n"'
fi

function toggleProxy() {
    # shellcheck disable=SC2154
    if [[ -n $http_proxy ]]; then
        unset "http_proxy"
        unset "https_proxy"
        unset "ftp_proxy"
        unset "socks_proxy"
        unset "no_proxy"
        export PROXY_DISABLE=1
        echo -e " ${echo_yellow}Proxy disable${echo_reset_color}"
    elif [[ -f "$HOME/.config/shell/host/proxy.sh" ]]; then
        # shellcheck disable=SC1090,SC1091
        source "$HOME/.config/shell/host/proxy.sh"
        unset PROXY_DISABLE
        echo -e " ${echo_green}Proxy enable${echo_reset_color}"
    else
        echo -e " ${echo_red}Missing proxy file !!${echo_reset_color}"
    fi
}

#######################################################################
#                          Bash Completion                            #
#######################################################################

if [[ -f /etc/bash_completion ]]; then
    # shellcheck disable=SC1091
    source /etc/bash_completion
elif [[ -f /usr/share/bash-completion/bash_completion ]]; then
    # shellcheck disable=SC1091
    source /usr/share/bash-completion/bash_completion
else
    # TODO: This may be too slow in some systems

    completion_dirs=(
        "/usr/share/bash-completion/completions"
        "/etc/bash_completion.d/"
    )

    for cdir in "${completion_dirs[@]}"; do
        if [[ -d $cdir   ]]; then
            for src in "$cdir"/*; do
                source "$src" 2>/dev/null
            done
        fi
    done
fi


text:
namespace content {

RenderViewHostDelegateView* RenderViewHostDelegate::GetDelegateView() {
  return nullptr;
}

bool RenderViewHostDelegate::IsNeverComposited() {
  return false;
}

bool RenderViewHostDelegate::IsJavaScriptDialogShowing() const {
  return false;
}

bool RenderViewHostDelegate::ShouldIgnoreUnresponsiveRenderer() {
  return false;
}

bool RenderViewHostDelegate::IsGuest() {
  return false;
}

absl::optional<SkColor> RenderViewHostDelegate::GetBaseBackgroundColor() {
  return absl::nullopt;
}

}  // namespace content


text:
/**
 * Created by kysonchao on 2017/8/12.
 */
'use strict'

$(document).ready(function () {
    var load_chat = function () {
        $.getJSON("output/module_dependencies_repr.json", function (module_dependencies_repr) {
            console.log(module_dependencies_repr);
            var nodes = [];
            var edges = [];
            for (var i = 0; i < module_dependencies_repr.length; i++) {
                var module_dependency_item = module_dependencies_repr[i];
                var module_name = module_dependency_item.name;
                var module_path = module_dependency_item.path;
                var module_dependencies = module_dependency_item.dependencies;
                nodes.push(
                    {data: {id: module_name, name: module_name}}
                );

                for (var j = 0; j < module_dependencies.length; j++) {
                    edges.push({
                        data: {
                            source: module_name,
                            target: module_dependencies[j]
                        }
                    })
                }
            }
            draw_chat(nodes, edges);
        });

        function draw_chat(nodes, edges) {
            var cy = cytoscape({
                container: $('#cy'),
                boxSelectionEnabled: false,
                autounselectify: false,
                selectionType: "additive",

                style: cytoscape.stylesheet()
                    .selector('node')
                    .css({
                        'content': 'data(name)',
                        'text-valign': 'center',
                        'color': 'white',
                        'background-opacity': 0.7,
                        'background-color': '#0099CC',
                        'text-outline-color': '#0099CC'
                    })
                    .selector('edge')
                    .css({
                        'curve-style': 'bezier',
                        'target-arrow-shape': 'triangle',
                        'target-arrow-color': '#CCCCCC',
                        'line-color': '#CCCCCC',
                        'width': 0.5
                    })
                    .selector(':selected')
                    .css({
                        'background-color': '#CCFF66',
                        'line-color': '#CCFF66',
                        'target-arrow-color': '#CCFF66',
                        'source-arrow-color': '#CCFF66'
                    })
                    .selector('.faded')
                    .css({
                        'opacity': 1.0,
                        'text-opacity': 0
                    }),
                elements: {
                    nodes: nodes,
                    edges: edges
                },
                layout: {
                    name: 'cose',
                    padding: 10
                }
            });

            function clearSelection() {
                var eles = cy.elements();
                for (var j = 0; j < eles.length; j++) {
                    eles[j].unselect();
                }
            }

            cy.on('tap', 'node', function (e) {
                clearSelection();
                var node = e.target;
                var neighborhood_dependencies = node.neighborhood("edge[source = \"" + node.data("id") + "\"]");
                console.log(neighborhood_dependencies);
                for (var i = 0; i < neighborhood_dependencies.length; i++) {
                    var neighborhood_node = cy.$("#" + neighborhood_dependencies[i].data("target"));
                    neighborhood_dependencies[i].select();
                    neighborhood_node.select();
                }
            });
            cy.on("tap", "edge", function (e) {
                clearSelection();
            })
        }
    };
    load_chat();
});


text:
from rlbot.parsing.agent_config_parser import add_participant_header, add_scripts_header
from rlbot.parsing.match_settings_config_parser import add_mutator_header, add_match_settings_header
from rlbot.parsing.custom_config import ConfigObject
from rlbot.utils.logging_utils import get_logger

TEAM_CONFIGURATION_HEADER = "Team Configuration"
RLBOT_CONFIGURATION_HEADER = 'RLBot Configuration'
EXTENSION_PATH_KEY = 'extension_path'
NETWORKING_ROLE_KEY = 'networking_role'
NETWORK_ADDRESS_KEY = 'network_address'

logger = get_logger('rlbot')

def create_bot_config_layout():
    config_object = ConfigObject()
    rlbot_header = config_object.add_header_name(RLBOT_CONFIGURATION_HEADER)
    rlbot_header.add_value(EXTENSION_PATH_KEY, str, default=None,
                           description='A path to the extension file we want to load')
    rlbot_header.add_value(NETWORKING_ROLE_KEY, str, default='none',
                           description='Defines the behavior when connecting multiple RLBot instances over a network.')
    rlbot_header.add_value(NETWORK_ADDRESS_KEY, str, default='127.0.0.1',
                           description='The IP address to connect to if networking is desired.')

    team_header = config_object.add_header_name(TEAM_CONFIGURATION_HEADER)
    team_header.add_value("Team Blue Color", int, default=0,
                          description="Changes Blue team color, use 0 to use default color")
    team_header.add_value("Team Blue Name", str, default="Blue",
                          description="Changes the Team name to use instead of 'Blue'")
    team_header.add_value("Team Orange Color", int, default=0,
                          description="Changes Blue team color, use 0 to use default color")
    team_header.add_value("Team Orange Name", str, default="Orange",
                          description="Changes the Team name to use instead of 'Orange'")
    add_match_settings_header(config_object)
    add_mutator_header(config_object)
    add_participant_header(config_object)
    add_scripts_header(config_object)
    return config_object


text:
require 'test/unit'

class AnAclTest < Test::Unit::TestCase
  # Replace this with your real tests.
  test "the truth" do
    assert true
  end
end


text:
namespace AsmJit {

//! @addtogroup AsmJit_MemoryManagement
//! @{

// ============================================================================
// [AsmJit::MemoryManager]
// ============================================================================

//! @brief Virtual memory manager interface.
//!
//! This class is pure virtual. You can get default virtual memory manager using
//! @c getGlobal() method. If you want to create more memory managers with same
//! functionality as global memory manager use @c VirtualMemoryManager class.
struct ASMJIT_API MemoryManager
{
  // --------------------------------------------------------------------------
  // [Construction / Destruction]
  // --------------------------------------------------------------------------

  //! @brief Create memory manager instance.
  MemoryManager() ASMJIT_NOTHROW;
  //! @brief Destroy memory manager instance, this means also to free all memory
  //! blocks.
  virtual ~MemoryManager() ASMJIT_NOTHROW;

  // --------------------------------------------------------------------------
  // [Interface]
  // --------------------------------------------------------------------------

  //! @brief Allocate a @a size bytes of virtual memory.
  //!
  //! Note that if you are implementing your own virtual memory manager then you
  //! can quitly ignore type of allocation. This is mainly for AsmJit to memory
  //! manager that allocated memory will be never freed.
  virtual void* alloc(sysuint_t size, uint32_t type = MEMORY_ALLOC_FREEABLE) ASMJIT_NOTHROW = 0;
  //! @brief Free previously allocated memory at a given @a address.
  virtual bool free(void* address) ASMJIT_NOTHROW = 0;
  //! @brief Free some tail memory.
  virtual bool shrink(void* address, sysuint_t used) ASMJIT_NOTHROW = 0;
  //! @brief Free all allocated memory.
  virtual void freeAll() ASMJIT_NOTHROW = 0;

  //! @brief Get how many bytes are currently used.
  virtual sysuint_t getUsedBytes() ASMJIT_NOTHROW = 0;
  //! @brief Get how many bytes are currently allocated.
  virtual sysuint_t getAllocatedBytes() ASMJIT_NOTHROW = 0;

  //! @brief Get global memory manager instance.
  //!
  //! Global instance is instance of @c VirtualMemoryManager class. Global memory
  //! manager is used by default by @ref Assembler::make() and @ref Compiler::make()
  //! methods.
  static MemoryManager* getGlobal() ASMJIT_NOTHROW;
};

//! @brief Reference implementation of memory manager that uses
//! @ref AsmJit::VirtualMemory class to allocate chunks of virtual memory
//! and bit arrays to manage it.
struct ASMJIT_API VirtualMemoryManager : public MemoryManager
{
  // --------------------------------------------------------------------------
  // [Construction / Destruction]
  // --------------------------------------------------------------------------

  //! @brief Create a @c VirtualMemoryManager instance.
  VirtualMemoryManager() ASMJIT_NOTHROW;

#if defined(ASMJIT_WINDOWS)
  //! @brief Create a @c VirtualMemoryManager instance for process @a hProcess.
  //!
  //! This is specialized version of constructor available only for windows and
  //! usable to alloc/free memory of different process.
  VirtualMemoryManager(HANDLE hProcess) ASMJIT_NOTHROW;
#endif // ASMJIT_WINDOWS

  //! @brief Destroy the @c VirtualMemoryManager instance, this means also to
  //! free all blocks.
  virtual ~VirtualMemoryManager() ASMJIT_NOTHROW;

  // --------------------------------------------------------------------------
  // [Interface]
  // --------------------------------------------------------------------------

  virtual void* alloc(sysuint_t size, uint32_t type = MEMORY_ALLOC_FREEABLE) ASMJIT_NOTHROW;
  virtual bool free(void* address) ASMJIT_NOTHROW;
  virtual bool shrink(void* address, sysuint_t used) ASMJIT_NOTHROW;
  virtual void freeAll() ASMJIT_NOTHROW;

  virtual sysuint_t getUsedBytes() ASMJIT_NOTHROW;
  virtual sysuint_t getAllocatedBytes() ASMJIT_NOTHROW;

  // --------------------------------------------------------------------------
  // [Virtual Memory Manager Specific]
  // --------------------------------------------------------------------------

  //! @brief Get whether to keep allocated memory after memory manager is
  //! destroyed.
  //!
  //! @sa @c setKeepVirtualMemory().
  bool getKeepVirtualMemory() const ASMJIT_NOTHROW;

  //! @brief Set whether to keep allocated memory after memory manager is
  //! destroyed.
  //!
  //! This method is usable when patching code of remote process. You need to
  //! allocate process memory, store generated assembler into it and patch the
  //! method you want to redirect (into your code). This method affects only
  //! VirtualMemoryManager destructor. After destruction all internal
  //! structures are freed, only the process virtual memory remains.
  //!
  //! @note Memory allocated with MEMORY_ALLOC_PERMANENT is always kept.
  //!
  //! @sa @c getKeepVirtualMemory().
  void setKeepVirtualMemory(bool keepVirtualMemory) ASMJIT_NOTHROW;

  // --------------------------------------------------------------------------
  // [Debug]
  // --------------------------------------------------------------------------

#if defined(ASMJIT_MEMORY_MANAGER_DUMP)
  //! @brief Dump memory manager tree into file.
  //!
  //! Generated output is using DOT language (from graphviz package).
  void dump(const char* fileName);
#endif // ASMJIT_MEMORY_MANAGER_DUMP

  // --------------------------------------------------------------------------
  // [Members]
  // --------------------------------------------------------------------------

protected:
  //! @brief Pointer to private data hidden from the public API.
  void* _d;
};

//! @}

} // AsmJit namespace

// [Api-End]
#include "ApiEnd.h"

// [Guard]
#endif // _ASMJIT_MEMORYMANAGER_H


text:
package com.infinities.skyport.compute.entity;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlElement;

public class DataCenter implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	@XmlElement(name = "DataCenterId")
	private String dataCenterId;

	@XmlElement(name = "Name")
	private String name;

	@XmlElement(name = "Description")
	private String description;

	@XmlElement(name = "Type")
	private String type;

	@XmlElement(name = "Status")
	private String status;

	@XmlElement(name = "Config")
	private String config;

	@XmlElement(name = "ConfigId")
	private String configid;

	public DataCenter() {
	}

	public DataCenter(String dataCenterId, String name, String description, String type, String status) {
		super();
		this.config = null;
		this.dataCenterId = dataCenterId;
		this.name = name;
		this.description = description;
		this.type = type;
		this.status = status;
	}

	public String getDataCenterId() {
		return dataCenterId;
	}

	public void setDataCenterId(String dataCenterId) {
		this.dataCenterId = dataCenterId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getConfig() {
		return config;
	}

	public void setConfig(String config) {
		this.config = config;
	}

	public String getConfigid() {
		return configid;
	}

	public void setConfigid(String configid) {
		this.configid = configid;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		DataCenter other = (DataCenter) obj;
		if (dataCenterId == null) {
			if (other.dataCenterId != null) {
				return false;
			}
		} else if (!dataCenterId.equals(other.dataCenterId)) {
			return false;
		}
		return true;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((dataCenterId == null) ? 0 : dataCenterId.hashCode());
		return result;
	}
}


text:
"""
FILE: sample_authentication.py

DESCRIPTION:
    This sample demonstrates how to authenticate to the Conversational Language Understanding service.
    We authenticate using an AzureKeyCredential from azure.core.credentials or a token credential from the
    azure-identity client library.

    See more details about authentication here:
    https://docs.microsoft.com/azure/cognitive-services/authentication

    Note: the endpoint must be formatted to use the custom domain name for your resource:
    https://<NAME-OF-YOUR-RESOURCE>.cognitiveservices.azure.com/

USAGE:
    python sample_authentication.py

    Set the environment variables with your own values before running the sample:
    1) AZURE_CONVERSATIONS_ENDPOINT - the endpoint to your Conversational Language Understanding resource.
    2) AZURE_CONVERSATIONS_KEY - your Conversational Language Understanding API key
"""

import os

def sample_authentication_api_key():
    # [START create_dt_client_with_key]
    from azure.core.credentials import AzureKeyCredential
    from azure.ai.language.conversations import ConversationAnalysisClient

    endpoint = os.environ["AZURE_CONVERSATIONS_ENDPOINT"]
    key = os.environ["AZURE_CONVERSATIONS_KEY"]

    clu_client = ConversationAnalysisClient(endpoint, AzureKeyCredential(key))
    # [END create_clu_client_with_key]

def sample_authentication_with_azure_active_directory():
    """DefaultAzureCredential will use the values from these environment
    variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
    """
    print("\n.. authentication_with_azure_active_directory")
    from azure.ai.language.conversations import ConversationAnalysisClient
    from azure.identity import DefaultAzureCredential

    endpoint = os.environ["AZURE_CONVERSATIONS_ENDPOINT"]
    credential = DefaultAzureCredential()

    clu_client = ConversationAnalysisClient(endpoint, credential=credential)

if __name__ == '__main__':
    sample_authentication_api_key()
    sample_authentication_with_azure_active_directory()


text:
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */
package com.facebook.android;

public final class R {
	public static final class attr {
		public static final int confirm_logout = 0x7f0100ce;
		public static final int done_button_background = 0x7f0100c8;
		public static final int done_button_text = 0x7f0100c6;
		public static final int extra_fields = 0x7f0100c3;
		public static final int fetch_user_info = 0x7f0100cf;
		public static final int is_cropped = 0x7f0100d3;
		public static final int login_text = 0x7f0100d0;
		public static final int logout_text = 0x7f0100d1;
		public static final int multi_select = 0x7f0100c9;
		public static final int preset_size = 0x7f0100d2;
		public static final int radius_in_meters = 0x7f0100ca;
		public static final int results_limit = 0x7f0100cb;
		public static final int search_text = 0x7f0100cc;
		public static final int show_pictures = 0x7f0100c2;
		public static final int show_search_box = 0x7f0100cd;
		public static final int show_title_bar = 0x7f0100c4;
		public static final int title_bar_background = 0x7f0100c7;
		public static final int title_text = 0x7f0100c5;
	}
	public static final class color {
		public static final int com_facebook_blue = 0x7f090045;
		public static final int com_facebook_loginview_text_color = 0x7f090049;
		public static final int com_facebook_picker_search_bar_background = 0x7f090043;
		public static final int com_facebook_picker_search_bar_text = 0x7f090044;
		public static final int com_facebook_usersettingsfragment_connected_shadow_color = 0x7f090047;
		public static final int com_facebook_usersettingsfragment_connected_text_color = 0x7f090046;
		public static final int com_facebook_usersettingsfragment_not_connected_text_color = 0x7f090048;
	}
	public static final class dimen {
		public static final int com_facebook_loginview_compound_drawable_padding = 0x7f0d0102;
		public static final int com_facebook_loginview_padding_bottom = 0x7f0d0101;
		public static final int com_facebook_loginview_padding_left = 0x7f0d00fe;
		public static final int com_facebook_loginview_padding_right = 0x7f0d00ff;
		public static final int com_facebook_loginview_padding_top = 0x7f0d0100;
		public static final int com_facebook_loginview_text_size = 0x7f0d0103;
		public static final int com_facebook_picker_divider_width = 0x7f0d00fb;
		public static final int com_facebook_picker_place_image_size = 0x7f0d00fa;
		public static final int com_facebook_profilepictureview_preset_size_large = 0x7f0d0106;
		public static final int com_facebook_profilepictureview_preset_size_normal = 0x7f0d0105;
		public static final int com_facebook_profilepictureview_preset_size_small = 0x7f0d0104;
		public static final int com_facebook_usersettingsfragment_profile_picture_height = 0x7f0d00fd;
		public static final int com_facebook_usersettingsfragment_profile_picture_width = 0x7f0d00fc;
	}
	public static final class drawable {
		public static final int com_facebook_button_blue = 0x7f02005e;
		public static final int com_facebook_button_blue_focused = 0x7f02005f;
		public static final int com_facebook_button_blue_normal = 0x7f020060;
		public static final int com_facebook_button_blue_pressed = 0x7f020061;
		public static final int com_facebook_button_check = 0x7f020062;
		public static final int com_facebook_button_check_off = 0x7f020063;
		public static final int com_facebook_button_check_on = 0x7f020064;
		public static final int com_facebook_button_grey_focused = 0x7f020065;
		public static final int com_facebook_button_grey_normal = 0x7f020066;
		public static final int com_facebook_button_grey_pressed = 0x7f020067;
		public static final int com_facebook_close = 0x7f020068;
		public static final int com_facebook_inverse_icon = 0x7f020069;
		public static final int com_facebook_list_divider = 0x7f02006a;
		public static final int com_facebook_list_section_header_background = 0x7f02006b;
		public static final int com_facebook_loginbutton_silver = 0x7f02006c;
		public static final int com_facebook_logo = 0x7f02006d;
		public static final int com_facebook_picker_default_separator_color = 0x7f0200da;
		public static final int com_facebook_picker_item_background = 0x7f02006e;
		public static final int com_facebook_picker_list_focused = 0x7f02006f;
		public static final int com_facebook_picker_list_longpressed = 0x7f020070;
		public static final int com_facebook_picker_list_pressed = 0x7f020071;
		public static final int com_facebook_picker_list_selector = 0x7f020072;
		public static final int com_facebook_picker_list_selector_background_transition = 0x7f020073;
		public static final int com_facebook_picker_list_selector_disabled = 0x7f020074;
		public static final int com_facebook_picker_magnifier = 0x7f020075;
		public static final int com_facebook_picker_top_button = 0x7f020076;
		public static final int com_facebook_place_default_icon = 0x7f020077;
		public static final int com_facebook_profile_default_icon = 0x7f020078;
		public static final int com_facebook_profile_picture_blank_portrait = 0x7f020079;
		public static final int com_facebook_profile_picture_blank_square = 0x7f02007a;
		public static final int com_facebook_top_background = 0x7f02007b;
		public static final int com_facebook_top_button = 0x7f02007c;
		public static final int com_facebook_usersettingsfragment_background_gradient = 0x7f02007d;
	}
	public static final class id {
		public static final int com_facebook_login_activity_progress_bar = 0x7f08006c;
		public static final int com_facebook_picker_activity_circle = 0x7f08006b;
		public static final int com_facebook_picker_checkbox = 0x7f08006e;
		public static final int com_facebook_picker_checkbox_stub = 0x7f080072;
		public static final int com_facebook_picker_divider = 0x7f080076;
		public static final int com_facebook_picker_done_button = 0x7f080075;
		public static final int com_facebook_picker_image = 0x7f08006f;
		public static final int com_facebook_picker_list_section_header = 0x7f080073;
		public static final int com_facebook_picker_list_view = 0x7f08006a;
		public static final int com_facebook_picker_profile_pic_stub = 0x7f080070;
		public static final int com_facebook_picker_row_activity_circle = 0x7f08006d;
		public static final int com_facebook_picker_search_text = 0x7f08007b;
		public static final int com_facebook_picker_title = 0x7f080071;
		public static final int com_facebook_picker_title_bar = 0x7f080078;
		public static final int com_facebook_picker_title_bar_stub = 0x7f080077;
		public static final int com_facebook_picker_top_bar = 0x7f080074;
		public static final int com_facebook_search_bar_view = 0x7f08007a;
		public static final int com_facebook_usersettingsfragment_login_button = 0x7f08007e;
		public static final int com_facebook_usersettingsfragment_logo_image = 0x7f08007c;
		public static final int com_facebook_usersettingsfragment_profile_name = 0x7f08007d;
		public static final int large = 0x7f08002a;
		public static final int normal = 0x7f080006;
		public static final int picker_subtitle = 0x7f080079;
		public static final int small = 0x7f080029;
	}
	public static final class layout {
		public static final int com_facebook_friendpickerfragment = 0x7f030029;
		public static final int com_facebook_login_activity_layout = 0x7f03002a;
		public static final int com_facebook_picker_activity_circle_row = 0x7f03002b;
		public static final int com_facebook_picker_checkbox = 0x7f03002c;
		public static final int com_facebook_picker_image = 0x7f03002d;
		public static final int com_facebook_picker_list_row = 0x7f03002e;
		public static final int com_facebook_picker_list_section_header = 0x7f03002f;
		public static final int com_facebook_picker_search_box = 0x7f030030;
		public static final int com_facebook_picker_title_bar = 0x7f030031;
		public static final int com_facebook_picker_title_bar_stub = 0x7f030032;
		public static final int com_facebook_placepickerfragment = 0x7f030033;
		public static final int com_facebook_placepickerfragment_list_row = 0x7f030034;
		public static final int com_facebook_search_bar_layout = 0x7f030035;
		public static final int com_facebook_usersettingsfragment = 0x7f030036;
	}
	public static final class string {
		public static final int com_facebook_choose_friends = 0x7f0a007c;
		public static final int com_facebook_dialogloginactivity_ok_button = 0x7f0a006d;
		public static final int com_facebook_internet_permission_error_message = 0x7f0a0080;
		public static final int com_facebook_internet_permission_error_title = 0x7f0a007f;
		public static final int com_facebook_loading = 0x7f0a007e;
		public static final int com_facebook_loginview_cancel_action = 0x7f0a0073;
		public static final int com_facebook_loginview_log_in_button = 0x7f0a006f;
		public static final int com_facebook_loginview_log_out_action = 0x7f0a0072;
		public static final int com_facebook_loginview_log_out_button = 0x7f0a006e;
		public static final int com_facebook_loginview_logged_in_as = 0x7f0a0070;
		public static final int com_facebook_loginview_logged_in_using_facebook = 0x7f0a0071;
		public static final int com_facebook_logo_content_description = 0x7f0a0074;
		public static final int com_facebook_nearby = 0x7f0a007d;
		public static final int com_facebook_picker_done_button_text = 0x7f0a007b;
		public static final int com_facebook_placepicker_subtitle_catetory_only_format = 0x7f0a0079;
		public static final int com_facebook_placepicker_subtitle_format = 0x7f0a0078;
		public static final int com_facebook_placepicker_subtitle_were_here_only_format = 0x7f0a007a;
		public static final int com_facebook_requesterror_password_changed = 0x7f0a0083;
		public static final int com_facebook_requesterror_permissions = 0x7f0a0085;
		public static final int com_facebook_requesterror_reconnect = 0x7f0a0084;
		public static final int com_facebook_requesterror_relogin = 0x7f0a0082;
		public static final int com_facebook_requesterror_web_login = 0x7f0a0081;
		public static final int com_facebook_usersettingsfragment_log_in_button = 0x7f0a0075;
		public static final int com_facebook_usersettingsfragment_logged_in = 0x7f0a0076;
		public static final int com_facebook_usersettingsfragment_not_logged_in = 0x7f0a0077;
	}
	public static final class style {
		public static final int com_facebook_loginview_default_style = 0x7f0e00a9;
		public static final int com_facebook_loginview_silver_style = 0x7f0e00aa;
	}
	public static final class styleable {
		public static final int[] com_facebook_friend_picker_fragment = { 0x7f0100c9 };
		public static final int com_facebook_friend_picker_fragment_multi_select = 0;
		public static final int[] com_facebook_login_view = { 0x7f0100ce, 0x7f0100cf, 0x7f0100d0, 0x7f0100d1 };
		public static final int com_facebook_login_view_confirm_logout = 0;
		public static final int com_facebook_login_view_fetch_user_info = 1;
		public static final int com_facebook_login_view_login_text = 2;
		public static final int com_facebook_login_view_logout_text = 3;
		public static final int[] com_facebook_picker_fragment = { 0x7f0100c2, 0x7f0100c3, 0x7f0100c4, 0x7f0100c5, 0x7f0100c6, 0x7f0100c7, 0x7f0100c8 };
		public static final int com_facebook_picker_fragment_done_button_background = 6;
		public static final int com_facebook_picker_fragment_done_button_text = 4;
		public static final int com_facebook_picker_fragment_extra_fields = 1;
		public static final int com_facebook_picker_fragment_show_pictures = 0;
		public static final int com_facebook_picker_fragment_show_title_bar = 2;
		public static final int com_facebook_picker_fragment_title_bar_background = 5;
		public static final int com_facebook_picker_fragment_title_text = 3;
		public static final int[] com_facebook_place_picker_fragment = { 0x7f0100ca, 0x7f0100cb, 0x7f0100cc, 0x7f0100cd };
		public static final int com_facebook_place_picker_fragment_radius_in_meters = 0;
		public static final int com_facebook_place_picker_fragment_results_limit = 1;
		public static final int com_facebook_place_picker_fragment_search_text = 2;
		public static final int com_facebook_place_picker_fragment_show_search_box = 3;
		public static final int[] com_facebook_profile_picture_view = { 0x7f0100d2, 0x7f0100d3 };
		public static final int com_facebook_profile_picture_view_is_cropped = 1;
		public static final int com_facebook_profile_picture_view_preset_size = 0;
	}
}


text:
"""
Created by James Dunlop
This is if you are using your own config and wish to add this application to it.
It is mainly used for the api to set the base paths from and the debugging for the tool.
"""
## Import base python stuff
import sys, getpass

#############################################
## CONFIG CONSTANTS
#############################################
## SOME CUSTOM FLAGS FOR THINGS TO DO OR USE
DEBUGGING                       = True

## SETUP BASE CONSTANTS FOR THE CONFIG
USER_NAME                       = '%s' % getpass.getuser()
## SHOT GUN BASE CONSTANTS
SHOTGUN_CONFIG_NAME             = 'default'
SHOTGUN_URL                     = 'https://mystudio.shotgunstudio.com'
SHOTGUN_TOOLKIT_NAME            = 'Toolkit'
SHOTGUN_TOOLKIT_API_KEY         = 'APIKEY'

## Set platform dependant config constants
if sys.platform == 'win32':
    ## OS specific
    TEMP_FOLDER                 = 'C:/Temp'
    OSTYPE                      = 'win'

    ## Shotgun specific
    SHOTGUN_SOFTWARE_ROOT       = 'T:/software'
    SHOTGUN_PRIMARY_DRIVE       = 'I:'
    SHOTGUN_SECONDARY_DRIVE     = 'K:'
    SHOTGUN_CONFIG_PATH         = '%s/%s' % (SHOTGUN_SOFTWARE_ROOT, SHOTGUN_CONFIG_NAME)
    SHOTGUN_ICON_PATH           = '%s/%s/config/icons' % (SHOTGUN_SOFTWARE_ROOT, SHOTGUN_CONFIG_NAME)
    TANKCORE_PYTHON_PATH        = '%s/studio/install/core/python' % SHOTGUN_SOFTWARE_ROOT
    SGTK_PYTHON_PATH            = '%s/python-api' % SHOTGUN_SOFTWARE_ROOT
    SHOTGUN_LIBRARY_PATH        = '%s/defaultShotgunLibrary' % SHOTGUN_SOFTWARE_ROOT
    SHOTGUN_DEVAPPS_PATH        = '%s/install/apps' % SHOTGUN_CONFIG_PATH

## OSX
elif sys.platform == 'darwin':
    ## OS specific
    TEMP_FOLDER                 = '/tmp'
    OSTYPE                      = 'osx'

    ## Shotgun specific
    SHOTGUN_SOFTWARE_ROOT       = '/volumes/development/software'
    SHOTGUN_PRIMARY_DRIVE       = '/volumes/projects'
    SHOTGUN_SECONDARY_DRIVE     = '/volumes/renders'
    SHOTGUN_CONFIG_PATH         = '%s/%s' % (SHOTGUN_SOFTWARE_ROOT, SHOTGUN_CONFIG_NAME)
    SHOTGUN_ICON_PATH           = '%s/%s/config/icons' % (SHOTGUN_SOFTWARE_ROOT, SHOTGUN_CONFIG_NAME)
    TANKCORE_PYTHON_PATH        = '%s/studio/install/core/python' % SHOTGUN_SOFTWARE_ROOT
    SGTK_PYTHON_PATH            = '%s/python-api' % SHOTGUN_SOFTWARE_ROOT
    SHOTGUN_LIBRARY_PATH        = '%s/defaultShotgunLibrary' % SHOTGUN_SOFTWARE_ROOT
    SHOTGUN_DEVAPPS_PATH        = '%s/install/apps' % SHOTGUN_CONFIG_PATH

## LINUX
else:
    ## OS specific
    TEMP_FOLDER                 = '/tmp'
    OSTYPE                      = 'linux'

    ## Shotgun specific
    SHOTGUN_SOFTWARE_ROOT       = '/development'
    SHOTGUN_PRIMARY_DRIVE       = '/projects'
    SHOTGUN_SECONDARY_DRIVE     = '/renders'
    SHOTGUN_CONFIG_PATH         = '%s/%s' % (SHOTGUN_SOFTWARE_ROOT, SHOTGUN_CONFIG_NAME)
    SHOTGUN_ICON_PATH           = '%s/%s/config/icons' % (SHOTGUN_SOFTWARE_ROOT, SHOTGUN_CONFIG_NAME)
    TANKCORE_PYTHON_PATH        = '%s/studio/install/core/python' % SHOTGUN_SOFTWARE_ROOT
    SGTK_PYTHON_PATH            = '%s/python-api' % SHOTGUN_SOFTWARE_ROOT
    SHOTGUN_LIBRARY_PATH        = '%s/defaultShotgunLibrary' % SHOTGUN_SOFTWARE_ROOT
    SHOTGUN_DEVAPPS_PATH        = '%s/install/apps' % SHOTGUN_CONFIG_PATH


text:
using SADFM.Infrastructure.Models;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SADFM.Infrastructure.Services
{
    public interface IReportService
    {
        DataTable FacilityVolumeReport(Guid facilityId, DateTime startDate, DateTime endDate);
        List<SADFM.Infrastructure.Models.PatientSummary> GetPatientSummaryReport(Guid scaleId, DateTime startDate, DateTime endDate, Guid? facilityId = null);
        DataTable FacilityPerformanceReport(Guid scaleId, DateTime startDate, DateTime endDate, Guid[] medicalSchemes, Guid facilityId);
        FacilityDashboardReport FacilityDashboardReport(Guid facilityId, DateTime startDate, DateTime endDate);
    }
}


text:
var _ = require('lodash')
var moment = require('moment')
module.exports = (cutoff) => {
  cutoff = moment(cutoff)
  return (files, metalsmith, done) => {
    for (key in files){
      if (files[key].date && cutoff.isBefore(files[key].date)){
        delete files[key]
      }
    }
    done()
  }
}