text:
class Light;
typedef std::shared_ptr<Light> SharedLightPtr;

enum LightType
{
  POINT_SOURCE =0,
  BALL_SOURCE=1
  //SPOT_LIGHT_SOURCE
};

struct LightParam
{
  LightParam(const LightType type, const Vec3 &color, const Vec3& center,
	     const Real radius, const Real coneAngleRadian, const Vec3 lightDirection )
    :Type(type), Color(color), Center(center), Radius(radius),
     ConeAngleRadian(coneAngleRadian), LightDirection(lightDirection)
  {}

  LightType Type;
  Vec3 Color;

  //Point
  Vec3 Center;

  //Ball
  Real Radius;
  Real ConeAngleRadian;

  //Spot Light
  Vec3 LightDirection;
};

///////////////////
//
// Interface
//
///////////////////
class Light
{
public:

  static SharedLightPtr CreateLight(const LightParam &param);

  virtual Vec3 GetColor(){}
  virtual Vec3 GetCenter(){}
  virtual Real GetRadius(){}
  virtual Vec3 GetNormalVector(const Vec3 &hitpoint){}
  virtual bool GetHitInformation(const Ray &ray, const Real tMax, const Real tMin, HitInformation* info){}
  virtual Ray GenerateRandomRay(UniformRandomGenerator01 &rand){}
};

///////////////////
//
// Point Source
//
///////////////////
class PointSource : public Light
{

private:

  Vec3 Center;
  Vec3 Color;
};

///////////////////
//
// Ball Source
//
///////////////////
class BallSource : public Light
{

public:

  BallSource(const LightParam &param);

  Vec3 GetColor();
  Vec3 GetCenter();
  Real GetRadius();
  Vec3 GetNormalVector(const Vec3 &hitpoint);
  bool GetHitInformation(const Ray &ray, const Real tMax, const Real tMin, HitInformation* info);
  Ray GenerateRandomRay(UniformRandomGenerator01 &random);

private:

  Vec3 Center;
  Real Radius;
  SharedShapePtr Shape;
};


text:
var path = require('path');
var config = require('./config');

module.exports = {
  html: '<%= config.framework %>/index.html',
  options: {
    dest: '<%= config.dist %>',
    flow: {
      steps: {
        js: ['concat', 'uglifyjs'],
        requirejs: [{
          name: 'requirejs',
          createConfig: function (context, block) {
            var file = context.inFiles[0];
            var extname = path.extname(file);
            var basename = path.basename(file, extname);
            var paths = {};
            paths[basename] = '../' + config.framework + '/' + basename;

            var generated = context.options.generated;
            generated.options = {
              baseUrl: config.app,
              out: context.outDir + '/' + block.dest,
              name: basename,
              paths: paths
            };
            return {};
          }
        }]
      },
      post: {}
    }
  }
};

redpajama_set_name: RedPajamaGithub


text:
FROM node:latest
MAINTAINER Matt Perkins <hello@mattperkins.me>

ENV HOME=/usr/src/app

# Install deps
WORKDIR $HOME
COPY . $HOME/
RUN npm config set registry http://registry.npmjs.org/ && npm install

# Run it
EXPOSE 8080


text:
<?php

/**
 * @file
 * Hooks provided by the Flag module.
 */

/**
 * @addtogroup hooks
 * @{
 */

/**
 * Define one or more flag types.
 *
 * @return
 *  An array whose keys are flag type names and whose values are properties of
 *  the flag type.
 *  Flag type names must match the content type (in the rest of Drupal: entity
 *  type) a flag type works with.
 *  Properties for flag types are as follows:
 *  - 'title': The main label of the flag type.
 *  - 'description': A longer description shown in the UI when creating a new
 *    flag.
 *  - 'handler': The name of the class implementing this flag type.
 *
 * @see flag_fetch_definition()
 */
function hook_flag_definitions() {
  return array(
    'node' => array(
      'title' => t('Nodes'),
      'description' => t("Nodes are a Drupal site's primary content."),
      'handler' => 'flag_node',
    ),
  );
}

/**
 * Alter flag type definitions provided by other modules.
 *
 * @param $definitions
 *  An array of flag definitions returned by hook_flag_definitions().
 */
function hook_flag_definitions_alter(&$definitions) {

}

/**
 * Define default flags.
 */
function hook_flag_default_flags() {

}

/**
 * Alter the definition of default flags.
 *
 * @param array &$flags
 *   An array keyed by flag machine name containing flag definitions.
 */
function hook_flag_default_flags_alter(&$flags) {
  if (!empty($flags['bookmark'])) {
    $flags['bookmark']['title'] = 'Bananana Bookmark';
  }
}

/**
 * Allow modules to alter a flag when it is initially loaded.
 *
 * @see flag_get_flags().
 */
function hook_flag_alter(&$flag) {

}

/**
 * Alter a flag's default options.
 *
 * Modules that wish to extend flags and provide additional options must declare
 * them here so that their additions to the flag admin form are saved into the
 * flag object.
 *
 * @param $options
 *  The array of default options for the flag type, with the options for the
 *  flag's link type merged in.
 * @param $flag
 *  The flag object.
 *
 * @see flag_flag::options()
 */
function hook_flag_options_alter(&$options, $flag) {

}

/**
 * Act on a flagging.
 *
 * @param $op
 *  The operation being performed: one of 'flag' or 'unflag'.
 * @param $flag
 *  The flag object.
 * @param $content_id
 *  The id of the content (aka entity) the flag is on.
 * @param $account
 *  The user account performing the action.
 * @param $fcid
 *  The id of the flagging in the {flag_content} table.
 */
function hook_flag($op, $flag, $content_id, $account, $fcid) {

}

/**
 * Allow modules to allow or deny access to flagging.
 *
 * @param $flag
 *  The flag object.
 * @param $content_id
 *  The id of the entity in question.
 * @param $action
 *  The action to test. Either 'flag' or 'unflag'.
 * @param $account
 *  The user on whose behalf to test the flagging action.
 *
 * @return
 *   Boolean TRUE if the user is allowed to flag/unflag the given content.
 *   FALSE otherwise.
 *
 * @see flag_flag:access()
 */
function hook_flag_access($flag, $content_id, $action, $account) {

}

/**
 * Allow modules to allow or deny access to flagging.
 *
 * @param $flag
 *  The flag object.
 * @param $content_ids
 *  An array of object ids to check access.
 * @param $account
 *  The user on whose behalf to test the flagging action.
 *
 * @return
 *   An array whose keys are the object IDs and values are booleans indicating
 *   access.
 *
 * @see hook_flag_access()
 * @see flag_flag:access_multiple()
 */
function hook_flag_access_multiple($flag, $content_ids, $account) {

}

/**
 * Define one or more flag link types.
 *
 * Link types defined here must be returned by this module's hook_flag_link().
 *
 * @return
 *  An array of one or more types, keyed by the machine name of the type, and
 *  where each value is a link type definition as an array with the following
 *  properties:
 *  - 'title': The human-readable name of the type.
 *  - 'description': The description of the link type.
 *  - 'options': An array of extra options for the link type.
 *  - 'uses standard js': Boolean, indicates whether the link requires Flag
 *    module's own JS file for links.
 *  - 'uses standard css': Boolean, indicates whether the link requires Flag
 *    module's own CSS file for links.
 *
 * @see flag_get_link_types()
 * @see hook_flag_link_types_alter()
 */
function hook_flag_link_types() {

}

/**
 * Alter other modules' definitions of flag link types.
 *
 * @param $link_types
 *  An array of the link types defined by all modules.
 *
 * @see flag_get_link_types()
 * @see hook_flag_link_types()
 */
function hook_flag_link_types_alter(&$link_types) {

}

/**
 * Return the link for the link types this module defines.
 *
 * The type of link to be produced is given by $flag->link_type.
 *
 * When Flag uses a link type provided by this module, it will call this
 * implementation of hook_flag_link(). This should return a single link's
 * attributes, using the same structure as hook_link(). Note that "title" is
 * provided by the Flag configuration if not specified here.
 *
 * @param $flag
 *   The full flag object for the flag link being generated.
 * @param $action
 *   The action this link should perform. Either 'flag' or 'unflag'.
 * @param $content_id
 *   The ID of the node, comment, user, or other object being flagged. The type
 *   of the object can be deduced from the flag type.
 *
 * @return
 *   An array defining properties of the link.
 *
 * @see hook_flag_link_types()
 * @see template_preprocess_flag()
 */
function hook_flag_link() {

}

/**
 * Act on flag deletion.
 *
 * This is invoked after all the flag database tables have had their relevant
 * entries deleted.
 *
 * @param $flag
 *  The flag object that has been deleted.
 */
function hook_flag_delete($flag) {

}

/**
 * Act when a flag is reset.
 *
 * @param $flag
 *  The flag object.
 * @param $entity_id
 *  The entity ID on which all flaggings are to be removed. May be NULL, in
 *  which case all of this flag's entities are to be unflagged.
 * @param $rows
 *  Database rows from the {flagging} table.
 *
 * @see flag_reset_flag()
 */
function hook_flag_reset($flag, $entity_id, $rows) {

}

/**
 * Alter the javascript structure that describes the flag operation.
 *
 * @param $flag
 *   The full flag object.
 * @param $content_id
 *   The ID of the node, comment, user or other object being flagged.
 *
 * @see flag_build_javascript_info()
 */
function hook_flag_javascript_info_alter() {

}

/**
 * Alter a flag object that is being prepared for exporting.
 *
 * @param $flag
 *  The flag object.
 *
 * @see flag_export_flags()
 */
function hook_flag_export_alter($flag) {

}


text:
(function() {
    'use strict';

    var mod = angular.module('ods-widgets');

    mod.service('MapRenderingShapePreview', ['ODSAPI', 'MapLayerHelper', '$q', function (ODSAPI, MapLayerHelper, $q) {
        return {
            render: function (layerConfig, map, layerGroup, timeout) {
                var deferred = $q.defer();
                var parameters = angular.extend({}, layerConfig.context.parameters, {
                    'rows': 1000,
                    'clusterprecision': map.getZoom(),
                    'geofilter.bbox': ODS.GeoFilter.getBoundsAsBboxParameter(map.getBounds())
                });
                ODSAPI.records.geopreview(layerConfig.context, parameters, timeout.promise).then(function (response) {
                    if (!response || !response.data) {
                        // Cancelled requests
                        deferred.reject();
                        return;
                    }

                    var data = response.data;
                    var shape;
                    if(data.length >= parameters.rows) {
                        layerConfig._incomplete = true;
                    }
                    for (var i = 0; i < data.length; i++) {
                        shape = data[i];
                        if (shape.geometry.type === 'Point') {
                            MapLayerHelper.drawPoint(layerConfig, map, [shape.geometry.coordinates[1], shape.geometry.coordinates[0]], null, layerGroup, shape.geo_digest);
                        } else {
                            MapLayerHelper.drawShape(layerConfig, map, shape.geometry, null, layerGroup, shape.geo_digest);
                        }
                    }
                    deferred.resolve(layerGroup);
                });
                return deferred.promise;
            }
        };
    }]);
}());


text:
New Product

<?php echo render('admin/products/_form'); ?>

<?php echo Html::anchor('admin/products', 'Back'); ?>


text:
{-# LANGUAGE OverloadedStrings #-}

module Entities where

import Data.Int
import Data.Monoid
import Data.Text.Lazy (Text)
import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple.Types

-- get the list of groups
getGroups :: Connection -> IO [[Text]]
getGroups conn =
    query_ conn "select * from \"group\" order by \"group\" asc"

-- change a group's name
updateGroup :: Text -> Text -> Connection -> IO Int64
updateGroup old new conn =
    execute conn "UPDATE \"group\" \
                 \ SET \"group\" = ? \
                 \ WHERE \"group\" = ?"
                 (new, old)

-- add a new group
addGroup :: Text -> Connection -> IO Int64
addGroup gname conn =
    execute conn "INSERT INTO \"group\" \
                 \ VALUES (?)"
                 (Only gname)

-- remove a group
removeGroup :: Text -> Connection -> IO Int64
removeGroup gname conn =
    execute conn "DELETE FROM \"group\" \
                 \ WHERE \"group\" = ?"
                 (Only gname)

-- get members of a group
getMembersFor :: Text -> Connection -> IO [[Text]]
getMembersFor gname conn =
    query conn "SELECT email::text FROM group_member \
               \ WHERE \"group\" = ? \
               \ ORDER BY email ASC"
               (Only gname)

-- add a member to a group
addMemberTo :: Text -> Text -> Connection -> IO Int64
addMemberTo new groupName conn =
    execute conn "INSERT INTO group_member (\"group\", email) \
               \ VALUES (?, ?)"
               (groupName, new)

-- remove a user from a group
removeMemberOf :: Text -> Text -> Connection -> IO Int64
removeMemberOf member groupName conn =
    execute conn "DELETE FROM group_member \
                 \ WHERE \"group\" = ? AND email = ?"
                 (groupName, member)

-- update a (meta-)user's email
updateMemberOf :: Text -> Text -> Text -> Connection -> IO Int64
updateMemberOf old new groupName conn =
    execute conn "UPDATE group_member \
                 \ SET email = ? \
                 \ WHERE \"group\" = ? AND email = ?"
                 (new, groupName, old)

-- list the different domains
getDomains :: Connection -> IO [[Text]]
getDomains conn =
    query_ conn "SELECT domain \
                \ FROM domain \
                \ ORDER BY domain ASC"

-- add a domain
addDomain :: Text -> Connection -> IO Int64
addDomain d conn =
    execute conn "INSERT INTO domain (domain) \
                 \ VALUES (?)"
                 (Only d)

-- update a domain's "name"
updateDomain :: Text -> Text -> Connection -> IO Int64
updateDomain old new conn =
    execute conn "UPDATE domain \
                 \ SET domain = ? \
                 \ WHERE domain = ?"
                 (new, old)

-- remove a domain
removeDomain :: Text -> Connection -> IO Int64
removeDomain d conn =
    execute conn "DELETE FROM domain \
                 \ WHERE domain = ?"
                 (Only d)

-- get the privileges associated to a domain
getDomainPrivileges :: Text -> Connection -> IO [[Text]]
getDomainPrivileges domain conn =
    query conn "SELECT privilege \
               \ FROM privilege \
               \ WHERE domain = ? \
               \ ORDER BY privilege ASC"
               (Only domain)

-- update the name of a privilege associated to a domain
updatePrivilegeOfDomain :: Text -> Text -> Text -> Connection -> IO Int64
updatePrivilegeOfDomain old new domain conn =
    execute conn "UPDATE privilege \
                 \ SET privilege = ? \
                 \ WHERE domain = ? AND privilege = ?"
                 (new, domain, old)

-- add a privilege for the given domain
addPrivilegeToDomain :: Text -> Text -> Connection -> IO Int64
addPrivilegeToDomain new domain conn =
    execute conn "INSERT INTO privilege (domain, privilege) \
                 \ VALUES (?, ?)"
                 (domain, new)

-- remove a privilege for the given domain
removePrivilegeOfDomain :: Text -> Text -> Connection -> IO Int64
removePrivilegeOfDomain old domain conn =
    execute conn "DELETE FROM privilege \
                 \ WHERE domain = ? AND privilege = ?"
                 (domain, old)

-- list the path/method rules for a given privilege on a given domain
getRules :: Text -> Text -> Connection -> IO [(Text, Text)]
getRules domain privilege conn =
    query conn "SELECT path, method \
               \ FROM privilege_rule \
               \ WHERE domain = ? \
               \   AND privilege = ? \
               \ ORDER BY path, method ASC"
               (domain, privilege)

-- add a path/method rule for a given privilege on a given domain
addRuleToPrivilege :: Text -> Text -> Text -> Text -> Connection -> IO Int64
addRuleToPrivilege domain privilege path method conn =
    execute conn "INSERT INTO privilege_rule \
                 \   (domain, privilege, path, method) \
                 \ VALUES \
                 \   (?, ?, ?, ?)"
                 (domain, privilege, path, method)

-- delete a privilege rule
deleteRuleFromPrivilege :: Text -> Text -> Text -> Text -> Connection -> IO Int64
deleteRuleFromPrivilege domain privilege path method conn =
    execute conn "DELETE FROM privilege_rule \
                 \ WHERE domain = ? \
                 \   AND privilege = ? \
                 \   AND path = ? \
                 \   AND method = ?"
                 (domain, privilege, path, method)

-- update just the path for a given rule
updatePathFor :: Text -> Text -> Text -> Text -> Text -> Connection -> IO Int64
updatePathFor domain privilege newpath oldpath method conn =
    execute conn "UPDATE privilege_rule \
                 \ SET path = ? \
                 \ WHERE domain = ? \
                 \   AND privilege = ? \
                 \   AND path = ? \
                 \   AND method = ?"
                 (newpath, domain, privilege, oldpath, method)

-- update just the method for a given rule
updateMethodFor :: Text -> Text -> Text -> Text -> Text -> Connection -> IO Int64
updateMethodFor domain privilege newmethod oldmethod path conn =
    execute conn "UPDATE privilege_rule \
                 \ SET method = ? \
                 \ WHERE domain = ? \
                 \   AND privilege = ? \
                 \   AND path = ? \
                 \   AND method = ?"
                 (newmethod, domain, privilege, path, oldmethod)

-- get the list of privileges granted to groups for a given domain
getGroupPrivsFor :: Text -> Connection -> IO [(Text, Text)]
getGroupPrivsFor domain conn =
    query conn "SELECT \"group\", privilege \
               \ FROM group_privilege \
               \ WHERE domain = ? \
               \ ORDER BY \"group\", privilege ASC"
               (Only domain)

-- grant a privilege to a group on a domain
addGPFor :: Text -> Text -> Text -> Connection -> IO Int64
addGPFor domain gr priv conn =
    execute conn "INSERT INTO group_privilege \
                 \  (\"group\", domain, privilege) \
                 \ VALUES (?, ?, ?)"
                 (gr, domain, priv)

-- remove a privilege for a group on a domain
deleteGPOf :: Text -> Text -> Text -> Connection -> IO Int64
deleteGPOf domain gr priv conn =
    execute conn "DELETE FROM group_privilege \
                 \ WHERE domain = ? \
                 \   AND \"group\" = ? \
                 \   AND privilege = ?"
                 (domain, gr, priv)

-- | completely remove a user from the sproxy db by
--   removing it from any group it belongs to.
removeUser :: Text -> Connection -> IO Int64
removeUser email conn =
    execute conn "DELETE FROM group_member \
                 \ WHERE email = ?"
                 (Only email)

-- | Search an user. Returns a list of matching emails
searchUser :: Text -> Connection -> IO [(Text, [Text])]
searchUser searchQuery conn = fmap postprocess $
    query conn "SELECT email::text, array_agg(\"group\") \
               \ FROM group_member \
               \ WHERE email LIKE ? \
               \ GROUP BY email"
               (Only $ "%" <> searchQuery <> "%")

    where postprocess = map (\(mail, groups) -> (mail, fromPGArray groups))

renameUser :: Text -> Text -> Connection -> IO Int64
renameUser oldemail newemail conn =
  execute conn
              "UPDATE group_member \
              \ SET email = ? \
              \ WHERE email = ?"
              (newemail, oldemail)


text: This is the odd footer.


text: sbcl --eval '(require :sqnc)' --eval '(use-package :sqnc)' 2> sqnc-errors.txt


text:
module.exports = function( grunt ) {

	"use strict";

	var fs = require( "fs" ),
		distDir = "dist",
		distpaths = [
			"dist/mjp.js",
			"dist/mjp.min.map",
			"dist/mjp.min.js"
		];

	// Process files for distribution
	grunt.registerTask( "dist", function() {
		var stored=distDir, flags, paths, nonascii;

		// Allow command line input as well
		flags = Object.keys( this.flags );

		// Combine all output target paths
		paths = [].concat( stored, flags ).filter(function( path ) {
			return path !== "*";
		});

		// Ensure the dist files are pure ASCII
		nonascii = false;

		distpaths.forEach(function( filename ) {
			var i, c,
				text = fs.readFileSync( filename, "utf8" );

			// Ensure files use only \n for line endings, not \r\n
			if ( /\x0d\x0a/.test( text ) ) {
				grunt.log.writeln( filename + ": Incorrect line endings (\\r\\n)" );
				nonascii = true;
			}

			// Ensure only ASCII chars so script tags don't need a charset attribute
			if ( text.length !== Buffer.byteLength( text, "utf8" ) ) {
				grunt.log.writeln( filename + ": Non-ASCII characters detected:" );
				for ( i = 0; i < text.length; i++ ) {
					c = text.charCodeAt( i );
					if ( c > 127 ) {
						grunt.log.writeln( "- position " + i + ": " + c );
						grunt.log.writeln( "-- " + text.substring( i - 20, i + 20 ) );
						break;
					}
				}
				nonascii = true;
			}

			// Modify map/min so that it points to files in the same folder;
			// see https://github.com/mishoo/UglifyJS2/issues/47
			if ( /\.map$/.test( filename ) ) {
				text = text.replace( /"dist\//g, "\"" );
				fs.writeFileSync( filename, text, "utf-8" );
			}

			// Optionally copy dist files to other locations
			paths.forEach(function( path ) {
				var created;

				if ( !/\/$/.test( path ) ) {
					path += "/";
				}

				created = path + filename.replace( "dist/", "" );
				grunt.file.write( created, text );
				grunt.log.writeln( "File '" + created + "' created." );
			});
		});

		return !nonascii;
	});
};


text:
package info.ephyra.answerselection.filters;

import info.ephyra.io.MsgPrinter;
import info.ephyra.nlp.NETagger;
import info.ephyra.nlp.OpenNLP;
import info.ephyra.search.Result;
import info.ephyra.util.RegexConverter;
import info.ephyra.util.StringUtils;

import java.util.ArrayList;
import java.util.Hashtable;

/**
 *
The AnswerProjectionFilter projects answers from the Web onto
 * a corpus.

 *
 *
This class extends the class Filter.

 *
 * @author Nico Schlaefer
 * @version 2007-07-24
 */
public class AnswerProjectionFilter extends Filter {
	/**
	 * Answer extraction techniques in the order of their preference for answer
	 * projection.
	 */
	private static final String[] EXTRACTION_TECHNIQUES = {
		FactoidsFromPredicatesFilter.ID,
		AnswerPatternFilter.ID,
		AnswerTypeFilter.ID
	};

	/** Results retrieved from the corpus. */
	private Result[] resultsCorp;

	/**
	 * Creates the filter and sets the results retrieved from the corpus.
	 *
	 * @param resultsCorp results retrieved from the corpus
	 */
	public AnswerProjectionFilter(Result[] resultsCorp) {
		this.resultsCorp = resultsCorp;
	}

	/**
	 * Checks if the answer extraction techniques used to extract the first
	 * result have a higher preference for answer projection than the techniques
	 * used for the second result.
	 *
	 * @param result1 first result
	 * @param result2 second result
	 * @return true iff the techniques used for the first result
	 *         have a higher preference
	 */
	private boolean hasHigherPreference(Result result1, Result result2) {
		for (String extractionTechnique : EXTRACTION_TECHNIQUES) {
			if (result2.extractedWith(extractionTechnique)) return false;
			if (result1.extractedWith(extractionTechnique)) return true;
		}
		return false;
	}

	/**
	 * Projects Web answers onto the corpus.
	 *
	 * @param results array of Result objects from the Web
	 * @return array of Result objects from the corpus
	 */
	public Result[] apply(Result[] results) {
		// split corpus results into factoid answers and raw results
		Hashtable<String, Result> factoids = new Hashtable<String, Result>();
		Hashtable<String, Result> sentences = new Hashtable<String, Result>();
		ArrayList<String> normSentences = new ArrayList<String>();
		Filter sorter = new HitPositionSorterFilter();
		resultsCorp = sorter.apply(resultsCorp);  // sort by hit position
		for (Result resultCorp : resultsCorp) {
			if (resultCorp.getScore() > 0) {
				// factoid answer
				String norm = StringUtils.normalize(resultCorp.getAnswer());
				Result factoid = factoids.get(norm);
				if (factoid != null) {
					if (hasHigherPreference(resultCorp, factoid)) {
						factoids.put(norm, resultCorp);
						String[] neTypes = factoid.getNeTypes();
						if (neTypes != null)
							for (String neType : neTypes)
								resultCorp.addNeType(neType);
					} else {
						String[] neTypes = resultCorp.getNeTypes();
						if (neTypes != null)
							for (String neType : neTypes)
								factoid.addNeType(neType);
					}
				} else {
					factoids.put(norm, resultCorp);
				}
			} else {
				// raw result
				String[] sents = OpenNLP.sentDetect(resultCorp.getAnswer());
				for (String sent : sents) {  // one result for each sentence
					String norm = StringUtils.normalize(sent);
					if (!sentences.containsKey(norm)) {
						Result sentence = resultCorp.getCopy();
						sentence.setAnswer(sent);
						sentences.put(norm, sentence);
						normSentences.add(norm);
					}
				}
			}
		}

		// project web results onto corpus
		ArrayList<Result> projected = new ArrayList<Result>();
		for (Result resultWeb : results) {
			if (resultWeb.getScore() <= 0) continue;  // only project factoids
			String norm = StringUtils.normalize(resultWeb.getAnswer());

			// Answer projection rules:
			// - first try to find a matching factoid answer extracted from the
			//   corpus, only if this attempt fails browse the raw results
			// - a named entity from a model-based tagger is projected only if
			//   the same named entity was extracted from the corpus (this takes
			//   the poor performance of the model-based NE taggers on the noisy
			//   Web data into account)
			// - if a factoid answer was extracted from the corpus with more
			//   than one technique, then the first extraction technique in
			//   'EXTRACTION_TECHNIQUES' determines the supporting document
			Result factoid = factoids.get(norm);
			if (factoid != null &&
					(!NETagger.allModelType(resultWeb.getNeTypes()) ||
					factoid.isNamedEntity())) {
				// factoid answer also extracted from corpus:
				// if web answer not a named entity from a model-based tagger or
				// corpus answer also a named entity
				// -> project answer
				Result result = resultWeb.getCopy();
				result.setAnswer(factoid.getAnswer());
				result.setDocID(factoid.getDocID());
				result.setSentence(factoid.getSentence());
				projected.add(result);
			} else if (!NETagger.allModelType(resultWeb.getNeTypes())) {
				// factoid answer not extracted from corpus:
				// if answer not a named entity from a model-based tagger
				// -> browse sentences for answer
				String normRegex = RegexConverter.strToRegexWithBounds(norm);

				for (String normSentence : normSentences) {
					String[] truncs = normSentence.split(normRegex, -1);

					if (truncs.length > 1) {  // sentence contains answer?
						// undo normalization
						Result sentence = sentences.get(normSentence);
						String sent = sentence.getAnswer();
						int start = truncs[0].split(" ", -1).length - 1;
						int end = start + norm.split(" ").length;
						String[] tokens = NETagger.tokenize(sent);
						String answer = tokens[start];
						for (int i = start + 1; i < end; i++)
							answer += " " + tokens[i];
						answer = OpenNLP.untokenize(answer, sent);

						if (norm.equals(StringUtils.normalize(answer))) {
							Result result = resultWeb.getCopy();
							result.setAnswer(answer);
							result.setDocID(sentence.getDocID());
							result.setSentence(sentence.getAnswer());
							projected.add(result);
							break;
						} else {
							MsgPrinter.printErrorMsg("\nNormalization could " +
									"not be undone:\n" + norm);
						}
					}
				}
			}
		}

		return projected.toArray(new Result[projected.size()]);
	}
}


text:
#pragma once
#include <aws/cloudsearch/CloudSearch_EXPORTS.h>
#include <aws/cloudsearch/CloudSearchRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <utility>

namespace Aws
{
namespace CloudSearch
{
namespace Model
{

  /**
   *
Container for the parameters to the DescribeIndexFields
   * operation. Specifies the name of the domain you want to describe. To restrict
   * the response to particular index fields, specify the names of the index fields
   * you want to describe. To show the active configuration and exclude any pending
   * changes, set the Deployed option to
   * true.

See Also:
   AWS
   * API Reference

   */
  class AWS_CLOUDSEARCH_API DescribeIndexFieldsRequest : public CloudSearchRequest
  {
  public:
    DescribeIndexFieldsRequest();
    Aws::String SerializePayload() const override;

  protected:
    void DumpBodyToUrl(Aws::Http::URI& uri ) const override;

  public:
    /**
     *
The name of the domain you want to describe.

     */
    inline const Aws::String& GetDomainName() const{ return m_domainName; }

    /**
     *
The name of the domain you want to describe.

     */
    inline void SetDomainName(const Aws::String& value) { m_domainNameHasBeenSet = true; m_domainName = value; }

    /**
     *
The name of the domain you want to describe.

     */
    inline void SetDomainName(Aws::String&& value) { m_domainNameHasBeenSet = true; m_domainName = std::move(value); }

    /**
     *
The name of the domain you want to describe.

     */
    inline void SetDomainName(const char* value) { m_domainNameHasBeenSet = true; m_domainName.assign(value); }

    /**
     *
The name of the domain you want to describe.

     */
    inline DescribeIndexFieldsRequest& WithDomainName(const Aws::String& value) { SetDomainName(value); return *this;}

    /**
     *
The name of the domain you want to describe.

     */
    inline DescribeIndexFieldsRequest& WithDomainName(Aws::String&& value) { SetDomainName(std::move(value)); return *this;}

    /**
     *
The name of the domain you want to describe.

     */
    inline DescribeIndexFieldsRequest& WithDomainName(const char* value) { SetDomainName(value); return *this;}

    /**
     *
A list of the index fields you want to describe. If not specified,
     * information is returned for all configured index fields.

     */
    inline const Aws::Vector<Aws::String>& GetFieldNames() const{ return m_fieldNames; }

    /**
     *
A list of the index fields you want to describe. If not specified,
     * information is returned for all configured index fields.

     */
    inline void SetFieldNames(const Aws::Vector<Aws::String>& value) { m_fieldNamesHasBeenSet = true; m_fieldNames = value; }

    /**
     *
A list of the index fields you want to describe. If not specified,
     * information is returned for all configured index fields.

     */
    inline void SetFieldNames(Aws::Vector<Aws::String>&& value) { m_fieldNamesHasBeenSet = true; m_fieldNames = std::move(value); }

    /**
     *
A list of the index fields you want to describe. If not specified,
     * information is returned for all configured index fields.

     */
    inline DescribeIndexFieldsRequest& WithFieldNames(const Aws::Vector<Aws::String>& value) { SetFieldNames(value); return *this;}

    /**
     *
A list of the index fields you want to describe. If not specified,
     * information is returned for all configured index fields.

     */
    inline DescribeIndexFieldsRequest& WithFieldNames(Aws::Vector<Aws::String>&& value) { SetFieldNames(std::move(value)); return *this;}

    /**
     *
A list of the index fields you want to describe. If not specified,
     * information is returned for all configured index fields.

     */
    inline DescribeIndexFieldsRequest& AddFieldNames(const Aws::String& value) { m_fieldNamesHasBeenSet = true; m_fieldNames.push_back(value); return *this; }

    /**
     *
A list of the index fields you want to describe. If not specified,
     * information is returned for all configured index fields.

     */
    inline DescribeIndexFieldsRequest& AddFieldNames(Aws::String&& value) { m_fieldNamesHasBeenSet = true; m_fieldNames.push_back(std::move(value)); return *this; }

    /**
     *
A list of the index fields you want to describe. If not specified,
     * information is returned for all configured index fields.

     */
    inline DescribeIndexFieldsRequest& AddFieldNames(const char* value) { m_fieldNamesHasBeenSet = true; m_fieldNames.push_back(value); return *this; }

    /**
     *
Whether to display the deployed configuration (true) or include
     * any pending changes (false). Defaults to false.

     */
    inline bool GetDeployed() const{ return m_deployed; }

    /**
     *
Whether to display the deployed configuration (true) or include
     * any pending changes (false). Defaults to false.

     */
    inline void SetDeployed(bool value) { m_deployedHasBeenSet = true; m_deployed = value; }

    /**
     *
Whether to display the deployed configuration (true) or include
     * any pending changes (false). Defaults to false.

     */
    inline DescribeIndexFieldsRequest& WithDeployed(bool value) { SetDeployed(value); return *this;}

  private:
    Aws::String m_domainName;
    bool m_domainNameHasBeenSet;
    Aws::Vector<Aws::String> m_fieldNames;
    bool m_fieldNamesHasBeenSet;
    bool m_deployed;
    bool m_deployedHasBeenSet;
  };

} // namespace Model
} // namespace CloudSearch
} // namespace Aws


text:
#include "El.hpp"
#ifdef EL_HAVE_MKL

using El::BlasInt;
using El::scomplex;
using El::dcomplex;

extern "C" {

typedef struct _MKL_Complex8 {
  float real;
  float imag;
} MKL_Complex8;

typedef struct _MKL_Complex16 {
  double real;
  double imag;
} MKL_Complex16;

void mkl_scsrmv
( const char* transA, const BlasInt* m, const BlasInt* k,
  const float* alpha, const char* matDescrA,
  const float* val, const BlasInt* indx,
  const BlasInt* pntrb, const BlasInt* pntre,
  const float* x, const float* beta, float* y );
void mkl_dcsrmv
( const char* transA, const BlasInt* m, const BlasInt* k,
  const double* alpha, const char* matDescrA,
  const double* val, const BlasInt* indx,
  const BlasInt* pntrb, const BlasInt* pntre,
  const double* x, const double* beta, double* y );
void mkl_ccsrmv
( const char* transA, const BlasInt* m, const BlasInt* k,
  const MKL_Complex8* alpha, const char* matDescrA,
  const MKL_Complex8* val, const BlasInt* indx,
  const BlasInt* pntrb, const BlasInt* pntre,
  const MKL_Complex8* x, const MKL_Complex8* beta, MKL_Complex8* y );
void mkl_zcsrmv
( const char* transA, const BlasInt* m, const BlasInt* k,
  const MKL_Complex16* alpha, const char* matDescrA,
  const MKL_Complex16* val, const BlasInt* indx,
  const BlasInt* pntrb, const BlasInt* pntre,
  const MKL_Complex16* x, const MKL_Complex16* beta, MKL_Complex16* y );

void MKL_Somatcopy
( char ordering, char trans, size_t rows, size_t cols,
  float alpha,
  const float* A, size_t lda,
        float* B, size_t ldb );
void MKL_Domatcopy
( char ordering, char trans, size_t rows, size_t cols,
  double alpha,
  const double* A, size_t lda,
        double* B, size_t ldb );
void MKL_Comatcopy
( char ordering, char trans, size_t rows, size_t cols,
  MKL_Complex8 alpha,
  const MKL_Complex8* A, size_t lda,
        MKL_Complex8* B, size_t ldb );
void MKL_Zomatcopy
( char ordering, char trans, size_t rows, size_t cols,
  MKL_Complex16 alpha,
  const MKL_Complex16* A, size_t lda,
        MKL_Complex16* B, size_t ldb );

void MKL_Somatcopy2
( char ordering, char trans, size_t rows, size_t cols,
  float alpha,
  const float* A, size_t lda, size_t stridea,
        float* B, size_t ldb, size_t strideb );
void MKL_Domatcopy2
( char ordering, char trans, size_t rows, size_t cols,
  double alpha,
  const double* A, size_t lda, size_t stridea,
        double* B, size_t ldb, size_t strideb );
void MKL_Comatcopy2
( char ordering, char trans, size_t rows, size_t cols,
  MKL_Complex8 alpha,
  const MKL_Complex8* A, size_t lda, size_t stridea,
        MKL_Complex8* B, size_t ldb, size_t strideb );
void MKL_Zomatcopy2
( char ordering, char trans, size_t rows, size_t cols,
  MKL_Complex16 alpha,
  const MKL_Complex16* A, size_t lda, size_t stridea,
        MKL_Complex16* B, size_t ldb, size_t strideb );

void MKL_Simatcopy
( char ordering, char trans, size_t rows, size_t cols,
  float alpha, float* A, size_t lda, size_t ldb );
void MKL_Dimatcopy
( char ordering, char trans, size_t rows, size_t cols,
  double alpha, double* A, size_t lda, size_t ldb );
void MKL_Cimatcopy
( char ordering, char trans, size_t rows, size_t cols,
  MKL_Complex8 alpha, MKL_Complex8* A, size_t lda, size_t ldb );
void MKL_Zimatcopy
( char ordering, char trans, size_t rows, size_t cols,
  MKL_Complex16 alpha, MKL_Complex16* A, size_t lda, size_t ldb );

} // extern "C"

namespace El {
namespace mkl {

// TODO: Ensure that BlasInt is compatible with MKL_INT in the following
//       routines

// NOTE: For the usual Elemental sparse format, we can simply set
//           ptre = ptrb+1
//       and
//           matDescrA[0] = 'G'
//           matDescrA[3] = 'C'
void csrmv
( Orientation orientation, BlasInt m, BlasInt k,
  float alpha, const char* matDescrA,
  const float* val, const BlasInt* indx,
  const BlasInt* pntrb, const BlasInt* pntre,
  const float* x, float beta, float* y )
{
    DEBUG_ONLY(CSE cse("mkl::csrmv"))
    char transA = OrientationToChar( orientation );
    if( transA == 'C' )
        transA = 'T';
    mkl_scsrmv
    ( &transA, &m, &k, &alpha, matDescrA, val, indx, pntrb, pntre,
      x, &beta, y );
}

void csrmv
( Orientation orientation, BlasInt m, BlasInt k,
  double alpha, const char* matDescrA,
  const double* val, const BlasInt* indx,
  const BlasInt* pntrb, const BlasInt* pntre,
  const double* x, double beta, double* y )
{
    DEBUG_ONLY(CSE cse("mkl::csrmv"))
    char transA = OrientationToChar( orientation );
    if( transA == 'C' )
        transA = 'T';
    mkl_dcsrmv
    ( &transA, &m, &k, &alpha, matDescrA, val, indx, pntrb, pntre,
      x, &beta, y );
}

void csrmv
( Orientation orientation, BlasInt m, BlasInt k,
  Complex<float> alpha, const char* matDescrA,
  const Complex<float>* val, const BlasInt* indx,
  const BlasInt* pntrb, const BlasInt* pntre,
  const Complex<float>* x, Complex<float> beta, Complex<float>* y )
{
    DEBUG_ONLY(CSE cse("mkl::csrmv"))
    char transA = OrientationToChar( orientation );
    mkl_ccsrmv
    ( &transA, &m, &k,
      reinterpret_cast<const MKL_Complex8*>(&alpha),
      matDescrA,
      reinterpret_cast<const MKL_Complex8*>(val),
      indx, pntrb, pntre,
      reinterpret_cast<const MKL_Complex8*>(x),
      reinterpret_cast<const MKL_Complex8*>(&beta),
      reinterpret_cast<      MKL_Complex8*>(y) );
}

void csrmv
( Orientation orientation, BlasInt m, BlasInt k,
  Complex<double> alpha, const char* matDescrA,
  const Complex<double>* val, const BlasInt* indx,
  const BlasInt* pntrb, const BlasInt* pntre,
  const Complex<double>* x, Complex<double> beta, Complex<double>* y )
{
    DEBUG_ONLY(CSE cse("mkl::csrmv"))
    char transA = OrientationToChar( orientation );
    mkl_zcsrmv
    ( &transA, &m, &k,
      reinterpret_cast<const MKL_Complex16*>(&alpha),
      matDescrA,
      reinterpret_cast<const MKL_Complex16*>(val),
      indx, pntrb, pntre,
      reinterpret_cast<const MKL_Complex16*>(x),
      reinterpret_cast<const MKL_Complex16*>(&beta),
      reinterpret_cast<      MKL_Complex16*>(y) );
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  Int alpha, const Int* A, BlasInt lda,
                   Int* B, BlasInt ldb )
{
    if( orientation == NORMAL )
    {
        for( BlasInt j=0; j<n; ++j )
            for( BlasInt i=0; i<m; ++i )
                B[i+j*ldb] = A[i+j*lda];
    }
    else if( orientation == TRANSPOSE )
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j+i*ldb] = A[i+j*lda];
    }
    else
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j+i*ldb] = Conj(A[i+j*lda]);
    }
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  float alpha, const float* A, BlasInt lda,
                     float* B, BlasInt ldb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Somatcopy( ordering, trans, m, n, alpha, A, lda, B, ldb );
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  double alpha, const double* A, BlasInt lda,
                      double* B, BlasInt ldb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Domatcopy( ordering, trans, m, n, alpha, A, lda, B, ldb );
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  scomplex alpha, const scomplex* A, BlasInt lda,
                        scomplex* B, BlasInt ldb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Complex8 alphaMKL;
    alphaMKL.real = alpha.real();
    alphaMKL.imag = alpha.imag();
    MKL_Comatcopy
    ( ordering, trans, m, n, alphaMKL,
      reinterpret_cast<const MKL_Complex8*>(A), lda,
      reinterpret_cast<      MKL_Complex8*>(B), ldb );
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  dcomplex alpha, const dcomplex* A, BlasInt lda,
                        dcomplex* B, BlasInt ldb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Complex16 alphaMKL;
    alphaMKL.real = alpha.real();
    alphaMKL.imag = alpha.imag();
    MKL_Zomatcopy
    ( ordering, trans, m, n, alphaMKL,
      reinterpret_cast<const MKL_Complex16*>(A), lda,
      reinterpret_cast<      MKL_Complex16*>(B), ldb );
}

#ifdef EL_HAVE_QUAD
void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  Quad alpha,
  const Quad* A, BlasInt lda,
        Quad* B, BlasInt ldb )
{
    if( orientation == NORMAL )
    {
        for( BlasInt j=0; j<n; ++j )
            for( BlasInt i=0; i<m; ++i )
                B[i+j*ldb] = A[i+j*lda];
    }
    else if( orientation == TRANSPOSE )
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j+i*ldb] = A[i+j*lda];
    }
    else
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j+i*ldb] = Conj(A[i+j*lda]);
    }
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  Complex<Quad> alpha,
  const Complex<Quad>* A, BlasInt lda,
        Complex<Quad>* B, BlasInt ldb )
{
    if( orientation == NORMAL )
    {
        for( BlasInt j=0; j<n; ++j )
            for( BlasInt i=0; i<m; ++i )
                B[i+j*ldb] = A[i+j*lda];
    }
    else if( orientation == TRANSPOSE )
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j+i*ldb] = A[i+j*lda];
    }
    else
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j+i*ldb] = Conj(A[i+j*lda]);
    }
}
#endif

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  Int alpha,
  const Int* A, BlasInt lda, BlasInt stridea,
        Int* B, BlasInt ldb, BlasInt strideb )
{
    if( orientation == NORMAL )
    {
        for( BlasInt j=0; j<n; ++j )
            for( BlasInt i=0; i<m; ++i )
                B[i*strideb+j*ldb] = A[i*stridea+j*lda];
    }
    else if( orientation == TRANSPOSE )
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j*strideb+i*ldb] = A[i*stridea+j*lda];
    }
    else
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j*strideb+i*ldb] = Conj(A[i*stridea+j*lda]);
    }
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  float alpha,
  const float* A, BlasInt lda, BlasInt stridea,
        float* B, BlasInt ldb, BlasInt strideb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Somatcopy2
    ( ordering, trans, m, n, alpha, A, lda, stridea, B, ldb, strideb );
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  double alpha,
  const double* A, BlasInt lda, BlasInt stridea,
        double* B, BlasInt ldb, BlasInt strideb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Domatcopy2
    ( ordering, trans, m, n, alpha, A, lda, stridea, B, ldb, strideb );
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  scomplex alpha,
  const scomplex* A, BlasInt lda, BlasInt stridea,
        scomplex* B, BlasInt ldb, BlasInt strideb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Complex8 alphaMKL;
    alphaMKL.real = alpha.real();
    alphaMKL.imag = alpha.imag();
    MKL_Comatcopy2
    ( ordering, trans, m, n, alphaMKL,
      reinterpret_cast<const MKL_Complex8*>(A), lda, stridea,
      reinterpret_cast<      MKL_Complex8*>(B), ldb, strideb );
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  dcomplex alpha,
  const dcomplex* A, BlasInt lda, BlasInt stridea,
        dcomplex* B, BlasInt ldb, BlasInt strideb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Complex16 alphaMKL;
    alphaMKL.real = alpha.real();
    alphaMKL.imag = alpha.imag();
    MKL_Zomatcopy2
    ( ordering, trans, m, n, alphaMKL,
      reinterpret_cast<const MKL_Complex16*>(A), lda, stridea,
      reinterpret_cast<      MKL_Complex16*>(B), ldb, strideb );
}

#ifdef EL_HAVE_QUAD
void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  Quad alpha,
  const Quad* A, BlasInt lda, BlasInt stridea,
        Quad* B, BlasInt ldb, BlasInt strideb )
{
    if( orientation == NORMAL )
    {
        for( BlasInt j=0; j<n; ++j )
            for( BlasInt i=0; i<m; ++i )
                B[i*strideb+j*ldb] = A[i*stridea+j*lda];
    }
    else if( orientation == TRANSPOSE )
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j*strideb+i*ldb] = A[i*stridea+j*lda];
    }
    else
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j*strideb+i*ldb] = Conj(A[i*stridea+j*lda]);
    }
}

void omatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  Complex<Quad> alpha,
  const Complex<Quad>* A, BlasInt lda, BlasInt stridea,
        Complex<Quad>* B, BlasInt ldb, BlasInt strideb )
{
    if( orientation == NORMAL )
    {
        for( BlasInt j=0; j<n; ++j )
            for( BlasInt i=0; i<m; ++i )
                B[i*strideb+j*ldb] = A[i*stridea+j*lda];
    }
    else if( orientation == TRANSPOSE )
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j*strideb+i*ldb] = A[i*stridea+j*lda];
    }
    else
    {
        for( BlasInt i=0; i<m; ++i )
            for( BlasInt j=0; j<n; ++j )
                B[j*strideb+i*ldb] = Conj(A[i*stridea+j*lda]);
    }
}
#endif

void imatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  Int alpha, Int* A, BlasInt lda, BlasInt ldb )
{
    LogicError("Integer MKL imatcopy not yet supported");
}

void imatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  float alpha, float* A, BlasInt lda, BlasInt ldb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Simatcopy( ordering, trans, m, n, alpha, A, lda, ldb );
}

void imatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  double alpha, double* A, BlasInt lda, BlasInt ldb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Dimatcopy( ordering, trans, m, n, alpha, A, lda, ldb );
}

void imatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  scomplex alpha, scomplex* A, BlasInt lda, BlasInt ldb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Complex8 alphaMKL;
    alphaMKL.real = alpha.real();
    alphaMKL.imag = alpha.imag();
    MKL_Cimatcopy
    ( ordering, trans, m, n, alphaMKL,
      reinterpret_cast<MKL_Complex8*>(A), lda, ldb );
}

void imatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  dcomplex alpha, dcomplex* A, BlasInt lda, BlasInt ldb )
{
    char ordering = 'C';
    char trans = OrientationToChar( orientation );
    MKL_Complex16 alphaMKL;
    alphaMKL.real = alpha.real();
    alphaMKL.imag = alpha.imag();
    MKL_Zimatcopy
    ( ordering, trans, m, n, alphaMKL,
      reinterpret_cast<MKL_Complex16*>(A), lda, ldb );
}

#ifdef EL_HAVE_QUAD
void imatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  Quad alpha, Quad* A, BlasInt lda, BlasInt ldb )
{
    LogicError("This routine not yet written");
}

void imatcopy
( Orientation orientation, BlasInt m, BlasInt n,
  Complex<Quad> alpha, Complex<Quad>* A, BlasInt lda, BlasInt ldb )
{
    LogicError("This routine not yet written");
}
#endif

} // namespace mkl
} // namespace El

#endif // ifdef EL_HAVE_MKL


text:
<?php
// /lib/Module.Filter.php

/**
 *
 */

namespace Module;

class Filter implements \Module\Module {

    private $id;
    private $input;
    private $conf;

    /**
     *
     */
    public function __construct($id, $conf) {
        $this->id = $id;
        $this->conf = $conf;
    }

    public function getId() {
        return $this->id;
    }

    /**
     *
     */
    public function in(\SimpleXMLElement $in) {
        $this->input = $in;
    }

    /**
     *
     */
    public function out() {
        $xml = $this->input;
        $entries = $xml->xpath("//a:entry");
        $filteredEntries = array();
        foreach ($entries as $entryKey => $entry) {
            if ($this->conf->mode == "permit") {
                if ($this->matchesCombinedCondition($entry, $this->conf->rules, $this->conf->combine)) {
                    array_push($filteredEntries, $entry);
                }
            } elseif ($this->conf->mode == "deny") {
                if (!$this->matchesCombinedCondition($entry, $this->conf->rules, $this->conf->combine)) {
                    array_push($filteredEntries, $entry);
                }
            } else {
                throw new \Exception("Mode $this->conf->mode not accepted");
            }
        }

        // delete all entries from $xml
        $xml = $this->filterEntries($xml, $filteredEntries);

        return $xml;
    }

    private function filterEntries($xml, $filteredEntries) {
        // create DOMDocument
        $dom = new \DOMDocument();
        $dom->loadXML($xml->asXML());
        $entries = $dom->getElementsByTagName('entry');

        // remove all entries
        while ($entries->length > 0) {
            $entry = $entries->item(0);
            $entry->parentNode->removeChild($entry);
        }

        // insert back all filtered entries
        $parent = $dom->getElementsByTagName("feed");
        foreach ($filteredEntries as $entry) {
            $entry = $dom->importNode(dom_import_simplexml($entry), true);
            $parent->item(0)->insertBefore($entry);
        }

        // convert back to SimpleXML format
        $xml = simplexml_load_string($dom->saveXML());
        foreach($xml->getDocNamespaces() as $strPrefix => $strNamespace) {
            if(strlen($strPrefix) == 0) {
                $strPrefix = "a"; // assign an arbitrary namespace prefix
            }
            $xml->registerXPathNamespace($strPrefix, $strNamespace);
        }
        return $xml;
    }

    private function matchesCombinedCondition($entry, $rules, $combine) {
        if ($combine == "and") {
            foreach ($rules as $rule) {
                if (!$this->matchesSingleCondition($entry, $rule)) {
                    return false;
                }
            }
            return true;
        } elseif ($combine == "or") {
            foreach ($rules as $rule) {
                if ($this->matchesSingleCondition($entry, $rule)) {
                    return true;
                }
            }
            return false;
        } else {
            throw new \Exception("Combination $combine is not implemented");
        }
    }

    private function matchesSingleCondition($entry, $rule) {
        $entryValue = $entry->{$rule->field};
        switch ($rule->op) {
            case "after":
                return strtotime($entryValue) > strtotime($rule->value);
                break;
            case "before":
                return strtotime($entryValue) < strtotime($rule->value);
                break;
            default:
                throw new \Exception("Operation $rule->op not implemented");
        }
    }
}


text:
import React, {PureComponent} from 'react';
import axios from "axios";
import validateErrorResponse from "../../utility/HttpResponseValidator";
import {userStatusFormatter, userRoleFormatter} from "../user/utility/UserFormatter";
import preventEnterEvent from "../../utility/KeyboardUtility";
import {faUserEdit} from "@fortawesome/free-solid-svg-icons";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";

class Profile extends PureComponent {

    constructor(props) {
        super(props);
        this.getUser = this.getUser.bind(this);
        this.onUpdateUserClick = this.onUpdateUserClick.bind(this);
        this.setUpdateUserUserName = this.setUpdateUserUserName.bind(this);
        this.setUpdateUserEmail = this.setUpdateUserEmail.bind(this);
        this.setUpdateUserPassword = this.setUpdateUserPassword.bind(this);
        this.setUpdateUserFullName = this.setUpdateUserFullName.bind(this);

        this.state = {
            userId: this.props.match.params.userId,
            user: {},
            updateUser: {
                username: "",
                email: "",
                fullName: "",
                password: ""
            }
        };

        this.getUser();
    }

    setUpdateUserUserName(username) {
        this.setState({
            updateUser: {
                ...this.state.updateUser,
                username: username
            }
        });
    }

    setUpdateUserEmail(email) {
        this.setState({
            updateUser: {
                ...this.state.updateUser,
                email: email
            }
        });
    }

    setUpdateUserFullName(fullName) {
        this.setState({
            updateUser: {
                ...this.state.updateUser,
                fullName: fullName
            }
        });
    }

    setUpdateUserPassword(password) {
        this.setState({
            updateUser: {
                ...this.state.updateUser,
                password: password
            }
        });
    }

    onUpdateUserClick() {
        axios
            .put(process.env.PUBLIC_URL + "/api/rest/core/profile", this.state.updateUser)
            .then(response => {
                this.getUser();
            })
            .catch(error => {
                validateErrorResponse(error)
            });
    }

    getUser() {
        axios
            .get(process.env.PUBLIC_URL + "/api/rest/core/profile")
            .then(response => {
                this.setState({
                    user: response.data,
                    updateUser: {
                        ...response.data
                    },
                });
            })
            .catch(error => {
                validateErrorResponse(error)
            });
    }

    render() {
        return (

User

                            <button className="btn btn-success demo-button-disabled menu-button" data-toggle="modal" data-target="#updateUserModal"><FontAwesomeIcon icon={faUserEdit} className="button-icon"/>Update profile</button>

Username

{this.state.user.username}

Name

{this.state.user.fullName}

Email

{this.state.user.email}

Status

{userStatusFormatter(this.state.user.status)}

Role

{userRoleFormatter(this.state.user.role)}

Created

{new Date(this.state.user.created).toLocaleString()}

Updated

{new Date(this.state.user.updated).toLocaleString()}

Update user

                                <button type="button" className="close" data-dismiss="modal" aria-label="Close">
                                    ×
                                </button>

                                <form>

                                        Username

                                            <input className="form-control" type="text" defaultValue={this.state.user.username} onChange={event => this.setUpdateUserUserName(event.target.value)} onKeyDown={preventEnterEvent}/>

                                        Name

                                            <input className="form-control" type="text" defaultValue={this.state.user.fullName} onChange={event => this.setUpdateUserFullName(event.target.value)} onKeyDown={preventEnterEvent}/>

                                        Email

                                            <input className="form-control" type="text" defaultValue={this.state.user.email} onChange={event => this.setUpdateUserEmail(event.target.value)} onKeyDown={preventEnterEvent}/>

                                        Password

                                            <input className="form-control" type="password" defaultValue={this.state.user.password} onChange={event => this.setUpdateUserPassword(event.target.value)} onKeyDown={preventEnterEvent}/>

                                </form>

                                <button className="btn btn-success" data-dismiss="modal" onClick={this.onUpdateUserClick}><FontAwesomeIcon icon={faUserEdit} className="button-icon"/>Update</button>

        )
    }

}

export default Profile;


text:
from model.contact import Contact

class ContactHelper:

    def __init__(self, app):
        self.app = app

    def modify_first_contact(self, new_contact_data):
        wd = self.app.wd
        # go to contact page (homepage)
        self.open_home_contact_page()
        self.select_first_contact()
        # enter modification mode
        wd.find_element_by_xpath("//table[@id='maintable']/tbody/tr[2]/td[8]/a/img").click()
        # modify contact form
        self.fill_contact_form(new_contact_data)
        # submit contact modification
        wd.find_element_by_xpath("//div[@id='content']/form[1]/input[22]").click()
        self.return_to_home_contact_page()

    def open_home_contact_page(self):
        wd = self.app.wd
        if not (wd.current_url.endswith("/addressbook/") and len(wd.find_elements_by_name("searchform")) > 0):
            wd.find_element_by_link_text("home").click()

    def return_to_home_contact_page(self):
        wd = self.app.wd
        wd.find_element_by_link_text("home page").click()

    def delete_first_contact(self):
        wd = self.app.wd
        #go to contact page (homepage)
        self.open_home_contact_page()
        self.select_first_contact()
        #submit deletion
        wd.find_element_by_xpath("//div[@id='content']/form[2]/div[2]/input").click()
        wd.switch_to_alert().accept()
        self.open_home_contact_page()

    def select_first_contact(self):
        wd = self.app.wd
        wd.find_element_by_name("selected[]").click()

    def create_contact(self, contact):
        wd = self.app.wd
        # init contact creation
        wd.find_element_by_link_text("add new").click()
        self.fill_contact_form(contact)
        # submit contact creation
        wd.find_element_by_xpath("//div[@id='content']/form/input[21]").click()
        self.return_to_home_contact_page()

    def fill_contact_form(self, contact):
        wd = self.app.wd
        # fill out contact form
        self.change_field_value("firstname", contact.firstname)
        self.change_field_value("middlename", contact.middlename)
        self.change_field_value("lastname", contact.lastname)
        self.change_field_value("nickname", contact.nickname)
        self.change_field_value("title", contact.title)
        self.change_field_value("company", contact.company)
        self.change_field_value("address", contact.address)
        self.change_field_value("home", contact.home)
        self.change_field_value("mobile", contact.mobile)
        self.change_field_value("work", contact.work)
        self.change_field_value("fax", contact.fax)
        self.change_field_value("email", contact.email)
        self.change_field_value("email2", contact.email2)
        self.change_field_value("email3", contact.email3)
        self.change_field_value("homepage", contact.homepage)
        self.change_field_value("address2", contact.address2)
        self.change_field_value("phone2", contact.phone2)
        self.change_field_value("notes", contact.notes)

    def change_field_value(self, field_name, text):
        wd = self.app.wd
        if text is not None:
            wd.find_element_by_name(field_name).click()
            wd.find_element_by_name(field_name).clear()
            wd.find_element_by_name(field_name).send_keys(text)

    def count(self):
        wd = self.app.wd
        self.open_home_contact_page()
        return len(wd.find_elements_by_name("selected[]"))

    def get_contact_list(self):
        wd = self.app.wd
        self.open_home_contact_page()
        contacts = []
        for element in wd.find_elements_by_name("entry"):
            text = element.find_element_by_name("selected[]").get_attribute("title")
            id = element.find_element_by_name("selected[]").get_attribute("value")
            contacts.append(Contact(firstname=text, id=id))
        return contacts


text:
#ifndef BlynkArduinoClient_h
#define BlynkArduinoClient_h

#include <BlynkApiArduino.h>
#include <Blynk/BlynkDebug.h>
#include <Client.h>

#if defined(ESP8266) && !defined(BLYNK_NO_YIELD)
    #define YIELD_FIX() BLYNK_RUN_YIELD();
#else
    #define YIELD_FIX()
#endif

template <typename Client>
class BlynkArduinoClientGen
{
public:
    BlynkArduinoClientGen(Client& c)
        : client(NULL), domain(NULL), port(0), isConn(false)
    {
        setClient(&c);
    }

    BlynkArduinoClientGen()
        : client(NULL), domain(NULL), port(0), isConn(false)
    {}

    void setClient(Client* c) {
        client = c;
        client->setTimeout(BLYNK_TIMEOUT_MS);
    }

    void begin(IPAddress a, uint16_t p) {
        domain = NULL;
        port = p;
        addr = a;
    }

    void begin(const char* d, uint16_t p) {
        domain = d;
        port = p;
    }

    bool connect() {
        if (domain) {
            BLYNK_LOG4(BLYNK_F("Connecting to "), domain, ':', port);

            isConn = (1 == client->connect(domain, port));
            return isConn;
        } else { //if (uint32_t(addr) != 0) {
            BLYNK_LOG_IP("Connecting to ", addr);
            isConn = (1 == client->connect(addr, port));
            return isConn;
        }
        return false;
    }

    void disconnect() { isConn = false; client->stop(); }

#ifdef BLYNK_ENC28J60_FIX
    size_t read(void* buf, size_t len) {
        while (client->available() < len) { BLYNK_RUN_YIELD(); }
        return client->read((uint8_t*)buf, len);
    }
#else
    size_t read(void* buf, size_t len) {
        size_t res = client->readBytes((char*)buf, len);
        YIELD_FIX();
        return res;
    }
#endif

#ifdef BLYNK_RETRY_SEND
    size_t write(const void* buf, size_t len) {
        size_t sent = 0;
        int retry = 0;
        while (sent < len && ++retry < 10) {
            size_t w = client->write((const uint8_t*)buf+sent, len-sent);
            if (w != 0 && w != -1) {
                sent += w;
            } else {
                BlynkDelay(50);
#if defined(BLYNK_DEBUG) && defined(BLYNK_PRINT)
                BLYNK_PRINT_TIME();
                BLYNK_PRINT.print(BLYNK_F("Retry "));
                BLYNK_PRINT.print(retry);
                BLYNK_PRINT.print(BLYNK_F(" send: "));
                BLYNK_PRINT.print(sent);
                BLYNK_PRINT.print('/');
                BLYNK_PRINT.println(len);
#endif
            }
        }
        return sent;
    }
#else
    size_t write(const void* buf, size_t len) {
        YIELD_FIX();
        size_t res = client->write((const uint8_t*)buf, len);
        YIELD_FIX();
        return res;
    }
#endif

    bool connected() { YIELD_FIX(); return isConn && client->connected(); }
    int available() {  YIELD_FIX(); return client->available(); }

protected:
    Client*     client;
    IPAddress   addr;
    const char* domain;
    uint16_t    port;
    bool        isConn;
};

typedef BlynkArduinoClientGen<Client> BlynkArduinoClient;

#endif


text:
package example;

import java.io.IOException;
import java.util.logging.Logger;

import org.apache.commons.cli.*;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.ObjectWriter;

import com.woorea.openstack.base.client.HttpMethod;
import com.woorea.openstack.base.client.OpenStackClientConnector;
import com.woorea.openstack.base.client.OpenStackRequest;
import com.woorea.openstack.base.client.OpenStackResponseException;
import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider;
import com.woorea.openstack.glance.Glance;
import com.woorea.openstack.glance.model.Image;
import com.woorea.openstack.glance.model.Images;
//import com.woorea.openstack.connector.JerseyConnector; // Override to ignore unknown JSON properties
import com.woorea.openstack.keystone.Keystone;
import com.woorea.openstack.keystone.model.Access;
import com.woorea.openstack.keystone.model.Authentication;
import com.woorea.openstack.keystone.model.Endpoint;
import com.woorea.openstack.keystone.model.Endpoints;
import com.woorea.openstack.keystone.model.Service;
import com.woorea.openstack.keystone.model.Services;
import com.woorea.openstack.keystone.model.Tenant;
import com.woorea.openstack.keystone.model.Tenants;
import com.woorea.openstack.keystone.model.User;
import com.woorea.openstack.keystone.model.Users;
import com.woorea.openstack.keystone.model.authentication.TokenAuthentication;
import com.woorea.openstack.keystone.model.authentication.UsernamePassword;
import com.woorea.openstack.keystone.utils.KeystoneUtils;
import com.woorea.openstack.nova.Nova;
import com.woorea.openstack.nova.api.extensions.HostsExtension;
import com.woorea.openstack.nova.model.Flavor;
import com.woorea.openstack.nova.model.Flavors;
import com.woorea.openstack.nova.model.Hosts;
import com.woorea.openstack.nova.model.Hosts.Host;
import com.woorea.openstack.nova.model.Server;
import com.woorea.openstack.nova.model.Servers;

public class Cli
{
	/**
	 * Keystone username to authorize (defaults to "admin")
	 */
	private String username = "admin";

	/**
	 * Tenant name that is used to authorize with Keystone (defaults to "admin")
	 */
	private String tenantName = "admin";

	/**
	 * User password for authenticating with keystone (defaults to "password")
	 */
	private String password = "password";

	/**
	 * Keystone API endpoint (e.g. "http://172.16.0.1:35357/v2.0/")
	 *
	 * Note that this CLI expects to be admin, so wants to use the Keystone Admin API,
	 * which is usually on port 35357, not on port 5000.
	 *
	 */
	private String apiEndpoint;

	/**
	 * Which API service endpoints
	 */
	private String facing = "public"; // "admin", "public", or "internal"

	/**
	 * Enable debug logging
	 */
	private boolean debug = false;

	// Client objects shared by multiple methods
	private OpenStackClientConnector connector;
	private Access access;
	private Keystone keystone;

	private ObjectMapper mapper = new ObjectMapper();

	/**
	 *
	 * @param args
	 */
	public static void main( String[] args )
    {
		Cli app = new Cli();
    	app.parseOptions(args);

    	System.out.println("API Endpoint: " + app.apiEndpoint);
    	System.out.println("User:         " + app.username);
    	System.out.println("Tenant:       " + app.tenantName);
    	System.out.println("Password:     " + app.password);
    	System.out.println("API Facing:   " + app.facing);
    	System.out.println("Debug:        " + app.debug);

    	app.run();
    }

    private void parseOptions( String[] args ) {
    	Options options = new Options();
    	options.addOption("a", "api", true, "Keystone Admin API endpoint");
    	options.addOption("u", "user", true, "Username");
    	options.addOption("t", "tenant", true, "Tenant Name");
    	options.addOption("p", "password", true, "Password");
    	options.addOption("f", "facing", true, "API facing endpoints (\"admin\", \"internal\", or default of \"public\")");
    	options.addOption("d", "debug", false, "Enable debug logging");

    	CommandLineParser parser = new PosixParser();
    	CommandLine cmd = null;
    	Boolean err = false;

    	try {
			cmd = parser.parse( options, args);
		} catch (ParseException e) {
			e.printStackTrace();
			System.exit(1);
		}

    	if ( cmd.hasOption("u") ) {
    		username = cmd.getOptionValue("u");
    	}

    	if ( cmd.hasOption("t") ) {
    		tenantName = cmd.getOptionValue("t");
        }

    	if ( cmd.hasOption("p") ) {
    		password = cmd.getOptionValue("p");
        }

    	if ( !cmd.hasOption("a") ) {
    		System.err.println("Must specify -a or --api!");
    		err = true;
    	} else {
    		apiEndpoint = cmd.getOptionValue("a");
        }

    	if ( cmd.hasOption("f") ) {
    		facing = cmd.getOptionValue("f");
        }

    	if ( cmd.hasOption("d")) {
    		debug = true;
    	}

    	if (err)
    		System.exit(1);
    }

    private void run() {
    	init();
    	showAllTenants();
    	showAllUsers();
    	showAllFlavors();
    	showAllImages();
    	showAllHosts();
    	showAllHypervisors();
    	showAllInstances();

    	System.out.println("Success :-)");
    }

    private void printJson(Object obj) {
		try {
			ObjectWriter writer = mapper.writer().withDefaultPrettyPrinter();
		    System.out.println(writer.writeValueAsString(obj));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

    }

    private void init() {
    	// Create the REST Client Connector, which also handles the JSON API serialization
    	Logger logger = null;
    	if (debug)
    		logger = Logger.getLogger("os");
    	connector = new JerseyConnector(logger);

    	// Create the Keystone Client Resource
		keystone = new Keystone(apiEndpoint, connector);
		UsernamePassword authentication = new UsernamePassword(username, password);

		// Authenticate with Keystone Admin API and get access credentials (especially token)
		access = keystone.tokens()
					.authenticate(authentication)
					.withTenantName(tenantName)
					.execute();

		// Set the Keystone Client Resource to use token when communicating with keystone
		keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));

		// List services
		System.out.println("\n\nServices:");
		Services services = keystone.services().list().execute();
		for (Service service : services) {
			System.out.println("  " + service.getId() + ", " + service.getName() + ", " + service.getDescription());
		}

		// List endpoints, which map to services by the service ID
		System.out.println("\n\nEndpoints:");
		Endpoints endpoints = keystone.endpoints().list().execute();
		for (Endpoint endpoint : endpoints) {
			System.out.println("  " + endpoint.getServiceId() + ", " + endpoint.getAdminURL() + ", " + endpoint.getPublicURL());
		}
    }

    /**
     * Get access to the default tenant, specified with -t or --tenant
     * @return Access
     */
    private Access getAccess() {
    	return access;
    }

    private Access getAccess(Tenant tenant) {
    	if (getAccess().getToken().getTenant().getId() == tenant.getId()) {
    		return getAccess();
    	}

    	// Use our existing token to authenticate with Keystone to create new tenant-specific tokens
		Authentication tokenAuth = new TokenAuthentication(getAccess().getToken().getId());

		// Now, *try* to create a NEW token on this tenant.
		// NOTE: even "admin" users are not authorized on every tenant, though
		//    oddly they are authorized to add themselves to tenants!?
		try {
			return keystone.tokens()
					.authenticate(tokenAuth)
					.withTenantId(tenant.getId())
					.execute();
		} catch (OpenStackResponseException err) {
			System.out.println("\nFailed to access tenant \"" + tenant.getName() + "\" - user must not have authorization for this tenant!");
			return null;  // Cannot access nova
		}
	}

    /**
	 * Create a Nova Client Resource using the default Keystone Admin tenant
	 * @return Nova
	 */
	private Nova createNovaClient() {
		Tenant tenant = getAccess().getToken().getTenant();
		return createNovaClient(tenant);
	}

	/**
	 * Create a Nova Client Resource by authenticating with Keystone to gain
	 * access to the specified tenant.
	 *
	 * Note: if the user does not have access to the tenant, will return null
	 *
	 * @param Tenant who we are binding the Nova to
	 * @return Nova
	 */
	private Nova createNovaClient(Tenant tenant) {
		Access access = getAccess(tenant);
		if (access == null) {
			return null;	// Our user may not have access to this tenant
		}
		String region = null; // Don't care which region

		// Find the appropriate Nova endpoint from the access credentials
		// NOTE: the Nova endpoint is specific to the tenant used to authenticate - cannot see compute resources from other tenants!!!
		String apiEndpoint = KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", region, facing);
		Nova nova = new Nova(apiEndpoint, connector);
		nova.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));

		return nova;
	}

	/**
	 * Create a Glance Client Resource by asking Keystone
	 *
	 * @return Glance
	 */
	private Glance createGlanceClient() {
		Access access = getAccess();
		String region = null; // Don't care which region

		// Find the appropriate Glance endpoint from the access credentials
		String apiEndpoint = KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "image", region, facing);

		if (!apiEndpoint.endsWith("/v1") && !apiEndpoint.endsWith("/v1/") &&
				!apiEndpoint.endsWith("/v2") && !apiEndpoint.endsWith("/v2/")) {
			// FIXME: Why do I need to explicitly add an API version!?
			// Without this a 300 Multiple Choices error is returned
			apiEndpoint += "/v1";
		}
		Glance glance = new Glance(apiEndpoint, connector);
		glance.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));

		return glance;
	}

	private void showAllTenants() {
		System.out.println("\n\nTenants:");
		Tenants tenants = keystone.tenants().list().execute();
		for (Tenant tenant : tenants) {
			System.out.println("  " + tenant.getId() + ", " + tenant.getName() + ", " + tenant.getDescription() + ", " + (tenant.getEnabled() ? "ENABLED" : "DISABLED"));
		}
	}

	private void showAllUsers() {
		System.out.println("\n\nUsers:\n");
		Users users = keystone.users().list().execute();
		for (User user: users) {
			printJson(user);
		}
	}

	private void showAllFlavors() {
		System.out.println("\n\nFlavors:\n");
		Nova nova = createNovaClient();
		Flavors flavors = nova.flavors().list(true/*detail*/).execute();
		for (Flavor flavor : flavors) {
			printJson(flavor);
		}
	}

	private void showAllImages() {
		System.out.println("\n\nImages:\n");
		Glance glance = createGlanceClient();
		Images images = glance.images().list(true/*detail*/).execute();
		for (Image image : images) {
			printJson(image);
		}
	}

	private void showAllHosts() {
		System.out.println("\n\nHosts:");
		HostsExtension hostsResource = new HostsExtension(createNovaClient());
		Hosts hosts = hostsResource.list().execute();
		for (Host host : hosts) {
			printJson(host);
		}
	}

	private void showAllHypervisors() {
		System.out.println("\n\nHypervisors:");
		Nova nova = createNovaClient();

		// No Hypervisors resource, so make an ad-hoc one
		OpenStackRequest<Hypervisors> hypervisorsList = new OpenStackRequest<Hypervisors>(nova, HttpMethod.GET, "/os-hypervisors/detail", null, Hypervisors.class);
		Hypervisors hypervisors = hypervisorsList.execute();
		for (Hypervisor hypervisor : hypervisors) {
			printJson(hypervisor);
		}
	}

	private void showAllInstances() {
		Boolean detail = true; // Access detailed view of Compute resources

		Nova nova = createNovaClient();

		System.out.println("\n\nLogin Token's Tenant's Instances (\"" + tenantName + "\"):");
		Servers instances = nova.servers().list(detail).execute();
		for (Server instance : instances) {
			System.out.println("  " + instance.getId() + ", " + instance.getName() + ", " + instance.getHost());
		}

		Tenants tenants = keystone.tenants().list().execute();
		for (Tenant tenant : tenants) {
			nova = createNovaClient(tenant);
			if (nova == null) continue;

			System.out.println("\n\nInstances for tenant \"" + tenant.getName() + "\":");
			instances = nova.servers().list(detail).execute();
			for (Server instance : instances) {
				printJson(instance);
			}
		}
	}
}


text:
package users

import (
	"fmt"

	"github.com/Sirupsen/logrus"
	"github.com/catalyzeio/cli/commands/invites"
	"github.com/catalyzeio/cli/models"
	"github.com/olekukonko/tablewriter"
	"github.com/pmylund/sortutil"
)

func CmdList(myUsersID string, iu IUsers, ii invites.IInvites) error {
	orgUsers, err := iu.List()
	if err != nil {
		return err
	}
	if orgUsers == nil || len(*orgUsers) == 0 {
		logrus.Println("No users found")
		return nil
	}
	roles, err := ii.ListRoles()
	if err != nil {
		return err
	}
	rolesMap := map[int]string{}
	for _, r := range *roles {
		rolesMap[r.ID] = r.Name
	}

	sortutil.DescByField(*orgUsers, "RoleID")

	data := [][]string{{"EMAIL", "ROLE"}}
	for _, user := range *orgUsers {
		if user.ID == myUsersID {
			data = append(data, []string{user.Email, fmt.Sprintf("%s (you)", rolesMap[user.RoleID])})
		} else {
			data = append(data, []string{user.Email, rolesMap[user.RoleID]})
		}
	}

	table := tablewriter.NewWriter(logrus.StandardLogger().Out)
	table.SetBorder(false)
	table.SetRowLine(false)
	table.SetCenterSeparator("")
	table.SetColumnSeparator("")
	table.SetRowSeparator("")
	table.AppendBulk(data)
	table.Render()
	return nil
}

func (u *SUsers) List() (*[]models.OrgUser, error) {
	headers := u.Settings.HTTPManager.GetHeaders(u.Settings.SessionToken, u.Settings.Version, u.Settings.Pod, u.Settings.UsersID)
	resp, statusCode, err := u.Settings.HTTPManager.Get(nil, fmt.Sprintf("%s%s/orgs/%s/users", u.Settings.AuthHost, u.Settings.AuthHostVersion, u.Settings.OrgID), headers)
	if err != nil {
		return nil, err
	}
	var users []models.OrgUser
	err = u.Settings.HTTPManager.ConvertResp(resp, statusCode, &users)
	if err != nil {
		return nil, err
	}
	return &users, nil
}


text:
<?xml version="1.0" ?>

<!--

-->

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>

        <!--Silvestra locale templating helper-->
        <service id="silvestra_locale.templating_helper.locale" class="Silvestra\Component\Locale\Templating\LocaleTemplatingHelper" public="true">
            <tag name="templating.helper" alias="silvestra_locale" />
        </service>

        <!--Silvestra locale twig extension-->
        <service class="Silvestra\Bundle\LocaleBundle\Twig\Extension\LocaleExtension" public="true">
            <tag name="twig.extension" alias="silvestra_locale" />

            <argument type="service" id="silvestra_locale.templating_helper.locale" />
        </service>

    </services>

</container>


text:
#define FALSE 0
#define TRUE 1

/* Define assembler register types BYTE, WORD, DWORD for C */
/* Note: H2INC.EXE outputs three HI4010 warnings: "identifier is a MASM keyword"
	 when defining these with a typedef.
         I tried preventing that warning, using #ifndef _H2INC, or with info
         from https://msdn.microsoft.com/en-us/library/aa712931.aspx
         or with pragmas, but found no solution that worked.
         So instead, use macros _BYTE, _WORD, _DWORD, and define them
         differently for C (using a typedef) and for H2INC (without that) */
#ifndef _H2INC	/* Compiling in C or C++ programs */
typedef unsigned char	BYTE;	/* 8 bits unsigned character */
typedef unsigned short  WORD;   /* 16-bit unsigned value */
typedef unsigned long   DWORD;  /* 32-bit unsigned integer */
#define _BYTE  BYTE
#define _WORD  WORD
#define _DWORD DWORD
#else		/* Converting to .inc with h2inc.exe */
#define _BYTE unsigned char
#define _WORD unsigned short
#define _DWORD unsigned long
#endif

/*****************************************************************************/
/*		     Definitions generic to all device drivers		     */
/*****************************************************************************/

#pragma pack(1) 	    /* All DOS structures are packed */

typedef struct tagDeviceHeader		/* Device driver header */
    {
    struct tagDeviceHeader far *dhLink;     /* Link to the next driver */
    _WORD dhAttributes;			    /* Device attributes */
    void (near *dhStrategy)();		    /* Strategy-routine offset */
    void (near *dhInterrupt)(); 	    /* Interrupt-routine offset */
    char dhNameOrUnits[8];		    /* Logical device name */
    } DeviceHeader;

typedef struct		    /* Standard request header */
    {
    _BYTE rhLength;		/* Length in bytes of this request header */
    _BYTE rhUnit;		/* Subunit for block device drivers */
    _BYTE rhFunction;		/* Command code */
    _WORD rhStatus;		/* Status word returned by the driver */
    _BYTE rhReserved[8]; 	/* reserved */
    } RequestHeader;

typedef struct		    /* Input/output commands request */
    {
    RequestHeader h;
    _BYTE rwrMediaID;		/* Media descriptor from BPB */
    char far *rwrBuffer;	/* Transfer address */
    _WORD rwrBytesSec;		/* Bytes / sectors count */
    _WORD rwrStartSec;		/* Starting sector */
    char far *rwrVolumeID;	/* Returned pointer on volume ID */
    _DWORD rwrHugeStartSec;	/* Starting sector if rwrStartSec=FFFF */
    } ReadWriteRequest;

typedef struct		    /* Non Destructive Read (Peek) command request */
    {
    RequestHeader h;
    char nrrChar;		/* Character read from device */
    } NDReadRequest;

#define SUCCESS 0x0000
#define BUSY	0x0200
#define ERROR	0x8000

#pragma pack()		    /* Return to default packing */

/* Data prototypes */

extern DeviceHeader deviceHeader;
#ifdef _DEBUG
extern int DebugPort;                   /* Debug port base address */
#endif

/* Function prototypes */

extern int _cdecl Read(ReadWriteRequest far *fpr);
extern int _cdecl Write(ReadWriteRequest far *fpr);
extern int _cdecl Peek(NDReadRequest far *fpr);
extern int _cdecl WStatus(RequestHeader far *fpr);
extern int _cdecl RStatus(RequestHeader far *fpr);


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" PolicyId="urn:oasis:names:tc:xacml:2.0:conformance-test:IIE002:policy1" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-overrides" Version="1.0" xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:policy:schema:os  access_control-xacml-2.0-policy-schema-os.xsd">
    <Description>
        Policy1 for Conformance Test IIE002.
    </Description>
    <Target/>
    <Rule Effect="Deny" RuleId="urn:oasis:names:tc:xacml:2.0:conformance-test:IIE002:rule1">
        <Description>
            A subject whose name is J. Hibbert may not
            read Bart Simpson's medical record.  NOTAPPLICABLE
        </Description>
        <Target>
            <AnyOf>
                <AllOf>
                    <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
                        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">J. Hibbert</AttributeValue>
                        <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
                    </Match>
                </AllOf>
            </AnyOf>
        </Target>
    </Rule>
</Policy>


text:
namespace login {
class ScreenContext;
}

namespace chromeos {

class BaseScreen;
class ErrorScreen;

// Interface that handles notifications received from any of login wizard
// screens.
class BaseScreenDelegate {
 public:
  // Each login screen or a view shown within login wizard view is itself a
  // state. Upon exit each view returns one of the results by calling OnExit()
  // method. Depending on the result and the current view or state login wizard
  // decides what is the next view to show. There must be an exit code for each
  // way to exit the screen for each screen. (Numeric ids are provided to
  // facilitate interpretation of log files only, they are subject to change
  // without notice.)
  enum ExitCodes {
    // "Continue" was pressed on network screen and network is online.
    NETWORK_CONNECTED = 0,
    HID_DETECTION_COMPLETED = 1,
    // Connection failed while trying to load a WebPageScreen.
    CONNECTION_FAILED = 2,
    UPDATE_INSTALLED = 3,
    UPDATE_NOUPDATE = 4,
    UPDATE_ERROR_CHECKING_FOR_UPDATE = 5,
    UPDATE_ERROR_UPDATING = 6,
    USER_IMAGE_SELECTED = 7,
    EULA_ACCEPTED = 8,
    EULA_BACK = 9,
    ENTERPRISE_AUTO_ENROLLMENT_CHECK_COMPLETED = 10,
    ENTERPRISE_ENROLLMENT_COMPLETED = 11,
    ENTERPRISE_ENROLLMENT_BACK = 12,
    RESET_CANCELED = 13,
    KIOSK_AUTOLAUNCH_CANCELED = 14,
    KIOSK_AUTOLAUNCH_CONFIRMED = 15,
    KIOSK_ENABLE_COMPLETED = 16,
    TERMS_OF_SERVICE_DECLINED = 17,
    TERMS_OF_SERVICE_ACCEPTED = 18,
    WRONG_HWID_WARNING_SKIPPED = 19,
    CONTROLLER_PAIRING_FINISHED = 20,
    HOST_PAIRING_FINISHED = 21,
    ENABLE_DEBUGGING_FINISHED = 22,
    ENABLE_DEBUGGING_CANCELED = 23,
    EXIT_CODES_COUNT  // not a real code, must be the last
  };

  // Method called by a screen when user's done with it.
  virtual void OnExit(BaseScreen& screen,
                      ExitCodes exit_code,
                      const ::login::ScreenContext* context) = 0;

  // Forces current screen showing.
  virtual void ShowCurrentScreen() = 0;

  virtual ErrorScreen* GetErrorScreen() = 0;
  virtual void ShowErrorScreen() = 0;
  virtual void HideErrorScreen(BaseScreen* parent_screen) = 0;

 protected:
  virtual ~BaseScreenDelegate() {}
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_BASE_SCREEN_DELEGATE_H_