text:
import util.HTMLFilter;

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ResourceBundle;

/**
 * Example servlet showing request headers
 *
 * @author James Duncan Davidson <duncan@eng.sun.com>
 */

public class CookieExample extends HttpServlet {

    private static final long serialVersionUID = 1L;

    private static final ResourceBundle RB = ResourceBundle.getBundle("LocalStrings");

    @Override
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {

        String cookieName = request.getParameter("cookiename");
        String cookieValue = request.getParameter("cookievalue");
        Cookie aCookie = null;
        if (cookieName != null && cookieValue != null) {
            aCookie = new Cookie(cookieName, cookieValue);
            aCookie.setPath(request.getContextPath() + "/");
            response.addCookie(aCookie);
        }

        response.setContentType("text/html");

        PrintWriter out = response.getWriter();
        out.println("");
        out.println("");

        String title = RB.getString("cookies.title");
        out.println("<title>" + title + "</title>");
        out.println("");
        out.println("");

        // relative links

        // XXX
        // making these absolute till we work out the
        // addition of a PathInfo issue

        out.println("");
        out.println("");
        out.println("");
        out.println("");

        out.println("
" + title + "
");

        Cookie[] cookies = request.getCookies();
        if ((cookies != null) && (cookies.length > 0)) {
            out.println(RB.getString("cookies.cookies") + "
");
            for (int i = 0; i < cookies.length; i++) {
                Cookie cookie = cookies[i];
                out.print("Cookie Name: " + HTMLFilter.filter(cookie.getName())
                          + "
");
                out.println("  Cookie Value: "
                            + HTMLFilter.filter(cookie.getValue())
                            + "

");
            }
        } else {
            out.println(RB.getString("cookies.no-cookies"));
        }

        if (aCookie != null) {
            out.println("
");
            out.println(RB.getString("cookies.set") + "
");
            out.print(RB.getString("cookies.name") + "  "
                      + HTMLFilter.filter(cookieName) + "
");
            out.print(RB.getString("cookies.value") + "  "
                      + HTMLFilter.filter(cookieValue));
        }

        out.println("
");
        out.println(RB.getString("cookies.make-cookie") + "
");
        out.print("<form action=\"");
        out.println("CookieExample\" method=POST>");
        out.print(RB.getString("cookies.name") + "  ");
        out.println("<input type=text length=20 name=cookiename>
");
        out.print(RB.getString("cookies.value") + "  ");
        out.println("<input type=text length=20 name=cookievalue>
");
        out.println("<input type=submit></form>");

        out.println("");
        out.println("");
    }

    @Override
    public void doPost(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
        doGet(request, response);
    }

}


text:
package org.ehcache.impl.internal.store.loaderwriter;

import org.ehcache.core.spi.service.ServiceFactory;
import org.ehcache.spi.service.ServiceCreationConfiguration;

public class LoaderWriterStoreProviderFactory implements ServiceFactory<LoaderWriterStoreProvider> {
  @Override
  public LoaderWriterStoreProvider create(ServiceCreationConfiguration<LoaderWriterStoreProvider> configuration) {
    return new LoaderWriterStoreProvider();
  }

  @Override
  public Class<? extends LoaderWriterStoreProvider> getServiceType() {
    return LoaderWriterStoreProvider.class;
  }
}

redpajama_set_name: RedPajamaGithub


text:
A (very) little web based task/app starter

I wanted to have the possibility to start applications (with parameters) on my server with a simple URL request. Also, a little bit of monitoring (output, exit code, etc.) of the started tasks would be nice. So this is taski.

# How to use
Just unpack on youre PHP enabled webserver, install composer dependencies, copy `config-dist.php` to `config.php` and you're ready to go.

# How to add apps
Applications have to be defined in the apps directory, for instructions see [_ReadMe.txt](taski/apps/_ReadMe.txt) there.

## License ##
The MIT License (MIT)


text:
<?php
require 'vendor/autoload.php';

$connection = [
    'driver' => 'mysqli',
    'host' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'blog',
];

// v případě chyby vyhodí Dibi\Exception
$database = new Dibi\Connection($connection);


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>EXP-LA: IMPACT (Imprinted Polymer Array for Counterterrorism):</AwardTitle>
    <AwardEffectiveDate>08/01/2007</AwardEffectiveDate>
    <AwardExpirationDate>07/31/2011</AwardExpirationDate>
    <AwardAmount>799763</AwardAmount>
    <AwardInstrument>
      <Value>Standard Grant</Value>
    </AwardInstrument>
    <Organization>
      07020000
      <Directorate>
        <LongName>Directorate For Engineering</LongName>
      </Directorate>
      <Division>
        <LongName>Div Of Chem, Bioeng, Env, & Transp Sys</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Bruce K. Hamilton</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>EXP-LA: EXP-LA: IMPACT (Imprinted Polymer Array for Counterterrorism)<br/><br/>Howard Katz<br/>Johns Hopkins University<br/>(0730926)<br/><br/>Bruce Hamilton, Program Director (703) 292-7066<br/><br/>This is a project to develop devices to detect airborne explosive components using organic semiconductors. A novel aspect of the proposal is the use of multiple components and star polymers to create molecular imprints for sensing. These molecularly imprinted polymeric materials will utilize shape, size, and possibly electronic structure for improved selectivity. The educational outreach of the project includes incorporation of organic sensors into low-voltage device fabrication kits for community college and high school students.</AbstractNarration>
    <MinAmdLetterDate>07/23/2007</MinAmdLetterDate>
    <MaxAmdLetterDate>07/23/2007</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>0730926</AwardID>
    <Investigator>
      <FirstName>George</FirstName>
      <LastName>Murray</LastName>
      <EmailAddress>george.murray@jhuapl.edu</EmailAddress>
      <StartDate>07/23/2007</StartDate>
      <EndDate/>
      <RoleCode>Co-Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>Howard</FirstName>
      <LastName>Katz</LastName>
      <EmailAddress>hekatz@jhu.edu</EmailAddress>
      <StartDate>07/23/2007</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Johns Hopkins University</Name>
      <CityName>Baltimore</CityName>
      <ZipCode>212182608</ZipCode>
      <PhoneNumber>4105168668</PhoneNumber>
      <StreetAddress>3400 N CHARLES ST</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>Maryland</StateName>
      <StateCode>MD</StateCode>
    </Institution>
    <FoaInformation>
      0308000
      <Name>Industrial Technology</Name>
    </FoaInformation>
    <ProgramElement>
      7653
      <Text>EXPLOSIVES & RLTD THREATS EXP</Text>
    </ProgramElement>
    <ProgramReference>
      0000
      <Text>UNASSIGNED</Text>
    </ProgramReference>
    <ProgramReference>
      019E
      <Text>SENSORS AND SENSING</Text>
    </ProgramReference>
    <ProgramReference>
      135E
      <Text>EXPLOSIVES & THRTS EXP LARGE</Text>
    </ProgramReference>
    <ProgramReference>
      OTHR
      <Text>OTHER RESEARCH OR EDUCATION</Text>
    </ProgramReference>
  </Award>
</rootTag>


text:
var fs = require('fs-extra');
var argv = require('minimist')(process.argv.slice(2));
var windowConfig = require('../window-config');
var closureCompiler = require('gulp-closure-compiler');
var gulp = require('gulp');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
var internalRuntimeVersion = require('../internal-version').VERSION;
var internalRuntimeToken = require('../internal-version').TOKEN;
var rimraf = require('rimraf');

var isProdBuild = !!argv.type;
var queue = [];
var inProgress = 0;
var MAX_PARALLEL_CLOSURE_INVOCATIONS = 4;

// Compiles AMP with the closure compiler. This is intended only for
// production use. During development we intent to continue using
// babel, as it has much faster incremental compilation.
exports.closureCompile = function(entryModuleFilename, outputDir,
    outputFilename, options) {
  // Rate limit closure compilation to MAX_PARALLEL_CLOSURE_INVOCATIONS
  // concurrent processes.
  return new Promise(function(resolve) {
    function start() {
      inProgress++;
      compile(entryModuleFilename, outputDir, outputFilename, options)
          .then(function() {
            inProgress--;
            next();
            resolve();
          }, function(e) {
            console./*OK*/error('Compilation error', e.message);
            process.exit(1);
          });
    }
    function next() {
      if (!queue.length) {
        return;
      }
      if (inProgress < MAX_PARALLEL_CLOSURE_INVOCATIONS) {
        queue.shift()();
      }
    }
    queue.push(start);
    next();
  });
};

function cleanupBuildDir() {
  fs.mkdirsSync('build/cc');
  rimraf.sync('build/fake-module');
  fs.mkdirsSync('build/fake-module/third_party/babel');
  fs.mkdirsSync('build/fake-module/src/polyfills/');
}
exports.cleanupBuildDir = cleanupBuildDir;

function compile(entryModuleFilename, outputDir,
    outputFilename, options) {
  return new Promise(function(resolve, reject) {
    var intermediateFilename = 'build/cc/' +
        entryModuleFilename.replace(/\//g, '_').replace(/^\./, '');
    console./*OK*/log('Starting closure compiler for', entryModuleFilename);

    // If undefined/null or false then we're ok executing the deletions
    // and mkdir.
    if (!options.preventRemoveAndMakeDir) {
      cleanupBuildDir();
    }
    var unneededFiles = [
      'build/fake-module/third_party/babel/custom-babel-helpers.js',
    ];
    var wrapper = windowConfig.getTemplate() +
        '(function(){var process={env:{NODE_ENV:"production"}};' +
        '%output%})();';
    if (options.wrapper) {
      wrapper = options.wrapper.replace('<%= contents %>',
          // TODO(@cramforce): Switch to define.
          'var process={env:{NODE_ENV:"production"}};%output%');
    }
    wrapper += '\n//# sourceMappingURL=' +
        outputFilename + '.map\n';
    if (fs.existsSync(intermediateFilename)) {
      fs.unlinkSync(intermediateFilename);
    }
    if (/development/.test(internalRuntimeToken)) {
      throw new Error('Should compile with a prod token');
    }
    var sourceMapBase = 'http://localhost:8000/';
    if (isProdBuild) {
      // Point sourcemap to fetch files from correct GitHub tag.
      sourceMapBase = 'https://raw.githubusercontent.com/ampproject/amphtml/' +
            internalRuntimeVersion + '/';
    }
    const srcs = [
      '3p/**/*.js',
      'ads/**/*.js',
      'extensions/**/*.js',
      'build/**/*.js',
      '!build/cc/**',
      '!build/polyfills.js',
      '!build/polyfills/**/*.js',
      'src/**/*.js',
      '!third_party/babel/custom-babel-helpers.js',
      // Exclude since it's not part of the runtime/extension binaries.
      '!extensions/amp-access/0.1/amp-login-done.js',
      'builtins/**.js',
      'third_party/caja/html-sanitizer.js',
      'third_party/closure-library/sha384-generated.js',
      'third_party/mustache/**/*.js',
      'node_modules/promise-pjs/promise.js',
      'node_modules/document-register-element/build/' +
          'document-register-element.max.js',
      'node_modules/core-js/modules/**.js',
      // Not sure what these files are, but they seem to duplicate code
      // one level below and confuse the compiler.
      '!node_modules/core-js/modules/library/**.js',
      // Don't include tests.
      '!**_test.js',
      '!**/test-*.js',
    ];
    // Many files include the polyfills, but we only want to deliver them
    // once. Since all files automatically wait for the main binary to load
    // this works fine.
    if (options.includePolyfills) {
      srcs.push(
        '!build/fake-module/src/polyfills.js',
        '!build/fake-module/src/polyfills/**/*.js'
      );
    } else {
      srcs.push(
        '!src/polyfills.js',
        '!src/polyfills/**/*.js'
      );
      unneededFiles.push(
        'build/fake-module/src/polyfills.js',
        'build/fake-module/src/polyfills/promise.js',
        'build/fake-module/src/polyfills/math-sign.js'
      );
    }
    unneededFiles.forEach(function(fake) {
      if (!fs.existsSync(fake)) {
        fs.writeFileSync(fake, '// Not needed in closure compiler\n');
      }
    });
    /*eslint "google-camelcase/google-camelcase": 0*/
    return gulp.src(srcs)
    .pipe(closureCompiler({
      // Temporary shipping with our own compiler that has a single patch
      // applied
      compilerPath: 'build-system/runner/dist/runner.jar',
      fileName: intermediateFilename,
      continueWithWarnings: true,
      tieredCompilation: true,  // Magic speed up.
      compilerFlags: {
        // Custom compilation level. Trying to land this in the core
        // compiler.
        compilation_level: 'SIMPLE_PLUS_OPTIMIZATIONS',
        // Transpile from ES6 to ES5.
        language_in: 'ECMASCRIPT6',
        language_out: 'ECMASCRIPT5',
        js_module_root: ['node_modules/', 'build/fake-module/'],
        common_js_entry_module: entryModuleFilename,
        process_common_js_modules: true,
        // This strips all files from the input set that aren't explicitly
        // required.
        only_closure_dependencies: true,
        output_wrapper: wrapper,
        create_source_map: intermediateFilename + '.map',
        source_map_location_mapping:
            '|' + sourceMapBase,
        warning_level: process.env.TRAVIS ? 'QUIET' : 'DEFAULT',
      }
    }))
    .on('error', function(err) {
      console./*OK*/error(err.message);
      process.exit(1);
    })
    .pipe(rename(outputFilename))
    .pipe(replace(/\$internalRuntimeVersion\$/g, internalRuntimeVersion))
    .pipe(replace(/\$internalRuntimeToken\$/g, internalRuntimeToken))
    .pipe(gulp.dest(outputDir))
    .on('end', function() {
      console./*OK*/log('Compiled', entryModuleFilename, 'to',
          outputDir + '/' + outputFilename, 'via', intermediateFilename);
      gulp.src(intermediateFilename + '.map')
          .pipe(rename(outputFilename + '.map'))
          .pipe(gulp.dest(outputDir))
          .on('end', resolve);
    });
  });
};


text:
layout: default
title: Team
permalink: /team/
color: "#a4b958"
modal: team
---

 {% include top-section.html %}

 {% include team.html %}


text:
In progress character sheet for the Generic Universal Roleplaying System.

Styling is inspired primarily by GCS, but also with some influence from the official sheet. The goal was to design a reponsive character sheet that would look good even with a small screen width.

TODO
 - Allow for free native language
 - Add option for Language talent to reduce cost.
 - Add a damage calculator that:
    - Takes inputs for Damage Amount, Damage Type, and Location
    - Reduce amount by DR for location
    - Apply damage multiplier for type/location
 - Populate Swing and Thrust damage based on Striking ST.
 - Use Sw or Thr as options for weapon damage


text:
angular.module('trainee', ['trainee.controllers', 'trainee.services'])
  .config(['$routeProvider', function($routeProvider) {
    $routeProvider.when('/questions/random', {templateUrl: 'partials/question.html', controller: 'QuestionCtrl'});
    $routeProvider.when('/questions/ordered/:index', {templateUrl: 'partials/question.html', controller: 'QuestionCtrl'});
    $routeProvider.when('/examtips/random', {templateUrl: 'partials/examtip.html', controller: 'ExamTipCtrl'});
    $routeProvider.when('/examtips/ordered/:index', {templateUrl: 'partials/examtip.html', controller: 'ExamTipCtrl'});
    $routeProvider.otherwise({redirectTo: '/questions/random'});
  }]);


text:
"""
Copyright 2015 SmartBear Software

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

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

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

class Status(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """

    def __init__(self):
        """
        Swagger model

        :param dict swaggerTypes: The key is attribute name and the value is attribute type.
        :param dict attributeMap: The key is attribute name and the value is json key in definition.
        """
        self.swagger_types = {
            'code': 'str',
            'info': 'str'
        }

        self.attribute_map = {
            'code': 'code',
            'info': 'info'
        }

        # Status code identifier.
        self.code = None  # str

        # Description of the status code.
        self.info = None  # str

    def __repr__(self):
        properties = []
        for p in self.__dict__:
            if p != 'swaggerTypes' and p != 'attributeMap':
                properties.append('{prop}={val!r}'.format(prop=p, val=self.__dict__[p]))

        return '<{name} {props}>'.format(name=__name__, props=' '.join(properties))


text:
$(function(){
    module("class instantiate");

    test("instantiate with new", function(){
        var array = $.ku4reflection.instantiate("new Array", [1,2,3,4]);

        expect(5);
        ok(array);
        equal(array[0], 1);
        equal(array[1], 2);
        equal(array[2], 3);
        equal(array[3], 4);
    });

    test("instantiate custom with new", function() {
        TestClass = function Class() { this.property = "property"};
        var value = $.ku4reflection.instantiate("new TestClass", [1]);

        expect(2);
        ok(value);
        equal(value.property, "property");
    });

    test("instantiate with $", function(){
        var money = $.ku4reflection.instantiate("$.money", [4.15, 'B']);

        expect(5);
        ok(money);
        equal(money.dollars(), 4);
        equal($.math.round(money.cents(), -2), .15);
        equal(money.currency(), "B");
        equal(money.value(), 4.15)
    });
});


text:
#include "cbase.h"
#include "asw_weapon_sniper_rifle.h"
#include "in_buttons.h"

#ifdef CLIENT_DLL
#include "c_asw_player.h"
#include "c_asw_weapon.h"
#include "c_asw_marine.h"
#include "dlight.h"
#include "asw_input.h"
#include "iefx.h"
#include "engine/ivdebugoverlay.h"
#include "c_asw_fx.h"
#else
#include "asw_lag_compensation.h"
#include "asw_marine.h"
#include "asw_marine_resource.h"
#include "asw_player.h"
#include "asw_weapon.h"
#include "npcevent.h"
#include "shot_manipulator.h"
#include "asw_shotgun_pellet.h"
#include "asw_marine_speech.h"
#include "asw_weapon_ammo_bag_shared.h"
#endif
#include "asw_marine_skills.h"
#include "asw_weapon_parse.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

extern ConVar asw_weapon_max_shooting_distance;
extern ConVar sk_plr_dmg_asw_sg;
extern ConVar asw_weapon_force_scale;

IMPLEMENT_NETWORKCLASS_ALIASED( ASW_Weapon_Sniper_Rifle, DT_ASW_Weapon_Sniper_Rifle )

BEGIN_NETWORK_TABLE( CASW_Weapon_Sniper_Rifle, DT_ASW_Weapon_Sniper_Rifle )
#ifdef CLIENT_DLL
	// recvprops
	RecvPropTime( RECVINFO( m_fSlowTime ) ),
	RecvPropBool( RECVINFO( m_bZoomed ) ),
#else
	// sendprops
	SendPropTime( SENDINFO( m_fSlowTime ) ),
	SendPropBool( SENDINFO( m_bZoomed ) ),
#endif
END_NETWORK_TABLE()

#ifdef CLIENT_DLL
BEGIN_PREDICTION_DATA( CASW_Weapon_Sniper_Rifle )
	DEFINE_PRED_FIELD_TOL( m_fSlowTime, FIELD_FLOAT, FTYPEDESC_INSENDTABLE, TD_MSECTOLERANCE ),
END_PREDICTION_DATA()

#else

//-----------------------------------------------------------------------------
// Purpose: Save Data
//-----------------------------------------------------------------------------//
BEGIN_DATADESC( CASW_Weapon_Sniper_Rifle )
	DEFINE_FIELD( m_fSlowTime, FIELD_TIME ),
END_DATADESC()
#endif

LINK_ENTITY_TO_CLASS( asw_weapon_sniper_rifle, CASW_Weapon_Sniper_Rifle );
PRECACHE_WEAPON_REGISTER( asw_weapon_sniper_rifle );

#ifndef CLIENT_DLL
extern ConVar asw_debug_marine_damage;

#endif /* not client */

CASW_Weapon_Sniper_Rifle::CASW_Weapon_Sniper_Rifle()
{
	m_fMinRange1	= 0;
	m_fMaxRange1	= 512;

	m_fMinRange2	= 256;
	m_fMaxRange2	= 1024;

	m_fSlowTime = 0;

#ifdef CLIENT_DLL
	m_pSniperDynamicLight = NULL;
#endif
}

CASW_Weapon_Sniper_Rifle::~CASW_Weapon_Sniper_Rifle()
{

}

#define PELLET_AIR_VELOCITY	3500
#define PELLET_WATER_VELOCITY	1500

void CASW_Weapon_Sniper_Rifle::PrimaryAttack( void )
{
	// If my clip is empty (and I use clips) start reload
	if ( UsesClipsForAmmo1() && !m_iClip1 )
	{
		Reload();
		return;
	}

	CASW_Player *pPlayer = GetCommander();
	CASW_Marine *pMarine = GetMarine();
	if ( !pMarine )
		return;

	// MUST call sound before removing a round from the clip of a CMachineGun
	WeaponSound(SINGLE);
	if (m_iClip1 <= AmmoClickPoint())
		BaseClass::WeaponSound( EMPTY );

	m_bIsFiring = true;

	// tell the marine to tell its weapon to draw the muzzle flash
	pMarine->DoMuzzleFlash();

	// sets the animation on the weapon model iteself
	//SendWeaponAnim( GetPrimaryAttackActivity() );

	// sets the animation on the marine holding this weapon
	//pMarine->SetAnimation( PLAYER_ATTACK1 );

#ifdef GAME_DLL	// check for turning on lag compensation
	if (pPlayer && pMarine->IsInhabited())
	{
		CASW_Lag_Compensation::RequestLagCompensation( pPlayer, pPlayer->GetCurrentUserCommand() );
	}
#endif

	FireBulletsInfo_t info;
	info.m_vecSrc = pMarine->Weapon_ShootPosition( );
	if ( pPlayer && pMarine->IsInhabited() )
	{
		info.m_vecDirShooting = pPlayer->GetAutoaimVectorForMarine(pMarine, GetAutoAimAmount(), GetVerticalAdjustOnlyAutoAimAmount());	// 45 degrees = 0.707106781187
	}
	else
	{
#ifdef CLIENT_DLL
		Msg("Error, clientside firing of a weapon that's being controlled by an AI marine\n");
#else
		info.m_vecDirShooting = pMarine->GetActualShootTrajectory( info.m_vecSrc );
#endif
	}

	info.m_iShots = 1;

	// Make sure we don't fire more than the amount in the clip
	if ( UsesClipsForAmmo1() )
	{
		info.m_iShots = MIN( info.m_iShots, m_iClip1 );
		m_iClip1 -= info.m_iShots;
#ifdef GAME_DLL
		CASW_Marine *pMarine = GetMarine();
		if (pMarine && m_iClip1 <= 0 && pMarine->GetAmmoCount(m_iPrimaryAmmoType) <= 0 )
		{
			pMarine->OnWeaponOutOfAmmo(true);
		}
#endif
	}
	else
	{
		info.m_iShots = MIN( info.m_iShots, pMarine->GetAmmoCount( m_iPrimaryAmmoType ) );
		pMarine->RemoveAmmo( info.m_iShots, m_iPrimaryAmmoType );
	}

	info.m_flDistance = asw_weapon_max_shooting_distance.GetFloat();
	info.m_iAmmoType = m_iPrimaryAmmoType;
	info.m_iTracerFreq = 1;
	info.m_flDamageForceScale = asw_weapon_force_scale.GetFloat();

	info.m_vecSpread = GetBulletSpread();
	info.m_flDamage = GetWeaponDamage();
#ifndef CLIENT_DLL
	if (asw_debug_marine_damage.GetBool())
		Msg("Weapon dmg = %f\n", info.m_flDamage);
	info.m_flDamage *= pMarine->OnFired_GetDamageScale();
#endif

	int iPenetration = 1;
	if ( pMarine->GetDamageBuffEndTime() > gpGlobals->curtime )		// sniper rifle penetrates more targets when marine is in a damage amp
	{
		iPenetration = 3;
	}
	pMarine->FirePenetratingBullets( info, iPenetration, 3.5f, 0, true, NULL, false  );

	// increment shooting stats
#ifndef CLIENT_DLL
	if (pMarine && pMarine->GetMarineResource())
	{
		pMarine->GetMarineResource()->UsedWeapon(this, 1);
		pMarine->OnWeaponFired( this, 1 );
	}
#endif

	if (m_iClip1 > 0)		// only force the fire wait time if we have ammo for another shot
		m_flNextPrimaryAttack = gpGlobals->curtime + GetFireRate();
	else
		m_flNextPrimaryAttack = gpGlobals->curtime;
	m_fSlowTime = gpGlobals->curtime + 0.03f;
}

void CASW_Weapon_Sniper_Rifle::Precache()
{
	PrecacheModel( "swarm/sprites/whiteglow1.vmt" );
	PrecacheModel( "swarm/sprites/greylaser1.vmt" );
	PrecacheScriptSound("ASW_Pistol.ReloadA");
	PrecacheScriptSound("ASW_Pistol.ReloadB");

	BaseClass::Precache();
}

bool CASW_Weapon_Sniper_Rifle::ShouldMarineMoveSlow()
{
	return (gpGlobals->curtime < m_fSlowTime) || IsZoomed();
}

void CASW_Weapon_Sniper_Rifle::ItemPostFrame( void )
{
	BaseClass::ItemPostFrame();

	CASW_Marine *pMarine = GetMarine();
	if ( !pMarine )
		return;

	// AIs switch out of zoom mode
	if ( !pMarine->IsInhabited() && IsZoomed() )
	{
		m_bZoomed = false;
	}

	bool bAttack1, bAttack2, bReload, bOldReload, bOldAttack1;
	GetButtons( bAttack1, bAttack2, bReload, bOldReload, bOldAttack1 );

	bool bOldAttack2 = false;
	if ( pMarine->IsInhabited() && pMarine->GetCommander() )
	{
		bOldAttack2 = !!(pMarine->m_nOldButtons & IN_ATTACK2);
	}

	if ( bAttack2 && !bOldAttack2 )
	{
		m_bZoomed = !IsZoomed();
	}
}

float CASW_Weapon_Sniper_Rifle::GetWeaponDamage()
{
	float flDamage = GetWeaponInfo()->m_flBaseDamage;

	if ( GetMarine() )
	{
		flDamage += MarineSkills()->GetSkillBasedValueByMarine(GetMarine(), ASW_MARINE_SKILL_ACCURACY, ASW_MARINE_SUBSKILL_ACCURACY_SNIPER_RIFLE_DMG);
	}

	return flDamage;
}

#ifdef CLIENT_DLL

ConVar asw_sniper_dlight_radius("asw_sniper_dlight_radius", "100", FCVAR_CHEAT, "Radius of the light around the cursor.");
ConVar asw_sniper_dlight_r("asw_sniper_dlight_r", "250", FCVAR_CHEAT, "Red component of flashlight colour");
ConVar asw_sniper_dlight_g("asw_sniper_dlight_g", "250", FCVAR_CHEAT, "Green component of flashlight colour");
ConVar asw_sniper_dlight_b("asw_sniper_dlight_b", "250", FCVAR_CHEAT, "Blue component of flashlight colour");
ConVar asw_sniper_dlight_exponent( "asw_sniper_dlight_exponent", "1", FCVAR_CHEAT );

void CASW_Weapon_Sniper_Rifle::UpdateDynamicLight()
{
	// DLIGHT disabled, since it looks bad
	return;

	C_ASW_Marine *pMarine =GetMarine();
	C_ASW_Player *pPlayer = pMarine ? pMarine->GetCommander() : NULL;

	if ( !pMarine || pMarine->GetActiveWeapon() != this || !pPlayer || !pMarine->IsInhabited() || !pPlayer->IsLocalPlayer() )
	{
		if (m_pSniperDynamicLight)
		{
			m_pSniperDynamicLight->die = gpGlobals->curtime + 0.001;
			m_pSniperDynamicLight = NULL;
		}
		return;
	}

	if ( !m_pSniperDynamicLight || (m_pSniperDynamicLight->key != index) )
	{
		m_pSniperDynamicLight = effects->CL_AllocDlight ( index );
	}

	//m_fAmbientLight = asw_flashlight_marine_ambient.GetFloat();
	//m_fLightingScale = asw_flashlight_marine_lightscale.GetFloat();

	Vector vecForward, vecRight, vecUp;

	if (m_pSniperDynamicLight)
	{
		AngleVectors( GetLocalAngles(), &vecForward, &vecRight, &vecUp );
		m_pSniperDynamicLight->origin = pPlayer->GetCrosshairTracePos() + Vector( 0, 0, 10 );
		Msg( "crosshair trace pos is %f %f %f\n", VectorExpand( pPlayer->GetCrosshairTracePos() ) );
		debugoverlay->AddTextOverlay( m_pSniperDynamicLight->origin, 0.01f, "Light" );
		m_pSniperDynamicLight->color.r = asw_sniper_dlight_r.GetInt();
		m_pSniperDynamicLight->color.g = asw_sniper_dlight_g.GetInt();
		m_pSniperDynamicLight->color.b = asw_sniper_dlight_b.GetInt();
		m_pSniperDynamicLight->radius = asw_sniper_dlight_radius.GetFloat();
		m_pSniperDynamicLight->color.exponent = asw_sniper_dlight_exponent.GetFloat();
		//m_pSniperDynamicLight->decay = 0;
		m_pSniperDynamicLight->die = gpGlobals->curtime + 30.0f;
	}
}

void CASW_Weapon_Sniper_Rifle::OnDataChanged( DataUpdateType_t updateType )
{
	BaseClass::OnDataChanged( updateType );

	if ( updateType == DATA_UPDATE_CREATED )
	{
		SetNextClientThink( CLIENT_THINK_ALWAYS );
	}
}

void CASW_Weapon_Sniper_Rifle::ClientThink()
{
	BaseClass::ClientThink();

	UpdateDynamicLight();

	if ( m_nEjectBrassCount > 0 && gpGlobals->curtime >= m_flEjectBrassTime )
	{
		int iAttachment = LookupAttachment( "eject1" );
		if( iAttachment != -1 )
		{
			for ( int i = 0; i < m_nEjectBrassCount; i++ )
			{
				EjectParticleBrass( "weapon_shell_casing_rifle", iAttachment );
			}
		}
		m_nEjectBrassCount = 0;
	}
}

ConVar asw_sniper_shell_delay( "asw_sniper_shell_delay", "0.7", FCVAR_NONE, "Delay on shell casing after firing rifle" );

void CASW_Weapon_Sniper_Rifle::OnMuzzleFlashed()
{
	BaseClass::OnMuzzleFlashed();

	Vector attachOrigin;
	QAngle attachAngles;

	m_nEjectBrassCount++;
	m_flEjectBrassTime = gpGlobals->curtime + asw_sniper_shell_delay.GetFloat();
	if( GetAttachment( LookupAttachment("muzzle"), attachOrigin, attachAngles ) )
	{
		FX_ASW_ShotgunSmoke(attachOrigin, attachAngles);
	}
}
#endif


text:
#ifndef DRTICPDS_H
#define DRTICPDS_H

#include "dcmtk/config/osconfig.h"     // make sure OS specific configuration is included first

#include "dcmtk/ofstd/oflist.h"        // for standard list class
#include "dcmtk/dcmrt/drttypes.h"      // module-specific helper class
#include "dcmtk/dcmrt/seq/drtbldps.h"  // for BeamLimitingDevicePositionSequence
#include "dcmtk/dcmrt/seq/drtcpas.h"   // for CorrectedParameterSequence
#include "dcmtk/dcmrt/seq/drtiwps.h"   // for IonWedgePositionSequence
#include "dcmtk/dcmrt/seq/drtlsds7.h"  // for LateralSpreadingDeviceSettingsSequence
#include "dcmtk/dcmrt/seq/drtos.h"     // for OverrideSequence
#include "dcmtk/dcmrt/seq/drtrmss7.h"  // for RangeModulatorSettingsSequence
#include "dcmtk/dcmrt/seq/drtrshs7.h"  // for RangeShifterSettingsSequence

/** Interface class for IonControlPointDeliverySequence (3008,0041) in RTIonBeamsSessionRecordModule
 */
class DCMTK_DCMRT_EXPORT DRTIonControlPointDeliverySequence
  : protected DRTTypes
{

  public:

    /** Item class
     */
    class DCMTK_DCMRT_EXPORT Item
      : protected DRTTypes
    {

      public:

      // --- constructors, destructor and operators ---

        /** (default) constructor
         *  @param emptyDefaultItem flag used to mark the empty default item
         */
        Item(const OFBool emptyDefaultItem = OFFalse);

        /** copy constructor
         *  @param copy item object to be copied
         */
        Item(const Item &copy);

        /** destructor
         */
        virtual ~Item();

        /** assigment operator
         *  @param copy item object to be copied
         */
        Item &operator=(const Item &copy);

      // --- general methods ---

        /** clear all internal member variables
         */
        void clear();

        /** check if item is empty
         *  @return OFTrue if item is empty, OFFalse otherwise
         */
        OFBool isEmpty();

        /** check if item is valid, i.e.\ not the empty default item
         *  @return OFTrue if item is valid, OFFalse otherwise
         */
        OFBool isValid() const;

      // --- input/output methods ---

        /** read elements from sequence item
         *  @param  item    reference to DICOM sequence item from which the elements should be read
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition read(DcmItem &item);

        /** write elements to sequence item
         *  @param  item    reference to DICOM sequence item to which the elements should be written
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition write(DcmItem &item);

      // --- get DICOM attribute values ---

        /** get BeamLimitingDeviceAngle (300a,0120)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getBeamLimitingDeviceAngle(OFString &value, const signed long pos = 0) const;

        /** get BeamLimitingDeviceAngle (300a,0120)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getBeamLimitingDeviceAngle(Float64 &value, const unsigned long pos = 0) const;

        /** get BeamLimitingDeviceRotationDirection (300a,0121)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getBeamLimitingDeviceRotationDirection(OFString &value, const signed long pos = 0) const;

        /** get DeliveredMeterset (3008,0044)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getDeliveredMeterset(OFString &value, const signed long pos = 0) const;

        /** get DeliveredMeterset (3008,0044)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getDeliveredMeterset(Float64 &value, const unsigned long pos = 0) const;

        /** get GantryAngle (300a,011e)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getGantryAngle(OFString &value, const signed long pos = 0) const;

        /** get GantryAngle (300a,011e)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getGantryAngle(Float64 &value, const unsigned long pos = 0) const;

        /** get GantryPitchAngle (300a,014a)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getGantryPitchAngle(Float32 &value, const unsigned long pos = 0) const;

        /** get GantryPitchRotationDirection (300a,014c)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getGantryPitchRotationDirection(OFString &value, const signed long pos = 0) const;

        /** get GantryRotationDirection (300a,011f)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getGantryRotationDirection(OFString &value, const signed long pos = 0) const;

        /** get HeadFixationAngle (300a,0148)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getHeadFixationAngle(Float32 &value, const unsigned long pos = 0) const;

        /** get KVP (0018,0060)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getKVP(OFString &value, const signed long pos = 0) const;

        /** get KVP (0018,0060)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getKVP(Float64 &value, const unsigned long pos = 0) const;

        /** get MetersetRateDelivered (3008,0046)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getMetersetRateDelivered(Float32 &value, const unsigned long pos = 0) const;

        /** get MetersetRateSet (3008,0045)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getMetersetRateSet(Float32 &value, const unsigned long pos = 0) const;

        /** get NominalBeamEnergy (300a,0114)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getNominalBeamEnergy(OFString &value, const signed long pos = 0) const;

        /** get NominalBeamEnergy (300a,0114)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getNominalBeamEnergy(Float64 &value, const unsigned long pos = 0) const;

        /** get NumberOfPaintings (300a,039a)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getNumberOfPaintings(OFString &value, const signed long pos = 0) const;

        /** get NumberOfPaintings (300a,039a)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getNumberOfPaintings(Sint32 &value, const unsigned long pos = 0) const;

        /** get NumberOfScanSpotPositions (300a,0392)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getNumberOfScanSpotPositions(OFString &value, const signed long pos = 0) const;

        /** get NumberOfScanSpotPositions (300a,0392)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getNumberOfScanSpotPositions(Sint32 &value, const unsigned long pos = 0) const;

        /** get PatientSupportAngle (300a,0122)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getPatientSupportAngle(OFString &value, const signed long pos = 0) const;

        /** get PatientSupportAngle (300a,0122)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getPatientSupportAngle(Float64 &value, const unsigned long pos = 0) const;

        /** get PatientSupportRotationDirection (300a,0123)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getPatientSupportRotationDirection(OFString &value, const signed long pos = 0) const;

        /** get ReferencedControlPointIndex (300c,00f0)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getReferencedControlPointIndex(OFString &value, const signed long pos = 0) const;

        /** get ReferencedControlPointIndex (300c,00f0)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getReferencedControlPointIndex(Sint32 &value, const unsigned long pos = 0) const;

        /** get ScanSpotMetersetsDelivered (3008,0047)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getScanSpotMetersetsDelivered(Float32 &value, const unsigned long pos = 0) const;

        /** get ScanSpotPositionMap (300a,0394)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getScanSpotPositionMap(Float32 &value, const unsigned long pos = 0) const;

        /** get ScanSpotTuneID (300a,0390)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getScanSpotTuneID(OFString &value, const signed long pos = 0) const;

        /** get ScanningSpotSize (300a,0398)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getScanningSpotSize(Float32 &value, const unsigned long pos = 0) const;

        /** get SnoutPosition (300a,030d)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getSnoutPosition(Float32 &value, const unsigned long pos = 0) const;

        /** get SpecifiedMeterset (3008,0042)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getSpecifiedMeterset(OFString &value, const signed long pos = 0) const;

        /** get SpecifiedMeterset (3008,0042)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getSpecifiedMeterset(Float64 &value, const unsigned long pos = 0) const;

        /** get TableTopLateralPosition (300a,012a)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopLateralPosition(OFString &value, const signed long pos = 0) const;

        /** get TableTopLateralPosition (300a,012a)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopLateralPosition(Float64 &value, const unsigned long pos = 0) const;

        /** get TableTopLongitudinalPosition (300a,0129)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopLongitudinalPosition(OFString &value, const signed long pos = 0) const;

        /** get TableTopLongitudinalPosition (300a,0129)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopLongitudinalPosition(Float64 &value, const unsigned long pos = 0) const;

        /** get TableTopPitchAngle (300a,0140)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopPitchAngle(Float32 &value, const unsigned long pos = 0) const;

        /** get TableTopPitchRotationDirection (300a,0142)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopPitchRotationDirection(OFString &value, const signed long pos = 0) const;

        /** get TableTopRollAngle (300a,0144)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopRollAngle(Float32 &value, const unsigned long pos = 0) const;

        /** get TableTopRollRotationDirection (300a,0146)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopRollRotationDirection(OFString &value, const signed long pos = 0) const;

        /** get TableTopVerticalPosition (300a,0128)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopVerticalPosition(OFString &value, const signed long pos = 0) const;

        /** get TableTopVerticalPosition (300a,0128)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1)
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTableTopVerticalPosition(Float64 &value, const unsigned long pos = 0) const;

        /** get TreatmentControlPointDate (3008,0024)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTreatmentControlPointDate(OFString &value, const signed long pos = 0) const;

        /** get TreatmentControlPointTime (3008,0025)
         *  @param  value  reference to variable in which the value should be stored
         *  @param  pos    index of the value to get (0..vm-1), -1 for all components
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition getTreatmentControlPointTime(OFString &value, const signed long pos = 0) const;

      // --- get DICOM sequence attributes ---

        /** get BeamLimitingDevicePositionSequence (300a,011a)
         *  @return reference to sequence element
         */
        DRTBeamLimitingDevicePositionSequence &getBeamLimitingDevicePositionSequence()
            { return BeamLimitingDevicePositionSequence; }

        /** get BeamLimitingDevicePositionSequence (300a,011a)
         *  @return const reference to sequence element
         */
        const DRTBeamLimitingDevicePositionSequence &getBeamLimitingDevicePositionSequence() const
            { return BeamLimitingDevicePositionSequence; }

        /** get CorrectedParameterSequence (3008,0068)
         *  @return reference to sequence element
         */
        DRTCorrectedParameterSequence &getCorrectedParameterSequence()
            { return CorrectedParameterSequence; }

        /** get CorrectedParameterSequence (3008,0068)
         *  @return const reference to sequence element
         */
        const DRTCorrectedParameterSequence &getCorrectedParameterSequence() const
            { return CorrectedParameterSequence; }

        /** get IonWedgePositionSequence (300a,03ac)
         *  @return reference to sequence element
         */
        DRTIonWedgePositionSequence &getIonWedgePositionSequence()
            { return IonWedgePositionSequence; }

        /** get IonWedgePositionSequence (300a,03ac)
         *  @return const reference to sequence element
         */
        const DRTIonWedgePositionSequence &getIonWedgePositionSequence() const
            { return IonWedgePositionSequence; }

        /** get LateralSpreadingDeviceSettingsSequence (300a,0370)
         *  @return reference to sequence element
         */
        DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule &getLateralSpreadingDeviceSettingsSequence()
            { return LateralSpreadingDeviceSettingsSequence; }

        /** get LateralSpreadingDeviceSettingsSequence (300a,0370)
         *  @return const reference to sequence element
         */
        const DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule &getLateralSpreadingDeviceSettingsSequence() const
            { return LateralSpreadingDeviceSettingsSequence; }

        /** get OverrideSequence (3008,0060)
         *  @return reference to sequence element
         */
        DRTOverrideSequence &getOverrideSequence()
            { return OverrideSequence; }

        /** get OverrideSequence (3008,0060)
         *  @return const reference to sequence element
         */
        const DRTOverrideSequence &getOverrideSequence() const
            { return OverrideSequence; }

        /** get RangeModulatorSettingsSequence (300a,0380)
         *  @return reference to sequence element
         */
        DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule &getRangeModulatorSettingsSequence()
            { return RangeModulatorSettingsSequence; }

        /** get RangeModulatorSettingsSequence (300a,0380)
         *  @return const reference to sequence element
         */
        const DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule &getRangeModulatorSettingsSequence() const
            { return RangeModulatorSettingsSequence; }

        /** get RangeShifterSettingsSequence (300a,0360)
         *  @return reference to sequence element
         */
        DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule &getRangeShifterSettingsSequence()
            { return RangeShifterSettingsSequence; }

        /** get RangeShifterSettingsSequence (300a,0360)
         *  @return const reference to sequence element
         */
        const DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule &getRangeShifterSettingsSequence() const
            { return RangeShifterSettingsSequence; }

      // --- set DICOM attribute values ---

        /** set BeamLimitingDeviceAngle (300a,0120)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setBeamLimitingDeviceAngle(const OFString &value, const OFBool check = OFTrue);

        /** set BeamLimitingDeviceRotationDirection (300a,0121)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (CS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setBeamLimitingDeviceRotationDirection(const OFString &value, const OFBool check = OFTrue);

        /** set DeliveredMeterset (3008,0044)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setDeliveredMeterset(const OFString &value, const OFBool check = OFTrue);

        /** set GantryAngle (300a,011e)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setGantryAngle(const OFString &value, const OFBool check = OFTrue);

        /** set GantryPitchAngle (300a,014a)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=1
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setGantryPitchAngle(const Float32 value, const unsigned long pos = 0);

        /** set GantryPitchRotationDirection (300a,014c)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (CS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setGantryPitchRotationDirection(const OFString &value, const OFBool check = OFTrue);

        /** set GantryRotationDirection (300a,011f)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (CS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setGantryRotationDirection(const OFString &value, const OFBool check = OFTrue);

        /** set HeadFixationAngle (300a,0148)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=1
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setHeadFixationAngle(const Float32 value, const unsigned long pos = 0);

        /** set KVP (0018,0060)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setKVP(const OFString &value, const OFBool check = OFTrue);

        /** set MetersetRateDelivered (3008,0046)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=1
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setMetersetRateDelivered(const Float32 value, const unsigned long pos = 0);

        /** set MetersetRateSet (3008,0045)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=1
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setMetersetRateSet(const Float32 value, const unsigned long pos = 0);

        /** set NominalBeamEnergy (300a,0114)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setNominalBeamEnergy(const OFString &value, const OFBool check = OFTrue);

        /** set NumberOfPaintings (300a,039a)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (IS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setNumberOfPaintings(const OFString &value, const OFBool check = OFTrue);

        /** set NumberOfScanSpotPositions (300a,0392)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (IS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setNumberOfScanSpotPositions(const OFString &value, const OFBool check = OFTrue);

        /** set PatientSupportAngle (300a,0122)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setPatientSupportAngle(const OFString &value, const OFBool check = OFTrue);

        /** set PatientSupportRotationDirection (300a,0123)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (CS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setPatientSupportRotationDirection(const OFString &value, const OFBool check = OFTrue);

        /** set ReferencedControlPointIndex (300c,00f0)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (IS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setReferencedControlPointIndex(const OFString &value, const OFBool check = OFTrue);

        /** set ScanSpotMetersetsDelivered (3008,0047)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=1-n
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setScanSpotMetersetsDelivered(const Float32 value, const unsigned long pos = 0);

        /** set ScanSpotPositionMap (300a,0394)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=1-n
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setScanSpotPositionMap(const Float32 value, const unsigned long pos = 0);

        /** set ScanSpotTuneID (300a,0390)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (SH) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setScanSpotTuneID(const OFString &value, const OFBool check = OFTrue);

        /** set ScanningSpotSize (300a,0398)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=2
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setScanningSpotSize(const Float32 value, const unsigned long pos = 0);

        /** set SnoutPosition (300a,030d)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=1
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setSnoutPosition(const Float32 value, const unsigned long pos = 0);

        /** set SpecifiedMeterset (3008,0042)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setSpecifiedMeterset(const OFString &value, const OFBool check = OFTrue);

        /** set TableTopLateralPosition (300a,012a)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setTableTopLateralPosition(const OFString &value, const OFBool check = OFTrue);

        /** set TableTopLongitudinalPosition (300a,0129)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setTableTopLongitudinalPosition(const OFString &value, const OFBool check = OFTrue);

        /** set TableTopPitchAngle (300a,0140)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=1
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setTableTopPitchAngle(const Float32 value, const unsigned long pos = 0);

        /** set TableTopPitchRotationDirection (300a,0142)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (CS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setTableTopPitchRotationDirection(const OFString &value, const OFBool check = OFTrue);

        /** set TableTopRollAngle (300a,0144)
         *  @param  value  value to be set (should be valid for this VR)
         *  @param  pos    index of the value to be set (0..vm-1), vm=1
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setTableTopRollAngle(const Float32 value, const unsigned long pos = 0);

        /** set TableTopRollRotationDirection (300a,0146)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (CS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setTableTopRollRotationDirection(const OFString &value, const OFBool check = OFTrue);

        /** set TableTopVerticalPosition (300a,0128)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DS) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setTableTopVerticalPosition(const OFString &value, const OFBool check = OFTrue);

        /** set TreatmentControlPointDate (3008,0024)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (DA) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setTreatmentControlPointDate(const OFString &value, const OFBool check = OFTrue);

        /** set TreatmentControlPointTime (3008,0025)
         *  @param  value  value to be set (single value only) or "" for no value
         *  @param  check  check 'value' for conformance with VR (TM) and VM (1) if enabled
         *  @return status, EC_Normal if successful, an error code otherwise
         */
        OFCondition setTreatmentControlPointTime(const OFString &value, const OFBool check = OFTrue);

      private:

        /// internal flag used to mark the empty default item
        /*const*/ OFBool EmptyDefaultItem;

        /// BeamLimitingDeviceAngle (300a,0120) vr=DS, vm=1, type=1C
        DcmDecimalString BeamLimitingDeviceAngle;
        /// BeamLimitingDevicePositionSequence (300a,011a) vr=SQ, vm=1, type=1C
        DRTBeamLimitingDevicePositionSequence BeamLimitingDevicePositionSequence;
        /// BeamLimitingDeviceRotationDirection (300a,0121) vr=CS, vm=1, type=1C
        DcmCodeString BeamLimitingDeviceRotationDirection;
        /// CorrectedParameterSequence (3008,0068) vr=SQ, vm=1, type=3
        DRTCorrectedParameterSequence CorrectedParameterSequence;
        /// DeliveredMeterset (3008,0044) vr=DS, vm=1, type=1
        DcmDecimalString DeliveredMeterset;
        /// GantryAngle (300a,011e) vr=DS, vm=1, type=1C
        DcmDecimalString GantryAngle;
        /// GantryPitchAngle (300a,014a) vr=FL, vm=1, type=2C
        DcmFloatingPointSingle GantryPitchAngle;
        /// GantryPitchRotationDirection (300a,014c) vr=CS, vm=1, type=2C
        DcmCodeString GantryPitchRotationDirection;
        /// GantryRotationDirection (300a,011f) vr=CS, vm=1, type=1C
        DcmCodeString GantryRotationDirection;
        /// HeadFixationAngle (300a,0148) vr=FL, vm=1, type=3
        DcmFloatingPointSingle HeadFixationAngle;
        /// IonWedgePositionSequence (300a,03ac) vr=SQ, vm=1, type=1C
        DRTIonWedgePositionSequence IonWedgePositionSequence;
        /// KVP (0018,0060) vr=DS, vm=1, type=1C
        DcmDecimalString KVP;
        /// LateralSpreadingDeviceSettingsSequence (300a,0370) vr=SQ, vm=1, type=1C
        DRTLateralSpreadingDeviceSettingsSequenceInRTIonBeamsSessionRecordModule LateralSpreadingDeviceSettingsSequence;
        /// MetersetRateDelivered (3008,0046) vr=FL, vm=1, type=3
        DcmFloatingPointSingle MetersetRateDelivered;
        /// MetersetRateSet (3008,0045) vr=FL, vm=1, type=3
        DcmFloatingPointSingle MetersetRateSet;
        /// NominalBeamEnergy (300a,0114) vr=DS, vm=1, type=1C
        DcmDecimalString NominalBeamEnergy;
        /// NumberOfPaintings (300a,039a) vr=IS, vm=1, type=1C
        DcmIntegerString NumberOfPaintings;
        /// NumberOfScanSpotPositions (300a,0392) vr=IS, vm=1, type=1C
        DcmIntegerString NumberOfScanSpotPositions;
        /// OverrideSequence (3008,0060) vr=SQ, vm=1, type=3
        DRTOverrideSequence OverrideSequence;
        /// PatientSupportAngle (300a,0122) vr=DS, vm=1, type=1C
        DcmDecimalString PatientSupportAngle;
        /// PatientSupportRotationDirection (300a,0123) vr=CS, vm=1, type=1C
        DcmCodeString PatientSupportRotationDirection;
        /// RangeModulatorSettingsSequence (300a,0380) vr=SQ, vm=1, type=1C
        DRTRangeModulatorSettingsSequenceInRTIonBeamsSessionRecordModule RangeModulatorSettingsSequence;
        /// RangeShifterSettingsSequence (300a,0360) vr=SQ, vm=1, type=1C
        DRTRangeShifterSettingsSequenceInRTIonBeamsSessionRecordModule RangeShifterSettingsSequence;
        /// ReferencedControlPointIndex (300c,00f0) vr=IS, vm=1, type=1
        DcmIntegerString ReferencedControlPointIndex;
        /// ScanSpotMetersetsDelivered (3008,0047) vr=FL, vm=1-n, type=1C
        DcmFloatingPointSingle ScanSpotMetersetsDelivered;
        /// ScanSpotPositionMap (300a,0394) vr=FL, vm=1-n, type=1C
        DcmFloatingPointSingle ScanSpotPositionMap;
        /// ScanSpotTuneID (300a,0390) vr=SH, vm=1, type=1C
        DcmShortString ScanSpotTuneID;
        /// ScanningSpotSize (300a,0398) vr=FL, vm=2, type=3
        DcmFloatingPointSingle ScanningSpotSize;
        /// SnoutPosition (300a,030d) vr=FL, vm=1, type=2C
        DcmFloatingPointSingle SnoutPosition;
        /// SpecifiedMeterset (3008,0042) vr=DS, vm=1, type=2
        DcmDecimalString SpecifiedMeterset;
        /// TableTopLateralPosition (300a,012a) vr=DS, vm=1, type=2C
        DcmDecimalString TableTopLateralPosition;
        /// TableTopLongitudinalPosition (300a,0129) vr=DS, vm=1, type=2C
        DcmDecimalString TableTopLongitudinalPosition;
        /// TableTopPitchAngle (300a,0140) vr=FL, vm=1, type=2C
        DcmFloatingPointSingle TableTopPitchAngle;
        /// TableTopPitchRotationDirection (300a,0142) vr=CS, vm=1, type=2C
        DcmCodeString TableTopPitchRotationDirection;
        /// TableTopRollAngle (300a,0144) vr=FL, vm=1, type=2C
        DcmFloatingPointSingle TableTopRollAngle;
        /// TableTopRollRotationDirection (300a,0146) vr=CS, vm=1, type=2C
        DcmCodeString TableTopRollRotationDirection;
        /// TableTopVerticalPosition (300a,0128) vr=DS, vm=1, type=2C
        DcmDecimalString TableTopVerticalPosition;
        /// TreatmentControlPointDate (3008,0024) vr=DA, vm=1, type=1
        DcmDate TreatmentControlPointDate;
        /// TreatmentControlPointTime (3008,0025) vr=TM, vm=1, type=1
        DcmTime TreatmentControlPointTime;

    };

  // --- constructors, destructor and operators ---

    /** (default) constructor
     *  @param emptyDefaultSequence internal flag used to mark the empty default sequence
     */
    DRTIonControlPointDeliverySequence(const OFBool emptyDefaultSequence = OFFalse);

    /** copy constructor
     *  @param copy sequence object to be copied
     */
    DRTIonControlPointDeliverySequence(const DRTIonControlPointDeliverySequence &copy);

    /** destructor
     */
    virtual ~DRTIonControlPointDeliverySequence();

    /** assigment operator
     *  @param copy sequence object to be copied
     */
    DRTIonControlPointDeliverySequence &operator=(const DRTIonControlPointDeliverySequence &copy);

  // --- general methods ---

    /** clear all internal member variables
     */
    void clear();

    /** check if sequence is empty
     *  @return OFTrue if sequence is empty, OFFalse otherwise
     */
    OFBool isEmpty();

    /** check if sequence is valid, i.e.\ not the empty default sequence
     *  @return OFTrue if sequence is valid, OFFalse otherwise
     */
    OFBool isValid() const;

    /** get number of items in the sequence
     *  @return number of items
     */
    unsigned long getNumberOfItems() const;

    /** goto first item in the sequence
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition gotoFirstItem();

    /** goto next item in the sequence
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition gotoNextItem();

    /** goto particular item in the sequence
     *  @param  num  number of the item to be selected (0..num-1)
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition gotoItem(const unsigned long num);

    /** get current item in the sequence
     *  @param  item  reference to item pointer (result variable)
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition getCurrentItem(Item *&item) const;

    /** get current item in the sequence
     *  @return reference to specified item if successful, empty default item otherwise
     */
    Item &getCurrentItem();

    /** get current item in the sequence
     *  @return const reference to specified item if successful, empty default item otherwise
     */
    const Item &getCurrentItem() const;

    /** get particular item in the sequence
     *  @param  num   number of the item to be retrieved (0..num-1)
     *  @param  item  reference to item pointer (result variable)
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition getItem(const unsigned long num, Item *&item);

    /** get particular item in the sequence
     *  @param  num  number of the item to be retrieved (0..num-1)
     *  @return reference to specified item if successful, empty default item otherwise
     */
    Item &getItem(const unsigned long num);

    /** get particular item in the sequence
     *  @param  num  number of the item to be retrieved (0..num-1)
     *  @return const reference to specified item if successful, empty default item otherwise
     */
    const Item &getItem(const unsigned long num) const;

    /** get particular item in the sequence
     *  @param  num  number of the item to be retrieved (0..num-1)
     *  @return reference to specified item if successful, empty default item otherwise
     */
    Item &operator[](const unsigned long num);

    /** get particular item in the sequence
     *  @param  num  number of the item to be retrieved (0..num-1)
     *  @return const reference to specified item if successful, empty default item otherwise
     */
    const Item &operator[](const unsigned long num) const;

    /** add new item to the end of this sequence
     *  @param  item  reference to new item pointer (result variable)
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition addItem(Item *&item);

    /** insert new item into the sequence
     *  @param  pos   position where the new item is to be inserted (0..num)
     *  @param  item  reference to new item pointer (result variable)
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition insertItem(const unsigned long pos, Item *&item);

    /** remove particular item from the sequence
     *  @param  pos  position of the item to be removed (0..num-1)
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition removeItem(const unsigned long pos);

  // --- input/output methods ---

    /** read sequence of items from dataset
     *  @param  dataset     reference to DICOM dataset from which the sequence should be read
     *  @param  card        cardinality (valid range for number of items)
     *  @param  type        value type (valid value: "1", "1C", "2" or something else which is not checked)
     *  @param  moduleName  optional module/sequence name to be printed (default: "RT object" if NULL)
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition read(DcmItem &dataset,
                     const OFString &card,
                     const OFString &type,
                     const char *moduleName = NULL);

    /** write sequence of items to dataset
     *  @param  dataset     reference to DICOM dataset to which the sequence should be written
     *  @param  card        cardinality (valid range for number of items)
     *  @param  type        value type (valid value: "1", "2" or something else which is not checked)
     *  @param  moduleName  optional module/sequence name to be printed (default: "RT object" if NULL)
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition write(DcmItem &dataset,
                      const OFString &card,
                      const OFString &type,
                      const char *moduleName = NULL);

  protected:

    /** goto particular item in the sequence
     *  @param  num       number of the item to be selected (0..num-1)
     *  @param  iterator  list iterator storing the position of the item
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition gotoItem(const unsigned long num,
                         OFListIterator(Item *) &iterator);

    /** goto particular item in the sequence
     *  @param  num       number of the item to be selected (0..num-1)
     *  @param  iterator  list iterator storing the position of the item
     *  @return status, EC_Normal if successful, an error code otherwise
     */
    OFCondition gotoItem(const unsigned long num,
                         OFListConstIterator(Item *) &iterator) const;

  private:

    /// internal flag used to mark the empty default sequence
    /*const*/ OFBool EmptyDefaultSequence;

    /// list of items in this sequence
    OFList<Item *>         SequenceOfItems;
    /// currently selected item
    OFListIterator(Item *) CurrentItem;
    /// empty default item
    Item                   EmptyItem;

};

#endif


text:
#include "src/cpp/posenet/posenet_decoder_op.h"

#include <cmath>
#include <numeric>
#include <string>

#include "flatbuffers/flexbuffers.h"
#include "src/cpp/posenet/posenet_decoder.h"
#include "tensorflow/lite/kernels/internal/tensor.h"
#include "tensorflow/lite/kernels/kernel_util.h"

namespace coral {
namespace posenet_decoder_op {

using tflite::GetInput;
using tflite::GetOutput;
using tflite::GetTensorData;
using tflite::NumDimensions;
using tflite::NumInputs;
using tflite::NumOutputs;

constexpr int kInputTensorHeatmaps = 0;
constexpr int kInputTensorShortOffsets = 1;
constexpr int kInputTensorMidOffsets = 2;

constexpr int kOutputTensorPoseKeypoints = 0;
constexpr int kOutputTensorPoseKeypointScores = 1;
constexpr int kOutputTensorPoseScores = 2;
constexpr int kOutputTensorPoseCount = 3;

struct OpData {
  // Decoder parameters
  int max_detections;
  float score_threshold;
  int stride;
  float nms_radius;

  // Temporary tensors (e.g for dequantized values)
  int heatmaps_float_index;
  int shorts_float_index;
  int mids_float_index;
};

void* Init(TfLiteContext* context, const char* buffer, size_t length) {
  auto* op_data = new OpData;
  const uint8_t* buffer_t = reinterpret_cast<const uint8_t*>(buffer);
  const flexbuffers::Map& m = flexbuffers::GetRoot(buffer_t, length).AsMap();

  op_data->max_detections = m["max_detections"].AsInt32();
  op_data->score_threshold = m["score_threshold"].AsFloat();
  op_data->stride = m["stride"].AsInt32();
  op_data->nms_radius = m["nms_radius"].AsFloat();

  context->AddTensors(context, 1, &op_data->heatmaps_float_index);
  context->AddTensors(context, 1, &op_data->shorts_float_index);
  context->AddTensors(context, 1, &op_data->mids_float_index);
  return op_data;
}

void Free(TfLiteContext* context, void* buffer) {
  delete reinterpret_cast<OpData*>(buffer);
}

TfLiteStatus PrepTempTensor(TfLiteContext* context, int temp_tensor_index,
                            const TfLiteIntArray* dims) {
  TfLiteTensor* temp_tensor = &context->tensors[temp_tensor_index];
  temp_tensor->type = kTfLiteFloat32;
  temp_tensor->allocation_type = kTfLiteArenaRw;
  return context->ResizeTensor(context, temp_tensor, TfLiteIntArrayCopy(dims));
}

TfLiteStatus PrepOutputTensor(TfLiteContext* context,
                              TfLiteTensor* output_tensor,
                              std::initializer_list<int> dims) {
  output_tensor->type = kTfLiteFloat32;
  TfLiteIntArray* size = TfLiteIntArrayCreate(dims.size());
  std::copy(std::begin(dims), std::end(dims), size->data);
  return context->ResizeTensor(context, output_tensor, size);
}

void ScaleFloatTensor(const TfLiteTensor* src, TfLiteTensor* dst, float scale) {
  assert(src->type == kTfLiteFloat32);
  assert(dst->type == kTfLiteFloat32);
  const float* src_data = GetTensorData<float>(src);
  float* dst_data = GetTensorData<float>(dst);
  assert(src_data != nullptr);
  assert(dst_data != nullptr);
  const size_t tensor_elements = src->bytes / sizeof(float);
  for (int idx = 0; idx < tensor_elements; ++idx) {
    dst_data[idx] = src_data[idx] * scale;
  }
}

void DequantizeTensor(const TfLiteTensor* src, TfLiteTensor* dst,
                      float extra_scale = 1.0) {
  if (src->type == kTfLiteUInt8) {
    const int num_elements = src->bytes;
    assert(num_elements * sizeof(float) == dst->bytes);
    const float quant_zero_point = static_cast<float>(src->params.zero_point);
    const float quant_scale = src->params.scale * extra_scale;
    const uint8_t* src_data = GetTensorData<uint8_t>(src);
    assert(src_data != nullptr);
    float* dst_data = GetTensorData<float>(dst);
    assert(dst_data != nullptr);
    for (int idx = 0; idx < num_elements; ++idx) {
      dst_data[idx] = (src_data[idx] - quant_zero_point) * quant_scale;
    }
  } else if (src->type == kTfLiteFloat32) {
    ScaleFloatTensor(src, dst, extra_scale);
  } else {
    assert(false);
  }
}

TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
  auto* op_data = reinterpret_cast<OpData*>(node->user_data);
  TF_LITE_ENSURE_EQ(context, NumInputs(node), 3);
  TF_LITE_ENSURE_EQ(context, NumOutputs(node), 4);

  const TfLiteTensor* heatmaps = GetInput(context, node, kInputTensorHeatmaps);
  const TfLiteTensor* shorts =
      GetInput(context, node, kInputTensorShortOffsets);
  const TfLiteTensor* mids = GetInput(context, node, kInputTensorMidOffsets);

  TF_LITE_ENSURE(context, (heatmaps->type == kTfLiteUInt8 ||  //
                           heatmaps->type == kTfLiteFloat32));
  TF_LITE_ENSURE(context, (shorts->type == kTfLiteUInt8 ||  //
                           shorts->type == kTfLiteFloat32));
  TF_LITE_ENSURE(context, (mids->type == kTfLiteUInt8 ||  //
                           mids->type == kTfLiteFloat32));
  TF_LITE_ENSURE_EQ(context, NumDimensions(heatmaps), 4);
  TF_LITE_ENSURE_EQ(context, NumDimensions(shorts), 4);
  TF_LITE_ENSURE_EQ(context, NumDimensions(mids), 4);
  TF_LITE_ENSURE_EQ(context, heatmaps->dims->data[0], 1);
  TF_LITE_ENSURE_EQ(context, shorts->dims->data[0], 1);
  TF_LITE_ENSURE_EQ(context, mids->dims->data[0], 1);
  TF_LITE_ENSURE_EQ(context, heatmaps->dims->data[3], kNumKeypoints);
  TF_LITE_ENSURE_EQ(context, shorts->dims->data[3], 2 * kNumKeypoints);
  TF_LITE_ENSURE_EQ(context, mids->dims->data[3], 2 * 2 * kNumEdges);

  // Temporary tensors
  TfLiteIntArrayFree(node->temporaries);
  node->temporaries = TfLiteIntArrayCreate(3);
  node->temporaries->data[0] = op_data->heatmaps_float_index;
  node->temporaries->data[1] = op_data->shorts_float_index;
  node->temporaries->data[2] = op_data->mids_float_index;

  TF_LITE_ENSURE_OK(
      context,
      PrepTempTensor(context, op_data->heatmaps_float_index, heatmaps->dims));
  TF_LITE_ENSURE_OK(
      context,
      PrepTempTensor(context, op_data->shorts_float_index, shorts->dims));
  TF_LITE_ENSURE_OK(
      context, PrepTempTensor(context, op_data->mids_float_index, mids->dims));

  // Output tensor 0 will be max_detections*kNumKeypoints*2
  // The last dimension has the x and y coordinates of each keypoint.
  TF_LITE_ENSURE_OK(
      context,
      PrepOutputTensor(context,
                       GetOutput(context, node, kOutputTensorPoseKeypoints),
                       {1, op_data->max_detections, kNumKeypoints, 2}));

  // Output tensor 1 to be size max_detections*kNumKeypoints and contain
  // keypoints scores in the range [0,1].
  TF_LITE_ENSURE_OK(
      context,
      PrepOutputTensor(
          context, GetOutput(context, node, kOutputTensorPoseKeypointScores),
          {1, op_data->max_detections, kNumKeypoints}));

  // Output tensor 2 to be size max_detections and contain
  // pose scores in the range [0,1].

  TF_LITE_ENSURE_OK(
      context, PrepOutputTensor(
                   context, GetOutput(context, node, kOutputTensorPoseScores),
                   {1, op_data->max_detections}));

  // Output Tensor 3 is an int32 scalar, the number of detected poses.
  // Currently only float output tensors are supported so save this as a float.
  TF_LITE_ENSURE_OK(
      context,
      PrepOutputTensor(context,
                       GetOutput(context, node, kOutputTensorPoseCount), {1}));

  return kTfLiteOk;
}

TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
  auto* op_data = reinterpret_cast<OpData*>(node->user_data);

  TF_LITE_ENSURE(context, op_data->stride > 0);
  const TfLiteTensor* heatmaps = GetInput(context, node, kInputTensorHeatmaps);
  const TfLiteTensor* shorts =
      GetInput(context, node, kInputTensorShortOffsets);
  const TfLiteTensor* mids = GetInput(context, node, kInputTensorMidOffsets);

  // Dequantize (and rescale) input tensors

  TfLiteTensor* heatmaps_float =
      &context->tensors[op_data->heatmaps_float_index];
  TfLiteTensor* shorts_float = &context->tensors[op_data->shorts_float_index];
  TfLiteTensor* mids_float = &context->tensors[op_data->mids_float_index];

  DequantizeTensor(heatmaps, heatmaps_float);
  DequantizeTensor(shorts, shorts_float, 1.0 / op_data->stride);
  DequantizeTensor(mids, mids_float, 1.0 / op_data->stride);

  const float* heatmaps_data = GetTensorData<float>(heatmaps_float);
  const float* mids_data = GetTensorData<float>(mids_float);
  const float* shorts_data = GetTensorData<float>(shorts_float);

  TfLiteTensor* pose_keypoints =
      GetOutput(context, node, kOutputTensorPoseKeypoints);
  TfLiteTensor* pose_keypoint_scores =
      GetOutput(context, node, kOutputTensorPoseKeypointScores);
  TfLiteTensor* pose_scores = GetOutput(context, node, kOutputTensorPoseScores);
  TfLiteTensor* pose_count = GetOutput(context, node, kOutputTensorPoseCount);
  float* pose_keypoints_data = GetTensorData<float>(pose_keypoints);
  float* pose_keypoint_scores_data = GetTensorData<float>(pose_keypoint_scores);
  float* pose_scores_data = GetTensorData<float>(pose_scores);
  float* pose_count_data = GetTensorData<float>(pose_count);

  const float nms_radius = op_data->nms_radius / op_data->stride;
  pose_count_data[0] = DecodeAllPoses(
      heatmaps_data, shorts_data, mids_data,
      /*height = */ heatmaps_float->dims->data[1],
      /*width = */ heatmaps_float->dims->data[2], op_data->max_detections,
      op_data->score_threshold,
      /*mid_short_offset_refinement_steps = */ 5, nms_radius, op_data->stride,
      reinterpret_cast<PoseKeypoints*>(pose_keypoints_data),
      reinterpret_cast<PoseKeypointScores*>(pose_keypoint_scores_data),
      pose_scores_data);

  return kTfLiteOk;
}

}  // namespace posenet_decoder_op

TfLiteRegistration* RegisterPosenetDecoderOp() {
  static TfLiteRegistration r = {
      posenet_decoder_op::Init, posenet_decoder_op::Free,
      posenet_decoder_op::Prepare, posenet_decoder_op::Eval};
  return &r;
}

}  // namespace coral


text:
using JavaScriptEngineSwitcher.Core;
using System.Web.Mvc;
using System.Web.Routing;

namespace Website {
    public class MvcApplication : System.Web.HttpApplication {
        protected void Application_Start() {
            AreaRegistration.RegisterAllAreas();
            JsEngineSwitcherConfig.Configure(JsEngineSwitcher.Instance);
            BundlerConfig.Configure();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
    }
}


text:
"""
test_arpspoof
----------------------------------

Tests for `arpspoof` module.
"""

import unittest

from arpspoof import arpspoof

class TestArpspoof(unittest.TestCase):

    def setUp(self):
        pass

    def test_something(self):
        pass

    def tearDown(self):
        pass

if __name__ == '__main__':
    unittest.main()


text:
/*
 * patNetworkBike.cc
 *
 *  Created on: Oct 28, 2011
 *      Author: jchen
 */

#include "patNetworkBike.h"

#include "patNBParameters.h"
#include "patNetworkElements.h"
#include <map>
#include "patWay.h"
#include "patType.h"
#include "patDisplay.h"

patNetworkBike::patNetworkBike(){
	m_transport_mode=TransportMode(BIKE);
}
void patNetworkBike::getFromNetwork(patNetworkElements* network, patGeoBoundingBox bb) {
	DEBUG_MESSAGE("read bike network");
	unsigned long bike_way_count = 0;
	unsigned long not_bike_way_count = 0;

	const map<unsigned long, patWay>* all_ways = network->getWays();

	for (map<unsigned long, patWay>::const_iterator way_iter =
			all_ways->begin(); way_iter != all_ways->end(); ++way_iter) {
		signed short int bike_way_indicator = way_iter->second.isBikeOneWay();
		if (bike_way_indicator == -2) {
			++not_bike_way_count;
			//DEBUG_MESSAGE("Not a car way;");

		} else if (bike_way_indicator == 0) {
			bike_way_count += 2;
			addWay(&(way_iter->second), false);
			addWay(&(way_iter->second), true);
		} else {
			WARNING("wrong indicator" << bike_way_indicator);
		}

	}
	DEBUG_MESSAGE("bike  way: " << bike_way_count * 2);
	DEBUG_MESSAGE("not bike way: " << not_bike_way_count);
	return;
}

patNetworkBike::~patNetworkBike() {

}

double patNetworkBike::getMinSpeed() const{
	return patNBParameters::the()->bikeNetworkMinSpeed;
}
double patNetworkBike::getMaxSpeed() const{

	return patNBParameters::the()->bikeNetworkMaxSpeed;
}


text:
<ion-content>
  <ion-badge class="dayBadge" [color]="days[0].selected ? 'primary' : 'light'" (click)=toggleDay(0)>
    {{'DAYS.MONDAY' | translate }} </ion-badge>
  <ion-badge class="dayBadge" [color]="days[1].selected ? 'primary' : 'light'" (click)=toggleDay(1)>
    {{'DAYS.TUESDAY' | translate }} </ion-badge>
  <ion-badge class="dayBadge" [color]="days[2].selected ? 'primary' : 'light'" (click)=toggleDay(2)>
    {{'DAYS.WEDNESDAY' | translate }} </ion-badge>
  <ion-badge class="dayBadge" [color]="days[3].selected ? 'primary' : 'light'" (click)=toggleDay(3)>
    {{'DAYS.THURSDAY' | translate }} </ion-badge>
  <ion-badge class="dayBadge" [color]="days[4].selected ? 'primary' : 'light'" (click)=toggleDay(4)>
    {{'DAYS.FRIDAY' | translate }} </ion-badge>
  <ion-badge class="dayBadge" [color]="days[5].selected ? 'primary' : 'light'" (click)=toggleDay(5)>
    {{'DAYS.SATURDAY' | translate }} </ion-badge>
  <ion-badge class="dayBadge" [color]="days[6].selected ? 'primary' : 'light'" (click)=toggleDay(6)>
    {{'DAYS.SUNDAY' | translate }} </ion-badge>

  <div *ngIf="!dayIsSelected" class="alertSelectADay"> {{'OPENINGHOURS.SELECT_AT_LEAST_ONE_DAY' | translate }} </div>

  <div *ngFor="let time of times; let index = index">

    <ion-list>
      <ion-item>
        <ion-label> {{'OPENINGHOURS.START_TIME' | translate }} </ion-label>
        <ion-datetime display-format="HH:mm" picker-format="HH:mm" [(ngModel)]="time.start"></ion-datetime>
      </ion-item>

      <ion-item>
        <ion-label>{{'OPENINGHOURS.END_TIME' | translate }}</ion-label>
        <ion-datetime display-format="HH:mm" picker-format="HH:mm" [(ngModel)]="time.end"></ion-datetime>
      </ion-item>
    </ion-list>
    <ion-button color="danger" (click)="removeInteval(index)"> {{'OPENINGHOURS.DELETE_INTERVAL' | translate }}
    </ion-button>

  </div>

  <ion-button color="success" (click)="addNewInteval()"> {{'OPENINGHOURS.ADD_INTERVAL' | translate }} </ion-button>

</ion-content>

<ion-footer id="footer">
  <ion-button color="warning" (click)="cancel()">Cancel</ion-button>
  <ion-button (click)="submit(times, days)" [disabled]="!dayIsSelected || times.length == 0">Submit</ion-button>
</ion-footer>


text:
package krawczls.executionEngineRegistry;

import java.util.Comparator;

public class WorkflowEngineCompareByActiveProcesses implements Comparator<WorkflowEngine> {
	public int compare(WorkflowEngine engine1, WorkflowEngine engine2) {
		return ((Integer) engine1.numberOfActiveProcesses()).compareTo( ((Integer) engine2.numberOfActiveProcesses()) );
	}
}


text:
<?php

/**
 * CLI response.
 *
 * This is a value object that represents a generic CLI response.
 * It prints the response body and exit with the given status.
 *
 * @author  Ricky Christie <seven.rchristie@gmail.com>
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
 *
 */

namespace Carrot\Response;

class CLIResponse implements ResponseInterface
{
    /**
     * @var string The body of the response, to be printed out to the
     *      console.
     */
    protected $body;

    /**
     * @var int The exit status number.
     */
    protected $exitStatus;

    /**
     * Constructor.
     *
     * @param string $body The body of the response, to be printed
     *        out to the console.
     * @param int $exitStatus The exit status number.
     *
     */
    public function __construct($body, $exitStatus = 0)
    {
        $this->body = $body;
        $this->exitStatus = (int) $exitStatus;
    }

    /**
     * Send the response to the client.
     *
     * Exits with the status code given at object construction.
     *
     */
    public function send()
    {
        echo $this->body;
        exit($this->exitStatus);
    }
}