text:
#ifndef ALIHFQNVECTORHANDLER_H
#define ALIHFQNVECTORHANDLER_H

/* $Id$ */

//*************************************************************************************
// \class AliHFQnVectorHandler
// \brief helper class to handle the Qn-vectors computed with different calibrations
// \authors:
// F. Grosa, fabrizio.grosa@cern.ch
// F. Catalano, fabio.catalano@cern.ch
// A. Dobrin, alexandru.dobrin@cern.ch
// A. Festanti, andrea.festanti@cern.ch
// G. Luparello, grazia.luparello@cern.ch
// F. Prino, prino@to.infn.it
// A. Rossi, andrea.rossi@cern.ch
// S. Trogolo, stefano.trogolo@cern.ch
///////////////////////////////////////////////////////////////////////////////////////

#include <TMath.h>
#include <TFile.h>
#include <TBits.h>
#include <TH1D.h>
#include <TString.h>

#include "AliAODEvent.h"
#include "AliAODTrack.h"
#include "AliAODVZERO.h"
#include "AliAnalysisTaskFlowVectorCorrections.h"
#include "AliQnCorrectionsManager.h"

using namespace std;

class AliHFQnVectorHandler : public TObject
{
  public:

    enum QvecNorm {
        kQoverQlength,
        kQoverM,
        kQoverSqrtM,
        kNone
    };

    enum CalibType {
        kQnCalib,
        kQnFrameworkCalib
    };

    AliHFQnVectorHandler();
    AliHFQnVectorHandler(int calibType, int normMeth, int harmonic, TString OADBfileName);

    virtual ~AliHFQnVectorHandler();

    bool SetAODEvent(AliAODEvent* event);
    void ResetAODEvent();

    void SetHarmonic(int harmonic) {fHarmonic = harmonic;}
    void SetCalibrationType(int calibType) {fCalibType = calibType;}
    void SetNormalisationMethod(int normMeth) {fNormMethod = normMeth;}
    void SetTPCEtaLimits(double absetamin=0., double absetamx=0.8) {fEtaMinTPC=absetamin; fEtaMaxTPC=absetamx;}
    void SetTPCPtLimits(double ptmin=0.2, double ptmax=5) {fPtMinTPC=ptmin; fPtMaxTPC=ptmax;}
    void SetFractionOfTPCtracksToUse(double fracToKeep) {fFractionOfTracksForQnTPC = fracToKeep;}
    void SetCalibrationsOADBFileName(TString OADBfileName) {fOADBFileName = OADBfileName;}

    bool ComputeCalibratedQnVectorTPC(bool forceCalc = false);
    bool ComputeCalibratedQnVectorV0(bool forceCalc = false);

    int GetHarmonic() const {return fHarmonic;}
    int GetCalibrationType() const {return fCalibType;}
    int GetNormalisationMethod() const {return fNormMethod;}
    TString GetCalibrationsOADBFileName() const {return fOADBFileName;}

    void GetQnVecTPC(double QnVecFullTPC[2], double QnVecPosTPC[2], double QnVecNegTPC[2]);
    void GetQnVecV0(double QnVecFullV0[2], double QnVecV0A[2], double QnVecV0C[2]);
    void GetUnNormQnVecTPC(double QnVecFullTPC[2], double QnVecPosTPC[2], double QnVecNegTPC[2]);
    void GetUnNormQnVecV0(double QnVecFullV0[2], double QnVecV0A[2], double QnVecV0C[2]);

    void GetqnTPC(double &qnFullTPC, double &qnPosTPC, double &qnNegTPC);
    void GetqnV0(double &qnFullV0, double &qnV0A, double &qnV0C);

    void GetMultQnVecTPC(double &MultFullTPC, double &MultPosTPC, double &MultNegTPC);
    void GetMultQnVecV0(double &MultFullV0, double &MultV0A, double &MultV0C);

    void GetEventPlaneAngleTPC(double &EvPlaneFullTPC, double &EvPlanePosTPC, double &EvPlaneNegTPC);
    void GetEventPlaneAngleV0(double &EvPlaneFullV0, double &EvPlaneV0A, double &EvPlaneV0C);

    void RemoveTracksFromQnTPC(vector<AliAODTrack*> trToRem, double QnVecFullTPC[2], double QnVecPosTPC[2], double QnVecNegTPC[2], double &multFullTPC, double &multPosTPC, double &multNegTPC, bool getUnNormalised=false);

    void EnablePhiDistrHistos();
    TH2F* GetPhiDistrHistosTPCPosEta() const {return fPhiVsCentrTPC[0];}
    TH2F* GetPhiDistrHistosTPCNegEta() const {return fPhiVsCentrTPC[1];}

  private:

    //utils methods
    void ComputeQvecQnFrameworkTPC();
    void ComputeQvecQnFrameworkV0();
    void ComputeQvecTPC();
    void ComputeQvecV0();
    double ComputeEventPlaneAngle(double Qx, double Qy) const {return (TMath::Pi()+TMath::ATan2(-Qy,-Qx))/2;}

    short GetVertexZbin() const;
    bool OpenInfoCalbration();

    bool IsTrackSelected(AliAODTrack* track);

    //data members
    unsigned int fHarmonic;                                    /// Harmonic of Q vector
    int fNormMethod;                                           /// Option for Q-vector normalisation
    int fCalibType;                                            /// Type of Q-vector calibrations to be applied

    double fEtaMinTPC;                                         /// Absolute minimum value of eta for TPC Q vector
    double fEtaMaxTPC;                                         /// Absolute maximum value of eta for TPC Q vector
    double fPtMinTPC;                                          /// Minimum value of pt for TPC Q vector
    double fPtMaxTPC;                                          /// Maximum value of pt for TPC Q vector

    double fQnVecFullTPC[2];                                   /// Qn vector of tracks in full TPC volume
    double fQnVecPosTPC[2];                                    /// Qn vector of tracks with positive pseudorapidity in TPC
    double fQnVecNegTPC[2];                                    /// Qn vector of tracks with negative pseudorapidity in TPC

    double fQnVecFullV0[2];                                    /// Qn vector of V0A+V0C sectors
    double fQnVecV0A[2];                                       /// Qn vector of V0A sectors
    double fQnVecV0C[2];                                       /// Qn vector of V0C sectors

    double fMultFullTPC;                                       /// Multiplicity for Q vector with full TPC volume
    double fMultPosTPC;                                        /// Multiplicity for Q vector with positive pseudorapidity in TPC
    double fMultNegTPC;                                        /// Multiplicity for Q vector with negative pseudorapidity in TPC

    double fMultFullV0;                                        /// Multiplicity for Q vector with V0A+V0C sectors
    double fMultV0A;                                           /// Multiplicity for Q vector with V0A sectors
    double fMultV0C;                                           /// Multiplicity for Q vector with V0C sectors

    double fQnVecNormFullTPC;                                  /// Norm of Q vector with full TPC volume before normalisation
    double fQnVecNormPosTPC;                                   /// Norm of Q vector with positive pseudorapidity in TPC before normalisation
    double fQnVecNormNegTPC;                                   /// Norm of Q vector with negative pseudorapidity in TPC before normalisation

    double fQnVecNormFullV0;                                   /// Norm of Q vector with V0A+V0C sectors before normalisation
    double fQnVecNormV0A;                                      /// Norm of Q vector with V0A sectors before normalisation
    double fQnVecNormV0C;                                      /// Norm of Q vector with V0C sectors before normalisation

    TBits fUsedTrackPosIDs;                                    /// IDs of tracks (with positive ID) used for the computation of the Q vector (TPC)
    TBits fUsedTrackNegIDs;                                    /// IDs of tracks (with negative ID) used for the computation of the Q vector (TPC)

    //random rejection
    double fFractionOfTracksForQnTPC;                          /// Fraction of tracks to keep when rejection enabled

    //data members needed for calibrations
    AliAODEvent* fAODEvent;                                    /// AOD event
    AliAODVZERO* fV0;                                          /// V0 info for the considered event
    int fRun;                                                  /// Run number
    double fZvtx;                                              /// Primary vertx Z
    double fCentrality;                                        /// Event centrality

    TFile* fOADBFile;                                          /// OADB input file
    TString fOADBFileName;                                     /// OADB input file name
    bool fIsOADBFileOpen;                                      /// Flag to test whether the OADB file is open
    int fCalibObjRun;                                          /// Run of loaded calibration objects

    TH1D* fHistMultV0;                                         /// Profile from V0 multiplicity

    TH1D* fQx2mV0A[14];                                        /// <Qxn> V0A
    TH1D* fQy2mV0A[14];                                        /// <Qyn> V0A
    TH1D* fQx2sV0A[14];                                        /// sigma Qxn V0A
    TH1D* fQy2sV0A[14];                                        /// sigma Qyn V0A

    TH1D* fQx2mV0C[14];                                        /// <Qxn> V0C
    TH1D* fQy2mV0C[14];                                        /// <Qyn> V0C
    TH1D* fQx2sV0C[14];                                        /// sigma Qxn V0C
    TH1D* fQy2sV0C[14];                                        /// sigma Qyn V0C

    TH1D* fWeightsTPC;                                         /// Weights for TPC --> to be defined
    bool fEnablePhiDistrHistos;                                /// Enable phi distribution histos
    TH2F* fPhiVsCentrTPC[2];                                   /// Phi vs. centr TH2 of selected TPC tracks in eta>0 and eta<0

    //data members needed for Qn-framework calibrations
    AliAnalysisTaskFlowVectorCorrections *fQnVectorTask;       /// Qn-framework task
    AliQnCorrectionsManager *fQnVectorMgr;                     /// Qn-framework manager

  /// \cond CLASSIMP
  ClassDef(AliHFQnVectorHandler,2); ///
  /// \endcond
};

#endif


text:
<?php

namespace app\controllers;
use app\models\UserGroups;
use Yii;
use app\models\Notices;
use app\models\Comments;
use yii\data\ArrayDataProvider;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use app\models\Groups;
use yii\helpers\Url;
use yii\web\ForbiddenHttpException;
use yii\web\NotFoundHttpException;
use app\models\Users;
use yii\filters\AccessControl;

class WorkspaceController extends \yii\web\Controller
{
    public $layout = 'workspace';

    private $group;
    public function beforeAction($action)
    {
        if (parent::beforeAction($action) && !empty(\Yii::$app->request->get('identifier'))){
            $this->group = Groups::find()->where(['identifier' => \Yii::$app->request->get('identifier')])->one();
            $roleId=UserGroups::find()->where(['group_id'=>$this->group->id, 'user_id' => \Yii::$app->user->getId()])->one()->role_id;
            $roleName = \Yii::$app->params['authRoles'][$roleId - 1];

            if($roleName) {
                \Yii::$app->db->createCommand('DELETE FROM auth_assignment WHERE user_id = :userId')
                    ->bindValue(':userId', \Yii::$app->user->getId())->execute();
                $auth = Yii::$app->authManager;
                $authorRole = $auth->getRole($roleName);
                $auth->assign($authorRole, \Yii::$app->user->getId());

                return true;
            }
        }
        return false;
    }

    public function actionIndex()
    {
        if(!\Yii::$app->user->isGuest && \Yii::$app->user->can('AccessGroup',['group'=>$this->group])) {
            if($this->group) {
                $query = Notices::find()->where(['group_id' => $this->group->id])->orderBy(['create_at' => SORT_DESC])->all();
                $dataProvider = new ArrayDataProvider([
                    'allModels' => $query,
                    'key' => 'id',

                ]);

                return $this->render('index', [
                    'dataProvider' => $dataProvider,
                    'group' => $this->group,
                ]);

            } else {
                throw new NotFoundHttpException(Yii::t('app', 'There is no group with identifier {id}', [
                    'id' => $this->group->identifier,
                ]));
            }
        } else {
            throw new ForbiddenHttpException('Access denied');
        }

    }

    public function actionView($id)
    {
        if(\Yii::$app->user->can('AccessGroup',['group'=>$this->group]))
        {
            $model_comments = new Comments();
            if ($model_comments->load(Yii::$app->request->post())) {
                if ($model_comments->save()) {
                    $this->redirect(Url::toRoute(['workspace/view', 'id' => $id, 'identifier' => $this->group->identifier]));
                }
            }
            $model_comments->notice_id = $id;

            $dataProvider = new ActiveDataProvider([
                'query' => Comments::find()->where(['notice_id' => $id])->orderBy(['created_at' => SORT_DESC]),
                'key' => 'id',
            ]);

            return $this->render('view', [
                'model_comments' => $model_comments,
                'dataProvider' => $dataProvider,
                'model' => $this->findModel($id),
                'group' => $this->group,
            ]);
        }
        else{
            throw new ForbiddenHttpException('Access denied');
        }
    }

    public function actionCreate()
    {
        if(\Yii::$app->user->can('createPost')) {
            $model = new Notices();

            if ($model->load(Yii::$app->request->post()) && $model->save()) {

                return $this->redirect(['view', 'id' => $model->id, 'identifier' => $this->group->identifier]);

            } else {
                $model->group_id = $this->group->id;

                return $this->render('create', [
                    'model' => $model,
                    'group' => $this->group
                ]);
            }
        }
        else
        {
            throw new ForbiddenHttpException('Access denied');
        }
    }

    public function actionUpdate($id)
    {
        if(\Yii::$app->user->can('updateOwnPost', ['updatePost'=>$this->findModel($id)])) {
            $model = $this->findModel($id);

            if ($model->load(Yii::$app->request->post()) && $model->save()) {

                return $this->redirect(['view', 'id' => $model->id, 'identifier' => $this->group->identifier]);

            } else {

                return $this->render('update', [
                    'model' => $model,
                    'group' => $this->group,
                ]);
            }
        }
        else
        {
            throw new ForbiddenHttpException('Access denied');
        }
    }

    public function actionDelete($id)
    {
        if(\Yii::$app->user->can('deletePost')) {
            Comments::deleteAll('notice_id = :id', [':id' => $id]);
            $this->findModel($id)->delete();

            return $this->redirect(['index', 'identifier' => $this->group->identifier]);
        }
        else
        {
            throw new ForbiddenHttpException('Access denied');
        }
    }

    public function actionDeletecomment($id_comment)
    {
        $comment = Comments::findOne($id_comment);

        $notice_id = $comment->notice_id;

        $comment->delete();

        return $this->redirect(Url::toRoute(['workspace/view', 'id' => $notice_id, 'identifier' => $this->group->identifier]));
    }

    protected function findModel($id)
    {
        if (($model = Notices::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
package "openjdk-6-jre-headless" do
  action :install
end

bash "challenge" do
  user "ubuntu"
  code <<-EOH

    # permissions
    chmod 755 $HOME

    # configure tomcat
    cp $HOME/chef-solo/cookbooks/challenge/aux/apache-tomcat-7.0.28.tar.gz $HOME
    tar xzf $HOME/apache-tomcat-7.0.28.tar.gz
    mv $HOME/apache-tomcat-7.0.28 $HOME/tomcat
    rm -rf $HOME/tomcat/webapps/*
    rm -rf $HOME/tomcat.tar.gz

    # move webapp
    cp $HOME/chef-solo/cookbooks/challenge/aux/COSMOS.war $HOME/tomcat/webapps/

  EOH
end

bash "init_d" do
  user "root"
  code <<-EOH

    # setup script
    cp /home/ubuntu/chef-solo/cookbooks/challenge/aux/init_d_script /etc/init.d/tomcat
    chmod 755 /etc/init.d/tomcat

    # register it with boot sequence
    update-rc.d tomcat defaults 98 02

    # nginx
    /etc/init.d/tomcat start

  EOH
end


text:
"""
 The OGRGeometry is a wrapper for using the OGR Geometry class
 (see http://www.gdal.org/ogr/classOGRGeometry.html).  OGRGeometry
 may be instantiated when reading geometries from OGR Data Sources
 (e.g. SHP files), or when given OGC WKT (a string).

 While the 'full' API is not present yet, the API is "pythonic" unlike
 the traditional and "next-generation" OGR Python bindings.  One major
 advantage OGR Geometries have over their GEOS counterparts is support
 for spatial reference systems and their transformation.

 Example:
  >>> from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, SpatialReference
  >>> wkt1, wkt2 = 'POINT(-90 30)', 'POLYGON((0 0, 5 0, 5 5, 0 5)'
  >>> pnt = OGRGeometry(wkt1)
  >>> print pnt
  POINT (-90 30)
  >>> mpnt = OGRGeometry(OGRGeomType('MultiPoint'), SpatialReference('WGS84'))
  >>> mpnt.add(wkt1)
  >>> mpnt.add(wkt1)
  >>> print mpnt
  MULTIPOINT (-90 30,-90 30)
  >>> print mpnt.srs.name
  WGS 84
  >>> print mpnt.srs.proj
  +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
  >>> mpnt.transform_to(SpatialReference('NAD27'))
  >>> print mpnt.proj
  +proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs
  >>> print mpnt
  MULTIPOINT (-89.999930378602485 29.999797886557641,-89.999930378602485 29.999797886557641)

  The OGRGeomType class is to make it easy to specify an OGR geometry type:
  >>> from django.contrib.gis.gdal import OGRGeomType
  >>> gt1 = OGRGeomType(3) # Using an integer for the type
  >>> gt2 = OGRGeomType('Polygon') # Using a string
  >>> gt3 = OGRGeomType('POLYGON') # It's case-insensitive
  >>> print gt1 == 3, gt1 == 'Polygon' # Equivalence works w/non-OGRGeomType objects
  True
"""
# Python library requisites.
import re, sys
from binascii import a2b_hex
from ctypes import byref, string_at, c_char_p, c_double, c_ubyte, c_void_p
from types import UnicodeType

# Getting GDAL prerequisites
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException
from django.contrib.gis.gdal.geomtype import OGRGeomType
from django.contrib.gis.gdal.srs import SpatialReference, CoordTransform

# Getting the ctypes prototype functions that interface w/the GDAL C library.
from django.contrib.gis.gdal.prototypes.geom import *
from django.contrib.gis.gdal.prototypes.srs import clone_srs

# For more information, see the OGR C API source code:
#  http://www.gdal.org/ogr/ogr__api_8h.html
#
# The OGR_G_* routines are relevant here.

# Regular expressions for recognizing HEXEWKB and WKT.
hex_regex = re.compile(r'^[0-9A-F]+$', re.I)
wkt_regex = re.compile(r'^(?P<type>POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)[ACEGIMLONPSRUTY\d,\.\-\(\) ]+$', re.I)
json_regex = re.compile(r'^\{[\s\w,\-\.\"\'\:\[\]]+\}$')

#### OGRGeometry Class ####
class OGRGeometry(object):
    "Generally encapsulates an OGR geometry."

    def __init__(self, geom_input, srs=None):
        "Initializes Geometry on either WKT or an OGR pointer as input."

        self._ptr = c_void_p(None) # Initially NULL
        str_instance = isinstance(geom_input, basestring)

        # If HEX, unpack input to to a binary buffer.
        if str_instance and hex_regex.match(geom_input):
            geom_input = buffer(a2b_hex(geom_input.upper()))
            str_instance = False

        # Constructing the geometry,
        if str_instance:
            # Checking if unicode
            if isinstance(geom_input, UnicodeType):
                # Encoding to ASCII, WKT or HEX doesn't need any more.
                geo_input = geo_input.encode('ascii')

            wkt_m = wkt_regex.match(geom_input)
            json_m = json_regex.match(geom_input)
            if wkt_m:
                if wkt_m.group('type').upper() == 'LINEARRING':
                    # OGR_G_CreateFromWkt doesn't work with LINEARRING WKT.
                    #  See http://trac.osgeo.org/gdal/ticket/1992.
                    g = create_geom(OGRGeomType(wkt_m.group('type')).num)
                    import_wkt(g, byref(c_char_p(geom_input)))
                else:
                    g = from_wkt(byref(c_char_p(geom_input)), None, byref(c_void_p()))
            elif json_m:
                if GEOJSON:
                    g = from_json(geom_input)
                else:
                    raise NotImplementedError('GeoJSON input only supported on GDAL 1.5+.')
            else:
                # Seeing if the input is a valid short-hand string
                # (e.g., 'Point', 'POLYGON').
                ogr_t = OGRGeomType(geom_input)
                g = create_geom(OGRGeomType(geom_input).num)
        elif isinstance(geom_input, buffer):
            # WKB was passed in
            g = from_wkb(str(geom_input), None, byref(c_void_p()), len(geom_input))
        elif isinstance(geom_input, OGRGeomType):
            # OGRGeomType was passed in, an empty geometry will be created.
            g = create_geom(geom_input.num)
        elif isinstance(geom_input, c_void_p):
            # OGR pointer (c_void_p) was the input.
            g = geom_input
        else:
            raise OGRException('Invalid input type for OGR Geometry construction: %s' % type(geom_input))

        # Now checking the Geometry pointer before finishing initialization
        # by setting the pointer for the object.
        if not g:
            raise OGRException('Cannot create OGR Geometry from input: %s' % str(geom_input))
        self._ptr = g

        # Assigning the SpatialReference object to the geometry, if valid.
        if bool(srs): self.srs = srs

        # Setting the class depending upon the OGR Geometry Type
        self.__class__ = GEO_CLASSES[self.geom_type.num]

    def __del__(self):
        "Deletes this Geometry."
        if self._ptr: destroy_geom(self._ptr)

    ### Geometry set-like operations ###
    # g = g1 | g2
    def __or__(self, other):
        "Returns the union of the two geometries."
        return self.union(other)

    # g = g1 & g2
    def __and__(self, other):
        "Returns the intersection of this Geometry and the other."
        return self.intersection(other)

    # g = g1 - g2
    def __sub__(self, other):
        "Return the difference this Geometry and the other."
        return self.difference(other)

    # g = g1 ^ g2
    def __xor__(self, other):
        "Return the symmetric difference of this Geometry and the other."
        return self.sym_difference(other)

    def __eq__(self, other):
        "Is this Geometry equal to the other?"
        return self.equals(other)

    def __ne__(self, other):
        "Tests for inequality."
        return not self.equals(other)

    def __str__(self):
        "WKT is used for the string representation."
        return self.wkt

    #### Geometry Properties ####
    @property
    def dimension(self):
        "Returns 0 for points, 1 for lines, and 2 for surfaces."
        return get_dims(self._ptr)

    @property
    def coord_dim(self):
        "Returns the coordinate dimension of the Geometry."
        return get_coord_dims(self._ptr)

    @property
    def geom_count(self):
        "The number of elements in this Geometry."
        return get_geom_count(self._ptr)

    @property
    def point_count(self):
        "Returns the number of Points in this Geometry."
        return get_point_count(self._ptr)

    @property
    def num_points(self):
        "Alias for `point_count` (same name method in GEOS API.)"
        return self.point_count

    @property
    def num_coords(self):
        "Alais for `point_count`."
        return self.point_count

    @property
    def geom_type(self):
        "Returns the Type for this Geometry."
        try:
            return OGRGeomType(get_geom_type(self._ptr))
        except OGRException:
            # VRT datasources return an invalid geometry type
            # number, but a valid name -- we'll try that instead.
            # See: http://trac.osgeo.org/gdal/ticket/2491
            return OGRGeomType(get_geom_name(self._ptr))

    @property
    def geom_name(self):
        "Returns the Name of this Geometry."
        return get_geom_name(self._ptr)

    @property
    def area(self):
        "Returns the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise."
        return get_area(self._ptr)

    @property
    def envelope(self):
        "Returns the envelope for this Geometry."
        # TODO: Fix Envelope() for Point geometries.
        return Envelope(get_envelope(self._ptr, byref(OGREnvelope())))

    @property
    def extent(self):
        "Returns the envelope as a 4-tuple, instead of as an Envelope object."
        return self.envelope.tuple

    #### SpatialReference-related Properties ####

    # The SRS property
    def get_srs(self):
        "Returns the Spatial Reference for this Geometry."
        try:
            srs_ptr = get_geom_srs(self._ptr)
            return SpatialReference(clone_srs(srs_ptr))
        except SRSException:
            return None

    def set_srs(self, srs):
        "Sets the SpatialReference for this geometry."
        if isinstance(srs, SpatialReference):
            srs_ptr = clone_srs(srs._ptr)
        elif isinstance(srs, (int, long, basestring)):
            sr = SpatialReference(srs)
            srs_ptr = clone_srs(sr._ptr)
        else:
            raise TypeError('Cannot assign spatial reference with object of type: %s' % type(srs))
        assign_srs(self._ptr, srs_ptr)

    srs = property(get_srs, set_srs)

    # The SRID property
    def get_srid(self):
        if self.srs: return self.srs.srid
        else: return None

    def set_srid(self, srid):
        if isinstance(srid, (int, long)):
            self.srs = srid
        else:
            raise TypeError('SRID must be set with an integer.')

    srid = property(get_srid, set_srid)

    #### Output Methods ####
    @property
    def geos(self):
        "Returns a GEOSGeometry object from this OGRGeometry."
        from django.contrib.gis.geos import GEOSGeometry
        return GEOSGeometry(self.wkb, self.srid)

    @property
    def gml(self):
        "Returns the GML representation of the Geometry."
        return to_gml(self._ptr)

    @property
    def hex(self):
        "Returns the hexadecimal representation of the WKB (a string)."
        return str(self.wkb).encode('hex').upper()
        #return b2a_hex(self.wkb).upper()

    @property
    def json(self):
        if GEOJSON:
            return to_json(self._ptr)
        else:
            raise NotImplementedError('GeoJSON output only supported on GDAL 1.5+.')
    geojson = json

    @property
    def wkb_size(self):
        "Returns the size of the WKB buffer."
        return get_wkbsize(self._ptr)

    @property
    def wkb(self):
        "Returns the WKB representation of the Geometry."
        if sys.byteorder == 'little':
            byteorder = 1 # wkbNDR (from ogr_core.h)
        else:
            byteorder = 0 # wkbXDR
        sz = self.wkb_size
        # Creating the unsigned character buffer, and passing it in by reference.
        buf = (c_ubyte * sz)()
        wkb = to_wkb(self._ptr, byteorder, byref(buf))
        # Returning a buffer of the string at the pointer.
        return buffer(string_at(buf, sz))

    @property
    def wkt(self):
        "Returns the WKT representation of the Geometry."
        return to_wkt(self._ptr, byref(c_char_p()))

    #### Geometry Methods ####
    def clone(self):
        "Clones this OGR Geometry."
        return OGRGeometry(clone_geom(self._ptr), self.srs)

    def close_rings(self):
        """
        If there are any rings within this geometry that have not been
        closed, this routine will do so by adding the starting point at the
        end.
        """
        # Closing the open rings.
        geom_close_rings(self._ptr)

    def transform(self, coord_trans, clone=False):
        """
        Transforms this geometry to a different spatial reference system.
        May take a CoordTransform object, a SpatialReference object, string
        WKT or PROJ.4, and/or an integer SRID.  By default nothing is returned
        and the geometry is transformed in-place.  However, if the `clone`
        keyword is set, then a transformed clone of this geometry will be
        returned.
        """
        if clone:
            klone = self.clone()
            klone.transform(coord_trans)
            return klone
        if isinstance(coord_trans, CoordTransform):
            geom_transform(self._ptr, coord_trans._ptr)
        elif isinstance(coord_trans, SpatialReference):
            geom_transform_to(self._ptr, coord_trans._ptr)
        elif isinstance(coord_trans, (int, long, basestring)):
            sr = SpatialReference(coord_trans)
            geom_transform_to(self._ptr, sr._ptr)
        else:
            raise TypeError('Transform only accepts CoordTransform, SpatialReference, string, and integer objects.')

    def transform_to(self, srs):
        "For backwards-compatibility."
        self.transform(srs)

    #### Topology Methods ####
    def _topology(self, func, other):
        """A generalized function for topology operations, takes a GDAL function and
        the other geometry to perform the operation on."""
        if not isinstance(other, OGRGeometry):
            raise TypeError('Must use another OGRGeometry object for topology operations!')

        # Returning the output of the given function with the other geometry's
        # pointer.
        return func(self._ptr, other._ptr)

    def intersects(self, other):
        "Returns True if this geometry intersects with the other."
        return self._topology(ogr_intersects, other)

    def equals(self, other):
        "Returns True if this geometry is equivalent to the other."
        return self._topology(ogr_equals, other)

    def disjoint(self, other):
        "Returns True if this geometry and the other are spatially disjoint."
        return self._topology(ogr_disjoint, other)

    def touches(self, other):
        "Returns True if this geometry touches the other."
        return self._topology(ogr_touches, other)

    def crosses(self, other):
        "Returns True if this geometry crosses the other."
        return self._topology(ogr_crosses, other)

    def within(self, other):
        "Returns True if this geometry is within the other."
        return self._topology(ogr_within, other)

    def contains(self, other):
        "Returns True if this geometry contains the other."
        return self._topology(ogr_contains, other)

    def overlaps(self, other):
        "Returns True if this geometry overlaps the other."
        return self._topology(ogr_overlaps, other)

    #### Geometry-generation Methods ####
    def _geomgen(self, gen_func, other=None):
        "A helper routine for the OGR routines that generate geometries."
        if isinstance(other, OGRGeometry):
            return OGRGeometry(gen_func(self._ptr, other._ptr), self.srs)
        else:
            return OGRGeometry(gen_func(self._ptr), self.srs)

    @property
    def boundary(self):
        "Returns the boundary of this geometry."
        return self._geomgen(get_boundary)

    @property
    def convex_hull(self):
        """
        Returns the smallest convex Polygon that contains all the points in
        this Geometry.
        """
        return self._geomgen(geom_convex_hull)

    def difference(self, other):
        """
        Returns a new geometry consisting of the region which is the difference
        of this geometry and the other.
        """
        return self._geomgen(geom_diff, other)

    def intersection(self, other):
        """
        Returns a new geometry consisting of the region of intersection of this
        geometry and the other.
        """
        return self._geomgen(geom_intersection, other)

    def sym_difference(self, other):
        """
        Returns a new geometry which is the symmetric difference of this
        geometry and the other.
        """
        return self._geomgen(geom_sym_diff, other)

    def union(self, other):
        """
        Returns a new geometry consisting of the region which is the union of
        this geometry and the other.
        """
        return self._geomgen(geom_union, other)

# The subclasses for OGR Geometry.
class Point(OGRGeometry):

    @property
    def x(self):
        "Returns the X coordinate for this Point."
        return getx(self._ptr, 0)

    @property
    def y(self):
        "Returns the Y coordinate for this Point."
        return gety(self._ptr, 0)

    @property
    def z(self):
        "Returns the Z coordinate for this Point."
        if self.coord_dim == 3:
            return getz(self._ptr, 0)

    @property
    def tuple(self):
        "Returns the tuple of this point."
        if self.coord_dim == 2:
            return (self.x, self.y)
        elif self.coord_dim == 3:
            return (self.x, self.y, self.z)
    coords = tuple

class LineString(OGRGeometry):

    def __getitem__(self, index):
        "Returns the Point at the given index."
        if index >= 0 and index < self.point_count:
            x, y, z = c_double(), c_double(), c_double()
            get_point(self._ptr, index, byref(x), byref(y), byref(z))
            dim = self.coord_dim
            if dim == 1:
                return (x.value,)
            elif dim == 2:
                return (x.value, y.value)
            elif dim == 3:
                return (x.value, y.value, z.value)
        else:
            raise OGRIndexError('index out of range: %s' % str(index))

    def __iter__(self):
        "Iterates over each point in the LineString."
        for i in xrange(self.point_count):
            yield self[i]

    def __len__(self):
        "The length returns the number of points in the LineString."
        return self.point_count

    @property
    def tuple(self):
        "Returns the tuple representation of this LineString."
        return tuple([self[i] for i in xrange(len(self))])
    coords = tuple

    def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.
        """
        return [func(self._ptr, i) for i in xrange(len(self))]

    @property
    def x(self):
        "Returns the X coordinates in a list."
        return self._listarr(getx)

    @property
    def y(self):
        "Returns the Y coordinates in a list."
        return self._listarr(gety)

    @property
    def z(self):
        "Returns the Z coordinates in a list."
        if self.coord_dim == 3:
            return self._listarr(getz)

# LinearRings are used in Polygons.
class LinearRing(LineString): pass

class Polygon(OGRGeometry):

    def __len__(self):
        "The number of interior rings in this Polygon."
        return self.geom_count

    def __iter__(self):
        "Iterates through each ring in the Polygon."
        for i in xrange(self.geom_count):
            yield self[i]

    def __getitem__(self, index):
        "Gets the ring at the specified index."
        if index < 0 or index >= self.geom_count:
            raise OGRIndexError('index out of range: %s' % index)
        else:
            return OGRGeometry(clone_geom(get_geom_ref(self._ptr, index)), self.srs)

    # Polygon Properties
    @property
    def shell(self):
        "Returns the shell of this Polygon."
        return self[0] # First ring is the shell
    exterior_ring = shell

    @property
    def tuple(self):
        "Returns a tuple of LinearRing coordinate tuples."
        return tuple([self[i].tuple for i in xrange(self.geom_count)])
    coords = tuple

    @property
    def point_count(self):
        "The number of Points in this Polygon."
        # Summing up the number of points in each ring of the Polygon.
        return sum([self[i].point_count for i in xrange(self.geom_count)])

    @property
    def centroid(self):
        "Returns the centroid (a Point) of this Polygon."
        # The centroid is a Point, create a geometry for this.
        p = OGRGeometry(OGRGeomType('Point'))
        get_centroid(self._ptr, p._ptr)
        return p

# Geometry Collection base class.
class GeometryCollection(OGRGeometry):
    "The Geometry Collection class."

    def __getitem__(self, index):
        "Gets the Geometry at the specified index."
        if index < 0 or index >= self.geom_count:
            raise OGRIndexError('index out of range: %s' % index)
        else:
            return OGRGeometry(clone_geom(get_geom_ref(self._ptr, index)), self.srs)

    def __iter__(self):
        "Iterates over each Geometry."
        for i in xrange(self.geom_count):
            yield self[i]

    def __len__(self):
        "The number of geometries in this Geometry Collection."
        return self.geom_count

    def add(self, geom):
        "Add the geometry to this Geometry Collection."
        if isinstance(geom, OGRGeometry):
            if isinstance(geom, self.__class__):
                for g in geom: add_geom(self._ptr, g._ptr)
            else:
                add_geom(self._ptr, geom._ptr)
        elif isinstance(geom, basestring):
            tmp = OGRGeometry(geom)
            add_geom(self._ptr, tmp._ptr)
        else:
            raise OGRException('Must add an OGRGeometry.')

    @property
    def point_count(self):
        "The number of Points in this Geometry Collection."
        # Summing up the number of points in each geometry in this collection
        return sum([self[i].point_count for i in xrange(self.geom_count)])

    @property
    def tuple(self):
        "Returns a tuple representation of this Geometry Collection."
        return tuple([self[i].tuple for i in xrange(self.geom_count)])
    coords = tuple

# Multiple Geometry types.
class MultiPoint(GeometryCollection): pass
class MultiLineString(GeometryCollection): pass
class MultiPolygon(GeometryCollection): pass

# Class mapping dictionary (using the OGRwkbGeometryType as the key)
GEO_CLASSES = {1 : Point,
               2 : LineString,
               3 : Polygon,
               4 : MultiPoint,
               5 : MultiLineString,
               6 : MultiPolygon,
               7 : GeometryCollection,
               101: LinearRing,
               }


text:
@interface Cocos2dxSimpleGameForiOSAppController : NSObject <UIAccelerometerDelegate, UIAlertViewDelegate, UITextFieldDelegate,UIApplicationDelegate> {
    UIWindow *window;
}

@end


text:
lib = File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require 'rubygems'
require 'bundler/setup'
require 'tiki/torch'

lgr                = Logger.new(STDOUT).tap { |x| x.level = Logger::INFO }
Tiki::Torch.logger = lgr

lgr.info 'Starting ...'

lgr.info 'Defining consumer ...'
class MySecondConsumer < Tiki::Torch::Consumer

  consumes 'multiple.events', channel: 'my_second_consumer'

  def process
    debug ">>> ##{object_id} : class    : #{event.class.name}"
    info ">>> ##{object_id} : payload  : (#{event.payload.class.name}) #{event.payload.to_yaml}"
    debug ">>> ##{object_id} : metadata : (#{event.metadata.class.name}) #{event.metadata.to_yaml}"
    debug ">>> ##{object_id} : delivery : (#{event.delivery.class.name}) #{event.delivery.to_yaml}"
  end

end

lgr.info 'Start polling for events ...'
Tiki::Torch.start_polling

lgr.info 'Waiting for a moment ...'
sleep 30

lgr.info 'Some stats ...'
lgr.info "MySecondConsumer : #{MySecondConsumer.stats.to_hash.to_yaml}"

lgr.info 'Shutting down ...'
Tiki::Torch.shutdown

lgr.info 'Done!'
exit


text:
#ifndef _EFI_PCI_BUS_H
#define _EFI_PCI_BUS_H

#include "Tiano.h"
#include "EfiDriverLib.h"
#include "EfiImage.h"
#include "Pci.h"
#include "Acpi.h"
#include "LinkedList.h"

//
// Driver Consumed Protocol Prototypes
//
#include EFI_PROTOCOL_DEFINITION (DevicePath)
#include EFI_PROTOCOL_DEFINITION (PciRootBridgeIo)
#include EFI_PROTOCOL_DEFINITION (Decompress)
#include EFI_PROTOCOL_DEFINITION (LoadedImage)
#include EFI_PROTOCOL_DEFINITION (UgaIo)

//
// Driver Consumed Protocol Prototypes
//
#include EFI_PROTOCOL_DEFINITION (DriverBinding)
#include EFI_PROTOCOL_DEFINITION (ComponentName)
#include EFI_PROTOCOL_DEFINITION (PciIo)
#include EFI_PROTOCOL_DEFINITION (BusSpecificDriverOverride)

//
// Driver Produced Protocol Prototypes
//

#define VGABASE1  0x3B0
#define VGALIMIT1 0x3BB

#define VGABASE2  0x3C0
#define VGALIMIT2 0x3DF

#define ISABASE   0x100
#define ISALIMIT  0x3FF

typedef enum {
  PciBarTypeUnknown = 0,
  PciBarTypeIo16,
  PciBarTypeIo32,
  PciBarTypeMem32,
  PciBarTypePMem32,
  PciBarTypeMem64,
  PciBarTypePMem64,
  PciBarTypeIo,
  PciBarTypeMem,
  PciBarTypeMaxType
} PCI_BAR_TYPE;

typedef struct {
  UINT64        BaseAddress;
  UINT64        Length;
  UINT64        Alignment;
  PCI_BAR_TYPE  BarType;
  BOOLEAN       Prefetchable;
  UINT8         MemType;
  UINT8         Offset;
} PCI_BAR;

#define PCI_IO_DEVICE_SIGNATURE   EFI_SIGNATURE_32 ('p','c','i','o')

#define EFI_BRIDGE_IO32_DECODE_SUPPORTED        0x0001
#define EFI_BRIDGE_PMEM32_DECODE_SUPPORTED      0x0002
#define EFI_BRIDGE_PMEM64_DECODE_SUPPORTED      0x0004
#define EFI_BRIDGE_IO16_DECODE_SUPPORTED        0x0008
#define EFI_BRIDGE_PMEM_MEM_COMBINE_SUPPORTED   0x0010
#define EFI_BRIDGE_MEM64_DECODE_SUPPORTED       0x0020
#define EFI_BRIDGE_MEM32_DECODE_SUPPORTED       0x0040

typedef struct _PCI_IO_DEVICE {
  UINT32                                    Signature;
  EFI_HANDLE                                Handle;
  EFI_PCI_IO_PROTOCOL                       PciIo;
  EFI_LIST_ENTRY                            Link;

  EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL PciDriverOverride;
  EFI_DEVICE_PATH_PROTOCOL                  *DevicePath;
  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL           *PciRootBridgeIo;

  //
  // PCI configuration space header type
  //
  PCI_TYPE00                                Pci;

  //
  // Bus number, Device number, Function number
  //
  UINT8                                     BusNumber;
  UINT8                                     DeviceNumber;
  UINT8                                     FunctionNumber;

  //
  // BAR for this PCI Device
  //
  PCI_BAR                                   PciBar[PCI_MAX_BAR];

  //
  // The bridge device this pci device is subject to
  //
  struct _PCI_IO_DEVICE                     *Parent;

  //
  // A linked list for children Pci Device if it is bridge device
  //
  EFI_LIST_ENTRY                            ChildList;

  //
  // TURE if the PCI bus driver creates the handle for this PCI device
  //
  BOOLEAN                                   Registered;

  //
  // TRUE if the PCI bus driver successfully allocates the resource required by
  // this PCI device
  //
  BOOLEAN                                   Allocated;

  //
  // The attribute this PCI device currently set
  //
  UINT64                                    Attributes;

  //
  // The attributes this PCI device actually supports
  //
  UINT64                                    Supports;

  //
  // The resource decode the bridge supports
  //
  UINT32                                    Decodes;

  //
  // The OptionRom Size
  //
  UINT64                                    RomSize;

  //
  // TRUE if there is any EFI driver in the OptionRom
  //
  BOOLEAN                                   BusOverride;

  //
  //  A list tracking reserved resource on a bridge device
  //
  EFI_LIST_ENTRY                            ReservedResourceList;

  //
  // A list tracking image handle of platform specific overriding driver
  //
  EFI_LIST_ENTRY                            OptionRomDriverList;

  BOOLEAN                                   IsPciExp;

} PCI_IO_DEVICE;

#define PCI_IO_DEVICE_FROM_PCI_IO_THIS(a) \
  CR (a, PCI_IO_DEVICE, PciIo, PCI_IO_DEVICE_SIGNATURE)

#define PCI_IO_DEVICE_FROM_PCI_DRIVER_OVERRIDE_THIS(a) \
  CR (a, PCI_IO_DEVICE, PciDriverOverride, PCI_IO_DEVICE_SIGNATURE)

#define PCI_IO_DEVICE_FROM_LINK(a) \
  CR (a, PCI_IO_DEVICE, Link, PCI_IO_DEVICE_SIGNATURE)

//
// Global Variables
//
extern EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gPciBusComponentName;
extern BOOLEAN                     gFullEnumeration;
static UINT64                      gAllOne = 0xFFFFFFFFFFFFFFFF;
static UINT64                      gAllZero   = 0;

#include "PciIo.h"
#include "PciCommand.h"
#include "PciDeviceSupport.h"
#include "PciEnumerator.h"
#include "PciEnumeratorSupport.h"
#include "PciDriverOverride.h"
#include "PciRomTable.h"
#include "PciOptionRomSupport.h"
#include "PciPowerManagement.h"

#define IS_ISA_BRIDGE(_p)       IS_CLASS2 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_ISA)
#define IS_INTEL_ISA_BRIDGE(_p) (IS_CLASS2 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_ISA_POSITIVE_DECODE) && ((_p)->Hdr.VendorId == 0x8086) && ((_p)->Hdr.DeviceId == 0x7110))

#endif


text:
class PaymentsController < ApplicationController
  def create
    CreatePaymentTransaction.call(payment_attributes)
    flash.success = "Payment tracked"
  rescue ActiveRecord::RecordInvalid
    flash.danger = "Some details were missing"
  ensure
    redirect_to pots_path
  end

  protected

    def payment_attributes
      params.require(:payment).permit(:monthly_budget_id, :amount, :tags).to_h.symbolize_keys
    end
end


text:
                <list-link data-url="/show/listing/crashplan/crashplan"></list-link>

            <a id="cpp-today" href="<?=url('module/crashplan/listing')?>" class="list-group-item list-group-item-success hide">
                0

            <a id="cpp-lastweek" href="<?=url('module/crashplan/listing')?>" class="list-group-item list-group-item-warning hide">
                0

            <a id="cpp-week_plus" href="<?=url('module/crashplan/listing')?>" class="list-group-item list-group-item-danger hide">
                0


text:
namespace extensions {
struct Message;
struct PortId;
class ScriptContext;

// A class representing information about a specific extension message port that
// handles sending related IPCs to the browser. This consists of a port id and
// a separate js_id which is exposed only to the JavaScript context.
class ExtensionPort {
 public:
  ExtensionPort(ScriptContext* script_context, const PortId& id, int js_id);
  ~ExtensionPort();

  // Posts a new message to the port. If the port is not initialized, the
  // message will be queued until it is.
  void PostExtensionMessage(std::unique_ptr<Message> message);

  // Closes the port. If there are pending messages, they will still be sent
  // assuming initialization completes (after which, the port will close).
  void Close(bool close_channel);

  const PortId& id() const { return id_; }
  int js_id() const { return js_id_; }

 private:
  // The associated ScriptContext for this port. Since these objects are owned
  // by a NativeHandler, this should always be valid.
  ScriptContext* script_context_ = nullptr;

  const PortId id_;

  // The id used in the JS bindings. If this is a receiver port, this is not the
  // same as the port_number in the PortId. This should be used only as an
  // identifier in the JS context this port is from.
  int js_id_ = 0;

  DISALLOW_COPY_AND_ASSIGN(ExtensionPort);
};

}  // namespace extensions

#endif  // EXTENSIONS_RENDERER_EXTENSION_PORT_H_


text:
package com.vidolima.doco.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Use this annotation on embedded fields.
 */
@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface DocumentEmbed {
    String name() default "";
}


text:
# Hive Appier Framework
# Copyright (c) 2008-2015 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foundation, either version 2.0 of the License, or (at your option) any
# later version.
#
# Hive Appier Framework is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Apache License for more details.
#
# You should have received a copy of the Apache License along with
# Hive Appier Framework. If not, see <http://www.apache.org/licenses/>.

__author__ = "João Magalhães <joamag@hive.pt>"
""" The author(s) of the module """

__version__ = "1.0.0"
""" The version of the module """

__revision__ = "$LastChangedRevision$"
""" The revision number of the module """

__date__ = "$LastChangedDate$"
""" The last change date of the module """

__copyright__ = "Copyright (c) 2008-2015 Hive Solutions Lda."
""" The copyright for the module """

__license__ = "Apache License, Version 2.0"
""" The license for the module """

import unittest

import appier

class OrderedDictTest(unittest.TestCase):

    def test_order(self):
        struct = appier.OrderedDict()

        struct["first"] = 1
        struct["second"] = 2
        struct["third"] = 3

        iterator = iter(struct)

        self.assertEqual(next(iterator), ["first", 1])
        self.assertEqual(next(iterator), ["second", 2])
        self.assertEqual(next(iterator), ["third", 3])


text:
/*
 * AUTHOR: Carlo Pinciroli <cpinciro@ulb.ac.be>
 *
 * An example controller to manually control the foot-bot.

 * To control a foot-bot, you need to Shift-Click on it in the OpenGL
 * visualization to select it.
 *
 * This controller is meant to be used with the XML file:
 *    experiments/manualcontrol.argos
 */

#ifndef FOOTBOT_MANUALCONTROL_H
#define FOOTBOT_MANUALCONTROL_H

/*
 * Include some necessary headers.
 */
/* Definition of the CCI_Controller class. */
#include <argos3/core/control_interface/ci_controller.h>
/* Definition of the differential steering actuator */
#include <argos3/plugins/robots/generic/control_interface/ci_differential_steering_actuator.h>
/* Definition of the LEDs actuator */
#include <argos3/plugins/robots/generic/control_interface/ci_leds_actuator.h>
/* Vector2 definitions */
#include <argos3/core/utility/math/vector2.h>

/*
 * All the ARGoS stuff in the 'argos' namespace.
 * With this statement, you save typing argos:: every time.
 */
using namespace argos;

/*
 * A controller is simply an implementation of the CCI_Controller class.
 */
class CFootBotManualControl : public CCI_Controller {

public:

   /*
    * The following variables are used as parameters for
    * turning during navigation. You can set their value
    * in the <parameters> section of the XML configuration
    * file, under the
    * <controllers><footbot_manualcontrol_controller><parameters><wheel_turning>
    * section.
    */
   struct SWheelTurningParams {
      /*
       * The turning mechanism.
       * The robot can be in three different turning states.
       */
      enum ETurningMechanism
      {
         NO_TURN = 0, // go straight
         SOFT_TURN,   // both wheels are turning forwards, but at different speeds
         HARD_TURN    // wheels are turning with opposite speeds
      } TurningMechanism;
      /*
       * Angular thresholds to change turning state.
       */
      CRadians HardTurnOnAngleThreshold;
      CRadians SoftTurnOnAngleThreshold;
      CRadians NoTurnAngleThreshold;
      /* Maximum wheel speed */
      Real MaxSpeed;

      void Init(TConfigurationNode& t_tree);
   };

public:

   /* Class constructor. */
   CFootBotManualControl();

   /* Class destructor. */
   virtual ~CFootBotManualControl() {}

   /*
    * This function initializes the controller.
    * The 't_node' variable points to the <parameters> section in the XML file
    * in the <controllers><footbot_manualcontrol_controller> section.
    */
   virtual void Init(TConfigurationNode& t_node);

   /*
    * This function is called once every time step.
    * The length of the time step is set in the XML file.
    */
   virtual void ControlStep();

   /*
    * This function resets the controller to its state right after the Init().
    * It is called when you press the reset button in the GUI.
    * In this example controller there is no need for resetting anything, so
    * the function could have been omitted. It's here just for completeness.
    */
   virtual void Reset() {}

   /*
    * Called to cleanup what done by Init() when the experiment finishes.
    * In this example controller there is no need for clean anything up, so
    * the function could have been omitted. It's here just for completeness.
    */
   virtual void Destroy() {}

   /*
    * Sets the selected flag on this robot.
    * When selected, a robot follows the control vector.
    */
   void Select();

   /*
    * Unsets the selected flag on this robot.
    * When unselected, a robot stays still.
    */
   void Deselect();

   /*
    * Sets the control vector.
    */
   void SetControlVector(const CVector2& c_control);

protected:

   /*
    * Gets a direction vector as input and transforms it into wheel actuation.
    */
   void SetWheelSpeedsFromVector(const CVector2& c_heading);

private:

   /* Pointer to the differential steering actuator */
   CCI_DifferentialSteeringActuator* m_pcWheels;
   /* Pointer to the LEDs actuator */
   CCI_LEDsActuator* m_pcLEDs;

   /* The turning parameters */
   SWheelTurningParams m_sWheelTurningParams;

   /* Flag to know whether this robot is selected */
   bool m_bSelected;

   /* The control vector */
   CVector2 m_cControl;
};

#endif


text:
package fr.adrienbrault.idea.symfony2plugin.tests.stubs.indexes;

import com.jetbrains.twig.TwigFileType;
import fr.adrienbrault.idea.symfony2plugin.stubs.indexes.TwigMacroFunctionStubIndex;
import fr.adrienbrault.idea.symfony2plugin.tests.SymfonyLightCodeInsightFixtureTestCase;

/**
 * @author Daniel Espendiller <daniel@espendiller.net>
 * @see fr.adrienbrault.idea.symfony2plugin.stubs.indexes.TwigMacroFunctionStubIndex
 */
public class TwigMacroFunctionStubIndexTest extends SymfonyLightCodeInsightFixtureTestCase {

    public void testThatMacrosAreInIndex() {
        myFixture.configureByText(TwigFileType.INSTANCE, "" +
            "{% macro foobar %}{% endmacro %}\n" +
            "{% macro foobar2(foobar, foo) %}{% endmacro %}\n"
        );

        assertIndexContains(TwigMacroFunctionStubIndex.KEY, "foobar", "foobar2");

        assertIndexContainsKeyWithValue(TwigMacroFunctionStubIndex.KEY, "foobar2", value ->
            "(foobar, foo)".equals(value.getParameters())
        );
    }
}


text:
[![dStack logo](http://dstack.gollygood.software/images/dstack-logo.jpg)](http://dstack.gollygood.software)

[![Stories in Ready](https://badge.waffle.io/gollygood/dstack.png?label=Ready)](https://waffle.io/gollygood/dstack)

Version: 01110110.01110100 (CaneSyrup)

dStack(short for "development stack") is a Vagrant+Chef powered LAMP stack that
allows setup of web nodes via a configuration YAML file. The primary target
users are enterprise development teams that need similar-to-production
development.

What's in the stack?
--------------------
Component     | Version(s)                  | Notes
------------- | --------------------------- | -------------
Apache2       | 2.2, 2.4                    |
ApacheSolr    | 3.x(default) or 4.x         |
APC           | 3.1.7, 4.0.6                |
Box OS        | Ubuntu 12.04                |
Chef Solo     | 10.14.2                     |
Drush         | 7.0.0                       |
Git           | 1.7.9.5                     |
MySQL         | 5.5                         |
PHP           | 5.3, 5.5, 5.6               |
ruby          | 1.9.3                       |
varnish       | 3.x(default) or 4.x         |
tika          |                             | @todo: Add tika.
vim           | 7.3                         |
Webgrind      | master                      | Commit: 077f79f13ddc8efa4cb10c2c041eb4b50037e0e3
Xdebug        | 2.2.7                       |
XHprof        | 0.9.4                       |

Requirements
------------

* Ruby >= 2.1.1
* Vagrant >= 1.6.3

**Windows is not supported.**

[Documentation](documentation)
------------------------------

The documentation is included as part of the codebase for easier reference
and continuity of versions of dStack. Each cookbook contains its own
documentation, however, an index of all documentation may be found in the
[documentation](documentation) directory along with any higher level
documentation that corresponds to dStack.

Bugs
----

Submit all bugs to the [issue queue](https://github.com/gollygood/dstack/issues)
on GitHub.

Contributing
------------

Make changes in a fork and submit a [pull request](https://github.com/gollygood/dstack/pulls).

For development you will need to install [Bundler](http://bundler.io/) and run
`make development`. This will install the tools necessary for development.

Before submitting a pull request run `make test` to make sure your code passes
tests and adheres to the [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide).

Sponsors
--------

Development is sponsored by [GollyGood Software](http://www.gollygoodsoftware.com/).

License
-------

Copyright:: 2015 dStack Development Team

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

*Vendor software maintain authorship and copyrights of their original authors
under the Apache License see [NOTICE](NOTICE)*.


text:
<bill session="115" type="h" number="3542" updated="2017-10-04T15:30:15Z">
  <state datetime="2017-07-28">REFERRED</state>
  <status>
    <introduced datetime="2017-07-28"/>
  </status>
  <introduced datetime="2017-07-28"/>
  <titles>
    <title type="short" as="introduced">Hamas Human Shields Prevention Act</title>
    <title type="short" as="introduced">Hamas Human Shields Prevention Act</title>
    <title type="official" as="introduced">To impose sanctions against Hamas for gross violations of internationally recognized human rights by reason of the use of civilians as human shields, and for other purposes.</title>
    <title type="display">Hamas Human Shields Prevention Act</title>
  </titles>
  <sponsor bioguide_id="W000795"/>
  <cosponsors>
    <cosponsor bioguide_id="D000610" joined="2017-07-28"/>
    <cosponsor bioguide_id="M001196" joined="2017-07-28"/>
    <cosponsor bioguide_id="R000435" joined="2017-07-28"/>
  </cosponsors>
  <actions>
    <action datetime="2017-07-28">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-07-28" state="REFERRED">
      <text>Referred to the Committee on Foreign Affairs, and in addition to the Committee on the Judiciary, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text>
    </action>
    <action datetime="2017-07-28">
      <text>Referred to the Committee on Foreign Affairs, and in addition to the Committee on the Judiciary, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSJU" name="House Judiciary" activity="Referral"/>
    <committee subcommittee="" code="HSFA" name="House Foreign Affairs" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="International affairs"/>
    <term name="Congressional oversight"/>
    <term name="Foreign property"/>
    <term name="Human rights"/>
    <term name="Middle East"/>
    <term name="Palestinians"/>
    <term name="Sanctions"/>
    <term name="Terrorism"/>
    <term name="United Nations"/>
    <term name="Visas and passports"/>
  </subjects>
  <amendments/>
  <summary date="2017-07-28T04:00:00Z" status="Introduced in House">Hamas Human Shields Prevention Act

This bill states that it is U.S. policy to: (1) condemn the use of human shields by Hamas as an act of terrorism and a violation of human rights and international humanitarian law, and (2) act against those engaging in or supporting the use of human shields.

The President is urged to direct the U.S. Permanent Representative to the United Nations (U.N.) to use U.S. influence at the U.N. Security Council to secure support for a resolution imposing multilateral sanctions against Hamas's use of human shields.

The President shall prohibit property transactions and U.S. entry with respect to: (1) each foreign person or entity that is a member of or acting on behalf of Hamas and that is responsible for or complicit in Hamas' use of human shields; and (2) each foreign person or entity and each agency or instrumentality of a foreign state that has significantly facilitated any act with respect to such use of human shields, provided material support to a listed person or entity, or attempted to facilitate or support such acts or persons.

The President may waive a sanction for 120 days with prior congressional certification that such waiver is vital to U.S. national security interests.</summary>
  <committee-reports/>
</bill>


text:
from re import compile, match

REGEX = compile('www\.\w+\.[^#]+')

def remove_url_anchor(url):
    return match(REGEX, url).group(0)

# def remove_url_anchor(url):
#     return url.split('#')[0]


text:
@interface Student : NSObject

@end


text:
#ifndef __RDPPOLYPOINT_H
#define __RDPPOLYPOINT_H

void
rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
             int npt, DDXPointPtr in_pts);

#endif


text:
package com.gogaworm.easyjlpt.viewmodel;

import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.LiveData;
import com.gogaworm.easyjlpt.db.Kanji;
import com.gogaworm.easyjlpt.db.Lesson;

import java.util.List;

public class KanjiLessonViewViewModel extends ListViewModel<Kanji> {

    public KanjiLessonViewViewModel(@NonNull Application application) {
        super(application);
    }

    @Override
    public LiveData<List<Kanji>> getData() {
        return controller.getKanjiForSelectedLesson();
    }

    @Override
    public void setSelectedItem(Kanji kanji) {
        controller.setSelectedKanji(kanji);
    }

    public Lesson getSelectedLesson() {
        return controller.getSelectedLesson().getValue();
    }
}


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

namespace Tests\Innmind\AMQP;

use Innmind\AMQP\{
    Producers,
    Producer\Producer,
    Model\Exchange\Declaration,
    Model\Exchange\Type,
    Client,
};
use PHPUnit\Framework\TestCase;

class ProducersTest extends TestCase
{
    public function testInterface()
    {
        $producers = new Producers(
            $this->createMock(Client::class),
            'foo',
            'bar'
        );

        $this->assertTrue($producers->contains('foo'));
        $this->assertTrue($producers->contains('bar'));
        $this->assertFalse($producers->contains('baz'));
        $this->assertInstanceOf(Producer::class, $producers->get('foo'));
        $this->assertSame($producers->get('foo'), $producers->get('foo'));
    }

    public function testFromDeclarations()
    {
        $producers = Producers::of(
            $this->createMock(Client::class),
            Declaration::passive('foo', Type::direct()),
            Declaration::passive('bar', Type::direct())
        );

        $this->assertTrue($producers->contains('foo'));
        $this->assertTrue($producers->contains('bar'));
        $this->assertFalse($producers->contains('baz'));
    }
}


text:
FactoryGirl.define do
  factory :taro, :class => User do
    name '太郎'
    blogs {[ FactoryGirl.create(:today), FactoryGirl.create(:tomorrow) ]}
  end

  factory :jiro, :class => User do
    name '次郎'
    blogs {[ FactoryGirl.create(:day_after_tomorrow) ]}
  end

  factory :hanako, :class => User do
    name '花子'
  end

  factory :john, :class => User do
    name 'john'
    blogs {[ FactoryGirl.create(:yesterday) ]}
  end

  factory :user do
    name 'test'
    blogs {(1..10).map{ FactoryGirl.create(:blog) } }
  end
end


text:
<?php

final class PhabricatorPolicyEditEngineExtension
  extends PhabricatorEditEngineExtension {

  const EXTENSIONKEY = 'policy.policy';

  public function getExtensionPriority() {
    return 250;
  }

  public function isExtensionEnabled() {
    return true;
  }

  public function getExtensionName() {
    return pht('Policies');
  }

  public function supportsObject(
    PhabricatorEditEngine $engine,
    PhabricatorApplicationTransactionInterface $object) {
    return ($object instanceof PhabricatorPolicyInterface);
  }

  public function buildCustomEditFields(
    PhabricatorEditEngine $engine,
    PhabricatorApplicationTransactionInterface $object) {

    $viewer = $engine->getViewer();

    $editor = $object->getApplicationTransactionEditor();
    $types = $editor->getTransactionTypesForObject($object);
    $types = array_fuse($types);

    $policies = id(new PhabricatorPolicyQuery())
      ->setViewer($viewer)
      ->setObject($object)
      ->execute();

    $map = array(
      PhabricatorTransactions::TYPE_VIEW_POLICY => array(
        'key' => 'policy.view',
        'aliases' => array('view'),
        'capability' => PhabricatorPolicyCapability::CAN_VIEW,
        'label' => pht('View Policy'),
        'description' => pht('Controls who can view the object.'),
        'description.conduit' => pht('Change the view policy of the object.'),
        'edit' => 'view',
      ),
      PhabricatorTransactions::TYPE_EDIT_POLICY => array(
        'key' => 'policy.edit',
        'aliases' => array('edit'),
        'capability' => PhabricatorPolicyCapability::CAN_EDIT,
        'label' => pht('Edit Policy'),
        'description' => pht('Controls who can edit the object.'),
        'description.conduit' => pht('Change the edit policy of the object.'),
        'edit' => 'edit',
      ),
      PhabricatorTransactions::TYPE_JOIN_POLICY => array(
        'key' => 'policy.join',
        'aliases' => array('join'),
        'capability' => PhabricatorPolicyCapability::CAN_JOIN,
        'label' => pht('Join Policy'),
        'description' => pht('Controls who can join the object.'),
        'description.conduit' => pht('Change the join policy of the object.'),
        'edit' => 'join',
      ),
    );

    $fields = array();
    foreach ($map as $type => $spec) {
      if (empty($types[$type])) {
        continue;
      }

      $capability = $spec['capability'];
      $key = $spec['key'];
      $aliases = $spec['aliases'];
      $label = $spec['label'];
      $description = $spec['description'];
      $conduit_description = $spec['description.conduit'];
      $edit = $spec['edit'];

      $policy_field = id(new PhabricatorPolicyEditField())
        ->setKey($key)
        ->setLabel($label)
        ->setAliases($aliases)
        ->setIsCopyable(true)
        ->setCapability($capability)
        ->setPolicies($policies)
        ->setTransactionType($type)
        ->setEditTypeKey($edit)
        ->setDescription($description)
        ->setConduitDescription($conduit_description)
        ->setConduitTypeDescription(pht('New policy PHID or constant.'))
        ->setValue($object->getPolicy($capability));
      $fields[] = $policy_field;

      if ($object instanceof PhabricatorSpacesInterface) {
        if ($capability == PhabricatorPolicyCapability::CAN_VIEW) {
          $type_space = PhabricatorTransactions::TYPE_SPACE;
          if (isset($types[$type_space])) {
            $space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID(
              $object);

            $space_field = id(new PhabricatorSpaceEditField())
              ->setKey('spacePHID')
              ->setLabel(pht('Space'))
              ->setEditTypeKey('space')
              ->setIsCopyable(true)
              ->setIsLockable(false)
              ->setIsReorderable(false)
              ->setAliases(array('space', 'policy.space'))
              ->setTransactionType($type_space)
              ->setDescription(pht('Select a space for the object.'))
              ->setConduitDescription(
                pht('Shift the object between spaces.'))
              ->setConduitTypeDescription(pht('New space PHID.'))
              ->setValue($space_phid);
            $fields[] = $space_field;

            $space_field->setPolicyField($policy_field);
            $policy_field->setSpaceField($space_field);
          }
        }
      }
    }

    return $fields;
  }

}


text:
//
// MIT License
//
// Copyright (c) 2017-2018 Thibault Martinez and Simon Ninon
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
//

#pragma once

#include <iota/types/trytes.hpp>

namespace IOTA {

namespace Models {

/**
 * Neighbor model.
 */
class Neighbor {
public:
  /**
   * Default ctor.
   */
  Neighbor() = default;

  /**
   * Full init ctor.
   *
   * @param address Address of your peer.
   * @param numberOfAllTransactions Number of all transactions sent (invalid, valid, already-seen).
   * @param numberOfInvalidTransactions Number of invalid transactions your peer has sent you.
   * @param numberOfNewTransactions Number of newly transmitted transactions.
   */
  Neighbor(const Types::Trytes& address, const int64_t& numberOfAllTransactions,
           const int64_t& numberOfInvalidTransactions, const int64_t& numberOfNewTransactions);

  /**
   * Default dtor.
   */
  ~Neighbor() = default;

public:
  /**
   * @return Address of your peer.
   */
  const Types::Trytes& getAddress() const;

  /**
   * @param addr Set address of your peer.
   */
  void setAddress(const Types::Trytes& addr);

public:
  /**
   * @return Number of all transactions sent (invalid, valid, already-seen).
   */
  const int64_t& getNumberOfAllTransactions() const;

  /**
   * @param nbTrx Set number of all transactions sent (invalid, valid, already seen).
   */
  void setNumberOfAllTransactions(const int64_t& nbTrx);

public:
  /**
   * @return Invalid transactions your peer has sent you. These are transactions with invalid
   * signatures or overall schema.
   */
  const int64_t& getNumberOfInvalidTransactions() const;

  /**
   * @param nbTrx Set number of invalid transactions sent your peer.
   */
  void setNumberOfInvalidTransactions(const int64_t& nbTrx);

public:
  /**
   * @return New transactions which were transmitted.
   */
  const int64_t& getNumberOfNewTransactions() const;

  /**
   * @param nbTrx Set number of newly transmitted transactions.
   */
  void setNumberOfNewTransactions(const int64_t& nbTrx);

public:
  /**
   * @param rhs An object to compare with this object.
   * @return Whether the current neighbor is the same as the given one.
   */
  bool operator==(const Neighbor& rhs) const;

  /**
   * @param rhs An object to compare with this object.
   * @return Whether the current neighbor is different from the given one.
   */
  bool operator!=(const Neighbor& rhs) const;

private:
  /**
   * Address of your peer.
   */
  Types::Trytes address_;
  /**
   * Number of all transactions sent (invalid, valid, already-seen).
   */
  int64_t numberOfAllTransactions_ = 0;
  /**
   * Invalid transactions your peer has sent you. These are transactions with invalid signatures or
   * overall schema.
   */
  int64_t numberOfInvalidTransactions_ = 0;
  /**
   * Number of newly transmitted transactions.
   */
  int64_t numberOfNewTransactions_ = 0;
};

}  // namespace Models

}  // namespace IOTA


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:paddingTop="10dip">
    <TextView
        android:id="@+id/info"
    	android:layout_width="180dip"
    	android:layout_height="wrap_content"
        android:textColor="#ffffffff"
        android:textSize="16sp"/>
	<ImageView
	    android:id="@+id/icon"
	    android:layout_width="wrap_content"
    	android:layout_height="wrap_content"
        />
</LinearLayout>


text:
public class Player
{
	private static final String DEFAULT_NAME   = "Player";
	private static final String DEFAULT_NAME_I = "Player %d";
	private String   name    ;
	private Board    board   ;
	private Strategy strategy;

	public Player()
	{
	}

	public Player(Strategy strategy)
	{
		this.strategy = strategy;
	}

	public Player(Board board)
	{
		this.board = board;
		this.name  = getDefaultName();
	}

	public Player(int i)
	{
		this.name = getDefaultName(i);
	}

	public Player(String name)
	{
		this.name = name;
	}

	public Player(int i, Board board)
	{
		this(i);
		this.board = board;
	}

	public Player(String name, Board board)
	{
		this(name);
		this.board = board;
	}

	public void setStrategy(Strategy strategy)
	{
		this.strategy = strategy;
	}

	public Strategy getStrategy()
	{
		return strategy;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getName()
	{
		return name;
	}

	public void setBoard(Board board)
	{
		this.board = board;
	}

	public Board getBoard()
	{
		return board;
	}

	public String getDefaultName()
	{
		return DEFAULT_NAME;
	}

	public String getDefaultName(int i)
	{
		return String.format(getDefaultNameI(), i);
	}

	private String getDefaultNameI()
	{
		return DEFAULT_NAME_I;
	}

	public Board board()
	{
		return getBoard();
	}

	public boolean isHuman()
	{
		return getStrategy() instanceof BattleShipStrategyNull;
	}

	public boolean isComputer()
	{
		return !isHuman();
	}
}


text:
package net.sourceforge.plantuml.jdot;

import java.awt.geom.CubicCurve2D;
import java.awt.geom.Point2D;

import net.sourceforge.plantuml.posimo.DotPath;
import net.sourceforge.plantuml.ugraphic.UTranslate;

public class YMirror {

	private final double max;

	public YMirror(double max) {
		this.max = max;
	}

	public double getMirrored(double v) {
		if (v < 0 || v > max) {
			throw new IllegalArgumentException();
		}
		//return v;
		return max - v;
	}

	public Point2D getMirrored(Point2D pt) {
		//return pt;
		return new Point2D.Double(pt.getX(), max - pt.getY());
	}

	public DotPath getMirrored(DotPath path) {
		DotPath result = new DotPath();
		for (CubicCurve2D.Double bez : path.getBeziers()) {
			result = result.addCurve(getMirrored(bez.getP1()), getMirrored(bez.getCtrlP1()),
					getMirrored(bez.getCtrlP2()), getMirrored(bez.getP2()));
		}
		return result;
	}

	public UTranslate getMirrored(UTranslate tr) {
		return new UTranslate(tr.getDx(), max - tr.getDy());
		//return tr;
	}

}