text:
// Door|Controls3D|0040
namespace VRTK
{
    using UnityEngine;

    /// <summary>
    /// Transforms a game object into a door with an optional handle attached to an optional frame. The direction can be freely set and also very reliably auto-detected.
    /// </summary>
    /// <remarks>
    /// There are situations when it can be very hard to automatically calculate the correct axis and anchor values for the hinge joint. If this situation is encountered then simply add the hinge joint manually and set these two values. All the rest will still be handled by the script.
    ///
    /// The script will instantiate the required Rigidbodies, Interactable and HingeJoint components automatically in case they do not exist yet. Gizmos will indicate the direction.
    /// </remarks>
    /// <example>
    /// `VRTK/Examples/025_Controls_Overview` shows a selection of door types, from a normal door and trapdoor, to a door with a cat-flap in the middle.
    /// </example>
    public class VRTK_Door : VRTK_Control
    {
        [Tooltip("The axis on which the door should open.")]
        public Direction direction = Direction.autodetect;
        [Tooltip("The game object for the door. Can also be an empty parent or left empty if the script is put onto the actual door mesh. If no colliders exist yet a collider will tried to be automatically attached to all children that expose renderers.")]
        public GameObject door;
        [Tooltip("The game object for the handles. Can also be an empty parent or left empty. If empty the door can only be moved using the rigidbody mode of the controller. If no collider exists yet a compound collider made up of all children will try to be calculated but this will fail if the door is rotated. In that case a manual collider will need to be assigned.")]
        public GameObject handles;
        [Tooltip("The game object for the frame to which the door is attached. Should only be set if the frame will move as well to ensure that the door moves along with the frame.")]
        public GameObject frame;
        [Tooltip("The parent game object for the door content elements.")]
        public GameObject content;
        [Tooltip("Makes the content invisible while the door is closed.")]
        public bool hideContent = true;
        [Tooltip("The maximum opening angle of the door.")]
        public float maxAngle = 120f;
        [Tooltip("Can the door be pulled to open.")]
        public bool openInward = false;
        [Tooltip("Can the door be pushed to open.")]
        public bool openOutward = true;
        [Tooltip("Keeps the door closed with a slight force. This way the door will not gradually open due to some minor physics effect. Only works if either inward or outward is selected, not both.")]
        public bool snapping = true;

        private static float DOOR_ANGULAR_DRAG = 10;
        private float stepSize = 1f;
        private Rigidbody handleRb;
        private FixedJoint handleFj;
        private VRTK_InteractableObject handleIo;
        private Rigidbody doorRb;
        private HingeJoint doorHj;
        private ConstantForce doorCf;
        private Rigidbody frameRb;
        private Direction finalDirection;
        private float subDirection = 1; // positive or negative can be determined automatically since handles dictate that
        private Vector3 secondaryDirection;
        private bool doorHjCreated = false;
        private bool doorCfCreated = false;

        protected override void OnDrawGizmos()
        {
            base.OnDrawGizmos();
            if (!enabled || !setupSuccessful)
            {
                return;
            }

            // show opening direction
            Bounds handleBounds = new Bounds();
            Bounds doorBounds = Utilities.GetBounds(getDoor().transform, getDoor().transform);
            float length = 0.5f;
            if (handles)
            {
                handleBounds = Utilities.GetBounds(handles.transform, handles.transform);
            }
            Vector3 dir = Vector3.zero;
            Vector3 dir2 = Vector3.zero;
            Vector3 thirdDirection = getThirdDirection(Direction2Axis(finalDirection), secondaryDirection);
            bool invertGizmos = false;

            switch (finalDirection)
            {
                case Direction.x:
                    if (thirdDirection == Vector3.up)
                    {
                        dir = transform.up.normalized;
                        dir2 = transform.forward.normalized;
                        length *= doorBounds.extents.z;
                    }
                    else
                    {
                        dir = transform.forward.normalized;
                        dir2 = transform.up.normalized;
                        length *= doorBounds.extents.y;
                        invertGizmos = true;
                    }
                    break;
                case Direction.y:
                    if (thirdDirection == Vector3.right)
                    {
                        dir = transform.right.normalized;
                        dir2 = transform.forward.normalized;
                        length *= doorBounds.extents.z;
                        invertGizmos = true;
                    }
                    else
                    {
                        dir = transform.forward.normalized;
                        dir2 = transform.right.normalized;
                        length *= doorBounds.extents.x;
                    }
                    break;
                case Direction.z:
                    if (thirdDirection == Vector3.up)
                    {
                        dir = transform.up.normalized;
                        dir2 = transform.right.normalized;
                        length *= doorBounds.extents.x;
                        invertGizmos = true;
                    }
                    else
                    {
                        dir = transform.right.normalized;
                        dir2 = transform.up.normalized;
                        length *= doorBounds.extents.y;
                    }
                    break;
            }

            if ((!invertGizmos && openInward) || (invertGizmos && openOutward))
            {
                Vector3 p1 = (handles) ? handleBounds.center : doorBounds.center;
                Vector3 p1end = p1 + dir2 * length * subDirection - dir * (length / 2f) * subDirection;
                Gizmos.DrawLine(p1, p1end);
                Gizmos.DrawSphere(p1end, length / 8f);
            }

            if ((!invertGizmos && openOutward) || (invertGizmos && openInward))
            {
                Vector3 p2 = (handles) ? handleBounds.center : doorBounds.center;
                Vector3 p2end = p2 + dir2 * length * subDirection + dir * (length / 2f) * subDirection;
                Gizmos.DrawLine(p2, p2end);
                Gizmos.DrawSphere(p2end, length / 8f);
            }
        }

        protected override void InitRequiredComponents()
        {
            InitFrame();
            InitDoor();
            InitHandle();

            SetContent(content, hideContent);
        }

        protected override bool DetectSetup()
        {
            // detect axis
            doorHj = getDoor().GetComponent<HingeJoint>();
            if (doorHj && !doorHjCreated)
            {
                direction = Direction.autodetect;
            }
            finalDirection = (direction == Direction.autodetect) ? DetectDirection() : direction;
            if (finalDirection == Direction.autodetect)
            {
                return false;
            }
            if (doorHj && !doorHjCreated)
            {
                // if there is a hinge joint already it overrides axis selection
                direction = finalDirection;
            }

            // detect opening direction
            Bounds doorBounds = Utilities.GetBounds(getDoor().transform, transform);
            if (doorHj == null || doorHjCreated)
            {
                if (handles)
                {
                    // determin sub-direction depending on handle location
                    Bounds handleBounds = Utilities.GetBounds(handles.transform, transform);
                    switch (finalDirection)
                    {
                        case Direction.x:
                            if ((handleBounds.center.z + handleBounds.extents.z) > (doorBounds.center.z + doorBounds.extents.z) || (handleBounds.center.z - handleBounds.extents.z) < (doorBounds.center.z - doorBounds.extents.z))
                            {
                                subDirection = (handleBounds.center.y > doorBounds.center.y) ? -1 : 1;
                                secondaryDirection = Vector3.up;
                            }
                            else
                            {
                                subDirection = (handleBounds.center.z > doorBounds.center.z) ? -1 : 1;
                                secondaryDirection = Vector3.forward;
                            }
                            break;
                        case Direction.y:
                            if ((handleBounds.center.z + handleBounds.extents.z) > (doorBounds.center.z + doorBounds.extents.z) || (handleBounds.center.z - handleBounds.extents.z) < (doorBounds.center.z - doorBounds.extents.z))
                            {
                                subDirection = (handleBounds.center.x > doorBounds.center.x) ? -1 : 1;
                                secondaryDirection = Vector3.right;
                            }
                            else
                            {
                                subDirection = (handleBounds.center.z > doorBounds.center.z) ? -1 : 1;
                                secondaryDirection = Vector3.forward;
                            }
                            break;
                        case Direction.z:
                            if ((handleBounds.center.x + handleBounds.extents.x) > (doorBounds.center.x + doorBounds.extents.x) || (handleBounds.center.x - handleBounds.extents.x) < (doorBounds.center.x - doorBounds.extents.x))
                            {
                                subDirection = (handleBounds.center.y > doorBounds.center.y) ? -1 : 1;
                                secondaryDirection = Vector3.up;
                            }
                            else
                            {
                                subDirection = (handleBounds.center.x > doorBounds.center.x) ? -1 : 1;
                                secondaryDirection = Vector3.right;
                            }
                            break;
                    }
                }
                else
                {
                    switch (finalDirection)
                    {
                        case Direction.x:
                            secondaryDirection = (doorBounds.extents.y > doorBounds.extents.z) ? Vector3.up : Vector3.forward;
                            break;
                        case Direction.y:
                            secondaryDirection = (doorBounds.extents.x > doorBounds.extents.z) ? Vector3.right : Vector3.forward;
                            break;
                        case Direction.z:
                            secondaryDirection = (doorBounds.extents.y > doorBounds.extents.x) ? Vector3.up : Vector3.right;
                            break;
                    }
                    // TODO: derive how to detect -1
                    subDirection = 1;
                }
            }
            else
            {
                // calculate directions from existing anchor
                Vector3 dir = doorBounds.center - doorHj.connectedAnchor;
                if (dir.x != 0)
                {
                    secondaryDirection = Vector3.right;
                    subDirection = dir.x <= 0 ? 1 : -1;
                }
                else if (dir.y != 0)
                {
                    secondaryDirection = Vector3.up;
                    subDirection = dir.y <= 0 ? 1 : -1;
                }
                else if (dir.z != 0)
                {
                    secondaryDirection = Vector3.forward;
                    subDirection = dir.z <= 0 ? 1 : -1;
                }
            }

            if (doorHjCreated)
            {
                float extents = 0;
                if (secondaryDirection == Vector3.right)
                {
                    extents = doorBounds.extents.x / getDoor().transform.lossyScale.x;
                }
                else if (secondaryDirection == Vector3.up)
                {
                    extents = doorBounds.extents.y / getDoor().transform.lossyScale.y;
                }
                else
                {
                    extents = doorBounds.extents.z / getDoor().transform.lossyScale.z;
                }

                doorHj.anchor = secondaryDirection * subDirection * extents;
                doorHj.axis = Direction2Axis(finalDirection);
            }
            if (doorHj)
            {
                doorHj.useLimits = true;
                doorHj.enableCollision = true;

                JointLimits limits = doorHj.limits;
                limits.min = openInward ? -maxAngle : 0;
                limits.max = openOutward ? maxAngle : 0;
                limits.bounciness = 0;
                doorHj.limits = limits;
            }
            if (doorCfCreated)
            {
                doorCf.force = getThirdDirection(doorHj.axis, secondaryDirection) * subDirection * -50f;
            }

            return true;
        }

        protected override ControlValueRange RegisterValueRange()
        {
            return new ControlValueRange() { controlMin = doorHj.limits.min, controlMax = doorHj.limits.max };
        }

        protected override void HandleUpdate()
        {
            value = CalculateValue();
            doorCf.enabled = snapping && (openOutward ^ openInward) && Mathf.Abs(value) < 2f; // snapping only works for single direction doors so far
        }

        private Vector3 Direction2Axis(Direction direction)
        {
            Vector3 axis = Vector3.zero;

            switch (direction)
            {
                case Direction.x:
                    axis = new Vector3(1, 0, 0);
                    break;
                case Direction.y:
                    axis = new Vector3(0, 1, 0);
                    break;
                case Direction.z:
                    axis = new Vector3(0, 0, 1);
                    break;
            }

            return axis;
        }

        private Direction DetectDirection()
        {
            Direction direction = Direction.autodetect;

            if (doorHj && !doorHjCreated)
            {
                // use direction of hinge joint
                if (doorHj.axis == Vector3.right)
                {
                    direction = Direction.x;
                }
                else if (doorHj.axis == Vector3.up)
                {
                    direction = Direction.y;
                }
                else if (doorHj.axis == Vector3.forward)
                {
                    direction = Direction.z;
                }
            }
            else
            {
                if (handles)
                {
                    Bounds handleBounds = Utilities.GetBounds(handles.transform, transform);
                    Bounds doorBounds = Utilities.GetBounds(getDoor().transform, transform, handles.transform);

                    // handles determine direction, there are actually two directions possible depending on handle position, we'll just detect one of them for now, preference is y
                    if ((handleBounds.center.y + handleBounds.extents.y) > (doorBounds.center.y + doorBounds.extents.y) || (handleBounds.center.y - handleBounds.extents.y) < (doorBounds.center.y - doorBounds.extents.y))
                    {
                        direction = Direction.x;
                    }
                    else
                    {
                        direction = Direction.y;
                    }
                }
            }

            return direction;
        }

        private void InitFrame()
        {
            if (frame == null)
            {
                return;
            }

            frameRb = frame.GetComponent<Rigidbody>();
            if (frameRb == null)
            {
                frameRb = frame.AddComponent<Rigidbody>();
                frameRb.isKinematic = true; // otherwise frame moves/falls over when door is moved or fully open
                frameRb.angularDrag = DOOR_ANGULAR_DRAG; // in case this is a nested door
            }
        }

        private void InitDoor()
        {
            Utilities.CreateColliders(getDoor());

            doorRb = getDoor().GetComponent<Rigidbody>();
            if (doorRb == null)
            {
                doorRb = getDoor().AddComponent<Rigidbody>();
                doorRb.angularDrag = DOOR_ANGULAR_DRAG;
            }
            doorRb.collisionDetectionMode = CollisionDetectionMode.Continuous; // otherwise door will not react to fast moving controller
            doorRb.isKinematic = false; // in case nested door as already created this

            doorHj = getDoor().GetComponent<HingeJoint>();
            if (doorHj == null)
            {
                doorHj = getDoor().AddComponent<HingeJoint>();
                doorHjCreated = true;
            }
            doorHj.connectedBody = frameRb;

            doorCf = getDoor().GetComponent<ConstantForce>();
            if (doorCf == null)
            {
                doorCf = getDoor().AddComponent<ConstantForce>();
                doorCf.enabled = false;
                doorCfCreated = true;
            }
        }

        private void InitHandle()
        {
            if (handles == null)
            {
                return;
            }

            if (handles.GetComponentInChildren<Collider>() == null)
            {
                Utilities.CreateColliders(handles);
            }

            handleRb = handles.GetComponent<Rigidbody>();
            if (handleRb == null)
            {
                handleRb = handles.AddComponent<Rigidbody>();
            }
            handleRb.isKinematic = false;
            handleRb.useGravity = false;

            handleFj = handles.GetComponent<FixedJoint>();
            if (handleFj == null)
            {
                handleFj = handles.AddComponent<FixedJoint>();
                handleFj.connectedBody = doorRb;
            }

            handleIo = handles.GetComponent<VRTK_InteractableObject>();
            if (handleIo == null)
            {
                handleIo = handles.AddComponent<VRTK_InteractableObject>();
            }
            handleIo.isGrabbable = true;
            handleIo.precisionSnap = true;
            handleIo.stayGrabbedOnTeleport = false;
            handleIo.grabAttachMechanic = VRTK_InteractableObject.GrabAttachType.Track_Object;
        }

        private float CalculateValue()
        {
            return Mathf.Round((doorHj.angle) / stepSize) * stepSize;
        }

        private GameObject getDoor()
        {
            return (door) ? door : gameObject;
        }
    }
}


text:
<?php
require_once __DIR__ . '/../google_api/autoload.php';

 class Google_calendar{

     protected $_credentials = __DIR__.'/calendar-php-quickstart.json';

     protected $_client_secret = __DIR__.'/client_secret.json';

     protected $_client;

      protected $_service;

     public function __construct(){
         $this->_client = $this->getClient();
         $this->_service = new Google_Service_Calendar($this->_client);
     }

     protected function getClient() {
        $client = new Google_Client();
        $client->setApplicationName(GOOGLE_APPLICATION_NAME);
        $client->setScopes(implode(' ', array(
            Google_Service_Calendar::CALENDAR_READONLY)
          ));
        $client->setAuthConfig($this->_client_secret);
        $client->setAccessType('offline');

        // Load previously authorized credentials from a file.
        $credentialsPath = ($this->_credentials);

          $accessToken = json_decode(file_get_contents($credentialsPath), true);

        $client->setAccessToken($accessToken);

        // Refresh the token if it's expired.
        if ($client->isAccessTokenExpired()) {
          $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());
          file_put_contents($credentialsPath, json_encode($client->getAccessToken()));
        }
        return $client;
      }

      public function get_events($from,$to=''){

          $optParams = array(
            'maxResults' => 100,
            'timeMin' => $from,
            'orderBy' => 'startTime',
            'singleEvents' => TRUE,

          );
          if($to != ''){
              $optParams['timeMax'] = $to;
          }
          return $this->_service->events->listEvents(GOOGLE_CALENDAR_ID, $optParams);

      }

 }

redpajama_set_name: RedPajamaGithub


text:
from django.apps import AppConfig

class InsightsConfig(AppConfig):
    name = "insights"


text:
{-# LANGUAGE FlexibleInstances          #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NoImplicitPrelude          #-}
{-# LANGUAGE StandaloneDeriving         #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}

-- | 'Arbitrary' instances for types in 'cardano-sl-infra'

module Test.Pos.Infra.Arbitrary () where

import           Universum

import qualified Data.ByteString as BS
import           Network.Kademlia.HashNodeId (HashId (..))
import           Test.QuickCheck (Arbitrary (..), choose, oneof)
import           Test.QuickCheck.Arbitrary.Generic (genericArbitrary,
                     genericShrink)

import           Pos.Chain.Delegation (ProxySKHeavy)
import           Pos.Infra.Communication.Types.Protocol (HandlerSpec (..),
                     VerInfo (..))
import           Pos.Infra.Communication.Types.Relay (DataMsg (..), InvMsg (..),
                     MempoolMsg (..), ReqMsg (..))
import           Pos.Infra.DHT (DHTData (..), DHTKey (..))

import           Test.Pos.Chain.Delegation.Arbitrary ()
import           Test.Pos.Chain.Update.Arbitrary ()

deriving instance Arbitrary DHTData

instance Arbitrary DHTKey where
    arbitrary = DHTKey . HashId . BS.pack <$> arbitrary

instance (Arbitrary key) => Arbitrary (ReqMsg key) where
    arbitrary = ReqMsg <$> arbitrary

instance Arbitrary (MempoolMsg tag) where
    arbitrary = pure MempoolMsg

instance (Arbitrary key) => Arbitrary (InvMsg key) where
    arbitrary = InvMsg <$> arbitrary

instance Arbitrary HandlerSpec where
    arbitrary = oneof
        [ ConvHandler <$> arbitrary
        , UnknownHandler <$> choose (128, 255) <*> arbitrary
        ]

instance Arbitrary VerInfo where
    arbitrary = genericArbitrary
    shrink = genericShrink

instance Arbitrary (DataMsg ProxySKHeavy) where
    arbitrary = genericArbitrary
    shrink = genericShrink


text:
Events

{{ $ctrl.event.name }}

Access

 {{$ctrl.event.name}} Access

Add a new member to {{$ctrl.event.name}}

          <input type="text" ng-model="$ctrl.nonMember.selected" placeholder="Search for a user"
            uib-typeahead="user as user.displayName for user in $ctrl.searchNonMembers($viewValue)"
            typeahead-min-length="0" class="form-control" ng-model-options="{ debounce: 1000 }">

          <ui-select ng-model="$ctrl.nonMember.role" theme="bootstrap">
            <ui-select-match placeholder="Select a role to give to user">{{$select.selected.title}}</ui-select-match>
            <ui-select-choices repeat="role in $ctrl.roles">

            </ui-select-choices>
          </ui-select>

          <button class="btn btn-success" ng-click="$ctrl.addMember()"
            ng-disabled="($ctrl.nonMember.selected == null || !$ctrl.nonMember.selected.id)">  Add member to event</button>

            Existing Members {{$ctrl.count()}}

          <form class="navbar-form navbar-left">

              <input type="text" class="form-control" placeholder="Search" ng-model="$ctrl.memberSearch"
              ng-model-options="{ debounce: 1000 }" ng-change="$ctrl.search()">

          </form>

                  <user-avatar [user]="member" avatar-width="40" avatar-height="40"></user-avatar>

                {{member.displayName}}
                {{member.email}}

              <div ng-if="member.role.selected.name === 'OWNER' || $ctrl.owners.length <= 1">
                <div ng-if="$ctrl.owners.length <= 1 && member.role.selected.name === 'OWNER'">
                  Owner

 1">

                  <ui-select ng-model="member.role.selected" theme="bootstrap"
                    on-select="$ctrl.updateRole(member, $model)">
                    <ui-select-match placeholder="Select a role to give to user">{{$select.selected.title}}
                    </ui-select-match>
                    <ui-select-choices repeat="role in $ctrl.roles">

                    </ui-select-choices>
                  </ui-select>

                  <button class="btn btn-danger" ng-click="$ctrl.removeMember(member)"></button>


text:
import sys
import time
import ftplib
from pysmi.reader.base import AbstractReader
from pysmi.mibinfo import MibInfo
from pysmi.compat import decode
from pysmi import error
from pysmi import debug

class FtpReader(AbstractReader):
    """Fetch ASN.1 MIB text by name from FTP server.
       *FtpReader* class instance tries to download ASN.1 MIB files
       by name and return their contents to caller.
    """
    def __init__(self, host, locationTemplate, timeout=5, ssl=False, port=21,
                 user='anonymous', password='anonymous@'):
        """Create an instance of *FtpReader* bound to specific FTP server
           directory.

           Args:
               host (str): domain name or IP address of web server
               locationTemplate (str): location part of the directory containing @mib@ magic placeholder to be replaced with MIB name fetch.
           Keyword Args:
               timeout (int): response timeout
               ssl (bool): access HTTPS web site
               port (int): TCP port web server is listening
               user (str): username at FTP server
               password (str): password for *username* at FTP server
        """
        self._host = host
        self._locationTemplate = locationTemplate
        self._timeout = timeout
        self._ssl = ssl
        self._port = port
        self._user = user
        self._password = password
        if '@mib@' not in locationTemplate:
            raise error.PySmiError('@mib@ placeholder not specified in location at %s' % self)

    def __str__(self):
        return '%s{"ftp://%s%s"}' % (self.__class__.__name__, self._host, self._locationTemplate)

    def getData(self, mibname):
        if self._ssl:
            conn = ftplib.FTP_TLS()
        else:
            conn = ftplib.FTP()

        try:
            conn.connect(self._host, self._port, self._timeout)
        except ftplib.all_errors:
            raise error.PySmiReaderFileNotFoundError('failed to connect to FTP server %s:%s: %s' % (self._host, self._port, sys.exc_info()[1]), reader=self)

        try:
            conn.login(self._user, self._password)
        except ftplib.all_errors:
            conn.close()
            raise error.PySmiReaderFileNotFoundError('failed to log in to FTP server %s:%s as %s/%s: %s' % (self._host, self._port, self._user, self._password, sys.exc_info()[1]), reader=self)

        mibname = decode(mibname)

        debug.logger & debug.flagReader and debug.logger('looking for MIB %s' % mibname)

        for mibalias, mibfile in self.getMibVariants(mibname):
            location = self._locationTemplate.replace('@mib@', mibfile)
            mtime = time.time()
            debug.logger & debug.flagReader and debug.logger('trying to fetch MIB %s from %s:%s' % (location, self._host, self._port))
            data = []
            try:
                try:
                    response = conn.sendcmd('MDTM %s' % location)
                except ftplib.all_errors:
                    debug.logger & debug.flagReader and debug.logger('server %s:%s does not support MDTM command, fetching file %s' % (self._host, self._port, location))
                else:
                    debug.logger & debug.flagReader and debug.logger('server %s:%s MDTM response is %s' % (self._host, self._port, response))
                    if response[:3] == 213:
                        mtime = time.mktime(time.strptime(response[4:], "%Y%m%d%H%M%S"))
                debug.logger & debug.flagReader and debug.logger('fetching source MIB %s, mtime %s' % (location, time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime(mtime))))
                conn.retrlines('RETR %s' % location, lambda x, y=data: y.append(x))
            except ftplib.all_errors:
                debug.logger & debug.flagReader and debug.logger('failed to fetch MIB %s from %s:%s: %s' % (location, self._host, self._port, sys.exc_info()[1]))
                continue

            data = decode('\n'.join(data))

            debug.logger & debug.flagReader and debug.logger('fetched %s bytes in %s' % (len(data), location))

            conn.close()
            return MibInfo(path='ftp://%s%s' % (self._host, location), file=mibfile, name=mibalias, mtime=mtime), data

        conn.close()

        raise error.PySmiReaderFileNotFoundError('source MIB %s not found' % mibname, reader=self)


text:
<?xml version="1.0"?>
<project name="properties-test">

  <target name="test">

  	<!-- Check basic pom component properties -->
    <echo message="project.artifactId : ${project.artifactId}"/>
    <fail unless="project.artifactId" message="Property not set \${project.artifactId}"/>

  	<!-- Properties defined in the pom <properties> -->
    <echo message="testProp1 : ${testProp1}"/>
    <fail unless="testProp1" message="Property not set \${testProp1}"/>

  	<!-- Properties defined in an active profile -->
  	<echo message="profileProp : ${profileProp}"/>
  	<fail unless="profileProp" message="Profile property not set \${profileProp}"/>

  	<!-- System properties -->
    <echo message="line.separator : ${line.separator}"/>
    <fail unless="line.separator" message="Property not set \${line.separator}"/>

  	<!-- Dependency artifact properties -->
    <echo message="junit:junit:jar : ${junit:junit:jar}"/>
    <fail unless="junit:junit:jar" message="Property not set \${junit:junit:jar}"/>
    <echo message="maven.dependency.junit.junit.jar.path : ${maven.dependency.junit.junit.jar.path}"/>
    <fail unless="maven.dependency.junit.junit.jar.path" message="Property not set \${maven.dependency.junit.junit.jar.path}"/>

  	<!-- Check that the build output dir is pointing to the correct location -->
    <property name="outputDir" location="./target/classes"/>
    <echo message="outputDir: ${outputDir}"/>
    <property name="outputDirProp" location="${project.build.outputDirectory}"/>
    <echo message="outputDirProp: ${outputDirProp}"/>
    <fail message="Incorrect output dir property">
      <condition>
        <not>
          <equals arg1="${outputDir}" arg2="${outputDirProp}"/>
        </not>
      </condition>
    </fail>

  	<!-- Check that the non-default test output dir is pointing to the correct location -->
    <property name="testOutputDir" location="./target/test-stuff"/>
    <echo message="testOutputDir ${testOutputDir}"/>
    <property name="testOutputDirProp" location="${project.build.testOutputDirectory}"/>
    <echo message="testOutputDirProp: ${testOutputDirProp}"/>
    <fail message="Incorrect test output dir prop">
      <condition>
        <not>
          <equals arg1="${testOutputDir}" arg2="${testOutputDirProp}"/>
        </not>
      </condition>
    </fail>

  </target>

</project>


text:
page_type: sample
languages:
- cpp
products:
- windows
- windows-uwp
name: Direct3D 12 bundles sample
urlFragment: d3d12-bundles-sample-uwp
description: Demonstrates the use of Direct3D 12 bundles.
extendedZipContent:
- path: LICENSE
  target: LICENSE
---

# Direct3D 12 bundles sample

![Bundles GUI](src/D3D12Bundles.png)

This sample demonstrates the use of Direct3D 12 bundles. An app can use bundles to group a small number of API commands together for execution later. When a bundle is created, the driver will perform as much pre-processing as possible to make it inexpensive to execute the bundle later. Part of this pre-processing means that there are certain restrictions on what operations can be performed within a bundle.

## Optional features

This sample has been updated to build against the Windows 10 Anniversary Update SDK. In this SDK a new revision of Root Signatures is available for Direct3D 12 apps to use. Root Signature 1.1 allows for apps to declare when descriptors in a descriptor heap won't change or the data descriptors point to won't change.  This allows the option for drivers to make optimizations that might be possible knowing that something (like a descriptor or the memory it points to) is static for some period of time.


text:
<?php

// no direct access
defined('_JEXEC') or die ;

if (version_compare(JVERSION, '1.6.0', '<'))
{
    jimport('joomla.installer.installer');

    // Load K2 language file
    $language = JFactory::getLanguage();
    $language->load('com_k2');
    $db = JFactory::getDBO();
    $status = new stdClass;
    $status->modules = array();
    $status->plugins = array();
    $src = $this->parent->getPath('source');
    $isUpdate = JFile::exists(JPATH_SITE.DS.'modules'.DS.'mod_k2_content'.DS.'mod_k2_content.php');

    $modules = $this->manifest->getElementByPath('modules');
    if (is_a($modules, 'JSimpleXMLElement') && count($modules->children()))
    {
        foreach ($modules->children() as $module)
        {
            $mname = $module->attributes('module');
            $client = $module->attributes('client');
            if (is_null($client))
            {
                $client = 'site';
            }
            $path = $client == 'administrator' ? $src.DS.'administrator'.DS.'modules'.DS.$mname : $src.DS.'modules'.DS.$mname;
            $installer = new JInstaller;
            $result = $installer->install($path);
            $status->modules[] = array('name' => $mname, 'client' => $client, 'result' => $result);
        }

        if (!$isUpdate)
        {
            $query = "UPDATE #__modules SET position='icon', ordering=99, published=1 WHERE module='mod_k2_quickicons'";
            $db->setQuery($query);
            $db->query();

            $query = "UPDATE #__modules SET position='cpanel', ordering=0, published=1 WHERE module='mod_k2_stats'";
            $db->setQuery($query);
            $db->query();
        }
    }

    $plugins = $this->manifest->getElementByPath('plugins');
    if (is_a($plugins, 'JSimpleXMLElement') && count($plugins->children()))
    {

        foreach ($plugins->children() as $plugin)
        {
            $pname = $plugin->attributes('plugin');
            $pgroup = $plugin->attributes('group');
            if ($pgroup == 'finder' || $pgroup == 'josetta_ext')
            {
                continue;
            }
            $path = $src.DS.'plugins'.DS.$pgroup;
            $installer = new JInstaller;
            $result = $installer->install($path);
            $query = "UPDATE #__plugins SET published=1 WHERE element=".$db->Quote($pname)." AND folder=".$db->Quote($pgroup);
            $db->setQuery($query);
            $db->query();
            $status->plugins[] = array('name' => $pname, 'group' => $pgroup, 'result' => $result);
        }
    }

    if (JFolder::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joomfish'.DS.'contentelements'))
    {

        $elements = $this->manifest->getElementByPath('joomfish');
        if (is_a($elements, 'JSimpleXMLElement') && count($elements->children()))
        {
            foreach ($elements->children() as $element)
            {
                JFile::copy($src.DS.'administrator'.DS.'components'.DS.'com_joomfish'.DS.'contentelements'.DS.$element->data(), JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joomfish'.DS.'contentelements'.DS.$element->data());
            }
        }

    }
    else
    {
        $mainframe = JFactory::getApplication();
        $mainframe->enqueueMessage(JText::_('K2_NOTICE_K2_CONTENT_ELEMENTS_FOR_JOOMFISH_WERE_NOT_COPIED_TO_THE_RELATED_FOLDER_BECAUSE_JOOMFISH_WAS_NOT_FOUND_ON_YOUR_SYSTEM'));
    }

    if (JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'admin.k2.php'))
    {
        JFile::delete(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'admin.k2.php');
    }

    if (JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'models'.DS.'cpanel.php'))
    {
        JFile::delete(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'models'.DS.'cpanel.php');
    }

    $db = JFactory::getDBO();
    $fields = $db->getTableFields('#__k2_categories');
    if (!array_key_exists('language', $fields['#__k2_categories']))
    {
        $query = "ALTER TABLE #__k2_categories ADD `language` CHAR(7) NOT NULL";
        $db->setQuery($query);
        $db->query();

        $query = "ALTER TABLE #__k2_categories ADD INDEX (`language`)";
        $db->setQuery($query);
        $db->query();
    }

    $fields = $db->getTableFields('#__k2_items');
    if (!array_key_exists('featured_ordering', $fields['#__k2_items']))
    {
        $query = "ALTER TABLE #__k2_items ADD `featured_ordering` INT(11) NOT NULL default '0' AFTER `featured`";
        $db->setQuery($query);
        $db->query();
    }
    if (!array_key_exists('language', $fields['#__k2_items']))
    {
        $query = "ALTER TABLE #__k2_items ADD `language` CHAR(7) NOT NULL";
        $db->setQuery($query);
        $db->query();

        $query = "ALTER TABLE #__k2_items ADD INDEX (`language`)";
        $db->setQuery($query);
        $db->query();
    }

    $query = "SELECT COUNT(*) FROM #__k2_user_groups";
    $db->setQuery($query);
    $num = $db->loadResult();

    if ($num == 0)
    {
        $query = "INSERT INTO #__k2_user_groups (`id`, `name`, `permissions`) VALUES('', 'Registered', 'frontEdit=0\nadd=0\neditOwn=0\neditAll=0\npublish=0\ncomment=1\ninheritance=0\ncategories=all\n\n')";
        $db->setQuery($query);
        $db->Query();

        $query = "INSERT INTO #__k2_user_groups (`id`, `name`, `permissions`) VALUES('', 'Site Owner', 'frontEdit=1\nadd=1\neditOwn=1\neditAll=1\npublish=1\ncomment=1\ninheritance=1\ncategories=all\n\n')";
        $db->setQuery($query);
        $db->Query();

    }

    if ($fields['#__k2_items']['video'] != 'text')
    {
        $query = "ALTER TABLE #__k2_items MODIFY `video` TEXT";
        $db->setQuery($query);
        $db->query();
    }

    if ($fields['#__k2_items']['introtext'] == 'text')
    {
        $query = "ALTER TABLE #__k2_items MODIFY `introtext` MEDIUMTEXT";
        $db->setQuery($query);
        $db->query();
    }

    if ($fields['#__k2_items']['fulltext'] == 'text')
    {
        $query = "ALTER TABLE #__k2_items MODIFY `fulltext` MEDIUMTEXT";
        $db->setQuery($query);
        $db->query();
    }

    $query = "SHOW INDEX FROM #__k2_items";
    $db->setQuery($query);
    $indexes = $db->loadObjectList();
    $indexExists = false;
    foreach ($indexes as $index)
    {
        if ($index->Key_name == 'search')
            $indexExists = true;
    }

    if (!$indexExists)
    {
        $query = "ALTER TABLE #__k2_items ADD FULLTEXT `search` (`title`,`introtext`,`fulltext`,`extra_fields_search`,`image_caption`,`image_credits`,`video_caption`,`video_credits`,`metadesc`,`metakey`)";
        $db->setQuery($query);
        $db->query();

        $query = "ALTER TABLE #__k2_items ADD FULLTEXT (`title`)";
        $db->setQuery($query);
        $db->query();
    }

    $query = "SHOW INDEX FROM #__k2_tags";
    $db->setQuery($query);
    $indexes = $db->loadObjectList();
    $indexExists = false;
    foreach ($indexes as $index)
    {
        if ($index->Key_name == 'name')
            $indexExists = true;
    }

    if (!$indexExists)
    {
        $query = "ALTER TABLE #__k2_tags ADD FULLTEXT (`name`)";
        $db->setQuery($query);
        $db->query();
    }

    $fields = $db->getTableFields('#__k2_users');
    if (!array_key_exists('ip', $fields['#__k2_users']))
    {
        $query = "ALTER TABLE `#__k2_users`
        ADD `ip` VARCHAR( 15 ) NOT NULL ,
        ADD `hostname` VARCHAR( 255 ) NOT NULL ,
        ADD `notes` TEXT NOT NULL";
        $db->setQuery($query);
        $db->query();
    }

    // Clean up empty entries in #__k2_users table caused by an issue in the K2 user plugin. Fix details: http://code.google.com/p/getk2/source/detail?r=1966
	$query = "DELETE FROM #__k2_users WHERE userID = 0";
	$db->setQuery($query);
	$db->query();

	// Fix media manager folder permissions
	set_time_limit(0);
	jimport('joomla.filesystem.folder');
	jimport('joomla.filesystem.path');
	$params = JComponentHelper::getParams('com_media');
    $root = $params->get('file_path', 'media');
	$mediaPath = JPATH_SITE.DS.JPath::clean($root);
	$folders = JFolder::folders($mediaPath, '.', true, true, array());
	foreach($folders as $folder)
	{
		@chmod($folder, 0755);
	}
	if(JFolder::exists($mediaPath.DS.'.tmb'))
	{
		@chmod($mediaPath.DS.'.tmb', 0755);
	}
	if(JFolder::exists($mediaPath.DS.'.quarantine'))
	{
		@chmod($mediaPath.DS.'.quarantine', 0755);
	}
}
?>
<?php if (version_compare(JVERSION, '1.6.0', '<')): ?>
<?php $rows = 0; ?>
<img src="<?php echo JURI::root(true); ?>/media/k2/assets/images/system/K2_Logo_126x48_24.png" alt="K2" align="right" />

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

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

			<?php echo 'K2 '.JText::_('K2_COMPONENT'); ?>
			<?php echo JText::_('K2_INSTALLED'); ?>

		<?php if (count($status->modules)): ?>

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

		<?php foreach ($status->modules as $module): ?>
		<tr class="row<?php echo(++$rows % 2); ?>">
			<?php echo $module['name']; ?>
			<?php echo ucfirst($module['client']); ?>
			<?php echo ($module['result'])?JText::_('K2_INSTALLED'):JText::_('K2_NOT_INSTALLED'); ?>

		<?php endforeach; ?>
		<?php endif; ?>
		<?php if (count($status->plugins)): ?>

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

		<?php foreach ($status->plugins as $plugin): ?>
		<tr class="row<?php echo(++$rows % 2); ?>">
			<?php echo ucfirst($plugin['name']); ?>
			<?php echo ucfirst($plugin['group']); ?>
			<?php echo ($plugin['result'])?JText::_('K2_INSTALLED'):JText::_('K2_NOT_INSTALLED'); ?>

		<?php endforeach; ?>
		<?php endif; ?>

<?php endif; ?>


text:
package com.speedment.runtime.core.internal.stream.builder;

import com.speedment.runtime.core.internal.stream.builder.action.longs.*;
import com.speedment.runtime.core.internal.stream.builder.pipeline.LongPipeline;
import com.speedment.runtime.core.internal.stream.builder.pipeline.PipelineImpl;
import com.speedment.runtime.core.internal.stream.builder.streamterminator.StreamTerminator;
import com.speedment.runtime.core.stream.java9.Java9LongStreamAdditions;
import java.util.*;
import static java.util.Objects.requireNonNull;
import java.util.function.*;
import java.util.stream.*;

/**
 *
 * @author pemi
 */
public final class LongStreamBuilder extends AbstractStreamBuilder<LongStreamBuilder, LongPipeline>
    implements LongStream, Java9LongStreamAdditions {

    LongStreamBuilder(final PipelineImpl<?> pipeline, final StreamTerminator streamTerminator, Set<BaseStream<?, ?>> streamSet) {
        super(pipeline, streamTerminator, streamSet);
        streamSet.add(this); // Add this new stream to the streamSet so it may be closed later
    }

    public LongStreamBuilder(final PipelineImpl<?> pipeline, final StreamTerminator streamTerminator) {
        this(pipeline, streamTerminator, newStreamSet());
    }

    @Override
    public LongStream filter(LongPredicate predicate) {
        requireNonNull(predicate);
        return append(new LongFilterAction(predicate));
    }

    @Override
    public LongStream map(LongUnaryOperator mapper) {
        requireNonNull(mapper);
        return append(new LongMapAction(mapper));
    }

    @Override
    public  Stream mapToObj(LongFunction<? extends U> mapper) {
        requireNonNull(mapper);
        assertNotLinkedOrConsumedAndSet();
        return new ReferenceStreamBuilder(pipeline, streamTerminator, streamSet).append(new LongMapToObjAction<>(mapper));
    }

    @Override
    public IntStream mapToInt(LongToIntFunction mapper) {
        requireNonNull(mapper);
        assertNotLinkedOrConsumedAndSet();
        return new IntStreamBuilder(pipeline, streamTerminator, streamSet).append(new LongMapToIntAction(mapper));
    }

    @Override
    public DoubleStream mapToDouble(LongToDoubleFunction mapper) {
        requireNonNull(mapper);
        assertNotLinkedOrConsumedAndSet();
        return new DoubleStreamBuilder(pipeline, streamTerminator, streamSet).append(new LongMapToDoubleAction(mapper));
    }

    @Override
    public LongStream flatMap(LongFunction<? extends LongStream> mapper) {
        requireNonNull(mapper);
        return append(new LongFlatMapAction(mapper));
    }

    @Override
    public LongStream distinct() {
        return append(new LongDistinctAction());
    }

    @Override
    public LongStream sorted() {
        return append(new LongSortedAction());
    }

    @Override
    public LongStream peek(LongConsumer action) {
        requireNonNull(action);
        return append(new LongPeekAction(action));
    }

    @Override
    public LongStream limit(long maxSize) {
        return append(new LongLimitAction(maxSize));
    }

    @Override
    public LongStream skip(long n) {
        return append(new LongSkipAction(n));
    }

    @Override
    public DoubleStream asDoubleStream() {
        assertNotLinkedOrConsumedAndSet();
        return new DoubleStreamBuilder(pipeline, streamTerminator, streamSet).append(new LongAsDoubleAction());
    }

    @Override
    public Stream<Long> boxed() {
        assertNotLinkedOrConsumedAndSet();
        return new ReferenceStreamBuilder<Long>(pipeline, streamTerminator, streamSet).append(new LongBoxedAction());
    }

        @Override
    public LongStream takeWhile(LongPredicate predicate) {
        return append(new LongTakeWhileAction(predicate));
    }

    @Override
    public LongStream dropWhile(LongPredicate predicate) {
        return append(new LongDropWhileAction(predicate));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public void forEach(LongConsumer action) {
        requireNonNull(action);
        assertNotLinkedOrConsumedAndSet();
        try {
            streamTerminator.forEach(pipeline(), action);
        } finally {
            close();
        }
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public void forEachOrdered(LongConsumer action) {
        requireNonNull(action);
        assertNotLinkedOrConsumedAndSet();
        try {
            streamTerminator.forEachOrdered(pipeline(), action);
        } finally {
            close();
        }
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public long[] toArray() {
        assertNotLinkedOrConsumedAndSet();
        try {
            return streamTerminator.toArray(pipeline());
        } finally {
            close();
        }
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public long reduce(long identity, LongBinaryOperator op) {
        requireNonNull(op);
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseLong(() -> streamTerminator.reduce(pipeline(), identity, op));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public OptionalLong reduce(LongBinaryOperator op) {
        requireNonNull(op);
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseReference(() -> streamTerminator.reduce(pipeline(), op));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public <R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R, R> combiner) {
        requireNonNull(supplier);
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseReference(() -> streamTerminator.collect(pipeline(), supplier, accumulator, combiner));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public long sum() {
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseLong(() -> streamTerminator.sum(pipeline()));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public OptionalLong min() {
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseReference(() -> streamTerminator.min(pipeline()));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public OptionalLong max() {
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseReference(() -> streamTerminator.max(pipeline()));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public long count() {
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseLong(() -> streamTerminator.count(pipeline()));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public OptionalDouble average() {
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseReference(() -> streamTerminator.average(pipeline()));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public LongSummaryStatistics summaryStatistics() {
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseReference(() -> streamTerminator.summaryStatistics(pipeline()));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public boolean anyMatch(LongPredicate predicate) {
        requireNonNull(predicate);
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseBoolean(() -> streamTerminator.anyMatch(pipeline(), predicate));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public boolean allMatch(LongPredicate predicate) {
        requireNonNull(predicate);
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseBoolean(() -> streamTerminator.allMatch(pipeline(), predicate));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public boolean noneMatch(LongPredicate predicate) {
        requireNonNull(predicate);
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseBoolean(() -> streamTerminator.noneMatch(pipeline(), predicate));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public OptionalLong findFirst() {
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseReference(() -> streamTerminator.findFirst(pipeline()));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline and
     * closes the stream automatically when a terminal operation is performed.
     *
     */
    @Override
    public OptionalLong findAny() {
        assertNotLinkedOrConsumedAndSet();
        return finallyCloseReference(() -> streamTerminator.findAny(pipeline()));
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline.
     *

     * If you call this method, you must ensure to call the stream's
     * {@link #close() } method or else resources may not be released properly.
     *
     */
    @Override
    public PrimitiveIterator.OfLong iterator() {
        assertNotLinkedOrConsumedAndSet();
        return streamTerminator.iterator(pipeline());
    }

    /**
     * {@inheritDoc}
     *
     *

     * N.B. This method may short-circuit operations in the Stream pipeline.
     *

     * If you call this method, you must ensure to call the stream's
     * {@link #close() } method or else resources may not be released properly.
     *
     */
    @Override
    public Spliterator.OfLong spliterator() {
        assertNotLinkedOrConsumedAndSet();
        return streamTerminator.spliterator(pipeline());
    }

}


text:
package com.bupt.poirot.pattern.factoryPattern;

/**
 * Created by hui.chen on 11/25/16.
 */
public class Tiger implements IAnimal {
    @Override
    public void speak() {
        System.out.println("Tiger says : Halum..Halum");
    }
}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE126_Buffer_Overread__wchar_t_declare_memmove_41.c
Label Definition File: CWE126_Buffer_Overread.stack.label.xml
Template File: sources-sink-41.tmpl.c
*/
/*
 * @description
 * CWE: 126 Buffer Over-read
 * BadSource:  Set data pointer to a small buffer
 * GoodSource: Set data pointer to a large buffer
 * Sink: memmove
 *    BadSink : Copy data to string using memmove
 * Flow Variant: 41 Data flow: data passed as an argument from one function to another in the same source file
 *
 * */

#include "std_testcase.h"

#include <wchar.h>

#ifndef OMITBAD

void CWE126_Buffer_Overread__wchar_t_declare_memmove_41_badSink(wchar_t * data)
{
    {
        wchar_t dest[100];
        wmemset(dest, L'C', 100-1);
        dest[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: using memmove with the length of the dest where data
         * could be smaller than dest causing buffer overread */
        memmove(dest, data, wcslen(dest)*sizeof(wchar_t));
        dest[100-1] = L'\0';
        printWLine(dest);
    }
}

void CWE126_Buffer_Overread__wchar_t_declare_memmove_41_bad()
{
    wchar_t * data;
    wchar_t dataBadBuffer[50];
    wchar_t dataGoodBuffer[100];
    wmemset(dataBadBuffer, L'A', 50-1); /* fill with 'A's */
    dataBadBuffer[50-1] = L'\0'; /* null terminate */
    wmemset(dataGoodBuffer, L'A', 100-1); /* fill with 'A's */
    dataGoodBuffer[100-1] = L'\0'; /* null terminate */
    /* FLAW: Set data pointer to a small buffer */
    data = dataBadBuffer;
    CWE126_Buffer_Overread__wchar_t_declare_memmove_41_badSink(data);
}

#endif /* OMITBAD */

#ifndef OMITGOOD

void CWE126_Buffer_Overread__wchar_t_declare_memmove_41_goodG2BSink(wchar_t * data)
{
    {
        wchar_t dest[100];
        wmemset(dest, L'C', 100-1);
        dest[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: using memmove with the length of the dest where data
         * could be smaller than dest causing buffer overread */
        memmove(dest, data, wcslen(dest)*sizeof(wchar_t));
        dest[100-1] = L'\0';
        printWLine(dest);
    }
}

/* goodG2B uses the GoodSource with the BadSink */
static void goodG2B()
{
    wchar_t * data;
    wchar_t dataBadBuffer[50];
    wchar_t dataGoodBuffer[100];
    wmemset(dataBadBuffer, L'A', 50-1); /* fill with 'A's */
    dataBadBuffer[50-1] = L'\0'; /* null terminate */
    wmemset(dataGoodBuffer, L'A', 100-1); /* fill with 'A's */
    dataGoodBuffer[100-1] = L'\0'; /* null terminate */
    /* FIX: Set data pointer to a large buffer */
    data = dataGoodBuffer;
    CWE126_Buffer_Overread__wchar_t_declare_memmove_41_goodG2BSink(data);
}

void CWE126_Buffer_Overread__wchar_t_declare_memmove_41_good()
{
    goodG2B();
}

#endif /* OMITGOOD */

/* Below is the main(). It is only used when building this testcase on
 * its own for testing or for building a binary to use in testing binary
 * analysis tools. It is not used when compiling all the testcases as one
 * application, which is how source code analysis tools are tested.
 */

#ifdef INCLUDEMAIN

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    CWE126_Buffer_Overread__wchar_t_declare_memmove_41_good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    CWE126_Buffer_Overread__wchar_t_declare_memmove_41_bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text:
layout: page
title: Cabrera 25th Anniversary
date: 2016-05-24
author: Jason Lara
tags: weekly links, java
status: published
summary: Ut in metus id eros commodo.
banner: images/banner/wedding.jpg
booking:
  startDate: 07/29/2019
  endDate: 08/02/2019
  ctyhocn: PITGNHX
  groupCode: C2A
published: true
---
Curabitur massa orci, efficitur ut pellentesque auctor, vestibulum sed dui. Pellentesque et tincidunt ante. Donec sagittis libero nisi, a interdum justo ornare a. Nulla posuere lacus eu erat imperdiet accumsan. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed consectetur placerat lacus. Suspendisse nec nisl ex. Proin et tellus scelerisque, rhoncus lorem in, placerat elit. Proin id ullamcorper ipsum, ac dapibus ex. Nullam a egestas metus. Praesent nulla magna, sollicitudin at fringilla nec, molestie vitae arcu. Vivamus scelerisque mauris vel tempor viverra. Aliquam erat volutpat. Cras eu convallis odio.
Nulla pharetra odio nec lacus aliquet, eget lacinia augue consectetur. Suspendisse lacinia leo vel ante ultrices accumsan. Quisque odio justo, fermentum in ex vel, mattis mattis dui. Sed quis suscipit sem. Donec consectetur blandit consectetur. Praesent eu odio sapien. Proin tristique pharetra arcu, quis facilisis lectus aliquam eu. Aliquam consequat gravida odio, ac convallis elit rhoncus in. Maecenas condimentum sollicitudin suscipit. Integer euismod leo ex, scelerisque sodales urna viverra quis.

* Sed id purus rutrum, condimentum mauris at, tempus lacus
* Quisque maximus eros nec sem tempor, eu blandit ligula consequat
* Suspendisse dapibus purus at quam luctus, eu facilisis eros fringilla
* Nam eu risus non est bibendum condimentum non et quam
* Donec ornare mi eget libero pretium, eleifend fringilla dui fermentum.

Donec sit amet lacinia turpis, sed rutrum arcu. Nunc eu scelerisque purus. Quisque eget libero eget justo auctor viverra. Aliquam ac dictum libero, dictum ultricies lectus. Nunc ornare turpis sed eros viverra sagittis. Integer eros diam, hendrerit non semper eu, ullamcorper et dui. In sagittis vel dolor quis sollicitudin. Morbi nec felis hendrerit, vestibulum nunc ac, feugiat nisl.


text:
clean:
	docker rmi -f web-api || true

build: clean
	docker build -t web-api --no-cache .

stop:
	docker stop web-api

start:
	docker run -p 127.0.0.1:5000:80 --name web-api -t web-api:latest


text:
import {async, ComponentFixture, TestBed} from '@angular/core/testing';

import {SigninComponent} from './signin.component';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {MatInputModule, MAT_DIALOG_DATA, MatDialogRef} from '@angular/material';
import {MatDialogModule} from '@angular/material';
import {ServerInteractService} from '../../common/serverInteract.service';
import {Observable} from 'rxjs/Observable';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {By} from '@angular/platform-browser';

class ServerInteractServiceStub {
    response = new Observable<Response>();

  postSignin() {
        return this.response;
    }

}

describe('lverg:SigninComponent', () => {
    let component: SigninComponent;
    let fixture: ComponentFixture<SigninComponent>;

    beforeEach(async(() => {
        TestBed.configureTestingModule({
            imports: [FormsModule,
                MatInputModule,
                MatDialogModule,
                ReactiveFormsModule,
                BrowserAnimationsModule],
            declarations: [SigninComponent],
            providers: [
                {provide: MAT_DIALOG_DATA, useValue: {}},
                {provide: MatDialogRef, useValue: {}},
                {provide: ServerInteractService, useClass: ServerInteractServiceStub}
            ]
        })
            .compileComponents();
    }));

    beforeEach(() => {
        fixture = TestBed.createComponent(SigninComponent);
        component = fixture.componentInstance;
        fixture.detectChanges();
    });

    it('should create', () => {
        expect(component).toBeTruthy();
    });

    it('should be valid if username and password are properly filled.', () => {

        component.signinForm.setValue({
            'username': 'theusername',
            'password': 'thepassword'
        });

        expect(component.signinForm.valid).toBe(true);
    });

    it('should be invalid if username is not filled', () => {

        component.signinForm.patchValue({
            'password': 'thepassword'
        });

        expect(component.signinForm.valid).toBe(false);
    });

    it('should be invalid if password is not filled', () => {

        component.signinForm.patchValue({
            'username': 'theusername',
        });

        expect(component.signinForm.valid).toBe(false);
    });

});


text:
VERSION=$(shell python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['version'])")

default:
	@echo "\"make publish\"?"

tag:
	# Make sure we're on the master branch
	@if [ "$(shell git rev-parse --abbrev-ref HEAD)" != "master" ]; then exit 1; fi
	curl -H "Authorization: token `cat $(HOME)/.github-access-token`" -d '{"tag_name": "v$(VERSION)"}' https://api.github.com/repos/nschloe/tikzplotlib/releases

upload: clean
	@if [ "$(shell git rev-parse --abbrev-ref HEAD)" != "master" ]; then exit 1; fi
	# https://stackoverflow.com/a/58756491/353337
	python3 -m pep517.build --source --binary .
	twine upload dist/*

publish: tag upload

clean:
	@find . | grep -E "(__pycache__|\.pyc|\.pyo$\)" | xargs rm -rf
	@rm -rf *.egg-info/ build/ dist/ MANIFEST

format:
	isort .
	black .

lint:
	black --check .
	flake8 .


text:
using EDDiscovery2.HTTP;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;

namespace EDDiscovery2.PlanetSystems.Repositories
{
    // Note: A WorldSurvey is now a "view" of the sum of surveys for a given world. So
    // It's read only. It can be used for creating quick reports on a planet's status or
    // in search features where you juts want to know which Worlds have jumponium ingredients.
    public class WorldSurvey : EdMaterializer
    {
        // Use this to get the WorldSurvey given a world-survey id.
        // Easy to get to from a World object using the world-id attribute.
        public EDWorldSurvey GetForId(int id)
        {
            if (id > 0)
            {
                var request = RequestGet($"{ApiNamespace}/world-surveys/{id}");
                if (request.StatusCode == HttpStatusCode.OK)
                {
                    var jo = JObject.Parse(request.Body);
                    var data = jo["data"];
                    EDWorldSurvey obj = new EDWorldSurvey();

                    return (obj.ParseJson((JObject)data)) ? obj : null;
                }
            }

            return null;
        }

        public EDWorldSurvey GetFirst(string scope)
        {
            var items = GetAll(scope);
            return (items.Count > 0) ? items[0] : null;
        }

        public List<EDWorldSurvey> GetAll(string scope)
        {
            List<EDWorldSurvey> listObjects = new List<EDWorldSurvey>();
            string query = ApiNamespace + "/world-surveys";

            if (!String.IsNullOrEmpty(scope))
                query = query + "?" + scope;

            var response = RequestGet(query);
            var json = response.Body;

            JArray jArray = null;
            JObject jObject = null;
            if (json != null && json.Length > 5)
                jObject = (JObject)JObject.Parse(json);

            if (jObject == null)
                return listObjects;

            jArray = (JArray)jObject["data"];

            foreach (JObject jo in jArray)
            {
                EDWorldSurvey obj = new EDWorldSurvey();

                if (obj.ParseJson((JObject)jo))
                    listObjects.Add(obj);
            }

            return listObjects;
        }
    }
}


text:
This is a bare bones HTML/CSS framework. This is what I'll typically start off most web projects with.

It includes a CSS reset and a bunch of minimal styles that should come in useful for any project, including a responsive grid, typography, buttons, icons and forms.

It can be used for a static web project as is, or you can copy the CSS folder into an existing framework (e.g. Rails).

## Features
* Uses SCSS partials to help structure the CSS.
* Responsive-ready 12-column grid system to work across all devices.
* Uses Font Awesome icon fonts for icons.
* Uses Normalize to reset browser styles.
* Only enough CSS to get you started; minimal visual styling with this boilerplate.
* Only the HTML/JS you need to get started; very little components with this boilerplate.

### Install Node.js and use Grunt
I'm using [Grunt](http://gruntjs.com/) to compile the SCSS to CSS.

You will need [Node.js](https://nodejs.org/download/).

Open up terminal (or command line) and run the default Grunt task.
```
$ npm install
$ grunt
```

Grunt will watch for any changes you make to your SCSS files and compile your new `main.css` file.

## HTML
A bare bones index.html template.

## CSS
* `lib/normalize` This is Normalize, a CSS reset.
* `lib/icons` This is Font Awesome's CSS stylesheet. Plug and play icons.
* `base/config` Put all your variables in here e.g. colors, padding, border radius - this helps with consistency across your project.
* `base/grid` A basic responsive grid system with 12 columns.
* `base/ie` Any styles that you need to add in order for Internet Explorer to work.
* `base/mixins` Reusabled Sass mixins e.g. clearfix.
* `base/print` Basic print stylesheets to make your pages look better when printed.
* `base/responsive` Add any global responsive styles here e.g. hide elements, show elements, resize elements.
* `base/shame` Keep this to hand for any quick and dirty CSS you need to add but plan to tidy later.
* `base/type` Basic styling for your typography.
* `components/alerts` Alerts to notify or give feedback to the user
* `components/buttons` Styles for any text links and/or buttons.
* `components/forms` Some basic form styles.
* `components/media` Styles for images, video etc.
* `components/nav` Inline navigation.
* `components/other` Other reusable styles that come in handy.
* `components/tables` Styles for tables.
* `pages/home` Styles that are specific to the homepage
* `pages/layout` Global layout styles e.g. header, footer, logo etc.
* `main.scss` This brings all the partials together. Compass only compiles files that don't have an underscore

As your project grows and you need to add more styles just create new .scss files and reference them anywhere in your main.scss file.

## JavaScript ##
* I've included some basic Javascript including the latest jQuery and the document ready function.

## Images ##
* There is a /img folder for images.
* For images referenced in the CSS I tend to keep them in the css/assets/ folder e.g. sp.png is a sprite I can reference.
* Images referenced in the HTML are stored in the /img folder.

## Retina Images ##
retina.js is prepended to scripts.js and will handle all of your inline retina image needs. You can learn more about it and how it works at http://retinajs.com/. There is also a mixin called retina-sprite that you can use to handle all of your retina images in CSS. Take a look at the mixin as you may have to change the path to the file as well as the background size to get it working.

## Fonts ##
* Included font awesome for icons

## Further Documentation ##
* Compass Framework
* SASS
* normalize.css
* Font Awesome

## Credits ##
* Motherplate


text:
package com.rho.eventsource;

import java.util.LinkedList;
import java.util.List;

import com.rhomobile.rhodes.api.IMethodResult;

class EventsourceSingleton extends EventsourceSingletonBase implements IEventsourceSingleton {
    public EventsourceSingleton(EventsourceFactory factory) {
        super(factory);
    }

    List<Object> getIDs() {
        List<Object> ids = new LinkedList<Object>();
        ids.add("SCN1");
        ids.add("SCN2");
        return ids;
    }

    @Override
    protected String getInitialDefaultID() {
        return (String)(getIDs().get(0));
    }

    @Override
    public void enumerate(IMethodResult res) {
        res.set(getIDs());
    }
}


text:
layout: contact
title: Contactez-nous
permalink: /contact/
lang: fr
---

Si vous souhaitez participer aux formations du club, voulez vous impliquer dans nos projets, ou que vous êtes simplement désireux d'en savoir plus sur nous et ce que nous faisons, n'hésitez pas à nous contacter !


text:
import React from 'react';

const Footer = () => (

          Code licensed under MIT © FrintJS Authors and Travix International.

);

export default Footer;


text:
import React, { Component } from 'react';
import Toggle from '../../components/toggle/Toggle';
import Flags from '../../components/flags/Flags';
import TweetEmbed from 'react-tweet-embed';

import './Tweet.css';

class Tweet extends Component {
  constructor(props) {
    super(props);

    this.state = {
      hidden: props.data.hidden
    };
  }

  handleHide(isHidden) {
    this.setState({
      hidden: isHidden
    });
  }

  getIDFromUrl(url){
    return url.substring(url.lastIndexOf('/') + 1);
  }

  render() {
    const data = this.props.data;

    const flags = () => {
        if (data.flagReasons.length > 0) {
          return <Flags reasons={data.flagReasons} />;
        }

        return null;
    };

    return (

            Tweet
            <TweetEmbed id={this.getIDFromUrl(data.url)} options={{cards: 'hidden', width:550}}/>

          <Toggle hidden={ this.state.hidden } uuid={ data.uuid } parentHide={this.handleHide.bind(this)} />

        { flags() }

    );
  }
}

export default Tweet;


text:
THE_BASE_DIR_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
source $THE_BASE_DIR_PATH/_init.sh

mkdir $THE_TMP_DIR_PATH -p

# package list (all)
THE_PACKAGE_LIST_FILE_PATH=$THE_TMP_DIR_PATH/$THE_PACKAGE_LIST_FILE_NAME

# remove package list (all)
rm $THE_PACKAGE_LIST_FILE_PATH -f

for APP_DIR_PATH in $THE_APP_DIR_PATH/* ; do
    # app/$package/etc/package.list
    EACH_PACKAGE_LIST_FILE_PATH=$APP_DIR_PATH/$THE_ETC_DIR_NAME/$THE_PACKAGE_LIST_FILE_NAME

    if [ -f $EACH_PACKAGE_LIST_FILE_PATH ]; then
        EACH_PACKAGE_LIST=$(cat $EACH_PACKAGE_LIST_FILE_PATH)
        echo $EACH_PACKAGE_LIST >> $THE_PACKAGE_LIST_FILE_PATH
    fi
done

sudo apt-get install $(cat $THE_PACKAGE_LIST_FILE_PATH) -y


text:
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { fetchData } from '../actions/index'
import ItemDetail from './itemDetail'

class JournalDetail extends Component {
  componentWillMount() {
    this.props.fetchData()
  }

  render() {
    if (!this.props.journal) return null

    return <ItemDetail data={ this.props.journal } slugPath="9" />
  }
}

const mapStateToProps = state => ({ journal: state.data.journal })

export default connect(mapStateToProps, { fetchData })(JournalDetail)


text:
  You are looking at the documentation of the development version.

Support Eve

If you use Eve please consider financial support:

Support Eve

Get Updates

Receive updates on new releases and upcoming projects.

Subscribe to Newsletter

Useful Links

Stack Overflow

Mailing List

Issue Tracker

GitHub

Blog

Demo

IRC

Feedback

  Feedback is greatly appreciated. If you have any questions, comments,
  random praise, or anonymous threats, get on the mailing list or
  shoot an email.

Powered By

Flask

SQLAlchemy

Cerberus

Events


text:
//-----------------------------------------------------------------------
// <copyright file="CustomerWithError.cs" company="Marimer LLC">
//     Copyright (c) Marimer LLC. All rights reserved.
//     Website: https://cslanet.com
// </copyright>
// <summary>no summary</summary>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Csla;
using Csla.Security;
using Csla.Core;
using Csla.Serialization;

namespace cslalighttest.CslaDataProvider
{
  [Serializable]
  public class CustomerWithError : BusinessBase<CustomerWithError>
  {
    const int CustomerWithErrorIDThrowsException = 99;

    private CustomerWithError() { }

    internal static CustomerWithError NewCustomerWithError()
    {
      var returnValue = new CustomerWithError();
      returnValue.Name = "New";
      return returnValue;
    }

    private static PropertyInfo<int> IdProperty = RegisterProperty<int>(c=>c.Id, "CustomerWithError Id", 0);
    public int Id
    {
      get
      {
        return GetProperty<int>(IdProperty);
      }
      set
      {
        SetProperty<int>(IdProperty, value);
      }
    }

    private static PropertyInfo<string> NameProperty = RegisterProperty<string>(c=>c.Name, "CustomerWithError Name", "");
    public string Name
    {
      get
      {
        return GetProperty<string>(NameProperty);
      }
      set
      {
        SetProperty<string>(NameProperty, value);
      }
    }

    private static PropertyInfo<string> MethodProperty = RegisterProperty<string>(c=>c.Method, "Method", "");
    public string Method
    {
      get
      {
        return GetProperty<string>(MethodProperty);
      }
      set
      {
        SetProperty<string>(MethodProperty, value);
      }
    }

    private static PropertyInfo<bool> ThrowExceptionProperty = RegisterProperty<bool>(c => c.ThrowException, "ThrowException", true);
    public bool ThrowException
    {
      get
      {
        return GetProperty<bool>(ThrowExceptionProperty);
      }
      set
      {
        LoadProperty<bool>(ThrowExceptionProperty, value);
      }
    }

    protected override void AddBusinessRules()
    {
      BusinessRules.AddRule(new Csla.Rules.CommonRules.MinValue<int>(IdProperty, 1));
    }

    [Serializable()]
    public class FetchCriteria : CriteriaBase<FetchCriteria>
    {
      public FetchCriteria() { }

      public FetchCriteria(int CustomerWithErrorID)
      {
        _CustomerWithErrorId = CustomerWithErrorID;
      }

      private int _CustomerWithErrorId;

      public int CustomerWithErrorID
      {
        get
        {
          return _CustomerWithErrorId;
        }
      }

      protected override void OnGetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
      {
        base.OnGetState(info, mode);
        info.AddValue("_CustomerWithErrorId", _CustomerWithErrorId);
      }
      protected override void OnSetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
      {
        base.OnSetState(info, mode);
        _CustomerWithErrorId = info.GetValue<int>("_CustomerWithErrorId");
      }
    }

    internal static CustomerWithError GetCustomerWithError(int CustomerWithErrorID)
    {
      CustomerWithError newCustomerWithError = new CustomerWithError();
      newCustomerWithError.DataPortal_Fetch(CustomerWithErrorID);
      newCustomerWithError.MarkAsChild();
      newCustomerWithError.MarkOld();
      return newCustomerWithError;
    }

    protected void DataPortal_Fetch(int criteria)
    {
      LoadProperty(IdProperty, criteria);
      LoadProperty(NameProperty, "CustomerWithError Name for Id: " + criteria.ToString());

      if (criteria == CustomerWithErrorIDThrowsException)
        throw new ApplicationException("Test for Silverlight DataSource Error!");
    }

    protected void DataPortal_Create(int criteria)
    {
      LoadProperty(IdProperty, criteria);
      LoadProperty(NameProperty, "New CustomerWithError for Id: " + criteria.ToString());
    }

    [DeleteSelf]
    protected void DataPortal_DeleteSelf()
    {
      Method = "Deleted CustomerWithError " + GetProperty<string>(NameProperty);
    }

    [Delete]
		protected void DataPortal_Delete(int criteria)
    {
      Method = "Deleted CustomerWithError ID " + criteria.ToString();
    }

    [Insert]
    protected void DataPortal_Insert()
    {
      Method = "Inserted CustomerWithError " + GetProperty<string>(NameProperty);
    }

    [Update]
		protected void DataPortal_Update()
    {
      Method = "Updating CustomerWithError " + GetProperty<string>(NameProperty);
    }
  }

  [Serializable]
  public class CustomerWithErrorWO_DP_XYZ : BusinessBase<CustomerWithErrorWO_DP_XYZ>
  {
  }

}


text:
<!doctype html>

    <meta charset="utf-8">
    <title>Page Not Found</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/main.css">

About

Formation

Projects

Perdu sur mon portfolio ?

Pas de panique, je vais vous aider

    * <----- vous êtes ici


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        wx/richtext/richtextbulletspage.h
// Purpose:
// Author:      Julian Smart
// Modified by:
// Created:     10/4/2006 10:32:31 AM
// Copyright:   (c) Julian Smart
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _RICHTEXTBULLETSPAGE_H_
#define _RICHTEXTBULLETSPAGE_H_

/*!
 * Includes
 */

#include "wx/richtext/richtextdialogpage.h"
#include "wx/spinbutt.h"        // for wxSpinEvent

/*!
 * Forward declarations
 */

////@begin forward declarations
class wxSpinCtrl;
class wxRichTextCtrl;
////@end forward declarations

/*!
 * Control identifiers
 */

////@begin control identifiers
#define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
#define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE wxEmptyString
#define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE
#define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300)
#define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition
////@end control identifiers

/*!
 * wxRichTextBulletsPage class declaration
 */

class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage: public wxRichTextDialogPage
{
    DECLARE_DYNAMIC_CLASS( wxRichTextBulletsPage )
    DECLARE_EVENT_TABLE()
    DECLARE_HELP_PROVISION()

public:
    /// Constructors
    wxRichTextBulletsPage( );
    wxRichTextBulletsPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE );

    /// Initialise members
    void Init();

    /// Creates the controls and sizers
    void CreateControls();

    /// Updates the bullets preview
    void UpdatePreview();

    /// Transfer data from/to window
    virtual bool TransferDataFromWindow();
    virtual bool TransferDataToWindow();

    /// Gets the attributes associated with the main formatting dialog
    wxRichTextAttr* GetAttributes();

    /// Update for symbol-related controls
    void OnSymbolUpdate( wxUpdateUIEvent& event );

    /// Update for number-related controls
    void OnNumberUpdate( wxUpdateUIEvent& event );

    /// Update for standard bullet-related controls
    void OnStandardBulletUpdate( wxUpdateUIEvent& event );

////@begin wxRichTextBulletsPage event handler declarations

    /// wxEVT_LISTBOX event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX
    void OnStylelistboxSelected( wxCommandEvent& event );

    /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
    void OnPeriodctrlClick( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL
    void OnPeriodctrlUpdate( wxUpdateUIEvent& event );

    /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
    void OnParenthesesctrlClick( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL
    void OnParenthesesctrlUpdate( wxUpdateUIEvent& event );

    /// wxEVT_CHECKBOX event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
    void OnRightParenthesisCtrlClick( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL
    void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event );

    /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL
    void OnBulletAlignmentCtrlSelected( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC
    void OnSymbolstaticUpdate( wxUpdateUIEvent& event );

    /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
    void OnSymbolctrlSelected( wxCommandEvent& event );

    /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
    void OnSymbolctrlUpdated( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL
    void OnSymbolctrlUpdate( wxUpdateUIEvent& event );

    /// wxEVT_BUTTON event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
    void OnChooseSymbolClick( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL
    void OnChooseSymbolUpdate( wxUpdateUIEvent& event );

    /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
    void OnSymbolfontctrlSelected( wxCommandEvent& event );

    /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
    void OnSymbolfontctrlUpdated( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL
    void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC
    void OnNamestaticUpdate( wxUpdateUIEvent& event );

    /// wxEVT_COMBOBOX event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
    void OnNamectrlSelected( wxCommandEvent& event );

    /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
    void OnNamectrlUpdated( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL
    void OnNamectrlUIUpdate( wxUpdateUIEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC
    void OnNumberstaticUpdate( wxUpdateUIEvent& event );

    /// wxEVT_SPINCTRL event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
    void OnNumberctrlUpdated( wxSpinEvent& event );

    /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
    void OnNumberctrlUp( wxSpinEvent& event );

    /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
    void OnNumberctrlDown( wxSpinEvent& event );

    /// wxEVT_TEXT event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
    void OnNumberctrlTextUpdated( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL
    void OnNumberctrlUpdate( wxUpdateUIEvent& event );

////@end wxRichTextBulletsPage event handler declarations

////@begin wxRichTextBulletsPage member function declarations

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end wxRichTextBulletsPage member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin wxRichTextBulletsPage member variables
    wxListBox* m_styleListBox;
    wxCheckBox* m_periodCtrl;
    wxCheckBox* m_parenthesesCtrl;
    wxCheckBox* m_rightParenthesisCtrl;
    wxComboBox* m_bulletAlignmentCtrl;
    wxComboBox* m_symbolCtrl;
    wxComboBox* m_symbolFontCtrl;
    wxComboBox* m_bulletNameCtrl;
    wxSpinCtrl* m_numberCtrl;
    wxRichTextCtrl* m_previewCtrl;
    /// Control identifiers
    enum {
        ID_RICHTEXTBULLETSPAGE = 10300,
        ID_RICHTEXTBULLETSPAGE_STYLELISTBOX = 10305,
        ID_RICHTEXTBULLETSPAGE_PERIODCTRL = 10313,
        ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL = 10311,
        ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL = 10306,
        ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL = 10315,
        ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC = 10301,
        ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL = 10307,
        ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL = 10308,
        ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL = 10309,
        ID_RICHTEXTBULLETSPAGE_NAMESTATIC = 10303,
        ID_RICHTEXTBULLETSPAGE_NAMECTRL = 10304,
        ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC = 10302,
        ID_RICHTEXTBULLETSPAGE_NUMBERCTRL = 10310,
        ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL = 10314
    };
////@end wxRichTextBulletsPage member variables

    bool m_hasBulletStyle;
    bool m_hasBulletNumber;
    bool m_hasBulletSymbol;
    bool m_dontUpdate;
};

#endif
    // _RICHTEXTBULLETSPAGE_H_


text:
class TransitQueryFiltersController < QueryFiltersController
  def vehicle_rebuild_types
    asset_events = AssetEvent.where(id: AssetEvent.where(asset_event_type: AssetEventType.find_by(class_name: 'RehabilitationUpdateEvent')).group(:base_transam_asset_id).pluck(Arel.sql("max(asset_events.id)")))
    lookup_table_data = VehicleRebuildType.all.pluck(:id, :name).map{|d| {id: d[0], name: d[1]}}

    idx = 0 # indicate other
    others = asset_events.where.not(other_vehicle_rebuild_type: [nil, ""]).pluck(:other_vehicle_rebuild_type).uniq.map{|name|
      idx -= 1
      {id: idx, name: name}
    }

    render json: (lookup_table_data + others)
  end
end


text:
<?php
	/**
	 * View/Request Bus Driver's Availability page for RSA
	 *
	 * @author     Tiandre Turner
	 * @author     Kristen Merritt
	 * @version    Release: 1.0
	 * @date       11/28/17
	 */

	$page='RAIHN View/Request Availability Dates';
	$path_to_root="./../";
	session_start();

	// Setting up template system and loads functions for Admin
	require_once($path_to_root.'../BUS/GeneralTemplate.class.php');
	require_once($path_to_root.'../BUS/admin/AdminFunctions.class.php');

	$generalTemplate = new GeneralTemplate($page, $path_to_root);
	$adminFunctions = new AdminFunctions($page, $path_to_root);

	// Inserting header and navigation onto page via template system
	echo $generalTemplate->insertHeader();
	echo '<link href="'.$path_to_root.'css/admin.css" rel="stylesheet">';
	echo '<link href="'.$path_to_root.'css/profile.css" rel="stylesheet">';
	// Gets Bus Driver ID
	$busDriverUser = $adminFunctions->getBusDriveryByContactID($_SESSION['id'])[0];
	$busID = $busDriverUser->getID();

?>

		Profile > View/Request Availability Dates

<?php echo $_SESSION['fullname']; ?>

			<button>Change Password</button>

			<button>View Schedule</button>

			<button>Request Schedule Change</button>

			<form id="edit-cong-form" align="middle">

Availability Dates

					<input id="date-input" class="text" type="date" name="from-date-input" value="">
					<select id='time_of_day' name='time_of_day'>
						<option value='-1'>Select a time of day</option>
						<option value='1'>Any</option>
						<option value='2'>Morning</option>
						<option value='3'>Afternoon</option>
					</select>
					<input id="dateArrowButton" class="availability" type="button" value=">" >
					<textarea id="dateValues" class="heighttext">
						<?php
							echo $adminFunctions->insertAvailablityIntoEditDriver($busID);
						?>
					</textarea>

				<input type="hidden" id="busDriverUID" name="busDriverUID" value="<?php echo $busID; ?>" />
				<input class="editright" id="updateAvailability" type="submit" value="Save">
			</form>

<?php
	echo $generalTemplate->insertFooter();
?>


text:
[![Build Status](https://travis-ci.org/AntonMykolaienko/xml2json.svg?branch=master)](https://travis-ci.org/AntonMykolaienko/xml2json) [![Download Xml2Json Converter](https://img.shields.io/sourceforge/dm/xml2json-converter.svg)](https://sourceforge.net/projects/xml2json-converter/files/latest/download)
[![Quality Gate](https://sonarcloud.io/api/badges/gate?key=com.fs:xml2json-parent)](https://sonarcloud.io/dashboard?id=com.fs%3Axml2json-parent)

Simple UI and Command line tool for converting large XML-files to JSON or JSON to XML, written on Java.

### Getting started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Requirements
To build application from sources you will need following parts:
- Oracle JDK 1.8u40 (or just JRE to run binary application) or newer ([Download](http://www.oracle.com/technetwork/java/javase/downloads/index.html))
- Git ([Download](https://git-scm.com/downloads))
- Maven 3.x ([Download](https://maven.apache.org/download.cgi))

### Build from sources
- Clone the repo: `git clone https://github.com/AntonMykolaienko/xml2json.git`
- Build: `mvn clean install`
- Binary application (dmg, rpm or exe) can be found at `xml2json\target\os\distribution\xml2json`

### Binary packages
You can download binaries for desired platform at SourceForge ([Download](https://sourceforge.net/projects/xml2json-converter/))

### Startup options
Application have UI written on JavaFX. Starting from 1.2.0 version Xml2Json converter supports conversion via command line in batch.
Tool supports following command line parameters:
- noGui - to indicate processing without GUI (Example: `--noGui`)
- sourceFolder - path to folder where source files placed (Example: `--sourceFolder=C:\Temp\Input`)
- destinationFolder - path to folder where converted files will be placed (Example: `--destinationFolder=C:\Temp\Output`)
- overwrite - to force overwrite converted files. Default: application will ask confirmation. (Example: `--overwrite`)

Examples:
1. Convert list of JSON-files:
	```
	java -jar xml2json-1.3.0-all.jar --noGui --sourceFolder=C:\Temp\Input \
	--destinationFolder=C:\Temp\Output --pattern=*.json
	```
2. Convert list of XML-files:
	```
	java -jar xml2json-1.3.0-all.jar --noGui --sourceFolder=C:\Temp\Input \
	--destinationFolder=C:\Temp\Output --pattern=*.xml
	```
3. Convert only one file :
	```
	java -jar xml2json-1.3.0-all.jar --noGui --sourceFolder=C:\Temp\Input \
	--destinationFolder=C:\Temp\Output --pattern=someFile.xml
	```

To start Tool with GUI just run following command:
```
java -jar xml2json-1.3.0-all.jar
```

<br>Note: When you are starting tool in command line mode it will use all free memory which you have in your system, but if you need limit memory usage then you will need to add `-Xmx=512M` to your start command right after 'java':
```
java -Xmx=512M -jar xml2json-1.3.0-all.jar --noGui --sourceFolder=C:\Temp\Input \
--destinationFolder=C:\Temp\Output --pattern=someFile.xml
```

### Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on code of conduct, and the process for submitting pull requests.

### Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/AntonMykolaienko/xml2json/tags).

### License
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.

### Screenshots
![Start Window](etc/img/1.StartWindow.jpg)
![Convert in Progress](etc/img/2.ConvertInProgress.jpg)

### Donation
You can make donation via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=33R3LMBMX3R96)