text:
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]

Generate strong pseudo-random bytes.

This module is a simple wrapper around the Node.js core `crypto.randomBytes` API,
with the following additions:

  * A `Promise` interface for environments with promises.
  * For Node.js versions that do not wait for the PRNG to be seeded, this module
    will wait a bit.

## Installation

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```sh
$ npm install random-bytes
```

## API

<!-- eslint-disable no-unused-vars -->

```js
var randomBytes = require('random-bytes')
```

### randomBytes(size, callback)

Generates strong pseudo-random bytes. The `size` argument is a number indicating
the number of bytes to generate.

<!-- eslint-disable no-undef -->

```js
randomBytes(12, function (error, bytes) {
  if (error) throw error
  // do something with the bytes
})
```

### randomBytes(size)

Generates strong pseudo-random bytes and return a `Promise`. The `size` argument is
a number indicating the number of bytes to generate.

**Note**: To use promises in Node.js _prior to 0.12_, promises must be
"polyfilled" using `global.Promise = require('bluebird')`.

<!-- eslint-disable no-undef -->

```js
randomBytes(18).then(function (string) {
  // do something with the string
})
```

### randomBytes.sync(size)

A synchronous version of above.

<!-- eslint-disable no-undef, no-unused-vars -->

```js
var bytes = randomBytes.sync(18)
```

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/random-bytes.svg
[npm-url]: https://npmjs.org/package/random-bytes
[node-version-image]: https://img.shields.io/node/v/random-bytes.svg
[node-version-url]: https://nodejs.org/en/download
[travis-image]: https://img.shields.io/travis/crypto-utils/random-bytes/master.svg
[travis-url]: https://travis-ci.org/crypto-utils/random-bytes
[coveralls-image]: https://img.shields.io/coveralls/crypto-utils/random-bytes/master.svg
[coveralls-url]: https://coveralls.io/r/crypto-utils/random-bytes?branch=master
[downloads-image]: https://img.shields.io/npm/dm/random-bytes.svg
[downloads-url]: https://npmjs.org/package/random-bytes


text:
package com.buession.redis.core;

import com.buession.core.Geo;
import com.buession.redis.Constants;

import java.util.Arrays;

/**
 * @author Yong.Teng
 */
public class GeoRadius {

    private byte[] member;

    private double distance;

    private Geo geo;

    public byte[] getMember(){
        return member;
    }

    public void setMember(byte[] member){
        this.member = member;
    }

    public String getMemberAsString(){
        return new String(member, Constants.CHARSET);
    }

    public double getDistance(){
        return distance;
    }

    public void setDistance(double distance){
        this.distance = distance;
    }

    public Geo getGeo(){
        return geo;
    }

    public void setGeo(Geo geo){
        this.geo = geo;
    }

    @Override
    public String toString(){
        return "GeoRadius{" + "member=" + Arrays.toString(member) + ", distance=" + distance + ", geo=" + geo + '}';
    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';
var util = require('util');
var path = require('path');
var yeoman = require('yeoman-generator');

var SpaGenerator = module.exports = function SpaGenerator(args, options, config) {
  yeoman.generators.Base.apply(this, arguments);

  this.on('end', function () {
    this.installDependencies({ skipInstall: options['skip-install'] });
  });

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};

util.inherits(SpaGenerator, yeoman.generators.Base);

SpaGenerator.prototype.askFor = function() {
  var cb = this.async();

  // have Yeoman greet the user.
  console.log(this.yeoman);

  // Define question that should be asked on project init
  var prompts = [
    {
      name: 'appName'
      ,message: 'What is the name of your app?'
    }
    ,{
      name: 'authorName'
      ,message: 'Please state your name:'
    }
    ,{
      name: 'authorEmail'
      ,message: 'Please state your email'
    }
  ];

  this.prompt(prompts, function (props) {
    // Bind property names
    this.authorName = props.authorName;
    this.authorEmail = props.authorEmail;
    this.appName = props.appName;

    // Run callback function, which lets yeoman to move on
    cb();
  }.bind(this));
};

SpaGenerator.prototype.skeleton = function() {
  // Create root directory for the app
  this.mkdir('app');
    this.mkdir('app/scripts');
    this.mkdir('app/styles');
    this.mkdir('app/images');
    this.mkdir('app/vendors');
    this.template('app/_index.html', 'app/_index.html');
  // Target directory with packages ready for distribution
  this.mkdir('dist');
  // Phonegap configuration root
  this.mkdir('phonegap');
  // Phonegap development root
  this.mkdir('build');
};

// Generate scripts for our app
SpaGenerator.prototype.scripts = function() {
  this.mkdir('app/scripts/config');
    // Configure internal dependency management with RequireJS
    this.template('app/scripts/config/main.js', 'app/scripts/config/main.js');
    // Configure environment (local/uat/production) dependent settings
    this.template('app/scripts/config/env.js', 'app/scripts/config/env.js');

  this.mkdir('app/scripts/modules');
  this.mkdir('app/scripts/pages');
    this.template('app/scripts/pages/index.js', 'app/scripts/pages/index.js');

  this.mkdir('app/scripts/prototypes');
    this.copy('app/scripts/prototypes/module.composer.js', 'app/scripts/prototypes/module.composer.js');
    this.copy('app/scripts/prototypes/page.composer.js', 'app/scripts/prototypes/page.composer.js');
    this.copy('app/scripts/prototypes/page.router.js', 'app/scripts/prototypes/page.router.js');

  this.mkdir('app/scripts/helpers');
    // Add commonly used methods and functions, that should be available throughout the app
    this.template('app/scripts/helpers/common.js', 'app/scripts/helpers/common.js');

  // Bootstrap
  this.template('app/scripts/app.js', 'app/scripts/app.js');
  // Primary router
  this.template('app/scripts/router.js', 'app/scripts/router.js');
  // Event bus
  this.template('app/scripts/events.js', 'app/scripts/events.js');
};

// Generate styles for our app
SpaGenerator.prototype.styles = function() {
  // Top layer file, which composes everything we've got
  this.copy('app/styles/package.less', 'app/styles/package.less');

  // Primary dependencies
  this.mkdir('app/styles/deps');
    // Import css reset with normalize
    this.copy('app/styles/deps/normalize.less', 'app/styles/deps/normalize.less');
    // Import fonts
    this.copy('app/styles/deps/fonts.less', 'app/styles/deps/fonts.less');
    // Set variables
    this.copy('app/styles/deps/variables.less', 'app/styles/deps/variables.less');
    // Define mixins
    this.copy('app/styles/deps/mixins.less', 'app/styles/deps/mixins.less');

  // Base layer :: general styling for HTML elements and very straightforward classes
  this.mkdir('app/styles/base');
    // Composes everything we've got within this layer
    this.copy('app/styles/base/index.less', 'app/styles/base/index.less');

  // Module's layer :: complete self-standing modules
  this.mkdir('app/styles/modules');
    // Composes everything we've got within this layer
    this.copy('app/styles/modules/index.less', 'app/styles/modules/index.less');

  // Page's layer :: page specific changes that should not effect the whole module
  this.mkdir('app/styles/pages');
    // Composes everything we've got within this layer
    this.copy('app/styles/pages/index.less', 'app/styles/pages/index.less');
};

SpaGenerator.prototype.configs = function() {
  // Configure our primary dependencies, which should be loaded with npm
  this.template('_package.json', 'package.json');
  // Configure our taskrunner (run / build / deploy)
  this.template('Gruntfile.js', 'Gruntfile.js');
  // Configure our dependency manager with a set of ..dependencies
  this.copy('bowerrc', '.bowerrc');
  this.template('_bower.json', 'bower.json');
  // User's promts recorded once the generator finished it's job
  this.template('_config.json', 'config.json');
  // Configure phonegap app
  this.copy('phonegap/config.xml', 'phonegap/config.xml');
  this.template('phonegap/config.json', 'phonegap/config.json');
};

SpaGenerator.prototype.projectfiles = function() {
  this.copy('gitignore', '.gitignore');
  this.copy('editorconfig', '.editorconfig');
  this.copy('jshintrc', '.jshintrc');
  this.template('README.md', 'README.md');
};


text:
title:  Item Similarity Engine | Built-in Engines
---

# ITEM SIMILARITY ENGINE: OVERVIEW

**People who like this may also like....**

This engine tries to suggest top **N** items that are similar to one of more targeted items. By being 'similar', it does not necessarily mean that the two items look alike, nor they share similar attributes. The definition of similarity is independently defined by each algorithm and is usually calculated by a distance function. The built-in algorithms assume that similarity between two items means the likelihood any user would like (or buy, view etc) both of them.

The engine suggests similar items through a two-step process:

## Step 1: Estimate Item Similarity

![Item Sim Score Prediction](/images/engine-itemsim-score.png)

In this batch-mode process, the engine estimates a similarity score for every item-item pair. The scores are computed by the deployed algorithm in the engine.

## Step 2: Rank Top N Items

With the similarity scores, this engine can rank all available items according to their similarity to the targeted items. Top N most similar items will then be returned.

# Collect Events Data / Events Data Requirement
The process of collecting events data for the Item Similarity Engine is
equivalent to that of Item Ranking Engine. Please refer to [Item Ranking Engine
/ Collect Events Data](/engines/itemrank) for detailed explanation.

# Data Source
Same as [Item Ranking Engine / Data Source](/engines/itemrank).

# Data Preparator
Same as [Item Ranking Engine / Data Preparator](/engines/itemrank).

# Item Similarity Engine API

Item Similarity Engine supports the following API endpoints:

## Sending Queries to Item Similarity Engine

To suggest top N items that are most similar to one or more targeted items, make an HTTP POST request to the Item Similarity Engine instance:

**POST** `<engine_instance_url>/queries.json`

with following JSON payload:

Field | Description
------ | :---------
`iids` | Array of item entity IDs.
`n` | maximum number of items recommended

> *Note*
>
>If multiple item IDs are specified (For example: `"iids": ["item0", "item1", "item2"]`, all the specified items will be taken into account when return the top N similar items. One typical usage is that you could keep track a list of recent viewed items of the user and then use this list of recently viewed items to recommend items to the user. This could also be used to provide recommendation to anonymous users as soon as they have viewed a few items.

#### Sample Query

To get top 5 items which are similar to items "12", "1", "19":

```bash
$ curl -X POST http://localhost:9997/queries.json \
-d '{"iids": ["12", "1", "19"], "n": 5}'
```

```php
<?php
use predictionio\EngineClient;

$engineClient = new EngineClient('http://localhost:9997');
$predictions = $engineClient->sendQuery(
                      array(
                        'iids'=>array('12', '1', '19'),
                        'n'=>5
                      )
               );
print_r($predictions);
?>
```

```python
from predictionio import EngineClient
engine_client = EngineClient(url="http://localhost:9997")

prediction = engine_client.send_query(data={"iids": ["12", "1", "19"], "n" : 5})
print(prediction)
```

```ruby
require 'predictionio'

client = PredictionIO::EngineClient.new('http://localhost:9997')

predictions = client.send_query('iids' => %w(12 1 19), 'n' => 5)
puts predictions
```

```java
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.apache.predictionio.EngineClient;

EngineClient engineClient = new EngineClient("http://localhost:9997");
engineClient.sendQuery(ImmutableMap.<String, Object>of(
        "iids", ImmutableList.of("12", "1", "19"),
        "n", 5));
```

The API returns the following JSON response:

Field | Description
:---- | :----------
`items` | array of { item Entity ID : predicted preference score }
        | in descending order.

#### Sample Response

```json
{"items":[{"17":0.8666961789131165},{"41":0.793708860874176},{"42":0.7885419726371765},{"36":0.7584964036941528},{"2":0.7584964036941528}]}
```

# Algorithms

## Changing Algorithm and Its Parameters

By default, **Non-cached Mahout Item Based Algorithm** (`"ncMahoutItemBased"`)
is used. You can switch to another algorithm or modify parameters by modifying
the file `algorithms.json` with any of above algorithm's JSON parameters
setting.

Please read [Selecting an
Algorithm](/cookbook/choosingalgorithms.html) for tips on
selecting the right algorithm and setting the parameters properly.

INFO: You may also [implement and add your own
algorithm](/cookbook/addalgorithm.html) to the engine easily.

Item Similarity Engine comes with the following algorithms:

## 1. Non-cached Mahout Item Based Algorithm

Use Mahout Item Based algorithm to calculate similarity scoree when serve
the query request. The item similarity matrix is not cached.

**Algorithm code name:** `"ncMahoutItemBased"`

**Parameters:**

Field | Type | Description
:---- | :----| :------
`booleanData` | boolean | Treat input data as having no preference values.
`itemSimilarity`| String | Item Similarity Measure. See **Note**
`weighted` | boolean | The Similarity score is weighted (only applied to Euclidean Distance, Pearson Correlation, Uncentered Cosine item similarity).
`threshold` | double | Similarity threshold. Discard item pairs with a similarity value below this.
`freshness` | integer | Freshness scale 0 - 10. Must be >= 0. 0 means no freshness.
`freshnessTimeUnit` | integer | The time unit in seconds for freshness prioritization. As an example, if you set this to one day (86400), and freshness is set to 10, items that are one day old would have their score degraded by a bit more than 60%, or e^-1 remains to be exact.

**Note:**

Supported value for `itemSimilarity`

Name | Value
:---- | :----
City Block | `CityBlockSimilarity`
Euclidean Distance | `EuclideanDistanceSimilarity`
Log-Likelihood | `LogLikelihoodSimilarity`
Pearson Correlation | `PearsonCorrelationSimilarity`
Tanimoto Coefficient | `TanimotoCoefficientSimilarity`
Uncentered Cosine | `UncenteredCosineSimilarity`

**Default algorithm parameters:**

```json
[
  {
    "name": "ncMahoutItemBased",
    "params": {
      "booleanData": true,
      "itemSimilarity": "LogLikelihoodSimilarity",
      "weighted": false,
      "threshold": 4.9E-324,
      "freshness" : 0,
      "freshnessTimeUnit" : 86400
    }
  }
]
```

# Using Custom Actions

By default, the built-in engine parameters support the following actions:
`"view"`, `"like"`, `"dislike"`, `"rate"` and `"conversion"`.
To add your own custom actions, you could simply modify the following params file:

*   `datasource.json`: Add your custom action names into the parameters
    `actions` and `u2iActions`.

*   `preparator.json`: Define how to map your custom action names to a score in
    the parameters `actions`. Use value of `null` if your action has a
    `pio_rating` property.


text:
@interface FNTopicDetailHeaderVBottomView : UIView

@property (weak, nonatomic) IBOutlet UILabel *messageL;

@property (weak, nonatomic) IBOutlet UISegmentedControl *chooseSegment;

@property (nonatomic, strong) void(^segueBlock)();

@end


text:
layout: post
title: "Jenius Engineer reading list #299"
author: "dedenf"
tags:
    - news
    - jenius

categories:
    - readinglist
    - engineer
published: true
canonical: https://jakartadev.org/daily-digest-468/
---

- [Making Instagram.com faster: Part 2](https://instagram-engineering.com/making-instagram-com-faster-part-2-f350c8fba0d4)
- [Implementing a Frontend with Micro-Components](https://itnext.io/micro-frontend-941a5f1a3e72)
- [Introducing Harmonia: Context-Aware Product Recommendation From Room Images](https://tech.wayfair.com/data-science/2019/09/introducing-harmonia-context-aware-product-recommendation-from-room-images/)
- [Achieving a tenfold increase in Varnish throughput by replacing libvmod‑curl with native request restarts](https://tech.showmax.com/2019/09/varnish-request-restarts/)


text:
stixel_world
============

This code is under development.


text:
require "erb"
require "fpm/namespace"
require "fpm/package"
require "fpm/errors"
require "fpm/util"
require "backports"
require "fileutils"
require "digest"

# Support for debian packages (.deb files)
#
# This class supports both input and output of packages.
class FPM::Package::Deb < FPM::Package

  # Map of what scripts are named.
  SCRIPT_MAP = {
    :before_install     => "preinst",
    :after_install      => "postinst",
    :before_remove      => "prerm",
    :after_remove       => "postrm",
  } unless defined?(SCRIPT_MAP)

  # The list of supported compression types. Default is gz (gzip)
  COMPRESSION_TYPES = [ "gz", "bzip2", "xz" ]

  option "--ignore-iteration-in-dependencies", :flag,
            "For '=' (equal) dependencies, allow iterations on the specified " \
            "version. Default is to be specific. This option allows the same " \
            "version of a package but any iteration is permitted"

  option "--build-depends", "DEPENDENCY",
    "Add DEPENDENCY as a Build-Depends" do |dep|
    @build_depends ||= []
    @build_depends << dep
  end

  option "--pre-depends", "DEPENDENCY",
    "Add DEPENDENCY as a Pre-Depends" do |dep|
    @pre_depends ||= []
    @pre_depends << dep
  end

  option "--compression", "COMPRESSION", "The compression type to use, must " \
    "be one of #{COMPRESSION_TYPES.join(", ")}.", :default => "gz" do |value|
    if !COMPRESSION_TYPES.include?(value)
      raise ArgumentError, "deb compression value of '#{value}' is invalid. " \
        "Must be one of #{COMPRESSION_TYPES.join(", ")}"
    end
    value
  end

  # Take care about the case when we want custom control file but still use fpm ...
  option "--custom-control", "FILEPATH",
    "Custom version of the Debian control file." do |control|
    File.expand_path(control)
  end

  # Add custom debconf config file
  option "--config", "SCRIPTPATH",
    "Add SCRIPTPATH as debconf config file." do |config|
     File.expand_path(config)
  end

  # Add custom debconf templates file
  option "--templates", "FILEPATH",
    "Add FILEPATH as debconf templates file." do |templates|
    File.expand_path(templates)
  end

  option "--installed-size", "KILOBYTES",
    "The installed size, in kilobytes. If omitted, this will be calculated " \
    "automatically" do |value|
    value.to_i
  end

  option "--priority", "PRIORITY",
    "The debian package 'priority' value.", :default => "extra"

  option "--use-file-permissions", :flag,
    "Use existing file permissions when defining ownership and modes"

  option "--user", "USER", "The owner of files in this package", :default => 'root'

  option "--group", "GROUP", "The group owner of files in this package", :default => 'root'

  option "--changelog", "FILEPATH", "Add FILEPATH as debian changelog" do |file|
    File.expand_path(file)
  end

  option "--recommends", "PACKAGE", "Add PACKAGE to Recommends" do |pkg|
    @recommends ||= []
    @recommends << pkg
    next @recommends
  end

  option "--suggests", "PACKAGE", "Add PACKAGE to Suggests" do |pkg|
    @suggests ||= []
    @suggests << pkg
    next @suggests
  end

  option "--meta-file", "FILEPATH", "Add FILEPATH to DEBIAN directory" do |file|
    @meta_files ||= []
    @meta_files << File.expand_path(file)
    next @meta_files
  end

  option "--interest", "EVENT", "Package is interested in EVENT trigger" do |event|
    @interested_triggers ||= []
    @interested_triggers << event
    next @interested_triggers
  end

  option "--activate", "EVENT", "Package activates EVENT trigger" do |event|
    @activated_triggers ||= []
    @activated_triggers << event
    next @activated_triggers
  end

  option "--field", "'FIELD: VALUE'", "Add custom field to the control file" do |fv|
    @custom_fields ||= {}
    field, value = fv.split(/: */, 2)
    @custom_fields[field] = value
    next @custom_fields
  end

  option "--shlibs", "SHLIBS", "Include control/shlibs content. This flag " \
    "expects a string that is used as the contents of the shlibs file. " \
    "See the following url for a description of this file and its format: " \
    "http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-shlibs"

  option "--init", "FILEPATH", "Add FILEPATH as an init script",
	:multivalued => true do |file|
    next File.expand_path(file)
  end

  option "--default", "FILEPATH", "Add FILEPATH as /etc/default configuration",
	:multivalued => true do |file|
    next File.expand_path(file)
  end

  option "--upstart", "FILEPATH", "Add FILEPATH as an upstart script",
	:multivalued => true do |file|
    next File.expand_path(file)
  end

  def initialize(*args)
    super(*args)
    attributes[:deb_priority] = "extra"
  end # def initialize

  private

  # Return the architecture. This will default to native if not yet set.
  # It will also try to use dpkg and 'uname -m' to figure out what the
  # native 'architecture' value should be.
  def architecture
    if @architecture.nil? or @architecture == "native"
      # Default architecture should be 'native' which we'll need to ask the
      # system about.
      if program_in_path?("dpkg")
        @architecture = %x{dpkg --print-architecture 2> /dev/null}.chomp
        if $?.exitstatus != 0 or @architecture.empty?
          # if dpkg fails or emits nothing, revert back to uname -m
          @architecture = %x{uname -m}.chomp
        end
      else
        @architecture = %x{uname -m}.chomp
      end
    end

    case @architecture
    when "x86_64"
      # Debian calls x86_64 "amd64"
      @architecture = "amd64"
    when "noarch"
      # Debian calls noarch "all"
      @architecture = "all"
    end
    return @architecture
  end # def architecture

  # Get the name of this package. See also FPM::Package#name
  #
  # This accessor actually modifies the name if it has some invalid or unwise
  # characters.
  def name
    if @name =~ /[A-Z]/
      logger.warn("Debian tools (dpkg/apt) don't do well with packages " \
        "that use capital letters in the name. In some cases it will " \
        "automatically downcase them, in others it will not. It is confusing." \
        " Best to not use any capital letters at all. I have downcased the " \
        "package name for you just to be safe.",
        :oldname => @name, :fixedname => @name.downcase)
      @name = @name.downcase
    end

    if @name.include?("_")
      logger.info("Debian package names cannot include underscores; " \
                   "automatically converting to dashes", :name => @name)
      @name = @name.gsub(/[_]/, "-")
    end

    if @name.include?(" ")
      logger.info("Debian package names cannot include spaces; " \
                   "automatically converting to dashes", :name => @name)
      @name = @name.gsub(/[ ]/, "-")
    end

    return @name
  end # def name

  def prefix
    return (attributes[:prefix] or "/")
  end # def prefix

  def input(input_path)
    extract_info(input_path)
    extract_files(input_path)
  end # def input

  def extract_info(package)
    with(build_path("control")) do |path|
      FileUtils.mkdir(path) if !File.directory?(path)
      # Unpack the control tarball
      safesystem("ar p #{package} control.tar.gz | tar -zxf - -C #{path}")

      control = File.read(File.join(path, "control"))

      parse = lambda do |field|
        value = control[/^#{field.capitalize}: .*/]
        if value.nil?
          return nil
        else
          logger.info("deb field", field => value.split(": ", 2).last)
          return value.split(": ",2).last
        end
      end

      # Parse 'epoch:version-iteration' in the version string
      version_re = /^(?:([0-9]+):)?(.+?)(?:-(.*))?$/
      m = version_re.match(parse.call("Version"))
      if !m
        raise "Unsupported version string '#{parse.call("Version")}'"
      end
      self.epoch, self.version, self.iteration = m.captures

      self.architecture = parse.call("Architecture")
      self.category = parse.call("Section")
      self.license = parse.call("License") || self.license
      self.maintainer = parse.call("Maintainer")
      self.name = parse.call("Package")
      self.url = parse.call("Homepage")
      self.vendor = parse.call("Vendor") || self.vendor
      with(parse.call("Provides")) do |provides_str|
        next if provides_str.nil?
        self.provides = provides_str.split(/\s*,\s*/)
      end

      # The description field is a special flower, parse it that way.
      # The description is the first line as a normal Description field, but also continues
      # on future lines indented by one space, until the end of the file. Blank
      # lines are marked as ' .'
      description = control[/^Description: .*/m].split(": ", 2).last
      self.description = description.gsub(/^ /, "").gsub(/^\.$/, "")

      #self.config_files = config_files

      self.dependencies += parse_depends(parse.call("Depends")) if !attributes[:no_auto_depends?]
    end
  end # def extract_info

  # Parse a 'depends' line from a debian control file.
  #
  # The expected input 'data' should be everything after the 'Depends: ' string
  #
  # Example:
  #
  #     parse_depends("foo (>= 3), bar (= 5), baz")
  def parse_depends(data)
    return [] if data.nil? or data.empty?
    # parse dependencies. Debian dependencies come in one of two forms:
    # * name
    # * name (op version)
    # They are all on one line, separated by ", "

    dep_re = /^([^ ]+)(?: \(([>=<]+) ([^)]+)\))?$/
    return data.split(/, */).collect do |dep|
      m = dep_re.match(dep)
      if m
        name, op, version = m.captures
        # deb uses ">>" and "<<" for greater and less than respectively.
        # fpm wants just ">" and "<"
        op = "<" if op == "<<"
        op = ">" if op == ">>"
        # this is the proper form of dependency
        "#{name} #{op} #{version}"
      else
        # Assume normal form dependency, "name op version".
        dep
      end
    end
  end # def parse_depends

  def extract_files(package)
    # Find out the compression type
    compression = `ar t #{package}`.split("\n").grep(/data.tar/).first.split(".").last
    case compression
      when "gz"
        datatar = "data.tar.gz"
        compression = "-z"
      when "bzip2"
        datatar = "data.tar.bz2"
        compression = "-j"
      when "xz"
        datatar = "data.tar.xz"
        compression = "-J"
      else
        raise FPM::InvalidPackageConfiguration,
          "Unknown compression type '#{self.attributes[:deb_compression]}' "
          "in deb source package #{package}"
    end

    # unpack the data.tar.{gz,bz2,xz} from the deb package into staging_path
    safesystem("ar p #{package} #{datatar} " \
               "| tar #{compression} -xf - -C #{staging_path}")
  end # def extract_files

  def output(output_path)
    self.provides = self.provides.collect { |p| fix_provides(p) }
    output_check(output_path)
    # Abort if the target path already exists.

    # create 'debian-binary' file, required to make a valid debian package
    File.write(build_path("debian-binary"), "2.0\n")

    # If we are given --deb-shlibs but no --after-install script, we
    # should implicitly create a before/after scripts that run ldconfig
    if attributes[:deb_shlibs]
      if !script?(:after_install)
        logger.info("You gave --deb-shlibs but no --after-install, so " \
                     "I am adding an after-install script that runs " \
                     "ldconfig to update the system library cache")
        scripts[:after_install] = template("deb/ldconfig.sh.erb").result(binding)
      end
      if !script?(:after_remove)
        logger.info("You gave --deb-shlibs but no --after-remove, so " \
                     "I am adding an after-remove script that runs " \
                     "ldconfig to update the system library cache")
        scripts[:after_remove] = template("deb/ldconfig.sh.erb").result(binding)
      end
    end

    if script?(:before_upgrade) or script?(:after_upgrade)
      if script?(:before_install) or script?(:before_upgrade)
        scripts[:before_install] = template("deb/preinst_upgrade.sh.erb").result(binding)
      end
      if script?(:before_remove)
        scripts[:before_remove] = template("deb/prerm_upgrade.sh.erb").result(binding)
      end
      if script?(:after_install) or script?(:after_upgrade)
        scripts[:after_install] = template("deb/postinst_upgrade.sh.erb").result(binding)
      end
      if script?(:after_remove)
        scripts[:after_remove] = template("deb/postrm_upgrade.sh.erb").result(binding)
      end
    end

    write_control_tarball

    # Tar up the staging_path into data.tar.{compression type}
    case self.attributes[:deb_compression]
      when "gz", nil
        datatar = build_path("data.tar.gz")
        compression = "-z"
      when "bzip2"
        datatar = build_path("data.tar.bz2")
        compression = "-j"
      when "xz"
        datatar = build_path("data.tar.xz")
        compression = "-J"
      else
        raise FPM::InvalidPackageConfiguration,
          "Unknown compression type '#{self.attributes[:deb_compression]}'"
    end

    # Write the changelog file
    dest_changelog = File.join(staging_path, "usr/share/doc/#{name}/changelog.Debian.gz")
    FileUtils.mkdir_p(File.dirname(dest_changelog))
    File.new(dest_changelog, "wb", 0644).tap do |changelog|
      Zlib::GzipWriter.new(changelog, Zlib::BEST_COMPRESSION).tap do |changelog_gz|
        if attributes[:deb_changelog]
          logger.info("Writing user-specified changelog", :source => attributes[:deb_changelog])
          File.new(attributes[:deb_changelog]).tap do |fd|
            chunk = nil
            # Ruby 1.8.7 doesn't have IO#copy_stream
            changelog_gz.write(chunk) while chunk = fd.read(16384)
          end.close
        else
          logger.info("Creating boilerplate changelog file")
          changelog_gz.write(template("deb/changelog.erb").result(binding))
        end
      end.close
    end # No need to close, GzipWriter#close will close it.

    attributes.fetch(:deb_init_list, []).each do |init|
      name = File.basename(init, ".init")
      dest_init = File.join(staging_path, "etc/init.d/#{name}")
      FileUtils.mkdir_p(File.dirname(dest_init))
      FileUtils.cp init, dest_init
      File.chmod(0755, dest_init)
    end

    attributes.fetch(:deb_default_list, []).each do |default|
      name = File.basename(default, ".default")
      dest_default = File.join(staging_path, "etc/default/#{name}")
      FileUtils.mkdir_p(File.dirname(dest_default))
      FileUtils.cp default, dest_default
      File.chmod(0644, dest_default)
    end

    attributes.fetch(:deb_upstart_list, []).each do |upstart|
      name = File.basename(upstart, ".upstart")
      dest_upstart = staging_path("etc/init/#{name}.conf")
      FileUtils.mkdir_p(File.dirname(dest_upstart))
      FileUtils.cp(upstart, dest_upstart)
      File.chmod(0644, dest_upstart)

      # Install an init.d shim that calls upstart
      dest_init = staging_path("/etc/init.d/#{name}")
      FileUtils.mkdir_p(File.dirname(dest_init))
      FileUtils.ln_s("/lib/init/upstart-job", dest_init)
    end

    args = [ tar_cmd, "-C", staging_path, compression ] + data_tar_flags + [ "-cf", datatar, "." ]
    safesystem(*args)

    # pack up the .deb, which is just an 'ar' archive with 3 files
    # the 'debian-binary' file has to be first
    with(File.expand_path(output_path)) do |output_path|
      ::Dir.chdir(build_path) do
        safesystem("ar", "-qc", output_path, "debian-binary", "control.tar.gz", datatar)
      end
    end
  end # def output

  def converted_from(origin)
    self.dependencies = self.dependencies.collect do |dep|
      fix_dependency(dep)
    end.flatten
    self.provides = self.provides.collect do |provides|
      fix_provides(provides)
    end.flatten

    if origin == FPM::Package::Deb
      changelog_path = staging_path("usr/share/doc/#{name}/changelog.Debian.gz")
      if File.exists?(changelog_path)
        logger.debug("Found a deb changelog file, using it.", :path => changelog_path)
        attributes[:deb_changelog] = build_path("deb_changelog")
        File.open(attributes[:deb_changelog], "w") do |deb_changelog|
          Zlib::GzipReader.open(changelog_path) do |gz|
            IO::copy_stream(gz, deb_changelog)
          end
        end
        File.unlink(changelog_path)
      end
    end
  end # def converted_from

  def debianize_op(op)
    # Operators in debian packaging are <<, <=, =, >= and >>
    # So any operator like < or > must be replaced
    {:< => "<<", :> => ">>"}[op.to_sym] or op
  end

  def fix_dependency(dep)
    # Deb dependencies are: NAME (OP VERSION), like "zsh (> 3.0)"
    # Convert anything that looks like 'NAME OP VERSION' to this format.
    if dep =~ /[\(,\|]/
      # Don't "fix" ones that could appear well formed already.
    else
      # Convert ones that appear to be 'name op version'
      name, op, version = dep.split(/ +/)
      if !version.nil?
        # Convert strings 'foo >= bar' to 'foo (>= bar)'
        dep = "#{name} (#{debianize_op(op)} #{version})"
      end
    end

    name_re = /^[^ \(]+/
    name = dep[name_re]
    if name =~ /[A-Z]/
      logger.warn("Downcasing dependency '#{name}' because deb packages " \
                   " don't work so good with uppercase names")
      dep = dep.gsub(name_re) { |n| n.downcase }
    end

    if dep.include?("_")
      logger.warn("Replacing dependency underscores with dashes in '#{dep}' because " \
                   "debs don't like underscores")
      dep = dep.gsub("_", "-")
    end

    # Convert gem ~> X.Y.Z to '>= X.Y.Z' and << X.Y+1.0
    if dep =~ /\(~>/
      name, version = dep.gsub(/[()~>]/, "").split(/ +/)[0..1]
      nextversion = version.split(".").collect { |v| v.to_i }
      l = nextversion.length
      nextversion[l-2] += 1
      nextversion[l-1] = 0
      nextversion = nextversion.join(".")
      return ["#{name} (>= #{version})", "#{name} (<< #{nextversion})"]
    elsif (m = dep.match(/(\S+)\s+\(!= (.+)\)/))
      # Move '!=' dependency specifications into 'Breaks'
      self.attributes[:deb_breaks] ||= []
      self.attributes[:deb_breaks] << dep.gsub(/!=/,"=")
      return []
    elsif (m = dep.match(/(\S+)\s+\(= (.+)\)/)) and
        self.attributes[:deb_ignore_iteration_in_dependencies?]
      # Convert 'foo (= x)' to 'foo (>= x)' and 'foo (<< x+1)'
      # but only when flag --ignore-iteration-in-dependencies is passed.
      name, version = m[1..2]
      nextversion = version.split('.').collect { |v| v.to_i }
      nextversion[-1] += 1
      nextversion = nextversion.join(".")
      return ["#{name} (>= #{version})", "#{name} (<< #{nextversion})"]
    elsif (m = dep.match(/(\S+)\s+\(> (.+)\)/))
      # Convert 'foo (> x) to 'foo (>> x)'
      name, version = m[1..2]
      return ["#{name} (>> #{version})"]
    else
      # otherwise the dep is probably fine
      return dep.rstrip
    end
  end # def fix_dependency

  def fix_provides(provides)
    name_re = /^[^ \(]+/
    name = provides[name_re]
    if name =~ /[A-Z]/
      logger.warn("Downcasing provides '#{name}' because deb packages " \
                   " don't work so good with uppercase names")
      provides = provides.gsub(name_re) { |n| n.downcase }
    end

    if provides.include?("_")
      logger.warn("Replacing 'provides' underscores with dashes in '#{provides}' because " \
                   "debs don't like underscores")
      provides = provides.gsub("_", "-")
    end
    return provides.rstrip
  end

  def control_path(path=nil)
    @control_path ||= build_path("control")
    FileUtils.mkdir(@control_path) if !File.directory?(@control_path)

    if path.nil?
      return @control_path
    else
      return File.join(@control_path, path)
    end
  end # def control_path

  def write_control_tarball
    # Use custom Debian control file when given ...
    write_control # write the control file
    write_shlibs # write optional shlibs file
    write_scripts # write the maintainer scripts
    write_conffiles # write the conffiles
    write_debconf # write the debconf files
    write_meta_files # write additional meta files
    write_triggers # write trigger config to 'triggers' file
    write_md5sums # write the md5sums file

    # Make the control.tar.gz
    with(build_path("control.tar.gz")) do |controltar|
      logger.info("Creating", :path => controltar, :from => control_path)

      args = [ tar_cmd, "-C", control_path, "-zcf", controltar,
        "--owner=0", "--group=0", "--numeric-owner", "." ]
      safesystem(*args)
    end

    logger.debug("Removing no longer needed control dir", :path => control_path)
  ensure
    FileUtils.rm_r(control_path)
  end # def write_control_tarball

  def write_control
    # warn user if epoch is set
    logger.warn("epoch in Version is set", :epoch => self.epoch) if self.epoch

    # calculate installed-size if necessary:
    if attributes[:deb_installed_size].nil?
      logger.info("No deb_installed_size set, calculating now.")
      total = 0
      Find.find(staging_path) do |path|
        stat = File.lstat(path)
        next if stat.directory?
        total += stat.size
      end
      # Per http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Installed-Size
      #   "The disk space is given as the integer value of the estimated
      #    installed size in bytes, divided by 1024 and rounded up."
      attributes[:deb_installed_size] = total / 1024
    end

    # Write the control file
    with(control_path("control")) do |control|
      if attributes[:deb_custom_control]
        logger.debug("Using '#{attributes[:deb_custom_control]}' template for the control file")
        control_data = File.read(attributes[:deb_custom_control])
      else
        logger.debug("Using 'deb.erb' template for the control file")
        control_data = template("deb.erb").result(binding)
      end

      logger.debug("Writing control file", :path => control)
      File.write(control, control_data)
      File.chmod(0644, control)
      edit_file(control) if attributes[:edit?]
    end
  end # def write_control

  # Write out the maintainer scripts
  #
  # SCRIPT_MAP is a map from the package ':after_install' to debian
  # 'post_install' names
  def write_scripts
    SCRIPT_MAP.each do |scriptname, filename|
      next unless script?(scriptname)

      with(control_path(filename)) do |controlscript|
        logger.debug("Writing control script", :source => filename, :target => controlscript)
        File.write(controlscript, script(scriptname))
        # deb maintainer scripts are required to be executable
        File.chmod(0755, controlscript)
      end
    end
  end # def write_scripts

  def write_conffiles
    return unless config_files.any?

    # scan all conf file paths for files and add them
    allconfigs = []
    config_files.each do |path|
      # Strip leading /
      path = path[1..-1] if path[0,1] == "/"
      cfg_path = File.expand_path(path, staging_path)
      begin
        Find.find(cfg_path) do |p|
          allconfigs << p.gsub("#{staging_path}/", '') if File.file? p
        end
      rescue Errno::ENOENT => e
        raise FPM::InvalidPackageConfiguration,
          "Error trying to use '#{cfg_path}' as a config file in the package. Does it exist?"
      end
    end
    allconfigs.sort!.uniq!

    with(control_path("conffiles")) do |conffiles|
      File.open(conffiles, "w") do |out|
        # 'config_files' comes from FPM::Package and is usually set with
        # FPM::Command's --config-files flag
        allconfigs.each do |cf|
          # We need to put the leading / back. Stops lintian relative-conffile error.
          out.puts("/" + cf)
        end
      end
      File.chmod(0644, conffiles)
    end
  end # def write_conffiles

  def write_shlibs
    return unless attributes[:deb_shlibs]
    logger.info("Adding shlibs", :content => attributes[:deb_shlibs])
    File.open(control_path("shlibs"), "w") do |out|
      out.write(attributes[:deb_shlibs])
    end
  end # def write_shlibs

  def write_debconf
    if attributes[:deb_config]
      FileUtils.cp(attributes[:deb_config], control_path("config"))
      File.chmod(0755, control_path("config"))
    end

    if attributes[:deb_templates]
      FileUtils.cp(attributes[:deb_templates], control_path("templates"))
      File.chmod(0755, control_path("templates"))
    end
  end # def write_debconf

  def write_meta_files
    files = attributes[:deb_meta_files]
    return unless files
    files.each do |fn|
      dest = control_path(File.basename(fn))
      FileUtils.cp(fn, dest)
      File.chmod(0644, dest)
    end
  end

  def write_triggers
    lines = [['interest', :deb_interest],
             ['activate', :deb_activate]].map { |label, attr|
      (attributes[attr] || []).map { |e| "#{label} #{e}\n" }
    }.flatten.join('')

    if lines.size > 0
      File.open(control_path("triggers"), 'a') do |f|
        f.write "\n" if f.size > 0
        f.write lines
      end
    end
  end

  def write_md5sums
    md5_sums = {}

    Find.find(staging_path) do |path|
      if File.file?(path) && !File.symlink?(path)
        md5 = Digest::MD5.file(path).hexdigest
        md5_path = path.gsub("#{staging_path}/", "")
        md5_sums[md5_path] = md5
      end
    end

    if not md5_sums.empty?
      File.open(control_path("md5sums"), "w") do |out|
        md5_sums.each do |path, md5|
          out.puts "#{md5}  #{path}"
        end
      end
      File.chmod(0644, control_path("md5sums"))
    end
  end # def write_md5sums

  def to_s(format=nil)
    # Default format if nil
    # git_1.7.9.3-1_amd64.deb
    return super("NAME_FULLVERSION_ARCH.TYPE") if format.nil?
    return super(format)
  end # def to_s

  def data_tar_flags
    data_tar_flags = []
    if attributes[:deb_use_file_permissions?].nil?
      if !attributes[:deb_user].nil?
        if attributes[:deb_user] == 'root'
          data_tar_flags += [ "--numeric-owner", "--owner", "0" ]
        else
          data_tar_flags += [ "--owner", attributes[:deb_user] ]
        end
      end

      if !attributes[:deb_group].nil?
        if attributes[:deb_group] == 'root'
          data_tar_flags += [ "--numeric-owner", "--group", "0" ]
        else
          data_tar_flags += [ "--group", attributes[:deb_group] ]
        end
      end
    end
    return data_tar_flags
  end # def data_tar_flags

  public(:input, :output, :architecture, :name, :prefix, :converted_from, :to_s, :data_tar_flags)
end # class FPM::Target::Deb


text:
[![Build Status](https://img.shields.io/travis/deshboard/boilerplate-crondaemon.svg?style=flat-square)](https://travis-ci.org/deshboard/boilerplate-crondaemon)

## Documentation

See the [docs](docs/) directory.

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.


text:
<?php

namespace Codecasts\Auth\JWT\Auth;

use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider;
use Codecasts\Auth\JWT\Contracts\Token\Manager as TokenManager;
use Illuminate\Auth\AuthManager;

/**
 * Service provider to register the 'jwt' auth guard.
 */
class ServiceProvider extends AuthServiceProvider
{
    /**
     * Laravel auth manager that will be needed to register the guard.
     *
     * @var AuthManager
     */
    protected $authManager = null;

    /**
     * Register Guard.
     */
    public function register()
    {
        // gets the auth factory instance and register on provider attribute.
        $this->authManager = $this->app->make(AuthManager::class);

        // register auth policies.
        $this->registerPolicies();

        // define a "jwt" guard.
        $this->authManager->extend('jwt', function ($app, $name, array $config) {
            // gets a instance of the token manager
            $tokenManager = $this->getTokenManager();

            // gets a instance of the user provider
            $userProvider = $this->getUserProvider($config['provider']);

            // creates a new guard instance passing a provider and a token manager
            $guard = new Guard($app, $name, $userProvider, $tokenManager);

            // set a event dispatcher on the guard.
            $guard->setDispatcher(resolve(Dispatcher::class));

            // returns the guard instance.
            return new Guard($app, $name, $userProvider, $tokenManager);
        });
    }

    /**
     * Get's the configured user provider instance.
     *
     * @param $alias
     * @return UserProvider
     */
    protected function getUserProvider($alias)
    {
        return $this->authManager->createUserProvider($alias);
    }

    /**
     * Get's a instance of the token manager.
     *
     * @return \Codecasts\Auth\JWT\Contracts\Token\Manager
     */
    protected function getTokenManager()
    {
        return $this->app->make(TokenManager::class);
    }
}


text:
package com.getperka.flatpack.codexes;

import javax.inject.Inject;

import com.getperka.flatpack.HasUuid;
import com.getperka.flatpack.ext.DeserializationContext;
import com.getperka.flatpack.ext.EntityDescription;
import com.getperka.flatpack.ext.JsonKind;
import com.getperka.flatpack.ext.SerializationContext;
import com.getperka.flatpack.ext.Type;
import com.getperka.flatpack.ext.TypeContext;
import com.google.gson.JsonElement;

/**
 * Maps Class literals to their payload names and back.
 */
public class HasUuidClassCodex extends ValueCodex<Class<? extends HasUuid>> {
  private TypeContext typeContext;

  protected HasUuidClassCodex() {}

  @Override
  public Type describe() {
    return new Type.Builder().withJsonKind(JsonKind.STRING).build();
  }

  @Override
  public Class<? extends HasUuid> readNotNull(JsonElement element, DeserializationContext context)
      throws Exception {
    String name = element.getAsString();
    EntityDescription entityDescription = typeContext.getEntityDescription(name);
    return entityDescription == null ? null : entityDescription.getEntityType();
  }

  @Override
  public void writeNotNull(Class<? extends HasUuid> object, SerializationContext context)
      throws Exception {
    context.getWriter().value(typeContext.describe(object).getTypeName());
  }

  @Inject
  void inject(TypeContext typeContext) {
    this.typeContext = typeContext;
  }
}


text:
seo:
  title: Email Authentication
  description: Technical standards to help ISPs and other receivers validate the identity of an email sender.
  keywords: authentication, SPF, DKIM, SenderID
title: Email Authentication
weight: 0
layout: page
navigation:
  show: false
---

Email authentication refers to technical standards that help ISPs and other receivers validate the identity of an email sender. There are three authentication standards in use: [SPF]({{root_url}}/Glossary/spf.html) developed by AOL, [Sender ID]({{root_url}}/Glossary/sender_id.html) developed by Microsoft and [DKIM]({{root_url}}/Glossary/dkim.html) developed by Yahoo!.

To get more information please check out our [Email Infrastructure Guide](https://go.sendgrid.com/SendGrid-Infrastructure-Guide.html?mc=Direct&mcd=https://sendgrid.com/docs/index.html).


text:
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/include/autoprepend.php'); require_once('html2fpdf.php');
// activate Output-Buffer:
ob_start(); ?>

<title>HTML 2 (F)PDF Project</title>

FEATURES

Current version: <?php echo  HTML2FPDF_VERSION ; ?>

This script supports the following tags:

<?php //Automatically get html2fpdf tag info
$pdf = new HTML2FPDF();
$pdf->DisableTags();
$pdf->DisplayPreferences('FullScreen');
$tags = strtoupper($pdf->enabledtags);
$tags = str_replace('>','>, ',$tags);
$tags{strlen($tags)-2} = ' '; //erase last comma
$tags = htmlspecialchars($tags);
echo $tags;
?>

This script supports the following CSS properties (not perfectly or fully
supported):

width, height, border, font-family, font-size, font-style, font-weight,
text-decoration, text-align, text-transform, direction, background, color.

This script supports the following image types: jpg, png, gif.

This script is not 100% accurate! It simply helps in normal html conditions.
Works best with XHTML 1.0

This page was dinamically created using PHP ob_get_contents and HTML2FPDF
class.

Read more on FAQ on how to make this or check the 2nd page (use the
'PageDown' keyboard key)
<newpage>

<?php $metaphp = htmlspecialchars($metaphp);
$metaphp = str_replace("\n",'
',$metaphp);
echo "<?".$metaphp."?>"; ?>

<?php // Output-Buffer in variable:
$html=ob_get_contents();

// delete Output-Buffer
ob_end_clean();
$pdf->AddPage();
$pdf->WriteHTML($html);
$pdf->Output('doc.pdf','I'); ?>


text:
namespace Ivento.Dci.Examples.Djikstra.Data
{
    public struct Edge
    {
        public readonly Node From;
        public readonly Node To;

        public Edge(Node from, Node to)
        {
            To = to;
            From = from;
        }
    }
}


text:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>Grahame</Author>
  <LastAuthor>Grahame</LastAuthor>
  <Created>2012-03-19T11:23:53Z</Created>
  <Version>14.00</Version>
 </DocumentProperties>
 <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
  <AllowPNG/>
 </OfficeDocumentSettings>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>9075</WindowHeight>
  <WindowWidth>25335</WindowWidth>
  <WindowTopX>2790</WindowTopX>
  <WindowTopY>3195</WindowTopY>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>

 </Styles>
 <Worksheet ss:Name="Data Elements">

   <Column ss:StyleID="s64" ss:AutoFitWidth="0" ss:Width="79.5"/>
   <Column ss:StyleID="s63" ss:AutoFitWidth="0" ss:Width="33" ss:Span="1"/>
   <Column ss:Index="4" ss:StyleID="s63" ss:AutoFitWidth="0" ss:Width="36"/>
   <Column ss:StyleID="s63" ss:AutoFitWidth="0" ss:Width="57"/>
   <Column ss:StyleID="s63" ss:AutoFitWidth="0" ss:Width="77.25"/>
   <Column ss:StyleID="s63" ss:AutoFitWidth="0" ss:Width="213.75" ss:Span="1"/>
   <Column ss:Index="9" ss:StyleID="s63" ss:AutoFitWidth="0" ss:Width="161.25"
    ss:Span="1"/>
   <Column ss:Index="11" ss:StyleID="s63" ss:AutoFitWidth="0" ss:Width="135"
    ss:Span="2"/>
   <Row ss:AutoFitHeight="0" ss:Height="30" ss:StyleID="s65">
    <Cell><Data ss:Type="String">Element</Data></Cell>
    <Cell><Data ss:Type="String">Card.</Data></Cell>
    <Cell><Data ss:Type="String">Inv.</Data></Cell>
    <Cell><Data ss:Type="String">Is Modifier</Data></Cell>
    <Cell><Data ss:Type="String">Type</Data></Cell>
    <Cell><Data ss:Type="String">Binding</Data></Cell>
    <Cell><Data ss:Type="String">Short Name</Data></Cell>
    <Cell><Data ss:Type="String">Definition</Data></Cell>
    <Cell><Data ss:Type="String">Requirements</Data></Cell>
    <Cell><Data ss:Type="String">Comments</Data></Cell>
    <Cell><Data ss:Type="String">RIM Mapping</Data></Cell>
    <Cell><Data ss:Type="String">v2 Mapping</Data></Cell>
    <Cell><Data ss:Type="String">ServD Mapping</Data></Cell>
    <Cell><Data ss:Type="String">To Do</Data></Cell>
    <Cell><Data ss:Type="String">Committee Notes</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="45">
    <Cell><Data ss:Type="String">Contact</Data></Cell>
    <Cell ss:StyleID="s66"/>
    <Cell ss:StyleID="s66"/>
    <Cell ss:StyleID="s66"/>
    <Cell><Data ss:Type="String">Structure</Data></Cell>
    <Cell ss:Index="7"><Data ss:Type="String">Technology mediated contact details (phone, fax, email, etc)</Data></Cell>
    <Cell><Data ss:Type="String">All kinds of technology mediated contact details for a person or organization, including telephone, email, etc.</Data></Cell>
    <Cell><Data ss:Type="String">Need to track phone, fax, mobile, sms numbers, email addresses, twitter tags, etc.</Data></Cell>
    <Cell ss:Index="11"><Data ss:Type="String">TEL</Data></Cell>
    <Cell><Data ss:Type="String">XTN</Data></Cell>
    <Cell><Data ss:Type="String">ContactPoint</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="42.75">
    <Cell><Data ss:Type="String">Contact.system</Data></Cell>
    <Cell><Data ss:Type="String">0..1</Data></Cell>
    <Cell><Data ss:Type="Number">2</Data></Cell>
    <Cell ss:Index="5"><Data ss:Type="String">code</Data></Cell>
    <Cell><Data ss:Type="String">ContactSystem</Data></Cell>
    <Cell><Data ss:Type="String">phone | fax | email | url</Data></Cell>
    <Cell><Data ss:Type="String">Telecommunications form for contact - what communications system is required to make use of the contact</Data></Cell>
    <Cell ss:Index="11"><Data ss:Type="String">./scheme</Data></Cell>
    <Cell><Data ss:Type="String">XTN.3</Data></Cell>
    <Cell><Data ss:Type="String">./ContactPointType</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="75">
    <Cell><Data ss:Type="String">Contact.value</Data></Cell>
    <Cell><Data ss:Type="String">0..1</Data></Cell>
    <Cell ss:Index="5"><Data ss:Type="String">string</Data></Cell>
    <Cell ss:Index="7"><Data ss:Type="String">The actual contact details</Data></Cell>
    <Cell><Data ss:Type="String">The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).</Data></Cell>
    <Cell><Data ss:Type="String">Need to support legacy numbers that are not in a tightly controlled format </Data></Cell>
    <Cell><Data ss:Type="String">Additional out of band data such as extensions, or notes about use of the contact are sometimes included in the value</Data></Cell>
    <Cell><Data ss:Type="String">./url</Data></Cell>
    <Cell><Data ss:Type="String">XTN.1 (or XTN.12)</Data></Cell>
    <Cell><Data ss:Type="String">./Value</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="60">
    <Cell><Data ss:Type="String">Contact.use</Data></Cell>
    <Cell><Data ss:Type="String">0..1</Data></Cell>
    <Cell ss:Index="4"><Data ss:Type="String">Y</Data></Cell>
    <Cell><Data ss:Type="String">code</Data></Cell>
    <Cell><Data ss:Type="String">ContactUse</Data></Cell>
    <Cell><Data ss:Type="String">home | work | temp | old | mobile - purpose of this address</Data></Cell>
    <Cell><Data ss:Type="String">Identifies the purpose for the address</Data></Cell>
    <Cell><Data ss:Type="String">Need to track the way a person uses this contact, so a user can choose which is appropriate for their purpose</Data></Cell>
    <Cell><Data ss:Type="String">This is labeled as "Is Modifier" because applications should not mistake a temporary or old contact etc for a current/permanent one. Applications can assume that a contact is current unless it explicitly says that it is temporary or old</Data></Cell>
    <Cell><Data ss:Type="String">unique(./use)</Data></Cell>
    <Cell><Data ss:Type="String">XTN.2 - but often indicated by field</Data></Cell>
    <Cell><Data ss:Type="String">./ContactPointPurpose</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="45">
    <Cell><Data ss:Type="String">Contact.period</Data></Cell>
    <Cell><Data ss:Type="String">0..1</Data></Cell>
    <Cell ss:Index="5"><Data ss:Type="String">Period</Data></Cell>
    <Cell ss:Index="7"><Data ss:Type="String">Time period when the contact was/is in use</Data></Cell>
    <Cell><Data ss:Type="String">Time period when the contact was/is in use</Data></Cell>
    <Cell ss:Index="11"><Data ss:Type="String">./useablePeriod[type="IVL<TS>"]</Data></Cell>
    <Cell><Data ss:Type="String">N/A</Data></Cell>
    <Cell><Data ss:Type="String">./StartDate and ./EndDate</Data></Cell>
   </Row>

  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>

    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Unsynced/>
   <Selected/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>4</ActiveRow>
     <ActiveCol>9</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
 <Worksheet ss:Name="Invariants">

   <Column ss:StyleID="s67" ss:AutoFitWidth="0" ss:Width="33.75"/>
   <Column ss:StyleID="s67" ss:AutoFitWidth="0" ss:Width="136.5" ss:Span="1"/>
   <Row ss:AutoFitHeight="0" ss:StyleID="s65">
    <Cell><Data ss:Type="String">Id</Data></Cell>
    <Cell><Data ss:Type="String">Name</Data></Cell>
    <Cell><Data ss:Type="String">Context</Data></Cell>
    <Cell><Data ss:Type="String">English</Data></Cell>
    <Cell><Data ss:Type="String">OCL</Data></Cell>
    <Cell><Data ss:Type="String">XPath</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell><Data ss:Type="Number">2</Data></Cell>
    <Cell><Data ss:Type="String">System is required</Data></Cell>
    <Cell><Data ss:Type="String">Contact</Data></Cell>
    <Cell ss:StyleID="s68"><ss:Data ss:Type="String"
      xmlns="http://www.w3.org/TR/REC-html40">A system is required if a value is provided.</ss:Data></Cell>
    <Cell><Data ss:Type="String">value.oclIsDefined implies system.oclIsDefined</Data></Cell>
    <Cell><Data ss:Type="String">not(exists(f:value)) or exists(f:system)</Data></Cell>
   </Row>

  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>

    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Unsynced/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>1</ActiveRow>
     <RangeSelection>R2</RangeSelection>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
 <Worksheet ss:Name="Bindings">

   <Column ss:AutoFitWidth="0" ss:Width="97.5"/>
   <Column ss:AutoFitWidth="0" ss:Width="164.25"/>
   <Column ss:AutoFitWidth="0" ss:Width="54.75"/>
   <Column ss:AutoFitWidth="0" ss:Width="135.75"/>
   <Column ss:AutoFitWidth="0" ss:Width="242.25"/>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s65"><Data ss:Type="String">Binding Name</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">Definition</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">Binding</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">Reference</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">Description</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">v2</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">v3</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s69"><Data ss:Type="String">ContactSystem</Data></Cell>
    <Cell ss:StyleID="s69"><Data ss:Type="String">Telecommunications form for contact</Data></Cell>
    <Cell ss:StyleID="s69"><Data ss:Type="String">code list</Data></Cell>
    <Cell ss:StyleID="s69"><Data ss:Type="String">#contact-system</Data></Cell>
    <Cell ss:Index="6" ss:StyleID="s70"><Data ss:Type="String">http://hl7.org/fhir/v2/vs/0202</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s69"><Data ss:Type="String">ContactUse</Data></Cell>
    <Cell ss:StyleID="s71"><Data ss:Type="String">Location, type or status of telecommunications address indicating use</Data></Cell>
    <Cell ss:StyleID="s69"><Data ss:Type="String">code list</Data></Cell>
    <Cell ss:StyleID="s69"><Data ss:Type="String">#contact-use</Data></Cell>
    <Cell ss:Index="6"><Data ss:Type="String">http://hl7.org/fhir/v2/vs/0201</Data></Cell>
    <Cell ss:StyleID="s70"><Data ss:Type="String">http://hl7.org/fhir/v3/vs/AddressUse</Data></Cell>
   </Row>

  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>

    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Unsynced/>
   <Print>
    <ValidPrinterInfo/>
    <PaperSizeIndex>9</PaperSizeIndex>
    <HorizontalResolution>300</HorizontalResolution>
    <VerticalResolution>300</VerticalResolution>
   </Print>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>4</ActiveRow>
     <ActiveCol>6</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
 <Worksheet ss:Name="contact-use">

   <Column ss:Index="2" ss:StyleID="s72" ss:AutoFitWidth="0" ss:Width="86.25"/>
   <Column ss:StyleID="s72" ss:AutoFitWidth="0" ss:Width="511.5"/>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s65"><Data ss:Type="String">Id</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">Code</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">Definition</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">v2</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">v3</Data></Cell>
    <Cell ss:StyleID="s65"/>
    <Cell ss:StyleID="s65"/>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="45">
    <Cell><Data ss:Type="Number">1</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">home</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">A communication contact at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available.</Data></Cell>
    <Cell><Data ss:Type="String" x:Ticked="1">>0201.PRN,>0201.ORN,>0201.VHN</Data></Cell>
    <Cell><Data ss:Type="String" x:Ticked="1">=AddressUse.H</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell><Data ss:Type="Number">2</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">work</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">An office contact. First choice for business related contacts during business hours.</Data></Cell>
    <Cell><Data ss:Type="String">~0201.WPN</Data></Cell>
    <Cell><Data ss:Type="String" x:Ticked="1">=AddressUse.WP</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell><Data ss:Type="Number">3</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">temp</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">A temporary contact. The period can provide more detailed information.</Data></Cell>
    <Cell ss:Index="5"><Data ss:Type="String" x:Ticked="1">=AddressUse.TMP</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell><Data ss:Type="Number">4</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">old</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">This contact is no longer in use (or was never correct, but retained for records)</Data></Cell>
    <Cell ss:Index="5"><Data ss:Type="String" x:Ticked="1">>AddressUse.OLD,>AddressUse.BAD</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="30">
    <Cell><Data ss:Type="Number">5</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">mobile</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business</Data></Cell>
    <Cell><Data ss:Type="String">~0201.PRS</Data></Cell>
    <Cell><Data ss:Type="String" x:Ticked="1">=AddressUse.MC</Data></Cell>
   </Row>

  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>

    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Unsynced/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>1</ActiveRow>
     <ActiveCol>1</ActiveCol>
     <RangeSelection>R2C2:R6C2</RangeSelection>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
 <Worksheet ss:Name="contact-system">

   <Column ss:Index="3" ss:StyleID="s72" ss:AutoFitWidth="0" ss:Width="491.25"/>
   <Row ss:AutoFitHeight="0">
    <Cell><Data ss:Type="String">Id</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">Code</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">Definition</Data></Cell>
    <Cell ss:StyleID="s65"><Data ss:Type="String">v2</Data></Cell>
    <Cell ss:StyleID="s65"/>
    <Cell ss:StyleID="s65"/>
    <Cell ss:StyleID="s65"/>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="30">
    <Cell><Data ss:Type="Number">1</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">phone</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required.</Data></Cell>
    <Cell><Data ss:Type="String">~0202.PH</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="30">
    <Cell><Data ss:Type="Number">2</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">fax</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required.</Data></Cell>
    <Cell><Data ss:Type="String">~0202.FX</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell><Data ss:Type="Number">3</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">email</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">The value is an email address</Data></Cell>
    <Cell><Data ss:Type="String" x:Ticked="1"><0202.Internet (use mailto: protocol)</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0" ss:Height="30">
    <Cell><Data ss:Type="Number">4</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">url</Data></Cell>
    <Cell ss:StyleID="s74"><Data ss:Type="String">The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses</Data></Cell>
    <Cell><Data ss:Type="String"><0202.Internet</Data></Cell>
   </Row>

  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>

    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Unsynced/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>1</ActiveRow>
     <ActiveCol>1</ActiveCol>
     <RangeSelection>R2C2:R5C2</RangeSelection>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
</Workbook>


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace IISExpressBootstrapper
{
    internal sealed class ProcessRunner : IDisposable
    {
        private readonly ProcessStartInfo processStartInfo;
        private Process process;
        private readonly Action<string> output;

        public bool IsRunning => process != null && !process.HasExited;

        public int ProcessId => process == null ? -1 : process.Id;

        public static ProcessRunner Run(string exePath, string arguments = "", IDictionary<string, string> environmentVariables = null, Action<string> output = null)
        {
            var processRunner = new ProcessRunner(exePath, arguments, environmentVariables, output);
            processRunner.Start();

            return processRunner;
        }

        private ProcessRunner(string exePath, string arguments, IEnumerable<KeyValuePair<string, string>> environmentVariables, Action<string> output)
        {
            processStartInfo = new ProcessStartInfo(exePath)
            {
                Arguments = arguments,
                LoadUserProfile = false,
                UseShellExecute = false,
                RedirectStandardOutput = output != null
            };

            this.output = output ?? (_ => { });

            if (environmentVariables == null) return;

            foreach (var environmentVariable in environmentVariables)
            {
                processStartInfo.EnvironmentVariables.Add(environmentVariable.Key, environmentVariable.Value);
            }
        }

        public void Start()
        {
            process = Process.Start(processStartInfo);
            if (process != null && processStartInfo.RedirectStandardOutput)
            {
                var reader = process.StandardOutput;
                while (reader.Peek() > -1)
                {
                    var message = reader.ReadToEnd();
                    output(message);
                }
            }
        }

        public void Dispose()
        {
            if (process == null) return;

            try
            {
                if (!process.HasExited)
                    process.Kill();
            }
            catch (InvalidOperationException)
            {
                // Will throw InvalidOperationException if process has already exited.
            }
            process.Dispose();
        }
    }
}


text:
<?php
/**
 * Related Products
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     1.6.4
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

global $product, $woocommerce_loop;

if ( empty( $product ) || ! $product->exists() ) {
	return;
}

$related = $product->get_related( $posts_per_page );

if ( sizeof( $related ) == 0 ) return;

$args = apply_filters( 'woocommerce_related_products_args', array(
	'post_type'            => 'product',
	'ignore_sticky_posts'  => 1,
	'no_found_rows'        => 1,
	'posts_per_page'       => $posts_per_page,
	'orderby'              => $orderby,
	'post__in'             => $related,
	'post__not_in'         => array( $product->id )
) );

$products = new WP_Query( $args );

$woocommerce_loop['columns'] = $columns;

if ( $products->have_posts() ) : ?>

<?php _e( 'Sounds You May Also Enjoy...', 'woocommerce' ); ?>

		<?php woocommerce_product_loop_start(); ?>

			<?php while ( $products->have_posts() ) : $products->the_post(); ?>

				<?php wc_get_template_part( 'content', 'product' ); ?>

			<?php endwhile; // end of the loop. ?>

		<?php woocommerce_product_loop_end(); ?>

<?php endif;

wp_reset_postdata();


text:
Configuration

    <load-edit config="config"
               user-input="model.newInstanceSpec"
               key="user_data">
    </load-edit>

          Disk Partition

        <select class="form-control"
                id="launch-instance-disk-partition"
                ng-model="model.newInstanceSpec.disk_config"
                ng-options="option.value as option.text for option in config.diskConfigOptions">
        </select>

          <input type="checkbox"
                 ng-model="model.newInstanceSpec.config_drive">
          Configuration Drive


text:
using System;
using System.Text;
using System.Collections.Generic;
using Antlr4.Runtime;
using Antlr4.Runtime.Tree;
using SDB.grammar;
using SDB;

namespace SDB_Script
{
    public class Program
    {
        public static string ReadInput()
        {
            var text = new StringBuilder();
            while (true)
            {
                Console.Write(">> ");
                var t = Console.ReadLine();
                if (t.Trim() != "<EOF>")
                    text.Append(t.Trim()).Append("\n");
                else
                    break;
            }
            return text.ToString();
        }
        public static void ParseFromPath(string path)
        {
            AntlrInputStream ais = new AntlrFileStream(path);
            parseInputStream(ais);
        }
        public static void ParseText(string text)
        {
            AntlrInputStream ais = new AntlrInputStream(text);
            parseInputStream(ais);
        }
        static void parseInputStream(AntlrInputStream ais)
        {
            SDBLexer lex = new SDBLexer(ais);
            ITokenStream toks = new CommonTokenStream(lex);
            SDBParser parse = new SDBParser(toks);
            IParseTree tree = parse.prog();
            new ImpVisitor().Visit(tree);
        }
    }
    class ImpVisitor : SDBBaseVisitor<object>
    {
        // Designed for rollback changes
        public readonly LinkedList<SDBStorage> storageList = new LinkedList<SDBStorage>();
        private SDBStorage storage = null; // Intermidiate storage
        public override object VisitType_null(SDBParser.Type_nullContext context)
        {
            return null;
        }
        public override object VisitType_text(SDBParser.Type_textContext context)
        {
            return parseStr(context.GetText());
        }
        public override object VisitType_cid(SDBParser.Type_cidContext context)
        {
            return context.GetText();
        }
        public override object VisitType_float(SDBParser.Type_floatContext context)
        {
            return float.Parse(context.GetText());
        }
        public override object VisitType_int(SDBParser.Type_intContext context)
        {
            return int.Parse(context.GetText());
        }
        public override object VisitInstr(SDBParser.InstrContext context)
        {
            var obj = base.VisitInstr(context);
            if (obj is bool)
                return (bool)obj ? 1 : 0; // 1 means pass. 0 means fail
            return obj;
        }
        public override object VisitGenTable(SDBParser.GenTableContext context)
        {
            List<SDBParams> tmp = (List<SDBParams>)Visit(context.c);
            storage = new SDBStorage(tmp.ToArray());
            return storage;
        }
        public override object VisitHash(SDBParser.HashContext context)
        {
            return (IList<SDBParams>)Visit(context.h);
        }
        public override object VisitHashDataTail(SDBParser.HashDataTailContext context)
        {
            IList<SDBParams> tmp = new List<SDBParams>();
            tmp.Add((SDBParams)Visit(context.h));
            return tmp;
        }
        public override object VisitHashDataReq(SDBParser.HashDataReqContext context)
        {
            IList<SDBParams> tmp = new List<SDBParams>();
            tmp.Add((SDBParams)Visit(context.h));
            IList<SDBParams> t = (IList<SDBParams>)Visit(context.r);
            foreach (var item in t)
            {
                tmp.Add(item);
            }
            return tmp;
        }
        public override object VisitHashSet(SDBParser.HashSetContext context)
        {
            var id = context.l.Text.Substring(1);
            var tp = context.r.Text;
            return SDBParams.Gen(id, tp);
        }
        public override object VisitDbAdd(SDBParser.DbAddContext context)
        {
            List<object> param = (List<object>)Visit(context.p);
            bool status = false;
            try
            {
                storageList.AddLast(storage.Duplicate());
                storage.AppendRow(param.ToArray());
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitDbUInput(SDBParser.DbUInputContext context)
        {
            if (context.p != null)
            {
                var prompt = parseStr(context.p.Text);
                Console.Write(prompt);
            }
            var text = Console.ReadLine();
            return text; // This instruction does not return a status code...
        }
        public override object VisitRollBackParam(SDBParser.RollBackParamContext context)
        {
            var rbTimes = 1;
            if (context.c != null)
                rbTimes = int.Parse(context.c.Text);
            bool status = false;
            try
            {
                for (int i = 1; i < rbTimes; i++)
                {
                    storageList.RemoveLast();
                }
                storage = storageList.Last.Value.Duplicate();
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitDbRollBack(SDBParser.DbRollBackContext context)
        {
            return base.VisitDbRollBack(context);
        }
        public override object VisitDbShow(SDBParser.DbShowContext context)
        {
            bool status = false;
            try
            {
                if (context.p != null)
                    Console.WriteLine("\t{0}\n---------------------------------", parseStr(context.p.Text));
                storage.Display();
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitDeleteAll(SDBParser.DeleteAllContext context)
        {
            bool status = false;
            try
            {
                storageList.AddLast(storage.Duplicate());
                storage.DeleteAll();
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitDeleteByPid(SDBParser.DeleteByPidContext context)
        {
            var nums = context.GetText().Split(',');
            var pids = new List<int>();
            foreach (var num in nums)
                pids.Add(int.Parse(num));
            bool status = false;
            try
            {
                storageList.AddLast(storage.Duplicate());
                storage.DeleteRows(pids.ToArray());
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitDeleteByQuery(SDBParser.DeleteByQueryContext context)
        {
            Visit(context.d);
            // Remove current storage state from rollback once
            bool status = false;
            try
            {
                var del = storage.Duplicate();
                var rol = storageList.Last.Value.Duplicate();
                storageList.AddLast(del.Duplicate());
                storage = rol.MergeTable(del, SDBStorage.MERGE_RULE.XOR);
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitDeleteParam(SDBParser.DeleteParamContext context)
        {
            return (bool)Visit(context.d);
        }
        public override object VisitDbDelete(SDBParser.DbDeleteContext context)
        {
            return (bool)Visit(context.d);
        }
        public override object VisitQueryParam(SDBParser.QueryParamContext context)
        {
            return (bool)Visit(context.q);
        }
        public override object VisitQueryMapTail(SDBParser.QueryMapTailContext context)
        {
            return (bool)Visit(context.q);
        }
        public override object VisitQueryMapReq(SDBParser.QueryMapReqContext context)
        {
            var qR = (bool)Visit(context.q);
            var rR = (bool)Visit(context.r);
            var op = context.o.Text;
            bool status = false;
            try
            {
                var tmp1 = storageList.Last.Value;
                storageList.RemoveLast();
                var tmp2 = storageList.Last.Value;
                storageList.AddLast(storage.Duplicate());
                storage = tmp1.MergeTable(tmp2, parseMr(op));
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitQuerySet(SDBParser.QuerySetContext context)
        {
            var name = context.l.Text.Substring(1);
            var match = Visit(context.d);
            var op = parseQr(context.q.Text);
            bool status = false;
            try
            {
                storageList.AddLast(storage.Query(name, match, op));
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitDbQuery(SDBParser.DbQueryContext context)
        {
            return (bool)Visit(context.q);
        }
        public override object VisitInsertSet(SDBParser.InsertSetContext context)
        {
            var columnName = context.l.Text.Substring(1);
            var columnData = Visit(context.r);
            var kvp = new KeyValuePair<string, object>(columnName, columnData);
            return kvp;
        }
        public override object VisitInsertParam(SDBParser.InsertParamContext context)
        {
            return (IDictionary<string, object>)Visit(context.d);
        }
        public override object VisitInsertMapTail(SDBParser.InsertMapTailContext context)
        {
            IDictionary<string, object> tmp = new Dictionary<string, object>();
            var kvp = (KeyValuePair<string, object>)Visit(context.h);
            tmp.Add(kvp);
            return tmp;
        }
        public override object VisitInsertMapReq(SDBParser.InsertMapReqContext context)
        {
            IDictionary<string, object> tmp = new Dictionary<string, object>();
            var kvp = (KeyValuePair<string, object>)Visit(context.h);
            tmp.Add(kvp);
            var req = (IDictionary<string, object>)Visit(context.r);
            foreach (var item in req)
            {
                tmp.Add(item);
            }
            return tmp;
        }
        public override object VisitDbInsert(SDBParser.DbInsertContext context)
        {
            var map = (IDictionary<string, object>)Visit(context.p);
            bool status = false;
            try
            {
                storageList.AddLast(storage.Duplicate());
                storage.SelectiveAdd(map);
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitUpdateSetOne(SDBParser.UpdateSetOneContext context)
        {
            var pid = int.Parse(context.p.Text);
            var ndt = (KeyValuePair<string, object>)Visit(context.h);
            bool status = false;
            try
            {
                storageList.AddLast(storage.Duplicate());
                storage.UpdateRow(pid, ndt.Key, ndt.Value + "");
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitUpdateSetLst(SDBParser.UpdateSetLstContext context)
        {
            var pid = int.Parse(context.p.Text);
            var ndt = (IDictionary<string, object>)Visit(context.h);
            bool status = false;
            try
            {
                foreach (var set in ndt)
                    storage.UpdateRow(pid, set.Key, set.Value + "");
                status = true;
            }
            catch { } // ignore...
            return status;
        }
        public override object VisitUpdateMapTail(SDBParser.UpdateMapTailContext context)
        {
            return (bool)Visit(context.h);
        }
        public override object VisitUpdateMapReq(SDBParser.UpdateMapReqContext context)
        { // Using single & instead of short circuting && to eval both sides...
            return (bool)Visit(context.h) & (bool)Visit(context.r);
        }
        public override object VisitDbUpdate(SDBParser.DbUpdateContext context)
        {
            return (bool)Visit(context.p);
        }
        public override object VisitParamList(SDBParser.ParamListContext context)
        {
            return (IList<object>)Visit(context.d);
        }
        public override object VisitDlist_tail(SDBParser.Dlist_tailContext context)
        {
            IList<object> tmp = new List<object>();
            tmp.Add(Visit(context.d));
            return tmp;
        }
        public override object VisitDlist_recu(SDBParser.Dlist_recuContext context)
        {
            IList<object> tmp = new List<object>();
            tmp.Add(Visit(context.d));
            IList<object> t = (IList<object>)Visit(context.t);
            foreach (var item in t)
            {
                tmp.Add(item);
            }
            return tmp;
        }
        private static SDBStorage.MERGE_RULE parseMr(string op)
        {
            var text = op.ToLower();
            SDBStorage.MERGE_RULE msg;
            switch (text)
            {
            case "or":
                msg = SDBStorage.MERGE_RULE.OR;
                break;
            case "xor":
                msg = SDBStorage.MERGE_RULE.XOR;
                break;
            case "and":
                msg = SDBStorage.MERGE_RULE.AND;
                break;
            default:
                throw new ArgumentException("Bad merging operator " + op);
            }
            return msg;
        }
        private static SDBStorage.QUERY_RULE parseQr(string op)
        {
            SDBStorage.QUERY_RULE msg;
            switch (op)
            {
            case "=":
                msg = SDBStorage.QUERY_RULE.EQUALS;
                break;
            case "<":
                msg = SDBStorage.QUERY_RULE.LESS;
                break;
            case ">":
                msg = SDBStorage.QUERY_RULE.MORE;
                break;
            case "<=":
                msg = SDBStorage.QUERY_RULE.L_OR_EQ;
                break;
            case ">=":
                msg = SDBStorage.QUERY_RULE.M_OR_EQ;
                break;
            case "<>":
                msg = SDBStorage.QUERY_RULE.NOT_EQU;
                break;
            case "=/":
                msg = SDBStorage.QUERY_RULE.MATCH;
                break;
            case "!/":
                msg = SDBStorage.QUERY_RULE.NO_MATCH;
                break;
            default:
                throw new ArgumentException("Bad query operator " + op);
            }
            return msg;
        }
        private static string parseStr(string text)
        {
            text = text.Substring(1, text.Length - 1);
            var msg = new StringBuilder();
            var length = text.Length;
            var charRep = text.ToCharArray();
            char prev = '\0';
            for (int i = 0; i < length; i++)
            {
                var cChar = charRep[i];
                if (prev == '\'' && cChar == '\'' && text[i - 1] != '\\')
                {
                    msg.Remove(msg.Length - 1, 1);
                    msg.Append('"');
                    prev = '\0';
                    continue;
                }
                if (prev == '\\')
                {
                    msg.Remove(msg.Length - 1, 1);
                    prev = '\0';
                    switch (cChar)
                    {
                    case 'a':
                    case 'A':
                        msg.Append("\a");
                        break;
                    case 'b':
                    case 'B':
                        msg.Append("\b");
                        break;
                    case 'f':
                    case 'F':
                        msg.Append("\f");
                        break;
                    case 'n':
                    case 'N':
                        msg.Append("\n");
                        break;
                    case 'r':
                    case 'R':
                        msg.Append("\r");
                        break;
                    case 't':
                    case 'T':
                        msg.Append("\t");
                        break;
                    case 'v':
                    case 'V':
                        msg.Append("\v");
                        break;
                    case 'z':
                    case 'Z':
                        msg.Append("\0");
                        break;
                    case '\\':
                        msg.Append("\\");
                        break;
                    case '"':
                        msg.Append("\"");
                        break;
                    case '\'':
                        msg.Append("'");
                        break;
                    default:
                        throw new FormatException("Bad escape \\" + cChar);
                    }
                    continue;
                }
                msg.Append(cChar);
                prev = cChar; // Must be last line in the loop
            }
            return msg.Remove(msg.Length - 1, 1).ToString();
        }
    }
}


text:
<?php
/**
 * Ultimate Tag Cloud Widget
 *
 * @author     Rickard Andersson <rickard@0x539.se>
 * @version    2.7.2
 * @license    GPLv2
 * @package    utcw
 * @subpackage cache
 * @since      2.4
 */
class UTCW_WPSuperCacheHandler extends UTCW_Handler
{

    /**
     * Returns true if WP Super Cache is enabled
     *
     * @return bool
     * @since 2.4
     */
    public function isEnabled()
    {
        return function_exists('add_cacheaction');
    }

    /**
     * Initializes the handler
     *
     * @since 2.4
     */
    public function init()
    {
        add_action('utcw_shortcode', array($this, 'onShortCode'));
    }

    /**
     * Called when the shortcode is used
     *
     * @since 2.4
     */
    public function onShortCode()
    {
        if (!defined('DONOTCACHEPAGE')) {
            define('DONOTCACHEPAGE', true);
        }
    }
}


text:
external help file: ACMESharp.POSH.dll-help.xml
online version:
schema: 2.0.0
---

# Get-ACMEExtensionModule

## SYNOPSIS

## SYNTAX

```
Get-ACMEExtensionModule [[-ModuleName] <String>] [[-AcmeVersion] <String>]
```

## DESCRIPTION
{{Fill in the Description}}

## EXAMPLES

### Example 1
```
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -ModuleName
Optional, the name of the PowerShell module that is an enabled ACMESharp Extension Module.
If unspecified, then all enabled Extension Modules will be returned.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AcmeVersion
An optional version spec, useful if multiple versions of the core ACMESharp module is installed,
this will specify which module installation will be targeted for inspecting for enabled modules.

The spec can be an exact version string or a \`-like\` pattern to be matched.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS


text:
require File.expand_path('../application', __FILE__)

# Initialize the Rails application.
Instajob::Application.initialize!


text:
import re
import vim
from ycm import vimsupport

SYNTAX_GROUP_REGEX = re.compile(
  r"""^
      (?P<group_name>\w+)
      \s+
      xxx
      \s+
      (?P<content>.+?)
      $""",
  re.VERBOSE )

KEYWORD_REGEX = re.compile( r'^[\w,]+$' )

SYNTAX_ARGUMENT_REGEX = re.compile(
  r"^\w+=.*$" )

SYNTAX_ARGUMENTS = set([
  'cchar',
  'conceal',
  'contained',
  'containedin',
  'nextgroup',
  'skipempty',
  'skipnl',
  'skipwhite',
  'transparent',
  'concealends',
  'contains',
  'display',
  'extend',
  'fold',
  'oneline',
  'keepend',
  'excludenl',
])

# These are the parent groups from which we want to extract keywords
ROOT_GROUPS = set([
  'Statement',
  'Boolean',
  'Include',
  'Type',
])

class SyntaxGroup( object ):
  def __init__( self, name, lines = None ):
    self.name     = name
    self.lines    = lines if lines else []
    self.children = []

def SyntaxKeywordsForCurrentBuffer():
  vim.command( 'redir => b:ycm_syntax' )
  vim.command( 'silent! syntax list' )
  vim.command( 'redir END' )
  syntax_output = vimsupport.GetVariableValue( 'b:ycm_syntax' )
  return _KeywordsFromSyntaxListOutput( syntax_output )

def _KeywordsFromSyntaxListOutput( syntax_output ):
  group_name_to_group = _SyntaxGroupsFromOutput( syntax_output )
  _ConnectGroupChildren( group_name_to_group )

  groups_with_keywords = []
  for root_group in ROOT_GROUPS:
    groups_with_keywords.extend(
      _GetAllDescendentats( group_name_to_group[ root_group ] ) )

  keywords = []
  for group in groups_with_keywords:
    keywords.extend( _ExtractKeywordsFromGroup( group ) )
  return set( keywords )

def _SyntaxGroupsFromOutput( syntax_output ):
  group_name_to_group = _CreateInitialGroupMap()
  lines               = syntax_output.split( '\n' )
  looking_for_group   = True

  current_group = None
  for line in lines:
    if not line:
      continue

    match = SYNTAX_GROUP_REGEX.search( line )
    if match:
      if looking_for_group:
        looking_for_group = False
      else:
        group_name_to_group[ current_group.name ] = current_group

      current_group = SyntaxGroup( match.group( 'group_name' ),
                                   [ match.group( 'content').strip() ] )
    else:
      if looking_for_group:
        continue

      if line[ 0 ] == ' ' or line[ 0 ] == '\t':
        current_group.lines.append( line.strip() )

  if current_group:
    group_name_to_group[ current_group.name ] = current_group
  return group_name_to_group

def _CreateInitialGroupMap():
  def AddToGroupMap( name, parent ):
    new_group = SyntaxGroup( name )
    group_name_to_group[ name ] = new_group
    parent.children.append( new_group )

  statement_group = SyntaxGroup( 'Statement' )
  type_group      = SyntaxGroup( 'Type' )

  # See `:h group-name` for details on how the initial group hierarchy is built
  group_name_to_group = {
    'Statement': statement_group,
    'Type': type_group,
    'Boolean': SyntaxGroup( 'Boolean' ),
    'Include': SyntaxGroup( 'Include' )
  }

  AddToGroupMap( 'Conditional', statement_group )
  AddToGroupMap( 'Repeat'     , statement_group )
  AddToGroupMap( 'Label'      , statement_group )
  AddToGroupMap( 'Operator'   , statement_group )
  AddToGroupMap( 'Keyword'    , statement_group )
  AddToGroupMap( 'Exception'  , statement_group )

  AddToGroupMap( 'StorageClass', type_group )
  AddToGroupMap( 'Structure'   , type_group )
  AddToGroupMap( 'Typedef'     , type_group )

  return group_name_to_group

def _ConnectGroupChildren( group_name_to_group ):
  def GetParentNames( group ):
    links_to     = 'links to '
    parent_names = []
    for line in group.lines:
      if line.startswith( links_to ):
        parent_names.append( line[ len( links_to ): ] )
    return parent_names

  for group in group_name_to_group.itervalues():
    parent_names = GetParentNames( group )

    for parent_name in parent_names:
      try:
        parent_group = group_name_to_group[ parent_name ]
      except KeyError:
        continue
      parent_group.children.append( group )

def _GetAllDescendentats( root_group ):
  descendants = []
  for child in root_group.children:
    descendants.append( child )
    descendants.extend( _GetAllDescendentats( child ) )
  return descendants

def _ExtractKeywordsFromGroup( group ):
  keywords = []
  for line in group.lines:
    if line.startswith( 'links to ' ):
      continue

    words = line.split()
    if not words or words[ 0 ] in SYNTAX_ARGUMENTS:
      continue

    for word in words:
      if ( word not in SYNTAX_ARGUMENTS and
           not SYNTAX_ARGUMENT_REGEX.match( word ) and
           KEYWORD_REGEX.match( word ) ):

        if word.endswith( ',' ):
          word = word[ :-1 ]
        keywords.append( word )
  return keywords


text:
package com.intelligentsia.dowsers.entity.manager;

import java.util.Map;

import com.intelligentsia.dowsers.entity.meta.MetaEntityContext;
import com.intelligentsia.dowsers.entity.meta.MetaEntityContextProviderSupport;
import com.intelligentsia.dowsers.entity.meta.MetaEntityProvider;
import com.intelligentsia.dowsers.entity.reference.Reference;

/**
 * MetaEntityContextProviderLazyInitialization is a class used to offer a lazy
 * initialization of MetaEntityContextProvider. When extra MetaEntityStore are
 * used, the need of EntityMapper can cause a cyclic dependencies.
 *
 * @author Jerome Guibert
 */
public class MetaEntityContextProviderLazyInitialization extends MetaEntityContextProviderSupport {

	/**
	 * Build a new instance of MetaEntityContextProviderLazyInitialization.java.
	 *
	 * @param contextEntities
	 * @throws NullPointerException
	 */
	public MetaEntityContextProviderLazyInitialization(final Map<Reference, MetaEntityContext> contextEntities) throws NullPointerException {
		super(null, contextEntities);
	}

	/**
	 * @param metaEntityProvider
	 */
	void setMetaEntityProvider(final MetaEntityProvider metaEntityProvider) {
		super.metaEntityProvider = metaEntityProvider;
	}

}


text:
script_location=$(dirname $(readlink --canonicalize $0))
. ${script_location}/common_setup.sh

echo "enabling epel yum repository..."
install_from_repo epel-release

# install CernVM-FS RPM packages
echo "installing RPM packages... "
install_rpm "$CONFIG_PACKAGES"
install_rpm $LIBS_PACKAGE
install_rpm $CLIENT_PACKAGE
install_rpm $UNITTEST_PACKAGE

# setup environment
echo -n "setting up CernVM-FS environment..."
sudo sh -c "echo CVMFS_NFS_SOURCE=yes > /etc/cvmfs/default.d/90-nfs.conf"
sudo cvmfs_config setup                          || die "fail (cvmfs_config setup)"
sudo mkdir -p /var/log/cvmfs-test                || die "fail (mkdir /var/log/cvmfs-test)"
sudo chown sftnight:sftnight /var/log/cvmfs-test || die "fail (chown /var/log/cvmfs-test)"
sudo systemctl start autofs                      || die "fail (systemctl start autofs)"
sudo cvmfs_config chksetup > /dev/null           || die "fail (cvmfs_config chksetup)"
echo "done"

# install additional stuff (needed for perl testing tools)
echo "installing additional RPM packages..."
install_from_repo gcc
install_from_repo gcc-c++
install_from_repo wget

# traffic shaping
install_from_repo trickle

# For 006 kernel compile
install_from_repo openssl-devel

# Migration test needs lsb_release
echo "install lsb_release..."
install_from_repo redhat-lsb-core

# increase open file descriptor limits
echo -n "increasing ulimit -n ... "
set_nofile_limit 65536 || die "fail"
echo "done"


text:
<a href="<?= $path ?>"><?= $name ?> on <?= $watercourse ?>

<?= $tagline ?>