answer
stringlengths 15
1.25M
|
|---|
#! /bin/bash
# -*- OpenSAF -*-
# This program is distributed in the hope that it will be useful, but
# See the Copying file included with the OpenSAF distribution for full
# licensing terms.
# The parameters in this file are inputs to run_osaf_tests.sh.
# Supply a file like this for the -e option envfile, or
# omit it and use the default settings.
# Where OpenSAF is installed:
OPENSAF_ROOT=${PWD%%tests*}
OPENSAF_CONF=/etc/opensaf
OPENSAF_VAR=/var/lib/opensaf
# Where test results go:
OPENSAF_TET_RESULT=$PWD/results
# Where test log saved:
OPENSAF_TET_LOG=/tmp/tccdlog
# The architecture of the machine where the tests are run;
# used by the tests to find executables with names of the
# form "*_${TARGET_ARCH}.exe"
#TARGET_ARCH=
# Where tetware objects are installed:
TET_ROOT=/usr/local/tet
# Where opensaf tests are installed:
TET_BASE_DIR=$PWD
export PATH=$PATH:${TET_ROOT}/bin
|
// Import section
// STL
#include <cassert>
// STDAIR
#include <stdair/bom/SegmentDate.hpp>
// AIRINV
#include <airinv/bom/SegmentStruct.hpp>
namespace AIRINV {
const std::string SegmentStruct::describe() const {
std::ostringstream ostr;
ostr << " " << _boardingPoint << " / "
<< boost::posix_time::to_simple_string(_boardingTime)
<< " -- " << _offPoint << " / "
<< boost::posix_time::to_simple_string(_offTime)
<< "
<< boost::posix_time::to_simple_string(_elapsed)
<< std::endl;
for (<API key>::const_iterator itCabin =
_cabinList.begin(); itCabin != _cabinList.end(); itCabin++) {
const SegmentCabinStruct& lCabin = *itCabin;
ostr << lCabin.describe();
}
ostr << std::endl;
return ostr.str();
}
void SegmentStruct::fill (stdair::SegmentDate& ioSegmentDate) const {
// Set the Boarding Date
ioSegmentDate.setBoardingDate (_offDate);
// Set the Boarding Time
ioSegmentDate.setBoardingTime (_boardingTime);
// Set the Off Date
ioSegmentDate.setOffDate (_offDate);
// Set the Off Time
ioSegmentDate.setOffTime (_offTime);
// Set the Elapsed Time
ioSegmentDate.setElapsedTime (_elapsed);
}
}
|
#ifndef <API key>
#define <API key>
#if ENABLE(FTL_JIT)
#include "DFGNodeType.h"
#include "<API key>.h"
#include "FTLExitValue.h"
#include <wtf/Noncopyable.h>
namespace JSC {
class TrackedReferences;
namespace FTL {
class <API key> {
<API key>(<API key>)
public:
<API key>(DFG::NodeType, CodeOrigin);
~<API key>();
void add(DFG::<API key>, const ExitValue&);
DFG::NodeType type() const { return m_type; }
CodeOrigin origin() const { return m_origin; }
ExitValue get(DFG::<API key>) const;
const Vector<ExitPropertyValue>& properties() const { return m_properties; }
void <API key>(int offset);
void dump(PrintStream& out) const;
void validateReferences(const TrackedReferences&) const;
private:
DFG::NodeType m_type;
CodeOrigin m_origin;
Vector<ExitPropertyValue> m_properties;
};
} } // namespace JSC::FTL
#endif // ENABLE(FTL_JIT)
#endif // <API key>
|
// library.C
// This file is part of Daisy.
// Daisy is free software; you can redistribute it and/or modify
// (at your option) any later version.
// Daisy is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// along with Daisy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define BUILD_DLL
#include "library.h"
#include "block_model.h"
#include "treelog.h"
#include "assertion.h"
#include "memutils.h"
#include "frame_model.h"
#include "filepos.h"
#include <map>
#include <sstream>
struct Library::Implementation
{
const symbol name;
symbol description;
// Types.
typedef std::map<symbol, boost::shared_ptr<const FrameModel>> frame_map;
typedef std::map<symbol, std::set<symbol>> ancestor_map;
// Data (remember to update Library::clone if you change this).
frame_map frames;
std::vector<doc_fun> doc_funs;
ancestor_map ancestors;
// Accessors.
const FrameModel& model (symbol) const;
bool check (symbol) const;
void add_ancestors (symbol);
void add_model (symbol, boost::shared_ptr<const FrameModel>);
void entries (std::vector<symbol>&) const;
void remove (symbol);
void clear_parsed ();
void refile_parsed (const std::string& from, const std::string& to);
static void load_syntax (Frame&);
Implementation (const symbol n);
~Implementation ();
};
const FrameModel&
Library::Implementation::model (const symbol key) const
{
frame_map::const_iterator i = frames.find (key);
if (i == frames.end ())
daisy_panic ("Model '" + key.name () + "' not in library '"
+ name.name () + "'");
return *(*i).second;
}
bool
Library::Implementation::check (const symbol key) const
{
frame_map::const_iterator i = frames.find (key);
if (i == frames.end ())
return false;
return true;
}
void
Library::Implementation::add_ancestors (const symbol key)
{
std::set<symbol> all;
symbol current = key;
while (true)
{
if (all.find (current) != all.end ())
daisy_panic ("Cyclic inheritence '" + current
+ "' for '" + key + "' in library '" + name + "'");
all.insert (current);
if (!check (current))
break;
const Frame& frame = this->model (current);
symbol next = frame.base_name ();
if (next == Attribute::None ())
break;
daisy_assert (next != current);
current = next;
}
ancestors[key] = all;
}
void
Library::Implementation::add_model (const symbol key,
boost::shared_ptr<const FrameModel> frame)
{
if (frame->type_name () != key)
daisy_panic ("Adding frame named "
+ frame->type_name () + " under the name "
+ key + ", type " + typeid (*frame).name ());
frames[key] = frame;
add_ancestors (key);
}
void
Library::Implementation::entries (std::vector<symbol>& result) const
{
for (frame_map::const_iterator i = frames.begin ();
i != frames.end ();
i++)
{
result.push_back ((*i).first);
}
}
void
Library::Implementation::remove (const symbol key)
{
const frame_map::iterator i = frames.find (key);
frames.erase (i);
}
void
Library::Implementation::clear_parsed ()
{
retry:
for (frame_map::iterator i = frames.begin (); i != frames.end (); i++)
{
const Frame& frame = *((*i).second);
if (frame.own_position () != Filepos::none ())
{
const symbol key = (*i).first;
frames.erase (i);
goto retry;
}
}
}
#if 0
void
Library::Implementation::refile_parsed (const std::string& from, const std::string& to)
{
daisy_assert (from != to);
for (frame_map::iterator i = frames.begin (); i != frames.end (); i++)
{
const Frame& frame = *((*i).second);
const Filepos& pos = frame.own_position ();
if (pos.filename () == from)
frame.reposition (Filepos (to, pos.line (), pos.column ()));
}
}
#endif
Library::Implementation::Implementation (const symbol n)
: name (symbol (n))
{ }
Library::Implementation::~Implementation ()
{ }
void
Library::clear_parsed ()
{ impl->clear_parsed (); }
#if 0
void
Library::refile_parsed (const std::string& from, const std::string& to)
{ impl->refile_parsed (from, to); }
#endif
symbol
Library::name () const
{ return impl->name; }
symbol
Library::description () const
{ return impl->description; }
const FrameModel&
Library::model (const symbol key) const
{ return impl->model (key); }
bool
Library::check (const symbol key) const
{ return impl->check (key); }
bool
Library::complete (const Metalib& metalib, const symbol key) const
{
if (!check (key))
return false;
const FrameModel& frame = model (key);
if (!frame.check (metalib, Treelog::null ()))
return false;
if (!frame.buildable ())
return false;
return true;
}
void
Library::add_model (const symbol key, boost::shared_ptr<const FrameModel> frame)
{ impl->add_model (key, frame); }
void
Library::entries (std::vector<symbol>& result) const
{ impl->entries (result); }
const std::set<symbol>&
Library::ancestors (symbol key) const
{ return impl->ancestors[key]; }
bool
Library::is_derived_from (const symbol a, const symbol b) const
{
if (a == b)
return true;
const FrameModel& frame = this->model (a);
if (frame.type_name () != a)
daisy_panic ("'" + a + "' in library present itself as a '"
+ frame.type_name () + "', maybe because it is a "
+ typeid (frame).name ());
const symbol type = frame.base_name ();
if (type == Attribute::None ())
return false;
if (type == b)
return true;
if (!check (type))
daisy_panic ("'" + a + "' is derived from non-existing '" + type
+ "', rather than '" + b + "'");
if (type == a)
daisy_panic ("'" + a + "' is derived from itself");
return is_derived_from (type, b);
}
const symbol
Library::base_model (const symbol parameterization) const
{
const FrameModel& al = this->model (parameterization);
const symbol base = al.base_name ();
daisy_assert (base != parameterization);
if (base != Attribute::None ())
return base_model (base);
return parameterization;
}
bool
Library::<API key> (const Frame& frame) const
{
// A missing description is boring.
const symbol my_d = frame.description ();
if (my_d == Attribute::None ())
return false;
// Top level description are always interesting.
const symbol base_name = frame.base_name ();
if (base_name == Attribute::None ())
return true;
// If the model has no description, this one is interesting.
if (!check (base_name))
{
daisy_bug (name () + " does not have '" + base_name + "' defined");
return true;
}
daisy_assert (check (base_name));
const Frame& super = model (base_name);
// If the model description is different, this one is interesting.
return my_d != super.description ();
}
void
Library::add_doc_fun (doc_fun fun)
{ impl->doc_funs.push_back (fun); }
std::vector<Library::doc_fun>&
Library::doc_funs () const
{ return impl->doc_funs; }
void
Library::remove (const symbol key)
{ impl->remove (key); }
void
Library::set_description (const symbol description)
{ impl->description = description; }
Library*
Library::clone () const
{
Library *const lib = new Library (impl->name.name ().c_str ());
lib->set_description (impl->description);
lib->impl->frames = impl->frames;
lib->impl->doc_funs = impl->doc_funs;
lib->impl->ancestors = impl->ancestors;
return lib;
}
Library::Library (const symbol name)
: impl (new Implementation (name))
{ }
Library::~Library ()
{ }
// library.C ends here
|
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script>
function test()
{
function TestView(viewName)
{
WebInspector.View.call(this);
this._viewName = viewName;
InspectorTest.addResult(this._viewName + "()");
}
TestView.prototype = {
show: function(parentElement)
{
InspectorTest.addResult(this._viewName + ".show()");
WebInspector.View.prototype.show.call(this, parentElement);
},
detach: function()
{
InspectorTest.addResult(this._viewName + ".detach()");
WebInspector.View.prototype.detach.call(this);
},
doResize: function()
{
InspectorTest.addResult(this._viewName + ".doResize()");
WebInspector.View.prototype.doResize.call(this);
},
wasShown: function()
{
InspectorTest.addResult(" " + this._viewName + ".wasShown()");
},
willHide: function()
{
InspectorTest.addResult(" " + this._viewName + ".willHide()");
},
onResize: function()
{
InspectorTest.addResult(" " + this._viewName + ".onResize()");
}
};
TestView.prototype.__proto__ = WebInspector.View.prototype;
InspectorTest.runTestSuite([
function testShowView(next)
{
var view = new TestView("View");
view.show(WebInspector.inspectorView.element);
view.detach();
next();
},
function testAppendViaDOM(next)
{
try {
var view = new TestView("View");
document.body.appendChild(view.element);
} catch (e) {
InspectorTest.addResult(e);
}
next();
},
function testInsertViaDOM(next)
{
try {
var view = new TestView("View");
document.body.insertBefore(view.element, null);
} catch (e) {
InspectorTest.addResult(e);
}
next();
},
function <API key>(next)
{
try {
var view = new TestView("View");
var div = document.createElement("div");
view.show(div);
} catch (e) {
InspectorTest.addResult(e);
}
next();
},
function testImmediateParent(next)
{
var parentView = new TestView("Parent");
var childView = new TestView("Child");
childView.show(parentView.element);
if (childView._parentView === parentView)
InspectorTest.addResult("OK");
else
InspectorTest.addResult("FAILED");
next();
},
function testDistantParent(next)
{
var parentView = new TestView("Parent");
var div = document.createElement("div");
parentView.element.appendChild(div);
var childView = new TestView("Child");
childView.show(div);
if (childView._parentView === parentView)
InspectorTest.addResult("OK");
else
InspectorTest.addResult("FAILED");
next();
},
function testEvents(next)
{
var parentView = new TestView("Parent");
parentView.markAsRoot();
var childView = new TestView("Child");
parentView.show(WebInspector.inspectorView.element);
parentView.doResize();
childView.show(parentView.element);
parentView.doResize();
parentView.detach();
parentView.show(WebInspector.inspectorView.element);
childView.detach();
parentView.detach();
next();
},
function <API key>(next)
{
var parentView = new TestView("Parent");
var childView = new TestView("Child");
childView.setHideOnDetach();
parentView.show(WebInspector.inspectorView.element);
parentView.doResize();
childView.show(parentView.element);
parentView.doResize();
parentView.detach();
parentView.show(WebInspector.inspectorView.element);
childView.detach();
parentView.detach();
next();
},
function testViewCounter(next)
{
var parentView = new TestView("Parent");
parentView.show(WebInspector.inspectorView.element);
var childView = new TestView("Child");
childView.show(parentView.element);
InspectorTest.addResult(" view counter: " + parentView.element.__viewCounter);
var childView2 = new TestView("Child 2");
childView2.show(parentView.element);
InspectorTest.addResult(" view counter: " + parentView.element.__viewCounter);
childView.detach();
InspectorTest.addResult(" view counter: " + parentView.element.__viewCounter);
childView2.detach();
InspectorTest.addResult(" view counter: " + parentView.element.__viewCounter);
next();
},
function testRemoveChild(next)
{
var parentView = new TestView("Parent");
parentView.show(WebInspector.inspectorView.element);
var childView = new TestView("Child");
childView.show(parentView.element);
try {
parentView.element.removeChild(childView.element);
} catch (e) {
InspectorTest.addResult(e);
}
next();
},
function <API key>(next)
{
var parentView = new TestView("Parent");
var div = document.createElement("div");
parentView.element.appendChild(div);
var childView = new TestView("Child");
childView.show(div);
try {
parentView.element.removeChild(div);
} catch (e) {
InspectorTest.addResult(e);
}
next();
},
function testRemoveChildren(next)
{
var parentView = new TestView("Parent");
var childView = new TestView("Child");
childView.show(parentView.element);
parentView.element.appendChild(document.createElement("div"));
try {
parentView.element.removeChildren();
} catch (e) {
InspectorTest.addResult(e);
}
next();
},
function <API key>(next)
{
var parentView = new TestView("Parent");
var div = document.createElement("div");
parentView.element.appendChild(div);
var childView = new TestView("Child");
childView.show(div);
try {
parentView.element.removeChildren();
} catch (e) {
InspectorTest.addResult(e);
}
next();
}
]);
}
</script>
</head>
<body onload="runTest()">
<p>
This tests that events are properly propagated through View hierarchy.
</p>
</body>
</html>
|
// @sect3{Include files}
// We start by including all the necessary deal.II header files and some C++
// related ones. Each one of them has been discussed in previous tutorial
// programs, so we will not get into details here.
#include <deal.II/base/parameter_handler.h>
#include <deal.II/base/point.h>
#include <deal.II/base/function.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/multithread_info.h>
#include <deal.II/base/thread_management.h>
#include <deal.II/base/work_stream.h>
#include <deal.II/base/parallel.h>
#include <deal.II/base/utilities.h>
#include <deal.II/base/conditional_ostream.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/precondition.h>
#include <deal.II/lac/solver_gmres.h>
#include <deal.II/lac/sparse_ilu.h>
#include <deal.II/lac/sparse_direct.h>
#include <deal.II/lac/constraint_matrix.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/tria_boundary_lib.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/dofs/dof_renumbering.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/fe_tools.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/numerics/matrix_tools.h>
#include <deal.II/numerics/vector_tools.h>
#include <deal.II/numerics/data_out.h>
#include <fstream>
#include <cmath>
#include <iostream>
// Finally this is as in all previous programs:
namespace Step35
{
using namespace dealii;
// @sect3{Run time parameters}
// Since our method has several parameters that can be fine-tuned we put
// them into an external file, so that they can be determined at run-time.
// This includes, in particular, the formulation of the equation for the
// auxiliary variable $\phi$, for which we declare an <code>enum</code>.
// Next, we declare a class that is going to read and store all the
// parameters that our program needs to run.
namespace RunTimeParameters
{
enum MethodFormulation
{
METHOD_STANDARD,
METHOD_ROTATIONAL
};
class Data_Storage
{
public:
Data_Storage();
~Data_Storage();
void read_data (const char *filename);
MethodFormulation form;
double initial_time,
final_time,
Reynolds;
double dt;
unsigned int n_global_refines,
pressure_degree;
unsigned int vel_max_iterations,
vel_Krylov_size,
vel_off_diagonals,
vel_update_prec;
double vel_eps,
vel_diag_strength;
bool verbose;
unsigned int output_interval;
protected:
ParameterHandler prm;
};
// In the constructor of this class we declare all the parameters. The
// details of how this works have been discussed elsewhere, for example in
// step-19 and step-29.
Data_Storage::Data_Storage()
{
prm.declare_entry ("Method_Form", "rotational",
Patterns::Selection ("rotational|standard"),
" Used to select the type of method that we are going "
"to use. ");
prm.enter_subsection ("Physical data");
{
prm.declare_entry ("initial_time", "0.",
Patterns::Double (0.),
" The initial time of the simulation. ");
prm.declare_entry ("final_time", "1.",
Patterns::Double (0.),
" The final time of the simulation. ");
prm.declare_entry ("Reynolds", "1.",
Patterns::Double (0.),
" The Reynolds number. ");
}
prm.leave_subsection();
prm.enter_subsection ("Time step data");
{
prm.declare_entry ("dt", "5e-4",
Patterns::Double (0.),
" The time step size. ");
}
prm.leave_subsection();
prm.enter_subsection ("Space discretization");
{
prm.declare_entry ("n_of_refines", "0",
Patterns::Integer (0, 15),
" The number of global refines we do on the mesh. ");
prm.declare_entry ("pressure_fe_degree", "1",
Patterns::Integer (1, 5),
" The polynomial degree for the pressure space. ");
}
prm.leave_subsection();
prm.enter_subsection ("Data solve velocity");
{
prm.declare_entry ("max_iterations", "1000",
Patterns::Integer (1, 1000),
" The maximal number of iterations GMRES must make. ");
prm.declare_entry ("eps", "1e-12",
Patterns::Double (0.),
" The stopping criterion. ");
prm.declare_entry ("Krylov_size", "30",
Patterns::Integer(1),
" The size of the Krylov subspace to be used. ");
prm.declare_entry ("off_diagonals", "60",
Patterns::Integer(0),
" The number of off-diagonal elements ILU must "
"compute. ");
prm.declare_entry ("diag_strength", "0.01",
Patterns::Double (0.),
" Diagonal strengthening coefficient. ");
prm.declare_entry ("update_prec", "15",
Patterns::Integer(1),
" This number indicates how often we need to "
"update the preconditioner");
}
prm.leave_subsection();
prm.declare_entry ("verbose", "true",
Patterns::Bool(),
" This indicates whether the output of the solution "
"process should be verbose. ");
prm.declare_entry ("output_interval", "1",
Patterns::Integer(1),
" This indicates between how many time steps we print "
"the solution. ");
}
Data_Storage::~Data_Storage()
{}
void Data_Storage::read_data (const char *filename)
{
std::ifstream file (filename);
AssertThrow (file, ExcFileNotOpen (filename));
prm.read_input (file);
if (prm.get ("Method_Form") == std::string ("rotational"))
form = METHOD_ROTATIONAL;
else
form = METHOD_STANDARD;
prm.enter_subsection ("Physical data");
{
initial_time = prm.get_double ("initial_time");
final_time = prm.get_double ("final_time");
Reynolds = prm.get_double ("Reynolds");
}
prm.leave_subsection();
prm.enter_subsection ("Time step data");
{
dt = prm.get_double ("dt");
}
prm.leave_subsection();
prm.enter_subsection ("Space discretization");
{
n_global_refines = prm.get_integer ("n_of_refines");
pressure_degree = prm.get_integer ("pressure_fe_degree");
}
prm.leave_subsection();
prm.enter_subsection ("Data solve velocity");
{
vel_max_iterations = prm.get_integer ("max_iterations");
vel_eps = prm.get_double ("eps");
vel_Krylov_size = prm.get_integer ("Krylov_size");
vel_off_diagonals = prm.get_integer ("off_diagonals");
vel_diag_strength = prm.get_double ("diag_strength");
vel_update_prec = prm.get_integer ("update_prec");
}
prm.leave_subsection();
verbose = prm.get_bool ("verbose");
output_interval = prm.get_integer ("output_interval");
}
}
// @sect3{Equation data}
// In the next namespace, we declare the initial and boundary conditions:
namespace EquationData
{
// As we have chosen a completely decoupled formulation, we will not take
// advantage of deal.II's capabilities to handle vector valued
// problems. We do, however, want to use an interface for the equation
// data that is somehow dimension independent. To be able to do that, our
// functions should be able to know on which spatial component we are
// currently working, and we should be able to have a common interface to
// do that. The following class is an attempt in that direction.
template <int dim>
class <API key>: public Function<dim>
{
public:
<API key> (const double initial_time = 0.);
void set_component (const unsigned int d);
protected:
unsigned int comp;
};
template <int dim>
<API key><dim>::
<API key> (const double initial_time)
:
Function<dim> (1, initial_time), comp(0)
{}
template <int dim>
void <API key><dim>::set_component(const unsigned int d)
{
Assert (d<dim, ExcIndexRange (d, 0, dim));
comp = d;
}
// With this class defined, we declare classes that describe the boundary
// conditions for velocity and pressure:
template <int dim>
class Velocity : public <API key><dim>
{
public:
Velocity (const double initial_time = 0.0);
virtual double value (const Point<dim> &p,
const unsigned int component = 0) const;
virtual void value_list (const std::vector< Point<dim> > &points,
std::vector<double> &values,
const unsigned int component = 0) const;
};
template <int dim>
Velocity<dim>::Velocity (const double initial_time)
:
<API key><dim> (initial_time)
{}
template <int dim>
void Velocity<dim>::value_list (const std::vector<Point<dim> > &points,
std::vector<double> &values,
const unsigned int) const
{
const unsigned int n_points = points.size();
Assert (values.size() == n_points,
<API key> (values.size(), n_points));
for (unsigned int i=0; i<n_points; ++i)
values[i] = Velocity<dim>::value (points[i]);
}
template <int dim>
double Velocity<dim>::value (const Point<dim> &p,
const unsigned int) const
{
if (this->comp == 0)
{
const double Um = 1.5;
const double H = 4.1;
return 4.*Um*p(1)*(H - p(1))/(H*H);
}
else
return 0.;
}
template <int dim>
class Pressure: public Function<dim>
{
public:
Pressure (const double initial_time = 0.0);
virtual double value (const Point<dim> &p,
const unsigned int component = 0) const;
virtual void value_list (const std::vector< Point<dim> > &points,
std::vector<double> &values,
const unsigned int component = 0) const;
};
template <int dim>
Pressure<dim>::Pressure (const double initial_time)
:
Function<dim> (1, initial_time)
{}
template <int dim>
double Pressure<dim>::value (const Point<dim> &p,
const unsigned int) const
{
return 25.-p(0);
}
template <int dim>
void Pressure<dim>::value_list (const std::vector<Point<dim> > &points,
std::vector<double> &values,
const unsigned int) const
{
const unsigned int n_points = points.size();
Assert (values.size() == n_points, <API key> (values.size(), n_points));
for (unsigned int i=0; i<n_points; ++i)
values[i] = Pressure<dim>::value (points[i]);
}
}
// @sect3{The <code><API key></code> class}
// Now for the main class of the program. It implements the various versions
// of the projection method for Navier-Stokes equations. The names for all
// the methods and member variables should be self-explanatory, taking into
// account the implementation details given in the introduction.
template <int dim>
class <API key>
{
public:
<API key> (const RunTimeParameters::Data_Storage &data);
void run (const bool verbose = false,
const unsigned int n_plots = 10);
protected:
RunTimeParameters::MethodFormulation type;
const unsigned int deg;
const double dt;
const double t_0, T, Re;
EquationData::Velocity<dim> vel_exact;
std::map<types::global_dof_index, double> boundary_values;
std::vector<types::boundary_id> boundary_indicators;
Triangulation<dim> triangulation;
FE_Q<dim> fe_velocity;
FE_Q<dim> fe_pressure;
DoFHandler<dim> <API key>;
DoFHandler<dim> <API key>;
QGauss<dim> quadrature_pressure;
QGauss<dim> quadrature_velocity;
SparsityPattern <API key>;
SparsityPattern <API key>;
SparsityPattern <API key>;
SparseMatrix<double> <API key>;
SparseMatrix<double> vel_it_matrix[dim];
SparseMatrix<double> vel_Mass;
SparseMatrix<double> vel_Laplace;
SparseMatrix<double> vel_Advection;
SparseMatrix<double> pres_Laplace;
SparseMatrix<double> pres_Mass;
SparseMatrix<double> pres_Diff[dim];
SparseMatrix<double> pres_iterative;
Vector<double> pres_n;
Vector<double> pres_n_minus_1;
Vector<double> phi_n;
Vector<double> phi_n_minus_1;
Vector<double> u_n[dim];
Vector<double> u_n_minus_1[dim];
Vector<double> u_star[dim];
Vector<double> force[dim];
Vector<double> v_tmp;
Vector<double> pres_tmp;
Vector<double> rot_u;
SparseILU<double> prec_velocity[dim];
SparseILU<double> prec_pres_Laplace;
SparseDirectUMFPACK prec_mass;
SparseDirectUMFPACK prec_vel_mass;
DeclException2 (ExcInvalidTimeStep,
double, double,
<< " The time step " << arg1 << " is out of range."
<< std::endl
<< " The permitted range is (0," << arg2 << "]");
void <API key> (const unsigned int n_refines);
void initialize();
void <API key> ();
void diffusion_step (const bool reinit_prec);
void projection_step (const bool reinit_prec);
void update_pressure (const bool reinit_prec);
private:
unsigned int vel_max_its;
unsigned int vel_Krylov_size;
unsigned int vel_off_diagonals;
unsigned int vel_update_prec;
double vel_eps;
double vel_diag_strength;
void <API key>();
void <API key>();
// The next few structures and functions are for doing various things in
// parallel. They follow the scheme laid out in @ref threads, using the
// WorkStream class. As explained there, this requires us to declare two
// structures for each of the assemblers, a per-task data and a scratch
// data structure. These are then handed over to functions that assemble
// local contributions and that copy these local contributions to the
// global objects.
// One of the things that are specific to this program is that we don't
// just have a single DoFHandler object that represents both the
// velocities and the pressure, but we use individual DoFHandler objects
// for these two kinds of variables. We pay for this optimization when we
// want to assemble terms that involve both variables, such as the
// divergence of the velocity and the gradient of the pressure, times the
// respective test functions. When doing so, we can't just anymore use a
// single FEValues object, but rather we need two, and they need to be
// initialized with cell iterators that point to the same cell in the
// triangulation but different DoFHandlers.
// To do this in practice, we declare a "synchronous" iterator -- an
// object that internally consists of several (in our case two) iterators,
// and each time the synchronous iteration is moved up one step, each of
// the iterators stored internally is moved up one step as well, thereby
// always staying in sync. As it so happens, there is a deal.II class that
// facilitates this sort of thing.
typedef std_cxx11::tuple< typename DoFHandler<dim>::<API key>,
typename DoFHandler<dim>::<API key>
> IteratorTuple;
typedef <API key><IteratorTuple> IteratorPair;
void <API key>();
struct InitGradPerTaskData
{
unsigned int d;
unsigned int vel_dpc;
unsigned int pres_dpc;
FullMatrix<double> local_grad;
std::vector<types::global_dof_index> <API key>;
std::vector<types::global_dof_index> <API key>;
InitGradPerTaskData (const unsigned int dd,
const unsigned int vdpc,
const unsigned int pdpc)
:
d(dd),
vel_dpc (vdpc),
pres_dpc (pdpc),
local_grad (vdpc, pdpc),
<API key> (vdpc),
<API key> (pdpc)
{}
};
struct InitGradScratchData
{
unsigned int nqp;
FEValues<dim> fe_val_vel;
FEValues<dim> fe_val_pres;
InitGradScratchData (const FE_Q<dim> &fe_v,
const FE_Q<dim> &fe_p,
const QGauss<dim> &quad,
const UpdateFlags flags_v,
const UpdateFlags flags_p)
:
nqp (quad.size()),
fe_val_vel (fe_v, quad, flags_v),
fe_val_pres (fe_p, quad, flags_p)
{}
InitGradScratchData (const InitGradScratchData &data)
:
nqp (data.nqp),
fe_val_vel (data.fe_val_vel.get_fe(),
data.fe_val_vel.get_quadrature(),
data.fe_val_vel.get_update_flags()),
fe_val_pres (data.fe_val_pres.get_fe(),
data.fe_val_pres.get_quadrature(),
data.fe_val_pres.get_update_flags())
{}
};
void <API key> (const IteratorPair &SI,
InitGradScratchData &scratch,
InitGradPerTaskData &data);
void <API key> (const InitGradPerTaskData &data);
// The same general layout also applies to the following classes and
// functions implementing the assembly of the advection term:
void <API key>();
struct <API key>
{
FullMatrix<double> local_advection;
std::vector<types::global_dof_index> local_dof_indices;
<API key> (const unsigned int dpc)
:
local_advection (dpc, dpc),
local_dof_indices (dpc)
{}
};
struct <API key>
{
unsigned int nqp;
unsigned int dpc;
std::vector< Point<dim> > u_star_local;
std::vector< Tensor<1,dim> > grad_u_star;
std::vector<double> u_star_tmp;
FEValues<dim> fe_val;
<API key> (const FE_Q<dim> &fe,
const QGauss<dim> &quad,
const UpdateFlags flags)
:
nqp (quad.size()),
dpc (fe.dofs_per_cell),
u_star_local (nqp),
grad_u_star (nqp),
u_star_tmp (nqp),
fe_val (fe, quad, flags)
{}
<API key> (const <API key> &data)
:
nqp (data.nqp),
dpc (data.dpc),
u_star_local (nqp),
grad_u_star (nqp),
u_star_tmp (nqp),
fe_val (data.fe_val.get_fe(),
data.fe_val.get_quadrature(),
data.fe_val.get_update_flags())
{}
};
void <API key> (const typename DoFHandler<dim>::<API key> &cell,
<API key> &scratch,
<API key> &data);
void <API key> (const <API key> &data);
// The final few functions implement the diffusion solve as well as
// postprocessing the output, including computing the curl of the
// velocity:
void <API key> (const unsigned int d);
void output_results (const unsigned int step);
void assemble_vorticity (const bool reinit_prec);
};
// @sect4{ <code><API key>::<API key></code> }
// In the constructor, we just read all the data from the
// <code>Data_Storage</code> object that is passed as an argument, verify
// that the data we read is reasonable and, finally, create the
// triangulation and load the initial data.
template <int dim>
<API key><dim>::<API key>(const RunTimeParameters::Data_Storage &data)
:
type (data.form),
deg (data.pressure_degree),
dt (data.dt),
t_0 (data.initial_time),
T (data.final_time),
Re (data.Reynolds),
vel_exact (data.initial_time),
fe_velocity (deg+1),
fe_pressure (deg),
<API key> (triangulation),
<API key> (triangulation),
quadrature_pressure (deg+1),
quadrature_velocity (deg+2),
vel_max_its (data.vel_max_iterations),
vel_Krylov_size (data.vel_Krylov_size),
vel_off_diagonals (data.vel_off_diagonals),
vel_update_prec (data.vel_update_prec),
vel_eps (data.vel_eps),
vel_diag_strength (data.vel_diag_strength)
{
if (deg < 1)
std::cout << " WARNING: The chosen pair of finite element spaces is not stable."
<< std::endl
<< " The obtained results will be nonsense"
<< std::endl;
AssertThrow (! ( (dt <= 0.) || (dt > .5*T)), ExcInvalidTimeStep (dt, .5*T));
<API key> (data.n_global_refines);
initialize();
}
// @sect4{ <code><API key>::<API key></code> }
// The method that creates the triangulation and refines it the needed
// number of times. After creating the triangulation, it creates the mesh
// dependent data, i.e. it distributes degrees of freedom and renumbers
// them, and initializes the matrices and vectors that we will use.
template <int dim>
void
<API key><dim>::
<API key> (const unsigned int n_refines)
{
GridIn<dim> grid_in;
grid_in.<API key> (triangulation);
{
std::string filename = "nsbench2.inp";
std::ifstream file (filename.c_str());
Assert (file, ExcFileNotOpen (filename.c_str()));
grid_in.read_ucd (file);
}
std::cout << "Number of refines = " << n_refines
<< std::endl;
triangulation.refine_global (n_refines);
std::cout << "Number of active cells: " << triangulation.n_active_cells()
<< std::endl;
boundary_indicators = triangulation.<API key>();
<API key>.distribute_dofs (fe_velocity);
DoFRenumbering::boost::Cuthill_McKee (<API key>);
<API key>.distribute_dofs (fe_pressure);
DoFRenumbering::boost::Cuthill_McKee (<API key>);
<API key>();
<API key>();
<API key>();
pres_n.reinit (<API key>.n_dofs());
pres_n_minus_1.reinit (<API key>.n_dofs());
phi_n.reinit (<API key>.n_dofs());
phi_n_minus_1.reinit (<API key>.n_dofs());
pres_tmp.reinit (<API key>.n_dofs());
for (unsigned int d=0; d<dim; ++d)
{
u_n[d].reinit (<API key>.n_dofs());
u_n_minus_1[d].reinit (<API key>.n_dofs());
u_star[d].reinit (<API key>.n_dofs());
force[d].reinit (<API key>.n_dofs());
}
v_tmp.reinit (<API key>.n_dofs());
rot_u.reinit (<API key>.n_dofs());
std::cout << "dim (X_h) = " << (<API key>.n_dofs()*dim)
<< std::endl
<< "dim (M_h) = " << <API key>.n_dofs()
<< std::endl
<< "Re = " << Re
<< std::endl
<< std::endl;
}
// @sect4{ <code><API key>::initialize</code> }
// This method creates the constant matrices and loads the initial data
template <int dim>
void
<API key><dim>::initialize()
{
<API key> = 0.;
<API key>.add (1./Re, vel_Laplace);
<API key>.add (1.5/dt, vel_Mass);
EquationData::Pressure<dim> pres (t_0);
VectorTools::interpolate (<API key>, pres, pres_n_minus_1);
pres.advance_time (dt);
VectorTools::interpolate (<API key>, pres, pres_n);
phi_n = 0.;
phi_n_minus_1 = 0.;
for (unsigned int d=0; d<dim; ++d)
{
vel_exact.set_time (t_0);
vel_exact.set_component(d);
VectorTools::interpolate (<API key>, ZeroFunction<dim>(), u_n_minus_1[d]);
vel_exact.advance_time (dt);
VectorTools::interpolate (<API key>, ZeroFunction<dim>(), u_n[d]);
}
}
// @sect4{ The <code><API key>::initialize_*_matrices</code> methods }
// In this set of methods we initialize the sparsity patterns, the
// constraints (if any) and assemble the matrices that do not depend on the
// timestep <code>dt</code>. Note that for the Laplace and mass matrices, we
// can use functions in the library that do this. Because the expensive
// operations of this function -- creating the two matrices -- are entirely
// independent, we could in principle mark them as tasks that can be worked
// on in %parallel using the Threads::new_task functions. We won't do that
// here since these functions internally already are parallelized, and in
// particular because the current function is only called once per program
// run and so does not incur a cost in each time step. The necessary
// modifications would be quite straightforward, however.
template <int dim>
void
<API key><dim>::<API key>()
{
<API key>.reinit (<API key>.n_dofs(),
<API key>.n_dofs(),
<API key>.<API key>());
DoFTools::<API key> (<API key>,
<API key>);
<API key>.compress();
<API key>.reinit (<API key>);
for (unsigned int d=0; d<dim; ++d)
vel_it_matrix[d].reinit (<API key>);
vel_Mass.reinit (<API key>);
vel_Laplace.reinit (<API key>);
vel_Advection.reinit (<API key>);
MatrixCreator::create_mass_matrix (<API key>,
quadrature_velocity,
vel_Mass);
MatrixCreator::<API key> (<API key>,
quadrature_velocity,
vel_Laplace);
}
// The initialization of the matrices that act on the pressure space is
// similar to the ones that act on the velocity space.
template <int dim>
void
<API key><dim>::<API key>()
{
<API key>.reinit (<API key>.n_dofs(), <API key>.n_dofs(),
<API key>.<API key>());
DoFTools::<API key> (<API key>, <API key>);
<API key>.compress();
pres_Laplace.reinit (<API key>);
pres_iterative.reinit (<API key>);
pres_Mass.reinit (<API key>);
MatrixCreator::<API key> (<API key>,
quadrature_pressure,
pres_Laplace);
MatrixCreator::create_mass_matrix (<API key>,
quadrature_pressure,
pres_Mass);
}
// For the gradient operator, we start by initializing the sparsity pattern
// and compressing it. It is important to notice here that the gradient
// operator acts from the pressure space into the velocity space, so we have
// to deal with two different finite element spaces. To keep the loops
// synchronized, we use the <code>typedef</code>'s that we have defined
// before, namely <code>PairedIterators</code> and
// <code>IteratorPair</code>.
template <int dim>
void
<API key><dim>::<API key>()
{
<API key>.reinit (<API key>.n_dofs(),
<API key>.n_dofs(),
<API key>.<API key>());
DoFTools::<API key> (<API key>,
<API key>,
<API key>);
<API key>.compress();
InitGradPerTaskData per_task_data (0, fe_velocity.dofs_per_cell,
fe_pressure.dofs_per_cell);
InitGradScratchData scratch_data (fe_velocity,
fe_pressure,
quadrature_velocity,
update_gradients | update_JxW_values,
update_values);
for (unsigned int d=0; d<dim; ++d)
{
pres_Diff[d].reinit (<API key>);
per_task_data.d = d;
WorkStream::run (IteratorPair (IteratorTuple (<API key>.begin_active(),
<API key>.begin_active()
)
),
IteratorPair (IteratorTuple (<API key>.end(),
<API key>.end()
)
),
*this,
&<API key><dim>::<API key>,
&<API key><dim>::<API key>,
scratch_data,
per_task_data
);
}
}
template <int dim>
void
<API key><dim>::
<API key> (const IteratorPair &SI,
InitGradScratchData &scratch,
InitGradPerTaskData &data)
{
scratch.fe_val_vel.reinit (std_cxx11::get<0> (SI.iterators));
scratch.fe_val_pres.reinit (std_cxx11::get<1> (SI.iterators));
std_cxx11::get<0> (SI.iterators)->get_dof_indices (data.<API key>);
std_cxx11::get<1> (SI.iterators)->get_dof_indices (data.<API key>);
data.local_grad = 0.;
for (unsigned int q=0; q<scratch.nqp; ++q)
{
for (unsigned int i=0; i<data.vel_dpc; ++i)
for (unsigned int j=0; j<data.pres_dpc; ++j)
data.local_grad (i, j) += -scratch.fe_val_vel.JxW(q) *
scratch.fe_val_vel.shape_grad (i, q)[data.d] *
scratch.fe_val_pres.shape_value (j, q);
}
}
template <int dim>
void
<API key><dim>::
<API key>(const InitGradPerTaskData &data)
{
for (unsigned int i=0; i<data.vel_dpc; ++i)
for (unsigned int j=0; j<data.pres_dpc; ++j)
pres_Diff[data.d].add (data.<API key>[i], data.<API key>[j],
data.local_grad (i, j) );
}
// @sect4{ <code><API key>::run</code> }
// This is the time marching function, which starting at <code>t_0</code>
// advances in time using the projection method with time step
// <code>dt</code> until <code>T</code>.
// Its second parameter, <code>verbose</code> indicates whether the function
// should output information what it is doing at any given moment: for
// example, it will say whether we are working on the diffusion, projection
// substep; updating preconditioners etc. Rather than implementing this
// output using code like
// @code
// if (verbose) std::cout << "something";
// @endcode
// we use the ConditionalOStream class to do that for us. That
// class takes an output stream and a condition that indicates whether the
// things you pass to it should be passed through to the given output
// stream, or should just be ignored. This way, above code simply becomes
// @code
// verbose_cout << "something";
// @endcode
// and does the right thing in either case.
template <int dim>
void
<API key><dim>::run (const bool verbose,
const unsigned int output_interval)
{
ConditionalOStream verbose_cout (std::cout, verbose);
const unsigned int n_steps = static_cast<unsigned int>((T - t_0)/dt);
vel_exact.set_time (2.*dt);
output_results(1);
for (unsigned int n = 2; n<=n_steps; ++n)
{
if (n % output_interval == 0)
{
verbose_cout << "Plotting Solution" << std::endl;
output_results(n);
}
std::cout << "Step = " << n << " Time = " << (n*dt) << std::endl;
verbose_cout << " Interpolating the velocity " << std::endl;
<API key>();
verbose_cout << " Diffusion Step" << std::endl;
if (n % vel_update_prec == 0)
verbose_cout << " With reinitialization of the preconditioner"
<< std::endl;
diffusion_step ((n%vel_update_prec == 0) || (n == 2));
verbose_cout << " Projection Step" << std::endl;
projection_step ( (n == 2));
verbose_cout << " Updating the Pressure" << std::endl;
update_pressure ( (n == 2));
vel_exact.advance_time(dt);
}
output_results (n_steps);
}
template <int dim>
void
<API key><dim>::<API key>()
{
for (unsigned int d=0; d<dim; ++d)
u_star[d].equ (2., u_n[d], -1, u_n_minus_1[d]);
}
// @sect4{<code><API key>::diffusion_step</code>}
// The implementation of a diffusion step. Note that the expensive operation
// is the diffusion solve at the end of the function, which we have to do
// once for each velocity component. To accelerate things a bit, we allow
// to do this in %parallel, using the Threads::new_task function which makes
// sure that the <code>dim</code> solves are all taken care of and are
// scheduled to available processors: if your machine has more than one
// processor core and no other parts of this program are using resources
// currently, then the diffusion solves will run in %parallel. On the other
// hand, if your system has only one processor core then running things in
// %parallel would be inefficient (since it leads, for example, to cache
// congestion) and things will be executed sequentially.
template <int dim>
void
<API key><dim>::diffusion_step (const bool reinit_prec)
{
pres_tmp.equ (-1., pres_n, -4./3., phi_n, 1./3., phi_n_minus_1);
<API key>();
for (unsigned int d=0; d<dim; ++d)
{
force[d] = 0.;
v_tmp.equ (2./dt,u_n[d],-.5/dt,u_n_minus_1[d]);
vel_Mass.vmult_add (force[d], v_tmp);
pres_Diff[d].vmult_add (force[d], pres_tmp);
u_n_minus_1[d] = u_n[d];
vel_it_matrix[d].copy_from (<API key>);
vel_it_matrix[d].add (1., vel_Advection);
vel_exact.set_component(d);
boundary_values.clear();
for (std::vector<types::boundary_id>::const_iterator
boundaries = boundary_indicators.begin();
boundaries != boundary_indicators.end();
++boundaries)
{
switch (*boundaries)
{
case 1:
VectorTools::
<API key> (<API key>,
*boundaries,
ZeroFunction<dim>(),
boundary_values);
break;
case 2:
VectorTools::
<API key> (<API key>,
*boundaries,
vel_exact,
boundary_values);
break;
case 3:
if (d != 0)
VectorTools::
<API key> (<API key>,
*boundaries,
ZeroFunction<dim>(),
boundary_values);
break;
case 4:
VectorTools::
<API key> (<API key>,
*boundaries,
ZeroFunction<dim>(),
boundary_values);
break;
default:
Assert (false, ExcNotImplemented());
}
}
MatrixTools::<API key> (boundary_values,
vel_it_matrix[d],
u_n[d],
force[d]);
}
Threads::TaskGroup<void> tasks;
for (unsigned int d=0; d<dim; ++d)
{
if (reinit_prec)
prec_velocity[d].initialize (vel_it_matrix[d],
SparseILU<double>::
AdditionalData (vel_diag_strength,
vel_off_diagonals));
tasks += Threads::new_task (&<API key><dim>::
<API key>,
*this, d);
}
tasks.join_all();
}
template <int dim>
void
<API key><dim>::<API key> (const unsigned int d)
{
SolverControl solver_control (vel_max_its, vel_eps*force[d].l2_norm());
SolverGMRES<> gmres (solver_control,
SolverGMRES<>::AdditionalData (vel_Krylov_size));
gmres.solve (vel_it_matrix[d], u_n[d], force[d], prec_velocity[d]);
}
// @sect4{ The <code><API key>::<API key></code> method and related}
// The following few functions deal with assembling the advection terms,
// which is the part of the system matrix for the diffusion step that
// changes at every time step. As mentioned above, we will run the assembly
// loop over all cells in %parallel, using the WorkStream class and other
// facilities as described in the documentation module on @ref threads.
template <int dim>
void
<API key><dim>::<API key>()
{
vel_Advection = 0.;
<API key> data (fe_velocity.dofs_per_cell);
<API key> scratch (fe_velocity, quadrature_velocity,
update_values |
update_JxW_values |
update_gradients);
WorkStream::run (<API key>.begin_active(),
<API key>.end(), *this,
&<API key><dim>::<API key>,
&<API key><dim>::<API key>,
scratch,
data);
}
template <int dim>
void
<API key><dim>::
<API key>(const typename DoFHandler<dim>::<API key> &cell,
<API key> &scratch,
<API key> &data)
{
scratch.fe_val.reinit(cell);
cell->get_dof_indices (data.local_dof_indices);
for (unsigned int d=0; d<dim; ++d)
{
scratch.fe_val.get_function_values (u_star[d], scratch.u_star_tmp);
for (unsigned int q=0; q<scratch.nqp; ++q)
scratch.u_star_local[q](d) = scratch.u_star_tmp[q];
}
for (unsigned int d=0; d<dim; ++d)
{
scratch.fe_val.<API key> (u_star[d], scratch.grad_u_star);
for (unsigned int q=0; q<scratch.nqp; ++q)
{
if (d==0)
scratch.u_star_tmp[q] = 0.;
scratch.u_star_tmp[q] += scratch.grad_u_star[q][d];
}
}
data.local_advection = 0.;
for (unsigned int q=0; q<scratch.nqp; ++q)
for (unsigned int i=0; i<scratch.dpc; ++i)
for (unsigned int j=0; j<scratch.dpc; ++j)
data.local_advection(i,j) += (scratch.u_star_local[q] *
scratch.fe_val.shape_grad (j, q) *
scratch.fe_val.shape_value (i, q)
+
0.5 *
scratch.u_star_tmp[q] *
scratch.fe_val.shape_value (i, q) *
scratch.fe_val.shape_value (j, q))
*
scratch.fe_val.JxW(q) ;
}
template <int dim>
void
<API key><dim>::
<API key>(const <API key> &data)
{
for (unsigned int i=0; i<fe_velocity.dofs_per_cell; ++i)
for (unsigned int j=0; j<fe_velocity.dofs_per_cell; ++j)
vel_Advection.add (data.local_dof_indices[i],
data.local_dof_indices[j],
data.local_advection(i,j));
}
// @sect4{<code><API key>::projection_step</code>}
// This implements the projection step:
template <int dim>
void
<API key><dim>::projection_step (const bool reinit_prec)
{
pres_iterative.copy_from (pres_Laplace);
pres_tmp = 0.;
for (unsigned d=0; d<dim; ++d)
pres_Diff[d].Tvmult_add (pres_tmp, u_n[d]);
phi_n_minus_1 = phi_n;
static std::map<types::global_dof_index, double> bval;
if (reinit_prec)
VectorTools::<API key> (<API key>, 3,
ZeroFunction<dim>(), bval);
MatrixTools::<API key> (bval, pres_iterative, phi_n, pres_tmp);
if (reinit_prec)
prec_pres_Laplace.initialize(pres_iterative,
SparseILU<double>::AdditionalData (vel_diag_strength,
vel_off_diagonals) );
SolverControl solvercontrol (vel_max_its, vel_eps*pres_tmp.l2_norm());
SolverCG<> cg (solvercontrol);
cg.solve (pres_iterative, phi_n, pres_tmp, prec_pres_Laplace);
phi_n *= 1.5/dt;
}
// @sect4{ <code><API key>::update_pressure</code> }
// This is the pressure update step of the projection method. It implements
// the standard formulation of the method, that is @f[ p^{n+1} = p^n +
// \phi^{n+1}, @f] or the rotational form, which is @f[ p^{n+1} = p^n +
// \phi^{n+1} - \frac{1}{Re} \nabla\cdot u^{n+1}. @f]
template <int dim>
void
<API key><dim>::update_pressure (const bool reinit_prec)
{
pres_n_minus_1 = pres_n;
switch (type)
{
case RunTimeParameters::METHOD_STANDARD:
pres_n += phi_n;
break;
case RunTimeParameters::METHOD_ROTATIONAL:
if (reinit_prec)
prec_mass.initialize (pres_Mass);
pres_n = pres_tmp;
prec_mass.solve (pres_n);
pres_n.sadd(1./Re, 1., pres_n_minus_1, 1., phi_n);
break;
default:
Assert (false, ExcNotImplemented());
};
}
// @sect4{ <code><API key>::output_results</code> }
// This method plots the current solution. The main difficulty is that we
// want to create a single output file that contains the data for all
// velocity components, the pressure, and also the vorticity of the flow. On
// the other hand, velocities and the pressure live on separate DoFHandler
// objects, and so can't be written to the same file using a single DataOut
// object. As a consequence, we have to work a bit harder to get the various
// pieces of data into a single DoFHandler object, and then use that to
// drive graphical output.
// We will not elaborate on this process here, but rather refer to step-32,
// where a similar procedure is used (and is documented) to
// create a joint DoFHandler object for all variables.
// Let us also note that we here compute the vorticity as a scalar quantity
// in a separate function, using the $L^2$ projection of the quantity
// $\text{curl} u$ onto the finite element space used for the components of
// the velocity. In principle, however, we could also have computed as a
// pointwise quantity from the velocity, and do so through the
// DataPostprocessor mechanism discussed in step-29 and step-33.
template <int dim>
void <API key><dim>::output_results (const unsigned int step)
{
assemble_vorticity ( (step == 1));
const FESystem<dim> joint_fe (fe_velocity, dim,
fe_pressure, 1,
fe_velocity, 1);
DoFHandler<dim> joint_dof_handler (triangulation);
joint_dof_handler.distribute_dofs (joint_fe);
Assert (joint_dof_handler.n_dofs() ==
((dim + 1)*<API key>.n_dofs() +
<API key>.n_dofs()),
ExcInternalError());
static Vector<double> joint_solution (joint_dof_handler.n_dofs());
std::vector<types::global_dof_index> <API key> (joint_fe.dofs_per_cell),
loc_vel_dof_indices (fe_velocity.dofs_per_cell),
<API key> (fe_pressure.dofs_per_cell);
typename DoFHandler<dim>::<API key>
joint_cell = joint_dof_handler.begin_active(),
joint_endc = joint_dof_handler.end(),
vel_cell = <API key>.begin_active(),
pres_cell = <API key>.begin_active();
for (; joint_cell != joint_endc; ++joint_cell, ++vel_cell, ++pres_cell)
{
joint_cell->get_dof_indices (<API key>);
vel_cell->get_dof_indices (loc_vel_dof_indices),
pres_cell->get_dof_indices (<API key>);
for (unsigned int i=0; i<joint_fe.dofs_per_cell; ++i)
switch (joint_fe.<API key>(i).first.first)
{
case 0:
Assert (joint_fe.<API key>(i).first.second < dim,
ExcInternalError());
joint_solution (<API key>[i]) =
u_n[ joint_fe.<API key>(i).first.second ]
(loc_vel_dof_indices[ joint_fe.<API key>(i).second ]);
break;
case 1:
Assert (joint_fe.<API key>(i).first.second == 0,
ExcInternalError());
joint_solution (<API key>[i]) =
pres_n (<API key>[ joint_fe.<API key>(i).second ]);
break;
case 2:
Assert (joint_fe.<API key>(i).first.second == 0,
ExcInternalError());
joint_solution (<API key>[i]) =
rot_u (loc_vel_dof_indices[ joint_fe.<API key>(i).second ]);
break;
default:
Assert (false, ExcInternalError());
}
}
std::vector<std::string> <API key> (dim, "v");
<API key>.push_back ("p");
<API key>.push_back ("rot_u");
DataOut<dim> data_out;
data_out.attach_dof_handler (joint_dof_handler);
std::vector< <API key>::<API key> >
<API key> (dim+2,
<API key>::<API key>);
<API key>[dim]
= <API key>::component_is_scalar;
<API key>[dim+1]
= <API key>::component_is_scalar;
data_out.add_data_vector (joint_solution,
<API key>,
DataOut<dim>::type_dof_data,
<API key>);
data_out.build_patches (deg + 1);
std::ofstream output (("solution-" +
Utilities::int_to_string (step, 5) +
".vtk").c_str());
data_out.write_vtk (output);
}
// Following is the helper function that computes the vorticity by
// projecting the term $\text{curl} u$ onto the finite element space used
// for the components of the velocity. The function is only called whenever
// we generate graphical output, so not very often, and as a consequence we
// didn't bother parallelizing it using the WorkStream concept as we do for
// the other assembly functions. That should not be overly complicated,
// however, if needed. Moreover, the implementation that we have here only
// works for 2d, so we bail if that is not the case.
template <int dim>
void <API key><dim>::assemble_vorticity (const bool reinit_prec)
{
Assert (dim == 2, ExcNotImplemented());
if (reinit_prec)
prec_vel_mass.initialize (vel_Mass);
FEValues<dim> fe_val_vel (fe_velocity, quadrature_velocity,
update_gradients |
update_JxW_values |
update_values);
const unsigned int dpc = fe_velocity.dofs_per_cell,
nqp = quadrature_velocity.size();
std::vector<types::global_dof_index> ldi (dpc);
Vector<double> loc_rot (dpc);
std::vector< Tensor<1,dim> > grad_u1 (nqp), grad_u2 (nqp);
rot_u = 0.;
typename DoFHandler<dim>::<API key>
cell = <API key>.begin_active(),
end = <API key>.end();
for (; cell != end; ++cell)
{
fe_val_vel.reinit (cell);
cell->get_dof_indices (ldi);
fe_val_vel.<API key> (u_n[0], grad_u1);
fe_val_vel.<API key> (u_n[1], grad_u2);
loc_rot = 0.;
for (unsigned int q=0; q<nqp; ++q)
for (unsigned int i=0; i<dpc; ++i)
loc_rot(i) += (grad_u2[q][0] - grad_u1[q][1]) *
fe_val_vel.shape_value (i, q) *
fe_val_vel.JxW(q);
for (unsigned int i=0; i<dpc; ++i)
rot_u (ldi[i]) += loc_rot(i);
}
prec_vel_mass.solve (rot_u);
}
}
// @sect3{ The main function }
// The main function looks very much like in all the other tutorial programs,
// so there is little to comment on here:
int main()
{
try
{
using namespace dealii;
using namespace Step35;
RunTimeParameters::Data_Storage data;
data.read_data ("parameter-file.prm");
deallog.depth_console (data.verbose ? 2 : 0);
<API key><2> test (data);
test.run (data.verbose, data.output_interval);
}
catch (std::exception &exc)
{
std::cerr << std::endl << std::endl
<< "
<< std::endl;
std::cerr << "Exception on processing: " << std::endl
<< exc.what() << std::endl
<< "Aborting!" << std::endl
<< "
<< std::endl;
return 1;
}
catch (...)
{
std::cerr << std::endl << std::endl
<< "
<< std::endl;
std::cerr << "Unknown exception!" << std::endl
<< "Aborting!" << std::endl
<< "
<< std::endl;
return 1;
}
std::cout << "
<< std::endl
<< "Apparently everything went fine!"
<< std::endl
<< "Don't forget to brush your teeth :-)"
<< std::endl << std::endl;
return 0;
}
|
// FILE: <API key>.cs
// CONTENTS:
// Implementation of <API key> for GPSTIME11 items (version 2).
// PROGRAMMERS:
// (c) of the C# port 2014 by Shinta <shintadono@googlemail.com>
// This is free software; you can redistribute and/or modify it under the
// terms of the GNU Lesser General Licence as published by the Free Software
// Foundation. See the COPYING file for more information.
// CHANGE HISTORY: omitted for easier Copy&Paste (pls see the original)
using System.Diagnostics;
namespace laszip.net
{
class <API key> : <API key>
{
const int <API key>=500;
const int <API key>=-10;
const int <API key>=(<API key>+1);
const int <API key>=(<API key>+2);
const int <API key>=(<API key>+6);
public <API key>(ArithmeticEncoder enc)
{
// set encoder
Debug.Assert(enc!=null);
this.enc=enc;
// create entropy models and integer compressors
m_gpstime_multi=enc.createSymbolModel(<API key>);
m_gpstime_0diff=enc.createSymbolModel(6);
ic_gpstime=new IntegerCompressor(enc, 32, 9); // 32 bits, 9 contexts
}
public override bool init(laszip_point item)
{
// init state
last=0; next=0;
last_gpstime_diff[0]=0;
last_gpstime_diff[1]=0;
last_gpstime_diff[2]=0;
last_gpstime_diff[3]=0;
<API key>[0]=0;
<API key>[1]=0;
<API key>[2]=0;
<API key>[3]=0;
// init models and integer compressors
enc.initSymbolModel(m_gpstime_multi);
enc.initSymbolModel(m_gpstime_0diff);
ic_gpstime.initCompressor();
// init last item
last_gpstime[0].f64=item.gps_time;
last_gpstime[1].u64=0;
last_gpstime[2].u64=0;
last_gpstime[3].u64=0;
return true;
}
public override bool write(laszip_point item)
{
U64I64F64 this_gpstime=new U64I64F64();
this_gpstime.f64=item.gps_time;
if(last_gpstime_diff[last]==0) // if the last integer difference was zero
{
if(this_gpstime.i64==last_gpstime[last].i64)
{
enc.encodeSymbol(m_gpstime_0diff, 0); // the doubles have not changed
}
else
{
// calculate the difference between the two doubles as an integer
long <API key>=this_gpstime.i64-last_gpstime[last].i64;
int curr_gpstime_diff=(int)<API key>;
if(<API key>==(long)(curr_gpstime_diff))
{
enc.encodeSymbol(m_gpstime_0diff, 1); // the difference can be represented with 32 bits
ic_gpstime.compress(0, curr_gpstime_diff, 0);
last_gpstime_diff[last]=curr_gpstime_diff;
<API key>[last]=0;
}
else // the difference is huge
{
// maybe the double belongs to another time sequence
for(uint i=1; i<4; i++)
{
long <API key>=this_gpstime.i64-last_gpstime[(last+i)&3].i64;
int other_gpstime_diff=(int)<API key>;
if(<API key>==(long)(other_gpstime_diff))
{
enc.encodeSymbol(m_gpstime_0diff, i+2); // it belongs to another sequence
last=(last+i)&3;
return write(item);
}
}
// no other sequence found. start new sequence.
enc.encodeSymbol(m_gpstime_0diff, 2);
ic_gpstime.compress((int)(last_gpstime[last].u64>>32), (int)(this_gpstime.u64>>32), 8);
enc.writeInt((uint)(this_gpstime.u64));
next=(next+1)&3;
last=next;
last_gpstime_diff[last]=0;
<API key>[last]=0;
}
last_gpstime[last].i64=this_gpstime.i64;
}
}
else // the last integer difference was *not* zero
{
if(this_gpstime.i64==last_gpstime[last].i64)
{
// if the doubles have not changed use a special symbol
enc.encodeSymbol(m_gpstime_multi, <API key>);
}
else
{
// calculate the difference between the two doubles as an integer
long <API key>=this_gpstime.i64-last_gpstime[last].i64;
int curr_gpstime_diff=(int)<API key>;
// if the current gpstime difference can be represented with 32 bits
if(<API key>==(long)(curr_gpstime_diff))
{
// compute multiplier between current and last integer difference
double multi_f=(double)curr_gpstime_diff/(double)(last_gpstime_diff[last]);
int multi=MyDefs.I32_QUANTIZE(multi_f);
// compress the residual curr_gpstime_diff in dependance on the multiplier
if(multi==1)
{
// this is the case we assume we get most often for regular spaced pulses
enc.encodeSymbol(m_gpstime_multi, 1);
ic_gpstime.compress(last_gpstime_diff[last], curr_gpstime_diff, 1);
<API key>[last]=0;
}
else if(multi>0)
{
if(multi<<API key>) // positive multipliers up to <API key> are compressed directly
{
enc.encodeSymbol(m_gpstime_multi, (uint)multi);
if(multi<10)
ic_gpstime.compress(multi*last_gpstime_diff[last], curr_gpstime_diff, 2);
else
ic_gpstime.compress(multi*last_gpstime_diff[last], curr_gpstime_diff, 3);
}
else
{
enc.encodeSymbol(m_gpstime_multi, <API key>);
ic_gpstime.compress(<API key>*last_gpstime_diff[last], curr_gpstime_diff, 4);
<API key>[last]++;
if(<API key>[last]>3)
{
last_gpstime_diff[last]=curr_gpstime_diff;
<API key>[last]=0;
}
}
}
else if(multi<0)
{
if(multi><API key>) // negative multipliers larger than <API key> are compressed directly
{
enc.encodeSymbol(m_gpstime_multi, (uint)(<API key>));
ic_gpstime.compress(multi*last_gpstime_diff[last], curr_gpstime_diff, 5);
}
else
{
enc.encodeSymbol(m_gpstime_multi, <API key>);
ic_gpstime.compress(<API key>*last_gpstime_diff[last], curr_gpstime_diff, 6);
<API key>[last]++;
if(<API key>[last]>3)
{
last_gpstime_diff[last]=curr_gpstime_diff;
<API key>[last]=0;
}
}
}
else
{
enc.encodeSymbol(m_gpstime_multi, 0);
ic_gpstime.compress(0, curr_gpstime_diff, 7);
<API key>[last]++;
if(<API key>[last]>3)
{
last_gpstime_diff[last]=curr_gpstime_diff;
<API key>[last]=0;
}
}
}
else // the difference is huge
{
// maybe the double belongs to another time sequence
for(uint i=1; i<4; i++)
{
long <API key>=this_gpstime.i64-last_gpstime[(last+i)&3].i64;
int other_gpstime_diff=(int)<API key>;
if(<API key>==(long)(other_gpstime_diff))
{
// it belongs to this sequence
enc.encodeSymbol(m_gpstime_multi, <API key>+i);
last=(last+i)&3;
return write(item);
}
}
// no other sequence found. start new sequence.
enc.encodeSymbol(m_gpstime_multi, <API key>);
ic_gpstime.compress((int)(last_gpstime[last].u64>>32), (int)(this_gpstime.u64>>32), 8);
enc.writeInt((uint)(this_gpstime.u64));
next=(next+1)&3;
last=next;
last_gpstime_diff[last]=0;
<API key>[last]=0;
}
last_gpstime[last].i64=this_gpstime.i64;
}
}
return true;
}
ArithmeticEncoder enc;
uint last, next;
U64I64F64[] last_gpstime=new U64I64F64[4];
int[] last_gpstime_diff=new int[4];
int[] <API key>=new int[4];
ArithmeticModel m_gpstime_multi;
ArithmeticModel m_gpstime_0diff;
IntegerCompressor ic_gpstime;
}
}
|
#ifndef DEBUGGER_PROTOCOL_H
#define DEBUGGER_PROTOCOL_H
#include <QByteArray>
#include <QList>
#include <QString>
#include <functional>
#include <vector>
namespace Debugger {
namespace Internal {
class DebuggerResponse;
// Convenience structure to build up backend commands.
class DebuggerCommand
{
public:
typedef std::function<void(const DebuggerResponse &)> Callback;
DebuggerCommand() : flags(0) {}
DebuggerCommand(const char *f, int flags = 0, Callback cb = Callback())
: function(f), callback(cb), flags(flags)
{}
DebuggerCommand(const char *f, Callback cb)
: function(f), callback(cb), flags(0)
{}
DebuggerCommand(const QByteArray &f) : function(f), flags(0) {}
void arg(const char *name);
void arg(const char *name, int value);
void arg(const char *name, qlonglong value);
void arg(const char *name, qulonglong value);
void arg(const char *name, const QString &value);
void arg(const char *name, const QByteArray &value);
void arg(const char *name, const char *value);
void arg(const char *name, const QList<int> &list);
void beginList(const char *name = 0);
void endList();
void beginGroup(const char *name = 0);
void endGroup();
QByteArray arguments() const;
QByteArray function;
QByteArray args;
Callback callback;
uint postTime; // <API key>
int flags;
private:
void argHelper(const char *name, const QByteArray &value);
};
/*
output ==>
( out-of-band-record )* [ result-record ] "(gdb)" nl
result-record ==>
[ token ] "^" result-class ( "," result )* nl
out-of-band-record ==>
async-record | stream-record
async-record ==>
exec-async-output | status-async-output | notify-async-output
exec-async-output ==>
[ token ] "*" async-output
status-async-output ==>
[ token ] "+" async-output
notify-async-output ==>
[ token ] "=" async-output
async-output ==>
async-class ( "," result )* nl
result-class ==>
"done" | "running" | "connected" | "error" | "exit"
async-class ==>
"stopped" | others (where others will be added depending on the needs--this is still in development).
result ==>
variable "=" value
variable ==>
string
value ==>
const | tuple | list
const ==>
c-string
tuple ==>
"{}" | "{" result ( "," result )* "}"
list ==>
"[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
stream-record ==>
<API key> | <API key> | log-stream-output
<API key> ==>
"~" c-string
<API key> ==>
"@" c-string
log-stream-output ==>
"&" c-string
nl ==>
CR | CR-LF
token ==>
any sequence of digits.
*/
// FIXME: rename into GdbMiValue
class GdbMi
{
public:
GdbMi() : m_type(Invalid) {}
QByteArray m_name;
QByteArray m_data;
std::vector<GdbMi> m_children;
enum Type { Invalid, Const, Tuple, List };
Type m_type;
Type type() const { return m_type; }
const QByteArray &name() const { return m_name; }
bool hasName(const char *name) const { return m_name == name; }
bool isValid() const { return m_type != Invalid; }
bool isList() const { return m_type == List; }
const QByteArray &data() const { return m_data; }
const std::vector<GdbMi> &children() const { return m_children; }
int childCount() const { return int(m_children.size()); }
const GdbMi &childAt(int index) const { return m_children[index]; }
const GdbMi &operator[](const char *name) const;
QByteArray toString(bool multiline = false, int indent = 0) const;
qulonglong toAddress() const;
int toInt() const { return m_data.toInt(); }
QString toUtf8() const { return QString::fromUtf8(m_data); }
QString toLatin1() const { return QString::fromLatin1(m_data); }
void fromString(const QByteArray &str);
void fromStringMultiple(const QByteArray &str);
static QByteArray parseCString(const char *&from, const char *to);
static QByteArray escapeCString(const QByteArray &ba);
void parseResultOrValue(const char *&from, const char *to);
void parseValue(const char *&from, const char *to);
void parseTuple(const char *&from, const char *to);
void parseTuple_helper(const char *&from, const char *to);
void parseList(const char *&from, const char *to);
private:
void dumpChildren(QByteArray *str, bool multiline, int indent) const;
};
enum ResultClass
{
// "done" | "running" | "connected" | "error" | "exit"
ResultUnknown,
ResultDone,
ResultRunning,
ResultConnected,
ResultError,
ResultExit
};
class DebuggerResponse
{
public:
DebuggerResponse() : token(-1), resultClass(ResultUnknown) {}
QByteArray toString() const;
static QByteArray <API key>(ResultClass resultClass);
int token;
ResultClass resultClass;
GdbMi data;
QByteArray logStreamOutput;
QByteArray consoleStreamOutput;
};
void extractGdbVersion(const QString &msg,
int *gdbVersion, int *gdbBuildVersion, bool *isMacGdb, bool *isQnxGdb);
// Keep in sync with dumper.py
enum DebuggerEncoding
{
Unencoded8Bit = 0,
<API key> = 1,
<API key> = 2,
<API key> = 3,
Base64Encoded16Bit = 4,
Base64Encoded8Bit = 5,
<API key> = 6,
<API key> = 7,
<API key> = 8,
<API key> = 9,
<API key> = 10,
<API key> = 11,
<API key> = 12,
<API key> = 13,
JulianDate = 14,
<API key> = 15,
<API key> = 16,
Hex2EncodedInt1 = 17,
Hex2EncodedInt2 = 18,
Hex2EncodedInt4 = 19,
Hex2EncodedInt8 = 20,
Hex2EncodedUInt1 = 21,
Hex2EncodedUInt2 = 22,
Hex2EncodedUInt4 = 23,
Hex2EncodedUInt8 = 24,
Hex2EncodedFloat4 = 25,
Hex2EncodedFloat8 = 26,
<API key> = 27,
<API key> = 28,
DateTimeInternal = 29,
SpecialEmptyValue = 30,
<API key> = 31,
SpecialInvalidValue = 32,
<API key> = 33,
<API key> = 34,
<API key> = 35,
<API key> = 36,
<API key> = 37,
<API key> = 38,
<API key> = 39
};
// Keep in sync with dumper.py, symbolgroupvalue.cpp of CDB
enum DebuggerDisplay {
StopDisplay = 0,
DisplayImageData = 1,
DisplayUtf16String = 2,
DisplayImageFile = 3,
DisplayLatin1String = 4,
DisplayUtf8String = 5,
DisplayPlotData = 6
};
// Decode string data as returned by the dumper helpers.
QString decodeData(const QByteArray &baIn, int encoding);
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_PROTOCOL_H
|
#ifndef MIMWIDGET_P_H
#define MIMWIDGET_P_H
#include "mimwidget.h"
#include <QPixmap>
class MImWidgetPrivate
{
Q_DECLARE_PUBLIC(MImWidget);
protected:
MImWidget *q_ptr;
public:
explicit MImWidgetPrivate();
virtual ~MImWidgetPrivate();
};
#endif // MIMWIDGET_P_H
|
import cockpit from 'cockpit';
import * as service from 'service';
import { debounce } from 'throttle-debounce';
import * as utils from './utils';
var firewall = {
owner: null,
installed: true,
enabled: false,
readonly: true,
services: {},
enabledServices: new Set(),
/* Dictionary where zone ID is the key and zone information, as fetched by
* fetchZoneInfos, the value */
zones: {},
activeZones: new Set(),
/* Zones predefined by firewalld, from untrusted to trusted */
predefinedZones: ['drop', 'block', 'public', 'external',
'dmz', 'work', 'home', 'internal', 'trusted'],
defaultZone: null,
availableInterfaces: [],
};
cockpit.event_target(firewall);
utils.list_interfaces().then(interfaces => {
firewall.availableInterfaces = interfaces;
});
const firewalld_service = service.proxy('firewalld');
var firewalld_dbus = null;
firewall.debouncedGetZones = debounce(300, () => {
getZones()
.then(() => getServices())
.then(() => firewall.debouncedEvent('changed'))
.catch(error => console.warn(error));
});
/* As certain dbus signal callbacks might change the firewall frequently
* in a short period of time, prevent rapid succession of renders by
* debouncing the ('changed') event */
firewall.debouncedEvent = debounce(300, event => firewall.dispatchEvent(event));
/* As a service might be removed from multiple zones at the same time,
* prevent rapid succession of GetServices call */
firewall.<API key> = debounce(300, () => {
getServices().then(() => firewall.debouncedEvent('changed'));
});
function initFirewalldDbus() {
firewalld_dbus = cockpit.dbus('org.fedoraproject.FirewallD1', { superuser: "try" });
firewalld_dbus.addEventListener('owner', (event, owner) => {
if (firewall.owner == owner)
return;
firewall.owner = owner;
firewall.enabled = !!owner;
firewall.zones = {};
firewall.activeZones = new Set();
firewall.services = {};
firewall.enabledServices = new Set();
if (!firewall.enabled) {
firewall.dispatchEvent('changed');
return;
}
getZones()
.then(() => getServices())
.then(() => firewall.debouncedEvent('changed'))
.catch(error => console.warn(error));
});
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: 'ServiceAdded'
}, (path, iface, signal, args) => {
const zone = args[0];
const service = args[1];
fetchZoneInfos([zone])
.then(() => fetchServiceInfos([service]))
.then(info => firewall.enabledServices.add(info[0].id))
.then(() => firewall.debouncedEvent('changed'))
.catch(error => console.warn(error));
});
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: 'ServiceRemoved'
}, (path, iface, signal, args) => {
const zone = args[0];
const service = args[1];
firewall.zones[zone].services = firewall.zones[zone].services.filter(s => s !== service);
firewall.enabledServices.delete(service);
firewall.<API key>();
});
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: 'PortAdded'
}, (path, iface, signal, args) => {
const zone = args[0];
const port = args[1];
const protocol = args[2];
if (!firewall.zones[zone].ports.some(p => p.port === port && p.protocol === protocol)) {
firewall.zones[zone].ports.push({ port, protocol });
firewall.debouncedEvent('changed');
}
});
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: 'PortRemoved'
}, (path, iface, signal, args) => {
const zone = args[0];
const port = args[1];
const protocol = args[2];
firewall.zones[zone].ports = firewall.zones[zone].ports
.filter(p => p.port !== port || p.protocol !== protocol);
firewall.debouncedEvent('changed');
});
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1',
path: '/org/fedoraproject/FirewallD1',
member: 'Reloaded'
}, () => firewall.debouncedGetZones());
/* There are two APIs available, changeZoneOf(Interface|Source) and
* add(Interface|Source). Listen to both of them for any background changes
* to zones. */
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: '<API key>'
}, () => firewall.debouncedGetZones());
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: 'ZoneOfSourceChanged'
}, () => firewall.debouncedGetZones());
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: 'InterfaceAdded'
}, () => firewall.debouncedGetZones());
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: 'SourceAdded'
}, () => firewall.debouncedGetZones());
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: 'InterfaceRemoved'
}, () => firewall.debouncedGetZones());
firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.zone',
path: '/org/fedoraproject/FirewallD1',
member: 'SourceRemoved'
}, () => firewall.debouncedGetZones());
}
firewalld_service.addEventListener('changed', () => {
const installed = !!firewalld_service.exists;
if (!firewall.enabled && firewalld_service.state == 'running')
initFirewalldDbus();
if (firewall.installed == installed)
return;
firewall.installed = installed;
firewall.dispatchEvent('changed');
});
function getZones() {
return firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1.zone',
'getActiveZones', [])
.then(reply => fetchZoneInfos(Object.keys(reply[0])))
.then(zones => {
firewall.activeZones = new Set(zones.map(z => z.id));
})
.then(() => firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1',
'getDefaultZone', []))
.then(reply => {
firewall.defaultZone = reply[0];
})
.then(() => firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1.zone',
'getZones', []))
.then(reply => fetchZoneInfos(reply[0]));
}
function getServices() {
if (firewall.readonly)
return Promise.resolve();
firewall.enabledServices = new Set();
return Promise.all([...firewall.activeZones].map(z => {
return firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1.zone',
'getServices', [z])
.then(reply => fetchServiceInfos(reply[0]))
.then(services => {
const promises = [];
for (const s of services) {
firewall.enabledServices.add(s.id);
if (s.includes.length)
promises.push(fetchServiceInfos(s.includes));
}
return Promise.all(promises);
});
}));
}
function fetchServiceInfos(services) {
return Promise.all(services.map(service => {
if (firewall.services[service])
return firewall.services[service];
let info;
return firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1',
'getServiceSettings', [service])
.then(reply => {
const name = reply[0][1];
const description = reply[0][2];
const ports = reply[0][3];
info = {
id: service,
name: name,
description: description,
ports: ports.map(p => ({ port: p[0], protocol: p[1] })),
includes: [],
};
firewall.services[service] = info;
return firewalld_dbus.call('/org/fedoraproject/FirewallD1/config',
'org.fedoraproject.FirewallD1.config',
'getServiceByName', [service]);
})
.then(path => firewalld_dbus.call(path[0],
'org.fedoraproject.FirewallD1.config.service',
'getSettings2', []))
.then(reply => {
if (reply[0].includes) {
info.includes = reply[0].includes.v;
firewall.services[service] = info;
}
return info;
})
.catch(error => {
if (error.name === 'org.freedesktop.DBus.Error.UnknownMethod')
return info;
return Promise.reject(error);
});
}));
}
function fetchZoneInfos(zones) {
return Promise.all(zones.map(zone => {
if (firewall.readonly) {
const info = {
id: zone,
name: zone,
description: null,
target: null,
services: [],
ports: [],
interfaces: [],
source: [],
};
firewall.zones[zone] = info;
return info;
}
return firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1',
'getZoneSettings', [zone])
.then(reply => {
const [, name, description, , target, services, ports, , , , interfaces, source] = reply[0];
const info = {
id: zone,
name: name,
description: description,
target: target,
services: services,
ports: ports.map(p => ({ port: p[0], protocol: p[1] })),
interfaces: interfaces,
source: source,
};
firewall.zones[zone] = info;
return info;
});
}));
}
initFirewalldDbus();
cockpit.spawn(['sh', '-c', 'pkcheck --action-id org.fedoraproject.FirewallD1.all --process $$ --<API key> 2>&1'], { superuser: "try" })
.done(() => {
firewall.readonly = false;
firewall.debouncedEvent('changed');
firewall.debouncedGetZones();
});
firewall.enable = () => firewalld_service.enable().then(() => firewalld_service.start());
firewall.disable = () => firewalld_service.disable().then(() => firewalld_service.stop());
firewall.<API key> = () => {
return firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1',
'listServices', [])
.then(reply => fetchServiceInfos(reply[0]))
.catch(error => console.warn(error));
};
/*
* Only call this after defining a new service, as it will remove existing
* non-permanent configurations.
*/
firewall.reload = () => {
return firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1',
'reload', [])
.catch(error => console.warn(error));
};
/*
* Remove a service from the specified zone (i.e., close its ports).
*
* Returns a promise that resolves when the service is removed.
*/
firewall.removeService = (zone, service) => {
return firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1.zone',
'removeService', [zone, service])
.then(reply => firewalld_dbus.call('/org/fedoraproject/FirewallD1/config',
'org.fedoraproject.FirewallD1.config',
'getZoneByName', [zone]))
.then(path => firewalld_dbus.call(path[0], 'org.fedoraproject.FirewallD1.config.zone',
'removeService', [service]));
};
/*
* Create new firewalld service.
*
* Returns a promise that resolves when the service is created.
* It will also reload firewalld and enable the new service.
*/
firewall.createService = (service, ports, zones) => {
const subscription = firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1',
path: '/org/fedoraproject/FirewallD1',
member: 'Reloaded'
}, () => {
firewall.addServices(zones, [service]);
subscription.remove();
});
return firewalld_dbus.call('/org/fedoraproject/FirewallD1/config',
'org.fedoraproject.FirewallD1.config',
'addService', [service, ["", "", "", ports, [], {}, [], []]])
.then(() => firewall.reload());
};
/*
* Add a predefined firewalld service to the specified zone (i.e., open its
* ports).
*
* Returns a promise that resolves when the service is added.
*/
firewall.addService = (zone, service) => {
return firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1.zone',
'addService', [zone, service, 0])
.then(reply => firewalld_dbus.call('/org/fedoraproject/FirewallD1/config',
'org.fedoraproject.FirewallD1.config',
'getZoneByName', [zone]))
.then(path => firewalld_dbus.call(path[0], 'org.fedoraproject.FirewallD1.config.zone',
'addService', [service]));
};
/*
* Like addService(), but adds multiple predefined firewalld services at once
* to the specified zones.
*
* Returns a promise that resolves when all services are added.
*/
firewall.addServices = (zone, services) =>
Promise.all(services.map(s => firewall.addService(zone, s)));
firewall.<API key> = (zones, service) =>
Promise.all(zones.map(z => firewall.removeService(z, service)));
firewall.activateZone = (zone, interfaces, sources) => {
let promises = interfaces.map(i => firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1.zone',
'addInterface', [zone, i]));
promises = promises.concat(sources.map(s => firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1.zone',
'addSource', [zone, s])));
let p = Promise.all(promises).then(() => firewalld_dbus.call('/org/fedoraproject/FirewallD1/config',
'org.fedoraproject.FirewallD1.config',
'getZoneByName', [zone]));
p = p.then(path => {
/* Once this signal is received, it's safe to actually emit the changed
* signal and thus update the UI */
const subscription = firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.config.zone',
path: path[0],
member: 'Updated'
}, (path, iface, signal, args) => {
getZones().then(() => getServices());
subscription.remove();
});
return firewalld_dbus.call(path[0],
'org.fedoraproject.FirewallD1.config.zone',
'getSettings', [])
.then(settings => {
settings[0][10] = interfaces;
settings[0][11] = sources;
return firewalld_dbus.call(path[0],
'org.fedoraproject.FirewallD1.config.zone',
'update', [settings[0]]);
});
});
return p;
};
/*
* A zone is considered deactivated when it has no interfaces or sources.
*/
firewall.deactiveateZone = (zone) => {
const zoneObject = firewall.zones[zone];
let promises = zoneObject.interfaces.map(i => firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1.zone',
'removeInterface', [zone, i]));
promises = promises.concat(zoneObject.source.map(s => firewalld_dbus.call('/org/fedoraproject/FirewallD1',
'org.fedoraproject.FirewallD1.zone',
'removeSource', [zone, s])));
let p = Promise.all(promises).then(() => firewalld_dbus.call('/org/fedoraproject/FirewallD1/config',
'org.fedoraproject.FirewallD1.config',
'getZoneByName', [zone]));
p = p.then(path => {
/* Once this signal is received, it's safe to actually emit the changed
* signal and thus update the UI */
const subscription = firewalld_dbus.subscribe({
interface: 'org.fedoraproject.FirewallD1.config.zone',
path: path[0],
member: 'Updated'
}, (path, iface, signal, args) => {
firewall.activeZones.delete(args[0]);
getZones().then(() => getServices());
subscription.remove();
});
return firewalld_dbus.call(path[0],
'org.fedoraproject.FirewallD1.config.zone',
'getSettings', [])
.then(settings => {
settings[0][10] = [];
settings[0][11] = [];
return firewalld_dbus.call(path[0],
'org.fedoraproject.FirewallD1.config.zone',
'update', [settings[0]]);
});
});
return p.catch(error => console.warn(error));
};
export default firewall;
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>@DOC_TITLE@</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" height="10%" bgcolor="#FFFFFF">
<tr>
<td colspan="2"><p><A href=http:
<td colspan="2"> <strong><font face="Helvetica" color="#000000" size="+3">Xmega Application Note</font></strong></td>
<td colspan="2"><p><A href=http:
</tr>
<tr>
<td colspan="6" height="1" background="blue.gif"></td>
</tr>
</table>
<!-- Generated by Doxygen 1.5.5 -->
<h1>TC_driver.c</h1><a href="TC__driver_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* This file has been prepared for Doxygen automatic documentation generation.*/</span>
<a name="l00068"></a>00068 <span class="preprocessor">#include "<a class="code" href="avr__compiler_8h.html" title="This file implements some macros that makes the IAR C-compiler and avr-gcc work with...">avr_compiler.h</a>"</span>
<a name="l00069"></a>00069 <span class="preprocessor">#include "<a class="code" href="TC__driver_8h.html" title="XMEGA Timer/Counter driver header file.">TC_driver.h</a>"</span>
<a name="l00070"></a>00070
<a name="l00079"></a><a class="code" href="TC__driver_8h.html#<API key>">00079</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Configures clock source for the Timer/Counter 0."><API key></a>( <span class="keyword">volatile</span> TC0_t * tc, TC_CLKSEL_t clockSelection )
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 tc->CTRLA = ( tc->CTRLA & ~TC0_CLKSEL_gm ) | clockSelection;
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083
<a name="l00092"></a><a class="code" href="TC__driver_8h.html#<API key>">00092</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Configures clock source for the Timer/Counter 1."><API key></a>( <span class="keyword">volatile</span> TC1_t * tc, TC_CLKSEL_t clockSelection )
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094 tc->CTRLA = ( tc->CTRLA & ~TC1_CLKSEL_gm ) | clockSelection;
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096
<a name="l00097"></a>00097
<a name="l00106"></a><a class="code" href="TC__driver_8h.html#<API key>">00106</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Configures the Waveform Generation Mode for the Timer/Counter 0.">TC0_ConfigWGM</a>( <span class="keyword">volatile</span> TC0_t * tc, TC_WGMODE_t wgm )
<a name="l00107"></a>00107 {
<a name="l00108"></a>00108 tc->CTRLB = ( tc->CTRLB & ~TC0_WGMODE_gm ) | wgm;
<a name="l00109"></a>00109 }
<a name="l00110"></a>00110
<a name="l00111"></a>00111
<a name="l00120"></a><a class="code" href="TC__driver_8h.html#<API key>">00120</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Configures the Waveform Generation Mode for the Timer/Counter 1.">TC1_ConfigWGM</a>( <span class="keyword">volatile</span> TC1_t * tc, TC_WGMODE_t wgm )
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122 tc->CTRLB = ( tc->CTRLB & ~TC1_WGMODE_gm ) | wgm;
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124
<a name="l00125"></a>00125
<a name="l00137"></a><a class="code" href="TC__driver_8h.html#<API key>">00137</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Configures the Timer/Counter 0 for input capture operation."><API key></a>( <span class="keyword">volatile</span> TC0_t * tc, TC_EVSEL_t eventSource )
<a name="l00138"></a>00138 {
<a name="l00139"></a>00139 tc->CTRLD = ( tc->CTRLD & ~( TC0_EVSEL_gm | TC0_EVACT_gm ) ) |
<a name="l00140"></a>00140 eventSource |
<a name="l00141"></a>00141 TC_EVACT_CAPT_gc;
<a name="l00142"></a>00142 }
<a name="l00143"></a>00143
<a name="l00144"></a>00144
<a name="l00156"></a><a class="code" href="TC__driver_8h.html#<API key>">00156</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Configures the Timer/Counter 1 for input capture operation."><API key></a>( <span class="keyword">volatile</span> TC1_t * tc, TC_EVSEL_t eventSource )
<a name="l00157"></a>00157 {
<a name="l00158"></a>00158 tc->CTRLD = ( tc->CTRLD & ~( TC1_EVSEL_gm | TC1_EVACT_gm ) ) |
<a name="l00159"></a>00159 eventSource |
<a name="l00160"></a>00160 TC_EVACT_CAPT_gc;
<a name="l00161"></a>00161 }
<a name="l00162"></a>00162
<a name="l00163"></a>00163
<a name="l00182"></a><a class="code" href="TC__driver_8h.html#<API key>">00182</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Enables compare/capture channels for Timer/Counter 0."><API key></a>( <span class="keyword">volatile</span> TC0_t * tc, uint8_t enableMask )
<a name="l00183"></a>00183 {
<a name="l00184"></a>00184 <span class="comment">/* Make sure only CCxEN bits are set in enableMask. */</span>
<a name="l00185"></a>00185 enableMask &= ( TC0_CCAEN_bm | TC0_CCBEN_bm | TC0_CCCEN_bm | TC0_CCDEN_bm );
<a name="l00186"></a>00186
<a name="l00187"></a>00187 <span class="comment">/* Enable channels. */</span>
<a name="l00188"></a>00188 tc->CTRLB |= enableMask;
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190
<a name="l00207"></a><a class="code" href="TC__driver_8h.html#<API key>">00207</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Enables compare/capture channels for Timer/Counter 1."><API key></a>( <span class="keyword">volatile</span> TC1_t * tc, uint8_t enableMask )
<a name="l00208"></a>00208 {
<a name="l00209"></a>00209 <span class="comment">/* Make sure only CCxEN bits are set in enableMask. */</span>
<a name="l00210"></a>00210 enableMask &= ( TC1_CCAEN_bm | TC1_CCBEN_bm );
<a name="l00211"></a>00211
<a name="l00212"></a>00212 <span class="comment">/* Enable channels. */</span>
<a name="l00213"></a>00213 tc->CTRLB |= enableMask;
<a name="l00214"></a>00214 }
<a name="l00215"></a>00215
<a name="l00216"></a>00216
<a name="l00232"></a><a class="code" href="TC__driver_8h.html#<API key>">00232</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Disables compare/capture channels on Timer/Counter 0."><API key></a>( <span class="keyword">volatile</span> TC0_t * tc, uint8_t disableMask )
<a name="l00233"></a>00233 {
<a name="l00234"></a>00234 <span class="comment">/* Make sure only CCxEN bits are set in disableMask. */</span>
<a name="l00235"></a>00235 disableMask &= ( TC0_CCAEN_bm | TC0_CCBEN_bm | TC0_CCCEN_bm | TC0_CCDEN_bm );
<a name="l00236"></a>00236
<a name="l00237"></a>00237 <span class="comment">/* Disable channels. */</span>
<a name="l00238"></a>00238 tc->CTRLB &= ~disableMask;
<a name="l00239"></a>00239 }
<a name="l00240"></a>00240
<a name="l00241"></a>00241
<a name="l00255"></a><a class="code" href="TC__driver_8h.html#<API key>">00255</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Disables compare/capture channels on Timer/Counter 1."><API key></a>( <span class="keyword">volatile</span> TC1_t * tc, uint8_t disableMask )
<a name="l00256"></a>00256 {
<a name="l00257"></a>00257 <span class="comment">/* Make sure only CCxEN bits are set in disableMask. */</span>
<a name="l00258"></a>00258 disableMask &= ( TC1_CCAEN_bm | TC1_CCBEN_bm );
<a name="l00259"></a>00259
<a name="l00260"></a>00260 <span class="comment">/* Disable channels. */</span>
<a name="l00261"></a>00261 tc->CTRLB &= ~disableMask;
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263
<a name="l00271"></a><a class="code" href="TC__driver_8h.html#<API key>">00271</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the overflow interrupt level."><API key></a>( <span class="keyword">volatile</span> TC0_t * tc, TC_OVFINTLVL_t intLevel )
<a name="l00272"></a>00272 {
<a name="l00273"></a>00273 tc->INTCTRLA = ( tc->INTCTRLA & ~TC0_OVFINTLVL_gm ) | intLevel;
<a name="l00274"></a>00274 }
<a name="l00275"></a>00275
<a name="l00276"></a>00276
<a name="l00284"></a><a class="code" href="TC__driver_8h.html#<API key>">00284</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the overflow interrupt level."><API key></a>( <span class="keyword">volatile</span> TC1_t * tc, TC_OVFINTLVL_t intLevel )
<a name="l00285"></a>00285 {
<a name="l00286"></a>00286 tc->INTCTRLA = ( tc->INTCTRLA & ~TC1_OVFINTLVL_gm ) | intLevel;
<a name="l00287"></a>00287 }
<a name="l00288"></a>00288
<a name="l00289"></a>00289
<a name="l00297"></a><a class="code" href="TC__driver_8h.html#<API key>">00297</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the Error interrupt level."><API key></a>( <span class="keyword">volatile</span> TC0_t * tc, TC_ERRINTLVL_t intLevel )
<a name="l00298"></a>00298 {
<a name="l00299"></a>00299 tc->INTCTRLA = ( tc->INTCTRLA & ~TC0_ERRINTLVL_gm ) | intLevel;
<a name="l00300"></a>00300 }
<a name="l00301"></a>00301
<a name="l00302"></a>00302
<a name="l00310"></a><a class="code" href="TC__driver_8h.html#<API key>">00310</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the Error interrupt level."><API key></a>( <span class="keyword">volatile</span> TC1_t * tc, TC_ERRINTLVL_t intLevel )
<a name="l00311"></a>00311 {
<a name="l00312"></a>00312 tc->INTCTRLA = ( tc->INTCTRLA & ~TC1_ERRINTLVL_gm ) | intLevel;
<a name="l00313"></a>00313 }
<a name="l00314"></a>00314
<a name="l00315"></a>00315
<a name="l00324"></a><a class="code" href="TC__driver_8h.html#<API key>">00324</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the interrupt level for compare/capture channel A interrupt.">TC0_SetCCAIntLevel</a>( <span class="keyword">volatile</span> TC0_t * tc, TC_CCAINTLVL_t intLevel )
<a name="l00325"></a>00325 {
<a name="l00326"></a>00326 tc->INTCTRLB = ( tc->INTCTRLB & ~TC0_CCAINTLVL_gm ) | intLevel;
<a name="l00327"></a>00327 }
<a name="l00328"></a>00328
<a name="l00329"></a>00329
<a name="l00338"></a><a class="code" href="TC__driver_8h.html#<API key>">00338</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the interrupt level for compare/capture channel A interrupt.">TC1_SetCCAIntLevel</a>( <span class="keyword">volatile</span> TC1_t * tc, TC_CCAINTLVL_t intLevel )
<a name="l00339"></a>00339 {
<a name="l00340"></a>00340 tc->INTCTRLB = ( tc->INTCTRLB & ~TC1_CCAINTLVL_gm ) | intLevel;
<a name="l00341"></a>00341 }
<a name="l00342"></a>00342
<a name="l00343"></a>00343
<a name="l00352"></a><a class="code" href="TC__driver_8h.html#<API key>">00352</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the interrupt level for compare/capture channel B interrupt.">TC0_SetCCBIntLevel</a>( <span class="keyword">volatile</span> TC0_t * tc, TC_CCBINTLVL_t intLevel )
<a name="l00353"></a>00353 {
<a name="l00354"></a>00354 tc->INTCTRLB = ( tc->INTCTRLB & ~TC0_CCBINTLVL_gm ) | intLevel;
<a name="l00355"></a>00355 }
<a name="l00356"></a>00356
<a name="l00357"></a>00357
<a name="l00366"></a><a class="code" href="TC__driver_8h.html#<API key>">00366</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the interrupt level for compare/capture channel B interrupt.">TC1_SetCCBIntLevel</a>( <span class="keyword">volatile</span> TC1_t * tc, TC_CCBINTLVL_t intLevel )
<a name="l00367"></a>00367 {
<a name="l00368"></a>00368 tc->INTCTRLB = ( tc->INTCTRLB & ~TC1_CCBINTLVL_gm ) | intLevel;
<a name="l00369"></a>00369 }
<a name="l00370"></a>00370
<a name="l00371"></a>00371
<a name="l00380"></a><a class="code" href="TC__driver_8h.html#<API key>">00380</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the interrupt level for compare/capture channel C interrupt.">TC0_SetCCCIntLevel</a>( <span class="keyword">volatile</span> TC0_t * tc, TC_CCCINTLVL_t intLevel )
<a name="l00381"></a>00381 {
<a name="l00382"></a>00382 tc->INTCTRLB = ( tc->INTCTRLB & ~TC0_CCCINTLVL_gm ) | intLevel;
<a name="l00383"></a>00383 }
<a name="l00384"></a>00384
<a name="l00385"></a>00385
<a name="l00394"></a><a class="code" href="TC__driver_8h.html#<API key>">00394</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Sets the interrupt level for compare/capture channel D interrupt.">TC0_SetCCDIntLevel</a>( <span class="keyword">volatile</span> TC0_t * tc, TC_CCDINTLVL_t intLevel )
<a name="l00395"></a>00395 {
<a name="l00396"></a>00396 tc->INTCTRLB = ( tc->INTCTRLB & ~TC0_CCDINTLVL_gm ) | intLevel;
<a name="l00397"></a>00397 }
<a name="l00398"></a>00398
<a name="l00399"></a>00399
<a name="l00408"></a><a class="code" href="TC__driver_8h.html#<API key>">00408</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Resets the Timer/Counter 0.">TC0_Reset</a>( <span class="keyword">volatile</span> TC0_t * tc )
<a name="l00409"></a>00409 {
<a name="l00410"></a>00410 <span class="comment">/* TC must be turned off before a Reset command. */</span>
<a name="l00411"></a>00411 tc->CTRLA = ( tc->CTRLA & ~TC0_CLKSEL_gm ) | TC_CLKSEL_OFF_gc;
<a name="l00412"></a>00412
<a name="l00413"></a>00413 <span class="comment">/* Issue Reset command. */</span>
<a name="l00414"></a>00414 tc->CTRLFSET = TC_CMD_RESET_gc;
<a name="l00415"></a>00415 }
<a name="l00416"></a>00416
<a name="l00417"></a>00417
<a name="l00426"></a><a class="code" href="TC__driver_8h.html#<API key>">00426</a> <span class="keywordtype">void</span> <a class="code" href="TC__driver_8c.html#<API key>" title="Resets the Timer/Counter 1.">TC1_Reset</a>( <span class="keyword">volatile</span> TC1_t * tc )
<a name="l00427"></a>00427 {
<a name="l00428"></a>00428 <span class="comment">/* TC must be turned off before a Reset command. */</span>
<a name="l00429"></a>00429 tc->CTRLA = ( tc->CTRLA & ~TC1_CLKSEL_gm ) | TC_CLKSEL_OFF_gc;
<a name="l00430"></a>00430
<a name="l00431"></a>00431 <span class="comment">/* Issue Reset command. */</span>
<a name="l00432"></a>00432 tc->CTRLFSET = TC_CMD_RESET_gc;
<a name="l00433"></a>00433 }
</pre></div></div>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>@DOC_TITLE@</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" height="10%" bgcolor="#FFFFFF">
<tr>
<td colspan="6" height="1" background="blue.gif"></td>
</tr>
<tr>
<td colspan="6">
<address style="align: right;"><small>
Generated on Wed Apr 23 07:45:44 2008 for AVR1306 Using the XMEGA Timer/Counter by <a href="http:
</td>
</tr>
</table>
|
package org.parallelj.launching.transport.tcp.command.option;
import java.util.Iterator;
import org.parallelj.launching.Launch;
import org.parallelj.launching.<API key>;
import org.parallelj.launching.inout.Argument;
import org.parallelj.launching.parser.ParserException;
import org.parallelj.launching.remote.RemoteProgram;
import org.parallelj.launching.remote.RemotePrograms;
public final class OptionsUtils {
private OptionsUtils() {
}
public static void processId(final IOption ioption, final Launch<?> launch)
throws OptionException {
String strId=null;
try {
strId = ioption.getOption().getValue("id");
// Check the Id
int id = Integer.parseInt(strId);
if (id >= RemotePrograms.getRemotePrograms().size()) {
throw new OptionException(
<API key>.EREMOTE0004.format(strId));
}
//jobDataMap.put(QuartzUtils.<API key>(), id);
} catch (<API key> e) {
throw new OptionException(<API key>.EREMOTE0008.format(
"id", strId), e);
}
}
public static void processArgs(final IOption ioption, final Launch<?> launch,
final Object... args) throws OptionException, ParserException {
// Check arguments number
final String[] arguments = ioption.getOption().getValues();
final RemoteProgram remoteProgram = (RemoteProgram) args[0];
if (arguments != null) {
if (remoteProgram.getArguments().size() > arguments.length) {
throw new OptionException(
<API key>.EREMOTE0005.format(
remoteProgram.getAdapterClass(),
arguments.length));
}
// Initialize arguments format
initializeArg(remoteProgram, arguments, launch);
}
}
/**
* Check the validity of arguments values coming from remote launching with
* regard to types. If not done, the Quartz Exception thrown doesn't stop
* the launch and Program may be launched with invalid arguments values.
*
* @param adapterArguments
* @param arguments
* @throws ParserException
*/
public static void initializeArg(final RemoteProgram remoteProgram, final String[] arguments, final Launch<?> launch)
throws OptionException, ParserException {
int numberOfEquals = 0;
for (String argument : arguments) {
if (argument.indexOf('=') > -1)
numberOfEquals++;
}
if (numberOfEquals != arguments.length)
throw new OptionException(<API key>.WREMOTE001.format(remoteProgram.getClass().getCanonicalName()));
for (String argument : arguments) {
if (argument.indexOf("=") > 0) {
String[] arg = argument.split("=");
String argName = arg[0];
String argValue = null;
if (arg.length>1)
argValue = arg[1];
if (argValue != null && argValue.trim().length() == 0)
argValue = null;
if (argValue!=null && argValue.charAt(0) == '"' && argValue.charAt(argValue.length()-1) == '"') {
argValue = argValue.substring(1, argValue.length()-1);
}
if (argValue!=null && argValue.charAt(0) == '\'' && argValue.charAt(argValue.length()-1) == '\'') {
argValue = argValue.substring(1, argValue.length()-1);
}
if (argValue!=null && argValue.equals("''")){
argValue = "";
}
Iterator<Argument> argumentIterator = remoteProgram.getArguments().iterator();
boolean found = false;
while (argumentIterator.hasNext() && !found) {
Argument a = argumentIterator.next();
try {
if (a.getName().equals(argName)) {
a.setValueUsingParser(argValue);
found = true;
}
} catch (Exception e) {
throw new OptionException(<API key>.EREMOTE0010.format(a.getName(), remoteProgram.getClass().getCanonicalName()), e);
}
}
if (!found) {
throw new OptionException(<API key>.EREMOTE0012.format(argument, remoteProgram.getClass().getCanonicalName(), argument)); }
} else {
throw new OptionException(<API key>.EREMOTE0011.format(remoteProgram.getClass().getCanonicalName()));
}
}
}
public static void checkArgs(final IOption ioption,
final RemoteProgram remoteProgram) throws OptionException {
if (ioption.getOption().getLongOpt().equals("args")
&& remoteProgram.getArguments().size()>0
&& ( ioption.getOption().getValues() == null
|| ioption.getOption().getValues().length < remoteProgram.getArguments().size())) {
throw new OptionException(
<API key>.EREMOTE0005.format(remoteProgram
.getAdapterClass().getCanonicalName(),
remoteProgram.getArguments().size()));
}
}
public static int checkId(final String str) throws OptionException {
int index = 0;
try {
index = Integer.parseInt(str);
} catch (<API key> e) {
throw new OptionException(
<API key>.EREMOTE0006.format(str));
}
return index;
}
public static RemoteProgram getProgram(final IIdOption iIdOption) throws OptionException {
final int index = checkId(iIdOption.getOption().getValue());
try {
final RemoteProgram remoteProgram = (RemoteProgram) (RemotePrograms
.getRemotePrograms().get(index));
return remoteProgram;
} catch (<API key> e) {
throw new OptionException(
<API key>.EREMOTE0004.format(index));
}
}
}
|
#include "eventlist.hh"
#include "testing.hh"
#include "internal.hh"
BSE_INTEGRITY_TEST (bse_event_list);
static void
bse_event_list ()
{
struct Control {
uint tick = 0;
Control (uint t = 0) : tick (t) {}
static int
compare_order (const Control &a, const Control &b)
{
return int (a.tick) - int (b.tick);
}
};
struct Note : Control {
uint16_t key = 0;
Note (uint t = 0, uint k = 0) : Control (t), key (k) {}
static int
compare_order (const Note &a, const Note &b)
{
int cmp = Control::compare_order (a, b);
if (!cmp)
cmp = int (a.key) - int (b.key);
return cmp;
}
};
int ret;
const Note *cnote;
struct CompareKey { int operator() (const Note &a, const Note &b) { return int (a.key) - int (b.key); } };
struct CompareOrder { int operator() (const Note &a, const Note &b) { return Note::compare_order (a, b); } };
using OrderedNoteList = Bse::OrderedEventList<Note,CompareOrder>;
OrderedNoteList::ConstP notesp;
{
int modified = -99;
Bse::EventList<Note,CompareKey> note_events ([&] (const Note&, int mod) { modified = mod; });
note_events.insert (Note()); TASSERT (modified == +1); // inserted
note_events.insert (Note()); TASSERT (modified == 0); // replaced
cnote = note_events.lookup (Note()); TASSERT (cnote != nullptr);
ret = note_events.remove (Note()); TASSERT (ret && modified == -1); // removed
modified = -99;
ret = note_events.remove (Note()); TASSERT (!ret && modified == -99); // unknown
note_events.insert (Note (33, 3)); TASSERT (modified == +1); // inserted
cnote = note_events.first(); TASSERT (cnote && cnote->key == 3);
note_events.insert (Note (15, 5)); TASSERT (modified == +1); // inserted
note_events.insert (Note (21, 1)); TASSERT (modified == +1); // inserted
cnote = note_events.first(); TASSERT (cnote && cnote->key == 1);
ret = note_events.last() - cnote + 1; TASSERT (ret == 3);
cnote = note_events.last(); TASSERT (cnote && cnote->key == 5);
cnote = note_events.lookup_after (Note (0, 2)); TASSERT (cnote && cnote->key == 3);
cnote += 1; TASSERT (cnote && cnote->key == 5);
notesp = note_events.ordered_events<OrderedNoteList>();
note_events.clear_silently();
ret = note_events.size(); TASSERT (ret == 0);
}
const auto ¬es = *notesp;
TASSERT (notes.size() == 3);
TASSERT (notes[0].tick == 15);
TASSERT (notes[1].tick == 21);
TASSERT (notes[2].tick == 33);
cnote = notes.lookup (Note (33, 3)); TASSERT (cnote && cnote == ¬es.back());
cnote = notes.lookup_after (Note (17, 0)); TASSERT (cnote && cnote->key == 1);
cnote = notes.lookup_after (Note (0, 0)); TASSERT (cnote && cnote == ¬es.front());
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LCOV - doc-coverage.info - Cqrs.MongoDB/Events/<API key>.cs</title>
<link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>
<body>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="title">Documentation Coverage Report</td></tr>
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
<tr>
<td width="100%">
<table cellpadding=1 border=0 width="100%">
<tr>
<td width="10%" class="headerItem">Current view:</td>
<td width="35%" class="headerValue"><a href="../../index.html">top level</a> - <a href="index.html">Cqrs.MongoDB/Events</a> - <API key>.cs</td>
<td width="5%"></td>
<td width="15%"></td>
<td width="10%" class="headerCovTableHead">Hit</td>
<td width="10%" class="headerCovTableHead">Total</td>
<td width="15%" class="headerCovTableHead">Coverage</td>
</tr>
<tr>
<td class="headerItem">Version:</td>
<td class="headerValue">4.0</td>
<td></td>
<td class="headerItem">Artefacts:</td>
<td class="headerCovTableEntry">4</td>
<td class="headerCovTableEntry">4</td>
<td class="<API key>">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2019-11-24 03:15:41</td>
<td></td>
</tr>
<tr><td><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
</table>
</td>
</tr>
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
</table>
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td><br></td>
</tr>
<tr>
<td>
<pre class="sourceHeading"> Line data Source code</pre>
<pre class="source">
<span class="lineNum"> 1 </span> :
<span class="lineNum"> 2 </span> :
<span class="lineNum"> 3 </span> :
<span class="lineNum"> 4 </span> :
<span class="lineNum"> 5 </span> :
<span class="lineNum"> 6 </span> :
<span class="lineNum"> 7 </span> : #endregion
<span class="lineNum"> 8 </span> :
<span class="lineNum"> 9 </span> : using System.Configuration;
<span class="lineNum"> 10 </span> : using Chinchilla.Logging;
<span class="lineNum"> 11 </span> : using Cqrs.Configuration;
<span class="lineNum"> 12 </span> : using Cqrs.Exceptions;
<span class="lineNum"> 13 </span> :
<span class="lineNum"> 14 </span> : namespace Cqrs.MongoDB.Events
<span class="lineNum"> 15 </span> : {
<span class="lineNum"> 16 </span> : /// <summary>
<span class="lineNum"> 17 </span> : /// A factory for getting connection strings and database names for Snapshot Store access.
<span class="lineNum"> 18 </span> : /// </summary>
<span class="lineNum"> 19 </span> : public class <API key>
<span class="lineNum"> 20 </span> : : <API key>
<span class="lineNum"> 21 </span><span class="lineCov"> 1 : {</span>
<span class="lineNum"> 22 </span> : /// <summary>
<span class="lineNum"> 23 </span> : /// The name of the app setting in <see cref="<API key>"/> that will have the name of the connection string of the MongoDB server.
<span class="lineNum"> 24 </span> : /// </summary>
<span class="lineNum"> 25 </span> : public static string <API key> = "Cqrs.MongoDb.SnapshotStore.<API key>";
<span class="lineNum"> 26 </span> :
<span class="lineNum"> 27 </span> : /// <summary>
<span class="lineNum"> 28 </span> : /// The name of the app setting in <see cref="<API key>"/> that will have the name of the database.
<span class="lineNum"> 29 </span> : /// </summary>
<span class="lineNum"> 30 </span> : public static string <API key> = "Cqrs.MongoDb.SnapshotStore.DatabaseName";
<span class="lineNum"> 31 </span> :
<span class="lineNum"> 32 </span> : /// <summary>
<span class="lineNum"> 33 </span> : /// Gets or sets the <see cref="<API key>"/>.
<span class="lineNum"> 34 </span> : /// </summary>
<span class="lineNum"> 35 </span> : protected <API key> <API key> { get; private set; }
<span class="lineNum"> 36 </span> :
<span class="lineNum"> 37 </span> : /// <summary>
<span class="lineNum"> 38 </span> : /// Gets or sets the <see cref="ILogger"/>.
<span class="lineNum"> 39 </span> : /// </summary>
<span class="lineNum"> 40 </span> : protected ILogger Logger { get; private set; }
<span class="lineNum"> 41 </span> :
<span class="lineNum"> 42 </span> : /// <summary>
<span class="lineNum"> 43 </span> : /// Instantiates a new instance of <see cref="<API key>"/>.
<span class="lineNum"> 44 </span> : /// </summary>
<span class="lineNum"> 45 </span><span class="lineCov"> 1 : public <API key>(<API key> <API key>, ILogger logger)</span>
<span class="lineNum"> 46 </span> : {
<span class="lineNum"> 47 </span> : <API key> = <API key>;
<span class="lineNum"> 48 </span> : Logger = logger;
<span class="lineNum"> 49 </span> : }
<span class="lineNum"> 50 </span> :
<span class="lineNum"> 51 </span> : #region Implementation of <API key>
<span class="lineNum"> 52 </span> :
<span class="lineNum"> 53 </span> : /// <summary>
<span class="lineNum"> 54 </span> : /// Gets the current connection string.
<span class="lineNum"> 55 </span> : /// </summary>
<span class="lineNum"> 56 </span><span class="lineCov"> 1 : public string <API key>()</span>
<span class="lineNum"> 57 </span> : {
<span class="lineNum"> 58 </span> : Logger.LogDebug("Getting MongoDB connection string", "<API key>\\<API key>");
<span class="lineNum"> 59 </span> :
<span class="lineNum"> 60 </span> : try
<span class="lineNum"> 61 </span> : {
<span class="lineNum"> 62 </span> : string applicationKey;
<span class="lineNum"> 63 </span> :
<span class="lineNum"> 64 </span> : if (!<API key>.TryGetSetting(<API key>, out applicationKey) || string.IsNullOrEmpty(applicationKey))
<span class="lineNum"> 65 </span> : {
<span class="lineNum"> 66 </span> : Logger.LogDebug(string.Format("No application setting named '{0}' was found in the configuration file with the name of a connection string to look for.", <API key>), "<API key>\\<API key>");
<span class="lineNum"> 67 </span> : throw new <API key>(<API key>);
<span class="lineNum"> 68 </span> : }
<span class="lineNum"> 69 </span> :
<span class="lineNum"> 70 </span> : <API key> connectionString = System.Configuration.<API key>.ConnectionStrings[applicationKey];
<span class="lineNum"> 71 </span> : // If the connection string doesn't exist this value IS the connection string itself
<span class="lineNum"> 72 </span> : if (connectionString == null)
<span class="lineNum"> 73 </span> : throw new <API key>(applicationKey);
<span class="lineNum"> 74 </span> :
<span class="lineNum"> 75 </span> : return connectionString.ConnectionString;
<span class="lineNum"> 76 </span> : }
<span class="lineNum"> 77 </span> : finally
<span class="lineNum"> 78 </span> : {
<span class="lineNum"> 79 </span> : Logger.LogDebug("Getting MongoDB connection string... Done", "<API key>\\<API key>");
<span class="lineNum"> 80 </span> : }
<span class="lineNum"> 81 </span> : }
<span class="lineNum"> 82 </span> :
<span class="lineNum"> 83 </span> : /// <summary>
<span class="lineNum"> 84 </span> : /// Gets the current database name.
<span class="lineNum"> 85 </span> : /// </summary>
<span class="lineNum"> 86 </span><span class="lineCov"> 1 : public string <API key>()</span>
<span class="lineNum"> 87 </span> : {
<span class="lineNum"> 88 </span> : string applicationKey;
<span class="lineNum"> 89 </span> :
<span class="lineNum"> 90 </span> : if (!<API key>.TryGetSetting(<API key>, out applicationKey) || string.IsNullOrEmpty(applicationKey))
<span class="lineNum"> 91 </span> : throw new <API key>(<API key>);
<span class="lineNum"> 92 </span> : return applicationKey;
<span class="lineNum"> 93 </span> : }
<span class="lineNum"> 94 </span> :
<span class="lineNum"> 95 </span> : #endregion
<span class="lineNum"> 96 </span> : }
<span class="lineNum"> 97 </span> : }
</pre>
</td>
</tr>
</table>
<br>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
<tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.13</a></td></tr>
</table>
<br>
</body>
</html>
|
#ifndef <API key>
#define <API key>
#include "Models/Bart/<API key>.hpp"
#include "Models/Bart/PosteriorSamplers/<API key>.hpp"
#include "Models/Glm/PosteriorSamplers/BregVsSampler.hpp"
#include "Models/PosteriorSamplers/PosteriorSampler.hpp"
namespace BOOM {
// Combines the regression component of the <API key>
// with a spike and slab prior, and the Bart part of the model with a
// traditional Bart prior.
// At each stage of the MCMC, the Bart predictions are subtracted from
// the data for the regression model, and vice versa.
class <API key> : public PosteriorSampler {
public:
<API key>(
<API key> *model,
const <API key> ®ression_prior,
const BartPriorParameters &bart_prior,
RNG &seeding_rng = GlobalRng::rng);
void draw() override;
double logpri() const override;
void <API key>();
void <API key>();
void <API key>();
void <API key>();
private:
<API key> *model_;
bool <API key>;
Ptr<<API key>> bart_sampler_;
bool <API key>;
};
} // namespace BOOM
#endif // <API key>
|
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <iv.h>
#include <iv_fd_pump.h>
#include <iv_list.h>
#include <iv_tls.h>
#include <string.h>
#include <sys/ioctl.h>
#include "iv_private.h"
struct iv_fd_pump_thr_info {
int num_bufs;
struct iv_list_head bufs;
};
static void buf_purge(struct iv_fd_pump_thr_info *tinfo);
static void <API key>(void *_tinfo)
{
struct iv_fd_pump_thr_info *tinfo = _tinfo;
tinfo->num_bufs = 0;
INIT_IV_LIST_HEAD(&tinfo->bufs);
}
static void <API key>(void *_tinfo)
{
struct iv_fd_pump_thr_info *tinfo = _tinfo;
buf_purge(tinfo);
}
static struct iv_tls_user iv_fd_pump_tls_user = {
.sizeof_state = sizeof(struct iv_fd_pump_thr_info),
.init_thread = <API key>,
.deinit_thread = <API key>,
};
static void iv_fd_pump_tls_init(void) __attribute__((constructor));
static void iv_fd_pump_tls_init(void)
{
<API key>(&iv_fd_pump_tls_user);
}
#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#endif
#if (defined(__NR_pipe2) || defined(HAVE_PIPE2)) && defined(O_CLOEXEC)
static int pipe2_support = 1;
#endif
static int grab_pipe(int *fd)
{
int ret;
#if (defined(__NR_pipe2) || defined(HAVE_PIPE2)) && defined(O_CLOEXEC)
if (pipe2_support) {
#ifdef __NR_pipe2
ret = syscall(__NR_pipe2, fd, O_CLOEXEC);
#else
ret = pipe2(fd, O_CLOEXEC);
#endif
if (ret == 0 || errno != ENOSYS)
return ret;
pipe2_support = 0;
}
#endif
ret = pipe(fd);
if (ret == 0) {
iv_fd_set_cloexec(fd[0]);
iv_fd_set_cloexec(fd[1]);
}
return ret;
}
#define MAX_CACHED_BUFS 20
#define BUF_SIZE 4096
#ifndef HAVE_SPLICE
#define splice_available 0
#define splice(...) -1
#ifndef FIONREAD
#define FIONREAD 0
#endif
#else
static int splice_available = -1;
#endif
struct iv_fd_pump_buf {
struct iv_list_head list;
union {
unsigned char buf[0];
int pfd[2];
} u;
};
static struct iv_fd_pump_buf *buf_alloc(void)
{
int size;
struct iv_fd_pump_buf *buf;
if (!splice_available)
size = sizeof(struct iv_list_head) + BUF_SIZE;
else
size = sizeof(struct iv_fd_pump_buf);
buf = malloc(size);
if (buf != NULL && splice_available && grab_pipe(buf->u.pfd) < 0) {
free(buf);
buf = NULL;
}
return buf;
}
static void __buf_free(struct iv_fd_pump_buf *buf)
{
if (splice_available) {
close(buf->u.pfd[0]);
close(buf->u.pfd[1]);
}
free(buf);
}
static void buf_put(struct iv_fd_pump_buf *buf, int bytes)
{
struct iv_fd_pump_thr_info *tinfo;
if (splice_available && bytes) {
__buf_free(buf);
return;
}
tinfo = iv_tls_user_ptr(&iv_fd_pump_tls_user);
if (tinfo->num_bufs < MAX_CACHED_BUFS) {
tinfo->num_bufs++;
iv_list_add(&buf->list, &tinfo->bufs);
} else {
__buf_free(buf);
}
}
static void <API key>(void)
{
#ifdef HAVE_SPLICE
struct iv_fd_pump_buf *b0;
struct iv_fd_pump_buf *b1;
int ret;
splice_available = 1;
b0 = buf_alloc();
if (b0 == NULL) {
splice_available = 0;
return;
}
b1 = buf_alloc();
if (b1 == NULL) {
__buf_free(b0);
splice_available = 0;
return;
}
ret = splice(b0->u.pfd[0], NULL, b1->u.pfd[1], NULL,
1, SPLICE_F_NONBLOCK);
if (ret < 0 && errno == EAGAIN) {
buf_put(b1, 0);
buf_put(b0, 0);
} else {
__buf_free(b0);
__buf_free(b1);
splice_available = 0;
}
#endif
}
static struct iv_fd_pump_buf *__buf_dequeue(struct iv_fd_pump_thr_info *tinfo)
{
if (!iv_list_empty(&tinfo->bufs)) {
struct iv_list_head *ilh;
tinfo->num_bufs
ilh = tinfo->bufs.next;
iv_list_del(ilh);
return iv_container_of(ilh, struct iv_fd_pump_buf, list);
}
return NULL;
}
static struct iv_fd_pump_buf *buf_get(void)
{
struct iv_fd_pump_thr_info *tinfo =
iv_tls_user_ptr(&iv_fd_pump_tls_user);
struct iv_fd_pump_buf *buf;
buf = __buf_dequeue(tinfo);
if (buf == NULL)
buf = buf_alloc();
return buf;
}
static void buf_purge(struct iv_fd_pump_thr_info *tinfo)
{
struct iv_fd_pump_buf *buf;
while ((buf = __buf_dequeue(tinfo)) != NULL)
__buf_free(buf);
}
static struct iv_fd_pump_buf *iv_fd_pump_buf(struct iv_fd_pump *ip)
{
return (struct iv_fd_pump_buf *)ip->buf;
}
void iv_fd_pump_init(struct iv_fd_pump *ip)
{
if (splice_available == -1)
<API key>();
ip->buf = NULL;
ip->bytes = 0;
ip->full = 0;
ip->saw_fin = 0;
ip->set_bands(ip->cookie, 1, 0);
}
void iv_fd_pump_destroy(struct iv_fd_pump *ip)
{
struct iv_fd_pump_buf *buf = iv_fd_pump_buf(ip);
if (ip->saw_fin != 2)
ip->set_bands(ip->cookie, 0, 0);
if (buf != NULL) {
buf_put(buf, ip->bytes);
ip->buf = NULL;
}
}
static int <API key>(struct iv_fd_pump *ip)
{
struct iv_fd_pump_buf *buf = iv_fd_pump_buf(ip);
int ret;
if (buf == NULL) {
buf = buf_get();
if (buf == NULL)
return -1;
ip->buf = (void *)buf;
}
do {
if (!splice_available) {
ret = read(ip->from_fd, buf->u.buf + ip->bytes,
BUF_SIZE - ip->bytes);
} else {
ret = splice(ip->from_fd, NULL, buf->u.pfd[1], NULL,
1048576, SPLICE_F_NONBLOCK);
}
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
if (errno != EAGAIN)
return -1;
if (splice_available && ip->bytes) {
int bytes = 1;
ioctl(ip->from_fd, FIONREAD, &bytes);
if (bytes > 0)
ip->full = 1;
}
return 0;
}
if (ret == 0) {
ip->saw_fin = 1;
if (!ip->bytes) {
if (ip->flags & <API key>)
shutdown(ip->to_fd, SHUT_WR);
ip->saw_fin = 2;
}
return 0;
}
ip->bytes += ret;
if (!splice_available && ip->bytes == BUF_SIZE)
ip->full = 1;
return 0;
}
static int <API key>(struct iv_fd_pump *ip)
{
struct iv_fd_pump_buf *buf = iv_fd_pump_buf(ip);
int ret;
do {
if (!splice_available) {
ret = write(ip->to_fd, buf->u.buf, ip->bytes);
} else {
ret = splice(buf->u.pfd[0], NULL, ip->to_fd, NULL,
ip->bytes, 0);
}
} while (ret < 0 && errno == EINTR);
if (ret <= 0)
return (ret < 0 && errno == EAGAIN) ? 0 : -1;
ip->full = 0;
ip->bytes -= ret;
if (!splice_available)
memmove(buf->u.buf, buf->u.buf + ret, ip->bytes);
if (!ip->bytes && ip->saw_fin == 1) {
if (ip->flags & <API key>)
shutdown(ip->to_fd, SHUT_WR);
ip->saw_fin = 2;
}
return 0;
}
static int __iv_fd_pump_pump(struct iv_fd_pump *ip)
{
if (!ip->full && ip->saw_fin == 0 && <API key>(ip))
return -1;
if (ip->bytes && <API key>(ip))
return -1;
switch (ip->saw_fin) {
case 0:
ip->set_bands(ip->cookie, !ip->full, !!ip->bytes);
return 1;
case 1:
ip->set_bands(ip->cookie, 0, 1);
return 1;
case 2:
ip->set_bands(ip->cookie, 0, 0);
return 0;
}
iv_fatal("iv_fd_pump_pump: saw_fin == %d", ip->saw_fin);
}
int iv_fd_pump_pump(struct iv_fd_pump *ip)
{
int ret;
ret = __iv_fd_pump_pump(ip);
if (ret < 0 || !ip->bytes) {
struct iv_fd_pump_buf *buf = iv_fd_pump_buf(ip);
if (buf != NULL) {
buf_put(buf, ip->bytes);
ip->buf = NULL;
}
}
return ret;
}
int iv_fd_pump_is_done(const struct iv_fd_pump *ip)
{
return !!(ip->saw_fin == 2);
}
|
#ifndef QAUDIODEVICEINFO_H
#define QAUDIODEVICEINFO_H
#include <QtCore/qobject.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qlist.h>
#include <qmobilityglobal.h>
#include <qtmedianamespace.h>
#include <qaudio.h>
#include <qaudioformat.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QAudioDeviceFactory;
class <API key>;
class Q_MULTIMEDIA_EXPORT QAudioDeviceInfo
{
friend class QAudioDeviceFactory;
public:
QAudioDeviceInfo();
QAudioDeviceInfo(const QAudioDeviceInfo& other);
~QAudioDeviceInfo();
QAudioDeviceInfo& operator=(const QAudioDeviceInfo& other);
bool isNull() const;
QString deviceName() const;
bool isFormatSupported(const QAudioFormat &format) const;
QAudioFormat preferredFormat() const;
QAudioFormat nearestFormat(const QAudioFormat &format) const;
QStringList supportedCodecs() const;
QList<int> <API key>() const;
QList<int> <API key>() const;
QList<int> supportedChannels() const;
QList<int> <API key>() const;
QList<int> <API key>() const;
QList<QAudioFormat::Endian> supportedByteOrders() const;
QList<QAudioFormat::SampleType> <API key>() const;
static QAudioDeviceInfo defaultInputDevice();
static QAudioDeviceInfo defaultOutputDevice();
static QList<QAudioDeviceInfo> availableDevices(QAudio::Mode mode);
private:
QAudioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode);
QString realm() const;
QByteArray handle() const;
QAudio::Mode mode() const;
QSharedDataPointer<<API key>> d;
};
QT_END_NAMESPACE
QT_END_HEADER
Q_DECLARE_METATYPE(QAudioDeviceInfo)
#endif // QAUDIODEVICEINFO_H
|
package org.hibernate.internal.jaxb;
/**
* From what type of source did we obtain the data
*
* @author Steve Ebersole
*/
public enum SourceType {
RESOURCE,
FILE,
INPUT_STREAM,
URL,
STRING,
DOM,
JAR,
ANNOTATION,
OTHER
}
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CQRS.NET: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="<API key>.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">CQRS.NET
 <span id="projectnumber">2.0</span>
</div>
<div id="projectbrief">A lightweight enterprise framework to write CQRS, event-sourced and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('<API key>.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Cqrs.Mongo.Entities.MongoEntity Member List</div> </div>
</div><!--header
<div class="contents">
<p>This is the complete list of members for <a class="el" href="<API key>.html">Cqrs.Mongo.Entities.MongoEntity</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">IsLogicallyDeleted</a></td><td class="entry"><a class="el" href="<API key>.html">Cqrs.Mongo.Entities.MongoEntity</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="<API key>.html#<API key>">Rsn</a></td><td class="entry"><a class="el" href="<API key>.html">Cqrs.Mongo.Entities.MongoEntity</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">SortingOrder</a></td><td class="entry"><a class="el" href="<API key>.html">Cqrs.Mongo.Entities.MongoEntity</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http:
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>
|
package polyglot.ext.coffer.extension;
import polyglot.ast.*;
import polyglot.types.*;
import polyglot.util.*;
import polyglot.visit.*;
import polyglot.ext.jl.ast.*;
import polyglot.ext.coffer.ast.*;
import polyglot.ext.coffer.types.*;
import java.util.*;
public class AssignDel_c extends JL_c {
public Node typeCheck(TypeChecker tc) throws SemanticException {
Assign n = (Assign) super.typeCheck(tc);
if (n.right().type() instanceof CofferClassType) {
CofferClassType t = (CofferClassType) n.right().type();
if (t.key() != null && n.left() instanceof Field) {
throw new SemanticException("Cannot assign tracked value into a field.", n.position());
}
if (t.key() != null && n.left() instanceof ArrayAccess) {
throw new SemanticException("Cannot assign tracked value into an array.", n.position());
}
}
return n;
}
}
|
// The LLVM Compiler Infrastructure
// This file is distributed under the University of Illinois Open Source
// This pass exposes codegen information to IR-level passes. Every
// transformation that uses codegen information is broken into three parts:
// 1. The IR-level analysis pass.
// 2. The IR-level transformation interface which provides the needed
// information.
// 3. Codegen-level implementation which uses target-specific hooks.
// This file defines #2, which is the interface that IR-level transformations
// use for querying the codegen.
#ifndef <API key>
#define <API key>
#include "llvm/IR/Intrinsics.h"
#include "llvm/Pass.h"
#include "llvm/Support/DataTypes.h"
namespace llvm {
class GlobalValue;
class Loop;
class Type;
class User;
class Value;
TargetTransformInfo - This pass provides access to the codegen
interfaces that are needed for IR-level transformations.
class TargetTransformInfo {
protected:
\brief The TTI instance one level down the stack.
This is used to implement the default behavior all of the methods which
is to delegate up through the stack of TTIs until one can answer the
query.
TargetTransformInfo *PrevTTI;
\brief The top of the stack of TTI analyses available.
This is a convenience routine maintained as TTI analyses become available
that complements the PrevTTI delegation chain. When one part of an
analysis pass wants to query another part of the analysis pass it can use
this to start back at the top of the stack.
TargetTransformInfo *TopTTI;
All pass subclasses must in their initializePass routine call
pushTTIStack with themselves to update the pointers tracking the previous
TTI instance in the analysis group's stack, and the top of the analysis
group's stack.
void pushTTIStack(Pass *P);
All pass subclasses must in their finalizePass routine call popTTIStack
to update the pointers tracking the previous TTI instance in the analysis
group's stack, and the top of the analysis group's stack.
void popTTIStack();
All pass subclasses must call TargetTransformInfo::getAnalysisUsage.
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
public:
This class is intended to be subclassed by real implementations.
virtual ~TargetTransformInfo() = 0;
\name Generic Target Information
@{
\brief Underlying constants for 'cost' values in this interface.
Many APIs in this interface return a cost. This enum defines the
fundamental values that should be used to interpret (and produce) those
costs. The costs are returned as an unsigned rather than a member of this
enumeration because it is expected that the cost of one IR instruction
may have a multiplicative factor to it or otherwise won't fit directly
into the enum. Moreover, it is common to sum or average costs which works
better as simple integral values. Thus this enum only provides constants.
Note that these costs should usually reflect the intersection of code-size
cost and execution cost. A free instruction is typically one that folds
into another instruction. For example, reg-to-reg moves can often be
skipped by renaming the registers in the CPU, but they still are encoded
and thus wouldn't be considered 'free' here.
enum TargetCostConstants {
TCC_Free = 0, ///< Expected to fold away in lowering.
TCC_Basic = 1, ///< The cost of a typical 'add' instruction.
TCC_Expensive = 4 ///< The cost of a 'div' instruction on x86.
};
\brief Estimate the cost of a specific operation when lowered.
Note that this is designed to work on an arbitrary synthetic opcode, and
thus work for hypothetical queries before an instruction has even been
formed. However, this does *not* work for GEPs, and must not be called
for a GEP instruction. Instead, use the dedicated getGEPCost interface as
analyzing a GEP's cost required more information.
Typically only the result type is required, and the operand type can be
omitted. However, if the opcode is one of the cast instructions, the
operand type is required.
The returned cost is defined in terms of \c TargetCostConstants, see its
comments for a detailed explanation of the cost values.
virtual unsigned getOperationCost(unsigned Opcode, Type *Ty,
Type *OpTy = 0) const;
\brief Estimate the cost of a GEP operation when lowered.
The contract for this function is the same as \c getOperationCost except
that it supports an interface that provides extra information specific to
the GEP operation.
virtual unsigned getGEPCost(const Value *Ptr,
ArrayRef<const Value *> Operands) const;
\brief Estimate the cost of a function call when lowered.
The contract for this is the same as \c getOperationCost except that it
supports an interface that provides extra information specific to call
instructions.
This is the most basic query for estimating call cost: it only knows the
function type and (potentially) the number of arguments at the call site.
The latter is only interesting for varargs function types.
virtual unsigned getCallCost(FunctionType *FTy, int NumArgs = -1) const;
\brief Estimate the cost of calling a specific function when lowered.
This overload adds the ability to reason about the particular function
being called in the event it is a library call with special lowering.
virtual unsigned getCallCost(const Function *F, int NumArgs = -1) const;
\brief Estimate the cost of calling a specific function when lowered.
This overload allows specifying a set of candidate argument values.
virtual unsigned getCallCost(const Function *F,
ArrayRef<const Value *> Arguments) const;
\brief Estimate the cost of an intrinsic when lowered.
Mirrors the \c getCallCost method but uses an intrinsic identifier.
virtual unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
ArrayRef<Type *> ParamTys) const;
\brief Estimate the cost of an intrinsic when lowered.
Mirrors the \c getCallCost method but uses an intrinsic identifier.
virtual unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
ArrayRef<const Value *> Arguments) const;
\brief Estimate the cost of a given IR user when lowered.
This can estimate the cost of either a ConstantExpr or Instruction when
lowered. It has two primary advantages over the \c getOperationCost and
\c getGEPCost above, and one significant disadvantage: it can only be
used when the IR construct has already been formed.
The advantages are that it can inspect the SSA use graph to reason more
accurately about the cost. For example, all-constant-GEPs can often be
folded into a load or other instruction, but if they are used in some
other context they may not be folded. This routine can distinguish such
cases.
The returned cost is defined in terms of \c TargetCostConstants, see its
comments for a detailed explanation of the cost values.
virtual unsigned getUserCost(const User *U) const;
\brief hasBranchDivergence - Return true if branch divergence exists.
Branch divergence has a significantly negative impact on GPU performance
when threads in the same wavefront take different paths due to conditional
branches.
virtual bool hasBranchDivergence() const;
\brief Test whether calls to a function lower to actual program function
calls.
The idea is to test whether the program is likely to require a 'call'
instruction or equivalent in order to call the given function.
FIXME: It's not clear that this is a good or useful query API. Client's
should probably move to simpler cost metrics using the above.
Alternatively, we could split the cost interface into distinct code-size
and execution-speed costs. This would allow modelling the core of this
query more accurately as the a call is a single small instruction, but
incurs significant execution cost.
virtual bool isLoweredToCall(const Function *F) const;
Parameters that control the generic loop unrolling transformation.
struct <API key> {
The cost threshold for the unrolled loop, compared to
CodeMetrics.NumInsts aggregated over all basic blocks in the loop body.
The unrolling factor is set such that the unrolled loop body does not
exceed this cost. Set this to UINT_MAX to disable the loop body cost
restriction.
unsigned Threshold;
The cost threshold for the unrolled loop when optimizing for size (set
to UINT_MAX to disable).
unsigned OptSizeThreshold;
A forced unrolling factor (the number of concatenated bodies of the
original loop in the unrolled loop body). When set to 0, the unrolling
transformation will select an unrolling factor based on the current cost
threshold and other factors.
unsigned Count;
Allow partial unrolling (unrolling of loops to expand the size of the
loop body, not only to eliminate small constant-trip-count loops).
bool Partial;
Allow runtime unrolling (unrolling of loops to expand the size of the
loop body even when the number of loop iterations is not known at compile
time).
bool Runtime;
};
\brief Get target-customized preferences for the generic loop unrolling
transformation. The caller will initialize UP with the current
target-independent defaults.
virtual void <API key>(Loop *L, <API key> &UP) const;
@}
\name Scalar Target Information
@{
\brief Flags indicating the kind of support for population count.
Compared to the SW implementation, HW support is supposed to
significantly boost the performance when the population is dense, and it
may or may not degrade performance if the population is sparse. A HW
support is considered as "Fast" if it can outperform, or is on a par
with, SW implementation when the population is sparse; otherwise, it is
considered as "Slow".
enum PopcntSupportKind {
PSK_Software,
PSK_SlowHardware,
PSK_FastHardware
};
\brief Return true if the specified immediate is legal add immediate, that
is the target has add instructions which can add a register with the
immediate without having to materialize the immediate into a register.
virtual bool isLegalAddImmediate(int64_t Imm) const;
\brief Return true if the specified immediate is legal icmp immediate,
that is the target has icmp instructions which can compare a register
against the immediate without having to materialize the immediate into a
register.
virtual bool <API key>(int64_t Imm) const;
\brief Return true if the addressing mode represented by AM is legal for
this target, for a load/store of the specified type.
The type may be VoidTy, in which case only return true if the addressing
mode is legal for a load/store of any legal type.
TODO: Handle pre/postinc as well.
virtual bool <API key>(Type *Ty, GlobalValue *BaseGV,
int64_t BaseOffset, bool HasBaseReg,
int64_t Scale) const;
\brief Return the cost of the scaling factor used in the addressing
mode represented by AM for this target, for a load/store
of the specified type.
If the AM is supported, the return value must be >= 0.
If the AM is not supported, it returns a negative value.
TODO: Handle pre/postinc as well.
virtual int <API key>(Type *Ty, GlobalValue *BaseGV,
int64_t BaseOffset, bool HasBaseReg,
int64_t Scale) const;
\brief Return true if it's free to truncate a value of type Ty1 to type
Ty2. e.g. On x86 it's free to truncate a i32 value in register EAX to i16
by referencing its sub-register AX.
virtual bool isTruncateFree(Type *Ty1, Type *Ty2) const;
\brief Return true if this type is legal.
virtual bool isTypeLegal(Type *Ty) const;
\brief Returns the target's jmp_buf alignment in bytes.
virtual unsigned getJumpBufAlignment() const;
\brief Returns the target's jmp_buf size in bytes.
virtual unsigned getJumpBufSize() const;
\brief Return true if switches should be turned into lookup tables for the
target.
virtual bool <API key>() const;
\brief Return hardware support for population count.
virtual PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const;
\brief Return true if the hardware has a fast square-root instruction.
virtual bool haveFastSqrt(Type *Ty) const;
\brief Return the expected cost of materializing for the given integer
immediate of the specified type.
virtual unsigned getIntImmCost(const APInt &Imm, Type *Ty) const;
\brief Return the expected cost of materialization for the given integer
immediate of the specified type for a given instruction. The cost can be
zero if the immediate can be folded into the specified instruction.
virtual unsigned getIntImmCost(unsigned Opcode, const APInt &Imm,
Type *Ty) const;
virtual unsigned getIntImmCost(Intrinsic::ID IID, const APInt &Imm,
Type *Ty) const;
@}
\name Vector Target Information
@{
\brief The various kinds of shuffle patterns for vector queries.
enum ShuffleKind {
SK_Broadcast, ///< Broadcast element 0 to all other elements.
SK_Reverse, ///< Reverse the order of the vector.
SK_InsertSubvector, ///< InsertSubvector. Index indicates start offset.
SK_ExtractSubvector ///< ExtractSubvector Index indicates start offset.
};
\brief Additional information about an operand's possible values.
enum OperandValueKind {
OK_AnyValue, // Operand can have any value.
OK_UniformValue, // Operand is uniform (splat of a value).
<API key>, // Operand is uniform constant.
<API key> // Operand is a non uniform constant value.
};
\return The number of scalar or vector registers that the target has.
If 'Vectors' is true, it returns the number of vector registers. If it is
set to false, it returns the number of scalar registers.
virtual unsigned <API key>(bool Vector) const;
\return The width of the largest scalar or vector register type.
virtual unsigned getRegisterBitWidth(bool Vector) const;
\return The maximum unroll factor that the vectorizer should try to
perform for this target. This number depends on the level of parallelism
and the number of execution units in the CPU.
virtual unsigned <API key>() const;
\return The expected cost of arithmetic ops, such as mul, xor, fsub, etc.
virtual unsigned <API key>(unsigned Opcode, Type *Ty,
OperandValueKind Opd1Info = OK_AnyValue,
OperandValueKind Opd2Info = OK_AnyValue) const;
\return The cost of a shuffle instruction of kind Kind and of type Tp.
The index and subtype parameters are used by the subvector insertion and
extraction shuffle kinds.
virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp, int Index = 0,
Type *SubTp = 0) const;
\return The expected cost of cast instructions, such as bitcast, trunc,
zext, etc.
virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
Type *Src) const;
\return The expected cost of control-flow related instructions such as
Phi, Ret, Br.
virtual unsigned getCFInstrCost(unsigned Opcode) const;
\returns The expected cost of compare and select instructions.
virtual unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
Type *CondTy = 0) const;
\return The expected cost of vector Insert and Extract.
Use -1 to indicate that there is no information on the index value.
virtual unsigned getVectorInstrCost(unsigned Opcode, Type *Val,
unsigned Index = -1) const;
\return The cost of Load and Store instructions.
virtual unsigned getMemoryOpCost(unsigned Opcode, Type *Src,
unsigned Alignment,
unsigned AddressSpace) const;
\brief Calculate the cost of performing a vector reduction.
This is the cost of reducing the vector value of type \p Ty to a scalar
value using the operation denoted by \p Opcode. The form of the reduction
can either be a pairwise reduction or a reduction that splits the vector
at every reduction level.
Pairwise:
(v0, v1, v2, v3)
((v0+v1), (v2, v3), undef, undef)
Split:
(v0, v1, v2, v3)
((v0+v2), (v1+v3), undef, undef)
virtual unsigned getReductionCost(unsigned Opcode, Type *Ty,
bool IsPairwiseForm) const;
\returns The cost of Intrinsic instructions.
virtual unsigned <API key>(Intrinsic::ID ID, Type *RetTy,
ArrayRef<Type *> Tys) const;
\returns The number of pieces into which the provided type must be
split during legalization. Zero is returned when the answer is unknown.
virtual unsigned getNumberOfParts(Type *Tp) const;
\returns The cost of the address computation. For most targets this can be
merged into the instruction indexing mode. Some targets might want to
distinguish between address computation for memory operations on vector
types and scalar types. Such targets should override this function.
The 'IsComplex' parameter is a hint that the address computation is likely
to involve multiple instructions and as such unlikely to be merged into
the address indexing mode.
virtual unsigned <API key>(Type *Ty,
bool IsComplex = false) const;
@}
Analysis group identification.
static char ID;
};
\brief Create the base case instance of a pass in the TTI analysis group.
This class provides the base case for the stack of TTI analyzes. It doesn't
delegate to anything and uses the STTI and VTTI objects passed in to
satisfy the queries.
ImmutablePass *<API key>();
} // End llvm namespace
#endif
|
export APPLICATION = periph_pwm
include ../Makefile.tests_common
BOARD_BLACKLIST := chronos mbed_lpc1768 msb-430 msb-430h native qemu-i386 redbee-econotag telosb \
wsn430-v1_3b wsn430-v1_4 z1
# all listed boards: no periph_conf.h defined,
USEMODULE += vtimer
DISABLE_MODULE += auto_init
include $(RIOTBASE)/Makefile.include
|
@external cmsState, html-face;
div.fieldsetVisible {
border: solid 1px value("constants.css.borderColor");
background: value("constants.css.<API key>");
min-height: 8px;
position: relative;
overflow: visible;
margin: 10px 0px 5px;
}
div.fieldsetInvisible {
/** Use the same color as the background to make this border invisible. */
border: solid 1px value("constants.css.<API key>");
border-top: solid 1px value("constants.css.borderColor");
background: value("constants.css.<API key>");
min-height: 8px;
position: relative;
overflow: visible;
margin: 10px 0px;
}
div.cmsState.image {
left: 5px;
position: absolute;
padding: 0;
cursor: pointer;
margin: -9px 0px 0px 2px;
min-width: 0;
height: 16px;
}
div.cmsState.image > div.html-face{
vertical-align: top;
}
.legend {
left: 20px;
background: value("constants.css.<API key>");
position: absolute;
font-weight: bold;
padding: 0 3px 0 3px;
margin: -11px 0px 0px 5px;
color: value("constants.css.textColor");
}
div.fieldsetVisible .content {
/* margin: 12px 6px 4px 6px; */
margin: 10px 6px 6px;
color: value("constants.css.textColor");
overflow: auto;
}
.fieldsetInvisible .content{
display: none;
}
|
#define LWIP_INTERNAL
extern "C" {
#include "osapi.h"
#include "ets_sys.h"
}
#include "debug.h"
#include "ESP8266WiFi.h"
#include "WiFiClient.h"
#include "WiFiServer.h"
#include "lwip/opt.h"
#include "lwip/tcp.h"
#include "lwip/inet.h"
#include "cbuf.h"
#include "include/ClientContext.h"
WiFiServer::WiFiServer(IPAddress addr, uint16_t port)
: _port(port)
, _addr(addr)
, _pcb(nullptr)
, _unclaimed(nullptr)
, _discarded(nullptr)
{
}
WiFiServer::WiFiServer(uint16_t port)
: _port(port)
, _addr((uint32_t) IPADDR_ANY)
, _pcb(nullptr)
, _unclaimed(nullptr)
, _discarded(nullptr)
{
}
void WiFiServer::begin() {
err_t err;
tcp_pcb* pcb = tcp_new();
if (!pcb)
return;
ip_addr_t local_addr;
local_addr.addr = (uint32_t) _addr;
err = tcp_bind(pcb, &local_addr, _port);
if (err != ERR_OK) {
tcp_close(pcb);
return;
}
tcp_pcb* listen_pcb = tcp_listen(pcb);
if (!listen_pcb) {
tcp_close(pcb);
return;
}
_pcb = listen_pcb;
tcp_accept(listen_pcb, &WiFiServer::_s_accept);
tcp_arg(listen_pcb, (void*) this);
}
void WiFiServer::setNoDelay(bool nodelay) {
if (!_pcb)
return;
if (nodelay)
tcp_nagle_disable(_pcb);
else
tcp_nagle_enable(_pcb);
}
bool WiFiServer::getNoDelay() {
if (!_pcb)
return false;
return tcp_nagle_disabled(_pcb);
}
bool WiFiServer::hasClient() {
if (_unclaimed)
return true;
return false;
}
WiFiClient WiFiServer::available(byte* status) {
if (_unclaimed) {
WiFiClient result(_unclaimed);
_unclaimed = _unclaimed->next();
DEBUGV("WS:av\r\n");
return result;
}
optimistic_yield(1000);
return WiFiClient();
}
uint8_t WiFiServer::status() {
if (!_pcb)
return CLOSED;
return _pcb->state;
}
void WiFiServer::close() {
if (!_pcb) {
return;
}
tcp_close(_pcb);
}
void WiFiServer::stop() {
close();
}
size_t WiFiServer::write(uint8_t b) {
return write(&b, 1);
}
size_t WiFiServer::write(const uint8_t *buffer, size_t size) {
// write to all clients
// not implemented
return 0;
}
template<typename T>
T* slist_append_tail(T* head, T* item) {
if (!head)
return item;
T* last = head;
while(last->next())
last = last->next();
last->next(item);
return head;
}
int8_t WiFiServer::_accept(tcp_pcb* apcb, int8_t err) {
DEBUGV("WS:ac\r\n");
ClientContext* client = new ClientContext(apcb, &WiFiServer::_s_discard, this);
_unclaimed = slist_append_tail(_unclaimed, client);
tcp_accepted(_pcb);
return ERR_OK;
}
void WiFiServer::_discard(ClientContext* client) {
// _discarded = slist_append_tail(_discarded, client);
DEBUGV("WS:dis\r\n");
}
int8_t WiFiServer::_s_accept(void *arg, tcp_pcb* newpcb, int8_t err) {
return reinterpret_cast<WiFiServer*>(arg)->_accept(newpcb, err);
}
void WiFiServer::_s_discard(void* server, ClientContext* ctx) {
reinterpret_cast<WiFiServer*>(server)->_discard(ctx);
}
|
require "rexml/document"
require 'stringio'
module Library::StepsHelper
def get_param_from_jcl(jcl_str)
regex = /<%(\S+)%>/
result = jcl_str.scan(regex)
result = result | result
arr = Array.new
result.each do |item|
arr << item[0]
end
return arr
end
def <API key>(hash)
xml_str = ''
doc = REXML::Document.new "<catalog/>"
root_node = doc.root
if hash!=nil
hash.each do |k,v|
el1 = root_node.add_element "param",{"name"=>k,"description"=>v["description"]}
if v["type"]=='option' then
arr = v["option"].split(";")
arr.each do |item|
el2 = el1.add_element "option"
el2.text = item
end
elsif v["type"]=='regex' then
el2 = el1.add_element "regex"
el2.text = v["option"]
end
end
#filename = str_to_md5(get_current_time)
#f = File.new(filename,"w")
#formatter = REXML::Formatters::Pretty.new
#formatter.compact = true
#formatter.write(doc, f)
#f.close
#if File.exist?(filename) then
# xml_str = File.open(filename).read
# File.delete(filename)
#end
end
xml_str = format(doc.to_s)
return xml_str
end
def format(xml_str)
output = StringIO.new
formatter = REXML::Formatters::Pretty.new
formatter.compact = true
formatter.write(REXML::Document.new(xml_str), output)
output.string
end
end
|
#include <QtGui>
#include "window.h"
Window::Window(QWidget *parent)
: QWidget(parent)
{
QLabel *textLabel = new QLabel(tr("Data:"), this);
textBrowser = new QTextBrowser(this);
QLabel *mimeTypeLabel = new QLabel(tr("MIME types:"), this);
mimeTypeCombo = new QComboBox(this);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(textLabel);
layout->addWidget(textBrowser);
layout->addWidget(mimeTypeLabel);
layout->addWidget(mimeTypeCombo);
/*
setAcceptDrops(true);
*/
setAcceptDrops(true);
setWindowTitle(tr("Drop Actions"));
}
void Window::dragEnterEvent(QDragEnterEvent *event)
{
if (event->mimeData()->hasFormat("text/plain"))
event-><API key>();
}
void Window::dropEvent(QDropEvent *event)
{
QMenu actionMenu(this);
QAction *copyAction = 0;
QAction *moveAction = 0;
QAction *linkAction = 0;
QAction *ignoreAction = 0;
if (event->possibleActions() & Qt::CopyAction)
copyAction = actionMenu.addAction(tr("Copy"));
if (event->possibleActions() & Qt::MoveAction)
moveAction = actionMenu.addAction(tr("Move"));
if (event->possibleActions() & Qt::LinkAction)
linkAction = actionMenu.addAction(tr("Link"));
if (event->possibleActions() & Qt::IgnoreAction)
ignoreAction = actionMenu.addAction(tr("Ignore"));
QAction *result = actionMenu.exec(QCursor::pos());
if (copyAction && result == copyAction)
event->setDropAction(Qt::CopyAction);
else if (moveAction && result == moveAction)
event->setDropAction(Qt::MoveAction);
else if (linkAction && result == linkAction)
event->setDropAction(Qt::LinkAction);
else {
event->setDropAction(Qt::IgnoreAction);
return;
}
textBrowser->setPlainText(event->mimeData()->text());
mimeTypeCombo->clear();
mimeTypeCombo->addItems(event->mimeData()->formats());
}
|
// JCSP ("CSP for Java") Libraries //
// 2001-2004 Quickstone Technologies Limited. //
// This library is free software; you can redistribute it and/or //
// modify it under the terms of the GNU Lesser General Public //
// version. //
// This library is distributed in the hope that it will be //
// details. //
// You should have received a copy of the GNU Lesser General //
// Free Software Foundation, Inc., 59 Temple Place, Suite 330, //
// Boston, MA 02111-1307, USA. //
// Author contact: P.H.Welch@kent.ac.uk //
package org.jcsp.awt;
import java.awt.*;
import java.util.Vector;
import org.jcsp.lang.*;
/**
* {@link java.awt.Panel <TT>java.awt.Panel</TT>}
* with a channel interface.
* <H2>Process Diagram</H2>
* <p><img src="doc-files/ActivePanel1.gif"></p>
* <H2>Description</H2>
* <TT>ActivePanel</TT> is a process extension of <TT>java.awt.Panel</TT>
* with channels for run-time configuration and event notification. The event channels
* should be connected to one or more <API key> server processes (instead
* of registering a passive object as a <I>Listener</I> to this component).
* <P>
* All channels are optional. The <TT>configure</TT> channel is settable from a constructor.
* Event channels can be added to notify the occurrence of any type of <TT>Event</TT>
* the component generates (by calling the appropriate
* <TT>add</TT><I>XXX</I><TT>EventChannel</TT> method <I>before</I> the process is run).
* Messages can be sent down the <TT>configure</TT> channel at any time to configure
* the component. See the <A HREF="#Protocols">table below</A> for details.
* <P>
* All channels are managed by independent internal handler processes. It is, therefore,
* safe for a serial application process both to service an event channel and configure
* the component -- no deadlock can occur.
* <P>
* <I>IMPORTANT: it is essential that event channels from this process are
* always serviced -- otherwise the Java Event Thread will be blocked and the GUI
* will stop responding. A simple way to guarantee this is to use channels
* configured with overwriting buffers.
* For example:</I>
* <PRE>
* final One2OneChannel myMouseEvent = Channel.one2one (new <API key> (n));
*
* final ActivePanel myPanel = new ActivePanel ();
* myPanel.<API key> (myMouseEvent.out ());
* </PRE>
* <I>This will ensure that the Java Event Thread will never be blocked.
* Slow or inattentive readers may miss rapidly generated events, but
* the </I><TT>n</TT><I> most recent events will always be available.</I>
* </P>
* <H2><A NAME="Protocols">Channel Protocols</A></H2>
* <CENTER>
* <TABLE BORDER="2">
* <TR>
* <TH COLSPAN="3">Input Channels</TH>
* </TR>
* <TR>
* <TH ROWSPAN="1">configure</TH>
* <TD>ActivePanel.Configure</TD>
* <TD>Invoke the user-defined <TT>Configure.configure</TT> method on the panel.</TD>
* </TR>
* <TR>
* <TH COLSPAN="3">Output Channels</TH>
* </TR>
* <TR>
* <TH>containerEvent</TH>
* <TD>ContainerEvent</TD>
* <TD>See the {@link #<API key>
* <TT><API key></TT>} method.</TD>
* </TR>
* <TR>
* <TH>componentEvent</TH>
* <TD>ComponentEvent</TD>
* <TD>See the {@link #<API key>
* <TT><API key></TT>} method.</TD>
* </TR>
* <TR>
* <TH>focusEvent</TH>
* <TD>FocusEvent</TD>
* <TD>See the {@link #<API key>
* <TT><API key></TT>} method.</TD>
* </TR>
* <TR>
* <TH>keyEvent</TH>
* <TD>KeyEvent</TD>
* <TD>See the {@link #addKeyEventChannel
* <TT>addKeyEventChannel</TT>} method.</TD>
* </TR>
* <TR>
* <TH>mouseEvent</TH>
* <TD>MouseEvent</TD>
* <TD>See the {@link #<API key>
* <TT><API key></TT>} method.</TD>
* </TR>
* <TR>
* <TH>mouseMotionEvent</TH>
* <TD>MouseEvent</TD>
* <TD>See the {@link #<API key>
* <TT><API key></TT>} method.</TD>
* </TR>
* </TABLE>
* </CENTER>
* <H2>Example</H2>
* <PRE>
* import java.awt.*;
* import java.awt.event.*;
* import org.jcsp.util.*;
* import org.jcsp.lang.*;
* import org.jcsp.awt.*;
*
* public class ActivePanelExample {
*
* public static void main (String argv[]) {
*
* final Frame root = new Frame ("ActivePanel Example");
*
* final One2OneChannel mouseEvent = Channel.one2one (new <API key> (10));
*
* final ActivePanel panel = new ActivePanel ();
* panel.<API key> (mouseEvent.out ());
*
* root.add (panel);
* root.setSize (400, 400);
* root.setVisible (true);
*
* new Parallel (
* new CSProcess[] {
* panel,
* new CSProcess () {
* public void run () {
* boolean running = true;
* while (running) {
* final MouseEvent event = (MouseEvent) mouseEvent.in ().read ();
* switch (event.getID ()) {
* case MouseEvent.MOUSE_ENTERED:
* System.out.println ("MOUSE_ENTERED");
* break;
* case MouseEvent.MOUSE_EXITED:
* System.out.println ("MOUSE_EXITED");
* break;
* case MouseEvent.MOUSE_PRESSED:
* System.out.println ("MOUSE_PRESSED");
* break;
* case MouseEvent.MOUSE_RELEASED:
* System.out.println ("MOUSE_RELEASED");
* break;
* case MouseEvent.MOUSE_CLICKED:
* if (event.getClickCount() > 1) {
* System.out.println ("<API key> ... goodbye!");
* running = false;
* } else {
* System.out.println ("MOUSE_CLICKED ... *double* click to quit!");
* }
* break;
* }
* }
* root.setVisible (false);
* System.exit (0);
* }
* }
* }
* ).run ();
* }
*
* }
* </PRE>
*
* @see java.awt.Panel
* @see java.awt.event.ContainerEvent
* @see java.awt.event.ComponentEvent
* @see java.awt.event.FocusEvent
* @see java.awt.event.KeyEvent
* @see java.awt.event.MouseEvent
* @see org.jcsp.util.<API key>
*
* @author P.D. Austin and P.H. Welch
*/
public class ActivePanel extends Panel implements CSProcess
{
/**
* The Vector construct containing the handlers.
*/
private Vector vec = new Vector();
/**
* The channel from which configuration messages arrive.
*/
private ChannelInput configure;
/**
* Constructs a new <TT>ActivePanel</TT> with no configuration channel.
*/
public ActivePanel()
{
this(null);
}
/**
* Constructs a new <TT>ActivePanel</TT> with a configuration channel.
*
* @param configure the channel for configuration events
* -- can be null if no configuration is required.
*/
public ActivePanel(ChannelInput configure)
{
this.configure = configure;
}
/**
* Sets the configuration channel for this <TT>ActivePanel</TT>.
* This method overwrites any configuration channel set in the constructor.
*
* @param configure the channel for configuration events
* -- can be null if no configuration is required.
*/
public void setConfigureChannel(ChannelInput configure)
{
this.configure = configure;
}
/**
* Add a new channel to this component that will be used to notify that
* a <TT>ContainerEvent</TT> has occurred. <I>This should be used
* instead of registering a ContainerListener with the component.</I> It is
* possible to add more than one Channel by calling this method multiple times
* If the channel passed is <TT>null</TT>, no action will be taken.
* <P>
* <I>NOTE: This method must be called before this process is run.</I>
*
* @param containerEvent the channel down which to send ContainerEvents.
*/
public void <API key>(ChannelOutput containerEvent)
{
if (containerEvent != null)
{
<API key> handler = new <API key>(containerEvent);
<API key>(handler);
vec.addElement(handler);
}
}
/**
* Add a new channel to this component that will be used to notify that
* a <TT>ComponentEvent</TT> has occurred. <I>This should be used
* instead of registering a ComponentListener with the component.</I> It is
* possible to add more than one Channel by calling this method multiple times
* If the channel passed is <TT>null</TT>, no action will be taken.
* <P>
* <I>NOTE: This method must be called before this process is run.</I>
*
* @param componentEvent the channel down which to send ComponentEvents.
*/
public void <API key>(ChannelOutput componentEvent)
{
if (componentEvent != null)
{
<API key> handler = new <API key>(componentEvent);
<API key>(handler);
vec.addElement(handler);
}
}
/**
* Add a new channel to this component that will be used to notify that
* a <TT>FocusEvent</TT> has occurred. <I>This should be used
* instead of registering a FocusListener with the component.</I> It is
* possible to add more than one Channel by calling this method multiple times
* If the channel passed is <TT>null</TT>, no action will be taken.
* <P>
* <I>NOTE: This method must be called before this process is run.</I>
*
* @param focusEvent the channel down which to send FocusEvents.
*/
public void <API key>(ChannelOutput focusEvent)
{
if (focusEvent != null)
{
FocusEventHandler handler = new FocusEventHandler(focusEvent);
addFocusListener(handler);
vec.addElement(handler);
}
}
/**
* Add a new channel to this component that will be used to notify that
* a <TT>KeyEvent</TT> has occurred. <I>This should be used
* instead of registering a KeyListener with the component.</I> It is
* possible to add more than one Channel by calling this method multiple times
* If the channel passed is <TT>null</TT>, no action will be taken.
* <P>
* <I>NOTE: This method must be called before this process is run.</I>
*
* @param keyEvent the channel down which to send KeyEvents.
*/
public void addKeyEventChannel(ChannelOutput keyEvent)
{
if (keyEvent != null)
{
KeyEventHandler handler = new KeyEventHandler(keyEvent);
addKeyListener(handler);
vec.addElement(handler);
}
}
/**
* Add a new channel to this component that will be used to notify that
* a <TT>MouseEvent</TT> has occurred. <I>This should be used
* instead of registering a MouseListener with the component.</I> It is
* possible to add more than one Channel by calling this method multiple times
* If the channel passed is <TT>null</TT>, no action will be taken.
* <P>
* <I>NOTE: This method must be called before this process is run.</I>
*
* @param mouseEvent the channel down which to send MouseEvents.
*/
public void <API key>(ChannelOutput mouseEvent)
{
if (mouseEvent != null)
{
MouseEventHandler handler = new MouseEventHandler(mouseEvent);
addMouseListener(handler);
vec.addElement(handler);
}
}
/**
* Add a new channel to this component that will be used to notify that
* a <TT>MouseMotionEvent</TT> has occurred. <I>This should be used
* instead of registering a MouseMotionListener with the component.</I> It is
* possible to add more than one Channel by calling this method multiple times
* If the channel passed is <TT>null</TT>, no action will be taken.
* <P>
* <I>NOTE: This method must be called before this process is run.</I>
*
* @param mouseMotionEvent the channel down which to send MouseMotionEvents.
*/
public void <API key>(ChannelOutput mouseMotionEvent)
{
if (mouseMotionEvent != null)
{
<API key> handler = new <API key>(mouseMotionEvent);
<API key>(handler);
vec.addElement(handler);
}
}
/**
* This enables general configuration of this component. Any object implementing
* this interface and sent down the <TT>configure</TT> channel to this component will have its
* <TT>configure</TT> method invoked on this component.
* <P>
* For an example, see {@link ActiveApplet.Configure}.
*/
static public interface Configure
{
/**
* @param panel the Panel being configured.
*/
public void configure(final Panel panel);
}
/**
* The main body of this process.
*/
public void run()
{
if (configure != null)
{
while (true)
{
Object message = configure.read();
if (message instanceof Configure)
((Configure) message).configure(this);
}
}
}
}
|
// This file is part of the deal.II library.
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// the top level of the deal.II distribution.
// document bug in parallel::distributed::GridRefinement
// ::<API key>() and fixed_fraction() with one CPU with
// 0 cells:
//#0 0x00007ffff67297e2 in dealii::(anonymous namespace)::min_element<float> (
// criteria=...)
// at /w/heister/deal-trunk/deal.II/source/distributed/grid_refinement.cc:57
//#1 0x00007ffff6727672 in dealii::(anonymous namespace)::<API key><float> (criteria=..., mpi_communicator=0x6fc860)
// at /w/heister/deal-trunk/deal.II/source/distributed/grid_refinement.cc:82
//#2 0x00007ffff672b4ef in dealii::parallel::distributed::GridRefinement::<API key><2, dealii::Vector<float>, 2>
#include "../tests.h"
#include <deal.II/lac/<API key>.h>
#include <deal.II/lac/vector.h>
#include <deal.II/base/logstream.h>
#include <deal.II/base/utilities.h>
#include <deal.II/distributed/tria.h>
#include <deal.II/distributed/grid_refinement.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/grid_generator.h>
#include <fstream>
//#include <mpi.h>
template <int dim>
void test()
{
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> triangulation(MPI_COMM_WORLD);
GridGenerator::hyper_cube (triangulation);
Vector<float> <API key> (triangulation.n_active_cells());
parallel::distributed::GridRefinement::
<API key> (triangulation,
<API key>,
0.3, 0.03);
parallel::distributed::GridRefinement::
<API key> (triangulation,
<API key>,
0.3, 0.03);
triangulation.<API key> ();
if (myid==0)
deallog << "<API key>="
<< triangulation.<API key>()
<< std::endl;
if (myid==0)
deallog << "OK" << std::endl;
}
int main(int argc, char *argv[])
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
{
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.threshold_double(1.e-10);
test<2>();
}
else
test<2>();
}
|
#!/usr/bin/env bash
# This script contains only functions that can be used in other bash scripts
function <API key>() {
sed -i 's/\(shortlink\.urlstub=http:.*:\)\(.*\)/\1'"$1"'/' conf/config.properties
}
|
package org.pentaho.di.www;
import java.io.<API key>;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URLEncoder;
import java.util.zip.GZIPOutputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.codec.binary.Base64;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.logging.CentralLogStore;
import org.pentaho.di.core.xml.XMLHandler;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.trans.step.StepInterface;
import org.pentaho.di.trans.step.StepStatus;
import org.pentaho.di.trans.step.BaseStepData.StepExecutionStatus;
public class <API key> extends BaseHttpServlet implements <API key> {
private static Class<?> PKG = <API key>.class; // for i18n purposes, needed by Translator2!! $NON-NLS-1$
private static final long serialVersionUID = <API key>;
public static final String CONTEXT_PATH = "/kettle/transStatus";
public <API key>() {
}
public <API key>(TransformationMap transformationMap) {
super(transformationMap);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if (isJettyMode() && !request.getContextPath().startsWith(CONTEXT_PATH)) {
return;
}
if (log.isDebug())
logDebug(BaseMessages.getString(PKG, "TransStatusServlet.Log.<API key>"));
String transName = request.getParameter("name");
String id = request.getParameter("id");
boolean useXML = "Y".equalsIgnoreCase(request.getParameter("xml"));
int startLineNr = Const.toInt(request.getParameter("from"), 0);
response.setStatus(HttpServletResponse.SC_OK);
if (useXML) {
response.setContentType("text/xml");
response.<API key>(Const.XML_ENCODING);
} else {
response.<API key>("UTF-8");
response.setContentType("text/html;charset=UTF-8");
}
PrintWriter out = response.getWriter();
// ID is optional...
Trans trans;
CarteObjectEntry entry;
if (Const.isEmpty(id)) {
// get the first transformation that matches...
entry = <API key>().<API key>(transName);
if (entry==null) {
trans = null;
} else {
id = entry.getId();
trans = <API key>().getTransformation(entry);
}
} else {
// Take the ID into account!
entry = new CarteObjectEntry(transName, id);
trans = <API key>().getTransformation(entry);
}
if (trans != null) {
String status = trans.getStatus();
int lastLineNr = CentralLogStore.getLastBufferLineNr();
String logText = CentralLogStore.getAppender().getBuffer(trans.getLogChannel().getLogChannelId(), false, startLineNr, lastLineNr).toString();
if (useXML) {
response.setContentType("text/xml");
response.<API key>(Const.XML_ENCODING);
out.print(XMLHandler.getXMLHeader(Const.XML_ENCODING));
<API key> transStatus = new <API key>(transName, entry.getId(), status);
transStatus.<API key>(startLineNr);
transStatus.<API key>(lastLineNr);
for (int i = 0; i < trans.nrSteps(); i++) {
StepInterface baseStep = trans.getRunThread(i);
if ((baseStep.isRunning()) || baseStep.getStatus() != StepExecutionStatus.STATUS_EMPTY) {
StepStatus stepStatus = new StepStatus(baseStep);
transStatus.getStepStatusList().add(stepStatus);
}
}
// The log can be quite large at times, we are going to put a base64 encoding around a compressed stream
// of bytes to handle this one.
<API key> baos = new <API key>();
GZIPOutputStream gzos = new GZIPOutputStream(baos);
gzos.write(logText.getBytes());
gzos.close();
String loggingString = new String(Base64.encodeBase64(baos.toByteArray()));
transStatus.setLoggingString(loggingString);
// Also set the result object...
transStatus.setResult(trans.getResult());
// Is the transformation paused?
transStatus.setPaused(trans.isPaused());
// Send the result back as XML
try {
out.println(transStatus.getXML());
} catch (KettleException e) {
throw new ServletException("Unable to get the transformation status in XML format", e);
}
} else {
response.setContentType("text/html;charset=UTF-8");
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE>" + BaseMessages.getString(PKG, "TransStatusServlet.KettleTransStatus") + "</TITLE>");
out.println("<META http-equiv=\"Refresh\" content=\"10;url=" + convertContextPath(CONTEXT_PATH) + "?name=" + URLEncoder.encode(transName, "UTF-8") + "\">");
out.println("<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
out.println("</HEAD>");
out.println("<BODY>");
out.println("<H1>" + BaseMessages.getString(PKG, "TransStatusServlet.TopTransStatus", transName) + "</H1>");
try {
out.println("<table border=\"1\">");
out.print("<tr> <th>" +
BaseMessages.getString(PKG, "TransStatusServlet.TransName") + "</th> <th>" +
BaseMessages.getString(PKG, "TransStatusServlet.CarteObjectId") + "</th> <th>" +
BaseMessages.getString(PKG, "TransStatusServlet.TransStatus") + "</th> </tr>"
);
out.print("<tr>");
out.print("<td>" + transName + "</td>");
out.print("<td>" + id + "</td>");
out.print("<td>" + status + "</td>");
out.print("</tr>");
out.print("</table>");
out.print("<p>");
if ((trans.isFinished() && trans.isRunning()) || (!trans.isRunning() && !trans.isPreparing() && !trans.isInitializing())) {
out.print("<a href=\"" + convertContextPath(StartTransServlet.CONTEXT_PATH) + "?name=" + URLEncoder.encode(transName, "UTF-8") + "&id="+id+"\">"
+ BaseMessages.getString(PKG, "TransStatusServlet.StartTrans") + "</a>");
out.print("<p>");
out.print("<a href=\"" + convertContextPath(<API key>.CONTEXT_PATH) + "?name=" + URLEncoder.encode(transName, "UTF-8") + "&id="+id+"\">"
+ BaseMessages.getString(PKG, "TransStatusServlet.PrepareTrans") + "</a><br>");
} else if (trans.isRunning()) {
out.print("<a href=\"" + convertContextPath(PauseTransServlet.CONTEXT_PATH) + "?name=" + URLEncoder.encode(transName, "UTF-8") + "&id="+id+"\">"
+ BaseMessages.getString(PKG, "PauseStatusServlet.PauseResumeTrans") + "</a><br>");
out.print("<a href=\"" + convertContextPath(StopTransServlet.CONTEXT_PATH) + "?name=" + URLEncoder.encode(transName, "UTF-8") + "&id="+id+"\">"
+ BaseMessages.getString(PKG, "TransStatusServlet.StopTrans") + "</a>");
out.print("<p>");
}
out.print("<a href=\"" + convertContextPath(CleanupTransServlet.CONTEXT_PATH) + "?name=" + URLEncoder.encode(transName, "UTF-8") + "&id="+id+"\">"
+ BaseMessages.getString(PKG, "TransStatusServlet.CleanupTrans") + "</a>");
out.print("<p>");
out.println("<table border=\"1\">");
out.print("<tr> <th>" + BaseMessages.getString(PKG, "TransStatusServlet.Stepname") + "</th> <th>"
+ BaseMessages.getString(PKG, "TransStatusServlet.CopyNr") + "</th> <th>" + BaseMessages.getString(PKG, "TransStatusServlet.Read") + "</th> <th>"
+ BaseMessages.getString(PKG, "TransStatusServlet.Written") + "</th> <th>" + BaseMessages.getString(PKG, "TransStatusServlet.Input")
+ "</th> <th>" + BaseMessages.getString(PKG, "TransStatusServlet.Output") + "</th> " + "<th>"
+ BaseMessages.getString(PKG, "TransStatusServlet.Updated") + "</th> <th>" + BaseMessages.getString(PKG, "TransStatusServlet.Rejected")
+ "</th> <th>" + BaseMessages.getString(PKG, "TransStatusServlet.Errors") + "</th> <th>"
+ BaseMessages.getString(PKG, "TransStatusServlet.Active") + "</th> <th>" + BaseMessages.getString(PKG, "TransStatusServlet.Time") + "</th> "
+ "<th>" + BaseMessages.getString(PKG, "TransStatusServlet.Speed") + "</th> <th>" + BaseMessages.getString(PKG, "TransStatusServlet.prinout")
+ "</th> </tr>");
for (int i = 0; i < trans.nrSteps(); i++) {
StepInterface step = trans.getRunThread(i);
if ((step.isRunning()) || step.getStatus() != StepExecutionStatus.STATUS_EMPTY) {
StepStatus stepStatus = new StepStatus(step);
if (step.isRunning() && !step.isStopped() && !step.isPaused()) {
String sniffLink = " <a href=\""+
convertContextPath(SniffStepServlet.CONTEXT_PATH) +
"?trans=" + URLEncoder.encode(transName, "UTF-8") +
"&id="+id+
"&lines=50"+
"©nr="+step.getCopy()+
"&type="+SniffStepServlet.TYPE_OUTPUT+
"&step=" + URLEncoder.encode(step.getStepname(), "UTF-8") +
"\">"+stepStatus.getStepname()+"</a>";
stepStatus.setStepname(sniffLink);
}
out.print(stepStatus.getHTMLTableRow());
}
}
out.println("</table>");
out.println("<p>");
out.print("<a href=\"" + convertContextPath(<API key>.CONTEXT_PATH) + "?name=" + URLEncoder.encode(transName, "UTF-8") + "&id="+id+"&xml=y\">"
+ BaseMessages.getString(PKG, "TransStatusServlet.ShowAsXml") + "</a><br>");
out.print("<a href=\"" + convertContextPath(GetStatusServlet.CONTEXT_PATH) + "\">" + BaseMessages.getString(PKG, "TransStatusServlet.BackToStatusPage") + "</a><br>");
out.print("<p><a href=\"" + convertContextPath(<API key>.CONTEXT_PATH) + "?name=" + URLEncoder.encode(transName, "UTF-8") + "&id="+id+"\">"
+ BaseMessages.getString(PKG, "TransStatusServlet.Refresh") + "</a>");
// Put the logging below that.
out.println("<p>");
out.println("<textarea id=\"translog\" cols=\"120\" rows=\"20\" wrap=\"off\" name=\"Transformation log\" readonly=\"readonly\">" + logText
+ "</textarea>");
out.println("<script type=\"text/javascript\"> ");
out.println(" translog.scrollTop=translog.scrollHeight; ");
out.println("</script> ");
out.println("<p>");
} catch (Exception ex) {
out.println("<p>");
out.println("<pre>");
ex.printStackTrace(out);
out.println("</pre>");
}
out.println("<p>");
out.println("</BODY>");
out.println("</HTML>");
}
} else {
if (useXML) {
out.println(new WebResult(WebResult.STRING_ERROR, BaseMessages.getString(PKG, "TransStatusServlet.Log.<API key>", transName)));
} else {
out.println("<H1>" + BaseMessages.getString(PKG, "TransStatusServlet.Log.CoundNotFindTrans", transName) + "</H1>");
out.println("<a href=\"" + convertContextPath(GetStatusServlet.CONTEXT_PATH) + "\">" + BaseMessages.getString(PKG, "TransStatusServlet.BackToStatusPage") + "</a><p>");
}
}
}
public String toString() {
return "Trans Status Handler";
}
public String getService() {
return CONTEXT_PATH + " (" + toString() + ")";
}
}
|
package org.opencms.setup.xml.v8;
import org.opencms.configuration.<API key>;
import org.opencms.configuration.<API key>;
import org.opencms.configuration.<API key>;
import org.opencms.setup.xml.A_CmsXmlWorkplace;
import org.opencms.setup.xml.CmsSetupXmlHelper;
import org.opencms.util.CmsStringUtil;
import java.util.ArrayList;
import java.util.List;
import org.dom4j.Document;
import org.dom4j.Node;
/**
* Add missing description for the new wizard to some explorer types.<p>
*
* @since 8.0.0
*/
public class <API key> extends A_CmsXmlWorkplace {
/** List of xpaths to update. */
private List<String> m_xpaths;
/**
* @see org.opencms.setup.xml.I_CmsSetupXmlUpdate#getName()
*/
public String getName() {
return "Add missing description for the new wizard to some explorer types";
}
/**
* @see org.opencms.setup.xml.A_CmsSetupXmlUpdate#executeUpdate(org.dom4j.Document, java.lang.String, boolean)
*/
@Override
protected boolean executeUpdate(Document document, String xpath, boolean forReal) {
boolean modified = false;
Node node = document.selectSingleNode(xpath);
if (node == null) {
if (xpath.equals(getXPathsToUpdate().get(0))) {
CmsSetupXmlHelper.setValue(document, xpath, "desc.image");
} else if (xpath.equals(getXPathsToUpdate().get(1))) {
CmsSetupXmlHelper.setValue(document, xpath, "desc.binary");
}
modified = true;
}
return modified;
}
/**
* @see org.opencms.setup.xml.A_CmsSetupXmlUpdate#getCommonPath()
*/
@Override
protected String getCommonPath() {
// /opencms/workplace/explorertypes
return new StringBuffer("/").append(<API key>.N_ROOT).append("/").append(
<API key>.N_WORKPLACE).append("/").append(
<API key>.N_EXPLORERTYPES).toString();
}
/**
* @see org.opencms.setup.xml.A_CmsSetupXmlUpdate#getXPathsToUpdate()
*/
@Override
protected List<String> getXPathsToUpdate() {
if (m_xpaths == null) {
// /opencms/workplace/explorertypes/explorertype[@name='${etype}']/newresource/@info
StringBuffer xp = new StringBuffer(256);
xp.append("/");
xp.append(<API key>.N_ROOT);
xp.append("/");
xp.append(<API key>.N_WORKPLACE);
xp.append("/");
xp.append(<API key>.N_EXPLORERTYPES);
xp.append("/");
xp.append(<API key>.N_EXPLORERTYPE);
xp.append("[@");
xp.append(<API key>.N_NAME);
xp.append("='${etype}']/");
xp.append(<API key>.N_NEWRESOURCE);
xp.append("/@");
xp.append(<API key>.A_INFO);
m_xpaths = new ArrayList<String>();
m_xpaths.add(CmsStringUtil.substitute(xp.toString(), "${etype}", "image"));
m_xpaths.add(CmsStringUtil.substitute(xp.toString(), "${etype}", "binary"));
}
return m_xpaths;
}
}
|
package dr.evolution.io;
import dr.evolution.alignment.Alignment;
import dr.evolution.alignment.SimpleAlignment;
import dr.evolution.datatype.AminoAcids;
import dr.evolution.datatype.DataType;
import dr.evolution.datatype.Nucleotides;
import dr.evolution.datatype.TwoStates;
import dr.evolution.sequence.Sequence;
import dr.evolution.sequence.SequenceList;
import dr.evolution.sequence.Sequences;
import dr.evolution.tree.FlexibleNode;
import dr.evolution.tree.FlexibleTree;
import dr.evolution.tree.Tree;
import dr.evolution.tree.TreeUtils;
import dr.evolution.util.*;
import dr.evolution.util.Date;
import dr.util.Attributable;
import java.awt.*;
import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Class for importing NEXUS file format
*
* @author Andrew Rambaut
* @author Alexei Drummond
* @version $Id: NexusImporter.java,v 1.30 2006/04/25 14:39:37 rambaut Exp $
*/
public class NexusImporter extends Importer implements SequenceImporter, TreeImporter {
public static final NexusBlock UNKNOWN_BLOCK = new NexusBlock("unknown");
public static final NexusBlock TAXA_BLOCK = new NexusBlock("TAXA");
public static final NexusBlock CHARACTERS_BLOCK = new NexusBlock("CHARACTERS");
public static final NexusBlock DATA_BLOCK = new NexusBlock("DATA");
public static final NexusBlock UNALIGNED_BLOCK = new NexusBlock("UNALIGNED");
public static final NexusBlock DISTANCES_BLOCK = new NexusBlock("DISTANCES");
public static final NexusBlock TREES_BLOCK = new NexusBlock("TREES");
public static final NexusBlock CALIBRATION_BLOCK = new NexusBlock("CALIBRATION");
public static boolean suppressWarnings = false;
private final boolean ignoreMetaComments;
public static void setSuppressWarnings(boolean sw) {
suppressWarnings = sw;
}
// NEXUS specific ImportException classes
public static class <API key> extends ImportException {
private static final long serialVersionUID = -<API key>;
public <API key>() {
super();
}
public <API key>(String message) {
super(message);
}
}
public static class NexusBlock {
private final String name;
public NexusBlock(String name) {
this.name = name;
}
public String toString() {
return name;
}
}
/**
* Constructor
*/
public NexusImporter(Reader reader) {
super(reader);
this.ignoreMetaComments = false;
<API key>('[', ']', '\0', '\0', '&');
}
public NexusImporter(Reader reader, boolean ignoreMetaComments) {
super(reader);
this.ignoreMetaComments = ignoreMetaComments;
<API key>('[', ']', '\0', '!', '&');
}
public NexusImporter(Reader reader, Writer commentWriter) {
super(reader, commentWriter);
this.ignoreMetaComments = false;
<API key>('[', ']', '\0', '!', '&');
}
/**
* This function returns an integer to specify what the
* next block in the file is. The internal variable nextBlock is also set to this
* value. This should be overridden to provide support for other blocks. Once
* the block is read in, nextBlock is automatically set to UNKNOWN_BLOCK by
* findEndBlock.
*/
public NexusBlock findNextBlock() throws IOException {
findToken("BEGIN", true);
String blockName = readToken(";");
return findBlockName(blockName);
}
/**
* This function returns an enum class to specify what the
* block given by blockName is.
*/
public NexusBlock findBlockName(String blockName) {
if (blockName.equalsIgnoreCase(TAXA_BLOCK.toString())) {
nextBlock = TAXA_BLOCK;
} else if (blockName.equalsIgnoreCase(CHARACTERS_BLOCK.toString())) {
nextBlock = CHARACTERS_BLOCK;
} else if (blockName.equalsIgnoreCase(DATA_BLOCK.toString())) {
nextBlock = DATA_BLOCK;
} else if (blockName.equalsIgnoreCase(UNALIGNED_BLOCK.toString())) {
nextBlock = UNALIGNED_BLOCK;
} else if (blockName.equalsIgnoreCase(DISTANCES_BLOCK.toString())) {
nextBlock = DISTANCES_BLOCK;
} else if (blockName.equalsIgnoreCase(TREES_BLOCK.toString())) {
nextBlock = TREES_BLOCK;
} else if (blockName.equalsIgnoreCase(CALIBRATION_BLOCK.toString())) {
nextBlock = CALIBRATION_BLOCK;
}
return nextBlock;
}
/**
* Parses a 'TAXA' block.
*/
public TaxonList parseTaxaBlock() throws ImportException, IOException {
return readTaxaBlock();
}
/**
* Parses a 'CHARACTERS' block.
*/
public Alignment <API key>(TaxonList taxonList) throws ImportException, IOException {
return readCharactersBlock(taxonList);
}
/**
* Parses a 'DATA' block.
*/
public Alignment parseDataBlock(TaxonList taxonList) throws ImportException, IOException {
return readDataBlock(/*taxonList*/);
}
/**
* Parses a 'TREES' block.
*/
public Tree[] parseTreesBlock(TaxonList taxonList) throws ImportException, IOException {
return readTreesBlock(taxonList, false);
}
/**
* Parses a 'CALIBRATION' block putting the dates into the appropriate taxa
*/
public dr.evolution.util.Date[] <API key>(TaxonList taxonList) throws ImportException, IOException {
return <API key>(taxonList);
}
// SequenceImporter IMPLEMENTATION
/**
* importAlignment.
*/
public Alignment importAlignment() throws IOException, Importer.ImportException {
boolean done = false;
TaxonList taxonList = null;
Alignment alignment = null;
while (!done) {
try {
NexusImporter.NexusBlock block = findNextBlock();
if (block == NexusImporter.TAXA_BLOCK) {
taxonList = readTaxaBlock();
} else if (block == NexusImporter.CALIBRATION_BLOCK) {
if (taxonList == null) {
throw new <API key>("TAXA block is missing");
}
<API key>(taxonList);
} else if (block == NexusImporter.CHARACTERS_BLOCK) {
if (taxonList == null) {
throw new <API key>("TAXA block is missing");
}
alignment = readCharactersBlock(taxonList);
done = true;
} else if (block == NexusImporter.DATA_BLOCK) {
// A data block doesn't need a taxon block before it
// but if one exists then it will use it.
alignment = readDataBlock(/*taxonList*/);
done = true;
} else {
// Ignore the block..
}
} catch (EOFException ex) {
done = true;
}
}
if (alignment == null) {
throw new <API key>("DATA or CHARACTERS block is missing");
}
return alignment;
}
/**
* importSequences.
*/
public SequenceList importSequences() throws IOException, ImportException {
return importAlignment();
}
// TreeImporter IMPLEMENTATION
private boolean isReadingTreesBlock = false;
private HashMap<String, Taxon> translationList = null;
private Tree nextTree = null;
private final String[] lastToken = new String[1];
/**
* import a single tree.
*/
public Tree importTree(TaxonList taxonList) throws IOException, ImportException {
return importTree(taxonList, false);
}
public Tree importTree(TaxonList taxonList, boolean <API key>) throws IOException, ImportException {
isReadingTreesBlock = false;
TaxonList[] aTaxonList = new TaxonList[1];
aTaxonList[0] = taxonList;
if (!startReadingTrees(aTaxonList)) {
throw new <API key>("TREES block is missing");
}
translationList = readTranslationList(aTaxonList[0], lastToken);
return readNextTree(translationList, lastToken, <API key> ? taxonList : null);
}
/**
* import an array of all trees.
*/
public Tree[] importTrees(TaxonList taxonList) throws IOException, ImportException {
return importTrees(taxonList, false);
}
public Tree[] importTrees(TaxonList taxonList, boolean <API key>) throws IOException, ImportException {
isReadingTreesBlock = false;
TaxonList[] aTaxonList = new TaxonList[1];
aTaxonList[0] = taxonList;
if (!startReadingTrees(aTaxonList)) {
throw new <API key>("TREES block is missing");
}
return readTreesBlock(aTaxonList[0], <API key>);
}
/**
* return whether another tree is available.
*/
public boolean hasTree() throws IOException, ImportException {
if (!isReadingTreesBlock) {
TaxonList[] taxonList = new TaxonList[1];
taxonList[0] = null;
isReadingTreesBlock = startReadingTrees(taxonList);
if (!isReadingTreesBlock) return false;
translationList = readTranslationList(taxonList[0], lastToken);
}
if (nextTree == null) {
nextTree = readNextTree(translationList, lastToken, null);
}
return (nextTree != null);
}
/**
* import the next tree.
* return the tree or null if no more trees are available
*/
public Tree importNextTree() throws IOException, ImportException {
// call hasTree to do the hard work...
if (!hasTree()) {
isReadingTreesBlock = false;
return null;
}
Tree tree = nextTree;
nextTree = null;
return tree;
}
public boolean startReadingTrees(TaxonList[] taxonList) throws IOException, ImportException {
boolean done = false;
while (!done) {
try {
NexusImporter.NexusBlock block = findNextBlock();
if (block == NexusImporter.TAXA_BLOCK && taxonList[0] == null) {
// only read the taxon list if one hasn't been set already...
taxonList[0] = readTaxaBlock();
} else if (block == NexusImporter.TREES_BLOCK) {
return true;
} else {
// Ignore the block..
}
} catch (EOFException ex) {
done = true;
}
}
return false;
}
/**
* Finds the end of the current block.
*/
private void findToken(String query, boolean ignoreCase) throws IOException {
String token;
boolean found = false;
do {
token = readToken();
if ((ignoreCase && token.equalsIgnoreCase(query)) || token.equals(query)) {
found = true;
}
} while (!found);
}
/**
* Finds the end of the current block.
*/
public void findEndBlock() throws IOException {
try {
String token;
do {
token = readToken(";");
} while (!token.equalsIgnoreCase("END") && !token.equalsIgnoreCase("ENDBLOCK"));
} catch (EOFException e) {
// Doesn't matter if the End is missing
}
nextBlock = UNKNOWN_BLOCK;
}
/**
* Reads the header information for a 'DATA', 'CHARACTERS' or 'TAXA' block.
*/
private void readDataBlockHeader(String tokenToLookFor, NexusBlock block) throws ImportException, IOException {
boolean dim = false, ttl = false, fmt = false;
String token;
do {
token = readToken();
if (token.equalsIgnoreCase("TITLE")) {
if (ttl) {
throw new <API key>("TITLE");
}
ttl = true;
} else if (token.equalsIgnoreCase("DIMENSIONS")) {
if (dim) {
throw new <API key>("DIMENSIONS");
}
boolean nchar = (block == TAXA_BLOCK);
boolean ntax = (block == CHARACTERS_BLOCK);
do {
String token2 = readToken("=;");
if (getLastDelimiter() != '=') {
throw new BadFormatException("Unknown subcommand, '" + token2 + "', or missing '=' in DIMENSIONS command");
}
if (token2.equalsIgnoreCase("NTAX")) {
if (block == CHARACTERS_BLOCK) {
throw new BadFormatException("NTAX subcommand in CHARACTERS block");
}
taxonCount = readInteger(";");
ntax = true;
} else if (token2.equalsIgnoreCase("NCHAR")) {
if (block == TAXA_BLOCK) {
throw new BadFormatException("NCHAR subcommand in TAXA block");
}
siteCount = readInteger(";");
nchar = true;
} else {
throw new BadFormatException("Unknown subcommand, '" + token2 + "', in DIMENSIONS command");
}
} while (getLastDelimiter() != ';');
if (!ntax) {
throw new BadFormatException("NTAX subcommand missing from DIMENSIONS command");
}
if (!nchar) {
throw new BadFormatException("NCHAR subcommand missing from DIMENSIONS command");
}
dim = true;
} else if (token.equalsIgnoreCase("FORMAT")) {
if (fmt) {
throw new <API key>("FORMAT");
}
dataType = null;
do {
String token2 = readToken("=;");
if (token2.equalsIgnoreCase("GAP")) {
if (getLastDelimiter() != '=') {
throw new BadFormatException("Expecting '=' after GAP subcommand in FORMAT command");
}
gapCharacters = readToken(";");
} else if (token2.equalsIgnoreCase("MISSING")) {
if (getLastDelimiter() != '=') {
throw new BadFormatException("Expecting '=' after MISSING subcommand in FORMAT command");
}
missingCharacters = readToken(";");
} else if (token2.equalsIgnoreCase("MATCHCHAR")) {
if (getLastDelimiter() != '=') {
throw new BadFormatException("Expecting '=' after MATCHCHAR subcommand in FORMAT command");
}
matchCharacters = readToken(";");
} else if (token2.equalsIgnoreCase("DATATYPE")) {
if (getLastDelimiter() != '=') {
throw new BadFormatException("Expecting '=' after DATATYPE subcommand in FORMAT command");
}
String token3 = readToken(";");
if (token3.equalsIgnoreCase("NUCLEOTIDE") ||
token3.equalsIgnoreCase("DNA") ||
token3.equalsIgnoreCase("RNA")) {
dataType = Nucleotides.INSTANCE;
} else if (token3.equalsIgnoreCase("STANDARD") || token3.equalsIgnoreCase("BINARY")) {
dataType = TwoStates.INSTANCE;
} else if (token3.equalsIgnoreCase("PROTEIN")) {
dataType = AminoAcids.INSTANCE;
} else if (token3.equalsIgnoreCase("CONTINUOUS")) {
throw new <API key>("Continuous data cannot be parsed at present");
}
} else if (token2.equalsIgnoreCase("INTERLEAVE")) {
isInterleaved = true;
}
} while (getLastDelimiter() != ';');
fmt = true;
}
} while (!token.equalsIgnoreCase(tokenToLookFor));
if (!dim) {
throw new <API key>("DIMENSIONS");
}
if (block != TAXA_BLOCK && dataType == null) {
throw new <API key>("DATATYPE");
}
}
/**
* Reads sequences in a 'DATA' or 'CHARACTERS' block.
*/
private void readSequenceData(Sequences sequences, TaxonList taxonList) throws ImportException, IOException {
int n, i;
String firstSequence = null;
if (isInterleaved) {
boolean firstLoop = true;
int readCount = 0;
while (readCount < siteCount) {
n = -1;
for (i = 0; i < taxonCount; i++) {
String token = readToken().trim();
Sequence sequence;
if (firstLoop) {
sequence = new Sequence();
sequence.setDataType(dataType);
sequences.addSequence(sequence);
Taxon taxon;
if (taxonList != null) {
int index = taxonList.getTaxonIndex(token.trim());
if (index == -1) {
// taxon not found in taxon list...
// ...perhaps it is a numerical taxon reference?
throw new <API key>(token);
} else {
taxon = taxonList.getTaxon(index);
}
} else {
taxon = new Taxon(token.trim());
}
sequence.setTaxon(taxon);
} else {
sequence = sequences.getSequence(i);
Taxon taxon = sequence.getTaxon();
if (!taxon.getId().equals(token)) {
throw new <API key>("Unknown taxon label: expecting '" +
taxon.getId() + "', found '" + token + "'");
}
}
StringBuffer buffer = new StringBuffer();
readSequenceLine(buffer, dataType, ";", gapCharacters, missingCharacters,
matchCharacters, firstSequence);
String seqString = buffer.toString();
sequence.<API key>(seqString);
if (i == 0) {
firstSequence = seqString;
}
if (getLastDelimiter() == ';') {
if (i < taxonCount - 1) {
throw new TooFewTaxaException();
}
if (readCount + n < siteCount) {
throw new <API key>(sequence.getTaxon().getId());
}
}
if (n == -1) {
n = seqString.length();
}
if (n != seqString.length()) {
throw new <API key>(sequence.getTaxon().getId());
}
}
firstLoop = false;
readCount += n;
}
if (getLastDelimiter() != ';') {
throw new BadFormatException("Expecting ';' after sequences data");
}
} else {
for (i = 0; i < taxonCount; i++) {
String token = readToken().trim();
Sequence sequence = new Sequence();
sequence.setDataType(dataType);
sequences.addSequence(sequence);
Taxon taxon;
if (taxonList != null) {
int index = taxonList.getTaxonIndex(token);
if (index == -1) {
// taxon not found in taxon list...
// ...perhaps it is a numerical taxon reference?
throw new <API key>(token);
} else {
taxon = taxonList.getTaxon(index);
}
} else {
taxon = new Taxon(token);
}
sequence.setTaxon(taxon);
StringBuffer buffer = new StringBuffer();
readSequence(buffer, dataType, ";", siteCount, gapCharacters,
missingCharacters, matchCharacters, firstSequence);
String seqString = buffer.toString();
if (seqString.length() != siteCount) {
throw new <API key>(sequence.getTaxon().getId());
}
sequence.<API key>(seqString);
if (i == 0) {
firstSequence = seqString;
}
if (getLastDelimiter() == ';' && i < taxonCount - 1) {
throw new TooFewTaxaException();
}
}
if (getLastDelimiter() != ';') {
throw new BadFormatException("Expecting ';' after sequences data, has '"
+ (char) getLastDelimiter() + "' in line " + getLineNumber());
}
}
}
/**
* Reads a 'TAXA' block.
*/
private TaxonList readTaxaBlock() throws ImportException, IOException, <API key> {
taxonCount = 0;
readDataBlockHeader("TAXLABELS", TAXA_BLOCK);
if (taxonCount == 0) {
throw new <API key>("NTAXA");
}
Taxa taxa = new Taxa();
do {
String name = readToken(";").trim();
if (name.length() > 0) {
Taxon taxon = new Taxon(name);
taxa.addTaxon(taxon);
}
} while (getLastDelimiter() != ';');
if (taxa.getTaxonCount() != taxonCount) {
throw new BadFormatException("Number of taxa doesn't match NTAXA field");
}
findEndBlock();
int duplicateTaxon = TaxonList.Utils.findDuplicateTaxon(taxa);
if (duplicateTaxon >= 0)
throw new <API key>("Tree contains duplicate taxon name: " + taxa.getTaxon(duplicateTaxon).getId() +
"!\nAll taxon names should be unique.");
return taxa;
}
/**
* Reads a 'CHARACTERS' block.
*/
private Alignment readCharactersBlock(TaxonList taxonList) throws ImportException, IOException {
siteCount = 0;
dataType = null;
readDataBlockHeader("MATRIX", CHARACTERS_BLOCK);
SimpleAlignment alignment = new SimpleAlignment();
readSequenceData(alignment, taxonList);
alignment.updateSiteCount();
findEndBlock();
return alignment;
}
/**
* Reads a 'DATA' block.
*/
private Alignment readDataBlock(/*TaxonList taxonList*/) throws ImportException, IOException {
taxonCount = 0;
siteCount = 0;
dataType = null;
readDataBlockHeader("MATRIX", DATA_BLOCK);
SimpleAlignment alignment = new SimpleAlignment();
readSequenceData(alignment, null);
alignment.updateSiteCount();
findEndBlock();
return alignment;
}
private Set<String> getNames(Collection<Taxon> taxa) {
Set<String> names = new HashSet<String>();
for (Taxon taxon : taxa) {
names.add(taxon.getId());
}
return names;
}
String notFoundInReference(Set<String> source, Set<String> reference) {
boolean any = false;
StringBuilder sb = new StringBuilder();
for (String name : source) {
if (!reference.contains(name)) {
sb.append(" ").append(name);
any = true;
}
}
return any ? sb.toString() : null;
}
/**
* Reads a 'TREES' block.
*/
private Tree[] readTreesBlock(TaxonList taxonList, boolean <API key>) throws ImportException, IOException {
ArrayList<Tree> trees = new ArrayList<Tree>();
String[] lastToken = new String[1];
HashMap<String, Taxon> translationList = readTranslationList(taxonList, lastToken);
if (<API key> && translationList.size() != taxonList.getTaxonCount()) {
Set<String> namesFromList = getNames(taxonList.asList());
Set<String> namesFromFile = getNames(translationList.values());
String notFoundInList = notFoundInReference(namesFromFile, namesFromList);
String notFoundInFile = notFoundInReference(namesFromList, namesFromFile);
throw new ImportException("Mismatch in taxa count in tree file (" + translationList.size() +
") and <taxa> block (" + taxonList.getTaxonCount() + ")\n" +
((notFoundInList != null) ? ("Not found in list:" + notFoundInList) : "") +
((notFoundInFile != null) ? ("Not found in file:" + notFoundInFile) : "")
);
}
boolean done = false;
do {
Tree tree = readNextTree(translationList, lastToken, <API key> ? taxonList : null);
if (tree != null) {
trees.add(tree);
} else {
done = true;
}
} while (!done);
if (trees.size() == 0) {
throw new BadFormatException("No trees defined in TREES block");
}
Tree[] treeArray = new Tree[trees.size()];
trees.toArray(treeArray);
nextBlock = UNKNOWN_BLOCK;
return treeArray;
}
private HashMap<String, Taxon> readTranslationList(TaxonList taxonList, String[] lastToken) throws ImportException, IOException {
HashMap<String, Taxon> translationList = new HashMap<String, Taxon>();
String token = readToken(";");
if (token.equalsIgnoreCase("TRANSLATE")) {
do {
String token2 = readToken(",;");
if (getLastDelimiter() == ',' || getLastDelimiter() == ';') {
throw new BadFormatException("Missing taxon label in TRANSLATE command of TREES block");
}
String token3 = readToken(",;");
Taxon taxon;
if (getLastDelimiter() != ',' && getLastDelimiter() != ';') {
throw new BadFormatException("Expecting ',' or ';' after taxon label in TRANSLATE command of TREES block");
}
if (taxonList != null) {
int index = taxonList.getTaxonIndex(token3);
if (index == -1) {
// taxon not found in taxon list...
// ...perhaps it is a numerical taxon reference?
throw new <API key>("Taxon '" + token3 + "' in nexus '" + token + "' block but " +
"not in the taxon list (taxon list may or may not originate from the nexus file)");
} else {
taxon = taxonList.getTaxon(index);
}
} else {
taxon = new Taxon(token3);
}
if (translationList.containsKey(token2)) {
throw new BadFormatException("Translation list uses the key, " + token2 + ", more than once.");
}
translationList.put(token2, taxon);
} while (getLastDelimiter() != ';');
token = readToken(";");
} else if (taxonList != null) {
for (int i = 0; i < taxonList.getTaxonCount(); i++) {
Taxon taxon = taxonList.getTaxon(i);
translationList.put(taxon.getId(), taxon);
}
}
lastToken[0] = token;
return translationList;
}
private Tree readNextTree(HashMap<String, Taxon> translationList, String[] lastToken, TaxonList taxonList) throws ImportException, IOException {
try {
Tree tree = null;
String token = lastToken[0];
if (token.equalsIgnoreCase("UTREE") || token.equalsIgnoreCase("TREE")) {
if (nextCharacter() == '*') {
// Star is used to specify a default tree - ignore it
readCharacter();
}
String token2 = readToken("=;");
// Save tree comment and attach it later
final String comment = getLastMetaComment();
<API key>();
if (getLastDelimiter() != '=') {
throw new BadFormatException("Missing label for tree'" + token2 + "' or missing '=' in TREE command of TREES block");
}
try {
if (nextCharacter() != '(') {
throw new BadFormatException("Missing tree definition in TREE command of TREES block");
}
// tree special comments
final String scomment = getLastMetaComment();
<API key>();
FlexibleNode root = readInternalNode(translationList);
if (translationList != null) {
// this ensures that if a translation list is used, the external node numbers
// of the trees correspond as well.
Map<Taxon, Integer> taxonNumberMap = new HashMap<Taxon, Integer>();
int count = 0;
for (String label : translationList.keySet()) {
Taxon taxon = translationList.get(label);
int number;
if (taxonList != null) { // Map back to original numbering from TaxonList
number = taxonList.getTaxonIndex(taxon);
} else { // Old functionality
try {
number = Integer.parseInt(label) - 1;
} catch (<API key> nfe) {
number = count;
}
}
taxonNumberMap.put(taxon, number);
count++;
}
tree = new FlexibleTree(root, false, true, taxonNumberMap);
} else {
tree = new FlexibleTree(root, false, true, null);
}
tree.setId(token2);
if (getLastDelimiter() == ':') {
// in case the root has a branch length, skip it
readToken(";");
if (getLastMetaComment() != null) {
// There was a meta-comment which should be in the form:
// \[&label[=value][,label[=value]>[,/..]]\]
try {
<API key>(getLastMetaComment(), root);
} catch (BadFormatException bfe) {
// ignore it
}
<API key>();
}
}
if (getLastDelimiter() != ';') {
throw new BadFormatException("Expecting ';' after tree, '" + token2 + "', TREE command of TREES block");
}
if (scomment != null) {
// below is correct only if [&W] appears on it own
String c = scomment;
while (c.length() > 0) {
final char ch = c.charAt(0);
if (ch == ';') {
c = c.substring(1);
continue;
}
if (ch == 'R') {
// we only have rooted trees anyway
c = c.substring(1);
} else if (ch == 'W') {
int e = c.indexOf(';');
if (e < 0) e = c.length();
try {
final Float value = new Float(c.substring(2, e));
tree.setAttribute("weight", value);
} catch (<API key> ex) {
// don't fail, ignore
}
c = c.substring(e);
} else {
c = c.substring(1);
}
}
}
if (comment != null) {
try {
<API key>(comment, tree);
} catch (Importer.BadFormatException e) {
// set generic comment attribute
tree.setAttribute("comment", comment);
}
}
} catch (EOFException e) {
// If we reach EOF we may as well return what we have?
return tree;
}
token = readToken(";");
} else if (token.equalsIgnoreCase("ENDBLOCK") || token.equalsIgnoreCase("END")) {
return null;
} else {
throw new BadFormatException("Unknown command '" + token + "' in TREES block");
}
//added this to escape readNextTree loop correctly -- AJD
lastToken[0] = token;
return tree;
} catch (EOFException e) {
return null;
}
}
/**
* Reads a branch in. This could be a node or a tip (calls readNode or readTip
* accordingly). It then reads the branch length and SimpleNode that will
* point at the new node or tip.
*/
FlexibleNode readBranch(HashMap<String, Taxon> translationList) throws IOException, ImportException {
double length = 0.0;
FlexibleNode branch;
<API key>();
if (nextCharacter() == '(') {
// is an internal node
branch = readInternalNode(translationList);
} else {
// is an external node
branch = readExternalNode(translationList);
}
if (getLastDelimiter() != ':' && getLastDelimiter() != ',' && getLastDelimiter() != ')') {
String label = readToken(",():;");
if (label.length() > 0) {
branch.setAttribute("label", label);
}
}
if (getLastDelimiter() == ':') {
length = readDouble(",():;");
if (getLastMetaComment() != null) {
if (!ignoreMetaComments) {
// There was a meta-comment which should be in the form:
// \[&label[=value][,label[=value]>[,/..]]\]
try {
<API key>(getLastMetaComment(), branch);
} catch (BadFormatException bfe) {
// ignore it
}
}
<API key>();
}
}
branch.setLength(length);
return branch;
}
/**
* Reads a node in. This could be a polytomy. Calls readBranch on each branch
* in the node.
*/
FlexibleNode readInternalNode(HashMap<String, Taxon> translationList) throws IOException, ImportException {
FlexibleNode node = new FlexibleNode();
// read the opening '('
readCharacter();
// read the first child
node.addChild(readBranch(translationList));
if (getLastDelimiter() != ',' && !suppressWarnings) {
java.util.logging.Logger.getLogger("dr.evolution.io").warning("Internal node only has a single child.");
}
// this allows one or more children
while(getLastDelimiter()==',') {
node.addChild(readBranch(translationList));
}
// should have had a closing ')'
if (getLastDelimiter() != ')') {
throw new BadFormatException("Missing closing ')' in tree in TREES block");
}
readToken(":(),;");
if (getLastMetaComment() != null) {
if (!ignoreMetaComments) {
// There was a meta-comment which should be in the form:
// \[&label[=value][,label[=value]>[,/..]]\]
try {
<API key>(getLastMetaComment(), node);
} catch (BadFormatException bfe) {
// ignore it
}
}
<API key>();
}
// find the next delimiter
return node;
}
// private void labelNode(FlexibleNode node, String label, String value) {
// // Attempt to format the value as a number
// Number number = null;
// try {
// number = Integer.valueOf(value);
// } catch (<API key> nfe1) {
// try {
// number = Double.valueOf(value);
// } catch (<API key> nfe2) {
// if (number != null) {
// node.setAttribute(label, number);
// } else {
// node.setAttribute(label, value);
/**
* Reads an external node in.
*/
FlexibleNode readExternalNode(HashMap<String, Taxon> translationList) throws ImportException, IOException {
FlexibleNode node = new FlexibleNode();
String label = readToken(":(),;");
Taxon taxon;
if (translationList.size() > 0) {
taxon = translationList.get(label);
if (taxon == null) {
// taxon not found in taxon list...
throw new <API key>("Taxon in tree, '" + label + "' is unknown");
}
} else {
taxon = new Taxon(label);
}
if (getLastMetaComment() != null) {
if (!ignoreMetaComments) {
// There was a meta-comment which should be in the form:
// \[&label[=value][,label[=value]>[,/..]]\]
try {
<API key>(getLastMetaComment(), node);
} catch (BadFormatException bfe) {
// ignore it
}
}
<API key>();
}
node.setTaxon(taxon);
return node;
}
/**
* Reads a 'CALIBRATION' block.
*/
private dr.evolution.util.Date[] <API key>(TaxonList taxonList) throws ImportException, IOException {
double origin = 0.0;
boolean isBackwards = false;
Units.Type units = Units.Type.YEARS;
ArrayList<Date> dates = new ArrayList<Date>();
String token;
boolean done = false;
do {
token = readToken(";");
if (token.equalsIgnoreCase("OPTIONS")) {
do {
String token2 = readToken("=;");
if (getLastDelimiter() != '=') {
throw new BadFormatException("Unknown subcommand, '" + token2 + "', or missing '=' in OPTIONS command of CALIBRATION block");
}
if (token2.equalsIgnoreCase("SCALE")) {
String token3 = readToken(";");
if (token3.equalsIgnoreCase("DAYS")) {
units = Units.Type.DAYS;
} else if (token3.equalsIgnoreCase("MONTHS")) {
units = Units.Type.MONTHS;
} else if (token3.equalsIgnoreCase("YEARS")) {
units = Units.Type.YEARS;
} else {
throw new BadFormatException("SCALE in OPTIONS command of CALIBRATION block must be one of DAYS, MONTHS or YEARS");
}
} else if (token2.equalsIgnoreCase("ORIGIN")) {
origin = readDouble(";");
} else if (token2.equalsIgnoreCase("DIRECTION")) {
String token3 = readToken(";");
if (token3.equalsIgnoreCase("FORWARDS")) {
isBackwards = false;
} else if (token3.equalsIgnoreCase("BACKWARDS")) {
isBackwards = true;
} else {
throw new BadFormatException("DIRECTION in OPTIONS command of CALIBRATION block must be either FORWARDS or BACKWARDS");
}
} else {
throw new BadFormatException("Unknown subcommand, '" + token2 + "', in OPTIONS command of CALIBRATION block");
}
} while (getLastDelimiter() != ';');
} else if (token.equalsIgnoreCase("TIPCALIBRATION")) {
do {
String token2 = readToken("=;");
if (getLastDelimiter() != '=') {
throw new BadFormatException("Missing date for label '" + token2 + "' or missing '=' in TIPCALIBRATION command of CALIBRATION block");
}
double value = readDouble(":;");
if (getLastDelimiter() != ':') {
throw new BadFormatException("Missing taxon list for label '" + token2 + "' or missing ':' in TIPCALIBRATION command of CALIBRATION block");
}
dr.evolution.util.Date date;
if (isBackwards) {
date = dr.evolution.util.Date.<API key>(value, units, origin);
} else {
date = dr.evolution.util.Date.<API key>(value, units, origin);
}
dates.add(date);
do {
String token3 = readToken(",;");
Taxon taxon;
int index = taxonList.getTaxonIndex(token3);
if (index == -1) {
// taxon not found in taxon list...
throw new <API key>("Unknown taxon '" + token3 + "' for label '" + token2 + "' in TIPCALIBRATION command of CALIBRATION block");
} else {
taxon = taxonList.getTaxon(index);
}
taxon.setAttribute("date", date);
} while (getLastDelimiter() != ',' && getLastDelimiter() != ';');
} while (getLastDelimiter() == ',');
} else if (token.equalsIgnoreCase("NODECALIBRATION")) {
throw new BadFormatException("NODECALIBRATION not suppored in CALIBRATION block");
} else if (token.equalsIgnoreCase("ENDBLOCK") || token.equalsIgnoreCase("END")) {
done = true;
} else {
throw new BadFormatException("Unknown command '" + token + "' in CALIBRATION block");
}
} while (!done);
dr.evolution.util.Date[] dateArray = new dr.evolution.util.Date[dates.size()];
dates.toArray(dateArray);
nextBlock = UNKNOWN_BLOCK;
return dateArray;
}
static void <API key>(String meta, Attributable item) throws Importer.BadFormatException {
if (meta.startsWith("B ")) {
// a MrBayes annotation
String[] parts = meta.split(" ");
if (parts.length == 3 && parts[1].length() > 0 && parts[2].length() > 0) {
item.setAttribute(parts[1], parseValue(parts[2]));
} else if (parts.length == 2 && parts[1].length() > 0) {
item.setAttribute(parts[1], Boolean.TRUE);
} else {
throw new Importer.BadFormatException("Badly formatted attribute: '" + meta + "'");
}
return;
}
// This regex should match key=value pairs, separated by commas
// This can match the following types of meta comment pairs:
// value=number, value="string", value={item1, item2, item3}
// (label must be quoted if it contains spaces (i.e. "my label"=label)
// TODO MAS Minor change in line below for nested arrays may cause other unforeseen bugs
Pattern pattern = Pattern.compile("(\"[^\"]*\"+|[^,=\\s]+)\\s*(=\\s*(\\{[^=]*\\}|\"[^\"]*\"+|[^,]+))?");
Matcher matcher = pattern.matcher(meta);
while (matcher.find()) {
String label = matcher.group(1);
if (label.length() > 1 && label.startsWith("\"")) {
label = label.substring(1, label.length() - 1);
}
if (label.trim().length() == 0) {
throw new Importer.BadFormatException("Badly formatted attribute: '" + matcher.group() + "'");
}
final String value = matcher.group(2);
if (value != null && value.trim().length() > 0) {
// there is a specified value so try to parse it
item.setAttribute(label, parseValue(value.substring(1)));
} else {
item.setAttribute(label, Boolean.TRUE);
}
}
}
public static boolean isInt(String str)
{
if (str == null) {
return false;
}
int length = str.length();
if (length == 0) {
return false;
}
int i = 0;
if (str.charAt(0) == '-') {
if (length == 1) {
return false;
}
i = 1;
}
for (; i < length; i++) {
char c = str.charAt(i);
if (c <= '/' || c >= ':') {
return false;
}
}
return true;
}
/**
* This method takes a string and tries to decode it returning the object
* that best fits the data. It will recognize comma delimited lists enclosed
* in {..} and call parseValue() on each element. It will also recognize Boolean,
* Integer and Double. If the value starts with a # then it will attempt to decode
* the following integer as an RGB colour - see Color.decode(). If nothing else fits
* then the value will be returned as a string but trimmed of leading and trailing
* white space.
*
* @param value the string
* @return the object
*/
public static Serializable parseValue(String value) {
value = value.trim();
if (value.startsWith("{")) {
// the value is a list so recursively parse the elements
// and return an array
String inside = value.substring(1, value.length() - 1);
if (inside.length() == 0) {
return null;
}
// Determine depth of further nesting
int depth = 0;
while (inside.charAt(depth) == '{') {
depth++;
}
StringBuilder split;
if (depth == 0) {
split = new StringBuilder(",");
} else {
StringBuilder rightBookEnd = new StringBuilder("(?<=");
StringBuilder leftBookEnd = new StringBuilder("(?=");
for (int i = 0; i < depth; ++i) {
rightBookEnd.append("\\}");
leftBookEnd.append("\\{");
}
leftBookEnd.append(")");
rightBookEnd.append(")");
split = rightBookEnd.append(",").append(leftBookEnd);
}
// Non-destructive split
String[] elements = inside.split(split.toString());
Object[] values = new Object[elements.length];
for (int i = 0; i < elements.length; i++) {
values[i] = parseValue(elements[i]);
}
return values;
}
if (value.startsWith("
// I am not sure whether this is a good idea but
// I am going to assume that a # denotes an RGB colour
try {
return Color.decode(value.substring(1));
} catch (<API key> nfe1) {
// not a colour
}
}
if (value.equalsIgnoreCase("TRUE") || value.equalsIgnoreCase("FALSE")) {
return Boolean.valueOf(value);
}
// Attempt to format the value as an integer
// try {
// return new Integer(value);
// } catch (<API key> nfe1) {
// // not an integer
// throwing exception to test for an integer is slow
if (isInt(value)) {
return Integer.valueOf(value);
}
// Attempt to format the value as a double
try {
return new Double(value);
} catch (<API key> nfe2) {
// not a double
}
// return the trimmed string
if (value.charAt(0) == '\"') {
value = value.substring(1, value.length() - 1);
}
return value;
}
// private stuff
private NexusBlock nextBlock = null;
private int taxonCount = 0, siteCount = 0;
private DataType dataType = null;
private String gapCharacters = "-";
private String matchCharacters = ".";
private String missingCharacters = "?";
private boolean isInterleaved = false;
public static void main(String[] args) throws IOException, ImportException {
if (args.length > 3) {
int sampleFrequency = Integer.parseInt(args[1]);
boolean <API key> = Boolean.getBoolean(args[2]);
boolean isNexus = Boolean.getBoolean(args[3]);
NexusImporter nexusImporter = null;
BufferedReader reader = null;
if (isNexus) {
nexusImporter = new NexusImporter(new FileReader(args[0]));
} else {
reader = new BufferedReader(new FileReader(args[0]));
}
int index = 0;
int count = 0;
String line = null;
if (!isNexus) line = reader.readLine();
while (line != null || (isNexus && nexusImporter.hasTree())) {
Tree tree;
if (isNexus) {
tree = nexusImporter.importNextTree();
} else {
String treeString = line.substring(line.indexOf('(')).trim();
java.io.Reader stringReader = new java.io.StringReader(treeString);
NewickImporter importer = new NewickImporter(stringReader);
tree = importer.importNextTree();
}
if (index % sampleFrequency == 0) {
if (<API key>) {
System.out.println(TreeUtils.newick(tree));
} else {
System.out.println(TreeUtils.newickNoLengths(tree));
count += 1;
}
}
index += 1;
if (!isNexus) line = reader.readLine();
}
System.out.println(count + " trees");
} else {
System.err.println("usage: filterTrees <tree-file-name> <sample-frequency> <<API key>>");
}
}
}
|
#include <sys/time.h>
#include <sys/resource.h>
#include <iostream>
#include <iomanip>
class Timer {
public:
void start() {
getrusage(RUSAGE_SELF, &before);
}
void stop() {
getrusage(RUSAGE_SELF, &after);
}
long print(char *message) {
long msecs_user = ((after.ru_utime.tv_sec - before.ru_utime.tv_sec) * 1000 +
(after.ru_utime.tv_usec - before.ru_utime.tv_usec) / 1000);
long msecs_system = ((after.ru_stime.tv_sec - before.ru_stime.tv_sec) * 1000 +
(after.ru_stime.tv_usec - before.ru_stime.tv_usec) / 1000);
std::cout << "--> " << std::setw(36) << message << " CPU " << std::setw(4) << (msecs_system + msecs_user)
<< " msec (user: " << msecs_user << " msec, system: " << msecs_system << " msec)."
<< std::endl;
return (msecs_system + msecs_user);
}
void print_user() {
long msecs_user = ((after.ru_utime.tv_sec - before.ru_utime.tv_sec) * 1000 +
(after.ru_utime.tv_usec - before.ru_utime.tv_usec) / 1000);
std::cout << "CPU: utilization " << msecs_user << " msec."
<< std::endl;
}
protected:
struct rusage before;
struct rusage after;
};
|
package org.dresdenocl.debug.ui.launch;
import org.dresdenocl.debug.ui.OclDebugUIPlugin;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.<API key>;
import org.eclipse.debug.core.ILaunchManager;
/**
* @author Lars Schuetze
*
*/
/**
* A class that converts the current selection or active editor to a launch
* configuration. Set the <API key> option to false to customize
* this class.
*/
public class OclLaunchShortcut implements org.eclipse.debug.ui.ILaunchShortcut2 {
public void launch(org.eclipse.jface.viewers.ISelection selection, String mode) {
if (selection instanceof org.eclipse.jface.viewers.<API key>) {
org.eclipse.jface.viewers.<API key> structuredSelection =
(org.eclipse.jface.viewers.<API key>) selection;
java.util.Iterator<?> it = structuredSelection.iterator();
while (it.hasNext()) {
Object object = it.next();
if (object instanceof org.eclipse.core.resources.IFile) {
org.eclipse.core.resources.IFile file =
(org.eclipse.core.resources.IFile) object;
launch(file, mode);
}
}
}
}
public void launch(org.eclipse.ui.IEditorPart editorPart, String mode) {
org.eclipse.ui.IEditorInput editorInput = editorPart.getEditorInput();
if (editorInput instanceof org.eclipse.ui.IFileEditorInput) {
org.eclipse.ui.IFileEditorInput fileInput =
(org.eclipse.ui.IFileEditorInput) editorInput;
launch(fileInput.getFile(), mode);
}
}
private void launch(org.eclipse.core.resources.IFile file, String mode) {
try {
ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
<API key> type =
lm.<API key>(OclDebugUIPlugin.<API key>);
org.eclipse.debug.core.<API key> workingCopy =
type.newInstance(null, file.getName());
org.eclipse.emf.common.util.URI uri =
org.eclipse.emf.common.util.URI.<API key>(file
.getFullPath().toString(), true);
workingCopy.setAttribute(OclDebugUIPlugin.OCL_URI, uri.toString());
org.eclipse.debug.core.<API key> configuration =
workingCopy.doSave();
org.eclipse.debug.ui.DebugUITools.launch(configuration, mode);
} catch (org.eclipse.core.runtime.CoreException e) {
org.dresdenocl.language.ocl.resource.ocl.mopp.OclPlugin.logError(
"Exception while launching selection", e);
}
}
public org.eclipse.debug.core.<API key>[] <API key>(
org.eclipse.jface.viewers.ISelection selection) {
return null;
}
public org.eclipse.debug.core.<API key>[] <API key>(
org.eclipse.ui.IEditorPart editorPart) {
return null;
}
public org.eclipse.core.resources.IResource <API key>(
org.eclipse.jface.viewers.ISelection selection) {
return null;
}
public org.eclipse.core.resources.IResource <API key>(
org.eclipse.ui.IEditorPart editorPart) {
return null;
}
}
|
package org.molgenis.test.data.staticentity.bidirectional.person2;
import org.molgenis.data.<API key>;
import org.molgenis.data.populate.EntityPopulator;
import org.molgenis.test.data.staticentity.bidirectional.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class PersonFactory2 extends <API key><Person, PersonMetaData2, String>
{
@Autowired
PersonFactory2(PersonMetaData2 personMeta, EntityPopulator entityPopulator)
{
super(Person.class, personMeta, entityPopulator);
}
}
|
package org.dresdenocl.standardlibrary.java.internal.library;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.dresdenocl.essentialocl.EssentialOclPlugin;
import org.dresdenocl.essentialocl.standardlibrary.OclAny;
import org.dresdenocl.essentialocl.standardlibrary.OclBoolean;
import org.dresdenocl.essentialocl.standardlibrary.<API key>;
import org.dresdenocl.essentialocl.standardlibrary.OclSet;
import org.dresdenocl.modelinstancetype.exception.<API key>;
import org.dresdenocl.modelinstancetype.exception.<API key>;
import org.dresdenocl.modelinstancetype.exception.<API key>;
import org.dresdenocl.modelinstancetype.exception.<API key>;
import org.dresdenocl.modelinstancetype.types.<API key>;
import org.dresdenocl.modelinstancetype.types.<API key>;
import org.dresdenocl.pivotmodel.Operation;
import org.dresdenocl.pivotmodel.Property;
import org.dresdenocl.pivotmodel.Type;
import org.dresdenocl.standardlibrary.java.factory.<API key>;
/**
* <p>
* This class implements the OCL type {@link <API key>} in Java.
* </p>
*
* @author Ronny Brandt
* @author Michael Thiele
*/
public class <API key> extends JavaOclAny implements <API key>,
IAddableElement {
protected Type metaType;
/**
* <p>
* Instantiates a new {@link JavaOclObject}.
* </p>
*
* @param adaptee The adapted model instance object.
*/
public <API key>(<API key> imiObject, Type metaType) {
super(imiObject);
this.metaType = metaType;
}
public <API key>(String undefinedReason, Type metaType) {
super(undefinedReason);
this.metaType = metaType;
}
public <API key>(Throwable invalidReason, Type metaType) {
super(invalidReason);
this.metaType = metaType;
}
/*
* (non-Javadoc)
*
* @see org.dresdenocl.standardlibrary.java.internal.library.IAddableElement
* #add(org.dresdenocl.essentialocl.standardlibrary.OclAny)
*/
@Override
public OclAny add(OclAny that) {
/*
* convention: any <API key> that has an operation called "+", "add" or "plus" is
* considered to be addable. Else return invalid.
*/
OclAny result;
result = checkInvalid(metaType, this, that);
if (result == null)
result = checkUndefined("+", metaType, this, that);
if (result == null) {
if (that.<API key>().isKindOf(metaType)) {
result = findMethod("+", that);
if (result == null)
result = findMethod("add", that);
if (result == null)
result = findMethod("plus", that);
if (result == null)
// not found any matching method -> invalid
result =
<API key>.INSTANCE.createOclInvalid(metaType,
new <API key>("Cannot find operation +, add or plus on " + this));
}
}
return result;
}
/*
* (non-Javadoc)
*
* @see org.dresdenocl.essentialocl.standardlibrary.OclAny#asSet()
*/
@Override
@SuppressWarnings("unchecked")
public OclSet<<API key>> asSet() {
OclSet<<API key>> result;
result =
checkInvalid(EssentialOclPlugin.<API key>().getOclLibrary()
.getSetType(metaType), this);
if (result == null)
result = checkAsSet(metaType);
if (result == null) {
Set<<API key>> resultSet = new HashSet<<API key>>();
resultSet.add(this.<API key>());
result =
<API key>.INSTANCE.createOclSet(resultSet, EssentialOclPlugin
.<API key>().getOclLibrary().getSetType(metaType));
}
return result;
}
/*
* (non-Javadoc)
*
* @see org.dresdenocl.essentialocl.standardlibrary.<API key>
* #<API key>()
*/
@Override
public <API key> <API key>() {
return (<API key>) this.imiElement;
}
/*
* (non-Javadoc)
*
* @see org.dresdenocl.standardlibrary.java.internal.library.IAddableElement #getNeutralElement()
*/
@Override
public OclAny getNeutralElement() {
// FIXME Michael: how to get an instance of an unknown neutral element?
return null;
}
/**
* <p>
* Returns the {@link OclAny} of a given {@link Property} that is defined on this
* {@link <API key>}.
* </p>
*
* @param property The {@link Property} whose value shall be returned.
* @return The result as an {@link OclAny}.
*/
@Override
public OclAny getProperty(Property property) {
OclAny result;
/* Check if the source is invalid. */
if (this.oclIsInvalid().isTrue()) {
result =
<API key>.INSTANCE.createOclInvalid(property.getType(),
this.getInvalidReason());
}
else if (this.oclIsUndefined().isTrue()) {
result =
<API key>.INSTANCE.createOclInvalid(property.getType(),
new <API key>(this.getUndefinedReason()));
}
/* Else try to get the property. */
else {
<API key> imiResult;
try {
imiResult = <API key>().getProperty(property);
if (imiResult.isUndefined()) {
result =
<API key>.INSTANCE.createOclUndefined(property.getType(),
imiResult.getName() + " is null.");
}
else {
result = <API key>.INSTANCE.createOclAny(imiResult);
}
}
/* Probably create an undefined or invalid result. */
catch (<API key> e) {
result = <API key>.INSTANCE.createOclInvalid(property.getType(), e);
}
catch (<API key> e) {
result = <API key>.INSTANCE.createOclInvalid(property.getType(), e);
}
// end catch.
}
// end else.
return result;
}
/*
* (non-Javadoc)
*
* @see org.dresdenocl.essentialocl.standardlibrary.OclAny#isEqualTo(tudresden
* .ocl20.pivot.essentialocl.standardlibrary.OclAny)
*/
@Override
public OclBoolean isEqualTo(OclAny that) {
OclBoolean result;
result = checkIsEqualTo(that);
if (result == null) {
if (!(that instanceof <API key>)) {
result = JavaOclBoolean.getInstance(false);
}
else {
Object thatObject = ((<API key>) that.<API key>()).getObject();
if (<API key>().getObject().equals(thatObject)) {
result = JavaOclBoolean.getInstance(true);
} else {
result = JavaOclBoolean.getInstance(false);
}
}
}
return result;
}
/*
* (non-Javadoc)
*
* @see org.dresdenocl.standardlibrary.java.internal.library.JavaOclAny#
* invokeOperation(org.dresdenocl.pivotmodel.Operation,
* org.dresdenocl.essentialocl.standardlibrary.OclAny[])
*/
@Override
public OclAny invokeOperation(Operation operation, OclAny... args) {
OclAny result = null;
final String operationName = operation.getName();
/*
* Handle oclIsTypeOf(), oclIsKindOf() and oclAsType() separately as the argument has no
* IMIElement.
*/
if ((operationName.equals("oclIsTypeOf") || operationName.equals("oclIsKindOf") || operationName
.equals("oclAsType")) && args.length == 1) {
result = super.invokeOperation(operation, args);
}
/*
* Handle oclIsInvalid() and oclIsUndefined separately as they cannot be invoked on IMIElements
* and are definitely defined in the Standard Library.
*/
if (result == null
&& (operationName.equals("oclIsUndefined") || operationName.equals("oclIsInvalid"))
&& args.length == 0)
result = super.invokeOperation(operation, args);
if (result == null && (operationName.equals("asSet") && args.length == 0))
result = this.asSet();
if (result == null)
result = checkInvalid(operation, args);
if (result == null) {
/* Else try to invoke the operation. */
<API key> imiResult;
List<<API key>> imiArguments;
imiArguments = new LinkedList<<API key>>();
/* Try to invoke the operation. */
try {
/* Get the model instance arguments. */
for (OclAny arg : args) {
imiArguments.add(arg.<API key>());
}
imiResult = <API key>().invokeOperation(operation, imiArguments);
result = <API key>.INSTANCE.createOclAny(imiResult);
}
/*
* If the operation is not defined on the model element, it may be an operation on OclAny.
*/
catch (<API key> e) {
result = super.invokeOperation(operation, args);
}
catch (<API key> e) {
result = super.invokeOperation(operation, args);
}
// end catch.
}
// no else.
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder result = new StringBuilder();
result.append(this.getClass().getSimpleName());
result.append("[");
if (!<API key>(result)) {
result.append(<API key>().toString());
}
result.append("]");
return result.toString();
}
/**
* Used to determine invalid return values for {@link Operation}s. <code>this</code> is checked to
* be <code>undefined</code> or <code>invalid</code> and the arguments are checked for
* <code>invalid</code> .
*
* @param operation the operation to call
* @param args the arguments of the operation
* @return <code>null</code> if neither the source nor the args are undefined or invalid, the
* undefined or invalid source else
*/
protected OclAny checkInvalid(Operation operation, OclAny... args) {
OclAny result = null;
if (this.oclIsInvalid().isTrue()
&& !(operation.getName().equals("oclIsInvalid") && args.length == 0)
&& !(operation.getName().equals("isEqualTo") && args.length == 1)) {
result =
<API key>.INSTANCE.createOclInvalid(operation.getType(),
this.getInvalidReason());
}
else if (this.oclIsUndefined().isTrue()
&& !(operation.getName().equals("oclIsInvalid") && args.length == 0)
&& !(operation.getName().equals("oclIsUndefined") && args.length == 0)
&& !(operation.getName().equals("isEqualTo") && args.length == 1)) {
result =
<API key>.INSTANCE.createOclInvalid(operation.getType(),
new RuntimeException("Tried to invoke operation " + operation.getName()
+ " on null. Reason: " + this.getUndefinedReason()));
}
if (result == null) {
/* The same for all the arguments */
for (OclAny arg : args) {
if (arg.oclIsInvalid().isTrue()) {
result =
<API key>.INSTANCE.createOclInvalid(operation.getType(),
arg.getInvalidReason());
break;
}
}
}
return result;
}
@SuppressWarnings("unchecked")
private OclAny findMethod(String methodName, OclAny that) {
OclAny result = null;
try {
findMethod(methodName, this.getClass(), that.getClass());
/*
* if no exception has been thrown, search for the operation in the PivotModel
*/
Operation operation = null;
List<Type> argTypes;
argTypes = new ArrayList<Type>();
argTypes.add(that.<API key>().getType());
operation = this.imiElement.getType().lookupOperation(methodName, argTypes);
if (operation != null)
result = super.invokeOperation(operation, that);
else
result =
<API key>.INSTANCE.createOclInvalid(metaType,
new <API key>("Cannot find " + methodName + " on " + this));
} catch (<API key> e) {
// ignore
}
return result;
}
}
|
KITSUNE_PATH = ../../../../../../bin
KITSUNE_LDFLAGS = -L$(KITSUNE_PATH) -lkitsune -ldl
KITSUNE_CFLAGS = -I$(KITSUNE_PATH) -fPIC
KTCC = $(KITSUNE_PATH)/ktcc
PROG = keyvalueserver
SOURCE = keyvalueserver.c
CFLAGS = -O2 -fomit-frame-pointer -g $(KITSUNE_CFLAGS)
all: $(PROG) $(PROG).so
%.o: %.c
$(KTCC) $(CFLAGS) -c $^
$(PROG): keyvalueserver.o
$(CC) -o $@ $^ $(KITSUNE_LDFLAGS)
$(PROG).so: keyvalueserver.o
$(CC) -shared -o $@ $^ $(KITSUNE_LDFLAGS)
clean:
rm *.o || true
rm $(PROG) || true
rm *.ktt || true
rm $(PROG).so || true
|
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobileTemplate.setCreatureName('gondula_shaman')
mobileTemplate.setLevel(78)
mobileTemplate.setDifficulty(Difficulty.NORMAL)
mobileTemplate.setMinSpawnDistance(3)
mobileTemplate.setMaxSpawnDistance(5)
mobileTemplate.setDeathblow(False)
mobileTemplate.setScale(1)
mobileTemplate.setSocialGroup('gondula tribe')
mobileTemplate.setAssistRange(1)
mobileTemplate.setOptionsBitmask(128)
mobileTemplate.setStalker(True)
templates = Vector()
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
templates.add('object/mobile/<API key>.iff')
mobileTemplate.setTemplates(templates)
weaponTemplates = Vector()
weapontemplate = WeaponTemplate('object/weapon/melee/unarmed/<API key>.iff', WeaponType.UNARMED, 1.0, 6, 'kinetic')
weaponTemplates.add(weapontemplate)
mobileTemplate.<API key>(weaponTemplates)
attacks = Vector()
mobileTemplate.setDefaultAttack('meleeHit')
mobileTemplate.setAttacks(attacks)
lootPoolNames_1 = ['Junk']
lootPoolChances_1 = [100]
lootGroupChance_1 = 65
mobileTemplate.addToLootGroups(lootPoolNames_1,lootPoolChances_1,lootGroupChance_1)
lootPoolNames_2 = ['<API key>']
lootPoolChances_2 = [100]
lootGroupChance_2 = 35
mobileTemplate.addToLootGroups(lootPoolNames_2,lootPoolChances_2,lootGroupChance_2)
core.spawnService.addMobileTemplate('gondula_shaman', mobileTemplate)
return
|
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: android/libcore/luni/src/main/java/java/util/concurrent/locks/<API key>.java
#ifndef <API key>
#define <API key>
@class JavaLangThread;
#include "J2ObjC_header.h"
#include "java/io/Serializable.h"
#define <API key> <API key>
@interface <API key> : NSObject < JavaIoSerializable > {
}
- (instancetype)init;
- (void)<API key>:(JavaLangThread *)t;
- (JavaLangThread *)<API key>;
@end
<API key>(<API key>)
CF_EXTERN_C_BEGIN
<API key>(<API key>, serialVersionUID, jlong)
CF_EXTERN_C_END
<API key>(<API key>)
#endif // <API key>
|
using LKCamelot.library;
using LKCamelot.model;
namespace LKCamelot.script.item
{
public class EnamelLeather : BaseArmor
{
public override string Name { get { return "Enamel Leather"; } }
public override int DamBase { get { return 0; } }
public override int ACBase { get { return 101; } }
public override int StrReq { get { return 313; } }
public override int DexReq { get { return 90; } }
public override int InitMinHits { get { return 720; } }
public override int InitMaxHits { get { return 720; } }
public override Class ClassReq { get { return 0; } }
public override ArmorType ArmorType { get { return ArmorType.Armor; } }
public EnamelLeather() : base (5)
{
}
public EnamelLeather(Serial serial) : base (serial)
{
}
}
}
|
#ifndef BD_PARSE_H
#define BD_PARSE_H
#include<stdio.h>
#include<vector>
#include"platform_types.h"
#include <QObject>
#include <innovEngine_sdk.h>
#define MAX_PATH 260
#define MAX_FIELD_LENGTH 16
#define FIELD_BUFFER_LENGTH (MAX_FIELD_LENGTH + 1)
#define TIME_BAD_VALUE (UINT32)0xFFFFFFFFL
#define DATE_BAD_VALUE (UINT32)0xFFFFFFFFL
#define GPS_BADVALUE ( (INT32)0xFFFFFFFFL )
#define <API key> 3
using namespace std;
typedef struct TGPSBDRMC {
UINT32 sentence;
UINT32 utc;
char status;
INT32 latitude; // degrees x 10^5
INT32 longitude; // degrees x 10^5
INT32 speed; // x 10 ^ 4
INT32 heading; // x 10 ^ 4
UINT32 date;
} TGPSBDRMC;
typedef struct TGPSBDGGA {
UINT32 sentence;
UINT32 utc;
INT32 latitude; // degrees x 10^5
INT32 longitude; // degrees x 10^5
char quality;
UINT8 satellitesUsed;
INT32 altitude; // x 10^4
} TGPSBDGGA;
typedef struct TGPSBDGSA {
UINT32 sentence;
char mode;
UINT8 fixType;
UINT8 satellitesUsed;
UINT8 satelliteIDs[12];
INT32 pdop; // x 10^4
INT32 hdop; // x 10^4
INT32 vdop; // x 10^4
} TGPSBDGSA;
typedef struct TGPSBDGSV {
UINT32 sentence;
UINT8 satelliteCount;
//UINT8 prn[12];
//UINT8 elevation[12];
//UINT16 azimuth[12];
//UINT8 snr[12];
UINT8 prn[27];
UINT8 elevation[27];
UINT16 azimuth[27];
UINT8 snr[27];
UINT8 satelliteTracked;
} TGPSBDGSV;
/** Structure for maintaining internal traffic message state */
typedef struct BDTPTTKT {
TtmcMessageType lastMessage;
UINT8 tmcData[8];
UINT8 hardwarePresent;
UINT8 blockCount;
UINT8 tmcCount;
UINT8 errorRate;
UINT16 frequency;
UINT8 tuneStatus;
// for station list
UINT8 stnCount;
UINT8 stnIndex;
BOOL8 stnCurrent;
UINT16 stnFrequency;
UINT16 stnPI;
UINT8 stnSignal;
UINT8 stnFlag;
char stnName[20];
} BDTPTTKT;
class navcoreBDParse
{
public:
bool successParse ;
UINT32 utc;
INT32 latitude; // degrees x 10^5
INT32 longitude; // degrees x 10^5
INT32 speed; // x 10 ^ 4
INT32 heading; // x 10 ^ 4
UINT32 date;
UINT8 satellitesUsed;
int GPSStatlliteNum;
int BD2StatelliteNum;
bool effectiveGPS;
navcoreBDParse();
~navcoreBDParse();
void processBDSFile(char *logFile);
bool checkBDChecksum(char *sentence);
BOOL8 BD_processSentence(char *sentence);
void clear( void );
bool parseFile( );
private:
bool processBDGSV(const char *sentence);
bool processBDGGA(const char *sentence);
bool processBDGSA(const char *sentence);
bool processBDRMC(const char *sentence);
BOOL8 processPTTKT(const char *sentence);
const char *findNextField(const char *sentence);
UINT8 readField(char *dest, const char *sentence);
INT32 decodeTimeValue(const char *text);
INT32 decodeLatLong(const char *text);
INT32 decodeFloatValue(const char *text);
UINT8 hexToBinary (const char *hex);
INT32 decodeIntegerValue(const char *text);
void initBDGSV();
void initBDGGA();
void initBDGSA();
void initBDRMC();
private:
//set to true when the final BDGSV message is received
BOOL8 gps_Rx_BDGSV1;
BOOL8 gps_Rx_BDGSV2;
BOOL8 gps_Rx_BDGSV3;
//@MIC
BOOL8 gps_Rx_BDGSV4;
BOOL8 gps_Rx_BDGSV5;
BOOL8 gps_Rx_BDGSV6;
//@MIC
BOOL8 gps_fullBDGSV;
};
#endif // BD_PARSE_H
|
.button {
-fx-font-weight: bold;
}
.add {
-fx-color: YellowGreen ;
}
.del {
-fx-color: Tomato ;
}
|
package org.radargun.stages;
import org.radargun.CacheWrapper;
import org.radargun.DistStageAck;
import org.radargun.state.MasterState;
import org.radargun.stressors.PutGetStressor;
import org.radargun.stressors.StringKeyGenerator;
import org.radargun.utils.Utils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static java.lang.Double.parseDouble;
import static org.radargun.utils.Utils.numberFormat;
/**
* Simulates the work with a distributed web sessions.
*
* @author Mircea.Markus@jboss.com
*/
public class <API key> extends AbstractDistStage {
private static final String SIZE_INFO = "SIZE_INFO";
private int opsCountStatusLog = 5000;
public static final String SESSION_PREFIX = "SESSION";
/**
* total number of request to be made against this session: reads + writes
*/
private int numberOfRequests = 50000;
/**
* for each session there will be created fixed number of attributes. On those attributes all the GETs and PUTs are
* performed (for PUT is overwrite)
*/
private int numberOfAttributes = 100;
/**
* Each attribute will be a byte[] of this size
*/
private int sizeOfAnAttribute = 1000;
/**
* Out of the total number of request, this define the frequency of writes (percentage)
*/
private int writePercentage = 20;
/**
* the number of threads that will work on this slave
*/
private int numOfThreads = 10;
private boolean reportNanos = false;
private String keyGeneratorClass = StringKeyGenerator.class.getName();
protected CacheWrapper cacheWrapper;
private boolean useTransactions = false;
private boolean commitTransactions = true;
private int transactionSize = 1;
private long durationMillis = -1;
protected Map<String, String> doWork() {
log.info("Starting "+getClass().getSimpleName()+": " + this);
PutGetStressor putGetStressor = new PutGetStressor();
putGetStressor.setNodeIndex(getSlaveIndex());
putGetStressor.<API key>(numberOfAttributes);
putGetStressor.setNumberOfRequests(numberOfRequests);
putGetStressor.setNumOfThreads(numOfThreads);
putGetStressor.<API key>(opsCountStatusLog);
putGetStressor.<API key>(sizeOfAnAttribute);
putGetStressor.setWritePercentage(writePercentage);
putGetStressor.<API key>(keyGeneratorClass);
putGetStressor.setUseTransactions(useTransactions);
putGetStressor.<API key>(commitTransactions);
putGetStressor.setTransactionSize(transactionSize);
putGetStressor.setDurationMillis(durationMillis);
return putGetStressor.stress(cacheWrapper);
}
public DistStageAck executeOnSlave() {
DefaultDistStageAck result = new DefaultDistStageAck(slaveIndex, slaveState.getLocalAddress());
this.cacheWrapper = slaveState.getCacheWrapper();
if (cacheWrapper == null) {
log.info("Not running test on this slave as the wrapper hasn't been configured.");
return result;
}
try {
Map<String, String> results = doWork();
String sizeInfo = generateSizeInfo();
log.info(sizeInfo);
results.put(SIZE_INFO, sizeInfo);
result.setPayload(results);
return result;
} catch (Exception e) {
log.warn("Exception while initializing the test", e);
result.setError(true);
result.setRemoteException(e);
return result;
}
}
/**
* Important: do not change the format of rhe log below as is is used by ./dist.sh to measure distribution load.
*/
private String generateSizeInfo() {
return "size info: " + cacheWrapper.getInfo() + ", clusterSize:" + super.getActiveSlaveCount() + ", nodeIndex:" + super.getSlaveIndex() + ", cacheSize: " + cacheWrapper.size();
}
public boolean processAckOnMaster(List<DistStageAck> acks, MasterState masterState) {
logDurationInfo(acks);
boolean success = true;
Map<Integer, Map<String, Object>> results = new HashMap<Integer, Map<String, Object>>();
masterState.put("results", results);
for (DistStageAck ack : acks) {
DefaultDistStageAck wAck = (DefaultDistStageAck) ack;
if (wAck.isError()) {
success = false;
log.warn("Received error ack: " + wAck);
} else {
if (log.isTraceEnabled())
log.trace(wAck);
}
Map<String, Object> benchResult = (Map<String, Object>) wAck.getPayload();
if (benchResult != null) {
results.put(ack.getSlaveIndex(), benchResult);
Object reqPerSes = benchResult.get("REQ_PER_SEC");
if (reqPerSes == null) {
throw new <API key>("Requests per second should be present!");
}
<API key>(benchResult);
log.info("Slave #" + ack.getSlaveIndex() + ": " + numberFormat(parseDouble(reqPerSes.toString())) + " requests per second.");
} else {
log.trace("No report received from slave: " + ack.getSlaveIndex());
}
}
return success;
}
/**
* Important: don't change the format of the log below as it is used by ./dist.sh in order to count the load
* distribution in the cluster.
*/
private void <API key>(Map<String, Object> benchResult) {
log.info("Received " + benchResult.remove(SIZE_INFO));
}
public void setNumberOfRequests(int numberOfRequests) {
this.numberOfRequests = numberOfRequests;
}
public void <API key>(int numberOfAttributes) {
this.numberOfAttributes = numberOfAttributes;
}
public void <API key>(int sizeOfAnAttribute) {
this.sizeOfAnAttribute = sizeOfAnAttribute;
}
public void setNumOfThreads(int numOfThreads) {
this.numOfThreads = numOfThreads;
}
public void setReportNanos(boolean reportNanos) {
this.reportNanos = reportNanos;
}
public void setWritePercentage(int writePercentage) {
this.writePercentage = writePercentage;
}
public void <API key>(int opsCountStatusLog) {
this.opsCountStatusLog = opsCountStatusLog;
}
public String <API key>() {
return keyGeneratorClass;
}
public void <API key>(String keyGeneratorClass) {
this.keyGeneratorClass = keyGeneratorClass;
}
public int getTransactionSize() {
return transactionSize;
}
public void setTransactionSize(int transactionSize) {
this.transactionSize = transactionSize;
}
public boolean isUseTransactions() {
return useTransactions;
}
public void setUseTransactions(boolean useTransactions) {
this.useTransactions = useTransactions;
}
public boolean <API key>() {
return commitTransactions;
}
public void <API key>(boolean commitTransactions) {
this.commitTransactions = commitTransactions;
}
public long getDurationMillis() {
return durationMillis;
}
public void setDuration(String duration) {
this.durationMillis = Utils.string2Millis(duration);
}
@Override
public String toString() {
return "<API key> {" +
"opsCountStatusLog=" + opsCountStatusLog +
", numberOfRequests=" + numberOfRequests +
", numberOfAttributes=" + numberOfAttributes +
", sizeOfAnAttribute=" + sizeOfAnAttribute +
", writePercentage=" + writePercentage +
", numOfThreads=" + numOfThreads +
", reportNanos=" + reportNanos +
", cacheWrapper=" + cacheWrapper +
", useTransactions=" + useTransactions +
", commitTransactions=" + commitTransactions +
", transactionSize=" + transactionSize +
", durationMillis=" + durationMillis+
", " + super.toString();
}
}
|
<?php
namespace Phing\Task\System\Pdo;
use Exception;
use PDO;
use PDOException;
use PDOStatement;
use Phing\Exception\BuildException;
use Phing\Io\File;
use Phing\Io\IOException;
use Phing\Io\Reader;
use Phing\Project;
use Phing\Task\System\Condition\Condition;
use Phing\Type\Element\FileListAware;
use Phing\Type\Element\FileSetAware;
/**
* Executes a series of SQL statements on a database using PDO.
*
* <p>Statements can
* either be read in from a text file using the <i>src</i> attribute or from
* between the enclosing SQL tags.</p>
*
* <p>Multiple statements can be provided, separated by semicolons (or the
* defined <i>delimiter</i>). Individual lines within the statements can be
* commented using either --, // or REM at the start of the line.</p>
*
* <p>The <i>autocommit</i> attribute specifies whether auto-commit should be
* turned on or off whilst executing the statements. If auto-commit is turned
* on each statement will be executed and committed. If it is turned off the
* statements will all be executed as one transaction.</p>
*
* <p>The <i>onerror</i> attribute specifies how to proceed when an error occurs
* during the execution of one of the statements.
* The possible values are: <b>continue</b> execution, only show the error;
* <b>stop</b> execution and commit transaction;
* and <b>abort</b> execution and transaction and fail task.</p>
*
* This task can also be used as a Condition.
*
* @author Hans Lellelid <hans@xmpl.org> (Phing)
* @author Jeff Martin <jeff@custommonkey.org> (Ant)
* @author Michael McCallum <gholam@xtra.co.nz> (Ant)
* @author Tim Stephenson <tim.stephenson@sybase.com> (Ant)
*/
class PDOSQLExecTask extends PDOTask implements Condition
{
use FileListAware;
use FileSetAware;
public const DELIM_ROW = 'row';
public const DELIM_NORMAL = 'normal';
public const DELIM_NONE = 'none';
/**
* Count of how many statements were executed successfully.
*
* @var int
*/
private $goodSql = 0;
/**
* Count of total number of SQL statements.
*
* @var int
*/
private $totalSql = 0;
/**
* Database connection.
*
* @var PDO
*/
private $conn;
/**
* Formatter elements.
*
* @var <API key>[]
*/
private $formatters = [];
/**
* SQL statement.
*
* @var PDOStatement
*/
private $statement;
/**
* SQL input file.
*
* @var File
*/
private $srcFile;
/**
* SQL input command.
*
* @var string
*/
private $sqlCommand = '';
/**
* SQL transactions to perform.
*/
private $transactions = [];
/**
* SQL Statement delimiter (for parsing files).
*
* @var string
*/
private $delimiter = ';';
/**
* The delimiter type indicating whether the delimiter will
* only be recognized on a line by itself.
*/
private $delimiterType = self::DELIM_NONE;
/**
* Action to perform if an error is found.
*/
private $onError = 'abort';
/**
* Encoding to use when reading SQL statements from a file.
*/
private $encoding;
/**
* Fetch mode for PDO select queries.
*
* @var int
*/
private $fetchMode;
/**
* The name of the property to set in the event of an error
*/
private $errorProperty;
/**
* The name of the property that receives the number of rows
* returned
*/
private $<API key>;
/**
* @var bool
*/
private $keepformat = false;
/**
* @var bool
*/
private $expandProperties = true;
/**
* Set the name of the SQL file to be run.
* Required unless statements are enclosed in the build file.
*/
public function setSrc(File $srcFile): void
{
$this->srcFile = $srcFile;
}
/**
* Set an inline SQL command to execute.
* NB: Properties are not expanded in this text.
*
* @param string $sql
*/
public function addText($sql): void
{
$this->sqlCommand .= $sql;
}
/**
* Creates a new <API key> for <formatter> element.
*
* @return <API key>
*/
public function createFormatter(): <API key>
{
$fe = new <API key>($this);
$this->formatters[] = $fe;
return $fe;
}
/**
* Add a SQL transaction to execute.
*/
public function createTransaction()
{
$t = new <API key>($this);
$this->transactions[] = $t;
return $t;
}
/**
* Set the statement delimiter.
*
* <p>For example, set this to "go" and delimitertype to "ROW" for
* Sybase ASE or MS SQL Server.</p>
*/
public function setDelimiter(string $delimiter): void
{
$this->delimiter = $delimiter;
}
/**
* Get the statement delimiter.
*/
public function getDelimiter(): string
{
return $this->delimiter;
}
/**
* Set the Delimiter type for this sql task. The delimiter type takes two
* values - normal and row. Normal means that any occurrence of the delimiter
* terminate the SQL command whereas with row, only a line containing just
* the delimiter is recognized as the end of the command.
*/
public function setDelimiterType(string $delimiterType): void
{
$this->delimiterType = $delimiterType;
}
/**
* Action to perform when statement fails: continue, stop, or abort
* optional; default "abort".
*
* @param string $action continue|stop|abort
*/
public function setOnerror($action): void
{
$this->onError = $action;
}
/**
* Sets the fetch mode to use for the PDO resultset.
*
* @param mixed $mode the PDO fetchmode int or constant name
*
* @throws BuildException
*/
public function setFetchmode($mode): void
{
if (is_numeric($mode)) {
$this->fetchMode = (int) $mode;
} else {
if (defined($mode)) {
$this->fetchMode = constant($mode);
} else {
throw new BuildException('Invalid PDO fetch mode specified: ' . $mode, $this->getLocation());
}
}
}
public function getGoodSQL()
{
return $this->goodSql;
}
/**
* Property to set to "true" if a statement throws an error.
*
* @param string $errorProperty the name of the property to set in the
* event of an error.
*/
public function setErrorProperty(string $errorProperty): void
{
$this->errorProperty = $errorProperty;
}
/**
* Sets a given property to the number of statements processed.
* @param string $<API key> String
*/
public function <API key>(string $<API key>): void
{
$this-><API key> = $<API key>;
}
public function setKeepformat(bool $keepformat): void
{
$this->keepformat = $keepformat;
}
public function setExpandProperties(bool $expandProps): void
{
$this->expandProperties = $expandProps;
}
/**
* Load the sql file and then execute it.
*
* {@inheritdoc}
*
* @throws BuildException
*/
public function main()
{
// Set a default fetchmode if none was specified
// (We're doing that here to prevent errors loading the class is PDO is not available.)
if (null === $this->fetchMode) {
$this->fetchMode = PDO::FETCH_ASSOC;
}
// Initialize the formatters here. This ensures that any parameters passed to the formatter
// element get passed along to the actual formatter object
foreach ($this->formatters as $fe) {
$fe->prepare($this->getLocation());
}
$savedTransaction = [];
for ($i = 0, $size = count($this->transactions); $i < $size; ++$i) {
$savedTransaction[] = clone $this->transactions[$i];
}
$savedSqlCommand = $this->sqlCommand;
$this->sqlCommand = trim($this->sqlCommand);
try {
if (
null === $this->srcFile
&& '' === $this->sqlCommand
&& empty($this->filesets)
&& empty($this->filelists)
&& 0 === count($this->transactions)
) {
throw new BuildException(
'Source file or fileset/filelist, '
. 'transactions or sql statement '
. 'must be set!',
$this->getLocation()
);
}
if (null !== $this->srcFile && !$this->srcFile->exists()) {
throw new BuildException('Source file does not exist!', $this->getLocation());
}
// deal with the filesets
foreach ($this->filesets as $fs) {
$ds = $fs->getDirectoryScanner($this->project);
$srcDir = $fs->getDir($this->project);
$srcFiles = $ds->getIncludedFiles();
// Make a transaction for each file
foreach ($srcFiles as $srcFile) {
$t = $this->createTransaction();
$t->setSrc(new File($srcDir, $srcFile));
}
}
// process filelists
foreach ($this->filelists as $fl) {
$srcDir = $fl->getDir($this->project);
$srcFiles = $fl->getFiles($this->project);
// Make a transaction for each file
foreach ($srcFiles as $srcFile) {
$t = $this->createTransaction();
$t->setSrc(new File($srcDir, $srcFile));
}
}
// Make a transaction group for the outer command
$t = $this->createTransaction();
if ($this->srcFile) {
$t->setSrc($this->srcFile);
}
$t->addText($this->sqlCommand);
$this->conn = $this->getConnection();
if ($this->conn === null) {
return;
}
try {
$this->statement = null;
// Initialize the formatters.
$this->initFormatters();
try {
// Process all transactions
for ($i = 0, $size = count($this->transactions); $i < $size; ++$i) {
if (!$this->isAutocommit() || $this->conn->inTransaction()) {
$this->log('Beginning transaction', Project::MSG_VERBOSE);
$this->conn->beginTransaction();
}
$this->transactions[$i]->runTransaction();
if (!$this->isAutocommit() || $this->conn->inTransaction()) {
$this->log('Committing transaction', Project::MSG_VERBOSE);
$this->conn->commit();
}
}
} catch (Exception $e) {
$this->closeConnection();
throw new BuildException($e);
}
} catch (IOException | PDOException $e) {
$this->closeQuietly();
$this->setErrorProp();
if ('abort' === $this->onError) {
throw new BuildException($e->getMessage(), $this->getLocation());
}
}
// Close the formatters.
$this->closeFormatters();
$this->log(
$this->goodSql . ' of ' . $this->totalSql .
' SQL statements executed successfully'
);
$this-><API key>($this->goodSql);
} catch (Exception $e) {
throw new BuildException($e);
} finally {
$this->transactions = $savedTransaction;
$this->sqlCommand = $savedSqlCommand;
$this->closeConnection();
}
}
/**
* read in lines and execute them.
*
* @throws BuildException
*/
public function runStatements(Reader $reader): void
{
if (self::DELIM_NONE === $this->delimiterType) {
$splitter = new <API key>($this, $reader);
} elseif (self::DELIM_NORMAL === $this->delimiterType && 0 === strpos((string) $this->getUrl(), 'pgsql:')) {
$splitter = new <API key>($this, $reader);
} else {
$splitter = new <API key>($this, $reader, $this->delimiterType);
}
$splitter->setExpandProperties($this->expandProperties);
$splitter->setKeepformat($this->keepformat);
try {
while (null !== ($query = $splitter->nextQuery())) {
$this->log('SQL: ' . $query, Project::MSG_VERBOSE);
$this->execSQL($query);
}
} catch (PDOException $e) {
throw new BuildException($e);
}
}
/**
* PDOSQLExecTask as condition.
*
* Returns false when the database connection fails, and true otherwise.
* This method only uses three properties: url (required), userId and
* password.
*
* The database connection is not stored in a variable, this allow to
* immediately close the connections since there's no reference to it.
*
* @author Jawira Portugal <dev@tugal.be>
*/
public function evaluate(): bool
{
if (empty($this->getUrl())) {
throw new BuildException('url is required');
}
$this->log('Trying to reach ' . $this->getUrl(), Project::MSG_DEBUG);
try {
new PDO($this->getUrl(), $this->getUserId(), $this->getPassword());
} catch (PDOException $ex) {
$this->log($ex->getMessage(), Project::MSG_VERBOSE);
return false;
}
$this->log('Successful connection to ' . $this->getUrl(), Project::MSG_DEBUG);
return true;
}
/**
* Whether the passed-in SQL statement is a SELECT statement.
* This does a pretty simple match, checking to see if statement starts with
* 'select' (but not 'select into').
*
* @param string $sql
*
* @return bool whether specified SQL looks like a SELECT query
*/
protected function isSelectSql($sql): bool
{
$sql = trim($sql);
return 0 === stripos($sql, 'select') && 0 !== stripos($sql, 'select into ');
}
/**
* Exec the sql statement.
*
* @param string $sql
*
* @throws BuildException
*/
protected function execSQL($sql): void
{
// Check and ignore empty statements
if (empty(trim($sql))) {
return;
}
try {
++$this->totalSql;
$this->statement = $this->conn->query($sql);
// only call processResults() for statements that return actual data (such as 'select')
if ($this->statement->columnCount() > 0) {
$this->processResults();
}
$this->statement->closeCursor();
$this->statement = null;
++$this->goodSql;
} catch (PDOException $e) {
$this->log('Failed to execute: ' . $sql, Project::MSG_ERR);
$this->setErrorProp();
if ('abort' !== $this->onError) {
$this->log((string) $e, Project::MSG_ERR);
}
if ('continue' !== $this->onError) {
throw new BuildException('Failed to execute SQL', $e);
}
$this->log($e->getMessage(), Project::MSG_ERR);
}
}
/**
* Returns configured PDOResultFormatter objects
* (which were created from <API key> objects).
*
* @return PDOResultFormatter[]
*/
protected function <API key>(): array
{
$formatters = [];
foreach ($this->formatters as $fe) {
$formatter = $fe->getFormatter();
if ($formatter instanceof <API key>) {
$formatter->setStatementCounter($this->goodSql);
}
$formatters[] = $formatter;
}
return $formatters;
}
/**
* Initialize the formatters.
*/
protected function initFormatters(): void
{
$formatters = $this-><API key>();
foreach ($formatters as $formatter) {
$formatter->initialize();
}
}
/**
* Run cleanup and close formatters.
*/
protected function closeFormatters(): void
{
$formatters = $this-><API key>();
foreach ($formatters as $formatter) {
$formatter->close();
}
}
/**
* Passes results from query to any formatters.
*
* @throws PDOException
*/
protected function processResults(): void
{
$this->log('Processing new result set.', Project::MSG_VERBOSE);
$formatters = $this-><API key>();
try {
while ($row = $this->statement->fetch($this->fetchMode)) {
foreach ($formatters as $formatter) {
$formatter->processRow($row);
}
}
} catch (Exception $x) {
$this->log('Error processing results: ' . $x->getMessage(), Project::MSG_ERR);
foreach ($formatters as $formatter) {
$formatter->close();
}
throw new BuildException($x);
}
}
/**
* Closes current connection.
*/
protected function closeConnection(): void
{
if ($this->conn) {
unset($this->conn);
$this->conn = null;
}
}
final protected function setErrorProp(): void
{
$this->setProperty($this->errorProperty, 'true');
}
final protected function <API key>(int $statementCount): void
{
$this->setProperty($this-><API key>, (string) $statementCount);
}
/**
* @param string|null $name
* @param string $value
*/
private function setProperty(?string $name, string $value): void
{
if ($name !== null) {
$this->getProject()->setNewProperty($name, $value);
}
}
/**
* Closes an unused connection after an error and doesn't rethrow
* a possible PDOException
*/
private function closeQuietly(): void
{
if (null !== $this->conn && 'abort' === $this->onError && !$this->isAutocommit()) {
try {
$this->conn->rollback();
} catch (PDOException $ex) {
}
}
$this->closeConnection();
}
}
|
'use strict';
angular.module('gumga.translate.filter', ['gumga.translate.filter.filter'])
|
package org.datacleaner.connection;
import java.util.Arrays;
import junit.framework.TestCase;
public class <API key> extends TestCase {
public void <API key>() throws Exception {
final MongoDbDatastore ds1 = new MongoDbDatastore("mongo", "localhost", 27017, "db", "user", "pw");
final MongoDbDatastore ds2 = new MongoDbDatastore("mongo", null, null, "db", "user", "pw");
assertEquals(ds1, ds2);
assertEquals("localhost", ds1.getHostname());
assertEquals(27017, ds1.getPort());
assertEquals("db", ds1.getDatabaseName());
assertEquals("mongo", ds1.getName());
assertEquals("user", ds1.getUsername());
assertEquals("[p, w]", Arrays.toString(ds1.getPassword()));
assertEquals(null, ds1.getTableDefs());
assertTrue(ds1.<API key>().<API key>());
}
}
|
/* Listing 57-3 */
#include "us_xfr.h"
#define BACKLOG 5
int
main(int argc, char *argv[])
{
struct sockaddr_un addr;
int sfd, cfd;
ssize_t numRead;
char buf[BUF_SIZE];
sfd = socket(AF_UNIX, SOCK_STREAM, 0);
if (sfd == -1)
errExit("socket");
/* Construct server socket address, bind socket to it,
and make this a listening socket */
if (remove(SV_SOCK_PATH) == -1 && errno != ENOENT)
errExit("remove-%s", SV_SOCK_PATH);
memset(&addr, 0, sizeof(struct sockaddr_un));
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, SV_SOCK_PATH, sizeof(addr.sun_path) - 1);
if (bind(sfd, (struct sockaddr *) &addr, sizeof(struct sockaddr_un)) == -1)
errExit("bind");
if (listen(sfd, BACKLOG) == -1)
errExit("listen");
for (;;) { /* Handle client connections iteratively */
/* Accept a connection. The connection is returned on a new
socket, 'cfd'; the listening socket ('sfd') remains open
and can be used to accept further connections. */
cfd = accept(sfd, NULL, 0);
if (cfd == -1)
errExit("accept");
/* Transfer data from connected socket to stdout until EOF */
while ((numRead = read(cfd, buf, BUF_SIZE)) > 0)
if (write(STDOUT_FILENO, buf, numRead) != numRead)
fatal("partial/failed write");
if (numRead == -1)
errExit("read");
if (close(cfd) == -1)
errMsg("close");
}
}
|
html {
-<API key>: 100%;
-ms-text-size-adjust: 100%;
}
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-<API key>: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}
.syntaxhighlighter {
background-color: #222222 !important;
}
.syntaxhighlighter .line.alt1 {
background-color: #222222 !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #222222 !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #253e5a !important;
}
.syntaxhighlighter .line.highlighted.number {
color: white !important;
}
.syntaxhighlighter table caption {
color: lime !important;
}
.syntaxhighlighter .gutter {
color: #38566f !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #435a5f !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #435a5f !important;
color: #222222 !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: #428bdd !important;
background: black !important;
border: 1px solid #435a5f !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: #428bdd !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: lime !important;
}
.syntaxhighlighter .toolbar {
color: #aaaaff !important;
background: #435a5f !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: #aaaaff !important;
}
.syntaxhighlighter .toolbar a:hover {
color: #9ccff4 !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: lime !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #428bdd !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: lime !important;
}
.syntaxhighlighter .keyword {
color: #aaaaff !important;
}
.syntaxhighlighter .preprocessor {
color: #8aa6c1 !important;
}
.syntaxhighlighter .variable {
color: aqua !important;
}
.syntaxhighlighter .value {
color: #f7e741 !important;
}
.syntaxhighlighter .functions {
color: #ff8000 !important;
}
.syntaxhighlighter .constants {
color: yellow !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #aaaaff !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: red !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: yellow !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: #ffaa3e !important;
}
|
#include "core/ActionPilot.h"
#include "core/ActionRegister.h"
#include "<API key>.h"
#include "AdjacencyMatrixBase.h"
#include "core/PlumedMain.h"
#include "core/ActionSet.h"
#include "tools/OFile.h"
namespace PLMD {
namespace adjmat {
//+PLUMEDOC CONCOMP DUMPGRAPH
/*
Write out the connectivity of the nodes in the graph in dot format.
\par Examples
*/
//+ENDPLUMEDOC
class DumpGraph : public ActionPilot {
private:
unsigned maxconnections;
The vessel that contains the graph
<API key>* mymatrix;
The name of the file on which we are outputting the graph
std::string filename;
public:
Create manual
static void registerKeywords( Keywords& keys );
Constructor
explicit DumpGraph( const ActionOptions& );
Calculate and apply do nothing
void calculate() override {};
void apply() override {};
Update will do the output
void update() override;
};
<API key>(DumpGraph,"DUMPGRAPH")
void DumpGraph::registerKeywords( Keywords& keys ) {
Action::registerKeywords( keys ); ActionPilot::registerKeywords( keys );
keys.add("compulsory","MATRIX","the action that calculates the adjacency matrix vessel we would like to analyze");
keys.add("compulsory","STRIDE","1","the frequency with which you would like to output the graph");
keys.add("compulsory","FILE","the name of the file on which to output the data");
keys.add("compulsory","MAXCONNECT","0","maximum number of connections that can be formed by any given node in the graph. "
"By default this is set equal to zero and the number of connections is set equal to the number "
"of nodes. You only really need to set this if you are working with a very large system and "
"memory is at a premium");
}
DumpGraph::DumpGraph( const ActionOptions& ao):
Action(ao),
ActionPilot(ao),
mymatrix(NULL)
{
parse("MAXCONNECT",maxconnections); std::string mstring; parse("MATRIX",mstring);
AdjacencyMatrixBase* mm = plumed.getActionSet().selectWithLabel<AdjacencyMatrixBase*>( mstring );
if( !mm ) error("found no action in set with label " + mstring + " that calculates matrix");
log.printf(" printing graph for matrix calculated by action %s\n", mm->getLabel().c_str() );
// Retrieve the adjacency matrix of interest
for(unsigned i=0; i<mm->getNumberOfVessels(); ++i) {
mymatrix = dynamic_cast<<API key>*>( mm->getPntrToVessel(i) );
if( mymatrix ) break ;
}
if( !mymatrix ) error( mm->getLabel() + " does not calculate an adjacency matrix");
if( !mymatrix->isSymmetric() ) error("input contact matrix must be symmetric");
if( maxconnections==0 ) maxconnections=mymatrix->getNumberOfRows();
parse("FILE",filename);
log.printf(" printing graph to file named %s \n",filename.c_str() );
checkRead();
}
void DumpGraph::update() {
OFile ofile; ofile.link(*this); ofile.setBackupString("graph");
ofile.open( filename ); ofile.printf("graph G { \n");
// Print all nodes
for(unsigned i=0; i<mymatrix->getNumberOfRows(); ++i) ofile.printf("%u [label=\"%u\"];\n",i,i);
// Now retrieve connectivitives
unsigned nedge; std::vector<std::pair<unsigned,unsigned> > edge_list( mymatrix->getNumberOfRows()*maxconnections );
mymatrix->retrieveEdgeList( nedge, edge_list );
for(unsigned i=0; i<nedge; ++i) ofile.printf("%u -- %u \n", edge_list[i].first, edge_list[i].second );
ofile.printf("} \n");
}
}
}
|
// This file is part of FiVES.
// FiVES is free software: you can redistribute it and/or modify
// the Free Software Foundation (LGPL v3)
// FiVES is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
using System;
using System.Collections.Generic;
namespace ServerSyncPlugin
{
<summary>
The ServerSync plugin interface.
</summary>
public interface IServerSync
{
<summary>
Collection of remote servers.
</summary>
IEnumerable<IRemoteServer> RemoteServers { get; }
<summary>
Local server.
</summary>
ILocalServer LocalServer { get; }
<summary>
Should be called when plugin shuts down. Closes all existing connection
</summary>
void ShutDown();
<summary>
Triggered when a remote server is added to the RemoteServers collection.
</summary>
event EventHandler<ServerEventArgs> AddedServer;
<summary>
Triggered when a remote server is removed from the RemoteServers collection.
</summary>
event EventHandler<ServerEventArgs> RemovedServer;
}
}
|
<?php
$parser = new \CoreTyson\<API key>\Parser\MoFileParser();
var_dump($parser->parse(ROOT.'/test/testApp/Locale/general.mo'));
|
#include "cgm/TextElement.h"
NITFPRIV(void) textPrint(NITF_DATA* data)
{
cgm_TextElement* text = (cgm_TextElement*)data;
if (text->attributes)
<API key>( text->attributes );
printf("\tText: ");
if (text->text)
cgm_Text_print(text->text);
}
NITFPRIV(void) textDestroy(NITF_DATA* data)
{
/* TODO!! */
cgm_TextElement* text = (cgm_TextElement*)data;
if (text->attributes)
<API key>( &(text->attributes) );
if (text->text)
{
cgm_Text_destruct( &(text->text) );
}
NITF_FREE(data);
}
NITFPRIV(cgm_Element*) textClone(NITF_DATA* data, nitf_Error* error)
{
cgm_TextElement *source = NULL, *dest = NULL;
cgm_Element* element = NULL;
assert(data);
source = (cgm_TextElement*)data;
element = <API key>(error);
if (!element)
return NULL;
dest = (cgm_TextElement*)element->data;
if ((dest != NULL) && (source != NULL))
{
if (source->attributes)
{
dest->attributes = <API key>(source->attributes, error);
if (!dest->attributes)
{
<API key>(&element);
return NULL;
}
}
if (source->text)
{
dest->text = cgm_Text_clone(source->text, error);
if (!dest->text)
{
<API key>(&element);
return NULL;
}
}
}
return element;
}
NITFAPI(cgm_Element*) <API key>(nitf_Error* error)
{
cgm_Element* element = <API key>(CGM_TEXT_ELEMENT, error);
if (element)
{
cgm_TextElement* text = (cgm_TextElement*)
NITF_MALLOC(sizeof(cgm_TextElement));
if (!text)
{
NITF_FREE(element);
return NULL;
}
text->attributes = NULL;
text->text = NULL;
element->data = (NITF_DATA*)text;
element->print = &textPrint;
element->clone = &textClone;
element->destroy = &textDestroy;
}
return element;
}
|
package orgomg.cwm.analysis.transformation;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import orgomg.cwm.foundation.softwaredeployment.<API key>;
import orgomg.cwm.objectmodel.core.CorePackage;
public interface <API key> extends EPackage {
/**
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNAME = "transformation";
/**
* The package namespace URI.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_URI = "http:///orgomg/cwm/analysis/transformation.ecore";
/**
* The package namespace name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_PREFIX = "orgomg.cwm.analysis.transformation";
/**
* The singleton instance of the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
<API key> eINSTANCE = orgomg.cwm.analysis.transformation.impl.<API key>.init();
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.TransformationImpl <em>Transformation</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.TransformationImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getTransformation()
* @generated
*/
int TRANSFORMATION = 0;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.NAMESPACE__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.NAMESPACE__IMPORTER;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.NAMESPACE__DOCUMENT;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int TRANSFORMATION__SET = CorePackage.NAMESPACE__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Owned Element</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Function</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The feature id for the '<em><b>Function Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 1;
/**
* The feature id for the '<em><b>Is Primary</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 2;
/**
* The feature id for the '<em><b>Source</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 3;
/**
* The feature id for the '<em><b>Target</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 4;
/**
* The feature id for the '<em><b>Task</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 5;
/**
* The number of structural features of the '<em>Transformation</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 6;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.DataObjectSetImpl <em>Data Object Set</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.DataObjectSetImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getDataObjectSet()
* @generated
*/
int DATA_OBJECT_SET = 1;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.MODEL_ELEMENT__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.MODEL_ELEMENT__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Source Transformation</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The feature id for the '<em><b>Target Transformation</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 1;
/**
* The feature id for the '<em><b>Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 2;
/**
* The number of structural features of the '<em>Data Object Set</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 3;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Task</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
int TRANSFORMATION_TASK = 2;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.COMPONENT__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.COMPONENT__IMPORTER;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.COMPONENT__DOCUMENT;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.COMPONENT__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Owned Element</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Is Abstract</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Feature</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.COMPONENT__FEATURE;
/**
* The feature id for the '<em><b>Structural Feature</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Parameter</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Generalization</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Specialization</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Instance</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.COMPONENT__INSTANCE;
/**
* The feature id for the '<em><b>Alias</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.COMPONENT__ALIAS;
/**
* The feature id for the '<em><b>Expression Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Mapping From</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Mapping To</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Classifier Map</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Cf Map</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.COMPONENT__CF_MAP;
/**
* The feature id for the '<em><b>Deployment</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key>;
/**
* The feature id for the '<em><b>Step</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key> + 0;
/**
* The feature id for the '<em><b>Original Task</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key> + 1;
/**
* The feature id for the '<em><b>Inverse Task</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key> + 2;
/**
* The feature id for the '<em><b>Transformation</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key> + 3;
/**
* The number of structural features of the '<em>Task</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>.<API key> + 4;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Step</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
int TRANSFORMATION_STEP = 3;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.MODEL_ELEMENT__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.MODEL_ELEMENT__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Task</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The feature id for the '<em><b>Warehouse Step</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 1;
/**
* The feature id for the '<em><b>Execution</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 2;
/**
* The number of structural features of the '<em>Step</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 3;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Activity</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
int <API key> = 4;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.SUBSYSTEM__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.SUBSYSTEM__IMPORTER;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.SUBSYSTEM__DOCUMENT;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.SUBSYSTEM__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Owned Element</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Is Abstract</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Feature</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.SUBSYSTEM__FEATURE;
/**
* The feature id for the '<em><b>Structural Feature</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Parameter</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Generalization</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Specialization</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Instance</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.SUBSYSTEM__INSTANCE;
/**
* The feature id for the '<em><b>Alias</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.SUBSYSTEM__ALIAS;
/**
* The feature id for the '<em><b>Expression Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Mapping From</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Mapping To</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Classifier Map</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Cf Map</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.SUBSYSTEM__CF_MAP;
/**
* The feature id for the '<em><b>Imported Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Data Manager</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Creation Date</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The feature id for the '<em><b>Warehouse Activity</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 1;
/**
* The feature id for the '<em><b>Execution</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 2;
/**
* The number of structural features of the '<em>Activity</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 3;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Precedence Constraint</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
int <API key> = 5;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.CONSTRAINT__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.CONSTRAINT__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Body</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.CONSTRAINT__BODY;
/**
* The feature id for the '<em><b>Constrained Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constrained Stereotype</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The number of structural features of the '<em>Precedence Constraint</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Use</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
int TRANSFORMATION_USE = 6;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.DEPENDENCY__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.DEPENDENCY__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Kind</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.DEPENDENCY__KIND;
/**
* The feature id for the '<em><b>Client</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.DEPENDENCY__CLIENT;
/**
* The feature id for the '<em><b>Supplier</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Type</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The number of structural features of the '<em>Use</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 1;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Map</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
int TRANSFORMATION_MAP = 7;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = TRANSFORMATION__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Owned Element</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Function</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Function Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Is Primary</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Source</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Target</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Task</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The number of structural features of the '<em>Map</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key> + 0;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Tree</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
int TRANSFORMATION_TREE = 8;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = TRANSFORMATION__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Owned Element</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Function</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Function Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Is Primary</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Source</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Target</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Task</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key>;
/**
* The feature id for the '<em><b>Type</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key> + 0;
/**
* The feature id for the '<em><b>Body</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key> + 1;
/**
* The number of structural features of the '<em>Tree</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = <API key> + 2;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.ClassifierMapImpl <em>Classifier Map</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.ClassifierMapImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getClassifierMap()
* @generated
*/
int CLASSIFIER_MAP = 9;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.NAMESPACE__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.NAMESPACE__IMPORTER;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.NAMESPACE__DOCUMENT;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CLASSIFIER_MAP__SET = CorePackage.NAMESPACE__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Owned Element</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Function</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The feature id for the '<em><b>Function Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 1;
/**
* The feature id for the '<em><b>Feature Map</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 2;
/**
* The feature id for the '<em><b>Cf Map</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 3;
/**
* The feature id for the '<em><b>Source</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 4;
/**
* The number of structural features of the '<em>Classifier Map</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 5;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.FeatureMapImpl <em>Feature Map</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.FeatureMapImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getFeatureMap()
* @generated
*/
int FEATURE_MAP = 10;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int FEATURE_MAP__NAME = CorePackage.MODEL_ELEMENT__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int FEATURE_MAP__SET = CorePackage.MODEL_ELEMENT__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Function</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The feature id for the '<em><b>Function Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 1;
/**
* The feature id for the '<em><b>Classifier Map</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 2;
/**
* The feature id for the '<em><b>Target</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int FEATURE_MAP__TARGET = CorePackage.<API key> + 3;
/**
* The number of structural features of the '<em>Feature Map</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 4;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.StepPrecedenceImpl <em>Step Precedence</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.StepPrecedenceImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getStepPrecedence()
* @generated
*/
int STEP_PRECEDENCE = 11;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.DEPENDENCY__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.DEPENDENCY__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Kind</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.DEPENDENCY__KIND;
/**
* The feature id for the '<em><b>Client</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.DEPENDENCY__CLIENT;
/**
* The feature id for the '<em><b>Supplier</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The number of structural features of the '<em>Step Precedence</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Classifier Feature Map</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
int <API key> = 12;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.MODEL_ELEMENT__NAME;
/**
* The feature id for the '<em><b>Visibility</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Client Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Supplier Dependency</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Constraint</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Namespace</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Importer</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Stereotype</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Tagged Value</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Document</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Description</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Responsible Party</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Element Node</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Set</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.MODEL_ELEMENT__SET;
/**
* The feature id for the '<em><b>Rendered Object</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Vocabulary Element</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Measurement</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Change Request</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key>;
/**
* The feature id for the '<em><b>Function</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 0;
/**
* The feature id for the '<em><b>Function Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 1;
/**
* The feature id for the '<em><b>Classifier To Feature</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 2;
/**
* The feature id for the '<em><b>Classifier Map</b></em>' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 3;
/**
* The feature id for the '<em><b>Classifier</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 4;
/**
* The feature id for the '<em><b>Feature</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 5;
/**
* The number of structural features of the '<em>Classifier Feature Map</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int <API key> = CorePackage.<API key> + 6;
/**
* The meta object id for the '{@link orgomg.cwm.analysis.transformation.TreeType <em>Tree Type</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.TreeType
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getTreeType()
* @generated
*/
int TREE_TYPE = 13;
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.Transformation <em>Transformation</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Transformation</em>'.
* @see orgomg.cwm.analysis.transformation.Transformation
* @generated
*/
EClass getTransformation();
/**
* Returns the meta object for the containment reference '{@link orgomg.cwm.analysis.transformation.Transformation#getFunction <em>Function</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Function</em>'.
* @see orgomg.cwm.analysis.transformation.Transformation#getFunction()
* @see #getTransformation()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the attribute '{@link orgomg.cwm.analysis.transformation.Transformation#<API key> <em>Function Description</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Function Description</em>'.
* @see orgomg.cwm.analysis.transformation.Transformation#<API key>()
* @see #getTransformation()
* @generated
*/
EAttribute <API key>();
/**
* Returns the meta object for the attribute '{@link orgomg.cwm.analysis.transformation.Transformation#isIsPrimary <em>Is Primary</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Is Primary</em>'.
* @see orgomg.cwm.analysis.transformation.Transformation#isIsPrimary()
* @see #getTransformation()
* @generated
*/
EAttribute <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.Transformation#getSource <em>Source</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Source</em>'.
* @see orgomg.cwm.analysis.transformation.Transformation#getSource()
* @see #getTransformation()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.Transformation#getTarget <em>Target</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Target</em>'.
* @see orgomg.cwm.analysis.transformation.Transformation#getTarget()
* @see #getTransformation()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.Transformation#getTask <em>Task</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Task</em>'.
* @see orgomg.cwm.analysis.transformation.Transformation#getTask()
* @see #getTransformation()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.DataObjectSet <em>Data Object Set</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Data Object Set</em>'.
* @see orgomg.cwm.analysis.transformation.DataObjectSet
* @generated
*/
EClass getDataObjectSet();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.DataObjectSet#<API key> <em>Source Transformation</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Source Transformation</em>'.
* @see orgomg.cwm.analysis.transformation.DataObjectSet#<API key>()
* @see #getDataObjectSet()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.DataObjectSet#<API key> <em>Target Transformation</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Target Transformation</em>'.
* @see orgomg.cwm.analysis.transformation.DataObjectSet#<API key>()
* @see #getDataObjectSet()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.DataObjectSet#getElement <em>Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Element</em>'.
* @see orgomg.cwm.analysis.transformation.DataObjectSet#getElement()
* @see #getDataObjectSet()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.TransformationTask <em>Task</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Task</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationTask
* @generated
*/
EClass <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.TransformationTask#getStep <em>Step</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Step</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationTask#getStep()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.TransformationTask#getOriginalTask <em>Original Task</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Original Task</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationTask#getOriginalTask()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.TransformationTask#getInverseTask <em>Inverse Task</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Inverse Task</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationTask#getInverseTask()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.TransformationTask#getTransformation <em>Transformation</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Transformation</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationTask#getTransformation()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.TransformationStep <em>Step</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Step</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationStep
* @generated
*/
EClass <API key>();
/**
* Returns the meta object for the reference '{@link orgomg.cwm.analysis.transformation.TransformationStep#getTask <em>Task</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Task</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationStep#getTask()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.TransformationStep#getWarehouseStep <em>Warehouse Step</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Warehouse Step</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationStep#getWarehouseStep()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.TransformationStep#getExecution <em>Execution</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Execution</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationStep#getExecution()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.<API key> <em>Activity</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Activity</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>
* @generated
*/
EClass <API key>();
/**
* Returns the meta object for the attribute '{@link orgomg.cwm.analysis.transformation.<API key>#getCreationDate <em>Creation Date</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Creation Date</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>#getCreationDate()
* @see #<API key>()
* @generated
*/
EAttribute <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.<API key>#<API key> <em>Warehouse Activity</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Warehouse Activity</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>#<API key>()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.<API key>#getExecution <em>Execution</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Execution</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>#getExecution()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.<API key> <em>Precedence Constraint</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Precedence Constraint</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>
* @generated
*/
EClass <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.TransformationUse <em>Use</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Use</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationUse
* @generated
*/
EClass <API key>();
/**
* Returns the meta object for the attribute '{@link orgomg.cwm.analysis.transformation.TransformationUse#getType <em>Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Type</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationUse#getType()
* @see #<API key>()
* @generated
*/
EAttribute <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.TransformationMap <em>Map</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Map</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationMap
* @generated
*/
EClass <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.TransformationTree <em>Tree</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Tree</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationTree
* @generated
*/
EClass <API key>();
/**
* Returns the meta object for the attribute '{@link orgomg.cwm.analysis.transformation.TransformationTree#getType <em>Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Type</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationTree#getType()
* @see #<API key>()
* @generated
*/
EAttribute <API key>();
/**
* Returns the meta object for the containment reference '{@link orgomg.cwm.analysis.transformation.TransformationTree#getBody <em>Body</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Body</em>'.
* @see orgomg.cwm.analysis.transformation.TransformationTree#getBody()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.ClassifierMap <em>Classifier Map</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Classifier Map</em>'.
* @see orgomg.cwm.analysis.transformation.ClassifierMap
* @generated
*/
EClass getClassifierMap();
/**
* Returns the meta object for the containment reference '{@link orgomg.cwm.analysis.transformation.ClassifierMap#getFunction <em>Function</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Function</em>'.
* @see orgomg.cwm.analysis.transformation.ClassifierMap#getFunction()
* @see #getClassifierMap()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the attribute '{@link orgomg.cwm.analysis.transformation.ClassifierMap#<API key> <em>Function Description</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Function Description</em>'.
* @see orgomg.cwm.analysis.transformation.ClassifierMap#<API key>()
* @see #getClassifierMap()
* @generated
*/
EAttribute <API key>();
/**
* Returns the meta object for the containment reference list '{@link orgomg.cwm.analysis.transformation.ClassifierMap#getFeatureMap <em>Feature Map</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Feature Map</em>'.
* @see orgomg.cwm.analysis.transformation.ClassifierMap#getFeatureMap()
* @see #getClassifierMap()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the containment reference list '{@link orgomg.cwm.analysis.transformation.ClassifierMap#getCfMap <em>Cf Map</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Cf Map</em>'.
* @see orgomg.cwm.analysis.transformation.ClassifierMap#getCfMap()
* @see #getClassifierMap()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.ClassifierMap#getSource <em>Source</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Source</em>'.
* @see orgomg.cwm.analysis.transformation.ClassifierMap#getSource()
* @see #getClassifierMap()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.FeatureMap <em>Feature Map</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Feature Map</em>'.
* @see orgomg.cwm.analysis.transformation.FeatureMap
* @generated
*/
EClass getFeatureMap();
/**
* Returns the meta object for the containment reference '{@link orgomg.cwm.analysis.transformation.FeatureMap#getFunction <em>Function</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Function</em>'.
* @see orgomg.cwm.analysis.transformation.FeatureMap#getFunction()
* @see #getFeatureMap()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the attribute '{@link orgomg.cwm.analysis.transformation.FeatureMap#<API key> <em>Function Description</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Function Description</em>'.
* @see orgomg.cwm.analysis.transformation.FeatureMap#<API key>()
* @see #getFeatureMap()
* @generated
*/
EAttribute <API key>();
/**
* Returns the meta object for the container reference '{@link orgomg.cwm.analysis.transformation.FeatureMap#getClassifierMap <em>Classifier Map</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the container reference '<em>Classifier Map</em>'.
* @see orgomg.cwm.analysis.transformation.FeatureMap#getClassifierMap()
* @see #getFeatureMap()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.FeatureMap#getTarget <em>Target</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Target</em>'.
* @see orgomg.cwm.analysis.transformation.FeatureMap#getTarget()
* @see #getFeatureMap()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.StepPrecedence <em>Step Precedence</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Step Precedence</em>'.
* @see orgomg.cwm.analysis.transformation.StepPrecedence
* @generated
*/
EClass getStepPrecedence();
/**
* Returns the meta object for class '{@link orgomg.cwm.analysis.transformation.<API key> <em>Classifier Feature Map</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Classifier Feature Map</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>
* @generated
*/
EClass <API key>();
/**
* Returns the meta object for the containment reference '{@link orgomg.cwm.analysis.transformation.<API key>#getFunction <em>Function</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Function</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>#getFunction()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the attribute '{@link orgomg.cwm.analysis.transformation.<API key>#<API key> <em>Function Description</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Function Description</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>#<API key>()
* @see #<API key>()
* @generated
*/
EAttribute <API key>();
/**
* Returns the meta object for the attribute '{@link orgomg.cwm.analysis.transformation.<API key>#<API key> <em>Classifier To Feature</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Classifier To Feature</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>#<API key>()
* @see #<API key>()
* @generated
*/
EAttribute <API key>();
/**
* Returns the meta object for the container reference '{@link orgomg.cwm.analysis.transformation.<API key>#getClassifierMap <em>Classifier Map</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the container reference '<em>Classifier Map</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>#getClassifierMap()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.<API key>#getClassifier <em>Classifier</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Classifier</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>#getClassifier()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for the reference list '{@link orgomg.cwm.analysis.transformation.<API key>#getFeature <em>Feature</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Feature</em>'.
* @see orgomg.cwm.analysis.transformation.<API key>#getFeature()
* @see #<API key>()
* @generated
*/
EReference <API key>();
/**
* Returns the meta object for enum '{@link orgomg.cwm.analysis.transformation.TreeType <em>Tree Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for enum '<em>Tree Type</em>'.
* @see orgomg.cwm.analysis.transformation.TreeType
* @generated
*/
EEnum getTreeType();
/**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the factory that creates the instances of the model.
* @generated
*/
<API key> <API key>();
/**
* <!-- begin-user-doc -->
* Defines literals for the meta objects that represent
* <ul>
* <li>each class,</li>
* <li>each feature of each class,</li>
* <li>each enum,</li>
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
* @generated
*/
interface Literals {
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.TransformationImpl <em>Transformation</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.TransformationImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getTransformation()
* @generated
*/
EClass TRANSFORMATION = eINSTANCE.getTransformation();
/**
* The meta object literal for the '<em><b>Function</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Function Description</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Is Primary</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Source</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Target</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Task</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.DataObjectSetImpl <em>Data Object Set</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.DataObjectSetImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getDataObjectSet()
* @generated
*/
EClass DATA_OBJECT_SET = eINSTANCE.getDataObjectSet();
/**
* The meta object literal for the '<em><b>Source Transformation</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Target Transformation</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Element</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Task</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
EClass TRANSFORMATION_TASK = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Step</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Original Task</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Inverse Task</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Transformation</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Step</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
EClass TRANSFORMATION_STEP = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Task</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Warehouse Step</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Execution</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Activity</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
EClass <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Creation Date</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Warehouse Activity</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Execution</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Precedence Constraint</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
EClass <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Use</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
EClass TRANSFORMATION_USE = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Type</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Map</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
EClass TRANSFORMATION_MAP = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Tree</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
EClass TRANSFORMATION_TREE = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Type</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Body</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.ClassifierMapImpl <em>Classifier Map</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.ClassifierMapImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getClassifierMap()
* @generated
*/
EClass CLASSIFIER_MAP = eINSTANCE.getClassifierMap();
/**
* The meta object literal for the '<em><b>Function</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Function Description</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Feature Map</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Cf Map</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Source</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.FeatureMapImpl <em>Feature Map</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.FeatureMapImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getFeatureMap()
* @generated
*/
EClass FEATURE_MAP = eINSTANCE.getFeatureMap();
/**
* The meta object literal for the '<em><b>Function</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Function Description</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Classifier Map</b></em>' container reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Target</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference FEATURE_MAP__TARGET = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.StepPrecedenceImpl <em>Step Precedence</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.StepPrecedenceImpl
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getStepPrecedence()
* @generated
*/
EClass STEP_PRECEDENCE = eINSTANCE.getStepPrecedence();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.impl.<API key> <em>Classifier Feature Map</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.impl.<API key>
* @see orgomg.cwm.analysis.transformation.impl.<API key>#<API key>()
* @generated
*/
EClass <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Function</b></em>' containment reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Function Description</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Classifier To Feature</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Classifier Map</b></em>' container reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Classifier</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '<em><b>Feature</b></em>' reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference <API key> = eINSTANCE.<API key>();
/**
* The meta object literal for the '{@link orgomg.cwm.analysis.transformation.TreeType <em>Tree Type</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see orgomg.cwm.analysis.transformation.TreeType
* @see orgomg.cwm.analysis.transformation.impl.<API key>#getTreeType()
* @generated
*/
EEnum TREE_TYPE = eINSTANCE.getTreeType();
}
} //<API key>
|
package org.fenixedu.cms.domain;
import com.google.common.collect.Sets;
import org.fenixedu.bennu.core.security.Authenticate;
import org.fenixedu.bennu.core.signals.DomainObjectEvent;
import org.fenixedu.bennu.core.signals.Signal;
import org.fenixedu.cms.domain.wraps.Wrap;
import org.fenixedu.cms.domain.wraps.Wrappable;
import org.fenixedu.cms.exceptions.CmsDomainException;
import org.fenixedu.commons.StringNormalizer;
import org.fenixedu.commons.i18n.LocalizedString;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pt.ist.fenixframework.Atomic;
import pt.ist.fenixframework.FenixFramework;
import pt.ist.fenixframework.<API key>.<API key>;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.fenixedu.commons.i18n.LocalizedString.fromJson;
/**
* Model of a Menu for a given {@link Page}
*/
public class Menu extends Menu_Base implements Wrappable, Sluggable, Cloneable, Comparable<Menu>{
public static final String SIGNAL_CREATED = "fenixedu.cms.menu.created";
public static final String SIGNAL_DELETED = "fenixedu.cms.menu.deleted";
public static final String SIGNAL_EDITED = "fenixedu.cms.menu.edited";
private static final Logger logger = LoggerFactory.getLogger(Menu.class);
public Menu(Site site, LocalizedString name) {
if (Authenticate.getUser() == null) {
throw CmsDomainException.forbiden();
}
this.setCreatedBy(Authenticate.getUser());
this.setCreationDate(new DateTime());
setSite(site);
setTopMenu(false);
this.setName(name);
this.setPrivileged(false);
this.setOrder(site.getMenusSet().size());
Signal.emit(Menu.SIGNAL_CREATED, new DomainObjectEvent<>(this));
}
@Override
public Site getSite() {
return super.getSite();
}
@Atomic
public void delete() {
logger.info("Menu " + getName() + " - " + getExternalId() +" of site " + getSite().getSlug() +
" deleted by user "+ Authenticate.getUser().getUsername());
Signal.emit(Menu.SIGNAL_DELETED, new DomainObjectEvent<>(this));
Sets.newHashSet(getItemsSet()).stream().distinct().forEach(MenuItem::delete);
this.setCreatedBy(null);
this.setSite(null);
this.deleteDomainObject();
}
@Override
public void setSlug(String slug) {
super.setSlug(SlugUtils.makeSlug(this, slug));
}
/**
* A slug is valid if there are no other page on that site that have the same slug.
*
* @param slug slug
* @return true if it is a valid slug.
*/
@Override
public boolean isValidSlug(String slug) {
Menu m = getSite().menuForSlug(slug);
return m == null || m == this;
}
/**
* saves the name of the post and creates a new slug for the post.
*/
@Override
public void setName(LocalizedString name) {
LocalizedString prevName = getName();
super.setName(name);
if (prevName == null) {
String slug = StringNormalizer.slugify(name.getContent());
setSlug(slug);
}
}
/**
* Puts a {@link MenuItem} at a given position, shifting the existing ones to the right.
*
* @param item
* The {@link MenuItem} to be added.
* @param position
* the position to save the item.
*/
public void putAt(MenuItem item, int position) {
if (position < 0) {
position = 0;
}
if (position >= this.getToplevelItemsSet().size()) {
item.removeFromParent();
position = getToplevelItemsSet().size();
}
if (item.getPosition() != null) {
item.removeFromParent();
}
List<MenuItem> list = <API key>().collect(Collectors.toList());
list.add(position, item);
MenuItem.fixOrder(list);
getToplevelItemsSet().add(item);
getItemsSet().add(item);
}
/**
* Removes a given {@link MenuItem} from the Menu.
*
* @param mi
* the {@link MenuItem} to be removed.
*/
public void remove(MenuItem mi) {
getToplevelItemsSet().remove(mi);
MenuItem.fixOrder(<API key>().collect(Collectors.toList()));
getItemsSet().remove(mi);
MenuItem.fixOrder(getItemsSorted().collect(Collectors.toList()));
}
/**
* Adds a given {@link MenuItem} as the last item.
*
* @param mi the {@link MenuItem} to be added.
*/
public void add(MenuItem mi) {
this.putAt(mi, getToplevelItemsSet().size());
}
public Stream<MenuItem> <API key>() {
return getToplevelItemsSet().stream().sorted();
}
public Stream<MenuItem> getItemsSorted() {
return getItemsSet().stream().sorted();
}
@Override
public Menu clone(CloneCache cloneCache) {
return cloneCache.getOrClone(this, obj -> {
Collection<MenuItem> menuItems = new HashSet<>(getItemsSet());
LocalizedString name = getName() != null ? fromJson(getName().json()) : null;
Menu clone = new Menu(getSite(), name);
cloneCache.setClone(Menu.this, clone);
clone.setName(name);
clone.setOrder(getOrder());
for (MenuItem menuItem : menuItems) {
menuItem.clone(cloneCache).setMenu(clone);
}
return clone;
});
}
@Override
public int compareTo(Menu o) {
return getOrder().compareTo(o.getOrder());
}
@SuppressWarnings("unused")
private class MenuWrap extends Wrap {
private final Page page;
private final Stream<Wrap> children;
public MenuWrap() {
this.page = null;
this.children = <API key>().filter(MenuItem::isVisible).map(MenuItem::makeWrap);
}
public MenuWrap(Page page) {
this.page = page;
this.children = <API key>().filter(MenuItem::isVisible).map(item -> item.makeWrap(page));
}
public Stream<Wrap> getChildren() {
return children;
}
public int getOrder(){
return Menu.this.getOrder();
}
public LocalizedString getName() {
return Menu.this.getName();
}
public Wrap getSite() {
return Menu.this.getSite().makeWrap();
}
public Boolean getTopMenu() {
return Menu.this.getTopMenu();
}
}
@Override
public Wrap makeWrap() {
return new MenuWrap();
}
public Wrap makeWrap(Page page) {
return new MenuWrap(page);
}
public MenuItem menuItemForOid(String menuItemOid) {
MenuItem menuItem = FenixFramework.getDomainObject(menuItemOid);
if(menuItem != null && FenixFramework.isDomainObjectValid(menuItem) && menuItem.getMenu() == this) {
return menuItem;
}
return null;
}
@<API key>
public boolean checkMenuOrder(){
return getOrder() != null && !(getOrder()<0);
}
}
|
.libs {
border: 1px solid #ccc;
padding: 5px 10px;
margin-top: 5px;
}
.libs .gwt-Tree img {
/* hack to align rows */
margin-left: 6px;
}
.libFilter input {
margin-right: 3px;
}
.libFilter {
}
.libFilter td {
padding-right: 15px;
}
.nolibs {
padding: 0 0 0 20px;
font-size: 93%;
}
|
namespace LiveResults.Client
{
partial class OEForm
{
<summary>
Required designer variable.
</summary>
private System.ComponentModel.IContainer components = null;
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtZeroTime = new System.Windows.Forms.TextBox();
this.lblZeroTime = new System.Windows.Forms.Label();
this.lblFormatInfo = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.cmbFormat = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.txtExtension = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.txtOEDirectory = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.<API key> = new System.Windows.Forms.FolderBrowserDialog();
this.listBox1 = new System.Windows.Forms.ListBox();
this.button2 = new System.Windows.Forms.Button();
this.fileSystemWatcher1 = new System.IO.FileSystemWatcher();
this.listBox2 = new System.Windows.Forms.ListBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.label2 = new System.Windows.Forms.Label();
this.txtCompID = new System.Windows.Forms.TextBox();
this.button3 = new System.Windows.Forms.Button();
this.fsWatcherOS = new System.IO.FileSystemWatcher();
this.label4 = new System.Windows.Forms.Label();
this.chkUploadStarttimes = new System.Windows.Forms.CheckBox();
this.button4 = new System.Windows.Forms.Button();
this.<API key> = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.fsWatcherOS)).BeginInit();
this.SuspendLayout();
// groupBox1
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.txtZeroTime);
this.groupBox1.Controls.Add(this.lblZeroTime);
this.groupBox1.Controls.Add(this.lblFormatInfo);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.cmbFormat);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.txtExtension);
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Controls.Add(this.txtOEDirectory);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(12, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(311, 187);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Settings";
// txtZeroTime
this.txtZeroTime.Location = new System.Drawing.Point(159, 161);
this.txtZeroTime.Name = "txtZeroTime";
this.txtZeroTime.Size = new System.Drawing.Size(146, 20);
this.txtZeroTime.TabIndex = 12;
// lblZeroTime
this.lblZeroTime.AutoSize = true;
this.lblZeroTime.Location = new System.Drawing.Point(7, 164);
this.lblZeroTime.Name = "lblZeroTime";
this.lblZeroTime.Size = new System.Drawing.Size(146, 13);
this.lblZeroTime.TabIndex = 13;
this.lblZeroTime.Text = "Event ZeroTime (HH:MM:SS)";
// lblFormatInfo
this.lblFormatInfo.Location = new System.Drawing.Point(7, 135);
this.lblFormatInfo.Name = "lblFormatInfo";
this.lblFormatInfo.Size = new System.Drawing.Size(298, 49);
this.lblFormatInfo.TabIndex = 11;
// label5
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(7, 95);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(39, 13);
this.label5.TabIndex = 10;
this.label5.Text = "Format";
// cmbFormat
this.cmbFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbFormat.FormattingEnabled = true;
this.cmbFormat.Location = new System.Drawing.Point(10, 111);
this.cmbFormat.Name = "cmbFormat";
this.cmbFormat.Size = new System.Drawing.Size(295, 21);
this.cmbFormat.TabIndex = 9;
this.cmbFormat.<API key> += new System.EventHandler(this.<API key>);
// label3
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(7, 59);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(268, 13);
this.label3.TabIndex = 8;
this.label3.Text = "Exportfile extension (fileextension to monitor in directory)";
// txtExtension
this.txtExtension.Location = new System.Drawing.Point(10, 75);
this.txtExtension.Name = "txtExtension";
this.txtExtension.Size = new System.Drawing.Size(112, 20);
this.txtExtension.TabIndex = 7;
this.txtExtension.Text = "*.xml";
// button1
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(274, 35);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(31, 20);
this.button1.TabIndex = 1;
this.button1.Text = "...";
this.button1.<API key> = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
// txtOEDirectory
this.txtOEDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtOEDirectory.Location = new System.Drawing.Point(10, 36);
this.txtOEDirectory.Name = "txtOEDirectory";
this.txtOEDirectory.Size = new System.Drawing.Size(258, 20);
this.txtOEDirectory.TabIndex = 1;
// label1
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(7, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(77, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Exportdirectory";
// listBox1
this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(12, 235);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(576, 186);
this.listBox1.TabIndex = 1;
// button2
this.button2.Location = new System.Drawing.Point(92, 196);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 31);
this.button2.TabIndex = 2;
this.button2.Text = "Start upload";
this.button2.<API key> = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
// fileSystemWatcher1
this.fileSystemWatcher1.EnableRaisingEvents = true;
this.fileSystemWatcher1.SynchronizingObject = this;
// listBox2
this.listBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.listBox2.FormattingEnabled = true;
this.listBox2.Location = new System.Drawing.Point(329, 32);
this.listBox2.Name = "listBox2";
this.listBox2.Size = new System.Drawing.Size(251, 69);
this.listBox2.TabIndex = 3;
// timer1
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// label2
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 193);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(73, 13);
this.label2.TabIndex = 4;
this.label2.Text = "CompetitionID";
// txtCompID
this.txtCompID.Location = new System.Drawing.Point(12, 209);
this.txtCompID.Name = "txtCompID";
this.txtCompID.Size = new System.Drawing.Size(74, 20);
this.txtCompID.TabIndex = 5;
// button3
this.button3.Location = new System.Drawing.Point(174, 196);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(73, 31);
this.button3.TabIndex = 6;
this.button3.Text = "Stop upload";
this.button3.<API key> = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
// fsWatcherOS
this.fsWatcherOS.EnableRaisingEvents = true;
this.fsWatcherOS.Filter = "*.csv.emma";
this.fsWatcherOS.NotifyFilter = System.IO.NotifyFilters.LastWrite;
this.fsWatcherOS.SynchronizingObject = this;
this.fsWatcherOS.Changed += new System.IO.<API key>(this.fsWatcherOS_Changed);
// label4
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(329, 12);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(43, 13);
this.label4.TabIndex = 9;
this.label4.Text = "Servers";
// chkUploadStarttimes
this.chkUploadStarttimes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chkUploadStarttimes.AutoSize = true;
this.chkUploadStarttimes.Checked = true;
this.chkUploadStarttimes.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkUploadStarttimes.Location = new System.Drawing.Point(332, 107);
this.chkUploadStarttimes.Name = "chkUploadStarttimes";
this.chkUploadStarttimes.Size = new System.Drawing.Size(107, 17);
this.chkUploadStarttimes.TabIndex = 10;
this.chkUploadStarttimes.Text = "Upload starttimes";
this.chkUploadStarttimes.<API key> = true;
// button4
this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button4.Location = new System.Drawing.Point(388, 196);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(192, 33);
this.button4.TabIndex = 11;
this.button4.Text = "Copy log to clipboard";
this.button4.<API key> = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
// <API key>
this.<API key>.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.<API key>.AutoSize = true;
this.<API key>.Checked = true;
this.<API key>.CheckState = System.Windows.Forms.CheckState.Checked;
this.<API key>.Location = new System.Drawing.Point(332, 130);
this.<API key>.Name = "<API key>";
this.<API key>.Size = new System.Drawing.Size(184, 17);
this.<API key>.TabIndex = 12;
this.<API key>.Text = "Automatically create radiocontrols";
this.<API key>.<API key> = true;
// OEForm
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(592, 444);
this.Controls.Add(this.<API key>);
this.Controls.Add(this.button4);
this.Controls.Add(this.chkUploadStarttimes);
this.Controls.Add(this.label4);
this.Controls.Add(this.button3);
this.Controls.Add(this.txtCompID);
this.Controls.Add(this.label2);
this.Controls.Add(this.listBox2);
this.Controls.Add(this.button2);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.groupBox1);
this.Name = "OEForm";
this.Text = "LiveResults Client, UploadClient";
this.FormClosing += new System.Windows.Forms.<API key>(this.OEForm_FormClosing);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.fsWatcherOS)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox txtOEDirectory;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.FolderBrowserDialog <API key>;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button button2;
private System.IO.FileSystemWatcher fileSystemWatcher1;
private System.Windows.Forms.ListBox listBox2;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.TextBox txtCompID;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button3;
private System.IO.FileSystemWatcher fsWatcherOS;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtExtension;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox chkUploadStarttimes;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox cmbFormat;
private System.Windows.Forms.Label lblFormatInfo;
private System.Windows.Forms.TextBox txtZeroTime;
private System.Windows.Forms.Label lblZeroTime;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.CheckBox <API key>;
}
}
|
package org.alfresco.repo.search.impl.querymodel.impl.db;
import java.util.Map;
import org.alfresco.repo.search.impl.querymodel.Argument;
import org.alfresco.repo.search.impl.querymodel.Function;
import org.alfresco.repo.search.impl.querymodel.impl.<API key>;
/**
* @author Andy
*
*/
public class DBFunctionArgument extends <API key>
{
/**
* @param name
* @param function
* @param arguments
*/
public DBFunctionArgument(String name, Function function, Map<String, Argument> arguments)
{
super(name, function, arguments);
}
}
|
package org.molgenis.core.ui.data.system.core;
import org.molgenis.data.<API key>;
import org.molgenis.data.populate.EntityPopulator;
import org.springframework.stereotype.Component;
@Component
public class <API key>
extends <API key><FreemarkerTemplate, <API key>, String>
{
<API key>(<API key> freemarkerTemplate, EntityPopulator entityPopulator)
{
super(FreemarkerTemplate.class, freemarkerTemplate, entityPopulator);
}
}
|
#include "ndpi_protocols.h"
#ifdef NDPI_PROTOCOL_NTP
static void <API key>(struct <API key>
*ndpi_struct, struct ndpi_flow_struct *flow)
{
<API key>(ndpi_struct, flow, NDPI_PROTOCOL_NTP, <API key>);
}
/* detection also works asymmetrically */
void ndpi_search_ntp_udp(struct <API key> *ndpi_struct, struct ndpi_flow_struct *flow)
{
struct ndpi_packet_struct *packet = &flow->packet;
// struct ndpi_id_struct *src=ndpi_struct->src;
// struct ndpi_id_struct *dst=ndpi_struct->dst;
if (!(packet->udp->dest == htons(123) || packet->udp->source == htons(123)))
goto exclude_ntp;
NDPI_LOG(NDPI_PROTOCOL_NTP, ndpi_struct, NDPI_LOG_DEBUG, "NTP port detected\n");
if (packet->payload_packet_len != 48)
goto exclude_ntp;
NDPI_LOG(NDPI_PROTOCOL_NTP, ndpi_struct, NDPI_LOG_DEBUG, "NTP length detected\n");
if ((((packet->payload[0] & 0x38) >> 3) <= 4)) {
NDPI_LOG(NDPI_PROTOCOL_NTP, ndpi_struct, NDPI_LOG_DEBUG, "detected NTP.");
<API key>(ndpi_struct, flow);
return;
}
exclude_ntp:
NDPI_LOG(NDPI_PROTOCOL_NTP, ndpi_struct, NDPI_LOG_DEBUG, "NTP excluded.\n");
<API key>(flow-><API key>, NDPI_PROTOCOL_NTP);
}
#endif
|
qx.Class.define("org.jspresso.framework.application.frontend.command.remote.<API key>", {
extend: org.jspresso.framework.application.frontend.command.remote.RemoteCommand,
construct: function () {
this.base(arguments);
},
properties: {
newSections: {
check: "Array"
}
}
});
|
#if !defined( <API key> )
#define <API key>
#include <common.h>
/* Define <API key> for local use of libcstring
*/
#if defined( <API key> )
#include <<API key>.h>
#include <<API key>.h>
#include <<API key>.h>
#include <libcstring_types.h>
#include <<API key>.h>
#else
/* If libtool DLL support is enabled set <API key>
* before including libcstring.h
*/
#if defined( _WIN32 ) && defined( DLL_IMPORT )
#define <API key>
#endif
#include <libcstring.h>
#endif
#endif
|
package Genome::File::BedPe::Header;
use strict;
use warnings;
sub new {
my ($class, $lines) = @_;
$lines = [] unless defined $lines;
my $self = {
lines => $lines,
custom_fields => [],
_custom_field_idx => {},
};
bless $self, $class;
return $self;
}
sub <API key> {
my $self = shift;
$self->{_custom_field_idx} = {
map { $self->{custom_fields}[$_] => $_ } 0..$#{$self->{custom_fields}}
};
}
sub set_custom_fields {
my ($self, @fields) = @_;
$self->{custom_fields} = \@fields;
$self-><API key>;
}
sub guess_custom_fields {
my $self = shift;
if (@{$self->{lines}}) {
my $last_line = $self->{lines}[-1];
my @fields = split("\t", $last_line);
if ($#fields >= 10) {
$self->{custom_fields} = [@fields[10..$#fields]];
$self-><API key>;
return 1;
}
}
return 1;
}
sub custom_field_index {
my ($self, $field_name) = @_;
if (exists $self->{_custom_field_idx}{$field_name}) {
return $self->{_custom_field_idx}{$field_name};
}
return;
}
sub to_string {
my $self = shift;
return join("\n", @{$self->{lines}});
}
1;
|
/**
* message.css
*
* @module Global
* @submodule Message
* @type Layout
* @version $Id$
* @author Inaki
*/
/* MSG */
.msg-list { background-color: #FDFDFD; }
.msg-list .main-list-item { border-bottom: 0 none; }
.msg-word-count {
color: #B2C0D1;
font-family: Constantia, Georgia;
font-size: 16px;
padding: 0 5px;
}
.msg-word-count.xcr { color: #E26F50; }
.msg-pm-list li .o-trash,
.msg-pm-list li .o-more,
.msg-box-del{ visibility: hidden; }
.msg-pm-list li:hover .o-trash,
.msg-pm-list li:hover .o-more,
.msg-box:hover .msg-box-del{ visibility: visible; }
.msg-pm-input { width: 640px; }
.msg-pm-input textarea{ border: 0 none; height: 72px; }
.<API key> { display: none; }
.<API key> textarea{ height: 112px }
.<API key> .<API key>{ display: block; }
.<API key> .msg-box{ border-color: #3497DB; }
.<API key> .msg-box-inverse .msg-box-arrow{ border-left-color: #3497DB; }
.<API key> { -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .1); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .1); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.<API key> .charcount{ color: #B2C0D1; padding: 0 5px; }
.<API key> .charcount strong{ font-size: 20px; font-family: Georgia; }
.<API key> .charcount.warning strong{ color: #E26F50; }
.msg-pm-detail-list .main-list-item { margin: 20px 0; padding-bottom: 0; padding-top: 0; }
.msg-pm-detail-list .main-list-item-body { margin-right: 100px; }
.msg-time-line{
text-align: center;
margin: 20px 120px;
border-width: 1px 0 0;
border-color: #EEE;
border-style: solid;
}
.msg-time-line legend{
margin-bottom: 0;
width: 120px;
border: 0 none;
font-size: 12px;
}
.msg-comment-list li .checkbox,
.<API key>,
.msg-multiple .msg-toolbar,
.msg-remind-timeline .msg-box .checkbox { display: none; }
.msg-multiple .msg-comment-list li .checkbox,
.msg-multiple .msg-remind-timeline .msg-box .checkbox { display: inline-block; }
.msg-multiple .<API key> { display: block; }
.o-msg-at,
.o-msg-comment,
.o-msg-praise,
.o-msg-private,
.o-msg-remind,
.o-msg-received,
.o-msg-sent{
background-image: url(../image/message.png);
background-repeat: no-repeat;
}
.o-msg-at,
.o-msg-comment,
.o-msg-praise,
.o-msg-private,
.o-msg-remind{
display: inline-block;
height: 20px;
vertical-align: middle;
width: 20px;
}
.o-msg-comment { background-position: -30px 0; }
.o-msg-praise { background-position: -60px 0; }
.o-msg-private { background-position: -90px 0; }
.o-msg-remind { background-position: -120px 0; }
.active .o-msg-at { background-position: 0 -30px; }
.active .o-msg-comment { background-position: -30px -30px; }
.active .o-msg-praise { background-position: -60px -30px; }
.active .o-msg-private { background-position: -90px -30px; }
.active .o-msg-remind { background-position: -120px -30px; }
.o-msg-received { background-position: 0 -60px; }
.o-msg-sent { background-position: -40px -60px; }
.msg-remind-detail { padding-top: 50px; }
.msg-remind-timeline {
border-left: 1px solid #EBEFF6;
margin-left: 98px;
padding: 10px 20px;
position: relative;
}
.msg-remind-timeline .msg-box { margin: 20px 0; }
.msg-remind-timeline .msg-alert { border: 1px solid #3497db; }
.msg-remind-timeline .msg-alert .msg-box-arrow { border-right: 10px solid #3497db; }
.msg-remind-timeline .msg-box-inverse { left: -80px; position: absolute; top: -40px; }
.msg-remind-timeline .msg-box-inverse .msg-box-arrow { top: 8px; }
.msg-remind-timeline .msg-box-inverse .msg-box-body {
font-size: 12px;
line-height: 16px;
padding: 10px;
width: 30px;
}
.o-timeline-point,
.o-timeline-subpoint { background-image: url(../image/timeline.png); background-repeat: no-repeat; position: absolute; }
.o-timeline-point {
border-radius: 8px;
height: 16px;
left: -8px;
top: -8px;
width: 16px;
}
.o-timeline-subpoint {
background-position: -20px 0;
border-radius: 6px;
height: 12px;
left: -27px;
top: 24px;
width: 12px;
}
.praise-list li .o-chat{ visibility: hidden; }
.praise-list li:hover .o-chat{ visibility: visible; }
|
qx.Class.define("org.jspresso.framework.application.frontend.command.remote.<API key>", {
extend: org.jspresso.framework.application.frontend.command.remote.RemoteCommand,
construct: function () {
this.base(arguments);
},
properties: {
snapshotId: {
check: "String",
nullable: true
},
name: {
check: "String",
nullable: true
}
}
});
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libwkhtmltox: src/lib Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libwkhtmltox
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="<API key>.html">src</a></li><li class="navelem"><a class="el" href="<API key>.html">lib</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">lib Directory Reference</div> </div>
</div><!--header
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
<tr class="memitem:pdf_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="pdf_8h.html">pdf.h</a></td></tr>
<tr class="memdesc:pdf_8h"><td class="mdescLeft"> </td><td class="mdescRight">Provides C bindings for pdf conversion. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
|
from ajenti.ui import *
from ajenti.com import implements
from ajenti.app.api import ICategoryProvider
from ajenti.app.helpers import *
from ajenti.utils import *
import backend
class UsersPlugin(CategoryPlugin):
text = 'Users'
icon = '/dl/users/icon_small.png'
folder = 'system'
platform =['Ubuntu', 'Debian', 'Arch', 'openSUSE']
params = {
'login': 'Login',
'password': 'Password',
'name': 'Name',
'uid': 'UID',
'gid': 'GID',
'ggid': 'GID',
'home': 'Home directory',
'shell': 'Shell',
'adduser': 'New user login',
'addgrp': 'New group name'
}
def on_session_start(self):
self._tab = 0
self._selected_user = ''
self._selected_group = ''
self._editing = ''
def get_ui(self):
panel = UI.PluginPanel(UI.Label(), title='User accounts', icon='/dl/users/icon.png')
panel.append(self.get_default_ui())
return panel
def get_default_ui(self):
self.users = backend.get_all_users()
self.groups = backend.get_all_groups()
backend.map_groups(self.users, self.groups)
tc = UI.TabControl(active=self._tab)
tc.add('Users', self.get_ui_users())
tc.add('Groups', self.get_ui_groups())
if self._editing != '':
tc = UI.VContainer(tc, UI.InputBox(text=self.params[self._editing], id='dlgEdit'))
return tc
def get_ui_users(self):
t = UI.DataTable(UI.DataTableRow(
UI.Label(text='Login'),
UI.Label(text='UID'),
UI.Label(text='Home'),
UI.Label(text='Shell'),
UI.Label(), header=True
))
for u in self.users:
t.append(UI.DataTableRow(
UI.DataTableCell(
UI.Image(file='/dl/core/ui/stock/user.png'),
UI.Label(text=u.login, bold=True)
),
UI.Label(text=u.uid, bold=(u.uid>=1000)),
UI.Label(text=u.home),
UI.Label(text=u.shell),
UI.DataTableCell(
UI.MiniButton(id='edit/'+u.login, text='Select'),
hidden=True
)
))
t = UI.VContainer(t, UI.Button(text='Add user', id='adduser'))
if self._selected_user != '':
t = UI.Container(t, self.get_ui_edit_user())
return t
def get_ui_groups(self):
t = UI.DataTable(UI.DataTableRow(
UI.Label(text='Name'),
UI.Label(text='GID'),
UI.Label(text='Users'),
UI.Label(), header=True
))
for u in self.groups:
t.append(UI.DataTableRow(
UI.DataTableCell(
UI.Image(file='/dl/core/ui/stock/group.png'),
UI.Label(text=u.name, bold=True)
),
UI.Label(text=u.gid, bold=(u.gid>=1000)),
UI.Label(text=', '.join(u.users)),
UI.DataTableCell(
UI.MiniButton(id='gedit/'+u.name, text='Select'),
hidden=True
)
))
t = UI.VContainer(t, UI.Button(text='Add group', id='addgrp'))
if self._selected_group != '':
t = UI.Container(t, self.get_ui_edit_group())
return t
def get_ui_edit_user(self):
u = backend.get_user(self._selected_user, self.users)
backend.map_groups([u], backend.get_all_groups())
g = ', '.join(u.groups)
dlg = UI.DialogBox(
UI.LayoutTable(
UI.LayoutTableRow(
UI.Label(text='Login: '+ u.login, bold=True),
UI.Button(text='Change', id='chlogin')
),
UI.LayoutTableRow(
UI.Label(),
UI.Button(text='Change password', id='chpasswd')
),
UI.LayoutTableRow(
UI.Label(),
UI.WarningButton(text='Delete user', id='deluser', msg='Delete user %s'%u.login)
),
UI.LayoutTableRow(
UI.Label(text='UID: '+ str(u.uid)),
UI.Button(text='Change', id='chuid')
),
UI.LayoutTableRow(
UI.Label(text='GID: '+ str(u.gid)),
UI.Button(text='Change', id='chgid')
),
UI.LayoutTableRow(
UI.Label(text='Home directory: '+ u.home),
UI.Button(text='Change', id='chhome')
),
UI.LayoutTableRow(
UI.Label(text='Shell: '+ u.shell),
UI.Button(text='Change', id='chshell')
),
UI.LayoutTableRow(
UI.Label(text='Groups: '),
UI.Button(text='Edit', id='chgroups')
),
UI.LayoutTableRow(
UI.LayoutTableCell(
UI.Label(text=g),
colspan=2
)
)
),
title='Edit user',
id='dlgEditUser'
)
return dlg
def get_ui_edit_group(self):
u = backend.get_group(self._selected_group, self.groups)
g = ', '.join(u.users)
dlg = UI.DialogBox(
UI.LayoutTable(
UI.LayoutTableRow(
UI.Label(text='Name: ' + u.name, bold=True),
UI.Button(text='Change', id='gchname')
),
UI.LayoutTableRow(
UI.Label(),
UI.WarningButton(text='Delete group', id='delgroup', msg='Delete group %s'%u.name)
),
UI.LayoutTableRow(
UI.Label(text='GID: ' + str(u.gid)),
UI.Button(text='Change', id='gchgid')
),
UI.LayoutTableRow(
UI.Label(text='Users: '),
UI.Label()
),
UI.LayoutTableRow(
UI.LayoutTableCell(
UI.Label(text=g),
colspan=2
)
)
),
title='Edit group',
id='dlgEditGroup'
)
return dlg
@event('minibutton/click')
@event('button/click')
def on_click(self, event, params, vars=None):
if params[0] == 'edit':
self._tab = 0
self._selected_user = params[1]
if params[0] == 'gedit':
self._tab = 1
self._selected_group = params[1]
if params[0] == 'chlogin':
self._tab = 0
self._editing = 'login'
if params[0] == 'chuid':
self._tab = 0
self._editing = 'uid'
if params[0] == 'chgid':
self._tab = 0
self._editing = 'gid'
if params[0] == 'chshell':
self._tab = 0
self._editing = 'shell'
if params[0] == 'chpasswd':
self._tab = 0
self._editing = 'password'
if params[0] == 'chhome':
self._tab = 0
self._editing = 'home'
if params[0] == 'gchname':
self._tab = 1
self._editing = 'name'
if params[0] == 'gchgid':
self._tab = 1
self._editing = 'ggid'
if params[0] == 'adduser':
self._tab = 0
self._editing = 'adduser'
if params[0] == 'addgrp':
self._tab = 1
self._editing = 'addgrp'
if params[0] == 'deluser':
self._tab = 0
backend.del_user(self._selected_user)
self._selected_user = ''
if params[0] == 'delgroup':
self._tab = 1
backend.del_group(self._selected_group)
self._selected_group = ''
@event('dialog/submit')
def on_submit(self, event, params, vars=None):
if params[0] == 'dlgEdit':
v = vars.getvalue('value', '')
if vars.getvalue('action', '') == 'OK':
if self._editing == 'adduser':
backend.add_user(v)
self._selected_user = v
if self._editing == 'addgrp':
backend.add_group(v)
self._selected_group = v
if self._editing == 'login':
backend.change_user_login(self._selected_user, v)
self._selected_user = v
if self._editing == 'uid':
backend.change_user_uid(self._selected_user, v)
if self._editing == 'gid':
backend.change_user_gid(self._selected_user, v)
if self._editing == 'shell':
backend.change_user_shell(self._selected_user, v)
if self._editing == 'password':
backend.<API key>(self._selected_user, v)
if self._editing == 'home':
backend.change_user_home(self._selected_user, v)
if self._editing == 'name':
backend.change_group_name(self._selected_group, v)
self._selected_group = v
if self._editing == 'ggid':
backend.change_group_gid(self._selected_group, v)
self._editing = ''
if params[0] == 'dlgEditUser':
self._selected_user = ''
if params[0] == 'dlgEditGroup':
self._selected_group = ''
class UsersContent(ModuleContent):
module = 'users'
path = __file__
|
#if 0
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#ifdef PIL_LINUX
#include <sys/time.h>
#include <sys/timeb.h>
#endif
#if defined(PIL_WINDOWS) || defined(PIL_MINGW)
#include <windows.h>
#endif
#include "base/base.h"
#include "Time.h"
namespace pi {
time functions
ru64 tm_get_millis(void)
{
#if defined(PIL_LINUX)
struct timeval tm_val;
ru64 v;
int ret;
ret = gettimeofday(&tm_val, NULL);
v = tm_val.tv_sec*1000 + tm_val.tv_usec/1000;
return v;
#endif
#if defined(PIL_WINDOWS) || defined(PIL_MINGW)
return GetTickCount();
#endif
}
ru64 tm_get_ms(void)
{
#if defined(PIL_LINUX)
struct timeval tm_val;
ru64 v;
int ret;
ret = gettimeofday(&tm_val, NULL);
v = tm_val.tv_sec*1000 + tm_val.tv_usec/1000;
return v;
#endif
#if defined(PIL_WINDOWS) || defined(PIL_MINGW)
return GetTickCount();
#endif
}
ru64 tm_get_us(void)
{
#if defined(PIL_LINUX)
struct timeval tm_val;
ru64 v;
int ret;
ret = gettimeofday(&tm_val, NULL);
v = tm_val.tv_sec*1000000 + tm_val.tv_usec;
return v;
#endif
#if defined(PIL_WINDOWS) || defined(PIL_MINGW)
FILETIME t;
ru64 t_ret;
// get UTC time
<API key>(&t);
t_ret = 0;
t_ret |= t.dwHighDateTime;
t_ret <<= 32;
t_ret |= t.dwLowDateTime;
// convert 100 ns to [ms]
t_ret /= 10;
return t_ret;
#endif
}
double tm_getTimeStamp(void)
{
#if defined(PIL_LINUX)
struct timeval tm_val;
double v;
int ret;
ret = gettimeofday(&tm_val, NULL);
v = tm_val.tv_sec + 1.0*tm_val.tv_usec/1e6;
return v;
#endif
#if defined(PIL_WINDOWS) || defined(PIL_MINGW)
FILETIME t;
ru64 t_ret;
double ts;
// get UTC time
<API key>(&t);
t_ret = 0;
t_ret |= t.dwHighDateTime;
t_ret <<= 32;
t_ret |= t.dwLowDateTime;
// convert 100 ns to second
ts = 1.0 * t_ret / 1e7;
return ts;
#endif
}
uint32_t tm_getTimeStampUnix(void)
{
#if defined(PIL_LINUX)
struct timeval tm_val;
uint32_t v;
int ret;
ret = gettimeofday(&tm_val, NULL);
v = tm_val.tv_sec;
return v;
#endif
#if defined(PIL_WINDOWS) || defined(PIL_MINGW)
FILETIME t;
ru64 t_ret;
uint32_t ts;
// get UTC time
<API key>(&t);
t_ret = 0;
t_ret |= t.dwHighDateTime;
t_ret <<= 32;
t_ret |= t.dwLowDateTime;
// convert 100 ns to second
ts = t_ret / 10000000;
return ts;
#endif
}
void tm_sleep(ru32 t)
{
#if defined(PIL_LINUX)
struct timespec tp;
tp.tv_sec = t / 1000;
tp.tv_nsec = ( t % 1000 ) * 1000000;
while( nanosleep(&tp, &tp) );
#endif
#if defined(PIL_WINDOWS) || defined(PIL_MINGW)
Sleep(t);
#endif
}
void tm_sleep_us(ri64 t)
{
#if defined(PIL_LINUX)
struct timespec tp;
tp.tv_sec = t / 1000000;
tp.tv_nsec = ( t % 1000000 ) * 1000;
while( nanosleep(&tp, &tp) );
#endif
#if defined(PIL_WINDOWS) || defined(PIL_MINGW)
Sleep(t/1000);
#endif
}
} // end of namespace pi
#endif
|
package modpacktweaks.client.gui.library.gui.element;
import modpacktweaks.client.gui.library.gui.IGuiBase;
import modpacktweaks.client.gui.library.gui.utils.GuiUtils;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
public class <API key> extends ElementItemIcon
{
public <API key>(IGuiBase parent, int x, int y, ItemStack stack)
{
super(parent, x, y, stack);
sizeX = sizeY = 18;
}
public <API key>(IGuiBase parent, int x, int y, ItemStack stack, boolean big)
{
super(parent, x, y, stack);
sizeX = sizeY = big ? 26 : 18;
}
@Override
public void draw()
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
gui.getTextureManager().bindTexture(texture);
<API key>(posX, posY, sizeX == 18 ? 0 : 18, 0, sizeX, sizeY);
int buffer = sizeX == 18 ? 1 : 5;
GuiUtils.drawItemStack(gui, item, posX + buffer, posY + buffer);
}
}
|
// System.Xml.IXmlLineInfo.cs
// Jason Diamond (jason@injektilo.org)
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
// included in all copies or substantial portions of the Software.
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
namespace System.Xml
{
public interface IXmlLineInfo
{
int LineNumber { get; }
int LinePosition { get; }
bool HasLineInfo();
}
}
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /><title><API key> xref</title>
<link type="text/css" rel="stylesheet" href="../../stylesheet.css" />
</head>
<body>
<div id="overview"><a href="../../../apidocs/org/jaxen/<API key>.html">View Javadoc</a></div><pre>
<a name="47" href="#47">47</a>
<a name="48" href="#48">48</a>
<a name="49" href="#49">49</a> <strong>package</strong> <a href="../../org/jaxen/package-summary.html">org.jaxen</a>;
<a name="50" href="#50">50</a>
<a name="51" href="#51">51</a> <strong>import</strong> java.util.HashMap;
<a name="52" href="#52">52</a>
<a name="53" href="#53">53</a> <em>/**<em>* Simple default implementation of <code>FunctionContext</code>.</em></em>
<a name="54" href="#54">54</a> <em> *</em>
<a name="55" href="#55">55</a> <em> * <p></em>
<a name="56" href="#56">56</a> <em> * This is a simple table-based key-lookup implementation</em>
<a name="57" href="#57">57</a> <em> * for <code>FunctionContext</code> which can be programmatically</em>
<a name="58" href="#58">58</a> <em> * extended by registering additional functions.</em>
<a name="59" href="#59">59</a> <em> * </p></em>
<a name="60" href="#60">60</a> <em> *</em>
<a name="61" href="#61">61</a> <em> * @see <API key></em>
<a name="62" href="#62">62</a> <em> *</em>
<a name="63" href="#63">63</a> <em> * @author <a href="<a href="mailto:bob@werken.com" target="alexandria_uri">mailto:bob@werken.com</a>">bob mcwhirter</a></em>
<a name="64" href="#64">64</a> <em> */</em>
<a name="65" href="#65">65</a> <strong>public</strong> <strong>class</strong> <a href="../../org/jaxen/<API key>.html"><API key></a> implements <a href="../../org/jaxen/FunctionContext.html">FunctionContext</a>
<a name="66" href="#66">66</a> {
<a name="67" href="#67">67</a> <em>/**<em>* Table of functions. */</em></em>
<a name="68" href="#68">68</a> <strong>private</strong> HashMap functions;
<a name="69" href="#69">69</a>
<a name="70" href="#70">70</a> <em>/**<em>* </em></em>
<a name="71" href="#71">71</a> <em> * <p></em>
<a name="72" href="#72">72</a> <em> * Construct an empty function context.</em>
<a name="73" href="#73">73</a> <em> * </p></em>
<a name="74" href="#74">74</a> <em> */</em>
<a name="75" href="#75">75</a> <strong>public</strong> <a href="../../org/jaxen/<API key>.html"><API key></a>()
<a name="76" href="#76">76</a> {
<a name="77" href="#77">77</a> <strong>this</strong>.functions = <strong>new</strong> HashMap();
<a name="78" href="#78">78</a> }
<a name="79" href="#79">79</a>
<a name="80" href="#80">80</a> <em>/**<em>* Register a new function.</em></em>
<a name="81" href="#81">81</a> <em> *</em>
<a name="82" href="#82">82</a> <em> * <p></em>
<a name="83" href="#83">83</a> <em> * By registering a new function, any XPath expression</em>
<a name="84" href="#84">84</a> <em> * that utilizes this <code>FunctionContext</code> may</em>
<a name="85" href="#85">85</a> <em> * refer to and use the new function.</em>
<a name="86" href="#86">86</a> <em> * </p></em>
<a name="87" href="#87">87</a> <em> *</em>
<a name="88" href="#88">88</a> <em> * <p></em>
<a name="89" href="#89">89</a> <em> * Functions may exist either in a namespace or not.</em>
<a name="90" href="#90">90</a> <em> * Namespace prefix-to-URI resolution is the responsibility</em>
<a name="91" href="#91">91</a> <em> * of a {@link NamespaceContext}. Within this <code>FunctionContext</code></em>
<a name="92" href="#92">92</a> <em> * functions are only referenced using the URI, <strong>not</strong></em>
<a name="93" href="#93">93</a> <em> * the prefix.</em>
<a name="94" href="#94">94</a> <em> * </p></em>
<a name="95" href="#95">95</a> <em> *</em>
<a name="96" href="#96">96</a> <em> * <p></em>
<a name="97" href="#97">97</a> <em> * The namespace URI of a function may be <code>null</code></em>
<a name="98" href="#98">98</a> <em> * to indicate that it exists without a namespace.</em>
<a name="99" href="#99">99</a> <em> * </p></em>
<a name="100" href="#100">100</a> <em> *</em>
<a name="101" href="#101">101</a> <em> * @param namespaceURI the namespace URI of the function to</em>
<a name="102" href="#102">102</a> <em> * be registered with this context</em>
<a name="103" href="#103">103</a> <em> * @param localName the non-prefixed local portion of the</em>
<a name="104" href="#104">104</a> <em> * function to be registered with this context</em>
<a name="105" href="#105">105</a> <em> * @param function a {@link Function} implementation object</em>
<a name="106" href="#106">106</a> <em> * to be used when evaluating the function</em>
<a name="107" href="#107">107</a> <em> */</em>
<a name="108" href="#108">108</a> <strong>public</strong> <strong>void</strong> registerFunction(String namespaceURI,
<a name="109" href="#109">109</a> String localName,
<a name="110" href="#110">110</a> <a href="../../org/jaxen/Function.html">Function</a> function )
<a name="111" href="#111">111</a> {
<a name="112" href="#112">112</a> <strong>this</strong>.functions.put( <strong>new</strong> QualifiedName(namespaceURI, localName),
<a name="113" href="#113">113</a> function );
<a name="114" href="#114">114</a> }
<a name="115" href="#115">115</a>
<a name="116" href="#116">116</a> <strong>public</strong> <a href="../../org/jaxen/Function.html">Function</a> getFunction(String namespaceURI,
<a name="117" href="#117">117</a> String prefix,
<a name="118" href="#118">118</a> String localName )
<a name="119" href="#119">119</a> throws <a href="../../org/jaxen/<API key>.html"><API key></a>
<a name="120" href="#120">120</a> {
<a name="121" href="#121">121</a> <a href="../../org/jaxen/QualifiedName.html">QualifiedName</a> key = <strong>new</strong> <a href="../../org/jaxen/QualifiedName.html">QualifiedName</a>( namespaceURI, localName );
<a name="122" href="#122">122</a>
<a name="123" href="#123">123</a> <strong>if</strong> ( <strong>this</strong>.functions.containsKey(key) ) {
<a name="124" href="#124">124</a> <strong>return</strong> (Function) <strong>this</strong>.functions.get( key );
<a name="125" href="#125">125</a> }
<a name="126" href="#126">126</a> <strong>else</strong> {
<a name="127" href="#127">127</a> <strong>throw</strong> <strong>new</strong> <a href="../../org/jaxen/<API key>.html"><API key></a>( <span class="string">"No Such Function "</span> + key.getClarkForm() );
<a name="128" href="#128">128</a> }
<a name="129" href="#129">129</a> }
<a name="130" href="#130">130</a> }
</pre>
<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
</html>
|
#define BOOST_TEST_MODULE <API key>
#include <boost/test/unit_test.hpp>
#include <boost/test/<API key>.hpp>
#include <shark/Algorithms/GradientDescent/TrustRegionNewton.h>
#include <shark/ObjectiveFunctions/Benchmarks/Rosenbrock.h>
#include <shark/ObjectiveFunctions/Benchmarks/Ellipsoid.h>
#include "../testFunction.h"
using namespace shark;
using namespace shark::benchmarks;
<API key> (<API key>)
<API key>( <API key> )
{
Ellipsoid function(5);
TrustRegionNewton optimizer;
std::cout<<"Testing: "<<optimizer.name()<<" with "<<function.name()<<std::endl;
testFunction(optimizer,function,100,100);
}
<API key>( <API key> )
{
Rosenbrock function(3);
TrustRegionNewton optimizer;
std::cout<<"Testing: "<<optimizer.name()<<" with "<<function.name()<<std::endl;
testFunction(optimizer,function,100,1000,1.e-14);
}
<API key>()
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using PcapDotNet.Base;
namespace PcapDotNet.Packets.Dns
{
<summary>
Faltstrom.
<pre>
+
| bit | 0-15 | 16-31 |
+
| 0 | Priority | Weight |
+
| 32 | Target |
| ... | |
+
</pre>
</summary>
[DnsTypeRegistration(Type = DnsType.Uri)]
public sealed class DnsResourceDataUri : <API key>, IEquatable<DnsResourceDataUri>
{
private static class Offset
{
public const int Priority = 0;
public const int Weight = Priority + sizeof(ushort);
public const int Target = Weight + sizeof(ushort);
}
private const int ConstantPartLength = Offset.Target;
<summary>
Constructs an instance out of the priority, weight and target fields.
</summary>
<param name="priority">
The priority of the target URI in this RR.
A client must attempt to contact the URI with the lowest-numbered priority it can reach;
URIs with the same priority should be tried in the order defined by the weight field.
</param>
<param name="weight">
A server selection mechanism.
The weight field specifies a relative weight for entries with the same priority.
Larger weights should be given a proportionately higher probability of being selected.
</param>
<param name="target">The URI of the target. Resolution of the URI is according to the definitions for the Scheme of the URI.</param>
public DnsResourceDataUri(ushort priority, ushort weight, IList<DataSegment> target)
{
Priority = priority;
Weight = weight;
Target = target.AsReadOnly();
}
<summary>
The priority of the target URI in this RR.
A client must attempt to contact the URI with the lowest-numbered priority it can reach;
URIs with the same priority should be tried in the order defined by the weight field.
</summary>
public ushort Priority { get; private set; }
<summary>
A server selection mechanism.
The weight field specifies a relative weight for entries with the same priority.
Larger weights should be given a proportionately higher probability of being selected.
</summary>
public ushort Weight { get; private set; }
<summary>
The URI of the target.
Resolution of the URI is according to the definitions for the Scheme of the URI.
</summary>
public ReadOnlyCollection<DataSegment> Target { get; private set; }
<summary>
Two DnsResourceDataUri are equal iff their priority, weight and target fields are equal.
</summary>
public bool Equals(DnsResourceDataUri other)
{
return other != null &&
Priority.Equals(other.Priority) &&
Weight.Equals(other.Weight) &&
Target.SequenceEqual(other.Target);
}
<summary>
Two DnsResourceDataUri are equal iff their priority, weight and target fields are equal.
</summary>
public override bool Equals(object obj)
{
return Equals(obj as DnsResourceDataUri);
}
<summary>
A hash code of the combination of the priority, weight and target fields.
</summary>
public override int GetHashCode()
{
return BitSequence.Merge(Priority, Weight).GetHashCode() ^ Target.SequenceGetHashCode();
}
internal DnsResourceDataUri()
: this(0, 0, new DataSegment[0])
{
}
internal override int GetLength()
{
return ConstantPartLength + Target.Sum(targetPart => GetStringLength(targetPart));
}
internal override void WriteDataSimple(byte[] buffer, int offset)
{
buffer.Write(offset + Offset.Priority, Priority, Endianity.Big);
buffer.Write(offset + Offset.Weight, Weight, Endianity.Big);
int targetOffset = offset + Offset.Target;
foreach (DataSegment targetPart in Target)
WriteString(buffer, ref targetOffset, targetPart);
}
internal override DnsResourceData CreateInstance(DataSegment data)
{
if (data.Length < ConstantPartLength)
return null;
ushort priority = data.ReadUShort(Offset.Priority, Endianity.Big);
ushort weight = data.ReadUShort(Offset.Weight, Endianity.Big);
List<DataSegment> target = new List<DataSegment>();
int targetDataOffset = Offset.Target;
while (data.Length > targetDataOffset)
{
DataSegment targetPart = ReadString(data, ref targetDataOffset);
if (targetPart == null)
return null;
target.Add(targetPart);
}
return new DnsResourceDataUri(priority, weight, target);
}
}
}
|
<!DOCTYPE html >
<html>
<head>
<link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
<script src="../libraries/RGraph.common.core.js" ></script>
<script src="../libraries/RGraph.common.effects.js" ></script>
<script src="../libraries/RGraph.pie.js" ></script>
<script src="../libraries/RGraph.bar.js" ></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
<title>A Bar chart with animated Pie chart</title>
<meta name="robots" content="noindex,nofollow" />
<meta name="description" content="A Bar chart with an animated Pie chart" />
</head>
<body>
<h1>A Bar chart with animated Pie chart</h1>
<p>
This demo shows a simple effect using the Pie chart RoundRobin effect.
</p>
<canvas id="cvs" width="600" height="250">[No canvas support]</canvas>
<script>
$(document).ready(function ()
{
var bar = new RGraph.Bar({
id: 'cvs',
data: [5,4,5,6,8,5,3],
options: {
gutter: {
bottom: 40
},
labels: ['Monday','\r\nTuesday','Wednesday','\r\nThursday','Friday','\r\nSaturday','Sunday'],
strokestyle: 'rgba(0,0,0,0)'
}
}).draw();
var pie = new RGraph.Pie({
id: 'cvs',
data: [4,8,6],
options: {
centerx: 60,
centery: 60,
radius: 25,
exploded: [5],
strokestyle: 'rgba(0,0,0,0)',
shadow: true,
strokestyle: '#fff',
linewidth: 1
}
}).roundRobin({frames: 30, radius: false});
});
</script>
<p></p>
This goes in the documents header (or you could place it just above the jQuery ready event code):
<pre class="code">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.effects.js"></script>
<script src="RGraph.pie.js"></script>
<script src="RGraph.bar.js"></script>
</pre>
Put this where you want the chart to show up:
<pre class="code">
<canvas id="cvs" width="600" height="250" !style="border: 1px solid #ccc">
[No canvas support]
</canvas>
</pre>
This is the code that generates the chart. Because it's using the jQuery ready event you can put this at the
bottom of the document:
<pre class="code">
<script>
$(document).ready(function ()
{
var bar = new RGraph.Bar({
id: 'cvs',
data: [5,4,5,6,8,5,3],
options: {
gutter: {
bottom: 40
},
labels: ['Monday','\r\nTuesday','Wednesday','\r\nThursday','Friday','\r\nSaturday','Sunday'],
strokestyle: 'rgba(0,0,0,0)'
}
}).draw();
var pie = new RGraph.Pie({
id: 'cvs',
data: [4,8,6],
options: {
centerx: 60,
centery: 60,
radius: 25,
exploded: [5],
strokestyle: 'rgba(0,0,0,0)',
shadow: true,
strokestyle: '#fff',
linewidth: 1
}
}).roundRobin({frames: 30, radius: false});
});
</script>
</pre>
<p>
<a href="https:
<a href="https:
<a href="https:
</p>
<p>
<a href="">« Back</a>
</p>
</body>
</html>
|
package edu.umd.cs.findbugs.ba;
import java.io.IOException;
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.MethodGen;
/**
* A test driver for dataflow analysis classes.
* It runs the dataflow analysis on the methods of a single class,
* and has options (properties) to restrict the analysis to a single
* method, and to print out a CFG annotated with dataflow values.
*
* @author David Hovemeyer
* @see Dataflow
* @see DataflowAnalysis
*/
public abstract class DataflowTestDriver <Fact, AnalysisType extends <API key><Fact>> {
/**
* Execute the analysis on a single class.
*
* @param filename the name of the class file
*/
public void execute(String filename) throws <API key>, CFGBuilderException, IOException {
JavaClass jclass = new <API key>(filename).parse();
final <API key> <API key> = new <API key>() {
public void reportMissingClass(<API key> e) {
e.printStackTrace();
System.exit(1);
}
};
AnalysisContext analysisContext = new AnalysisContext(<API key>);
ClassContext classContext = analysisContext.getClassContext(jclass);
String methodName = System.getProperty("dataflow.method");
Method[] methods = jclass.getMethods();
for (int i = 0; i < methods.length; ++i) {
Method method = methods[i];
if (methodName != null && !method.getName().equals(methodName))
continue;
MethodGen methodGen = classContext.getMethodGen(method);
if (methodGen == null)
continue;
System.out.println("
System.out.println("Method: " + SignatureConverter.<API key>(methodGen));
System.out.println("
execute(classContext, method);
}
}
/**
* Execute the analysis on a single method of a class.
*/
public void execute(ClassContext classContext, Method method) throws <API key>, CFGBuilderException {
Dataflow<Fact, AnalysisType> dataflow = createDataflow(classContext, method);
System.out.println("Finished in " + dataflow.getNumIterations() + " iterations");
CFG cfg = classContext.getCFG(method);
examineResults(cfg, dataflow);
if (Boolean.getBoolean("dataflow.printcfg")) {
CFGPrinter p = new DataflowCFGPrinter<Fact, AnalysisType>(cfg, dataflow, dataflow.getAnalysis());
p.print(System.out);
}
}
/**
* Downcall method to create the dataflow driver object
* and execute the analysis.
*
* @param classContext ClassContext for the class
* @param method the Method
* @return the Dataflow driver
*/
public abstract Dataflow<Fact, AnalysisType> createDataflow(ClassContext classContext, Method method)
throws CFGBuilderException, <API key>;
/**
* Downcall method to inspect the analysis results.
* Need not be implemented by subclasses.
*
* @param cfg the control flow graph
* @param dataflow the analysis results
*/
public void examineResults(CFG cfg, Dataflow<Fact, AnalysisType> dataflow) {
}
}
// vim:ts=4
|
<?php
/**
* Abstract Class controller
*/
abstract class controller {
protected $model;
protected $userRole = <API key>::ROLE_TRANSLATOR;
/**
* @var Users_UserStruct
*/
protected $logged_user;
protected $uid;
protected $userIsLogged = false;
protected $userMail;
/**
* Controllers Factory
*
* Initialize the Controller Instance and route the
* API Calls to the right Controller
*
* @return mixed
*/
public static function getInstance() {
if( isset( $_REQUEST['api'] ) && filter_input( INPUT_GET, 'api', <API key> ) ){
if( !isset( $_REQUEST['action'] ) || empty( $_REQUEST['action'] ) ){
header( "Location: " . INIT::$HTTPHOST . INIT::$BASEURL . "api/docs", true, 303 ); //Redirect 303 See Other
die();
}
$_REQUEST[ 'action' ][0] = strtoupper( $_REQUEST[ 'action' ][ 0 ] );
//PHP 5.2 compatibility, don't use a lambda function
$func = create_function( '$c', 'return strtoupper($c[1]);' );
$_REQUEST[ 'action' ] = <API key>( '/_([a-z])/', $func, $_REQUEST[ 'action' ] );
$_POST[ 'action' ] = $_REQUEST[ 'action' ];
//set the log to the API Log
Log::$fileName = 'API.log';
}
//Default : catController
$action = ( isset( $_POST[ 'action' ] ) ) ? $_POST[ 'action' ] : ( isset( $_GET[ 'action' ] ) ? $_GET[ 'action' ] : 'cat' );
$className = $action . "Controller";
//Put here all actions we want to be performed by ALL controllers
require_once INIT::$MODEL_ROOT . '/queries.php';
return new $className();
}
/**
* When Called it perform the controller action to retrieve/manipulate data
*
* @return mixed
*/
abstract function doAction();
/**
* Called to get the result values in the right format
*
* @return mixed
*/
abstract function finalize();
/**
* Set No Cache headers
*
*/
protected function nocache() {
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
}
public function sessionStart(){
Bootstrap::sessionStart();
}
/**
* Explicitly disable sessions for ajax call
*
* Sessions enabled on INIT Class
*
*/
public function disableSessions(){
Bootstrap::sessionClose();
}
/**
* @return mixed
*/
public function getModel()
{
return $this->model;
}
public function setUserCredentials() {
$this->logged_user = new Users_UserStruct();
$this->logged_user->uid = ( isset( $_SESSION[ 'uid' ] ) && !empty( $_SESSION[ 'uid' ] ) ? $_SESSION[ 'uid' ] : null );
$this->logged_user->email = ( isset( $_SESSION[ 'cid' ] ) && !empty( $_SESSION[ 'cid' ] ) ? $_SESSION[ 'cid' ] : null );
try {
$userDao = new Users_UserDao( Database::obtain() );
$loggedUser = $userDao->setCacheTTL( 3600 )->read( $this->logged_user )[ 0 ]; // one hour cache
$this->logged_user = ( !empty( $loggedUser ) ? $loggedUser : $this->logged_user );
} catch ( Exception $e ) {
Log::doLog( 'User not logged.' );
}
$this->userIsLogged = ( !empty( $this->logged_user->email ) );
$this->uid = $this->logged_user->getUid();
$this->userMail = $this->logged_user->getEmail();
}
/**
* Try to get user name from cookie if it is not present and put it in session.
*
*/
protected function <API key>() {
if ( empty( $_SESSION[ 'cid' ] ) ) {
$<API key> = AuthCookie::getCredentials();
if ( $<API key> ) {
$_SESSION[ 'cid' ] = $<API key>['username'];
$_SESSION[ 'uid' ] = $<API key>['uid'];
}
}
}
}
|
package com.darkona.adventurebackpack.inventory;
import com.darkona.adventurebackpack.item.<API key>;
import com.darkona.adventurebackpack.item.ItemHose;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.*;
public class SlotTool extends <API key>
{
public SlotTool(IInventory inventory, int id, int x, int y)
{
super(inventory, id, x, y);
}
@Override
public boolean isItemValid(ItemStack stack)
{
return isValidTool(stack);
}
public static boolean isValidTool(ItemStack stack)
{
boolean valid = false;
String[] validToolNames = {
"wrench", "hammer", "axe", "shovel", "grafter", "scoop", "crowbar", "mattock", "drill",/*"hatchet","excavator","chisel"*/
};
String[] invalidToolNames = {
"bucket", "sword", "dagger", "sabre", "rapier", "shield", "cutlass", "bow", "whip"
};
if (stack != null && stack.getMaxStackSize() == 1)
{
Item item = stack.getItem();
String name = item.getUnlocalizedName().toLowerCase();
// Vanilla
if (item instanceof ItemTool || item instanceof ItemHoe || item instanceof ItemShears || item instanceof ItemFishingRod || item instanceof ItemFlintAndSteel)
{
return true;
}
//Adventure Backpack duh!
if (item instanceof ItemHose || item instanceof <API key>)
{
return false;
}
// Just for extra compatibility and/or security and/or less annoyance
for (String toolName : validToolNames)
{
String a = toolName;
if (name.contains(toolName)) return true;
}
for (String toolName : invalidToolNames)
{
String a = toolName;
if (name.contains(toolName)) return false;
}
//And also this because I'm a badass
try
{
// Tinker's Construct
if (item.getClass().getName().contains("tconstruct.items.tools")) return true;
} catch (Exception oops)
{
// oops.printStackTrace();
}
try
{
//Buildcraft
if (java.lang.Class.forName("buildcraft.api.tools.IToolWrench").isInstance(item)) return true;
} catch (Exception oops)
{
// oops.printStackTrace();
}
try
{
//IndustrialCraft
if (java.lang.Class.forName("ic2.api.item.IElectricItem").isInstance(item)) return true;
} catch (Exception oops)
{
// oops.printStackTrace();
}
//Thaumcraft
try
{
//Thermal Expansion
if (java.lang.Class.forName("cofh.core.item.tool").isInstance(item)) return true;
if (java.lang.Class.forName("thermalexpansion.item.tool").isInstance(item)) return true;
} catch (Exception oops)
{
// oops.printStackTrace();
}
}
return valid;
}
}
|
#include "send.h"
#include <libnfe/libnfe.h>
#include <libnfe/errno.h>
#include <libnfe/gen_xml.h>
#include <curl/curl.h>
#include <openssl/evp.h>
#include <openssl/ssl.h>
#include <openssl/crypto.h>
#include <openssl/pem.h>
#include <stdio.h>
#include <openssl/x509.h>
#include <openssl/rsa.h>
#include <libxml/xmlwriter.h>
#include <string.h>
typedef struct {
EVP_PKEY *key;
X509 *cert;
} SSL_KEY;
static size_t writefunction(void *ptr, size_t size,
size_t nmemb, void *s){
char **r = (char**) s;
*r = strndup(ptr, (size_t)(size*nmemb));
return (nmemb*size);
}
CURLcode sslctx_function(CURL *curl, void *sslctx, SSL_KEY *ssl_key){
RSA *rsa = NULL;
X509 *cert = ssl_key->cert;
EVP_PKEY *pKey = ssl_key->key;
int rc;
(void)curl; //avoid warnings
//get_private_key(&pKey, &cert, pwd);
if(pKey == NULL){
return -1;
}
rsa = EVP_PKEY_get1_RSA(pKey);
// tell SSL to use the X509 certificate
rc = <API key>((SSL_CTX*)sslctx, cert);
if(rc != 1) {
fprintf(stderr, "Use certificate failed\n");
}
//tell SSL to use the RSA key from memory
rc = <API key>((SSL_CTX*)sslctx, rsa);
if(rc != 1) {
fprintf(stderr, "Use Key failed\n");
}
return CURLE_OK;
}
static char *format_soap(sefaz_servico_t service, char *xml, int cuf,
const char *wsdl){
int rc, buffersize;
xmlTextWriterPtr writer;
xmlDocPtr doc;
xmlChar *xmlbuf;
char *versao = get_versao(service);
writer = xmlNewTextWriterDoc(&doc, 0);
if (writer == NULL)
return NULL;
<API key>(writer, NULL, "UTF-8", NULL);
rc = <API key>(writer, BAD_CAST "soap12:Envelope");
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "xmlns:xsi",
BAD_CAST "http:
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "xmlns:xsd",
BAD_CAST "http:
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "xmlns:soap12",
BAD_CAST "http:
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "soap12:Header");
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "nfeCabecMsg");
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "xmlns",
BAD_CAST wsdl);
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "versaoDados",
"%s", versao);
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "cUF",
"%d", cuf);
if (rc < 0)
return NULL;
rc = <API key>(writer);
if (rc < 0)
return NULL;
rc = <API key>(writer);
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "soap12:Body");
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "nfeDadosMsg");
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST "xmlns",
BAD_CAST wsdl);
if (rc < 0)
return NULL;
rc = <API key>(writer, BAD_CAST xml);
if (rc < 0)
return NULL;
rc = <API key>(writer);
if (rc < 0)
return NULL;
rc = <API key>(writer);
if (rc < 0)
return NULL;
rc = <API key>(writer);
if (rc < 0)
return NULL;
if (rc < 0)
return NULL;
<API key>(writer);
xmlDocDumpMemory(doc, &xmlbuf, &buffersize);
return (char*) xmlbuf;
}
char *send_sefaz(sefaz_servico_t service, char *URL, int ambiente, int cuf,
char *xml, EVP_PKEY *key, X509 *cert){
CURL *ch;
CURLcode rv;
rv = curl_global_init(CURL_GLOBAL_ALL);
ch = curl_easy_init();
struct curl_slist *header = NULL;
SSL_KEY ssl_key = {
.key = key,
.cert = cert
};
char *server_response;
header = curl_slist_append(header,
"Content-type: application/soap+xml; charset=UTF-8");
rv = curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L);
rv = curl_easy_setopt(ch, CURLOPT_HTTPHEADER, header);
rv = curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L);
rv = curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L);
rv = curl_easy_setopt(ch, <API key>, writefunction);
rv = curl_easy_setopt(ch, CURLOPT_WRITEDATA, &server_response);
char *h = format_soap(service, xml, cuf, SEFAZ_WSDL[service]);
rv = curl_easy_setopt(ch, CURLOPT_POSTFIELDS, h);
/* both VERIFYPEER and VERIFYHOST are set to 0 in this case because there is
no CA certificate*/
rv = curl_easy_setopt(ch, <API key>, 0L);
rv = curl_easy_setopt(ch, <API key>, 0L);
rv = curl_easy_setopt(ch, CURLOPT_URL, URL);
rv = curl_easy_setopt(ch, <API key>, *sslctx_function);
rv = curl_easy_setopt(ch, <API key>, &ssl_key);
rv = curl_easy_perform(ch);
free(h);
if(rv!=CURLE_OK) {
return NULL;
}
curl_easy_cleanup(ch);
curl_global_cleanup();
return server_response;
}
|
package bulkio;
public class SizeOf <T> {
public <T extends Object> int sizeof() {
return 0;
}
}
class FloatSize extends SizeOf< Float > {
public FloatSize() {};
public < T > int sizeof() {
return bytes();
};
public static int bytes() {
return 4;
}
}
class DoubleSize extends SizeOf< Double > {
public DoubleSize() {};
public < T > int sizeof() {
return bytes();
};
public static int bytes() {
return 8;
}
}
class Int8Size extends SizeOf< Byte > {
public Int8Size() {};
public < T > int sizeof() {
return bytes();
};
public static int bytes() {
return 1;
}
}
class CharSize extends SizeOf< Character > {
public CharSize() {};
public < T > int sizeof() {
return bytes();
};
public static int bytes() {
return 1;
}
}
class UInt8Size extends Int8Size {
public UInt8Size() {};
}
class OctetSize extends Int8Size {
public OctetSize() {};
}
class Int16Size extends SizeOf< Short > {
public Int16Size() {};
public < T > int sizeof() {
return bytes();
};
public static int bytes() {
return 2;
}
}
class UInt16Size extends Int16Size {
public UInt16Size() { };
}
class Int32Size extends SizeOf< Integer > {
public Int32Size() {};
public < T > int sizeof() {
return bytes();
};
public static int bytes() {
return 4;
}
}
class UInt32Size extends Int32Size {
public UInt32Size() { };
}
class Int64Size extends SizeOf< Long > {
public Int64Size() {};
public < T > int sizeof() {
return bytes();
};
public static int bytes() {
return 8;
}
}
class UInt64Size extends Int64Size {
public UInt64Size() { };
}
|
'use strict';
const crypto = require('crypto');
/**
* Utility class for generating, parsing, and validating tokens.
* @type {Token}
*/
module.exports = class Token {
/**
* Generates a token.
* @param {number} timeout Number of minutes before the token is expired.
* @param {string} algorithm Algorithm for cipher.
* @param {string} password Password for cipher.
* @param {string} data Data to be encrypted.
* @returns {string} Encrypted token.
*/
static generate (timeout, algorithm, password, data) {
// determine expiration
var expiration = new Date();
expiration.setMinutes(expiration.getMinutes() + timeout);
// create and encrypt the token
var cipher = crypto.createCipher(algorithm, password);
var token = {};
token.data = data;
token.expiration = expiration;
token = cipher.update(JSON.stringify(token), 'utf8', 'hex');
token += cipher.final('hex');
return token;
}
/**
* Parses a token
* @param {string} algorithm Algorithm for cipher.
* @param {string} password Password for cipher.
* @param {string} token The token string to parse.
* @returns {object} The token containing the expiration and data.
*/
static parse (algorithm, password, token) {
var decipher = crypto.createDecipher(algorithm, password);
token = decipher.update(token, 'hex', 'utf8');
token += decipher.final('utf8');
return JSON.parse(token);
}
/**
* Validate a token's expiration
* @param {object} token The parsed token object.
* @returns {boolean} Token validation.
*/
static validate (token) {
return new Date() < new Date(token.expiration);
}
};
|
package pl.starchasers.launcher.utils;
import java.io.BufferedInputStream;
import java.io.<API key>;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
public class FileUtils {
@SuppressWarnings("rawtypes")
public static void unzip(String filePath, String unzipPath) {
Enumeration entries;
ZipFile zipFile;
<API key> out = null;
try {
zipFile = new ZipFile(filePath);
entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
if (entry.isDirectory()
|| entry.getName().startsWith("META-INF")) {
continue;
}
out = new <API key>(new FileOutputStream(unzipPath
+ entry.getName()));
byte[] buffer = new byte[1024];
int len;
while ((len = zipFile.getInputStream(entry).read(buffer)) >= 0) {
out.write(buffer, 0, len);
}
}
zipFile.close();
out.close();
} catch (Exception ioe) {
ioe.printStackTrace();
return;
}
}
public static void unzipOne(String zip, String name, String nametosave){
OutputStream out;
try {
out = new FileOutputStream(zip.substring(0,zip.lastIndexOf("/")) +"/"+ nametosave);
FileInputStream fin = new FileInputStream(zip);
BufferedInputStream bin = new BufferedInputStream(fin);
@SuppressWarnings("resource")
ZipInputStream zin = new ZipInputStream(bin);
ZipEntry ze = null;
while ((ze = zin.getNextEntry()) != null) {
if (ze.getName().equals(name)) {
byte[] buffer = new byte[8192];
int len;
while ((len = zin.read(buffer)) != -1) {
out.write(buffer, 0, len);
}
out.close();
break;
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void unzipNatives(String filePath, String unzipPath) {
@SuppressWarnings("rawtypes")
Enumeration entries;
ZipFile zipFile;
<API key> out = null;
try {
zipFile = new ZipFile(filePath);
entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
if (entry.isDirectory()
|| entry.getName().startsWith("META-INF")) {
continue;
}
out = new <API key>(new FileOutputStream(unzipPath
+ entry.getName().substring(entry.getName().lastIndexOf("/")+1)));
byte[] buffer = new byte[1024];
int len;
while ((len = zipFile.getInputStream(entry).read(buffer)) >= 0) {
out.write(buffer, 0, len);
}
}
zipFile.close();
out.close();
} catch (Exception ioe) {
ioe.printStackTrace();
return;
}
}
static public void extractFolder(String zipFile, String newPath) throws ZipException, IOException
{
System.out.println(zipFile);
int BUFFER = 2048;
File file = new File(zipFile);
ZipFile zip = new ZipFile(file);
//String newPath = zipFile.substring(0, zipFile.length() - 4);
new File(newPath).mkdir();
@SuppressWarnings("rawtypes")
Enumeration zipFileEntries = zip.entries();
// Process each entry
while (zipFileEntries.hasMoreElements())
{
// grab a zip file entry
ZipEntry entry = (ZipEntry) zipFileEntries.nextElement();
String currentEntry = entry.getName();
File destFile = new File(newPath, currentEntry);
//destFile = new File(newPath, destFile.getName());
File destinationParent = destFile.getParentFile();
// create the parent directory structure if needed
destinationParent.mkdirs();
if (!entry.isDirectory())
{
BufferedInputStream is = new BufferedInputStream(zip
.getInputStream(entry));
int currentByte;
// establish buffer for writing file
byte data[] = new byte[BUFFER];
// write the current file to disk
FileOutputStream fos = new FileOutputStream(destFile);
<API key> dest = new <API key>(fos,
BUFFER);
// read and write until last byte is encountered
while ((currentByte = is.read(data, 0, BUFFER)) != -1) {
dest.write(data, 0, currentByte);
}
dest.flush();
dest.close();
is.close();
}
if (currentEntry.endsWith(".zip"))
{
// found a zip file, try to open
extractFolder(destFile.getAbsolutePath(),newPath);
}
}
zip.close();
}
}
|
<?php
namespace BitWasp\Bitcoin\Mnemonic\Electrum\Wordlist;
use BitWasp\Bitcoin\Mnemonic\Electrum\<API key>;
use BitWasp\Bitcoin\Mnemonic\WordList;
class EnglishWordList extends WordList implements <API key>
{
/**
* @var array
*/
private $wordsFlipped;
/**
* @return int
*/
public function count(): int
{
return count($this->getWords());
}
/**
* @return array
*/
public function getWords(): array
{
return array('like', 'just', 'love', 'know', 'never', 'want', 'time',
'out', 'there', 'make', 'look', 'eye', 'down', 'only', 'think',
'heart', 'back', 'then', 'into', 'about', 'more', 'away', 'still',
'them', 'take', 'thing', 'even', 'through', 'long', 'always',
'world', 'too', 'friend', 'tell', 'try', 'hand', 'thought', 'over',
'here', 'other', 'need', 'smile', 'again', 'much', 'cry', 'been',
'night', 'ever', 'little', 'said', 'end', 'some', 'those', 'around',
'mind', 'people', 'girl', 'leave', 'dream', 'left', 'turn', 'myself',
'give', 'nothing', 'really', 'off', 'before', 'something', 'find',
'walk', 'wish', 'good', 'once', 'place', 'ask', 'stop', 'keep',
'watch', 'seem', 'everything', 'wait', 'got', 'yet', 'made',
'remember', 'start', 'alone', 'run', 'hope', 'maybe', 'believe',
'body', 'hate', 'after', 'close', 'talk', 'stand', 'own', 'each',
'hurt', 'help', 'home', 'god', 'soul', 'new', 'many', 'two',
'inside', 'should', 'true', 'first', 'fear', 'mean', 'better',
'play', 'another', 'gone', 'change', 'use', 'wonder', 'someone',
'hair', 'cold', 'open', 'best', 'any', 'behind', 'happen', 'water',
'dark', 'laugh', 'stay', 'forever', 'name', 'work', 'show', 'sky',
'break', 'came', 'deep', 'door', 'put', 'black', 'together', 'upon',
'happy', 'such', 'great', 'white', 'matter', 'fill', 'past',
'please', 'burn', 'cause', 'enough', 'touch', 'moment', 'soon',
'voice', 'scream', 'anything', 'stare', 'sound', 'red', 'everyone',
'hide', 'kiss', 'truth', 'death', 'beautiful', 'mine', 'blood',
'broken', 'very', 'pass', 'next', 'forget', 'tree', 'wrong', 'air',
'mother', 'understand', 'lip', 'hit', 'wall', 'memory', 'sleep',
'free', 'high', 'realize', 'school', 'might', 'skin', 'sweet',
'perfect', 'blue', 'kill', 'breath', 'dance', 'against', 'fly',
'between', 'grow', 'strong', 'under', 'listen', 'bring', 'sometimes',
'speak', 'pull', 'person', 'become', 'family', 'begin', 'ground',
'real', 'small', 'father', 'sure', 'feet', 'rest', 'young',
'finally', 'land', 'across', 'today', 'different', 'guy', 'line',
'fire', 'reason', 'reach', 'second', 'slowly', 'write', 'eat',
'smell', 'mouth', 'step', 'learn', 'three', 'floor', 'promise',
'breathe', 'darkness', 'push', 'earth', 'guess', 'save', 'song',
'above', 'along', 'both', 'color', 'house', 'almost', 'sorry',
'anymore', 'brother', 'okay', 'dear', 'game', 'fade', 'already',
'apart', 'warm', 'beauty', 'heard', 'notice', 'question', 'shine',
'began', 'piece', 'whole', 'shadow', 'secret', 'street', 'within',
'finger', 'point', 'morning', 'whisper', 'child', 'moon', 'green',
'story', 'glass', 'kid', 'silence', 'since', 'soft', 'yourself',
'empty', 'shall', 'angel', 'answer', 'baby', 'bright', 'dad', 'path',
'worry', 'hour', 'drop', 'follow', 'power', 'war', 'half', 'flow',
'heaven', 'act', 'chance', 'fact', 'least', 'tired', 'children',
'near', 'quite', 'afraid', 'rise', 'sea', 'taste', 'window', 'cover',
'nice', 'trust', 'lot', 'sad', 'cool', 'force', 'peace', 'return',
'blind', 'easy', 'ready', 'roll', 'rose', 'drive', 'held', 'music',
'beneath', 'hang', 'mom', 'paint', 'emotion', 'quiet', 'clear',
'cloud', 'few', 'pretty', 'bird', 'outside', 'paper', 'picture',
'front', 'rock', 'simple', 'anyone', 'meant', 'reality', 'road',
'sense', 'waste', 'bit', 'leaf', 'thank', 'happiness', 'meet', 'men',
'smoke', 'truly', 'decide', 'self', 'age', 'book', 'form', 'alive',
'carry', 'escape', 'damn', 'instead', 'able', 'ice', 'minute',
'throw', 'catch', 'leg', 'ring', 'course', 'goodbye', 'lead', 'poem',
'sick', 'corner', 'desire', 'known', 'problem', 'remind',
'shoulder', 'suppose', 'toward', 'wave', 'drink', 'jump', 'woman',
'pretend', 'sister', 'week', 'human', 'joy', 'crack', 'grey', 'pray',
'surprise', 'dry', 'knee', 'less', 'search', 'bleed', 'caught',
'clean', 'embrace', 'future', 'king', 'son', 'sorrow', 'chest',
'hug', 'remain', 'sat', 'worth', 'blow', 'daddy', 'final', 'parent',
'tight', 'also', 'create', 'lonely', 'safe', 'cross', 'dress',
'evil', 'silent', 'bone', 'fate', 'perhaps', 'anger', 'class',
'scar', 'snow', 'tiny', 'tonight', 'continue', 'control', 'dog',
'edge', 'mirror', 'month', 'suddenly', 'comfort', 'given', 'loud',
'quickly', 'gaze', 'plan', 'rush', 'stone', 'town', 'battle',
'ignore', 'spirit', 'stood', 'stupid', 'yours', 'brown', 'build',
'dust', 'hey', 'kept', 'pay', 'phone', 'twist', 'although', 'ball',
'beyond', 'hidden', 'nose', 'taken', 'fail', 'float', 'pure',
'somehow', 'wash', 'wrap', 'angry', 'cheek', 'creature', 'forgotten',
'heat', 'rip', 'single', 'space', 'special', 'weak', 'whatever',
'yell', 'anyway', 'blame', 'job', 'choose', 'country', 'curse',
'drift', 'echo', 'figure', 'grew', 'laughter', 'neck', 'suffer',
'worse', 'yeah', 'disappear', 'foot', 'forward', 'knife', 'mess',
'somewhere', 'stomach', 'storm', 'beg', 'idea', 'lift', 'offer',
'breeze', 'field', 'five', 'often', 'simply', 'stuck', 'win',
'allow', 'confuse', 'enjoy', 'except', 'flower', 'seek', 'strength',
'calm', 'grin', 'gun', 'heavy', 'hill', 'large', 'ocean', 'shoe',
'sigh', 'straight', 'summer', 'tongue', 'accept', 'crazy',
'everyday', 'exist', 'grass', 'mistake', 'sent', 'shut', 'surround',
'table', 'ache', 'brain', 'destroy', 'heal', 'nature', 'shout',
'sign', 'stain', 'choice', 'doubt', 'glance', 'glow', 'mountain',
'queen', 'stranger', 'throat', 'tomorrow', 'city', 'either', 'fish',
'flame', 'rather', 'shape', 'spin', 'spread', 'ash', 'distance',
'finish', 'image', 'imagine', 'important', 'nobody', 'shatter',
'warmth', 'became', 'feed', 'flesh', 'funny', 'lust', 'shirt',
'trouble', 'yellow', 'attention', 'bare', 'bite', 'money', 'protect',
'amaze', 'appear', 'born', 'choke', 'completely', 'daughter',
'fresh', 'friendship', 'gentle', 'probably', 'six', 'deserve',
'expect', 'grab', 'middle', 'nightmare', 'river', 'thousand',
'weight', 'worst', 'wound', 'barely', 'bottle', 'cream', 'regret',
'relationship', 'stick', 'test', 'crush', 'endless', 'fault',
'itself', 'rule', 'spill', 'art', 'circle', 'join', 'kick', 'mask',
'master', 'passion', 'quick', 'raise', 'smooth', 'unless', 'wander',
'actually', 'broke', 'chair', 'deal', 'favorite', 'gift', 'note',
'number', 'sweat', 'box', 'chill', 'clothes', 'lady', 'mark', 'park',
'poor', 'sadness', 'tie', 'animal', 'belong', 'brush', 'consume',
'dawn', 'forest', 'innocent', 'pen', 'pride', 'stream', 'thick',
'clay', 'complete', 'count', 'draw', 'faith', 'press', 'silver',
'struggle', 'surface', 'taught', 'teach', 'wet', 'bless', 'chase',
'climb', 'enter', 'letter', 'melt', 'metal', 'movie', 'stretch',
'swing', 'vision', 'wife', 'beside', 'crash', 'forgot', 'guide',
'haunt', 'joke', 'knock', 'plant', 'pour', 'prove', 'reveal',
'steal', 'stuff', 'trip', 'wood', 'wrist', 'bother', 'bottom',
'crawl', 'crowd', 'fix', 'forgive', 'frown', 'grace', 'loose',
'lucky', 'party', 'release', 'surely', 'survive', 'teacher',
'gently', 'grip', 'speed', 'suicide', 'travel', 'treat', 'vein',
'written', 'cage', 'chain', 'conversation', 'date', 'enemy',
'however', 'interest', 'million', 'page', 'pink', 'proud', 'sway',
'themselves', 'winter', 'church', 'cruel', 'cup', 'demon',
'experience', 'freedom', 'pair', 'pop', 'purpose', 'respect',
'shoot', 'softly', 'state', 'strange', 'bar', 'birth', 'curl',
'dirt', 'excuse', 'lord', 'lovely', 'monster', 'order', 'pack',
'pants', 'pool', 'scene', 'seven', 'shame', 'slide', 'ugly', 'among',
'blade', 'blonde', 'closet', 'creek', 'deny', 'drug', 'eternity',
'gain', 'grade', 'handle', 'key', 'linger', 'pale', 'prepare',
'swallow', 'swim', 'tremble', 'wheel', 'won', 'cast', 'cigarette',
'claim', 'college', 'direction', 'dirty', 'gather', 'ghost',
'hundred', 'loss', 'lung', 'orange', 'present', 'swear', 'swirl',
'twice', 'wild', 'bitter', 'blanket', 'doctor', 'everywhere',
'flash', 'grown', 'knowledge', 'numb', 'pressure', 'radio', 'repeat',
'ruin', 'spend', 'unknown', 'buy', 'clock', 'devil', 'early',
'false', 'fantasy', 'pound', 'precious', 'refuse', 'sheet', 'teeth',
'welcome', 'add', 'ahead', 'block', 'bury', 'caress', 'content',
'depth', 'despite', 'distant', 'marry', 'purple', 'threw',
'whenever', 'bomb', 'dull', 'easily', 'grasp', 'hospital',
'innocence', 'normal', 'receive', 'reply', 'rhyme', 'shade',
'someday', 'sword', 'toe', 'visit', 'asleep', 'bought', 'center',
'consider', 'flat', 'hero', 'history', 'ink', 'insane', 'muscle',
'mystery', 'pocket', 'reflection', 'shove', 'silently', 'smart',
'soldier', 'spot', 'stress', 'train', 'type', 'view', 'whether',
'bus', 'energy', 'explain', 'holy', 'hunger', 'inch', 'magic', 'mix',
'noise', 'nowhere', 'prayer', 'presence', 'shock', 'snap', 'spider',
'study', 'thunder', 'trail', 'admit', 'agree', 'bag', 'bang',
'bound', 'butterfly', 'cute', 'exactly', 'explode', 'familiar',
'fold', 'further', 'pierce', 'reflect', 'scent', 'selfish', 'sharp',
'sink', 'spring', 'stumble', 'universe', 'weep', 'women',
'wonderful', 'action', 'ancient', 'attempt', 'avoid', 'birthday',
'branch', 'chocolate', 'core', 'depress', 'drunk', 'especially',
'focus', 'fruit', 'honest', 'match', 'palm', 'perfectly', 'pillow',
'pity', 'poison', 'roar', 'shift', 'slightly', 'thump', 'truck',
'tune', 'twenty', 'unable', 'wipe', 'wrote', 'coat', 'constant',
'dinner', 'drove', 'egg', 'eternal', 'flight', 'flood', 'frame',
'freak', 'gasp', 'glad', 'hollow', 'motion', 'peer', 'plastic',
'root', 'screen', 'season', 'sting', 'strike', 'team', 'unlike',
'victim', 'volume', 'warn', 'weird', 'attack', 'await', 'awake',
'built', 'charm', 'crave', 'despair', 'fought', 'grant', 'grief',
'horse', 'limit', 'message', 'ripple', 'sanity', 'scatter', 'serve',
'split', 'string', 'trick', 'annoy', 'blur', 'boat', 'brave',
'clearly', 'cling', 'connect', 'fist', 'forth', 'imagination',
'iron', 'jock', 'judge', 'lesson', 'milk', 'misery', 'nail', 'naked',
'ourselves', 'poet', 'possible', 'princess', 'sail', 'size',
'snake', 'society', 'stroke', 'torture', 'toss', 'trace', 'wise',
'bloom', 'bullet', 'cell', 'check', 'cost', 'darling', 'during',
'footstep', 'fragile', 'hallway', 'hardly', 'horizon', 'invisible',
'journey', 'midnight', 'mud', 'nod', 'pause', 'relax', 'shiver',
'sudden', 'value', 'youth', 'abuse', 'admire', 'blink', 'breast',
'bruise', 'constantly', 'couple', 'creep', 'curve', 'difference',
'dumb', 'emptiness', 'gotta', 'honor', 'plain', 'planet', 'recall',
'rub', 'ship', 'slam', 'soar', 'somebody', 'tightly', 'weather',
'adore', 'approach', 'bond', 'bread', 'burst', 'candle', 'coffee',
'cousin', 'crime', 'desert', 'flutter', 'frozen', 'grand', 'heel',
'hello', 'language', 'level', 'movement', 'pleasure', 'powerful',
'random', 'rhythm', 'settle', 'silly', 'slap', 'sort', 'spoken',
'steel', 'threaten', 'tumble', 'upset', 'aside', 'awkward', 'bee',
'blank', 'board', 'button', 'card', 'carefully', 'complain', 'crap',
'deeply', 'discover', 'drag', 'dread', 'effort', 'entire', 'fairy',
'giant', 'gotten', 'greet', 'illusion', 'jeans', 'leap', 'liquid',
'march', 'mend', 'nervous', 'nine', 'replace', 'rope', 'spine',
'stole', 'terror', 'accident', 'apple', 'balance', 'boom',
'childhood', 'collect', 'demand', 'depression', 'eventually',
'faint', 'glare', 'goal', 'group', 'honey', 'kitchen', 'laid',
'limb', 'machine', 'mere', 'mold', 'murder', 'nerve', 'painful',
'poetry', 'prince', 'rabbit', 'shelter', 'shore', 'shower', 'soothe',
'stair', 'steady', 'sunlight', 'tangle', 'tease', 'treasure',
'uncle', 'begun', 'bliss', 'canvas', 'cheer', 'claw', 'clutch',
'commit', 'crimson', 'crystal', 'delight', 'doll', 'existence',
'express', 'fog', 'football', 'gay', 'goose', 'guard', 'hatred',
'illuminate', 'mass', 'math', 'mourn', 'rich', 'rough', 'skip',
'stir', 'student', 'style', 'support', 'thorn', 'tough', 'yard',
'yearn', 'yesterday', 'advice', 'appreciate', 'autumn', 'bank',
'beam', 'bowl', 'capture', 'carve', 'collapse', 'confusion',
'creation', 'dove', 'feather', 'girlfriend', 'glory', 'government',
'harsh', 'hop', 'inner', 'loser', 'moonlight', 'neighbor', 'neither',
'peach', 'pig', 'praise', 'screw', 'shield', 'shimmer', 'sneak',
'stab', 'subject', 'throughout', 'thrown', 'tower', 'twirl', 'wow',
'army', 'arrive', 'bathroom', 'bump', 'cease', 'cookie', 'couch',
'courage', 'dim', 'guilt', 'howl', 'hum', 'husband', 'insult', 'led',
'lunch', 'mock', 'mostly', 'natural', 'nearly', 'needle', 'nerd',
'peaceful', 'perfection', 'pile', 'price', 'remove', 'roam',
'sanctuary', 'serious', 'shiny', 'shook', 'sob', 'stolen', 'tap',
'vain', 'void', 'warrior', 'wrinkle', 'affection', 'apologize',
'blossom', 'bounce', 'bridge', 'cheap', 'crumble', 'decision',
'descend', 'desperately', 'dig', 'dot', 'flip', 'frighten',
'heartbeat', 'huge', 'lazy', 'lick', 'odd', 'opinion', 'process',
'puzzle', 'quietly', 'retreat', 'score', 'sentence', 'separate',
'situation', 'skill', 'soak', 'square', 'stray', 'taint', 'task',
'tide', 'underneath', 'veil', 'whistle', 'anywhere', 'bedroom',
'bid', 'bloody', 'burden', 'careful', 'compare', 'concern',
'curtain', 'decay', 'defeat', 'describe', 'double', 'dreamer',
'driver', 'dwell', 'evening', 'flare', 'flicker', 'grandma',
'guitar', 'harm', 'horrible', 'hungry', 'indeed', 'lace', 'melody',
'monkey', 'nation', 'object', 'obviously', 'rainbow', 'salt',
'scratch', 'shown', 'shy', 'stage', 'stun', 'third', 'tickle',
'useless', 'weakness', 'worship', 'worthless', 'afternoon', 'beard',
'boyfriend', 'bubble', 'busy', 'certain', 'chin', 'concrete', 'desk',
'diamond', 'doom', 'drawn', 'due', 'felicity', 'freeze', 'frost',
'garden', 'glide', 'harmony', 'hopefully', 'hunt', 'jealous',
'lightning', 'mama', 'mercy', 'peel', 'physical', 'position',
'pulse', 'punch', 'quit', 'rant', 'respond', 'salty', 'sane',
'satisfy', 'savior', 'sheep', 'slept', 'social', 'sport', 'tuck',
'utter', 'valley', 'wolf', 'aim', 'alas', 'alter', 'arrow', 'awaken',
'beaten', 'belief', 'brand', 'ceiling', 'cheese', 'clue',
'confidence', 'connection', 'daily', 'disguise', 'eager', 'erase',
'essence', 'everytime', 'expression', 'fan', 'flag', 'flirt', 'foul',
'fur', 'giggle', 'glorious', 'ignorance', 'law', 'lifeless',
'measure', 'mighty', 'muse', 'north', 'opposite', 'paradise',
'patience', 'patient', 'pencil', 'petal', 'plate', 'ponder',
'possibly', 'practice', 'slice', 'spell', 'stock', 'strife', 'strip',
'suffocate', 'suit', 'tender', 'tool', 'trade', 'velvet', 'verse',
'waist', 'witch', 'aunt', 'bench', 'bold', 'cap', 'certainly',
'click', 'companion', 'creator', 'dart', 'delicate', 'determine',
'dish', 'dragon', 'drama', 'drum', 'dude', 'everybody', 'feast',
'forehead', 'former', 'fright', 'fully', 'gas', 'hook', 'hurl',
'invite', 'juice', 'manage', 'moral', 'possess', 'raw', 'rebel',
'royal', 'scale', 'scary', 'several', 'slight', 'stubborn', 'swell',
'talent', 'tea', 'terrible', 'thread', 'torment', 'trickle',
'usually', 'vast', 'violence', 'weave', 'acid', 'agony', 'ashamed',
'awe', 'belly', 'blend', 'blush', 'character', 'cheat', 'common',
'company', 'coward', 'creak', 'danger', 'deadly', 'defense',
'define', 'depend', 'desperate', 'destination', 'dew', 'duck',
'dusty', 'embarrass', 'engine', 'example', 'explore', 'foe',
'freely', 'frustrate', 'generation', 'glove', 'guilty', 'health',
'hurry', 'idiot', 'impossible', 'inhale', 'jaw', 'kingdom',
'mention', 'mist', 'moan', 'mumble', 'mutter', 'observe', 'ode',
'pathetic', 'pattern', 'pie', 'prefer', 'puff', 'rape', 'rare',
'revenge', 'rude', 'scrape', 'spiral', 'squeeze', 'strain', 'sunset',
'suspend', 'sympathy', 'thigh', 'throne', 'total', 'unseen',
'weapon', 'weary');
}
/**
* @param string $word
* @return int
*/
public function getIndex(string $word): int
{
// create a flipped word list to speed up the searching of words
if (null === $this->wordsFlipped) {
$this->wordsFlipped = array_flip($this->getWords());
}
if (!isset($this->wordsFlipped[$word])) {
throw new \<API key>(__CLASS__ . ' does not contain word ' . $word);
}
return $this->wordsFlipped[$word];
}
}
|
require 'rdf/ntriples'
# override several inspect functions to improve output for what we're doing
class RDF::Literal
def inspect
RDF::NTriples::Writer.serialize(self) + " R:L:(#{self.class.to_s.match(/([^:]*)$/)})"
end
end
class RDF::URI
def inspect
RDF::NTriples::Writer.serialize(self)
end
end
class RDF::Node
def inspect
RDF::NTriples::Writer.serialize(self) + "(#{object_id})"
end
end
class RDF::Graph
def inspect
"\n" + dump(:n3) + "\n"
end
end
class RDF::Query
def inspect
"RDF::Query(#{context ? context.to_sxp : 'nil'})#{patterns.inspect}"
end
end
|
*DECK DGBCO
SUBROUTINE DGBCO (ABD, LDA, N, ML, MU, IPVT, RCOND, Z)
C***BEGIN PROLOGUE DGBCO
C***PURPOSE Factor a band matrix by Gaussian elimination and
C estimate the condition number of the matrix.
C***LIBRARY SLATEC (LINPACK)
C***CATEGORY D2A2
C***TYPE DOUBLE PRECISION (SGBCO-S, DGBCO-D, CGBCO-C)
C***KEYWORDS BANDED, CONDITION NUMBER, LINEAR ALGEBRA, LINPACK,
C MATRIX FACTORIZATION
C***AUTHOR Moler, C. B., (U. of New Mexico)
C***DESCRIPTION
C
C DGBCO factors a double precision band matrix by Gaussian
C elimination and estimates the condition of the matrix.
C
C If RCOND is not needed, DGBFA is slightly faster.
C To solve A*X = B , follow DGBCO by DGBSL.
C To compute INVERSE(A)*C , follow DGBCO by DGBSL.
C To compute DETERMINANT(A) , follow DGBCO by DGBDI.
C
C On Entry
C
C ABD DOUBLE PRECISION(LDA, N)
C contains the matrix in band storage. The columns
C of the matrix are stored in the columns of ABD and
C the diagonals of the matrix are stored in rows
C ML+1 through 2*ML+MU+1 of ABD .
C See the comments below for details.
C
C LDA INTEGER
C the leading dimension of the array ABD .
C LDA must be .GE. 2*ML + MU + 1 .
C
C N INTEGER
C the order of the original matrix.
C
C ML INTEGER
C number of diagonals below the main diagonal.
C 0 .LE. ML .LT. N .
C
C MU INTEGER
C number of diagonals above the main diagonal.
C 0 .LE. MU .LT. N .
C More efficient if ML .LE. MU .
C
C On Return
C
C ABD an upper triangular matrix in band storage and
C the multipliers which were used to obtain it.
C The factorization can be written A = L*U where
C L is a product of permutation and unit lower
C triangular matrices and U is upper triangular.
C
C IPVT INTEGER(N)
C an integer vector of pivot indices.
C
C RCOND DOUBLE PRECISION
C an estimate of the reciprocal condition of A .
C For the system A*X = B , relative perturbations
C in A and B of size EPSILON may cause
C relative perturbations in X of size EPSILON/RCOND .
C If RCOND is so small that the logical expression
C 1.0 + RCOND .EQ. 1.0
C is true, then A may be singular to working
C precision. In particular, RCOND is zero if
C exact singularity is detected or the estimate
C underflows.
C
C Z DOUBLE PRECISION(N)
C a work vector whose contents are usually unimportant.
C If A is close to a singular matrix, then Z is
C an approximate null vector in the sense that
C NORM(A*Z) = RCOND*NORM(A)*NORM(Z) .
C
C Band Storage
C
C If A is a band matrix, the following program segment
C will set up the input.
C
C ML = (band width below the diagonal)
C MU = (band width above the diagonal)
C M = ML + MU + 1
C DO 20 J = 1, N
C I1 = MAX(1, J-MU)
C I2 = MIN(N, J+ML)
C DO 10 I = I1, I2
C K = I - J + M
C ABD(K,J) = A(I,J)
C 10 CONTINUE
C 20 CONTINUE
C
C This uses rows ML+1 through 2*ML+MU+1 of ABD .
C In addition, the first ML rows in ABD are used for
C elements generated during the triangularization.
C The total number of rows needed in ABD is 2*ML+MU+1 .
C The ML+MU by ML+MU upper left triangle and the
C ML by ML lower right triangle are not referenced.
C
C Example: If the original matrix is
C
C 11 12 13 0 0 0
C 21 22 23 24 0 0
C 0 32 33 34 35 0
C 0 0 43 44 45 46
C 0 0 0 54 55 56
C 0 0 0 0 65 66
C
C then N = 6, ML = 1, MU = 2, LDA .GE. 5 and ABD should contain
C
C * * * + + + , * = not used
C * * 13 24 35 46 , + = used for pivoting
C * 12 23 34 45 56
C 11 22 33 44 55 66
C 21 32 43 54 65 *
C
C***REFERENCES J. J. Dongarra, J. R. Bunch, C. B. Moler, and G. W.
C Stewart, LINPACK Users' Guide, SIAM, 1979.
C***ROUTINES CALLED DASUM, DAXPY, DDOT, DGBFA, DSCAL
C***REVISION HISTORY (YYMMDD)
C 780814 DATE WRITTEN
C 890531 Changed all specific intrinsics to generic. (WRB)
C 890831 Modified array declarations. (WRB)
C 890831 REVISION DATE from Version 3.2
C 891214 Prologue converted to Version 4.0 format. (BAB)
C 900326 Removed duplicate information from DESCRIPTION section.
C (WRB)
C 920501 Reformatted the REFERENCES section. (WRB)
C***END PROLOGUE DGBCO
INTEGER LDA,N,ML,MU,IPVT(*)
DOUBLE PRECISION ABD(LDA,*),Z(*)
DOUBLE PRECISION RCOND
C
DOUBLE PRECISION DDOT,EK,T,WK,WKM
DOUBLE PRECISION ANORM,S,DASUM,SM,YNORM
INTEGER IS,INFO,J,JU,K,KB,KP1,L,LA,LM,LZ,M,MM
C
C COMPUTE 1-NORM OF A
C
C***FIRST EXECUTABLE STATEMENT DGBCO
ANORM = 0.0D0
L = ML + 1
IS = L + MU
DO 10 J = 1, N
ANORM = MAX(ANORM,DASUM(L,ABD(IS,J),1))
IF (IS .GT. ML + 1) IS = IS - 1
IF (J .LE. MU) L = L + 1
IF (J .GE. N - ML) L = L - 1
10 CONTINUE
C
C FACTOR
C
CALL DGBFA(ABD,LDA,N,ML,MU,IPVT,INFO)
C
C RCOND = 1/(NORM(A)*(ESTIMATE OF NORM(INVERSE(A)))) .
C ESTIMATE = NORM(Z)/NORM(Y) WHERE A*Z = Y AND TRANS(A)*Y = E .
C TRANS(A) IS THE TRANSPOSE OF A . THE COMPONENTS OF E ARE
C CHOSEN TO CAUSE MAXIMUM LOCAL GROWTH IN THE ELEMENTS OF W WHERE
C TRANS(U)*W = E . THE VECTORS ARE FREQUENTLY RESCALED TO AVOID
C OVERFLOW.
C
C SOLVE TRANS(U)*W = E
C
EK = 1.0D0
DO 20 J = 1, N
Z(J) = 0.0D0
20 CONTINUE
M = ML + MU + 1
JU = 0
DO 100 K = 1, N
IF (Z(K) .NE. 0.0D0) EK = SIGN(EK,-Z(K))
IF (ABS(EK-Z(K)) .LE. ABS(ABD(M,K))) GO TO 30
S = ABS(ABD(M,K))/ABS(EK-Z(K))
CALL DSCAL(N,S,Z,1)
EK = S*EK
30 CONTINUE
WK = EK - Z(K)
WKM = -EK - Z(K)
S = ABS(WK)
SM = ABS(WKM)
IF (ABD(M,K) .EQ. 0.0D0) GO TO 40
WK = WK/ABD(M,K)
WKM = WKM/ABD(M,K)
GO TO 50
40 CONTINUE
WK = 1.0D0
WKM = 1.0D0
50 CONTINUE
KP1 = K + 1
JU = MIN(MAX(JU,MU+IPVT(K)),N)
MM = M
IF (KP1 .GT. JU) GO TO 90
DO 60 J = KP1, JU
MM = MM - 1
SM = SM + ABS(Z(J)+WKM*ABD(MM,J))
Z(J) = Z(J) + WK*ABD(MM,J)
S = S + ABS(Z(J))
60 CONTINUE
IF (S .GE. SM) GO TO 80
T = WKM - WK
WK = WKM
MM = M
DO 70 J = KP1, JU
MM = MM - 1
Z(J) = Z(J) + T*ABD(MM,J)
70 CONTINUE
80 CONTINUE
90 CONTINUE
Z(K) = WK
100 CONTINUE
S = 1.0D0/DASUM(N,Z,1)
CALL DSCAL(N,S,Z,1)
C
C SOLVE TRANS(L)*Y = W
C
DO 120 KB = 1, N
K = N + 1 - KB
LM = MIN(ML,N-K)
IF (K .LT. N) Z(K) = Z(K) + DDOT(LM,ABD(M+1,K),1,Z(K+1),1)
IF (ABS(Z(K)) .LE. 1.0D0) GO TO 110
S = 1.0D0/ABS(Z(K))
CALL DSCAL(N,S,Z,1)
110 CONTINUE
L = IPVT(K)
T = Z(L)
Z(L) = Z(K)
Z(K) = T
120 CONTINUE
S = 1.0D0/DASUM(N,Z,1)
CALL DSCAL(N,S,Z,1)
C
YNORM = 1.0D0
C
C SOLVE L*V = Y
C
DO 140 K = 1, N
L = IPVT(K)
T = Z(L)
Z(L) = Z(K)
Z(K) = T
LM = MIN(ML,N-K)
IF (K .LT. N) CALL DAXPY(LM,T,ABD(M+1,K),1,Z(K+1),1)
IF (ABS(Z(K)) .LE. 1.0D0) GO TO 130
S = 1.0D0/ABS(Z(K))
CALL DSCAL(N,S,Z,1)
YNORM = S*YNORM
130 CONTINUE
140 CONTINUE
S = 1.0D0/DASUM(N,Z,1)
CALL DSCAL(N,S,Z,1)
YNORM = S*YNORM
C
C SOLVE U*Z = W
C
DO 160 KB = 1, N
K = N + 1 - KB
IF (ABS(Z(K)) .LE. ABS(ABD(M,K))) GO TO 150
S = ABS(ABD(M,K))/ABS(Z(K))
CALL DSCAL(N,S,Z,1)
YNORM = S*YNORM
150 CONTINUE
IF (ABD(M,K) .NE. 0.0D0) Z(K) = Z(K)/ABD(M,K)
IF (ABD(M,K) .EQ. 0.0D0) Z(K) = 1.0D0
LM = MIN(K,M) - 1
LA = M - LM
LZ = K - LM
T = -Z(K)
CALL DAXPY(LM,T,ABD(LA,K),1,Z(LZ),1)
160 CONTINUE
C MAKE ZNORM = 1.0
S = 1.0D0/DASUM(N,Z,1)
CALL DSCAL(N,S,Z,1)
YNORM = S*YNORM
C
IF (ANORM .NE. 0.0D0) RCOND = YNORM/ANORM
IF (ANORM .EQ. 0.0D0) RCOND = 0.0D0
RETURN
END
|
#include "Rendering.h"
<API key>::<API key>(Cauldron::TriangleSoup3V3N2T * S)
{
// find texture resource
_Soup = S;
_TextureResource = cauldron::FindTexture(S->GetTexturePtr());
_Compiled = false;
}
<API key>::~<API key>()
{
glDeleteLists(_DisplayList, 1);
}
void <API key>::render(fConfiguration config)
{
if(!_Compiled)
{
_DisplayList = glGenLists(1);
glNewList(_DisplayList, GL_COMPILE);
int vElem = (3 + 3 + 2) * sizeof(GLfloat);
SwitchVertexBuffer(0);
/*
ClientStateArrays (true,true,false,false,true,false);
glVertexPointer(3, GL_FLOAT, vElem, _Soup->GetVertexDataPtr() );
glNormalPointer(GL_FLOAT, vElem, _Soup->GetVertexDataPtr() + 3);
glTexCoordPointer(2, GL_FLOAT, vElem, _Soup->GetVertexDataPtr() + 6);
*/
MapVNTPointers(8 * sizeof(GLfloat) , _Soup->GetVertexDataPtr(), _Soup->GetVertexDataPtr() + 3, _Soup->GetVertexDataPtr() + 6, 2);
Rendering::UseMaterial(_Soup->GetMaterial());
glDrawElements(GL_TRIANGLES, _Soup->GetIndicesSize(), GL_UNSIGNED_INT, _Soup->GetIndicesPtr() );
glEndList();
_Compiled = true;
}
glPushMatrix();
glMultMatrixd(config._glMatrix);
glCallList(_DisplayList);
glPopMatrix();
}
unsigned int <API key>::getTextureAttrib()
{
return _TextureResource;
}
void <API key>::destroy()
{
delete this;
}
|
title: ""
permalink: /sds/2/x/db/<API key>/
sidebar:
nav: "lMenu-SDS-2.x"
[As an importable databricks notebook](https://lamastex.github.io/<API key>/sds/2/x/db/<API key>.html)
<iframe src="https://lamastex.github.io/<API key>/sds/2/x/db/<API key>" width="1080" height="1080" frameborder="0"></iframe>
|
var convert = require('./convert');
module.exports = convert('split', require('../split'));
|
"""
Amazon MWS Finances API
"""
from __future__ import absolute_import
from ..mws import MWS
# from .. import utils
from ..decorators import next_token_action
class Finances(MWS):
URI = "/Finances/2015-05-01"
VERSION = "2015-05-01"
NS = '{https://mws.amazonservices.com/Finances/2015-05-01}'
<API key> = [
'<API key>',
'ListFinancialEvents',
]
@next_token_action('<API key>')
def <API key>(self, created_after=None, created_before=None, max_results=None, next_token=None):
data = {
'Action': '<API key>',
'<API key>': created_after,
'<API key>': created_before,
'MaxResultsPerPage': max_results,
}
return self.make_request(data)
def <API key>(self, token):
return self.<API key>(next_token=token)
@next_token_action('ListFinancialEvents')
def <API key>(self, <API key>=None, amazon_order_id=None, posted_after=None,
posted_before=None, max_results=None, next_token=None):
data = {
'Action': 'ListFinancialEvents',
'<API key>': <API key>,
'AmazonOrderId': amazon_order_id,
'PostedAfter': posted_after,
'PostedBefore': posted_before,
'MaxResultsPerPage': max_results,
}
return self.make_request(data)
def <API key>(self, token):
return self.<API key>(next_token=token)
|
package app.logic.activity.live;
public class CarouselImgInfo {
private String carousel_id ;
private String update_time ;
private String descr ;
private String create_time ;
private String image ;
private String address ;
public CarouselImgInfo(){
}
public String getCarousel_id() {
return carousel_id;
}
public void setCarousel_id(String carousel_id) {
this.carousel_id = carousel_id;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getUpdate_time() {
return update_time;
}
public void setUpdate_time(String update_time) {
this.update_time = update_time;
}
public String getDescription() {
return descr;
}
public void setDescription(String description) {
this.descr = description;
}
public String getCreate_time() {
return create_time;
}
public void setCreate_time(String create_time) {
this.create_time = create_time;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
}
|
#!/usr/bin/python -u
from __future__ import print_function
import json
import optparse
import sys
import subprocess
parser = optparse.OptionParser()
parser.add_option('--buck-test-info')
(options, args) = parser.parse_args()
if options.buck_test_info is not None:
with open(options.buck_test_info) as f:
test_infos = json.load(f)
for info in test_infos:
subprocess.call(info['command'])
|
/* $NetBSD: stdio.h,v 1.88 2013/05/04 18:30:14 christos Exp $ */
#ifndef _STDIO_H_
#define _STDIO_H_
#include <sys/cdefs.h>
#include <sys/featuretest.h>
#include <sys/ansi.h>
#ifdef _BSD_SIZE_T_
typedef _BSD_SIZE_T_ size_t;
#undef _BSD_SIZE_T_
#endif
#ifdef _BSD_SSIZE_T_
typedef _BSD_SSIZE_T_ ssize_t;
#undef _BSD_SSIZE_T_
#endif
#if defined(_POSIX_C_SOURCE)
#ifndef __VA_LIST_DECLARED
typedef __va_list va_list;
#define __VA_LIST_DECLARED
#endif
#endif
#include <sys/null.h>
/*
* This is fairly grotesque, but pure ANSI code must not inspect the
* innards of an fpos_t anyway. The library internally uses off_t,
* which we assume is exactly as big as eight chars.
*/
typedef struct __sfpos {
__off_t _pos;
__mbstate_t _mbstate_in, _mbstate_out;
} fpos_t;
#define _FSTDIO /* Define for new stdio with functions. */
/*
* NB: to fit things in six character monocase externals, the stdio
* code uses the prefix `__s' for stdio objects, typically followed
* by a three-character attempt at a mnemonic.
*/
/* stdio buffers */
struct __sbuf {
unsigned char *_base;
int _size;
};
/*
* stdio state variables.
*
* The following always hold:
*
* if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
* _lbfsize is -_bf._size, else _lbfsize is 0
* if _flags&__SRD, _w is 0
* if _flags&__SWR, _r is 0
*
* This ensures that the getc and putc macros (or inline functions) never
* try to write or read from a file that is in `read' or `write' mode.
* (Moreover, they can, and do, automatically switch from read mode to
* write mode, and back, on "r+" and "w+" files.)
*
* _lbfsize is used only to make the inline line-buffered output stream
* code as compact as possible.
*
* _ub, _up, and _ur are used when ungetc() pushes back more characters
* than fit in the current _bf, or when ungetc() pushes back a character
* that does not match the previous one in _bf. When this happens,
* _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
* _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
*
* NB: see WARNING above before changing the layout of this structure!
*/
typedef struct __sFILE {
unsigned char *_p; /* current position in (some) buffer */
int _r; /* read space left for getc() */
int _w; /* write space left for putc() */
unsigned short _flags; /* flags, below; this FILE is free if 0 */
short _file; /* fileno, if Unix descriptor, else -1 */
struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */
int _lbfsize; /* 0 or -_bf._size, for inline putc */
/* operations */
void *_cookie; /* cookie passed to io functions */
int (*_close)(void *);
ssize_t (*_read) (void *, void *, size_t);
__off_t (*_seek) (void *, __off_t, int);
ssize_t (*_write)(void *, const void *, size_t);
/* file extension */
struct __sbuf _ext;
/* separate buffer for long sequences of ungetc() */
unsigned char *_up; /* saved _p when _p is doing ungetc data */
int _ur; /* saved _r when _r is counting ungetc data */
/* tricks to meet minimum requirements even when malloc() fails */
unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
unsigned char _nbuf[1]; /* guarantee a getc() buffer */
int (*_flush)(void *);
/* Formerly used by fgetln/fgetwln; kept for binary compatibility */
char _lb_unused[sizeof(struct __sbuf) - sizeof(int (*)(void *))];
/* Unix stdio files get aligned to block boundaries on fseek() */
int _blksize; /* stat.st_blksize (may be != _bf._size) */
__off_t _offset; /* current lseek offset */
} FILE;
__BEGIN_DECLS
extern FILE __sF[3];
__END_DECLS
#define __SLBF 0x0001 /* line buffered */
#define __SNBF 0x0002 /* unbuffered */
#define __SRD 0x0004 /* OK to read */
#define __SWR 0x0008 /* OK to write */
/* RD and WR are never simultaneously asserted */
#define __SRW 0x0010 /* open for reading & writing */
#define __SEOF 0x0020 /* found EOF */
#define __SERR 0x0040 /* found error */
#define __SMBF 0x0080 /* _buf is from malloc */
#define __SAPP 0x0100 /* fdopen()ed in append mode */
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
#define __SOPT 0x0400 /* do fseek() optimization */
#define __SNPT 0x0800 /* do not do fseek() optimization */
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
#define __SMOD 0x2000 /* true => fgetln modified _p text */
#define __SALC 0x4000 /* allocate string space dynamically */
/*
* The following three definitions are for ANSI C, which took them
* from System V, which brilliantly took internal interface macros and
* made them official arguments to setvbuf(), without renaming them.
* Hence, these ugly _IOxxx names are *supposed* to appear in user code.
*
* Although numbered as their counterparts above, the implementation
* does not rely on this.
*/
#define _IOFBF 0 /* setvbuf should set fully buffered */
#define _IOLBF 1 /* setvbuf should set line buffered */
#define _IONBF 2 /* setvbuf should set unbuffered */
#define BUFSIZ 1024 /* size of buffer used by setbuf */
#define EOF (-1)
/*
* FOPEN_MAX is a minimum maximum, and is the number of streams that
* stdio can provide without attempting to allocate further resources
* (which could fail). Do not use this for anything.
*/
/* must be == _POSIX_STREAM_MAX <limits.h> */
#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
#define P_tmpdir "/var/tmp/"
#endif
#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
/* Always ensure that this is consistent with <limits.h> */
#ifndef TMP_MAX
#define TMP_MAX 308915776 /* Legacy */
#endif
/* Always ensure that these are consistent with <fcntl.h> and <unistd.h>! */
#ifndef SEEK_SET
#define SEEK_SET 0 /* set file offset to offset */
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1 /* set file offset to current plus offset */
#endif
#ifndef SEEK_END
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
#define stdin (&__sF[0])
#define stdout (&__sF[1])
#define stderr (&__sF[2])
/*
* Functions defined in ANSI C standard.
*/
__BEGIN_DECLS
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
char *fgets(char * __restrict, int, FILE * __restrict);
FILE *fopen(const char * __restrict , const char * __restrict);
int fprintf(FILE * __restrict, const char * __restrict, ...)
__printflike(2, 3);
int fputc(int, FILE *);
int fputs(const char * __restrict, FILE * __restrict);
size_t fread(void * __restrict, size_t, size_t, FILE * __restrict);
FILE *freopen(const char * __restrict, const char * __restrict,
FILE * __restrict);
int fscanf(FILE * __restrict, const char * __restrict, ...)
__scanflike(2, 3);
int fseek(FILE *, long, int);
long ftell(FILE *);
size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
int getc(FILE *);
int getchar(void);
ssize_t getdelim(char ** __restrict, size_t * __restrict, int,
FILE * __restrict);
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
void perror(const char *);
int printf(const char * __restrict, ...)
__printflike(1, 2);
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
void rewind(FILE *);
int scanf(const char * __restrict, ...)
__scanflike(1, 2);
void setbuf(FILE * __restrict, char * __restrict);
int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
int sscanf(const char * __restrict, const char * __restrict, ...)
__scanflike(2, 3);
FILE *tmpfile(void);
int ungetc(int, FILE *);
int vfprintf(FILE * __restrict, const char * __restrict, __va_list)
__printflike(2, 0);
int vprintf(const char * __restrict, __va_list)
__printflike(1, 0);
#ifndef __AUDIT__
char *gets(char *);
int sprintf(char * __restrict, const char * __restrict, ...)
__printflike(2, 3);
char *tmpnam(char *);
int vsprintf(char * __restrict, const char * __restrict,
__va_list)
__printflike(2, 0);
#endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
int rename (const char *, const char *) __RENAME(__posix_rename);
#else
int rename (const char *, const char *);
#endif
__END_DECLS
#ifndef __LIBC12_SOURCE__
int fgetpos(FILE * __restrict, fpos_t * __restrict) __RENAME(__fgetpos50);
int fsetpos(FILE *, const fpos_t *) __RENAME(__fsetpos50);
#endif
/*
* IEEE Std 1003.1-90
*/
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(_NETBSD_SOURCE)
#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */
#define L_cuserid 9 /* size for cuserid(); UT_NAMESIZE + 1 */
__BEGIN_DECLS
char *ctermid(char *);
#ifndef __CUSERID_DECLARED
#define __CUSERID_DECLARED
/* also declared in unistd.h */
char *cuserid(char *);
#endif /* __CUSERID_DECLARED */
FILE *fdopen(int, const char *);
int fileno(FILE *);
__END_DECLS
#endif /* not ANSI */
/*
* IEEE Std 1003.1c-95, also adopted by X/Open CAE Spec Issue 5 Version 2
*/
#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
defined(_REENTRANT) || defined(_NETBSD_SOURCE)
__BEGIN_DECLS
void flockfile(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
__END_DECLS
#endif /* _POSIX_C_SOURCE >= 1995056 || _XOPEN_SOURCE >= 500 || ... */
/*
* Functions defined in POSIX 1003.2 and XPG2 or later.
*/
#if (_POSIX_C_SOURCE - 0) >= 2 || (_XOPEN_SOURCE - 0) >= 2 || \
defined(_NETBSD_SOURCE)
__BEGIN_DECLS
int pclose(FILE *);
FILE *popen(const char *, const char *);
__END_DECLS
#endif
/*
* Functions defined in ISO XPG4.2, ISO C99, POSIX 1003.1-2001 or later.
*/
#if ((__STDC_VERSION__ - 0) >= 199901L) || \
((_POSIX_C_SOURCE - 0) >= 200112L) || \
(defined(_XOPEN_SOURCE) && defined(<API key>)) || \
((_XOPEN_SOURCE - 0) >= 500) || \
defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
__BEGIN_DECLS
int snprintf(char * __restrict, size_t, const char * __restrict, ...)
__printflike(3, 4);
int vsnprintf(char * __restrict, size_t, const char * __restrict,
__va_list)
__printflike(3, 0);
__END_DECLS
#endif
/*
* Functions defined in XPG4.2.
*/
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
__BEGIN_DECLS
int getw(FILE *);
int putw(int, FILE *);
#ifndef __AUDIT__
char *tempnam(const char *, const char *);
#endif
__END_DECLS
#endif
/*
* X/Open CAE Specification Issue 5 Version 2
*/
#if (_XOPEN_SOURCE - 0) >= 500 || defined(_LARGEFILE_SOURCE) || \
defined(_NETBSD_SOURCE)
#ifndef off_t
typedef __off_t off_t;
#define off_t __off_t
#endif /* off_t */
__BEGIN_DECLS
int fseeko(FILE *, off_t, int);
off_t ftello(FILE *);
__END_DECLS
#endif /* _XOPEN_SOURCE >= 500 || _LARGEFILE_SOURCE || _NETBSD_SOURCE */
/*
* Functions defined in ISO C99. Still put under _NETBSD_SOURCE due to
* backward compatible.
*/
#if defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
__BEGIN_DECLS
int vscanf(const char * __restrict, __va_list)
__scanflike(1, 0);
int vfscanf(FILE * __restrict, const char * __restrict, __va_list)
__scanflike(2, 0);
int vsscanf(const char * __restrict, const char * __restrict,
__va_list)
__scanflike(2, 0);
__END_DECLS
#endif /* _ISOC99_SOURCE || _NETBSD_SOURCE */
/*
* Routines that are purely local.
*/
#if defined(_NETBSD_SOURCE)
#define FPARSELN_UNESCESC 0x01
#define FPARSELN_UNESCCONT 0x02
#define FPARSELN_UNESCCOMM 0x04
#define FPARSELN_UNESCREST 0x08
#define FPARSELN_UNESCALL 0x0f
__BEGIN_DECLS
int asprintf(char ** __restrict, const char * __restrict, ...)
__printflike(2, 3);
char *fgetln(FILE * __restrict, size_t * __restrict);
char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
int fpurge(FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char ** __restrict, const char * __restrict,
__va_list)
__printflike(2, 0);
const char *fmtcheck(const char *, const char *)
__format_arg(2);
__END_DECLS
/*
* Stdio function-access interface.
*/
__BEGIN_DECLS
FILE *funopen(const void *,
int (*)(void *, char *, int),
int (*)(void *, const char *, int),
off_t (*)(void *, off_t, int),
int (*)(void *));
FILE *funopen2(const void *,
ssize_t (*)(void *, void *, size_t),
ssize_t (*)(void *, const void *, size_t),
off_t (*)(void *, off_t, int),
int (*)(void *),
int (*)(void *));
__END_DECLS
#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
#define fropen2(cookie, fn) funopen2(cookie, fn, 0, 0, 0, 0)
#define fwopen2(cookie, fn) funopen2(cookie, 0, fn, 0, 0, 0)
#endif /* _NETBSD_SOURCE */
/*
* Functions internal to the implementation.
*/
__BEGIN_DECLS
int __srget(FILE *);
int __swbuf(int, FILE *);
__END_DECLS
/*
* The __sfoo macros are here so that we can
* define function versions in the C library.
*/
#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
#if defined(__GNUC__) && defined(__STDC__)
static __inline int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
return (__swbuf(_c, _p));
}
#else
/*
* This has been tuned to generate reasonable code on the vax using pcc.
*/
#define __sputc(c, p) \
(--(p)->_w < 0 ? \
(p)->_w >= (p)->_lbfsize ? \
(*(p)->_p = (c)), *(p)->_p != '\n' ? \
(int)*(p)->_p++ : \
__swbuf('\n', p) : \
__swbuf((int)(c), p) : \
(*(p)->_p = (c), (int)*(p)->_p++))
#endif
#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
#define __sferror(p) (((p)->_flags & __SERR) != 0)
#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
#define __sfileno(p) \
((p)->_file == -1 ? -1 : (int)(unsigned short)(p)->_file)
#if !defined(__lint__) && !defined(__cplusplus)
#if !defined(_REENTRANT) && !defined(_PTHREADS)
#define feof(p) __sfeof(p)
#define ferror(p) __sferror(p)
#define clearerr(p) __sclearerr(p)
#define getc(fp) __sgetc(fp)
#define putc(x, fp) __sputc(x, fp)
#endif /* !_REENTRANT && !_PTHREADS */
#define getchar() getc(stdin)
#define putchar(x) putc(x, stdout)
#endif /* !__lint__ && !__cplusplus */
#if (defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(_NETBSD_SOURCE)) && !defined(__cplusplus)
#if !defined(_REENTRANT) && !defined(_PTHREADS)
#define fileno(p) __sfileno(p)
#endif /* !_REENTRANT && !_PTHREADS */
#endif /* !_ANSI_SOURCE && !__cplusplus*/
#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
int vdprintf(int, const char * __restrict, __va_list)
__printflike(2, 0);
int dprintf(int, const char * __restrict, ...)
__printflike(2, 3);
#endif /* (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE) */
#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
defined(_REENTRANT) || defined(_NETBSD_SOURCE) && !defined(__cplusplus)
#define getc_unlocked(fp) __sgetc(fp)
#define putc_unlocked(x, fp) __sputc(x, fp)
#define getchar_unlocked() getc_unlocked(stdin)
#define putchar_unlocked(x) putc_unlocked(x, stdout)
#endif /* _POSIX_C_SOURCE >= 199506 || _XOPEN_SOURCE >= 500 || _REENTRANT... */
#if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0) >= 700 || \
defined(_NETBSD_SOURCE)
FILE *fmemopen(void * __restrict, size_t, const char * __restrict);
#endif
#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
# ifndef __LOCALE_T_DECLARED
typedef struct _locale *locale_t;
# define __LOCALE_T_DECLARED
# endif
__BEGIN_DECLS
int fprintf_l(FILE * __restrict, locale_t, const char * __restrict, ...)
__printflike(3, 4);
int vfprintf_l(FILE * __restrict, locale_t, const char * __restrict,
__va_list) __printflike(3, 0);
int printf_l(locale_t, const char * __restrict, ...)
__printflike(2, 3);
int vprintf_l(locale_t, const char * __restrict, __va_list)
__printflike(2, 0);
int asprintf_l(char ** __restrict, locale_t, const char * __restrict, ...)
__printflike(3, 4);
int vasprintf_l(char ** __restrict, locale_t, const char * __restrict,
__va_list)
__printflike(3, 0);
int vdprintf_l(int, locale_t, const char * __restrict, __va_list)
__printflike(3, 0);
int dprintf_l(int, locale_t, const char * __restrict, ...)
__printflike(3, 4);
int snprintf_l(char * __restrict, size_t, locale_t,
const char * __restrict, ...) __printflike(4, 5);
int vsnprintf_l(char * __restrict, size_t, locale_t,
const char * __restrict, __va_list) __printflike(4, 0);
#ifndef __AUDIT__
int sprintf_l(char * __restrict, locale_t, const char * __restrict, ...)
__printflike(3, 4);
int vsprintf_l(char * __restrict, locale_t, const char * __restrict,
__va_list) __printflike(3, 0);
#endif
int fscanf_l(FILE * __restrict, locale_t, const char * __restrict, ...)
__scanflike(3, 4);
int scanf_l(locale_t, const char * __restrict, ...)
__scanflike(2, 3);
int sscanf_l(const char * __restrict, locale_t,
const char * __restrict, ...) __scanflike(3, 4);
int vscanf_l(locale_t, const char * __restrict, __va_list)
__scanflike(2, 0);
int vscanf_l(locale_t, const char * __restrict, __va_list)
__scanflike(2, 0);
int vfscanf_l(FILE * __restrict, locale_t, const char * __restrict,
__va_list) __scanflike(3, 0);
int vsscanf_l(const char * __restrict, locale_t, const char * __restrict,
__va_list) __scanflike(3, 0);
#ifdef _NETBSD_SOURCE
int snprintf_ss(char *restrict, size_t, const char * __restrict, ...)
__printflike(3, 4);
int vsnprintf_ss(char *restrict, size_t, const char * __restrict, __va_list)
__printflike(3, 0);
#endif
__END_DECLS
#endif
#if _FORTIFY_SOURCE > 0
#include <ssp/stdio.h>
#endif
#endif /* _STDIO_H_ */
|
goog.provide('ng.material.components.icon');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.icon
* @description
* Icon
*/
angular.module('material.components.icon', ['material.core']);
angular
.module('material.components.icon')
.directive('mdIcon', ['$mdIcon', '$mdTheming', '$mdAria', mdIconDirective]);
function mdIconDirective($mdIcon, $mdTheming, $mdAria ) {
return {
restrict: 'E',
link : postLink
};
/**
* Directive postLink
* Supports embedded SVGs, font-icons, & external SVGs
*/
function postLink(scope, element, attr) {
$mdTheming(element);
prepareForFontIcon();
// If using a font-icon, then the textual name of the icon itself
// provides the aria-label.
var label = attr.alt || attr.mdFontIcon || attr.mdSvgIcon || element.text();
var attrName = attr.$normalize(attr.$attr.mdSvgIcon || attr.$attr.mdSvgSrc || '');
if ( !attr['aria-label'] ) {
if (label !== '' && !parentsHaveText() ) {
$mdAria.expect(element, 'aria-label', label);
$mdAria.expect(element, 'role', 'img');
} else if ( !element.text() ) {
// If not a font-icon with ligature, then
// hide from the accessibility layer.
$mdAria.expect(element, 'aria-hidden', 'true');
}
}
if (attrName) {
// Use either pre-configured SVG or URL source, respectively.
attr.$observe(attrName, function(attrVal) {
element.empty();
if (attrVal) {
$mdIcon(attrVal)
.then(function(svg) {
element.empty();
element.append(svg);
});
}
});
}
function parentsHaveText() {
var parent = element.parent();
if (parent.attr('aria-label') || parent.text()) {
return true;
}
else if(parent.parent().attr('aria-label') || parent.parent().text()) {
return true;
}
return false;
}
function prepareForFontIcon() {
if (!attr.mdSvgIcon && !attr.mdSvgSrc) {
if (attr.mdFontIcon) {
element.addClass('md-font ' + attr.mdFontIcon);
}
element.addClass($mdIcon.fontSet(attr.mdFontSet));
}
}
}
}
angular
.module('material.components.icon' )
.provider('$mdIcon', MdIconProvider);
/**
* @ngdoc service
* @name $mdIconProvider
* @module material.components.icon
*
* @description
* `$mdIconProvider` is used only to register icon IDs with URLs. These configuration features allow
* icons and icon sets to be pre-registered and associated with source URLs **before** the `<md-icon />`
* directives are compiled.
*
* If using font-icons, the developer is responsible for loading the fonts.
*
* If using SVGs, loading of the actual svg files are deferred to on-demand requests and are loaded
* internally by the `$mdIcon` service using the `$http` service. When an SVG is requested by name/ID,
* the `$mdIcon` service searches its registry for the associated source URL;
* that URL is used to on-demand load and parse the SVG dynamically.
*
* **Notice:** Most font-icons libraries do not support ligatures (for example `fontawesome`).<br/>
* In such cases you are not able to use the icon's ligature name - Like so:
*
* <hljs lang="html">
* <md-icon md-font-set="fa">fa-bell</md-icon>
* </hljs>
*
* You should instead use the given unicode, instead of the ligature name.
*
* <p ng-hide="true"> ##// Notice we can't use a hljs element here, because the characters will be escaped.</p>
* ```html
* <md-icon md-font-set="fa"></md-icon>
* ```
*
* All unicode ligatures are prefixed with the `&#x` string.
*
* @usage
* <hljs lang="js">
* app.config(function($mdIconProvider) {
*
* // Configure URLs for icons specified by [set:]id.
*
* $mdIconProvider
* .defaultFontSet( 'fa' ) // This sets our default fontset className.
* .defaultIconSet('my/app/icons.svg') // Register a default set of SVG icons
* .iconSet('social', 'my/app/social.svg') // Register a named icon set of SVGs
* .icon('android', 'my/app/android.svg') // Register a specific icon (by name)
* .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set
* });
* </hljs>
*
* SVG icons and icon sets can be easily pre-loaded and cached using either (a) a build process or (b) a runtime
* **startup** process (shown below):
*
* <hljs lang="js">
* app.config(function($mdIconProvider) {
*
* // Register a default set of SVG icon definitions
* $mdIconProvider.defaultIconSet('my/app/icons.svg')
*
* })
* .run(function($http, $templateCache){
*
* // Pre-fetch icons sources by URL and cache in the $templateCache...
* // subsequent $http calls will look there first.
*
* var urls = [ 'imy/app/icons.svg', 'img/icons/android.svg'];
*
* angular.forEach(urls, function(url) {
* $http.get(url, {cache: $templateCache});
* });
*
* });
*
* </hljs>
*
* NOTE: the loaded SVG data is subsequently cached internally for future requests.
*
*/
/**
* @ngdoc method
* @name $mdIconProvider#icon
*
* @description
* Register a source URL for a specific icon name; the name may include optional 'icon set' name prefix.
* These icons will later be retrieved from the cache using `$mdIcon( <icon name> )`
*
* @param {string} id Icon name/id used to register the icon
* @param {string} url specifies the external location for the data file. Used internally by `$http` to load the
* data or as part of the lookup in `$templateCache` if pre-loading was configured.
* @param {number=} viewBoxSize Sets the width and height the icon's viewBox.
* It is ignored for icons with an existing viewBox. Default size is 24.
*
* @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API
*
* @usage
* <hljs lang="js">
* app.config(function($mdIconProvider) {
*
* // Configure URLs for icons specified by [set:]id.
*
* $mdIconProvider
* .icon('android', 'my/app/android.svg') // Register a specific icon (by name)
* .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set
* });
* </hljs>
*
*/
/**
* @ngdoc method
* @name $mdIconProvider#iconSet
*
* @description
* Register a source URL for a 'named' set of icons; group of SVG definitions where each definition
* has an icon id. Individual icons can be subsequently retrieved from this cached set using
* `$mdIcon(<icon set name>:<icon name>)`
*
* @param {string} id Icon name/id used to register the iconset
* @param {string} url specifies the external location for the data file. Used internally by `$http` to load the
* data or as part of the lookup in `$templateCache` if pre-loading was configured.
* @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set.
* It is ignored for icons with an existing viewBox. All icons in the icon set should be the same size.
* Default value is 24.
*
* @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API
*
*
* @usage
* <hljs lang="js">
* app.config(function($mdIconProvider) {
*
* // Configure URLs for icons specified by [set:]id.
*
* $mdIconProvider
* .iconSet('social', 'my/app/social.svg') // Register a named icon set
* });
* </hljs>
*
*/
/**
* @ngdoc method
* @name $mdIconProvider#defaultIconSet
*
* @description
* Register a source URL for the default 'named' set of icons. Unless explicitly registered,
* subsequent lookups of icons will failover to search this 'default' icon set.
* Icon can be retrieved from this cached, default set using `$mdIcon(<name>)`
*
* @param {string} url specifies the external location for the data file. Used internally by `$http` to load the
* data or as part of the lookup in `$templateCache` if pre-loading was configured.
* @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set.
* It is ignored for icons with an existing viewBox. All icons in the icon set should be the same size.
* Default value is 24.
*
* @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API
*
* @usage
* <hljs lang="js">
* app.config(function($mdIconProvider) {
*
* // Configure URLs for icons specified by [set:]id.
*
* $mdIconProvider
* .defaultIconSet( 'my/app/social.svg' ) // Register a default icon set
* });
* </hljs>
*
*/
/**
* @ngdoc method
* @name $mdIconProvider#defaultFontSet
*
* @description
* When using Font-Icons, Angular Material assumes the the Material Design icons will be used and automatically
* configures the default font-set == 'material-icons'. Note that the font-set references the font-icon library
* class style that should be applied to the `<md-icon>`.
*
* Configuring the default means that the attributes
* `md-font-set="material-icons"` or `class="material-icons"` do not need to be explicitly declared on the
* `<md-icon>` markup. For example:
*
* `<md-icon> face </md-icon>`
* will render as
* `<span class="material-icons"> face </span>`, and
*
* `<md-icon md-font-set="fa"> face </md-icon>`
* will render as
* `<span class="fa"> face </span>`
*
* @param {string} name of the font-library style that should be applied to the md-icon DOM element
*
* @usage
* <hljs lang="js">
* app.config(function($mdIconProvider) {
* $mdIconProvider.defaultFontSet( 'fa' );
* });
* </hljs>
*
*/
/**
* @ngdoc method
* @name $mdIconProvider#fontSet
*
* @description
* When using a font set for `<md-icon>` you must specify the correct font classname in the `md-font-set`
* attribute. If the fonset className is really long, your markup may become cluttered... an easy
* solution is to define an `alias` for your fontset:
*
* @param {string} alias of the specified fontset.
* @param {string} className of the fontset.
*
* @usage
* <hljs lang="js">
* app.config(function($mdIconProvider) {
* // In this case, we set an alias for the `material-icons` fontset.
* $mdIconProvider.fontSet('md', 'material-icons');
* });
* </hljs>
*
*/
/**
* @ngdoc method
* @name $mdIconProvider#defaultViewBoxSize
*
* @description
* While `<md-icon />` markup can also be style with sizing CSS, this method configures
* the default width **and** height used for all icons; unless overridden by specific CSS.
* The default sizing is (24px, 24px).
* @param {number=} viewBoxSize Sets the width and height of the viewBox for an icon or an icon set.
* All icons in a set should be the same size. The default value is 24.
*
* @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API
*
* @usage
* <hljs lang="js">
* app.config(function($mdIconProvider) {
*
* // Configure URLs for icons specified by [set:]id.
*
* $mdIconProvider
* .defaultViewBoxSize(36) // Register a default icon size (width == height)
* });
* </hljs>
*
*/
var config = {
defaultViewBoxSize: 24,
defaultFontSet: 'material-icons',
fontSets : [ ]
};
function MdIconProvider() { }
MdIconProvider.prototype = {
icon : function (id, url, viewBoxSize) {
if ( id.indexOf(':') == -1 ) id = '$default:' + id;
config[id] = new ConfigurationItem(url, viewBoxSize );
return this;
},
iconSet : function (id, url, viewBoxSize) {
config[id] = new ConfigurationItem(url, viewBoxSize );
return this;
},
defaultIconSet : function (url, viewBoxSize) {
var setName = '$default';
if ( !config[setName] ) {
config[setName] = new ConfigurationItem(url, viewBoxSize );
}
config[setName].viewBoxSize = viewBoxSize || config.defaultViewBoxSize;
return this;
},
defaultViewBoxSize : function (viewBoxSize) {
config.defaultViewBoxSize = viewBoxSize;
return this;
},
/**
* Register an alias name associated with a font-icon library style ;
*/
fontSet : function fontSet(alias, className) {
config.fontSets.push({
alias : alias,
fontSet : className || alias
});
return this;
},
/**
* Specify a default style name associated with a font-icon library
* fallback to Material Icons.
*
*/
defaultFontSet : function defaultFontSet(className) {
config.defaultFontSet = !className ? '' : className;
return this;
},
defaultIconSize : function defaultIconSize(iconSize) {
config.defaultIconSize = iconSize;
return this;
},
preloadIcons: function ($templateCache) {
var iconProvider = this;
var svgRegistry = [
{
id : 'md-tabs-arrow',
url: 'md-tabs-arrow.svg',
svg: '<svg version="1.1" x="0px" y="0px" viewBox="0 0 24 24"><g><polygon points="15.4,7.4 14,6 8,12 14,18 15.4,16.6 10.8,12 "/></g></svg>'
},
{
id : 'md-close',
url: 'md-close.svg',
svg: '<svg version="1.1" x="0px" y="0px" viewBox="0 0 24 24"><g><path d="M19 6.41l-1.41-1.41-5.59 5.59-5.59-5.59-1.41 1.41 5.59 5.59-5.59 5.59 1.41 1.41 5.59-5.59 5.59 5.59 1.41-1.41-5.59-5.59z"/></g></svg>'
},
{
id: 'md-cancel',
url: 'md-cancel.svg',
svg: '<svg version="1.1" x="0px" y="0px" viewBox="0 0 24 24"><g><path d="M12 2c-5.53 0-10 4.47-10 10s4.47 10 10 10 10-4.47 10-10-4.47-10-10-10zm5 13.59l-1.41 1.41-3.59-3.59-3.59 3.59-1.41-1.41 3.59-3.59-3.59-3.59 1.41-1.41 3.59 3.59 3.59-3.59 1.41 1.41-3.59 3.59 3.59 3.59z"/></g></svg>'
},
{
id: 'md-menu',
url: 'md-menu.svg',
svg: '<svg version="1.1" x="0px" y="0px" viewBox="0 0 24 24"><path d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" /></svg>'
},
{
id: 'md-toggle-arrow',
url: 'md-toggle-arrow-svg',
svg: '<svg version="1.1" x="0px" y="0px" viewBox="0 0 48 48"><path d="M24 16l-12 12 2.83 2.83 9.17-9.17 9.17 9.17 2.83-2.83z"/><path d="M0 0h48v48h-48z" fill="none"/></svg>'
},
{
id: 'md-calendar',
url: 'md-calendar.svg',
svg: '<svg xmlns="http:
}
];
svgRegistry.forEach(function(asset){
iconProvider.icon(asset.id, asset.url);
$templateCache.put(asset.url, asset.svg);
});
},
$get : ['$http', '$q', '$log', '$templateCache', '$mdUtil', function($http, $q, $log, $templateCache, $mdUtil) {
this.preloadIcons($templateCache);
return MdIconService(config, $http, $q, $log, $templateCache, $mdUtil);
}]
};
/**
* Configuration item stored in the Icon registry; used for lookups
* to load if not already cached in the `loaded` cache
*/
function ConfigurationItem(url, viewBoxSize) {
this.url = url;
this.viewBoxSize = viewBoxSize || config.defaultViewBoxSize;
}
/**
* @ngdoc service
* @name $mdIcon
* @module material.components.icon
*
* @description
* The `$mdIcon` service is a function used to lookup SVG icons.
*
* @param {string} id Query value for a unique Id or URL. If the argument is a URL, then the service will retrieve the icon element
* from its internal cache or load the icon and cache it first. If the value is not a URL-type string, then an ID lookup is
* performed. The Id may be a unique icon ID or may include an iconSet ID prefix.
*
* For the **id** query to work properly, this means that all id-to-URL mappings must have been previously configured
* using the `$mdIconProvider`.
*
* @returns {obj} Clone of the initial SVG DOM element; which was created from the SVG markup in the SVG data file.
*
* @usage
* <hljs lang="js">
* function SomeDirective($mdIcon) {
*
* // See if the icon has already been loaded, if not
* // then lookup the icon from the registry cache, load and cache
* // it for future requests.
* // NOTE: ID queries require configuration with $mdIconProvider
*
* $mdIcon('android').then(function(iconEl) { element.append(iconEl); });
* $mdIcon('work:chair').then(function(iconEl) { element.append(iconEl); });
*
* // Load and cache the external SVG using a URL
*
* $mdIcon('img/icons/android.svg').then(function(iconEl) {
* element.append(iconEl);
* });
* };
* </hljs>
*
* NOTE: The `<md-icon /> ` directive internally uses the `$mdIcon` service to query, loaded, and instantiate
* SVG DOM elements.
*/
/* ngInject */
function MdIconService(config, $http, $q, $log, $templateCache, $mdUtil) {
var iconCache = {};
var urlRegex = /[-\w@:%\+.~#?&//=]{2,}\.[a-z]{2,4}\b(\/[-\w@:%\+.~#?&//=]*)?/i;
var dataUrlRegex = /^data:image\/svg\+xml[\s*;\w\-\=]*?(base64)?,(.*)$/i;
Icon.prototype = { clone : cloneSVG, prepare: prepareAndStyle };
getIcon.fontSet = <API key>;
// Publish service...
return getIcon;
/**
* Actual $mdIcon service is essentially a lookup function
*/
function getIcon(id) {
id = id || '';
// If already loaded and cached, use a clone of the cached icon.
// Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.
if ( iconCache[id] ) return $q.when( transformClone(iconCache[id]) );
if ( urlRegex.test(id) || dataUrlRegex.test(id) ) return loadByURL(id).then( cacheIcon(id) );
if ( id.indexOf(':') == -1 ) id = '$default:' + id;
var load = config[id] ? loadByID : loadFromIconSet;
return load(id)
.then( cacheIcon(id) );
}
/**
* Lookup registered fontSet style using its alias...
* If not found,
*/
function <API key>(alias) {
var useDefault = angular.isUndefined(alias) || !(alias && alias.length);
if ( useDefault ) return config.defaultFontSet;
var result = alias;
angular.forEach(config.fontSets, function(it){
if ( it.alias == alias ) result = it.fontSet || result;
});
return result;
}
function transformClone(cacheElement) {
var clone = cacheElement.clone();
var cacheSuffix = '_cache' + $mdUtil.nextUid();
// We need to modify for each cached icon the id attributes.
// This is needed because SVG id's are treated as normal DOM ids
// and should not have a duplicated id.
if (clone.id) clone.id += cacheSuffix;
angular.forEach(clone.querySelectorAll('[id]'), function (item) {
item.id += cacheSuffix;
});
return clone;
}
/**
* Prepare and cache the loaded icon for the specified `id`
*/
function cacheIcon( id ) {
return function updateCache( icon ) {
iconCache[id] = isIcon(icon) ? icon : new Icon(icon, config[id]);
return iconCache[id].clone();
};
}
/**
* Lookup the configuration in the registry, if !registered throw an error
* otherwise load the icon [on-demand] using the registered URL.
*
*/
function loadByID(id) {
var iconConfig = config[id];
return loadByURL(iconConfig.url).then(function(icon) {
return new Icon(icon, iconConfig);
});
}
/**
* Loads the file as XML and uses querySelector( <id> ) to find
* the desired node...
*/
function loadFromIconSet(id) {
var setName = id.substring(0, id.lastIndexOf(':')) || '$default';
var iconSetConfig = config[setName];
return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);
function extractFromSet(set) {
var iconName = id.slice(id.lastIndexOf(':') + 1);
var icon = set.querySelector('#' + iconName);
return !icon ? announceIdNotFound(id) : new Icon(icon, iconSetConfig);
}
function announceIdNotFound(id) {
var msg = 'icon ' + id + ' not found';
$log.warn(msg);
return $q.reject(msg || id);
}
}
/**
* Load the icon by URL (may use the $templateCache).
* Extract the data for later conversion to Icon
*/
function loadByURL(url) {
/* Load the icon from embedded data URL. */
function loadByDataUrl(url) {
var results = dataUrlRegex.exec(url);
var isBase64 = /base64/i.test(url);
var data = isBase64 ? window.atob(results[2]) : results[2];
return $q.when(angular.element(data)[0]);
}
/* Load the icon by URL using HTTP. */
function loadByHttpUrl(url) {
return $http
.get(url, { cache: $templateCache })
.then(function(response) {
return angular.element('<div>').append(response.data).find('svg')[0];
}).catch(announceNotFound);
}
return dataUrlRegex.test(url)
? loadByDataUrl(url)
: loadByHttpUrl(url);
}
/**
* Catch HTTP or generic errors not related to incorrect icon IDs.
*/
function announceNotFound(err) {
var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);
$log.warn(msg);
return $q.reject(msg);
}
/**
* Check target signature to see if it is an Icon instance.
*/
function isIcon(target) {
return angular.isDefined(target.element) && angular.isDefined(target.config);
}
/**
* Define the Icon class
*/
function Icon(el, config) {
if (el && el.tagName != 'svg') {
el = angular.element('<svg xmlns="http:
}
// Inject the namespace if not available...
if ( !el.getAttribute('xmlns') ) {
el.setAttribute('xmlns', "http:
}
this.element = el;
this.config = config;
this.prepare();
}
/**
* Prepare the DOM element that will be cached in the
* loaded iconCache store.
*/
function prepareAndStyle() {
var viewBoxSize = this.config ? this.config.viewBoxSize : config.defaultViewBoxSize;
angular.forEach({
'fit' : '',
'height': '100%',
'width' : '100%',
'preserveAspectRatio': 'xMidYMid meet',
'viewBox' : this.element.getAttribute('viewBox') || ('0 0 ' + viewBoxSize + ' ' + viewBoxSize),
'focusable': false // Disable IE11s default behavior to make SVGs focusable
}, function(val, attr) {
this.element.setAttribute(attr, val);
}, this);
}
/**
* Clone the Icon DOM element.
*/
function cloneSVG(){
// If the element or any of its children have a style attribute, then a CSP policy without
// 'unsafe-inline' in the style-src directive, will result in a violation.
return this.element.cloneNode(true);
}
}
MdIconService.$inject = ["config", "$http", "$q", "$log", "$templateCache", "$mdUtil"];
ng.material.components.icon = angular.module("material.components.icon");
|
import Config from '../../Config';
import Component from './Component';
import Assets from '../../utils/assets';
class ErrorSet extends Component {
constructor() {
super();
}
public render(): void {
let width: number = this.config.get('width'),
height: number = this.config.get('height'),
marginLeft: number = this.config.get('marginLeft'),
errorImagePosition: number[] = this.config.get('errorImagePosition');
this.svg.select('.spinner').style('opacity', 0);
this.svg.append('g')
.attr('class', 'warning')
.style('opacity', 1)
.html(Assets.WARNING);
this.svg.select('.svg-warning')
.attr('width', 200)
.attr('height', 200)
.attr('x', width / 2 - 100)
.attr('y', height / 2 - 100);
if (errorImagePosition) {
this.translate(errorImagePosition[0], errorImagePosition[1]);
}
}
public update(data: [{}]) {
if (typeof data !== undefined && data.length != 0) {
this.svg.select('.warning').style('opacity', 0);
}
}
public transition() {}
public clear() {}
translate(x: number, y: number) {
this.svg.select('.svg-warning')
.attr('x', x)
.attr('y', y);
}
}
export default ErrorSet;
|
class StorageProfile < ApplicationRecord
belongs_to :<API key>
has_many :<API key>, :dependent => :destroy
has_many :storages, :through => :<API key>
has_many :vms_and_templates, :dependent => :nullify
has_many :disks, :dependent => :nullify
end
|
package org.andidev.applicationname.entity.abstracts;
import java.util.UUID;
import javax.persistence.*;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.<API key>;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.data.jpa.domain.AbstractPersistable;
import static org.apache.commons.lang3.builder.ToStringStyle.*;
import org.hibernate.<API key>;
@EqualsAndHashCode(of = "uuid", callSuper = false)
@Setter
@Getter
@MappedSuperclass
public class IdUuidVersionEntity extends AbstractPersistable<Long> {
@Column(unique = true)
@Setter(AccessLevel.PROTECTED)
private String uuid = UUID.randomUUID().toString();
@Version
@Setter(AccessLevel.PROTECTED)
private Long version;
@Override
public String toString() {
try {
return <API key>.reflectionToString(this, SHORT_PREFIX_STYLE);
} catch (<API key> e) {
return new ToStringBuilder(this, SHORT_PREFIX_STYLE)
.append("id", getId())
.append("uuid", getUuid())
.append("version", getVersion())
.toString();
}
}
}
|
# File: Leaf.pm
# Description: Read Creo Leaf EXIF meta information
# Revisions: 09/28/2005 - P. Harvey Created
package Image::ExifTool::Leaf;
use strict;
use vars qw($VERSION);
use Image::ExifTool qw(:DataAccess :Utils);
use Image::ExifTool::Exif;
$VERSION = '1.07';
sub ProcessLeaf($$$);
%Image::ExifTool::Leaf::Main = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Camera' },
NOTES => q{
These tags are found in .MOS images from Leaf digital camera backs as
written by Creo Leaf Capture. They exist within the Leaf-specific directory
structure of EXIF tag 0x8606. The tables below list observed Leaf tags,
however ExifTool will extract any tags found in the Leaf directories even if
they don't appear in these tables.
},
icc_camera_profile => {
Name => 'ICC_Profile',
SubDirectory => {
TagTable => 'Image::ExifTool::ICC_Profile::Main',
},
},
icc_rgb_ws_profile => {
Name => 'RGB_Profile',
SubDirectory => {
TagTable => 'Image::ExifTool::ICC_Profile::Main',
},
},
camera_profile => {
Name => 'CameraProfile',
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::CameraProfile',
},
},
JPEG_preview_data => {
%Image::ExifTool::previewImageTagInfo,
Groups => { 2 => 'Preview' },
},
JPEG_preview_info => 'PreviewInfo',
<API key> => {
Name => 'ToneSpaceFlow',
Description => 'ICC To Tone Space Flow',
Format => 'int16u',
},
<API key> => {
Name => 'ToneMatrix',
Description => 'ICC To Tone Matrix',
Format => 'int8u',
Binary => 1,
},
PDA_histogram_data => {
Name => 'PDAHistogram',
Binary => 1,
},
<API key> => {
Name => 'PatternAngle',
Description => 'Pattern Rotation Angle',
Format => 'int16u',
Notes => '"ratation" is not a typo',
},
back_serial_number => {
Name => 'BackSerial',
Description => 'Back Serial Number',
PrintConv => '$val =~ s/ .*//s; $val',
},
image_offset => { Format => 'int16u' },
);
%Image::ExifTool::Leaf::CameraProfile = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Camera' },
CamProf_version => '<API key>',
CamProf_name => 'CameraName',
CamProf_type => 'CameraType',
CamProf_back_type => 'CameraBackType',
CamProf_back_type => {
Name => 'CameraBackType',
},
<API key> => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::CaptureProfile',
},
},
<API key> => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::ImageProfile',
},
},
);
%Image::ExifTool::Leaf::CaptureProfile = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Image' },
CaptProf_version => {},
CaptProf_name => {},
CaptProf_type => {},
CaptProf_back_type => {},
<API key> => {
Name => 'CaptureSerial',
Description => 'Capture Serial Number',
PrintConv => '$val =~ s/ .*//s; $val',
},
<API key> => {},
<API key> => {},
<API key> => 'XYOffsetInfo',
<API key> => {},
<API key>=> {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key>=>{},
<API key> => {},
<API key> => {},
<API key> => {},
CaptProf_CCD_rect => {},
<API key> => {},
<API key> => {},
);
%Image::ExifTool::Leaf::ImageProfile = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Image' },
ImgProf_version => {},
ImgProf_name => {},
ImgProf_type => {},
ImgProf_back_type => {},
ImgProf_shoot_setup => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::ShootSetup',
},
},
<API key> => {},
<API key> => {},
);
%Image::ExifTool::Leaf::ShootSetup = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Image' },
ShootObj_version => {},
ShootObj_name => {},
ShootObj_type => {},
ShootObj_back_type => {},
<API key> => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::CaptureSetup',
},
},
<API key> => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::ColorSetup',
},
},
ShootObj_save_setup => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::SaveSetup',
},
},
<API key> => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::CameraSetup',
},
},
<API key> => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::LookHeader',
},
},
);
%Image::ExifTool::Leaf::CaptureSetup = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Image' },
CaptureObj_version => {},
CaptureObj_name => {},
CaptureObj_type => {},
<API key> => {},
CaptureObj_neutals => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::Neutrals',
},
},
<API key> => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::Selection',
},
},
<API key> => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::ToneCurve',
},
},
<API key> => {
SubDirectory => {
TagTable => 'Image::ExifTool::Leaf::Sharpness',
},
},
<API key> => {},
<API key> => {},
);
%Image::ExifTool::Leaf::Neutrals = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Image' },
NeutObj_version => {},
NeutObj_name => {},
NeutObj_type => {},
NeutObj_back_type => {},
NeutObj_neutrals => {},
NeutObj_color_casts => {},
<API key> => {},
<API key> => {},
);
%Image::ExifTool::Leaf::Selection = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Image' },
SelObj_version => {},
SelObj_name => {},
SelObj_type => {},
SelObj_back_type => {},
SelObj_rect => {},
SelObj_resolution => {},
SelObj_scale => {},
SelObj_locks => {},
SelObj_orientation => {},
);
%Image::ExifTool::Leaf::ToneCurve = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Image' },
ToneObj_version => {},
ToneObj_name => {},
ToneObj_type => {},
ToneObj_back_type => {},
ToneObj_npts => {},
ToneObj_tones => {},
ToneObj_gamma => {},
);
%Image::ExifTool::Leaf::Sharpness = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Image' },
SharpObj_version => {},
SharpObj_name => {},
SharpObj_type => {},
SharpObj_back_type => {},
<API key> => {},
SharpObj_data_len => {},
SharpObj_sharp_info => {},
);
%Image::ExifTool::Leaf::ColorSetup = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Image' },
ColorObj_version => {},
ColorObj_name => {},
ColorObj_type => {},
ColorObj_back_type => {},
ColorObj_has_ICC => {},
<API key> => {},
<API key> => {},
ColorObj_color_mode => {},
ColorObj_color_type => {},
);
%Image::ExifTool::Leaf::SaveSetup = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Other' },
SaveObj_version => {},
SaveObj_name => {},
SaveObj_type => {},
SaveObj_back_type => {},
<API key>=> {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
<API key> => {},
SaveObj_std_oxygen => {},
<API key> => {},
<API key> => {},
<API key> => {},
);
%Image::ExifTool::Leaf::CameraSetup = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Camera' },
CameraObj_version => {},
CameraObj_name => {},
CameraObj_type => {},
CameraObj_back_type => {},
CameraObj_ISO_speed => {},
CameraObj_strobe => {},
<API key> => {},
CameraObj_lens_type => {},
CameraObj_lens_ID => {},
);
%Image::ExifTool::Leaf::LookHeader = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Other' },
LookHead_version => {},
LookHead_name => {},
LookHead_type => {},
LookHead_back_type => {},
);
# tag table for any unknown Leaf directories
%Image::ExifTool::Leaf::Unknown = (
PROCESS_PROC => \&ProcessLeaf,
GROUPS => { 0 => 'Leaf', 2 => 'Unknown' },
);
# table for Leaf SubIFD entries
%Image::ExifTool::Leaf::SubIFD = (
GROUPS => { 0 => 'MakerNotes', 1 => 'LeafSubIFD', 2 => 'Image'},
WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
NOTES => q{
Leaf writes a TIFF-format sub-IFD inside IFD0 of a MOS image. No tags in
this sub-IFD are currently known, except for tags 0x8602 and 0x8606 which
really shouldn't be here anyway (so they don't appear in the table below)
because they duplicate references to the same data from tags with the same
ID in IFD0.
},
);
# prepare Leaf tables by generating tag 'Name' and table 'NOTES'
{
my @tableList = ( 'Image::ExifTool::Leaf::Main' );
my ($tag, %doneTable);
# keep prefix in tag name of common tags
my %keepPrefix = ( Version=>1, Name=>1, Type=>1, BackType=>1 );
while (@tableList) {
my $table = shift @tableList;
next if $doneTable{$table};
my $prefix = ($table =~ /::Main$/) ? undef : '';
$doneTable{$table} = 1;
no strict 'refs';
$table = \%$table;
use strict 'refs';
foreach $tag (keys %$table) {
my $tagInfo = $$table{$tag};
next unless ref $tagInfo eq 'HASH';
next if $tag eq 'GROUPS';
if (defined $prefix and not $prefix) {
($prefix = $tag) =~ s/_.*
}
unless ($$tagInfo{Name}) {
my $name;
($name = $tag) =~ s/_(.)/\U$1/g;
if ($prefix) {
$name =~ s/^$prefix
$name = $prefix . $name if $keepPrefix{$name};
}
$$tagInfo{Name} = ucfirst($name);
}
next unless $$tagInfo{SubDirectory};
my $subTable = $tagInfo->{SubDirectory}->{TagTable};
next unless $subTable =~ /::Leaf::/;
push @tableList, $subTable;
}
next unless $prefix;
$$table{NOTES} = "All B<Tag ID>'s in the following table have a " .
"leading '${prefix}_' which\nhas been removed.\n";
}
}
# Process Leaf information
# Inputs: 0) ExifTool object reference
# 1) Reference to directory information hash
# 2) Pointer to tag table for this directory
# Returns: 1 on success, otherwise returns 0 and sets a Warning
sub ProcessLeaf($$$)
{
my ($et, $dirInfo, $tagTablePtr) = @_;
my $dataPt = $$dirInfo{DataPt};
my $dirStart = $$dirInfo{DirStart} || 0;
my $dirLen = $$dirInfo{DirLen} || $$dirInfo{DataLen} - $dirStart;
my $dirEnd = $dirStart + $dirLen;
my $verbose = $et->Options('Verbose');
my $pos = $dirStart;
my $hdrLen = 52; # header length for PKTS information
my $success;
$verbose and $et->VerboseDir('Leaf');
for (;;) {
last if $pos + $hdrLen > $dirEnd;
my $header = substr($$dataPt, $pos, $hdrLen);
last unless substr($header, 0, 4) eq 'PKTS';
$success = 1;
my $size = Get32u(\$header, 48);
$pos += $hdrLen;
if ($pos + $size > $dirEnd) {
$et->Warn('Truncated Leaf data');
last;
}
my $tag = substr($header, 8, 40);
$tag =~ s/\0.*
next unless $tag;
my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
# generate tag info for unknown tags
my $val;
if ($tagInfo and $$tagInfo{Format}) {
$val = ReadValue($dataPt, $pos, $$tagInfo{Format}, undef, $size);
} else {
$val = substr($$dataPt, $pos, $size);
}
unless ($tagInfo) {
my $name = ucfirst($tag);
$name =~ s/_(.)/\U$1/g;
if ($val =~ /^PKTS\0\0\0\x01/) {
# also unpack unknown directories
$tagInfo = {
Name => $name,
SubDirectory => { TagTable => 'Image::ExifTool::Leaf::Unknown' },
};
} elsif ($tagTablePtr ne \%Image::ExifTool::Leaf::Main or
$et->Options('Unknown'))
{
$tagInfo = {
Name => $name,
Writable => 0,
PrintConv => 'length($val) > 60 ? substr($val,0,55) . "[...]" : $val',
};
# make tags in main table unknown because they tend to be binary
$$tagInfo{Unknown} = 1 if $tagTablePtr eq \%Image::ExifTool::Leaf::Main;
}
$tagInfo and AddTagToTable($tagTablePtr, $tag, $tagInfo);
}
if ($verbose) {
$et->VerboseInfo($tag, $tagInfo,
Table => $tagTablePtr,
Value => $val,
DataPt => $dataPt,
DataPos => $$dirInfo{DataPos},
Size => $size,
Start => $pos,
);
}
if ($tagInfo) {
if ($$tagInfo{SubDirectory}) {
my %subdirInfo = (
DataPt => $dataPt,
DirLen => $size,
DirStart => $pos,
DataPos => $$dirInfo{DataPos},
DirName => 'Leaf PKTS',
);
my $subTable = GetTagTable($tagInfo->{SubDirectory}->{TagTable});
$et->ProcessDirectory(\%subdirInfo, $subTable);
} else {
$val =~ tr/\n/ /; # translate newlines to spaces
$val =~ s/\0+$//; # remove null terminators
$et->FoundTag($tagInfo, $val);
}
}
$pos += $size;
}
$success or $et->Warn('Bad format Leaf data');
return $success;
}
1; # end
__END__
=head1 NAME
Image::ExifTool::Leaf - Read Creo Leaf EXIF meta information
=head1 SYNOPSIS
This module is loaded automatically by Image::ExifTool when required.
=head1 DESCRIPTION
This module contains definitions required by Image::ExifTool to interpret
meta information from Leaf digital camera backs written by Creo Leaf
Capture.
=head1 AUTHOR
Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 SEE ALSO
L<Image::ExifTool::TagNames/Leaf Tags>,
L<Image::ExifTool(3pm)|Image::ExifTool>
=cut
|
package gridsim.datagrid;
import gridsim.ParameterException;
/**
* A class for representing a physical file in a DataGrid environment
*
* @author Uros Cibej and Anthony Sulistio
* @since GridSim Toolkit 4.0
*/
public class File {
private String name_; // logical file name
private FileAttribute attr_; // a file attribute
// a transaction time for adding / getting /deleting this file
private double transTime_;
/** Denotes that this file has not been registered to a Replica Catalogue */
public static final int NOT_REGISTERED = -1;
/** Denotes that the type of this file is unknown */
public static final int TYPE_UNKOWN = 0;
/** Denotes that the type of this file is a raw data */
public static final int TYPE_RAW_DATA = 1;
/** Denotes that the type of this file is a reconstructed data */
public static final int <API key> = 2;
/** Denotes that the type of this file is a tag data */
public static final int TYPE_TAG_DATA = 3;
/**
* Creates a new DataGrid file with a given size (in MBytes). <br>
* NOTE: By default, a newly-created file is set to a <b>master</b> copy.
* @param fileName file name
* @param fileSize file size is in MBytes
* @throws ParameterException This happens when one of the following
* scenarios occur:
* <ul>
* <li> the file name is empty or <tt>null</tt>
* <li> the file size is zero or negative numbers
* </ul>
*/
public File(String fileName, int fileSize) throws ParameterException
{
if (fileName == null || fileName.length() == 0) {
throw new ParameterException("File(): Error - invalid file name.");
}
if (fileSize <= 0) {
throw new ParameterException("File(): Error - size <= 0.");
}
name_ = fileName;
attr_ = new FileAttribute(fileName, fileSize);
transTime_ = 0;
}
/**
* Copy constructor, i.e. cloning from a source file into this object,
* but this object is set to a <b>replica</b>
* @param file the source of a File object to copy
* @throws ParameterException This happens when the source file is
* <tt>null</tt>
*/
public File(File file) throws ParameterException
{
if (file == null) {
throw new ParameterException("File(): Error - file is null.");
}
// copy the attributes into the file
FileAttribute fileAttr = file.getFileAttribute();
attr_.copyValue(fileAttr);
fileAttr.setMasterCopy(false); // set this file to replica
}
/**
* Clone this file but the clone file is set to a <b>replica</b>
* @return a clone of this file (as a replica)
* or <tt>null</tt> if an error occurs
*/
public File makeReplica() {
return makeCopy();
}
/**
* Clone this file and make the new file as a <b>master</b> copy as well
* @return a clone of this file (as a master copy)
* or <tt>null</tt> if an error occurs
*/
public File makeMasterCopy()
{
File file = makeCopy();
if (file != null) {
file.setMasterCopy(true);
}
return file;
}
/**
* Makes a copy of this file
* @return a clone of this file (as a replica)
* or <tt>null</tt> if an error occurs
*/
private File makeCopy()
{
File file = null;
try
{
file = new File(name_, attr_.getFileSize());
FileAttribute fileAttr = file.getFileAttribute();
attr_.copyValue(fileAttr);
fileAttr.setMasterCopy(false); // set this file to replica
}
catch (Exception e) {
file = null;
}
return file;
}
/**
* Gets an attribute of this file
* @return a file attribute
*/
public FileAttribute getFileAttribute() {
return attr_;
}
/**
* Gets the size of this object (in byte).<br>
* NOTE: This object size is NOT the actual file size. Moreover,
* this size is used for transferring this object over a network.
* @return the object size (in byte)
*/
public int getAttributeSize() {
return attr_.getAttributeSize();
}
/**
* Sets the resource ID that stores this file
* @param resourceID a resource ID
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/
public boolean setResourceID(int resourceID) {
return attr_.setResourceID(resourceID);
}
/**
* Gets the resource ID that stores this file
* @return the resource ID
*/
public int getResourceID() {
return attr_.getResourceID();
}
/**
* Returns the file name
* @return the file name
*/
public String getName() {
return attr_.getName();
}
/**
* Sets the file name
* @param name the file name
*/
public void setName(String name) {
attr_.setName(name);
}
/**
* Sets the owner name of this file
* @param name the owner name
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/
public boolean setOwnerName(String name) {
return attr_.setOwnerName(name);
}
/**
* Gets the owner name of this file
* @return the owner name or <tt>null</tt> if empty
*/
public String getOwnerName() {
return attr_.getOwnerName();
}
/**
* Gets the file size (in MBytes)
* @return the file size (in MBytes)
*/
public int getSize() {
return attr_.getFileSize();
}
/**
* Gets the file size (in bytes)
* @return the file size (in bytes)
*/
public int getSizeInByte() {
return attr_.getFileSizeInByte();
}
/**
* Sets the file size (in MBytes)
* @param fileSize the file size (in MBytes)
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/
public boolean setFileSize(int fileSize) {
return attr_.setFileSize(fileSize);
}
/**
* Sets the last update time of this file (in seconds)<br>
* NOTE: This time is relative to the start time. Preferably use
* {@link gridsim.GridSim#clock()} method.
* @param time the last update time (in seconds)
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/
public boolean setUpdateTime(double time) {
return attr_.setUpdateTime(time);
}
/**
* Gets the last update time (in seconds)
* @return the last update time (in seconds)
*/
public double getLastUpdateTime() {
return attr_.getLastUpdateTime();
}
/**
* Sets the file registration ID (published by a Replica Catalogue entity)
* @param id registration ID
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/
public boolean setRegistrationID(int id) {
return attr_.setRegistrationID(id);
}
/**
* Gets the file registration ID
* @return registration ID
*/
public int getRegistrationID() {
return attr_.getRegistrationID();
}
/**
* Sets the file type (e.g. raw, tag, etc)
* @param type a file type
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/
public boolean setType(int type) {
return attr_.setType(type);
}
/**
* Gets this file type
* @return file type
*/
public int getType() {
return attr_.getType();
}
/**
* Sets the checksum of this file
* @param checksum the checksum of this file
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/
public boolean setChecksum(int checksum) {
return attr_.setChecksum(checksum);
}
/**
* Gets the file checksum
* @return file checksum
*/
public int getChecksum() {
return attr_.getChecksum();
}
/**
* Sets the cost associated with this file
* @param cost cost of this file
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
*/
public boolean setCost(double cost) {
return attr_.setCost(cost);
}
/**
* Gets the cost associated with this file
* @return the cost of this file
*/
public double getCost() {
return attr_.getCost();
}
/**
* Gets the file creation time (in millisecond)
* @return the file creation time (in millisecond)
*/
public long getCreationTime() {
return attr_.getCreationTime();
}
/**
* Checks if this file already registered to a Replica Catalogue
* @return <tt>true</tt> if it is registered, <tt>false</tt> otherwise
*/
public boolean isRegistered() {
return attr_.isRegistered();
}
/**
* Marks this file as a master copy or replica
* @param masterCopy a flag denotes <tt>true</tt> for master copy or
* <tt>false</tt> for a replica
*/
public void setMasterCopy(boolean masterCopy) {
attr_.setMasterCopy(masterCopy);
}
/**
* Checks whether this file is a master copy or replica
* @return <tt>true</tt> if it is a master copy or <tt>false</tt> otherwise
*/
public boolean isMasterCopy() {
return attr_.isMasterCopy();
}
/**
* Marks this file as a read only or not
* @param readOnly a flag denotes <tt>true</tt> for read only or
* <tt>false</tt> for re-writeable
*/
public void setReadOnly(boolean readOnly) {
attr_.setReadOnly(readOnly);
}
/**
* Checks whether this file is a read only or not
* @return <tt>true</tt> if it is a read only or <tt>false</tt> otherwise
*/
public boolean isReadOnly() {
return attr_.isReadOnly();
}
/**
* Sets the current transaction time (in second) of this file.
* This transaction time can be related to the operation of adding /
* deleting / getting this file on a resource's storage.
* @param time the transaction time (in second)
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
* @see gridsim.datagrid.storage.Storage#addFile(File)
* @see gridsim.datagrid.storage.Storage#addFile(List)
* @see gridsim.datagrid.storage.Storage#addReservedFile(File)
* @see gridsim.datagrid.storage.Storage#deleteFile(File)
* @see gridsim.datagrid.storage.Storage#deleteFile(String)
* @see gridsim.datagrid.storage.Storage#deleteFile(String, File)
* @see gridsim.datagrid.storage.Storage#getFile(String)
* @see gridsim.datagrid.storage.Storage#renameFile(File, String)
*/
public boolean setTransactionTime(double time)
{
if (time < 0) {
return false;
}
transTime_ = time;
return true;
}
/**
* Gets the last transaction time of this file (in second).
* @return the transaction time (in second)
*/
public double getTransactionTime() {
return transTime_;
}
}
|
package jef.database.routing.sql;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jef.database.Condition.Operator;
import jef.database.jdbc.result.ResultSetContainer;
import jef.database.jdbc.statement.<API key>;
import jef.database.jsqlparser.RemovedDelayProcess;
import jef.database.jsqlparser.expression.BinaryExpression;
import jef.database.jsqlparser.expression.BinaryExpression.Prior;
import jef.database.jsqlparser.expression.Column;
import jef.database.jsqlparser.expression.JpqlParameter;
import jef.database.jsqlparser.expression.Parenthesis;
import jef.database.jsqlparser.expression.Table;
import jef.database.jsqlparser.expression.operators.relational.Between;
import jef.database.jsqlparser.expression.operators.relational.EqualsTo;
import jef.database.jsqlparser.expression.operators.relational.ExpressionList;
import jef.database.jsqlparser.expression.operators.relational.InExpression;
import jef.database.jsqlparser.statement.select.Limit;
import jef.database.jsqlparser.statement.select.PlainSelect;
import jef.database.jsqlparser.statement.select.Select;
import jef.database.jsqlparser.statement.select.StartWithExpression;
import jef.database.jsqlparser.visitor.Expression;
import jef.database.jsqlparser.visitor.ExpressionType;
import jef.database.jsqlparser.visitor.SqlValue;
import jef.database.jsqlparser.visitor.Statement;
import jef.database.jsqlparser.visitor.VisitorAdapter;
import jef.database.query.ParameterProvider;
import jef.database.wrapper.clause.InMemoryPaging;
import jef.database.wrapper.clause.<API key>;
import jef.database.wrapper.populator.ColumnDescription;
import jef.database.wrapper.populator.ColumnMeta;
import jef.tools.PageLimit;
import jef.tools.StringUtils;
import com.alibaba.druid.proxy.jdbc.JdbcParameter;
public class SqlAndParameter implements <API key> {
public Statement statement;
public List<Object> params;
private ParameterProvider rawParams;
private Map<Expression, Object> paramsMap;
private StartWithExpression startWith;
private Limit limit;
/**
* @param st
* SQL Statement
* @param params
*
* @param rawParams
*
*/
public SqlAndParameter(Statement st, List<Object> params, ParameterProvider rawParams) {
this.statement = st;
this.params = params;
this.rawParams = rawParams;
paramsMap = SqlAnalyzer.reverse(st, params);
}
public Map<Expression, Object> getParamsMap() {
return paramsMap;
}
private <API key> parseStartWith(ColumnMeta columns) {
if (statement instanceof Select) {
return parse((Select) statement, columns);
}
throw new <API key>();
}
private <API key> parse(Select st, ColumnMeta columns) {
if (st.getSelectBody() instanceof PlainSelect) {
return parse((PlainSelect) st.getSelectBody(), columns);
}
throw new <API key>();
}
private <API key> parse(PlainSelect selectBody, ColumnMeta columns) {
if (startWith == null) {
return null;
}
Map<String, String> maps = new HashMap<String, String>();
selectBody.accept(new TableCollector(maps));
<API key> result = new <API key>();
parseStartWith(startWith.getStartExpression(), result, maps, columns);
parseConnectBy(getAsEqualsTo(startWith.<API key>()), result, maps, columns);
return result;
}
private EqualsTo getAsEqualsTo(Expression ex) {
ExpressionType type = ex.getType();
if (type == ExpressionType.parenthesis) {
return getAsEqualsTo(((Parenthesis) ex).getExpression());
} else if (type == ExpressionType.eq) {
return (EqualsTo) ex;
}
throw new <API key>(ex.toString());
}
private void parseStartWith(Expression startExpression, <API key> result, Map<String, String> maps, ColumnMeta columns) {
int leftColumn;
Operator op;
Object value;
switch (startExpression.getType()) {
case eq:
op = Operator.EQUALS;
leftColumn = getColumnId(((BinaryExpression) startExpression).getLeftExpression(), columns, maps);
value = getAsValue(((BinaryExpression) startExpression).getRightExpression());
break;
case ge:
op = Operator.GREAT_EQUALS;
leftColumn = getColumnId(((BinaryExpression) startExpression).getLeftExpression(), columns, maps);
value = getAsValue(((BinaryExpression) startExpression).getRightExpression());
break;
case gt:
op = Operator.GREAT;
leftColumn = getColumnId(((BinaryExpression) startExpression).getLeftExpression(), columns, maps);
value = getAsValue(((BinaryExpression) startExpression).getRightExpression());
break;
case in:
op = Operator.IN;
InExpression in = (InExpression) startExpression;
leftColumn = getColumnId(in.<API key>(), columns, maps);
if (in.getItemsList() instanceof ExpressionList) {
List<Object> values = new ArrayList<Object>();
for (Expression ex : ((ExpressionList) in.getItemsList()).getExpressions()) {
Object v = getAsValue(ex);
if (v instanceof Object[]) {
values.addAll(Arrays.asList((Object[]) v));
} else {
values.add(v);
}
}
value = values;
} else {
throw new <API key>(in.getItemsList().toString());
}
break;
case lt:
op = Operator.LESS;
leftColumn = getColumnId(((BinaryExpression) startExpression).getLeftExpression(), columns, maps);
value = getAsValue(((BinaryExpression) startExpression).getRightExpression());
break;
case le:
op = Operator.LESS_EQUALS;
leftColumn = getColumnId(((BinaryExpression) startExpression).getLeftExpression(), columns, maps);
value = getAsValue(((BinaryExpression) startExpression).getRightExpression());
break;
case like:
op = Operator.MATCH_ANY;
leftColumn = getColumnId(((BinaryExpression) startExpression).getLeftExpression(), columns, maps);
value = getAsValue(((BinaryExpression) startExpression).getRightExpression());
break;
case ne:
op = Operator.NOT_EQUALS;
leftColumn = getColumnId(((BinaryExpression) startExpression).getLeftExpression(), columns, maps);
value = getAsValue(((BinaryExpression) startExpression).getRightExpression());
break;
case between:
op = Operator.BETWEEN_L_L;
Between be = (Between) startExpression;
leftColumn = getColumnId(be.getLeftExpression(), columns, maps);
value = Arrays.asList(getAsValue(be.<API key>()), getAsValue(be.<API key>()));
break;
default:
throw new <API key>();
}
result.startWithColumn = leftColumn;
result.startWithOperator = op;
result.startWithValue = value;
}
private int getColumnId(Expression leftExpression, ColumnMeta columns, Map<String, String> maps) {
if (leftExpression instanceof Column) {
return getColumn(columns, (Column) leftExpression, maps);
}
throw new <API key>(leftExpression.toString());
}
private Object getAsValue(Expression exp) {
if (exp.getType() == ExpressionType.value) {
SqlValue value = (SqlValue) exp;
return value.getValue();
} else if (exp instanceof JpqlParameter) {
JpqlParameter jp = (JpqlParameter) exp;
Object value;
if (jp.getName() == null) {
value = rawParams.getIndexedParam(jp.getIndex());
} else {
value = rawParams.getNamedParam(jp.getName());
}
return value;
} else if (exp instanceof JdbcParameter) {
throw new <API key>();
}
throw new <API key>(exp.toString());
}
private void parseConnectBy(EqualsTo equals, <API key> result, Map<String, String> maps, ColumnMeta columns) {
Expression parent;
Expression current;
if (equals.getPrior() == Prior.LEFT) {
parent = equals.getRightExpression();
current = equals.getLeftExpression();
} else if (equals.getPrior() == Prior.RIGHT) {
parent = (Column) equals.getLeftExpression();
current = (Column) equals.getRightExpression();
} else {
throw new <API key>("NO PRIOR Found");
}
if (parent instanceof Column && current instanceof Column) {
Column c1 = (Column) current;
Column c2 = (Column) parent;
int n1 = getColumn(columns, c1, maps);
int n2 = getColumn(columns, c2, maps);
if (n1 > 0 && n2 > 0) {
result.connectPrior = n1;
result.connectParent = n2;
return;
}
throw new <API key>("The connect condition parser Error:" + c1 + "=" + c2);
}
throw new <API key>("Prior conditions must be Column");
}
private int getColumn(ColumnMeta columns, Column c1, Map<String, String> maps) {
String table1 = null;
if (StringUtils.isNotEmpty(c1.getTableAlias())) {
table1 = maps.get(StringUtils.upperCase(c1.getTableAlias()));
}
int n1 = 0;
for (ColumnDescription cd : columns.getColumns()) {
if (match(table1, c1.getColumnName(), cd)) {
n1 = cd.getN();
}
}
return n1;
}
private boolean match(String keyTable, String keyColumn, ColumnDescription cd) {
String table=cd.getTable();
if (keyTable != null && StringUtils.isNotEmpty(table)) {
if (!StringUtils.equalsIgnoreCase(keyTable, table)) {
return false;
}
}
return StringUtils.equalsIgnoreCase(keyColumn, cd.getName());
}
static class TableCollector extends VisitorAdapter {
Map<String, String> tableAlias;
TableCollector(Map<String, String> map) {
tableAlias = map;
}
@Override
public void visit(Table table) {
if (StringUtils.isNotEmpty(table.getAlias())) {
tableAlias.put(StringUtils.upperCase(table.getAlias()), StringUtils.upperCase(table.getName()));
}
}
}
private int[] getLimitLength(Limit limit) {
int offset = 0;
int rowcount = 0;
if (limit.<API key>() != null) {
Object obj=getParamsMap().get(limit.<API key>());
if(obj instanceof Number){
offset = ((Number) obj).intValue();
}
} else {
offset = (int)limit.getOffset();
}
if (limit.<API key>() != null) {
Object obj=getParamsMap().get(limit.<API key>());
if(obj instanceof Number){
rowcount = ((Number) obj).intValue();
}
} else {
rowcount = (int)limit.getRowCount();
}
return new int[]{offset,rowcount};
}
public InMemoryPaging parseLimit(Limit limit,ColumnMeta columns) {
int[] value=getLimitLength(limit);
int offset=value[0];
int rowcount=value[1];
if(offset>0 || rowcount>0){
return new InMemoryPaging(offset, rowcount);
}else{
return null;
}
}
public long getLimitSpan() {
if(limit!=null){
int[] values=getLimitLength(limit);
return values[1];
}
return 0;
}
@Override
public boolean hasInMemoryOperate() {
return startWith!=null || limit!=null;
}
@Override
public void <API key>(PageLimit range, ResultSetContainer mrs) {
if(startWith!=null){
mrs.<API key>(parseStartWith(mrs.getColumns()));
}
if(limit!=null){
mrs.setInMemoryPage(parseLimit(limit,mrs.getColumns()));
}
}
/**
*
*
* @param delays
*/
public void setInMemoryClause(RemovedDelayProcess delays) {
if(delays!=null){
this.startWith = delays.startWith;
this.limit=delays.limit;
}
}
public Limit getLimit() {
return limit;
}
public void setNewLimit(PageLimit range) {
if(range==null){
limit=null;
}else{
Limit limit=new Limit();
limit.setOffset(range.getOffset());
limit.setRowCount(range.getLimit());
this.limit=limit;
}
}
public void setLimit(Limit countLimit) {
this.limit=countLimit;
}
private <API key> reverseResultSet;
@Override
public <API key> getRsLaterProcessor() {
return reverseResultSet;
}
public void setReverseResultSet(<API key> reverseResultSet) {
this.reverseResultSet = reverseResultSet;
}
}
|
<?php
namespace BingAds\AdIntelligence;
final class <API key>
{
public $TotalNumEntries;
public $Entries;
}
|
/ [<API key>.ts]
class C1<T, U, V> {
constructor(private k: T, protected [a, b, c]: [T,U,V]) {
if ((b === undefined && c === undefined) || (this.b === undefined && this.c === undefined)) {
this.a = a || k;
}
}
public getA() {
return this.a
}
public getB() {
return this.b
}
public getC() {
return this.c;
}
}
class C2 extends C1<number, string, boolean> {
public <API key>() {
return `${this.a} ${this.b} ${this.c}`;
}
}
/ [<API key>.js]
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var C1 = (function () {
function C1(k, [a, b, c]) {
this.k = k;
this.[a, b, c] = [a, b, c];
if ((b === undefined && c === undefined) || (this.b === undefined && this.c === undefined)) {
this.a = a || k;
}
}
C1.prototype.getA = function () {
return this.a;
};
C1.prototype.getB = function () {
return this.b;
};
C1.prototype.getC = function () {
return this.c;
};
return C1;
})();
var C2 = (function (_super) {
__extends(C2, _super);
function C2() {
_super.apply(this, arguments);
}
C2.prototype.<API key> = function () {
return `${this.a} ${this.b} ${this.c}`;
};
return C2;
})(C1);
|
import os
import sys
#PYTHON_DIR = join(dirname(__file__), '/opt/ofelia/vt_manager/src/python/')
PYTHON_DIR = os.path.join(os.path.dirname(__file__), "../..")
# This is needed because wsgi disallows using stdout
sys.stdout = sys.stderr
os.environ['<API key>'] = 'vt_manager.settings.settingsLoader'
sys.path.insert(0,PYTHON_DIR)
from vt_manager.models.VirtualMachine import VirtualMachine
vmid = str(sys.argv[1])
vm = VirtualMachine.objects.get(id = vmid).getChildObject()
server = vm.Server.get()
server.deleteVM(vm)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.