text:
/**
 * GnucashTransactionSplit.java
 * License: GPLv3 or later
 * Created on 05.05.2005
 * (c) 2005 by "Wolschon Softwaredesign und Beratung".
 *
 *
 * -----------------------------------------------------------
 * major Changes:
 *  05.05.2005 - initial version
 * ...
 *
 */
package biz.wolschon.fileformats.gnucash;

import biz.wolschon.numbers.FixedPointNumber;

/**
 * created: 05.05.2005

 * Entry-Line in an invoice stating one position
 * with it's name, single-unit-price and count.
 *
 * @author Marcus Wolschon
 *
 */
public interface GnucashInvoiceEntry extends Comparable<GnucashInvoiceEntry> {

    /**
     * @return the unique-id to identify this object with across name- and hirarchy-changes
     */
    String getId();

    /**
     *
     * @return the unique-id of the invoice we belong to to
     * @see GnucashInvoice#getId()
     */
    String getInvoiceID();

    /**
     * @return the invoice this entry belongs to
     */
    GnucashInvoice getInvoice();
    /**
     * @return the price of a single of the ${@link #getQuantity()} items of
     * type ${@link #getAction()}.
     */
    FixedPointNumber getPrice();

    /**
     * @return the price of a single of the ${@link #getQuantity()} items of
     * type ${@link #getAction()}.
     */
    String getPriceFormatet();

    /**
     * Possible value for {@link #getAction()}.
     */
    String ACTION_JOB = "Auftrag";
    /**
     * Possible value for {@link #getAction()}.
     */
    String ACTION_MATERIAL = "Material";
    /**
     * Possible value for {@link #getAction()}.
     */
    String ACTION_HOURS = "Stunden";

    /**
     * The returned text is saved locale-specific. E.g. "Stunden" instead of "hours" for Germany.
     * @return HOURS or ITEMS, ....
     */
    String getAction();

    /**
     * @return the number of items of price ${@link #getPrice()} and type ${@link #getAction()}.
     */
    FixedPointNumber getQuantity();

    /**
     * @return the number of items of price ${@link #getPrice()} and type ${@link #getAction()}.
     * @deprecated use ${@link #getQuantityFormated()}
     */
    @Deprecated
    String getQuantityFormatet();
    /**
     * @return the number of items of price ${@link #getPrice()} and type ${@link #getAction()}.
     */
    String getQuantityFormated();

    /**
     * @return the user-defined description for this object (may contain multiple lines and non-ascii-characters)
     */
    String getDescription();

    /**
     *
     * @return true if any sales-tax applies at all to this item.
     */
    boolean isTaxable();
    /**
     *
     * @return e.g. "0.16" for "16%"
     */
    FixedPointNumber getApplicableTaxPercend();

    /**
     * @return never null, "0%" if no taxtable is there
     */
    String getApplicableTaxPercendFormatet();

    /**
     * This is the sum as enteres by the user.
     * The user can decide to include or exclude taxes.
     * @return count*single-unit-price excluding or including taxes.
     * @see #getSumExclTaxes()
     * @see #getSumInclTaxes()
     */
    FixedPointNumber getSum();

    /**
     * This is the sum as enteres by the user.
     * The user can decide to include or exclude taxes.
     * @return count*single-unit-price excluding or including taxes.
     * @see #getSumExclTaxes()
     * @see #getSumInclTaxes()
     */
    String getSumFormatet();

    /**
     * @return count*single-unit-price including taxes.
     */
    FixedPointNumber getSumInclTaxes();

    /**
     * @return count*single-unit-price including taxes.
     */
    String getSumInclTaxesFormatet();
    /**
     * @return count*single-unit-price excluding taxes.
     */
    FixedPointNumber getSumExclTaxes();

    /**
     * @return count*single-unit-price excluding taxes.
     */
    String getSumExclTaxesFormatet();
}


text:
To release you need:
- an OSSRH account
- gpg installed and a pgp key published
- credentials for the above added to your maven settings file
- personal OAuth access token with full repo permissions

The process for this is described [here](https://git.basistech.net/raas/rosapi1.5/blob/master/doc/release-binding.md#request-access-to-ossrh-if-not-already-done).

## Releasing

A single script takes care of running the maven release process as well as creating the release in github.

From the root directory of the repo run:
`./tools/release.sh ${ELASTIC_VERSION} ${GITHUB_ACCESS_TOKEN}`

As an example:
`./tools/release.sh 5.6.2 012345abcdef`

If successful head to https://oss.sonatype.org/#stagingRepositories to release the staged artifacts.

redpajama_set_name: RedPajamaGithub


text:
class CreateNotifications < ActiveRecord::Migration

  def up
    create_table :notifications do |t|
		t.integer :source_id
		t.integer :destination_id
		t.integer :type
		t.string :content

		t.foreign_key :peers, column: 'source_id'
		t.foreign_key :peers, column: 'destination_id'
	end
  end

  def down
	drop_table :notifications
  end

end


text:
title: "Lunch Hour"
playwright: "John Mortimer"
period: Spring
season: In House
season_sort: 110
date_start: 1964-03-03

---


text:
enum COD2MAPArgType
{
	ARG_VALUE_SET, // Just Needs To Be Set.
	ARG_VALUE_NEEDS_INT, //Needs User INT Input.
	ARG_VALUE_NEEDS_COMBO, //Needs User To Choose Strig From List.
	ARG_VALUE_NEEDS_STRING //Needs String
};

struct COD2MAPArg_s
{
	const char* name;
	const char* description;
	COD2MAPArgType type;
	int minValue;
	int maxValue;
	bool isSettable;//Is Settable, Needs No Value. E.G. -
	QStringList DataCollection; //Over Kill? Probably. Bad Practice? Most Defiantly. Do I Care? You bet not.
};

class COD2MAP
{
private:
	COD2MAPArg_s CurrentArg;

public:
	COD2MAP();
	COD2MAP(COD2MAPArg_s, QTreeWidget*);
	~COD2MAP();

	static QString setCOD2MAPSetting(COD2MAPArg_s, QCheckBox*);
	static QString setCOD2MAPSetting(COD2MAPArg_s, QLineEdit*);
	static QString setCOD2MAPSetting(COD2MAPArg_s, QSpinBox*);
	static QString setCOD2MAPSetting(COD2MAPArg_s, QComboBox*);

	static COD2MAPArg_s findSetting(QString, QTreeWidget*, COD2MAPArg_s*, int);
};


text:
var Viewer = (function($) {

  var map, mapControls, attribution;

  var settings = {
    projection: '',
    projectionCode: '',
    projectionExtent: '',
    extent: [],
    center: [0, 0],
    zoom: 0,
    resolutions:[],
    source: {},
    group: [],
    layers: [],
    modules: [],
    editLayer: null
  };
  var cqlQuery, queryFinished = false;

  var rotate = new ol.interaction.DragRotateAndZoom();

  var selectControl = new ol.interaction.Select({
    layers: function(layer) {
      if (layer.get('queryable') === "false") {
        return false;
      }
    },
    style: [
      new ol.style.Style({
        image: new ol.style.Circle({
          fill: new ol.style.Fill({
            color: 'rgba(255, 255, 255, 0.4)'
          }),
          stroke: new ol.style.Stroke({
            color: '#3399CC',
            width: 2
          }),
          radius: 7
        })
      }),
      new ol.style.Style({
        fill: new ol.style.Fill({
          color: 'rgba(255, 255, 255, 0.4)'
        }),
        stroke: new ol.style.Stroke({
          color: '#3399CC',
          width: 2
        })
      }),
      new ol.style.Style({
        stroke: new ol.style.Stroke({
          color: '#3399CC',
          width: 2
        })
      })
    ]
  });

  return {
    init: function(mapSettings) {

      //Map settings to use for this viewer
      settings.projectionCode = mapSettings.projectionCode || undefined;
      settings.projectionExtent = mapSettings.projectionExtent || undefined;
      settings.projection = ol.proj.get(settings.projectionCode) || undefined;
      if (settings.projectionExtent) {
        settings.projection.setExtent(settings.projectionExtent);
      }
      settings.extent = mapSettings.extent || undefined;
      settings.center = mapSettings.center;
      settings.zoom = mapSettings.zoom;
      settings.resolutions = mapSettings.resolutions || undefined;
      settings.source = mapSettings.source;
      settings.home = mapSettings.home;
      settings.groups = mapSettings.groups;
      settings.editLayer = mapSettings.editLayer;
      this.createLayers(mapSettings.layers, settings.layers); //read layers from mapSettings
      settings.modules = mapSettings.modules;

      //If url arguments, parse this settings
      if (window.location.search) {
        this.parseArg();
      }

      //Create attribution
      attribution = new ol.control.Attribution({
        collapsible: false
      });

      //Set map controls
      mapControls = [new ol.control.Rotate({
        tipLabel: ''
      }), attribution];

      if (window.top != window.self) {
        MapWindow.init();
      }

      this.loadMap();

      // init modules
      var module;
      var options;
      var fn, nsFn;
      for (var i = 0; i < settings.modules.length; i++) {
        module = settings.modules[i].name;
        options = settings.modules[i].options || undefined;
        fn = window[module]['init'];
        fn.apply(null, options);
      }

    },
    createLayers: function(layerlist, layerTarget) {
      for (var i = layerlist.length - 1; i >= 0; i--) {
        if (layerlist[i].type == 'WMTS') {
          layerTarget.push(Viewer.addWMTS(layerlist[i]));
        } else if (layerlist[i].type == 'WMS') {
          layerTarget.push(Viewer.addWMS(layerlist[i]));
        } else if (layerlist[i].type == 'WFS') {
          layerTarget.push(Viewer.addWFS(layerlist[i]));
        } else if (layerlist[i].type == 'GEOJSON') {
          layerTarget.push(Viewer.addGeoJson(layerlist[i]));
        } else if (layerlist[i].type == 'GROUP') {
          layerTarget.push(Viewer.createLayerGroup(layerlist[i].layers, layerlist[i]));
        }
      }

      return layerTarget;
    },
    createLayerGroup: function(layers, layersConfig) {
      var group = [];
      group = Viewer.createLayers(layers, group);
      return new ol.layer.Group({
        name: layersConfig.name,
        group: layersConfig.group,
        title: layersConfig.title,
        styleName: layersConfig.style || 'default',
        layers: group,
        mapSource: layersConfig.source,
        visible: layersConfig.visible
      });
    },
    loadMap: function() {
      map = new ol.Map({
        target: 'map',
        interactions: ol.interaction.defaults(settings.interactions).extend([selectControl, rotate]),
        controls: mapControls,
        layers: settings.layers,
        view: new ol.View({
          extent: settings.extent || undefined,
          projection: settings.projection || undefined,
          center: settings.center,
          resolutions: settings.resolutions || undefined,
          zoom: settings.zoom
        })
      });
    },
    parseArg: function() {
      var str = window.location.search.substring(1);
      var elements = str.split("&");

      for (var i = 0; i < elements.length; i++) {
        //center coordinates
        if (i === 0) {
          var z = elements[i].split(",");
          settings.center[0] = parseInt(z[0]);
          settings.center[1] = parseInt(z[1]);
        } else if (i == 1) {
          settings.zoom = parseInt(elements[i]);
        } else if (i == 2) {
          var l = elements[i].split(";");
          var layers = settings.layers;
          var la, match;
          for (var j = 0; j < layers.length; j++) {
            match = 0;
            $.each(l, function(index, el) {
              la = el.split(",");
              if (layers[j].get('group')) {
                if ((layers[j].get('group') == 'background') && (la[0] == layers[j].get('name'))) {
                  layers[j].setVisible(true);
                  match = 1;
                } else if ((layers[j].get('group') == 'background') && (match === 0)) {
                  layers[j].setVisible(false);
                } else if (la[0] == layers[j].get('name')) {
                  if (la[1] == 1) {
                    layers[j].set('legend', true);
                    layers[j].setVisible(false);
                  } else {
                    layers[j].set('legend', true);
                    layers[j].setVisible(true);
                  }
                }
              }
            })
          }
        }
      }

    },
    getSettings: function() {
      return settings;
    },
    getMapUrl: function() {
      var layerNames = '',
        url;
      //delete search arguments if present
      if (window.location.search) {
        url = window.location.href.replace(window.location.search, '?');
      } else {
        url = window.location.href + '?';
      }
      var mapView = map.getView();
      var center = mapView.getCenter();
      for (var i = 0; i < 2; i++) {
        center[i] = parseInt(center[i]); //coordinates in integers
      }
      var zoom = mapView.getZoom();
      var layers = map.getLayers();
      //add layer if visible
      layers.forEach(function(el) {
        if (el.getVisible() === true) {
          layerNames += el.get('name') + ';';
        } else if (el.get('legend') === true) {
          layerNames += el.get('name') + ',1;';
        }
      });

      return url + center + '&' + zoom + '&' + layerNames.slice(0, layerNames.lastIndexOf(";"));
    },
    getMap: function() {
      return map;
    },
    getLayers: function() {
      return settings.layers;
    },
    getSelectControl: function() {
      return selectControl;
    },
    getLayer: function(layername) {
      var layer = $.grep(settings.layers, function(obj) {
        return (obj.get('name') == layername);
      });

      return layer[0];
    },
    getEditLayer: function() {
      return settings.editLayer;
    },
    getEditLayers: function() {
      return settings.editLayers;
    },
    getGroup: function(group) {
      group = $.grep(settings.layers, function(obj) {
        return (obj.get('group') == group);
      });
      return group;
    },
    getGroups: function() {
      return settings.groups;
    },
    getProjectionCode: function() {
      return settings.projectionCode;
    },
    getMapSource: function() {
      return settings.source;
    },
    setEditLayer: function(layer) {
      settings.editLayer = layer;
    },
    addWMS: function(layersConfig) {
      layersConfig.hasOwnProperty('attribution') ? attr = [new ol.Attribution({
        html: layersConfig.attribution
      })] : [attr = null];
      return new ol.layer.Tile({
        name: layersConfig.name.split(':').pop(), //remove workspace part of name
        group: layersConfig.group || 'default',
        opacity: layersConfig.opacity || 1,
        title: layersConfig.title,
        styleName: layersConfig.style || 'default',
        extent: layersConfig.extent || undefined,
        minResolution: layersConfig.hasOwnProperty('minScale') ? Viewer.scaleToResolution(layersConfig.minScale) : undefined,
        maxResolution: layersConfig.hasOwnProperty('maxScale') ? Viewer.scaleToResolution(layersConfig.maxScale) : undefined,
        type: layersConfig.type,
        visible: layersConfig.visible,
        legend: false,
        source: new ol.source.TileWMS(({
          url: settings.source[layersConfig.source].url,
          attributions: attr,
          gutter: layersConfig.gutter || 0,
          crossOrigin: 'anonymous',
          params: {
            'LAYERS': layersConfig.name,
            'FORMAT': 'image/jpeg',
            'TILED': true,
            VERSION: settings.source[layersConfig.source].version
          },
          tileGrid: new ol.tilegrid.TileGrid({
            resolutions: settings.resolutions,
            origin: [-166640, 6305699]
          }),
        }))
      });
    },
    addGeoJson: function(layersConfig) {
      var geometryName = layersConfig.hasOwnProperty('geometryName') ? layersConfig.geometryName : 'geom';
      return new ol.layer.Vector({
        group: 'none',
        name: layersConfig.name.split(':').pop(),
        opacity: layersConfig.opacity || 1,
        styleName: layersConfig.style || 'default',
        legend: false,
        queryable: layersConfig.hasOwnProperty('queryable') ? layersConfig.queryable : true,
        minResolution: layersConfig.hasOwnProperty('minScale') ? Viewer.scaleToResolution(layersConfig.minScale) : undefined,
        maxResolution: layersConfig.hasOwnProperty('maxScale') ? Viewer.scaleToResolution(layersConfig.maxScale) : undefined,
        title: layersConfig.title,
        visible: layersConfig.visible,
        source: new ol.source.Vector({
          url: layersConfig.source,
          format: new ol.format.GeoJSON({
            geometryName: geometryName
          })
        }),
        style: Viewer.createStyle(layersConfig.style)
      });
    },
    addWFS: function(layersConfig) {
      var vectorSource = null;
      var geometryName = layersConfig.hasOwnProperty('geometryName') ? layersConfig.geometryName : 'geom';
      var featureType = layersConfig.name.split('__').shift();
      vectorSource = new ol.source.Vector({
        loader: function(extent, resolution, projection) {
          var that = this;
          var format = new ol.format.GeoJSON();
          var url = settings.source[layersConfig.source].url + '?service=WFS&' +
            'version=1.1.0&request=GetFeature&typeName=' + featureType +
            '&outputFormat=application/json' +
            '&srsname=' + settings.projectionCode + '&bbox=' + extent.join(',') + ',' + settings.projectionCode;
          $.ajax({
            url: url,
            dataType: 'json',
            success: function(response) {
              var format = new ol.format.GeoJSON({
                geometryName: geometryName
              });
              vectorSource.addFeatures(format.readFeatures(response));
            }
          });
        },
        strategy: ol.loadingstrategy.tile(new ol.tilegrid.createXYZ({
          maxZoom: settings.resolutions.length
        }))
      });
      var options = {
        featureType: featureType.split('__').shift(),
        name: layersConfig.name.split(':').pop(),
        title: layersConfig.title,
        group: layersConfig.group || 'default',
        opacity: layersConfig.opacity || 1,
        geometryName: geometryName,
        relations: layersConfig.relations || undefined,
        legend: false,
        mapSource: layersConfig.source,
        styleName: layersConfig.style || 'default',
        queryable: layersConfig.hasOwnProperty('queryable') ? layersConfig.queryable : true,
        minResolution: layersConfig.hasOwnProperty('minScale') ? Viewer.scaleToResolution(layersConfig.minScale) : undefined,
        maxResolution: layersConfig.hasOwnProperty('maxScale') ? Viewer.scaleToResolution(layersConfig.maxScale) : undefined,
        visible: layersConfig.visible,
        attributes: layersConfig.attributes
      };

      var styleOptions = Viewer.createStyle(layersConfig.style, layersConfig.clusterStyle);
      var layerType = layersConfig.vectorSource ? layersConfig.vectorSource : 'vector';

      if (layerType == 'vector') {
        options.source = vectorSource;
        options.style = styleOptions;
        return new ol.layer.Vector(options);
      } else if (layerType == 'cluster') {
        options.source = new ol.source.Cluster({
          source: vectorSource,
          distance: 40
        });
        options.style = styleOptions;
        return new ol.layer.Vector(options);
      } else if (layerType == 'image') {
        options.source = new ol.source.ImageVector({
          source: vectorSource,
          style: styleOptions
        });

        return new ol.layer.Image(options);
      }
    },
    wfsCql: function(relations, coordinates, relatedId) {
      var url, finishedQueries = 0;
      cqlQuery = [];
      // alert(coordinates);
      // var matches = coordinates.filter.match(/\[(.*?)\]/);
      for (var i = 0; i < relations.length; i++) {
        (function(index) {
          var layer = relations[index].layer;
          var mapServer = settings.source[Viewer.getLayer(layer).get('mapSource')].url;
          url = mapServer + '?';
          data = 'service=WFS&' +
            'version=1.0.0&request=GetFeature&typeName=' + layer +
            '&outputFormat=json' +
            '&CQL_FILTER=INTERSECTS(GEOM,' + coordinates + ')&outputFormat=json';
          $.ajax({
            url: url,
            type: 'POST',
            data: data,
            dataType: 'json',
            success: function(response) {
              var result = {};
              result.layer = relations[index].layer;
              result.url = relations[index].url || undefined;
              result.features = [];
              for (var j = 0; j < response.features.length; j++) {
                var f = {};
                f.attribute = response.features[j]['properties'][relations[index].attribute];
                f.url = response.features[j]['properties'][relations[index].url] || undefined;
                f.relatedId = relatedId;
                result.features.push(f);
              }
              cqlQuery.push(result);
              finishedQueries++;
              if (finishedQueries >= relations.length) {
                queryFinished = true;
              }
            },
            error: function(jqXHR, textStatus, errorThrown) {
              console.log(errorThrown);
            }
          });
        })(i);
      }
    },
    getCqlQuery: function() {
      return cqlQuery;
    },
    modalMoreInfo: function(featureId) {
      var content = $('#identify').html();
      var title = $('.popup-title').html();
      Popup.setVisibility(false);

      var queryList = '
';
      queryList += '
';

      var modal = Modal('#map', {
        title: title,
        content: content + queryList
      });
      modal.showModal();
      $('.modal li').removeClass('hidden');

      var queryListItems = '';
      var tries = 10,
        nrTries = 0;
      checkQuery();

      //check if query is finished
      function checkQuery() {
        if (queryFinished) {
          appendQuery();
          queryFinished = false;
          return;
        } else {
          setTimeout(function() {
            if (nrTries <= tries) {
              nrTries++;
              checkQuery();
            }
          }, 100);
        }
      }
      //append query results to modal
      function appendQuery() {
        cqlQuery.sort(function(a, b) {
          return a.layer.localeCompare(b.layer);
        });
        for (var i = 0; i < cqlQuery.length; i++) {
          if (cqlQuery[i].features.length) {
            var l = Viewer.getLayer(cqlQuery[i].layer);
            for (var j = 0; j < cqlQuery[i].features.length; j++) {
              if (featureId === cqlQuery[i].features[j].relatedId) {
                queryListItems += '

' + l.get('title') + '
';
                var attr = cqlQuery[i].features[j].attribute;
                if (cqlQuery[i].features[j].url) {
                  queryListItems += '

' +
                    attr +
                    '

';
                } else {
                  queryListItems += '

' + attr + '

'; //

';
                }
              }
            }
            queryListItems += '
';
          }
        }
        $('#querylist').append(queryListItems);
      }
    },
    //Style
    createStyle: function(styleName, clusterStyleName) {
      var s = styleSettings[styleName];
      var clusterSettings = styleSettings[clusterStyleName];
      var style = (function() {
        var styleList = [];
        //Create style for each rule
        for (var i = 0; i < s.length; i++) {
          var styleRule = [];
          var styleOptions;
          //Check if rule is array, ie multiple styles for the rule
          if (s[i].constructor === Array) {
            for (var j = 0; j < s[i].length; j++) {
              styleOptions = Viewer.createStyleOptions(s[i][j]);
              styleRule.push(new ol.style.Style(styleOptions));
            }
          }
          //If single style for rule
          else {
            styleOptions = Viewer.createStyleOptions(s[i]);
            styleRule = [new ol.style.Style(styleOptions)];
          }

          styleList.push(styleRule);
        }
        if (clusterSettings) {
          return Viewer.styleFunction(s, styleList, clusterSettings);
        } else {
          return Viewer.styleFunction(s, styleList);
        }

      })();

      return style;
    },
    styleFunction: function(styleSettings, styleList, clusterSettings) {
      var s = styleSettings;
      var cs = clusterSettings;
      var cluster;
      var fn = function(feature, resolution) {
        var scale = Viewer.getScale(resolution);
        var featAttr, expr, featMatch, matches, styleL;
        //If size is larger than, it is a cluster
        var size = cs ? feature.get('features').length : 1;
        //If cluster
        if (size > 1) {
          if (checkScale(cs.maxScale, cs.minScale)) {
            var textFill = new ol.style.Fill({
              color: cs['textFill']['color']
            });
            var textStroke = new ol.style.Stroke({
              color: cs['textStroke']['color'],
              width: cs['textStroke']['width']
            });
            cluster = [new ol.style.Style({
              image: new ol.style.Circle({
                radius: cs['radius'],
                fill: new ol.style.Fill({
                  color: cs['fill']['color']
                }),
                stroke: new ol.style.Stroke({
                  color: cs['stroke']['color'],
                  width: cs['stroke']['width']
                })
              }),
              text: new ol.style.Text({
                text: size.toString(),
                fill: textFill,
                stroke: textStroke,
                font: cs['font']
              })
            })];

            if (cs.hasOwnProperty('filter')) {
              //find attribute vale between [] defined in styles
              matches = cs.filter.match(/\[(.*?)\]/);
              if (matches) {
                featAttr = matches[1];
                expr = cs.filter.split(']')[1];
                featMatch = feature.get(featAttr);
                expr = typeof featMatch == 'number' ? featMatch + expr : '"' + featMatch + '"' + expr;
              }
              if (eval(expr)) {
                styleL = cluster;
              }
            } else {
              styleL = cluster;
            }
          }
        }
        //If not cluster
        else {
          for (var j = 0; j < s.length; j++) {
            if (checkScale(s[j][0].maxScale, s[j][0].minScale)) {
              if (s[j][0].hasOwnProperty('filter')) {
                //find attribute vale between [] defined in styles
                matches = s[j][0].filter.match(/\[(.*?)\]/);
                if (matches) {
                  featAttr = matches[1];
                  expr = s[j][0].filter.split(']')[1];
                  //Koll om features är definerat (från ett vanligt lager), annars features från ett klusterlager
                  if (feature.get('features')) {
                    featMatch = feature.get('features')[0].get(featAttr);
                  } else {
                    featMatch = feature.get(featAttr);
                  }
                  expr = typeof featMatch == 'number' ? featMatch + expr : '"' + featMatch + '"' + expr;
                }
                if (eval(expr)) {
                  styleL = styleList[j];
                }
              } else {
                styleL = styleList[j];
              }
            }
          }
        }
        // check if scale is defined
        function checkScale(maxScale, minScale) {
          if (maxScale || minScale) {
            // Alter 1: maxscale and minscale
            if (maxScale && minScale) {
              if ((scale > maxScale) && (scale < minScale)) {
                return true;
              }
            }
            // Alter 2: only maxscale
            else if (maxScale) {
              if (scale > maxScale) {
                return true;
              }
            }
            // Alter 3: only minscale
            else if (minScale) {
              if (scale < minScale) {
                return true;
              }
            }
          }
          // Alter 4: no scale limit
          else {
            return true;
          }
        }
        // end check scale
        return styleL;
      };

      return fn;
    },
    createStyleOptions: function(styleParams) {
      var styleOptions = {
        fill: styleParams.fill ? new ol.style.Fill(styleParams.fill) : undefined,
        stroke: styleParams.stroke ? new ol.style.Stroke(styleParams.stroke) : undefined,
        text: styleParams.text ? new ol.style.Text(styleParams.text) : undefined,
        image: undefined
      };
      if (styleParams.hasOwnProperty('circle')) {
        styleOptions.image = new ol.style.Circle({
          radius: styleParams.circle.radius,
          fill: new ol.style.Fill(styleParams.circle.fill) || undefined,
          stroke: new ol.style.Stroke(styleParams.circle.stroke) || undefined
        });
      } else if (styleParams.hasOwnProperty('icon')) {
        styleOptions.image = new ol.style.Icon(styleParams.icon);
      }

      return styleOptions;
    },
    getScale: function(resolution) {
      var dpi = 25.4 / 0.28;
      var mpu = settings.projection.getMetersPerUnit();
      var scale = resolution * mpu * 39.37 * dpi;
      scale = Math.round(scale);

      return scale;
    },
    scaleToResolution: function(scale) {
      var dpi = 25.4 / 0.28;
      var mpu = settings.projection.getMetersPerUnit();
      var resolution = scale / (mpu * 39.37 * dpi);

      return resolution;
    },
    autoPan: function() {
      /*Workaround to remove when autopan implemented for overlays */
      var el = $('.popup');
      var center = map.getView().getCenter();
      var popupOffset = $(el).offset();
      var mapOffset = $('#' + map.getTarget()).offset();
      var offsetY = popupOffset.top - mapOffset.top;
      var mapSize = map.getSize();
      var offsetX = (mapOffset.left + mapSize[0]) - (popupOffset.left + $(el).outerWidth(true));

      if (offsetY < 0 || offsetX < 0 || offsetX > (mapSize[0] - $(el).outerWidth(true))) {
        var dx = 0,
          dy = 0;
        if (offsetX < 0) {
          dx = (-offsetX) * map.getView().getResolution();
        }
        if (offsetX > (mapSize[0] - $(el).outerWidth(true))) {
          dx = -($(el).outerWidth(true) - (mapSize[0] - offsetX)) * map.getView().getResolution();
        }
        if (offsetY < 0) {
          dy = (-offsetY) * map.getView().getResolution();
        }
        var pan = ol.animation.pan({
          duration: 300,
          source: center
        });
        map.beforeRender(pan);
        map.getView().setCenter([center[0] + dx, center[1] + dy]);

      }
      /*End workaround*/
    },
    removeOverlays: function() {
      var overlays = map.getOverlays();
      if (overlays.length > 0) {
        for (var i = 0; i < overlays.length; i++) {
          map.removeOverlay(overlays[i]);
        }
      }
    },
    removeSelections: function() {
      selectControl.getFeatures().clear();
    }
  };
})(jQuery);


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

<TITLE>
com.amazonaws.services.elasticloadbalancing.model (AWS SDK for Java - 1.4.7)
</TITLE>

<META NAME="date" CONTENT="2013-06-18">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../JavaDoc.css" TITLE="Style">

com.amazonaws.services.elasticloadbalancing.model

Classes

AppCookieStickinessPolicy

ApplySecurityGroupsToLoadBalancerRequest

ApplySecurityGroupsToLoadBalancerResult

AttachLoadBalancerToSubnetsRequest

AttachLoadBalancerToSubnetsResult

BackendServerDescription

ConfigureHealthCheckRequest

ConfigureHealthCheckResult

CreateAppCookieStickinessPolicyRequest

CreateAppCookieStickinessPolicyResult

CreateLBCookieStickinessPolicyRequest

CreateLBCookieStickinessPolicyResult

CreateLoadBalancerListenersRequest

CreateLoadBalancerPolicyRequest

CreateLoadBalancerPolicyResult

CreateLoadBalancerRequest

CreateLoadBalancerResult

DeleteLoadBalancerListenersRequest

DeleteLoadBalancerPolicyRequest

DeleteLoadBalancerPolicyResult

DeleteLoadBalancerRequest

DeregisterInstancesFromLoadBalancerRequest

DeregisterInstancesFromLoadBalancerResult

DescribeInstanceHealthRequest

DescribeInstanceHealthResult

DescribeLoadBalancerPoliciesRequest

DescribeLoadBalancerPoliciesResult

DescribeLoadBalancerPolicyTypesRequest

DescribeLoadBalancerPolicyTypesResult

DescribeLoadBalancersRequest

DescribeLoadBalancersResult

DetachLoadBalancerFromSubnetsRequest

DetachLoadBalancerFromSubnetsResult

DisableAvailabilityZonesForLoadBalancerRequest

DisableAvailabilityZonesForLoadBalancerResult

EnableAvailabilityZonesForLoadBalancerRequest

EnableAvailabilityZonesForLoadBalancerResult

HealthCheck

Instance

InstanceState

LBCookieStickinessPolicy

Listener

ListenerDescription

LoadBalancerDescription

Policies

PolicyAttribute

PolicyAttributeDescription

PolicyAttributeTypeDescription

PolicyDescription

PolicyTypeDescription

RegisterInstancesWithLoadBalancerRequest

RegisterInstancesWithLoadBalancerResult

SetLoadBalancerListenerSSLCertificateRequest

SetLoadBalancerPoliciesForBackendServerRequest

SetLoadBalancerPoliciesForBackendServerResult

SetLoadBalancerPoliciesOfListenerRequest

SetLoadBalancerPoliciesOfListenerResult

SourceSecurityGroup

Exceptions

CertificateNotFoundException

DuplicateListenerException

DuplicateLoadBalancerNameException

DuplicatePolicyNameException

InvalidConfigurationRequestException

InvalidInstanceException

InvalidSchemeException

InvalidSecurityGroupException

InvalidSubnetException

ListenerNotFoundException

LoadBalancerNotFoundException

PolicyNotFoundException

PolicyTypeNotFoundException

SubnetNotFoundException

TooManyLoadBalancersException

TooManyPoliciesException


text:
using PropertyGridHelpers.Controls;
using System;
using Xunit;
#if NET35
#else
using Xunit.Abstractions;
#endif

#if NET35
namespace PropertyGridHelpersTest.net35.Controls
#elif NET452
namespace PropertyGridHelpersTest.net452.Controls
#elif NET462
namespace PropertyGridHelpersTest.net462.Controls
#elif NET472
namespace PropertyGridHelpersTest.net472.Controls
#elif NET48
namespace PropertyGridHelpersTest.net48.Controls
#elif NET6_0
namespace PropertyGridHelpersTest.net60.Controls
#endif
{
    /// <summary>
    /// Tests for the flag checked list box
    /// </summary>
    public class FlagCheckedListBoxItemTest
    {
#if NET35
#else
        readonly ITestOutputHelper OutputHelper;

        /// <summary>
        /// Initializes a new instance of the <see cref="FlagCheckedListBoxItemTest"/> class.
        /// </summary>
        /// <param name="output">The output.</param>
        public FlagCheckedListBoxItemTest(
            ITestOutputHelper output)

        {
            OutputHelper = output;
        }
#endif

        /// <summary>
        /// Caption is set correctly test.
        /// </summary>
        [Fact]
        public void CaptionSetCorrectlyTest()
        {
            var item = new FlagCheckedListBoxItem(1, "Test");
            Assert.Equal("Test", item.Caption);
            Output("Caption set to 'Test' as expected");
        }

        /// <summary>
        /// Value is set correctly test.
        /// </summary>
        [Fact]
        public void ValueSetCorrectlyTest()
        {
            var item = new FlagCheckedListBoxItem(1, "Test");
            Assert.Equal(1, item.Value);
            Output("Value set to 1 as expected");
        }

        /// <summary>
        /// Null the parameters handled correctly test.
        /// </summary>
        [Fact]
        public void NullParametersHandledCorrectlyTest()
        {
            var item = new FlagCheckedListBoxItem(0, null);
            Assert.Null(item.Caption);
            Output("Caption set to null as expected");
        }

        /// <summary>
        /// Determines whether IsFlag is true test.
        /// </summary>
        [Fact]
        public void IsFlagIsTrueTest()
        {
            var item = new FlagCheckedListBoxItem(4, null);
            Assert.True(item.IsFlag);
            Output("IsFlag returns true as expected");
        }

        /// <summary>
        /// Determines whether IsFlag is false test.
        /// </summary>
        [Fact]
        public void IsFlagIsFalseTest()
        {
            var item = new FlagCheckedListBoxItem(5, null);
            Assert.False(item.IsFlag);
            Output("IsFlag returns false as expected");
        }

        /// <summary>
        /// Determines whether IsMemberFlag is true test.
        /// </summary>
        [Fact]
        public void IsMemberFlagIsTrueTest()
        {
            var item = new FlagCheckedListBoxItem(4, null);
            Assert.True(item.IsMemberFlag(new FlagCheckedListBoxItem(5, null)));
            Output("IsMemberFlag returns true as expected");
        }

        /// <summary>
        /// Determines whether IsMemberFlag is false test.
        /// </summary>
        [Fact]
        public void IsMemberFlagIsFalseTest()
        {
            var item = new FlagCheckedListBoxItem(5, null);
            Assert.False(item.IsMemberFlag(new FlagCheckedListBoxItem(4, null)));
            Output("IsMemberFlag returns false as expected");
        }

        /// <summary>
        /// Outputs the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
#if NET35
        private static void Output(string message)
#else
        private void Output(string message)
#endif
        {
#if NET35
            Console.WriteLine(message);
#else
            OutputHelper.WriteLine(message);
#endif
        }
    }
}


text:
package de.uds.lsv.platon.script;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import de.martingropp.util.Pair;
import de.martingropp.util.PreprocessingReader;

/**
 * A reader supporting #include and //#include.
 *
 * @author mgropp
 */
public class IncludeReader extends PreprocessingReader {
	private static final Log logger = LogFactory.getLog(IncludeReader.class.getName());

	/** We use this to determine the include path. */
	private static final String STDLIB = "/script-include/stdlib.groovy";

	public static class CodeLocation {
		public URL url;
		public int startLine;

		public CodeLocation(URL url, int startLine) {
			this.url = url;
			this.startLine = startLine;
		}

		@Override
		public String toString() {
			return String.format("%s:%d", url, startLine);
		}
	}

	public static class CodeSpan extends CodeLocation {
		/** exclusive */
		public int endLine;

		public CodeSpan(URL url, int startLine) {
			this(url, startLine, -1);
		}

		public CodeSpan(URL url, int startLine, int endLine) {
			super(url, startLine);
			this.endLine = endLine;
		}

		public boolean containsLine(int line) {
			return (
				line >= startLine &&
				(endLine < 0 || line < endLine)
			);
		}

		public int size() {
			if (endLine < 0) {
				throw new IllegalStateException();
			}

			return endLine - startLine;
		}

		@Override
		public String toString() {
			if (endLine >= 0) {
				return String.format("%s:%d→%d", url, startLine, endLine);
			} else {
				return super.toString();
			}
		}
	}

	private static class Origin extends CodeSpan {
		public Origin parent;
		public List<Origin> children = null;

		public Origin(URL url, int startLine) {
			this(null, url, startLine);
		}

		public Origin(Origin parent, URL url, int startLine) {
			super(url, startLine);
			this.parent = parent;
		}

		public Origin addChild(URL url, int startLine) {
			if (children == null) {
				children = new ArrayList<>();
			}

			Origin child = new Origin(this, url, startLine);
			children.add(child);

			return child;
		}

		public Origin end(int endLine) {
			this.endLine = endLine;
			return parent;
		}

		public CodeLocation translateLine(int line) {
			if (line < startLine) {
				throw new RuntimeException(
					"Line not inside span " + this + ": " + line
				);
			}
			if (endLine >= 0 && line >= endLine) {
				throw new RuntimeException(
					"Line not inside span " + this + ": " + line
				);
			}

			int delta = 0;
			if (children != null) {
				for (Origin child : children) {
					if (child.startLine > line) {
						break;
					}

					if (child.containsLine(line)) {
						return child.translateLine(line);
					}

					// -1: #include line
					delta += child.size() - 1;
				}
			}

			return new CodeLocation(this.url, line - this.startLine - delta);
		}
	}

	private final URI rootUri;
	private final Set<URL> alreadyIncluded = new HashSet<>();
	private Origin rootOrigin;
	private Origin currentOrigin;

	/**
	 * A list of URIs whose resolve methods are called to resolve
	 * included files.
	 * (To be exact, the resolve method of IncludeReader is called.)
	 */
	private List<URI> includePath = new ArrayList<>();

	public IncludeReader(URL sourceUrl) throws IOException {
		this(sourceUrl, StandardCharsets.UTF_8);
	}

	public IncludeReader(URL sourceUrl, Charset charset) throws IOException {
		super(new BufferedReader(new InputStreamReader(sourceUrl.openStream(), charset)));
		try {
			this.rootUri = sourceUrl.toURI();
		}
		catch (URISyntaxException e) {
			throw new RuntimeException(e);
		}
		rootOrigin = new Origin(sourceUrl, getLine());
		currentOrigin = rootOrigin;
		alreadyIncluded.add(sourceUrl);

		setupIncludePath();
	}

	/**
	 * This constructor disables #include!
	 * @param reader
	 */
	public IncludeReader(BufferedReader reader) {
		readers.push(reader);
		rootUri = null;
		setupIncludePath();
	}

	/**
	 * @param reader
	 * @param rootUri
	 *   The base path for included files.
	 */
	public IncludeReader(BufferedReader reader, URI rootUri) {
		readers.push(reader);
		this.rootUri = rootUri;
		if (rootUri != null) {
			rootOrigin = new Origin(null, getLine());
			currentOrigin = rootOrigin;
		}
		setupIncludePath();
	}

	private void setupIncludePath() {
		if (rootUri != null) {
			includePath.add(rootUri);
		}

		URL url = IncludeReader.class.getResource(STDLIB);
		if (url != null) {
			try {
				includePath.add(url.toURI());
			}
			catch (URISyntaxException e) {
				// should™ not happen anyway
				throw new RuntimeException(e);
			}
		}
	}

	@Override
	protected void popReader() throws IOException {
		logger.debug("End of input file in line " + getLine()); // no +1
		super.popReader();
		if (currentOrigin != null) {
			currentOrigin = currentOrigin.end(getLine());
		}
	}

	private static URI resolve(URI rootUri, String relative) {
		// https://bugs.openjdk.java.net/browse/JDK-8020755
		if ("jar".equals(rootUri.getScheme())) {
			if (relative.startsWith("/")) {
				throw new RuntimeException("Absolute paths are not supported!");
			}

			String root = rootUri.toString();
			int index = root.lastIndexOf('/');
			try {
				if (index < 0) {
					return new URI(relative);
				}

				return new URI(
					root.substring(0, index + 1) +
					relative
				).normalize();
			}
			catch (URISyntaxException e) {
				// should™ not happen anyway
				throw new RuntimeException(e);
			}
		}

		return rootUri.resolve(relative);
	}

	private Pair<InputStream,URL> open(String relative) throws MalformedURLException {
		for (URI baseUri : includePath) {
			URL url = resolve(baseUri, relative).toURL();
			if (alreadyIncluded.contains(url)) {
				throw new RuntimeException(String.format(
					"Not including »%s«: already loaded.",
					url
				));
			}

			try {
				Pair<InputStream,URL> pair = new Pair<>(
					url.openStream(),
					url
				);
				alreadyIncluded.add(url);
				return pair;
			}
			catch (IOException e) {
				continue;
			}
		}

		return null;
	}

	@Override
	protected boolean preprocess(String line, LinkedList<String> buffer) throws MalformedURLException, IOException {
		if (
			line.trim().startsWith("#include ") ||
			line.trim().startsWith("//#include ")
		) {
			if (rootUri == null) {
				throw new RuntimeException("#include disabled (reason: anonymous Reader).");
			}

			line = line.trim();
			String filename = line.substring(line.indexOf("#include") + 9).trim();
			if (
				filename.length() < 2 ||
				!"\"'".contains(Character.toString(filename.charAt(0))) ||
				filename.charAt(filename.length()-1) != filename.charAt(0)
			) {
				throw new RuntimeException("Bad argument for #include: »" + filename + "«");
			}

			filename = filename.substring(1, filename.length()-1);

			Pair<InputStream,URL> resolved = open(filename);
			if (resolved == null) {
				throw new IOException("Failed to open " + filename);
			}

			InputStream stream = resolved.first;
			URL includeUrl = resolved.second;

			logger.debug(String.format(
				"Including script in line %d from %s",
				getLine() + 1,
				includeUrl
			));

			currentOrigin = currentOrigin.addChild(includeUrl, getLine());

			readers.push(
				new BufferedReader(new InputStreamReader(stream))
			);

		} else {
			buffer.add(line);
		}

		return true;
	}

	/**
	 * @param line
	 *   line number, 0-based!
	 * @return
	 */
	public CodeLocation translateLocation(int line) {
		if (rootOrigin == null) {
			return new CodeLocation(null, line);
		} else {
			return rootOrigin.translateLine(line);
		}
	}
}


text:
{% extends "basic/layout.html" %}
{% set script_files = script_files + ['_static/js/bootstrap-2.2.1.min.js', '_static/bootstrap-sphinx.js'] %}
{% set css_files = ['_static/css/bootstrap-2.2.1.min.css', '_static/bootstrap-sphinx.css', '_static/css/bootstrap-responsive-2.2.1.min.css'] + css_files %}

{%- block doctype -%}
<!DOCTYPE html>
{%- endblock %}

{# Sidebar: Rework into our Boostrap nav section. #}
{% macro navBar() %}

      <button class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">

      </button>

      {{ project|e }}
      {{ version|e }}

          {% block sidebartoc %}
            {% include "globaltoc.html" %}
            {% include "localtoc.html" %}
          {% endblock %}
          {% block sidebarrel %}
            {% include "relations.html" %}
          {% endblock %}
          {% if theme_source_link_position == "nav" %}

{% include "sourcelink.html" %}

          {% endif %}

        {% block sidebarsearch %}
          {% include "searchbox.html" %}
        {% endblock %}

{% endmacro %}

{%- block extrahead %}
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
{% endblock %}

{# Silence the sidebar's, relbar's #}
{% block header %}{% endblock %}
{% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{% endblock %}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
{% block sidebarsourcelink %}{% endblock %}

{%- block content %}

  {{ navBar() }}
  {% block body %}{% endblock %}

{%- endblock %}

{%- block footer %}

      Back to top
      {% if theme_source_link_position == "footer" %}

        {% include "sourcelink.html" %}
      {% endif %}

    {%- if show_copyright %}
      {%- if hasdoc('copyright') %}
        {% trans path=pathto('copyright'), copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}

      {%- else %}
        {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}

      {%- endif %}
    {%- endif %}
    {%- if last_updated %}
      {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}

    {%- endif %}
    {%- if show_sphinx %}
      {% trans sphinx_version=sphinx_version|e %}Created using Sphinx {{ sphinx_version }}.{% endtrans %}

    {%- endif %}

{%- endblock %}


text:
package com.kingfisher.chlilypad.abstraction.common;

import com.kingfisher.chlilypad.CHLilyPad;
import com.kingfisher.chlilypad.abstraction.CHLilyPadConvertor;
import com.kingfisher.chlilypad.abstraction.common.events.CommonLilyPadListener;

/**
 *
 * @author KingFisher
 */
public abstract class CHLilyPadAbstractCommonConvertor implements CHLilyPadConvertor {

	private CommonLilyPadListener _listener;

	@Override
	public void startup() {
		_listener = new CommonLilyPadListener();
		CHLilyPad.getConnect().registerEvents(_listener);
	}

	@Override
	public void shutdown() {
		CHLilyPad.getConnect().unregisterEvents(_listener);
		_listener = null;
	}
}


text:
module core.app
{
    /**
     *
     */
    export class RepositoryService
    {
        static $inject = ['$http'];

        constructor(private $http: ng.IHttpService)
        {
        }

        /**
         *
         * @param url
         * @param config
         */
        get<T>(url: string, config?: ng.IRequestShortcutConfig): ng.IPromise<T>
        {
            var iurl = this.interpolateUrl(url, config.params, config.data);

            this.updateConfig(config);

            return this.$http.get(iurl, config).then((x) => x.data);
        }

        /**
         *
         * @param url
         * @param config
         */
        delete<T>(url: string, config?: ng.IRequestShortcutConfig): ng.IPromise<T>
        {
            var iurl = this.interpolateUrl(url, config.params, config.data);

            this.updateConfig(config);

            return this.$http.delete(iurl, config).then((x) => x.data);
        }

        /**
         *
         * @param url
         * @param config
         */
        head<T>(url: string, config?: ng.IRequestShortcutConfig): ng.IPromise<T>
        {
            var iurl = this.interpolateUrl(url, config.params, config.data);

            this.updateConfig(config);

            return this.$http.head(iurl, config).then((x) => x.data);
        }

        /**
         *
         * @param url
         * @param config
         */
        jsonp<T>(url: string, config?: ng.IRequestShortcutConfig): ng.IPromise<T>
        {
            var iurl = this.interpolateUrl(url, config.params, config.data);

            this.updateConfig(config);

            return this.$http.jsonp(iurl, config).then((x) => x.data);
        }

        /**
         *
         * @param url
         * @param data
         * @param config
         */
        post<T>(url: string, data: any, config?: ng.IRequestShortcutConfig): ng.IPromise<T>
        {
            var iurl = this.interpolateUrl(url, config.params, config.data);

            this.updateConfig(config);

            return this.$http.post(iurl, data, config).then((x) => x.data);
        }

        /**
         *
         * @param url
         * @param data
         * @param config
         */
        put<T>(url: string, data: any, config?: ng.IRequestShortcutConfig): ng.IPromise<T>
        {
            var iurl = this.interpolateUrl(url, config.params, config.data);

            this.updateConfig(config);

            return this.$http.put(iurl, data, config).then((x) => x.data);
        }

        /**
         *
         * @param config
         */
        updateConfig(config: ng.IRequestShortcutConfig): void
        {
            //if (this.ErrorService.forms.length > 0)
            //{
            //    var id = this.ErrorService.forms.shift();

            //    if (config == null)
            //    {
            //        config = {};
            //    }

            //    if (config.headers == null)
            //    {
            //        config.headers = {};
            //    }

            //    config.headers['X-FORM'] = id;
            //}
        }

        /**
         * Move values from the params and data arguments into the URL where
         * there is a match for labels. When the match occurs, the key-value
         * pairs are removed from the parent object and merged into the string
         * value of the URL.
         * @param url
         * @param params
         * @param data
         */
        interpolateUrl(url: string, params: any, data: any): string
        {
            // Make sure we have an object to work with - makes the rest of the
            // logic easier.
            params = (params || {});

            data = (data || {});

            // Replace each label in the URL (ex, :userID).

            var replacer = ($0, key) =>
            {
                // NOTE: Giving "data" precedence over "params".
                return this.popFirstKey(data, params, key) || "";
            };

            url = url.replace(/:([a-z]\w*)/gi, replacer);

            // Strip out any repeating slashes (but NOT the http:// version).
            url = url.replace(/(^|[^:])[\/]{2,}/g, "$1/");

            // Strip out any trailing slash.
            url = url.replace(/\/+$/i, "");

            return url;
        }

        /**
         *
         * @param data
         * @param params
         * @param key
         */
        popFirstKey(data: any, params: any, key: string): string
        {
            // Convert the arguments list into a true array so we can easily
            // pluck values from either end.
            var objects = Array.prototype.slice.call(arguments);

            // The key will always be the last item in the argument collection.
            objects.pop();

            var object = null;

            // Iterate over the arguments, looking for the first object that
            // contains a reference to the given key.
            while (object = objects.shift())
            {
                if (object.hasOwnProperty(key))
                {
                    return this.popKey(object, key);
                }
            }

            return null;
        }

        /**
         *
         * @param object
         * @param key
         */
        popKey(object: string, key: string): any
        {
            var value = object[key];

            delete object[key];

            if (typeof value == 'boolean')
            {
                value = value ? 'true' : 'false';
            }

            return value;
        }
    }

    angular.module('app').service('RepositoryService', RepositoryService);
}


text:
package nl.nn.adapterframework.senders;

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

import lombok.Getter;
import lombok.Setter;
import nl.nn.adapterframework.configuration.ConfigurationException;
import nl.nn.adapterframework.core.ISender;
import nl.nn.adapterframework.core.PipeLineSession;
import nl.nn.adapterframework.core.SenderException;
import nl.nn.adapterframework.core.SenderResult;
import nl.nn.adapterframework.core.TimeoutException;
import nl.nn.adapterframework.statistics.HasStatistics;
import nl.nn.adapterframework.statistics.StatisticsKeeper;
import nl.nn.adapterframework.statistics.StatisticsKeeperIterationHandler;
import nl.nn.adapterframework.stream.Message;
import nl.nn.adapterframework.util.ClassUtils;

/**
 * Series of Senders, that are executed one after another.
 *
 * @author  Gerrit van Brakel
 * @since   4.9
 */
public class SenderSeries extends SenderWrapperBase {

	private List<ISender> senderList = new LinkedList<>();
	private Map<ISender, StatisticsKeeper> statisticsMap = new HashMap<>();
	private @Getter @Setter boolean synchronous=true;

	@Override
	protected boolean isSenderConfigured() {
		return !senderList.isEmpty();
	}

	@Override
	public void configure() throws ConfigurationException {
		for (ISender sender: getSenders()) {
			sender.configure();
		}
		super.configure();
	}

	@Override
	public void open() throws SenderException {
		for (ISender sender: getSenders()) {
			sender.open();
		}
		super.open();
	}
	@Override
	public void close() throws SenderException {
		for (ISender sender: getSenders()) {
			sender.close();
		}
		super.close();
	}

	@Override
	public SenderResult doSendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException {
		String correlationID = session==null ? null : session.getCorrelationId();
		SenderResult result=null;
		long t1 = System.currentTimeMillis();
		for (ISender sender: getSenders()) {
			if (log.isDebugEnabled()) log.debug(getLogPrefix()+"sending correlationID ["+correlationID+"] message ["+message+"] to sender ["+sender.getName()+"]");
			result = sender.sendMessage(message, session);
			if (!result.isSuccess()) {
				return result;
			}
			message = result.getResult();
			long t2 = System.currentTimeMillis();
			StatisticsKeeper sk = getStatisticsKeeper(sender);
			sk.addValue(t2-t1);
			t1=t2;
		}
		return result!=null ? result : new SenderResult(message);
	}

	@Override
	public void iterateOverStatistics(StatisticsKeeperIterationHandler hski, Object data, Action action) throws SenderException {
		//Object senderData=hski.openGroup(data,getName(),"sender");
		for (ISender sender: getSenders()) {
			hski.handleStatisticsKeeper(data,getStatisticsKeeper(sender));
			if (sender instanceof HasStatistics) {
				((HasStatistics)sender).iterateOverStatistics(hski,data,action);
			}
		}
		//hski.closeGroup(senderData);
	}

	@Override
	public boolean consumesSessionVariable(String sessionKey) {
		if (super.consumesSessionVariable(sessionKey)) {
			return true;
		}
		for (ISender sender:senderList) {
			if (sender.consumesSessionVariable(sessionKey)) {
				return true;
			}
		}
		return false;
	}

	@Deprecated // replaced by registerSender, to allow for multiple senders in XSD. Method must be present, as it is used by Digester
	public final void setSender(ISender sender) {
		registerSender(sender);
	}

	/**
	 * one or more specifications of senders that will be executed one after another. Each sender will get the result of the preceding one as input.
	 * @ff.mandatory
	 */
	public void registerSender(ISender sender) {
		senderList.add(sender);
		setSynchronous(sender.isSynchronous()); // set synchronous to isSynchronous of the last Sender added
		statisticsMap.put(sender, new StatisticsKeeper("-> "+ClassUtils.nameOf(sender)));
	}

	protected Iterable<ISender> getSenders() {
		return senderList;
	}
	protected StatisticsKeeper getStatisticsKeeper(ISender sender) {
		return statisticsMap.get(sender);
	}

}


text:
import pygame
import sys
from actor import *
from world import *
from level import *
from const import *

SCREEN = None

pygame.init()
SCREEN = pygame.display.set_mode( (Constants.SCREEN_WIDTH, Constants.SCREEN_HEIGHT) )#, pygame.FULLSCREEN )
pygame.display.set_caption('Labyrinth')

world = World()
world.create(Level("level1.txt"))

CLOCK = pygame.time.Clock()

actor_move_left = 0
actor_move_right = 0
actor_move_up = 0
actor_move_down = 0

camera_move_left = 0
camera_move_right = 0
camera_move_up = 0
camera_move_down = 0

world.start()

running = 1
while running:
    tick = CLOCK.tick(Constants.FPS)
    dt = 1.0 / tick

    for event in pygame.event.get():
        #print(event)
        if event.type == pygame.QUIT:
            running = 0

        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_LEFT:
                camera_move_left = -500
            if event.key == pygame.K_RIGHT:
                camera_move_right = 500
            if event.key == pygame.K_UP:
                camera_move_up = -500
            if event.key == pygame.K_DOWN:
                camera_move_down = 500
            if event.key == pygame.K_a:
                actor_move_left = 200
            if event.key == pygame.K_d:
                actor_move_right = -200
            if event.key == pygame.K_w:
                actor_move_up = 200
            if event.key == pygame.K_s:
                actor_move_down = -200

        if event.type == pygame.KEYUP:
            if event.key == pygame.K_LEFT:
                camera_move_left = 0
            if event.key == pygame.K_RIGHT:
                camera_move_right = 0
            if event.key == pygame.K_UP:
                camera_move_up = 0
            if event.key == pygame.K_DOWN:
                camera_move_down = 0
            if event.key == pygame.K_a:
                actor_move_left = 0
            if event.key == pygame.K_d:
                actor_move_right = 0
            if event.key == pygame.K_w:
                actor_move_up = 0
            if event.key == pygame.K_s:
                actor_move_down = 0
            if event.key == pygame.K_r:
                world.reset()
                world.start()

        if event.type == pygame.MOUSEBUTTONUP:
            mX, mY = pygame.mouse.get_pos()
            world.click(mX, mY)

    camera_move_x = int((camera_move_left + camera_move_right) * dt)
    camera_move_y = int((camera_move_up + camera_move_down) * dt)

    actor_move_x = int((actor_move_left + actor_move_right) * dt)
    actor_move_y = int((actor_move_up + actor_move_down) * dt)

##    if actor_move_x != 0 or actor_move_y != 0:
##        world.moveActor((actor_move_x, actor_move_y))

    if camera_move_x != 0 or camera_move_y != 0:
        world.getCamera().move((camera_move_x, camera_move_y))
    #world.getCamera().pan(world.player.screenPos())

    SCREEN.fill(Color.BLACK)

    world.update(dt)
    world.render(SCREEN)

    pygame.display.flip()

pygame.quit()
sys.exit()


text:
<?xml version="1.0" encoding="UTF-8"?>
<problems>
  <problem>
    <file>test.py</file>
    <line>2</line>
    <problem_class severity="WARNING"/>
    <description>Signature is not compatible to __new__</description>
  </problem>
  <problem>
    <file>test.py</file>
    <line>12</line>
    <problem_class severity="WARNING"/>
    <description>Signature is not compatible to __init__</description>
  </problem>
</problems>


text:
if is_service_enabled mistral; then
    if [[ "$1" == "source" ]]; then
        # Initial source
        source $TOP_DIR/lib/mistral
    elif [[ "$1" == "stack" && "$2" == "install" ]]; then
        echo_summary "Installing mistral"
        install_mistral
    elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
        echo_summary "Configuring mistral"
        configure_mistral
        create_mistral_accounts
    elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
        echo_summary "Initializing mistral"
        init_mistral
        start_mistral
    fi

    if [[ "$1" == "unstack" ]]; then
        stop_mistral
    fi
fi


text:
@interface NSFileManager(Ext)
- (CGFloat)extFileSizeInMegaBytesAtPath:(NSString *)path;
- (NSUInteger)extFileSizeInBytesAtPath:(NSString *)path;

- (void)extCreateFolderPathIfNeeded:(NSString *)folderPath;
@end


text:
```npm install javaflamegraph```

# Usage
1. ```cd ./node_modules/javaflamegraph```
2. ```npm start``` - This will wait till it detects a process with name 'Java'. Can be best best used to start profiling at program startup.
3. ```npm run start <process id>``` - This will start profiling for the given process id.
    e.g. ```npm run start 1234```

# Dependency
This library depends on perl, shell, and jstack (Java SDK).These are already available on linux/mac.On windows you can use this package with cygwin.

## Acknowledgements
Thanks to [Brendan Gregg's FlameGraph](https://github.com/brendangregg/FlameGraph)

## License

MIT © [Saquib Khan](https://github.com/saquibkhan)


text:
layout: none
title: pygments
id: pygments
root: ../
---

<head>
    <title>pygments</title>
    <link media="all" rel="stylesheet" type="text/css" href="../assets/pygments/syntax.css" />
</head>

<body>
    {% highlight ruby %}
    def show
    @widget = Widget(params[:id])
    respond_to do |format|
        format.html # show.html.erb
        format.json { render json: @widget }
    end
    end
    {% endhighlight %}
</body>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ExCSS.Model.Extensions;

// ReSharper disable once CheckNamespace
namespace ExCSS
{
    public sealed class StyleSheet
    {
        private readonly List<RuleSet> _rules;
        private string _name;

        public StyleSheet()
        {
            _rules = new List<RuleSet>();
            Errors = new List<StylesheetParseError>();
        }

        public List<RuleSet> Rules
        {
            get { return _rules; }
        }

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        public StyleSheet RemoveRule(int index)
        {
            if (index >= 0 && index < _rules.Count)
            {
                _rules.RemoveAt(index);
            }

            return this;
        }

        public StyleSheet InsertRule(string rule, int index)
        {
            if (index < 0 || index > _rules.Count)
            {
                return this;
            }

            var value = Parser.ParseRule(rule);
            _rules.Insert(index, value);

            return this;
        }

        public IList<StyleRule> StyleRules
        {
            get
            {
                return Rules.Where(r => r is StyleRule).Cast<StyleRule>().ToList();
            }
        }

        public IList<CharacterSetRule> CharsetDirectives
        {
            get
            {
                return GetDirectives<CharacterSetRule>(RuleType.Charset);
            }
        }

        public IList<ImportRule> ImportDirectives
        {
            get
            {
                return GetDirectives<ImportRule>(RuleType.Import);
            }
        }

        public IList<FontFaceRule> FontFaceDirectives
        {
            get
            {
                return GetDirectives<FontFaceRule>(RuleType.FontFace);
            }
        }

        public IList<KeyframesRule> KeyframeDirectives
        {
            get
            {
                return GetDirectives<KeyframesRule>(RuleType.Keyframes);
            }
        }

        public IList<MediaRule> MediaDirectives
        {
            get
            {
                return GetDirectives<MediaRule>(RuleType.Media);

            }
        }

        public IList<PageRule> PageDirectives
        {
            get
            {
                return GetDirectives<PageRule>(RuleType.Page);

            }
        }

        public IList<SupportsRule> SupportsDirectives
        {
            get
            {
                return GetDirectives<SupportsRule>(RuleType.Supports);
            }
        }

        public IList<NamespaceRule> NamespaceDirectives
        {
            get
            {
                return GetDirectives<NamespaceRule>(RuleType.Namespace);
            }
        }

        private IList<T> GetDirectives<T>(RuleType ruleType)
        {
            return Rules.Where(r => r.RuleType == ruleType).Cast<T>().ToList();
        }

        public List<StylesheetParseError> Errors { get; private set; }

        public override string ToString()
        {
            return ToString(false);
        }

        public string ToString(bool friendlyFormat, int indentation = 0)
        {
            var builder = new StringBuilder();

            foreach (var rule in _rules)
            {
                builder.Append(rule.ToString(friendlyFormat, indentation).TrimStart() + (friendlyFormat ? Environment.NewLine : ""));
            }

            return builder.TrimFirstLine().TrimLastLine().ToString();
        }
    }
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

  <title>Qt 4.3: dirmodel.cpp Example File (tools/completer/dirmodel.cpp)</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />

  	Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

dirmodel.cpp Example File
tools/completer/dirmodel.cpp

 #include "dirmodel.h"

 DirModel::DirModel(QObject *parent)
     : QDirModel(parent)
 {
 }

 QVariant DirModel::data(const QModelIndex &index, int role) const
 {
     if (role == Qt::DisplayRole && index.column() == 0) {
         QString path  = QDir::toNativeSeparators(filePath(index));
         if (path.endsWith(QDir::separator()))
             path.chop(1);
         return path;
     }

     return QDirModel::data(index, role);
 }

<address>

Copyright © 2008 Trolltech
Trademarks

Qt 4.3.5

</address>


text:
import React, { PureComponent as Component } from 'react';
import {
  Table,
  Card,
  Badge,
  Select,
  Button,
  Modal,
  Row,
  Col,
  message,
  Popconfirm,
  Switch,
  Tooltip
} from 'antd';
import PropTypes from 'prop-types';
import { fetchGroupMsg } from '../../../../reducer/modules/group';
import { connect } from 'react-redux';
import ErrMsg from '../../../../components/ErrMsg/ErrMsg.js';
import { fetchGroupMemberList } from '../../../../reducer/modules/group.js';
import {
  fetchProjectList,
  getProjectMemberList,
  getProject,
  addMember,
  delMember,
  changeMemberRole,
  changeMemberEmailNotice
} from '../../../../reducer/modules/project.js';
import UsernameAutoComplete from '../../../../components/UsernameAutoComplete/UsernameAutoComplete.js';
import '../Setting.scss';

const Option = Select.Option;

const arrayAddKey = arr => {
  return arr.map((item, index) => {
    return {
      ...item,
      key: index
    };
  });
};

@connect(
  state => {
    return {
      projectMsg: state.project.currProject,
      uid: state.user.uid,
      projectList: state.project.projectList
    };
  },
  {
    fetchGroupMemberList,
    getProjectMemberList,
    addMember,
    delMember,
    fetchGroupMsg,
    changeMemberRole,
    getProject,
    fetchProjectList,
    changeMemberEmailNotice
  }
)
class ProjectMember extends Component {
  constructor(props) {
    super(props);
    this.state = {
      groupMemberList: [],
      projectMemberList: [],
      groupName: '',
      role: '',
      visible: false,
      dataSource: [],
      inputUids: [],
      inputRole: 'dev',
      modalVisible: false,
      selectProjectId: 0
    };
  }
  static propTypes = {
    match: PropTypes.object,
    projectId: PropTypes.number,
    projectMsg: PropTypes.object,
    uid: PropTypes.number,
    addMember: PropTypes.func,
    delMember: PropTypes.func,
    changeMemberRole: PropTypes.func,
    getProject: PropTypes.func,
    fetchGroupMemberList: PropTypes.func,
    fetchGroupMsg: PropTypes.func,
    getProjectMemberList: PropTypes.func,
    fetchProjectList: PropTypes.func,
    projectList: PropTypes.array,
    changeMemberEmailNotice: PropTypes.func
  };

  showAddMemberModal = () => {
    this.setState({
      visible: true
    });
  };

  showImportMemberModal = async () => {
    await this.props.fetchProjectList(this.props.projectMsg.group_id);
    this.setState({
      modalVisible: true
    });
  };

  // 重新获取列表

  reFetchList = () => {
    this.props.getProjectMemberList(this.props.match.params.id).then(res => {
      this.setState({
        projectMemberList: arrayAddKey(res.payload.data.data),
        visible: false,
        modalVisible: false
      });
    });
  };

  handleOk = () => {
    this.addMembers(this.state.inputUids);
  };

  // 增 - 添加成员
  addMembers = memberUids => {
    this.props
      .addMember({
        id: this.props.match.params.id,
        member_uids: memberUids,
        role: this.state.inputRole
      })
      .then(res => {
        if (!res.payload.data.errcode) {
          const { add_members, exist_members } = res.payload.data.data;
          const addLength = add_members.length;
          const existLength = exist_members.length;
          this.setState({
            inputRole: 'dev',
            inputUids: []
          });
          message.success(`添加成功! 已成功添加 ${addLength} 人,其中 ${existLength} 人已存在`);
          this.reFetchList(); // 添加成功后重新获取分组成员列表
        }
      });
  };
  // 添加成员时 选择新增成员权限
  changeNewMemberRole = value => {
    this.setState({
      inputRole: value
    });
  };

  // 删 - 删除分组成员
  deleteConfirm = member_uid => {
    return () => {
      const id = this.props.match.params.id;
      this.props.delMember({ id, member_uid }).then(res => {
        if (!res.payload.data.errcode) {
          message.success(res.payload.data.errmsg);
          this.reFetchList(); // 添加成功后重新获取分组成员列表
        }
      });
    };
  };

  // 改 - 修改成员权限
  changeUserRole = e => {
    const id = this.props.match.params.id;
    const role = e.split('-')[0];
    const member_uid = e.split('-')[1];
    this.props.changeMemberRole({ id, member_uid, role }).then(res => {
      if (!res.payload.data.errcode) {
        message.success(res.payload.data.errmsg);
        this.reFetchList(); // 添加成功后重新获取分组成员列表
      }
    });
  };

  // 修改用户是否接收消息通知
  changeEmailNotice = async (notice, member_uid) => {
    const id = this.props.match.params.id;
    await this.props.changeMemberEmailNotice({ id, member_uid, notice });
    this.reFetchList(); // 添加成功后重新获取项目成员列表
  };

  // 关闭模态框
  handleCancel = () => {
    this.setState({
      visible: false
    });
  };
  // 关闭批量导入模态框
  handleModalCancel = () => {
    this.setState({
      modalVisible: false
    });
  };

  // 处理选择项目
  handleChange = key => {
    this.setState({
      selectProjectId: key
    });
  };

  // 确定批量导入模态框
  handleModalOk = async () => {
    // 获取项目中的成员列表
    const menberList = await this.props.getProjectMemberList(this.state.selectProjectId);
    const memberUidList = menberList.payload.data.data.map(item => {
      return item.uid;
    });
    this.addMembers(memberUidList);
  };

  onUserSelect = uids => {
    this.setState({
      inputUids: uids
    });
  };

  async componentWillMount() {
    const groupMemberList = await this.props.fetchGroupMemberList(this.props.projectMsg.group_id);
    const groupMsg = await this.props.fetchGroupMsg(this.props.projectMsg.group_id);
    const projectMemberList = await this.props.getProjectMemberList(this.props.match.params.id);
    this.setState({
      groupMemberList: groupMemberList.payload.data.data,
      groupName: groupMsg.payload.data.data.group_name,
      projectMemberList: arrayAddKey(projectMemberList.payload.data.data),
      role: this.props.projectMsg.role
    });
  }

  render() {
    const isEmailChangeEable = this.state.role === 'owner' || this.state.role === 'admin';
    const columns = [
      {
        title:
          this.props.projectMsg.name + ' 项目成员 (' + this.state.projectMemberList.length + ') 人',
        dataIndex: 'username',
        key: 'username',
        render: (text, record) => {
          return (

{text}

              <Tooltip placement="top" title="消息通知">

                  <Switch
                    size="small"
                    checkedChildren="开"
                    unCheckedChildren="关"
                    checked={record.email_notice}
                    disabled={!(isEmailChangeEable || record.uid === this.props.uid)}
                    onChange={e => this.changeEmailNotice(e, record.uid)}
                  />

              </Tooltip>

          );
        }
      },
      {
        title:
          this.state.role === 'owner' || this.state.role === 'admin' ? (

              <Button className="btn" type="primary" icon="plus" onClick={this.showAddMemberModal}>
                添加成员
              </Button>
              <Button className="btn" icon="plus" onClick={this.showImportMemberModal}>
                批量导入成员
              </Button>

          ) : (
            ''
          ),
        key: 'action',
        className: 'member-opration',
        render: (text, record) => {
          if (this.state.role === 'owner' || this.state.role === 'admin') {
            return (

                <Select
                  value={record.role + '-' + record.uid}
                  className="select"
                  onChange={this.changeUserRole}
                >
                  <Option value={'owner-' + record.uid}>组长</Option>
                  <Option value={'dev-' + record.uid}>开发者</Option>
                  <Option value={'guest-' + record.uid}>访客</Option>
                </Select>
                <Popconfirm
                  placement="topRight"
                  title="你确定要删除吗? "
                  onConfirm={this.deleteConfirm(record.uid)}
                  okText="确定"
                  cancelText=""
                >
                  <Button type="danger" icon="delete" className="btn-danger" />
                </Popconfirm>

            );
          } else {
            // 非管理员可以看到权限 但无法修改
            if (record.role === 'owner') {
              return '组长';
            } else if (record.role === 'dev') {
              return '开发者';
            } else if (record.role === 'guest') {
              return '访客';
            } else {
              return '';
            }
          }
        }
      }
    ];
    // 获取当前分组下的所有项目名称
    const children = this.props.projectList.map((item, index) => (
      <Option key={index} value={'' + item._id}>
        {item.name}
      </Option>
    ));

    return (

          {this.state.visible ? (
            <Modal
              title="添加成员"
              visible={this.state.visible}
              onOk={this.handleOk}
              onCancel={this.handleCancel}
            >
              <Row gutter={6} className="modal-input">
                <Col span="5">

用户名:

                </Col>
                <Col span="15">
                  <UsernameAutoComplete callbackState={this.onUserSelect} />
                </Col>
              </Row>
              <Row gutter={6} className="modal-input">
                <Col span="5">

权限:

                </Col>
                <Col span="15">
                  <Select defaultValue="dev" className="select" onChange={this.changeNewMemberRole}>
                    <Option value="owner">组长</Option>
                    <Option value="dev">开发者</Option>
                    <Option value="guest">访客</Option>
                  </Select>
                </Col>
              </Row>
            </Modal>
          ) : (
            ''
          )}
          <Modal
            title="批量导入成员"
            visible={this.state.modalVisible}
            onOk={this.handleModalOk}
            onCancel={this.handleModalCancel}
          >
            <Row gutter={6} className="modal-input">
              <Col span="5">

项目名:

              </Col>
              <Col span="15">
                <Select
                  showSearch
                  style={{ width: 200 }}
                  placeholder="请选择项目名称"
                  optionFilterProp="children"
                  onChange={this.handleChange}
                >
                  {children}
                </Select>
              </Col>
            </Row>
          </Modal>

          <Table
            columns={columns}
            dataSource={this.state.projectMemberList}
            pagination={false}
            locale={{ emptyText: <ErrMsg type="noMemberInProject" /> }}
            className="setting-project-member"
          />
          <Card
            bordered={false}
            title={
              this.state.groupName + ' 分组成员 ' + '(' + this.state.groupMemberList.length + ') 人'
            }
            hoverable={true}
            className="setting-group"
          >
            {this.state.groupMemberList.length ? (
              this.state.groupMemberList.map((item, index) => {
                return (

                      {item.username}
                      {item.uid === this.props.uid ? (
                        <Badge
                          count={'我'}
                          style={{
                            backgroundColor: '#689bd0',
                            fontSize: '13px',
                            marginLeft: '8px',
                            borderRadius: '4px'
                          }}
                        />
                      ) : null}

                    {item.role === 'owner' ?
组长
 : null}
                    {item.role === 'dev' ?
开发者
 : null}
                    {item.role === 'guest' ?
访客
 : null}

                );
              })
            ) : (
              <ErrMsg type="noMemberInGroup" />
            )}
          </Card>

    );
  }
}

export default ProjectMember;


text:
package com.tazzie02.tazbotdiscordlib;

import net.dv8tion.jda.core.entities.Message;

public interface MessageEditor {

	public Message editMessageSync(Message message, String content);
//	public Message editMessageSync(Message message, Message newMessage); // TODO
	public void editMessageAsync(Message message, String content);
//	public void editMessageAsync(Message message, Message newMessage); // TODO
	public void deleteMessageSync(Message message);
	public void deleteMessageAsync(Message message);

}


text:
import gmail as Gm
import messages as Msg
import slack

from cfg.config import (
    WEBHOOK_URL,
    GOCD_DASHBOARD_URL,
)

def main():
    try:
        service, labels, messages_details = initialize()
        process(service, labels, messages_details)
    except:
        pass

def initialize():
    service = Gm.get_service()
    labels = Gm.get_labels(service)
    initial_messages = Gm.get_messages(service, include_labels=['UNREAD'])
    messages_details = Gm.get_messages_details(service, initial_messages)
    return (service, labels, messages_details)

def process(service, labels, messages_details):
    for item in messages_details:
        subject = Msg.get_subject(item)

        if Msg.is_gocd_pattern(subject):
            gocd_details = Msg.get_gocd_details(subject)

            if slack.is_matching_send_rule(gocd_details):
                body = Msg.get_body(item)
                changeset = Msg.get_changeset_info(body)
                text = (slack
                        .message_builder(gocd_details,
                                         changeset,
                                         GOCD_DASHBOARD_URL))

                slack.send_to_slack(text, WEBHOOK_URL)

                Gm.add_label(service, Msg.get_id(item),
                             'SENT_TO_SLACK', labels)

        Gm.remove_label(service, Msg.get_id(item),
                        'UNREAD', labels)

if __name__ == "__main__":
    main()


text:
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

RocketChat.API.helperMethods.set('parseJsonQuery', function _parseJsonQuery() {
	let sort;
	if (this.queryParams.sort) {
		try {
			sort = JSON.parse(this.queryParams.sort);
		} catch (e) {
			this.logger.warn(`Invalid sort parameter provided "${ this.queryParams.sort }":`, e);
			throw new Meteor.Error('error-invalid-sort', `Invalid sort parameter provided: "${ this.queryParams.sort }"`, { helperMethod: 'parseJsonQuery' });
		}
	}

	let fields;
	if (this.queryParams.fields) {
		try {
			fields = JSON.parse(this.queryParams.fields);
		} catch (e) {
			this.logger.warn(`Invalid fields parameter provided "${ this.queryParams.fields }":`, e);
			throw new Meteor.Error('error-invalid-fields', `Invalid fields parameter provided: "${ this.queryParams.fields }"`, { helperMethod: 'parseJsonQuery' });
		}
	}

	// Verify the user's selected fields only contains ones which their role allows
	if (typeof fields === 'object') {
		let nonSelectableFields = Object.keys(RocketChat.API.v1.defaultFieldsToExclude);
		if (this.request.route.includes('/v1/users.')) {
			const getFields = () => Object.keys(RocketChat.authz.hasPermission(this.userId, 'view-full-other-user-info') ? RocketChat.API.v1.limitedUserFieldsToExcludeIfIsPrivilegedUser : RocketChat.API.v1.limitedUserFieldsToExclude);
			nonSelectableFields = nonSelectableFields.concat(getFields());
		}

		Object.keys(fields).forEach((k) => {
			if (nonSelectableFields.includes(k) || nonSelectableFields.includes(k.split(RocketChat.API.v1.fieldSeparator)[0])) {
				delete fields[k];
			}
		});
	}

	// Limit the fields by default
	fields = Object.assign({}, fields, RocketChat.API.v1.defaultFieldsToExclude);
	if (this.request.route.includes('/v1/users.')) {
		if (RocketChat.authz.hasPermission(this.userId, 'view-full-other-user-info')) {
			fields = Object.assign(fields, RocketChat.API.v1.limitedUserFieldsToExcludeIfIsPrivilegedUser);
		} else {
			fields = Object.assign(fields, RocketChat.API.v1.limitedUserFieldsToExclude);
		}
	}

	let query = {};
	if (this.queryParams.query) {
		try {
			query = JSON.parse(this.queryParams.query);
		} catch (e) {
			this.logger.warn(`Invalid query parameter provided "${ this.queryParams.query }":`, e);
			throw new Meteor.Error('error-invalid-query', `Invalid query parameter provided: "${ this.queryParams.query }"`, { helperMethod: 'parseJsonQuery' });
		}
	}

	// Verify the user has permission to query the fields they are
	if (typeof query === 'object') {
		let nonQueryableFields = Object.keys(RocketChat.API.v1.defaultFieldsToExclude);
		if (this.request.route.includes('/v1/users.')) {
			if (RocketChat.authz.hasPermission(this.userId, 'view-full-other-user-info')) {
				nonQueryableFields = nonQueryableFields.concat(Object.keys(RocketChat.API.v1.limitedUserFieldsToExcludeIfIsPrivilegedUser));
			} else {
				nonQueryableFields = nonQueryableFields.concat(Object.keys(RocketChat.API.v1.limitedUserFieldsToExclude));
			}
		}

		Object.keys(query).forEach((k) => {
			if (nonQueryableFields.includes(k) || nonQueryableFields.includes(k.split(RocketChat.API.v1.fieldSeparator)[0])) {
				delete query[k];
			}
		});
	}

	return {
		sort,
		fields,
		query,
	};
});


text:
class Ponto {
  protected:
    int x, y;

  public:
    Ponto( const int x, const int y );
    void setPosition( const int x, const int y );

    int getX( void ) const;
    int getY( void ) const;
};

#endif


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var sqlProvider = require("../sql");
var bluebird = require("bluebird");
var bcrypt = require("bcrypt-nodejs");
var compare = bluebird.promisify(bcrypt.compare);
var hash = bluebird.promisify(bcrypt.hash);
var genSalt = bluebird.promisify(bcrypt.genSalt);
var sql = sqlProvider.users;
/*
 This repository mixes hard-coded and dynamic SQL,
 primarily to show a diverse example of using both.
 */
var Repository = (function () {
    function Repository(db, pgp) {
        this.db = db;
        this.pgp = pgp; // library's root, if ever needed;
    }
    Repository.prototype.setVisibleMap = function (id_user, id_map) {
        return this.db.none("UPDATE User_Maps SET visible = true WHERE id_map = '${id_map#}' AND id_user = '${id_user#}'", { id_user: id_user, id_map: id_map });
    };
    Repository.prototype.deleteForgetToken = function (id_user) {
        return this.db.none("DELETE FROM users_change_password_token WHERE id = '${id_user#}'", { id_user: id_user });
    };
    Repository.prototype.createForgetToken = function (id_user) {
        return this.db.one(sql.createForgetToken, { id_user: id_user });
    };
    Repository.prototype.findIdByToken = function (token) {
        return this.db.oneOrNone(sql.findIdByToken, { token: this.pgp.as.value(token) });
    };
    Repository.prototype.isValid = function (id) {
        return this.db.one(sql.isValid, { id_user: this.pgp.as.value(id) })
            .then(function (isValid) { return isValid.valid; });
    };
    Repository.prototype.getAllGroups = function () {
        return this.db.one(sql.getAllGroups)
            .then(function (allGroups) { return allGroups.groups; });
    };
    Repository.prototype.validPassword = function (user, password) {
        return compare(password, user.password);
    };
    Repository.prototype.genPassword = function (password) {
        return hash(password, null, null);
    };
    Repository.prototype.findBy = function (column, value) {
        return this.db.any(sql.findBy, {
            column: this.pgp.as.name(column),
            value: this.pgp.as.value(value)
        });
    };
    // Crear el enum de roles
    Repository.prototype.createRolesEnum = function () {
        return this.db.none(sql.createRolesEnum);
    };
    // Creates the table;
    Repository.prototype.create = function () {
        return this.db.none(sql.create);
    };
    // Crea la extensión "citext"(Case Insensitive text) para poder utilizar este tipo de dato en la columna e-mail
    // http://dba.stackexchange.com/a/74313
    Repository.prototype.createCitextExtension = function () {
        return this.db.none(sql.createCitextExtension);
    };
    Repository.prototype.init = function () {
        return this.db.tx('Demo-Users', function (t) { return t.map(sql.init, null, function (row) { return row.id; }); });
    };
    // Tries to find a user from id;
    Repository.prototype.find = function (id) {
        return this.db.oneOrNone('SELECT * FROM Users WHERE id = $1', id);
    };
    // Returns all user records;
    Repository.prototype.all = function () {
        this.db.any('SELECT * FROM Users');
    };
    // Returns the total number of users;
    Repository.prototype.total = function () {
        return this.db.one('SELECT count(*) FROM Users', [], function (a) { return +a.count; });
    };
    return Repository;
}());
exports.Repository = Repository;


text:
package io.induct.util;

import java.util.Arrays;
import java.util.function.Supplier;

/**
 * @author Esko Suomi <suomi.esko@gmail.com>
 * @since 24.1.2015
 */
public class MoreArrays {

    /**
     * Pivot given table by its axii, eg. turn
     *

     *[[a,b,c]
     * [d,e,f]]

     * to
     *

     *[[a,d],
     * [b,e],
     * [c,f]]
     *

     *
     * @param bytes
     * @return
     */
    public static byte[][] pivot(byte[][] bytes) {
        int maxWidth = bytes[0].length;
        int maxHeight = bytes.length;
        byte[][] pivot = new byte[maxWidth][];
        MoreArrays.fill(pivot, () -> new byte[maxHeight]);

        for (int x = 0; x < maxHeight; x++) {
            for (int y = 0; y < maxWidth; y++) {
                byte b = bytes[x][y];
                pivot[y][x] = b;
            }
        }
        return pivot;
    }

    /**
     * Fill array entries with supplier provided values. Unlike {@link Arrays#fill(Object[], Object)} this causes unique
     * values to be used for each cell
     *
     * @param arr Array to fill
     * @param supplier Supplier for fill value
     */
    public static void fill(Object[] arr, Supplier<?> supplier) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] = supplier.get();
        }
    }

    /**
     * Rotate values of given array. Positive offset rotates to right, negatives to left
     *
     * @param offset Rotation offset
     * @param arr Array to shift
     * @return Rotated array
     */
    public static byte[] shift(int offset, byte[] arr) {
        if (offset == 0) return Arrays.copyOf(arr, arr.length);

        byte[] rotated = new byte[arr.length];

        boolean rotateRight = offset > 0;

        offset = Math.abs(offset);
        offset = arr.length % offset;

        int cut, remainder;
        if (rotateRight) {
            cut = arr.length - offset - 1;
            remainder = offset + 1;
        } else {
            cut = offset + 1;
            remainder = arr.length - offset - 1;
        }

        System.arraycopy(arr, 0, rotated, remainder, cut);
        System.arraycopy(arr, cut, rotated, 0, remainder);

        return rotated;
    }
}


text:
package org.pentaho.di.ui.spoon;

public interface SpoonPerspectiveImageProvider extends SpoonPerspective {

  /**
   * Get the path to the perspective's icon, can be within a jar (classLoader) or
   * file-system.
   *
   * @return the path to the perspective's icon
   */
  public String getPerspectiveIconPath();

}


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

<title>Uses of Package etri.sdn.controller.module.storagemanager</title>
<meta name="date" content="2014-02-26">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
etri.sdn.controller.module.storagemanager

Packages that use etri.sdn.controller.module.storagemanager

Package
Description

etri.sdn.controller.module.firewall

etri.sdn.controller.module.storagemanager

Classes in etri.sdn.controller.module.storagemanager used by etri.sdn.controller.module.firewall

Class and Description

IStorageService

The interface to persistent storage used for C.R.U.D.

OFMStorageManager

This class enables a persistent storage for the controller.

Classes in etri.sdn.controller.module.storagemanager used by etri.sdn.controller.module.storagemanager

Class and Description

IStorageService

The interface to persistent storage used for C.R.U.D.

OFMStorageManager

This class enables a persistent storage for the controller.

Storage

This class provides RESTful APIs for applications using  IStorageService Interface.

StorageException

Signals that an storage related exception of some sort has occurred.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
package org.docksidestage.dockside.dbflute.exbhv;

import org.docksidestage.dockside.dbflute.bsbhv.BsVendorCheckBhv;

/**
 * The behavior of VENDOR_CHECK.
 * <p>
 * You can implement your original methods here.
 * This class remains when re-generating.
 * </p>
 * @author DBFlute(AutoGenerator)
 */
@org.springframework.stereotype.Component("vendorCheckBhv")
public class VendorCheckBhv extends BsVendorCheckBhv {
}


text:
'use strict';
var fs = require('fs');
var pkg = require('./package.json');
var stripBom = require('./index');
var input = process.argv[2];

function help() {
	console.log(pkg.description);
	console.log('');
	console.log('Usage');
	console.log('  $ strip-bom <file> > <new-file>');
	console.log('  $ cat <file> | strip-bom > <new-file>');
	console.log('');
	console.log('Example');
	console.log('  $ strip-bom unicorn.txt > unicorn-without-bom.txt');
}

if (process.argv.indexOf('--help') !== -1) {
	help();
	return;
}

if (process.argv.indexOf('--version') !== -1) {
	console.log(pkg.version);
	return;
}

if (process.stdin.isTTY) {
	if (!input) {
		help();
		return;
	}

	fs.createReadStream(input).pipe(stripBom.stream()).pipe(process.stdout);
} else {
	process.stdin.pipe(stripBom.stream()).pipe(process.stdout);
}


text:
package anubis.runtime;

import java.math.BigDecimal;
import java.math.BigInteger;
import anubis.AnubisObject;

/**
 * @author SiroKuro
 */
public class ADecimal extends ANumber {
	public final BigDecimal value;

	protected ADecimal(BigDecimal value) {
		assert value != null;
		this.value = value;
	}

	@Override
	public Number getNumber() {
		return value;
	}

	public BigDecimal getValue() {
		return value;
	}

	@Override
	public <T> T operate(BinaryOperator<T> op, ANumber y) {
		return y.operate(op, value);
	}

	@Override
	public <T> T operate(UnaryOperator<T> op) {
		return op.operate(value);
	}

	@Override
	protected <T> T operate(BinaryOperator<T> op, BigDecimal x) {
		return op.operate(x, value);
	}

	@Override
	protected <T> T operate(BinaryOperator<T> op, BigInteger x) {
		return op.operate(new BigDecimal(x), value);
	}

	public static ADecimal valueOf(BigDecimal value) {
		return new ADecimal(value);
	}

	/**
	 * @param d
	 * @return
	 */
	public static AnubisObject valueOf(double d) {
		return valueOf(BigDecimal.valueOf(d));
	}
}