text:
.class public Landroid/net/cw/CWConstants;
.super Ljava/lang/Object;
.source "CWConstants.java"

# static fields
.field public static final ACTION_CW_REGISTRATION_STATE_CHANGED:Ljava/lang/String; = "android.intent.action.ACTION_CW_REGISTRATION_STATE_CHANGED"

.field public static final ACTION_CW_SIP_INVITE_RESULT:Ljava/lang/String; = "android.intent.action.ACTION_CW_SIP_INVITE_RESULT"

.field public static final CW_SIP_INVITE_FAIL:I = 0xca

.field public static final CW_SIP_INVITE_OK:I = 0xc9

.field public static final CW_SIP_INVITE_TIMEOUT:I = 0xcb

.field public static final EXTRA_CW_REG_EXPIRE:Ljava/lang/String; = "cw_reg_expire"

.field public static final EXTRA_CW_REG_STATE:Ljava/lang/String; = "cw_reg_state"

.field public static final EXTRA_CW_SIP_INVITE_RESULT:Ljava/lang/String; = "cw_sip_invite_result"

.field public static final PROPERTY_CW_DATA_IP:Ljava/lang/String; = "cdma.cw.dataip"

.field public static final PROPERTY_CW_DATA_PORT:Ljava/lang/String; = "cdma.cw.dataport"

.field public static final PROPERTY_CW_STREAM_ID:Ljava/lang/String; = "cdma.cw.streamid"

.field public static final RIL_CW_DEREGISTERING:I = 0x6a

.field public static final RIL_CW_DEREGISTER_FAIL:I = 0x68

.field public static final RIL_CW_DEREGISTER_SUCC:I = 0x67

.field public static final RIL_CW_REGISTERING:I = 0x69

.field public static final RIL_CW_REGISTER_FAIL:I = 0x66

.field public static final RIL_CW_REGISTER_IDLE:I = 0x6c

.field public static final RIL_CW_REGISTER_SUCC:I = 0x65

.field public static final RIL_CW_REGISTER_TIMEOUT:I = 0x6b

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 3
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>net_http (GamedayUtil)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

# File lib/gameday_util.rb, line 66
  def self.net_http
    self.read_config
    if !@@proxy_addr.empty?
      return Net::HTTP::Proxy(@@proxy_addr, @@proxy_port)
    else
      return Net::HTTP
    end
  end

redpajama_set_name: RedPajamaGithub


text:
"""Tests for the distributed values library."""

from absl.testing import parameterized

from tensorflow.python.distribute import combinations
from tensorflow.python.distribute import ps_values
from tensorflow.python.distribute import strategy_combinations
from tensorflow.python.eager import def_function
from tensorflow.python.eager import test
from tensorflow.python.ops import variable_scope
from tensorflow.python.ops import variables as variables_lib

@combinations.generate(
    combinations.combine(
        distribution=[
            strategy_combinations.central_storage_strategy_with_two_gpus
        ],
        mode=["graph", "eager"]))
class AggregatingVariableTest(test.TestCase, parameterized.TestCase):

  def testAssignOutOfScope(self, distribution):
    with distribution.scope():
      aggregating = variables_lib.Variable(1.)
    self.assertIsInstance(aggregating, ps_values.AggregatingVariable)
    self.evaluate(aggregating.assign(3.))
    self.assertEqual(self.evaluate(aggregating.read_value()), 3.)
    self.assertEqual(self.evaluate(aggregating._v.read_value()), 3.)

  def testAssignAdd(self, distribution):
    with distribution.scope():
      v = variable_scope.variable(
          1, aggregation=variables_lib.VariableAggregation.MEAN)
    self.evaluate(variables_lib.global_variables_initializer())

    @def_function.function
    def assign():
      return v.assign_add(2)

    per_replica_results = self.evaluate(
        distribution.experimental_local_results(
            distribution.run(assign)))
    self.assertAllEqual([3], per_replica_results)

if __name__ == "__main__":
  test.main()


text:
include_recipe "sentry::default"
include_recipe "sentry::user"

# Create sentry instance virtualenv and config
sentry_conf "sentry" do
  virtualenv_dir node["sentry"]["virtualenv"]
  user node["sentry"]["user"]
  group node["sentry"]["group"]
  settings node["sentry"]["settings"]
  superusers node["sentry"]["superusers"]
end

node["sentry"]["servers"].each() do |server|

  # Running sentry instance
  sentry_instance "sentry-#{server["port"]}" do
    virtualenv node["sentry"]["virtualenv"]
    user node["sentry"]["user"]
    group node["sentry"]["group"]
    pidfile "/var/run/sentry-#{server["port"]}.pid"
    config node["sentry"]["config"]
    host server["host"]
    port server["port"]
    workers server["workers"]
    gunicorn server["gunicorn"]
    provider server["supervisor"] || node["sentry"]["supervisor"]
  end
end


text:
module HP
  module Cloud
    class CLI < Thor

      map %w(lb:nodes:rm lb:nodes:delete lb:nodes:del) => 'lb:nodes:remove'

      desc "lb:nodes:remove lb_name_or_id node_id [node_id ...]", "Remove the specified load balancer nodes."
      long_desc <<-DESC
  Remove load balancer node by specifying the name or id of the load balancer and the id of the nodes.

Examples:
  hpcloud lb:nodes:remove scale 1044952   # Delete the load balancers ndoe `1044952` from `scale`

Aliases: lb:nodes:rm, lb:nodes:delete, lb:nodes:del
      DESC
      CLI.add_common_options
      define_method "lb:nodes:remove" do |lb_name_or_id, name_or_id, *name_or_ids|
        cli_command(options) {
          name_or_ids = [name_or_id] + name_or_ids
          lb = Lbs.new.get(lb_name_or_id)
          name_or_ids.each{ |name|
            sub_command("removing load balancer node") {
              node = LbNodes.new(lb.id).get(name, false)
              node.load_balancer_id = lb.id
              node.destroy
              @log.display "Removed node '#{name}' from load balancer '#{lb_name_or_id}'."
            }
          }
        }
      end
    end
  end
end


text:
const mixins = require('../../mixins.js');

module.exports = function (values) {
  const stOpts = values.options;

  return [

    // Default Thickness
    ...mixins.createComponentVariations((lumin, palette) => ({
      class: 'tab_control',
      settings: [stOpts.underlineDirtyTabs],
      attributes: ['dirty'],

      parents: [
        {
          attributes: [lumin],
        },
      ],

      'layer2.tint': palette('gray'),
    })),

    {
      class: 'tab_control',
      settings: [stOpts.underlineDirtyTabs],
      attributes: ['dirty', 'selected'],

      'layer2.opacity': 1, // Border - Bottom
    },

    // Thick Thickness
    {
      class: 'tab_control',
      settings: [stOpts.underlineDirtyTabs, stOpts.underlineDirtyTabsThick],
      attributes: ['dirty'],

      'layer2.inner_margin': [0, 0, 0, 2],
    },

    /* support for highlight_modified_tabs setting */

    // Default Thickness
    ...mixins.createComponentVariations((lumin, palette) => ({
      class: 'tab_control',
      settings: ['highlight_modified_tabs'],
      attributes: ['dirty'],

      parents: [
        {
          attributes: [lumin],
        },
      ],

      'layer2.tint': palette('gray'),
    })),

    {
      class: 'tab_control',
      settings: ['highlight_modified_tabs'],
      attributes: ['dirty', 'selected'],

      'layer2.opacity': 1, // Border - Bottom
    },

    // Thick Thickness
    {
      class: 'tab_control',
      settings: ['highlight_modified_tabs', stOpts.underlineDirtyTabsThick],
      attributes: ['dirty'],

      'layer2.inner_margin': [0, 0, 0, 2],
    },
  ];
};


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

		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="generator" content="JsDoc Toolkit" />

		<title>JsDoc Reference - AV.Cloud.BeforeSaveRequest</title>

Class Index
| File Index

Classes

_global_

AV

AV.ACL

AV.Cloud

AV.Cloud.AfterSaveRequest

AV.Cloud.AfterUpdateRequest

AV.Cloud.BeforeDeleteRequest

AV.Cloud.BeforeDeleteResponse

AV.Cloud.BeforeSaveRequest

AV.Cloud.BeforeSaveResponse

AV.Cloud.FunctionRequest

AV.Cloud.FunctionResponse

AV.Collection

AV.Error

AV.Events

AV.FacebookUtils

AV.File

AV.GeoPoint

AV.History

AV.InboxQuery

AV.Insight

AV.Insight.JobQuery

AV.Object

AV.Op

AV.Op.Add

AV.Op.AddUnique

AV.Op.Increment

AV.Op.Relation

AV.Op.Remove

AV.Op.Set

AV.Op.Unset

AV.Push

AV.Query

AV.Relation

AV.Role

AV.Router

AV.SearchQuery

AV.SearchSortBuilder

AV.Status

AV.User

AV.View

avosExpressCookieSession

avosExpressHttpsRedirect

				Class AV.Cloud.BeforeSaveRequest

				A Request object that is passed into the beforeSave function.
Available in Cloud Code only.

Defined in:  cloud.js.

Class Summary

						Constructor Attributes
						Constructor Name and Description

								AV.Cloud.BeforeSaveRequest()

Field Summary

							Field Attributes
							Field Name and Description

								object

The object that is being saved.

								user

If set, the user that made the request.

					Class Detail

						AV.Cloud.BeforeSaveRequest()

					Field Detail

					{AV.Object}
					object

						The object that is being saved.

					{AV.User}
					user

						If set, the user that made the request.

			Documentation generated by JsDoc Toolkit 2.4.0 on Fri Aug 28 2015 11:55:09 GMT+0800 (CST)


text:
FROM brandonsoto/opencv-python
MAINTAINER Brandon Soto <brandon.soto09@gmail.com>

ADD . /videostream
EXPOSE 8081
ENV DISPLAY :0
CMD ["python3", "/videostream/client.py"]


text:
"""
https://www.xilinx.com/support/documentation/data_sheets/ds181_Artix_7_Data_Sheet.pdf
"""


text:
<?php declare(strict_types=1);

namespace Limoncello\Validation\Execution;

use Limoncello\Validation\Contracts\Execution\ContextInterface;
use function assert;
use function count;
use function is_array;

/**
 * @package Limoncello\Validation
 */
final class BlockReplies
{
    /**
     * Rule reply key.
     */
    private const REPLY_SUCCESS_VALUE = 0;

    /**
     * Rule reply key.
     */
    private const REPLY_ERRORS_INFO = self::REPLY_SUCCESS_VALUE + 1;

    /**
     * Error info key.
     */
    public const ERROR_INFO_BLOCK_INDEX = 0;

    /**
     * Error info key.
     */
    public const ERROR_INFO_VALUE = self::ERROR_INFO_BLOCK_INDEX + 1;

    /**
     * Error info key.
     */
    public const ERROR_INFO_CODE = self::ERROR_INFO_VALUE + 1;

    /**
     * Error info key.
     */
    public const ERROR_INFO_MESSAGE_TEMPLATE = self::ERROR_INFO_CODE + 1;

    /**
     * Error info key.
     */
    public const ERROR_INFO_MESSAGE_PARAMETERS = self::ERROR_INFO_MESSAGE_TEMPLATE + 1;

    /**
     * @param mixed $result
     *
     * @return array
     */
    public static function createSuccessReply($result): array
    {
        return [
            static::REPLY_SUCCESS_VALUE => $result,
            static::REPLY_ERRORS_INFO   => null,
        ];
    }

    /**
     * @return array
     */
    public static function createStartSuccessReply(): array
    {
        return [];
    }

    /**
     * @return array
     */
    public static function createEndSuccessReply(): array
    {
        return [];
    }

    /**
     * @param ContextInterface $context
     * @param mixed            $errorValue
     * @param int              $errorCode
     * @param string           $messageTemplate
     * @param array            $messageParams
     *
     * @return array
     */
    public static function createErrorReply(
        ContextInterface $context,
        $errorValue,
        int $errorCode,
        string $messageTemplate,
        array $messageParams
    ): array {
        return [
            static::REPLY_SUCCESS_VALUE => null,
            static::REPLY_ERRORS_INFO   => [
                static::createErrorInfoEntry(
                    $context->getCurrentBlockId(),
                    $errorValue,
                    $errorCode,
                    $messageTemplate,
                    $messageParams
                ),
            ],
        ];
    }

    /**
     * @param ContextInterface $context
     * @param int              $errorCode
     * @param string           $messageTemplate
     * @param array            $messageParams
     *
     * @return array
     */
    public static function createStartErrorReply(
        ContextInterface $context,
        int $errorCode,
        string $messageTemplate,
        array $messageParams
    ): array {
        $value = null;

        return [
            static::createErrorInfoEntry(
                $context->getCurrentBlockId(),
                $value,
                $errorCode,
                $messageTemplate,
                $messageParams
            ),
        ];
    }

    /**
     * @param ContextInterface $context
     * @param int              $errorCode
     * @param string           $messageTemplate
     * @param array            $messageParams
     *
     * @return array
     */
    public static function createEndErrorReply(
        ContextInterface $context,
        int $errorCode,
        string $messageTemplate,
        array $messageParams
    ): array {
        $value = null;

        return [
            static::createErrorInfoEntry(
                $context->getCurrentBlockId(),
                $value,
                $errorCode,
                $messageTemplate,
                $messageParams
            ),
        ];
    }

    /**
     * @param int    $blockId
     * @param mixed  $value
     * @param int    $code
     * @param string $messageTemplate
     * @param array  $messageParams
     *
     * @return array
     */
    protected static function createErrorInfoEntry(
        int $blockId,
        $value,
        int $code,
        string $messageTemplate,
        array $messageParams
    ): array {
        return [
            static::ERROR_INFO_BLOCK_INDEX        => $blockId,
            static::ERROR_INFO_VALUE              => $value,
            static::ERROR_INFO_CODE               => $code,
            static::ERROR_INFO_MESSAGE_TEMPLATE   => $messageTemplate,
            static::ERROR_INFO_MESSAGE_PARAMETERS => $messageParams,
        ];
    }

    /**
     * @param array $result
     *
     * @return bool
     */
    public static function isResultSuccessful(array $result): bool
    {
        assert(
            count($result) === 2 &&
            ($result[static::REPLY_ERRORS_INFO] === null || is_array($result[static::REPLY_ERRORS_INFO]) === true)
        );

        // if error code is `null`
        $isOk = $result[static::REPLY_ERRORS_INFO] === null;

        return $isOk;
    }

    /**
     * @param array $result
     *
     * @return mixed
     */
    public static function extractResultOutput(array $result)
    {
        // extracting result only make sense when error is `null`.
        assert(static::isResultSuccessful($result) === true && $result[static::REPLY_ERRORS_INFO] === null);

        $value = $result[static::REPLY_SUCCESS_VALUE];

        return $value;
    }

    /**
     * @param array $result
     *
     * @return array
     */
    public static function extractResultErrorsInfo(array $result): array
    {
        assert(
            count($result) === 2 &&
            $result[static::REPLY_SUCCESS_VALUE] === null &&
            is_array($result[static::REPLY_ERRORS_INFO]) === true &&
            empty($result[static::REPLY_ERRORS_INFO]) === false
        );

        $value = $result[static::REPLY_ERRORS_INFO];

        return $value;
    }
}


text:
class Vote < ActiveRecord::Base
  attr_accessible :user_id, :vote_type

  belongs_to :user
  belongs_to :votable, :polymorphic => true
end


text:
"""
TimestampedGeoJson plugin
--------------

Add a timestamped geojson feature collection on a folium map.
This is based on Leaflet.TimeDimension.

https://github.com/socib/Leaflet.TimeDimension

A geo-json is timestamped if:
    * it contains only features of types LineString, MultiPoint,
      MultiLineString and MultiPolygon.
    * each feature has a "times" property with the same length as the
      coordinates array.
    * each element of each "times" property is a timestamp in ms since epoch,
     or in ISO string.  Eventually, you may have Point features with a
     "times" property being an array of length 1.

"""

import json
from jinja2 import Template

from folium.element import MacroElement, Figure, JavascriptLink, CssLink

class TimestampedGeoJson(MacroElement):
    def __init__(self, data, transition_time=200, loop=True, auto_play=True):
        """Creates a TimestampedGeoJson plugin to append into a map with
        Map.add_children.

        Parameters
        ----------
            data: file, dict or str.
                The timestamped geo-json data you want to plot.

                If file, then data will be read in the file and fully embedded in Leaflet's javascript.
                If dict, then data will be converted to json and embeded in the javascript.
                If str, then data will be passed to the javascript as-is.

                A geo-json is timestamped if:
                    * it contains only features of types LineString,
                      MultiPoint, MultiLineString and MultiPolygon.
                    * each feature has a "times" property with the same length
                      as the coordinates array.
                    * each element of each "times" property is a timestamp in
                      ms since epoch, or in ISO string.
                    Eventually, you may have Point features with a "times"
                    property being an array of length 1.

                examples :
                    # providing file
                    TimestampedGeoJson(open('foo.json'))

                    # providing dict
                    TimestampedGeoJson({
                        "type": "FeatureCollection",
                            "features": [
                                {
                                    "type": "Feature",
                                    "geometry": {
                                        "type": "LineString",
                                        "coordinates": [[-70,-25],[-70,35],[70,35]],
                                        },
                                    "properties": {
                                        "times": [1435708800000, 1435795200000, 1435881600000]
                                        }
                                    }
                                ]
                            })

                    # providing string
                    TimestampedGeoJson(open('foo.json').read())
            transition_time : int, default 200.
                The duration in ms of a transition from one timestamp to another.
            loop : bool, default True
                Whether the animation shall loop.
            auto_play : bool, default True
                Whether the animation shall start automatically at startup.

        """
        super(TimestampedGeoJson, self).__init__()
        self._name = 'TimestampedGeoJson'

        # self.template = self.env.get_template('timestamped_geo_json.tpl')
        if 'read' in dir(data):
            self.data = data.read()
        elif type(data) is dict:
            self.data = json.dumps(data)
        else:
            self.data = data
        self.transition_time = int(transition_time)
        self.loop = bool(loop)
        self.auto_play = bool(auto_play)

        self._template = Template("""
        {% macro script(this, kwargs) %}
            {{this._parent.get_name()}}.timeDimension = L.timeDimension();
            {{this._parent.get_name()}}.timeDimensionControl = L.control.timeDimension({
                position: 'bottomleft',
                autoPlay: {{'true' if this.auto_play else 'false'}},
                playerOptions: {
                    transitionTime: {{this.transition_time}},
                    loop: {{'true' if this.loop else 'false'}}}
                    });
            {{this._parent.get_name()}}.addControl({{this._parent.get_name()}}.timeDimensionControl);

            var {{this.get_name()}} = L.timeDimension.layer.geoJson(
                L.geoJson({{this.data}}),
                {updateTimeDimension: true,addlastPoint: true}
                ).addTo({{this._parent.get_name()}});
        {% endmacro %}
        """)

    def render(self, **kwargs):
        super(TimestampedGeoJson, self).render()

        figure = self.get_root()
        assert isinstance(figure, Figure), ("You cannot render this Element "
                                            "if it's not in a Figure.")

        figure.header.add_children(
            JavascriptLink("https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"),
            name='jquery2.0.0')

        figure.header.add_children(
            JavascriptLink("https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"),
            name='jqueryui1.10.2')

        figure.header.add_children(
            JavascriptLink("https://raw.githubusercontent.com/nezasa/iso8601-js-period/master/iso8601.min.js"),
            name='iso8601')

        figure.header.add_children(
            JavascriptLink("https://raw.githubusercontent.com/socib/Leaflet.TimeDimension/master/dist/leaflet.timedimension.min.js"),
            name='leaflet.timedimension')

        figure.header.add_children(
            CssLink("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css"),
            name='highlight.js_css')

        figure.header.add_children(
            CssLink("http://apps.socib.es/Leaflet.TimeDimension/dist/leaflet.timedimension.control.min.css"),
            name='leaflet.timedimension_css')


text:
    impac.dashboard.create.create_new_dashboard

        impac.dashboard.create.name

          <input type="text" class="form-control" ng-model="dashboard.name" placeholder="{{'impac.dashboard.create.placeholder.cash_accounts' | translate}}"></input>

        impac.dashboard.create.source

            impac.dashboard.create.current_company
            impac.dashboard.create.multi_company

              <input type="checkbox" ng-model="org.selected" ng-disabled="!org.acl.related.impac.show" />
              {{ org.name }}

      <dashboard-templates-selector on-select="templates.select($event)" ng-if="templates.enabled"></dashboard-templates-selector>

  <button class="btn btn-default" ng-click="$close()" ng-disabled="loading" translate>impac.dashboard.create.cancel</button>
  <button class="btn btn-success" ng-click="createDashboard(organizations)" ng-disabled="invalid() || loading">

    {{ 'impac.dashboard.create.create' | translate }}
  </button>


text:
namespace CGAL {

template <typename Cycle_circulator, typename Planar_map>
typename Planar_map::Face_handle
add_cycle( Cycle_circulator c, typename Planar_map::Face_handle outer_cycle, Planar_map& pm) {

  typedef typename Planar_map::X_curve X_curve;
  typedef typename Planar_map::Halfedge_handle Halfedge_handle;
  typedef typename Planar_map::Face_handle Face_handle;
  typedef typename Planar_map::Halfedge_around_vertex_circulator Halfedge_around_vertex_circulator;

  // edge 1
  Cycle_circulator curr(c), prev(curr);
  curr++;
  CGAL_assertion( curr != prev);
  X_curve first_segment( *prev, *curr);
  CGAL_NEF_TRACEN("inserting first segment "<<first_segment);
  Halfedge_handle first_edge =
    pm.insert_in_face_interior( first_segment, outer_cycle);

  // edge 2 ... n-1
  Cycle_circulator done(c);
  done--;
  Halfedge_handle edge = first_edge;
  while( curr != done) {
    prev++;
    curr++;
    X_curve segment( *prev, *curr);
    Halfedge_around_vertex_circulator hav(edge->target()->incident_halfedges()), hend(hav);
    CGAL_For_all( hav, hend)
      if( hav->source()->point() == segment.target())
	break;
    if( hav != hend) { // segment already inserted
      CGAL_NEF_TRACEN("segment already inserted (bubble): "<<segment);
      edge = hav->twin();
    }
    else if( edge->source()->point() == segment.target()) {
      CGAL_NEF_TRACEN("segment already inserted (dagger): "<<segment);
      edge = edge->twin();
    }
    else {
      CGAL_NEF_TRACEN("interseting segment "<<segment);
      edge = pm.insert_from_vertex( segment, edge);
    }
  }

  // edge n
  CGAL_assertion( *c == first_edge->source()->point());
  X_curve last_segment( *curr, *c);
  Halfedge_around_vertex_circulator hav(edge->target()->incident_halfedges()), hend(hav);
  CGAL_For_all( hav, hend)
    if( hav->source()->point() == last_segment.target())
      break;
  Halfedge_handle last_edge;
  if( hav != hend) { // segment already inserted
    CGAL_NEF_TRACEN("last segment already inserted (bubble): "<<last_segment);
    last_edge = hav->twin();
  }
    else if( edge->source()->point() == last_segment.target()) {
      CGAL_NEF_TRACEN("last segment already inserted (dagger): "<<last_segment);
      last_edge = edge->twin();
    }
  else {
    CGAL_NEF_TRACEN("inserting last segment "<<last_segment);
    last_edge = pm.insert_at_vertices( last_segment, edge->target(), first_edge->source());
  }

  Face_handle face = last_edge->face();
  if( face->is_unbounded())
    face = last_edge->twin()->face();

  return face;
}

template <typename SNC_structure, typename Planar_map, typename Projector>
typename Planar_map::Face_handle
add_hole( typename SNC_structure::Halffacet_cycle_const_iterator ci,
	  typename Planar_map::Face_handle face, Planar_map& pm,
	  Projector projector) {

  typedef typename Planar_map::Face_handle Face_handle;
  typedef typename SNC_structure::SNC_decorator SNC_decorator;
  typedef typename SNC_structure::SHalfedge_const_handle SHalfedge_const_handle;
  typedef typename SNC_structure::SHalfedge_around_facet_const_circulator
    SHalfedge_around_facet_const_circulator;

  typedef typename SNC_structure::Kernel Kernel;
  typedef typename Kernel::Point_2 Point_2;
  typedef typename Kernel::Point_3 Point_3;

  typedef std::vector<Point_2> Point_2_vector;
  typedef typename Point_2_vector::const_iterator Point_2_vector_iterator;
  typedef Circulator_from_iterator<Point_2_vector_iterator> Circulator;

  SNC_decorator D;
  Face_handle hole;
  if( ci.is_shalfedge()) {
    SHalfedge_const_handle se(ci);
    SHalfedge_around_facet_const_circulator sc(se), send(sc);
    Point_2_vector cycle;
    cycle.reserve(circulator_distance(sc, send));
    CGAL_For_all( sc, send)
      cycle.push_back(projector(sc->source()->source()->point()));
    CGAL_NEF_TRACEN("number of vertices on cycle: "<<circulator_distance( sc, send));
#ifdef _DEBUG
    //CGAL_NEF_TRACEN("vertices on cycle:");
    //std::copy( cycle.begin(), cycle.end(), std::ostream_iterator<Point_2>( std::cerr, "\n"));
#endif
    hole = add_cycle( Circulator(cycle.begin(), cycle.end()), face, pm);
  }
  else if(ci.is_shalfloop()) {
    CGAL_warning_msg( 0, "isolated points are not supported on planar maps");
  }
  else
    CGAL_error_msg( "wrong handle");
  return hole;
}

template <typename SNC_structure, typename Planar_map, typename Projector>
typename Planar_map::Face_handle
add_face( typename SNC_structure::Halffacet_cycle_const_iterator ci,
	   typename Planar_map::Face_handle face, Planar_map& pm,
	   Projector projector) {
  typedef typename SNC_structure::SHalfedge_const_handle SHalfedge_const_handle;
  typedef typename SNC_structure::SHalfedge_around_facet_const_circulator
    SHalfedge_around_facet_const_circulator;
  CGAL_precondition( ci.is_shalfedge());
  CGAL_assertion_code(SHalfedge_const_handle se(ci));
  CGAL_assertion_code(SHalfedge_around_facet_const_circulator sc(se));
  CGAL_assertion_code(SHalfedge_around_facet_const_circulator send(sc));
  CGAL_precondition( circulator_distance(sc, send) > 2);
  return add_hole<SNC_structure>( ci, face, pm, projector);
}

template <typename SNC_structure, typename Planar_map, typename Projector>
typename Planar_map::Face_handle
pm_from_nef3_facet( typename SNC_structure::Halffacet_const_handle f,
		    Planar_map& pm,
		    Projector projector) {
  typedef typename SNC_structure::Halffacet_cycle_const_iterator
    Halffacet_cycle_const_iterator;
  typedef typename Planar_map::Face_handle Face_handle;

  Halffacet_cycle_const_iterator hci = f->facet_cycles_begin();
  CGAL_NEF_TRACEN("adding outer boundary...");
  Face_handle pm_face = add_face<SNC_structure>
    ( hci, pm.unbounded_face(), pm, projector);
  ++hci;
  CGAL_assertion( !pm_face->is_unbounded());
  for( ; hci != f->facet_cycles_end(); ++hci) {
    CGAL_NEF_TRACEN("adding hole...");
    add_hole<SNC_structure>( hci, pm_face, pm, projector);
  }
  return pm_face;
}

} //namespace CGAL

#endif // PM_FROM_NEF3_FACET_2_H


text:
import React from 'react'
import PropTypes from 'prop-types';

export class Human extends React.Component
{
    render() {
        return (

Human Name: {this.props.name}

                    Human Age : {this.props.age}

Human Activites: {this.props.activites.name}

                {this.props.activites.languages.map((language , i) =>
{language}
)}

        )
    }
}

Human.propTypes ={
    name : PropTypes.string,
    age: PropTypes.number,
    activites: PropTypes.object
}


text:
from boto.swf.exceptions import SWFResponseError, SWFTypeAlreadyExistsError

from swf import exceptions
from swf.constants import REGISTERED
from swf.exceptions import AlreadyExistsError, DoesNotExistError, ResponseError, raises
from swf.models import BaseModel
from swf.models.base import ModelDiff
from swf.utils import immutable

class ActivityTypeDoesNotExist(Exception):
    pass

@immutable
class ActivityType(BaseModel):
    """ActivityType wrapper

    :param  domain: Domain the workflow type should be registered in
    :type   domain: swf.models.Domain

    :param  name: name of the ActivityType
    :type   name: str

    :param  version: version of the ActivityType
    :type   version: str

    :param  status: ActivityType status
    :type   status: swf.constants.{REGISTERED, DEPRECATED}

    :param  description: ActivityType description
    :type   description: str | None

    :param   creation_date: creation date of the current ActivityType
    :type    creation_date: float (timestamp)

    :param   deprecation_date: deprecation date of ActivityType
    :type    deprecation_date: float (timestamp)

    :param  task_list: specifies the default task list to use for scheduling
                       tasks of this activity type.
    :type   task_list: str

    :param  task_heartbeat_timeout: default maximum time before which a worker
                                    processing a task of this type must report
                                    progress by calling RecordActivityTaskHeartbeat.
    :type   task_heartbeat_timeout: int

    :param  task_schedule_to_close_timeout: default maximum duration for a task
                                            of this activity type.
    :type   task_schedule_to_close_timeout: int

    :param  task_schedule_to_start_timeout: default maximum duration that a
                                            task of this activity type can wait
                                            before being assigned to a worker.
    :type   task_schedule_to_start_timeout: int

    :param   task_start_to_close_timeout: default maximum duration that a
                                          worker can take to process tasks of
                                          this activity type.
    :type    task_start_to_close_timeout: int
    """

    kind = "type"

    __slots__ = [
        "domain",
        "name",
        "version",
        "status",
        "description",
        "creation_date",
        "deprecation_date",
        "task_list",
        "task_heartbeat_timeout",
        "task_schedule_to_close_timeout",
        "task_schedule_to_start_timeout",
        "task_start_to_close_timeout",
    ]

    def __init__(
        self,
        domain,
        name,
        version,
        status=REGISTERED,
        description=None,
        creation_date=0.0,
        deprecation_date=0.0,
        task_list=None,
        task_heartbeat_timeout=0,
        task_schedule_to_close_timeout=0,
        task_schedule_to_start_timeout=0,
        task_start_to_close_timeout=0,
        *args,
        **kwargs
    ):

        self.domain = domain
        self.name = name
        self.version = version
        self.status = status
        self.description = description

        self.creation_date = creation_date
        self.deprecation_date = deprecation_date

        self.task_list = task_list
        self.task_heartbeat_timeout = task_heartbeat_timeout
        self.task_schedule_to_close_timeout = task_schedule_to_close_timeout
        self.task_schedule_to_start_timeout = task_schedule_to_start_timeout
        self.task_start_to_close_timeout = task_start_to_close_timeout

        # immutable decorator rebinds class name,
        # so have to use generic self.__class__
        super(self.__class__, self).__init__(*args, **kwargs)

    def _diff(self):
        """Checks for differences between ActivityType instance
        and upstream version

        :returns: A list (swf.models.base.ModelDiff) namedtuple describing
                  differences
        :rtype: ModelDiff
        """
        try:
            description = self.connection.describe_activity_type(
                self.domain.name, self.name, self.version
            )
        except SWFResponseError as err:
            if err.error_code == "UnknownResourceFault":
                raise DoesNotExistError("Remote ActivityType does not exist")

            raise ResponseError(err.body["message"])

        info = description["typeInfo"]
        config = description["configuration"]

        return ModelDiff(
            ("name", self.name, info["activityType"]["name"]),
            ("version", self.version, info["activityType"]["version"]),
            ("status", self.status, info["status"]),
            ("description", self.description, info["description"]),
            ("creation_date", self.creation_date, info["creationDate"]),
            ("deprecation_date", self.deprecation_date, info["deprecationDate"]),
            ("task_list", self.task_list, config["defaultTaskList"]["name"]),
            (
                "task_heartbeat_timeout",
                self.task_heartbeat_timeout,
                config["defaultTaskHeartbeatTimeout"],
            ),
            (
                "task_schedule_to_close_timeout",
                self.task_schedule_to_close_timeout,
                config["defaultTaskScheduleToCloseTimeout"],
            ),
            (
                "task_schedule_to_start_timeout",
                self.task_schedule_to_start_timeout,
                config["defaultTaskScheduleToStartTimeout"],
            ),
            (
                "task_start_to_close_timeout",
                self.task_start_to_close_timeout,
                config["defaultTaskStartToCloseTimeout"],
            ),
        )

    @property
    @exceptions.is_not(ActivityTypeDoesNotExist)
    @exceptions.catch(
        SWFResponseError,
        raises(
            ActivityTypeDoesNotExist,
            when=exceptions.is_unknown("ActivityType"),
            extract=exceptions.extract_resource,
        ),
    )
    def exists(self):
        """Checks if the ActivityType exists amazon-side

        :rtype: bool
        """
        self.connection.describe_activity_type(
            self.domain.name, self.name, self.version
        )
        return True

    def save(self):
        """Creates the activity type amazon side"""
        try:
            self.connection.register_activity_type(
                self.domain.name,
                self.name,
                self.version,
                task_list=str(self.task_list),
                default_task_heartbeat_timeout=str(self.task_heartbeat_timeout),
                default_task_schedule_to_close_timeout=str(
                    self.task_schedule_to_close_timeout
                ),
                default_task_schedule_to_start_timeout=str(
                    self.task_schedule_to_start_timeout
                ),
                default_task_start_to_close_timeout=str(
                    self.task_start_to_close_timeout
                ),
                description=self.description,
            )
        except SWFTypeAlreadyExistsError as err:
            raise AlreadyExistsError("{} already exists".format(self))
        except SWFResponseError as err:
            if err.error_code in ["UnknownResourceFault", "TypeDeprecatedFault"]:
                raise DoesNotExistError(err.body["message"])
            raise

    @exceptions.catch(
        SWFResponseError,
        raises(
            ActivityTypeDoesNotExist,
            when=exceptions.is_unknown("ActivityType"),
            extract=exceptions.extract_resource,
        ),
    )
    def delete(self):
        """Deprecates the domain amazon side"""
        self.connection.deprecate_activity_type(
            self.domain.name, self.name, self.version
        )

    def upstream(self):
        from swf.querysets.activity import ActivityTypeQuerySet

        qs = ActivityTypeQuerySet(self.domain)
        return qs.get(self.name, self.version)

    def __repr__(self):
        return "<{} domain={} name={} version={} status={}>".format(
            self.__class__.__name__,
            self.domain.name,
            self.name,
            self.version,
            self.status,
        )

@immutable
class ActivityTask(BaseModel):
    __slots__ = [
        "domain",
        "task_list",
        "task_token",
        "activity_type",
        "workflow_execution",
        "input",
        "activity_id",
        "started_event_id",
    ]

    def __init__(
        self,
        domain,
        task_list,
        task_token=None,
        activity_type=None,
        workflow_execution=None,
        input=None,
        activity_id=None,
        started_event_id=None,
        context=None,
    ):
        self.domain = domain
        self.task_list = task_list

        self.task_token = task_token
        self.activity_type = activity_type
        self.workflow_execution = workflow_execution
        self.input = input
        self.activity_id = activity_id
        self.started_event_id = started_event_id

        self.context = context

    @classmethod
    def from_poll(cls, domain, task_list, data):
        from .workflow import WorkflowExecution

        activity_type = ActivityType(
            domain, data["activityType"]["name"], data["activityType"]["version"]
        )

        workflow_execution = WorkflowExecution(
            domain,
            data["workflowExecution"]["workflowId"],
            data["workflowExecution"]["runId"],
        )

        return cls(
            domain,
            task_list,
            task_token=data["taskToken"],
            activity_type=activity_type,
            workflow_execution=workflow_execution,
            input=data.get("input"),
            activity_id=data["activityId"],
            started_event_id=data["startedEventId"],
            context=data,
        )


text:
`cd` to this directory and run either `node area-charts.js` or `node bar-chart.js`.

Then go to `0.0.0.0:8080` in your browser to see the charts.


text:
import React from 'react';
import PropTypes from 'prop-types';

import { st, classes } from './FeatureList.st.css';
import { dataHooks } from './constants';

import FluidColumns from '../common/FluidColumns';
import Text from '../Text';

/** FeatureList is a group of layouts that displays image, description and title. It's used in a footer of a marketing page to list product features. */
class FeatureList extends React.Component {
  render() {
    const { dataHook, className, features, cols } = this.props;
    return (

        <FluidColumns cols={cols}>
          {features.map((feature, index) => {
            return (
              <FeatureItem
                dataHook={dataHooks.feature}
                key={index}
                index={index}
                image={feature.image}
                title={feature.title}
                text={feature.text}
              />
            );
          })}
        </FluidColumns>

    );
  }
}

const FeatureItem = ({ dataHook, index, image, title, text }) => (

    {image && (
      <div
        className={classes.featureItemImageContainer}
        data-hook={`${dataHooks.featureImage}${index}`}
        children={image}
      />
    )}

      {title && (

          <Text
            dataHook={`${dataHooks.featureTitle}${index}`}
            size="medium"
            weight="bold"
          >
            {title}
          </Text>

      )}
      {text && (
        <Text dataHook={`${dataHooks.featureText}${index}`} size="small">
          {text}
        </Text>
      )}

);

FeatureList.displayName = 'FeatureList';

FeatureList.propTypes = {
  /** Applied as data-hook HTML attribute that can be used in the tests */
  dataHook: PropTypes.string,

  /** A css class to be applied to the component's root element */
  className: PropTypes.string,

  /** Define the number of columns. It is used for the grid in order to define how many features will be displayed in a row. The default value is 3. */
  cols: PropTypes.number,

  /**
   * Array of features
   *  * `image` - the feature image.
   *  * `title` - the feature title.
   *  * `text` - the feature content.
   */
  features: PropTypes.arrayOf(
    PropTypes.shape({
      image: PropTypes.node,
      title: PropTypes.string,
      text: PropTypes.string,
    }),
  ),
};

FeatureList.defaultProps = {
  cols: 3,
  features: [],
};

export default FeatureList;


text:
'use strict';

const fs = require('fs');
const path = require('path');
const util = require('util');
const fixtures = path.join.bind(path, __dirname, 'fixtures');
const Comments = require('..');
const comments = new Comments();

const str = `class Prompt {

  /**
   * Returns the status of the prompt.
   *
   * @return {String} Object with prompt \`status\`, \`cursor\`, \`value\`, \`typed\` and \`error\` (if one exists).
   * @api public
   */

  set status(value) {
    throw new Error('prompt.status is a getter and may not be defined');
  }
  get status() {
    if (this.aborted) return 'aborted';
    if (this.answered) return 'answered';
    return 'pending';
  }
}`;

const ast = comments.parse(str);
console.log(util.inspect(ast, { depth: null, maxArrayLength: null }));


text:
package com.kryptnostic.directory.v1.model;

import java.math.BigInteger;
import java.security.SecureRandom;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

public final class ReservationToken {
    private static final SecureRandom random        = new SecureRandom();
    private static final Integer      N_SECURE_BITS = 130;
    private static final Integer      ENCODING      = 32;
    private final String              value;

    @JsonCreator
    private ReservationToken( String value ) {
        this.value = value;
    }

    @JsonValue
    public String getValue() {
        return value;
    }

    public static ReservationToken getSecureToken() {
        return new ReservationToken( new BigInteger( N_SECURE_BITS, random ).toString( ENCODING ) );
    }

    public static ReservationToken fromValue( final String value ) {
        return new ReservationToken( value );
    }

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

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

}


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="latest_ob.xsl" type="text/xsl"?>
<current_observation version="1.0"
	 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:noNamespaceSchemaLocation="http://www.weather.gov/view/current_observation.xsd">
	<credit>NOAA's National Weather Service</credit>
	<credit_URL>http://weather.gov/</credit_URL>
	<image>
		<url>http://weather.gov/images/xml_logo.gif</url>
		<title>NOAA's National Weather Service</title>
		<link>http://weather.gov</link>
	</image>
	<suggested_pickup>15 minutes after the hour</suggested_pickup>
	<suggested_pickup_period>60</suggested_pickup_period>
	<location>Annapolis, United States Naval Academy, MD</location>
	<station_id>KNAK</station_id>
	<latitude>38.99125</latitude>
	<longitude>-76.48907</longitude>
	<observation_time>Last Updated on Jan 4 2016, 9:54 pm EST</observation_time>
        <observation_time_rfc822>Mon, 04 Jan 2016 21:54:00 -0500</observation_time_rfc822>
	<weather>Fair</weather>
	<temperature_string>25.0 F (-3.9 C)</temperature_string>
	<temp_f>25.0</temp_f>
	<temp_c>-3.9</temp_c>
	<relative_humidity>55</relative_humidity>
	<wind_string>from the North at 18.4 gusting to 27.6 MPH (16 gusting to 24 KT)</wind_string>
	<wind_dir>North</wind_dir>
	<wind_degrees>350</wind_degrees>
	<wind_mph>18.4</wind_mph>
	<wind_gust_mph>27.6</wind_gust_mph>
	<wind_kt>16</wind_kt>
	<wind_gust_kt>24</wind_gust_kt>
	<pressure_string>1028.6 mb</pressure_string>
	<pressure_mb>1028.6</pressure_mb>
	<pressure_in>30.37</pressure_in>
	<dewpoint_string>10.9 F (-11.7 C)</dewpoint_string>
	<dewpoint_f>10.9</dewpoint_f>
	<dewpoint_c>-11.7</dewpoint_c>
	<windchill_string>11 F (-12 C)</windchill_string>
      	<windchill_f>11</windchill_f>
      	<windchill_c>-12</windchill_c>
	<visibility_mi>10.00</visibility_mi>
 	<icon_url_base>http://forecast.weather.gov/images/wtf/small/</icon_url_base>
	<two_day_history_url>http://www.weather.gov/data/obhistory/KNAK.html</two_day_history_url>
	<icon_url_name>nskc.png</icon_url_name>
	<ob_url>http://www.weather.gov/data/METAR/KNAK.1.txt</ob_url>
	<disclaimer_url>http://weather.gov/disclaimer.html</disclaimer_url>
	<copyright_url>http://weather.gov/disclaimer.html</copyright_url>
	<privacy_policy_url>http://weather.gov/notice.html</privacy_policy_url>
</current_observation>


text:
typedef struct font_character font_character;
typedef struct font_kerning font_kerning;

typedef struct font_data font_data;

typedef struct loaded_font loaded_font;

struct font_character
{
    uint32 id;
    uint16 source_x;
    uint16 source_y;
    uint16 source_w;
    uint16 source_h;

    int16 offset_x;
    int16 offset_y;
    int16 advance;

    uint8 page;
    uint8 channel;
};

struct font_kerning
{
    uint32 first;
    uint32 second;
    int16 amount;
};

struct font_data
{
    uint16 size;

    int16 line_height;
    int16 baseline;

    uint16 page_count;
    char** page_names;

    uint32 character_count;
    font_character* characters;

    uint32 kerning_count;
    font_kerning* kerning;
};

struct loaded_font
{
    font_data data;

    loaded_texture* textures;
    material* materials;
};

loaded_font
load_font(gl_functions* gl, font_data data);

font_data
font_create_from_file(char* path);

font_character*
font_get_character(font_data* font, uint32 character);

font_kerning*
font_get_kerning(font_data* font, uint32 first, uint32 second);

vector2
font_measure_text(font_data* font, real32 size, char* text);

void
font_data_free(font_data* font);

#endif // FONT_H_INCLUDED


text:
extern crate build;
fn main() {
    build::link("vss_uuid", true)
}


text:
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
    public bool CheckValidationResult(
        ServicePoint srvPoint, X509Certificate certificate,
        WebRequest request, int certificateProblem) {
        return true;
    }
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
$userName=$args[0]
$password= ConvertTo-SecureString -AsPlainText $args[1] -Force
$creds=New-Object System.Management.Automation.PSCredential -ArgumentList $userName, $password
$url=$args[2]
$api="/wapi/v2.6/adminuser"
$filter="?name="+$user
$uri=$url+$api+$filter
try {
    Invoke-RestMethod -Uri $uri -Credential $creds | Out-Null
}
catch [System.Net.WebException] {
    Write-Debug "----- Exception -----"
    Write-Debug  $_.Exception
    Write-Debug  $_.Exception.Response.StatusCode
    Write-Debug  $_.Exception.Response.StatusDescription
    $result = $_.Exception.Response.GetResponseStream()
    $reader = New-Object System.IO.StreamReader($result)
    $reader.BaseStream.Position = 0
    $reader.DiscardBufferedData()
    $responseBody = $reader.ReadToEnd()
}
if($responseBody.Length -eq 0) {
    return $true
}
else {
    throw "Heartbeat Failed: "+$responseBody.Error
}


text:
const glob = require("glob");
const path = require("path");
const test = require("tape");
const load = require("load-json-file");
const shapely = require("boolean-shapely");
const disjoint = require("./index").default;

test("turf-boolean-disjoint", (t) => {
  // True Fixtures
  glob
    .sync(path.join(__dirname, "test", "true", "**", "*.geojson"))
    .forEach((filepath) => {
      const name = path.parse(filepath).name;
      const geojson = load.sync(filepath);
      const feature1 = geojson.features[0];
      const feature2 = geojson.features[1];
      const result = disjoint(feature1, feature2);

      if (process.env.SHAPELY)
        shapely
          .disjoint(feature1, feature2)
          .then((result) => t.true(result, "[true] shapely - " + name));
      t.true(result, "[true] " + name);
    });
  // False Fixtures
  glob
    .sync(path.join(__dirname, "test", "false", "**", "*.geojson"))
    .forEach((filepath) => {
      const name = path.parse(filepath).name;
      const geojson = load.sync(filepath);
      const feature1 = geojson.features[0];
      const feature2 = geojson.features[1];
      const result = disjoint(feature1, feature2);

      if (process.env.SHAPELY)
        shapely
          .disjoint(feature1, feature2)
          .then((result) => t.false(result, "[false] shapely - " + name));
      t.false(result, "[false] " + name);
    });
  t.end();
});


text:
package functional

import (
	"fmt"
	"os"
	"path/filepath"
	"testing"

	"github.com/Microsoft/hcsshim/internal/uvm"
	"github.com/Microsoft/hcsshim/osversion"
	"github.com/Microsoft/hcsshim/test/functional/utilities"
)

// TestPlan9 tests adding/removing Plan9 shares to/from a v2 Linux utility VM
// TODO: This is very basic. Need multiple shares and so-on. Can be iterated on later.
func TestPlan9(t *testing.T) {
	testutilities.RequiresBuild(t, osversion.RS5)

	vm := testutilities.CreateLCOWUVM(t, t.Name())
	defer vm.Close()

	dir := testutilities.CreateTempDir(t)
	defer os.RemoveAll(dir)
	var iterations uint32 = 64
	var shares []*uvm.Plan9Share
	for i := 0; i < int(iterations); i++ {
		share, err := vm.AddPlan9(dir, fmt.Sprintf("/tmp/%s", filepath.Base(dir)), false, false, nil)
		if err != nil {
			t.Fatalf("AddPlan9 failed: %s", err)
		}
		shares = append(shares, share)
	}

	// Remove them all
	for _, share := range shares {
		if err := vm.RemovePlan9(share); err != nil {
			t.Fatalf("RemovePlan9 failed: %s", err)
		}
	}
}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const package_chunk_sort_1 = require("../../utilities/package-chunk-sort");
const base_href_webpack_1 = require("../../lib/base-href-webpack");
const utils_1 = require("./utils");
function getBrowserConfig(wco) {
    const { projectRoot, buildOptions, appConfig } = wco;
    const appRoot = path.resolve(projectRoot, appConfig.root);
    const nodeModules = path.resolve(projectRoot, 'node_modules');
    let extraPlugins = [];
    // figure out which are the lazy loaded entry points
    const lazyChunks = utils_1.lazyChunksFilter([
        ...utils_1.extraEntryParser(appConfig.scripts, appRoot, 'scripts'),
        ...utils_1.extraEntryParser(appConfig.styles, appRoot, 'styles')
    ]);
    if (buildOptions.vendorChunk) {
        extraPlugins.push(new webpack.optimize.CommonsChunkPlugin({
            name: 'vendor',
            chunks: ['main'],
            minChunks: (module) => module.resource && module.resource.startsWith(nodeModules)
        }));
    }
    return {
        plugins: [
            new HtmlWebpackPlugin({
                template: path.resolve(appRoot, appConfig.index),
                filename: path.resolve(buildOptions.outputPath, appConfig.index),
                chunksSortMode: package_chunk_sort_1.packageChunkSort(appConfig),
                excludeChunks: lazyChunks,
                xhtml: true
            }),
            new base_href_webpack_1.BaseHrefWebpackPlugin({
                baseHref: buildOptions.baseHref
            }),
            new webpack.optimize.CommonsChunkPlugin({
                minChunks: Infinity,
                name: 'inline'
            })
        ].concat(extraPlugins)
    };
}
exports.getBrowserConfig = getBrowserConfig;
//# sourceMappingURL=/users/mikkeldamm/forked-repos/angular-cli/models/webpack-configs/browser.js.map


text:
Simple but elegant way of display circle images in your Xamarin.Forms projects

#### Setup
* Available on NuGet: https://www.nuget.org/packages/Xam.Plugins.Forms.ImageCircle
* Install into your PCL project and Client projects.

In your iOS, Android, and Windows Phone projects call:

```
Xamarin.Forms.Init();//platform specific init
ImageCircleRenderer.Init();
```

You must do this AFTER you call Xamarin.Forms.Init();

#### Usage
Instead of using an Image simply use a CircleImage instead!

You **MUST** set the width & height requests to the same value and you will want to use AspectFill. Here is a sample:
```
new CircleImage
{
  BorderColor = Color.White,
  BorderThickness = 3,
  HeightRequest = 150,
  WidthRequest = 150,
  Aspect = Aspect.AspectFill,
  HorizontalOptions = LayoutOptions.Center,
  Source = UriImageSource.FromUri(new Uri("http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG"))
}
```

**XAML:**

First add the xmlns namespace:
```xml
xmlns:controls="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin.Abstractions"
```

Then add the xaml:

```xml
<controls:CircleImage Source="{Binding Image}">
  <controls:CircleImage.WidthRequest>
    <OnPlatform x:TypeArguments="x:Double">
      <OnPlatform.iOS>55</OnPlatform.iOS>
      <OnPlatform.Android>55 </OnPlatform.Android>
      <OnPlatform.WinPhone>75</OnPlatform.WinPhone>
    </OnPlatform>
   </controls:CircleImage.WidthRequest>
<controls:CircleImage.HeightRequest>
    <OnPlatform x:TypeArguments="x:Double">
      <OnPlatform.iOS>55</OnPlatform.iOS>
      <OnPlatform.Android>55</OnPlatform.Android>
      <OnPlatform.WinPhone>75</OnPlatform.WinPhone>
    </OnPlatform>
   </controls:CircleImage.HeightRequest>
</controls:CircleImage>
```

**Bindable Properties**

You are able to set the ```BorderColor``` to a Forms.Color to display a border around your image and also ```BorderThickness``` for how thick you want it. This is supported in iOS & Android only.

#### Contributors
* [jamesmontemagno](https://github.com/jamesmontemagno)

Thanks!

#### License
Licensed under main repo license


text:
/* globals document, require, describe, it, afterEach */
"use strict";

// var chai = require("chai");
// var expect = chai.expect;
// var mandelbrot = require("./../");
//
// var createElement = function(tag, id) {
//   var el = document.createElement(tag);
//   if (id) {
//     el.setAttribute("id", id);
//   }
//   return el;
// };
//
// var addToDocument = function(el) {
//   document.body.appendChild(el);
// };

describe("Mandelbrot Test Suite", function() {
  afterEach(function() {
    document.body.innerHTML = "";
  });

  it("works", function() {
  });
});


text:
package com.opensymphony.xwork2.util.finder;

import org.apache.commons.lang.StringUtils;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.*;
import java.util.*;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;

/**
 * @author David Blevins
 * @version $Rev: 894090 $ $Date: 2009-12-27 19:18:29 +0100 (Sun, 27 Dec 2009) $
 */
public class ResourceFinder {
    private static final Logger LOG = LoggerFactory.getLogger(ResourceFinder.class);

    private final URL[] urls;
    private final String path;
    private final ClassLoaderInterface classLoaderInterface;
    private final List<String> resourcesNotLoaded = new ArrayList<String>();

    public ResourceFinder(URL... urls) {
        this(null, new ClassLoaderInterfaceDelegate(Thread.currentThread().getContextClassLoader()), urls);
    }

    public ResourceFinder(String path) {
        this(path, new ClassLoaderInterfaceDelegate(Thread.currentThread().getContextClassLoader()), null);
    }

    public ResourceFinder(String path, URL... urls) {
        this(path, new ClassLoaderInterfaceDelegate(Thread.currentThread().getContextClassLoader()), urls);
    }

    public ResourceFinder(String path, ClassLoaderInterface classLoaderInterface) {
        this(path, classLoaderInterface, null);
    }

    public ResourceFinder(String path, ClassLoaderInterface classLoaderInterface, URL... urls) {
        if (path == null){
            path = "";
        } else if (path.length() > 0 && !path.endsWith("/")) {
            path += "/";
        }
        this.path = path;

        this.classLoaderInterface = classLoaderInterface == null ? new ClassLoaderInterfaceDelegate(Thread.currentThread().getContextClassLoader()) : classLoaderInterface ;

        for (int i = 0; urls != null && i < urls.length; i++) {
            URL url = urls[i];
            if (url == null || isDirectory(url) || "jar".equals(url.getProtocol())) {
                continue;
            }
            try {
                urls[i] = new URL("jar", "", -1, url.toString() + "!/");
            } catch (MalformedURLException e) {
            }
        }
        this.urls = (urls == null || urls.length == 0)? null : urls;
    }

    private static boolean isDirectory(URL url) {
        String file = url.getFile();
        return (file.length() > 0 && file.charAt(file.length() - 1) == '/');
    }

    /**
     * Returns a list of resources that could not be loaded in the last invoked findAvailable* or
     * mapAvailable* methods.
     *

     * The list will only contain entries of resources that match the requirements
     * of the last invoked findAvailable* or mapAvailable* methods, but were unable to be
     * loaded and included in their results.
     *

     * The list returned is unmodifiable and the results of this method will change
     * after each invocation of a findAvailable* or mapAvailable* methods.
     *

     * This method is not thread safe.
     */
    public List<String> getResourcesNotLoaded() {
        return Collections.unmodifiableList(resourcesNotLoaded);
    }

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //
    //   Find
    //
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    public URL find(String uri) throws IOException {
        String fullUri = path + uri;

        return getResource(fullUri);
    }

    public List<URL> findAll(String uri) throws IOException {
        String fullUri = path + uri;

        Enumeration<URL> resources = getResources(fullUri);
        List<URL> list = new ArrayList<URL>();
        while (resources.hasMoreElements()) {
            URL url = resources.nextElement();
            list.add(url);
        }
        return list;
    }

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //
    //   Find String
    //
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    /**
     * Reads the contents of the URL as a {@link String}'s and returns it.
     *
     * @param uri
     * @return a stringified content of a resource
     * @throws IOException if a resource pointed out by the uri param could not be find
     * @see ClassLoader#getResource(String)
     */
    public String findString(String uri) throws IOException {
        String fullUri = path + uri;

        URL resource = getResource(fullUri);
        if (resource == null) {
            throw new IOException("Could not find a resource in : " + fullUri);
        }

        return readContents(resource);
    }

    /**
     * Reads the contents of the found URLs as a list of {@link String}'s and returns them.
     *
     * @param uri
     * @return a list of the content of each resource URL found
     * @throws IOException if any of the found URLs are unable to be read.
     */
    public List<String> findAllStrings(String uri) throws IOException {
        String fulluri = path + uri;

        List<String> strings = new ArrayList<String>();

        Enumeration<URL> resources = getResources(fulluri);
        while (resources.hasMoreElements()) {
            URL url = resources.nextElement();
            String string = readContents(url);
            strings.add(string);
        }
        return strings;
    }

    /**
     * Reads the contents of the found URLs as a Strings and returns them.
     * Individual URLs that cannot be read are skipped and added to the
     * list of 'resourcesNotLoaded'
     *
     * @param uri
     * @return a list of the content of each resource URL found
     * @throws IOException if classLoader.getResources throws an exception
     */
    public List<String> findAvailableStrings(String uri) throws IOException {
        resourcesNotLoaded.clear();
        String fulluri = path + uri;

        List<String> strings = new ArrayList<String>();

        Enumeration<URL> resources = getResources(fulluri);
        while (resources.hasMoreElements()) {
            URL url = resources.nextElement();
            try {
                String string = readContents(url);
                strings.add(string);
            } catch (IOException notAvailable) {
                resourcesNotLoaded.add(url.toExternalForm());
            }
        }
        return strings;
    }

    /**
     * Reads the contents of all non-directory URLs immediately under the specified
     * location and returns them in a map keyed by the file name.
     *

     * Any URLs that cannot be read will cause an exception to be thrown.
     *

     * Example classpath:
     *

     * META-INF/serializables/one
     * META-INF/serializables/two
     * META-INF/serializables/three
     * META-INF/serializables/four/foo.txt
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * Map map = finder.mapAvailableStrings("serializables");
     * map.contains("one");  // true
     * map.contains("two");  // true
     * map.contains("three");  // true
     * map.contains("four");  // false
     *
     * @param uri
     * @return a list of the content of each resource URL found
     * @throws IOException if any of the urls cannot be read
     */
    public Map<String, String> mapAllStrings(String uri) throws IOException {
        Map<String, String> strings = new HashMap<String, String>();
        Map<String, URL> resourcesMap = getResourcesMap(uri);
        for (Map.Entry<String, URL> entry : resourcesMap.entrySet()) {
            String name = entry.getKey();
            URL url = entry.getValue();
            String value = readContents(url);
            strings.put(name, value);
        }
        return strings;
    }

    /**
     * Reads the contents of all non-directory URLs immediately under the specified
     * location and returns them in a map keyed by the file name.
     *

     * Individual URLs that cannot be read are skipped and added to the
     * list of 'resourcesNotLoaded'
     *

     * Example classpath:
     *

     * META-INF/serializables/one
     * META-INF/serializables/two      # not readable
     * META-INF/serializables/three
     * META-INF/serializables/four/foo.txt
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * Map map = finder.mapAvailableStrings("serializables");
     * map.contains("one");  // true
     * map.contains("two");  // false
     * map.contains("three");  // true
     * map.contains("four");  // false
     *
     * @param uri
     * @return a list of the content of each resource URL found
     * @throws IOException if classLoader.getResources throws an exception
     */
    public Map<String, String> mapAvailableStrings(String uri) throws IOException {
        resourcesNotLoaded.clear();
        Map<String, String> strings = new HashMap<String, String>();
        Map<String, URL> resourcesMap = getResourcesMap(uri);
        for (Map.Entry<String, URL> entry  : resourcesMap.entrySet()) {
            String name = entry.getKey();
            URL url = entry.getValue();
            try {
                String value = readContents(url);
                strings.put(name, value);
            } catch (IOException notAvailable) {
                resourcesNotLoaded.add(url.toExternalForm());
            }
        }
        return strings;
    }

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //
    //   Find Class
    //
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    /**
     * Executes {@link #findString(String)} assuming the contents URL found is the name of
     * a class that should be loaded and returned.
     *
     * @param uri
     * @return
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public Class findClass(String uri) throws IOException, ClassNotFoundException {
        String className = findString(uri);
        return (Class) classLoaderInterface.loadClass(className);
    }

    /**
     * Executes findAllStrings assuming the strings are
     * the names of a classes that should be loaded and returned.
     *

     * Any URL or class that cannot be loaded will cause an exception to be thrown.
     *
     * @param uri
     * @return
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public List<Class> findAllClasses(String uri) throws IOException, ClassNotFoundException {
        List<Class> classes = new ArrayList<Class>();
        List<String> strings = findAllStrings(uri);
        for (String className : strings) {
            Class clazz = classLoaderInterface.loadClass(className);
            classes.add(clazz);
        }
        return classes;
    }

    /**
     * Executes findAvailableStrings assuming the strings are
     * the names of a classes that should be loaded and returned.
     *

     * Any class that cannot be loaded will be skipped and placed in the
     * 'resourcesNotLoaded' collection.
     *
     * @param uri
     * @return
     * @throws IOException if classLoader.getResources throws an exception
     */
    public List<Class> findAvailableClasses(String uri) throws IOException {
        resourcesNotLoaded.clear();
        List<Class> classes = new ArrayList<Class>();
        List<String> strings = findAvailableStrings(uri);
        for (String className : strings) {
            try {
                Class clazz = classLoaderInterface.loadClass(className);
                classes.add(clazz);
            } catch (Exception notAvailable) {
                resourcesNotLoaded.add(className);
            }
        }
        return classes;
    }

    /**
     * Executes mapAllStrings assuming the value of each entry in the
     * map is the name of a class that should be loaded.
     *

     * Any class that cannot be loaded will be cause an exception to be thrown.
     *

     * Example classpath:
     *

     * META-INF/xmlparsers/xerces
     * META-INF/xmlparsers/crimson
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * Map map = finder.mapAvailableStrings("xmlparsers");
     * map.contains("xerces");  // true
     * map.contains("crimson");  // true
     * Class xercesClass = map.get("xerces");
     * Class crimsonClass = map.get("crimson");
     *
     * @param uri
     * @return
     * @throws IOException
     * @throws ClassNotFoundException
     */
    public Map<String, Class> mapAllClasses(String uri) throws IOException, ClassNotFoundException {
        Map<String, Class> classes = new HashMap<String, Class>();
        Map<String, String> map = mapAllStrings(uri);
        for (Map.Entry<String, String> entry : map.entrySet()) {
            String string = entry.getKey();
            String className = entry.getValue();
            Class clazz = classLoaderInterface.loadClass(className);
            classes.put(string, clazz);
        }
        return classes;
    }

    /**
     * Executes mapAvailableStrings assuming the value of each entry in the
     * map is the name of a class that should be loaded.
     *

     * Any class that cannot be loaded will be skipped and placed in the
     * 'resourcesNotLoaded' collection.
     *

     * Example classpath:
     *

     * META-INF/xmlparsers/xerces
     * META-INF/xmlparsers/crimson
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * Map map = finder.mapAvailableStrings("xmlparsers");
     * map.contains("xerces");  // true
     * map.contains("crimson");  // true
     * Class xercesClass = map.get("xerces");
     * Class crimsonClass = map.get("crimson");
     *
     * @param uri
     * @return
     * @throws IOException if classLoader.getResources throws an exception
     */
    public Map<String, Class> mapAvailableClasses(String uri) throws IOException {
        resourcesNotLoaded.clear();
        Map<String, Class> classes = new HashMap<String, Class>();
        Map<String, String> map = mapAvailableStrings(uri);
        for (Map.Entry<String, String> entry : map.entrySet()) {
            String string = entry.getKey();
            String className = entry.getValue();
            try {
                Class clazz = classLoaderInterface.loadClass(className);
                classes.put(string, clazz);
            } catch (Exception notAvailable) {
                resourcesNotLoaded.add(className);
            }
        }
        return classes;
    }

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //
    //   Find Implementation
    //
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    /**
     * Assumes the class specified points to a file in the classpath that contains
     * the name of a class that implements or is a subclass of the specfied class.
     *

     * Any class that cannot be loaded will be cause an exception to be thrown.
     *

     * Example classpath:
     *

     * META-INF/java.io.InputStream    # contains the classname org.acme.AcmeInputStream
     * META-INF/java.io.OutputStream
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * Class clazz = finder.findImplementation(java.io.InputStream.class);
     * clazz.getName();  // returns "org.acme.AcmeInputStream"
     *
     * @param interfase a superclass or interface
     * @return
     * @throws IOException            if the URL cannot be read
     * @throws ClassNotFoundException if the class found is not loadable
     * @throws ClassCastException     if the class found is not assignable to the specified superclass or interface
     */
    public Class findImplementation(Class interfase) throws IOException, ClassNotFoundException {
        String className = findString(interfase.getName());
        Class impl = classLoaderInterface.loadClass(className);
        if (!interfase.isAssignableFrom(impl)) {
            throw new ClassCastException("Class not of type: " + interfase.getName());
        }
        return impl;
    }

    /**
     * Assumes the class specified points to a file in the classpath that contains
     * the name of a class that implements or is a subclass of the specfied class.
     *

     * Any class that cannot be loaded or assigned to the specified interface will be cause
     * an exception to be thrown.
     *

     * Example classpath:
     *

     * META-INF/java.io.InputStream    # contains the classname org.acme.AcmeInputStream
     * META-INF/java.io.InputStream    # contains the classname org.widget.NeatoInputStream
     * META-INF/java.io.InputStream    # contains the classname com.foo.BarInputStream
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * List classes = finder.findAllImplementations(java.io.InputStream.class);
     * classes.contains("org.acme.AcmeInputStream");  // true
     * classes.contains("org.widget.NeatoInputStream");  // true
     * classes.contains("com.foo.BarInputStream");  // true
     *
     * @param interfase a superclass or interface
     * @return
     * @throws IOException            if the URL cannot be read
     * @throws ClassNotFoundException if the class found is not loadable
     * @throws ClassCastException     if the class found is not assignable to the specified superclass or interface
     */
    public List<Class> findAllImplementations(Class interfase) throws IOException, ClassNotFoundException {
        List<Class> implementations = new ArrayList<Class>();
        List<String> strings = findAllStrings(interfase.getName());
        for (String className : strings) {
            Class impl = classLoaderInterface.loadClass(className);
            if (!interfase.isAssignableFrom(impl)) {
                throw new ClassCastException("Class not of type: " + interfase.getName());
            }
            implementations.add(impl);
        }
        return implementations;
    }

    /**
     * Assumes the class specified points to a file in the classpath that contains
     * the name of a class that implements or is a subclass of the specfied class.
     *

     * Any class that cannot be loaded or are not assignable to the specified class will be
     * skipped and placed in the 'resourcesNotLoaded' collection.
     *

     * Example classpath:
     *

     * META-INF/java.io.InputStream    # contains the classname org.acme.AcmeInputStream
     * META-INF/java.io.InputStream    # contains the classname org.widget.NeatoInputStream
     * META-INF/java.io.InputStream    # contains the classname com.foo.BarInputStream
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * List classes = finder.findAllImplementations(java.io.InputStream.class);
     * classes.contains("org.acme.AcmeInputStream");  // true
     * classes.contains("org.widget.NeatoInputStream");  // true
     * classes.contains("com.foo.BarInputStream");  // true
     *
     * @param interfase a superclass or interface
     * @return
     * @throws IOException if classLoader.getResources throws an exception
     */
    public List<Class> findAvailableImplementations(Class interfase) throws IOException {
        resourcesNotLoaded.clear();
        List<Class> implementations = new ArrayList<Class>();
        List<String> strings = findAvailableStrings(interfase.getName());
        for (String className : strings) {
            try {
                Class impl = classLoaderInterface.loadClass(className);
                if (interfase.isAssignableFrom(impl)) {
                    implementations.add(impl);
                } else {
                    resourcesNotLoaded.add(className);
                }
            } catch (Exception notAvailable) {
                resourcesNotLoaded.add(className);
            }
        }
        return implementations;
    }

    /**
     * Assumes the class specified points to a directory in the classpath that holds files
     * containing the name of a class that implements or is a subclass of the specfied class.
     *

     * Any class that cannot be loaded or assigned to the specified interface will be cause
     * an exception to be thrown.
     *

     * Example classpath:
     *

     * META-INF/java.net.URLStreamHandler/jar
     * META-INF/java.net.URLStreamHandler/file
     * META-INF/java.net.URLStreamHandler/http
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * Map map = finder.mapAllImplementations(java.net.URLStreamHandler.class);
     * Class jarUrlHandler = map.get("jar");
     * Class fileUrlHandler = map.get("file");
     * Class httpUrlHandler = map.get("http");
     *
     * @param interfase a superclass or interface
     * @return
     * @throws IOException            if the URL cannot be read
     * @throws ClassNotFoundException if the class found is not loadable
     * @throws ClassCastException     if the class found is not assignable to the specified superclass or interface
     */
    public Map<String, Class> mapAllImplementations(Class interfase) throws IOException, ClassNotFoundException {
        Map<String, Class> implementations = new HashMap<String, Class>();
        Map<String, String> map = mapAllStrings(interfase.getName());
        for (Map.Entry<String, String> entry : map.entrySet()) {
            String string = entry.getKey();
            String className = entry.getValue();
            Class impl = classLoaderInterface.loadClass(className);
            if (!interfase.isAssignableFrom(impl)) {
                throw new ClassCastException("Class not of type: " + interfase.getName());
            }
            implementations.put(string, impl);
        }
        return implementations;
    }

    /**
     * Assumes the class specified points to a directory in the classpath that holds files
     * containing the name of a class that implements or is a subclass of the specfied class.
     *

     * Any class that cannot be loaded or are not assignable to the specified class will be
     * skipped and placed in the 'resourcesNotLoaded' collection.
     *

     * Example classpath:
     *

     * META-INF/java.net.URLStreamHandler/jar
     * META-INF/java.net.URLStreamHandler/file
     * META-INF/java.net.URLStreamHandler/http
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * Map map = finder.mapAllImplementations(java.net.URLStreamHandler.class);
     * Class jarUrlHandler = map.get("jar");
     * Class fileUrlHandler = map.get("file");
     * Class httpUrlHandler = map.get("http");
     *
     * @param interfase a superclass or interface
     * @return
     * @throws IOException if classLoader.getResources throws an exception
     */
    public Map<String, Class> mapAvailableImplementations(Class interfase) throws IOException {
        resourcesNotLoaded.clear();
        Map<String, Class> implementations = new HashMap<String, Class>();
        Map<String, String> map = mapAvailableStrings(interfase.getName());
        for (Map.Entry<String, String> entry : map.entrySet()) {
            String string = entry.getKey();
            String className = entry.getValue();
            try {
                Class impl = classLoaderInterface.loadClass(className);
                if (interfase.isAssignableFrom(impl)) {
                    implementations.put(string, impl);
                } else {
                    resourcesNotLoaded.add(className);
                }
            } catch (Exception notAvailable) {
                resourcesNotLoaded.add(className);
            }
        }
        return implementations;
    }

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //
    //   Find Properties
    //
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    /**
     * Finds the corresponding resource and reads it in as a properties file
     *

     * Example classpath:
     *

     * META-INF/widget.properties
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * Properties widgetProps = finder.findProperties("widget.properties");
     *
     * @param uri
     * @return
     * @throws IOException if the URL cannot be read or is not in properties file format
     */
    public Properties findProperties(String uri) throws IOException {
        String fulluri = path + uri;

        URL resource = getResource(fulluri);
        if (resource == null) {
            throw new IOException("Could not find command in : " + fulluri);
        }

        return loadProperties(resource);
    }

    /**
     * Finds the corresponding resources and reads them in as a properties files
     *

     * Any URL that cannot be read in as a properties file will cause an exception to be thrown.
     *

     * Example classpath:
     *

     * META-INF/app.properties
     * META-INF/app.properties
     * META-INF/app.properties
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * List<Properties> appProps = finder.findAllProperties("app.properties");
     *
     * @param uri
     * @return
     * @throws IOException if the URL cannot be read or is not in properties file format
     */
    public List<Properties> findAllProperties(String uri) throws IOException {
        String fulluri = path + uri;

        List<Properties> properties = new ArrayList<Properties>();

        Enumeration<URL> resources = getResources(fulluri);
        while (resources.hasMoreElements()) {
            URL url = resources.nextElement();
            Properties props = loadProperties(url);
            properties.add(props);
        }
        return properties;
    }

    /**
     * Finds the corresponding resources and reads them in as a properties files
     *

     * Any URL that cannot be read in as a properties file will be added to the
     * 'resourcesNotLoaded' collection.
     *

     * Example classpath:
     *

     * META-INF/app.properties
     * META-INF/app.properties
     * META-INF/app.properties
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * List<Properties> appProps = finder.findAvailableProperties("app.properties");
     *
     * @param uri
     * @return
     * @throws IOException if classLoader.getResources throws an exception
     */
    public List<Properties> findAvailableProperties(String uri) throws IOException {
        resourcesNotLoaded.clear();
        String fulluri = path + uri;

        List<Properties> properties = new ArrayList<Properties>();

        Enumeration<URL> resources = getResources(fulluri);
        while (resources.hasMoreElements()) {
            URL url = resources.nextElement();
            try {
                Properties props = loadProperties(url);
                properties.add(props);
            } catch (Exception notAvailable) {
                resourcesNotLoaded.add(url.toExternalForm());
            }
        }
        return properties;
    }

    /**
     * Finds the corresponding resources and reads them in as a properties files
     *

     * Any URL that cannot be read in as a properties file will cause an exception to be thrown.
     *

     * Example classpath:
     *

     * META-INF/jdbcDrivers/oracle.properties
     * META-INF/jdbcDrivers/mysql.props
     * META-INF/jdbcDrivers/derby
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * List<Properties> driversList = finder.findAvailableProperties("jdbcDrivers");
     * Properties oracleProps = driversList.get("oracle.properties");
     * Properties mysqlProps = driversList.get("mysql.props");
     * Properties derbyProps = driversList.get("derby");
     *
     * @param uri
     * @return
     * @throws IOException if the URL cannot be read or is not in properties file format
     */
    public Map<String, Properties> mapAllProperties(String uri) throws IOException {
        Map<String, Properties> propertiesMap = new HashMap<String, Properties>();
        Map<String, URL> map = getResourcesMap(uri);
        for (Map.Entry<String, URL> entry : map.entrySet()) {
            String string = entry.getKey();
            URL url = entry.getValue();
            Properties properties = loadProperties(url);
            propertiesMap.put(string, properties);
        }
        return propertiesMap;
    }

    /**
     * Finds the corresponding resources and reads them in as a properties files
     *

     * Any URL that cannot be read in as a properties file will be added to the
     * 'resourcesNotLoaded' collection.
     *

     * Example classpath:
     *

     * META-INF/jdbcDrivers/oracle.properties
     * META-INF/jdbcDrivers/mysql.props
     * META-INF/jdbcDrivers/derby
     *

     * ResourceFinder finder = new ResourceFinder("META-INF/");
     * List<Properties> driversList = finder.findAvailableProperties("jdbcDrivers");
     * Properties oracleProps = driversList.get("oracle.properties");
     * Properties mysqlProps = driversList.get("mysql.props");
     * Properties derbyProps = driversList.get("derby");
     *
     * @param uri
     * @return
     * @throws IOException if classLoader.getResources throws an exception
     */
    public Map<String, Properties> mapAvailableProperties(String uri) throws IOException {
        resourcesNotLoaded.clear();
        Map<String, Properties> propertiesMap = new HashMap<String, Properties>();
        Map<String, URL> map = getResourcesMap(uri);
        for (Map.Entry<String, URL> entry : map.entrySet()) {
            String string = entry.getKey();
            URL url = entry.getValue();
            try {
                Properties properties = loadProperties(url);
                propertiesMap.put(string, properties);
            } catch (Exception notAvailable) {
                resourcesNotLoaded.add(url.toExternalForm());
            }
        }
        return propertiesMap;
    }

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //
    //   Map Resources
    //
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    public Map<String, URL> getResourcesMap(String uri) throws IOException {
        String basePath = path + uri;

        Map<String, URL> resources = new HashMap<String, URL>();
        if (!basePath.endsWith("/")) {
            basePath += "/";
        }
        Enumeration<URL> urls = getResources(basePath);

        while (urls.hasMoreElements()) {
            URL location = urls.nextElement();

            try {
                if ("jar".equals(location.getProtocol())) {

                    readJarEntries(location, basePath, resources);

                } else if ("file".equals(location.getProtocol())) {

                    readDirectoryEntries(location, resources);

                }
            } catch (Exception e) {
            }
        }

        return resources;
    }

    /**
     * Gets a list of subpckages from jars or dirs
     */
    public Set<String> findPackages(String uri) throws IOException {
        String basePath = path + uri;

        Set<String> resources = new HashSet<String>();
        if (!basePath.endsWith("/")) {
            basePath += "/";
        }
        Enumeration<URL> urls = getResources(basePath);

        while (urls.hasMoreElements()) {
            URL location = urls.nextElement();

            try {
                if ("jar".equals(location.getProtocol())) {

                    readJarDirectoryEntries(location, basePath, resources);

                } else if ("file".equals(location.getProtocol())) {

                    readSubDirectories(new File(location.toURI()), uri, resources);

                }
            } catch (Exception e) {
            }
        }

        return convertPathsToPackages(resources);
    }

    /**
     * Gets a list of subpckages from jars or dirs
     */
    public Map<URL, Set<String>> findPackagesMap(String uri) throws IOException {
        String basePath = path + uri;

        if (!basePath.endsWith("/")) {
            basePath += "/";
        }
        Enumeration<URL> urls = getResources(basePath);
        Map<URL, Set<String>> result = new HashMap<URL, Set<String>>();

        while (urls.hasMoreElements()) {
            URL location = urls.nextElement();

            try {
                if ("jar".equals(location.getProtocol())) {
                    Set<String> resources = new HashSet<String>();
                    readJarDirectoryEntries(location, basePath, resources);
                    result.put(location, convertPathsToPackages(resources));
                } else if ("file".equals(location.getProtocol())) {
                    Set<String> resources = new HashSet<String>();
                    readSubDirectories(new File(location.toURI()), uri, resources);
                    result.put(location, convertPathsToPackages(resources));
                }
            } catch (Exception e) {
            }
        }

        return result;
    }

    private Set<String> convertPathsToPackages(Set<String> resources) {
        Set<String> packageNames = new HashSet<String>(resources.size());
        for(String resource : resources) {
            packageNames.add(StringUtils.chomp(StringUtils.replace(resource, "/", "."), "."));
        }

        return packageNames;
    }

    private static void readDirectoryEntries(URL location, Map<String, URL> resources) throws MalformedURLException {
        File dir = new File(URLDecoder.decode(location.getPath()));
        if (dir.isDirectory()) {
            File[] files = dir.listFiles();
            for (File file : files) {
                if (!file.isDirectory()) {
                    String name = file.getName();
                    URL url = file.toURL();
                    resources.put(name, url);
                }
            }
        }
    }

    /**
     * Reads subdirectories of a file. The output is a list of subdirectories, relative to the basepath
     */
     private static void readSubDirectories(File dir, String basePath, Set<String> resources) throws MalformedURLException {
        if (dir.isDirectory()) {
            File[] files = dir.listFiles();
            for (File file : files) {
                if (file.isDirectory()) {
                    String name = file.getName();
                    String subName = StringUtils.chomp(basePath, "/") + "/" + name;
                    resources.add(subName);
                    readSubDirectories(file, subName, resources);
                }
            }
        }
    }

    private static void readJarEntries(URL location, String basePath, Map<String, URL> resources) throws IOException {
        JarURLConnection conn = (JarURLConnection) location.openConnection();
        JarFile jarfile = null;
        jarfile = conn.getJarFile();

        Enumeration<JarEntry> entries = jarfile.entries();
        while (entries != null && entries.hasMoreElements()) {
            JarEntry entry = entries.nextElement();
            String name = entry.getName();

            if (entry.isDirectory() || !name.startsWith(basePath) || name.length() == basePath.length()) {
                continue;
            }

            name = name.substring(basePath.length());

            if (name.contains("/")) {
                continue;
            }

            URL resource = new URL(location, name);
            resources.put(name, resource);
        }
    }

    //read directories in the jar that start with the basePath
    private static void readJarDirectoryEntries(URL location, String basePath, Set<String> resources) throws IOException {
        JarURLConnection conn = (JarURLConnection) location.openConnection();
        JarFile jarfile = null;
        jarfile = conn.getJarFile();

        Enumeration<JarEntry> entries = jarfile.entries();
        while (entries != null && entries.hasMoreElements()) {
            JarEntry entry = entries.nextElement();
            String name = entry.getName();

            if (entry.isDirectory() && StringUtils.startsWith(name, basePath)) {
                resources.add(name);
            }
        }
    }

    private Properties loadProperties(URL resource) throws IOException {
        InputStream in = resource.openStream();

        BufferedInputStream reader = null;
        try {
            reader = new BufferedInputStream(in);
            Properties properties = new Properties();
            properties.load(reader);

            return properties;
        } finally {
            try {
                in.close();
                reader.close();
            } catch (Exception e) {
            }
        }
    }

    private String readContents(URL resource) throws IOException {
        InputStream in = resource.openStream();
        BufferedInputStream reader = null;
        StringBuilder sb = new StringBuilder();

        try {
            reader = new BufferedInputStream(in);

            int b = reader.read();
            while (b != -1) {
                sb.append((char) b);
                b = reader.read();
            }

            return sb.toString().trim();
        } finally {
            try {
                in.close();
                reader.close();
            } catch (Exception e) {
            }
        }
    }

    private URL getResource(String fullUri) {
        if (urls == null){
            return classLoaderInterface.getResource(fullUri);
        }
        return findResource(fullUri, urls);
    }

    private Enumeration<URL> getResources(String fulluri) throws IOException {
        if (urls == null) {
            return classLoaderInterface.getResources(fulluri);
        }
        Vector<URL> resources = new Vector();
        for (URL url : urls) {
            URL resource = findResource(fulluri, url);
            if (resource != null){
                resources.add(resource);
            }
        }
        return resources.elements();
    }

    private URL findResource(String resourceName, URL... search) {
        for (int i = 0; i < search.length; i++) {
            URL currentUrl = search[i];
            if (currentUrl == null) {
                continue;
            }
            JarFile jarFile = null;
            try {
                String protocol = currentUrl.getProtocol();
                if ("jar".equals(protocol)) {
                    /*
                    * If the connection for currentUrl or resURL is
                    * used, getJarFile() will throw an exception if the
                    * entry doesn't exist.
                    */
                    URL jarURL = ((JarURLConnection) currentUrl.openConnection()).getJarFileURL();
                    try {
                        JarURLConnection juc = (JarURLConnection) new URL("jar", "", jarURL.toExternalForm() + "!/").openConnection();
                        jarFile = juc.getJarFile();
                    } catch (IOException e) {
                        // Don't look for this jar file again
                        search[i] = null;
                        throw e;
                    }

                    String entryName;
                    if (currentUrl.getFile().endsWith("!/")) {
                        entryName = resourceName;
                    } else {
                        String file = currentUrl.getFile();
                        int sepIdx = file.lastIndexOf("!/");
                        if (sepIdx == -1) {
                            // Invalid URL, don't look here again
                            search[i] = null;
                            continue;
                        }
                        sepIdx += 2;
                        StringBuilder sb = new StringBuilder(file.length() - sepIdx + resourceName.length());
                        sb.append(file.substring(sepIdx));
                        sb.append(resourceName);
                        entryName = sb.toString();
                    }
                    if ("META-INF/".equals(entryName) && jarFile.getEntry("META-INF/MANIFEST.MF") != null){
                        return targetURL(currentUrl, "META-INF/MANIFEST.MF");
                    }
                    if (jarFile.getEntry(entryName) != null) {
                        return targetURL(currentUrl, resourceName);
                    }
                } else if ("file".equals(protocol)) {
                    String baseFile = currentUrl.getFile();
                    String host = currentUrl.getHost();
                    int hostLength = 0;
                    if (host != null) {
                        hostLength = host.length();
                    }
                    StringBuilder buf = new StringBuilder(2 + hostLength + baseFile.length() + resourceName.length());

                    if (hostLength > 0) {
                        buf.append("//").append(host);
                    }
                    // baseFile always ends with '/'
                    buf.append(baseFile);
                    String fixedResName = resourceName;
                    // Do not create a UNC path, i.e. \\host
                    while (fixedResName.startsWith("/") || fixedResName.startsWith("\\")) {
                        fixedResName = fixedResName.substring(1);
                    }
                    buf.append(fixedResName);
                    String filename = buf.toString();
                    File file = new File(filename);
                    File file2 = new File(URLDecoder.decode(filename));

                    if (file.exists() || file2.exists()) {
                        return targetURL(currentUrl, fixedResName);
                    }
                } else {
                    URL resourceURL = targetURL(currentUrl, resourceName);
                    URLConnection urlConnection = resourceURL.openConnection();

                    try {
                        urlConnection.getInputStream().close();
                    } catch (SecurityException e) {
                        return null;
                    }
                    // HTTP can return a stream on a non-existent file
                    // So check for the return code;
                    if (!"http".equals(resourceURL.getProtocol())) {
                        return resourceURL;
                    }

                    int code = ((HttpURLConnection) urlConnection).getResponseCode();
                    if (code >= 200 && code < 300) {
                        return resourceURL;
                    }
                }
            } catch (MalformedURLException e) {
                // Keep iterating through the URL list
            } catch (IOException e) {
            } catch (SecurityException e) {
            }
        }
        return null;
    }

    private URL targetURL(URL base, String name) throws MalformedURLException {
        StringBuilder sb = new StringBuilder(base.getFile().length() + name.length());
        sb.append(base.getFile());
        sb.append(name);
        String file = sb.toString();
        return new URL(base.getProtocol(), base.getHost(), base.getPort(), file, null);
    }
}