text:
package org.innovateuk.ifs.security;

import org.innovateuk.ifs.RootPermissionRulesTest;
import org.innovateuk.ifs.alert.builder.AlertResourceBuilder;
import org.innovateuk.ifs.alert.resource.AlertResource;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class AlertPermissionRulesTest extends RootPermissionRulesTest<AlertPermissionRules> {

    private AlertResource alertResource;

    @Before
    public void setUp() {
        alertResource = AlertResourceBuilder.newAlertResource()
                .build();
    }

    @Override
    protected AlertPermissionRules supplyPermissionRulesUnderTest() {
        return new AlertPermissionRules();
    }

    @Test
    public void systemMaintenanceUserCanCreateAlerts() {
        assertTrue(rules.systemMaintenanceUserCanCreateAlerts(alertResource, systemMaintenanceUser()));
    }

    @Test
    public void systemMaintenanceUserCanCreateAlerts_anonymous() {
        assertFalse(rules.systemMaintenanceUserCanCreateAlerts(alertResource, anonymousUser()));
    }

    @Test
    public void systemMaintenanceUserCanDeleteAlerts() {
        assertTrue(rules.systemMaintenanceUserCanDeleteAlerts(alertResource, systemMaintenanceUser()));
    }

    @Test
    public void systemMaintenanceUserCanDeleteAlerts_anonymous() {
        assertFalse(rules.systemMaintenanceUserCanDeleteAlerts(alertResource, anonymousUser()));
    }
}


text:
This chart shows the average rate of resolution over time for defects found during
a release timebox.  It does not care whether defects are associated with the release
directly, only that they were created during the time period.

* Note that items might have been killed during the period, but if those are
items that were created before the period started, they do not count.

There is an app setting to let the installer decide whether the app will count all
defects or only defects associated with production via a special web link field.

There another app setting to let the installer decide the definition of resolved, that is
across one or more states.

When in Team View, each bar can be clicked to pop up a table of defects that make up
that bar -- it provides a link to the defect details page and name, dates and cycle time.

## Development Notes

* Whether an item is a production item is based on the existence of at least
one value in the incidents field, which is a web link field.
* Because it's a web link field, we can't query on it and the data isn't in
lookback, so we have to go get all the defects first.
* Although the display of resolution time is in days, it is calculated in hours
then divided by 24 so that we can have partial days.
* So that the dialog box bubbles up, data is provided back from the click event on
each chart point, so the code must override (or pass in, anyway), a function to read
the data and do something.
* This app uses a new component in the settings to handle selecting multiple state values
because the current field value dropdown doesn't play well with settings when in multiSelect
mode.

### First Load

If you've just downloaded this from github and you want to do development,
you're going to need to have these installed:

 * node.js
 * grunt-cli
 * grunt-init

Since you're getting this from github, we assume you have the command line
version of git also installed.  If not, go get git.

If you have those three installed, just type this in the root directory here
to get set up to develop:

  npm install

### Structure

  * src/javascript:  All the JS files saved here will be compiled into the
  target html file
  * src/style: All of the stylesheets saved here will be compiled into the
  target html file
  * test/fast: Fast jasmine tests go here.  There should also be a helper
  file that is loaded first for creating mocks and doing other shortcuts
  (fastHelper.js) **Tests should be in a file named <something>-spec.js**
  * test/slow: Slow jasmine tests go here.  There should also be a helper
  file that is loaded first for creating mocks and doing other shortcuts
  (slowHelper.js) **Tests should be in a file named <something>-spec.js**
  * templates: This is where templates that are used to create the production
  and debug html files live.  The advantage of using these templates is that
  you can configure the behavior of the html around the JS.
  * config.json: This file contains the configuration settings necessary to
  create the debug and production html files.  Server is only used for debug,
  name, className and sdk are used for both.
  * package.json: This file lists the dependencies for grunt
  * auth.json: This file should NOT be checked in.  Create this to run the
  slow test specs.  It should look like:
    {
        "username":"you@company.com",
        "password":"secret"
    }

### Usage of the grunt file
####Tasks

##### grunt debug

Use grunt debug to create the debug html file.  You only need to run this when you have added new files to
the src directories.

##### grunt build

Use grunt build to create the production html file.  We still have to copy the html file to a panel to test.

##### grunt test-fast

Use grunt test-fast to run the Jasmine tests in the fast directory.  Typically, the tests in the fast
directory are more pure unit tests and do not need to connect to Rally.

##### grunt test-slow

Use grunt test-slow to run the Jasmine tests in the slow directory.  Typically, the tests in the slow
directory are more like integration tests in that they require connecting to Rally and interacting with
data.

redpajama_set_name: RedPajamaGithub


text:
(function() {
  var previousDevice, _addClass, _doc_element, _find, _handleOrientation, _hasClass, _orientation_event, _removeClass, _supports_orientation, _user_agent;

  previousDevice = window.device;

  window.device = {};

  _doc_element = window.document.documentElement;

  _user_agent = window.navigator.userAgent.toLowerCase();

  device.ios = function() {
    return device.iphone() || device.ipod() || device.ipad();
  };

  device.iphone = function() {
    return _find('iphone');
  };

  device.ipod = function() {
    return _find('ipod');
  };

  device.ipad = function() {
    return _find('ipad');
  };

  device.android = function() {
    return _find('android');
  };

  device.androidPhone = function() {
    return device.android() && _find('mobile');
  };

  device.androidTablet = function() {
    return device.android() && !_find('mobile');
  };

  device.blackberry = function() {
    return _find('blackberry') || _find('bb10') || _find('rim');
  };

  device.blackberryPhone = function() {
    return device.blackberry() && !_find('tablet');
  };

  device.blackberryTablet = function() {
    return device.blackberry() && _find('tablet');
  };

  device.windows = function() {
    return _find('windows');
  };

  device.windowsPhone = function() {
    return device.windows() && _find('phone');
  };

  device.windowsTablet = function() {
    return device.windows() && _find('touch');
  };

  device.fxos = function() {
    return (_find('(mobile;') || _find('(tablet;')) && _find('; rv:');
  };

  device.fxosPhone = function() {
    return device.fxos() && _find('mobile');
  };

  device.fxosTablet = function() {
    return device.fxos() && _find('tablet');
  };

  device.meego = function() {
    return _find('meego');
  };

  device.mobile = function() {
    return device.androidPhone() || device.iphone() || device.ipod() || device.windowsPhone() || device.blackberryPhone() || device.fxosPhone() || device.meego();
  };

  device.tablet = function() {
    return device.ipad() || device.androidTablet() || device.blackberryTablet() || device.windowsTablet() || device.fxosTablet();
  };

  device.portrait = function() {
    return Math.abs(window.orientation) !== 90;
  };

  device.landscape = function() {
    return Math.abs(window.orientation) === 90;
  };

  device.noConflict = function() {
    window.device = previousDevice;
    return this;
  };

  _find = function(needle) {
    return _user_agent.indexOf(needle) !== -1;
  };

  _hasClass = function(class_name) {
    var regex;
    regex = new RegExp(class_name, 'i');
    return _doc_element.className.match(regex);
  };

  _addClass = function(class_name) {
    if (!_hasClass(class_name)) {
      return _doc_element.className += " " + class_name;
    }
  };

  _removeClass = function(class_name) {
    if (_hasClass(class_name)) {
      return _doc_element.className = _doc_element.className.replace(class_name, "");
    }
  };

  if (device.ios()) {
    if (device.ipad()) {
      _addClass("ios ipad tablet");
    } else if (device.iphone()) {
      _addClass("ios iphone mobile");
    } else if (device.ipod()) {
      _addClass("ios ipod mobile");
    }
  } else if (device.android()) {
    if (device.androidTablet()) {
      _addClass("android tablet");
    } else {
      _addClass("android mobile");
    }
  } else if (device.blackberry()) {
    if (device.blackberryTablet()) {
      _addClass("blackberry tablet");
    } else {
      _addClass("blackberry mobile");
    }
  } else if (device.windows()) {
    if (device.windowsTablet()) {
      _addClass("windows tablet");
    } else if (device.windowsPhone()) {
      _addClass("windows mobile");
    } else {
      _addClass("desktop");
    }
  } else if (device.fxos()) {
    if (device.fxosTablet()) {
      _addClass("fxos tablet");
    } else {
      _addClass("fxos mobile");
    }
  } else if (device.meego()) {
    _addClass("meego mobile");
  } else {
    _addClass("desktop");
  }

  _handleOrientation = function() {
    if (device.landscape()) {
      _removeClass("portrait");
      return _addClass("landscape");
    } else {
      _removeClass("landscape");
      return _addClass("portrait");
    }
  };

  _supports_orientation = "onorientationchange" in window;

  _orientation_event = _supports_orientation ? "orientationchange" : "resize";

  if (window.addEventListener) {
    window.addEventListener(_orientation_event, _handleOrientation, false);
  } else if (window.attachEvent) {
    window.attachEvent(_orientation_event, _handleOrientation);
  } else {
    window[_orientation_event] = _handleOrientation;
  }

  _handleOrientation();

}).call(this);


text:
using NHibernate;

namespace BetterModules.Core.DataAccess.DataContext
{
    public interface ISessionFactoryProvider
    {
        /// <summary>
        /// Opens a session.
        /// </summary>
        /// <param name="trackEntitiesConcurrency">if set to <c>true</c> tracks entities concurrency.</param>
        /// <returns>An opened session object.</returns>
        ISession OpenSession(bool trackEntitiesConcurrency = true);
    }
}


text:
<!DOCTYPE html>

    <title>About MetaSerialization  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset="utf-8">

          MetaSerialization 2.0 Docs

         (87% documented)

        <form role="search" action="search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>

            View on GitHub

      MetaSerialization Reference

      About MetaSerialization  Reference

            Guides

                About MetaSerialization

                Example Implementations

                Getting-Started

                Installation

                Introduction

                README

            Classes

                LinearCodingStack

                MetaDecoder

                – Errors

                MetaEncoder

                – Errors

                MetaKeyedDecodingContainer

                MetaKeyedEncodingContainer

                MetaSingleValueDecodingContainer

                MetaSingleValueEncodingContainer

                MetaUnkeyedDecodingContainer

                MetaUnkeyedEncodingContainer

                ReferencingCodingStorage

                SimpleSerialization

            Enumerations

                Reference

                SpecialCodingKey

            Extensions

                Array

                Bool

                Dictionary

                Double

                Float

                Int

                Int16

                Int32

                Int64

                Int8

                String

                UInt

                UInt16

                UInt32

                UInt64

                UInt8

            Protocols

                CodingStorage

                ContainerElementReference

                DecodingKeyedContainerMeta

                DecodingRepresentation

                DecodingUnkeyedContainerMeta

                DirectlyDecodable

                DirectlyEncodable

                EncodingKeyedContainerMeta

                EncodingRepresentation

                EncodingUnkeyedContainerMeta

                IntermediateDecoder

                IntermediateEncoder

                Meta

                MetaSupplier

                NilMeta

                UnkeyedContainerMeta

                Unwrapper

            Structures

                CodingStorageError

                – Reason

                IndexCodingKey

                KeyedContainerElementReference

                KeyedErrorContainer

                MetaCodingKey

                NilMarker

                PrimitivesEnumTranslator

                – Primitive

                PrimitivesProtocolTranslator

                StandardCodingKey

                UnkeyedContainerElementReference

            Type Aliases

                DirectlyCodable

                ErrorContainer

                ErrorEncoder

                KeyedContainerMeta

                Representation

                Serialization

What it does

MetaSerialization provides a layer in between your serialization framework and the swift standard library interface
(mainly Encoder and Decoder) and implements most of the overhead Encoder and Decoder require.

How it works

MetaSerialization provides implementations for Encoder and Decoder, MetaEncoder and MetaDecoder, that rely on a MetaSupplier and an Unwrapper.

With these helpers, MetaDecoder and MetaEncoder create a representation of the serialized data in a meta format.

This format is created in a way, that in the end the meta tree (as I call the in-between format) will only contain values, that are natively supported by your framework or in other words that you can encode directly.

This enables you to serialize any swift class or struct or enum you or anyone else writes, plus any array, dictionary, set, Int, String, and so on to an external (I call it raw) representation that only supports, say, Numbers, String and some kind of Dictionaries and Arrays by mainly writing the code to convert a swift Int to your representation of a number, a swift String to your representation of a String, a swift Array of exclusively your supported types (Number, String, Dictionary, Array in this example) to your representation of a unkeyed container or Array and a swift Dictionary (of exclusively your supported types) to your representation of a keyed container or Dictionary (or Map).

Implementing this still looks like a lot of work and pretty complicated, but this, I guess, is what you would have to do anyway to implement the serialization process.
Concretely, in the example about JSON in the Introduction guide, you would need write this code:

convert a KeyedContainerMeta (you chose the concrete implementation, by default [String : Meta]is used) to this JSON:{ … }(…` represents other JSON you need create),

convert a UnkeyedContainerMeta (again, you chose which one, default is [Meta]) to this JSON: [ ... ],

set quotation marks around Strings and convert your other primitives types.

Codable and MetaSerialization will already have converted any custom types to such (un)keyed containers at this point.

The thing about this procedure is that it can be called recursively to encode and decode these (un)keyed containers (this is in some manner also the principle the whole Codable environment relies on), but this isn’t the topic of this frameworks, it’s just a general idea for encoding and decoding.

Usage

This repository contains two complete example implementations for two self invented formats. You may use those examples as blueprints for a lot of other implementations.

There is also a fork, here, that shows how simple it can be to add Codable support to an existing framework with MetaSerialization.

Limitation

MetaSerialization can only do it’s work properly, if you do not use the function encode(to: ) of the Encodable protocol directly in your implementation of it. Use the encode methods of the (Un)Keyed/SingleValueEncodingContainers instead.

Furthermore you may not do anything in your encoding and decoding code. There are some limitations beyond swifts limitations, when you are using MetaSerialization (or using a framework using MetaSerialization). Here’s a list of code snippets, for which MetaSerialization will give you the “go directly into the prision” card/crash.

© 2016 cherrywoods under Apache 2.0 license.

Generated by jazzy ♪♫ v0.13.1, a Realm project.


text:
#ifndef itkObjectToObjectMultiMetricv4_h
#define itkObjectToObjectMultiMetricv4_h

#include "itkObjectToObjectMetric.h"
#include "itkArray.h"
#include <deque>

namespace itk
{
/** \class ObjectToObjectMultiMetricv4
  * \brief This class takes one ore more ObjectToObject metrics and assigns weights to their derivatives
  * to compute a single result.
  *
  * This class takes N ObjectToObject-derived component metrics and assigns a weight to each of the metrics'
  * derivatives. It then computes a weighted measure of the metric. The GetValue() and
  * GetValueAndDerivative() methods compute the measure and derivative using the following calculation:
  *
  * metric value = Sum_j ( w_j * M_j ) (see important note below)
  *
  * and the GetDerivative() method computes the derivative by computing:
  *
  * derivative = Sum_j ( w_j * dM_j / ||dM_j|| ) * ( Sum_j( ||dM_j|| ) / J )
  *
  * \note The metric value is unit-less, and thus it is difficult to compute a combined metric.
  * This metric returns the metric value in three ways:
  *  1) GetValue() returns the computed value of only the *first* component metric. This result
  *     is stored in m_Value and also returned by GetCurrentValue().
  *  2) GetValueArray() returns an itkArray of metric values, one for each component metric. It
  *     only has meaning after a call to GetValue(), GetDerivative() or GetValueAndDerivative().
  *  3) GetWeightedValue() returns a combined metric value of all component metrics, using the
  *     assigned weights. It only has meaning after a call to GetValue(), GetDerivative()
  *     or GetValueAndDerivative().
  *
  * The assigned weights are normalized internally to sum to one before use, and the weights
  * default to 1/N, where N is the number of component metrics.
  *
  * \note Each component metric must use the same transform parameters object. That is, each metric
  * must be evaluating the same parameters by evaluating the same transform. Except, if a component
  * transform is a CompositeTransform, in which case it must be set to optimize a single transform,
  * and that transform must be the same as the transform in other component metrics.
  *
  * \note Each component metric must be setup independently, except for the metric transforms
  * which can optionally be set from this class. That is, each component's images or point sets,
  * fixed transforms and options must be set independently. The only methods in this metric for setting
  * up the component metrics is SetMovingTransform(). The corresponding
  * Set accesor is also available. When Set{Fixed/Moving}Transform() is not used
  * this metric's m_{Fixed/Moving}Transform member is assigned to the
  * fixed/moving transform assigned to the first component metric.
  *
  * Each component will be initialized by this metric in the call to Initialize().
  *
  * \note When used with an itkRegistrationParameterScalesEstimator estimator, and the multi-metric
  * holds one or more point-set metrics, the user must assign a virtual domain point set for sampling
  * to ensure proper sampling within the point set metrics. In order to generate valid shift estimations,
  * such a virtual domain point set must include mapped points from the fixed point set.
  * See RegistrationParameterScalesEstimator::SetVirtualDomainPointSet() and
  * PointSetToPointSetMetricv4::GetVirtualTransformedPointSet(). If there are two different point sets,
  * then the virtual domain point set should be a union of the two for completeness.
  *
  * \note If the user does not explicitly assign a virtual domain, then the first valid virtual
  * domain found in the component metrics will be used a virtual domain for this multi-metric,
  * which will be queried by classes such as registration parameter estimators.
  * Each componenet metric will still use its own virtual domain for internal calculations when
  * evaluated, so it is possible to use different virtual domains for each metric if desired.
  * If no component metric has a virtual domain defined, then by default the virtual domain is
  * unbounded.
  * When the transform is high dimensional (e.g. DisplacementFieldTransform) then there must
  * be a virtual domain that matches the space of the transform field. Note that when used
  * with a DisplacementFieldTransform, both Image and PointSet metrics will automatically
  * create a matching virtual domain during initialization if one has not been assigned by the user.
  *
  * \ingroup ITKMetricsv4
  */
template<unsigned int TFixedDimension, unsigned int TMovingDimension, typename TVirtualImage = Image<double, TFixedDimension>, class TInternalComputationValueType = double >
class ITK_TEMPLATE_EXPORT ObjectToObjectMultiMetricv4:
  public ObjectToObjectMetric<TFixedDimension, TMovingDimension, TVirtualImage, TInternalComputationValueType>
{
public:
  ITK_DISALLOW_COPY_AND_ASSIGN(ObjectToObjectMultiMetricv4);

  /** Standard class type aliases */
  using Self = ObjectToObjectMultiMetricv4;
  using Superclass = ObjectToObjectMetric<TFixedDimension, TMovingDimension, TVirtualImage, TInternalComputationValueType>;
  using Pointer = SmartPointer<Self>;
  using ConstPointer = SmartPointer<const Self>;

  /** Run-time type information (and related methods). */
  itkTypeMacro(ObjectToObjectMultiMetricv4, ObjectToObjectMetric);

  /** New macro for creation of through a Smart Pointer */
  itkNewMacro( Self );

  /** Types inherited from Superclass. */
  using MeasureType = typename Superclass::MeasureType;
  using DerivativeType = typename Superclass::DerivativeType;
  using DerivativeValueType = typename Superclass::DerivativeValueType;
  using ParametersType = typename Superclass::ParametersType;
  using ParametersValueType = typename Superclass::ParametersValueType;
  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
  using CoordinateRepresentationType = typename Superclass::CoordinateRepresentationType;
  using MovingTransformType = typename Superclass::MovingTransformType;
  using FixedTransformType = typename Superclass::FixedTransformType;

  /** type alias related to the metric queue */
  using MetricType = Superclass;
  using MetricBasePointer = typename MetricType::Pointer;
  using MetricBaseConstPointer = typename MetricType::ConstPointer;
  using MetricQueueType = std::deque<MetricBasePointer>;

  using ObjectType = typename Superclass::ObjectType;

  using WeightValueType = typename DerivativeType::ValueType;
  using WeightsArrayType = Array<WeightValueType>;
  using MetricValueArrayType = Array<MeasureType>;

  itkSetMacro(MetricWeights,WeightsArrayType);
  itkGetMacro(MetricWeights,WeightsArrayType);

  /** Add a metric to the queue */
  void AddMetric( MetricType* metric );

  /** Clear the metric queue */
  void ClearMetricQueue();

  /** Get the number of metrics */
  SizeValueType GetNumberOfMetrics() const;

  void Initialize() override;

  /** Set fixed object (image, point set, etc.)*/
  void SetFixedObject( const ObjectType *itkNotUsed( object ) ) override
    {
    itkExceptionMacro( "A single object should not be specified for the multi metric.");
    }

  /** Set moving object (image, point set, etc.)*/
  void SetMovingObject( const ObjectType *itkNotUsed( object ) ) override
    {
    itkExceptionMacro( "A single object should not be specified for the multi metric.");
    }

  /** Set each of the component metrics to use this moving transform. */
  void SetMovingTransform( MovingTransformType * ) override;

  /** Set each of the component metrics to use this fixed transform. */
  void SetFixedTransform( FixedTransformType * ) override;

  /** Evaluate the metrics and return the value of only the *first* metric.
   * \sa GetValueArray
   * \sa GetWeightedValue
   */
  MeasureType GetValue() const override;

  void GetDerivative( DerivativeType & ) const override;

  /** Evaluate the metric value and derivative.
   * \note \param value will contain the value of only the *first* metric on return.
   * \param derivative holds the combined derivative on return.
   *
   * \sa GetValueArray
   * \sa GetWeightedValue */
  void GetValueAndDerivative(MeasureType & value, DerivativeType & derivative) const override;

  /** Returns an itkArray of metric values, one for each component metric. It
   *  only has meaning after a call to GetValue(), GetDerivative() or GetValueAndDerivative(). */
  MetricValueArrayType GetValueArray() const;

  /**  Returns a combined metric value of all component metrics, using the
   *   assigned weights. It only has meaning after a call to GetValue(), GetDerivative() or GetValueAndDerivative(). */
  MeasureType GetWeightedValue() const;

  /** Get the metrics queue */
  const MetricQueueType & GetMetricQueue() const;

  bool SupportsArbitraryVirtualDomainSamples() const override;

  using MetricCategoryType = typename Superclass::MetricCategoryType;

  /** Get metric category */
  MetricCategoryType GetMetricCategory() const override
    {
    return Superclass::MULTI_METRIC;
    }

protected:

  ObjectToObjectMultiMetricv4();
  ~ObjectToObjectMultiMetricv4() override = default;
  void PrintSelf(std::ostream & os, Indent indent) const override;

private:
  MetricQueueType               m_MetricQueue;
  WeightsArrayType              m_MetricWeights;
  mutable MetricValueArrayType  m_MetricValueArray;
};

} //end namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
#include "itkObjectToObjectMultiMetricv4.hxx"
#endif

#endif


text:
<!DOCTYPE html>
<title>File-008-001-Readonly check: File.type is readonly or not.</title>
<link rel="stylesheet" href="../resources/style.css"/>

Please select "blob.txt" from resources folder to test: <input type='file' id='t_file' name='t_file' />


text:
<?php
namespace Price\Builder\Config;

use Price\Calculator\StandardCalculator;

class StandardConfig implements ConfigInterface
{
    public function getCalculator()
    {
        return new StandardCalculator();
    }

    public function getDecorators()
    {
        return [];
    }

    public function getCurrencySymbol()
    {
        return null;
    }

}


text:
using AutoMapper;
using Esfa.Vacancy.Domain.Entities;
using ApiTypes = Esfa.Vacancy.Api.Types;

namespace Esfa.Vacancy.Register.Api.Mappings
{
    public class ApprenticeshipSummaryMapper : Profile
    {
        private const string National = "National";

        public ApprenticeshipSummaryMapper()
        {
            CreateMap<ApprenticeshipSummary, ApiTypes.ApprenticeshipSummary>()
                .ForMember(target => target.VacancyReference, c => c.MapFrom(source => int.Parse(source.VacancyReference)))
                .ForMember(target => target.ExpectedStartDate, c => c.MapFrom(source => source.StartDate))
                .ForMember(target => target.ApplicationClosingDate, c => c.MapFrom(source => source.ClosingDate))
                .ForMember(target => target.TrainingType, c => c.MapFrom(source =>
                    source.StandardLarsCode.HasValue ? ApiTypes.TrainingType.Standard : ApiTypes.TrainingType.Framework))
                .ForMember(target => target.TrainingTitle, c => c.MapFrom(source => source.SubCategory))
                .ForMember(target => target.TrainingCode, c => c.MapFrom(source =>
                    source.StandardLarsCode.HasValue ? source.StandardLarsCode.ToString() : source.FrameworkLarsCode))
                .ForMember(target => target.ShortDescription, c => c.MapFrom(source => source.Description))
                .ForMember(target => target.TrainingProviderName, c => c.MapFrom(source => source.ProviderName))
                .ForMember(target => target.Ukprn, c => c.MapFrom(source => source.Ukprn))
                .ForMember(target => target.IsNationwide, c => c.MapFrom(source => source.VacancyLocationType.Equals(National)))
                .ForMember(target => target.VacancyUrl, c => c.Ignore())
                .ForMember(target => target.IsEmployerDisabilityConfident, c => c.MapFrom(source => source.IsDisabilityConfident));

        }
    }
}


text:
@interface WPBaseReq : NSObject<WPBaseReqProtocol>
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end


text:
#include "qpid/messaging/amqp/EncodedMessage.h"
#include "qpid/messaging/Address.h"
#include "qpid/messaging/exceptions.h"
#include "qpid/messaging/MessageImpl.h"
#include "qpid/Exception.h"
#include "qpid/amqp/Decoder.h"
#include "qpid/amqp/DataBuilder.h"
#include "qpid/amqp/ListBuilder.h"
#include "qpid/amqp/MapBuilder.h"
#include "qpid/amqp/typecodes.h"
#include "qpid/types/encodings.h"
#include "qpid/log/Statement.h"
#include <boost/lexical_cast.hpp>
#include <string.h>

namespace qpid {
namespace messaging {
namespace amqp {
using namespace qpid::amqp;

EncodedMessage::EncodedMessage(size_t s) : size(s), data(size ? new char[size] : 0), nestAnnotations(false)
{
    init();
}

EncodedMessage::EncodedMessage() : size(0), data(0), nestAnnotations(false)
{
    init();
}

EncodedMessage::EncodedMessage(const EncodedMessage& other) : size(other.size), data(size ? new char[size] : 0), nestAnnotations(false)
{
    init();
}

void EncodedMessage::init()
{
    //init all CharSequence members
    deliveryAnnotations.init();
    messageAnnotations.init();
    userId.init();
    to.init();
    subject.init();
    replyTo.init();
    contentType.init();
    contentEncoding.init();
    groupId.init();
    replyToGroupId.init();
    applicationProperties.init();
    body.init();
    footer.init();
}

EncodedMessage::~EncodedMessage()
{
    delete[] data;
}

size_t EncodedMessage::getSize() const
{
    return size;
}
void EncodedMessage::trim(size_t t)
{
    size = t;
}
void EncodedMessage::resize(size_t s)
{
    delete[] data;
    size = s;
    data = new char[size];
}

char* EncodedMessage::getData()
{
    return data;
}
const char* EncodedMessage::getData() const
{
    return data;
}

void EncodedMessage::init(qpid::messaging::MessageImpl& impl)
{
    try {
        //initial scan of raw data
        qpid::amqp::Decoder decoder(data, size);
        InitialScan reader(*this, impl);
        decoder.read(reader);
        bareMessage = reader.getBareMessage();
        if (bareMessage.data && !bareMessage.size) {
            bareMessage.size = (data + size) - bareMessage.data;
        }
    } catch (const qpid::Exception& e) {
        throw FetchError(e.what());
    }
}
void EncodedMessage::setNestAnnotationsOption(bool b) { nestAnnotations = b; }

namespace {
using qpid::types::Variant;
void merge(qpid::types::Variant::Map& map, const qpid::types::Variant::Map& additions)
{
    for (Variant::Map::const_iterator i = additions.begin(); i != additions.end(); ++i)
    {
        if (map.find(i->first) == map.end()) {
            map[i->first] = i->second;
        } else {
            QPID_LOG(info, "Annotation " << i->first << " hidden by application property of the same name (consider using nest_annotations option?)");
        }
    }
}
}

void EncodedMessage::populate(qpid::types::Variant::Map& map) const
{
    try {
        //decode application properties
        if (applicationProperties) {
            qpid::amqp::Decoder decoder(applicationProperties.data, applicationProperties.size);
            decoder.readMap(map);
        }
        //add in 'x-amqp-' prefixed values
        if (!!firstAcquirer) {
            map["x-amqp-first-acquirer"] = firstAcquirer.get();
        }
        if (!!deliveryCount) {
            map["x-amqp-delivery-count"] = deliveryCount.get();
        }
        if (to) {
            map["x-amqp-to"] = to.str();
        }
        if (contentEncoding) {
            map["x-amqp-content-encoding"] = contentEncoding.str();
        }
        if (!!absoluteExpiryTime) {
            map["x-amqp-absolute-expiry-time"] = absoluteExpiryTime.get();
        }
        if (!!creationTime) {
            map["x-amqp-creation-time"] = creationTime.get();
        }
        if (groupId) {
            map["x-amqp-group-id"] = groupId.str();
        }
        if (!!groupSequence) {
            map["x-amqp-group-sequence"] = groupSequence.get();
        }
        if (replyToGroupId) {
            map["x-amqp-reply-to-group-id"] = replyToGroupId.str();
        }
        //add in any annotations
        if (deliveryAnnotations) {
            qpid::amqp::Decoder decoder(deliveryAnnotations.data, deliveryAnnotations.size);
            if (nestAnnotations) {
                map["x-amqp-delivery-annotations"] = decoder.readMap();
            } else {
                merge(map, decoder.readMap());
            }
        }
        if (messageAnnotations) {
            qpid::amqp::Decoder decoder(messageAnnotations.data, messageAnnotations.size);
            if (nestAnnotations) {
                map["x-amqp-message-annotations"] = decoder.readMap();
            } else {
                merge(map, decoder.readMap());
            }
        }
    } catch (const qpid::Exception& e) {
        throw FetchError(e.what());
    }
}
qpid::amqp::CharSequence EncodedMessage::getBareMessage() const
{
    return bareMessage;
}

void EncodedMessage::getReplyTo(qpid::messaging::Address& a) const
{
    std::string rt = replyTo.str();
    std::string::size_type i = rt.find('/');
    if (i != std::string::npos && i > 0 && rt.find('/', i+1) == std::string::npos) {
        //handle <name>/<subject> special case
        a.setName(rt.substr(0, i));
        a.setSubject(rt.substr(i+1));
    } else {
        a.setName(rt);
    }
}
void EncodedMessage::getSubject(std::string& s) const
{
    s.assign(subject.data, subject.size);
}
void EncodedMessage::getContentType(std::string& s) const
{
    s.assign(contentType.data, contentType.size);
}
void EncodedMessage::getUserId(std::string& s) const
{
    s.assign(userId.data, userId.size);
}
void EncodedMessage::getMessageId(std::string& s) const
{
    messageId.assign(s);
}
void EncodedMessage::getCorrelationId(std::string& s) const
{
    correlationId.assign(s);
}
void EncodedMessage::getBody(std::string& raw, qpid::types::Variant& c) const
{
    try {
        if (!content.isVoid()) {
            c = content;//integer types, floats, bool etc
            //TODO: populate raw data?
        } else {
            if (bodyType.empty()
                || bodyType == qpid::amqp::typecodes::BINARY_NAME
                || bodyType == qpid::types::encodings::UTF8
                || bodyType == qpid::types::encodings::ASCII)
            {
                c = std::string(body.data, body.size);
                c.setEncoding(bodyType);
            } else if (bodyType == qpid::amqp::typecodes::LIST_NAME) {
                qpid::amqp::ListBuilder builder;
                qpid::amqp::Decoder decoder(body.data, body.size);
                decoder.read(builder);
                c = builder.getList();
                raw.assign(body.data, body.size);
            } else if (bodyType == qpid::amqp::typecodes::MAP_NAME) {
                qpid::types::Variant v = qpid::types::Variant::Map();
                qpid::amqp::DataBuilder builder(v);
                qpid::amqp::Decoder decoder(body.data, body.size);
                decoder.read(builder);
                c = builder.getValue().asMap();
                raw.assign(body.data, body.size);
            } else if (bodyType == qpid::amqp::typecodes::UUID_NAME) {
                if (body.size == qpid::types::Uuid::SIZE) c = qpid::types::Uuid(body.data);
                raw.assign(body.data, body.size);
            } else if (bodyType == qpid::amqp::typecodes::ARRAY_NAME) {
                raw.assign(body.data, body.size);
            }
        }
    } catch (const qpid::Exception& e) {
        throw FetchError(e.what());
    }
}

qpid::amqp::CharSequence EncodedMessage::getBody() const
{
    return body;
}

bool EncodedMessage::hasHeaderChanged(const qpid::messaging::MessageImpl& msg) const
{
    if (!durable) {
        if (msg.isDurable()) return true;
    } else {
        if (durable.get() != msg.isDurable()) return true;
    }

    if (!priority) {
        if (msg.getPriority() != 4) return true;
    } else {
        if (priority.get() != msg.getPriority()) return true;
    }

    if (msg.getTtl() && (!ttl || msg.getTtl() != ttl.get())) {
        return true;
    }

    //first-acquirer can't be changed via Message interface as yet

    if (msg.isRedelivered() && (!deliveryCount || deliveryCount.get() == 0)) {
        return true;
    }

    return false;
}

EncodedMessage::InitialScan::InitialScan(EncodedMessage& e, qpid::messaging::MessageImpl& m) : em(e), mi(m)
{
    //set up defaults as needed:
    mi.setPriority(4);
}
//header:
void EncodedMessage::InitialScan::onDurable(bool b) { mi.setDurable(b); em.durable = b; }
void EncodedMessage::InitialScan::onPriority(uint8_t i) { mi.setPriority(i); em.priority = i; }
void EncodedMessage::InitialScan::onTtl(uint32_t i) { mi.setTtl(i); em.ttl = i; }
void EncodedMessage::InitialScan::onFirstAcquirer(bool b) { em.firstAcquirer = b; }
void EncodedMessage::InitialScan::onDeliveryCount(uint32_t i)
{
    mi.setRedelivered(i);
    em.deliveryCount = i;
}

//properties:
void EncodedMessage::InitialScan::onMessageId(uint64_t v) { em.messageId.set(v); }
void EncodedMessage::InitialScan::onMessageId(const qpid::amqp::CharSequence& v, qpid::types::VariantType t) { em.messageId.set(v, t); }
void EncodedMessage::InitialScan::onUserId(const qpid::amqp::CharSequence& v) { em.userId = v; }
void EncodedMessage::InitialScan::onTo(const qpid::amqp::CharSequence& v) { em.to = v; }
void EncodedMessage::InitialScan::onSubject(const qpid::amqp::CharSequence& v) { em.subject = v; }
void EncodedMessage::InitialScan::onReplyTo(const qpid::amqp::CharSequence& v) { em.replyTo = v;}
void EncodedMessage::InitialScan::onCorrelationId(uint64_t v) { em.correlationId.set(v); }
void EncodedMessage::InitialScan::onCorrelationId(const qpid::amqp::CharSequence& v, qpid::types::VariantType t) { em.correlationId.set(v, t); }
void EncodedMessage::InitialScan::onContentType(const qpid::amqp::CharSequence& v) { em.contentType = v; }
void EncodedMessage::InitialScan::onContentEncoding(const qpid::amqp::CharSequence& v) { em.contentEncoding = v; }
void EncodedMessage::InitialScan::onAbsoluteExpiryTime(int64_t i) { em.absoluteExpiryTime = i; }
void EncodedMessage::InitialScan::onCreationTime(int64_t i) { em.creationTime = i; }
void EncodedMessage::InitialScan::onGroupId(const qpid::amqp::CharSequence& v) { em.groupId = v; }
void EncodedMessage::InitialScan::onGroupSequence(uint32_t i) { em.groupSequence = i; }
void EncodedMessage::InitialScan::onReplyToGroupId(const qpid::amqp::CharSequence& v) { em.replyToGroupId = v; }

void EncodedMessage::InitialScan::onApplicationProperties(const qpid::amqp::CharSequence& v, const qpid::amqp::CharSequence&) { em.applicationProperties = v; }
void EncodedMessage::InitialScan::onDeliveryAnnotations(const qpid::amqp::CharSequence& v, const qpid::amqp::CharSequence&) { em.deliveryAnnotations = v; }
void EncodedMessage::InitialScan::onMessageAnnotations(const qpid::amqp::CharSequence& v, const qpid::amqp::CharSequence&) { em.messageAnnotations = v; }

void EncodedMessage::InitialScan::onData(const qpid::amqp::CharSequence& v)
{
    em.body = v;
}
void EncodedMessage::InitialScan::onAmqpSequence(const qpid::amqp::CharSequence& v)
{
    em.body = v;
    em.bodyType = qpid::amqp::typecodes::LIST_NAME;
}
void EncodedMessage::InitialScan::onAmqpValue(const qpid::amqp::CharSequence& v, const std::string& type, const qpid::amqp::Descriptor*)
{
    em.body = v;
    if (type == qpid::amqp::typecodes::STRING_NAME) {
        em.bodyType = qpid::types::encodings::UTF8;
    } else if (type == qpid::amqp::typecodes::SYMBOL_NAME) {
        em.bodyType = qpid::types::encodings::ASCII;
    } else {
        em.bodyType = type;
    }
}
void EncodedMessage::InitialScan::onAmqpValue(const qpid::types::Variant& v, const qpid::amqp::Descriptor*)
{
    em.content = v;
}

void EncodedMessage::InitialScan::onFooter(const qpid::amqp::CharSequence& v, const qpid::amqp::CharSequence&) { em.footer = v; }

}}} // namespace qpid::messaging::amqp


text:
#import "BRBaseMediaCollection.h"

@class BRMediaCollectionType, NSString, NSArray;

@interface BRPhotoMediaCollection : BRBaseMediaCollection {
@private
	NSString *_collectionName;	// 8 = 0x8
	NSString *_keyAssetID;	// 12 = 0xc
	NSString *_description;	// 16 = 0x10
	NSArray *_mediaAssets;	// 20 = 0x14
	NSString *_collectionID;	// 24 = 0x18
	BRMediaCollectionType *_collectionType;	// 28 = 0x1c
	double _date;	// 32 = 0x20
	BOOL _dateCalculated;	// 40 = 0x28
}
@property(retain) NSString *collectionID;	// G=0x315d0381; S=0x315d02bd; converted property
@property(retain) NSString *collectionName;	// G=0x315d0819; S=0x315d0725; converted property
@property(retain) BRMediaCollectionType *collectionType;	// G=0x315cfd21; S=0x315cfd31; converted property
@property(retain) id date;	// G=0x315cfdb9; S=0x315cfd75; converted property
@property(retain) NSString *description;	// G=0x315d04f9; S=0x315d0435; converted property
@property(retain) NSString *keyAssetID;	// G=0x315d0671; S=0x315d05ad; converted property
@property(retain) NSArray *mediaAssets;	// G=0x315d0209; S=0x315d0125; converted property
+ (id)collectionWithCollectionInfo:(id)collectionInfo;	// 0x315cff9d
- (id)initWithCollectionInfo:(id)collectionInfo;	// 0x315cfd49
- (void)_calculateMostRecentDate;	// 0x315cffd1
- (id)archivableCollectionInfo;	// 0x315cfd45
// converted property getter: - (id)collectionID;	// 0x315d0381
// converted property getter: - (id)collectionName;	// 0x315d0819
// converted property getter: - (id)collectionType;	// 0x315cfd21
// converted property getter: - (id)date;	// 0x315cfdb9
- (void)dealloc;	// 0x315cff0d
// converted property getter: - (id)description;	// 0x315d04f9
- (unsigned)hash;	// 0x315cfed1
- (BOOL)isEqual:(id)equal;	// 0x315cfe31
- (BOOL)isLibrary;	// 0x315cfd41
- (id)keyAsset;	// 0x315d08cd
// converted property getter: - (id)keyAssetID;	// 0x315d0671
// converted property getter: - (id)mediaAssets;	// 0x315d0209
- (id)playbackOptions;	// 0x315cfd1d
// converted property setter: - (void)setCollectionID:(id)anId;	// 0x315d02bd
// converted property setter: - (void)setCollectionName:(id)name;	// 0x315d0725
// converted property setter: - (void)setCollectionType:(id)type;	// 0x315cfd31
// converted property setter: - (void)setDate:(id)date;	// 0x315cfd75
// converted property setter: - (void)setDescription:(id)description;	// 0x315d0435
// converted property setter: - (void)setKeyAssetID:(id)anId;	// 0x315d05ad
// converted property setter: - (void)setMediaAssets:(id)assets;	// 0x315d0125
- (id)title;	// 0x315cfe1d
@end


text:
When using grep, most systems have color highlighting enabled by default. But since Git Bash on Windows does not, force it using the `--color` flag.

```bash
$ pip freeze | grep -i py --color
```


text:
/*
 * condor_chirp -- a program wrapper around the chirp API
 */

#include "condor_common.h"
#include "chirp_client.h"
#include "chirp_protocol.h"
#include <stdio.h>
#include <stdlib.h>
#include "MyString.h"

#define DISCONNECT_AND_RETURN(client, rval) \
	int save_errno = errno; \
	chirp_client_disconnect((client)); \
	errno = save_errno; \
	return (rval)

#define CLOSE_DISCONNECT_AND_RETURN(client, fd, rval) \
	int save_errno = errno; \
	chirp_client_close((client), (fd)); \
	chirp_client_disconnect((client)); \
	errno = save_errno; \
	return (rval)

#define CONNECT_STARTER(client) \
	(client) = chirp_client_connect_starter(); \
	if (!(client)) { \
		fprintf(stderr, "cannot chirp_connect to shadow\n"); \
		return -1; \
	}

void print_stat(chirp_stat *stat, const char *lead = "") {
	time_t t;

	printf("%sdevice: %ld\n", lead, stat->cst_dev);
	printf("%sinode: %ld\n", lead, stat->cst_ino);
	printf("%smode: %ld\n", lead, stat->cst_mode);
	printf("%snlink: %ld\n", lead, stat->cst_nlink);
	printf("%suid: %ld\n", lead, stat->cst_uid);
	printf("%sgid: %ld\n", lead, stat->cst_gid);
	printf("%srdevice: %ld\n", lead, stat->cst_rdev);
	printf("%ssize: %ld\n", lead, stat->cst_size);
	printf("%sblksize: %ld\n", lead, stat->cst_blksize);
	printf("%sblocks: %ld\n", lead, stat->cst_blocks);
	t = stat->cst_atime;
	printf("%satime: %s", lead, ctime(&t));
	t = stat->cst_mtime;
	printf("%smtime: %s", lead, ctime(&t));
	t = stat->cst_ctime;
	printf("%sctime: %s", lead, ctime(&t));
}

void print_statfs(chirp_statfs *stat, const char *lead = "") {
	printf("%sf_type: %ld\n", lead, stat->f_type);
	printf("%sf_bsize: %ld\n", lead, stat->f_bsize);
	printf("%sf_blocks: %ld\n", lead, stat->f_blocks);
	printf("%sf_bfree: %ld\n", lead, stat->f_bfree);
	printf("%sf_bavail: %ld\n", lead, stat->f_bavail);
	printf("%sf_files: %ld\n", lead, stat->f_files);
	printf("%sf_ffree: %ld\n", lead, stat->f_ffree);
}

struct chirp_client *
chirp_client_connect_starter()
{
    FILE *file;
    int fields;
    struct chirp_client *client;
    char *default_filename;
    char host[CONDOR_HOSTNAME_MAX];
    char cookie[CHIRP_LINE_MAX];
	MyString path;
    int port;
    int result;
	const char *dir;

	if ((default_filename = getenv("_CONDOR_CHIRP_CONFIG"))) {
		path.formatstr( "%s", default_filename );
	} else {
		if (NULL == (dir = getenv("_CONDOR_SCRATCH_DIR"))) {
			dir = ".";
		}
		path.formatstr( "%s%c%s",dir,DIR_DELIM_CHAR,".chirp.config");
	}
    file = safe_fopen_wrapper_follow(path.Value(),"r");
    if(!file) {
		fprintf(stderr, "Can't open %s file\n",path.Value());
		return 0;
	}

    fields = fscanf(file,"%s %d %s",host,&port,cookie);
    fclose(file);

    if(fields!=3) {
        errno = EINVAL;
        return 0;
    }

    client = chirp_client_connect(host,port);
    if(!client) return 0;

    result = chirp_client_cookie(client,cookie);
    if(result!=0) {
		DISCONNECT_AND_RETURN(client, 0);
    }

    return client;
}

int
chirp_get_one_file(char *remote, char *local) {
	struct chirp_client *client = 0;

	CONNECT_STARTER(client);

	char *buf = NULL;

	int num_read = chirp_client_getfile_buffer( client, remote, &buf );
	if (num_read < 0) {
		DISCONNECT_AND_RETURN(client, -1);
	}

	FILE *wfd;
	if (strcmp(local, "-") == 0) {
		wfd = stdout;
	} else {
		wfd = ::safe_fopen_wrapper_follow(local, "wb+");
	}

	if (wfd == NULL) {
		fprintf(stderr, "Can't open local file %s\n", local);
		free(buf);
		DISCONNECT_AND_RETURN(client, -1);
	}

	int num_written = ::fwrite(buf, 1, num_read, wfd);
	if (num_written != num_read) {
		fprintf(stderr, "local write error on %s\n", local);
		::fclose(wfd);
		free(buf);
		DISCONNECT_AND_RETURN(client, -1);
	}

	fclose(wfd);
	free(buf);
	DISCONNECT_AND_RETURN(client, 0);
}

// Old version using open, write
// Still here because of the ability to use different modes
int
chirp_put_one_file(char *local, char *remote, char *mode, int perm) {
	struct chirp_client *client;

		// We connect each time, so that we don't have thousands
		// of idle connections hanging around the master
	CONNECT_STARTER(client);

	FILE *rfd;
	if (strcmp(local, "-") == 0) {
		rfd = stdin;
	} else {
		rfd = ::safe_fopen_wrapper_follow(local, "rb");
	}

	if (rfd == NULL) {
		fprintf(stderr, "Can't open local file %s\n", local);
		DISCONNECT_AND_RETURN(client, -1);
	}

	int wfd = chirp_client_open(client, remote, mode, perm);
	if (wfd < 0) {
		::fclose(rfd);
		fprintf(stderr, "Can't chirp_client_open %s:%d\n", remote, wfd);
		DISCONNECT_AND_RETURN(client, -1);
	}

	char buf[8192];

	int num_read = 0;
	do {
		num_read = ::fread(buf, 1, 8192, rfd);
		if (num_read < 0) {
			fclose(rfd);
			fprintf(stderr, "local read error on %s\n", local);
			CLOSE_DISCONNECT_AND_RETURN(client, wfd, -1);
		}

			// EOF
		if (num_read == 0) {
			break;
		}

		int num_written = chirp_client_write(client, wfd, buf, num_read);
		if (num_written != num_read) {
			fclose(rfd);
			fprintf(stderr, "Couldn't chirp_write as much as we read\n");
			CLOSE_DISCONNECT_AND_RETURN(client, wfd, -1);
		}

	} while (num_read > 0);
	::fclose(rfd);

	CLOSE_DISCONNECT_AND_RETURN(client, wfd, 0);
}

// New version using putfile
int
chirp_put_one_file(char *local, char *remote, int perm) {
	struct chirp_client *client;

	CONNECT_STARTER(client);

	FILE *rfd = ::safe_fopen_wrapper_follow(local, "rb");

	if (rfd == NULL) {
		fprintf(stderr, "Can't open local file %s\n", local);
		DISCONNECT_AND_RETURN(client, -1);
	}

		// Get size of file, allocate buffer
	struct stat stat_buf;
	if (fstat(fileno(rfd), &stat_buf) == -1) {
		fprintf(stderr, "Can't fstat local file %s\n", local);
		fclose(rfd);
		DISCONNECT_AND_RETURN(client, -1);
	}

	int size = stat_buf.st_size;
	char* buf = (char*)malloc(size);
	if ( ! buf) {
		fprintf(stderr, "Can't allocate %d bytes\n", size);
		fclose(rfd);
		DISCONNECT_AND_RETURN(client, -1);
	}

	int num_read = ::fread(buf, 1, size, rfd);

	if (num_read < 0) {
		fclose(rfd);
		free(buf);
		fprintf(stderr, "Local read error on %s\n", local);
		DISCONNECT_AND_RETURN(client, -1);
	}

		// Call putfile
	int num_written = chirp_client_putfile_buffer(client, remote, buf, perm, num_read);
	if (num_written != num_read) {
		fclose(rfd);
		free(buf);
		fprintf(stderr, "Couldn't chirp_write as much as we read\n");
		DISCONNECT_AND_RETURN(client, -1);
	}

	fclose(rfd);
	free(buf);
	DISCONNECT_AND_RETURN(client, 0);
}

/*
 * chirp_fetch
 *   parse the fetch-specific arguments, then call
 *  chirp_get_one_file to do the real work
 */

int chirp_fetch(int argc, char **argv) {
	if (argc != 4) {
		printf("condor_chirp fetch remote_file local_file\n");
		return -1;
	}
	return chirp_get_one_file(argv[2], argv[3]);
}

/*
 * chirp_put
 *   parse the put-specific arguments, then call
 *  chirp_put_one_file to do the real work
 */

int chirp_put(int argc, char **argv) {

	int fileOffset = 2;
	char default_mode [] = "cwb";
	char *mode = default_mode;
	unsigned perm = 0777;

	bool more = true;
	while (more && fileOffset + 1 < argc) {

		if (strcmp(argv[fileOffset], "-mode") == 0) {
			mode = argv[fileOffset+1];
			fileOffset += 2;
			more = true;
		}
		else if (strcmp(argv[fileOffset], "-perm") == 0) {
			char *permStr = argv[fileOffset + 1];
			perm = strtol(permStr, NULL, 8);
			fileOffset += 2;
			more = true;
		}
		else {
			more = false;
		}
	}

	if(fileOffset + 1 >= argc || argc > fileOffset + 2) {
		printf("condor_chirp put  [-mode mode] [-perm perm] local_file "
			   "remote_file\n");
		return -1;
	}

	// Use putfile
	if(strcmp(mode, "cwb") == 0 && strcmp(argv[fileOffset], "-") != 0) {
		return chirp_put_one_file(argv[fileOffset], argv[fileOffset + 1], perm);
	}
	// Use open, write
	else {
		return chirp_put_one_file(argv[fileOffset], argv[fileOffset + 1], mode, perm);
	}
}

/*
 * chirp_remove
 *   call chirp_remove to do the real work
 */

int chirp_remove(int argc, char **argv) {
	if (argc != 3) {
		printf("condor_chirp remove remote_file\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

    int rval = chirp_client_unlink(client, argv[2]);
	DISCONNECT_AND_RETURN(client, rval);
}

/*
 * chirp_getattr
 *   call chirp_getattr to do the real work
 */

int chirp_get_job_attr(int argc, char **argv) {
	if (argc != 3) {
		printf("condor_chirp get_job_attr AttributeName\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	char *p = 0;
	int len = chirp_client_get_job_attr(client, argv[2], &p);
	printf("%.*s\n", len, p);
	free(p);
	DISCONNECT_AND_RETURN(client, 0);
}

int chirp_get_job_attr_delayed(int argc, char **argv) {
	if (argc != 3) {
		printf("condor_chirp get_job_attr_delayed AttributeName\n");
		printf("This retrieves the attribute value from the local starter.\n");
		printf("While this has no impact on the schedd, the attribute value may\n");
		printf("differ from the current one in the schedd, depending when the last\n");
		printf("schedd->starter update occurred.\n");
		return -1;
	}

	struct chirp_client *client = NULL;
	CONNECT_STARTER(client);

	char *p = 0;
	int len = chirp_client_get_job_attr_delayed(client, argv[2], &p);
	printf("%.*s\n", len, p);
	free(p);
	DISCONNECT_AND_RETURN(client, 0);
}

/*
 * chirp_getattr
 *   call chirp_setattr to do the real work
 */

int chirp_set_job_attr(int argc, char **argv) {
	if (argc != 4) {
		printf("condor_chirp set_job_attr AttributeName AttributeValue\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

    int rval = chirp_client_set_job_attr(client, argv[2], argv[3]);
	DISCONNECT_AND_RETURN(client, rval);
}

/*
 * chirp_set_job_attr_delayed
 * Do an update to the remote shadow.  The update is non-durable - it may be lost by the
 * schedd, but it will consume less resources on the submit side.
 */

int chirp_set_job_attr_delayed(int argc, char **argv) {
	if (argc != 4) {
		printf("condor_chirp set_job_attr_delayed AttributeName AttributeValue\n");
		printf("This will perform a non-durable update to the shadow; it consumes\n");
		printf("less resources than set_job_attr, but may be lost.\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	int rval = chirp_client_set_job_attr_delayed(client, argv[2], argv[3]);
	DISCONNECT_AND_RETURN(client, rval);
}

/*
 * chirp_ulog
 *
 */

int chirp_ulog(int argc, char **argv) {
	if (argc != 3) {
		printf("condor_chirp ulog message\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

    int rval = chirp_client_ulog(client, argv[2]);
	DISCONNECT_AND_RETURN(client, rval);
}

/*
 * chirp_phase
 *
 */

int chirp_phase(int argc, char **argv) {
	if (argc != 3) {
		printf("condor_chirp phase phasestring\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

    int rval = chirp_client_phase(client, argv[2]);
	DISCONNECT_AND_RETURN(client, rval);
}

int chirp_read(int argc, char **argv) {
	int fileOffset = 2;
	int offset = 0;
	int stride_length = 0;
	int stride_skip = 0;

	bool more = true;
	while (more && fileOffset + 1 < argc) {

		if (strcmp(argv[fileOffset], "-offset") == 0) {
			offset = strtol(argv[fileOffset + 1], NULL, 10);
			fileOffset += 2;
			more = true;
		}
		else if (strcmp(argv[fileOffset], "-stride") == 0
					&& fileOffset + 2 < argc) {
			stride_length = strtol(argv[fileOffset + 1], NULL, 10);
			stride_skip = strtol(argv[fileOffset + 2], NULL, 10);
			fileOffset += 3;
			more = true;
		}
		else {
			more = false;
		}
	}

	if(fileOffset + 2 != argc) {
		printf("condor_chirp read [-offset offset] [-stride length skip] "
			"remotepath length\n");
		return -1;
	}

	char *path = argv[fileOffset];
	int length = strtol(argv[fileOffset + 1], NULL, 10);
	void* buf = malloc(length+1);
	if ( ! buf) {
		printf("failed to allocate %d bytes\n", length);
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	int fd = chirp_client_open(client, path, "r", 0);
	if(fd < 0) {
		DISCONNECT_AND_RETURN(client, fd);
	}

	int ret_val = -1;
	// Use read
	if(offset == 0 && stride_length == 0 && stride_skip == 0) {
		ret_val = chirp_client_read(client, fd, buf, length);
	}
	// Use pread
	else if(offset != 0 && stride_length == 0 && stride_skip == 0) {
		ret_val = chirp_client_pread(client, fd, buf, length, offset);
	}
	// Use sread
	else {
		ret_val = chirp_client_sread(client, fd, buf, length, offset,
			stride_length, stride_skip);
	}

	if(ret_val >= 0) {
		char* to_print = (char*)buf;
		to_print[length] = '\0';
		printf("%s\n", to_print);
	}

	free(buf);
	CLOSE_DISCONNECT_AND_RETURN(client, fd, ret_val);

}

int chirp_write(int argc, char **argv) {
	int fileOffset = 2;
	int offset = 0;
	int stride_length = 0;
	int stride_skip = 0;

	bool more = true;
	while (more && fileOffset + 1 < argc) {

		if (strcmp(argv[fileOffset], "-offset") == 0) {
			offset = strtol(argv[fileOffset + 1], NULL, 10);
			fileOffset += 2;
			more = true;
		}
		else if (strcmp(argv[fileOffset], "-stride") == 0
					&& fileOffset + 2 < argc) {
			stride_length = strtol(argv[fileOffset + 1], NULL, 10);
			stride_skip = strtol(argv[fileOffset + 2], NULL, 10);
			fileOffset += 3;
			more = true;
		}
		else {
			more = false;
		}
	}
	int length = 0;
	bool backward_compat = false;
	if(fileOffset + 2 == argc) {
		//backward compat
		backward_compat = true;
		if(stride_length != 0 || stride_skip != 0) {
			length = stride_length;
		} else {
			length = 1024;
		}
	} else if(fileOffset + 3 == argc) {
		length = strtol(argv[fileOffset + 2], NULL, 10);
	} else {
		printf("condor_chirp write [-offset offset] [-stride length skip] "
			"remote_file local_file length %d %d\n",fileOffset , argc);
		return -1;
	}

	char *remote_file = argv[fileOffset];
	char *local_file = argv[fileOffset+1];

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	int num_read = 0, num_written = 0, add = 0;
	FILE *rfd;
	char *buf;

		// Use stdin or a local file
	if (strcmp(local_file, "-") == 0) {
		rfd = stdin;
	} else {
		rfd = ::safe_fopen_wrapper_follow(local_file, "rb");
		if (!rfd) {
			fprintf(stderr, "Can't open local file %s\n", local_file);
			DISCONNECT_AND_RETURN(client, -1);
		}
	}

		// Open the remote file
	int fd = chirp_client_open(client, remote_file, "w", 0);
	if(fd < 0) {
		fclose(rfd);
		DISCONNECT_AND_RETURN(client, fd);
	}

	buf = (char*)malloc(length+1);
	if ( ! buf) {
		errno = ENOMEM;
		CLOSE_DISCONNECT_AND_RETURN(client, fd, -1);
	}

	int ret_val = -1;
	// Use pwrite
	if(stride_length == 0 && stride_skip == 0) {
		//offset is remote offset so we don't read using the offset value
		num_read = ::fread(buf, 1, length, rfd);
		if (num_read < 0) {
			fclose(rfd);
			free((char*)buf);
			fprintf(stderr, "Local read error on %s\n", local_file);
			CLOSE_DISCONNECT_AND_RETURN(client, fd, -1);
		}
		ret_val = chirp_client_pwrite(client, fd, buf, num_read, offset);
	} else {
		if (!backward_compat){
			num_read = ::fread(buf, 1, length, rfd);
			if (num_read < 0) {
				fclose(rfd);
				free((char*)buf);
				fprintf(stderr, "Local read error on %s\n", local_file);
				CLOSE_DISCONNECT_AND_RETURN(client, fd, -1);
			}

			ret_val = chirp_client_swrite(client, fd, buf, length, offset,
				stride_length, stride_skip);
		} else {
			unsigned int total = 0;
			do {
				num_read = ::fread(buf, 1, length, rfd);
				if (num_read < 0) {
					fclose(rfd);
					free((char*)buf);
					fprintf(stderr, "Local read error on %s\n", local_file);
					CLOSE_DISCONNECT_AND_RETURN(client, fd, -1);
				}

				// EOF
				if (num_read == 0) {
					break;
				}

				// Use pwrite
				num_written = chirp_client_pwrite(client, fd, buf, num_read, offset+add);

				// Make sure we wrote the expected number of bytes
				if(num_written != num_read) {
					fclose(rfd);
					free((char*)buf);
					fprintf(stderr, "pwrite unable to write %d bytes\n", num_read);
					CLOSE_DISCONNECT_AND_RETURN(client, fd, -1);
				}
				total += num_written;
				if(stride_length != 0 || stride_skip != 0) {
					add += stride_skip;
				} else {
					add += num_read;
				}
			} while (num_read > 0);
			ret_val = total;
		}
	}
	fclose(rfd);
	free((char*)buf);
	CLOSE_DISCONNECT_AND_RETURN(client, fd, ret_val);
}

int chirp_rmdir(int argc, char **argv) {
	if (argc < 3 || argc > 4 || (argc == 4 && strcmp(argv[2], "-r") != 0)) {
		printf("condor_chirp rmdir [-r] remotepath\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	int status = -1;

		// Use rmall if '-r' specified
	if(argc == 4) {
		status = chirp_client_rmall(client, argv[3]);
	} else {
		status = chirp_client_rmdir(client, argv[2]);
	}
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_getdir(int argc, char **argv) {
	if (argc < 3 || argc > 4 || (argc == 4 && strcmp(argv[2], "-l") != 0)) {
		printf("condor_chirp getdir [-l] remotepath\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	char *buffer;
	int status = -1;

		// Use getlongdir if '-l' specified
	if(argc == 4) {
		if((status = chirp_client_getlongdir(client, argv[3], &buffer)) >= 0) {
			char *line;
			struct chirp_stat stat;

			line = strtok(buffer, "\n");
			while(line != NULL) {
				printf("%s\n", line);
				line = strtok(NULL, "\n");
				if(line == NULL || get_stat(line, &stat) < 0) {
					break;
				}
				print_stat(&stat, "\t");
				line = strtok(NULL, "\n");
			}
		}
	} else {
		if((status = chirp_client_getdir(client, argv[2], &buffer) >= 0)) {
			printf("%s", buffer);
		}
	}
	free(buffer);
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_whoami() {
	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	char* buffer = (char*)malloc(CHIRP_LINE_MAX);
	int status = chirp_client_whoami(client, buffer, CHIRP_LINE_MAX);
	printf("%s\n", buffer);
	free(buffer);
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_whoareyou(int argc, char **argv) {
	if (argc != 3) {
		printf("condor_chirp whoareyou remotepath\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	char* buffer = (char*)malloc(CHIRP_LINE_MAX);
	int status = chirp_client_whoareyou(client, argv[2], buffer, CHIRP_LINE_MAX);
	printf("%s\n", buffer);
	free(buffer);
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_link(int argc, char **argv) {
	if (argc < 4 || argc > 5 || (argc == 5 && strcmp(argv[2], "-s") != 0)) {
		printf("condor_chirp link [-s] oldpath newpath\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	int status = -1;
	if(argc == 5) {
		status = chirp_client_symlink(client, argv[3], argv[4]);
	} else {
		status = chirp_client_link(client, argv[2], argv[3]);
	}
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_readlink(int argc, char **argv) {
	if (argc != 4) {
		printf("condor_chirp readlink remotepath length\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	char *buffer = NULL;

	int length = atoi(argv[3]);
	int status = chirp_client_readlink(client, argv[2], length, &buffer);
	if(status >= 0) {
		printf("%s\n", buffer);
	}
	free(buffer);
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_do_stat(int argc, char **argv) {
	if (argc != 3) {
		printf("condor_chirp %s remotepath\n", argv[1]);
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	struct chirp_stat stat;
	int status = -1;
	if(strcmp(argv[1], "lstat") == 0) {
		status = chirp_client_lstat(client, argv[2], &stat);
	} else {
		status = chirp_client_stat(client, argv[2], &stat);
	}
	if(status >= 0) {
		print_stat(&stat);
	}
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_do_statfs(int argc, char **argv) {
	if (argc != 3) {
		printf("condor_chirp statfs remotepath\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	struct chirp_statfs statfs;
	int status = chirp_client_statfs(client, argv[2], &statfs);
	if(status >= 0) {
		print_statfs(&statfs);
	}
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_access(int argc, char **argv) {
	if (argc != 4) {
		printf("condor_chirp access remotepath mode(rwxf)\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	int mode = 0;
	char *m = argv[3];
	while(*m != '\0') {
		switch(*m) {
			case 'r':
				mode |= R_OK;
				break;
			case 'w':
				mode |= W_OK;
				break;
			case 'x':
				mode |= X_OK;
				break;
			case 'f':
				mode |= F_OK;
				break;
			default:
				fprintf(stderr, "invalid mode char '%c'\n", *m);
				DISCONNECT_AND_RETURN(client, -1);
				break;
		}
		m++;
	}
	int status = chirp_client_access(client, argv[2], mode);
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_chmod(int argc, char **argv) {
	if (argc != 4) {
		printf("condor_chirp chmod remotepath mode\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	unsigned mode;
	if (1 != sscanf(argv[3], "%o", &mode)) {
		free(client);
		return EINVAL;
	}
	int status = chirp_client_chmod(client, argv[2], mode);
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_chown(int argc, char **argv) {
	if (argc != 5) {
		printf("condor_chirp %s remotepath uid gid\n", argv[1]);
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	int uid = atoi(argv[3]);
	int gid = atoi(argv[4]);
	int status = -1;
	if(strcmp(argv[1], "lchown")) {
		status = chirp_client_lchown(client, argv[2], uid, gid);
	} else {
		status = chirp_client_chown(client, argv[2], uid, gid);
	}
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_truncate(int argc, char **argv) {
	if (argc != 4) {
		printf("condor_chirp truncate remotepath length\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	int len = atoi(argv[3]);
	int status = chirp_client_truncate(client, argv[2], len);
	DISCONNECT_AND_RETURN(client, status);
}

int chirp_utime(int argc, char **argv) {
	if (argc != 5) {
		printf("condor_chirp utime remotepath actime mtime\n");
		return -1;
	}

	struct chirp_client *client = 0;
	CONNECT_STARTER(client);

	int actime = atoi(argv[3]);
	int mtime = atoi(argv[4]);
	int status = chirp_client_utime(client, argv[2], actime, mtime);
	DISCONNECT_AND_RETURN(client, status);
}

void usage() {
	printf("Usage:\n");
	printf("condor_chirp fetch remote_file local_file\n");
	printf("condor_chirp put [-mode mode] [-perm perm] local_file "
	   "remote_file\n");
	printf("condor_chirp remove remote_file\n");
	printf("condor_chirp get_job_attr job_attribute\n");
	printf("condor_chirp get_job_attr_delayed job_attribute\n");
	printf("condor_chirp set_job_attr job_attribute attribute_value\n");
	printf("condor_chirp set_job_attr_delayed job_attribute attribute_value\n");
	printf("condor_chirp ulog text\n");
	printf("condor_chirp phase phasestring\n");
	printf("condor_chirp read [-offset offset] [-stride length skip] "
		"remote_file length\n");
	printf("condor_chirp write [-offset remote_offset] [-stride length skip] "
		"remote_file local_file\n");
	printf("condor_chirp rmdir [-r] remotepath\n");
	printf("condor_chirp getdir [-l] remotepath\n");
	printf("condor_chirp whoami\n");
	printf("condor_chirp whoareyou remotepath\n");
	printf("condor_chirp link [-s] oldpath newpath\n");
	printf("condor_chirp readlink remotepath length\n");
	printf("condor_chirp stat remotepath\n");
	printf("condor_chirp lstat remotepath\n");
	printf("condor_chirp statfs remotepath\n");
	printf("condor_chirp access remotepath mode(rwxf)\n");
	printf("condor_chirp chmod remotepath mode\n");
	printf("condor_chirp chown remotepath uid gid\n");
	printf("condor_chirp lchown remotepath uid gid\n");
	printf("condor_chirp truncate remotepath length\n");
	printf("condor_chirp utime remotepath actime mtime\n");
}

int
main(int argc, char **argv) {

	int ret_val = -1;

	if (argc == 1 || (argc == 2 && strcmp(argv[1], "-h") == 0)) {
		usage();
		exit(-1);
	}

	if (strcmp("fetch", argv[1]) == 0) {
		ret_val = chirp_fetch(argc, argv);
	} else if (strcmp("put", argv[1]) == 0) {
		ret_val = chirp_put(argc, argv);
	} else if (strcmp("remove", argv[1]) == 0) {
		ret_val = chirp_remove(argc, argv);
	} else if (strcmp("get_job_attr_delayed", argv[1]) == 0) {
		ret_val = chirp_get_job_attr_delayed(argc, argv);
	} else if (strcmp("get_job_attr", argv[1]) == 0) {
		ret_val = chirp_get_job_attr(argc, argv);
	} else if (strcmp("set_job_attr_delayed", argv[1]) == 0) {
		ret_val = chirp_set_job_attr_delayed(argc, argv);
	} else if (strcmp("set_job_attr", argv[1]) == 0) {
		ret_val = chirp_set_job_attr(argc, argv);
	} else if (strcmp("ulog", argv[1]) == 0) {
		ret_val = chirp_ulog(argc, argv);
	} else if (strcmp("phase", argv[1]) == 0) {
		ret_val = chirp_phase(argc, argv);
	} else if (strcmp("read", argv[1]) == 0) {
		ret_val = chirp_read(argc, argv);
	} else if (strcmp("write", argv[1]) == 0) {
		ret_val = chirp_write(argc, argv);
	} else if (strcmp("rmdir", argv[1]) == 0) {
		ret_val = chirp_rmdir(argc, argv);
	} else if (strcmp("getdir", argv[1]) == 0) {
		ret_val = chirp_getdir(argc, argv);
	} else if (strcmp("whoami", argv[1]) == 0) {
		ret_val = chirp_whoami();
	} else if (strcmp("whoareyou", argv[1]) == 0) {
		ret_val = chirp_whoareyou(argc, argv);
	} else if (strcmp("link", argv[1]) == 0) {
		ret_val = chirp_link(argc, argv);
	} else if (strcmp("readlink", argv[1]) == 0) {
		ret_val = chirp_readlink(argc, argv);
	} else if (strcmp("stat", argv[1]) == 0 || strcmp("lstat", argv[1]) == 0) {
		ret_val = chirp_do_stat(argc, argv);
	} else if (strcmp("statfs", argv[1]) == 0) {
		ret_val = chirp_do_statfs(argc, argv);
	} else if (strcmp("access", argv[1]) == 0) {
		ret_val = chirp_access(argc, argv);
	} else if (strcmp("chmod", argv[1]) == 0) {
		ret_val = chirp_chmod(argc, argv);
	} else if (strcmp("chown", argv[1]) == 0 || strcmp("lchown", argv[1]) == 0){
		ret_val = chirp_chown(argc, argv);
	} else if (strcmp("truncate", argv[1]) == 0) {
		ret_val = chirp_truncate(argc, argv);
	} else if (strcmp("utime", argv[1]) == 0) {
		ret_val = chirp_utime(argc, argv);
	} else {
		printf("Unknown command %s\n", argv[1]);
		usage();
		exit(-1);
	}

	if(ret_val < 0 && errno != 0) {
		printf("\tError: %d (%s)\n", errno, strerror(errno));
	}
	return ret_val;
}


text:
<?php
defined('_JEXEC') or die('No direct access!');
jimport('joomla.application.component.helper');
$mapskey=JComponentHelper::getParams('com_regoffices')->get('googlemaps_key');
//$mapskey='AIzaSyCURPPXV_X66ukfddsJ_321GGtkhEpakI8';

$doc=JFactory::getDocument();
$lang=JFactory::getLanguage();
$url_offices_json=JRoute::_('index.php?option=com_regoffices&view=offices&format=json');

$doc->addStylesheet('/media/com_regoffices/css/regoffices.css');
$doc->addScript('https://maps.googleapis.com/maps/api/js?key='.$mapskey.'&signed_in=true&language='.$lang->getTag());//&callback=initMap
$jscontent='window.url_offices_json="'.$url_offices_json.'";'.PHP_EOL;
$jscontent.='window.regoffices_filter={};'.PHP_EOL;
$jscontent.='window.regoffices_filter.country='.$this->country->id.';'.PHP_EOL;
$jscontent.=file_get_contents(dirname(__FILE__).DIRECTORY_SEPARATOR.'default.js');
$doc->addScriptDeclaration($jscontent);
?>

<?php echo $this->heading; ?>

<?php echo JText::_('COM_REGOFFICES_SELECT_HEADING'); ?>

<?php echo JText::_('COM_REGOFFICES_SELECT_COUNTRY'); ?>

					<?php foreach($this->countries as $country): ?>
						<li<?php echo($country->id==$this->country->id?' class="active"':''); ?>>
							<a href="<?php echo JRoute::_('index.php?option=com_regoffices&view=country&id='.$country->id); ?>"><?php echo $country->getlangvar('name'); ?>

					<?php endforeach; ?>

<?php echo JText::_('COM_REGOFFICES_SELECT_CITY'); ?>

					<?php foreach($this->cities as $city): ?>

							<a href="<?php echo JRoute::_('index.php?option=com_regoffices&view=city&id='.$city->id); ?>"><?php echo $city->getlangvar('name'); ?>

					<?php endforeach; ?>

<?php echo $this->description; ?>


text:
package org.codehaus.enunciate.samples.genealogy.services.impl;

import org.codehaus.enunciate.samples.genealogy.cite.InfoSet;
import org.codehaus.enunciate.samples.genealogy.cite.Source;
import org.codehaus.enunciate.samples.genealogy.data.Event;
import org.codehaus.enunciate.samples.genealogy.services.ServiceException;
import org.codehaus.enunciate.samples.genealogy.services.SourceService;
import org.codehaus.enunciate.samples.genealogy.services.UnknownSourceBean;
import org.codehaus.enunciate.samples.genealogy.services.UnknownSourceException;

import javax.jws.WebService;
import javax.ws.rs.Path;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;

/**
 * @author Ryan Heaton
 */
@WebService (
  endpointInterface = "org.codehaus.enunciate.samples.genealogy.services.SourceService"
)
@Path ("source")
public class SourceServiceImpl implements SourceService {

  public void addSource(Source source) {
    try {
      Thread.sleep(10 * 1000); //simulate a long wait time...  doens't matter, should be one-way...
    }
    catch (InterruptedException e) {
      //fall through...
    }
  }

  public Source getSource(String id) throws ServiceException, UnknownSourceException {
    if ("valid".equals(id)) {
      Source source = new Source();
      source.setId("valid");
      source.setLink(URI.create("uri:some-uri"));
      source.setTitle("some-title");
      return source;
    }
    else if ("throw".equals(id)) {
      throw new ServiceException("some message", "another message");
    }
    else if ("unknown".equals(id)) {
      UnknownSourceBean bean = new UnknownSourceBean();
      bean.setSourceId("unknown");
      bean.setErrorCode(888);
      throw new UnknownSourceException("some message", bean);
    }

    return null;
  }

  public String addInfoSet(String sourceId, InfoSet infoSet) throws ServiceException {
    if ("somesource".equals(sourceId)) {
      return "newid";
    }
    else if ("unknown".equals(sourceId)) {
      throw new ServiceException("unknown source id", "anyhow");
    }
    else if ("resource".equals(sourceId)) {
      InputStreamReader reader = new InputStreamReader(SourceServiceImpl.class.getResourceAsStream("infosetid.txt"));
      BufferedReader buffered = new BufferedReader(reader);
      try {
        return buffered.readLine();
      }
      catch (IOException e) {
        throw new ServiceException("unable to read", e.getMessage());
      }
    }

    return "okay";
  }

  public String addEvents(String infoSetId, Event[] assertions, String contributorId) throws ServiceException {
    if ("illegal".equals(contributorId)) {
      throw new ServiceException("illegal contributor", "illegal");
    }

    if ("unknown".equals(infoSetId)) {
      throw new ServiceException("unknown info set", infoSetId);
    }

    if (assertions.length < 3) {
      throw new ServiceException("you must add three", "three");
    }

    return contributorId;
  }
}


text:
using IORAMHelper;
using System;

namespace GenieLibrary
{
	/// <summary>
	/// Definiert Eigenschaften eines DAT-Datei-Datenelements.
	/// </summary>
	public class IGenieDataElement
	{
		#region Hilfsfunktionen

		/// <summary>
		/// Stellt sicher, dass die übergebene Liste die angegebene Länge hat, indem im Fehlerfall eine Exception ausgelöst wird.
		/// </summary>
		/// <param name="list">Die zu überprüfende Liste.</param>
		/// <param name="length">Die Soll-Länge der Liste.</param>
		public static void AssertListLength(System.Collections.ICollection list, int length)
		{
			// Länge abgleichen
			if(list.Count != length)
			{
				// Fehler auslösen
				throw new AssertionException("Die Listenlänge (" + list.Count + ") weicht von der Soll-Länge (" + length + ") ab.");
			}
		}

		/// <summary>
		/// Stellt sicher, dass der übergebene Wert true ist, sonst wird eine Exception ausgelöst.
		/// </summary>
		/// <param name="value">Der zu überprüfende Wahrheitswert.</param>
		public static void AssertTrue(bool value)
		{
			// Länge abgleichen
			if(!value)
			{
				// Fehler auslösen
				throw new AssertionException("Der Ausdruck wurde unerwartet zu false ausgewertet.");
			}
		}

		#endregion Hilfsfunktionen

		#region Strukturen

		/// <summary>
		/// Definiert das übliche Ressourcen-Tupel (Typ, Menge, Aktiviert) mit frei wählbaren Datentypen.
		/// </summary>
		/// <typeparam name="T">Der Datentyp des Ressourcen-Typs.</typeparam>
		/// <typeparam name="A">Der Datentyp der Ressourcen-Menge.</typeparam>
		/// <typeparam name="E">Der Datentyp des Ressourcen-Aktivierungs-Flags.</typeparam>
		public struct ResourceTuple<T, A, E>
		{
			public T Type;
			public A Amount;
			public E Mode;
		}

		#endregion Strukturen

		#region Exceptions

		/// <summary>
		/// Definiert die bei einer fehlerhaften Überprüfung ausgelöste Exception.
		/// </summary>
		public class AssertionException : Exception
		{
			#region Funktionen

			/// <summary>
			/// Löst eine neue Assert-Exception aus.
			/// </summary>
			public AssertionException()
				: base("Assertion fehlgeschlagen.")
			{ }

			/// <summary>
			/// Löst eine neue Assert-Exception mit der angegebenen Fehlermeldung aus.
			/// </summary>
			/// <param name="message">Die zugehörige Fehlermeldung.</param>
			public AssertionException(string message)
				: base(message)
			{ }

			#endregion Funktionen
		}

		#endregion Exceptions
	}
}


text:
<!doctype html>

    <title>Code coverage report for app/Containers/App/route.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../../prettify.css" />
    <link rel="stylesheet" href="../../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      All files / app/Containers/App route.js

        0%
        Statements
        0/55

        0%
        Branches
        0/17

        0%
        Functions
        0/4

        0%
        Lines
        0/52

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

import { initializeApp } from './task'
import { initializeLive } from '../Live/task'
import { init as initializeLogin } from '../Login/task'
import { init as initializeLayout } from '../Layout/task'
import { initializeNavigation } from '../Navigation/task'
import { init as initPackages } from '../Packages/task'
import { initializeQuestion, initializeQuestionAdd, initializeQuestionEdit } from '../Question/task'
import { checkToken } from '../../util/util'
// import {ajaxMenus, changeMenus, verifyPermissions} from './task'

function listener(store, history) {
  // console.clear()
  const pathname = history.location.pathname
  checkToken()
  store.dispatch({ type: 'UpdatePathname', payload: pathname })
  if (store.getState().app.pathnameChange) {
    console.warn('routeChangeTrue')
    store.dispatch(initializeLayout())
    store.dispatch(initializeApp())
    switch (pathname) {
      case '/':
        store.dispatch(initializeNavigation())
        console.log('in the root route')
        break
      case '/login':
        store.dispatch(initializeLogin())
        break
      case '/navigation':
        store.dispatch(initializeNavigation())
        break
      case '/question':
        store.dispatch(initializeQuestion())
        break
      case '/question/add':
        store.dispatch(initializeQuestionAdd())
        break
      case '/question/edit':
        store.dispatch(initializeQuestionEdit())
        break
      case '/live':
        store.dispatch(initializeLive())
        break
      case '/live/add':
        store.dispatch(initializeLive('add'))
        break
      case '/live/edit':
        store.dispatch(initializeLive('edit'))
        break
      case '/packages':
        store.dispatch(initPackages())
        break
      case '/packages/add':
        store.dispatch(initPackages('add'))
        break
      case '/packages/edit':
        store.dispatch(initPackages('edit'))
        break
      default:
        break
    }
  }
}

function routeChange(store, history) {
  (process.env.NODE_ENV === 'production')
    ? console.clear()
    : (() => {
      console.group('router')
      console.warn('store', store)
      console.warn('state', store.getState())
      console.warn('history', history)
      console.warn('pathname', history.location.pathname)
      console.groupEnd()
    })()

  listener(store, history)
  history.listen(() => listener(store, history))
}

export { routeChange }

  Code coverage
  generated by istanbul at Mon Sep 18 2017 17:44:25 GMT+0800 (CST)


text:
using System.Collections.Generic;

namespace RiotNet.Models
{
    /// <summary>
    /// The base class for a list of data points.
    /// </summary>
    public class StaticDataList<T>
    {
        /// <summary>
        /// Gets or sets the type of list.
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// Gets or sets the game version to which the item list applies.
        /// </summary>
        public string Version { get; set; }

        /// <summary>
        /// Gets or sets the data indexed by name or ID.
        /// </summary>
        public Dictionary<string, T> Data { get; set; } = new Dictionary<string, T>();
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Reflection
{
    /// <summary>
    /// The base class for binding algorithms used by <see cref="System.Reflection.MetadataLoadContext"/>.
    /// </summary>
    public abstract class MetadataAssemblyResolver
    {
        /// <summary>
        /// The binding algorithm. This method is called when an Assembly is to be returned from a given AssemblyName.
        /// This occurs when MetadataLoadContext.LoadAssemblyByName() is called or when a Type from one assembly has a
        /// dependency on another assembly.
        ///
        /// It should use MetadataLoadContext.LoadFromStream(), LoadFromAssemblyPath()
        /// or LoadFromByteArray() to load the requested assembly and return it.
        /// </summary>
        ///<remarks>
        /// To indicate the failure to find an assembly, the handler should return null rather than throwing an exception. Returning null commits
        /// the failure so that future attempts to load that name will fail without re-invoking the handler.
        ///
        /// If the handler throws an exception, the exception will be passed through to the application that invoked the operation that triggered
        /// the binding. The MetadataLoadContext will not catch it and no binding will occur.
        ///
        /// The handler will generally not be called more than once for the same name, unless two threads race to load the same assembly.
        /// Even in that case, one result will win and be atomically bound to the name.
        ///
        /// The MetadataLoadContext intentionally performs no ref-def matching on the returned assembly as what constitutes a ref-def match is a policy.
        /// It is also the kind of arbitrary restriction that MetadataLoadContext strives to avoid.
        ///
        /// The MetadataLoadContext cannot consume assemblies from other MetadataLoadContexts or other type providers (such as the underlying runtime's own Reflection system.)
        /// If a handler returns such an assembly, the MetadataLoadContext throws a FileLoadException.
        /// </remarks>
        public abstract Assembly Resolve(MetadataLoadContext context, AssemblyName assemblyName);
    }
}


text:
binary-reader
=============

#### Buffered binary reader with a fluent api ####

[![NPM version](https://badge.fury.io/js/binary-reader.png)](http://badge.fury.io/js/binary-reader "Fury Version Badge")
[![Build Status](https://secure.travis-ci.org/gagle/node-binary-reader.png)](http://travis-ci.org/gagle/node-binary-reader "Travis CI Badge")
[![Dependency Status](https://david-dm.org/gagle/node-binary-reader.png)](https://david-dm.org/gagle/node-binary-reader "David Dependency Manager Badge")

[![NPM installation](https://nodei.co/npm/binary-reader.png?mini=true)](https://nodei.co/npm/binary-reader "NodeICO Badge")

This module is a wrapper around the `fs.read()` function. It has an internal buffer that maintains the last chunk of bytes read from disk, so it minimizes the number of I/O calls. If the requested bytes are already in the buffer it doesn't perform any I/O call and the bytes are copied directly from the internal buffer. It also implements a fluent interface for your ease, so it also tries to minimize the number of nested asynchronous calls.

#### Documentation ####

- [What are its uses?](#uses)
- [How it works?](#diagrams)

#### Functions ####

- [_module_.open(path[, options]) : Reader](#open)

#### Objects ####

- [Reader](#Reader)

---

__What are its uses?__

Anything that needs to read big binary files to extract just a little portion of data, e.g. metadata readers: music, images, fonts, etc.

Benefits:

- Read big binary files without caring about how to retrieve the data and without implementing your own internal cursor system.
- Avoid the callback nesting. It uses a very lightweight and fast asynchronous series control flow library: [deferred-queue](https://github.com/gagle/node-deferred-queue).
- Ease the error handling.
- It is lazy! It delays the open and read calls until they are necessary, i.e. `br.open(file).seek(50).close()` does nothing.

---

__How it works?__

To make the things easier there are 5 cases depending on the buffer position and the range of the bytes that you want to read. These cases are only applicable if the buffer size is smaller than the file size, otherwise the whole file is read into memory, so only one I/O call is done.

Suppose a buffer size of 5 bytes (green background).
The pointer `p` is the cursor and it points to the first byte to read.
The pointer `e` is the end and it points to the last byte to read.
The `x` bytes are not in memory. They need to be read from disk.
The `y` bytes are already in memory. No need to read them again.

For the sake of simplicity, assume that the `x` group of bytes has a length smaller than the buffer size. The binary reader takes care of this and makes all the necessary calls to read all the bytes.

---

___module_.open(path[, options]) : Reader__

Returns a new `Reader`. The reader is lazy so the file will be opened with the first [read()](#reader_read) call.

Options:

- __highWaterMark__ - _Number_
  The buffer size. Default is 16KB.

---

__Reader__

The reader uses a fluent interface. The way to go is to chain the operations synchronously and, after all, close the file. They will be executed in series and asynchronously. If any error occurs, an `error` event is fired, the pending tasks are cancelled and the file is automatically closed.

The `read()` and `seek()` functions receive a callback. This callback is executed when the current operation finishes and before the next one. If you need to stop executing the subsequent tasks because you've got an error or by any other reason, you must call to [cancel()](#reader_cancel). You cannot call to [close()](reader_close) because the task will be enqueued and what you need is to close the file immediately. For example:

```javascript
br.open (file)
    .on ("error", function (error){
      console.error (error);
    })
    .on ("close", function (){
      ...
    })
    .read (1, function (bytesRead, buffer){
      //The subsequent tasks are not executed
      this.cancel ();
    })
    .read (1, function (){
      //This is never executed
    })
    .close ();
```

__Events__

- [close](#event_close)
- [error](#event_error)

__Methods__

- [Reader#cancel([error]) : undefined](#reader_cancel)
- [Reader#close() : Reader](#reader_close)
- [Reader#isEOF() : Boolean](#reader_iseof)
- [Reader#read(bytes, callback) : Reader](#reader_read)
- [Reader#seek(position[, whence][, callback]) : Reader](#reader_seek)
- [Reader#size() : Number](#reader_size)
- [Reader#tell() : Number](#reader_tell)

---

__close__

Arguments: none.

Emitted when the reader is closed or cancelled.

__error__

Arguments: `error`.

Emitted when an error occurs.

---

__Reader#cancel([error]) : undefined__

Stops the reader immediately, that is, this operation is not deferred, it cancels all the pending tasks and the file is automatically closed. If you pass an error, it will be forwarded to the `error` event instead of emitting a `close` event.

This function is mostly used when you need to execute some arbitrary code, you get an error and therefore you need to close the reader.

```javascript
br.open (file)
    .on ("error", function (error){
      console.error (error);
    })
    .on ("close", function (){
      ...
    })
    .read (1, function (bytesRead, buffer, cb){
      var me = this;
      asyncFn (function (error){
        if (error){
          //The error is forwarded to the "error" event
          //No "close" event is emitted if you pass an error
          me.cancel (error);
        }else{
          //Proceed with the next task
          cb ();
        }
      });
    })
    .read (1, function (){
      ...
    })
    .close ();
```

---

__Reader#close() : Reader__

Closes the reader.

This operation is deferred, it's enqueued in the list of pending tasks.

In the following example, the close operation is executed after the read operation, so the reader reads 1 byte and then closes the file.

```javascript
br.open (file)
    .on ("error", function (error){
      console.error (error);
    })
    .on ("close", function (){
      ...
    })
    .read (1, function (){ ... })
    .close ();
```

---

__Reader#isEOF() : Boolean__

Checks whether the internal cursor has reached the end of the file. Subsequent reads return an empty buffer. This operation is not deferred, it's executed immediately.

In this example the cursor is moved to the last byte but it's still not at the end, it will be after the read.

```javascript
var r = br.open (file)
    .on ("error", function (error){
      console.error (error);
    })
    .on ("close", function (){
      ...
    })
    .seek (0, { end: true }, function (){
      console.log (r.isEOF ()); //false
    })
    .read (1, function (){
      console.log (r.isEOF ()); //true
    })
    .close ();
```

---

__Reader#read(bytes, callback) : Reader__

Reads data and the cursor is automatically moved forwards. The callback receives three arguments: the number of bytes that has been read, the buffer with the raw data and a callback that's used to allow asynchronous operations between tasks. The buffer is not a view, it's a new instance, so you can modify the content without altering the internal buffer.

This operation is deferred, it's enqueued in the list of pending tasks.

For example:

```javascript
br.open (file)
    .on ("error", function (error){
      console.error (error);
    })
    .on ("close", function (){
      ...
    }))
    .read (1, function (bytesRead, buffer, cb){
      //Warning! If you use the "cb" argument you must call it or the reader
      //will hang up
      process.nextTick (cb);
    })
    .read (1, function (){ ... })
    .close ();
```

---

__Reader#seek(position[, whence][, callback]) : Reader__

Moves the cursor along the file.

This operation is deferred, it's enqueued in the list of pending tasks.

The `whence` parameter it's used to tell the reader from where it must move the cursor, it's the reference point. It has 3 options: `start`, `current`, `end`.

For example, to move the cursor from the end:

```javascript
seek (0, { start: true });
seek (0);
```

By default the cursor it's referenced from the start of the file.

To move the cursor from the current position:

```javascript
seek (5, { current: true });
seek (-5, { current: true });
```

The cursor can be moved with positive and negative offsets.

To move the cursor from the end:

```javascript
seek (3, { end: true });
```

---

This will move the cursor to the fourth byte from the end of the file.

__Reader#size() : Number__

Returns the size of the file. This operation is not deferred, it's executed immediately.

---

__Reader#tell() : Number__

Returns the position of the cursor. This operation is not deferred, it's executed immediately.

```javascript
br.open (file)
    .on ("error", function (error){
      console.error (error);
    })
    .on ("close", function (){
      ...
    })
    .seek (0, { end: true }, function (){
      console.log (this.tell () === this.size () - 1); //true
    })
    .read (1, function (){
      console.log (this.tell () === this.size ()); //true
      console.log (this.isEOF ()); //true
    })
    .close ();
```


text:
set echo off
prompt +-------------------------------------------------------------------------+
prompt | NKSG: PL/SQL Simple Generator                                           |
prompt +-------------------------------------------------------------------------+
prompt | (c) Copyright 2017 Geraldo Viana (r4vrya@gmail.com)                     |
prompt |                                                                         |
prompt | Licensed under the Apache License, Version 2.0 (the "License"):         |
prompt | you may not use this file except in compliance with the License.        |
prompt | You may obtain a copy of the License at                                 |
prompt |                                                                         |
prompt |     http://www.apache.org/licenses/LICENSE-2.0                          |
prompt |                                                                         |
prompt | Unless required by applicable law or agreed to in writing, software     |
prompt | distributed under the License is distributed on an "AS IS" BASIS,       |
prompt | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.|
prompt | See the License for the specific language governing permissions and     |
prompt | limitations under the License.                                          |
prompt +-------------------------------------------------------------------------+
prompt | SQL> @nksg-install.sql                                                  |
prompt +-------------------------------------------------------------------------+
whenever sqlerror continue
whenever oserror  continue
set define off
set feedback off
set heading off
set linesize 120
set loboffset 1
set long 16777216
set longchunksize 8192
set pause off
set scan on
set serveroutput on size 1000000
set sqlblanklines on
set tab off
set termout on
set timing off
set trimspool off
set verify off
set wrap on

prompt +-------------------------------------------------------------------------+
prompt | NKSG: Start of script                                                   |
prompt +-------------------------------------------------------------------------+

set echo on
alter session set plsql_warnings='enable:all,disable:05005,disable:06002,disable:06004,disable:06005,disable:06006,disable:06009,disable:06010,disable:07202,disable:07204,disable:07206';
alter session set plsql_optimize_level=3;
alter session set plsql_code_type=native;
alter session set plscope_settings='identifiers:none';

set echo off
prompt +-------------------------------------------------------------------------+
prompt | NKSG: Creating Package Specification                                    |
prompt +-------------------------------------------------------------------------+

prompt Creating Package: NKSG_TEMPCLOB ...
@@nksg_tempclob.pks
/
show errors

prompt Creating Package: NKSG_DMLAPI ...
@@nksg_dmlapi.pks
/
show errors

prompt +-------------------------------------------------------------------------+
prompt | NKSG: Creating Package Implementation                                   |
prompt +-------------------------------------------------------------------------+

prompt Creating Package Body: NKSG_TEMPCLOB ...
@@nksg_tempclob.pkb
/
show errors

prompt Creating Package Body: NKSG_DMLAPI ...
@@nksg_dmlapi.pkb
/
show errors

prompt +-------------------------------------------------------------------------+
prompt | NKSG: End of Script                                                     |
prompt +-------------------------------------------------------------------------+
set feedback on
set heading on
set echo off


text:
/*
 * Hibernate Validator, declare and validate application constraints
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
 */
package org.hibernate.validator.test.constraints;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * @author Hardy Ferentschik
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = StartLessThanEndImpl.class)
public @interface StartLessThanEnd {
	String message() default "x";

	Class<?>[] groups() default { };

	Class<? extends Payload>[] payload() default { };
}