hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
108
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
float64
1
77k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
653k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
1
5a3d24d871e1bc144f1d6cafb6f1a155356dffbe
4,910
cpp
C++
src/Structs.Core.cpu/Collections/BitArray.cpp
Grimace1975/gpustructs
549f32c96d4df6aafcb38cc063a8cd516512883b
[ "MIT" ]
null
null
null
src/Structs.Core.cpu/Collections/BitArray.cpp
Grimace1975/gpustructs
549f32c96d4df6aafcb38cc063a8cd516512883b
[ "MIT" ]
null
null
null
src/Structs.Core.cpu/Collections/BitArray.cpp
Grimace1975/gpustructs
549f32c96d4df6aafcb38cc063a8cd516512883b
[ "MIT" ]
null
null
null
#ifndef CORE_H # include "..\..\..\inc\System\Core.h" #endif #include "BitArray.hpp" #include <string.h> using namespace Structs; namespace Structs { namespace Collections { BitArray::BitArray(uint size) { _size = size; } void BitArray::Destroy(BitArray &p) { if (&p == nullptr) return; if (p._divisor != 0) for (uint i = 0; i < BITVEC_NPTR; i++) Destroy(*p.u.Sub[i]); } uint BitArray::getLength() { return _size; } bool BitArray::Get(uint index) { if (index == 0 || index > _size) return false; index--; BitArray* p = this; while (p->_divisor != 0) { uint bin = index / p->_divisor; index %= p->_divisor; p = p->u.Sub[bin]; if (p == nullptr) return false; } if (p->_size <= BITVEC_NBIT) return ((p->u.Bitmap[index / BITVEC_SZELEM] & (1 << (int)(index & (BITVEC_SZELEM - 1)))) != 0); uint h = BITVEC_HASH(index++); while (p->u.Hash[h] != 0) { if (p->u.Hash[h] == index) return true; h = (h + 1) % BITVEC_NINT; } return false; } RC BitArray::Set(uint index) { Debug_Assert(index > 0); Debug_Assert(index <= _size); index--; BitArray *p = this; while (p->_size > BITVEC_NBIT && p->_divisor != 0) { uint bin = index / p->_divisor; index %= p->_divisor; if (p->u.Sub[bin] == nullptr) p->u.Sub[bin] = new BitArray(p->_divisor); p = p->u.Sub[bin]; } if (p->_size <= BITVEC_NBIT) { p->u.Bitmap[index / BITVEC_SZELEM] |= (byte)(1 << (int)(index & (BITVEC_SZELEM - 1))); return RC::OK; } uint h = BITVEC_HASH(index++); // if there wasn't a hash collision, and this doesn't completely fill the hash, then just add it without worring about sub-dividing and re-hashing. if (p->u.Hash[h] == 0) if (p->_set < (BITVEC_NINT - 1)) goto bitvec_set_end; else goto bitvec_set_rehash; // there was a collision, check to see if it's already in hash, if not, try to find a spot for it do { if (p->u.Hash[h] == index) return RC::OK; h++; if (h >= BITVEC_NINT) h = 0; } while (p->u.Hash[h] != 0); // we didn't find it in the hash. h points to the first available free spot. check to see if this is going to make our hash too "full". bitvec_set_rehash: if (p->_set >= BITVEC_MXHASH) { uint* values = new uint[BITVEC_NINT]; memcpy(values, p->u.Hash, sizeof(p->u.Hash)); memset(p->u.Sub, 0, sizeof(p->u.Sub)); p->_divisor = (uint)((p->_size + BITVEC_NPTR - 1) / BITVEC_NPTR); RC rc = p->Set(index); for (uint j = 0; j < BITVEC_NINT; j++) if (values[j] != 0) rc |= p->Set(values[j]); return rc; } bitvec_set_end: p->_set++; p->u.Hash[h] = index; return RC::OK; } void BitArray::Clear(uint index, uint buffer[]) { Debug_Assert(index > 0); index--; BitArray* p = this; while (p->_divisor != 0) { uint bin = index / p->_divisor; index %= p->_divisor; p = p->u.Sub[bin]; if (p == nullptr) return; } if (p->_size <= BITVEC_NBIT) p->u.Bitmap[index / BITVEC_SZELEM] &= (byte)~((1 << (int)(index & (BITVEC_SZELEM - 1)))); else { uint* values = buffer; memcpy(values, p->u.Hash, sizeof(p->u.Hash)); memset(p->u.Hash, 0, sizeof(p->u.Hash)); p->_set = 0; for (uint j = 0; j < BITVEC_NINT; j++) if (values[j] != 0 && values[j] != (index + 1)) { uint h = BITVEC_HASH(values[j] - 1); p->_set++; while (p->u.Hash[h] != 0) { h++; if (h >= BITVEC_NINT) h = 0; } p->u.Hash[h] = values[j]; } } } }}
36.102941
160
0.405906
5a3dba1ad0707e8f2523f50885675d3e4a54b7bb
1,088
cpp
C++
Tutorials/Week 3/Solutions/Office.cpp
JamesMarino/CSCI204
17b2c44252d1be40214831c6e7e0c2b71848f500
[ "MIT" ]
null
null
null
Tutorials/Week 3/Solutions/Office.cpp
JamesMarino/CSCI204
17b2c44252d1be40214831c6e7e0c2b71848f500
[ "MIT" ]
null
null
null
Tutorials/Week 3/Solutions/Office.cpp
JamesMarino/CSCI204
17b2c44252d1be40214831c6e7e0c2b71848f500
[ "MIT" ]
null
null
null
// Office.cpp // Static field holds rent due date for an office - rents are due on the 1st #include <iostream> #include <string> using namespace std; class Office { private: int officeNum; string tenant; int rent; static int rentDueDate; public: void setOfficeData(int, string, int); static void showRentDueDate(); void showOffice(); }; int Office::rentDueDate = 1; void Office::setOfficeData (int num, string occupant, int rent) { this->officeNum = num; this->tenant = occupant; this->rent = rent; } void Office::showOffice () { cout << "Office " << this->officeNum << " is occupied by " << this->tenant << "." << endl; cout << "The rent, $" << this->rent << " is due on day " << rentDueDate << " of the month." << endl; cout << "ALL rents are due on the day " << rentDueDate << " of the month." << endl; } void Office::showRentDueDate () { cout << "All rents are due on day " << rentDueDate << " of the month." << endl; } int main() { Office myOffice; myOffice.setOfficeData(234, "Dr. Smith", 450); Office::showRentDueDate(); myOffice.showOffice(); }
21.76
101
0.654412
5a3e900a0a703723b1b7bd32ddda0acae6b32857
2,637
hpp
C++
indexer/covered_object.hpp
mapsme/geocore
346fceb020cd909b37706ab6ad454aec1a11f52e
[ "Apache-2.0" ]
13
2019-09-16T17:45:31.000Z
2022-01-29T15:51:52.000Z
indexer/covered_object.hpp
mapsme/geocore
346fceb020cd909b37706ab6ad454aec1a11f52e
[ "Apache-2.0" ]
37
2019-10-04T00:55:46.000Z
2019-12-27T15:13:19.000Z
indexer/covered_object.hpp
mapsme/geocore
346fceb020cd909b37706ab6ad454aec1a11f52e
[ "Apache-2.0" ]
13
2019-10-02T15:03:58.000Z
2020-12-28T13:06:22.000Z
#pragma once #include "geometry/point2d.hpp" #include "geometry/polygon.hpp" #include "geometry/rect2d.hpp" #include "coding/geometry_coding.hpp" #include "base/buffer_vector.hpp" #include "base/geo_object_id.hpp" #include <cstdint> #include <vector> namespace indexer { // Class for intermediate objects used to build CoveringIndex. class CoveredObject { public: CoveredObject() = default; // Decodes id stored in CoveringIndex. See GetStoredId(). static base::GeoObjectId FromStoredId(uint64_t storedId) { return base::GeoObjectId(storedId >> 2 | storedId << 62); } // We need CoveringIndex object id to be at most numeric_limits<int64_t>::max(). // We use incremental encoding for ids and need to keep ids of close object close if it is possible. // To ensure it we move two leading bits which encodes object type to the end of id. uint64_t GetStoredId() const { return m_id << 2 | m_id >> 62; } void Deserialize(char const * data); template <typename ToDo> void ForEachPoint(ToDo && toDo) const { for (auto const & p : m_points) toDo(p); } template <typename ToDo> void ForEachTriangle(ToDo && toDo) const { for (size_t i = 2; i < m_triangles.size(); i += 3) toDo(m_triangles[i - 2], m_triangles[i - 1], m_triangles[i]); } void SetId(uint64_t id) { m_id = id; } void SetPoints(buffer_vector<m2::PointD, 32> && points) { m_points = std::move(points); } void SetTriangles(buffer_vector<m2::PointD, 32> && triangles) { m_triangles = std::move(triangles); } void SetForTesting(uint64_t id, m2::PointD point) { m_id = id; m_points.clear(); m_points.push_back(point); } void SetForTesting(uint64_t id, m2::RectD rect) { m_id = id; m_points.clear(); m_points.push_back(rect.LeftBottom()); m_points.push_back(rect.RightBottom()); m_points.push_back(rect.RightTop()); m_points.push_back(rect.LeftTop()); buffer_vector<m2::PointD, 32> strip; auto const index = FindSingleStrip( m_points.size(), IsDiagonalVisibleFunctor<buffer_vector<m2::PointD, 32>::const_iterator>( m_points.begin(), m_points.end())); MakeSingleStripFromIndex(index, m_points.size(), [&](size_t i) { strip.push_back(m_points[i]); }); serial::StripToTriangles(strip.size(), strip, m_triangles); } private: uint64_t m_id = 0; buffer_vector<m2::PointD, 32> m_points; // m_triangles[3 * i], m_triangles[3 * i + 1], m_triangles[3 * i + 2] form the i-th triangle. buffer_vector<m2::PointD, 32> m_triangles; }; } // namespace indexer
26.908163
102
0.668563
5a41d85552d1170f10241f9d4566dad233198f36
2,275
cpp
C++
cctbx/adp_restraints/fixed_u_eq_adp_bpl.cpp
rimmartin/cctbx_project
644090f9432d9afc22cfb542fc3ab78ca8e15e5d
[ "BSD-3-Clause-LBNL" ]
155
2016-11-23T12:52:16.000Z
2022-03-31T15:35:44.000Z
cctbx/adp_restraints/fixed_u_eq_adp_bpl.cpp
rimmartin/cctbx_project
644090f9432d9afc22cfb542fc3ab78ca8e15e5d
[ "BSD-3-Clause-LBNL" ]
590
2016-12-10T11:31:18.000Z
2022-03-30T23:10:09.000Z
cctbx/adp_restraints/fixed_u_eq_adp_bpl.cpp
rimmartin/cctbx_project
644090f9432d9afc22cfb542fc3ab78ca8e15e5d
[ "BSD-3-Clause-LBNL" ]
115
2016-11-15T08:17:28.000Z
2022-02-09T15:30:14.000Z
#include <cctbx/boost_python/flex_fwd.h> #include <boost/python/def.hpp> #include <boost/python/class.hpp> #include <boost/python/args.hpp> #include <boost/python/return_value_policy.hpp> #include <boost/python/copy_const_reference.hpp> #include <boost/python/return_internal_reference.hpp> #include <boost/python/return_by_value.hpp> #include <scitbx/array_family/boost_python/shared_wrapper.h> #include <cctbx/adp_restraints/fixed_u_eq_adp.h> #include <scitbx/boost_python/container_conversions.h> namespace cctbx { namespace adp_restraints { namespace { struct fixed_u_eq_adp_proxy_wrappers { typedef fixed_u_eq_adp_proxy w_t; static void wrap() { using namespace boost::python; class_<w_t, bases<adp_restraint_proxy<1> > > ("fixed_u_eq_adp_proxy", no_init) .def(init< af::tiny<unsigned, 1> const &, double, double>( (arg("i_seqs"), arg("weight"), arg("u_eq_ideal")))) .def_readonly("u_eq_ideal", &w_t::u_eq_ideal) ; { scitbx::af::boost_python::shared_wrapper<w_t>::wrap( "shared_fixed_u_eq_adp_proxy"); } } }; struct fixed_u_eq_adp_wrappers { typedef fixed_u_eq_adp w_t; static void wrap() { using namespace boost::python; typedef return_value_policy<return_by_value> rbv; class_<w_t, bases<adp_restraint_base_1<1> > > ("fixed_u_eq_adp", no_init) .def(init< scitbx::sym_mat3<double> const &, double, double>( (arg("u_cart"), arg("weight"), arg("u_eq_ideal")))) .def(init< double, double, double>( (arg("u_iso"), arg("weight"), arg("u_eq_ideal")))) .def(init< adp_restraint_params<double> const &, fixed_u_eq_adp_proxy const &>( (arg("params"), arg("proxy")))) .def_readonly("u_eq_ideal", &w_t::u_eq_ideal) ; } }; void wrap_all() { using namespace boost::python; fixed_u_eq_adp_wrappers::wrap(); fixed_u_eq_adp_proxy_wrappers::wrap(); } } namespace boost_python { void wrap_fixed_u_eq_adp() { wrap_all(); } }}}
25.852273
60
0.607033
5a467f39695c9b5c2b5e7d6e8cf80f1335bd1599
3,212
hpp
C++
include/opengl/draw_info.hpp
bjadamson/BoomHS
60b5d8ddc2490ec57e8f530ba7ce3135221e2ec4
[ "MIT" ]
2
2016-07-22T10:09:21.000Z
2017-09-16T06:50:01.000Z
include/opengl/draw_info.hpp
bjadamson/BoomHS
60b5d8ddc2490ec57e8f530ba7ce3135221e2ec4
[ "MIT" ]
14
2016-08-13T22:45:56.000Z
2018-12-16T03:56:36.000Z
include/opengl/draw_info.hpp
bjadamson/BoomHS
60b5d8ddc2490ec57e8f530ba7ce3135221e2ec4
[ "MIT" ]
null
null
null
#pragma once #include <opengl/bind.hpp> #include <opengl/global.hpp> #include <opengl/vao.hpp> #include <opengl/vertex_attribute.hpp> #include <boomhs/entity.hpp> #include <common/log.hpp> #include <common/type_macros.hpp> #include <optional> #include <string> namespace boomhs { class ObjStore; } // namespace boomhs namespace opengl { class ShaderPrograms; class BufferHandles { GLuint vbo_ = 0, ebo_ = 0; static auto constexpr NUM_BUFFERS = 1; explicit BufferHandles(); NO_COPY(BufferHandles); public: friend class DrawInfo; ~BufferHandles(); // move-construction OK. BufferHandles(BufferHandles&&); BufferHandles& operator=(BufferHandles&&); auto vbo() const { return vbo_; } auto ebo() const { return ebo_; } std::string to_string() const; }; std::ostream& operator<<(std::ostream&, BufferHandles const&); class DrawInfo { size_t num_vertexes_; GLuint num_indices_; BufferHandles handles_; VAO vao_; public: DebugBoundCheck debug_check; NO_COPY(DrawInfo); explicit DrawInfo(size_t, GLuint); DrawInfo(DrawInfo&&); DrawInfo& operator=(DrawInfo&&); void bind_impl(common::Logger&); void unbind_impl(common::Logger&); DEFAULT_WHILEBOUND_MEMBERFN_DECLATION(); auto vbo() const { return handles_.vbo(); } auto ebo() const { return handles_.ebo(); } auto num_vertexes() const { return num_vertexes_; } auto num_indices() const { return num_indices_; } auto& vao() { return vao_; } auto const& vao() const { return vao_; } std::string to_string() const; }; struct DrawInfoHandle { using value_type = size_t; value_type value; explicit DrawInfoHandle(value_type const v) : value(v) { } }; class DrawHandleManager; class EntityDrawHandleMap { std::vector<opengl::DrawInfo> drawinfos_; std::vector<boomhs::EntityID> entities_; friend class DrawHandleManager; EntityDrawHandleMap() = default; NO_COPY(EntityDrawHandleMap); MOVE_DEFAULT(EntityDrawHandleMap); DrawInfoHandle add(boomhs::EntityID, opengl::DrawInfo&&); bool empty() const { return drawinfos_.empty(); } bool has(DrawInfoHandle) const; auto size() const { assert(drawinfos_.size() == entities_.size()); return drawinfos_.size(); } DrawInfo const& get(DrawInfoHandle) const; DrawInfo& get(DrawInfoHandle); std::optional<DrawInfoHandle> find(boomhs::EntityID) const; }; class DrawHandleManager { // These slots get a value when memory is loaded, set to none when memory is not. EntityDrawHandleMap entities_; EntityDrawHandleMap& entities(); EntityDrawHandleMap const& entities() const; public: DrawHandleManager() = default; NO_COPY(DrawHandleManager); MOVE_DEFAULT(DrawHandleManager); // methods DrawInfoHandle add_entity(boomhs::EntityID, DrawInfo&&); DrawInfo& lookup_entity(common::Logger&, boomhs::EntityID); DrawInfo const& lookup_entity(common::Logger&, boomhs::EntityID) const; void add_mesh(common::Logger&, ShaderPrograms&, boomhs::ObjStore&, boomhs::EntityID, boomhs::EntityRegistry&); void add_cube(common::Logger&, ShaderPrograms&, boomhs::EntityID, boomhs::EntityRegistry&); }; } // namespace opengl
22
93
0.711706
53fe5e6aeb1f1c44f8f4face1da69d196f13f417
13,467
cpp
C++
operators_c.cpp
ntan15/scratch_wadge
0657069749b9507062c1f7e875c6545076fb85c8
[ "Unlicense" ]
null
null
null
operators_c.cpp
ntan15/scratch_wadge
0657069749b9507062c1f7e875c6545076fb85c8
[ "Unlicense" ]
null
null
null
operators_c.cpp
ntan15/scratch_wadge
0657069749b9507062c1f7e875c6545076fb85c8
[ "Unlicense" ]
null
null
null
#include "operators_c.h" #include "operators.h" #include <Eigen/Dense> #include <iostream> using namespace std; static dfloat_t *to_c(VectorXd &v) { dfloat_t *vdata = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * v.size()); #if USE_DFLOAT_DOUBLE == 1 Eigen::Map<Eigen::VectorXd>(vdata, v.size()) = v.cast<dfloat_t>(); #else Eigen::Map<Eigen::VectorXf>(vdata, v.size()) = v.cast<dfloat_t>(); #endif return vdata; } static dfloat_t *to_c(MatrixXd &m) { dfloat_t *mdata = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * m.size()); #if USE_DFLOAT_DOUBLE == 1 Eigen::Map<Eigen::MatrixXd>(mdata, m.rows(), m.cols()) = m.cast<dfloat_t>(); #else Eigen::Map<Eigen::MatrixXf>(mdata, m.rows(), m.cols()) = m.cast<dfloat_t>(); #endif return mdata; } static uintloc_t *to_c(MatrixXu32 &m) { uintloc_t *mdata = (uintloc_t *)asd_malloc_aligned(sizeof(uintloc_t) * m.size()); Eigen::Map<Eigen::Matrix<uintloc_t, Eigen::Dynamic, Eigen::Dynamic>>( mdata, m.rows(), m.cols()) = m.cast<uintloc_t>(); return mdata; } host_operators_t *host_operators_new_2D(int N, int M, uintloc_t E, uintloc_t *EToE, uint8_t *EToF, uint8_t *EToO, double *EToVX) { host_operators_t *ops = (host_operators_t *)asd_malloc(sizeof(host_operators_t)); ref_elem_data *ref_data = build_ref_ops_2D(N, M, M); VectorXd wq = ref_data->wq; // nodal MatrixXd Dr = ref_data->Dr; MatrixXd Ds = ref_data->Ds; MatrixXd Vq = ref_data->Vq; VectorXd wfq = ref_data->wfq; VectorXd nrJ = ref_data->nrJ; VectorXd nsJ = ref_data->nsJ; MatrixXd Vfqf = ref_data->Vfqf; MatrixXd Vfq = ref_data->Vfq; MatrixXd Pq = ref_data->Pq; MatrixXd MM = Vq.transpose() * wq.asDiagonal() * Vq; MatrixXd MMfq = Vfq.transpose() * wfq.asDiagonal(); MatrixXd Lq = mldivide(MM, MMfq); MatrixXd VqLq = Vq * Lq; MatrixXd VqPq = Vq * Pq; MatrixXd VfPq = Vfq * Pq; MatrixXd Drq = Vq * Dr * Pq - .5 * Vq * Lq * nrJ.asDiagonal() * Vfq * Pq; MatrixXd Dsq = Vq * Ds * Pq - .5 * Vq * Lq * nsJ.asDiagonal() * Vfq * Pq; ops->dim = 2; ops->N = N; ops->M = M; ops->Np = (int)ref_data->r.size(); ops->Nq = (int)ref_data->rq.size(); // printf("Num cubature points Nq = %d\n",ops->Nq); ops->Nfp = N + 1; ops->Nfq = (int)ref_data->ref_rfq.size(); ops->Nfaces = ref_data->Nfaces; ops->Nvgeo = 4; ops->Nfgeo = 3; ops->wq = to_c(wq); ops->nrJ = to_c(nrJ); ops->nsJ = to_c(nsJ); ops->Drq = to_c(Drq); ops->Dsq = to_c(Dsq); ops->Vq = to_c(Vq); ops->Pq = to_c(Pq); ops->VqLq = to_c(VqLq); ops->VqPq = to_c(VqPq); ops->VfPq = to_c(VfPq); ops->Vfqf = to_c(Vfqf); Map<MatrixXd> EToVXmat(EToVX, 2 * 3, E); if (sizeof(uintloc_t) != sizeof(uint32_t)) { cerr << "Need to update build maps to support different integer types" << endl; std::abort(); } Map<MatrixXu32> mapEToE(EToE, 3, E); Map<MatrixXu8> mapEToF(EToF, 3, E); Map<MatrixXu8> mapEToO(EToO, 3, E); geo_elem_data *geo_data = build_geofacs_2D(ref_data, EToVXmat); map_elem_data *map_data = build_maps_2D(ref_data, mapEToE, mapEToF, mapEToO); const int Nvgeo = ops->Nvgeo; const int Nfgeo = ops->Nfgeo; const int Nfaces = ref_data->Nfaces; const int Nq = ops->Nq; const int Nfq = ops->Nfq; ops->xyzq = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nq * 3 * E); ops->xyzf = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nfq * ops->Nfaces * 3 * E); ops->vgeo = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nq * Nvgeo * E); ops->vfgeo = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nfq * Nfaces * Nvgeo * E); ops->fgeo = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nfq * Nfgeo * Nfaces * E); for (uintloc_t e = 0; e < E; ++e) { for (int n = 0; n < Nq; ++n) { ops->xyzq[n + 0 * Nq + e * Nq * 3] = (dfloat_t)geo_data->xq(n, e); ops->xyzq[n + 1 * Nq + e * Nq * 3] = (dfloat_t)geo_data->yq(n, e); // ops->xyzq[n + 2*Nq + e*Nq*3] = (dfloat_t)geo_data->zq(n,e); ops->vgeo[e * Nq * Nvgeo + 0 * Nq + n] = (dfloat_t)geo_data->rxJ(n, e); ops->vgeo[e * Nq * Nvgeo + 1 * Nq + n] = (dfloat_t)geo_data->ryJ(n, e); ops->vgeo[e * Nq * Nvgeo + 2 * Nq + n] = (dfloat_t)geo_data->sxJ(n, e); ops->vgeo[e * Nq * Nvgeo + 3 * Nq + n] = (dfloat_t)geo_data->syJ(n, e); } } for (uintloc_t e = 0; e < E; ++e) { for (int n = 0; n < Nfq * Nfaces; ++n) { ops->xyzf[n + 0 * Nfq * Nfaces + e * Nfq * Nfaces * 3] = (dfloat_t)geo_data->xf(n, e); ops->xyzf[n + 1 * Nfq * Nfaces + e * Nfq * Nfaces * 3] = (dfloat_t)geo_data->yf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 0 * Nfq * Nfaces + n] = (dfloat_t)geo_data->rxJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 1 * Nfq * Nfaces + n] = (dfloat_t)geo_data->ryJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 2 * Nfq * Nfaces + n] = (dfloat_t)geo_data->sxJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 3 * Nfq * Nfaces + n] = (dfloat_t)geo_data->syJf(n, e); ops->fgeo[e * Nfq * Nfaces * Nfgeo + 0 * Nfq * Nfaces + n] = (dfloat_t)geo_data->nxJ(n, e); ops->fgeo[e * Nfq * Nfaces * Nfgeo + 1 * Nfq * Nfaces + n] = (dfloat_t)geo_data->nyJ(n, e); ops->fgeo[e * Nfq * Nfaces * Nfgeo + 2 * Nfq * Nfaces + n] = (dfloat_t)geo_data->sJ(n, e); } } ops->Jq = to_c(geo_data->J); ops->mapPq = to_c(map_data->mapPq); // ops->mapPqNoFields = to_c(map_data->mapPq); // save /* // JC: FIX LATER - only valid for tri2.msh ops->mapPq[0] = 7; ops->mapPq[1] = 6; ops->mapPq[2] = 9; ops->mapPq[3] = 8; ops->mapPq[6] = 1; ops->mapPq[7] = 0; ops->mapPq[8] = 3; ops->mapPq[9] = 2; */ // for(int i = 0; i < Nfq*Nfaces*E; ++i){ // printf("mapPq(%d) = %d\n",i,ops->mapPq[i]); // } ops->Fmask = to_c(map_data->fmask); delete ref_data; delete geo_data; delete map_data; return ops; } host_operators_t *host_operators_new_3D(int N, int M, uintloc_t E, uintloc_t *EToE, uint8_t *EToF, uint8_t *EToO, double *EToVX) { host_operators_t *ops = (host_operators_t *)asd_malloc(sizeof(host_operators_t)); ref_elem_data *ref_data = build_ref_ops_3D(N, M, M); VectorXd wq = ref_data->wq; // nodal MatrixXd Dr = ref_data->Dr; MatrixXd Ds = ref_data->Ds; MatrixXd Dt = ref_data->Dt; MatrixXd Vq = ref_data->Vq; MatrixXd Pq = ref_data->Pq; MatrixXd Vfqf = ref_data->Vfqf; MatrixXd Vfq = ref_data->Vfq; VectorXd wfq = ref_data->wfq; VectorXd nrJ = ref_data->nrJ; VectorXd nsJ = ref_data->nsJ; VectorXd ntJ = ref_data->ntJ; MatrixXd MM = Vq.transpose() * wq.asDiagonal() * Vq; MatrixXd MMfq = Vfq.transpose() * wfq.asDiagonal(); MatrixXd Lq = mldivide(MM, MMfq); MatrixXd VqLq = Vq * Lq; MatrixXd VqPq = Vq * Pq; MatrixXd VfPq = Vfq * Pq; MatrixXd Drq = Vq * Dr * Pq - .5 * Vq * Lq * nrJ.asDiagonal() * Vfq * Pq; MatrixXd Dsq = Vq * Ds * Pq - .5 * Vq * Lq * nsJ.asDiagonal() * Vfq * Pq; MatrixXd Dtq = Vq * Dt * Pq - .5 * Vq * Lq * ntJ.asDiagonal() * Vfq * Pq; MatrixXd Drstq(Drq.rows(),3*Drq.cols()); Drstq << Drq,Dsq,Dtq; /* cout << "VqPq = " << endl << VqPq << endl; cout << "VqLq = " << endl << VqLq << endl; cout << "VfPq = " << endl << VfPq << endl; cout << "Drq = " << endl << Drq << endl; cout << "nrJ = " << endl << nrJ << endl; cout << "Dsq = " << endl << Dsq << endl; cout << "nsJ = " << endl << nsJ << endl; cout << "Dtq = " << endl << Dtq << endl; cout << "ntJ = " << endl << ntJ << endl; */ ops->dim = 3; ops->N = N; ops->M = M; ops->Np = (int)ref_data->r.size(); ops->Nq = (int)ref_data->rq.size(); ops->Nfp = (N + 1) * (N + 2) / 2; ops->Nfq = (int)ref_data->ref_rfq.size(); ops->Nfaces = ref_data->Nfaces; ops->Nvgeo = 9; ops->Nfgeo = 4; ops->wq = to_c(wq); ops->nrJ = to_c(nrJ); ops->nsJ = to_c(nsJ); ops->ntJ = to_c(ntJ); ops->Drq = to_c(Drq); ops->Dsq = to_c(Dsq); ops->Dtq = to_c(Dtq); ops->Drstq = to_c(Drstq); ops->Vq = to_c(Vq); ops->Pq = to_c(Pq); ops->VqLq = to_c(VqLq); ops->VqPq = to_c(VqPq); ops->VfPq = to_c(VfPq); ops->Vfqf = to_c(Vfqf); Map<MatrixXd> EToVXmat(EToVX, 3 * 4, E); if (sizeof(uintloc_t) != sizeof(uint32_t)) { cerr << "Need to update build maps to support different integer types" << endl; std::abort(); } Map<MatrixXu32> mapEToE(EToE, 4, E); Map<MatrixXu8> mapEToF(EToF, 4, E); Map<MatrixXu8> mapEToO(EToO, 4, E); geo_elem_data *geo_data = build_geofacs_3D(ref_data, EToVXmat); map_elem_data *map_data = build_maps_3D(ref_data, mapEToE, mapEToF, mapEToO); const int Nvgeo = ops->Nvgeo; const int Nfgeo = ops->Nfgeo; const int Nfaces = ref_data->Nfaces; const int Nq = ops->Nq; const int Nfq = ops->Nfq; ops->xyzq = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nq * 3 * E); ops->xyzf = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nfq * ops->Nfaces * 3 * E); ops->vgeo = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nq * Nvgeo * E); ops->vfgeo = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nfq * Nfaces * Nvgeo * E); ops->fgeo = (dfloat_t *)asd_malloc_aligned(sizeof(dfloat_t) * ops->Nfq * Nfgeo * Nfaces * E); for (uintloc_t e = 0; e < E; ++e) { for (int n = 0; n < Nq; ++n) { ops->xyzq[n + 0 * Nq + e * Nq * 3] = (dfloat_t)geo_data->xq(n, e); ops->xyzq[n + 1 * Nq + e * Nq * 3] = (dfloat_t)geo_data->yq(n, e); ops->xyzq[n + 2 * Nq + e * Nq * 3] = (dfloat_t)geo_data->zq(n, e); ops->vgeo[e * Nq * Nvgeo + 0 * Nq + n] = (dfloat_t)geo_data->rxJ(n, e); ops->vgeo[e * Nq * Nvgeo + 1 * Nq + n] = (dfloat_t)geo_data->ryJ(n, e); ops->vgeo[e * Nq * Nvgeo + 2 * Nq + n] = (dfloat_t)geo_data->rzJ(n, e); ops->vgeo[e * Nq * Nvgeo + 3 * Nq + n] = (dfloat_t)geo_data->sxJ(n, e); ops->vgeo[e * Nq * Nvgeo + 4 * Nq + n] = (dfloat_t)geo_data->syJ(n, e); ops->vgeo[e * Nq * Nvgeo + 5 * Nq + n] = (dfloat_t)geo_data->szJ(n, e); ops->vgeo[e * Nq * Nvgeo + 6 * Nq + n] = (dfloat_t)geo_data->txJ(n, e); ops->vgeo[e * Nq * Nvgeo + 7 * Nq + n] = (dfloat_t)geo_data->tyJ(n, e); ops->vgeo[e * Nq * Nvgeo + 8 * Nq + n] = (dfloat_t)geo_data->tzJ(n, e); } } for (uintloc_t e = 0; e < E; ++e) { for (int n = 0; n < Nfq * Nfaces; ++n) { ops->xyzf[n + 0 * Nfq * Nfaces + e * Nfq * Nfaces * 3] = (dfloat_t)geo_data->xf(n, e); ops->xyzf[n + 1 * Nfq * Nfaces + e * Nfq * Nfaces * 3] = (dfloat_t)geo_data->yf(n, e); ops->xyzf[n + 2 * Nfq * Nfaces + e * Nfq * Nfaces * 3] = (dfloat_t)geo_data->zf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 0 * Nfq * Nfaces + n] = (dfloat_t)geo_data->rxJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 1 * Nfq * Nfaces + n] = (dfloat_t)geo_data->ryJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 2 * Nfq * Nfaces + n] = (dfloat_t)geo_data->rzJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 3 * Nfq * Nfaces + n] = (dfloat_t)geo_data->sxJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 4 * Nfq * Nfaces + n] = (dfloat_t)geo_data->syJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 5 * Nfq * Nfaces + n] = (dfloat_t)geo_data->szJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 6 * Nfq * Nfaces + n] = (dfloat_t)geo_data->txJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 7 * Nfq * Nfaces + n] = (dfloat_t)geo_data->tyJf(n, e); ops->vfgeo[e * Nfq * Nfaces * Nvgeo + 8 * Nfq * Nfaces + n] = (dfloat_t)geo_data->tzJf(n, e); ops->fgeo[e * Nfq * Nfaces * Nfgeo + 0 * Nfq * Nfaces + n] = (dfloat_t)geo_data->nxJ(n, e); ops->fgeo[e * Nfq * Nfaces * Nfgeo + 1 * Nfq * Nfaces + n] = (dfloat_t)geo_data->nyJ(n, e); ops->fgeo[e * Nfq * Nfaces * Nfgeo + 2 * Nfq * Nfaces + n] = (dfloat_t)geo_data->nzJ(n, e); ops->fgeo[e * Nfq * Nfaces * Nfgeo + 3 * Nfq * Nfaces + n] = (dfloat_t)geo_data->sJ(n, e); // if (e==99){ // printf("n = %d, nxJ = %f\n", n, (dfloat_t) geo_data->nxJ(n,e)); // } } } ops->Jq = to_c(geo_data->J); ops->mapPq = to_c(map_data->mapPq); ops->Fmask = to_c(map_data->fmask); delete ref_data; delete geo_data; delete map_data; return ops; } void host_operators_free(host_operators_t *ops) { asd_free_aligned(ops->vgeo); asd_free_aligned(ops->fgeo); asd_free_aligned(ops->Jq); asd_free_aligned(ops->mapPq); asd_free_aligned(ops->Fmask); asd_free_aligned(ops->nrJ); asd_free_aligned(ops->nsJ); asd_free_aligned(ops->Drq); asd_free_aligned(ops->Dsq); if (ops->dim == 3) { asd_free_aligned(ops->ntJ); asd_free_aligned(ops->Dtq); } asd_free_aligned(ops->Vq); asd_free_aligned(ops->Pq); asd_free_aligned(ops->VqLq); asd_free_aligned(ops->VqPq); asd_free_aligned(ops->VfPq); asd_free_aligned(ops->Vfqf); }
31.538642
80
0.556843
99046f7f13fbffeefb6d06369b8ecde9df1dbf40
2,337
cc
C++
larq_compute_engine/mlir/transforms/fuse_padding.cc
godhj93/compute-engine
1f812a6722e2ee6a510c883826fd5925f9c34b18
[ "Apache-2.0" ]
null
null
null
larq_compute_engine/mlir/transforms/fuse_padding.cc
godhj93/compute-engine
1f812a6722e2ee6a510c883826fd5925f9c34b18
[ "Apache-2.0" ]
null
null
null
larq_compute_engine/mlir/transforms/fuse_padding.cc
godhj93/compute-engine
1f812a6722e2ee6a510c883826fd5925f9c34b18
[ "Apache-2.0" ]
null
null
null
#include "larq_compute_engine/mlir/transforms/padding.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" #include "tensorflow/compiler/mlir/lite/ir/tfl_ops.h" namespace mlir { namespace TFL { namespace { bool NoBatchAndChannelPadding(Attribute paddings_attr) { auto paddings = GetValidPadAttr(paddings_attr); if (!paddings) return false; return IsNoPadding(paddings, 0) && IsNoPadding(paddings, 3); } // The TFLite op has `stride_height` and `stride_width` as separate attributes. // Due to a TableGen limitation we can't pass them both in a single call. bool IsSamePaddingPartial(Attribute paddings_attr, Value input, Value output, Attribute strides_attr, uint64_t dimension) { auto paddings = GetValidPadAttr(paddings_attr); if (!paddings) return false; auto input_shape = GetShape4D(input); if (input_shape.empty()) return false; auto output_shape = GetShape4D(output); if (output_shape.empty()) return false; if (!strides_attr.isa<IntegerAttr>()) return false; const int stride = strides_attr.cast<IntegerAttr>().getInt(); // Check that there is no padding in the batch and channel dimensions return IsSamePadding1D(paddings, dimension, input_shape[dimension], output_shape[dimension], stride); } #include "larq_compute_engine/mlir/transforms/generated_fuse_padding.inc" // Prepare LCE operations in functions for subsequent legalization. struct FusePadding : public PassWrapper<FusePadding, FunctionPass> { FusePadding() = default; FusePadding(const FusePadding& pass) {} void runOnFunction() override { auto* ctx = &getContext(); OwningRewritePatternList patterns(ctx); auto func = getFunction(); populateWithGenerated(patterns); (void)applyPatternsAndFoldGreedily(func, std::move(patterns)); } void getDependentDialects(DialectRegistry& registry) const override { registry.insert<::mlir::TFL::TensorFlowLiteDialect>(); } }; } // namespace // Creates an instance of the TensorFlow dialect FusePadding pass. std::unique_ptr<OperationPass<FuncOp>> CreateFusePaddingPass() { return std::make_unique<FusePadding>(); } static PassRegistration<FusePadding> pass( "tfl-fuse-padding", "Fuse padding ops into (Depthwise)Convs."); } // namespace TFL } // namespace mlir
34.880597
79
0.744544
990895bc2b59a8a47daa6835471237eac9152d89
8,857
cpp
C++
XMLWriter.cpp
malord/prime
f0e8be99b7dcd482708b9c928322bc07a3128506
[ "MIT" ]
null
null
null
XMLWriter.cpp
malord/prime
f0e8be99b7dcd482708b9c928322bc07a3128506
[ "MIT" ]
null
null
null
XMLWriter.cpp
malord/prime
f0e8be99b7dcd482708b9c928322bc07a3128506
[ "MIT" ]
null
null
null
// Copyright 2000-2021 Mark H. P. Lord #include "XMLWriter.h" #include <string.h> namespace { // TODO: might be worth finding a common place for this? Or making them static methods so other modules can use them? inline bool IsXMLWhitespace(char ch) { return ch == 0x09 || ch == 0x0a || ch == 0x0d || ch == 0x0c || ch == 0x20; } inline const char* SkipXMLWhitespace(const char* from, const char* to) { for (; from != to; ++from) { if (!IsXMLWhitespace(*from)) { return from; } } return from; } } namespace Prime { XMLWriter::XMLWriter() { } XMLWriter::XMLWriter(const Options& options, Stream* stream, Log* log, size_t bufferSize, void* buffer) { init(options, stream, log, bufferSize, buffer); } XMLWriter::~XMLWriter() { } void XMLWriter::init(const Options& options, Stream* stream, Log* log, size_t bufferSize, void* buffer) { reset(); _streamBuffer.init(stream, bufferSize, buffer); _log = log; _options = options; beginWrite(); } void XMLWriter::beginWrite() { _currentIndent = 0; _errors = false; } bool XMLWriter::end() { PRIME_ASSERT(_elements.empty()); // Didn't end all elements. return flush(); } bool XMLWriter::flush() { if (!_streamBuffer.flush(_log)) { _errors = true; } return !getErrorFlag(); } bool XMLWriter::reset() { bool success = flush(); _errors = false; return success; } void XMLWriter::writeRaw(StringView string) { if (!_streamBuffer.writeString(string, _log)) { _errors = true; } } void XMLWriter::writeDOCTYPE(StringView text) { _errors = !_streamBuffer.writeBytes("<!", 2, _log) || _errors; //writeEscaped(text); _errors = !_streamBuffer.writeString(text, _log) || _errors; _errors = !_streamBuffer.writeByte('>', _log) || _errors; } void XMLWriter::writeComment(StringView string) { // Should probably add a check for --> (actually, -- is illegal in a comment) in the comment. I'll leave that to the caller for now. closeElementAndWriteIndent(); _errors = !_streamBuffer.writeBytes("<!-- ", 5, _log) || _errors; writeCommentEscaped(string); _errors = !_streamBuffer.writeBytes(" -->", 4, _log) || _errors; } void XMLWriter::writeCommentEscaped(StringView stringView) { const char* string = stringView.begin(); const char* ptr = stringView.begin(); const char* end = stringView.end(); const char* escape = NULL; for (;;) { if (ptr == end) { } else if (*ptr == '-' && end - ptr >= 3 && memcmp(ptr, "-->", 3) == 0) { escape = "-- >"; } else { ++ptr; continue; } _errors = !_streamBuffer.writeBytes(string, ptr - string, _log) || _errors; if (ptr == end) { break; } _errors = !_streamBuffer.writeString(escape, _log) || _errors; escape = 0; ++ptr; string = ptr; } } void XMLWriter::closeElementAndWriteIndent() { closeElement(); if (!_elements.empty() && !_elements.back().isText) { _errors = !_streamBuffer.writeByte('\n', _log) || _errors; writeIndent(); } } void XMLWriter::startElement(StringView name) { startElement(name, false); } void XMLWriter::startTextElement(StringView name) { startElement(name, true); } void XMLWriter::writeProcessingInstruction(StringView name, StringView content) { closeElementAndWriteIndent(); _errors = !_streamBuffer.writeBytes("<?", 2, _log) || _errors; _errors = !_streamBuffer.writeString(name, _log) || _errors; _errors = !_streamBuffer.writeBytes(" ", 1, _log) || _errors; _errors = !_streamBuffer.writeString(content, _log) || _errors; _errors = !_streamBuffer.writeBytes("?>", 2, _log) || _errors; } void XMLWriter::startElement(StringView name, bool isText) { closeElementAndWriteIndent(); _errors = !_streamBuffer.writeByte('<', _log) || _errors; _errors = !_streamBuffer.writeString(name, _log) || _errors; Element newElement; newElement.name = name; newElement.isText = isText; newElement.isOpen = true; ++_currentIndent; _elements.push_back(newElement); } void XMLWriter::closeElement() { if (!_elements.empty() && _elements.back().isOpen) { _errors = !_streamBuffer.writeByte('>', _log) || _errors; _elements.back().isOpen = false; } } void XMLWriter::writeIndent() { if (!_elements.empty() && !_elements.back().isText) { for (int i = 0; i != _currentIndent; ++i) { _errors = !_streamBuffer.writeByte('\t', _log) || _errors; } } } void XMLWriter::writeAttribute(StringView name, StringView value) { PRIME_ASSERT(!_elements.empty()); // Need an element to have an attribute. PRIME_ASSERT(_elements.back().isOpen); // The > has been written. _errors = !_streamBuffer.writeByte(' ', _log) || _errors; _errors = !_streamBuffer.writeString(name, _log) || _errors; _errors = !_streamBuffer.writeBytes("=\"", 2, _log) || _errors; writeEscaped(value); _errors = !_streamBuffer.writeByte('"', _log) || _errors; } void XMLWriter::writeEscaped(StringView stringView) { const char* string = stringView.begin(); const char* ptr = string; const char* end = stringView.end(); const char* escape = NULL; for (;;) { if (ptr != end) { if (*ptr == '<') { escape = "&lt;"; } else if (*ptr == '>') { escape = "&gt;"; } else if (*ptr == '\'') { escape = _options.getHTML() ? "&#39;" : "&apos;"; } else if (*ptr == '"') { escape = "&quot;"; } else if (*ptr == '&') { escape = "&amp;"; } else { ++ptr; continue; } } _errors = !_streamBuffer.writeBytes(string, ptr - string, _log) || _errors; if (ptr == end) { break; } _errors = !_streamBuffer.writeString(escape, _log) || _errors; escape = 0; ++ptr; string = ptr; } } void XMLWriter::writeTextInternal(StringView string, bool escape) { const char* begin = string.begin(); const char* end = string.end(); if (!_elements.empty()) { if (!_elements.back().isText) { begin = SkipXMLWhitespace(begin, end); if (begin != end) { _elements.back().isText = true; } } } if (begin == end) { return; } closeElement(); if (escape) { writeEscaped(StringView(begin, end)); } else { writeRaw(StringView(begin, end)); } } void XMLWriter::writeText(StringView string) { writeTextInternal(string, true); } void XMLWriter::writeEscapedText(StringView string) { writeTextInternal(string, false); } void XMLWriter::writeCDATA(StringView text) { if (!_elements.empty()) { _elements.back().isText = true; } closeElement(); _errors = !_streamBuffer.writeBytes("<![CDATA[", 9, _log) || _errors; writeCDATAEscaped(text); _errors = !_streamBuffer.writeBytes("]]>", 3, _log) || _errors; } void XMLWriter::writeCDATAEscaped(StringView stringView) { const char* string = stringView.begin(); const char* ptr = string; const char* end = stringView.end(); const char* escape = NULL; for (;;) { if (ptr == end) { } else if (*ptr == ']' && end - ptr >= 3 && memcmp(ptr, "]]>", 3) == 0) { escape = "]]><![CDATA["; } else { ++ptr; continue; } _errors = !_streamBuffer.writeBytes(string, ptr - string, _log) || _errors; if (ptr == end) { break; } _errors = !_streamBuffer.writeString(escape, _log) || _errors; escape = 0; ++ptr; string = ptr; } } void XMLWriter::endElement(bool allowSelfClosing) { PRIME_ASSERT(!_elements.empty()); // More end elements than start elements. --_currentIndent; if (_elements.back().isOpen && allowSelfClosing) { _errors = !_streamBuffer.writeBytes("/>", 2, _log) || _errors; } else { if (_elements.back().isOpen) { _errors = !_streamBuffer.writeBytes(">", 1, _log) || _errors; } if (!_elements.back().isText) { _errors = !_streamBuffer.writeByte('\n', _log) || _errors; writeIndent(); } _errors = !_streamBuffer.writeBytes("</", 2, _log) || _errors; _errors = !_streamBuffer.writeString(_elements.back().name, _log) || _errors; _errors = !_streamBuffer.writeByte('>', _log) || _errors; } _elements.pop_back(); //if (_elements.empty()) // _errors = ! _streamBuffer.writeByte('\n', _log) || _errors; } }
24.265753
136
0.584058
990ce40d611e8ecc977c2e5fe7133c3bcbddaf35
9,821
cpp
C++
Source/Engine/LightFroxelationTechnique.cpp
glowing-chemist/Bell
0cf4d0ac925940869077779700c1d3bd45ff841f
[ "MIT" ]
14
2020-02-12T19:13:46.000Z
2022-03-05T02:26:06.000Z
Source/Engine/LightFroxelationTechnique.cpp
glowing-chemist/Bell
0cf4d0ac925940869077779700c1d3bd45ff841f
[ "MIT" ]
5
2020-08-06T07:19:47.000Z
2021-01-05T21:20:51.000Z
Source/Engine/LightFroxelationTechnique.cpp
glowing-chemist/Bell
0cf4d0ac925940869077779700c1d3bd45ff841f
[ "MIT" ]
2
2021-09-18T13:36:47.000Z
2021-12-04T15:08:53.000Z
#include "Engine/LightFroxelationTechnique.hpp" #include "Engine/Engine.hpp" #include "Engine/DefaultResourceSlots.hpp" #include "Core/Executor.hpp" constexpr const char* kFroxelIndirectArgs = "FroxelIndirectArgs"; constexpr const char* kLightIndexCounter = "lightIndexCounter"; constexpr const char* kActiveFroxelsCounter = "ActiveFroxelsCounter"; LightFroxelationTechnique::LightFroxelationTechnique(RenderEngine* eng, RenderGraph& graph) : Technique("LightFroxelation", eng->getDevice()), mActiveFroxelsShader(eng->getShader("./Shaders/ActiveFroxels.comp")), mIndirectArgsShader(eng->getShader("./Shaders/IndirectFroxelArgs.comp")), mClearCoutersShader(eng->getShader("./Shaders/LightFroxelationClearCounters.comp")), mLightAsignmentShader(eng->getShader("./Shaders/FroxelationGenerateLightLists.comp")), mXTiles(eng->getDevice()->getSwapChainImageView()->getImageExtent().width / 32), mYTiles(eng->getDevice()->getSwapChainImageView()->getImageExtent().height / 32), mLightBuffer(getDevice(), BufferUsage::DataBuffer | BufferUsage::TransferDest, (sizeof(Scene::Light) * 1000) + std::max(sizeof(uint4), getDevice()->getMinStorageBufferAlignment()), (sizeof(Scene::Light) * 1000) + std::max(sizeof(uint4), getDevice()->getMinStorageBufferAlignment()), "LightBuffer"), mLightBufferView(mLightBuffer, std::max(sizeof(uint4), getDevice()->getMinStorageBufferAlignment())), mLightCountView(mLightBuffer, 0, sizeof(uint4)), mLightsSRS(getDevice(), 2), mActiveFroxelsImage(eng->getDevice(), Format::R32Uint, ImageUsage::Storage | ImageUsage::Sampled, eng->getDevice()->getSwapChainImageView()->getImageExtent().width, eng->getDevice()->getSwapChainImageView()->getImageExtent().height, 1, 1, 1, 1, "ActiveFroxels"), mActiveFroxelsImageView(mActiveFroxelsImage, ImageViewType::Colour), // Assumes an avergae max of 10 active froxels per screen space tile. mActiveFroxlesBuffer(eng->getDevice(), BufferUsage::DataBuffer | BufferUsage::Uniform, sizeof(float4) * (mXTiles * mYTiles * 10), sizeof(float4) * (mXTiles* mYTiles * 10), "ActiveFroxelBuffer"), mActiveFroxlesBufferView(mActiveFroxlesBuffer, std::max(eng->getDevice()->getMinStorageBufferAlignment(), sizeof(uint32_t))), mActiveFroxelsCounter(mActiveFroxlesBuffer, 0u, static_cast<uint32_t>(sizeof(uint32_t))), mIndirectArgsBuffer(eng->getDevice(), BufferUsage::DataBuffer | BufferUsage::IndirectArgs, sizeof(uint32_t) * 3, sizeof(uint32_t) * 3, "FroxelIndirectArgs"), mIndirectArgsView(mIndirectArgsBuffer, 0, sizeof(uint32_t) * 3), mSparseFroxelBuffer(eng->getDevice(), BufferUsage::DataBuffer, sizeof(float2) * (mXTiles * mYTiles * 32), sizeof(float2) * (mXTiles * mYTiles * 32), kSparseFroxels), mSparseFroxelBufferView(mSparseFroxelBuffer), mLightIndexBuffer(eng->getDevice(), BufferUsage::DataBuffer, sizeof(uint32_t) * (mXTiles * mYTiles * 16 * 16), sizeof(uint32_t) * (mXTiles * mYTiles * 16 * 16), kLightIndicies), mLightIndexBufferView(mLightIndexBuffer, std::max(eng->getDevice()->getMinStorageBufferAlignment(), sizeof(uint32_t))), mLightIndexCounterView(mLightIndexBuffer, 0, static_cast<uint32_t>(sizeof(uint32_t))) { // set light buffers SRS for(uint32_t i = 0; i < getDevice()->getSwapChainImageCount(); ++i) { mLightsSRS.get(i)->addDataBufferRO(mLightCountView.get(i)); mLightsSRS.get(i)->addDataBufferRW(mLightBufferView.get(i)); mLightsSRS.get(i)->finalise(); } ComputeTask clearCountersTask{ "clearFroxelationCounters" }; clearCountersTask.addInput(kActiveFroxelsCounter, AttachmentType::DataBufferWO); clearCountersTask.addInput(kLightIndexCounter, AttachmentType::DataBufferWO); clearCountersTask.setRecordCommandsCallback( [this](const RenderGraph& graph, const uint32_t taskIndex, Executor* exec, RenderEngine*, const std::vector<const MeshInstance*>&) { PROFILER_EVENT("Clear froxel counter"); PROFILER_GPU_TASK(exec); PROFILER_GPU_EVENT("Clear froxel counter"); const RenderTask& task = graph.getTask(taskIndex); exec->setComputeShader(static_cast<const ComputeTask&>(task), graph, mClearCoutersShader); exec->dispatch(1, 1, 1); } ); mClearCounters = graph.addTask(clearCountersTask); ComputeTask activeFroxelTask{ "LightingFroxelation" }; activeFroxelTask.addInput(kActiveFroxels, AttachmentType::Image2D); activeFroxelTask.addInput(kLinearDepth, AttachmentType::Texture2D); activeFroxelTask.addInput(kCameraBuffer, AttachmentType::UniformBuffer); activeFroxelTask.addInput(kDefaultSampler, AttachmentType::Sampler); activeFroxelTask.addInput(kActiveFroxelBuffer, AttachmentType::DataBufferWO); activeFroxelTask.addInput(kActiveFroxelsCounter, AttachmentType::DataBufferRW); activeFroxelTask.setRecordCommandsCallback( [this](const RenderGraph& graph, const uint32_t taskIndex, Executor* exec, RenderEngine* eng, const std::vector<const MeshInstance*>&) { PROFILER_EVENT("light froxelation"); PROFILER_GPU_TASK(exec); PROFILER_GPU_EVENT("light froxelation"); const RenderTask& task = graph.getTask(taskIndex); exec->setComputeShader(static_cast<const ComputeTask&>(task), graph, mActiveFroxelsShader); const auto extent = eng->getDevice()->getSwapChainImageView()->getImageExtent(); exec->dispatch(static_cast<uint32_t>(std::ceil(extent.width / 32.0f)), static_cast<uint32_t>(std::ceil(extent.height / 32.0f)), 1); } ); mActiveFroxels = graph.addTask(activeFroxelTask); ComputeTask indirectArgsTask{ "generateFroxelIndirectArgs" }; indirectArgsTask.addInput(kActiveFroxelsCounter, AttachmentType::DataBufferRO); indirectArgsTask.addInput(kFroxelIndirectArgs, AttachmentType::DataBufferWO); indirectArgsTask.setRecordCommandsCallback( [this](const RenderGraph& graph, const uint32_t taskIndex, Executor* exec, RenderEngine*, const std::vector<const MeshInstance*>&) { const RenderTask& task = graph.getTask(taskIndex); exec->setComputeShader(static_cast<const ComputeTask&>(task), graph, mIndirectArgsShader); exec->dispatch(1, 1, 1); } ); mIndirectArgs = graph.addTask(indirectArgsTask); ComputeTask lightListAsignmentTask{ "LightAsignment" }; lightListAsignmentTask.addInput(kActiveFroxelBuffer, AttachmentType::DataBufferRO); lightListAsignmentTask.addInput(kActiveFroxelsCounter, AttachmentType::DataBufferRO); lightListAsignmentTask.addInput(kLightIndicies, AttachmentType::DataBufferWO); lightListAsignmentTask.addInput(kLightIndexCounter, AttachmentType::DataBufferRW); lightListAsignmentTask.addInput(kSparseFroxels, AttachmentType::DataBufferWO); lightListAsignmentTask.addInput(kCameraBuffer, AttachmentType::UniformBuffer); lightListAsignmentTask.addInput(kLightBuffer, AttachmentType::ShaderResourceSet); lightListAsignmentTask.addInput(kFroxelIndirectArgs, AttachmentType::IndirectBuffer); lightListAsignmentTask.setRecordCommandsCallback( [this](const RenderGraph& graph, const uint32_t taskIndex, Executor* exec, RenderEngine*, const std::vector<const MeshInstance*>&) { PROFILER_EVENT("build light lists"); PROFILER_GPU_TASK(exec); PROFILER_GPU_EVENT("build light lists"); const RenderTask& task = graph.getTask(taskIndex); exec->setComputeShader(static_cast<const ComputeTask&>(task), graph, mLightAsignmentShader); exec->dispatchIndirect(this->mIndirectArgsView); } ); mLightListAsignment = graph.addTask(lightListAsignmentTask); } void LightFroxelationTechnique::render(RenderGraph&, RenderEngine* engine) { mActiveFroxelsImageView->updateLastAccessed(); mActiveFroxelsImage->updateLastAccessed(); mActiveFroxlesBuffer->updateLastAccessed(); mSparseFroxelBuffer->updateLastAccessed(); mLightIndexBuffer->updateLastAccessed(); mIndirectArgsBuffer->updateLastAccessed(); (*mLightBuffer)->updateLastAccessed(); (*mLightsSRS)->updateLastAccessed(); // Frustum cull the lights and send to the gpu. Frustum frustum = engine->getCurrentSceneCamera().getFrustum(); std::vector<Scene::Light*> visibleLightPtrs = engine->getScene()->getVisibleLights(frustum); std::vector<Scene::Light> visibleLights{}; visibleLights.reserve(visibleLightPtrs.size()); std::transform(visibleLightPtrs.begin(), visibleLightPtrs.end(), std::back_inserter(visibleLights), [] (const Scene::Light* light) { return *light; }); mLightBuffer.get()->setContents(static_cast<int>(visibleLights.size()), sizeof(uint32_t)); if(!visibleLights.empty()) { mLightBuffer.get()->resize(visibleLights.size() * sizeof(Scene::Light), false); mLightBuffer.get()->setContents(visibleLights.data(), static_cast<uint32_t>(visibleLights.size() * sizeof(Scene::Light)), std::max(sizeof(uint4), engine->getDevice()->getMinStorageBufferAlignment())); } } void LightFroxelationTechnique::bindResources(RenderGraph& graph) { graph.bindShaderResourceSet(kLightBuffer, *mLightsSRS); if(!graph.isResourceSlotBound(kActiveFroxels)) { graph.bindImage(kActiveFroxels, mActiveFroxelsImageView); graph.bindBuffer(kActiveFroxelBuffer, mActiveFroxlesBufferView); graph.bindBuffer(kSparseFroxels, mSparseFroxelBufferView); graph.bindBuffer(kLightIndicies, mLightIndexBufferView); graph.bindBuffer(kActiveFroxelsCounter, mActiveFroxelsCounter); graph.bindBuffer(kFroxelIndirectArgs, mIndirectArgsView); graph.bindBuffer(kLightIndexCounter, mLightIndexCounterView); } }
53.961538
302
0.74188
990e91dfcbacdb744afa79e9d0ea86c0449d3536
17,620
cc
C++
third-party/webscalesqlclient/mysql-5.6/sql/item_jsonfunc.cc
hkirsman/hhvm_centos7_builds
2a1fd6de0d2d289c1575f43f10018f3bec23bb13
[ "PHP-3.01", "Zend-2.0" ]
null
null
null
third-party/webscalesqlclient/mysql-5.6/sql/item_jsonfunc.cc
hkirsman/hhvm_centos7_builds
2a1fd6de0d2d289c1575f43f10018f3bec23bb13
[ "PHP-3.01", "Zend-2.0" ]
null
null
null
third-party/webscalesqlclient/mysql-5.6/sql/item_jsonfunc.cc
hkirsman/hhvm_centos7_builds
2a1fd6de0d2d289c1575f43f10018f3bec23bb13
[ "PHP-3.01", "Zend-2.0" ]
null
null
null
/* Copyright (c) 2014, Facebook. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* This file defines all json string functions (using FBSON library) */ /* May include caustic 3rd-party defs. Use early, so it can override nothing. */ #include "my_global.h" /* It is necessary to include set_var.h instead of item.h because there are dependencies on include order for set_var.h and item.h. This will be resolved later. */ #include "sql_class.h" #include "set_var.h" #include "mysqld.h" #include "item_cmpfunc.h" // error messages for JSON parsing errors const constexpr char* const fbson::FbsonErrMsg::err_msg_[]; /* * Note we assume the system charset is UTF8, * which is the encoding of json object in FBSON */ /* * Converts FbsonValue object to string and write to str * Input: pval - FbsonValue object to convert * str - output * cs - character set * json_text - whether to return json text or native values * Output: true - success */ static bool ValueToString(fbson::FbsonValue *pval, String &str, const CHARSET_INFO *cs, bool json_text) { if (!pval) return false; switch (pval->type()) { case fbson::FbsonType::T_Null: { if (json_text) { str.set("null", 4, cs); return true; } else return false; } case fbson::FbsonType::T_False: { if (json_text) str.set("false", 5, cs); else str.set_int(0, true /*unsigned_flag*/, cs); return true; } case fbson::FbsonType::T_True: { if (json_text) str.set("true", 4, cs); else str.set_int(1, true /*unsigned_flag*/, cs); return true; } case fbson::FbsonType::T_String: { if (!json_text) { // copy the string without double quotes fbson::StringVal *str_val = (fbson::StringVal *)pval; str.copy(str_val->getBlob(), str_val->getBlobLen(), cs); return true; } // else json_text, fall through } case fbson::FbsonType::T_Object: case fbson::FbsonType::T_Array: { fbson::FbsonToJson tojson; const char *json = tojson.json(pval); str.copy(json, strlen(json), cs); return true; } case fbson::FbsonType::T_Int8: { str.set_int(((fbson::Int8Val*)pval)->val(), false, cs); return true; } case fbson::FbsonType::T_Int16: { str.set_int(((fbson::Int16Val*)pval)->val(), false, cs); return true; } case fbson::FbsonType::T_Int32: { str.set_int(((fbson::Int32Val*)pval)->val(), false, cs); return true; } case fbson::FbsonType::T_Int64: { str.set_int(((fbson::Int64Val*)pval)->val(), false, cs); return true; } case fbson::FbsonType::T_Double: { str.set_real(((fbson::DoubleVal*)pval)->val(), NOT_FIXED_DEC, cs); return true; } default: return false; } return false; } /* * Get FBSON value object from item if item is FBSON binary * Otherwise, the string is pointed by json * Input: item - input item * Output: json - a json string or an fbson binary blob * Return: FbsonValue object * * Note: if the item is a document column, the item value is Fbson binary and * an FbsonValue object is returned (the fbson binary is stored in the json * output param). Otherwise, the item's string value depends on two conditions: * (1) whether it is a DOC_EXTRACT_FUNC, and (2) whether * use_fbson_output_format is turned on. If both are true, the item value is * Fbson binary and FbsonValue object is returned. Otherwise, the JSON string * is stored in json (output param) and return value is nullptr. */ static fbson::FbsonValue *get_fbson_val(Item *item, String *&json, String *buffer) { fbson::FbsonValue *pval = nullptr; if (item->field_type() == MYSQL_TYPE_DOCUMENT) { // item is a document field, and json is an fbson binary pval = item->val_document_value(buffer); // this is an FBSON blob if(pval != nullptr && buffer->ptr() != (char*)pval) { buffer->copy((char*)pval, pval->numPackedBytes(), item->collation.collation); json = buffer; } } else { json = item->val_str(buffer); // we check again if the string is actually FBSON value binary. // if use_fbson_output_format is true and item is DOC_EXTRACT_FUNC, // then json is a fbson binary, and we convert it to FbsonValue object. // otherwise, json is a JSON string. if (json && current_thd->variables.use_fbson_output_format && item->type() == item->FUNC_ITEM && ((Item_func*)item)->functype() == ((Item_func*)item)->DOC_EXTRACT_FUNC) pval = (fbson::FbsonValue*)(json->ptr()); } return pval; } /* * Parses JSON c_str into FBSON value object * Input: c_str - JSON string (null terminated) * os - output stream storing FBSON packed bytes * Output: FbsonValue object. * NULL if JSON is invalid */ static fbson::FbsonValue *get_fbson_val(const char *c_str, fbson::FbsonOutStream &os) { // try parsing input as JSON fbson::FbsonValue *pval = nullptr; fbson::FbsonJsonParser parser(os); if (parser.parse(c_str)) { pval = fbson::FbsonDocument::createValue( os.getBuffer(), os.getSize()); DBUG_ASSERT(pval); } else { fbson::FbsonErrInfo err_info = parser.getErrorInfo(); my_error(ER_INVALID_JSON, MYF(0), c_str, err_info.err_pos, err_info.err_msg); } return pval; } /* * Item_func_json_valid */ bool Item_func_json_valid::val_bool() { DBUG_ASSERT(fixed); null_value = 0; String buffer; String *json = nullptr; // we try to get FbsonVal if first input arg is FBSON binary // otherwise the input arg string is returned/stored in json fbson::FbsonValue *pval = get_fbson_val(args[0], json, &buffer); if (json) { if (pval) return true; // FBSON blob fbson::FbsonJsonParser parser; return parser.parse(json->c_ptr_safe()); } null_value = 1; return false; } longlong Item_func_json_valid::val_int() { return (val_bool() ? 1 : 0); } /* * Extracts key path (stored in args) from pval * Input: args - path arguments * arg_count - # of path elements * pval - FBSON value object to extract from * Output: FbsonValue object pointed by key path. * NULL if path is invalid */ static fbson::FbsonValue* json_extract_helper(Item **args, uint arg_count, fbson::FbsonValue *pval) /* in: fbson value object */ { String buffer; String *pstr; for (unsigned i = 1; i < arg_count && pval; ++i) { if (pval->isObject()) { if ( (pstr = args[i]->val_str(&buffer)) ) pval = ((fbson::ObjectVal*)pval)->find(pstr->c_ptr_safe()); else pval = nullptr; } else if (pval->isArray()) { if ( (pstr = args[i]->val_str(&buffer)) ) { // array index parameter is 0-based char *end = nullptr; int index = strtol(pstr->c_ptr_safe(), &end, 0); if (end && !*end) pval = ((fbson::ArrayVal*)pval)->get(index); else pval = nullptr; } else pval = nullptr; } else pval = nullptr; } return pval; } String *Item_func_json_extract::intern_val_str(String *str, bool json_text) { DBUG_ASSERT(fixed); null_value = 0; String *pstr = nullptr; // we try to get FbsonVal if first input arg is FBSON binary // otherwise the input arg string is returned/stored in pstr fbson::FbsonValue *pval = get_fbson_val(args[0], pstr, str); if (pstr) { if (pval) { pval = json_extract_helper(args, arg_count, pval); if (pval && current_thd->variables.use_fbson_output_format) { // if we output FBSON, set the returning str to the underlying buffer str->set((char*)pval, pval->numPackedBytes(), collation.collation); return str; } else if (ValueToString(pval,*str,collation.collation, json_text)) return str; } else { fbson::FbsonOutStream os; pval = get_fbson_val(pstr->c_ptr_safe(), os); pval = json_extract_helper(args, arg_count, pval); if (pval && current_thd->variables.use_fbson_output_format) { str->copy((char*)pval, pval->numPackedBytes(), collation.collation); return str; } else if (ValueToString(pval, *str, collation.collation, json_text)) return str; } } null_value = 1; return nullptr; } /* * Item_func_json_extract * The retrurned string format is valid JSON text, such as: * true, false * null * "string" * 123, 123.45 * {"key":"value"} * [1,2,3] * * This is useful if we want to get value in JSON format from key path. */ String *Item_func_json_extract::val_str(String *str) { return intern_val_str(str, true /* json_text */); } void Item_func_json_extract::fix_length_and_dec() { // use the json data size (first arg) ulonglong char_length= args[0]->max_char_length(); fix_char_length_ulonglong(char_length); } /* * Item_func_json_extract_value * The returned string format is raw value, such as: * 1 (for true), 0 (for false) * NULL row (for null) * string (no double quotes) * 123, 123.45 * {"key":"value"} * [1,2,3] * * This is useful if the value will be directly used in comparsions on string * vs. integer, in the WHERE clause. */ String *Item_func_json_extract_value::val_str(String *str) { return Item_func_json_extract::intern_val_str(str, false /* json_text */); } /* * Item_func_json_contains_key */ bool Item_func_json_contains_key::val_bool() { DBUG_ASSERT(fixed); null_value = 0; String buffer; String *pstr = nullptr; // we try to get FbsonVal if first input arg is FBSON binary // otherwise the input arg string is returned/stored in pstr fbson::FbsonValue *pval = get_fbson_val(args[0], pstr, &buffer); if (pstr) { if (pval) { return json_extract_helper(args, arg_count, pval) != nullptr; } else { fbson::FbsonOutStream os; pval = get_fbson_val(pstr->c_ptr_safe(), os); return json_extract_helper(args, arg_count, pval) != nullptr; } } null_value = 1; return false; } longlong Item_func_json_contains_key::val_int() { return (val_bool() ? 1 : 0); } /* * Gets array length from FbsonValue object * Input: pval - FbsonValue object (array) * json - original JSON string * Output: number of array elements (array length) * 0 if pval is not an array object */ static longlong json_array_length_helper(fbson::FbsonValue *pval, const char *json) { if (pval && pval->isArray()) return ((fbson::ArrayVal*)pval)->numElem(); else my_error(ER_INVALID_JSON_ARRAY, MYF(0), json, 0, "Invalid array value"); return 0; } /* * Item_func_json_array_length */ longlong Item_func_json_array_length::val_int() { DBUG_ASSERT(fixed); null_value = 0; String buffer; String *pstr = nullptr; // we try to get FbsonVal if first input arg is FBSON binary // otherwise the input arg string is returned/stored in pstr fbson::FbsonValue *pval = get_fbson_val(args[0], pstr, &buffer); if (pstr) { if (pval) { return json_array_length_helper(pval, pstr->c_ptr_safe()); } else { fbson::FbsonOutStream os; pval = get_fbson_val(pstr->c_ptr_safe(), os); return json_array_length_helper(pval, pstr->c_ptr_safe()); } } null_value = 1; return 0; } /* Returns true if the item value matches that of the FbsonValue. * * For example, if the FbsonValue is Int8, check the val_int() of the item. * If the FbsonValue is a String, check the val_str() of the item. */ static bool compare_fbson_value_with_item(Item *item, fbson::FbsonValue *pval) { DBUG_ASSERT(pval); String str; switch (pval->type()) { case fbson::FbsonType::T_Null: { return (item->type() == Item::NULL_ITEM); } case fbson::FbsonType::T_False: { return (item->type() == Item::INT_ITEM && item->val_int() == 0); } case fbson::FbsonType::T_True: { return (item->type() == Item::INT_ITEM && item->val_int() == 1); } case fbson::FbsonType::T_String: { if (item->type() != Item::STRING_ITEM) return false; /* Compare strings character by character */ String *item_str = item->val_str(&str); fbson::StringVal *str_val = (fbson::StringVal *)pval; if (item_str->length() != str_val->getBlobLen()) return false; return !memcmp(item_str->c_ptr(), str_val->getBlob(), item_str->length()); } case fbson::FbsonType::T_Object: case fbson::FbsonType::T_Array: { /* Perform SIMILAR comparison where all kvp's must match */ if (item->type() == Item::DOCUMENT_ITEM) { fbson::FbsonValue *pval2 = item->val_document_value(&str); if (pval2) return compare_fbson_value(pval, pval2); } return false; } case fbson::FbsonType::T_Int8: { return (item->type() == Item::INT_ITEM && item->val_int() == ((fbson::Int8Val*)pval)->val()); } case fbson::FbsonType::T_Int16: { return (item->type() == Item::INT_ITEM && item->val_int() == ((fbson::Int16Val*)pval)->val()); } case fbson::FbsonType::T_Int32: { return (item->type() == Item::INT_ITEM && item->val_int() == ((fbson::Int32Val*)pval)->val()); } case fbson::FbsonType::T_Int64: { return (item->type() == Item::INT_ITEM && item->val_int() == ((fbson::Int64Val*)pval)->val()); } case fbson::FbsonType::T_Double: { return ((item->type() == Item::DECIMAL_ITEM || item->type() == Item::REAL_ITEM) && item->val_real() == ((fbson::DoubleVal*)pval)->val()); } default: DBUG_ASSERT(0); return false; } } /* * Gets whether or not a key or key-value pair is contained in a document * Input: pval - FbsonValue object * key - The key name to search for * val - The value to search for (null is only search for key) * * Output: true if a key or key-value is contained in the document * false if the key or key-value could not be found anywhere in document */ static bool json_contains_helper(Item *key, Item *val, fbson::FbsonValue *pval) { DBUG_ASSERT(pval); /* Check key is a string */ if (key->type() != Item::STRING_ITEM) { my_error(ER_WRONG_ARGUMENTS, MYF(0), "KEY MUST BE STRING"); return false; } String buffer; if (pval->isObject()) { String *key_str = key->val_str(&buffer); fbson::FbsonValue *find = ((fbson::ObjectVal*)pval)->find(key_str->c_ptr()); /* Find the key or find the key-value pair */ if ((find && !val) || (find && val && compare_fbson_value_with_item(val, find))) return true; /* Continue searching recursively at the next level */ fbson::ObjectVal::iterator it = ((fbson::ObjectVal*) pval)->begin(); fbson::ObjectVal::iterator it_end = ((fbson::ObjectVal*) pval)->end(); for (; it != it_end; ++it) { if (json_contains_helper(key, val, it->value())) return true; } return false; } /* Recursively search all key-value pairs in the array */ if (pval->isArray()) { for (uint i = 0; i < ((fbson::ArrayVal*)pval)->numElem(); i++) { if (json_contains_helper(key, val, ((fbson::ArrayVal*)pval)->get(i))) return true; } } return false; } /* * Item_func_json_contains will return true if the key-value pair can be found * on any level of the document. If the value is omitted, it will search for * just the key. * * First argument is the column name * Second argument is the key * Third argument (optional) is the value */ bool Item_func_json_contains::val_bool() { DBUG_ASSERT(fixed); null_value = 0; String buffer; String *pstr = nullptr; /* "pstr" is set to the binary or string value of the item * If "pstr" is the FBSON binary, "pval" will be the associated FbsonValue. * If "pstr" is the JSON literal string, "pval" will be NULL */ fbson::FbsonValue *pval = get_fbson_val(args[0], pstr, &buffer); if (pstr) { fbson::FbsonOutStream os; if (!pval) pval = get_fbson_val(pstr->c_ptr_safe(), os); if (pval) { /* Search only for existence of key */ if (arg_count == 2) return json_contains_helper(args[1], nullptr, pval); /* Search for existence of key-value pair */ return json_contains_helper(args[1], args[2], pval); } } my_error(ER_INVALID_JSON, MYF(0), args[0]->val_str(&buffer), 0, "Invalid object value"); return false; } longlong Item_func_json_contains::val_int() { return (val_bool() ? 1 : 0); }
26.616314
80
0.62798
991079589d5147f94a6171c1143c3dd8af22f512
4,157
cpp
C++
environment/interpretation/obstacle_detector/src/ObstacleDetector.cpp
krishna95/freezing-batman
66f1ac7e73c65162f1593cf440c3363a9e4b1efb
[ "BSD-3-Clause" ]
null
null
null
environment/interpretation/obstacle_detector/src/ObstacleDetector.cpp
krishna95/freezing-batman
66f1ac7e73c65162f1593cf440c3363a9e4b1efb
[ "BSD-3-Clause" ]
null
null
null
environment/interpretation/obstacle_detector/src/ObstacleDetector.cpp
krishna95/freezing-batman
66f1ac7e73c65162f1593cf440c3363a9e4b1efb
[ "BSD-3-Clause" ]
null
null
null
#include "../include/ObstacleDetector.hpp" #include <climits> #include <cassert> void exit_with_help(){ std::cout<< "Usage: lane-detector [options]\n" "options:\n" "-d : Non-zero for debug\n" "-s : Subscriber topic name\n" "-p : Publisher topic name\n" "-l : Maximum distance we need \n" "-m : Mininum distance we need \n" ; exit(1); } void ObstacleDetector::publishData(){ cv_bridge::CvImage out_msg; out_msg.encoding = sensor_msgs::image_encodings::MONO8; out_msg.image = img; out_msg.encoding = sensor_msgs::image_encodings::MONO8; pub.publish(out_msg.toImageMsg()); } void ObstacleDetector::interpret() { if (debug){ cvNamedWindow("Control Box", 1); } int s=5; if (debug) { cvCreateTrackbar("Kernel 1", "Control Box", &s, 20); cv::namedWindow("Raw Scan", 0); cv::imshow("Raw Scan", img); cv::waitKey(WAIT_TIME); } int dilation_size = EXPAND_OBS; cv::Mat element = cv::getStructuringElement( cv::MORPH_ELLIPSE, cv::Size( 2*dilation_size + 1, 2*dilation_size+1 ), cv::Point( dilation_size, dilation_size ) ); cv::dilate(img, img, element); if (debug) { cv::namedWindow("Dilate Filter", 1); cv::imshow("Dilate Filter", img); cv::waitKey(WAIT_TIME); } publishData(); } void ObstacleDetector::scanCallback(const sensor_msgs::LaserScan& scan) { ROS_INFO("Scan callback called"); size_t size = scan.ranges.size(); float angle = scan.angle_min; float maxRangeForContainer = scan.range_max - 0.1f; img = img-img; // Assign zero to all pixels for (size_t i = 0; i < size; ++i) { float dist = scan.ranges[i]; if ((dist > scan.range_min) && (dist < maxRangeForContainer)) { double x1 = -1 * sin(angle) * dist; double y1 = cos(angle) * dist; int x = (int) ((x1 * 100) + CENTERX); int y = (int) ((y1 * 100) + CENTERY + LIDAR_Y_SHIFT); if (x >= 0 && y >= min_dist && (int) x < MAP_MAX && (int) y < max_dist) { int x2 = (x); int y2 = (MAP_MAX - y - 30 - 1); if(!(y2 >= 0 && y2 < MAP_MAX)){ continue; } img.at<uchar>(y2,x2)=255; } } angle += scan.angle_increment; } interpret(); } ObstacleDetector::ObstacleDetector(int argc, char *argv[], ros::NodeHandle &node_handle):nh(node_handle) { topic_name = std::string("interpreter/obstacleMap/0"); sub_topic_name = std::string("/scan"); min_dist = 0; max_dist = 400; debug = 0; for(int i=1;i<argc;i++) { if(argv[i][0] != '-') { break; } if (++i>=argc) { } switch(argv[i-1][1]) { case 'd': debug = atoi(argv[i]); break; case 's': sub_topic_name = std::string(argv[i]); break; case 'p': topic_name = std::string(argv[i]); break; case 'l': max_dist = atoi(argv[i]); break; case 'm': min_dist = atoi(argv[i]); break; default: fprintf(stderr, "Unknown option: -%c\n", argv[i-1][1]); exit_with_help(); } } it = new image_transport::ImageTransport(nh); sub = nh.subscribe(sub_topic_name.c_str(), 2, &ObstacleDetector::scanCallback,this); img = cv::Mat(MAP_MAX,MAP_MAX,CV_8UC1,cvScalarAll(0)); pub = it->advertise(topic_name.c_str(), 10); } ObstacleDetector::~ObstacleDetector() { } int main(int argc, char** argv) { std::string node_name; // if (argc>1){ // node_name = std::string("interpreter_obstacleDetector_") + std::string(argv[1]); // } // else{ // node_name = std::string("interpreter_obstacleDetector_0"); // } ros::init(argc, argv, node_name.c_str()); ros::NodeHandle nh; ObstacleDetector obstacle_detector(argc, argv, nh); ros::Rate loop_rate(LOOP_RATE); ROS_INFO("Obstacle Detector Thread Started..."); while (ros::ok()) { ros::spinOnce(); loop_rate.sleep(); } ROS_INFO("Obstacle code exiting"); return 0; }
26.819355
106
0.566514
9915b7f000edc4973109b7ba5e2117c26dcbd15b
15,698
cpp
C++
world/Room.cpp
sg-p4x347/binding-of-ryesaac
f4b4b3e8f29c5fa2dda184691358605c41f539d5
[ "MIT" ]
null
null
null
world/Room.cpp
sg-p4x347/binding-of-ryesaac
f4b4b3e8f29c5fa2dda184691358605c41f539d5
[ "MIT" ]
6
2019-11-29T16:42:12.000Z
2019-12-08T07:03:23.000Z
world/Room.cpp
sg-p4x347/binding-of-ryesaac
f4b4b3e8f29c5fa2dda184691358605c41f539d5
[ "MIT" ]
null
null
null
#include "pch.h" #include "Room.h" #include "geom/ModelRepository.h" using geom::ModelRepository; #include "tex/TextureRepository.h" using tex::TextureRepository; #include "geom/CollisionUtil.h" #include "geom/Sphere.h" #include "game/Game.h" using game::Game; #include "game/MultimediaPlayer.h" using game::MultimediaPlayer; #include <GL/glut.h> #include "World.h" namespace world { const float Room::k_collisionCullRange = 1.5f; Room::Room(RoomType type, Vector3 center) : m_center(center), m_type(type), m_inCombat(false), m_duck(0) { } void Room::Update(double elapsed) { AiUpdate(elapsed); AgentUpdate(elapsed); MovementUpdate(elapsed); CollisionUpdate(elapsed); DoorUpdate(elapsed); CombatUpdate(elapsed); ItemUpdate(elapsed); //SweepUpdate(elapsed); DeferredUpdate(elapsed); PlayerLocationUpdate(); } void Room::Render() { for (auto& entity : ER.GetIterator<Model, Position>()) { Position& position = entity.Get<Position>(); Model& modelComp = entity.Get<Model>(); if (!modelComp.Hidden && modelComp.ModelPtr) { glPushMatrix(); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,TextureRepository::GetID(modelComp.ModelPtr->Name)); glTranslatef(position.Pos.X, position.Pos.Y, position.Pos.Z); glRotatef(math::RadToDeg(position.Rot.X), 1.f, 0.f, 0.f); glRotatef(math::RadToDeg(position.Rot.Y), 0.f, 1.f, 0.f); glRotatef(math::RadToDeg(position.Rot.Z), 0.f, 0.f, 1.f); geom::Model& model = *modelComp.ModelPtr; for (auto& mesh : model.Meshes) { glBegin(GL_TRIANGLES); for (auto& index : mesh.Indices) { geom::ModelMeshVertex& vertex = mesh.Vertices[index]; glNormal3f(vertex.Normal.X, vertex.Normal.Y, vertex.Normal.Z); glTexCoord2f(vertex.TextureCoordinate.X, vertex.TextureCoordinate.Y); glVertex3f(vertex.Position.X, vertex.Position.Y, vertex.Position.Z); } glEnd(); } glBindTexture(GL_TEXTURE_2D, 0); glPopMatrix(); } } } EntityRepository& Room::GetER() { return ER; } Room::RoomType Room::GetType() { return m_type; } void Room::AddLoot(LootItem item) { m_loot.push_back(item); } void Room::DropLoot() { for (auto& loot : m_loot) { string modelName = ""; switch (loot) { case LootItem::Key: modelName = "key"; break; } m_deferredTasks.push_back([=] { ER.CreateEntity( Position(m_center, Vector3::Zero), Movement(Vector3::Zero,Vector3(0.f,1.f,0.f)), Model(ModelRepository::Get(modelName)), Collision(std::make_shared<geom::Sphere>(Vector3::Zero, 0.25f)), Item(loot) ); }); } // Consume the loot m_loot.clear(); } void Room::SweepAttack(int cornerIndex) { Vector3 pivot; Vector3 start; float angle; switch (cornerIndex) { case 0: pivot = m_center + Vector3(-World::k_roomUnitSize.X, 0.f, -World::k_roomUnitSize.Y) * 0.5f; start = m_center + Vector3(World::k_roomUnitSize.X, 0.f, -World::k_roomUnitSize.Y) * 0.5f; angle = -math::PI / 2.f; break; case 1: pivot = m_center + Vector3(World::k_roomUnitSize.X, 0.f, -World::k_roomUnitSize.Y) * 0.5f; start = m_center + Vector3(-World::k_roomUnitSize.X, 0.f, -World::k_roomUnitSize.Y) * 0.5f; angle = math::PI / 2.f; break; case 2: pivot = m_center + Vector3(World::k_roomUnitSize.X, 0.f, World::k_roomUnitSize.Y) * 0.5f; start = m_center + Vector3(-World::k_roomUnitSize.X, 0.f, World::k_roomUnitSize.Y) * 0.5f; angle = math::PI / 2.f; break; case 3: pivot = m_center + Vector3(-World::k_roomUnitSize.X, 0.f, World::k_roomUnitSize.Y) * 0.5f; start = m_center + Vector3(World::k_roomUnitSize.X, 0.f, World::k_roomUnitSize.Y) * 0.5f; angle = -math::PI / 2.f; break; } Sweep sweep; sweep.Duration = 6.f; for (float t = 0; t <= 1; t += 1.f / 20) { sweep.Waypoints.push_back(pivot + (math::CreateRotationY(angle * t) * (start - pivot))); } m_deferredTasks.push_back([=] { ER.CreateEntity( Position(), Movement(Vector3::Zero, Vector3(0.f, angle / sweep.Duration, 0.f)), Sweep(sweep), Model(ModelRepository::Get("duck_head")), Agent(Agent::AgentFaction::Toast, 0.f, 20, 0.f, 0.f, 1), Collision(std::make_shared<geom::Sphere>(Vector3::Zero, 1.f)) ); }); } ecs::EntityID Room::CreateDuck() { return ER.CreateEntity( Position(Vector3::Zero, Vector3(0.f, math::PI, 0.f)), Sweep(), Model(ModelRepository::Get("duck_head")), Agent(Agent::AgentFaction::Toast, 0.f, 20, 0.f, 0.f, 1), Collision(std::make_shared<geom::Sphere>(Vector3::Zero, 1.f)) ); } void Room::StompAttack(Vector2 focus) { m_deferredTasks.push_back([=] { if (!m_duck) { m_duck = CreateDuck(); } for (auto& entity : ER.GetIterator<Sweep>()) { auto& sweep = entity.Get<Sweep>(); if (sweep.ID == m_duck) { sweep.Duration = 6.f; static float start = 4.f; sweep.Waypoints.push_back(Vector3(focus.X, start, focus.Y)); sweep.Waypoints.push_back(Vector3(focus.X, 0.f, focus.Y)); sweep.Waypoints.push_back(Vector3(focus.X, 0.f, focus.Y)); sweep.Waypoints.push_back(Vector3(focus.X, start, focus.Y)); } } }); } void Room::AgentUpdate(double elapsed) { for (auto& entity : ER.GetIterator<Agent, Model, Movement, Collision, Position>()) { auto& agent = entity.Get<Agent>(); auto& model = entity.Get<Model>(); auto& movement = entity.Get<Movement>(); auto& collision = entity.Get<Collision>(); auto& position = entity.Get<Position>(); // Convert agent heading into a velocity agent.Heading.Normalize(); movement.Velocity = agent.Heading * agent.Speed; // Update attack cooldown agent.AttackCooldown = max(0.0, agent.AttackCooldown - elapsed); // Update recovery cooldown agent.RecoveryCooldown = max(0.0, agent.RecoveryCooldown - elapsed); // Strobe the model while in cooldown if (agent.RecoveryCooldown) { static const float k_recoveryFlashPeriod = 0.25f; model.Hidden = std::fmodf(agent.RecoveryCooldown, k_recoveryFlashPeriod) <= k_recoveryFlashPeriod * 0.5f; } else { model.Hidden = false; } if (agent.Attack && !agent.AttackCooldown) { shared_ptr<geom::Model> projectileModel; switch (agent.Faction) { case Agent::AgentFaction::Bread: projectileModel = ModelRepository::Get("butter"); break; case Agent::AgentFaction::Toast: projectileModel = ModelRepository::Get("butter"); break; } m_deferredTasks.push_back([=] { Agent projectile = Agent(agent.Faction, 8.f, 0, 0.f, 0.f, 1); projectile.Heading = Vector3(std::cos(-position.Rot.Y), 0.f, std::sin(-position.Rot.Y)); ER.CreateEntity( Position(position), projectile, Movement(Vector3::Zero,Vector3(0.f,math::TWO_PI * 5.f,0.f)), Collision(std::make_shared<geom::Sphere>(Vector3::Zero, 0.25), (uint32_t)CollisionChannel::Projectile), Model(projectileModel) ); }); agent.AttackCooldown = agent.AttackPeriod; } if (agent.MaxHealth > 0) { if (agent.Health <= 0) { m_deferredTasks.push_back([=] { ER.Remove(agent.ID); }); } else { // Apply damage if not in recovery (temporary invincibility after taking damage) if (!agent.RecoveryCooldown && !collision.Contacts.empty()) { for (auto& other : ER.GetIterator<Agent>()) { auto& otherAgent = other.Get<Agent>(); // check to see if other is a different faction and shows up in our contact list if (otherAgent.Faction != agent.Faction && collision.Contacts.count(otherAgent.ID)) { // Apply other agent's damage to our health agent.Health -= otherAgent.Damage; // Start recovery cooldown agent.RecoveryCooldown = agent.RecoveryPeriod; } } } } } else { if (!collision.Contacts.empty()) { m_deferredTasks.push_back([=] { ER.Remove(agent.ID); }); } } } } void Room::AiUpdate(double elapsed) { for (auto& playerEntity : ER.GetIterator<Player, Agent, Position>()) { auto& player = playerEntity.Get<Agent>(); auto& playerPos = playerEntity.Get<Position>(); for (auto& enemyEntity : ER.GetIterator<AI,Agent, Position>()) { auto& enemy = enemyEntity.Get<Agent>(); auto& enemyPos = enemyEntity.Get<Position>(); if (enemy.Faction != player.Faction) { enemy.Heading = playerPos.Pos - enemyPos.Pos; enemyPos.Rot.Y = -std::atan2f(enemy.Heading.Z, enemy.Heading.X); } } } } void Room::MovementUpdate(double elapsed) { for (auto& entity : ER.GetIterator<Movement, Position>()) { auto& movement = entity.Get<Movement>(); auto& position = entity.Get<Position>(); position.Pos += movement.Velocity * elapsed; position.Rot += movement.AngularVelocity * elapsed; // Wrap rotations around 2 pi position.Rot.X = std::fmodf(position.Rot.X, math::TWO_PI); position.Rot.Y = std::fmodf(position.Rot.Y, math::TWO_PI); position.Rot.Z = std::fmodf(position.Rot.Z, math::TWO_PI); } } void Room::CollisionUpdate(double elapsed) { // Clear contacts for (auto& collider : ER.GetIterator<Collision>()) { collider.Get<Collision>().Contacts.clear(); } for (auto& dynamicCollider : ER.GetIterator<Movement,Collision, Position>()) { auto& movement = dynamicCollider.Get<Movement>(); auto& dynamicCollision = dynamicCollider.Get<Collision>(); auto& dynamicPosition = dynamicCollider.Get<Position>(); auto dynamicCollisionVolume = dynamicCollision.CollisionVolume->Transform(dynamicPosition.GetTransform()); for (auto& staticCollider : ER.GetIterator<Collision, Position>()) { auto& staticCollision = staticCollider.Get<Collision>(); auto& staticPosition = staticCollider.Get<Position>(); if ( // This collision has already been handled by the other entity !dynamicCollision.Contacts.count(staticCollision.ID) // Only handle collisions between disjoint channels && !(dynamicCollision.Channel & staticCollision.Channel) // Don't collide with ourself && staticCollision.ID != dynamicCollision.ID // Be within a sane range && (staticPosition.Pos - dynamicPosition.Pos).LengthSquared() < k_collisionCullRange * k_collisionCullRange ) { auto staticCollisionVolume = staticCollision.CollisionVolume->Transform(staticPosition.GetTransform()); // Use GJK to test if an intersection exists geom::GjkIntersection intersection; if (geom::GJK(*dynamicCollisionVolume, *staticCollisionVolume, intersection)) { // Use EPA to get the contact details Collision::Contact contact; if (geom::EPA(*dynamicCollisionVolume, *staticCollisionVolume, intersection, contact)) { // Immediately correct the position in the X-Z plane dynamicPosition.Pos.X += contact.Normal.X * contact.PenetrationDepth; dynamicPosition.Pos.Z += contact.Normal.Z * contact.PenetrationDepth; // Update collision volume dynamicCollisionVolume = dynamicCollision.CollisionVolume->Transform(dynamicPosition.GetTransform()); // Register contacts on both colliders contact.Collider = staticCollision.ID; dynamicCollision.Contacts[contact.Collider] = contact; contact.Collider = dynamicCollision.ID; staticCollision.Contacts[contact.Collider] = contact; } } } } } } void Room::PlayerLocationUpdate() { for (auto& playerEntity : ER.GetIterator<Player, Collision>()) { auto& player = playerEntity.Get<Player>(); if (m_type == RoomType::Duck) { if (m_inCombat) { if (Game::GetInstance().state != GameState::InGame_BossBattle) { Game::GetInstance().state = GameState::InGame_BossBattle; Game::GetInstance().bossStart = clock(); MultimediaPlayer::SetUp("./Assets/audio/Boss_Battle_Condesa_DuckAttacks_Overlay.wav", true, true); MultimediaPlayer::GetInstance().startAudio(); } } else { if (Game::GetInstance().state != GameState::Outro) { Game::GetInstance().state = GameState::Outro; MultimediaPlayer::SetUp("./Assets/audio/Boss_Battle_Victory.wav", true, true); MultimediaPlayer::GetInstance().startAudio(); } } } } } void Room::DoorUpdate(double elapsed) { for (auto& entity : ER.GetIterator<Door, Model, Collision>()) { auto& door = entity.Get<Door>(); auto& model = entity.Get<Model>(); auto& collision = entity.Get<Collision>(); if (door.State == Door::DoorState::Locked) { for (auto& playerEntity : ER.GetIterator<Player, Collision>()) { auto& player = playerEntity.Get<Player>(); if (player.Inventory[LootItem::Key] > 0) { if (playerEntity.Get<Collision>().Contacts.count(door.ID)) { // unlock the door door.State = Door::DoorState::Open; // consume the key player.Inventory[LootItem::Key]--; break; } } } } // Update model model.ModelPtr = ModelRepository::Get("door_" + std::to_string((int)door.State)); /* Update collision channel As long as the player shares this channel, collision will not be handled */ switch (door.State) { case Door::DoorState::Closed: case Door::DoorState::Locked: collision.Channel = 0; break; case Door::DoorState::Open: collision.Channel = (uint32_t)CollisionChannel::Door; break; } } } void Room::CombatUpdate(double elapsed) { bool previousCombatState = m_inCombat; // While there are enemy agents in the room, keep the doors closed for (auto& agent : ER.GetIterator<Agent>()) { if (agent.Get<Agent>().Faction != Agent::AgentFaction::Bread) { // Close all the doors if they are open m_inCombat = true; for (auto& door : ER.GetIterator<Door>()) { if (door.Get<Door>().State == Door::DoorState::Open) door.Get<Door>().State = Door::DoorState::Closed; } return; } } // not in combat - Open all the non-locked doors m_inCombat = false; for (auto& door : ER.GetIterator<Door>()) { if (door.Get<Door>().State == Door::DoorState::Closed) door.Get<Door>().State = Door::DoorState::Open; } // Drop loot if the combat state has dropped to false if (previousCombatState && !m_inCombat) { DropLoot(); } } void Room::ItemUpdate(double elapsed) { for (auto& playerEntity : ER.GetIterator<Player, Collision>()) { auto& player = playerEntity.Get<Player>(); for (auto& entity : ER.GetIterator<Item>()) { auto& item = entity.Get<Item>(); if (playerEntity.Get<Collision>().Contacts.count(item.ID)) { // Perform the transaction player.Inventory[item.Type]++; m_deferredTasks.push_back([=] { ER.Remove(item.ID); }); } } } } void Room::SweepUpdate(double elapsed) { for (auto& entity : ER.GetIterator<Sweep, Position>()) { auto& sweep = entity.Get<Sweep>(); auto& position = entity.Get<Position>(); sweep.Progress = min(sweep.Duration, sweep.Progress + elapsed); float percent = (sweep.Progress / sweep.Duration); sweep.CurrentWaypoint = percent * (sweep.Waypoints.size() - 1); float linePercent = percent - ((float)sweep.CurrentWaypoint / (float)(sweep.Waypoints.size() - 1)); Vector3 currentWaypoint = sweep.Waypoints[sweep.CurrentWaypoint]; if (sweep.CurrentWaypoint < sweep.Waypoints.size() - 1) { Vector3 nextWaypoint = sweep.Waypoints[sweep.CurrentWaypoint + 1]; position.Pos = (nextWaypoint - currentWaypoint) * linePercent + currentWaypoint; } else { position.Pos = currentWaypoint; } } } void Room::DeferredUpdate(double elapsed) { for (auto& task : m_deferredTasks) { task(); } m_deferredTasks.clear(); } }
31.270916
112
0.659511
9916b25ce105f4344fc80f98d780b27c0deb21f3
621
cpp
C++
packages/orchestrator/third_party/slt_setting/examples/00_hello_setting.cpp
cogment/cogment
55df705fce16942d396324dd733b4c60af729738
[ "Apache-2.0" ]
4
2020-08-03T20:07:41.000Z
2020-08-03T20:11:29.000Z
packages/orchestrator/third_party/slt_setting/examples/00_hello_setting.cpp
cogment/cogment
55df705fce16942d396324dd733b4c60af729738
[ "Apache-2.0" ]
null
null
null
packages/orchestrator/third_party/slt_setting/examples/00_hello_setting.cpp
cogment/cogment
55df705fce16942d396324dd733b4c60af729738
[ "Apache-2.0" ]
2
2021-02-20T02:42:10.000Z
2022-03-23T23:47:21.000Z
#include "slt/settings.h" #include "slt/settings_context.h" #include <string> slt::Setting ip_address = slt::Setting_builder<std::string>() .with_default("localhost") .with_description("The IP address to operate on") .with_arg("ip") .with_env_variable("IP"); int main(int argc, const char* argv[]) { slt::Settings_context ctx("hello_settings", argc, argv); if (ctx.help_requested()) { return 0; } std::cout << "the value of ip_address is: " << ip_address.get() << "\n"; return 0; }
28.227273
79
0.550725
9919c30b52c598b849cfdd1c15db09b41bffaef6
1,317
cpp
C++
src/Misc/PKCS1.cpp
httese/OpenPGP
7dce08dc8b72eeb0dcbf3df56d64606a6b957938
[ "MIT" ]
99
2015-01-06T01:53:26.000Z
2022-01-31T18:18:27.000Z
src/Misc/PKCS1.cpp
httese/OpenPGP
7dce08dc8b72eeb0dcbf3df56d64606a6b957938
[ "MIT" ]
27
2015-03-09T05:46:53.000Z
2020-05-06T02:52:18.000Z
src/Misc/PKCS1.cpp
httese/OpenPGP
7dce08dc8b72eeb0dcbf3df56d64606a6b957938
[ "MIT" ]
42
2015-03-18T03:44:43.000Z
2022-03-31T21:34:06.000Z
#include "Misc/PKCS1.h" #include "Misc/pgptime.h" #include "RNG/RNGs.h" #include "common/includes.h" namespace OpenPGP { std::string EME_PKCS1v1_5_ENCODE(const std::string & m, const unsigned int & k) { if (m.size() > (k - 11)) { // "Error: EME-PKCS1 Message too long.\n"; return ""; } std::string EM = zero + "\x02"; while (EM.size() < k - m.size() - 1) { if (const unsigned char c = RNG::RNG().rand_bytes(1)[0]) { // non-zero octets only EM += std::string(1, c); } } return EM + zero + m; } std::string EME_PKCS1v1_5_DECODE(const std::string & m) { if (m.size() > 11) { if (!m[0]) { if (m[1] == '\x02') { std::string::size_type x = 2; while ((x < m.size()) && m[x]) { x++; } return m.substr(x + 1, m.size() - x - 1); } } } // "Error: EME-PKCS1 Decryption Error.\n"; return ""; } std::string EMSA_PKCS1_v1_5(const uint8_t & hash, const std::string & hashed_data, const unsigned int & keylength) { return zero + "\x01" + std::string(keylength - (Hash::ASN1_DER.at(hash).size() >> 1) - 3 - (Hash::LENGTH.at(hash) >> 3), (char) 0xffU) + zero + unhexlify(Hash::ASN1_DER.at(hash)) + hashed_data; } }
28.021277
197
0.515566
991a1d83e9ae9220fd6908a25dc12d3db0a6c07f
1,009
cpp
C++
Warcraft Heroes Beyond Time/Warcraft Heroes Beyond Time/EnergyItem.cpp
SoftCactusTeam/Warcraft_Adventures
7b44294d44094ce690abe90348dd87f42cdae07d
[ "MIT" ]
9
2018-03-19T21:36:53.000Z
2020-02-28T07:05:17.000Z
Warcraft Heroes Beyond Time/Warcraft Heroes Beyond Time/EnergyItem.cpp
SoftCactusTeam/Warcraft-Heroes-Beyond-Time
7b44294d44094ce690abe90348dd87f42cdae07d
[ "MIT" ]
87
2018-03-04T15:04:57.000Z
2018-06-07T08:42:55.000Z
Warcraft Heroes Beyond Time/Warcraft Heroes Beyond Time/EnergyItem.cpp
SoftCactusTeam/Warcraft_Adventures
7b44294d44094ce690abe90348dd87f42cdae07d
[ "MIT" ]
2
2018-02-14T08:13:05.000Z
2018-02-16T19:17:57.000Z
#include "EnergyItem.h" #include "Scene.h" #include "Thrall.h" #include "Application.h" #include "ModuleRender.h" EnergyItem::EnergyItem() { } EnergyItem::~EnergyItem() { } bool EnergyItem::Start() { return true; } bool EnergyItem::Act(ModuleItems::ItemEvent event, float dt) { switch (event) { case ModuleItems::ItemEvent::PLAYER_HITTED: App->scene->player->IncreaseEnergy(ModuleItems::energywhenHitted); break; } return true; } bool EnergyItem::Draw() { return true; } bool EnergyItem::printYourStuff(iPoint pos) { //The GUI uses this method, fill it in all the items. iPoint iconPos = { 171 / 2 - 31 / 2 ,50 }; App->render->Blit(App->items->getItemsTexture(), pos.x + iconPos.x, pos.y + iconPos.y, &SDL_Rect(ENERGY_ITEM), 1, 0); printMyString((char*)Title.data(), { 171 / 2 + pos.x, 100 + pos.y }, true); printMyString((char*)softDescription.data(), { 171 / 2 + pos.x, 150 + pos.y }); return true; } const std::string EnergyItem::myNameIs() const { return std::string(Title); }
19.037736
118
0.683845
991e8d7497ac0af4900c06138616500c5a5df0b2
297
hpp
C++
lib/systems/simulator/UdpMessageHandlerInterface.hpp
aep/qtsl
8710cbbf2405ad9147c399d1afea906a80b1fbac
[ "MIT" ]
null
null
null
lib/systems/simulator/UdpMessageHandlerInterface.hpp
aep/qtsl
8710cbbf2405ad9147c399d1afea906a80b1fbac
[ "MIT" ]
null
null
null
lib/systems/simulator/UdpMessageHandlerInterface.hpp
aep/qtsl
8710cbbf2405ad9147c399d1afea906a80b1fbac
[ "MIT" ]
null
null
null
#ifndef QTSL_UdpMessageHandlerInterface_H #define QTSL_UdpMessageHandlerInterface_H namespace qtsl{ namespace udp{ struct UdpMessage; }; class UdpMessageHandlerInterface{ public: virtual void udpMessageHandler(qtsl::udp::UdpMessage * message)=0; }; }; #endif
19.8
74
0.720539
9922a99b0238dfc09a07e514936e3b29593b130c
28,042
cpp
C++
src/hi/hicalendar.cpp
SC-One/HiCalendar
dfda3134dfbde0c7845c4c3e2d41635721511678
[ "MIT" ]
30
2020-10-30T13:01:10.000Z
2022-02-04T04:54:11.000Z
src/hi/hicalendar.cpp
Qt-QML/HiCalendar
a9e1f2fcd111f2d5c8eb1af705acef829584b102
[ "MIT" ]
null
null
null
src/hi/hicalendar.cpp
Qt-QML/HiCalendar
a9e1f2fcd111f2d5c8eb1af705acef829584b102
[ "MIT" ]
6
2020-10-31T09:38:13.000Z
2022-02-04T07:20:21.000Z
#include "include/hi/hicalendar.hpp" ////::::::::::::::::::::::::::::::::::::::::::: YearMonthDay YearMonthDay::YearMonthDay(int _Year, int _Month, int _Day, QObject *parent): QObject(parent),year(_Year),month(_Month),day(_Day) {} YearMonthDay::YearMonthDay(const YearMonthDay &other): QObject(other.parent()),year(other.year),month(other.month),day(other.day) {} YearMonthDay& YearMonthDay::operator=(const YearMonthDay &other) { this->setParent(other.parent()); this->year = other.year; this->month = other.month; this->day = other.day; return *this; } bool YearMonthDay::operator !=(const YearMonthDay &other) { return (this->parent() != other.parent() || this->year != other.year || this->month != other.month || this->day != other.day); } bool YearMonthDay::operator ==(const YearMonthDay &other) { return !(*this != other); } YearMonthDay::~YearMonthDay() {} //////::::::::::::::::::::::::::::::::::::::::::: HiCalendarSelectedDayData HiCalendarDayModel::HiCalendarDayModel(QDate _Date, int _DayOfCustomMonth, int _DayOfCustomWeek, int _DayInCustomWeekOfMonth, bool _IsHoliday , QObject *parent): QObject(parent), _date(_Date), _is_holiday(_IsHoliday) { _day_of_custom_month = 1; _day_of_custom_week = 1; _day_in_custom_week_of_month = 1; if (_DayOfCustomMonth > 0 && _DayOfCustomMonth <32) { _day_of_custom_month = _DayOfCustomMonth; } if(_DayOfCustomWeek > 0 && _DayOfCustomWeek < 8) { _day_of_custom_week = _DayOfCustomWeek; } if(_DayInCustomWeekOfMonth > 0 && _DayInCustomWeekOfMonth < 7) { _day_in_custom_week_of_month = _DayInCustomWeekOfMonth; } emit dayModifiedSi(); } HiCalendarDayModel::HiCalendarDayModel(const HiCalendarDayModel& item): QObject(item.parent()), _date(item.getGeorgianDate()), _day_of_custom_month(item.getDayOfCustomMonth()), _day_of_custom_week(item.getDayOfCustomWeek()), _day_in_custom_week_of_month(item.getDayInCustomWeekNOfMonth()), _is_holiday(item.isHoliday()) { emit dayModifiedSi(); } HiCalendarDayModel& HiCalendarDayModel::operator=(const HiCalendarDayModel &other) { this->_day_of_custom_month = other.getDayOfCustomMonth(); this->_day_of_custom_week = other.getDayOfCustomWeek(); this->_day_in_custom_week_of_month = other.getDayInCustomWeekNOfMonth(); this->_date = other.getGeorgianDate(); emit dayModifiedSi(); return *this; } bool HiCalendarDayModel::operator!=(const HiCalendarDayModel &other) const { return (_date != other.getGeorgianDate() || _day_of_custom_month != other.getDayOfCustomMonth() || _day_of_custom_week != other.getDayOfCustomWeek() || _day_in_custom_week_of_month != other.getDayInCustomWeekNOfMonth()); } bool HiCalendarDayModel::operator==(const HiCalendarDayModel &other) const { return !(*this != other); } YearMonthDay HiCalendarDayModel::getJalaliDateAsYearMonthDay() const { QCalendar calendar(QCalendar::System::Jalali); QCalendar::YearMonthDay jalali_date = calendar.partsFromDate(_date); YearMonthDay output{jalali_date.year,jalali_date.month,jalali_date.day,this->parent()}; return output; } int HiCalendarDayModel::getJalaliYear() const { QCalendar calendar(QCalendar::System::Jalali); QCalendar::YearMonthDay jalali_date = calendar.partsFromDate(_date); return jalali_date.year; } int HiCalendarDayModel::getJalaliMonth() const { QCalendar calendar(QCalendar::System::Jalali); QCalendar::YearMonthDay jalali_date = calendar.partsFromDate(_date); return jalali_date.month; } int HiCalendarDayModel::getJalaloDay() const { QCalendar calendar(QCalendar::System::Jalali); QCalendar::YearMonthDay jalali_date = calendar.partsFromDate(_date); return jalali_date.day; } YearMonthDay HiCalendarDayModel::getGeorgianDateAsYearMonthDay() const { YearMonthDay output{_date.year(),_date.month(),_date.day(),this->parent()}; return output; } int HiCalendarDayModel::getGeorgianYear() const { return _date.year(); } int HiCalendarDayModel::getGeorgianMonth() const { return _date.month(); } int HiCalendarDayModel::getGeorgianDay() const { return _date.day(); } YearMonthDay HiCalendarDayModel::getIslamicDateAsYearMonthDay() const { QCalendar calendar(QCalendar::System::IslamicCivil); QCalendar::YearMonthDay islamic_date = calendar.partsFromDate(_date); YearMonthDay output{islamic_date.year,islamic_date.month,islamic_date.day,this->parent()}; return output; } int HiCalendarDayModel::getIslamicYear() const { QCalendar calendar(QCalendar::System::IslamicCivil); QCalendar::YearMonthDay islamic_date = calendar.partsFromDate(_date); return islamic_date.year; } int HiCalendarDayModel::getIslamicMonth() const { QCalendar calendar(QCalendar::System::IslamicCivil); QCalendar::YearMonthDay islamic_date = calendar.partsFromDate(_date); return islamic_date.month; } int HiCalendarDayModel::getIslamicDay() const { QCalendar calendar(QCalendar::System::IslamicCivil); QCalendar::YearMonthDay islamic_date = calendar.partsFromDate(_date); return islamic_date.day; } bool HiCalendarDayModel::isDayOver() const { return (QDate::currentDate() > _date); } bool HiCalendarDayModel::isToday() const { return (_date == QDate::currentDate()); } bool HiCalendarDayModel::isHoliday() const { return _is_holiday; } int HiCalendarDayModel::getDayOfCustomMonth() const { return _day_of_custom_month; } int HiCalendarDayModel::getDayOfCustomWeek() const { return _day_of_custom_week; } int HiCalendarDayModel::getDayInCustomWeekNOfMonth() const { return _day_in_custom_week_of_month; } QDate HiCalendarDayModel::getGeorgianDate() const { return _date; } QString HiCalendarDayModel::toString() const { QString output = "{\"jalali_year\":"+ QString::number(getJalaliYear()) + ",\"jalali_month\":"+ QString::number(getJalaliMonth()) + ",\"jalali_day\":"+ QString::number(getJalaloDay()) + ",\"georgian_year\":"+ QString::number(getGeorgianYear()) + ",\"georgian_month\":"+ QString::number(getGeorgianMonth()) + ",\"georgian_day\":"+ QString::number(getGeorgianDay()) + ",\"islamic_year\":"+ QString::number(getIslamicYear()) + ",\"islamic_month\":"+ QString::number(getIslamicMonth()) + ",\"islamic_day\":"+ QString::number(getIslamicDay()) + ",\"is_day_over\":"+ (isDayOver()? "true" : "false") + ",\"is_today\":"+ (isToday()? "true" : "false") + ",\"day_of_custom_month\":"+ QString::number(getDayOfCustomMonth()) + ",\"day_of_custom_week\":"+ QString::number(getDayOfCustomWeek()) + ",\"day_in_custom_week_n_of_month\":"+ QString::number(getDayInCustomWeekNOfMonth())+",\"is_holiday_in_calendar_selected_type\":"+ (isHoliday()?"true":"false") + "}"; return output; } HiCalendarDayModel::~HiCalendarDayModel() {} //////////::::::::::::::::::::::::::::::::::::: Calendar Controller HiCalendarController::HiCalendarController(HiCalendarController::CalendarTypes _CalendarType, QObject *_Parent): QObject(_Parent), _calendar_type(_CalendarType), _current_selected_day(nullptr) { emit calendarTypeChanged(_calendar_type); } HiCalendarController::HiCalendarController(const HiCalendarController &_Input): QObject(_Input.parent()), _days_of_current_month_list(_Input.getDaysOfCurrentMonth()), _calendar_type(_Input.getCalendarType()), _current_selected_day(nullptr) { emit calendarTypeChanged(_calendar_type); } HiCalendarController::CalendarTypes HiCalendarController::getCalendarType() const { return _calendar_type; } QString HiCalendarController::currentMonthHeaderInfo() const { return _current_month_header_info; } const QVariantList HiCalendarController::getDaysOfCurrentMonth() const { return _days_of_current_month_list; } HiCalendarDayModel* HiCalendarController::getCurrentSelectedDay() const { return _current_selected_day; } void HiCalendarController::showCurrentSelectedYearMonthDay(QDate _SelectedDate) { QStringList jalali_months = {"فروردین" , "اردیبهشت", "خرداد", "تیر", "اَمرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"}; QStringList georgian_months = {"January","February","March","April","May","June","July","August","September","October","November","December"}; QStringList islamic_months = {"محرم" , "صفر", "ربیع‌الاول", "ربیع‌الثانی", "جمادی‌الاول", "جمادی‌الثانی", "رجب", "شعبان", "رمضان", "شوال", "ذیقعده", "ذیحجه"}; int day_of_week = 1; int day_is_in_week_N_of_month = 0; int year = 1; int month = 1; int day = 1; if(_SelectedDate == QDate(1,1,1)) { _SelectedDate = QDate::currentDate(); } QDate newDate = _SelectedDate; if(_current_selected_day != nullptr)//is not first { clearCurrentDays(); _current_selected_day = nullptr; } if (getCalendarType() == HiCalendarController::CalendarTypes::Jalali) { QCalendar jalali_calendar(QCalendar::System::Jalali); QCalendar islamic_calendar(QCalendar::System::IslamicCivil); int first_georgian_month = 0; int second_georgian_month = 0; int first_islamic_month = 0; int second_islamic_month = 0; int first_georgian_year = 0; int second_georgian_year = 0; int first_islamic_year = 0; int second_islamic_year = 0; QCalendar::YearMonthDay jalali_date = jalali_calendar.partsFromDate(_SelectedDate); year = jalali_date.year;//current selected year as jalali month = jalali_date.month;//current selected month as jalali day = jalali_date.day;//current selected day as jalali if (day > 1) { newDate = _SelectedDate.addDays(-(day-1));//first day of selected month as georgian } QCalendar::YearMonthDay islamic_date = islamic_calendar.partsFromDate(newDate); first_georgian_month = newDate.month(); first_georgian_year = newDate.year(); first_islamic_month = islamic_date.month; first_islamic_year = islamic_date.year; int day_counter = 1; while ( jalali_calendar.partsFromDate(newDate).month == month) { bool is_holiday = false; if ( newDate.dayOfWeek() < 6) { day_of_week = newDate.dayOfWeek()+2; } else { day_of_week = newDate.dayOfWeek() % 6 +1; } if(day_of_week == 1 || day_is_in_week_N_of_month == 0) { day_is_in_week_N_of_month++; } islamic_date = islamic_calendar.partsFromDate(newDate); if(islamic_date.month != first_islamic_month) { second_islamic_month = islamic_date.month; } if(islamic_date.year != first_islamic_year) { second_islamic_year = islamic_date.year; } if(newDate.month() != first_georgian_month) { second_georgian_month = newDate.month(); } if(newDate.year() != first_georgian_year) { second_georgian_year = newDate.year(); } //jalali holidays if (newDate.dayOfWeek() == 5) is_holiday = true; if (month == 1) { if (day_counter >= 1 && day_counter < 5) is_holiday = true; if (day_counter == 12 || day_counter == 13) is_holiday = true; } if (month == 3) { if (day_counter == 14 || day_counter == 15) is_holiday = true; } if (month == 11 && day_counter == 22) is_holiday = true; if (month == 12 && (day_counter == 29 || day_counter == 30)) is_holiday = true; //islamic holidays if (islamic_date.month == 1) { if (islamic_date.day == 9 || islamic_date.day == 10) is_holiday = true;//tasua-ashura } if (islamic_date.month == 2) { qDebug()<<"=============2"; if (islamic_date.day == 20 || islamic_date.day == 28 || islamic_date.day == 30) is_holiday = true; if (islamic_date.day == 29) { qDebug()<<newDate.toString(); QDate tmpDate = newDate.addDays(1); qDebug()<<newDate<<" ====> ttt " << tmpDate.toString(); QCalendar::YearMonthDay islamic_date_tmp = islamic_calendar.partsFromDate(tmpDate); if (islamic_date_tmp.month != 2) { is_holiday = true; } } } if (islamic_date.month == 3) { if (islamic_date.day == 8 || islamic_date.day == 17) is_holiday = true; } if (islamic_date.month == 6) { if (islamic_date.day == 3 ) is_holiday = true; } if (islamic_date.month == 7) { if (islamic_date.day == 13 || islamic_date.day == 27) is_holiday = true; } if (islamic_date.month == 8) { if (islamic_date.day == 15) is_holiday = true; } if (islamic_date.month == 9) { if (islamic_date.day == 19 || islamic_date.day == 21) is_holiday = true; } if (islamic_date.month == 10) { if (islamic_date.day == 1 || islamic_date.day == 2 || islamic_date.day == 25) is_holiday = true; } if (islamic_date.month == 12) { if (islamic_date.day == 10 || islamic_date.day == 18) is_holiday = true; } HiCalendarDayModel* newDay = new HiCalendarDayModel(newDate, day_counter, day_of_week, day_is_in_week_N_of_month,is_holiday ,this); this->addDayItem(newDay); if(newDate == _SelectedDate) { _current_selected_day = newDay; } newDate = newDate.addDays(1); day_counter++; } _current_month_header_info = jalali_months[month-1] +" "+ QString::number(year) + "\n"; if(second_georgian_year == 0) //same georgian year { _current_month_header_info += georgian_months[first_georgian_month-1] + " - " + georgian_months[second_georgian_month-1] + " " + QString::number(first_georgian_year)+"\n"; } else // different georgian years { _current_month_header_info += georgian_months[first_georgian_month-1] + " " + QString::number(first_georgian_year); _current_month_header_info += " - " + georgian_months[second_georgian_month-1] + " " + QString::number(second_georgian_year)+"\n"; } if(second_islamic_year == 0) //same islamic year { _current_month_header_info += islamic_months[first_islamic_month-1] + " - " + islamic_months[second_islamic_month-1] + " " + QString::number(first_islamic_year); } else // different islamic years { _current_month_header_info += islamic_months[first_islamic_month-1] + " " + QString::number(first_islamic_year); _current_month_header_info += " - " + islamic_months[second_islamic_month-1] + " " + QString::number(second_islamic_year); } } else { year = _SelectedDate.year(); month = _SelectedDate.month(); day = _SelectedDate.day(); QDate newDate(year,month,1); int days_of_week_count[8] = {0,0,0,0,0,0,0,0}; while (newDate.month() == month) { bool is_holiday = false; if(getCalendarType() == HiCalendarController::CalendarTypes::EuroGeorgian) { day_of_week = newDate.dayOfWeek(); } else if (getCalendarType() == HiCalendarController::CalendarTypes::UsGeorgian) { day_of_week = (newDate.dayOfWeek() % 7) + 1; } if(day_of_week == 1 || day_is_in_week_N_of_month == 0) { day_is_in_week_N_of_month++; } //georgian holidays days_of_week_count[newDate.dayOfWeek()]++; if (newDate.dayOfWeek() == 7) is_holiday = true; if (newDate.month() == 1) { if (newDate.day() == 1) is_holiday = true; if (newDate.dayOfWeek() == 1 && days_of_week_count[newDate.dayOfWeek()] == 3) is_holiday = true; } if (newDate.month() == 2) { if (newDate.day() == 12) is_holiday = true; if (newDate.dayOfWeek() == 1 && days_of_week_count[newDate.dayOfWeek()] == 3) is_holiday = true; } if (newDate.month() == 5) { if (newDate.day() == 5) is_holiday = true; if (newDate.dayOfWeek() == 1 && (31 - newDate.day() <7)) is_holiday = true; } if (newDate.month() == 7) { if (newDate.day() == 4) is_holiday = true; } if (newDate.month() == 9) { if (newDate.day() == 4) is_holiday = true; if (newDate.dayOfWeek() == 1 && days_of_week_count[newDate.dayOfWeek()] == 1) is_holiday = true; } if (newDate.month() == 11) { if (newDate.day() == 11) is_holiday = true; if (newDate.dayOfWeek() == 3 && (30 - newDate.day() <7)) is_holiday = true; } if (newDate.month() == 12) { if (newDate.day() == 25) is_holiday = true; } HiCalendarDayModel* newDay = new HiCalendarDayModel(newDate, newDate.day(), day_of_week, day_is_in_week_N_of_month ,is_holiday,this); this->addDayItem(newDay); if(newDate == _SelectedDate) { _current_selected_day = newDay; } newDate = newDate.addDays(1); } _current_month_header_info = georgian_months[month-1] +" - "+ QString::number(year); } if (_current_selected_day != nullptr) { emit daySelectedSi(_current_selected_day); } emit refreshCalendarSi(); } void HiCalendarController::nextDay() { if (_current_selected_day != nullptr && _days_of_current_month_list.length() >0) { this->showCurrentSelectedYearMonthDay(_current_selected_day->getGeorgianDate().addDays(1)); } } void HiCalendarController::prevDay() { if (_current_selected_day != nullptr && _days_of_current_month_list.length() >0) { this->showCurrentSelectedYearMonthDay(_current_selected_day->getGeorgianDate().addDays(-1)); } } void HiCalendarController::nextMonth() { if (_current_selected_day != nullptr && _days_of_current_month_list.length() >0) { if (getCalendarType() == HiCalendarController::CalendarTypes::Jalali) { QCalendar jalali_calendar(QCalendar::System::Jalali); QDate newDate = _current_selected_day->getGeorgianDate(); QCalendar::YearMonthDay jalali_date = jalali_calendar.partsFromDate(newDate); int year = jalali_date.year; int month = jalali_date.month + 1; if (month > 12) { month = 1; year++; } newDate = jalali_calendar.dateFromParts(year,month,1); this->showCurrentSelectedYearMonthDay(newDate); } else { QDate newDate = _current_selected_day->getGeorgianDate().addMonths(1); newDate.setDate(newDate.year(),newDate.month(),1); this->showCurrentSelectedYearMonthDay(newDate); } } } void HiCalendarController::prevMonth() { if (_current_selected_day != nullptr && _days_of_current_month_list.length() >0) { if (getCalendarType() == HiCalendarController::CalendarTypes::Jalali) { QCalendar jalali_calendar(QCalendar::System::Jalali); QDate newDate = _current_selected_day->getGeorgianDate(); QCalendar::YearMonthDay jalali_date = jalali_calendar.partsFromDate(newDate); int year = jalali_date.year; int month = jalali_date.month - 1; if (month < 1) { month = 12; year--; } newDate = jalali_calendar.dateFromParts(year,month,1); this->showCurrentSelectedYearMonthDay(newDate); } else { QDate newDate = _current_selected_day->getGeorgianDate().addMonths(-1); newDate.setDate(newDate.year(),newDate.month(),1); this->showCurrentSelectedYearMonthDay(newDate); } } } void HiCalendarController::nextYear() { if (_current_selected_day != nullptr && _days_of_current_month_list.length() >0) { if (getCalendarType() == HiCalendarController::CalendarTypes::Jalali) { QCalendar jalali_calendar(QCalendar::System::Jalali); QDate newDate = _current_selected_day->getGeorgianDate(); QCalendar::YearMonthDay jalali_date = jalali_calendar.partsFromDate(newDate); int year = jalali_date.year + 1; int month = jalali_date.month; newDate = jalali_calendar.dateFromParts(year,month,1); this->showCurrentSelectedYearMonthDay(newDate); } else { QDate newDate = _current_selected_day->getGeorgianDate().addYears(1); newDate.setDate(newDate.year(),newDate.month(),1); this->showCurrentSelectedYearMonthDay(newDate); } } } void HiCalendarController::prevYear() { if (_current_selected_day != nullptr && _days_of_current_month_list.length() >0) { if (getCalendarType() == HiCalendarController::CalendarTypes::Jalali) { QCalendar jalali_calendar(QCalendar::System::Jalali); QDate newDate = _current_selected_day->getGeorgianDate(); QCalendar::YearMonthDay jalali_date = jalali_calendar.partsFromDate(newDate); int year = jalali_date.year - 1; int month = jalali_date.month; newDate = jalali_calendar.dateFromParts(year,month,1); this->showCurrentSelectedYearMonthDay(newDate); } else { QDate newDate = _current_selected_day->getGeorgianDate().addYears(-1); newDate.setDate(newDate.year(),newDate.month(),1); this->showCurrentSelectedYearMonthDay(newDate); } } } void HiCalendarController::addDayItem(HiCalendarDayModel *_Day) { if (!_days_of_current_month_list.contains(QVariant::fromValue(_Day))) { _days_of_current_month_list.append(QVariant::fromValue(_Day)); } } void HiCalendarController::selectDayByClick(HiCalendarDayModel *_Day) { QDate selected_date = _Day->getGeorgianDate(); if (_days_of_current_month_list.length() >0) { this->showCurrentSelectedYearMonthDay(selected_date); for (QVariantList::iterator j = _days_of_current_month_list.begin(); j != _days_of_current_month_list.end(); j++) { QObject* object = qvariant_cast<QObject*>(*j); HiCalendarDayModel* day = qobject_cast<HiCalendarDayModel*>(object); if (day->getGeorgianDate() == selected_date) { _current_selected_day = day; emit daySelectedSi(_current_selected_day); break; } } } } void HiCalendarController::clearCurrentDays() { for (QVariantList::iterator j = _days_of_current_month_list.begin(); j != _days_of_current_month_list.end(); j++) { QObject* object = qvariant_cast<QObject*>(*j); HiCalendarDayModel* day = qobject_cast<HiCalendarDayModel*>(object); day->deleteLater(); } _days_of_current_month_list.clear(); emit refreshCalendarSi(); } HiCalendarController &HiCalendarController::operator=(const HiCalendarController &other) { this->_days_of_current_month_list = other.getDaysOfCurrentMonth(); this->_calendar_type = other.getCalendarType(); this->_current_selected_day = other.getCurrentSelectedDay(); this->_current_month_header_info = other.currentMonthHeaderInfo(); return *this; } bool HiCalendarController::operator!=(const HiCalendarController &other) const { return (this->_days_of_current_month_list != other.getDaysOfCurrentMonth() || this->_calendar_type != other.getCalendarType() || this->_current_selected_day != other.getCurrentSelectedDay() || this->_current_month_header_info != other.currentMonthHeaderInfo()); } bool HiCalendarController::operator==(const HiCalendarController &other) const { return !(*this != other); } HiCalendarController::~HiCalendarController() { this->clearCurrentDays(); } //////////:::::::::::::::::::::::::::::::::::::::::::::: Hi Calendar Context HiCalendarContext::HiCalendarContext(QObject *parent) : QObject(parent),_calendar (nullptr) {} void HiCalendarContext::renewCalendar(QString calendar_type) { calendar_type = calendar_type.toLower(); if (calendar_type == "us" || calendar_type == "us_calendar" || calendar_type == "us_georgian_calendar") { this->renewCalendar(HiCalendarController::CalendarTypes::UsGeorgian); } else if(calendar_type == "euro" || calendar_type == "euro_calendar" || calendar_type == "euro_georgian_calendar") { this->renewCalendar(HiCalendarController::CalendarTypes::EuroGeorgian); } else if (calendar_type == "jalali" || calendar_type == "jalali_calendar") { this->renewCalendar(HiCalendarController::CalendarTypes::Jalali); } } void HiCalendarContext::renewCalendar(HiCalendarController::CalendarTypes calendar_type) { bool changed = false; if (calendar_type == HiCalendarController::CalendarTypes::UsGeorgian) { changed = true; if (_calendar != nullptr) _calendar->deleteLater(); _calendar = new HiCalendarController(HiCalendarController::CalendarTypes::UsGeorgian , this); } else if(calendar_type == HiCalendarController::CalendarTypes::EuroGeorgian) { changed = true; if (_calendar != nullptr) _calendar->deleteLater(); _calendar = new HiCalendarController(HiCalendarController::CalendarTypes::EuroGeorgian, this); } else if (calendar_type == HiCalendarController::CalendarTypes::Jalali) { changed = true; if (_calendar != nullptr) _calendar->deleteLater(); _calendar = new HiCalendarController(HiCalendarController::CalendarTypes::Jalali, this); } if (changed == true && _calendar != nullptr) { _calendar->showCurrentSelectedYearMonthDay(); emit calendarChangedSi(); } } HiCalendarController* HiCalendarContext::getCalendar() { return _calendar; } HiCalendarContext::~HiCalendarContext() { if (_calendar != nullptr) { _calendar->deleteLater(); } }
37.741588
954
0.61308
9927a78165656864eb420193b3dc3673c4a5bd6a
1,686
cpp
C++
source/raytracer/implementation/geometry/object/triangle.cpp
danielil/RayTracer
16682be15d31e9201acd66b4a12ae78c69fbc671
[ "MIT" ]
null
null
null
source/raytracer/implementation/geometry/object/triangle.cpp
danielil/RayTracer
16682be15d31e9201acd66b4a12ae78c69fbc671
[ "MIT" ]
null
null
null
source/raytracer/implementation/geometry/object/triangle.cpp
danielil/RayTracer
16682be15d31e9201acd66b4a12ae78c69fbc671
[ "MIT" ]
null
null
null
/** * The MIT License (MIT) * Copyright (c) 2017-2017 Daniel Sebastian Iliescu, http://dansil.net * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "raytracer/geometry/object/triangle.hpp" namespace raytracer::geometry::object { std::optional< point > triangle::intersect( const ray& ray ) const { // TODO return {}; } spatial_vector triangle::normal( const point& intersection_point ) const { // TODO auto normal = intersection_point - center; normalize( std::begin( normal ), std::end( normal ) ); return normal; } const image::channels& triangle::get_channels() const { // TODO return this->channels; } }
32.423077
81
0.734282
992d5d130d63c83e1a52fe236d3ece50664a82e1
2,009
hpp
C++
include/scigl_render/scene/cv_camera.hpp
Tuebel/scigl_render
ec790d54ca4a14546348a5dd2f799d5abcc4bd36
[ "MIT" ]
null
null
null
include/scigl_render/scene/cv_camera.hpp
Tuebel/scigl_render
ec790d54ca4a14546348a5dd2f799d5abcc4bd36
[ "MIT" ]
null
null
null
include/scigl_render/scene/cv_camera.hpp
Tuebel/scigl_render
ec790d54ca4a14546348a5dd2f799d5abcc4bd36
[ "MIT" ]
null
null
null
#pragma once #include <gl3w/GL/gl3w.h> #include <scigl_render/shader/shader.hpp> #include <scigl_render/scene/camera_intrinsics.hpp> #include <scigl_render/scene/pose.hpp> #include <vector> namespace scigl_render { /*! A camera has a position in the world (extrinsics) and projection (intrinsic). The extrinsics and intrinsics are calculated using the OpenCV camera model: - x-axis points right - y-axis points down - z-axis points into the image plane So use the OpenCV / ROS frame convention to set the extrinsic pose. */ class CvCamera { public: /*! Current pose of the camera in cartesian coordinates according the ROS camera frame convention (see Header defintion: http://docs.ros.org/melodic/api/sensor_msgs/html/msg/CameraInfo.html) */ QuaternionPose pose; /*! Default constructor. Don't forget to set the intrinsics! */ CvCamera(); /*! Constructor with intrinsics */ CvCamera(CameraIntrinsics intrinsics); /*! The view matrix results by moving the entire scene in the opposite direction of the camera transformation (passive transformation of the camera). Converts the OpenCV/ROS extrinsic pose to the OpenGL pose (negate y & z axes). */ glm::mat4 get_view_matrix() const; /*! The projection matrix based on the intrinsics configured on construction. */ glm::mat4 get_projection_matrix() const; /*! Sets the view and projection matrix in the shader, given the current values. The variable names must be: "projection_matrix" and "view_matrix" */ void set_in_shader(const Shader &shader) const; CameraIntrinsics get_intrinsics() const; void set_intrinsics(CameraIntrinsics intrinsics); private: glm::mat4 projection_matrix; CameraIntrinsics intrinsics; /*! Get the projection matrix for the given camera intrinsics. \return a projection matrix calculated that transforms from view to clipping space */ static glm::mat4 calc_projection_matrix(const CameraIntrinsics &intrinsics); }; } // namespace scigl_render
28.7
79
0.752613
99322fd9da6141454cccef5308d5e23cc4ae3042
1,792
cpp
C++
test/query_builder_tests.cpp
Malibushko/yatgbotlib
a5109c36c9387aef0e6d15e303d2f3753eef9aac
[ "MIT" ]
3
2020-04-05T23:51:09.000Z
2020-08-14T07:24:45.000Z
test/query_builder_tests.cpp
Malibushko/yatgbotlib
a5109c36c9387aef0e6d15e303d2f3753eef9aac
[ "MIT" ]
1
2020-07-24T19:46:28.000Z
2020-07-31T14:49:28.000Z
test/query_builder_tests.cpp
Malibushko/yatgbotlib
a5109c36c9387aef0e6d15e303d2f3753eef9aac
[ "MIT" ]
null
null
null
#include <gtest/gtest.h> #include "telegram_bot.h" using namespace telegram; TEST(QueryBuilder,builder_builtin) { QueryBuilder builder; int b = 5; int c = 6; bool d = false; builder << make_named_pair(b) << make_named_pair(c) << make_named_pair(d); std::string json = builder.getQuery(); std::string expected = "{\"b\":5,\"c\":6,\"d\":false}"; EXPECT_EQ(expected,json); } TEST(QueryBuilder,builder_variant) { QueryBuilder builder; using variant_type = std::variant<std::string,int,bool>; variant_type var1 = false; variant_type var2 = std::string("test"); variant_type var3 = 19; builder << make_named_pair(var1) << make_named_pair(var2) << make_named_pair(var3); std::string json = builder.getQuery(); std::string expected = "{\"var1\":false,\"var2\":\"test\",\"var3\":19}"; EXPECT_EQ(expected,json); } TEST(QueryBuilder,builder_array) { QueryBuilder builder; std::vector<int> vec{1,2,3,4}; builder << make_named_pair(vec); std::string json = builder.getQuery(); std::string expected = "{\"vec\":[1,2,3,4]}"; EXPECT_EQ(expected,json); } struct MetaStruct { declare_struct declare_field(int,i); }; TEST(QueryBuilder,builder_array_complex) { QueryBuilder builder; std::vector<MetaStruct> vec{{1},{2},{3}}; builder << make_named_pair(vec); std::string json = builder.getQuery(); std::string expected = "{\"vec\":[{\"i\":1},{\"i\":2},{\"i\":3}]}"; EXPECT_EQ(expected,json); } TEST(QueryBuilder,builder_empty_document) { QueryBuilder builder; std::string json = builder.getQuery(); std::string expected = "null"; EXPECT_EQ(expected,json); } int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
28.903226
87
0.650112
9933976a01123be433ebac6aa2221ede3a33c9bd
25,960
cc
C++
dist/cpp/proto/services/request/topicSubscription.pb.cc
ate362/ubii-msg-formats
f96058dc1091886c47761fbba1a3033bcf180b4c
[ "BSD-3-Clause" ]
2
2021-01-29T12:49:01.000Z
2021-03-06T13:35:49.000Z
dist/cpp/proto/services/request/topicSubscription.pb.cc
ate362/ubii-msg-formats
f96058dc1091886c47761fbba1a3033bcf180b4c
[ "BSD-3-Clause" ]
null
null
null
dist/cpp/proto/services/request/topicSubscription.pb.cc
ate362/ubii-msg-formats
f96058dc1091886c47761fbba1a3033bcf180b4c
[ "BSD-3-Clause" ]
2
2021-05-14T14:06:33.000Z
2022-02-21T21:25:35.000Z
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: proto/services/request/topicSubscription.proto #include "proto/services/request/topicSubscription.pb.h" #include <algorithm> #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/port.h> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/wire_format_lite_inl.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/generated_message_reflection.h> #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> // This is a temporary google only hack #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS #include "third_party/protobuf/version.h" #endif // @@protoc_insertion_point(includes) namespace ubii { namespace services { namespace request { class TopicSubscriptionDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed<TopicSubscription> _instance; } _TopicSubscription_default_instance_; } // namespace request } // namespace services } // namespace ubii namespace protobuf_proto_2fservices_2frequest_2ftopicSubscription_2eproto { static void InitDefaultsTopicSubscription() { GOOGLE_PROTOBUF_VERIFY_VERSION; { void* ptr = &::ubii::services::request::_TopicSubscription_default_instance_; new (ptr) ::ubii::services::request::TopicSubscription(); ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } ::ubii::services::request::TopicSubscription::InitAsDefaultInstance(); } ::google::protobuf::internal::SCCInfo<0> scc_info_TopicSubscription = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsTopicSubscription}, {}}; void InitDefaults() { ::google::protobuf::internal::InitSCC(&scc_info_TopicSubscription.base); } ::google::protobuf::Metadata file_level_metadata[1]; const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::services::request::TopicSubscription, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::services::request::TopicSubscription, client_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::services::request::TopicSubscription, subscribe_topics_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::services::request::TopicSubscription, unsubscribe_topics_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::services::request::TopicSubscription, subscribe_topic_regexp_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::ubii::services::request::TopicSubscription, unsubscribe_topic_regexp_), }; static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, sizeof(::ubii::services::request::TopicSubscription)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { reinterpret_cast<const ::google::protobuf::Message*>(&::ubii::services::request::_TopicSubscription_default_instance_), }; void protobuf_AssignDescriptors() { AddDescriptors(); AssignDescriptors( "proto/services/request/topicSubscription.proto", schemas, file_default_instances, TableStruct::offsets, file_level_metadata, NULL, NULL); } void protobuf_AssignDescriptorsOnce() { static ::google::protobuf::internal::once_flag once; ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); } void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); } void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n.proto/services/request/topicSubscripti" "on.proto\022\025ubii.services.request\"\236\001\n\021Topi" "cSubscription\022\021\n\tclient_id\030\001 \001(\t\022\030\n\020subs" "cribe_topics\030\002 \003(\t\022\032\n\022unsubscribe_topics" "\030\003 \003(\t\022\036\n\026subscribe_topic_regexp\030\004 \003(\t\022 " "\n\030unsubscribe_topic_regexp\030\005 \003(\tb\006proto3" }; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( descriptor, 240); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "proto/services/request/topicSubscription.proto", &protobuf_RegisterTypes); } void AddDescriptors() { static ::google::protobuf::internal::once_flag once; ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); } // Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); } } static_descriptor_initializer; } // namespace protobuf_proto_2fservices_2frequest_2ftopicSubscription_2eproto namespace ubii { namespace services { namespace request { // =================================================================== void TopicSubscription::InitAsDefaultInstance() { } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int TopicSubscription::kClientIdFieldNumber; const int TopicSubscription::kSubscribeTopicsFieldNumber; const int TopicSubscription::kUnsubscribeTopicsFieldNumber; const int TopicSubscription::kSubscribeTopicRegexpFieldNumber; const int TopicSubscription::kUnsubscribeTopicRegexpFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 TopicSubscription::TopicSubscription() : ::google::protobuf::Message(), _internal_metadata_(NULL) { ::google::protobuf::internal::InitSCC( &protobuf_proto_2fservices_2frequest_2ftopicSubscription_2eproto::scc_info_TopicSubscription.base); SharedCtor(); // @@protoc_insertion_point(constructor:ubii.services.request.TopicSubscription) } TopicSubscription::TopicSubscription(const TopicSubscription& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), subscribe_topics_(from.subscribe_topics_), unsubscribe_topics_(from.unsubscribe_topics_), subscribe_topic_regexp_(from.subscribe_topic_regexp_), unsubscribe_topic_regexp_(from.unsubscribe_topic_regexp_) { _internal_metadata_.MergeFrom(from._internal_metadata_); client_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.client_id().size() > 0) { client_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.client_id_); } // @@protoc_insertion_point(copy_constructor:ubii.services.request.TopicSubscription) } void TopicSubscription::SharedCtor() { client_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } TopicSubscription::~TopicSubscription() { // @@protoc_insertion_point(destructor:ubii.services.request.TopicSubscription) SharedDtor(); } void TopicSubscription::SharedDtor() { client_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void TopicSubscription::SetCachedSize(int size) const { _cached_size_.Set(size); } const ::google::protobuf::Descriptor* TopicSubscription::descriptor() { ::protobuf_proto_2fservices_2frequest_2ftopicSubscription_2eproto::protobuf_AssignDescriptorsOnce(); return ::protobuf_proto_2fservices_2frequest_2ftopicSubscription_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const TopicSubscription& TopicSubscription::default_instance() { ::google::protobuf::internal::InitSCC(&protobuf_proto_2fservices_2frequest_2ftopicSubscription_2eproto::scc_info_TopicSubscription.base); return *internal_default_instance(); } void TopicSubscription::Clear() { // @@protoc_insertion_point(message_clear_start:ubii.services.request.TopicSubscription) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; subscribe_topics_.Clear(); unsubscribe_topics_.Clear(); subscribe_topic_regexp_.Clear(); unsubscribe_topic_regexp_.Clear(); client_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); _internal_metadata_.Clear(); } bool TopicSubscription::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:ubii.services.request.TopicSubscription) for (;;) { ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // string client_id = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_client_id())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->client_id().data(), static_cast<int>(this->client_id().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "ubii.services.request.TopicSubscription.client_id")); } else { goto handle_unusual; } break; } // repeated string subscribe_topics = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_subscribe_topics())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->subscribe_topics(this->subscribe_topics_size() - 1).data(), static_cast<int>(this->subscribe_topics(this->subscribe_topics_size() - 1).length()), ::google::protobuf::internal::WireFormatLite::PARSE, "ubii.services.request.TopicSubscription.subscribe_topics")); } else { goto handle_unusual; } break; } // repeated string unsubscribe_topics = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_unsubscribe_topics())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->unsubscribe_topics(this->unsubscribe_topics_size() - 1).data(), static_cast<int>(this->unsubscribe_topics(this->unsubscribe_topics_size() - 1).length()), ::google::protobuf::internal::WireFormatLite::PARSE, "ubii.services.request.TopicSubscription.unsubscribe_topics")); } else { goto handle_unusual; } break; } // repeated string subscribe_topic_regexp = 4; case 4: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_subscribe_topic_regexp())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->subscribe_topic_regexp(this->subscribe_topic_regexp_size() - 1).data(), static_cast<int>(this->subscribe_topic_regexp(this->subscribe_topic_regexp_size() - 1).length()), ::google::protobuf::internal::WireFormatLite::PARSE, "ubii.services.request.TopicSubscription.subscribe_topic_regexp")); } else { goto handle_unusual; } break; } // repeated string unsubscribe_topic_regexp = 5; case 5: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_unsubscribe_topic_regexp())); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->unsubscribe_topic_regexp(this->unsubscribe_topic_regexp_size() - 1).data(), static_cast<int>(this->unsubscribe_topic_regexp(this->unsubscribe_topic_regexp_size() - 1).length()), ::google::protobuf::internal::WireFormatLite::PARSE, "ubii.services.request.TopicSubscription.unsubscribe_topic_regexp")); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:ubii.services.request.TopicSubscription) return true; failure: // @@protoc_insertion_point(parse_failure:ubii.services.request.TopicSubscription) return false; #undef DO_ } void TopicSubscription::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:ubii.services.request.TopicSubscription) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // string client_id = 1; if (this->client_id().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->client_id().data(), static_cast<int>(this->client_id().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.client_id"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->client_id(), output); } // repeated string subscribe_topics = 2; for (int i = 0, n = this->subscribe_topics_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->subscribe_topics(i).data(), static_cast<int>(this->subscribe_topics(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.subscribe_topics"); ::google::protobuf::internal::WireFormatLite::WriteString( 2, this->subscribe_topics(i), output); } // repeated string unsubscribe_topics = 3; for (int i = 0, n = this->unsubscribe_topics_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->unsubscribe_topics(i).data(), static_cast<int>(this->unsubscribe_topics(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.unsubscribe_topics"); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->unsubscribe_topics(i), output); } // repeated string subscribe_topic_regexp = 4; for (int i = 0, n = this->subscribe_topic_regexp_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->subscribe_topic_regexp(i).data(), static_cast<int>(this->subscribe_topic_regexp(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.subscribe_topic_regexp"); ::google::protobuf::internal::WireFormatLite::WriteString( 4, this->subscribe_topic_regexp(i), output); } // repeated string unsubscribe_topic_regexp = 5; for (int i = 0, n = this->unsubscribe_topic_regexp_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->unsubscribe_topic_regexp(i).data(), static_cast<int>(this->unsubscribe_topic_regexp(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.unsubscribe_topic_regexp"); ::google::protobuf::internal::WireFormatLite::WriteString( 5, this->unsubscribe_topic_regexp(i), output); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@protoc_insertion_point(serialize_end:ubii.services.request.TopicSubscription) } ::google::protobuf::uint8* TopicSubscription::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:ubii.services.request.TopicSubscription) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // string client_id = 1; if (this->client_id().size() > 0) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->client_id().data(), static_cast<int>(this->client_id().length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.client_id"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->client_id(), target); } // repeated string subscribe_topics = 2; for (int i = 0, n = this->subscribe_topics_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->subscribe_topics(i).data(), static_cast<int>(this->subscribe_topics(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.subscribe_topics"); target = ::google::protobuf::internal::WireFormatLite:: WriteStringToArray(2, this->subscribe_topics(i), target); } // repeated string unsubscribe_topics = 3; for (int i = 0, n = this->unsubscribe_topics_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->unsubscribe_topics(i).data(), static_cast<int>(this->unsubscribe_topics(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.unsubscribe_topics"); target = ::google::protobuf::internal::WireFormatLite:: WriteStringToArray(3, this->unsubscribe_topics(i), target); } // repeated string subscribe_topic_regexp = 4; for (int i = 0, n = this->subscribe_topic_regexp_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->subscribe_topic_regexp(i).data(), static_cast<int>(this->subscribe_topic_regexp(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.subscribe_topic_regexp"); target = ::google::protobuf::internal::WireFormatLite:: WriteStringToArray(4, this->subscribe_topic_regexp(i), target); } // repeated string unsubscribe_topic_regexp = 5; for (int i = 0, n = this->unsubscribe_topic_regexp_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->unsubscribe_topic_regexp(i).data(), static_cast<int>(this->unsubscribe_topic_regexp(i).length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "ubii.services.request.TopicSubscription.unsubscribe_topic_regexp"); target = ::google::protobuf::internal::WireFormatLite:: WriteStringToArray(5, this->unsubscribe_topic_regexp(i), target); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@protoc_insertion_point(serialize_to_array_end:ubii.services.request.TopicSubscription) return target; } size_t TopicSubscription::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:ubii.services.request.TopicSubscription) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } // repeated string subscribe_topics = 2; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->subscribe_topics_size()); for (int i = 0, n = this->subscribe_topics_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->subscribe_topics(i)); } // repeated string unsubscribe_topics = 3; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->unsubscribe_topics_size()); for (int i = 0, n = this->unsubscribe_topics_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->unsubscribe_topics(i)); } // repeated string subscribe_topic_regexp = 4; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->subscribe_topic_regexp_size()); for (int i = 0, n = this->subscribe_topic_regexp_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->subscribe_topic_regexp(i)); } // repeated string unsubscribe_topic_regexp = 5; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->unsubscribe_topic_regexp_size()); for (int i = 0, n = this->unsubscribe_topic_regexp_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->unsubscribe_topic_regexp(i)); } // string client_id = 1; if (this->client_id().size() > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->client_id()); } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void TopicSubscription::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:ubii.services.request.TopicSubscription) GOOGLE_DCHECK_NE(&from, this); const TopicSubscription* source = ::google::protobuf::internal::DynamicCastToGenerated<const TopicSubscription>( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:ubii.services.request.TopicSubscription) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:ubii.services.request.TopicSubscription) MergeFrom(*source); } } void TopicSubscription::MergeFrom(const TopicSubscription& from) { // @@protoc_insertion_point(class_specific_merge_from_start:ubii.services.request.TopicSubscription) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; subscribe_topics_.MergeFrom(from.subscribe_topics_); unsubscribe_topics_.MergeFrom(from.unsubscribe_topics_); subscribe_topic_regexp_.MergeFrom(from.subscribe_topic_regexp_); unsubscribe_topic_regexp_.MergeFrom(from.unsubscribe_topic_regexp_); if (from.client_id().size() > 0) { client_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.client_id_); } } void TopicSubscription::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:ubii.services.request.TopicSubscription) if (&from == this) return; Clear(); MergeFrom(from); } void TopicSubscription::CopyFrom(const TopicSubscription& from) { // @@protoc_insertion_point(class_specific_copy_from_start:ubii.services.request.TopicSubscription) if (&from == this) return; Clear(); MergeFrom(from); } bool TopicSubscription::IsInitialized() const { return true; } void TopicSubscription::Swap(TopicSubscription* other) { if (other == this) return; InternalSwap(other); } void TopicSubscription::InternalSwap(TopicSubscription* other) { using std::swap; subscribe_topics_.InternalSwap(CastToBase(&other->subscribe_topics_)); unsubscribe_topics_.InternalSwap(CastToBase(&other->unsubscribe_topics_)); subscribe_topic_regexp_.InternalSwap(CastToBase(&other->subscribe_topic_regexp_)); unsubscribe_topic_regexp_.InternalSwap(CastToBase(&other->unsubscribe_topic_regexp_)); client_id_.Swap(&other->client_id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata TopicSubscription::GetMetadata() const { protobuf_proto_2fservices_2frequest_2ftopicSubscription_2eproto::protobuf_AssignDescriptorsOnce(); return ::protobuf_proto_2fservices_2frequest_2ftopicSubscription_2eproto::file_level_metadata[kIndexInFileMessages]; } // @@protoc_insertion_point(namespace_scope) } // namespace request } // namespace services } // namespace ubii namespace google { namespace protobuf { template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::ubii::services::request::TopicSubscription* Arena::CreateMaybeMessage< ::ubii::services::request::TopicSubscription >(Arena* arena) { return Arena::CreateInternal< ::ubii::services::request::TopicSubscription >(arena); } } // namespace protobuf } // namespace google // @@protoc_insertion_point(global_scope)
44.913495
181
0.729507
9934e3629c522f13fd76e73643c00baf3df398be
29,949
cpp
C++
cpp/apps/AeroCombat/temp/AeroSurf.cpp
ProkopHapala/SimpleSimulationEngine
240f9b7e85b3a6eda7a27dc15fe3f7b8c08774c5
[ "MIT" ]
26
2016-12-04T04:45:12.000Z
2022-03-24T09:39:28.000Z
cpp/apps/AeroCombat/temp/AeroSurf.cpp
ProkopHapala/SimpleSimulationEngine
240f9b7e85b3a6eda7a27dc15fe3f7b8c08774c5
[ "MIT" ]
null
null
null
cpp/apps/AeroCombat/temp/AeroSurf.cpp
ProkopHapala/SimpleSimulationEngine
240f9b7e85b3a6eda7a27dc15fe3f7b8c08774c5
[ "MIT" ]
2
2019-02-09T12:31:06.000Z
2019-04-28T02:24:50.000Z
//#include "rString.hpp" #include <math.h> #include "AeroSurf.hpp" #if _DEBUG_AEROSURF void drawWing(Vector3 pos, Matrix3 rot, float a, float AspectRatio ) { Matrix4 pose; pose.SetPosition(Vector3D(pos.X(), pos.Y(), pos.Z())); pose.SetOrientation(rot); renderer.DrawBox(Vector3D(0, 0, 0), Vector3(AspectRatio*a*0.5, 0.025, a*0.5), PackedWhite, &pose); } void drawRigidBody(Vector3 pos, Matrix3 rot, float sz) { renderer.Add3dLine(pos, pos + rot.Direction() * sz, PackedBlue ); renderer.Add3dLine(pos, pos + rot.DirectionUp() * sz, PackedGreen ); renderer.Add3dLine(pos, pos + rot.DirectionAside() * sz, PackedRed ); Matrix4 pose; pose.SetPosition(Vector3D(pos.X(), pos.Y(), pos.Z())); pose.SetOrientation(rot); renderer.DrawBox(Vector3D(0, 0, 0), Vector3(0.5, 0.25, 1.0), PackedWhite, &pose); }; #endif // _DEBUG_AEROSURF //============== // PolarModel //============== inline void PolarModel::GetAeroCoefs(float ca, float sa, float& CD, float& CL) const { float abs_sa = (sa>0) ? sa : -sa; // symmetric wing float wS = cubicSmoothStep<float>(abs_sa, _sStall, _sStall + _wStall); // stalled mixing factor float mS = 1 - wS; // not-stalled mixing factor CD = _CD0 + ( mS * _dCD * abs_sa + wS * _dCDS) * abs_sa; // drag if (ca <0) { // for Angle of Attack > 90 deg ( air comes from behind ) ca = -ca; sa = -sa; }; CL = ( mS* _dCL + wS * _dCLS*ca) * sa; // lift } //===================== // PolarModelTorque //===================== inline void PolarModelTorque::GetAeroCoefs(float ca, float sa, float flap, float& CD, float& CL, float& CM) const { float abs_sa = (sa>0) ? sa : -sa; // symmetric wing float wS = cubicSmoothStep<float>(abs_sa, _sStall, _sStall + _wStall); // stalled mixing factor float mS = 1 - wS; // not-stalled mixing factor CD = _CD0 + (mS*_dCD*abs_sa + wS * _dCDS) * abs_sa; // drag if (ca <0) { // for Angle of Attack > 90 deg ( air comes from behind ) ca = -ca; sa = -sa; }; CL = (mS*_dCL + wS * _dCLS*ca) * sa; // lift float sa_, ca_; rot2D(flap, ca, sa, ca_, sa_); abs_sa = (sa_>0) ? sa_ : -sa_; //// We should use the same stall cutoff as main wing independent of flap (?) //wS = cubicSmoothStep<float>(abs_sa, _sStall, _sStall + _wStall); // stalled mixing factor //mS = 1 - wS; // not-stalled mixing factor CM = (mS*_dCM + wS * _dCMS*ca_) * sa_; // TODO: FIXME pitching moment } // ====================================================== // AeroSurface // ====================================================== float AeroSurface::Control2tilt(float control) const { // if _maxTilt <> -_minTilt this will produce piecewise linear function f(0)=0 with different slope for positive and negative value of control if (control > 0) { return control * _maxTilt; } else { return control * -_minTilt; } } float AeroSurface::Controls2tilt(float elevator, float rudder, float aileron) const { float control = _cElevator*elevator + _cRudder*rudder + _cAileron*aileron; if (control > 0) { return control * _maxTilt; } else { return control * -_minTilt; } } void AeroSurface::Tilt(float angle) { Matrix3 tiltMat = M3Identity; tiltMat.SetRotationX(angle); _lrot = _lrot * tiltMat; }; void AeroSurface::ApplyForce(const Vector3& vair0, const Matrix3& craftRot, const Vector3& craftOmega, Vector3& force, Vector3& torq, float tilt, int i, bool debug, const Vector3& pos0 ) const { // global coordinates Matrix3 grot; // rotation of panel in world coordinates if (_bControlable) { // Apply controls Matrix3 tiltMat = M3Identity; tiltMat.SetRotationX(tilt); grot = craftRot * _lrot * tiltMat; } else { grot = craftRot * _lrot; } Vector3 gdpos = craftRot * _lpos; // position of panel in world coordinates relative to COG Vector3 uair = vair0 + gdpos.CrossProduct(craftOmega); // velocity of panel due to rotation of aircraft //Vector3 uair = vair0; // ignore rotation of aircraft float vrair2 = uair.SquareSize(); if (vrair2 > lowSpeedCuoff) // for zero air-speed it would diverge { // unitary vector in direction of air flow float vrair = sqrt(vrair2); uair *= (1 / vrair); // decompose uair to panel coordinates float ca = grot.DirectionAside().DotProduct(uair); float cb = grot.DirectionUp().DotProduct(uair); float cc = grot.Direction().DotProduct(uair); // All aerodynamic forces are scalled by this factor float prefactor = vrair2 * _area; // density not included force = VZero; #if _DEBUG_AEROSURF Vector3 pos = pos0 + gdpos; // position of panel in world coordinates; just for ploting if (debug) renderer.Add3dLine(pos, pos + uair * 5.0, PackedBlue); #endif // _DEBUG_AEROSURF // get Lift and Drag coefs from polar (dimensionless) float CD, CL; _polar.GetAeroCoefs(-cc, cb, CD, CL); if (_bFiniteWingCorrection) { // NOTE: This is used if we use polar of infinite wing (of 2D airfoil ) // but finite wing effect can be already included in polar, than _bFiniteWingCorrection should be set to false // http://www.srmuniv.ac.in/sites/default/files/downloads/class4-2012.pdf // https://en.wikipedia.org/wiki/Lifting-line_theory#Useful_approximations CL *= _aspectRatio / ( 2 + _aspectRatio ); CD += CL * CL / (3.1415926535 * _aspectRatio); // induced drag // https://en.wikipedia.org/wiki/Lift-induced_drag } // Scale Lift and Drag (no density yet) CL *= prefactor; CD *= prefactor; if ((cb*cb) > 1e-8) // for zero Angle of Attack we cannot determine lift direction { Vector3 airUp = grot.DirectionUp() + (uair * -cb); // component of grot.Up perpendicular to uair airUp.Normalize(); force = airUp * CL + uair * CD; // combine Lift and Drag force #if _DEBUG_AEROSURF if (debug) { renderer.Add3dLine(pos, pos + airUp * 5.0, PackedGreen); char plotName[128]; sprintf(plotName, "wing[%i]", i); //TO_DBG_MGRAPH(plotName, Lift, CL, 200); //TO_DBG_MGRAPH(plotName, Drag, CD, 200); /* if (debugPlot>0) { int N = 200; if (!liftPlot && GDebugGui) { liftPlot = GDebugGui->AddMultiGraph(plotName, "Lift", N); GEngine->ShowDiagGraph(liftPlot); iLift = liftPlot->AddGraph("Lift"); } if (!dragPlot && GDebugGui) { dragPlot = GDebugGui->AddMultiGraph(plotName, "Drag", N); GEngine->ShowDiagGraph(dragPlot); iDrag = dragPlot->AddGraph("Drag"); } if (debugPlot == 1) { if (-1 != iLift && liftPlot) liftPlot->AddValue(iLift, CL); if (-1 != iDrag && dragPlot) dragPlot->AddValue(iDrag, CD); } if (debugPlot == 2) { liftPlot->Clear(); dragPlot->Clear(); float dAoA = 6.28 / N; for (int i = 0; i < N; i++ ) { float AoA = dAoA * i - 3.14; float ca_ = cos(AoA); float sa_ = sin(AoA); polar->getAeroCoefs(ca_, sa_, CD, CL); liftPlot->AddValue(iLift, CL); dragPlot->AddValue(iDrag, CD); } float AoA = atan2( cb, -cc ); liftPlot->HighlightB = AoA/6.28 + 0.5; DIAG_MESSAGE_ID(100, 30 + i, Format("AoA %f", AoA ) ); } } */ // DECL_DBG_2DSLIDER(coords, 1, 2, -5, 5, -5, 5); // Creates two floats, coord_X and coord_Y, with their initial values set to [1, 2] and the slider has a range of <-5,5> x <-5,5> //TO_DBG_MGRAPH(speed, z, FutureVisualState().RelativeSpeed().Z(), 200); } #endif // _DEBUG_AEROSURF } else { force += uair * CD; // for zero Angle of Attack only drag force } // apply anisotropic drag coef - Do we really need this here ? force += grot.DirectionAside() * (_cAnisoDrag[0] * ca * prefactor); force += grot.DirectionUp() * (_cAnisoDrag[1] * cb * prefactor); force += grot.Direction() * (_cAnisoDrag[2] * cc * prefactor); torq = gdpos.CrossProduct(force); #if _DEBUG_AEROSURF if (debug) { renderer.Add3dLine(pos, pos + grot.DirectionUp() * 5.0, PackedBlack); renderer.Add3dLine(pos, pos + grot.Direction() * 5.0, PackedWhite); renderer.Add3dLine(pos, pos + force * 5.0, PackedRed); } #endif // _DEBUG_AEROSURF } }; void AeroSurface::FromString(const char * str) { float lrot_bx, lrot_by, lrot_bz, lrot_cx, lrot_cy, lrot_cz; sscanf(str, " %f %f %f %f %f %f %f %f %f %f %f %f %f %f", &_lpos[0], &_lpos[1], &_lpos[2], &lrot_bx, &lrot_by, &lrot_bz, &lrot_cx, &lrot_cy, &lrot_cz, &_cAnisoDrag[0], &_cAnisoDrag[1], &_cAnisoDrag[2], &_area, &_aspectRatio ); _lrot.SetDirectionAndUp(Vector3(lrot_cx, lrot_cy, lrot_cz), Vector3(lrot_bx, lrot_by, lrot_bz)); }; void AeroSurface::FromStringPolarModel(const char * str) { float lrot_bx, lrot_by, lrot_bz, lrot_cx, lrot_cy, lrot_cz; sscanf(str, " %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f", &_lpos[0], &_lpos[1], &_lpos[2], &lrot_bx, &lrot_by, &lrot_bz, &lrot_cx, &lrot_cy, &lrot_cz, &_cAnisoDrag[0], &_cAnisoDrag[1], &_cAnisoDrag[2], &_area, &_aspectRatio, &(_polar._CD0), &(_polar._dCD), &(_polar._dCDS), &(_polar._dCL), &(_polar._dCLS), &(_polar._sStall), &(_polar._wStall) ); _lrot.SetDirectionAndUp( Vector3(lrot_cx, lrot_cy, lrot_cz), Vector3(lrot_bx, lrot_by, lrot_bz) ); }; int AeroSurface::ToStringPolarModel(char * str) const { return sprintf(str, "%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %i \n", _lpos[0], _lpos[1], _lpos[2], _lrot.DirectionUp()[0], _lrot.DirectionUp()[1], _lrot.DirectionUp()[2], _lrot.Direction()[0], _lrot.Direction()[1], _lrot.Direction()[2], _cAnisoDrag[0], _cAnisoDrag[1], _cAnisoDrag[2], _area,_aspectRatio, _polar._CD0, _polar._dCD, _polar._dCDS, _polar._dCL, _polar._dCLS, _polar._sStall, _polar._wStall, _minTilt, _maxTilt, _bFiniteWingCorrection ); }; // ========================================= // Propeler // ========================================= float Propeler::GetBaypassThrust(float v0, float throtle) const { // Thrust is limited by amount of air passing through propeler // Derived from those equations // dm = S * v0 // F = dm * Dv // Engine power accelerates both the aircraft and the air // P = F * v0 + 0.5*dm*(Dv**2) = S*(v0**2)*Dv + 0.5*S*v0*(Dv**2) // Quadratic equation // v0 ... aircraft velocity // vstatic ... we need non-zero flow through properler even when aircraft stand still on ground float dm = _area * (v0 + _vstatic); // mass of air-flow per second // coefs of quadratic equation float a = 0.5*dm; float b = dm * v0; float c = -_power * throtle; float Dv1, Dv2; quadratic_roots(a, b, c, Dv1, Dv2); // solve of square of air-speed return dm * Dv1 * _efficiency - dm * v0*_CD; } void Propeler::ApplyForce(const Vector3& vair0, float airDens, const Matrix3& craftRot, const Vector3& craftOmega, Vector3& force, Vector3& torq, float throtle, int i, bool debug, const Vector3& pos0) const { // rotation of panel in world coordinates Vector3 gdir = craftRot * _ldir; // direction Vector3 gdpos = craftRot * _lpos; // position Vector3 pos = pos0 + gdpos; float v = 0.0; float Fout = _thrustRocket * throtle; // constant velocity independent thrust - like rocket if (_bSolveBypass) { // thrust computed from velocity and engine power (ideal propeler) Vector3 vair = vair0 + gdpos.CrossProduct(craftOmega); // velocity of panel due to rotation of aircraft v = vair.Size() * gdir.DotProduct(vair); Fout += GetBaypassThrust(v,throtle)*airDens; } force = gdir * Fout; torq = gdpos.CrossProduct(force); }; float Propeler::AutoVStatic() const { return pow(4 * _power / _area, 0.333333); // this is just guess without good physical justification }; void Propeler::FromString(const char * str) { sscanf(str, " %f %f %f %f %f %f %f %f %f %f %f %f", &_lpos[0], &_lpos[1], &_lpos[2], &_ldir[0], &_ldir[1], &_ldir[2], &_thrustRocket, &_area, &_power, &_efficiency, &_CD, &_vstatic ); _ldir.Normalize(); if (_vstatic < 0) _vstatic=AutoVStatic(); printf("%lf %lf %lf %lf\n", _area, _power, _efficiency, _CD); } // ================================ // ComposedAeroModel // ================================ void ComposedAeroModel::ApplyForce(const Vector3& vair, const Matrix3& craftRot, const Vector3& craftOmega, Vector3& force, Vector3& torq, float elevator, float rudder, float aileron, float throtle, const Vector3& pos0) const { force = VZero; torq = VZero; #if _DEBUG_AEROSURF bool debug = _DebugLevel >= 2; if(debug) { DIAG_MESSAGE_ID(100, 9, Format("vair = %f %f %f", vair.X(), vair.Y(), vair.Z())); renderer.Add3dLine(pos0, pos0 + vair * 10.0, PackedRed); } #endif // _DEBUG_AEROSURF for (int iwing = 0; iwing < _wings.Size(); iwing++) { Vector3 torq_i, force_i; const AeroSurface& wing = _wings[iwing]; // this is replaced by AeroSurf::_cElevator,_cRudder,_cAileron //float tilt = 0.0; //if (iwing == _elevatorId) // tilt = -pitch; //else if (iwing == _rudderId) // tilt = -yaw; //else if (iwing == _leftAirelonId) // tilt = roll; //else if (iwing == _rightAirelonId) // tilt = -roll; //wing.ApplyForce(vair, craftRot, craftOmega, force_i, torq_i, wing.Control2tilt(tilt), iwing, debug, pos0); float tilt = 0.0; if(wing._bControlable) tilt = wing.Controls2tilt(elevator, rudder, aileron); wing.ApplyForce(vair, craftRot, craftOmega, force_i, torq_i, tilt, iwing, debug, pos0); force += force_i; torq += torq_i; #if _DEBUG_AEROSURF if (debug) { Vector3 pos_i = pos0 + craftRot * wing._lpos; float a = sqrt(wing._area / wing._aspectRatio); drawWing(pos_i, craftRot*wing._lrot, a, wing._aspectRatio); } #endif // _DEBUG_AEROSURF } if (_bSupersonic) { // http://www.srmuniv.ac.in/sites/default/files/downloads/class4-2012.pdf float speedOfSound = 343.0f; // TODO : speed of sound may change with altitude etc. https://en.wikipedia.org/wiki/Speed_of_sound#/media/File:Comparison_US_standard_atmosphere_1962.svg float v2 = vair.SquareSize(); if ( v2 > Square( speedOfSound*_MachMin ) ) { float v = sqrt(v2); float wd = supersonicDrag( v/speedOfSound, _Mach0, _MachMin, _MachMax ); float cdir = vair.DotProduct(force); force += vair * ( _cWaveDrag * wd * cdir / v2 ); // apply wave-drag-force along airflow direction; 1/v2 factor since (vair*cdir)~v2 } } float fDens = 0.5*Atmosphere::GetDensity(pos0[1]); // rho/2; hope that _position[1]==0 is sea level ? #if _DEBUG_AEROSURF if (_DebugLevel >= 2) { DIAG_MESSAGE_ID(15, 65, Format("Attitude %f AirDensity %f ", pos0[1], fDens*2.0)); } #endif // _DEBUG_AEROSURF force *= fDens; torq *= fDens; for (int i = 0; i < _propelers.Size(); i++) { Vector3 torq_i, force_i; const Propeler& prop = _propelers[i]; prop.ApplyForce(vair, fDens, craftRot, craftOmega, force_i, torq_i, throtle, i, debug, pos0); force += force_i; torq += torq_i; } }; void ComposedAeroModel::FromFile(FILE* pFile) { const int nbuf = 1024; char buf[nbuf]; fgets(buf, nbuf, pFile); int nWings; sscanf(buf, "%i\n", &nWings); //_wings.Access(nWings); _wings.Resize(nWings); for (int i = 0; i < _wings.Size(); i++) { fgets(buf, nbuf, pFile); _wings[i].FromStringPolarModel(buf); } //fgets(buf, nbuf, pFile); //sscanf(buf, "%i %i %i %i\n", &_leftAirelonId, &_rightAirelonId, &_elevatorId, &_rudderId); //_leftAirelonId--; //_rightAirelonId--; //_elevatorId--; //_rudderId--; }; int ComposedAeroModel::LoadFile(const char * fname) { FILE * pFile; LogF(" AeroTestPlatform::InitWingsFile loading wings from: >>%s<<\n", fname); pFile = fopen(fname, "r"); if (pFile == nullptr) { LogF(" ComposedAeroModel::fromFile cannot open >>%s<< => call default InitWings() \n", fname); //exit(-1); return -1; } FromFile(pFile); LogF("AeroTestPlatform::InitWingsFile wings loaded from >>%s<<\n", fname); fclose(pFile); return 0; }; char* ComposedAeroModel::ToString(char * str) const { str += sprintf(str, " ===== AeroTestPlatform::toString : _nWings %i \n", _wings.Size()); for (int i = 0; i < _wings.Size(); i++) { str += sprintf(str, " ===== wing[%i] ", i); str += _wings[i].ToStringPolarModel(str); }; return str; }; float ComposedAeroModel::WettedArea() const { float area = 0; for (int i = 0; i < _wings.Size(); i++) { area += _wings[i]._area; } return area; }; float ComposedAeroModel::MultArea(float f) { float area = 0; for (int i = 0; i < _wings.Size(); i++) { float a = _wings[i]._area; a *= f; _wings[i]._area = a; area += a; } return area; }; float ComposedAeroModel::GetMaxTorqScale() const { float tmax = 0; for (int i = 0; i < _wings.Size(); i++) { float ti = _wings[i]._lpos.Size() * _wings[i]._area; tmax = fmax(tmax, ti); } return tmax; }; // ====================================================== // CompactAeroModel // ====================================================== void CompactAeroModel::FromString(const char * str) { sscanf(str, " %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f ", &_area, &_cAnisoDrag[0], &_cAnisoDrag[1], &_cAnisoDrag[2], &_cTorqDamp[0], &_cTorqDamp[1], &_cTorqDamp[2], &_cTorqControl[0], &_cTorqControl[1], &_cTorqControl[2], &_cTorqRelax[0], &_cTorqRelax[1], &_cTorqRelax[2], &(_polarFwUp._sStall), &(_polarFwUp._wStall), &(_polarFwUp._CD0), &(_polarFwUp._dCD), &(_polarFwUp._dCDS), &(_polarFwUp._dCL), &(_polarFwUp._dCLS) ); LogF(" ===== CompactAeroModel::fromString \n"); LogF(" area %f C %f %f %f D %f %f %f L %f %f %f S %f %f %f \n", _area, _cAnisoDrag[0], _cAnisoDrag[1], _cAnisoDrag[2], _cTorqDamp[0], _cTorqDamp[1], _cTorqDamp[2], _cTorqControl[0], _cTorqControl[1], _cTorqControl[2], _cTorqRelax[0], _cTorqRelax[1], _cTorqRelax[2] ); LogF("polarFwUp %f %f %f %f %f %f %f \n", _polarFwUp._sStall, _polarFwUp._wStall, _polarFwUp._CD0, _polarFwUp._dCD, _polarFwUp._dCDS, _polarFwUp._dCL, _polarFwUp._dCLS); }; void CompactAeroModel::ApplyForce(const Vector3& vair0, const Matrix3& craftRot, const Vector3& craftOmega, Vector3& force, Vector3& torq, float elevator, float rudder, float aileron, const Vector3& pos0) const { Vector3 uair = vair0; // we shoud consider craftOmega #if _DEBUG_AEROSURF renderer.Add3dLine(pos0, pos0 + uair * 5.0, PackedBlue); renderer.Add3dLine(pos0, pos0 + craftRot.DirectionAside()*5.0, PackedColor(0xff808080)); renderer.Add3dLine(pos0, pos0 + craftRot.DirectionUp()*5.0, PackedBlack); renderer.Add3dLine(pos0, pos0 + craftRot.Direction()*5.0, PackedWhite); #endif // _DEBUG_AEROSURF //Vector3 uair = vair0 + gdpos.CrossProduct(craftOmega); float vrair2 = uair.SquareSize(); torq = VZero; force = VZero; if (vrair2 > lowSpeedCuoff) // for zero air-speed we would devide by 0 { float vrair = sqrt(vrair2); uair *= (1 / vrair); // decompose uair to panel coordinates float ca = uair.DotProduct(craftRot.DirectionAside()); float cb = uair.DotProduct(craftRot.DirectionUp()); float cc = uair.DotProduct(craftRot.Direction()); #if _DEBUG_AEROSURF DIAG_MESSAGE_ID(100, 11, Format("elevator %f rudder %f aileron %f ", elevator, rudder, aileron)); DIAG_MESSAGE_ID(100, 12, Format("ca %f cb %f cc %f ", ca, cb, cc)); #endif // _DEBUG_AEROSURF float prefactor = vrair2 * _area; // scale all aerodynamic forces by this { float CD, CL; Vector3 airUp; _polarFwUp.GetAeroCoefs(-cc, cb, CD, CL); if ((cb*cb) > 1e-8) { airUp = craftRot.DirectionUp() + (uair * -cb); // component of grot.Up perpendicular to uair airUp.Normalize(); } else { airUp = craftRot.DirectionUp(); } #if _DEBUG_AEROSURF renderer.Add3dLine(pos0, pos0 + airUp * 5.0, PackedGreen); #endif // _DEBUG_AEROSURF force += (airUp * CL + uair * CD) * prefactor; } #if _DEBUG_AEROSURF renderer.Add3dLine(pos0, pos0 + force * 5.0, PackedRed); #endif // _DEBUG_AEROSURF float cc2 = cc * cc; // damp effect of control surfaces when aircraft is not alligned to airflow // Stabilization - aligns aircraft orientation toward airflow torq += craftRot.DirectionAside() * (_cTorqRelax[0] * cb*cc2* prefactor); torq += craftRot.DirectionUp() * (_cTorqRelax[1] * -ca * cc2* prefactor); torq += uair.CrossProduct(craftRot.Direction()) * ( _cTorqRelax[2] * prefactor ); // Control input torq += craftRot.DirectionAside() * (_cTorqControl[0] * elevator * prefactor * cc2); //torq += craftRot.DirectionUp() * (_cTorqControl[1] * -rudder * prefactor * cc2 ); torq += craftRot.Direction() * (_cTorqControl[2] * aileron * prefactor * cc2); // damping of aircraft rotation due to drag of control surfaces torq += craftRot.DirectionAside() * ( craftOmega.DotProduct(craftRot.DirectionAside()) * -_cTorqDamp[0] * prefactor); // pitch drag torq += craftRot.DirectionUp() * ( craftOmega.DotProduct(craftRot.DirectionUp()) * -_cTorqDamp[1] * prefactor); // yaw drag torq += craftRot.Direction() * ( craftOmega.DotProduct(craftRot.Direction()) * -_cTorqDamp[2] * prefactor); // roll drag // apply anisotropic drag coef force += craftRot.DirectionAside() * (_cAnisoDrag[0] * ca*prefactor); force += craftRot.DirectionUp() * (_cAnisoDrag[1] * cb*prefactor); force += craftRot.Direction() * (_cAnisoDrag[2] * cc*prefactor); #if _DEBUG_AEROSURF DIAG_MESSAGE_ID(100, 14, Format("force %f %f %f torq %f %f %f ", force.X(), force.Y(), force.Z(), torq.X(), torq.Y(), torq.Z())); #endif // _DEBUG_AEROSURF } float fDens = 0.5*Atmosphere::GetDensity(pos0[1]); // hope that _position[1]==0 is ground level ? force *= fDens; torq *= fDens; }; // ====================================================== // CompactAeroMode2 // ====================================================== void CompactAeroModel2::FromString(const char * str) { sscanf(str, " %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f ", //&areaUp, &ARup, //&areaSide, &ARside, &_area, &_cAnisoDrag[0], &_cAnisoDrag[1], &_cAnisoDrag[2], &_cTorqDamp[0], &_cTorqDamp[1], &_cTorqDamp[2], &_cTorqControl[0], &_cTorqControl[1], &_cTorqControl[2], &_cTorqRelax[0], &_cTorqRelax[1], &_cTorqRelax[2], &(_polarFwUp._sStall), &(_polarFwUp._wStall), &(_polarFwUp._CD0), &(_polarFwUp._dCD), &(_polarFwUp._dCDS), &(_polarFwUp._dCL), &(_polarFwUp._dCLS), &(_polarFwUp._dCM), &(_polarFwUp._dCMS), &(_polarFwSide._sStall), &(_polarFwSide._wStall), &(_polarFwSide._CD0), &(_polarFwSide._dCD), &(_polarFwSide._dCDS), &(_polarFwSide._dCL), &(_polarFwSide._dCLS), &(_polarFwSide._dCM), &(_polarFwSide._dCMS) ); LogF(" ===== CompactAeroModel2::fromString \n"); LogF(" area %f C %f %f %f D %f %f %f L %f %f %f S %f %f %f \n", _area, _cAnisoDrag[0], _cAnisoDrag[1], _cAnisoDrag[2], _cTorqDamp[0], _cTorqDamp[1], _cTorqDamp[2], _cTorqControl[0], _cTorqControl[1], _cTorqControl[2], _cTorqRelax[0], _cTorqRelax[1], _cTorqRelax[2] ); LogF("polarFwUp %f %f %f %f %f %f %f %f %f \n", _polarFwUp._sStall, _polarFwUp._wStall, _polarFwUp._CD0, _polarFwUp._dCD, _polarFwUp._dCDS, _polarFwUp._dCL, _polarFwUp._dCLS, _polarFwUp._dCM, _polarFwUp._dCM); LogF("polarFwSide %f %f %f %f %f %f %f %f %f \n", _polarFwSide._sStall, _polarFwSide._wStall, _polarFwSide._CD0, _polarFwSide._dCD, _polarFwSide._dCDS, _polarFwSide._dCL, _polarFwSide._dCLS, _polarFwSide._dCM, _polarFwSide._dCM); }; void CompactAeroModel2::ApplyForce(const Vector3& vair0, const Matrix3& craftRot, const Vector3& craftOmega, Vector3& force, Vector3& torq, float elevator, float rudder, float aileron, const Vector3& pos0) const { Vector3 uair = vair0; // we shoud consider craftOmega #if _DEBUG_AEROSURF //LogF( "CompactAeroModel2::applyForce ID10: S %f %f %f L %f %f %f D %f %f %f ", S[0], S[1], S[2], L[0], L[1], L[2], D[0], D[1], D[2] ); //DIAG_MESSAGE_ID(100, 10, Format("ID10: S %f %f %f L %f %f %f D %f %f %f ", S[0], S[1], S[2], L[0], L[1], L[2], D[0], D[1], D[2])); renderer.Add3dLine(pos0, pos0 + uair * 5.0, PackedBlue); renderer.Add3dLine(pos0, pos0 + craftRot.DirectionAside() * 5.0, PackedColor(0xff808080)); renderer.Add3dLine(pos0, pos0 + craftRot.DirectionUp()*5.0, PackedBlack); renderer.Add3dLine(pos0, pos0 + craftRot.Direction()*5.0, PackedWhite); #endif // _DEBUG_AEROSURF //Vector3 uair = vair0 + gdpos.CrossProduct(craftOmega); float vrair2 = uair.SquareSize(); torq = VZero; force = VZero; if (vrair2 > lowSpeedCuoff) { float vrair = sqrt(vrair2); uair *= (1 / vrair); // decompose uair to panel coordinates float ca = uair.DotProduct(craftRot.DirectionAside()); float cb = uair.DotProduct(craftRot.DirectionUp()); float cc = uair.DotProduct(craftRot.Direction()); #if _DEBUG_AEROSURF DIAG_MESSAGE_ID(100, 11, Format("elevator %f rudder %f aileron %f ", elevator, rudder, aileron)); DIAG_MESSAGE_ID(100, 12, Format("ca %f cb %f cc %f ", ca, cb, cc)); #endif // _DEBUG_AEROSURF float prefactor = vrair2 * _area; float CD, CL, CMup, CMside; Vector3 airUp; // ==== main wing polar (lift along aircraft up vector); Pitch control { _polarFwUp.GetAeroCoefs(-cc, cb, elevator*0.25, CD, CL, CMup); if ((cb*cb) > 1e-8) { airUp = craftRot.DirectionUp() + (uair * -cb); // component of grot.Up perpendicular to uair airUp.Normalize(); } else { airUp = craftRot.DirectionUp(); } #if _DEBUG_AEROSURF renderer.Add3dLine(pos0, pos0 + airUp * 5.0, PackedGreen); #endif // _DEBUG_AEROSURF force += (airUp * CL + uair * CD) * prefactor; torq += airUp.CrossProduct(uair) * -CMup * prefactor; } // ==== keel wing polar (lift along aircraft side vector); Yaw control { _polarFwSide.GetAeroCoefs(-cc, ca, 0, CD, CL, CMside); if ((ca*ca) > 1e-8) { airUp = craftRot.DirectionAside() + (uair * -ca); // component of grot.Up perpendicular to uair airUp.Normalize(); } else { airUp = craftRot.DirectionAside(); } #if _DEBUG_AEROSURF renderer.Add3dLine(pos0, pos0 + airUp * 5.0, PackedColor(0xffff00ff)); #endif // _DEBUG_AEROSURF force += (airUp * CL + uair * CD) * prefactor * 0.2; torq += airUp.CrossProduct(uair) * -CMside * prefactor; } #if _DEBUG_AEROSURF DIAG_MESSAGE_ID(100, 13, Format(" CMup %f CMside %f ", CMup, CMside)); renderer.Add3dLine(pos0, pos0 + force * 5.0, PackedRed); #endif // _DEBUG_AEROSURF float cc2 = cc * cc; // factor used to damp torques for non-standard flight regimes ( large angle between vair and grot.Direction() ) torq += craftRot.Direction() * (_cTorqControl[2] * aileron * prefactor * cc2); // Roll control - we still don't do this by Polar // damping of aircraft rotation due to drag of control surfaces torq += craftRot.DirectionAside()* ( craftOmega.DotProduct(craftRot.DirectionAside()) * -_cTorqDamp[0] * prefactor); // pitch damp torq += craftRot.DirectionUp()* ( craftOmega.DotProduct(craftRot.DirectionUp()) * -_cTorqDamp[1] * prefactor); // yaw damp torq += craftRot.Direction()* ( craftOmega.DotProduct(craftRot.Direction()) * -_cTorqDamp[2] * prefactor); // roll damp // apply anisotropic drag coef force += craftRot.DirectionAside() * (_cAnisoDrag[0] * ca*prefactor); force += craftRot.DirectionUp() * (_cAnisoDrag[1] * cb*prefactor); force += craftRot.Direction() * (_cAnisoDrag[2] * cc*prefactor); #if _DEBUG_AEROSURF DIAG_MESSAGE_ID(100, 14, Format("force %f %f %f torq %f %f %f ", force.X(), force.Y(), force.Z(), torq.X(), torq.Y(), torq.Z())); #endif // _DEBUG_AEROSURF } float fDens = 0.5*Atmosphere::GetDensity(pos0[1]); // hope that _position[1]==0 is ground level ? force *= fDens; torq *= fDens; };
41.945378
232
0.593208
99356e10586396d15804cca3c0e4352d43ee44cf
450
cpp
C++
SHUFFLIN.cpp
Ayushi-Kosta/codechef-challenges
7adb8f93277fe4fd0f6ec9709503644e3688b0fe
[ "MIT" ]
2
2020-10-30T16:22:31.000Z
2021-10-06T14:30:07.000Z
SHUFFLIN.cpp
Ayushi-Kosta/codechef-challenges
7adb8f93277fe4fd0f6ec9709503644e3688b0fe
[ "MIT" ]
2
2021-10-08T19:49:53.000Z
2021-10-08T19:53:56.000Z
SHUFFLIN.cpp
Ayushi-Kosta/codechef-challenges
7adb8f93277fe4fd0f6ec9709503644e3688b0fe
[ "MIT" ]
9
2020-10-17T19:11:38.000Z
2021-10-19T01:55:18.000Z
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; int n; for(int i=0;i<t;i++) { cin>>n; int a[n]; int aodd=0; int aeven=0; int ieven,iodd; int ans; for(int j=1;j<=n;j++) { cin>>a[j]; if(a[j]%2==0) { aeven=aeven+1; } else { aodd=aodd+1; } } ieven=n/2; iodd=n/2; if(n%2==1) { iodd=iodd+1; } cout<<min(iodd,aeven)+min(ieven,aodd)<<endl; } return 0; }
11.25
46
0.486667
9937511dd96eb5f5b44d8fdf60832706774ce001
7,997
cc
C++
src/jumandic/shared/lattice_format.cc
HarukaMa/jumanpp
9e7ca75ecf79c596c86731f63e1e07a8b45076de
[ "Apache-2.0" ]
300
2016-10-19T02:20:39.000Z
2022-02-23T19:58:04.000Z
src/jumandic/shared/lattice_format.cc
HarukaMa/jumanpp
9e7ca75ecf79c596c86731f63e1e07a8b45076de
[ "Apache-2.0" ]
130
2016-10-17T07:57:14.000Z
2022-03-20T17:37:13.000Z
src/jumandic/shared/lattice_format.cc
HarukaMa/jumanpp
9e7ca75ecf79c596c86731f63e1e07a8b45076de
[ "Apache-2.0" ]
36
2016-10-19T11:47:05.000Z
2022-01-25T09:36:12.000Z
// // Created by Arseny Tolmachev on 2017/07/21. // #include "lattice_format.h" #include "core/analysis/analyzer_impl.h" #include "util/logging.hpp" namespace jumanpp { namespace jumandic { namespace output { Status LatticeFormatInfo::fillInfo(const core::analysis::Analyzer& an, i32 topN) { auto ai = an.impl(); auto lat = ai->lattice(); info.clear_no_resize(); if (lat->createdBoundaryCount() <= 3) { return Status::Ok(); } auto eosBnd = lat->boundary(lat->createdBoundaryCount() - 1); auto eosBeam = eosBnd->starts()->beamData(); auto maxN = std::min<i32>(eosBeam.size(), topN); for (int i = 0; i < maxN; ++i) { auto el = eosBeam.at(i); if (core::analysis::EntryBeam::isFake(el)) { break; } auto ptr = el.ptr.previous; while (ptr->boundary >= 2) { info[ptr->latticeNodePtr()].addElem(*ptr, i); ptr = ptr->previous; } } return Status::Ok(); } void LatticeFormatInfo::publishResult(std::vector<LatticeInfoView>* view) { view->clear(); view->reserve(info.size()); for (auto& pair : info) { view->push_back({pair.first, &pair.second}); pair.second.fixPrevs(); } std::sort(view->begin(), view->end(), [](const LatticeInfoView& v1, const LatticeInfoView& v2) { if (v1.nodePtr().boundary == v2.nodePtr().boundary) { return v1.nodePtr().position < v2.nodePtr().position; } return v1.nodePtr().boundary < v2.nodePtr().boundary; }); i32 firstId = 1; for (auto& v : *view) { v.assignId(firstId); ++firstId; } } i32 LatticeFormatInfo::idOf(LatticeNodePtr ptr) const { auto iter = info.find(ptr); if (iter != info.end()) { return iter->second.id; } return 0; } namespace { StringPiece escapeTab(StringPiece sp) { if (sp.size() == 1 && sp[0] == '\t') { return StringPiece("\\t"); } return sp; } } // namespace Status LatticeFormat::format(const core::analysis::Analyzer& analyzer, StringPiece comment) { printer.reset(); auto lat = analyzer.impl()->lattice(); if (lat->createdBoundaryCount() == 3) { printer.reset(); printer << "EOS\n"; return Status::Ok(); } i32 outputN = this->topN; if (analyzer.impl()->cfg().autoBeamStep > 0) { outputN = analyzer.impl()->autoBeamSizes(); } JPP_RETURN_IF_ERROR(latticeInfo.fillInfo(analyzer, outputN)); latticeInfo.publishResult(&infoView); auto& om = analyzer.output(); auto& f = flds; if (!comment.empty()) { printer << "# " << comment << '\n'; } else { printer << "# MA-SCORE\t"; auto eos = lat->boundary(lat->createdBoundaryCount() - 1); auto eosBeam = eos->starts()->beamData(); for (int i = 0; i < outputN; ++i) { auto& bel = eosBeam.at(i); if (core::analysis::EntryBeam::isFake(bel)) { break; } printer << "rank" << (i + 1) << ':' << bel.totalScore << ' '; } printer << '\n'; } for (auto& n : infoView) { if (!om.locate(n.nodePtr(), &walker)) { return Status::InvalidState() << "failed to locate node: " << n.nodePtr().boundary << ":" << n.nodePtr().position; } auto& weights = analyzer.scorer()->scoreWeights; auto ptrit = std::max_element( n.nodeInfo().ptrs.begin(), n.nodeInfo().ptrs.end(), [lat, &weights](const core::analysis::ConnectionPtr& p1, const core::analysis::ConnectionPtr& p2) { auto s1 = lat->boundary(p1.boundary)->scores()->forPtr(p1); auto s2 = lat->boundary(p2.boundary)->scores()->forPtr(p2); float total1 = 0, total2 = 0; for (size_t i = 0; i < weights.size(); ++i) { total1 += s1[i] * weights[i]; total2 += s2[i] * weights[i]; } return total1 > total2; }); auto& cptr = *ptrit; auto bnd = lat->boundary(cptr.boundary); auto& ninfo = bnd->starts()->nodeInfo().at(cptr.right); while (walker.next()) { printer << "-\t"; printer << n.nodeInfo().id << '\t'; auto& prevs = n.nodeInfo().prev; for (size_t i = 0; i < prevs.size(); ++i) { auto id = latticeInfo.idOf(prevs[i]); printer << id; if (i != prevs.size() - 1) { printer << ';'; } } printer << '\t'; auto position = cptr.boundary - 2; // we have 2 BOS printer << position << '\t'; printer << position + ninfo.numCodepoints() - 1 << '\t'; printer << escapeTab(f.surface[walker]) << '\t'; auto canFrm = f.canonicForm[walker]; if (!canFrm.empty()) { printer << f.canonicForm[walker]; } else { printer << f.baseform[walker] << '/' << f.reading[walker]; } printer << '\t'; printer << escapeTab(f.reading[walker]) << '\t'; printer << escapeTab(f.baseform[walker]) << '\t'; auto fieldBuffer = walker.features(); JumandicPosId rawId{fieldBuffer[1], fieldBuffer[2], fieldBuffer[4], // conjForm and conjType are reversed fieldBuffer[3]}; auto newId = idResolver.dicToJuman(rawId); printer << f.pos[walker] << '\t' << newId.pos << '\t'; printer << ifEmpty(f.subpos[walker], "*") << '\t' << newId.subpos << '\t'; printer << ifEmpty(f.conjType[walker], "*") << '\t' << newId.conjType << '\t'; printer << ifEmpty(f.conjForm[walker], "*") << '\t' << newId.conjForm << '\t'; auto features = f.features[walker]; while (features.next()) { printer << features.key(); if (features.hasValue()) { printer << ':' << features.value(); } printer << '|'; } auto eptr = walker.eptr(); if (eptr.isSpecial()) { auto v = om.valueOfUnkPlaceholder(eptr, jumandic::NormalizedPlaceholderIdx); if (v != 0) { formatNormalizedFeature(printer, v); printer << "|"; } } auto conn = bnd->scores(); auto scores = conn->forPtr(cptr); JPP_DCHECK_GE(weights.size(), 1); float totalScore = scores[0] * weights[0]; printer << "特徴量スコア:" << totalScore << '|'; if (weights.size() == 2) { // have RNN float rnnScore = scores[1] * weights[1]; printer << "言語モデルスコア:" << rnnScore << '|'; totalScore += rnnScore; } printer << "形態素解析スコア:" << totalScore << '|'; printer << "ランク:"; auto& ranks = n.nodeInfo().ranks; for (size_t i = 0; i < ranks.size(); ++i) { printer << ranks[i] + 1; if (i != ranks.size() - 1) { printer << ';'; } } printer << '\n'; } } printer << "EOS\n"; return Status::Ok(); } StringPiece LatticeFormat::result() const { return printer.result(); } Status LatticeFormat::initialize(const core::analysis::OutputManager& om) { LOG_TRACE() << "Initializing Lattice format, topn=" << topN; JPP_RETURN_IF_ERROR(flds.initialize(om)); JPP_RETURN_IF_ERROR(idResolver.initialize(om.dic())); return Status::Ok(); } LatticeFormat::LatticeFormat(i32 topN) : topN(topN) { printer.reserve(16 * 1024); } void LatticeNodeInfo::addElem(const core::analysis::ConnectionPtr& cptr, i32 rank) { ranks.push_back(static_cast<u16>(rank)); ptrs.insert(cptr); auto prevptr = cptr.previous->latticeNodePtr(); if (std::find(prev.begin(), prev.end(), prevptr) == prev.end()) { prev.push_back(prevptr); } } void LatticeNodeInfo::fixPrevs() { if (prev.size() > 1) { std::sort(prev.begin(), prev.end(), [](const LatticeNodePtr& p1, const LatticeNodePtr& p2) { if (p1.boundary == p2.boundary) return p1.position < p2.position; return p1.boundary < p2.boundary; }); } } } // namespace output } // namespace jumandic } // namespace jumanpp
28.663082
80
0.549706
9937f50614e6ba984a31acd400bde0a8bf8dc7e1
8,221
cpp
C++
ch06/6.exercise.10.cpp
0p3r4t4/PPPUCPP2nd
cf1bd23bb22ee00a77172e43678b7eaa91f592e0
[ "MIT" ]
51
2017-03-24T06:08:11.000Z
2022-03-18T00:28:14.000Z
ch06/6.exercise.10.cpp
0p3r4t4/PPPUCPP2nd
cf1bd23bb22ee00a77172e43678b7eaa91f592e0
[ "MIT" ]
1
2019-06-23T07:33:42.000Z
2019-12-12T13:14:04.000Z
ch06/6.exercise.10.cpp
0p3r4t4/PPPUCPP2nd
cf1bd23bb22ee00a77172e43678b7eaa91f592e0
[ "MIT" ]
25
2017-04-07T13:22:45.000Z
2022-03-18T00:28:15.000Z
// 6.exercise.10.cpp // // A permutation is an ordered subset of a set. For example, say you wanted to // pick a combination to a vault. There are 60 possible numbers, and you need // three different numbers for the combination. There are P(60,3) permutations // for the combination, where P is defined by the formula // // a! // P(a,b) = ------, // (a-b)! // // where ! is used as a suffix factorial operator. For example, 4! is // 4*3*2*1. // // Combinations are similar to permutations, except that the order of the // objects doesn't matter. For example, if you were making a "banana split" // sundea and wished to use three different flavors of ice cream out of five // that you had, you wouldn't care if you used a scoop of vanilla at the // beginning or the end; you would still have used vanilla. The formula for // combination is // // P(a,b) // C(a,b) = ------. // b! // // Design a program that asks users for two numbers, asks them whether they // want to calculate permutations or combinations, and prints out the result. // This will have several parts. Do an analysis of the above requeriments. // Write exactly what the program will have to do. Then go into design phase. // Write pseudo code for the program, and break it into sub-components. This // program should have error checking. Make sure that all erroneous inputs will // generate good error messages // // Comments: See 6.exercise.10.md #include "std_lib_facilities.h" const string err_msg_pmul_with_negs = "called with negative integers."; const string err_msg_nk_precon = "n and k parameters relationship precondition violated."; const string err_msg_product_overflows = "integer multiplication overflows."; const string err_msg_eoi = "Unexpected end of input."; const string err_msg_main_bad_option = "Bad option parsing."; const string msg_setc_get = "Set cardinality (n)? "; const string msg_subc_get = "Subset cardinality (n)? "; const string msg_calc_option = "What type of calculation do you want? (p)ermutation, (c)ombination or (b)oth? "; const string msg_again_option = "Do you want to perform a new calculation (y/n)? "; bool is_in(const char c, const vector<char>& v) // Returns true if character c is contained in vector<char> v and returns false // otherwise. { for (char cv : v) if (cv == c) return true; return false; } int get_natural(const string& msg) // Asks the user (printing the message msg) for a positive integer. // It keeps asking until a positive integer is entered or EOF is reached // or signaled, in which case it throws an error. // Tries to read an integer ignoring the rest of the line, whatever it is, and // despite that read has been successful or not. { int n = 0; for (;;) { cout << msg; cin >> n; if (cin) { cin.ignore(numeric_limits<streamsize>::max(), '\n'); if (n < 0) cout << n << " is not a positive integer.\n"; else return n; } else if (!cin.eof()) { cout << "Your input is not a number.\n"; cin.clear(); cin.ignore(numeric_limits<streamsize>::max(), '\n'); } else { error("get_natural(): " + err_msg_eoi); } } } char get_option(const string& msg, const vector<char>& v) // Asks the user (printing the message msg) for a char value (option). // It keeps asking until the answer is a char value that is present in vector // v or EOF is reached or signales, in which case it throws and error. // Only the first character of a line is considered, ignoring the rest of it. { char c = 0; for (;;) { cout << msg; cin >> c; if (cin) { cin.ignore(numeric_limits<streamsize>::max(), '\n'); if (!is_in(c, v)) cout << c << " is not a valid option.\n"; else return c; } else { // If cin fails reading a char, I guess the only way is to // have reached end of input. I could be mistaken, though. error("get_option(): " + err_msg_eoi); } } } bool check_pmul(int a, int b) // Partial implementation not using larger integer type and only for // positive integers, from https://www.securecoding.cert.org INT32C. // Is its work to tell if multiplication could // be performed or not. // Precondition: // Both arguments must be positive. { if (a < 0 || b < 0) error("check_pmul(): " + err_msg_pmul_with_negs); return !( a > (numeric_limits<int>::max() / b) ); } int perm(int n, int k) // Calculates the k-permutations of n elements, what we call P(n, k). // This is not done with the factorial formula expressed in the statement but // with a limited product. See 6.exercise.10.md for details. // If either n or k equals zero, the permutation is 1. // // Preconditions: // - n and k must be positive and n >= k. It's very unlikely to happen // otherwise since we assume it is assured by previous calls to // get_natural(), but to maintain good habits ... { if (n < 0 || k < 0 || n < k) error("perm(): " + err_msg_nk_precon); if (n == 0 || k == 0) return 1; int prod = 1; for (int i = n-k+1; i <= n; ++i) if (check_pmul(prod, i)) prod *= i; else error("perm(): " + err_msg_product_overflows); return prod; } int comb(int n, int k) // Calculates the k-combinations of n elements, what we call C(n, k). // This is not done with the factorial formula expressed in the statement but, // being the k-combinations of n element also known as the binomial // coefficient, using the multiplicative formula as stated in // https://en.wikipedia.org/wiki/Binomial_coefficient#Multiplicative_formula // If either n or k equals zero, the combination is 1. // // Preconditions: // - n and k must be positive and n >= k. It's very unlikely to happen // otherwise since we assume it is assured by previous calls to // get_natural(), but to maintain good habits ... { if (n < 0 || k < 0 || n < k) error("perm(): " + err_msg_nk_precon); if (n == 0 || k == 0) return 1; int prod = 1; for (int i = 1; i <= k; ++i) if (check_pmul(prod, n+1-i)) // Multiplying first by the numerator ensure the division to have // no reminder. prod = (prod * (n+1-i)) / i; else error("comb(): " + err_msg_product_overflows); return prod; } int main() try { const vector<char> calc_options = {'p', 'P', 'c', 'C', 'b', 'B'}; const vector<char> again_options = {'y', 'Y', 'n', 'N'}; cout << "Calculator for k-permutation and k-combination of n elements\n" "without repetition. Beware of large numbers, the calculator\n" "is very limited.\n"; while (cin) { cout << endl; int setc = get_natural(msg_setc_get); int subc = get_natural(msg_subc_get); char option = get_option(msg_calc_option, calc_options); switch(option) { case 'p': case 'P': cout << " P(" << setc << ", " << subc << ") = " << perm(setc, subc) << '\n'; break; case 'c': case 'C': cout << " C(" << setc << ", " << subc << ") = " << comb(setc, subc) << '\n'; break; case 'b': case 'B': cout << " P(" << setc << ", " << subc << ") = " << perm(setc, subc) << '\n'; cout << " C(" << setc << ", " << subc << ") = " << comb(setc, subc) << '\n'; break; default: error("main(): " + err_msg_main_bad_option); } option = get_option(msg_again_option, again_options); if (option == 'n' || option == 'N') break; } cout << "\nBye!\n\n"; return 0; } catch(exception& e) { cerr << e.what() << '\n'; return 1; } catch(...) { cerr << "Oops! Unknown exception.\n"; return 2; }
33.971074
112
0.585452
993c39b4a2928028fd47a4e72fb468df81a7ecff
2,598
cpp
C++
Source/GUI/VintageToggleButton.cpp
grhn/gold-rush-filter
7b91dc5c44bc1acb46804638c357f8e240becdc3
[ "MIT" ]
1
2019-09-08T19:57:22.000Z
2019-09-08T19:57:22.000Z
Source/GUI/VintageToggleButton.cpp
grhn/gold-rush-filter
7b91dc5c44bc1acb46804638c357f8e240becdc3
[ "MIT" ]
null
null
null
Source/GUI/VintageToggleButton.cpp
grhn/gold-rush-filter
7b91dc5c44bc1acb46804638c357f8e240becdc3
[ "MIT" ]
null
null
null
// // VintageToggleButton.cpp // GoldRush // // Created by Tommi Gröhn on 26.10.2015. // // #include "VintageToggleButton.h" VintageToggleButton::VintageToggleButton (Colour baseColour, Colour switchColour) : baseColour (baseColour), switchColour (switchColour) { } void VintageToggleButton::setLabel (String s) { label = s; } void VintageToggleButton::paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) { const float w = getWidth(); const float h = getHeight(); const float rounding = 2.0f; const float edgeSize = 2.0f; // Draw base { Path p; g.setGradientFill(ColourGradient(Colours::darkgrey, 0, 0, Colours::black, 0 + w / 8.0, h, false)); p.addRoundedRectangle (0, 0, w, h, rounding, rounding, rounding, rounding, rounding, rounding); g.fillPath (p); g.fillPath (p); } // Draw button { Path p; if (getToggleState()) { g.setGradientFill(ColourGradient(Colours::red, w / 2, h / 3, Colours::darkred.darker(), 0, h, true)); p.addRoundedRectangle (edgeSize, edgeSize, w - edgeSize * 2.0, h - edgeSize * 2.0, rounding, rounding, rounding, rounding, rounding, rounding); g.fillPath (p); } else { g.setGradientFill(ColourGradient(Colours::red.withBrightness (0.3), 0, 0, Colours::red.withBrightness (0.1), 0, h, false)); p.addRoundedRectangle (edgeSize, edgeSize, w - edgeSize * 2.0, h - edgeSize * 2.0, rounding, rounding, rounding, rounding, rounding, rounding); g.fillPath (p); } } // Draw label on top of button { const float margin = 2.0; g.setFont (goldRushFonts::logoFont.withHeight(14.0f)); g.setColour (Colours::antiquewhite); g.drawFittedText (getName(), Rectangle<int> (margin, margin, getWidth() - 2.0 * margin, getHeight() - 2.0 * margin), Justification::centred, 2); } }
32.475
136
0.469977
9945af9d2f759ea6e140d9addac71d3923741a56
1,534
cpp
C++
2011-codeforces-saratov-school-regional/d_three-sons.cpp
galenhwang/acm-problems
304e11a144c5589c6d9e493b05ad228f20619686
[ "MIT" ]
null
null
null
2011-codeforces-saratov-school-regional/d_three-sons.cpp
galenhwang/acm-problems
304e11a144c5589c6d9e493b05ad228f20619686
[ "MIT" ]
null
null
null
2011-codeforces-saratov-school-regional/d_three-sons.cpp
galenhwang/acm-problems
304e11a144c5589c6d9e493b05ad228f20619686
[ "MIT" ]
null
null
null
#include <stdio.h> #include <iostream> #include <algorithm> using namespace std; int get (int accumTotal[], int first, int last) { int permVal = accumTotal[last]; if (first > 0) permVal -= accumTotal[first-1]; return permVal; } int numWays(int len, int accumTotal[], int sons[]) { int val = 0; for(int i = 0; i < len; i++) { for(int j = i + 1; j < len - 1; j++) { int perm[3] = { get(accumTotal, 0, i),get(accumTotal, i+1,j), get(accumTotal, j+1,len-1) }; sort(perm, perm+3); if(perm[0] == sons[0] && perm[1] == sons[1] && perm[2] == sons[2]) val++; } } return val; } int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int n, m; cin >> n >> m; int count = 0; int accumRowTotals[n]; int accumColTotals[m]; for (int i = 0; i < n; i++) { accumRowTotals[i] = 0; for (int j = 0; j < m; j++) { if (i == 0) accumColTotals[j] = 0; int val; cin >> val; accumRowTotals[i] += val; accumColTotals[j] += val; } if (i > 0) accumRowTotals[i] += accumRowTotals[i-1]; } for (int j = 0; j < m; j++) { if (j > 0) accumColTotals[j] += accumColTotals[j-1]; } int sons[3]; for (int i = 0; i < 3; i++) { cin >> sons[i]; } sort(sons, sons+3); cout << numWays(m, accumColTotals, sons) + numWays(n, accumRowTotals, sons) << endl; }
26.912281
88
0.483703
994640bbfd3c68da9bda39bdace3ff969b0a97f9
177,106
cc
C++
src/bin/dhcp4/dhcp4_lexer.cc
mcr/kea
7fbbfde2a0742a3d579d51ec94fc9b91687fb901
[ "Apache-2.0" ]
1
2019-08-10T21:52:58.000Z
2019-08-10T21:52:58.000Z
src/bin/dhcp4/dhcp4_lexer.cc
jxiaobin/kea
1987a50a458921f9e5ac84cb612782c07f3b601d
[ "Apache-2.0" ]
null
null
null
src/bin/dhcp4/dhcp4_lexer.cc
jxiaobin/kea
1987a50a458921f9e5ac84cb612782c07f3b601d
[ "Apache-2.0" ]
null
null
null
#line 1 "dhcp4_lexer.cc" #line 3 "dhcp4_lexer.cc" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ /* %not-for-header */ /* %if-c-only */ /* %if-not-reentrant */ #define yy_create_buffer parser4__create_buffer #define yy_delete_buffer parser4__delete_buffer #define yy_scan_buffer parser4__scan_buffer #define yy_scan_string parser4__scan_string #define yy_scan_bytes parser4__scan_bytes #define yy_init_buffer parser4__init_buffer #define yy_flush_buffer parser4__flush_buffer #define yy_load_buffer_state parser4__load_buffer_state #define yy_switch_to_buffer parser4__switch_to_buffer #define yypush_buffer_state parser4_push_buffer_state #define yypop_buffer_state parser4_pop_buffer_state #define yyensure_buffer_stack parser4_ensure_buffer_stack #define yy_flex_debug parser4__flex_debug #define yyin parser4_in #define yyleng parser4_leng #define yylex parser4_lex #define yylineno parser4_lineno #define yyout parser4_out #define yyrestart parser4_restart #define yytext parser4_text #define yywrap parser4_wrap #define yyalloc parser4_alloc #define yyrealloc parser4_realloc #define yyfree parser4_free /* %endif */ /* %endif */ /* %ok-for-header */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* %if-c++-only */ /* %endif */ /* %if-c-only */ #ifdef yy_create_buffer #define parser4__create_buffer_ALREADY_DEFINED #else #define yy_create_buffer parser4__create_buffer #endif #ifdef yy_delete_buffer #define parser4__delete_buffer_ALREADY_DEFINED #else #define yy_delete_buffer parser4__delete_buffer #endif #ifdef yy_scan_buffer #define parser4__scan_buffer_ALREADY_DEFINED #else #define yy_scan_buffer parser4__scan_buffer #endif #ifdef yy_scan_string #define parser4__scan_string_ALREADY_DEFINED #else #define yy_scan_string parser4__scan_string #endif #ifdef yy_scan_bytes #define parser4__scan_bytes_ALREADY_DEFINED #else #define yy_scan_bytes parser4__scan_bytes #endif #ifdef yy_init_buffer #define parser4__init_buffer_ALREADY_DEFINED #else #define yy_init_buffer parser4__init_buffer #endif #ifdef yy_flush_buffer #define parser4__flush_buffer_ALREADY_DEFINED #else #define yy_flush_buffer parser4__flush_buffer #endif #ifdef yy_load_buffer_state #define parser4__load_buffer_state_ALREADY_DEFINED #else #define yy_load_buffer_state parser4__load_buffer_state #endif #ifdef yy_switch_to_buffer #define parser4__switch_to_buffer_ALREADY_DEFINED #else #define yy_switch_to_buffer parser4__switch_to_buffer #endif #ifdef yypush_buffer_state #define parser4_push_buffer_state_ALREADY_DEFINED #else #define yypush_buffer_state parser4_push_buffer_state #endif #ifdef yypop_buffer_state #define parser4_pop_buffer_state_ALREADY_DEFINED #else #define yypop_buffer_state parser4_pop_buffer_state #endif #ifdef yyensure_buffer_stack #define parser4_ensure_buffer_stack_ALREADY_DEFINED #else #define yyensure_buffer_stack parser4_ensure_buffer_stack #endif #ifdef yylex #define parser4_lex_ALREADY_DEFINED #else #define yylex parser4_lex #endif #ifdef yyrestart #define parser4_restart_ALREADY_DEFINED #else #define yyrestart parser4_restart #endif #ifdef yylex_init #define parser4_lex_init_ALREADY_DEFINED #else #define yylex_init parser4_lex_init #endif #ifdef yylex_init_extra #define parser4_lex_init_extra_ALREADY_DEFINED #else #define yylex_init_extra parser4_lex_init_extra #endif #ifdef yylex_destroy #define parser4_lex_destroy_ALREADY_DEFINED #else #define yylex_destroy parser4_lex_destroy #endif #ifdef yyget_debug #define parser4_get_debug_ALREADY_DEFINED #else #define yyget_debug parser4_get_debug #endif #ifdef yyset_debug #define parser4_set_debug_ALREADY_DEFINED #else #define yyset_debug parser4_set_debug #endif #ifdef yyget_extra #define parser4_get_extra_ALREADY_DEFINED #else #define yyget_extra parser4_get_extra #endif #ifdef yyset_extra #define parser4_set_extra_ALREADY_DEFINED #else #define yyset_extra parser4_set_extra #endif #ifdef yyget_in #define parser4_get_in_ALREADY_DEFINED #else #define yyget_in parser4_get_in #endif #ifdef yyset_in #define parser4_set_in_ALREADY_DEFINED #else #define yyset_in parser4_set_in #endif #ifdef yyget_out #define parser4_get_out_ALREADY_DEFINED #else #define yyget_out parser4_get_out #endif #ifdef yyset_out #define parser4_set_out_ALREADY_DEFINED #else #define yyset_out parser4_set_out #endif #ifdef yyget_leng #define parser4_get_leng_ALREADY_DEFINED #else #define yyget_leng parser4_get_leng #endif #ifdef yyget_text #define parser4_get_text_ALREADY_DEFINED #else #define yyget_text parser4_get_text #endif #ifdef yyget_lineno #define parser4_get_lineno_ALREADY_DEFINED #else #define yyget_lineno parser4_get_lineno #endif #ifdef yyset_lineno #define parser4_set_lineno_ALREADY_DEFINED #else #define yyset_lineno parser4_set_lineno #endif #ifdef yywrap #define parser4_wrap_ALREADY_DEFINED #else #define yywrap parser4_wrap #endif /* %endif */ #ifdef yyalloc #define parser4_alloc_ALREADY_DEFINED #else #define yyalloc parser4_alloc #endif #ifdef yyrealloc #define parser4_realloc_ALREADY_DEFINED #else #define yyrealloc parser4_realloc #endif #ifdef yyfree #define parser4_free_ALREADY_DEFINED #else #define yyfree parser4_free #endif /* %if-c-only */ #ifdef yytext #define parser4_text_ALREADY_DEFINED #else #define yytext parser4_text #endif #ifdef yyleng #define parser4_leng_ALREADY_DEFINED #else #define yyleng parser4_leng #endif #ifdef yyin #define parser4_in_ALREADY_DEFINED #else #define yyin parser4_in #endif #ifdef yyout #define parser4_out_ALREADY_DEFINED #else #define yyout parser4_out #endif #ifdef yy_flex_debug #define parser4__flex_debug_ALREADY_DEFINED #else #define yy_flex_debug parser4__flex_debug #endif #ifdef yylineno #define parser4_lineno_ALREADY_DEFINED #else #define yylineno parser4_lineno #endif /* %endif */ /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ /* %if-c-only */ #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> /* %endif */ /* %if-tables-serialization */ /* %endif */ /* end standard C headers. */ /* %if-c-or-c++ */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include <inttypes.h> typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* %endif */ /* begin standard C++ headers. */ /* %if-c++-only */ /* %endif */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* %not-for-header */ /* Returned upon end-of-file. */ #define YY_NULL 0 /* %ok-for-header */ /* %not-for-header */ /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* %ok-for-header */ /* %if-reentrant */ /* %endif */ /* %if-not-reentrant */ /* %endif */ /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif /* %if-not-reentrant */ extern int yyleng; /* %endif */ /* %if-c-only */ /* %if-not-reentrant */ extern FILE *yyin, *yyout; /* %endif */ /* %endif */ #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { /* %if-c-only */ FILE *yy_input_file; /* %endif */ /* %if-c++-only */ /* %endif */ char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ /* %if-not-reentrant */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* %endif */ /* %ok-for-header */ /* %endif */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* %if-c-only Standard (non-C++) definition */ /* %if-not-reentrant */ /* %not-for-header */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; /* %ok-for-header */ /* %endif */ void yyrestart ( FILE *input_file ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); void yy_delete_buffer ( YY_BUFFER_STATE b ); void yy_flush_buffer ( YY_BUFFER_STATE b ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); void yypop_buffer_state ( void ); static void yyensure_buffer_stack ( void ); static void yy_load_buffer_state ( void ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); /* %endif */ void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ /* Begin user sect3 */ #define parser4_wrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define FLEX_DEBUG typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr yytext /* %% [1.5] DFA */ /* %if-c-only Standard (non-C++) definition */ static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); static void yynoreturn yy_fatal_error ( const char* msg ); /* %endif */ /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ (yy_c_buf_p) = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ #define YY_NUM_RULES 175 #define YY_END_OF_BUFFER 176 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static const flex_int16_t yy_accept[1468] = { 0, 168, 168, 0, 0, 0, 0, 0, 0, 0, 0, 176, 174, 10, 11, 174, 1, 168, 165, 168, 168, 174, 167, 166, 174, 174, 174, 174, 174, 161, 162, 174, 174, 174, 163, 164, 5, 5, 5, 174, 174, 174, 10, 11, 0, 0, 157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 168, 168, 0, 167, 168, 3, 2, 6, 0, 168, 0, 0, 0, 0, 0, 0, 4, 0, 0, 9, 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 171, 0, 170, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 0, 136, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 172, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 0, 140, 0, 0, 0, 0, 0, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 30, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 12, 145, 0, 142, 0, 141, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 77, 0, 0, 0, 0, 82, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 98, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 22, 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, 129, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 106, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 154, 0, 57, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 126, 0, 124, 0, 118, 117, 0, 46, 0, 21, 0, 0, 0, 0, 0, 139, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 15, 0, 40, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 51, 0, 0, 99, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 63, 0, 148, 0, 147, 0, 153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 45, 0, 0, 0, 0, 156, 85, 27, 0, 0, 47, 116, 0, 0, 0, 151, 121, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 24, 0, 127, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 105, 0, 0, 0, 26, 0, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 20, 155, 55, 0, 149, 144, 28, 0, 0, 16, 0, 0, 133, 0, 0, 0, 0, 0, 0, 113, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 134, 13, 0, 0, 0, 0, 0, 122, 0, 0, 0, 0, 0, 0, 119, 0, 0, 0, 0, 0, 112, 0, 19, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, 0, 48, 0, 0, 43, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 0, 86, 0, 0, 0, 0, 0, 0, 109, 114, 52, 0, 0, 0, 0, 108, 0, 0, 135, 0, 0, 0, 0, 0, 75, 0, 0, 110, 0 } ; static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, 7, 5, 5, 5, 5, 5, 5, 8, 9, 10, 11, 12, 13, 14, 14, 14, 14, 15, 14, 16, 14, 14, 14, 17, 5, 18, 5, 19, 20, 5, 21, 22, 23, 24, 25, 26, 5, 27, 5, 28, 5, 29, 5, 30, 31, 32, 5, 33, 34, 35, 36, 37, 38, 5, 39, 5, 40, 41, 42, 5, 43, 5, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 5, 71, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 } ; static const YY_CHAR yy_meta[72] = { 0, 1, 1, 2, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 } ; static const flex_int16_t yy_base[1480] = { 0, 0, 70, 19, 29, 41, 49, 52, 58, 87, 95, 1830, 1831, 32, 1826, 141, 0, 201, 1831, 206, 88, 11, 213, 1831, 1808, 114, 25, 2, 6, 1831, 1831, 73, 11, 17, 1831, 1831, 1831, 104, 1814, 1769, 0, 1806, 107, 1821, 217, 247, 1831, 1765, 185, 1764, 1770, 93, 58, 1762, 91, 211, 195, 14, 273, 195, 1761, 181, 275, 207, 211, 76, 68, 188, 1770, 232, 219, 296, 284, 280, 1753, 204, 302, 322, 305, 1772, 0, 349, 357, 370, 377, 362, 1831, 0, 1831, 301, 342, 296, 325, 201, 346, 359, 224, 1831, 1769, 1808, 1831, 353, 1831, 390, 1797, 357, 1755, 1765, 369, 220, 1760, 362, 288, 364, 374, 221, 1803, 0, 441, 366, 1747, 1744, 1748, 1744, 1752, 360, 1748, 1737, 1738, 76, 1754, 1737, 1746, 1746, 365, 1737, 365, 1738, 1736, 357, 1782, 1786, 1728, 1779, 1721, 1744, 1741, 1741, 1735, 268, 1728, 1721, 1726, 1720, 371, 1731, 1724, 1715, 1714, 1728, 379, 1714, 384, 1730, 1707, 415, 387, 419, 1728, 1725, 1726, 1724, 390, 1706, 1708, 420, 1700, 1717, 1709, 0, 386, 439, 425, 396, 440, 453, 1708, 1831, 0, 1751, 460, 1698, 1701, 437, 452, 1709, 458, 1752, 466, 1751, 462, 1750, 1831, 506, 1749, 472, 1710, 1702, 1689, 1705, 1702, 1701, 1692, 448, 1741, 1735, 1701, 1680, 1688, 1683, 1697, 1693, 1681, 1693, 1693, 1684, 1668, 1672, 1685, 1687, 1684, 1676, 1666, 1684, 1831, 1679, 1682, 1663, 1662, 1712, 1661, 1671, 1674, 496, 1670, 1658, 1669, 1705, 1652, 1708, 1645, 1660, 489, 1650, 1666, 1647, 1646, 1652, 1643, 1642, 1649, 1697, 1655, 1654, 1648, 77, 1655, 1650, 1642, 1632, 1647, 1646, 1641, 1645, 1626, 1642, 1628, 1634, 1641, 1629, 492, 1622, 1636, 1677, 1638, 485, 1629, 477, 1831, 1831, 485, 1831, 1831, 1616, 0, 456, 473, 1618, 520, 490, 1672, 1625, 484, 1831, 1670, 1831, 1664, 548, 1831, 474, 1606, 1615, 1661, 1607, 1613, 1663, 1620, 1615, 1618, 479, 1831, 1616, 1658, 1613, 1610, 528, 1616, 1654, 1648, 1603, 1598, 1595, 1644, 1603, 1592, 1608, 1640, 1588, 554, 1602, 1587, 1600, 1587, 1597, 1592, 1599, 1594, 1590, 496, 1588, 1591, 1586, 1582, 1630, 488, 1624, 1831, 1623, 1575, 1574, 1573, 1566, 1568, 1572, 1561, 1574, 518, 1619, 1574, 1571, 1831, 1574, 1563, 1563, 1575, 518, 1550, 1551, 1572, 529, 1554, 1603, 1550, 1564, 1563, 1549, 1561, 1560, 1559, 1558, 380, 1599, 1598, 1831, 1542, 1541, 572, 1554, 1831, 1831, 1553, 0, 1542, 1534, 525, 1539, 1590, 1589, 1547, 1587, 1831, 1535, 1585, 1831, 556, 603, 542, 1584, 1528, 1539, 1535, 1523, 1831, 1528, 1534, 1537, 1536, 1523, 1522, 1831, 1524, 1521, 538, 1519, 1521, 1831, 1529, 1526, 1511, 1524, 1519, 578, 1526, 1514, 1507, 1556, 1831, 1505, 1521, 1553, 1516, 1513, 1514, 1516, 1548, 1501, 1496, 1495, 1544, 1490, 1505, 1483, 1490, 1495, 1543, 1831, 1490, 1486, 1484, 1493, 1487, 1494, 1478, 1478, 1488, 1491, 1480, 1475, 1831, 1530, 1831, 1474, 1485, 1470, 1475, 1484, 1478, 1472, 1481, 1521, 1515, 1479, 1462, 1462, 1457, 1477, 1452, 1458, 1457, 1465, 1469, 1452, 1508, 1450, 1464, 1453, 1831, 1831, 1453, 1451, 1831, 1462, 1496, 1458, 0, 1442, 1459, 1497, 1447, 1831, 1831, 1444, 1831, 1450, 1831, 551, 569, 595, 1831, 1447, 1446, 1434, 1485, 1432, 1483, 1430, 1429, 1436, 1429, 1441, 1440, 1440, 1422, 1427, 1468, 1435, 1427, 1470, 1416, 1432, 1431, 1831, 1416, 1413, 1469, 1426, 1418, 1424, 1415, 1423, 1408, 1424, 1406, 1420, 520, 1402, 1396, 1401, 1416, 1413, 1414, 1411, 1452, 1409, 1831, 1395, 1397, 1406, 1404, 1441, 1440, 1393, 562, 1402, 1385, 1386, 1383, 1831, 1397, 1376, 1395, 1387, 1430, 1384, 1391, 1427, 1831, 1374, 1388, 1372, 1386, 1389, 1370, 1420, 1419, 1418, 1365, 1416, 1415, 1831, 14, 1377, 1377, 1375, 1358, 1363, 1365, 1831, 1371, 1361, 1831, 1406, 1354, 1409, 568, 501, 1352, 1350, 1357, 1400, 562, 1404, 544, 1398, 1397, 1396, 1350, 1340, 1393, 1346, 1354, 1355, 1389, 1352, 1346, 1333, 1341, 1384, 1388, 1345, 1344, 1831, 1345, 1338, 1327, 1340, 1343, 1338, 1339, 1336, 1335, 1331, 1337, 1332, 1373, 1372, 1322, 1312, 552, 1369, 1831, 1368, 1317, 1309, 1310, 1359, 1322, 1309, 1320, 1831, 1308, 1317, 1316, 1316, 1356, 1299, 1308, 1313, 1290, 1294, 1345, 1309, 1291, 1301, 1341, 1340, 1339, 1286, 1337, 1301, 580, 582, 1278, 1288, 579, 1831, 1338, 1284, 1294, 1294, 1277, 1282, 1286, 1276, 1288, 1291, 1328, 1831, 1322, 578, 1284, 15, 20, 86, 175, 242, 1831, 274, 374, 536, 561, 559, 578, 575, 576, 575, 574, 589, 585, 640, 605, 595, 611, 601, 1831, 611, 611, 604, 615, 613, 656, 600, 602, 617, 604, 662, 621, 607, 610, 1831, 1831, 620, 625, 630, 618, 1831, 1831, 632, 619, 613, 618, 636, 623, 671, 624, 674, 625, 681, 1831, 628, 632, 627, 685, 640, 630, 631, 627, 640, 651, 635, 653, 648, 649, 651, 644, 646, 647, 647, 649, 664, 703, 662, 667, 644, 1831, 669, 659, 704, 664, 654, 669, 670, 657, 671, 1831, 690, 698, 667, 662, 715, 680, 684, 723, 673, 668, 680, 675, 676, 672, 681, 676, 732, 691, 692, 683, 1831, 685, 696, 681, 697, 692, 737, 706, 690, 691, 1831, 707, 710, 693, 750, 695, 1831, 712, 715, 695, 713, 751, 711, 707, 702, 720, 719, 720, 706, 721, 713, 720, 710, 728, 713, 1831, 721, 727, 772, 1831, 723, 728, 770, 723, 735, 729, 734, 732, 730, 732, 742, 785, 731, 731, 788, 734, 746, 1831, 734, 742, 740, 745, 757, 741, 746, 756, 757, 762, 801, 760, 776, 781, 763, 761, 757, 809, 754, 1831, 754, 774, 763, 768, 775, 816, 817, 766, 1831, 814, 763, 766, 765, 785, 782, 787, 788, 774, 782, 791, 771, 788, 795, 835, 1831, 836, 837, 790, 800, 802, 791, 787, 794, 803, 846, 795, 793, 795, 812, 851, 803, 802, 808, 806, 804, 857, 858, 854, 1831, 818, 811, 802, 821, 809, 819, 816, 821, 817, 830, 830, 1831, 814, 815, 1831, 816, 874, 815, 834, 835, 832, 818, 839, 838, 822, 827, 845, 1831, 835, 868, 859, 889, 831, 853, 1831, 836, 838, 855, 853, 845, 849, 1831, 1831, 859, 859, 895, 844, 897, 846, 904, 849, 860, 852, 858, 854, 873, 874, 875, 1831, 1831, 874, 1831, 859, 861, 880, 870, 863, 875, 917, 883, 1831, 875, 925, 868, 927, 1831, 928, 872, 878, 885, 927, 1831, 1831, 877, 879, 893, 898, 881, 938, 897, 898, 899, 937, 891, 896, 945, 895, 947, 1831, 896, 949, 950, 892, 952, 913, 954, 898, 910, 915, 901, 931, 960, 1831, 919, 912, 963, 912, 927, 914, 910, 926, 931, 918, 914, 972, 927, 932, 1831, 933, 926, 935, 936, 933, 923, 926, 926, 931, 984, 985, 930, 988, 984, 927, 942, 935, 994, 1831, 949, 1831, 1831, 954, 946, 956, 942, 943, 1002, 948, 958, 1006, 1831, 956, 956, 958, 960, 1011, 954, 957, 1831, 976, 1831, 960, 1831, 1831, 974, 1831, 968, 1831, 1018, 969, 1020, 1021, 1003, 1831, 1023, 982, 1831, 970, 978, 972, 971, 974, 974, 975, 982, 972, 1831, 994, 980, 981, 996, 996, 999, 999, 996, 1038, 1002, 995, 1831, 1831, 1005, 1831, 1002, 1007, 1008, 1005, 1047, 1831, 998, 999, 999, 1005, 1004, 1015, 1831, 1054, 1003, 1831, 1004, 1004, 1006, 1012, 1831, 1014, 1066, 1017, 1020, 1069, 1032, 1831, 1029, 1831, 1026, 1831, 1049, 1831, 1074, 1075, 1076, 1035, 1021, 1079, 1080, 1035, 1025, 1030, 1084, 1085, 1081, 1046, 1042, 1084, 1034, 1039, 1037, 1094, 1052, 1096, 1056, 1098, 1061, 1051, 1045, 1061, 1061, 1105, 1049, 1066, 1065, 1049, 1105, 1106, 1055, 1108, 1073, 1074, 1831, 1074, 1061, 1831, 1072, 1119, 1079, 1092, 1831, 1831, 1831, 1066, 1123, 1831, 1831, 1072, 1070, 1084, 1831, 1831, 1074, 1123, 1068, 1073, 1131, 1081, 1091, 1092, 1831, 1135, 1090, 1831, 1137, 1831, 1082, 1097, 1085, 1100, 1104, 1831, 1138, 1106, 1099, 1108, 1090, 1097, 1151, 1112, 1111, 1154, 1155, 1156, 1107, 1831, 1158, 1159, 1160, 1831, 1110, 1110, 1163, 1109, 1108, 1166, 1121, 1831, 1163, 1116, 1113, 1831, 1127, 1831, 1130, 1173, 1128, 1175, 1136, 1119, 1121, 1118, 1134, 1135, 1144, 1831, 1134, 1184, 1831, 1831, 1831, 1180, 1831, 1831, 1831, 1181, 1138, 1831, 1136, 1143, 1831, 1140, 1145, 1143, 1193, 1194, 1139, 1831, 1154, 1831, 1155, 1145, 1157, 1200, 1144, 1152, 1153, 1166, 1831, 1165, 1153, 1207, 1168, 1159, 1168, 1170, 1174, 1831, 1831, 1213, 1158, 1215, 1175, 1217, 1831, 1213, 1177, 1178, 1165, 1160, 1181, 1831, 1182, 1183, 1226, 1185, 1188, 1831, 1229, 1831, 1192, 1831, 1174, 1232, 1233, 1178, 1195, 1181, 1181, 1183, 1831, 1188, 1198, 1831, 1184, 1196, 1831, 1831, 1201, 1195, 1199, 1190, 1242, 1191, 1199, 1208, 1201, 1196, 1211, 1202, 1209, 1196, 1211, 1216, 1259, 1218, 1261, 1206, 1222, 1213, 1227, 1223, 1216, 1831, 1268, 1831, 1269, 1270, 1227, 1226, 1227, 1217, 1831, 1831, 1831, 1275, 1219, 1235, 1278, 1831, 1274, 1225, 1831, 1224, 1226, 1237, 1284, 1235, 1831, 1244, 1287, 1831, 1831, 1293, 1298, 1303, 1308, 1313, 1318, 1323, 1326, 1300, 1305, 1307, 1320 } ; static const flex_int16_t yy_def[1480] = { 0, 1468, 1468, 1469, 1469, 1468, 1468, 1468, 1468, 1468, 1468, 1467, 1467, 1467, 1467, 1467, 1470, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1471, 1467, 1467, 1467, 1472, 15, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1473, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1470, 1467, 1467, 1467, 1467, 1467, 1467, 1474, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1471, 1467, 1472, 1467, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1475, 45, 1473, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1474, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1476, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1475, 1467, 1473, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1477, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 1467, 45, 1473, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 1467, 1467, 1467, 1478, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 45, 1473, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 1467, 45, 45, 1467, 45, 45, 1467, 1479, 45, 45, 45, 45, 1467, 1467, 45, 1467, 45, 1467, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 1467, 45, 45, 45, 45, 1467, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 1467, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 1467, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 1467, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 1467, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 1467, 45, 1467, 1467, 45, 1467, 45, 1467, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 1467, 45, 1467, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 1467, 45, 1467, 45, 1467, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 45, 45, 45, 45, 1467, 1467, 1467, 45, 45, 1467, 1467, 45, 45, 45, 1467, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 45, 1467, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 1467, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 1467, 1467, 45, 1467, 1467, 1467, 45, 45, 1467, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 1467, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 1467, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 45, 45, 45, 1467, 45, 1467, 45, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 45, 45, 1467, 1467, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 1467, 45, 1467, 45, 45, 45, 45, 45, 45, 1467, 1467, 1467, 45, 45, 45, 45, 1467, 45, 45, 1467, 45, 45, 45, 45, 45, 1467, 45, 45, 1467, 0, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467 } ; static const flex_int16_t yy_nxt[1903] = { 0, 1467, 13, 14, 13, 1467, 15, 16, 1467, 17, 18, 19, 20, 21, 22, 22, 22, 23, 24, 86, 705, 37, 14, 37, 87, 25, 26, 38, 1467, 706, 27, 37, 14, 37, 42, 28, 42, 38, 92, 93, 29, 115, 30, 13, 14, 13, 91, 92, 25, 31, 93, 13, 14, 13, 13, 14, 13, 32, 40, 818, 13, 14, 13, 33, 40, 115, 92, 93, 819, 91, 34, 35, 13, 14, 13, 95, 15, 16, 96, 17, 18, 19, 20, 21, 22, 22, 22, 23, 24, 13, 14, 13, 109, 39, 91, 25, 26, 13, 14, 13, 27, 39, 85, 85, 85, 28, 42, 41, 42, 42, 29, 42, 30, 83, 108, 41, 111, 94, 25, 31, 109, 217, 218, 89, 137, 89, 139, 32, 90, 90, 90, 138, 374, 33, 140, 375, 83, 108, 820, 111, 34, 35, 44, 44, 44, 45, 45, 46, 45, 45, 45, 45, 45, 45, 45, 45, 47, 45, 45, 45, 45, 45, 48, 45, 49, 50, 45, 51, 45, 52, 53, 54, 45, 45, 45, 45, 55, 56, 45, 57, 45, 45, 58, 45, 45, 59, 60, 61, 62, 63, 64, 65, 66, 67, 52, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 57, 45, 45, 45, 45, 45, 81, 105, 82, 82, 82, 81, 114, 84, 84, 84, 102, 105, 81, 83, 84, 84, 84, 821, 83, 108, 123, 112, 141, 124, 182, 83, 125, 105, 126, 114, 127, 113, 142, 200, 143, 164, 83, 119, 194, 165, 133, 83, 108, 120, 112, 103, 121, 182, 83, 45, 149, 134, 182, 136, 150, 45, 200, 45, 45, 113, 45, 135, 45, 45, 45, 194, 117, 145, 146, 45, 45, 147, 45, 45, 151, 185, 822, 148, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 90, 90, 90, 45, 128, 197, 111, 45, 129, 160, 180, 130, 131, 161, 114, 45, 242, 823, 155, 45, 243, 45, 118, 162, 132, 152, 156, 153, 157, 154, 112, 166, 197, 158, 159, 167, 180, 175, 168, 181, 113, 90, 90, 90, 102, 169, 170, 176, 85, 85, 85, 171, 177, 172, 81, 173, 82, 82, 82, 83, 180, 85, 85, 85, 89, 181, 89, 83, 113, 90, 90, 90, 83, 181, 81, 174, 84, 84, 84, 103, 190, 101, 83, 193, 196, 198, 183, 83, 101, 190, 83, 199, 211, 196, 223, 83, 224, 230, 226, 184, 231, 212, 213, 824, 232, 287, 204, 197, 190, 193, 83, 262, 196, 198, 227, 287, 101, 205, 199, 504, 101, 196, 505, 248, 101, 254, 255, 257, 271, 272, 258, 259, 101, 287, 280, 289, 101, 199, 101, 188, 203, 203, 203, 290, 263, 264, 265, 203, 203, 203, 203, 203, 203, 288, 288, 266, 299, 267, 289, 268, 269, 273, 270, 289, 283, 274, 296, 300, 302, 275, 203, 203, 203, 203, 203, 203, 304, 306, 296, 288, 291, 395, 317, 303, 299, 359, 292, 398, 390, 296, 318, 302, 348, 402, 300, 398, 319, 404, 404, 304, 409, 309, 412, 403, 306, 307, 307, 307, 426, 478, 398, 719, 307, 307, 307, 307, 307, 307, 399, 360, 406, 407, 466, 409, 432, 427, 404, 416, 433, 408, 412, 396, 467, 361, 719, 307, 307, 307, 307, 307, 307, 459, 460, 349, 517, 446, 350, 415, 415, 415, 447, 661, 662, 679, 415, 415, 415, 415, 415, 415, 487, 517, 492, 510, 488, 479, 493, 624, 511, 551, 541, 525, 517, 526, 552, 727, 728, 415, 415, 415, 415, 415, 415, 542, 825, 543, 620, 625, 718, 527, 680, 626, 763, 724, 624, 764, 448, 816, 525, 725, 526, 449, 45, 45, 45, 826, 827, 828, 829, 45, 45, 45, 45, 45, 45, 625, 718, 794, 796, 797, 830, 802, 831, 832, 795, 816, 798, 803, 833, 834, 799, 835, 45, 45, 45, 45, 45, 45, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 847, 848, 849, 850, 846, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 865, 866, 867, 864, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 906, 929, 930, 905, 931, 932, 933, 934, 935, 936, 937, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 957, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 993, 992, 938, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 991, 992, 1018, 1019, 1020, 1021, 1023, 1025, 1026, 1027, 1022, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1024, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1072, 1095, 1096, 1097, 1098, 1099, 1073, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1143, 1172, 1173, 1174, 1175, 1177, 1126, 1178, 1179, 1180, 1181, 1182, 1176, 1183, 1184, 1185, 1186, 1187, 1148, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1204, 1205, 1206, 1207, 1203, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1205, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1277, 1278, 1279, 1280, 1281, 1254, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1302, 1276, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 12, 12, 12, 12, 12, 36, 36, 36, 36, 36, 80, 294, 80, 80, 80, 99, 401, 99, 514, 99, 101, 101, 101, 101, 101, 116, 116, 116, 116, 116, 179, 101, 179, 179, 179, 201, 201, 201, 817, 815, 814, 813, 812, 811, 810, 809, 808, 807, 806, 805, 804, 801, 800, 793, 792, 791, 790, 789, 788, 787, 786, 785, 784, 783, 782, 781, 780, 779, 778, 777, 776, 775, 774, 773, 772, 771, 770, 769, 768, 767, 766, 765, 762, 761, 760, 759, 758, 757, 756, 755, 754, 753, 752, 751, 750, 749, 748, 747, 746, 745, 744, 743, 742, 741, 740, 739, 738, 737, 736, 735, 734, 733, 732, 731, 730, 729, 726, 723, 722, 721, 720, 717, 716, 715, 714, 713, 712, 711, 710, 709, 708, 707, 704, 703, 702, 701, 700, 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, 684, 683, 682, 681, 678, 677, 676, 675, 674, 673, 672, 671, 670, 669, 668, 667, 666, 665, 664, 663, 660, 659, 658, 657, 656, 655, 654, 653, 652, 651, 650, 649, 648, 647, 646, 645, 644, 643, 642, 641, 640, 639, 638, 637, 636, 635, 634, 633, 632, 631, 630, 629, 628, 627, 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, 611, 610, 609, 608, 607, 606, 605, 604, 603, 602, 601, 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, 581, 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, 570, 569, 568, 567, 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 550, 549, 548, 547, 546, 545, 544, 540, 539, 538, 537, 536, 535, 534, 533, 532, 531, 530, 529, 528, 524, 523, 522, 521, 520, 519, 518, 516, 515, 513, 512, 509, 508, 507, 506, 503, 502, 501, 500, 499, 498, 497, 496, 495, 494, 491, 490, 489, 486, 485, 484, 483, 482, 481, 480, 477, 476, 475, 474, 473, 472, 471, 470, 469, 468, 465, 464, 463, 462, 461, 458, 457, 456, 455, 454, 453, 452, 451, 450, 445, 444, 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, 431, 430, 429, 428, 425, 424, 423, 422, 421, 420, 419, 418, 417, 414, 413, 411, 410, 405, 400, 397, 394, 393, 392, 391, 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, 377, 376, 373, 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, 362, 358, 357, 356, 355, 354, 353, 352, 351, 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 316, 315, 314, 313, 312, 311, 310, 308, 202, 305, 303, 301, 298, 297, 295, 293, 286, 285, 284, 282, 281, 279, 278, 277, 276, 261, 260, 256, 253, 252, 251, 250, 249, 247, 246, 245, 244, 241, 240, 239, 238, 237, 236, 235, 234, 233, 229, 228, 225, 222, 221, 220, 219, 216, 215, 214, 210, 209, 208, 207, 206, 202, 195, 192, 191, 189, 187, 186, 178, 163, 144, 122, 110, 107, 106, 104, 43, 100, 98, 97, 88, 43, 1467, 11, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467 } ; static const flex_int16_t yy_chk[1903] = { 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 21, 610, 3, 3, 3, 21, 1, 1, 3, 0, 610, 1, 4, 4, 4, 13, 1, 13, 4, 27, 28, 1, 57, 1, 5, 5, 5, 26, 32, 1, 1, 33, 6, 6, 6, 7, 7, 7, 1, 7, 721, 8, 8, 8, 1, 8, 57, 27, 28, 722, 26, 1, 1, 2, 2, 2, 32, 2, 2, 33, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 52, 5, 31, 2, 2, 10, 10, 10, 2, 6, 20, 20, 20, 2, 37, 9, 37, 42, 2, 42, 2, 20, 51, 10, 54, 31, 2, 2, 52, 129, 129, 25, 65, 25, 66, 2, 25, 25, 25, 65, 265, 2, 66, 265, 20, 51, 723, 54, 2, 2, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 48, 17, 17, 17, 19, 56, 19, 19, 19, 44, 59, 22, 17, 22, 22, 22, 724, 19, 64, 61, 55, 67, 61, 93, 22, 61, 48, 61, 56, 61, 55, 67, 115, 67, 75, 17, 59, 109, 75, 63, 19, 64, 59, 55, 44, 59, 96, 22, 45, 70, 63, 93, 64, 70, 45, 115, 45, 45, 55, 45, 63, 45, 45, 45, 109, 58, 69, 69, 45, 45, 69, 45, 58, 70, 96, 725, 69, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 58, 89, 89, 89, 58, 62, 112, 71, 58, 62, 73, 91, 62, 62, 73, 78, 58, 149, 727, 72, 58, 149, 58, 58, 73, 62, 71, 72, 71, 72, 71, 77, 76, 112, 72, 72, 76, 91, 78, 76, 92, 77, 90, 90, 90, 101, 76, 76, 78, 81, 81, 81, 76, 78, 77, 82, 77, 82, 82, 82, 81, 94, 85, 85, 85, 83, 92, 83, 82, 77, 83, 83, 83, 85, 95, 84, 77, 84, 84, 84, 101, 105, 103, 81, 108, 111, 113, 94, 84, 103, 119, 82, 114, 125, 154, 134, 85, 134, 139, 136, 95, 139, 125, 125, 728, 139, 180, 119, 172, 105, 108, 84, 165, 111, 113, 136, 183, 103, 119, 114, 390, 103, 154, 390, 154, 103, 160, 160, 162, 166, 166, 162, 162, 103, 180, 172, 182, 103, 175, 103, 103, 118, 118, 118, 183, 165, 165, 165, 118, 118, 118, 118, 118, 118, 181, 184, 165, 193, 165, 182, 165, 165, 167, 165, 185, 175, 167, 190, 194, 196, 167, 118, 118, 118, 118, 118, 118, 198, 200, 205, 181, 184, 285, 213, 280, 193, 252, 185, 287, 280, 190, 213, 196, 243, 295, 194, 290, 213, 296, 309, 198, 299, 205, 302, 295, 200, 203, 203, 203, 319, 366, 287, 625, 203, 203, 203, 203, 203, 203, 290, 252, 298, 298, 354, 299, 325, 319, 296, 309, 325, 298, 302, 285, 354, 252, 625, 203, 203, 203, 203, 203, 203, 348, 348, 243, 404, 338, 243, 307, 307, 307, 338, 564, 564, 582, 307, 307, 307, 307, 307, 307, 375, 416, 379, 396, 375, 366, 379, 525, 396, 441, 432, 414, 404, 414, 441, 632, 632, 307, 307, 307, 307, 307, 307, 432, 729, 432, 527, 526, 624, 416, 582, 527, 668, 630, 525, 668, 338, 719, 414, 630, 414, 338, 415, 415, 415, 730, 731, 732, 733, 415, 415, 415, 415, 415, 415, 526, 624, 700, 701, 701, 734, 704, 735, 736, 700, 719, 701, 704, 737, 738, 701, 739, 415, 415, 415, 415, 415, 415, 740, 741, 742, 743, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 750, 755, 756, 757, 758, 761, 762, 763, 764, 767, 768, 769, 770, 771, 772, 773, 774, 771, 775, 776, 777, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 805, 806, 807, 808, 809, 810, 811, 812, 813, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 836, 837, 838, 839, 816, 840, 841, 815, 842, 843, 844, 846, 847, 848, 849, 850, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 871, 872, 873, 875, 876, 877, 878, 879, 880, 868, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 907, 906, 849, 908, 909, 910, 911, 913, 914, 915, 916, 917, 918, 919, 920, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 905, 906, 934, 935, 936, 938, 939, 940, 941, 942, 938, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 974, 975, 977, 978, 979, 980, 981, 982, 939, 983, 984, 985, 986, 987, 988, 990, 991, 992, 993, 994, 995, 997, 998, 999, 1000, 1001, 1002, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 991, 1017, 1018, 1019, 1022, 1024, 992, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1033, 1034, 1035, 1036, 1038, 1039, 1040, 1041, 1042, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1072, 1102, 1103, 1104, 1105, 1106, 1054, 1107, 1109, 1112, 1113, 1114, 1105, 1115, 1116, 1117, 1118, 1119, 1077, 1120, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1130, 1132, 1135, 1137, 1139, 1140, 1141, 1142, 1143, 1145, 1146, 1141, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1143, 1168, 1171, 1173, 1174, 1175, 1176, 1177, 1179, 1180, 1181, 1182, 1183, 1184, 1186, 1187, 1189, 1190, 1191, 1192, 1194, 1195, 1196, 1197, 1198, 1199, 1201, 1203, 1205, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1205, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1248, 1249, 1251, 1252, 1253, 1254, 1258, 1259, 1262, 1263, 1264, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1276, 1277, 1279, 1281, 1282, 1283, 1284, 1285, 1287, 1288, 1289, 1290, 1291, 1292, 1254, 1226, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1301, 1302, 1303, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1313, 1314, 1315, 1317, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1331, 1332, 1336, 1340, 1341, 1343, 1344, 1346, 1347, 1348, 1349, 1350, 1351, 1353, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1374, 1375, 1376, 1377, 1378, 1380, 1381, 1382, 1383, 1384, 1385, 1387, 1388, 1389, 1390, 1391, 1393, 1395, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1406, 1407, 1409, 1410, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1439, 1441, 1442, 1443, 1444, 1445, 1446, 1450, 1451, 1452, 1453, 1455, 1456, 1458, 1459, 1460, 1461, 1462, 1464, 1465, 1468, 1468, 1468, 1468, 1468, 1469, 1469, 1469, 1469, 1469, 1470, 1476, 1470, 1470, 1470, 1471, 1477, 1471, 1478, 1471, 1472, 1472, 1472, 1472, 1472, 1473, 1473, 1473, 1473, 1473, 1474, 1479, 1474, 1474, 1474, 1475, 1475, 1475, 720, 718, 716, 715, 714, 713, 712, 711, 710, 709, 708, 707, 706, 703, 702, 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, 678, 677, 676, 675, 674, 673, 672, 671, 669, 667, 666, 665, 664, 663, 662, 661, 660, 659, 658, 657, 656, 655, 654, 653, 652, 650, 649, 648, 647, 646, 645, 644, 643, 642, 641, 640, 639, 638, 637, 636, 635, 634, 633, 631, 629, 628, 627, 626, 623, 622, 621, 619, 618, 616, 615, 614, 613, 612, 611, 608, 607, 606, 605, 604, 603, 602, 601, 600, 599, 598, 597, 595, 594, 593, 592, 591, 590, 589, 588, 586, 585, 584, 583, 581, 580, 579, 578, 577, 576, 575, 573, 572, 571, 570, 569, 568, 567, 566, 565, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 550, 549, 548, 547, 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, 536, 535, 534, 533, 532, 531, 530, 529, 523, 521, 518, 517, 516, 515, 513, 512, 511, 509, 508, 505, 504, 503, 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, 481, 479, 477, 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, 466, 464, 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, 445, 444, 443, 442, 440, 439, 438, 437, 436, 434, 433, 431, 430, 428, 427, 426, 425, 424, 423, 421, 420, 419, 418, 417, 412, 411, 409, 408, 407, 406, 405, 403, 402, 400, 397, 395, 394, 392, 391, 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, 378, 377, 376, 374, 373, 372, 371, 369, 368, 367, 365, 364, 363, 362, 361, 360, 359, 358, 357, 355, 353, 352, 351, 350, 349, 347, 346, 345, 344, 343, 342, 341, 340, 339, 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 324, 323, 322, 321, 318, 317, 316, 315, 314, 313, 312, 311, 310, 306, 304, 301, 300, 297, 293, 286, 284, 283, 282, 281, 279, 278, 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, 266, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 251, 250, 249, 248, 247, 246, 245, 244, 242, 241, 240, 239, 238, 237, 236, 235, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 212, 211, 210, 209, 208, 207, 206, 204, 201, 199, 197, 195, 192, 191, 189, 186, 178, 177, 176, 174, 173, 171, 170, 169, 168, 164, 163, 161, 159, 158, 157, 156, 155, 153, 152, 151, 150, 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, 137, 135, 133, 132, 131, 130, 128, 127, 126, 124, 123, 122, 121, 120, 116, 110, 107, 106, 104, 99, 98, 79, 74, 68, 60, 53, 50, 49, 47, 43, 41, 39, 38, 24, 14, 11, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 1; static const flex_int16_t yy_rule_linenum[175] = { 0, 147, 149, 151, 156, 157, 162, 163, 164, 176, 179, 184, 191, 200, 209, 218, 227, 236, 245, 255, 264, 273, 282, 291, 300, 309, 318, 327, 336, 345, 354, 366, 375, 384, 393, 402, 413, 424, 435, 446, 456, 466, 477, 488, 499, 510, 521, 532, 543, 554, 565, 576, 587, 596, 605, 615, 624, 634, 648, 664, 673, 682, 691, 700, 721, 742, 751, 761, 770, 781, 790, 799, 808, 817, 826, 836, 845, 854, 863, 872, 881, 890, 899, 908, 917, 926, 936, 947, 959, 968, 977, 987, 997, 1007, 1017, 1027, 1037, 1046, 1056, 1065, 1074, 1083, 1092, 1102, 1112, 1121, 1131, 1140, 1149, 1158, 1167, 1176, 1185, 1194, 1203, 1212, 1221, 1230, 1239, 1248, 1257, 1266, 1275, 1284, 1293, 1302, 1311, 1320, 1329, 1338, 1347, 1356, 1365, 1374, 1383, 1392, 1401, 1411, 1421, 1431, 1441, 1451, 1461, 1471, 1481, 1491, 1500, 1509, 1518, 1527, 1536, 1545, 1554, 1565, 1576, 1589, 1602, 1617, 1716, 1721, 1726, 1731, 1732, 1733, 1734, 1735, 1736, 1738, 1756, 1769, 1774, 1778, 1780, 1782, 1784 } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "dhcp4_lexer.ll" /* Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC") This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #line 8 "dhcp4_lexer.ll" /* Generated files do not make clang static analyser so happy */ #ifndef __clang_analyzer__ #include <cerrno> #include <climits> #include <cstdlib> #include <string> #include <dhcp4/parser_context.h> #include <asiolink/io_address.h> #include <boost/lexical_cast.hpp> #include <exceptions/exceptions.h> /* Please avoid C++ style comments (// ... eol) as they break flex 2.6.2 */ /* Work around an incompatibility in flex (at least versions 2.5.31 through 2.5.33): it generates code that does not conform to C89. See Debian bug 333231 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */ # undef yywrap # define yywrap() 1 namespace { bool start_token_flag = false; isc::dhcp::Parser4Context::ParserType start_token_value; unsigned int comment_start_line = 0; using namespace isc::dhcp; }; /* To avoid the call to exit... oops! */ #define YY_FATAL_ERROR(msg) isc::dhcp::Parser4Context::fatal(msg) #line 1751 "dhcp4_lexer.cc" /* noyywrap disables automatic rewinding for the next file to parse. Since we always parse only a single string, there's no need to do any wraps. And using yywrap requires linking with -lfl, which provides the default yywrap implementation that always returns 1 anyway. */ /* nounput simplifies the lexer, by removing support for putting a character back into the input stream. We never use such capability anyway. */ /* batch means that we'll never use the generated lexer interactively. */ /* avoid to get static global variables to remain with C++. */ /* in last resort %option reentrant */ /* Enables debug mode. To see the debug messages, one needs to also set yy_flex_debug to 1, then the debug messages will be printed on stderr. */ /* I have no idea what this option does, except it was specified in the bison examples and Postgres folks added it to remove gcc 4.3 warnings. Let's be on the safe side and keep it. */ #define YY_NO_INPUT 1 /* These are not token expressions yet, just convenience expressions that can be used during actual token definitions. Note some can match incorrect inputs (e.g., IP addresses) which must be checked. */ /* for errors */ #line 94 "dhcp4_lexer.ll" /* This code run each time a pattern is matched. It updates the location by moving it ahead by yyleng bytes. yyleng specifies the length of the currently matched token. */ #define YY_USER_ACTION driver.loc_.columns(yyleng); #line 1777 "dhcp4_lexer.cc" #line 1778 "dhcp4_lexer.cc" #define INITIAL 0 #define COMMENT 1 #define DIR_ENTER 2 #define DIR_INCLUDE 3 #define DIR_EXIT 4 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ /* %if-c-only */ #include <unistd.h> /* %endif */ /* %if-c++-only */ /* %endif */ #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* %if-c-only Reentrant structure and macros (non-C++). */ /* %if-reentrant */ /* %if-c-only */ static int yy_init_globals ( void ); /* %endif */ /* %if-reentrant */ /* %endif */ /* %endif End reentrant structures and macros. */ /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy ( void ); int yyget_debug ( void ); void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); void yyset_extra ( YY_EXTRA_TYPE user_defined ); FILE *yyget_in ( void ); void yyset_in ( FILE * _in_str ); FILE *yyget_out ( void ); void yyset_out ( FILE * _out_str ); int yyget_leng ( void ); char *yyget_text ( void ); int yyget_lineno ( void ); void yyset_lineno ( int _line_number ); /* %if-bison-bridge */ /* %endif */ /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap ( void ); #else extern int yywrap ( void ); #endif #endif /* %not-for-header */ #ifndef YY_NO_UNPUT #endif /* %ok-for-header */ /* %endif */ #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif /* %ok-for-header */ /* %endif */ #endif /* %if-c-only */ /* %endif */ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* %if-c-only Standard (non-C++) definition */ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ /* %if-c++-only C++ definition \ */\ /* %endif */ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR /* %if-c-only */ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) /* %endif */ /* %if-c++-only */ /* %endif */ #endif /* %if-tables-serialization structures and prototypes */ /* %not-for-header */ /* %ok-for-header */ /* %not-for-header */ /* %tables-yydmap generated elements */ /* %endif */ /* end tables serialization structures and prototypes */ /* %ok-for-header */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ extern int yylex (void); #define YY_DECL int yylex (void) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK /*LINTED*/break; #endif /* %% [6.0] YY_RULE_SETUP definition goes here */ #define YY_RULE_SETUP \ YY_USER_ACTION /* %not-for-header */ /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) /* %if-c-only */ yyin = stdin; /* %endif */ /* %if-c++-only */ /* %endif */ if ( ! yyout ) /* %if-c-only */ yyout = stdout; /* %endif */ /* %if-c++-only */ /* %endif */ if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_load_buffer_state( ); } { /* %% [7.0] user's declarations go here */ #line 100 "dhcp4_lexer.ll" #line 104 "dhcp4_lexer.ll" /* This part of the code is copied over to the verbatim to the top of the generated yylex function. Explanation: http://www.gnu.org/software/bison/manual/html_node/Multiple-start_002dsymbols.html */ /* Code run each time yylex is called. */ driver.loc_.step(); if (start_token_flag) { start_token_flag = false; switch (start_token_value) { case Parser4Context::PARSER_JSON: default: return isc::dhcp::Dhcp4Parser::make_TOPLEVEL_JSON(driver.loc_); case Parser4Context::PARSER_DHCP4: return isc::dhcp::Dhcp4Parser::make_TOPLEVEL_DHCP4(driver.loc_); case Parser4Context::SUBPARSER_DHCP4: return isc::dhcp::Dhcp4Parser::make_SUB_DHCP4(driver.loc_); case Parser4Context::PARSER_INTERFACES: return isc::dhcp::Dhcp4Parser::make_SUB_INTERFACES4(driver.loc_); case Parser4Context::PARSER_SUBNET4: return isc::dhcp::Dhcp4Parser::make_SUB_SUBNET4(driver.loc_); case Parser4Context::PARSER_POOL4: return isc::dhcp::Dhcp4Parser::make_SUB_POOL4(driver.loc_); case Parser4Context::PARSER_HOST_RESERVATION: return isc::dhcp::Dhcp4Parser::make_SUB_RESERVATION(driver.loc_); case Parser4Context::PARSER_OPTION_DEFS: return isc::dhcp::Dhcp4Parser::make_SUB_OPTION_DEFS(driver.loc_); case Parser4Context::PARSER_OPTION_DEF: return isc::dhcp::Dhcp4Parser::make_SUB_OPTION_DEF(driver.loc_); case Parser4Context::PARSER_OPTION_DATA: return isc::dhcp::Dhcp4Parser::make_SUB_OPTION_DATA(driver.loc_); case Parser4Context::PARSER_HOOKS_LIBRARY: return isc::dhcp::Dhcp4Parser::make_SUB_HOOKS_LIBRARY(driver.loc_); case Parser4Context::PARSER_DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_SUB_DHCP_DDNS(driver.loc_); case Parser4Context::PARSER_CONFIG_CONTROL: return isc::dhcp::Dhcp4Parser::make_SUB_CONFIG_CONTROL(driver.loc_); case Parser4Context::PARSER_LOGGING: return isc::dhcp::Dhcp4Parser::make_SUB_LOGGING(driver.loc_); } } #line 2108 "dhcp4_lexer.cc" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { /* %% [8.0] yymore()-related code goes here */ yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; /* %% [9.0] code to set up and find next match goes here */ yy_current_state = (yy_start); yy_match: do { YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1468 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 1467 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_find_action: /* %% [10.0] code to find the action number goes here */ yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; /* %% [11.0] code for yylineno update goes here */ do_action: /* This label is used only to access EOF actions. */ /* %% [12.0] debug code goes here */ if ( yy_flex_debug ) { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); else if ( yy_act < 175 ) fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext ); else if ( yy_act == 175 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", yytext ); else if ( yy_act == 176 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); } switch ( yy_act ) { /* beginning of action switch */ /* %% [13.0] actions go here */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 147 "dhcp4_lexer.ll" ; YY_BREAK case 2: YY_RULE_SETUP #line 149 "dhcp4_lexer.ll" ; YY_BREAK case 3: YY_RULE_SETUP #line 151 "dhcp4_lexer.ll" { BEGIN(COMMENT); comment_start_line = driver.loc_.end.line;; } YY_BREAK case 4: YY_RULE_SETUP #line 156 "dhcp4_lexer.ll" BEGIN(INITIAL); YY_BREAK case 5: YY_RULE_SETUP #line 157 "dhcp4_lexer.ll" ; YY_BREAK case YY_STATE_EOF(COMMENT): #line 158 "dhcp4_lexer.ll" { isc_throw(Dhcp4ParseError, "Comment not closed. (/* in line " << comment_start_line); } YY_BREAK case 6: YY_RULE_SETUP #line 162 "dhcp4_lexer.ll" BEGIN(DIR_ENTER); YY_BREAK case 7: YY_RULE_SETUP #line 163 "dhcp4_lexer.ll" BEGIN(DIR_INCLUDE); YY_BREAK case 8: YY_RULE_SETUP #line 164 "dhcp4_lexer.ll" { /* Include directive. */ /* Extract the filename. */ std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); driver.includeFile(tmp); } YY_BREAK case YY_STATE_EOF(DIR_ENTER): case YY_STATE_EOF(DIR_INCLUDE): case YY_STATE_EOF(DIR_EXIT): #line 173 "dhcp4_lexer.ll" { isc_throw(Dhcp4ParseError, "Directive not closed."); } YY_BREAK case 9: YY_RULE_SETUP #line 176 "dhcp4_lexer.ll" BEGIN(INITIAL); YY_BREAK case 10: YY_RULE_SETUP #line 179 "dhcp4_lexer.ll" { /* Ok, we found a with space. Let's ignore it and update loc variable. */ driver.loc_.step(); } YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP #line 184 "dhcp4_lexer.ll" { /* Newline found. Let's update the location and continue. */ driver.loc_.lines(yyleng); driver.loc_.step(); } YY_BREAK case 12: YY_RULE_SETUP #line 191 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CONFIG: return isc::dhcp::Dhcp4Parser::make_DHCP4(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("Dhcp4", driver.loc_); } } YY_BREAK case 13: YY_RULE_SETUP #line 200 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_INTERFACES_CONFIG(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("interfaces-config", driver.loc_); } } YY_BREAK case 14: YY_RULE_SETUP #line 209 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_SANITY_CHECKS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("sanity-checks", driver.loc_); } } YY_BREAK case 15: YY_RULE_SETUP #line 218 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SANITY_CHECKS: return isc::dhcp::Dhcp4Parser::make_LEASE_CHECKS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("lease-checks", driver.loc_); } } YY_BREAK case 16: YY_RULE_SETUP #line 227 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::INTERFACES_CONFIG: return isc::dhcp::Dhcp4Parser::make_DHCP_SOCKET_TYPE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("dhcp-socket-type", driver.loc_); } } YY_BREAK case 17: YY_RULE_SETUP #line 236 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_SOCKET_TYPE: return isc::dhcp::Dhcp4Parser::make_RAW(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("raw", driver.loc_); } } YY_BREAK case 18: YY_RULE_SETUP #line 245 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_SOCKET_TYPE: case isc::dhcp::Parser4Context::NCR_PROTOCOL: return isc::dhcp::Dhcp4Parser::make_UDP(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("udp", driver.loc_); } } YY_BREAK case 19: YY_RULE_SETUP #line 255 "dhcp4_lexer.ll" { switch(driver.ctx_) { case Parser4Context::INTERFACES_CONFIG: return isc::dhcp::Dhcp4Parser::make_OUTBOUND_INTERFACE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("outbound-interface", driver.loc_); } } YY_BREAK case 20: YY_RULE_SETUP #line 264 "dhcp4_lexer.ll" { switch(driver.ctx_) { case Parser4Context::OUTBOUND_INTERFACE: return Dhcp4Parser::make_SAME_AS_INBOUND(driver.loc_); default: return Dhcp4Parser::make_STRING("same-as-inbound", driver.loc_); } } YY_BREAK case 21: YY_RULE_SETUP #line 273 "dhcp4_lexer.ll" { switch(driver.ctx_) { case Parser4Context::OUTBOUND_INTERFACE: return Dhcp4Parser::make_USE_ROUTING(driver.loc_); default: return Dhcp4Parser::make_STRING("use-routing", driver.loc_); } } YY_BREAK case 22: YY_RULE_SETUP #line 282 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::INTERFACES_CONFIG: return isc::dhcp::Dhcp4Parser::make_INTERFACES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("interfaces", driver.loc_); } } YY_BREAK case 23: YY_RULE_SETUP #line 291 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::INTERFACES_CONFIG: return isc::dhcp::Dhcp4Parser::make_RE_DETECT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("re-detect", driver.loc_); } } YY_BREAK case 24: YY_RULE_SETUP #line 300 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_LEASE_DATABASE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("lease-database", driver.loc_); } } YY_BREAK case 25: YY_RULE_SETUP #line 309 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_HOSTS_DATABASE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("hosts-database", driver.loc_); } } YY_BREAK case 26: YY_RULE_SETUP #line 318 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_HOSTS_DATABASES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("hosts-databases", driver.loc_); } } YY_BREAK case 27: YY_RULE_SETUP #line 327 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_CONFIG_CONTROL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("config-control", driver.loc_); } } YY_BREAK case 28: YY_RULE_SETUP #line 336 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CONFIG_CONTROL: return isc::dhcp::Dhcp4Parser::make_CONFIG_DATABASES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("config-databases", driver.loc_); } } YY_BREAK case 29: YY_RULE_SETUP #line 345 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::HOSTS_DATABASE: return isc::dhcp::Dhcp4Parser::make_READONLY(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("readonly", driver.loc_); } } YY_BREAK case 30: YY_RULE_SETUP #line 354 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::OPTION_DEF: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_TYPE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("type", driver.loc_); } } YY_BREAK case 31: YY_RULE_SETUP #line 366 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DATABASE_TYPE: return isc::dhcp::Dhcp4Parser::make_MEMFILE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("memfile", driver.loc_); } } YY_BREAK case 32: YY_RULE_SETUP #line 375 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DATABASE_TYPE: return isc::dhcp::Dhcp4Parser::make_MYSQL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("mysql", driver.loc_); } } YY_BREAK case 33: YY_RULE_SETUP #line 384 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DATABASE_TYPE: return isc::dhcp::Dhcp4Parser::make_POSTGRESQL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("postgresql", driver.loc_); } } YY_BREAK case 34: YY_RULE_SETUP #line 393 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DATABASE_TYPE: return isc::dhcp::Dhcp4Parser::make_CQL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("cql", driver.loc_); } } YY_BREAK case 35: YY_RULE_SETUP #line 402 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_USER(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("user", driver.loc_); } } YY_BREAK case 36: YY_RULE_SETUP #line 413 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_PASSWORD(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("password", driver.loc_); } } YY_BREAK case 37: YY_RULE_SETUP #line 424 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_HOST(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("host", driver.loc_); } } YY_BREAK case 38: YY_RULE_SETUP #line 435 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_PORT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("port", driver.loc_); } } YY_BREAK case 39: YY_RULE_SETUP #line 446 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: return isc::dhcp::Dhcp4Parser::make_PERSIST(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("persist", driver.loc_); } } YY_BREAK case 40: YY_RULE_SETUP #line 456 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: return isc::dhcp::Dhcp4Parser::make_LFC_INTERVAL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("lfc-interval", driver.loc_); } } YY_BREAK case 41: YY_RULE_SETUP #line 466 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_CONNECT_TIMEOUT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("connect-timeout", driver.loc_); } } YY_BREAK case 42: YY_RULE_SETUP #line 477 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_KEYSPACE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("keyspace", driver.loc_); } } YY_BREAK case 43: YY_RULE_SETUP #line 488 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_RECONNECT_WAIT_TIME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("reconnect-wait-time", driver.loc_); } } YY_BREAK case 44: YY_RULE_SETUP #line 499 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_REQUEST_TIMEOUT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("request-timeout", driver.loc_); } } YY_BREAK case 45: YY_RULE_SETUP #line 510 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_TCP_KEEPALIVE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("tcp-keepalive", driver.loc_); } } YY_BREAK case 46: YY_RULE_SETUP #line 521 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_TCP_NODELAY(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("tcp-nodelay", driver.loc_); } } YY_BREAK case 47: YY_RULE_SETUP #line 532 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_CONTACT_POINTS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("contact-points", driver.loc_); } } YY_BREAK case 48: YY_RULE_SETUP #line 543 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: return isc::dhcp::Dhcp4Parser::make_MAX_RECONNECT_TRIES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("max-reconnect-tries", driver.loc_); } } YY_BREAK case 49: YY_RULE_SETUP #line 554 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_VALID_LIFETIME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("valid-lifetime", driver.loc_); } } YY_BREAK case 50: YY_RULE_SETUP #line 565 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_RENEW_TIMER(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("renew-timer", driver.loc_); } } YY_BREAK case 51: YY_RULE_SETUP #line 576 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_REBIND_TIMER(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("rebind-timer", driver.loc_); } } YY_BREAK case 52: YY_RULE_SETUP #line 587 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_DECLINE_PROBATION_PERIOD(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("decline-probation-period", driver.loc_); } } YY_BREAK case 53: YY_RULE_SETUP #line 596 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_SERVER_TAG(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("server-tag", driver.loc_); } } YY_BREAK case 54: YY_RULE_SETUP #line 605 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_SUBNET4(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("subnet4", driver.loc_); } } YY_BREAK case 55: YY_RULE_SETUP #line 615 "dhcp4_lexer.ll" { switch (driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_SHARED_NETWORKS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("shared-networks", driver.loc_); } } YY_BREAK case 56: YY_RULE_SETUP #line 624 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::CLIENT_CLASSES: return isc::dhcp::Dhcp4Parser::make_OPTION_DEF(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("option-def", driver.loc_); } } YY_BREAK case 57: YY_RULE_SETUP #line 634 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: case isc::dhcp::Parser4Context::POOLS: case isc::dhcp::Parser4Context::RESERVATIONS: case isc::dhcp::Parser4Context::CLIENT_CLASSES: return isc::dhcp::Dhcp4Parser::make_OPTION_DATA(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("option-data", driver.loc_); } } YY_BREAK case 58: YY_RULE_SETUP #line 648 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LEASE_DATABASE: case isc::dhcp::Parser4Context::HOSTS_DATABASE: case isc::dhcp::Parser4Context::CONFIG_DATABASE: case isc::dhcp::Parser4Context::OPTION_DEF: case isc::dhcp::Parser4Context::OPTION_DATA: case isc::dhcp::Parser4Context::CLIENT_CLASSES: case isc::dhcp::Parser4Context::SHARED_NETWORK: case isc::dhcp::Parser4Context::LOGGERS: return isc::dhcp::Dhcp4Parser::make_NAME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("name", driver.loc_); } } YY_BREAK case 59: YY_RULE_SETUP #line 664 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OPTION_DATA: return isc::dhcp::Dhcp4Parser::make_DATA(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("data", driver.loc_); } } YY_BREAK case 60: YY_RULE_SETUP #line 673 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OPTION_DATA: return isc::dhcp::Dhcp4Parser::make_ALWAYS_SEND(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("always-send", driver.loc_); } } YY_BREAK case 61: YY_RULE_SETUP #line 682 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: return isc::dhcp::Dhcp4Parser::make_POOLS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("pools", driver.loc_); } } YY_BREAK case 62: YY_RULE_SETUP #line 691 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::POOLS: return isc::dhcp::Dhcp4Parser::make_POOL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("pool", driver.loc_); } } YY_BREAK case 63: YY_RULE_SETUP #line 700 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::INTERFACES_CONFIG: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::POOLS: case isc::dhcp::Parser4Context::SHARED_NETWORK: case isc::dhcp::Parser4Context::OPTION_DEF: case isc::dhcp::Parser4Context::OPTION_DATA: case isc::dhcp::Parser4Context::RESERVATIONS: case isc::dhcp::Parser4Context::CLIENT_CLASSES: case isc::dhcp::Parser4Context::CONTROL_SOCKET: case isc::dhcp::Parser4Context::DHCP_QUEUE_CONTROL: case isc::dhcp::Parser4Context::LOGGERS: case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_USER_CONTEXT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("user-context", driver.loc_); } } YY_BREAK case 64: YY_RULE_SETUP #line 721 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::INTERFACES_CONFIG: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::POOLS: case isc::dhcp::Parser4Context::SHARED_NETWORK: case isc::dhcp::Parser4Context::OPTION_DEF: case isc::dhcp::Parser4Context::OPTION_DATA: case isc::dhcp::Parser4Context::RESERVATIONS: case isc::dhcp::Parser4Context::CLIENT_CLASSES: case isc::dhcp::Parser4Context::CONTROL_SOCKET: case isc::dhcp::Parser4Context::DHCP_QUEUE_CONTROL: case isc::dhcp::Parser4Context::LOGGERS: case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_COMMENT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("comment", driver.loc_); } } YY_BREAK case 65: YY_RULE_SETUP #line 742 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: return isc::dhcp::Dhcp4Parser::make_SUBNET(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("subnet", driver.loc_); } } YY_BREAK case 66: YY_RULE_SETUP #line 751 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_INTERFACE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("interface", driver.loc_); } } YY_BREAK case 67: YY_RULE_SETUP #line 761 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: return isc::dhcp::Dhcp4Parser::make_ID(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("id", driver.loc_); } } YY_BREAK case 68: YY_RULE_SETUP #line 770 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_RESERVATION_MODE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("reservation-mode", driver.loc_); } } YY_BREAK case 69: YY_RULE_SETUP #line 781 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::RESERVATION_MODE: return isc::dhcp::Dhcp4Parser::make_DISABLED(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("disabled", driver.loc_); } } YY_BREAK case 70: YY_RULE_SETUP #line 790 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::RESERVATION_MODE: return isc::dhcp::Dhcp4Parser::make_DISABLED(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("off", driver.loc_); } } YY_BREAK case 71: YY_RULE_SETUP #line 799 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::RESERVATION_MODE: return isc::dhcp::Dhcp4Parser::make_OUT_OF_POOL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("out-of-pool", driver.loc_); } } YY_BREAK case 72: YY_RULE_SETUP #line 808 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::RESERVATION_MODE: return isc::dhcp::Dhcp4Parser::make_GLOBAL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("global", driver.loc_); } } YY_BREAK case 73: YY_RULE_SETUP #line 817 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::RESERVATION_MODE: return isc::dhcp::Dhcp4Parser::make_ALL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("all", driver.loc_); } } YY_BREAK case 74: YY_RULE_SETUP #line 826 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OPTION_DEF: case isc::dhcp::Parser4Context::OPTION_DATA: return isc::dhcp::Dhcp4Parser::make_CODE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("code", driver.loc_); } } YY_BREAK case 75: YY_RULE_SETUP #line 836 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_HOST_RESERVATION_IDENTIFIERS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("host-reservation-identifiers", driver.loc_); } } YY_BREAK case 76: YY_RULE_SETUP #line 845 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CONFIG: return isc::dhcp::Dhcp4Parser::make_LOGGING(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("Logging", driver.loc_); } } YY_BREAK case 77: YY_RULE_SETUP #line 854 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LOGGING: return isc::dhcp::Dhcp4Parser::make_LOGGERS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("loggers", driver.loc_); } } YY_BREAK case 78: YY_RULE_SETUP #line 863 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LOGGERS: return isc::dhcp::Dhcp4Parser::make_OUTPUT_OPTIONS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("output_options", driver.loc_); } } YY_BREAK case 79: YY_RULE_SETUP #line 872 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OUTPUT_OPTIONS: return isc::dhcp::Dhcp4Parser::make_OUTPUT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("output", driver.loc_); } } YY_BREAK case 80: YY_RULE_SETUP #line 881 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LOGGERS: return isc::dhcp::Dhcp4Parser::make_DEBUGLEVEL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("debuglevel", driver.loc_); } } YY_BREAK case 81: YY_RULE_SETUP #line 890 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OUTPUT_OPTIONS: return isc::dhcp::Dhcp4Parser::make_FLUSH(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("flush", driver.loc_); } } YY_BREAK case 82: YY_RULE_SETUP #line 899 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OUTPUT_OPTIONS: return isc::dhcp::Dhcp4Parser::make_MAXSIZE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("maxsize", driver.loc_); } } YY_BREAK case 83: YY_RULE_SETUP #line 908 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OUTPUT_OPTIONS: return isc::dhcp::Dhcp4Parser::make_MAXVER(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("maxver", driver.loc_); } } YY_BREAK case 84: YY_RULE_SETUP #line 917 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::LOGGERS: return isc::dhcp::Dhcp4Parser::make_SEVERITY(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("severity", driver.loc_); } } YY_BREAK case 85: YY_RULE_SETUP #line 926 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::RESERVATIONS: return isc::dhcp::Dhcp4Parser::make_CLIENT_CLASSES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("client-classes", driver.loc_); } } YY_BREAK case 86: YY_RULE_SETUP #line 936 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::POOLS: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_REQUIRE_CLIENT_CLASSES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("require-client-classes", driver.loc_); } } YY_BREAK case 87: YY_RULE_SETUP #line 947 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::POOLS: case isc::dhcp::Parser4Context::SHARED_NETWORK: case isc::dhcp::Parser4Context::CLIENT_CLASSES: return isc::dhcp::Dhcp4Parser::make_CLIENT_CLASS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("client-class", driver.loc_); } } YY_BREAK case 88: YY_RULE_SETUP #line 959 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CLIENT_CLASSES: return isc::dhcp::Dhcp4Parser::make_TEST(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("test", driver.loc_); } } YY_BREAK case 89: YY_RULE_SETUP #line 968 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CLIENT_CLASSES: return isc::dhcp::Dhcp4Parser::make_ONLY_IF_REQUIRED(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("only-if-required", driver.loc_); } } YY_BREAK case 90: YY_RULE_SETUP #line 977 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: return isc::dhcp::Dhcp4Parser::make_RESERVATIONS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("reservations", driver.loc_); } } YY_BREAK case 91: YY_RULE_SETUP #line 987 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::HOST_RESERVATION_IDENTIFIERS: case isc::dhcp::Parser4Context::RESERVATIONS: return isc::dhcp::Dhcp4Parser::make_DUID(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("duid", driver.loc_); } } YY_BREAK case 92: YY_RULE_SETUP #line 997 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::HOST_RESERVATION_IDENTIFIERS: case isc::dhcp::Parser4Context::RESERVATIONS: return isc::dhcp::Dhcp4Parser::make_HW_ADDRESS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("hw-address", driver.loc_); } } YY_BREAK case 93: YY_RULE_SETUP #line 1007 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::HOST_RESERVATION_IDENTIFIERS: case isc::dhcp::Parser4Context::RESERVATIONS: return isc::dhcp::Dhcp4Parser::make_CLIENT_ID(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("client-id", driver.loc_); } } YY_BREAK case 94: YY_RULE_SETUP #line 1017 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::HOST_RESERVATION_IDENTIFIERS: case isc::dhcp::Parser4Context::RESERVATIONS: return isc::dhcp::Dhcp4Parser::make_CIRCUIT_ID(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("circuit-id", driver.loc_); } } YY_BREAK case 95: YY_RULE_SETUP #line 1027 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::HOST_RESERVATION_IDENTIFIERS: case isc::dhcp::Parser4Context::RESERVATIONS: return isc::dhcp::Dhcp4Parser::make_FLEX_ID(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("flex-id", driver.loc_); } } YY_BREAK case 96: YY_RULE_SETUP #line 1037 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::RESERVATIONS: return isc::dhcp::Dhcp4Parser::make_HOSTNAME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("hostname", driver.loc_); } } YY_BREAK case 97: YY_RULE_SETUP #line 1046 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OPTION_DEF: case isc::dhcp::Parser4Context::OPTION_DATA: return isc::dhcp::Dhcp4Parser::make_SPACE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("space", driver.loc_); } } YY_BREAK case 98: YY_RULE_SETUP #line 1056 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OPTION_DATA: return isc::dhcp::Dhcp4Parser::make_CSV_FORMAT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("csv-format", driver.loc_); } } YY_BREAK case 99: YY_RULE_SETUP #line 1065 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OPTION_DEF: return isc::dhcp::Dhcp4Parser::make_RECORD_TYPES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("record-types", driver.loc_); } } YY_BREAK case 100: YY_RULE_SETUP #line 1074 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OPTION_DEF: return isc::dhcp::Dhcp4Parser::make_ENCAPSULATE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("encapsulate", driver.loc_); } } YY_BREAK case 101: YY_RULE_SETUP #line 1083 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::OPTION_DEF: return isc::dhcp::Dhcp4Parser::make_ARRAY(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("array", driver.loc_); } } YY_BREAK case 102: YY_RULE_SETUP #line 1092 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_RELAY(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("relay", driver.loc_); } } YY_BREAK case 103: YY_RULE_SETUP #line 1102 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::RELAY: case isc::dhcp::Parser4Context::RESERVATIONS: return isc::dhcp::Dhcp4Parser::make_IP_ADDRESS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("ip-address", driver.loc_); } } YY_BREAK case 104: YY_RULE_SETUP #line 1112 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::RELAY: return isc::dhcp::Dhcp4Parser::make_IP_ADDRESSES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("ip-addresses", driver.loc_); } } YY_BREAK case 105: YY_RULE_SETUP #line 1121 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_HOOKS_LIBRARIES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("hooks-libraries", driver.loc_); } } YY_BREAK case 106: YY_RULE_SETUP #line 1131 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::HOOKS_LIBRARIES: return isc::dhcp::Dhcp4Parser::make_PARAMETERS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("parameters", driver.loc_); } } YY_BREAK case 107: YY_RULE_SETUP #line 1140 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::HOOKS_LIBRARIES: return isc::dhcp::Dhcp4Parser::make_LIBRARY(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("library", driver.loc_); } } YY_BREAK case 108: YY_RULE_SETUP #line 1149 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_EXPIRED_LEASES_PROCESSING(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("expired-leases-processing", driver.loc_); } } YY_BREAK case 109: YY_RULE_SETUP #line 1158 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::EXPIRED_LEASES_PROCESSING: return isc::dhcp::Dhcp4Parser::make_RECLAIM_TIMER_WAIT_TIME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("reclaim-timer-wait-time", driver.loc_); } } YY_BREAK case 110: YY_RULE_SETUP #line 1167 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::EXPIRED_LEASES_PROCESSING: return isc::dhcp::Dhcp4Parser::make_FLUSH_RECLAIMED_TIMER_WAIT_TIME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("flush-reclaimed-timer-wait-time", driver.loc_); } } YY_BREAK case 111: YY_RULE_SETUP #line 1176 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::EXPIRED_LEASES_PROCESSING: return isc::dhcp::Dhcp4Parser::make_HOLD_RECLAIMED_TIME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("hold-reclaimed-time", driver.loc_); } } YY_BREAK case 112: YY_RULE_SETUP #line 1185 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::EXPIRED_LEASES_PROCESSING: return isc::dhcp::Dhcp4Parser::make_MAX_RECLAIM_LEASES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("max-reclaim-leases", driver.loc_); } } YY_BREAK case 113: YY_RULE_SETUP #line 1194 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::EXPIRED_LEASES_PROCESSING: return isc::dhcp::Dhcp4Parser::make_MAX_RECLAIM_TIME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("max-reclaim-time", driver.loc_); } } YY_BREAK case 114: YY_RULE_SETUP #line 1203 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::EXPIRED_LEASES_PROCESSING: return isc::dhcp::Dhcp4Parser::make_UNWARNED_RECLAIM_CYCLES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("unwarned-reclaim-cycles", driver.loc_); } } YY_BREAK case 115: YY_RULE_SETUP #line 1212 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_DHCP4O6_PORT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("dhcp4o6-port", driver.loc_); } } YY_BREAK case 116: YY_RULE_SETUP #line 1221 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_CONTROL_SOCKET(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("control-socket", driver.loc_); } } YY_BREAK case 117: YY_RULE_SETUP #line 1230 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CONTROL_SOCKET: return isc::dhcp::Dhcp4Parser::make_SOCKET_TYPE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("socket-type", driver.loc_); } } YY_BREAK case 118: YY_RULE_SETUP #line 1239 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CONTROL_SOCKET: return isc::dhcp::Dhcp4Parser::make_SOCKET_NAME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("socket-name", driver.loc_); } } YY_BREAK case 119: YY_RULE_SETUP #line 1248 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_DHCP_QUEUE_CONTROL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("dhcp-queue-control", driver.loc_); } } YY_BREAK case 120: YY_RULE_SETUP #line 1257 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_DHCP_DDNS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("dhcp-ddns", driver.loc_); } } YY_BREAK case 121: YY_RULE_SETUP #line 1266 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_ENABLE_UPDATES(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("enable-updates", driver.loc_); } } YY_BREAK case 122: YY_RULE_SETUP #line 1275 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_QUALIFYING_SUFFIX(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("qualifying-suffix", driver.loc_); } } YY_BREAK case 123: YY_RULE_SETUP #line 1284 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_SERVER_IP(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("server-ip", driver.loc_); } } YY_BREAK case 124: YY_RULE_SETUP #line 1293 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_SERVER_PORT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("server-port", driver.loc_); } } YY_BREAK case 125: YY_RULE_SETUP #line 1302 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_SENDER_IP(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("sender-ip", driver.loc_); } } YY_BREAK case 126: YY_RULE_SETUP #line 1311 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_SENDER_PORT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("sender-port", driver.loc_); } } YY_BREAK case 127: YY_RULE_SETUP #line 1320 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_MAX_QUEUE_SIZE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("max-queue-size", driver.loc_); } } YY_BREAK case 128: YY_RULE_SETUP #line 1329 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_NCR_PROTOCOL(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("ncr-protocol", driver.loc_); } } YY_BREAK case 129: YY_RULE_SETUP #line 1338 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_NCR_FORMAT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("ncr-format", driver.loc_); } } YY_BREAK case 130: YY_RULE_SETUP #line 1347 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_OVERRIDE_NO_UPDATE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("override-no-update", driver.loc_); } } YY_BREAK case 131: YY_RULE_SETUP #line 1356 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_OVERRIDE_CLIENT_UPDATE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("override-client-update", driver.loc_); } } YY_BREAK case 132: YY_RULE_SETUP #line 1365 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_REPLACE_CLIENT_NAME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("replace-client-name", driver.loc_); } } YY_BREAK case 133: YY_RULE_SETUP #line 1374 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_GENERATED_PREFIX(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("generated-prefix", driver.loc_); } } YY_BREAK case 134: YY_RULE_SETUP #line 1383 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_HOSTNAME_CHAR_SET(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("hostname-char-set", driver.loc_); } } YY_BREAK case 135: YY_RULE_SETUP #line 1392 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP_DDNS: return isc::dhcp::Dhcp4Parser::make_HOSTNAME_CHAR_REPLACEMENT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("hostname-char-replacement", driver.loc_); } } YY_BREAK case 136: YY_RULE_SETUP #line 1401 "dhcp4_lexer.ll" { /* dhcp-ddns value keywords are case insensitive */ if (driver.ctx_ == isc::dhcp::Parser4Context::NCR_PROTOCOL) { return isc::dhcp::Dhcp4Parser::make_UDP(driver.loc_); } std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); return isc::dhcp::Dhcp4Parser::make_STRING(tmp, driver.loc_); } YY_BREAK case 137: YY_RULE_SETUP #line 1411 "dhcp4_lexer.ll" { /* dhcp-ddns value keywords are case insensitive */ if (driver.ctx_ == isc::dhcp::Parser4Context::NCR_PROTOCOL) { return isc::dhcp::Dhcp4Parser::make_TCP(driver.loc_); } std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); return isc::dhcp::Dhcp4Parser::make_STRING(tmp, driver.loc_); } YY_BREAK case 138: YY_RULE_SETUP #line 1421 "dhcp4_lexer.ll" { /* dhcp-ddns value keywords are case insensitive */ if (driver.ctx_ == isc::dhcp::Parser4Context::NCR_FORMAT) { return isc::dhcp::Dhcp4Parser::make_JSON(driver.loc_); } std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); return isc::dhcp::Dhcp4Parser::make_STRING(tmp, driver.loc_); } YY_BREAK case 139: YY_RULE_SETUP #line 1431 "dhcp4_lexer.ll" { /* dhcp-ddns value keywords are case insensitive */ if (driver.ctx_ == isc::dhcp::Parser4Context::REPLACE_CLIENT_NAME) { return isc::dhcp::Dhcp4Parser::make_WHEN_PRESENT(driver.loc_); } std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); return isc::dhcp::Dhcp4Parser::make_STRING(tmp, driver.loc_); } YY_BREAK case 140: YY_RULE_SETUP #line 1441 "dhcp4_lexer.ll" { /* dhcp-ddns value keywords are case insensitive */ if (driver.ctx_ == isc::dhcp::Parser4Context::REPLACE_CLIENT_NAME) { return isc::dhcp::Dhcp4Parser::make_WHEN_PRESENT(driver.loc_); } std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); return isc::dhcp::Dhcp4Parser::make_STRING(tmp, driver.loc_); } YY_BREAK case 141: YY_RULE_SETUP #line 1451 "dhcp4_lexer.ll" { /* dhcp-ddns value keywords are case insensitive */ if (driver.ctx_ == isc::dhcp::Parser4Context::REPLACE_CLIENT_NAME) { return isc::dhcp::Dhcp4Parser::make_NEVER(driver.loc_); } std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); return isc::dhcp::Dhcp4Parser::make_STRING(tmp, driver.loc_); } YY_BREAK case 142: YY_RULE_SETUP #line 1461 "dhcp4_lexer.ll" { /* dhcp-ddns value keywords are case insensitive */ if (driver.ctx_ == isc::dhcp::Parser4Context::REPLACE_CLIENT_NAME) { return isc::dhcp::Dhcp4Parser::make_NEVER(driver.loc_); } std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); return isc::dhcp::Dhcp4Parser::make_STRING(tmp, driver.loc_); } YY_BREAK case 143: YY_RULE_SETUP #line 1471 "dhcp4_lexer.ll" { /* dhcp-ddns value keywords are case insensitive */ if (driver.ctx_ == isc::dhcp::Parser4Context::REPLACE_CLIENT_NAME) { return isc::dhcp::Dhcp4Parser::make_ALWAYS(driver.loc_); } std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); return isc::dhcp::Dhcp4Parser::make_STRING(tmp, driver.loc_); } YY_BREAK case 144: YY_RULE_SETUP #line 1481 "dhcp4_lexer.ll" { /* dhcp-ddns value keywords are case insensitive */ if (driver.ctx_ == isc::dhcp::Parser4Context::REPLACE_CLIENT_NAME) { return isc::dhcp::Dhcp4Parser::make_WHEN_NOT_PRESENT(driver.loc_); } std::string tmp(yytext+1); tmp.resize(tmp.size() - 1); return isc::dhcp::Dhcp4Parser::make_STRING(tmp, driver.loc_); } YY_BREAK case 145: YY_RULE_SETUP #line 1491 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CONFIG: return isc::dhcp::Dhcp4Parser::make_DHCP6(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("Dhcp6", driver.loc_); } } YY_BREAK case 146: YY_RULE_SETUP #line 1500 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CONFIG: return isc::dhcp::Dhcp4Parser::make_DHCPDDNS(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("DhcpDdns", driver.loc_); } } YY_BREAK case 147: YY_RULE_SETUP #line 1509 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::CONFIG: return isc::dhcp::Dhcp4Parser::make_CONTROL_AGENT(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("Control-agent", driver.loc_); } } YY_BREAK case 148: YY_RULE_SETUP #line 1518 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: return isc::dhcp::Dhcp4Parser::make_SUBNET_4O6_INTERFACE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("4o6-interface", driver.loc_); } } YY_BREAK case 149: YY_RULE_SETUP #line 1527 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: return isc::dhcp::Dhcp4Parser::make_SUBNET_4O6_INTERFACE_ID(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("4o6-interface-id", driver.loc_); } } YY_BREAK case 150: YY_RULE_SETUP #line 1536 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::SUBNET4: return isc::dhcp::Dhcp4Parser::make_SUBNET_4O6_SUBNET(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("4o6-subnet", driver.loc_); } } YY_BREAK case 151: YY_RULE_SETUP #line 1545 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: return isc::dhcp::Dhcp4Parser::make_ECHO_CLIENT_ID(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("echo-client-id", driver.loc_); } } YY_BREAK case 152: YY_RULE_SETUP #line 1554 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_MATCH_CLIENT_ID(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("match-client-id", driver.loc_); } } YY_BREAK case 153: YY_RULE_SETUP #line 1565 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: return isc::dhcp::Dhcp4Parser::make_AUTHORITATIVE(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("authoritative", driver.loc_); } } YY_BREAK case 154: YY_RULE_SETUP #line 1576 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: case isc::dhcp::Parser4Context::RESERVATIONS: case isc::dhcp::Parser4Context::CLIENT_CLASSES: return isc::dhcp::Dhcp4Parser::make_NEXT_SERVER(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("next-server", driver.loc_); } } YY_BREAK case 155: YY_RULE_SETUP #line 1589 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: case isc::dhcp::Parser4Context::RESERVATIONS: case isc::dhcp::Parser4Context::CLIENT_CLASSES: return isc::dhcp::Dhcp4Parser::make_SERVER_HOSTNAME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("server-hostname", driver.loc_); } } YY_BREAK case 156: YY_RULE_SETUP #line 1602 "dhcp4_lexer.ll" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: case isc::dhcp::Parser4Context::SUBNET4: case isc::dhcp::Parser4Context::SHARED_NETWORK: case isc::dhcp::Parser4Context::RESERVATIONS: case isc::dhcp::Parser4Context::CLIENT_CLASSES: return isc::dhcp::Dhcp4Parser::make_BOOT_FILE_NAME(driver.loc_); default: return isc::dhcp::Dhcp4Parser::make_STRING("boot-file-name", driver.loc_); } } YY_BREAK case 157: YY_RULE_SETUP #line 1617 "dhcp4_lexer.ll" { /* A string has been matched. It contains the actual string and single quotes. We need to get those quotes out of the way and just use its content, e.g. for 'foo' we should get foo */ std::string raw(yytext+1); size_t len = raw.size() - 1; raw.resize(len); std::string decoded; decoded.reserve(len); for (size_t pos = 0; pos < len; ++pos) { int b = 0; char c = raw[pos]; switch (c) { case '"': /* impossible condition */ driver.error(driver.loc_, "Bad quote in \"" + raw + "\""); break; case '\\': ++pos; if (pos >= len) { /* impossible condition */ driver.error(driver.loc_, "Overflow escape in \"" + raw + "\""); } c = raw[pos]; switch (c) { case '"': case '\\': case '/': decoded.push_back(c); break; case 'b': decoded.push_back('\b'); break; case 'f': decoded.push_back('\f'); break; case 'n': decoded.push_back('\n'); break; case 'r': decoded.push_back('\r'); break; case 't': decoded.push_back('\t'); break; case 'u': /* support only \u0000 to \u00ff */ ++pos; if (pos + 4 > len) { /* impossible condition */ driver.error(driver.loc_, "Overflow unicode escape in \"" + raw + "\""); } if ((raw[pos] != '0') || (raw[pos + 1] != '0')) { driver.error(driver.loc_, "Unsupported unicode escape in \"" + raw + "\""); } pos += 2; c = raw[pos]; if ((c >= '0') && (c <= '9')) { b = (c - '0') << 4; } else if ((c >= 'A') && (c <= 'F')) { b = (c - 'A' + 10) << 4; } else if ((c >= 'a') && (c <= 'f')) { b = (c - 'a' + 10) << 4; } else { /* impossible condition */ driver.error(driver.loc_, "Not hexadecimal in unicode escape in \"" + raw + "\""); } pos++; c = raw[pos]; if ((c >= '0') && (c <= '9')) { b |= c - '0'; } else if ((c >= 'A') && (c <= 'F')) { b |= c - 'A' + 10; } else if ((c >= 'a') && (c <= 'f')) { b |= c - 'a' + 10; } else { /* impossible condition */ driver.error(driver.loc_, "Not hexadecimal in unicode escape in \"" + raw + "\""); } decoded.push_back(static_cast<char>(b & 0xff)); break; default: /* impossible condition */ driver.error(driver.loc_, "Bad escape in \"" + raw + "\""); } break; default: if ((c >= 0) && (c < 0x20)) { /* impossible condition */ driver.error(driver.loc_, "Invalid control in \"" + raw + "\""); } decoded.push_back(c); } } return isc::dhcp::Dhcp4Parser::make_STRING(decoded, driver.loc_); } YY_BREAK case 158: /* rule 158 can match eol */ YY_RULE_SETUP #line 1716 "dhcp4_lexer.ll" { /* Bad string with a forbidden control character inside */ driver.error(driver.loc_, "Invalid control in " + std::string(yytext)); } YY_BREAK case 159: /* rule 159 can match eol */ YY_RULE_SETUP #line 1721 "dhcp4_lexer.ll" { /* Bad string with a bad escape inside */ driver.error(driver.loc_, "Bad escape in " + std::string(yytext)); } YY_BREAK case 160: YY_RULE_SETUP #line 1726 "dhcp4_lexer.ll" { /* Bad string with an open escape at the end */ driver.error(driver.loc_, "Overflow escape in " + std::string(yytext)); } YY_BREAK case 161: YY_RULE_SETUP #line 1731 "dhcp4_lexer.ll" { return isc::dhcp::Dhcp4Parser::make_LSQUARE_BRACKET(driver.loc_); } YY_BREAK case 162: YY_RULE_SETUP #line 1732 "dhcp4_lexer.ll" { return isc::dhcp::Dhcp4Parser::make_RSQUARE_BRACKET(driver.loc_); } YY_BREAK case 163: YY_RULE_SETUP #line 1733 "dhcp4_lexer.ll" { return isc::dhcp::Dhcp4Parser::make_LCURLY_BRACKET(driver.loc_); } YY_BREAK case 164: YY_RULE_SETUP #line 1734 "dhcp4_lexer.ll" { return isc::dhcp::Dhcp4Parser::make_RCURLY_BRACKET(driver.loc_); } YY_BREAK case 165: YY_RULE_SETUP #line 1735 "dhcp4_lexer.ll" { return isc::dhcp::Dhcp4Parser::make_COMMA(driver.loc_); } YY_BREAK case 166: YY_RULE_SETUP #line 1736 "dhcp4_lexer.ll" { return isc::dhcp::Dhcp4Parser::make_COLON(driver.loc_); } YY_BREAK case 167: YY_RULE_SETUP #line 1738 "dhcp4_lexer.ll" { /* An integer was found. */ std::string tmp(yytext); int64_t integer = 0; try { /* In substring we want to use negative values (e.g. -1). In enterprise-id we need to use values up to 0xffffffff. To cover both of those use cases, we need at least int64_t. */ integer = boost::lexical_cast<int64_t>(tmp); } catch (const boost::bad_lexical_cast &) { driver.error(driver.loc_, "Failed to convert " + tmp + " to an integer."); } /* The parser needs the string form as double conversion is no lossless */ return isc::dhcp::Dhcp4Parser::make_INTEGER(integer, driver.loc_); } YY_BREAK case 168: YY_RULE_SETUP #line 1756 "dhcp4_lexer.ll" { /* A floating point was found. */ std::string tmp(yytext); double fp = 0.0; try { fp = boost::lexical_cast<double>(tmp); } catch (const boost::bad_lexical_cast &) { driver.error(driver.loc_, "Failed to convert " + tmp + " to a floating point."); } return isc::dhcp::Dhcp4Parser::make_FLOAT(fp, driver.loc_); } YY_BREAK case 169: YY_RULE_SETUP #line 1769 "dhcp4_lexer.ll" { string tmp(yytext); return isc::dhcp::Dhcp4Parser::make_BOOLEAN(tmp == "true", driver.loc_); } YY_BREAK case 170: YY_RULE_SETUP #line 1774 "dhcp4_lexer.ll" { return isc::dhcp::Dhcp4Parser::make_NULL_TYPE(driver.loc_); } YY_BREAK case 171: YY_RULE_SETUP #line 1778 "dhcp4_lexer.ll" driver.error (driver.loc_, "JSON true reserved keyword is lower case only"); YY_BREAK case 172: YY_RULE_SETUP #line 1780 "dhcp4_lexer.ll" driver.error (driver.loc_, "JSON false reserved keyword is lower case only"); YY_BREAK case 173: YY_RULE_SETUP #line 1782 "dhcp4_lexer.ll" driver.error (driver.loc_, "JSON null reserved keyword is lower case only"); YY_BREAK case 174: YY_RULE_SETUP #line 1784 "dhcp4_lexer.ll" driver.error (driver.loc_, "Invalid character: " + std::string(yytext)); YY_BREAK case YY_STATE_EOF(INITIAL): #line 1786 "dhcp4_lexer.ll" { if (driver.states_.empty()) { return isc::dhcp::Dhcp4Parser::make_END(driver.loc_); } driver.loc_ = driver.locs_.back(); driver.locs_.pop_back(); driver.file_ = driver.files_.back(); driver.files_.pop_back(); if (driver.sfile_) { fclose(driver.sfile_); driver.sfile_ = 0; } if (!driver.sfiles_.empty()) { driver.sfile_ = driver.sfiles_.back(); driver.sfiles_.pop_back(); } parser4__delete_buffer(YY_CURRENT_BUFFER); parser4__switch_to_buffer(driver.states_.back()); driver.states_.pop_back(); BEGIN(DIR_EXIT); } YY_BREAK case 175: YY_RULE_SETUP #line 1809 "dhcp4_lexer.ll" ECHO; YY_BREAK #line 4390 "dhcp4_lexer.cc" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; /* %if-c-only */ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; /* %endif */ /* %if-c++-only */ /* %endif */ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ /* %ok-for-header */ /* %if-c++-only */ /* %not-for-header */ /* %ok-for-header */ /* %endif */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ /* %if-c-only */ static int yy_get_next_buffer (void) /* %endif */ /* %if-c++-only */ /* %endif */ { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc( (void *) b->yy_ch_buf, (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ /* %if-c-only */ /* %not-for-header */ static yy_state_type yy_get_previous_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { yy_state_type yy_current_state; char *yy_cp; /* %% [15.0] code to get the start state into yy_current_state goes here */ yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { /* %% [16.0] code to find the next state goes here */ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1468 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ /* %if-c-only */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) /* %endif */ /* %if-c++-only */ /* %endif */ { int yy_is_jam; /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ char *yy_cp = (yy_c_buf_p); YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1468 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 1467); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT /* %if-c-only */ /* %endif */ #endif /* %if-c-only */ #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif /* %endif */ /* %if-c++-only */ /* %endif */ { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); /* %% [19.0] update BOL and yylineno */ return c; } /* %if-c-only */ #endif /* ifndef YY_NO_INPUT */ /* %endif */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ /* %if-c-only */ void yyrestart (FILE * input_file ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_init_buffer( YY_CURRENT_BUFFER, input_file ); yy_load_buffer_state( ); } /* %if-c++-only */ /* %endif */ /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ /* %if-c-only */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) /* %endif */ /* %if-c++-only */ /* %endif */ { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } /* %if-c-only */ static void yy_load_buffer_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; /* %if-c-only */ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; /* %endif */ /* %if-c++-only */ /* %endif */ (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ /* %if-c-only */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) /* %endif */ /* %if-c++-only */ /* %endif */ { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } /* %if-c++-only */ /* %endif */ /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ /* %if-c-only */ void yy_delete_buffer (YY_BUFFER_STATE b ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf ); yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ /* %if-c-only */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) /* %endif */ /* %if-c++-only */ /* %endif */ { int oerrno = errno; yy_flush_buffer( b ); /* %if-c-only */ b->yy_input_file = file; /* %endif */ /* %if-c++-only */ /* %endif */ b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } /* %if-c-only */ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; /* %endif */ /* %if-c++-only */ /* %endif */ errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ /* %if-c-only */ void yy_flush_buffer (YY_BUFFER_STATE b ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /* %if-c-or-c++ */ /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ /* %if-c-only */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) /* %endif */ /* %if-c++-only */ /* %endif */ { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /* %endif */ /* %if-c-or-c++ */ /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ /* %if-c-only */ void yypop_buffer_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* %endif */ /* %if-c-or-c++ */ /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ /* %if-c-only */ static void yyensure_buffer_stack (void) /* %endif */ /* %if-c++-only */ /* %endif */ { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } /* %endif */ #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif /* %if-c-only */ static void yynoreturn yy_fatal_error (const char* msg ) { fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* %endif */ /* %if-c++-only */ /* %endif */ /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /* %if-c-only */ /* %if-reentrant */ /* %endif */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /* %if-reentrant */ /* %endif */ /** Set the current line number. * @param _line_number line number * */ void yyset_lineno (int _line_number ) { yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) { yyin = _in_str ; } void yyset_out (FILE * _out_str ) { yyout = _out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int _bdebug ) { yy_flex_debug = _bdebug ; } /* %endif */ /* %if-reentrant */ /* %if-bison-bridge */ /* %endif */ /* %endif if-c-only */ /* %if-c-only */ static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = NULL; yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* %endif */ /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); /* %if-reentrant */ /* %endif */ return 0; } /* %endif */ /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return realloc(ptr, size); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } /* %if-tables-serialization definitions */ /* %define-yytables The name for this specific scanner's tables. */ #define YYTABLES_NAME "yytables" /* %endif */ /* %ok-for-header */ #line 1809 "dhcp4_lexer.ll" using namespace isc::dhcp; void Parser4Context::scanStringBegin(const std::string& str, ParserType parser_type) { start_token_flag = true; start_token_value = parser_type; file_ = "<string>"; sfile_ = 0; loc_.initialize(&file_); yy_flex_debug = trace_scanning_; YY_BUFFER_STATE buffer; buffer = parser4__scan_bytes(str.c_str(), str.size()); if (!buffer) { fatal("cannot scan string"); /* fatal() throws an exception so this can't be reached */ } } void Parser4Context::scanFileBegin(FILE * f, const std::string& filename, ParserType parser_type) { start_token_flag = true; start_token_value = parser_type; file_ = filename; sfile_ = f; loc_.initialize(&file_); yy_flex_debug = trace_scanning_; YY_BUFFER_STATE buffer; /* See dhcp4_lexer.cc header for available definitions */ buffer = parser4__create_buffer(f, 65536 /*buffer size*/); if (!buffer) { fatal("cannot scan file " + filename); } parser4__switch_to_buffer(buffer); } void Parser4Context::scanEnd() { if (sfile_) fclose(sfile_); sfile_ = 0; static_cast<void>(parser4_lex_destroy()); /* Close files */ while (!sfiles_.empty()) { FILE* f = sfiles_.back(); if (f) { fclose(f); } sfiles_.pop_back(); } /* Delete states */ while (!states_.empty()) { parser4__delete_buffer(states_.back()); states_.pop_back(); } } void Parser4Context::includeFile(const std::string& filename) { if (states_.size() > 10) { fatal("Too many nested include."); } FILE* f = fopen(filename.c_str(), "r"); if (!f) { fatal("Can't open include file " + filename); } if (sfile_) { sfiles_.push_back(sfile_); } sfile_ = f; states_.push_back(YY_CURRENT_BUFFER); YY_BUFFER_STATE buffer; buffer = parser4__create_buffer(f, 65536 /*buffer size*/); if (!buffer) { fatal( "Can't scan include file " + filename); } parser4__switch_to_buffer(buffer); files_.push_back(file_); file_ = filename; locs_.push_back(loc_); loc_.initialize(&file_); BEGIN(INITIAL); } namespace { /** To avoid unused function error */ class Dummy { /* cppcheck-suppress unusedPrivateFunction */ void dummy() { yy_fatal_error("Fix me: how to disable its definition?"); } }; } #endif /* !__clang_analyzer__ */
31.63172
102
0.591329
99498d75c3ba0878a454dc0cf2205c6eba578045
5,362
cpp
C++
thirdparty/qtiplot/qtiplot/src/matrix/MatrixSizeDialog.cpp
hoehnp/SpaceDesignTool
9abd34048274b2ce9dbbb685124177b02d6a34ca
[ "IJG" ]
6
2018-09-05T12:41:59.000Z
2021-07-01T05:34:23.000Z
thirdparty/qtiplot/qtiplot/src/matrix/MatrixSizeDialog.cpp
hoehnp/SpaceDesignTool
9abd34048274b2ce9dbbb685124177b02d6a34ca
[ "IJG" ]
2
2015-02-07T19:09:21.000Z
2015-08-14T03:15:42.000Z
thirdparty/qtiplot/qtiplot/src/matrix/MatrixSizeDialog.cpp
hoehnp/SpaceDesignTool
9abd34048274b2ce9dbbb685124177b02d6a34ca
[ "IJG" ]
2
2015-03-25T15:50:31.000Z
2017-12-06T12:16:47.000Z
/*************************************************************************** File : MatrixSizeDialog.cpp Project : QtiPlot -------------------------------------------------------------------- Copyright : (C) 2004-2008 by Ion Vasilief Email (use @ for *) : ion_vasilief*yahoo.fr Description : Matrix dimensions dialog ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * ***************************************************************************/ #include "MatrixSizeDialog.h" #include "MatrixCommand.h" #include "../DoubleSpinBox.h" #include <QPushButton> #include <QLabel> #include <QGroupBox> #include <QSpinBox> #include <QMessageBox> #include <QLayout> MatrixSizeDialog::MatrixSizeDialog( Matrix *m, QWidget* parent, Qt::WFlags fl ) : QDialog( parent, fl ), d_matrix(m) { setWindowTitle(tr("QtiPlot - Matrix Dimensions")); groupBox1 = new QGroupBox(tr("Dimensions")); QHBoxLayout *topLayout = new QHBoxLayout(groupBox1); topLayout->addWidget( new QLabel(tr( "Rows" )) ); boxRows = new QSpinBox(); boxRows->setRange(1, 1000000); topLayout->addWidget(boxRows); topLayout->addStretch(); topLayout->addWidget( new QLabel(tr( "Columns" )) ); boxCols = new QSpinBox(); boxCols->setRange(1, 1000000); topLayout->addWidget(boxCols); groupBox2 = new QGroupBox(tr("Coordinates")); QGridLayout *centerLayout = new QGridLayout(groupBox2); centerLayout->addWidget( new QLabel(tr( "X (Columns)" )), 0, 1 ); centerLayout->addWidget( new QLabel(tr( "Y (Rows)" )), 0, 2 ); centerLayout->addWidget( new QLabel(tr( "First" )), 1, 0 ); QLocale locale = m->locale(); boxXStart = new DoubleSpinBox(); boxXStart->setLocale(locale); centerLayout->addWidget( boxXStart, 1, 1 ); boxYStart = new DoubleSpinBox(); boxYStart->setLocale(locale); centerLayout->addWidget( boxYStart, 1, 2 ); centerLayout->addWidget( new QLabel(tr( "Last" )), 2, 0 ); boxXEnd = new DoubleSpinBox(); boxXEnd->setLocale(locale); centerLayout->addWidget( boxXEnd, 2, 1 ); boxYEnd = new DoubleSpinBox(); boxYEnd->setLocale(locale); centerLayout->addWidget( boxYEnd, 2, 2 ); centerLayout->setRowStretch(3, 1); QHBoxLayout *bottomLayout = new QHBoxLayout(); bottomLayout->addStretch(); buttonApply = new QPushButton(tr("&Apply")); buttonApply->setDefault( true ); bottomLayout->addWidget(buttonApply); buttonOk = new QPushButton(tr("&OK")); bottomLayout->addWidget( buttonOk ); buttonCancel = new QPushButton(tr("&Cancel")); bottomLayout->addWidget( buttonCancel ); QVBoxLayout * mainLayout = new QVBoxLayout( this ); mainLayout->addWidget(groupBox1); mainLayout->addWidget(groupBox2); mainLayout->addLayout(bottomLayout); boxRows->setValue(m->numRows()); boxCols->setValue(m->numCols()); boxXStart->setValue(m->xStart()); boxYStart->setValue(m->yStart()); boxXEnd->setValue(m->xEnd()); boxYEnd->setValue(m->yEnd()); connect( buttonApply, SIGNAL(clicked()), this, SLOT(apply())); connect( buttonOk, SIGNAL(clicked()), this, SLOT(accept() )); connect( buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); } void MatrixSizeDialog::apply() { double fromX = boxXStart->value(); double toX = boxXEnd->value(); double fromY = boxYStart->value(); double toY = boxYEnd->value(); double oxs = d_matrix->xStart(); double oxe = d_matrix->xEnd(); double oys = d_matrix->yStart(); double oye = d_matrix->yEnd(); if(oxs != fromX || oxe != toX || oys != fromY || oye != toY){ d_matrix->undoStack()->push(new MatrixSetCoordinatesCommand(d_matrix, oxs, oxe, oys, oye, fromX, toX, fromY, toY, tr("Set Coordinates x[%1 : %2], y[%3 : %4]").arg(fromX).arg(toX).arg(fromY).arg(toY))); d_matrix->setCoordinates(fromX, toX, fromY, toY); } d_matrix->setDimensions(boxRows->value(), boxCols->value()); } void MatrixSizeDialog::accept() { apply(); close(); }
39.426471
111
0.560425
9949a2dfaf008c365fbe6fbb12b10e581e36e2fb
4,382
cpp
C++
gui/widgets/knob.cpp
goossens/ObjectTalk
ca1d4f558b5ad2459b376102744d52c6283ec108
[ "MIT" ]
6
2021-11-12T15:03:53.000Z
2022-01-28T18:30:33.000Z
gui/widgets/knob.cpp
goossens/ObjectTalk
ca1d4f558b5ad2459b376102744d52c6283ec108
[ "MIT" ]
null
null
null
gui/widgets/knob.cpp
goossens/ObjectTalk
ca1d4f558b5ad2459b376102744d52c6283ec108
[ "MIT" ]
null
null
null
// ObjectTalk Scripting Language // Copyright (c) 1993-2022 Johan A. Goossens. All rights reserved. // // This work is licensed under the terms of the MIT license. // For a copy, see <https://opensource.org/licenses/MIT>. // // Include files // #include "ot/function.h" #include "ot/vm.h" #include "knob.h" // // OtKnobClass::init // OtObject callback; OtObject OtKnobClass::init(size_t count, OtObject* parameters) { switch (count) { case 4: setCallback(parameters[3]); case 3: setLabel(parameters[2]->operator std::string()); case 2: setMargin(parameters[1]->operator int()); case 1: setTexture(parameters[0]); case 0: break; default: OtExcept("[Knob] constructor expects up to 4 arguments (not %ld)", count); } return nullptr; } // // OtKnobClass::setTexture // OtObject OtKnobClass::setTexture(OtObject object) { // a texture can be a texture object or the name of an inamge file if (object->isKindOf("Texture")) { texture = object->cast<OtTextureClass>(); } else if (object->isKindOf("String")) { texture = OtTextureClass::create(); texture->loadImage(object->operator std::string()); } else { OtExcept("Expected a [Texture] or [String] object, not a [%s]", object->getType()->getName().c_str()); } return shared(); } // // OtKnobClass::setMargin // OtObject OtKnobClass::setMargin(int m) { margin = m; return shared(); } // // OtKnobClass::setLabel // OtObject OtKnobClass::setLabel(const std::string& l) { label = l; return shared(); } // // OtKnobClass::setCallback // OtObject OtKnobClass::setCallback(OtObject c) { callback = c; return shared(); } // // OtKnobClass::render // void OtKnobClass::render() { // add margin if required if (margin) { ImGui::Dummy(ImVec2(0, margin)); } // ensure we have a texture if (texture) { // calculate image dimensions float width = texture->getWidth(); float fullHeight = texture->getHeight(); float steps = fullHeight / width; float height = fullHeight / steps; // calculate position float indent = ImGui::GetCursorPosX(); float availableSpace = ImGui::GetWindowSize().x - indent; ImVec2 pos = ImVec2(indent + (availableSpace - width) / 2, ImGui::GetCursorPosY()); // setup new widget ImGui::PushID((void*) this); ImGui::SetCursorPos(pos); ImGui::InvisibleButton("", ImVec2(width, height), 0); ImGuiIO& io = ImGui::GetIO(); // detect mouse activity if (ImGui::IsItemActive() && io.MouseDelta.y != 0.0) { auto newValue = OtClamp(value - io.MouseDelta.y / 2.0, 0.0, 100.0); // call user callback if value has changed if (callback && newValue != value) { OtVM::callMemberFunction(callback, "__call__", OtObjectCreate(value)); } value = newValue; } ImGui::PopID(); // render correct frame of image strip ImGui::SetCursorPos(pos); float offset1 = std::floor(value / 100.0 * (steps - 1)) * height; float offset2 = offset1 + height; ImGui::Image( (void*)(intptr_t) texture->getTextureHandle().idx, ImVec2(width, height), ImVec2(0, offset1 / fullHeight), ImVec2(1, offset2 / fullHeight)); // render label if required if (label.size()) { ImGui::Dummy(ImVec2(0, 5)); ImVec2 size = ImGui::CalcTextSize(label.c_str()); ImVec2 pos = ImGui::GetCursorPos(); ImGui::SetCursorPos(ImVec2(indent + (availableSpace - size.x) / 2, pos.y)); ImGui::TextUnformatted(label.c_str()); } } // add margin if required if (margin) { ImGui::Dummy(ImVec2(0, margin)); } } // // OtKnobClass::getMeta // OtType OtKnobClass::getMeta() { static OtType type = nullptr; if (!type) { type = OtTypeClass::create<OtKnobClass>("Knob", OtWidgetClass::getMeta()); type->set("__init__", OtFunctionClass::create(&OtKnobClass::init)); type->set("setTexture", OtFunctionClass::create(&OtKnobClass::setTexture)); type->set("setMargin", OtFunctionClass::create(&OtKnobClass::setMargin)); type->set("setLabel", OtFunctionClass::create(&OtKnobClass::setLabel)); type->set("setCallback", OtFunctionClass::create(&OtKnobClass::setCallback)); type->set("setValue", OtFunctionClass::create(&OtKnobClass::setValue)); type->set("getValue", OtFunctionClass::create(&OtKnobClass::getValue)); } return type; } // // OtKnobClass::create // OtKnob OtKnobClass::create() { OtKnob knob = std::make_shared<OtKnobClass>(); knob->setType(getMeta()); return knob; }
21.586207
104
0.67298
994e733f0a3ca96b7a7c1ed762019b524d211c9f
1,206
cpp
C++
hardway/ex2.cpp
mgalushka/cpp-start
a7af1668291ffd1c1b606310714880dcbefb3ea5
[ "MIT" ]
null
null
null
hardway/ex2.cpp
mgalushka/cpp-start
a7af1668291ffd1c1b606310714880dcbefb3ea5
[ "MIT" ]
null
null
null
hardway/ex2.cpp
mgalushka/cpp-start
a7af1668291ffd1c1b606310714880dcbefb3ea5
[ "MIT" ]
null
null
null
#include <string> #include <iostream> #include <stdint.h> #include <stdlib.h> uint32_t* reverse_array(uint32_t length, uint32_t* input); void print_array(uint32_t length, uint32_t* input); int main(int argc, char* argv[]){ std::string str = "This is string"; std::cout << "Length(" << str << ") = " << str.length() << "\n"; uint32_t L = 10; uint32_t* input = (uint32_t*) malloc(L * sizeof(uint32_t)); for(uint32_t i = 0; i < L; i++){ input[i] = 3 * i; } print_array(L, input); input = reverse_array(L, input); print_array(L, input); free(input); return 0; } uint32_t* reverse_array(uint32_t length, uint32_t* input){ if (length <= 1){ return input; } uint32_t* result = (uint32_t*) malloc(length * sizeof(uint32_t)); for (uint32_t i = 0; i < length / 2; i++) { result[length - 1 - i] = input[i]; result[i] = input[length - 1 - i]; } free(input); return result; } void print_array(uint32_t length, uint32_t* input){ for (uint32_t i = 0; i < length; i++) { std::cout << input[i]; if (i < (length - 1)){ std::cout << ", "; } } std::cout << "\n"; }
24.12
69
0.554726
995085d5b9ee461af1ed4d74528789e6d8bef94e
7,773
cpp
C++
Motor2D/j1Pathfinding.cpp
Gerard346/Game-Dev2019
3e927070ff2ba8b07de2dc4d56de63a6ffd4fb84
[ "MIT" ]
null
null
null
Motor2D/j1Pathfinding.cpp
Gerard346/Game-Dev2019
3e927070ff2ba8b07de2dc4d56de63a6ffd4fb84
[ "MIT" ]
null
null
null
Motor2D/j1Pathfinding.cpp
Gerard346/Game-Dev2019
3e927070ff2ba8b07de2dc4d56de63a6ffd4fb84
[ "MIT" ]
null
null
null
#include "p2Defs.h" #include "p2Log.h" #include "j1App.h" #include "j1Render.h" #include "j1Textures.h" #include "j1Pathfinding.h" #include "j1Map.h" #include <math.h> #include "j1Input.h" #include "j1Window.h" j1Pathfinding::j1Pathfinding() : j1Module() { name.create("pathfinding"); } // Destructor j1Pathfinding::~j1Pathfinding() {} // Called before render is available bool j1Pathfinding::Awake(const pugi::xml_node& config) { bool ret = true; str_load_tex = (char*)config.child("debug_texture").child_value(); ResetPath(); return ret; } bool j1Pathfinding::Start() { debug_tex = App->tex->Load(str_load_tex); return true; } bool j1Pathfinding::PreUpdate() { return true; } bool j1Pathfinding::Update(float f) { Draw(); return true; } void j1Pathfinding::ResetPath() { path.Clear(); frontier.Clear(); visited.clear(); breadcrumbs.clear(); memset(cost_so_far, 0, sizeof(uint) * COST_MAP * COST_MAP); } void j1Pathfinding::Path(int x, int y) { path.Clear(); iPoint goal = App->map->WorldToMap(x, y); int goal_index = visited.find(goal); if (goal_index == -1) { return; } path.PushBack(goal); while (true) { path.PushBack(breadcrumbs[goal_index]); goal_index = visited.find(breadcrumbs[goal_index]); if (visited[goal_index] == breadcrumbs[goal_index]) { break; } } } void j1Pathfinding::PropagateASTAR(iPoint origin, iPoint goal) { BROFILER_CATEGORY("A star", Profiler::Color::Black); iPoint map_goal = App->map->WorldToMap(goal.x, goal.y); ResetPath(); if (walkability_layer == nullptr) { return; } iPoint map_origin = App->map->WorldToMap(origin.x, origin.y); frontier.Push(map_origin, 0); visited.add(map_origin); breadcrumbs.add(map_origin); while (frontier.Count() > 0) { iPoint curr; if (frontier.Pop(curr)) { iPoint neighbors[4]; neighbors[0].create(curr.x + 1, curr.y + 0); neighbors[1].create(curr.x + 0, curr.y + 1); neighbors[2].create(curr.x - 1, curr.y + 0); neighbors[3].create(curr.x + 0, curr.y - 1); for (uint i = 0; i < 4; ++i) { int neighbor_cost = MovementCost(neighbors[i].x, neighbors[i].y); if (neighbor_cost > 0) { if (visited.find(neighbors[i]) == -1) { int x_distance = map_goal.x > neighbors[i].x ? map_goal.x - neighbors[i].x : neighbors[i].x - map_goal.x; int y_distance = map_goal.y > neighbors[i].y ? map_goal.y - neighbors[i].y : neighbors[i].y - map_goal.y; frontier.Push(neighbors[i], neighbor_cost + cost_so_far[neighbors[i].x][neighbors[i].y] + x_distance + y_distance); visited.add(neighbors[i]); breadcrumbs.add(curr); cost_so_far[neighbors[i].x][neighbors[i].y] = neighbor_cost; if (neighbors[i].x == map_goal.x && neighbors[i].y == map_goal.y) { Path(goal.x, goal.y); return; } } } } } } } bool j1Pathfinding::PropagateASTARf(fPoint origin, fPoint goal, p2DynArray<iPoint>& ref) { iPoint map_goal = App->map->WorldToMap(goal.x, goal.y); ResetPath(); if (walkability_layer == nullptr) { return false; } iPoint map_origin = App->map->WorldToMap(origin.x, origin.y); frontier.Push(map_origin, 0); visited.add(map_origin); breadcrumbs.add(map_origin); while (frontier.Count() > 0) { iPoint curr; if (frontier.Pop(curr)) { iPoint neighbors[4]; neighbors[0].create(curr.x + 1, curr.y + 0); neighbors[1].create(curr.x + 0, curr.y + 1); neighbors[2].create(curr.x - 1, curr.y + 0); neighbors[3].create(curr.x + 0, curr.y - 1); for (uint i = 0; i < 4; ++i) { int neighbor_cost = MovementCost(neighbors[i].x, neighbors[i].y); if (neighbor_cost > 0) { if (visited.find(neighbors[i]) == -1) { int x_distance = map_goal.x > neighbors[i].x ? map_goal.x - neighbors[i].x : neighbors[i].x - map_goal.x; int y_distance = map_goal.y > neighbors[i].y ? map_goal.y - neighbors[i].y : neighbors[i].y - map_goal.y; frontier.Push(neighbors[i], neighbor_cost + cost_so_far[neighbors[i].x][neighbors[i].y] + x_distance + y_distance); visited.add(neighbors[i]); breadcrumbs.add(curr); cost_so_far[neighbors[i].x][neighbors[i].y] = neighbor_cost; if (neighbors[i].x == map_goal.x && neighbors[i].y == map_goal.y) { Path(goal.x, goal.y); if (path.Count() > 0) { ref.Clear(); for (int i = 0; i < path.Count(); i++) { ref.PushBack(*path.At(i)); } return true; } else { return false; } } } } } } } return false; } bool j1Pathfinding::CanReach(const iPoint origin, const iPoint destination) { p2List<iPoint> closed_list; p2PQueue<iPoint> open_list; open_list.Push(origin,0); uint distance_to_loop = origin.DistanceManhattan(destination) * DISTANCE_TO_REACH; while (distance_to_loop > 0) { if (PropagateBFS(origin, destination, &closed_list, &open_list)) { //LOG("TRUE"); closed_list.clear(); open_list.Clear(); return true; } distance_to_loop--; } //LOG("FALSE"); closed_list.clear(); open_list.Clear(); return false; } void j1Pathfinding::TypePathfinding(typePathfinding type) { switch (type) { case NONE: break; case WALK: walkability_layer = App->map->GetLayer("Walkability"); break; case FLY: walkability_layer = App->map->GetLayer("WalkabilityFly"); break; default: break; } } bool j1Pathfinding::IsWalkable(const iPoint& position) const { return walkability_layer->Get(position.x, position.y) > 0; } bool j1Pathfinding::PropagateBFS(const iPoint& origin, const iPoint& destination, p2List<iPoint>* closed, p2PQueue<iPoint>* open_list) { if (walkability_layer == nullptr) { return false; } p2List<iPoint>* closed_list; if (closed == nullptr) closed_list = &this->visited; else closed_list = closed; p2PQueue<iPoint>* open_l; if (open_list == nullptr) open_l = &this->frontier; else open_l = open_list; if (closed_list->find(destination) != -1) { return true; } iPoint point; if (open_l->start != NULL && closed_list->find(destination) == -1) { open_l->Pop(point); if (open_l->find(point) == -1) closed_list->add(point); iPoint neightbour[4]; neightbour[0] = { point.x - 1, point.y }; neightbour[1] = { point.x + 1, point.y }; neightbour[2] = { point.x, point.y - 1 }; neightbour[3] = { point.x, point.y + 1 }; for (uint i = 0; i < 4; i++) { if (closed_list->find(neightbour[i]) == -1 && IsWalkable(neightbour[i])) { open_l->Push(neightbour[i],0); closed_list->add(neightbour[i]); } } } return false; } int j1Pathfinding::MovementCost(int x, int y) const { int ret = -1; if (x >= 0 && x < walkability_layer->width && y >= 0 && y < walkability_layer->height) { int id = walkability_layer->Get(x, y); if (id == 6) { ret = 1; } else { ret = -1; } } return ret; } void j1Pathfinding::DrawPath() { iPoint point; // Draw visited p2List_item<iPoint>* item = visited.start; while (item) { point = item->data; iPoint pos = App->map->MapToWorld(point.x, point.y); App->render->DrawQuad({ pos.x, pos.y, 16,16}, 255, 0, 0, 150); item = item->next; } // Draw frontier for (uint i = 0; i < frontier.Count(); ++i) { point = *(frontier.Peek(i)); iPoint pos = App->map->MapToWorld(point.x, point.y); App->render->DrawQuad({ pos.x, pos.y, 16,16 }, 0, 255, 0, 150); } // Draw path for (uint i = 0; i < path.Count(); ++i) { iPoint pos = App->map->MapToWorld(path[i].x, path[i].y); App->render->DrawQuad({ pos.x, pos.y, 16,16 }, 0, 0, 255, 150); break; } } void j1Pathfinding::Draw() { if (debug) { DrawPath(); } } bool j1Pathfinding::CleanUp() { LOG("Unloading pathfinding"); ResetPath(); return true; }
20.728
134
0.63206
9952033c3c777f60050880690f73804b8b7e1b0c
2,516
hpp
C++
dLoad.hpp
dyexlzc/CppdynamicLoad
14303e2929ecc26aa16ef7f0dad7cc2d71cb3077
[ "MIT" ]
null
null
null
dLoad.hpp
dyexlzc/CppdynamicLoad
14303e2929ecc26aa16ef7f0dad7cc2d71cb3077
[ "MIT" ]
null
null
null
dLoad.hpp
dyexlzc/CppdynamicLoad
14303e2929ecc26aa16ef7f0dad7cc2d71cb3077
[ "MIT" ]
null
null
null
#ifndef _DLOAD_HPP #define _DLOAD_HPP #include <unordered_map> #include <string> #include <dlfcn.h> //加载动态库所需要的头文件 #include "interface.h" class dynamicLoader { class SoWrapper //用来包装指针 { public: interface *(*getInstanceFunc)(void); void *soPtr; SoWrapper(interface *(*fptr)(void), void *soptr) { getInstanceFunc = fptr; soPtr = soptr; } SoWrapper() {} SoWrapper(const SoWrapper &sw) { //自己写一个拷贝构造,否则map不认 this->soPtr = sw.soPtr; this->getInstanceFunc = sw.getInstanceFunc; } }; std::string mSoPath; //so库的根目录 std::unordered_map<std::string, SoWrapper> libInstanceMap; //map储存so指针实现 o(n)的效率 public: dynamicLoader(const std::string &soPath) : mSoPath(soPath) {} ~dynamicLoader() {} bool load(const std::string &libName) { //加载so库名,即so的全名,【libxxx】.so,成功或者已经加载,则返回true,失败返回false if(libInstanceMap.count(libName)!=0)return true; void *soPtr = dlopen((mSoPath + libName).c_str(), RTLD_LAZY); if (!soPtr) return false; if (libInstanceMap.count(libName) != 0) return true; //如果已经加载过 interface *(*getInstanceFunc)(void); //getInstance的函数指针 getInstanceFunc = (interface * (*)(void)) dlsym(soPtr, "getInstance"); //从so中获取符号,因此必须导出getInstance函数 SoWrapper sw(getInstanceFunc, soPtr); //构建warpper对象 libInstanceMap[libName] = sw; return true; //存入instanceMap中,下次要再次使用时直接获取即可 } bool unload(const std::string &libName) { //卸载类库 if (isExists(libName)) { dlclose(libInstanceMap[libName].soPtr); //关闭so文件的调用 libInstanceMap[libName].soPtr = nullptr; libInstanceMap[libName].getInstanceFunc = nullptr; libInstanceMap.erase(libName); } return true; } interface *getInstance(const std::string &libName) { //获取实例,实例产生的方式取决于maker中的实现方式 if (isExists(libName)) { return (interface *)(libInstanceMap[libName].getInstanceFunc()); //返回实例执行的结果 } return nullptr; } bool isExists(const std::string &libName) { //判断是否已经加载该so if (libInstanceMap.count(libName) == 0) { return false; //不存在 } return true; } }; #endif
32.675325
109
0.561208
995a2f2e82a3c4a6b2fb3ff3d69dd6af5d4cc8c4
4,865
cpp
C++
saber/lite/funcs/saber_deconv_act.cpp
Shixiaowei02/Anakin
f1ea086c5dfa1009ba15a64bc3e30cde07356360
[ "Apache-2.0" ]
1
2018-08-03T05:14:27.000Z
2018-08-03T05:14:27.000Z
saber/lite/funcs/saber_deconv_act.cpp
Shixiaowei02/Anakin
f1ea086c5dfa1009ba15a64bc3e30cde07356360
[ "Apache-2.0" ]
3
2018-06-22T09:08:44.000Z
2018-07-04T08:38:30.000Z
saber/lite/funcs/saber_deconv_act.cpp
Shixiaowei02/Anakin
f1ea086c5dfa1009ba15a64bc3e30cde07356360
[ "Apache-2.0" ]
1
2021-01-27T07:44:55.000Z
2021-01-27T07:44:55.000Z
#include "saber/lite/funcs/saber_deconv_act.h" #include "saber/lite/net/saber_factory_lite.h" namespace anakin{ namespace saber{ namespace lite{ SaberDeconvAct2D::SaberDeconvAct2D() { _conv_func = new SaberDeconv2D; } SaberDeconvAct2D::SaberDeconvAct2D(const ParamBase *param) { _conv_func = new SaberDeconv2D; _param = (const ConvAct2DParam*)param; /* if (_param->_flag_act) { LCHECK_EQ(_param->_act_type, Active_relu, "active type must be relu"); } */ this->_flag_param = true; _conv_func->load_param(&_param->_conv_param); } SaberDeconvAct2D::~SaberDeconvAct2D() { if (this->_flag_create_param) { delete _param; _param = nullptr; } delete _conv_func; } SaberStatus SaberDeconvAct2D::load_param(const ParamBase *param) { if (this->_flag_create_param) { delete _param; _param = nullptr; this->_flag_create_param = false; } _param = (const ConvAct2DParam*)param; this->_flag_param = true; _conv_func->set_activation(_param->_flag_act); return _conv_func->load_param(&_param->_conv_param); } SaberStatus SaberDeconvAct2D::load_param(std::istream &stream, const float *weights) { int weights_size; int num_out; int group; int kw; int kh; int stride_w; int stride_h; int pad_w; int pad_h; int dila_w; int dila_h; int flag_bias; int act_type; int flag_act; int w_offset; int b_offset; stream >> weights_size >> num_out >> group >> kw >> kh >> stride_w >> stride_h >> \ pad_w >> pad_h >> dila_w >> dila_h >> flag_bias >> act_type >> flag_act >> w_offset >> b_offset; _param = new ConvAct2DParam(weights_size, num_out, group, kw, kh, \ stride_w, stride_h, pad_w, pad_h, dila_w, dila_h, flag_bias>0, \ (ActiveType)act_type, flag_act>0, \ weights + w_offset, weights + b_offset); this->_flag_create_param = true; this->_flag_param = true; _conv_func->set_activation(flag_act); return _conv_func->load_param(&_param->_conv_param); } #if 0 SaberStatus SaberDeconvAct2D::load_param(FILE *fp, const float *weights) { int weights_size; int num_out; int group; int kw; int kh; int stride_w; int stride_h; int pad_w; int pad_h; int dila_w; int dila_h; int flag_bias; int act_type; int flag_act; int w_offset; int b_offset; fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", &weights_size, &num_out, &group, &kw, &kh, &stride_w, &stride_h, &pad_w, &pad_h, &dila_w, &dila_h, &flag_bias, &act_type, &flag_act, &w_offset, &b_offset); _param = new ConvAct2DParam(weights_size, num_out, group, kw, kh, \ stride_w, stride_h, pad_w, pad_h, dila_w, dila_h, flag_bias>0, \ (ActiveType)act_type, flag_act>0, \ weights + w_offset, weights + b_offset); this->_flag_create_param = true; this->_flag_param = true; return SaberSuccess; } #endif SaberStatus SaberDeconvAct2D::compute_output_shape(const std::vector<Tensor<CPU, AK_FLOAT> *> &inputs, std::vector<Tensor<CPU, AK_FLOAT> *> &outputs) { if (!this->_flag_param) { printf("load conv_act param first\n"); return SaberNotInitialized; } return _conv_func->compute_output_shape(inputs, outputs); } SaberStatus SaberDeconvAct2D::init(const std::vector<Tensor<CPU, AK_FLOAT> *> &inputs, std::vector<Tensor<CPU, AK_FLOAT> *> &outputs, Context &ctx) { if (!this->_flag_param) { printf("load conv_act param first\n"); return SaberNotInitialized; } if (_param->_flag_act) { _conv_func->set_activation(true); //SABER_CHECK(_conv_func->set_activation(true)); } else { _conv_func->set_activation(false); // SABER_CHECK(_conv_func->set_activation(false)); } // LOG(INFO) << "Deconv act"; //_conv_func->set_activation(_param->_flag_act); this->_flag_init = true; #if defined(ENABLE_OP_TIMER) || defined(ENABLE_DEBUG) _conv_func->set_op_name(this->get_op_name()); #endif return _conv_func->init(inputs, outputs, ctx); } SaberStatus SaberDeconvAct2D::dispatch(const std::vector<Tensor<CPU, AK_FLOAT> *> &inputs, std::vector<Tensor<CPU, AK_FLOAT> *> &outputs) { if (!this->_flag_init) { printf("init conv_act first\n"); return SaberNotInitialized; } return _conv_func->dispatch(inputs, outputs); } REGISTER_LAYER_CLASS(SaberDeconvAct2D); } //namespace lite } //namespace saber } //namespace anakin
30.030864
107
0.619322
995c2f7a0f20072e7d8039748ef224a5e5949dba
4,993
hh
C++
src/net/REDQueue.hh
drexelwireless/dragonradio
885abd68d56af709e7a53737352641908005c45b
[ "MIT" ]
8
2020-12-05T20:30:54.000Z
2022-01-22T13:32:14.000Z
src/net/REDQueue.hh
drexelwireless/dragonradio
885abd68d56af709e7a53737352641908005c45b
[ "MIT" ]
3
2020-10-28T22:15:27.000Z
2021-01-27T14:43:41.000Z
src/net/REDQueue.hh
drexelwireless/dragonradio
885abd68d56af709e7a53737352641908005c45b
[ "MIT" ]
null
null
null
#ifndef REDQUEUE_HH_ #define REDQUEUE_HH_ #include <list> #include <random> #include "logging.hh" #include "Clock.hh" #include "net/Queue.hh" #include "net/SizedQueue.hh" /** @brief An Adaptive RED queue. */ /** See the paper Random Early Detection Gateways for Congestion Avoidance */ template <class T> class REDQueue : public SizedQueue<T> { public: using const_iterator = typename std::list<T>::const_iterator; using Queue<T>::canPop; using SizedQueue<T>::stop; using SizedQueue<T>::drop; using SizedQueue<T>::done_; using SizedQueue<T>::size_; using SizedQueue<T>::hi_priority_flows_; using SizedQueue<T>::m_; using SizedQueue<T>::cond_; using SizedQueue<T>::hiq_; using SizedQueue<T>::q_; REDQueue(bool gentle, size_t min_thresh, size_t max_thresh, double max_p, double w_q) : SizedQueue<T>() , gentle_(gentle) , min_thresh_(min_thresh) , max_thresh_(max_thresh) , max_p_(max_p) , w_q_(w_q) , count_(-1) , avg_(0) , gen_(std::random_device()()) , dist_(0, 1.0) { } REDQueue() = delete; virtual ~REDQueue() { stop(); } /** @brief Get flag indicating whether or not to be gentle */ /** See: * https://www.icir.org/floyd/notes/test-suite-red.txt */ bool getGentle(void) const { return gentle_; } /** @brief Set flag indicating whether or not to be gentle */ void setGentle(bool gentle) { gentle_ = gentle; } /** @brief Get minimum threshold */ size_t getMinThresh(void) const { return min_thresh_; } /** @brief Set minimum threshold */ void setMinThresh(size_t min_thresh) { min_thresh_ = min_thresh; } /** @brief Get maximum threshold */ size_t getMaxThresh(void) const { return max_thresh_; } /** @brief Set maximum threshold */ void setMaxThresh(size_t max_thresh) { max_thresh_ = max_thresh; } /** @brief Get maximum drop probability */ double getMaxP(void) const { return max_p_; } /** @brief Set maximum drop probability */ void setMaxP(double max_p) { max_p_ = max_p; } /** @brief Get queue qeight */ double getQueueWeight(void) const { return max_p_; } /** @brief Set queue qeight */ void setQueueWeight(double w_q) { w_q_ = w_q; } virtual void reset(void) override { std::lock_guard<std::mutex> lock(m_); done_ = false; size_ = 0; count_ = 0; hiq_.clear(); q_.clear(); } virtual void push(T&& item) override { { std::lock_guard<std::mutex> lock(m_); if (item->flow_uid && hi_priority_flows_.find(*item->flow_uid) != hi_priority_flows_.end()) { hiq_.emplace_back(std::move(item)); return; } bool mark = false; // Calculate new average queue size if (size_ == 0) avg_ = 0; else avg_ = (1 - w_q_)*avg_ + w_q_*size_; // Determine whether or not to mark packet if (avg_ < min_thresh_) { count_ = -1; } else if (min_thresh_ <= avg_ && avg_ < max_thresh_) { count_++; double p_b = max_p_*(avg_ - min_thresh_)/(max_thresh_ - min_thresh_); double p_a = p_b/(1.0 - count_*p_b); if (dist_(gen_) < p_a) { mark = true; count_ = 0; } } else if (gentle_ && avg_ < 2*max_thresh_) { count_++; double p_a = max_p_*(avg_ - max_thresh_)/max_thresh_; if (dist_(gen_) < p_a) { mark = true; count_ = 0; } } else { mark = true; count_ = 0; } if (mark) drop(item); if (!mark) { size_ += item->payload_size; q_.emplace_back(std::move(item)); } } cond_.notify_one(); } protected: /** @brief Gentle flag. */ bool gentle_; /** @brief Minimum threshold. */ size_t min_thresh_; /** @brief Maximum threshold. */ size_t max_thresh_; /** @brief Maximum drop probability. */ double max_p_; /** @brief Queue weight. */ double w_q_; /** @brief Packets since last marked packet. */ int count_; /** @brief Average size of queue (bytes). */ double avg_; /** @brief Random number generator */ std::mt19937 gen_; /** @brief Uniform 0-1 real distribution */ std::uniform_real_distribution<double> dist_; }; using REDNetQueue = REDQueue<std::shared_ptr<NetPacket>>; #endif /* REDQUEUE_HH_ */
22.799087
105
0.530342
995d417fdaf7d5b02113724963860c36fb84b251
3,208
hpp
C++
test/matrix/blas/matsub.hpp
rigarash/monolish-debian-package
70b4917370184bcf07378e1907c5239a1ad9579b
[ "Apache-2.0" ]
172
2021-04-05T10:04:40.000Z
2022-03-28T14:30:38.000Z
test/matrix/blas/matsub.hpp
rigarash/monolish-debian-package
70b4917370184bcf07378e1907c5239a1ad9579b
[ "Apache-2.0" ]
96
2021-04-06T01:53:44.000Z
2022-03-09T07:27:09.000Z
test/matrix/blas/matsub.hpp
termoshtt/monolish
1cba60864002b55bc666da9baa0f8c2273578e01
[ "Apache-2.0" ]
8
2021-04-05T13:21:07.000Z
2022-03-09T23:24:06.000Z
#include "../../test_utils.hpp" template <typename T> void ans_matsub(const monolish::matrix::Dense<T> &A, const monolish::matrix::Dense<T> &B, monolish::matrix::Dense<T> &C) { if (A.get_row() != B.get_row()) { std::runtime_error("A.row != B.row"); } if (A.get_col() != B.get_col()) { std::runtime_error("A.col != B.col"); } // MN=MN+MN int M = A.get_row(); int N = A.get_col(); for (int i = 0; i < A.get_nnz(); i++) { C.val[i] = A.val[i] - B.val[i]; } } template <typename MAT_A, typename MAT_B, typename MAT_C, typename T> bool test_send_matsub(const size_t M, const size_t N, double tol) { size_t nnzrow = 27; if ((nnzrow < M) && (nnzrow < N)) { nnzrow = 27; } else { nnzrow = std::min({M, N}) - 1; } monolish::matrix::COO<T> seedA = monolish::util::random_structure_matrix<T>(M, N, nnzrow, 1.0); MAT_A A(seedA); MAT_B B(seedA); MAT_C C(seedA); monolish::matrix::Dense<T> AA(seedA); monolish::matrix::Dense<T> BB(seedA); monolish::matrix::Dense<T> CC(seedA); ans_matsub(AA, BB, CC); monolish::matrix::COO<T> ansC(CC); monolish::util::send(A, B, C); monolish::blas::matsub(A, B, C); C.recv(); monolish::matrix::COO<T> resultC(C); return ans_check<T>(__func__, A.type(), resultC.val.data(), ansC.val.data(), ansC.get_nnz(), tol); } template <typename MAT_A, typename MAT_B, typename MAT_C, typename T> bool test_send_matsub_linearoperator(const size_t M, const size_t N, double tol) { size_t nnzrow = 27; if ((nnzrow < M) && (nnzrow < N)) { nnzrow = 27; } else { nnzrow = std::min({M, N}) - 1; } monolish::matrix::COO<T> seedA = monolish::util::random_structure_matrix<T>(M, N, nnzrow, 1.0); monolish::matrix::CRS<T> A1(seedA); monolish::matrix::CRS<T> B1(seedA); monolish::matrix::CRS<T> C1(seedA); monolish::matrix::Dense<T> AA(seedA); monolish::matrix::Dense<T> BB(seedA); monolish::matrix::Dense<T> CC(seedA); ans_matsub(AA, BB, CC); monolish::matrix::COO<T> ansC(CC); monolish::util::send(A1, B1, C1); MAT_A A(A1); MAT_B B(B1); MAT_C C(C1); monolish::blas::matsub(A, B, C); C.recv(); monolish::matrix::COO<T> resultC(C); return ans_check<T>(__func__, A.type(), resultC.val.data(), ansC.val.data(), ansC.get_nnz(), tol); } template <typename MAT_A, typename MAT_B, typename MAT_C, typename T> bool test_matsub(const size_t M, const size_t N, double tol) { size_t nnzrow = 27; if ((nnzrow < M) && (nnzrow < N)) { nnzrow = 27; } else { nnzrow = std::min({M, N}) - 1; } monolish::matrix::COO<T> seedA = monolish::util::random_structure_matrix<T>(M, N, nnzrow, 1.0); MAT_A A(seedA); MAT_B B(seedA); MAT_C C(seedA); monolish::matrix::Dense<T> AA(seedA); monolish::matrix::Dense<T> BB(seedA); monolish::matrix::Dense<T> CC(seedA); ans_matsub(AA, BB, CC); monolish::matrix::COO<T> ansC(CC); monolish::blas::matsub(A, B, C); monolish::matrix::COO<T> resultC(C); return ans_check<T>(__func__, A.type(), resultC.val.data(), ansC.val.data(), ansC.get_nnz(), tol); }
25.259843
78
0.595387
996460e59d36a608dfaff28a701efe1942d69542
2,024
cpp
C++
deform_control/external_libs/OpenSceneGraph-2.8.5/src/osgPlugins/ive/Viewport.cpp
UM-ARM-Lab/mab_ms
f199f05b88060182cfbb47706bd1ff3479032c43
[ "BSD-2-Clause" ]
3
2018-08-20T12:12:43.000Z
2021-06-06T09:43:27.000Z
deform_control/external_libs/OpenSceneGraph-2.8.5/src/osgPlugins/ive/Viewport.cpp
UM-ARM-Lab/mab_ms
f199f05b88060182cfbb47706bd1ff3479032c43
[ "BSD-2-Clause" ]
null
null
null
deform_control/external_libs/OpenSceneGraph-2.8.5/src/osgPlugins/ive/Viewport.cpp
UM-ARM-Lab/mab_ms
f199f05b88060182cfbb47706bd1ff3479032c43
[ "BSD-2-Clause" ]
1
2022-03-31T03:12:23.000Z
2022-03-31T03:12:23.000Z
/********************************************************************** * * FILE: Viewport.cpp * * DESCRIPTION: Read/Write osg::Viewport in binary format to disk. * * CREATED BY: Auto generated by iveGenerated * and later modified by Rune Schmidt Jensen. * * HISTORY: Created 21.3.2003 * * Copyright 2003 VR-C **********************************************************************/ #include "Exception.h" #include "Viewport.h" #include "Object.h" using namespace ive; void Viewport::write(DataOutputStream* out){ // Write Viewport's identification. out->writeInt(IVEVIEWPORT); // If the osg class is inherited by any other class we should also write this to file. osg::Object* obj = dynamic_cast<osg::Object*>(this); if(obj){ ((ive::Object*)(obj))->write(out); } else throw Exception("Viewport::write(): Could not cast this osg::Viewport to an osg::Object."); // Write Viewport's properties. out->writeInt(static_cast<int>(x())); out->writeInt(static_cast<int>(y())); out->writeInt(static_cast<int>(width())); out->writeInt(static_cast<int>(height())); } void Viewport::read(DataInputStream* in){ // Peek on Viewport's identification. int id = in->peekInt(); if(id == IVEVIEWPORT){ // Read Viewport's identification. id = in->readInt(); // If the osg class is inherited by any other class we should also read this from file. osg::Object* obj = dynamic_cast<osg::Object*>(this); if(obj){ ((ive::Object*)(obj))->read(in); } else throw Exception("Viewport::read(): Could not cast this osg::Viewport to an osg::Object."); // Read Viewport's properties x() = in->readInt(); y() = in->readInt(); width() = in->readInt(); height() = in->readInt(); } else{ throw Exception("Viewport::read(): Expected Viewport identification."); } }
31.625
102
0.552372
99655b5fe5c2657b64d3c464da1a2b152235abdb
33
hh
C++
include/trick/compat/sim_services/Message/include/MessageLCout.hh
gilbertguoze/trick
f0537efb0fa3cb5c0c84e36b60f055c1d1c60d21
[ "NASA-1.3" ]
647
2015-05-07T16:08:16.000Z
2022-03-30T02:33:21.000Z
include/trick/compat/sim_services/Message/include/MessageLCout.hh
gilbertguoze/trick
f0537efb0fa3cb5c0c84e36b60f055c1d1c60d21
[ "NASA-1.3" ]
995
2015-04-30T19:44:31.000Z
2022-03-31T20:14:44.000Z
include/trick/compat/sim_services/Message/include/MessageLCout.hh
gilbertguoze/trick
f0537efb0fa3cb5c0c84e36b60f055c1d1c60d21
[ "NASA-1.3" ]
251
2015-05-15T09:24:34.000Z
2022-03-22T20:39:05.000Z
#include "trick/MessageLCout.hh"
16.5
32
0.787879
9967ae213a368f4d7eca16535649ff73f8cce3ab
9,045
cxx
C++
HLT/EMCAL/AliHLTEMCALDigitMakerComponent.cxx
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
52
2016-12-11T13:04:01.000Z
2022-03-11T11:49:35.000Z
HLT/EMCAL/AliHLTEMCALDigitMakerComponent.cxx
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
1,388
2016-11-01T10:27:36.000Z
2022-03-30T15:26:09.000Z
HLT/EMCAL/AliHLTEMCALDigitMakerComponent.cxx
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
275
2016-06-21T20:24:05.000Z
2022-03-31T13:06:19.000Z
// $Id$ /************************************************************************** * This file is property of and copyright by the ALICE HLT Project * * All rights reserved. * * * * Primary Authors: Oystein Djuvsland * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ #include "AliHLTEMCALDigitMakerComponent.h" #include "AliHLTCaloDigitMaker.h" #include "AliHLTCaloDigitDataStruct.h" #include "AliHLTCaloChannelDataHeaderStruct.h" #include "AliHLTCaloChannelDataStruct.h" #include "AliHLTEMCALMapper.h" #include "AliHLTEMCALDefinitions.h" #include "AliCaloCalibPedestal.h" #include "AliEMCALCalibData.h" #include "AliCDBEntry.h" #include "AliCDBPath.h" #include "AliCDBManager.h" #include "TFile.h" #include <sys/stat.h> #include <sys/types.h> //#include "AliHLTEMCALConstant.h" #include "AliHLTCaloConstants.h" using EMCAL::NZROWSMOD; using EMCAL::NXCOLUMNSMOD; using EMCAL::NMODULES; using CALO::HGLGFACTOR; /** * @file AliHLTEMCALDigitMakerComponent.cxx * @author Oystein Djuvsland * @date * @brief A digit maker component for EMCAL HLT */ // see below for class documentation // or // refer to README to build package // or // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt ClassImp(AliHLTEMCALDigitMakerComponent) AliHLTEMCALDigitMakerComponent gAliHLTEMCALDigitMakerComponent; AliHLTEMCALDigitMakerComponent::AliHLTEMCALDigitMakerComponent() : AliHLTCaloProcessor(), // AliHLTCaloConstantsHandler("EMCAL"), fDigitContainerPtr(0), fPedestalData(0), fCalibData(0) { //see header file for documentation for(int imod = 0; imod < NMODULES; imod++){ fDigitMakerPtr[imod] = NULL; fBCMInitialised[imod] = true; fGainsInitialised[imod] = true; } } AliHLTEMCALDigitMakerComponent::~AliHLTEMCALDigitMakerComponent() { //see header file for documentation } int AliHLTEMCALDigitMakerComponent::Deinit() { //see header file for documentation for(int imod = 0; imod < NMODULES; imod++){ if(fDigitMakerPtr[imod]) { delete fDigitMakerPtr[imod]; fDigitMakerPtr[imod] = 0; } } return 0; } const char* AliHLTEMCALDigitMakerComponent::GetComponentID() { //see header file for documentation return "EmcalDigitMaker"; } void AliHLTEMCALDigitMakerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list) { //see header file for documentation list.clear(); list.push_back(AliHLTEMCALDefinitions::fgkChannelDataType); } AliHLTComponentDataType AliHLTEMCALDigitMakerComponent::GetOutputDataType() { //see header file for documentation // return AliHLTCaloDefinitions::fgkDigitDataType|kAliHLTDataOriginEMCAL; return AliHLTEMCALDefinitions::fgkDigitDataType; } void AliHLTEMCALDigitMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier) { //see header file for documentation constBase = 0; inputMultiplier = (float)sizeof(AliHLTCaloDigitDataStruct)/sizeof(AliHLTCaloChannelDataStruct) + 1; } int AliHLTEMCALDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /* trigData */, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, std::vector<AliHLTComponentBlockData>& outputBlocks) { //patch in order to skip calib events if(! IsDataEvent()) return 0; //see header file for documentation UInt_t offset = 0; UInt_t mysize = 0; Int_t digitCount = 0; Int_t ret = 0; const AliHLTComponentBlockData* iter = 0; unsigned long ndx; UInt_t specification = 0; AliHLTCaloChannelDataHeaderStruct* tmpChannelData = 0; Int_t moduleID; for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) { iter = blocks+ndx; if(iter->fDataType != AliHLTEMCALDefinitions::fgkChannelDataType) continue; if(iter->fSpecification >= 40) continue; // Do not use inactive DDLs moduleID = int(iter->fSpecification/2); if(!fBCMInitialised[moduleID]){ if(moduleID > -1){ for(Int_t x = 0; x < NXCOLUMNSMOD ; x++) // PTH for(Int_t z = 0; z < NZROWSMOD ; z++) // PTH fDigitMakerPtr[moduleID]->SetBadChannel(x, z, fPedestalData->IsBadChannel(moduleID, z, x)); // FR //delete fBadChannelMap; fBCMInitialised[moduleID] = true; } else HLTError("Error setting pedestal with module value of %d", moduleID); } if(!fGainsInitialised[moduleID]){ if(moduleID > -1){ for(Int_t x = 0; x < NXCOLUMNSMOD; x++) //PTH for(Int_t z = 0; z < NZROWSMOD; z++) //PTH // FR setting gains fDigitMakerPtr[moduleID]->SetGain(x, z, HGLGFACTOR, fCalibData->GetADCchannel(moduleID, z, x)); fGainsInitialised[moduleID] = true; } else HLTError("Error setting gains with module value of %d", moduleID); } tmpChannelData = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*>(iter->fPtr); fDigitMakerPtr[moduleID]->SetDigitDataPtr(reinterpret_cast<AliHLTCaloDigitDataStruct*>(outputPtr)); ret = fDigitMakerPtr[moduleID]->MakeDigits(tmpChannelData, size-(digitCount*sizeof(AliHLTCaloDigitDataStruct))); HLTDebug("Found %d digits", ret); if(ret == -1) { HLTError("Trying to write over buffer size"); return -ENOBUFS; } digitCount += ret; outputPtr += sizeof(AliHLTCaloDigitDataStruct) * ret; // forward pointer } mysize += digitCount*sizeof(AliHLTCaloDigitDataStruct); HLTDebug("# of digits: %d, used memory size: %d, available size: %d", digitCount, mysize, size); if(mysize > 0) { AliHLTComponentBlockData bd; FillBlockData( bd ); bd.fOffset = offset; bd.fSize = mysize; bd.fDataType = AliHLTEMCALDefinitions::fgkDigitDataType; bd.fSpecification = 0; outputBlocks.push_back(bd); } for(Int_t imod = 0; imod < NMODULES; imod++) fDigitMakerPtr[imod]->Reset(); size = mysize; return 0; } int AliHLTEMCALDigitMakerComponent::DoInit(int argc, const char** argv ) { //see header file for documentation for(Int_t imod = 0; imod < NMODULES; imod++){ fDigitMakerPtr[imod] = new AliHLTCaloDigitMaker("EMCAL"); AliHLTCaloMapper *mapper = new AliHLTEMCALMapper(2); fDigitMakerPtr[imod]->SetMapper(mapper); for(int i = 0; i < argc; i++) { if(!strcmp("-lowgainfactor", argv[i])) { fDigitMakerPtr[imod]->SetGlobalLowGainFactor(atof(argv[i+1])); } if(!strcmp("-highgainfactor", argv[i])) { fDigitMakerPtr[imod]->SetGlobalHighGainFactor(atof(argv[i+1])); } } } if (GetBCMFromCDB()) return -1; if (GetGainsFromCDB()) return -1; //GetBCMFromCDB(); //fDigitMakerPtr->SetDigitThreshold(2); return 0; } int AliHLTEMCALDigitMakerComponent::GetBCMFromCDB() { // See header file for class documentation for(Int_t imod = 0; imod < 20; imod++) fBCMInitialised[imod] = false; // HLTInfo("Getting bad channel map..."); AliCDBPath path("EMCAL","Calib","Pedestals"); if(path.GetPath()) { // HLTInfo("configure from entry %s", path.GetPath()); AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/); if (pEntry) { fPedestalData = (AliCaloCalibPedestal*)pEntry->GetObject(); } else { // HLTError("can not fetch object \"%s\" from CDB", path); return -1; } } if(!fPedestalData) { return -1; } return 0; } int AliHLTEMCALDigitMakerComponent::GetGainsFromCDB() { // See header file for class documentation for(Int_t imod = 0; imod < 20; imod++) fGainsInitialised[imod] = false; // HLTInfo("Getting bad channel map..."); AliCDBPath path("EMCAL","Calib","Data"); if(path.GetPath()) { // HLTInfo("configure from entry %s", path.GetPath()); AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/); if (pEntry) { fCalibData = (AliEMCALCalibData*)pEntry->GetObject(); } else { // HLTError("can not fetch object \"%s\" from CDB", path); return -1; } } if(!fCalibData) return -1; return 0; } AliHLTComponent* AliHLTEMCALDigitMakerComponent::Spawn() { //see header file for documentation return new AliHLTEMCALDigitMakerComponent(); }
28.443396
120
0.656385
99687f987cf282449c724d0facef62ce19ca5f27
27,930
cpp
C++
pxr/imaging/lib/hd/quadrangulate.cpp
marsupial/USD
98d49911893d59be5a9904a29e15959affd530ec
[ "BSD-3-Clause" ]
9
2021-03-31T21:23:48.000Z
2022-03-05T09:29:27.000Z
pxr/imaging/lib/hd/quadrangulate.cpp
unity3d-jp/USD
0f146383613e1efe872ea7c85aa3536f170fcda2
[ "BSD-3-Clause" ]
null
null
null
pxr/imaging/lib/hd/quadrangulate.cpp
unity3d-jp/USD
0f146383613e1efe872ea7c85aa3536f170fcda2
[ "BSD-3-Clause" ]
2
2016-12-13T00:53:40.000Z
2020-05-04T07:32:53.000Z
// // Copyright 2016 Pixar // // Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in // compliance with the Apache License and the following modification to it: // Section 6. Trademarks. is deleted and replaced with: // // 6. Trademarks. This License does not grant permission to use the trade // names, trademarks, service marks, or product names of the Licensor // and its affiliates, except as required to comply with Section 4(c) of // the License and to reproduce the content of the NOTICE file. // // You may obtain a copy of the Apache License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the Apache License with the above modification is // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the Apache License for the specific // language governing permissions and limitations under the Apache License. // #include "pxr/imaging/glf/glew.h" #include "pxr/imaging/hd/quadrangulate.h" #include "pxr/imaging/hd/bufferArrayRange.h" #include "pxr/imaging/hd/glslProgram.h" #include "pxr/imaging/hd/meshTopology.h" #include "pxr/imaging/hd/perfLog.h" #include "pxr/imaging/hd/renderContextCaps.h" #include "pxr/imaging/hd/resourceRegistry.h" #include "pxr/imaging/hd/vtBufferSource.h" #include "pxr/imaging/glf/glslfx.h" #include "pxr/base/gf/vec4i.h" Hd_QuadInfoBuilderComputation::Hd_QuadInfoBuilderComputation( HdMeshTopology *topology, SdfPath const &id) : _id(id), _topology(topology) { } bool Hd_QuadInfoBuilderComputation::Resolve() { if (not _TryLock()) return false; HD_TRACE_FUNCTION(); int const * numVertsPtr = _topology->GetFaceVertexCounts().cdata(); int const * vertsPtr = _topology->GetFaceVertexIndices().cdata(); int const * holeFacesPtr = _topology->GetHoleIndices().cdata(); int numFaces = _topology->GetFaceVertexCounts().size(); int numVertIndices = _topology->GetFaceVertexIndices().size(); int numHoleFaces = _topology->GetHoleIndices().size(); // compute numPoints from topology indices int numPoints = HdMeshTopology::ComputeNumPoints( _topology->GetFaceVertexIndices()); Hd_QuadInfo *quadInfo = new Hd_QuadInfo(); quadInfo->numVerts.clear(); quadInfo->verts.clear(); quadInfo->pointsOffset = numPoints; int vertIndex = 0; int numAdditionalPoints = 0; int maxNumVert = 0; int holeIndex = 0; bool invalidTopology = false; for (int i = 0; i < numFaces; ++i) { int nv = numVertsPtr[i]; if (holeIndex < numHoleFaces and holeFacesPtr[holeIndex] == i) { // skip hole faces. vertIndex += nv; ++holeIndex; continue; } if (nv == 4) { vertIndex += nv; continue; } // if it isn't a quad, quadInfo->numVerts.push_back(nv); for (int j = 0; j < nv; ++j) { // store vertex indices into quadinfo int index = 0; if (vertIndex >= numVertIndices) { invalidTopology = true; } else { index = vertsPtr[vertIndex++]; } quadInfo->verts.push_back(index); } // nv + 1 (edge + center) additional vertices needed. numAdditionalPoints += (nv + 1); // remember max numvert for making gpu-friendly table maxNumVert = std::max(maxNumVert, nv); } quadInfo->numAdditionalPoints = numAdditionalPoints; quadInfo->maxNumVert = maxNumVert; if (invalidTopology) { TF_WARN("numVerts and verts are incosistent [%s]", _id.GetText()); } // set quadinfo to topology // topology takes the ownership of quadinfo so no need to free. _topology->SetQuadInfo(quadInfo); _SetResolved(); return true; } bool Hd_QuadInfoBuilderComputation::_CheckValid() const { return true; } // --------------------------------------------------------------------------- Hd_QuadIndexBuilderComputation::Hd_QuadIndexBuilderComputation( HdMeshTopology *topology, Hd_QuadInfoBuilderComputationSharedPtr const &quadInfoBuilder, SdfPath const &id) : _id(id), _topology(topology), _quadInfoBuilder(quadInfoBuilder) { } void Hd_QuadIndexBuilderComputation::AddBufferSpecs(HdBufferSpecVector *specs) const { specs->push_back(HdBufferSpec(HdTokens->indices, GL_INT, 4)); // coarse-quads uses int2 as primitive param. specs->push_back(HdBufferSpec(HdTokens->primitiveParam, GL_INT, 2)); } bool Hd_QuadIndexBuilderComputation::Resolve() { // quadInfoBuilder may or may not exists, depending on how we switched // the repr of the mesh. If it exists, we have to wait. if (_quadInfoBuilder and not _quadInfoBuilder->IsResolved()) return false; if (not _TryLock()) return false; // generate quad index buffer HD_TRACE_FUNCTION(); // TODO: create ptex id remapping buffer here. int const * numVertsPtr = _topology->GetFaceVertexCounts().cdata(); int const * vertsPtr = _topology->GetFaceVertexIndices().cdata(); int const * holeFacesPtr = _topology->GetHoleIndices().cdata(); int numFaces = _topology->GetFaceVertexCounts().size(); int numVertIndices = _topology->GetFaceVertexIndices().size(); int numHoleFaces = _topology->GetHoleIndices().size(); // count num quads bool invalidTopology = false; int numQuads = HdMeshTopology::ComputeNumQuads( _topology->GetFaceVertexCounts(), _topology->GetHoleIndices(), &invalidTopology); if (invalidTopology) { TF_WARN("degenerated face found [%s]", _id.GetText()); invalidTopology = false; } int holeIndex = 0; VtVec4iArray quadsFaceVertexIndices(numQuads); VtVec2iArray primitiveParam(numQuads); // quadrangulated verts is added to the end. bool flip = (_topology->GetOrientation() != HdTokens->rightHanded); int vertIndex = HdMeshTopology::ComputeNumPoints( _topology->GetFaceVertexIndices()); // TODO: We need to support ptex index in addition to coarse indices. //int ptexIndex = 0; for (int i = 0, qv = 0, v = 0; i<numFaces; ++i) { int nv = numVertsPtr[i]; if (nv < 3) { continue; // skip degenerated face } if (holeIndex < numHoleFaces and holeFacesPtr[holeIndex] == i) { // skip hole faces. ++holeIndex; continue; } if (v+nv > numVertIndices) { invalidTopology = true; if (nv == 4) { quadsFaceVertexIndices[qv++] = GfVec4i(0); } else { for (int j = 0; j < nv; ++j) { quadsFaceVertexIndices[qv++] = GfVec4i(0); } } v += nv; continue; } if (nv == 4) { if (flip) { quadsFaceVertexIndices[qv][0] = (vertsPtr[v+0]); quadsFaceVertexIndices[qv][1] = (vertsPtr[v+3]); quadsFaceVertexIndices[qv][2] = (vertsPtr[v+2]); quadsFaceVertexIndices[qv][3] = (vertsPtr[v+1]); } else { quadsFaceVertexIndices[qv][0] = (vertsPtr[v+0]); quadsFaceVertexIndices[qv][1] = (vertsPtr[v+1]); quadsFaceVertexIndices[qv][2] = (vertsPtr[v+2]); quadsFaceVertexIndices[qv][3] = (vertsPtr[v+3]); } primitiveParam[qv] = GfVec2i( HdMeshTopology::EncodeCoarseFaceParam(i, 0), qv); ++qv; } else { // quadrangulate non-quad faces // the additional points (edge and center) are stored at the end of // original points, as // last point, e0, e1, ..., en, center, e0, e1, ... // so each sub-quads become // *first non-quad // v0, e0, center, e(-1), // v1, e1, center, e0, //... // *second non-quad // ... for (int j = 0; j < nv; ++j) { // vertex quadsFaceVertexIndices[qv][0] = vertsPtr[v+j]; if (flip) { // edge prev quadsFaceVertexIndices[qv][1] = vertIndex + (j+nv-1)%nv; // center quadsFaceVertexIndices[qv][2] = vertIndex + nv; // edge next quadsFaceVertexIndices[qv][3] = vertIndex + j; } else { // edge next quadsFaceVertexIndices[qv][1] = vertIndex + j; // center quadsFaceVertexIndices[qv][2] = vertIndex + nv; // edge prev quadsFaceVertexIndices[qv][3] = vertIndex + (j+nv-1)%nv; } primitiveParam[qv] = GfVec2i( HdMeshTopology::EncodeCoarseFaceParam(i, 0), qv); ++qv; } vertIndex += nv + 1; } v += nv; } if (invalidTopology) { TF_WARN("numVerts and verts are incosistent [%s]", _id.GetText()); } _SetResult(HdBufferSourceSharedPtr(new HdVtBufferSource( HdTokens->indices, VtValue(quadsFaceVertexIndices)))); _primitiveParam.reset(new HdVtBufferSource(HdTokens->primitiveParam, VtValue(primitiveParam))); _SetResolved(); return true; } bool Hd_QuadIndexBuilderComputation::HasChainedBuffer() const { return true; } HdBufferSourceSharedPtr Hd_QuadIndexBuilderComputation::GetChainedBuffer() const { return _primitiveParam; } bool Hd_QuadIndexBuilderComputation::_CheckValid() const { return true; } // --------------------------------------------------------------------------- Hd_QuadrangulateTableComputation::Hd_QuadrangulateTableComputation( HdMeshTopology *topology, HdBufferSourceSharedPtr const &quadInfoBuilder) : _topology(topology), _quadInfoBuilder(quadInfoBuilder) { } bool Hd_QuadrangulateTableComputation::Resolve() { if (not TF_VERIFY(_quadInfoBuilder)) return false; if (not _quadInfoBuilder->IsResolved()) return false; if (not _TryLock()) return false; HD_TRACE_FUNCTION(); Hd_QuadInfo const *quadInfo = _topology->GetQuadInfo(); if (not quadInfo) { TF_CODING_ERROR("Hd_QuadInfo is null."); return true; } // transfer quadrangulation table to GPU // for the same reason as cpu quadrangulation, we need a check // of IsAllQuads here. // see the comment on HdMeshTopology::Quadrangulate() if (not quadInfo->IsAllQuads()) { int quadInfoStride = quadInfo->maxNumVert + 2; int numNonQuads = quadInfo->numVerts.size(); // create a buffer source for gpu quadinfo table VtIntArray array(quadInfoStride * numNonQuads); int index = 0, vertIndex = 0, dstOffset = quadInfo->pointsOffset; for (int i = 0; i < numNonQuads; ++i) { // GPU quadinfo table layout // // struct NonQuad { // int numVert; // int dstOffset; // int index[maxNumVert]; // } [numNonQuads] // int numVert = quadInfo->numVerts[i]; array[index] = numVert; array[index+1] = dstOffset; for (int j = 0; j < numVert; ++j) { array[index+j+2] = quadInfo->verts[vertIndex++]; } index += quadInfoStride; dstOffset += numVert + 1; // edge + center } // sanity check for number of points TF_VERIFY(dstOffset == quadInfo->pointsOffset + quadInfo->numAdditionalPoints); // GPU quadrangulate table HdBufferSourceSharedPtr table(new HdVtBufferSource(HdTokens->quadInfo, VtValue(array))); _SetResult(table); } else { _topology->ClearQuadrangulateTableRange(); } _SetResolved(); return true; } void Hd_QuadrangulateTableComputation::AddBufferSpecs( HdBufferSpecVector *specs) const { // quadinfo computation produces an index buffer for quads. specs->push_back(HdBufferSpec(HdTokens->quadInfo, GL_INT, 1)); } bool Hd_QuadrangulateTableComputation::_CheckValid() const { return true; } // --------------------------------------------------------------------------- template <typename T> HdBufferSourceSharedPtr _Quadrangulate(HdBufferSourceSharedPtr const &source, Hd_QuadInfo const *qi) { // CPU quadrangulation // original points + quadrangulated points VtArray<T> results(qi->pointsOffset + qi->numAdditionalPoints); // copy original primVars T const *srcPtr = reinterpret_cast<T const*>(source->GetData()); memcpy(results.data(), srcPtr, sizeof(T)*qi->pointsOffset); // compute quadrangulate primVars int index = 0; // store quadrangulated points at end int dstIndex = qi->pointsOffset; HD_PERF_COUNTER_ADD(HdPerfTokens->quadrangulatedVerts, qi->numAdditionalPoints); TF_FOR_ALL (numVertsIt, qi->numVerts) { int nv = *numVertsIt; T center(0); for (int i = 0; i < nv; ++i) { int i0 = qi->verts[index+i]; int i1 = qi->verts[index+(i+1)%nv]; // midpoint T edge = (srcPtr[i0] + srcPtr[i1]) * 0.5; results[dstIndex++] = edge; // accumulate center center += srcPtr[i0]; } // average center value center /= nv; results[dstIndex++] = center; index += nv; } return HdBufferSourceSharedPtr(new HdVtBufferSource( source->GetName(), VtValue(results))); } Hd_QuadrangulateComputation::Hd_QuadrangulateComputation( HdMeshTopology *topology, HdBufferSourceSharedPtr const &source, HdBufferSourceSharedPtr const &quadInfoBuilder, SdfPath const &id) : _id(id), _topology(topology), _source(source), _quadInfoBuilder(quadInfoBuilder) { } bool Hd_QuadrangulateComputation::Resolve() { if (not TF_VERIFY(_source)) return false; if (not _source->IsResolved()) return false; if (_quadInfoBuilder and not _quadInfoBuilder->IsResolved()) return false; if (not _TryLock()) return false; HD_TRACE_FUNCTION(); HD_PERF_COUNTER_INCR(HdPerfTokens->quadrangulateCPU); Hd_QuadInfo const *quadInfo = _topology->GetQuadInfo(); if (not TF_VERIFY(quadInfo)) return true; // If the topology is all quads, just return source. // This check is needed since if the topology changes, we don't know // whether the topology is all-quads or not until the quadinfo computation // is resolved. So we conservatively register primvar quadrangulations // on that case, it hits this condition. Once quadinfo resolved on the // topology, HdMeshTopology::GetQuadrangulateComputation returns null // and nobody calls this function for all-quads prims. if (quadInfo->IsAllQuads()) { _SetResult(_source); _SetResolved(); return true; } HdBufferSourceSharedPtr result; switch (_source->GetGLElementDataType()) { case GL_FLOAT: result = _Quadrangulate<float>(_source, quadInfo); break; case GL_FLOAT_VEC2: result = _Quadrangulate<GfVec2f>(_source, quadInfo); break; case GL_FLOAT_VEC3: result = _Quadrangulate<GfVec3f>(_source, quadInfo); break; case GL_FLOAT_VEC4: result = _Quadrangulate<GfVec4f>(_source, quadInfo); break; case GL_DOUBLE: result = _Quadrangulate<double>(_source, quadInfo); break; case GL_DOUBLE_VEC2: result = _Quadrangulate<GfVec2d>(_source, quadInfo); break; case GL_DOUBLE_VEC3: result = _Quadrangulate<GfVec3d>(_source, quadInfo); break; case GL_DOUBLE_VEC4: result = _Quadrangulate<GfVec4d>(_source, quadInfo); break; default: TF_CODING_ERROR("Unsupported points type for quadrangulation [%s]", _id.GetText()); result = _source; break; } _SetResult(result); _SetResolved(); return true; } void Hd_QuadrangulateComputation::AddBufferSpecs(HdBufferSpecVector *specs) const { // produces same spec buffer as source _source->AddBufferSpecs(specs); } int Hd_QuadrangulateComputation::GetGLComponentDataType() const { return _source->GetGLComponentDataType(); } bool Hd_QuadrangulateComputation::_CheckValid() const { return (_source->IsValid()); } // --------------------------------------------------------------------------- template <typename T> HdBufferSourceSharedPtr _QuadrangulateFaceVarying(HdBufferSourceSharedPtr const &source, VtIntArray const &faceVertexCounts, VtIntArray const &holeFaces, bool flip, SdfPath const &id) { T const *srcPtr = reinterpret_cast<T const *>(source->GetData()); int numElements = source->GetNumElements(); // CPU face-varying quadrangulation bool invalidTopology = false; int numFVarValues = 0; int holeIndex = 0; int numHoleFaces = holeFaces.size(); for (int i = 0; i < faceVertexCounts.size(); ++i) { int nVerts = faceVertexCounts[i]; if (nVerts < 3) { // skip degenerated face invalidTopology = true; } else if (holeIndex < numHoleFaces and holeFaces[holeIndex] == i) { // skip hole face ++holeIndex; } else if (nVerts == 4) { numFVarValues += 4; } else { numFVarValues += 4 * nVerts; } } if (invalidTopology) { TF_WARN("degenerated face found [%s]", id.GetText()); invalidTopology = false; } VtArray<T> results(numFVarValues); // reset holeIndex holeIndex = 0; int dstIndex = 0; for (int i = 0, v = 0; i < faceVertexCounts.size(); ++i) { int nVerts = faceVertexCounts[i]; if (nVerts < 3) { // skip degenerated faces. } else if (holeIndex < numHoleFaces and holeFaces[holeIndex] == i) { // skip hole faces. ++holeIndex; } else if (nVerts == 4) { // copy for (int j = 0; j < 4; ++j) { if (v+j >= numElements) { invalidTopology = true; results[dstIndex++] = T(0); } else { results[dstIndex++] = srcPtr[v+j]; } } } else { // quadrangulate // compute the center first // early out if overrunning if (v+nVerts > numElements) { invalidTopology = true; for (int j = 0; j < nVerts; ++j) { results[dstIndex++] = T(0); results[dstIndex++] = T(0); results[dstIndex++] = T(0); results[dstIndex++] = T(0); } continue; } T center(0); for (int j = 0; j < nVerts; ++j) { center += srcPtr[v+j]; } center /= nVerts; // for each quadrant for (int j = 0; j < nVerts; ++j) { results[dstIndex++] = srcPtr[v+j]; // mid edge results[dstIndex++] = (srcPtr[v+j] + srcPtr[v+(j+1)%nVerts]) * 0.5; // center results[dstIndex++] = center; // mid edge results[dstIndex++] = (srcPtr[v+j] + srcPtr[v+(j+nVerts-1)%nVerts]) * 0.5; } } v += nVerts; } if (invalidTopology) { TF_WARN("numVerts and verts are incosistent [%s]", id.GetText()); } return HdBufferSourceSharedPtr(new HdVtBufferSource( source->GetName(), VtValue(results))); } Hd_QuadrangulateFaceVaryingComputation::Hd_QuadrangulateFaceVaryingComputation( HdMeshTopology *topology, HdBufferSourceSharedPtr const &source, SdfPath const &id) : _id(id), _topology(topology), _source(source) { } bool Hd_QuadrangulateFaceVaryingComputation::Resolve() { if (not TF_VERIFY(_source)) return false; if (not _source->IsResolved()) return false; if (not _TryLock()) return false; HD_TRACE_FUNCTION(); HD_PERF_COUNTER_INCR(HdPerfTokens->quadrangulateFaceVarying); VtIntArray const &faceVertexCounts = _topology->GetFaceVertexCounts(); VtIntArray const &holeFaces = _topology->GetHoleIndices(); bool flip = (_topology->GetOrientation() != HdTokens->rightHanded); HdBufferSourceSharedPtr result; switch (_source->GetGLElementDataType()) { case GL_FLOAT: result = _QuadrangulateFaceVarying<float>( _source, faceVertexCounts, holeFaces, flip, _id); break; case GL_FLOAT_VEC2: result = _QuadrangulateFaceVarying<GfVec2f>( _source, faceVertexCounts, holeFaces, flip, _id); break; case GL_FLOAT_VEC3: result = _QuadrangulateFaceVarying<GfVec3f>( _source, faceVertexCounts, holeFaces, flip, _id); break; case GL_FLOAT_VEC4: result = _QuadrangulateFaceVarying<GfVec4f>( _source, faceVertexCounts, holeFaces, flip, _id); break; case GL_DOUBLE: result = _QuadrangulateFaceVarying<double>( _source, faceVertexCounts, holeFaces, flip, _id); break; case GL_DOUBLE_VEC2: result = _QuadrangulateFaceVarying<GfVec2d>( _source, faceVertexCounts, holeFaces, flip, _id); break; case GL_DOUBLE_VEC3: result = _QuadrangulateFaceVarying<GfVec3d>( _source, faceVertexCounts, holeFaces, flip, _id); break; case GL_DOUBLE_VEC4: result = _QuadrangulateFaceVarying<GfVec4d>( _source, faceVertexCounts, holeFaces, flip, _id); break; default: TF_CODING_ERROR("Unsupported primvar type for quadrangulation [%s]", _id.GetText()); result = _source; break; } _SetResult(result); _SetResolved(); return true; } void Hd_QuadrangulateFaceVaryingComputation::AddBufferSpecs(HdBufferSpecVector *specs) const { // produces same spec buffer as source _source->AddBufferSpecs(specs); } bool Hd_QuadrangulateFaceVaryingComputation::_CheckValid() const { return (_source->IsValid()); } // --------------------------------------------------------------------------- Hd_QuadrangulateComputationGPU::Hd_QuadrangulateComputationGPU( HdMeshTopology *topology, TfToken const &sourceName, GLenum dataType, SdfPath const &id) : _id(id), _topology(topology), _name(sourceName), _dataType(dataType) { if (dataType != GL_FLOAT and dataType != GL_DOUBLE) { TF_CODING_ERROR("Unsupported primvar type for quadrangulation [%s]", _id.GetText()); } } void Hd_QuadrangulateComputationGPU::Execute(HdBufferArrayRangeSharedPtr const &range) { if (not TF_VERIFY(_topology)) return; HD_TRACE_FUNCTION(); HD_PERF_COUNTER_INCR(HdPerfTokens->quadrangulateGPU); // if this topology doesn't contain non-quad faces, quadInfoRange is null. HdBufferArrayRangeSharedPtr const &quadrangulateTableRange = _topology->GetQuadrangulateTableRange(); if (not quadrangulateTableRange) return; HD_TRACE_FUNCTION(); HD_MALLOC_TAG_FUNCTION(); Hd_QuadInfo const *quadInfo = _topology->GetQuadInfo(); if (not quadInfo) { TF_CODING_ERROR("Hd_QuadInfo is null."); return; } if (not glDispatchCompute) return; // select shader by datatype TfToken shaderToken = (_dataType == GL_FLOAT ? HdGLSLProgramTokens->quadrangulateFloat : HdGLSLProgramTokens->quadrangulateDouble); HdGLSLProgramSharedPtr computeProgram = HdGLSLProgram::GetComputeProgram(shaderToken); if (not computeProgram) return; GLuint program = computeProgram->GetProgram().GetId(); // buffer resources for GPU computation HdBufferResourceSharedPtr primVar = range->GetResource(_name); HdBufferResourceSharedPtr quadrangulateTable = quadrangulateTableRange->GetResource(); // prepare uniform buffer for GPU computation struct Uniform { int vertexOffset; int quadInfoStride; int quadInfoOffset; int maxNumVert; int primVarOffset; int primVarStride; int numComponents; } uniform; int quadInfoStride = quadInfo->maxNumVert + 2; // coherent vertex offset in aggregated buffer array uniform.vertexOffset = range->GetOffset(); // quadinfo offset/stride in aggregated adjacency table uniform.quadInfoStride = quadInfoStride; uniform.quadInfoOffset = quadrangulateTable->GetOffset(); uniform.maxNumVert = quadInfo->maxNumVert; // interleaved offset/stride to points // note: this code (and the glsl smooth normal compute shader) assumes // components in interleaved vertex array are always same data type. // i.e. it can't handle an interleaved array which interleaves // float/double, float/int etc. uniform.primVarOffset = primVar->GetOffset() / primVar->GetComponentSize(); uniform.primVarStride = primVar->GetStride() / primVar->GetComponentSize(); uniform.numComponents = primVar->GetNumComponents(); // transfer uniform buffer GLuint ubo = computeProgram->GetGlobalUniformBuffer().GetId(); HdRenderContextCaps const &caps = HdRenderContextCaps::GetInstance(); // XXX: workaround for 319.xx driver bug of glNamedBufferDataEXT on UBO // XXX: move this workaround to renderContextCaps if (false and caps.directStateAccessEnabled) { glNamedBufferDataEXT(ubo, sizeof(uniform), &uniform, GL_STATIC_DRAW); } else { glBindBuffer(GL_UNIFORM_BUFFER, ubo); glBufferData(GL_UNIFORM_BUFFER, sizeof(uniform), &uniform, GL_STATIC_DRAW); glBindBuffer(GL_UNIFORM_BUFFER, 0); } glBindBufferBase(GL_UNIFORM_BUFFER, 0, ubo); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, primVar->GetId()); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, quadrangulateTable->GetId()); // dispatch compute kernel glUseProgram(program); int numNonQuads = (int)quadInfo->numVerts.size(); glDispatchCompute(numNonQuads, 1, 1); glUseProgram(0); glBindBufferBase(GL_UNIFORM_BUFFER, 0, 0); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, 0); glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, 0); HD_PERF_COUNTER_ADD(HdPerfTokens->quadrangulatedVerts, quadInfo->numAdditionalPoints); } void Hd_QuadrangulateComputationGPU::AddBufferSpecs(HdBufferSpecVector *specs) const { // nothing // // GPU quadrangulation requires the source data on GPU in prior to // execution, so no need to populate bufferspec on registration. } int Hd_QuadrangulateComputationGPU::GetNumOutputElements() const { Hd_QuadInfo const *quadInfo = _topology->GetQuadInfo(); if (not quadInfo) { TF_CODING_ERROR("Hd_QuadInfo is null [%s]", _id.GetText()); return 0; } return quadInfo->pointsOffset + quadInfo->numAdditionalPoints; }
32.401392
87
0.608127
99729080b278e38abd0603ace3e6b2327a716b4e
249
cpp
C++
Leetcode Problems/26.Remove_Duplicates_from_Sorted_Array.cpp
rishusingh022/My-Journey-of-Data-Structures-and-Algorithms
28a70fdf10366fc97ddb9f6a69852b3478b564e6
[ "MIT" ]
1
2021-01-13T07:20:57.000Z
2021-01-13T07:20:57.000Z
Leetcode Problems/26.Remove_Duplicates_from_Sorted_Array.cpp
rishusingh022/My-Journey-of-Data-Structures-and-Algorithms
28a70fdf10366fc97ddb9f6a69852b3478b564e6
[ "MIT" ]
1
2021-10-01T18:26:34.000Z
2021-10-01T18:26:34.000Z
Leetcode Problems/26.Remove_Duplicates_from_Sorted_Array.cpp
rishusingh022/My-Journey-of-Data-Structures-and-Algorithms
28a70fdf10366fc97ddb9f6a69852b3478b564e6
[ "MIT" ]
7
2021-10-01T16:07:29.000Z
2021-10-04T13:23:48.000Z
class Solution { public: int removeDuplicates(vector<int>& nums) { vector<int>::iterator ip; ip = std::unique(nums.begin(), nums.end()); nums.resize(std::distance(nums.begin(), ip)); return nums.size(); } };
27.666667
53
0.574297
99753e1401a617d5b2566b133eedd37307d7b558
345
cpp
C++
sdk/src/frame_operations.cpp
andreeasandulescu/aditof_sdk
c554aacc610f9086636b2742266726123989c4fd
[ "BSD-3-Clause" ]
null
null
null
sdk/src/frame_operations.cpp
andreeasandulescu/aditof_sdk
c554aacc610f9086636b2742266726123989c4fd
[ "BSD-3-Clause" ]
null
null
null
sdk/src/frame_operations.cpp
andreeasandulescu/aditof_sdk
c554aacc610f9086636b2742266726123989c4fd
[ "BSD-3-Clause" ]
null
null
null
#include <aditof/frame_operations.h> namespace aditof { bool operator==(const FrameDetails &lhs, const FrameDetails &rhs) { return lhs.type == rhs.type && lhs.width == rhs.width && lhs.width && rhs.height; } bool operator!=(const FrameDetails &lhs, const FrameDetails &rhs) { return !(lhs == rhs); } } // namespace aditof
23
73
0.663768
9978b390491df18d645dde376bb564e507571ed5
201
hpp
C++
engine/engine.hpp
davidscholberg/opengl-es-test
9792d6d6f4f01fb91a8ec59ecf0fd02cd019db79
[ "BSD-2-Clause" ]
null
null
null
engine/engine.hpp
davidscholberg/opengl-es-test
9792d6d6f4f01fb91a8ec59ecf0fd02cd019db79
[ "BSD-2-Clause" ]
null
null
null
engine/engine.hpp
davidscholberg/opengl-es-test
9792d6d6f4f01fb91a8ec59ecf0fd02cd019db79
[ "BSD-2-Clause" ]
null
null
null
#ifndef ENGINE_HPP_ #define ENGINE_HPP_ class engine { public: engine(); engine(engine const &) = delete; ~engine(); void operator=(engine const &) = delete; }; #endif // ENGINE_HPP_
15.461538
44
0.651741
5f53ae65b626f3f81e712d5ccfec67ede8b34bb3
6,275
cpp
C++
ECS/Project/Project/Renderers/RendererModules/DPassLightingModule/DPassLightingModule.cpp
AshwinKumarVijay/SceneECS
2acc115d5e7738ef9bf087c025e5e5a10cac3443
[ "MIT" ]
2
2017-01-30T23:38:49.000Z
2017-09-08T09:34:37.000Z
ECS/Project/Project/Renderers/RendererModules/DPassLightingModule/DPassLightingModule.cpp
AshwinKumarVijay/SceneECS
2acc115d5e7738ef9bf087c025e5e5a10cac3443
[ "MIT" ]
null
null
null
ECS/Project/Project/Renderers/RendererModules/DPassLightingModule/DPassLightingModule.cpp
AshwinKumarVijay/SceneECS
2acc115d5e7738ef9bf087c025e5e5a10cac3443
[ "MIT" ]
null
null
null
#include "DPassLightingModule.h" #include "../Renderers/ModuleRenderer/ModuleRenderer.h" #include "../GBufferModule/GBufferModule.h" #include "../LightsModule/LightsModule.h" #include "../../../Camera/Camera.h" #include "../../RendererResourceManagers/RendererShaderManager/RendererShaderData/RendererShaderData.h" // Default DPassLightingModule Constructor. DPassLightingModule::DPassLightingModule(std::shared_ptr<Renderer> newRenderer, std::shared_ptr<const GBufferModule> newGBufferModule, std::shared_ptr<const LightsModule> newLightsModule) : RendererModule(newRenderer) { // Copy over the Screen Width and Screen Height Textures. screenWidth = newRenderer->getSceneQuality().screenWidth; screenHeight = newRenderer->getSceneQuality().screenHeight; // Copy over the G Buffer Module. gBufferModule = newGBufferModule; // Copy over the Lights Module. lightsModule = newLightsModule; // Create the Deferred Pass Lighting Shader. deferredPassLightingShader = std::make_shared<RendererShaderData>(); // Add the Property Value. deferredPassLightingShader->addPropertyValue("Shader Type", "Deferred Lighting Pass Shader"); deferredPassLightingShader->addPropertyValue("Shader Output Opacity", "False"); // Set the Vertex Shader G Buffer Source. std::string vsSource = "Assets/ModuleRendererShaders/DeferredLightingPassShaders/PhongLightingPassShaders/PhongLightingShader.vert.glsl"; deferredPassLightingShader->addPropertyValue("Vertex Shader Source", vsSource); // Set the Fragment Shader G Buffer Source. std::string fsSource = "Assets/ModuleRendererShaders/DeferredLightingPassShaders/PhongLightingPassShaders/PhongLightingShader.frag.glsl"; deferredPassLightingShader->addPropertyValue("Fragment Shader Source", fsSource); // Add the Shader to the Module Renderer. newRenderer->addShader(deferredPassLightingShader); // createDeferredPassLightingTexturesAndFramebuffers(); } // Default DPassLightingModule Destructor. DPassLightingModule::~DPassLightingModule() { } // Render the Deferred Pass Lighting Module. void DPassLightingModule::render(const float & deltaFrameTime, const float & currentFrameTime, const float & lastFrameTime, std::shared_ptr<const Camera> activeCamera) { // Use the Program. glUseProgram(deferredPassLightingShader->getShaderID()); // Bind the Deferred Pass Lighting Framebuffer Object. glBindFramebuffer(GL_FRAMEBUFFER, deferredPassLightingFramebuffer); glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // std::shared_ptr<ModuleRenderer> moduleRenderer = std::dynamic_pointer_cast<ModuleRenderer>(getRenderer().lock()); // Upload the Ambient Light Data. moduleRenderer->uploadAmbientLightData(*deferredPassLightingShader); // Upload the Camera Data. moduleRenderer->uploadCameraData(*deferredPassLightingShader, glm::vec4(activeCamera->getCameraPosition(), 1.0), activeCamera->getPerspectiveMatrix(), activeCamera->getViewMatrix(), glm::vec4(activeCamera->getNearClip(), activeCamera->getFarClip(), 0.0, 0.0)); // Upload the G Buffer Textures. moduleRenderer->uploadGBufferTextures(*deferredPassLightingShader, gBufferModule.lock()->viewWorldSpacePositionTexture(), gBufferModule.lock()->viewWorldSpaceVertexNormalAndDepthTexture(), gBufferModule.lock()->viewAmbientColorTexture(), gBufferModule.lock()->viewDiffuseAlbedoAndLitTypeTexture(), gBufferModule.lock()->viewSpecularAlbedoAndLightingTypeTexture(), gBufferModule.lock()->viewMRFOTexture(), gBufferModule.lock()->viewEmissiveColorAndIntensityTexture(), 0); // Upload the Lights Data. lightsModule.lock()->uploadLightsData(deferredPassLightingShader); // Draw the Arrays. glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); // Bind the Default Framebuffer. glBindFramebuffer(GL_FRAMEBUFFER, 0); } // Create the Deferred Pass Lighting Textures And Framebuffers. void DPassLightingModule::createDeferredPassLightingTexturesAndFramebuffers() { // Create the Deferred Pass Lighting Module Color Texture. glGenTextures(1, &deferredPassLightingModuleColorTexture); glBindTexture(GL_TEXTURE_2D, deferredPassLightingModuleColorTexture); glTextureImage2DEXT(deferredPassLightingModuleColorTexture, GL_TEXTURE_2D, 0, GL_RGBA32F, screenWidth, screenHeight, 0, GL_RGBA, GL_FLOAT, NULL); glTextureParameteri(deferredPassLightingModuleColorTexture, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTextureParameteri(deferredPassLightingModuleColorTexture, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glBindTexture(GL_TEXTURE_2D, 0); // Create the Deferred Pass Lighting Module Depth Texture. glGenTextures(1, &deferredPassLightingModuleDepthTexture); glBindTexture(GL_TEXTURE_2D, deferredPassLightingModuleDepthTexture); glTextureImage2DEXT(deferredPassLightingModuleDepthTexture, GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, screenWidth, screenHeight, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL); glTextureParameteri(deferredPassLightingModuleDepthTexture, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTextureParameteri(deferredPassLightingModuleDepthTexture, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glBindTexture(GL_TEXTURE_2D, 0); // Bind the Deferred Pass Lighting Framebuffer Object glGenFramebuffers(1, &deferredPassLightingFramebuffer); glBindFramebuffer(GL_FRAMEBUFFER, deferredPassLightingFramebuffer); // Associate the Color Texture with the Current Framebuffer. glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + 0, GL_TEXTURE_2D, deferredPassLightingModuleColorTexture, 0); // Associate the Depth Stencil Texture with the Current Framebuffer. glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, deferredPassLightingModuleDepthTexture, 0); // Set the Draw Buffers of the Current Framebuffer. GLenum framebufferDrawBuffers[] = { GL_COLOR_ATTACHMENT0 + 0 }; glDrawBuffers(1, framebufferDrawBuffers); // Bind the Default Framebuffer. glBindFramebuffer(GL_FRAMEBUFFER, 0); } // Return the Deferred Pass Lighting Color Texture. unsigned int DPassLightingModule::viewDeferredPassLightingColorTexture() { return deferredPassLightingModuleColorTexture; } // Return the Deferred Pass Lighting Depth Texture. unsigned int DPassLightingModule::viewDeferredPassLightingDepthTexture() { return deferredPassLightingModuleDepthTexture; }
45.80292
471
0.821514
5f54235200ec8d97ec06dea28849d76f39f3f2f0
894
cpp
C++
Week00/Kruskal.cpp
princesinghtomar/Competitive-Programming
a0df818dfa56267fdde59bd1862d0b78f6e069c4
[ "MIT" ]
3
2020-11-11T13:45:40.000Z
2021-07-20T11:53:34.000Z
Week00/Kruskal.cpp
princesinghtomar/Competitive-Programming
a0df818dfa56267fdde59bd1862d0b78f6e069c4
[ "MIT" ]
11
2020-10-03T14:26:35.000Z
2021-10-30T15:26:40.000Z
Week00/Kruskal.cpp
princesinghtomar/Competitive-Programming
a0df818dfa56267fdde59bd1862d0b78f6e069c4
[ "MIT" ]
12
2020-05-12T08:39:54.000Z
2021-10-30T14:56:27.000Z
#include<iostream> #include<utility> #include<vector> #include<algorithm> using namespace std; vector<pair<long long int,pair<long long int,long long int>>> v; long long int P[1000006],S[1000006]; long long int dsu(long long int x,long long int y) { long long int i,j; i=x; while(i!=P[i]) { P[i]=P[P[i]]; i=P[i]; } j=y; while(j!=P[j]) { P[j]=P[P[j]]; j=P[j]; } if(i==j) return 1; else { if(S[i]>S[j]) { P[j]=P[i]; S[i] += S[j]; } else { P[i]=P[j]; S[j] += S[i]; } return 0; } } int main() { long long int N,M,i,j,a,b,c,ans=0; cin>>N>>M; for(i=0;i<N;i++) { P[i]=i; S[i]=1; } for(i=0;i<M;i++) { cin>>a>>b>>c; v.push_back(make_pair(c,make_pair(a,b))); } sort(v.begin(),v.end()); for(i=0;i<M;i++) { j = dsu(v[i].second.first,v[i].second.second); if(j==0) ans += v[i].first; } cout<<ans<<endl; return 0; }
11.461538
64
0.517897
5f55451154271c6f2ddcb48dab20ed261f716b75
12,889
cpp
C++
src/ndnSIM/NFD/tests/daemon/mgmt/command-authenticator.t.cpp
NDNLink/NDN-Chord
cfabf8f56eea2c4ba47052ce145a939ebdc21e57
[ "MIT" ]
1
2021-09-07T04:12:15.000Z
2021-09-07T04:12:15.000Z
src/ndnSIM/NFD/tests/daemon/mgmt/command-authenticator.t.cpp
NDNLink/NDN-Chord
cfabf8f56eea2c4ba47052ce145a939ebdc21e57
[ "MIT" ]
null
null
null
src/ndnSIM/NFD/tests/daemon/mgmt/command-authenticator.t.cpp
NDNLink/NDN-Chord
cfabf8f56eea2c4ba47052ce145a939ebdc21e57
[ "MIT" ]
1
2020-07-15T06:21:03.000Z
2020-07-15T06:21:03.000Z
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2014-2018, Regents of the University of California, * Arizona Board of Regents, * Colorado State University, * University Pierre & Marie Curie, Sorbonne University, * Washington University in St. Louis, * Beijing Institute of Technology, * The University of Memphis. * * This file is part of NFD (Named Data Networking Forwarding Daemon). * See AUTHORS.md for complete list of NFD authors and contributors. * * NFD is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. */ #include "mgmt/command-authenticator.hpp" #include "tests/test-common.hpp" #include "tests/manager-common-fixture.hpp" #include <boost/filesystem.hpp> namespace nfd { namespace tests { class CommandAuthenticatorFixture : public CommandInterestSignerFixture { protected: CommandAuthenticatorFixture() : authenticator(CommandAuthenticator::create()) { } void makeModules(std::initializer_list<std::string> modules) { for (const std::string& module : modules) { authorizations.emplace(module, authenticator->makeAuthorization(module, "verb")); } } void loadConfig(const std::string& config) { auto configPath = boost::filesystem::current_path() / "command-authenticator-test.conf"; ConfigFile cf; authenticator->setConfigFile(cf); cf.parse(config, false, configPath.c_str()); } bool authorize(const std::string& module, const Name& identity, const std::function<void(Interest&)>& modifyInterest = nullptr) { Interest interest = this->makeControlCommandRequest(Name("/prefix/" + module + "/verb"), ControlParameters(), identity); if (modifyInterest != nullptr) { modifyInterest(interest); } ndn::mgmt::Authorization authorization = authorizations.at(module); bool isAccepted = false; bool isRejected = false; authorization(Name("/prefix"), interest, nullptr, [this, &isAccepted, &isRejected] (const std::string& requester) { BOOST_REQUIRE_MESSAGE(!isAccepted && !isRejected, "authorization function should invoke only one continuation"); isAccepted = true; lastRequester = requester; }, [this, &isAccepted, &isRejected] (ndn::mgmt::RejectReply act) { BOOST_REQUIRE_MESSAGE(!isAccepted && !isRejected, "authorization function should invoke only one continuation"); isRejected = true; lastRejectReply = act; }); this->advanceClocks(1_ms, 10); BOOST_REQUIRE_MESSAGE(isAccepted || isRejected, "authorization function should invoke one continuation"); return isAccepted; } protected: shared_ptr<CommandAuthenticator> authenticator; std::unordered_map<std::string, ndn::mgmt::Authorization> authorizations; std::string lastRequester; ndn::mgmt::RejectReply lastRejectReply; }; BOOST_AUTO_TEST_SUITE(Mgmt) BOOST_FIXTURE_TEST_SUITE(TestCommandAuthenticator, CommandAuthenticatorFixture) BOOST_AUTO_TEST_CASE(Certs) { Name id0("/localhost/CommandAuthenticator/0"); Name id1("/localhost/CommandAuthenticator/1"); Name id2("/localhost/CommandAuthenticator/2"); BOOST_REQUIRE(addIdentity(id0)); BOOST_REQUIRE(saveIdentityCertificate(id1, "1.ndncert", true)); BOOST_REQUIRE(saveIdentityCertificate(id2, "2.ndncert", true)); makeModules({"module0", "module1", "module2", "module3", "module4", "module5", "module6", "module7"}); const std::string& config = R"CONFIG( authorizations { authorize { certfile any privileges { module1 module3 module5 module7 } } authorize { certfile "1.ndncert" privileges { module2 module3 module6 module7 } } authorize { certfile "2.ndncert" privileges { module4 module5 module6 module7 } } } )CONFIG"; loadConfig(config); // module0: none BOOST_CHECK_EQUAL(authorize("module0", id0), false); BOOST_CHECK_EQUAL(authorize("module0", id1), false); BOOST_CHECK_EQUAL(authorize("module0", id2), false); // module1: any BOOST_CHECK_EQUAL(authorize("module1", id0), true); BOOST_CHECK_EQUAL(authorize("module1", id1), true); BOOST_CHECK_EQUAL(authorize("module1", id2), true); // module2: id1 BOOST_CHECK_EQUAL(authorize("module2", id0), false); BOOST_CHECK_EQUAL(authorize("module2", id1), true); BOOST_CHECK_EQUAL(authorize("module2", id2), false); // module3: any,id1 BOOST_CHECK_EQUAL(authorize("module3", id0), true); BOOST_CHECK_EQUAL(authorize("module3", id1), true); BOOST_CHECK_EQUAL(authorize("module3", id2), true); // module4: id2 BOOST_CHECK_EQUAL(authorize("module4", id0), false); BOOST_CHECK_EQUAL(authorize("module4", id1), false); BOOST_CHECK_EQUAL(authorize("module4", id2), true); // module5: any,id2 BOOST_CHECK_EQUAL(authorize("module5", id0), true); BOOST_CHECK_EQUAL(authorize("module5", id1), true); BOOST_CHECK_EQUAL(authorize("module5", id2), true); // module6: id1,id2 BOOST_CHECK_EQUAL(authorize("module6", id0), false); BOOST_CHECK_EQUAL(authorize("module6", id1), true); BOOST_CHECK_EQUAL(authorize("module6", id2), true); // module7: any,id1,id2 BOOST_CHECK_EQUAL(authorize("module7", id0), true); BOOST_CHECK_EQUAL(authorize("module7", id1), true); BOOST_CHECK_EQUAL(authorize("module7", id2), true); } BOOST_AUTO_TEST_CASE(Requester) { Name id0("/localhost/CommandAuthenticator/0"); Name id1("/localhost/CommandAuthenticator/1"); BOOST_REQUIRE(addIdentity(id0)); BOOST_REQUIRE(saveIdentityCertificate(id1, "1.ndncert", true)); makeModules({"module0", "module1"}); const std::string& config = R"CONFIG( authorizations { authorize { certfile any privileges { module0 } } authorize { certfile "1.ndncert" privileges { module1 } } } )CONFIG"; loadConfig(config); // module0: any BOOST_CHECK_EQUAL(authorize("module0", id0), true); BOOST_CHECK_EQUAL(lastRequester, "*"); BOOST_CHECK_EQUAL(authorize("module0", id1), true); BOOST_CHECK_EQUAL(lastRequester, "*"); // module1: id1 BOOST_CHECK_EQUAL(authorize("module1", id0), false); BOOST_CHECK_EQUAL(authorize("module1", id1), true); BOOST_CHECK(id1.isPrefixOf(lastRequester)); } class IdentityAuthorizedFixture : public CommandAuthenticatorFixture { protected: IdentityAuthorizedFixture() : id1("/localhost/CommandAuthenticator/1") { BOOST_REQUIRE(saveIdentityCertificate(id1, "1.ndncert", true)); makeModules({"module1"}); const std::string& config = R"CONFIG( authorizations { authorize { certfile "1.ndncert" privileges { module1 } } } )CONFIG"; loadConfig(config); } bool authorize1(const std::function<void(Interest&)>& modifyInterest) { return authorize("module1", id1, modifyInterest); } protected: Name id1; }; BOOST_FIXTURE_TEST_SUITE(Rejects, IdentityAuthorizedFixture) BOOST_AUTO_TEST_CASE(BadKeyLocator_NameTooShort) { BOOST_CHECK_EQUAL(authorize1( [] (Interest& interest) { interest.setName("/prefix"); } ), false); BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::SILENT); } BOOST_AUTO_TEST_CASE(BadKeyLocator_BadSigInfo) { BOOST_CHECK_EQUAL(authorize1( [] (Interest& interest) { setNameComponent(interest, ndn::signed_interest::POS_SIG_INFO, "not-SignatureInfo"); } ), false); BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::SILENT); } BOOST_AUTO_TEST_CASE(BadKeyLocator_MissingKeyLocator) { BOOST_CHECK_EQUAL(authorize1( [] (Interest& interest) { ndn::SignatureInfo sigInfo(tlv::SignatureSha256WithRsa); setNameComponent(interest, ndn::signed_interest::POS_SIG_INFO, sigInfo.wireEncode().begin(), sigInfo.wireEncode().end()); } ), false); BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::SILENT); } BOOST_AUTO_TEST_CASE(BadKeyLocator_BadKeyLocatorType) { BOOST_CHECK_EQUAL(authorize1( [] (Interest& interest) { ndn::KeyLocator kl; kl.setKeyDigest(ndn::encoding::makeBinaryBlock(tlv::KeyDigest, "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD", 8)); ndn::SignatureInfo sigInfo(tlv::SignatureSha256WithRsa); sigInfo.setKeyLocator(kl); setNameComponent(interest, ndn::signed_interest::POS_SIG_INFO, sigInfo.wireEncode().begin(), sigInfo.wireEncode().end()); } ), false); BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::SILENT); } BOOST_AUTO_TEST_CASE(NotAuthorized) { Name id0("/localhost/CommandAuthenticator/0"); BOOST_REQUIRE(addIdentity(id0)); BOOST_CHECK_EQUAL(authorize("module1", id0), false); BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::STATUS403); } BOOST_AUTO_TEST_CASE(BadSig) { BOOST_CHECK_EQUAL(authorize1( [] (Interest& interest) { setNameComponent(interest, ndn::command_interest::POS_SIG_VALUE, "bad-signature-bits"); } ), false); BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::STATUS403); } BOOST_AUTO_TEST_CASE(InvalidTimestamp) { name::Component timestampComp; BOOST_CHECK_EQUAL(authorize1( [&timestampComp] (const Interest& interest) { timestampComp = interest.getName().at(ndn::command_interest::POS_TIMESTAMP); } ), true); // accept first command BOOST_CHECK_EQUAL(authorize1( [&timestampComp] (Interest& interest) { setNameComponent(interest, ndn::command_interest::POS_TIMESTAMP, timestampComp); } ), false); // reject second command because timestamp equals first command BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::STATUS403); } BOOST_FIXTURE_TEST_CASE(MissingAuthorizationsSection, CommandAuthenticatorFixture) { Name id0("/localhost/CommandAuthenticator/0"); BOOST_REQUIRE(addIdentity(id0)); makeModules({"module42"}); loadConfig(""); BOOST_CHECK_EQUAL(authorize("module42", id0), false); BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::STATUS403); } BOOST_AUTO_TEST_SUITE_END() // Rejects BOOST_AUTO_TEST_SUITE(BadConfig) BOOST_AUTO_TEST_CASE(EmptyAuthorizationsSection) { const std::string& config = R"CONFIG( authorizations { } )CONFIG"; BOOST_CHECK_THROW(loadConfig(config), ConfigFile::Error); } BOOST_AUTO_TEST_CASE(UnrecognizedKey) { const std::string& config = R"CONFIG( authorizations { unrecognized_key { } } )CONFIG"; BOOST_CHECK_THROW(loadConfig(config), ConfigFile::Error); } BOOST_AUTO_TEST_CASE(CertfileMissing) { const std::string& config = R"CONFIG( authorizations { authorize { privileges { } } } )CONFIG"; BOOST_CHECK_THROW(loadConfig(config), ConfigFile::Error); } BOOST_AUTO_TEST_CASE(CertUnreadable) { const std::string& config = R"CONFIG( authorizations { authorize { certfile "1.ndncert" privileges { } } } )CONFIG"; BOOST_CHECK_THROW(loadConfig(config), ConfigFile::Error); } BOOST_AUTO_TEST_CASE(PrivilegesMissing) { const std::string& config = R"CONFIG( authorizations { authorize { certfile any } } )CONFIG"; BOOST_CHECK_THROW(loadConfig(config), ConfigFile::Error); } BOOST_AUTO_TEST_CASE(UnregisteredModule) { const std::string& config = R"CONFIG( authorizations { authorize { certfile any privileges { nosuchmodule } } } )CONFIG"; BOOST_CHECK_THROW(loadConfig(config), ConfigFile::Error); } BOOST_AUTO_TEST_SUITE_END() // BadConfig BOOST_AUTO_TEST_SUITE_END() // TestCommandAuthenticator BOOST_AUTO_TEST_SUITE_END() // Mgmt } // namespace tests } // namespace nfd
27.134737
109
0.66708
5f5592726c03618955fb5f662a83cf8ca5b042a6
343
cpp
C++
Source/TextureBaker/Private/TextureBakerCommands.cpp
WhiteWh/UE4TextureBaker
976decb8a895bb7aa8c4dad17e857b25a7a753ce
[ "MIT" ]
7
2021-05-04T10:33:36.000Z
2022-02-02T20:06:21.000Z
Source/TextureBaker/Private/TextureBakerCommands.cpp
WhiteWh/UE4TextureBaker
976decb8a895bb7aa8c4dad17e857b25a7a753ce
[ "MIT" ]
null
null
null
Source/TextureBaker/Private/TextureBakerCommands.cpp
WhiteWh/UE4TextureBaker
976decb8a895bb7aa8c4dad17e857b25a7a753ce
[ "MIT" ]
null
null
null
// Copyright Epic Games, Inc. All Rights Reserved. #include "TextureBakerCommands.h" #define LOCTEXT_NAMESPACE "FTextureBakerModule" void FTextureBakerCommands::RegisterCommands() { UI_COMMAND(OpenPluginWindow, "TextureBaker", "Bring up TextureBaker window", EUserInterfaceActionType::Button, FInputGesture()); } #undef LOCTEXT_NAMESPACE
26.384615
129
0.80758
5f58e8a2a07d36c37ebe2d543e363510648bc238
3,934
cc
C++
src/imageprocessing/contour.cc
SanczoPL/gt-annotate
b760d0dc3f91ce5748190b95468e2e54bee76b2a
[ "MIT" ]
null
null
null
src/imageprocessing/contour.cc
SanczoPL/gt-annotate
b760d0dc3f91ce5748190b95468e2e54bee76b2a
[ "MIT" ]
null
null
null
src/imageprocessing/contour.cc
SanczoPL/gt-annotate
b760d0dc3f91ce5748190b95468e2e54bee76b2a
[ "MIT" ]
null
null
null
#include "imageprocessing/contour.h" #include <QJsonObject> #include <QJsonArray> #include <QFile> #include <QJsonDocument> #include <QDebug> #include <QRectF> #include <QString> //#define DEBUG constexpr auto NAME{ "Name" }; constexpr auto WIDTH{ "Width" }; constexpr auto HEIGHT{ "Height" }; constexpr auto X{ "X" }; constexpr auto Y{ "Y" }; constexpr auto SIZE{ "Size" }; constexpr auto CONTOUR{ "Contour" }; constexpr auto CANNY_TRESHOLD{ "CannyTreshold" }; constexpr auto DILATE_COUNTER{ "DilateCounter" }; constexpr auto ERODE_COUNTER{ "ErodeCounter" }; constexpr auto MIN_AREA{ "MinArea" }; constexpr auto MAX_AREA{ "MaxArea" }; constexpr auto ROTATED_RECT{ "RotatedRect" }; constexpr auto BOUNDING_RECT{ "BoundingRect" }; Contour::Contour() { configureDefault(); } void Contour::configureDefault() { m_treshCanny = 3; m_dilateCounter = 2; m_erodeCounter = 2; m_minArea = 4; m_maxArea = 40000; } void Contour::configure(const QJsonObject &a_config) { m_treshCanny = a_config[CANNY_TRESHOLD].toInt(); m_dilateCounter = a_config[DILATE_COUNTER].toInt(); m_erodeCounter = a_config[ERODE_COUNTER].toInt(); m_minArea = a_config[MIN_AREA].toInt(); m_maxArea = a_config[MAX_AREA].toInt(); } void Contour::createCannyImage(cv::Mat &opencv_img, cv::Mat &canny_output) { #ifdef DEBUG Logger->debug("Contour::createCannyImage()"); #endif cv::dilate(opencv_img, opencv_img, cv::Mat(), cv::Point(-1, -1), m_dilateCounter, 1, 1); cv::erode(opencv_img, opencv_img, cv::Mat(), cv::Point(-1, -1), m_erodeCounter, 1, 1); cv::Canny(opencv_img, canny_output, m_treshCanny, m_treshCanny*2 ); } void Contour::findContours(cv::Mat & input, QJsonArray & contoursArray, QString label) { #ifdef DEBUG Logger->debug("Contour::FindContours()"); #endif cv::Mat canny_output; Contour::createCannyImage(input, canny_output); std::vector<std::vector<cv::Point> > contours; std::vector<cv::Vec4i> hierarchy; cv::findContours(input, contours, hierarchy, cv::RETR_EXTERNAL, cv::CHAIN_APPROX_SIMPLE ); double area; std::vector<std::vector<cv::Point>> contoursBEST; std::vector<cv::Vec4i> hierarchyBEST; std::vector<cv::Point> approx; for (unsigned int i = 0; i < contours.size(); i++) { area = cv::contourArea(contours[i]); //if ((area >= m_minArea) && (area <= m_maxArea)) { contoursBEST.push_back(contours[i]); hierarchyBEST.push_back(hierarchy[i]); } } for (unsigned int i = 0; i < contoursBEST.size(); i++) { cv::approxPolyDP(cv::Mat(contoursBEST[i]), approx, cv::arcLength(cv::Mat(contoursBEST[i]), true) * 0.04, true); area = cv::contourArea(contoursBEST[i]); cv::Rect boundRect; boundRect = cv::boundingRect(contoursBEST[i]); /* // TODO: add support for rotatedrect: cv::RotatedRect; RotatedRect = minAreaRect( contoursBEST[i] ); // rotated rectangle Point2f rect_points[4]; minRect[i].points( rect_points ); for ( int j = 0; j < 4; j++ ) { line( drawing, rect_points[j], rect_points[(j+1)%4], color ); }*/ int x = boundRect.x; int y = boundRect.y; int width = boundRect.width; int height = boundRect.height; int size = qAbs(width / 2) * qAbs(height / 2); QJsonObject obj { { NAME, label}, { X, x }, { Y, y }, { WIDTH, width }, { HEIGHT, height }, { SIZE, size} }; contoursArray.append(obj); #ifdef DEBUG Logger->debug("Contour::FindContours() obj, contoursArray:"); qDebug() << "obj:" << obj; qDebug() << "contoursArray:" << contoursArray; #endif } } /* void Contour::crateRois(cv::Mat &opencv_img, QString label, QJsonArray& contoursArray) { Logger->trace("Contour::CrateRois()"); cv::Mat canny_output; Contour::CreateCannyImage(opencv_img, canny_output); QString _name = label + "_canny_output.png"; cv::imwrite(_name.toStdString(), canny_output); Contour::FindContours(canny_output, contoursArray, label); Logger->trace("Contour::CrateRois() done"); }*/
26.402685
113
0.684291
5f591ef1df93a565bdf87b4967e0b3b6c6cc98ce
4,793
cpp
C++
teleconf.cpp
boochow/teleconf
c90b04c0daf786870709d218f4c29848d16ecace
[ "MIT" ]
3
2020-08-01T17:46:06.000Z
2021-04-09T17:24:53.000Z
teleconf.cpp
boochow/teleconf
c90b04c0daf786870709d218f4c29848d16ecace
[ "MIT" ]
null
null
null
teleconf.cpp
boochow/teleconf
c90b04c0daf786870709d218f4c29848d16ecace
[ "MIT" ]
null
null
null
/* * File: teleconf.cpp */ #include "usermodfx.h" #include "biquad.hpp" #define SUBTIMBRE 0 // filter parameters #define LPF_FC 3000.f #define HPF_FC 300.f #define LPF_Q 0.707f // filters before downsampling static dsp::BiQuad s_bq_lpf_r; static dsp::BiQuad s_bq_hpf_r; static dsp::BiQuad s_bq_lpf_l; static dsp::BiQuad s_bq_hpf_l; #if SUBTIMBRE static dsp::BiQuad s_bqs_lpf_r; static dsp::BiQuad s_bqs_hpf_r; static dsp::BiQuad s_bqs_lpf_l; static dsp::BiQuad s_bqs_hpf_l; #endif // filters after downsampling static dsp::BiQuad s_bq_lpf_out_r; static dsp::BiQuad s_bq_lpf_out2_r; static dsp::BiQuad s_bq_lpf_out_l; static dsp::BiQuad s_bq_lpf_out2_l; #if SUBTIMBRE static dsp::BiQuad s_bqs_lpf_out_r; static dsp::BiQuad s_bqs_lpf_out2_r; static dsp::BiQuad s_bqs_lpf_out_l; static dsp::BiQuad s_bqs_lpf_out2_l; #endif static const float s_fs_recip = 1.f / 48000.f; static float dry = 0.f; static float wet = 1.f; static uint32_t count = 0; static float lastmy_r; static float lastmy_l; #if SUBTIMBRE static float lastsy_r; static float lastsy_l; #endif void init_lpf(const float f, const float q) { float wc = s_bq_lpf_r.mCoeffs.wc(f, s_fs_recip); s_bq_lpf_r.mCoeffs.setSOLP(fx_tanpif(wc), q); s_bq_lpf_out_r.mCoeffs = s_bq_lpf_r.mCoeffs; s_bq_lpf_out2_r.mCoeffs = s_bq_lpf_r.mCoeffs; #if SUBTIMBRE s_bqs_lpf_r.mCoeffs = s_bq_lpf_r.mCoeffs; s_bqs_lpf_out_r.mCoeffs = s_bq_lpf_r.mCoeffs; s_bqs_lpf_out2_r.mCoeffs = s_bq_lpf_r.mCoeffs; #endif s_bq_lpf_l.mCoeffs = s_bq_lpf_r.mCoeffs; s_bq_lpf_out_l.mCoeffs = s_bq_lpf_r.mCoeffs; s_bq_lpf_out2_l.mCoeffs = s_bq_lpf_r.mCoeffs; #if SUBTIMBRE s_bqs_lpf_l.mCoeffs = s_bq_lpf_r.mCoeffs; s_bqs_lpf_out_l.mCoeffs = s_bq_lpf_r.mCoeffs; s_bqs_lpf_out2_l.mCoeffs = s_bq_lpf_r.mCoeffs; #endif } void MODFX_INIT(uint32_t platform, uint32_t api) { s_bq_lpf_r.flush(); s_bq_lpf_out_r.flush(); s_bq_lpf_out2_r.flush(); s_bq_lpf_l.flush(); s_bq_lpf_out_l.flush(); s_bq_lpf_out2_l.flush(); s_bq_hpf_r.flush(); s_bq_hpf_l.flush(); #if SUBTIMBRE s_bqs_lpf_r.flush(); s_bqs_lpf_out_r.flush(); s_bqs_lpf_out2_r.flush(); s_bqs_lpf_l.flush(); s_bqs_lpf_out_l.flush(); s_bqs_lpf_out2_l.flush(); s_bqs_hpf_r.flush(); s_bqs_hpf_l.flush(); #endif init_lpf(LPF_FC, LPF_Q); float wc = s_bq_hpf_r.mCoeffs.wc(HPF_FC, s_fs_recip); s_bq_hpf_r.mCoeffs.setSOHP(fx_tanpif(wc), 0.5); s_bq_hpf_l.mCoeffs = s_bq_hpf_r.mCoeffs; #if SUBTIMBRE s_bqs_hpf_r.mCoeffs = s_bq_hpf_r.mCoeffs; s_bqs_hpf_l.mCoeffs = s_bq_hpf_r.mCoeffs; #endif } __fast_inline float g711(const float s) { q15_t val = f32_to_q15(s); int16_t sign = (val < 0) ? -1 : 1; val = q15abs(val); uint16_t mask = 1 << 14; int i; for(i = 0; i < 6; i++) { if (val & mask) break; else val <<=1; } val &= 0x7c00; val >>= i; val = val * sign; return q15_to_f32(val); } void MODFX_PROCESS(const float *main_xn, float *main_yn, const float *sub_xn, float *sub_yn, uint32_t frames) { const float * mx = main_xn; float * __restrict my = main_yn; const float * my_e = my + 2*frames; const float * sx = sub_xn; float * __restrict sy = sub_yn; float vmx; float vsx; for (; my != my_e; ) { // Left channel vmx = s_bq_hpf_l.process_so(s_bq_lpf_l.process_so(*mx)); #if SUBTIMBRE vsx = s_bqs_hpf_l.process_so(s_bqs_lpf_l.process_so(*sx)); #endif if (count == 0) { lastmy_l = g711(vmx); #if SUBTIMBRE lastsy_l = g711(vsx); #endif } *my++ = dry * (*mx++) + wet * \ s_bq_lpf_out2_l.process_so(s_bq_lpf_out_l.process_so(lastmy_l)); #if SUBTIMBRE *sy++ = dry * (*sx++) + wet * \ s_bq_lpf_out2_l.process_so(s_bqs_lpf_out_l.process_so(lastsy_l)); #endif // Right channel vmx = s_bq_hpf_r.process_so(s_bq_lpf_r.process_so(*mx)); #if SUBTIMBRE vsx = s_bqs_hpf_r.process_so(s_bqs_lpf_r.process_so(*sx)); #endif if (count == 0) { lastmy_r = g711(vmx); #if SUBTIMBRE lastsy_r = g711(vsx); #endif } *my++ = dry * (*mx++) + wet * \ s_bq_lpf_out2_r.process_so(s_bq_lpf_out_r.process_so(lastmy_r)); #if SUBTIMBRE *sy++ = dry * (*sx++) + wet * \ s_bq_lpf_out2_r.process_so(s_bqs_lpf_out_r.process_so(lastsy_r)); #endif count = (count + 1) % 6; } } void MODFX_PARAM(uint8_t index, int32_t value) { const float valf = q31_to_f32(value); switch (index) { case k_user_modfx_param_time: init_lpf(LPF_FC, LPF_Q + 1.6 * valf); break; case k_user_modfx_param_depth: wet = valf; dry = 1.0 - wet; break; default: break; } }
24.207071
75
0.666388
5f5a5fbfa7cbb3aced2ba754aa5d9ce4ac21bef0
2,564
cxx
C++
main/sw/source/core/docnode/retrieveinputstreamconsumer.cxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
[ "Apache-2.0" ]
679
2015-01-06T06:34:58.000Z
2022-03-30T01:06:03.000Z
main/sw/source/core/docnode/retrieveinputstreamconsumer.cxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
[ "Apache-2.0" ]
102
2017-11-07T08:51:31.000Z
2022-03-17T12:13:49.000Z
main/sw/source/core/docnode/retrieveinputstreamconsumer.cxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
[ "Apache-2.0" ]
331
2015-01-06T11:40:55.000Z
2022-03-14T04:07:51.000Z
/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ #include "precompiled_sw.hxx" #include <retrieveinputstreamconsumer.hxx> #include <ndgrf.hxx> #include <retrieveinputstream.hxx> #include <swthreadmanager.hxx> /** class to provide creation of a thread to retrieve an input stream given by an URL and to consume the retrieved input stream. OD 2007-01-29 #i73788# @author OD */ SwAsyncRetrieveInputStreamThreadConsumer::SwAsyncRetrieveInputStreamThreadConsumer( SwGrfNode& rGrfNode ) : mrGrfNode( rGrfNode ), mnThreadID( 0 ) { } SwAsyncRetrieveInputStreamThreadConsumer::~SwAsyncRetrieveInputStreamThreadConsumer() { SwThreadManager::GetThreadManager().RemoveThread( mnThreadID ); } void SwAsyncRetrieveInputStreamThreadConsumer::CreateThread( const String& rURL ) { // Get new data container for input stream data SwRetrievedInputStreamDataManager::tDataKey nDataKey = SwRetrievedInputStreamDataManager::GetManager().ReserveData( mrGrfNode.GetThreadConsumer() ); rtl::Reference< ObservableThread > pNewThread = SwAsyncRetrieveInputStreamThread::createThread( nDataKey, rURL ); // Add thread to thread manager and pass ownership of thread to thread manager. mnThreadID = SwThreadManager::GetThreadManager().AddThread( pNewThread ); } void SwAsyncRetrieveInputStreamThreadConsumer::ApplyInputStream( com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream, const sal_Bool bIsStreamReadOnly ) { mrGrfNode.ApplyInputStream( xInputStream, bIsStreamReadOnly ); }
37.15942
85
0.692668
5f5eb07b5c05bac6798a9ad1e9b96ccb07a1ece8
1,390
cpp
C++
TouchGFX/generated/fonts/src/Table_Asap_Bold_12_4bpp.cpp
koson/car-dash
7be8f02a243d43b4fd9fd33b0a160faa5901f747
[ "MIT" ]
null
null
null
TouchGFX/generated/fonts/src/Table_Asap_Bold_12_4bpp.cpp
koson/car-dash
7be8f02a243d43b4fd9fd33b0a160faa5901f747
[ "MIT" ]
null
null
null
TouchGFX/generated/fonts/src/Table_Asap_Bold_12_4bpp.cpp
koson/car-dash
7be8f02a243d43b4fd9fd33b0a160faa5901f747
[ "MIT" ]
null
null
null
// Autogenerated, do not edit #include <fonts/GeneratedFont.hpp> FONT_TABLE_LOCATION_FLASH_PRAGMA KEEP extern const touchgfx::GlyphNode glyphs_Asap_Bold_12_4bpp[] FONT_TABLE_LOCATION_FLASH_ATTRIBUTE = { { 0, 0x0031, 6, 9, 9, 0, 6, 0, 0, 0x00 }, { 27, 0x0032, 6, 9, 9, 0, 6, 0, 0, 0x00 }, { 54, 0x0033, 6, 9, 9, 0, 6, 0, 0, 0x00 }, { 81, 0x0034, 7, 9, 9, 0, 6, 0, 0, 0x00 }, { 117, 0x0035, 6, 9, 9, 0, 6, 0, 0, 0x00 }, { 144, 0x0036, 6, 9, 9, 0, 6, 0, 0, 0x00 }, { 171, 0x0037, 6, 9, 9, 0, 6, 0, 0, 0x00 }, { 198, 0x0038, 7, 9, 9, 0, 6, 0, 0, 0x00 }, { 234, 0x003F, 6, 9, 9, 0, 5, 0, 0, 0x00 } }; // Asap_Bold_12_4bpp extern const touchgfx::GlyphNode glyphs_Asap_Bold_12_4bpp[]; extern const uint8_t unicodes_Asap_Bold_12_4bpp_0[]; extern const uint8_t* const unicodes_Asap_Bold_12_4bpp[] = { unicodes_Asap_Bold_12_4bpp_0 }; extern const touchgfx::KerningNode kerning_Asap_Bold_12_4bpp[]; touchgfx::GeneratedFont& getFont_Asap_Bold_12_4bpp(); touchgfx::GeneratedFont& getFont_Asap_Bold_12_4bpp() { static touchgfx::GeneratedFont Asap_Bold_12_4bpp(glyphs_Asap_Bold_12_4bpp, 9, 12, 0, 4, 1, 0, 1, unicodes_Asap_Bold_12_4bpp, kerning_Asap_Bold_12_4bpp, 63, 0, 0); return Asap_Bold_12_4bpp; }
39.714286
166
0.605036
5f63f37831fc89994b6c70e806053b00a494acc9
191
cpp
C++
willis_game_framework/WGF/InputListener.cpp
mrwonko/ancient
fcee7c5f55ad5cdf16fe2dc4560cd34785b7bb01
[ "MIT" ]
null
null
null
willis_game_framework/WGF/InputListener.cpp
mrwonko/ancient
fcee7c5f55ad5cdf16fe2dc4560cd34785b7bb01
[ "MIT" ]
null
null
null
willis_game_framework/WGF/InputListener.cpp
mrwonko/ancient
fcee7c5f55ad5cdf16fe2dc4560cd34785b7bb01
[ "MIT" ]
null
null
null
#include "InputListener.h" namespace WGF { InputListener::InputListener() { //ctor } InputListener::~InputListener() { //dtor } } // namespace WGF
11.235294
35
0.549738
5f68e65393a05b2daa346d882f09e8eb4c063733
287
cpp
C++
LibreOJ/loj10230.cpp
wzl19371/OI-LIfe
f7f54542d1369b5e4047fcbb2e26c1c64d22ee26
[ "MIT" ]
1
2020-10-05T02:07:52.000Z
2020-10-05T02:07:52.000Z
LibreOJ/loj10230.cpp
wzl19371/OI-LIfe
f7f54542d1369b5e4047fcbb2e26c1c64d22ee26
[ "MIT" ]
null
null
null
LibreOJ/loj10230.cpp
wzl19371/OI-LIfe
f7f54542d1369b5e4047fcbb2e26c1c64d22ee26
[ "MIT" ]
null
null
null
#include <cstdio> using namespace std; typedef long long ll; const int p=5000011; const int maxn=1e5+10; int n,k; ll f[maxn]; int main(){ scanf("%d%d",&n,&k); for(int i=0;i<=k;i++) f[i]=(i+1)%p; for(int i=k+1;i<=n;i++) f[i]=(f[i-1]+f[i-k-1])%p; printf("%lld\n",f[n]); }
20.5
51
0.550523
5f68f140cbe176c4d78210070f227d661d99bfe4
7,405
cc
C++
third_party/perfetto/src/ftrace_reader/ftrace_procfs.cc
zipated/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
third_party/perfetto/src/ftrace_reader/ftrace_procfs.cc
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
third_party/perfetto/src/ftrace_reader/ftrace_procfs.cc
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "src/ftrace_reader/ftrace_procfs.h" #include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <fstream> #include <sstream> #include <string> #include "perfetto/base/file_utils.h" #include "perfetto/base/logging.h" #include "perfetto/base/utils.h" namespace perfetto { // Reading /trace produces human readable trace output. // Writing to this file clears all trace buffers for all CPUS. // Writing to /trace_marker file injects an event into the trace buffer. // Reading /tracing_on returns 1/0 if tracing is enabled/disabled. // Writing 1/0 to this file enables/disables tracing. // Disabling tracing with this file prevents further writes but // does not clear the buffer. namespace { void KernelLogWrite(const char* s) { PERFETTO_DCHECK(*s && s[strlen(s) - 1] == '\n'); if (FtraceProcfs::g_kmesg_fd != -1) base::ignore_result(write(FtraceProcfs::g_kmesg_fd, s, strlen(s))); } } // namespace // static int FtraceProcfs::g_kmesg_fd = -1; // Set by ProbesMain() in probes.cc . // static std::unique_ptr<FtraceProcfs> FtraceProcfs::Create(const std::string& root) { if (!CheckRootPath(root)) { return nullptr; } return std::unique_ptr<FtraceProcfs>(new FtraceProcfs(root)); } FtraceProcfs::FtraceProcfs(const std::string& root) : root_(root) {} FtraceProcfs::~FtraceProcfs() = default; bool FtraceProcfs::EnableEvent(const std::string& group, const std::string& name) { std::string path = root_ + "events/" + group + "/" + name + "/enable"; return WriteToFile(path, "1"); } bool FtraceProcfs::DisableEvent(const std::string& group, const std::string& name) { std::string path = root_ + "events/" + group + "/" + name + "/enable"; return WriteToFile(path, "0"); } bool FtraceProcfs::DisableAllEvents() { std::string path = root_ + "events/enable"; return WriteToFile(path, "0"); } std::string FtraceProcfs::ReadEventFormat(const std::string& group, const std::string& name) const { std::string path = root_ + "events/" + group + "/" + name + "/format"; return ReadFileIntoString(path); } std::string FtraceProcfs::ReadPageHeaderFormat() const { std::string path = root_ + "events/header_page"; return ReadFileIntoString(path); } std::string FtraceProcfs::ReadCpuStats(size_t cpu) const { std::string path = root_ + "per_cpu/cpu" + std::to_string(cpu) + "/stats"; return ReadFileIntoString(path); } size_t FtraceProcfs::NumberOfCpus() const { static size_t num_cpus = static_cast<size_t>(sysconf(_SC_NPROCESSORS_CONF)); return num_cpus; } void FtraceProcfs::ClearTrace() { std::string path = root_ + "trace"; PERFETTO_CHECK(ClearFile(path)); // Could not clear. } bool FtraceProcfs::WriteTraceMarker(const std::string& str) { std::string path = root_ + "trace_marker"; return WriteToFile(path, str); } bool FtraceProcfs::SetCpuBufferSizeInPages(size_t pages) { if (pages * base::kPageSize > 1 * 1024 * 1024 * 1024) { PERFETTO_ELOG("Tried to set the per CPU buffer size to more than 1gb."); return false; } std::string path = root_ + "buffer_size_kb"; return WriteNumberToFile(path, pages * (base::kPageSize / 1024ul)); } bool FtraceProcfs::EnableTracing() { KernelLogWrite("perfetto: enabled ftrace\n"); std::string path = root_ + "tracing_on"; return WriteToFile(path, "1"); } bool FtraceProcfs::DisableTracing() { KernelLogWrite("perfetto: disabled ftrace\n"); std::string path = root_ + "tracing_on"; return WriteToFile(path, "0"); } bool FtraceProcfs::SetTracingOn(bool enable) { return enable ? EnableTracing() : DisableTracing(); } bool FtraceProcfs::IsTracingEnabled() { std::string path = root_ + "tracing_on"; return ReadOneCharFromFile(path) == '1'; } bool FtraceProcfs::SetClock(const std::string& clock_name) { std::string path = root_ + "trace_clock"; return WriteToFile(path, clock_name); } std::string FtraceProcfs::GetClock() { std::string path = root_ + "trace_clock"; std::string s = ReadFileIntoString(path); size_t start = s.find('['); if (start == std::string::npos) return ""; size_t end = s.find(']', start); if (end == std::string::npos) return ""; return s.substr(start + 1, end - start - 1); } std::set<std::string> FtraceProcfs::AvailableClocks() { std::string path = root_ + "trace_clock"; std::string s = ReadFileIntoString(path); std::set<std::string> names; size_t start = 0; size_t end = 0; while (true) { end = s.find(' ', start); if (end == std::string::npos) end = s.size(); if (start == end) break; std::string name = s.substr(start, end - start); if (name[0] == '[') name = name.substr(1, name.size() - 2); names.insert(name); if (end == s.size()) break; start = end + 1; } return names; } bool FtraceProcfs::WriteNumberToFile(const std::string& path, size_t value) { // 2^65 requires 20 digits to write. char buf[21]; int res = snprintf(buf, 21, "%zu", value); if (res < 0 || res >= 21) return false; return WriteToFile(path, std::string(buf)); } bool FtraceProcfs::WriteToFile(const std::string& path, const std::string& str) { base::ScopedFile fd = base::OpenFile(path, O_WRONLY); if (!fd) return false; ssize_t written = PERFETTO_EINTR(write(fd.get(), str.c_str(), str.length())); ssize_t length = static_cast<ssize_t>(str.length()); // This should either fail or write fully. PERFETTO_CHECK(written == length || written == -1); return written == length; } base::ScopedFile FtraceProcfs::OpenPipeForCpu(size_t cpu) { std::string path = root_ + "per_cpu/cpu" + std::to_string(cpu) + "/trace_pipe_raw"; return base::OpenFile(path, O_RDONLY | O_NONBLOCK); } char FtraceProcfs::ReadOneCharFromFile(const std::string& path) { base::ScopedFile fd = base::OpenFile(path, O_RDONLY); PERFETTO_CHECK(fd); char result = '\0'; ssize_t bytes = PERFETTO_EINTR(read(fd.get(), &result, 1)); PERFETTO_CHECK(bytes == 1 || bytes == -1); return result; } bool FtraceProcfs::ClearFile(const std::string& path) { base::ScopedFile fd = base::OpenFile(path, O_WRONLY | O_TRUNC); return !!fd; } std::string FtraceProcfs::ReadFileIntoString(const std::string& path) const { // You can't seek or stat the procfs files on Android. // The vast majority (884/886) of format files are under 4k. std::string str; str.reserve(4096); if (!base::ReadFile(path, &str)) return ""; return str; } // static bool FtraceProcfs::CheckRootPath(const std::string& root) { base::ScopedFile fd = base::OpenFile(root + "trace", O_RDONLY); return static_cast<bool>(fd); } } // namespace perfetto
29.039216
79
0.674139
5f6cbdca6a051b4956ce42dd94703eb78799ff86
1,465
cpp
C++
Libs/Common/Region.cpp
ajensen1234/ShapeWorks
fb308c8c38ad0e00c7f62aa7221e00e72140d909
[ "MIT" ]
40
2019-07-26T18:02:13.000Z
2022-03-28T07:24:23.000Z
Libs/Common/Region.cpp
ajensen1234/ShapeWorks
fb308c8c38ad0e00c7f62aa7221e00e72140d909
[ "MIT" ]
1,359
2019-06-20T17:17:53.000Z
2022-03-31T05:42:29.000Z
Libs/Common/Region.cpp
ajensen1234/ShapeWorks
fb308c8c38ad0e00c7f62aa7221e00e72140d909
[ "MIT" ]
13
2019-12-06T01:31:48.000Z
2022-02-24T04:34:23.000Z
#include "Region.h" namespace shapeworks { IndexRegion& IndexRegion::pad(int padding) { for (auto i = 0; i < 3; i++) { min[i] -= padding; max[i] += padding; } return *this; } std::ostream &operator<<(std::ostream &os, const IndexRegion &r) { return os << "{\n\tmin: [" << r.min[0] << ", " << r.min[1] << ", " << r.min[2] << "]" << ",\n\tmax: [" << r.max[0] << ", " << r.max[1] << ", " << r.max[2] << "]\n}"; } PhysicalRegion& PhysicalRegion::shrink(const PhysicalRegion &other) { for (auto i = 0; i < 3; i++) { min[i] = std::max(min[i], other.min[i]); max[i] = std::min(max[i], other.max[i]); } return *this; } PhysicalRegion& PhysicalRegion::expand(const PhysicalRegion &other) { for (auto i = 0; i < 3; i++) { min[i] = std::min(min[i], other.min[i]); max[i] = std::max(max[i], other.max[i]); } return *this; } PhysicalRegion& PhysicalRegion::expand(const Point &pt) { for (auto i=0; i<3; i++) { min[i] = std::min(min[i], pt[i]); max[i] = std::max(max[i], pt[i]); } return *this; } std::ostream &operator<<(std::ostream &os, const PhysicalRegion &r) { return os << "{\n\tmin: [" << r.min[0] << ", " << r.min[1] << ", " << r.min[2] << "]" << ",\n\tmax: [" << r.max[0] << ", " << r.max[1] << ", " << r.max[2] << "]\n}"; } PhysicalRegion& PhysicalRegion::pad(double padding) { min -= Point({padding, padding, padding}); max += Point({padding, padding, padding}); return *this; } }
20.347222
91
0.527645
5f6d12b7ee7528691a2fa8ea09a2c9ab14dac0cd
5,815
cc
C++
parsers/gumbo_url_filter_test.cc
google/plusfish
a56ac07ca132613ecda7f252a69312ada66bbbca
[ "Apache-2.0" ]
14
2020-10-16T18:33:37.000Z
2022-03-27T18:29:00.000Z
parsers/gumbo_url_filter_test.cc
qause/plusfish
a56ac07ca132613ecda7f252a69312ada66bbbca
[ "Apache-2.0" ]
2
2021-03-18T11:19:59.000Z
2021-04-26T12:27:33.000Z
parsers/gumbo_url_filter_test.cc
qause/plusfish
a56ac07ca132613ecda7f252a69312ada66bbbca
[ "Apache-2.0" ]
5
2021-06-29T10:51:04.000Z
2022-01-09T05:18:16.000Z
// Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "parsers/gumbo_url_filter.h" #include <memory> #include <gtest/gtest.h> #include "gtest/gtest.h" #include "absl/container/node_hash_set.h" #include <gumbo.h> #include "parsers/gumbo_filter.h" #include "parsers/gumbo_parser.h" #include "proto/issue_details.pb.h" namespace plusfish { class GumboUrlFilterTest : public ::testing::Test { protected: GumboUrlFilterTest() {} void SetUp() override { url_filter_.reset(new GumboUrlFilter(&anchors_, &issues_)); filters_.emplace_back(url_filter_.get()); gumbo_.reset(new GumboParser()); } void ParseAndFilter(const std::string& content_to_parse) { gumbo_->Parse(content_to_parse); gumbo_->FilterDocument(filters_); } std::vector<std::string> anchors_; absl::node_hash_set<std::unique_ptr<IssueDetails>> issues_; std::vector<GumboFilter*> filters_; std::unique_ptr<GumboParser> gumbo_; std::unique_ptr<GumboUrlFilter> url_filter_; }; TEST_F(GumboUrlFilterTest, ParseUrlFromKnownAttribute) { ParseAndFilter("<a href='hello'>hello</a>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("hello", anchors_[0].c_str()); EXPECT_STREQ("hello", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseUrlFromRandomAttribute) { ParseAndFilter("<a foo='//hello'>hello</a>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("//hello", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseContentFromRandomAttributeIgnored) { ParseAndFilter("<a foo='hello'>hello</a>"); ASSERT_EQ(0, anchors_.size()); } TEST_F(GumboUrlFilterTest, ParseSkipDuplicateUrls) { ParseAndFilter("<a href='hello'></a><a href='hello'></a>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("hello", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseUrlFromTextElement) { std::string basic_url("http://example.com"); ParseAndFilter("<b>" + basic_url + "</b>"); ASSERT_EQ(1, anchors_.size()); EXPECT_EQ(basic_url, anchors_[0]); } TEST_F(GumboUrlFilterTest, ParseMultipleUrlsFromTextElements) { std::string basic_url("http://example.com"); std::string url_without_scheme("//example.com/aa"); std::string url_with_params("https://example.com/foo?a=a"); // The three URLs are spread over two text elements. ParseAndFilter("<b>" + basic_url + "</b>" + url_without_scheme + " foobar " + url_with_params); ASSERT_EQ(3, anchors_.size()); ASSERT_EQ(1, std::count(anchors_.begin(), anchors_.end(), basic_url)); ASSERT_EQ(1, std::count(anchors_.begin(), anchors_.end(), url_without_scheme)); ASSERT_EQ(1, std::count(anchors_.begin(), anchors_.end(), url_with_params)); } TEST_F(GumboUrlFilterTest, ParseFromJavascriptUrl) { ParseAndFilter("<a href=\"javascript:location = '/here';\"></a>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("/here", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseFromVbscriptUrl) { ParseAndFilter("<a href=\"vbscript:location.href = '/here';\"></a>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("/here", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseFromJavascriptMixedCaseUrl) { ParseAndFilter("<a href=\"jaVascript:location = '/again';\"></a>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("/again", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseUrlEmptyJavascriptUrl) { ParseAndFilter("<a href=\"javascript:\"></a>"); ASSERT_EQ(0, anchors_.size()); } TEST_F(GumboUrlFilterTest, ParseUrlFromMetaTag) { std::string url("http://meta"); ParseAndFilter("<meta http-equiv=\"refresh\" content=\"5; url=" + url + "\"/>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("http://meta", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseUrlFromMetaTagIgnoresCase) { std::string url("http://meta"); ParseAndFilter("<meta http-equiv=\"refresh\" content=\"5; uRl=" + url + "\"/>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("http://meta", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseQuotedUrlFromMetaTag) { std::string url("http://meta"); ParseAndFilter("<meta http-equiv=\"refresh\" content=\"5; url='" + url + "'\"/>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("http://meta", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseUrlFromMetaTagWithOneQuote) { std::string url("http://meta"); ParseAndFilter("<meta http-equiv=\"refresh\" content=\"5; url='" + url + "\"/>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("http://meta", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseUrlFromMetaWithoutContent) { ParseAndFilter("<meta http-equiv=\"\"/>"); ASSERT_EQ(0, anchors_.size()); } TEST_F(GumboUrlFilterTest, ParsedGumboUrlIsUnescaped) { ParseAndFilter("<a href='hello&amp;'>hello</a>"); ASSERT_EQ(1, anchors_.size()); EXPECT_STREQ("hello&", anchors_[0].c_str()); } TEST_F(GumboUrlFilterTest, ParseUrlOnclick) { ParseAndFilter("<p onclick=\"location.href='/url';\">"); ASSERT_EQ(1, anchors_.size()); } TEST_F(GumboUrlFilterTest, ParseUrlOnclickFindsXss) { ParseAndFilter( "<p onclick=\"var customerName='';plus123fish;'; " "alert('Welcome Mr. ' + customerName);\">"); ASSERT_EQ(1, issues_.size()); } } // namespace plusfish
32.853107
79
0.693895
5f71afccb2722ea46e95da751a1150f0d225eec0
1,870
hpp
C++
Sources/etwprof/OS/Stream/OStreamManipulators.hpp
Donpedro13/etwprof
a9db371ef556d564529c5112c231157d3789292b
[ "MIT" ]
38
2018-06-11T19:09:16.000Z
2022-03-17T04:15:15.000Z
Sources/etwprof/OS/Stream/OStreamManipulators.hpp
killvxk/etwprof
37ca044b5dd6be39dbd77ba7653395aa95768692
[ "MIT" ]
12
2018-06-12T20:24:05.000Z
2021-07-31T18:28:48.000Z
Sources/etwprof/OS/Stream/OStreamManipulators.hpp
killvxk/etwprof
37ca044b5dd6be39dbd77ba7653395aa95768692
[ "MIT" ]
5
2019-02-23T04:11:03.000Z
2022-03-17T04:15:18.000Z
#ifndef ETWP_OSTREAM_MANIPULATORS_HPP #define ETWP_OSTREAM_MANIPULATORS_HPP namespace ETWP { class ConsoleOStream; using OStreamManipulator = void (*)(ConsoleOStream*); void Endl (ConsoleOStream* stream); void ColorReset (ConsoleOStream* stream); void FgColorReset (ConsoleOStream* stream); void FgColorBlack (ConsoleOStream* stream); void FgColorBlue (ConsoleOStream* stream); void FgColorDarkBlue (ConsoleOStream* stream); void FgColorCyan (ConsoleOStream* stream); void FgColorDarkCyan (ConsoleOStream* stream); void FgColorGray (ConsoleOStream* stream); void FgColorDarkGray (ConsoleOStream* stream); void FgColorGreen (ConsoleOStream* stream); void FgColorDarkGreen (ConsoleOStream* stream); void FgColorMagenta (ConsoleOStream* stream); void FgColorDarkMagenta (ConsoleOStream* stream); void FgColorRed (ConsoleOStream* stream); void FgColorDarkRed (ConsoleOStream* stream); void FgColorWhite (ConsoleOStream* stream); void FgColorYellow (ConsoleOStream* stream); void FgColorDarkYellow (ConsoleOStream* stream); void BgColorReset (ConsoleOStream* stream); void BgColorBlack (ConsoleOStream* stream); void BgColorBlue (ConsoleOStream* stream); void BgColorDarkBlue (ConsoleOStream* stream); void BgColorCyan (ConsoleOStream* stream); void BgColorDarkCyan (ConsoleOStream* stream); void BgColorGray (ConsoleOStream* stream); void BgColorDarkGray (ConsoleOStream* stream); void BgColorGreen (ConsoleOStream* stream); void BgColorDarkGreen (ConsoleOStream* stream); void BgColorMagenta (ConsoleOStream* stream); void BgColorDarkMagenta (ConsoleOStream* stream); void BgColorRed (ConsoleOStream* stream); void BgColorDarkRed (ConsoleOStream* stream); void BgColorWhite (ConsoleOStream* stream); void BgColorYellow (ConsoleOStream* stream); void BgColorDarkYellow (ConsoleOStream* stream); } // namespace ETWP #endif // #ifndef ETWP_OSTREAM_MANIPULATORS_HPP
35.961538
53
0.818182
5f769c53c564d2e8ab345db842a6e9f09e0a9cf4
115
cpp
C++
docs/mfc/reference/codesnippet/CPP/application-information-and-management_1.cpp
bobbrow/cpp-docs
769b186399141c4ea93400863a7d8463987bf667
[ "CC-BY-4.0", "MIT" ]
965
2017-06-25T23:57:11.000Z
2022-03-31T14:17:32.000Z
docs/mfc/reference/codesnippet/CPP/application-information-and-management_1.cpp
bobbrow/cpp-docs
769b186399141c4ea93400863a7d8463987bf667
[ "CC-BY-4.0", "MIT" ]
3,272
2017-06-24T00:26:34.000Z
2022-03-31T22:14:07.000Z
docs/mfc/reference/codesnippet/CPP/application-information-and-management_1.cpp
bobbrow/cpp-docs
769b186399141c4ea93400863a7d8463987bf667
[ "CC-BY-4.0", "MIT" ]
951
2017-06-25T12:36:14.000Z
2022-03-26T22:49:06.000Z
// Print the application's executable filename. TRACE(_T("Executable filename = %s\n"), AfxGetApp()->m_pszExeName);
57.5
67
0.747826
5f77a8ba5661c148146681589a80917d88931e12
4,833
cpp
C++
utils/swc_to_nlxml.cpp
Twinklebear/nlxml
2044a89c8b0b1d69c7762dc48406770f4b7c9834
[ "MIT" ]
null
null
null
utils/swc_to_nlxml.cpp
Twinklebear/nlxml
2044a89c8b0b1d69c7762dc48406770f4b7c9834
[ "MIT" ]
1
2019-03-18T00:37:08.000Z
2019-03-18T21:45:35.000Z
utils/swc_to_nlxml.cpp
Twinklebear/nlxml
2044a89c8b0b1d69c7762dc48406770f4b7c9834
[ "MIT" ]
null
null
null
#include <iostream> #include <set> #include <map> #include <iterator> #include <vector> #include <sstream> #include <fstream> #include <algorithm> #include <vector> #include <algorithm> #include <glm/glm.hpp> #include <glm/ext.hpp> #include "nlxml.h" using namespace nlxml; /* Read the SWC file (http://research.mssm.edu/cnic/swc.html) recursively * down the branches to import it as NLXML * File format is a bunch of lines in ASCII with numbers specifying: * * n T x y z R P * * n is an integer label that identifies the current point * and increments by one from one line to the next. * * T is an integer representing the type of neuronal segment, * such as soma, axon, apical dendrite, etc. The standard accepted * integer values are given below. * * 0 = undefined * 1 = soma * 2 = axon * 3 = dendrite * 4 = apical dendrite * 5 = fork point * 6 = end point * 7 = custom * * x, y, z gives the cartesian coordinates of each node. * * R is the radius at that node. * * P indicates the parent (the integer label) of the current point * or -1 to indicate an origin (soma). */ struct SWCPoint { int id = 0; int type = 0; float x = 0; float y = 0; float z = 0; float radius = 0; int parent_id = 0; int children = 0; }; std::ostream& operator<<(std::ostream &os, const SWCPoint &p) { os << "(" << p.id << ", " << p.type << ", [" << p.x << ", " << p.y << ", " << p.z << "], " << p.radius << ", " << p.parent_id << ", {" << p.children << "})"; return os; } bool operator<(const SWCPoint &a, const SWCPoint &b) { return a.id < b.id; } SWCPoint read_point(const std::string &l) { std::istringstream iss(l); std::vector<std::string> vals{std::istream_iterator<std::string>(iss), std::istream_iterator<std::string>()}; SWCPoint p; p.id = std::stoi(vals[0]); p.type = std::stoi(vals[1]); p.x = std::stof(vals[2]); p.y = std::stof(vals[3]); p.z = std::stof(vals[4]); p.radius = std::stof(vals[5]); p.parent_id = std::stoi(vals[6]); return p; } // Points in the map are indexed by their parent ID, with a set of // all points who are parented by that point using SWCMap = std::map<int, std::set<SWCPoint>>; template<typename T> void convert_swc_branch(T &branch, const SWCPoint parent, const std::set<SWCPoint> &children, const SWCMap &swcpoints) { if (children.size() > 1) { for (auto branches = children.cbegin(); branches != children.cend(); ++branches) { Branch b; b.leaf = "Normal"; SWCPoint bstart = *branches; b.points.push_back(Point(bstart.x, bstart.y, bstart.z, bstart.radius)); auto bpoints = swcpoints.find(bstart.id); if (bpoints != swcpoints.end()) { convert_swc_branch(b, bstart, bpoints->second, swcpoints); } branch.branches.push_back(b); } } else if (children.size() == 1) { SWCPoint child = *children.cbegin(); branch.points.push_back(Point(child.x, child.y, child.z, child.radius)); auto child_children = swcpoints.find(child.id); if (child_children != swcpoints.end() && !child_children->second.empty()) { convert_swc_branch(branch, child, child_children->second, swcpoints); } } } NeuronData convert_swc(const SWCMap &swcpoints) { NeuronData data; auto treeiter = swcpoints.find(-1); if (treeiter == swcpoints.end()) { std::cout << "No trees in file!?\n"; return data; } auto trees = treeiter->second; for (auto it = trees.begin(); it != trees.end(); ++it) { const SWCPoint p = *it; Tree t; t.color = Color(1, 1, 1); switch (p.type) { case 1: t.type = "Soma"; break; case 2: t.type = "Axon"; break; case 3: t.type = "Dendrite"; break; case 4: t.type = "Apical Dendrite"; break; case 7: t.type = "Custom"; break; default: t.type = "Undefined"; } t.leaf = "Normal"; t.points.push_back(Point(p.x, p.y, p.z, p.radius)); auto children = swcpoints.find(p.id); if (children != swcpoints.end()) { convert_swc_branch(t, p, children->second, swcpoints); } data.trees.push_back(t); } return data; } SWCMap import_swc(const std::string &fname) { std::ifstream fin(fname.c_str()); SWCMap points; std::string line; while (std::getline(fin, line)) { if (line.empty() || line[0] == '#') { continue; } SWCPoint p = read_point(line); points[p.parent_id].insert(p); } return points; } int main(int argc, char **argv) { std::string input, output; for (int i = 1; i < argc; ++i) { if (std::strcmp(argv[i], "-o") == 0) { output = argv[++i]; } else { input = argv[i]; } } if (input.empty() || output.empty()) { std::cout << "Error: an input and output file are needed.\n" << "Usage: ./" << argv[0] << " <input> -o <output>\n"; return 1; } std::cout << "Exporting SWC file as NLXML to " << output << "\n"; auto swcpoints = import_swc(input); auto data = convert_swc(swcpoints); export_file(data, output); return 0; }
25.303665
84
0.634802
5f7a9c797738783fd2ab6b6edf2c15f5c2023d2b
588
hpp
C++
src/moistureMeasurement.hpp
umiko/MoistureMeter
89b617e57bf5934ccd4d0fdfa2eda12c4385edf1
[ "MIT" ]
null
null
null
src/moistureMeasurement.hpp
umiko/MoistureMeter
89b617e57bf5934ccd4d0fdfa2eda12c4385edf1
[ "MIT" ]
null
null
null
src/moistureMeasurement.hpp
umiko/MoistureMeter
89b617e57bf5934ccd4d0fdfa2eda12c4385edf1
[ "MIT" ]
null
null
null
//AUTHOR: //umiko(https://github.com/umiko) //Permission to copy and modify is granted under the MIT license // //DESCRIPTION: //A struct to save the last measurement taken, so it can be supplied at a later time again #ifndef MOISTUREMEASUREMENT_CPP #define MOISTUREMEASUREMENT_CPP #include <Arduino.h> class moistureMeasurement { private: public: static int m_measurement_count; int m_rawValue{0}; int m_baseline{0}; moistureMeasurement(); moistureMeasurement(int rawValue, int baseline); ~moistureMeasurement(); float getMoistureInPercentage(); void print(); }; #endif
23.52
90
0.765306
5f7e054f3218e19556c3b55237df7d837d96e2e5
29,442
cpp
C++
src/main.cpp
greggubben/headControl
e280cd04fdd5bd5be5e88fa380cba2efcad2e54f
[ "MIT" ]
null
null
null
src/main.cpp
greggubben/headControl
e280cd04fdd5bd5be5e88fa380cba2efcad2e54f
[ "MIT" ]
null
null
null
src/main.cpp
greggubben/headControl
e280cd04fdd5bd5be5e88fa380cba2efcad2e54f
[ "MIT" ]
null
null
null
#include <Arduino.h> // On Air Display control // Light up the On Air sign using a strip of 10 WS2812s // Button controls if sign is on or off // Webpage also available to control sign #include <SPIFFS.h> #include <WiFi.h> #include <WiFiManager.h> // For managing the Wifi Connection #include <ESPmDNS.h> // For running OTA and Web Server #include <WiFiUdp.h> // For running OTA #include <ArduinoOTA.h> // For running OTA #include <ESPAsyncWebServer.h> // For running Web Server #include <ArduinoJson.h> // For running Web Services #include <Wire.h> // For Servos #include <SPI.h> // For display #include <Adafruit_GFX.h> // For display #include <Adafruit_ILI9341.h> // For display #include <XPT2046_Touchscreen.h> // For display #include <Adafruit_PWMServoDriver.h> // For Servos #include "settings.h" // Secret values using namespace std; //for using LED as a startup status indicator #include <Ticker.h> Ticker ticker; boolean ledState = LOW; // Used for blinking LEDs when WifiManager in Connecting and Configuring // On board LED used to show status #ifndef LED_BUILTIN #define LED_BUILTIN 13 // ESP32 DOES NOT DEFINE LED_BUILTIN #endif const int ledPin = LED_BUILTIN; // the number of the LED pin // // TFT definitions // //#define TFT_CS D0 //for D1 mini or TFT I2C Connector Shield (V1.1.0 or later) //#define TFT_DC D8 //for D1 mini or TFT I2C Connector Shield (V1.1.0 or later) //#define TFT_RST -1 //for D1 mini or TFT I2C Connector Shield (V1.1.0 or later) //#define TS_CS D3 //for D1 mini or TFT I2C Connector Shield (V1.1.0 or later) //#define TFT_LED D2 //for D1 mini to adjust brightness #define TFT_CS 14 //for D32 Pro #define TFT_DC 27 //for D32 Pro #define TFT_RST 33 //for D32 Pro #define TFT_LED 32 //for D32 Pro #define TS_CS 12 //for D32 Pro // Visual part of the Display Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST); // Screen Display positions of interest #define BACKGROUND_COLOR ILI9341_BLACK #define DIVIDER_HEIGHT 3 #define DIVIDER_COLOR ILI9341_CYAN #define SETUP_FONT_SIZE 1 #define SETUP_FONT_COLOR ILI9341_WHITE #define SERVO_STATUS_FONT_SIZE 2 #define SERVO_STATUS_FONT_COLOR ILI9341_GREENYELLOW #define SERVO_STATUS_DISABLED_FONT_COLOR ILI9341_LIGHTGREY #define SERVO_STATUS_OUTRANGE_FONT_COLOR ILI9341_RED #define SERVO_HEADER_FONT_COLOR ILI9341_GREEN #define FACE_STATUS_FONT_COLOR ILI9341_CYAN #define OTA_STATUS_FONT_SIZE 3 #define OTA_STATUS_FONT_COLOR ILI9341_PINK #define OTA_ERROR_FONT_COLOR ILI9341_RED // Time to wait to dim or turn off screen #define SCREEN_OFF_DELAY 600000 // 10 minutes #define SCREEN_BRIGHTNESS_FULL 255 #define SCREEN_BRIGHTNESS_OFF 0 uint16_t screenHeight = 0; uint16_t screenWidth = 0; uint16_t statusTopLeftX = 0; uint16_t statusTopLeftY = 0; uint16_t statusHeight = 0; // variables used for returning face to a resting state int16_t restStatusX = 0; int16_t restStatusY = 0; uint16_t restStatusHeight = 0; unsigned long restSeconds = 0; // variables used for handling the websocket int16_t faceWebSocketStatusX = 0; int16_t faceWebSocketStatusY = 0; uint16_t faceWebSocketStatusHeight = 0; // variables used for handling the ota progress int16_t otaProgressStatusX = 0; int16_t otaProgressStatusY = 0; uint16_t otaProgressStatusHeight = 0; // variables used for showing screen only during activity unsigned long lastActivity = 0; // Timestamp of when the last activity happened in millis bool screenOn = true; bool drawScreen = false; // // Touchscreen definitions // // Touch response part of the display XPT2046_Touchscreen ts(TS_CS); // // PWM definitions // // called this way, it uses the default address 0x40 #define I2C_SDA 21 // For D32 Pro #define I2C_SCL 22 // For D32 Pro Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(); // Depending on your servo make, the pulse width min and max may vary, you // want these to be as small/large as possible without hitting the hard stop // for max range. You'll have to tweak them as necessary to match the servos you // have! //#define SERVOMIN 0 // This is the 'minimum' pulse length count (out of 4096) //#define SERVOMAX 4095 // This is the 'maximum' pulse length count (out of 4096) #define SERVOMIN 150 // This is the 'minimum' pulse length count (out of 4096) #define SERVOMAX 600 // This is the 'maximum' pulse length count (out of 4096) #define SERVO_FREQ 50 // Analog servos run at ~60 Hz updates // // Web Server definitions // AsyncWebServer webServer(80); // // Web Socket definitions // AsyncWebSocket faceWebSocketServer("/facews"); void notifyFaceClients(); // // Head definitions // typedef struct headServo { // Definition for Servo being used by the head uint8_t servoNum; // Position number of the servo attached to the PWM bool enabled; // Indicated if this servo should be set String name; // Name for the servo uint8_t limitMinAngle; // This is the minimum angle allowed for this servo uint8_t limitMaxAngle; // This is the maximum angle allowed for this servo uint8_t angle; // Expected current angle of the servo String direction; // Direction the servos move UD, DU, LR, RL } headServo; // The widest range for all the servos is 30 to 150 headServo left_eyebrow = {0, true, "LEFT EYE BROW", 58, 102, 80, "DU"}; headServo right_eyebrow = {1, true, "RIGHT EYE BROW", 64, 114, 89, "UD"}; headServo left_eye_updown = {2, true, "LEFT EYE U/D ", 70, 100, 85, "UD"}; headServo left_eye_leftright = {3, true, "LEFT EYE SIDE", 50, 90, 63, "LR"}; headServo right_eye_updown = {4, true, "RIGHT EYE U/D ", 73, 123, 98, "UD"}; headServo right_eye_leftright = {5, true, "RIGHT EYE SIDE", 59, 94, 76, "LR"}; headServo mouth = {6, true, "MOUTH OPEN", 66, 88, 67, "DU"}; headServo neck_updown = {7, false, "NECK NOD ", 67, 77, 70, "UD"}; headServo neck_leftright = {8, false, "NECK TURN", 30, 100, 65, "LR"}; headServo *headServos[] = {&left_eyebrow, &right_eyebrow, &left_eye_updown, &left_eye_leftright, &right_eye_updown, &right_eye_leftright, &mouth, &neck_updown, &neck_leftright}; int headServosLen = sizeof(headServos) / sizeof(headServos[0]); // // Face Definitions // typedef struct face { // Definition for Face to set head servos String name; // Name for the face uint8_t angles[9]; // Angles for all 9 servos in the order of headServos[] } face; // List of Face definitions face relaxed = {"Relaxed", { 80, 89, 85, 63, 98, 76, 67, 70, 65}}; face frown = {"Frown", { 60, 112, 85, 63, 98, 76, 67, 70, 65}}; face spock = {"Spock", { 80, 112, 85, 63, 98, 76, 67, 70, 65}}; face smile = {"Smile", { 75, 96, 96, 63, 106, 76, 78, 70, 65}}; face sad = {"Sad", { 93, 73, 75, 67, 89, 78, 67, 70, 65}}; face cross = {"Cross", { 66, 104, 78, 82, 88, 70, 67, 70, 65}}; face *faces[] = {&relaxed, &frown, &spock, &smile, &sad, &cross}; int facesLen = sizeof(faces) / sizeof(faces[0]); const int defaultFace = 0; // Default face to return to - start with Relaxed int selectedFaceNum = defaultFace; // Start with the Default face const unsigned long showFaceDurationMillis = 2*60000; // How long to show a face before returning to default resting face bool atRest = true; // Is the head at it's default resting face? unsigned long lastFaceChangeMillis = 0; // Last time the face changed /************************************************* * Callback Utilities during setup *************************************************/ /* * Blink the LED Strip. * If on then turn off * If off then turn on */ void tick() { //toggle state digitalWrite(ledPin, !digitalRead(ledPin)); // set pin to the opposite state } /* * gets called when WiFiManager enters configuration mode */ void configModeCallback (WiFiManager *myWiFiManager) { //Serial.println("Entered config mode"); //Serial.println(WiFi.softAPIP()); //if you used auto generated SSID, print it //Serial.println(myWiFiManager->getConfigPortalSSID()); //entered config mode, make led toggle faster ticker.attach(0.2, tick); } /************************************************* * TFT Functions *************************************************/ /* * Initialize the TFT for text */ void clearTftScreen(uint8_t fontSize, uint16_t fontColor) { tft.fillScreen(BACKGROUND_COLOR); // origin = left,top landscape (USB left upper) tft.setRotation(1); tft.setTextSize(fontSize); tft.setTextColor(fontColor); tft.setCursor(0,0); } /* * Turn the screen on */ void turnScreenOn() { digitalWrite(TFT_LED, SCREEN_BRIGHTNESS_FULL); screenOn = true; } /* * Turn the screen off */ void turnScreenOff() { digitalWrite(TFT_LED, SCREEN_BRIGHTNESS_OFF); clearTftScreen(SERVO_STATUS_FONT_SIZE, SERVO_HEADER_FONT_COLOR); screenOn = false; } /* * Only draw the Rest countdown status * Must be called after drawStatus has been called at least once * so variables are set up properly. */ void drawRestStatus() { tft.setCursor(restStatusX, restStatusY); if (atRest) { tft.fillRect(restStatusX, restStatusY, screenWidth - restStatusX, restStatusHeight, BACKGROUND_COLOR); tft.print("Resting"); } else { unsigned long timeElapsed = millis() - lastFaceChangeMillis; unsigned long timeLeftMillis = showFaceDurationMillis - timeElapsed; unsigned long timeLeftSeconds = timeLeftMillis/1000; if (restSeconds != timeLeftSeconds) { tft.fillRect(restStatusX, restStatusY, screenWidth - restStatusX, restStatusHeight, BACKGROUND_COLOR); tft.print(timeLeftSeconds); tft.print(" sec"); restSeconds = timeLeftSeconds; } } } /* * Only draw the number of Face Web Socket Clients * Must be called after drawStatus has been called at least once * so variables are set up properly. */ void drawFaceWebSocketStatus() { tft.setCursor(faceWebSocketStatusX, faceWebSocketStatusY); size_t faceClients = faceWebSocketServer.count(); tft.fillRect(faceWebSocketStatusX, faceWebSocketStatusY, screenWidth - faceWebSocketStatusX, faceWebSocketStatusHeight, BACKGROUND_COLOR); tft.print(faceClients); } /* * Draw the full screen status */ void drawStatus() { clearTftScreen(SERVO_STATUS_FONT_SIZE, SERVO_HEADER_FONT_COLOR); int16_t textX; int16_t textY; uint16_t textWidth; uint16_t textHeight; tft.printf("%2s %16s %5s\n", "#", "NAME", "Angle"); int16_t cursorX = tft.getCursorX(); int16_t cursorY = tft.getCursorY(); //tft.setTextColor(SERVO_HEADER_FONT_COLOR); tft.getTextBounds(" ", cursorX, cursorY, &textX, &textY, &textWidth, &textHeight); cursorY+=2; int16_t length = textWidth*2; tft.drawLine(cursorX, cursorY, cursorX+length, cursorY, SERVO_HEADER_FONT_COLOR); cursorX += length; cursorX += textWidth; length = textWidth*16; tft.drawLine(cursorX, cursorY, cursorX+length, cursorY, SERVO_HEADER_FONT_COLOR); cursorX += length; cursorX += textWidth; length = textWidth*5; tft.drawLine(cursorX, cursorY, cursorX+length, cursorY, SERVO_HEADER_FONT_COLOR); cursorY+=3; tft.setCursor(0, cursorY); for (headServo *hs : headServos) { //uint16_t currPwm = pwm.getPWM(hs->servoNum); if (hs->angle < hs->limitMinAngle || hs->limitMaxAngle < hs->angle) { tft.setTextColor(SERVO_STATUS_OUTRANGE_FONT_COLOR); } else if (hs->enabled) { tft.setTextColor(SERVO_STATUS_FONT_COLOR); } else { tft.setTextColor(SERVO_STATUS_DISABLED_FONT_COLOR); } tft.printf("%2d %16s %5d\n", hs->servoNum, hs->name.c_str(), hs->angle); //tft.ptintln(); } cursorY = tft.getCursorY(); cursorY -= (textHeight/2); tft.setCursor(0, cursorY); tft.setTextColor(FACE_STATUS_FONT_COLOR); tft.println(); face *selectedFace = faces[selectedFaceNum]; tft.printf("Face: %2d - %s\n", selectedFaceNum, selectedFace->name.c_str()); tft.print("Clients: "); faceWebSocketStatusX = tft.getCursorX(); faceWebSocketStatusY = tft.getCursorY(); faceWebSocketStatusHeight = textHeight; tft.println(); tft.print("Rest in: "); restStatusX = tft.getCursorX(); restStatusY = tft.getCursorY(); restStatusHeight = textHeight; //tft.println(); // Dynamic status values can only be updated after the boilerplate is drawn drawFaceWebSocketStatus(); drawRestStatus(); } // // Display OTA status // void showOtaStart(String type) { turnScreenOn(); clearTftScreen(OTA_STATUS_FONT_SIZE, OTA_STATUS_FONT_COLOR); int16_t textX; int16_t textY; uint16_t textWidth; uint16_t textHeight; tft.getTextBounds(" ", 0, 0, &textX, &textY, &textWidth, &textHeight); tft.print("OTA in Progess\n"); tft.printf("Type: %s\n", type.c_str()); tft.print("Progress: "); otaProgressStatusX = tft.getCursorX(); otaProgressStatusY = tft.getCursorY(); otaProgressStatusHeight = textHeight; tft.println(); } // // Display the progress of the OTA download // void showOtaProgress (unsigned int progress, unsigned int total) { int16_t cursorX = tft.getCursorX(); int16_t cursorY = tft.getCursorY(); tft.setCursor(otaProgressStatusX, otaProgressStatusY); unsigned int percentProgress = (progress / (total / 100)); tft.fillRect(otaProgressStatusX, otaProgressStatusY, screenWidth - otaProgressStatusX, otaProgressStatusHeight, BACKGROUND_COLOR); tft.print(percentProgress); tft.print("%"); tft.setCursor(cursorX, cursorY); } // // Display OTA Error // void showOtaError(ota_error_t error,String errorMessage) { tft.setTextColor(OTA_ERROR_FONT_COLOR); tft.printf("Error: %s", errorMessage.c_str()); } // // Display the OTA has ended // void showOtaEnd() { tft.println("END"); } /************************************************* * Servo Functions *************************************************/ void setAngle (headServo *hs, int angle, bool limit = true) { if (angle < 0) angle = 0; if (angle > 180) angle = 180; if (limit && angle < hs->limitMinAngle) angle = hs->limitMinAngle; if (limit && angle > hs->limitMaxAngle) angle = hs->limitMaxAngle; if (hs->enabled) { uint16_t pulse = map(angle, 0, 180, SERVOMIN, SERVOMAX); pwm.setPWM(hs->servoNum, 0, pulse); hs->angle = angle; } drawScreen = true; //tft.printf("%2d: %3d - %4d", hs->servoNum, angle, pulse); } void servoRangeTest() { uint8_t minRange = 255; // starting minimum range value across all servos uint8_t maxRange = 0; // starting maximum range value across all servos uint16_t curX = 0; uint16_t curY = 0; // Find the min and max of the limits for (headServo *hs : headServos) { if (hs->limitMaxAngle > maxRange) maxRange = hs->limitMaxAngle; if (hs->limitMinAngle < minRange) minRange = hs->limitMinAngle; } tft.printf("minRange: %d\nmaxRange: %d\n", minRange, maxRange); if (minRange < maxRange) { int interval = (maxRange - minRange) / 20; // Move all servos through the range from min to max tft.println("min to max"); curX = tft.getCursorX(); curY = tft.getCursorY(); for (int angle = minRange; angle < maxRange; angle += interval) { for (headServo *hs : headServos) { if (hs->limitMinAngle < angle && angle < hs->limitMaxAngle) { tft.fillRect(curX, curY, screenWidth, 8, ILI9341_BLUE); setAngle(hs, angle); tft.setCursor(curX, curY); delay(500); } } delay(1000); } tft.println(); delay(250); // Move all servos through the range from max to min tft.println("max to min"); curX = tft.getCursorX(); curY = tft.getCursorY(); for (int angle = maxRange; angle > minRange; angle -= interval) { for (headServo *hs : headServos) { if (hs->limitMinAngle < angle && angle < hs->limitMaxAngle) { tft.fillRect(curX, curY, screenWidth, 8, ILI9341_BLUE); setAngle(hs, angle); tft.setCursor(curX, curY); } } delay(25); } tft.println(); delay(250); } } void middleServos() { // Find the min and max of the limits for (headServo *hs : headServos) { uint8_t middle = ((hs->limitMaxAngle - hs->limitMinAngle)/2) + hs->limitMinAngle; setAngle(hs, middle); } } // // Send the current status of the Servos // void sendServos(AsyncWebServerRequest *request) { DynamicJsonDocument jsonDoc(2048); JsonObject jsonRoot = jsonDoc.to<JsonObject>(); JsonArray jsonServoArray = jsonRoot.createNestedArray("servos"); for (int s=0; s<headServosLen; s++) { JsonObject jsonServoStatus = jsonServoArray.createNestedObject(); jsonServoStatus["servoNum"] = headServos[s]->servoNum; jsonServoStatus["name"] = headServos[s]->name; jsonServoStatus["angle"] = headServos[s]->angle; jsonServoStatus["minAngle"] = headServos[s]->limitMinAngle; jsonServoStatus["maxAngle"] = headServos[s]->limitMaxAngle; jsonServoStatus["direction"] = headServos[s]->direction; jsonServoStatus["enabled"] = headServos[s]->enabled; } String payload; serializeJson(jsonDoc, payload); request->send(200, "application/json", payload); } /************************************************* * Face Functions *************************************************/ // // Set servos to a new face // void _setFace (face *newFace) { for (headServo *hs : headServos) { setAngle(hs, newFace->angles[hs->servoNum]); } atRest = false; lastFaceChangeMillis = millis(); notifyFaceClients(); } void setFace (int faceNum) { if (0 <= faceNum && faceNum < facesLen) { selectedFaceNum = faceNum; face *newFace = faces[selectedFaceNum]; _setFace(newFace); } } void setDefaultFace() { setFace(defaultFace); atRest = true; // This is the At Rest face } // // Build JSON object of Face data // void buildFaceJson(DynamicJsonDocument *jsonDoc) { JsonObject jsonRoot = jsonDoc->to<JsonObject>(); JsonArray jsonFaceArray = jsonRoot.createNestedArray("faces"); for (int f=0; f<facesLen; f++) { JsonObject jsonFaceStatus = jsonFaceArray.createNestedObject(); jsonFaceStatus["faceNum"] = f; jsonFaceStatus["name"] = faces[f]->name; jsonFaceStatus["selected"] = (f == selectedFaceNum); } } /************************************************* * Web Server Routines *************************************************/ // // Send the list of Faces // void sendFaces(AsyncWebServerRequest *request) { DynamicJsonDocument jsonDoc(2048); buildFaceJson(&jsonDoc); String payload; serializeJson(jsonDoc, payload); request->send(200, "application/json", payload); } void handleFace (AsyncWebServerRequest *request) { uint8_t faceNum = 0; switch (request->method()) { case HTTP_PUT: if (request->hasArg("faceNum")) { faceNum = request->arg("faceNum").toInt(); if (0 <= faceNum && faceNum < facesLen) { setFace(faceNum); sendFaces(request); } else { request->send(400, "text/plain", "Argument 'faceNum' out of range."); } } else { request->send(400, "text/plain", "Argument 'faceNum' missing."); } break; case HTTP_GET: sendFaces(request); break; default: request->send(405, "text/plain", "Method Not Allowed"); break; } drawScreen = true; } // // Handle service for Servos // void handleServos (AsyncWebServerRequest *request) { uint8_t servoNum = 0; uint8_t angle = 0; bool limit = true; switch (request->method()) { case HTTP_PUT: if (request->hasArg("servoNum") && request->hasArg("angle")) { servoNum = request->arg("servoNum").toInt(); angle = request->arg("angle").toInt(); if (request->hasArg("override")) limit = false; if (0 <= servoNum && servoNum < headServosLen) { headServo *hs = headServos[servoNum]; setAngle(hs, angle, limit); } else { request->send(400, "text/plain", "Argument 'servoNum' out of range."); } } else if (request->hasArg("middle")) { middleServos(); } else if (request->hasArg("default")) { setDefaultFace(); } else { request->send(400, "text/plain", "Argument 'servoNum' or 'angle' is missing."); } sendServos(request); break; case HTTP_GET: sendServos(request); break; default: request->send(405, "text/plain", "Method Not Allowed"); break; } drawScreen = true; } // // Display a Not Found page // void handleNotFound(AsyncWebServerRequest *request) { String message = "File Not Found\n\n"; message += "URI: "; message += request->url(); message += "\nMethod: "; message += request->methodToString(); message += "\nArguments: "; message += request->args(); message += "\n"; for (uint8_t i = 0; i < request->args(); i++) { message += " " + request->argName(i) + ": " + request->arg(i) + "\n"; } request->send(404, "text/plain", message); } /************************************************* * Web Socket Routines *************************************************/ // // Send the list of Faces // void notifyFaceClients() { DynamicJsonDocument jsonDoc(2048); buildFaceJson(&jsonDoc); String payload; serializeJson(jsonDoc, payload); faceWebSocketServer.textAll(payload); } // // Handle events raised on Web Socket // void onFaceWebSocketEvent (AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len) { switch (type) { case WS_EVT_CONNECT: //Serial.printf("WebSocket client #%u connected from %s\n", client->id(), client->remoteIP().toString().c_str()); drawFaceWebSocketStatus(); break; case WS_EVT_DISCONNECT: //Serial.printf("WebSocket client #%u disconnected\n", client->id()); drawFaceWebSocketStatus(); break; case WS_EVT_DATA: //handleWebSocketMessage(arg, data, len); break; case WS_EVT_PONG: case WS_EVT_ERROR: break; } } /************************************************* * Setup *************************************************/ void setup() { Serial.begin(115200); Serial.println(ESP.getSdkVersion()); // start ticker to slow blink LED during Setup ticker.attach(0.6, tick); // set the digital pin as output: pinMode(ledPin, OUTPUT); pinMode(TFT_LED, OUTPUT); turnScreenOn(); // // Start the screen so startup status can be displayed // tft.begin(); clearTftScreen(SETUP_FONT_SIZE, SETUP_FONT_COLOR); screenWidth = tft.width(); screenHeight = tft.height(); tft.println(ESP.getSdkVersion()); tft.println(); // // Start Touch Screen // tft.print("Touch Screen ... "); if (!ts.begin()) { tft.println("Error Starting"); } else { tft.println("Started"); } ts.setRotation(0); // // Start SPIFFS // tft.print("SPIFFS ... "); if (!SPIFFS.begin()) { tft.println("Error Starting"); } else { tft.println("Started"); } // // Set up the Wifi Connection // tft.print("WiFi ... "); WiFi.hostname(devicename); WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP WiFiManager wm; // wm.resetSettings(); // reset settings - for testing wm.setAPCallback(configModeCallback); //set callback that gets called when connecting to previous WiFi fails, and enters Access Point mode //if it does not connect it starts an access point with the specified name here "AutoConnectAP" if (!wm.autoConnect(devicename,devicepassword)) { //Serial.println("failed to connect and hit timeout"); //reset and try again, or maybe put it to deep sleep ESP.restart(); delay(1000); } //Serial.println("connected"); tft.println("Connected"); tft.print("IP: "); tft.println(WiFi.localIP()); tft.print("Hostname: "); tft.println(WiFi.getHostname()); tft.println(); // // Set up the Multicast DNS // tft.print("mDNS "); MDNS.begin(devicename); MDNS.addService(devicename, "tcp", 80); tft.println("Started"); // // Set up OTA // tft.print("OTA "); // ArduinoOTA.setPort(8266); ArduinoOTA.setHostname(devicename); ArduinoOTA.setPassword(devicepassword); ArduinoOTA.onStart([]() { String type; if (ArduinoOTA.getCommand() == U_FLASH) { type = "sketch"; } else { // U_FS type = "filesystem"; } showOtaStart(type); // NOTE: if updating FS this would be the place to unmount FS using FS.end() //Serial.println("Start updating " + type); }); ArduinoOTA.onEnd([]() { showOtaEnd(); //Serial.println("\nEnd"); }); ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { showOtaProgress(progress, total); //Serial.printf("Progress: %u%%\r", (progress / (total / 100))); }); ArduinoOTA.onError([](ota_error_t error) { String errorMessage = String(error); //Serial.printf("Error[%u]: ", error); if (error == OTA_AUTH_ERROR) { errorMessage = "Auth Failed"; //Serial.println("Auth Failed"); } else if (error == OTA_BEGIN_ERROR) { errorMessage = "Begin Failed"; //Serial.println("Begin Failed"); } else if (error == OTA_CONNECT_ERROR) { errorMessage = "Connect Failed"; //Serial.println("Connect Failed"); } else if (error == OTA_RECEIVE_ERROR) { errorMessage = "Receive Failed"; //Serial.println("Receive Failed"); } else if (error == OTA_END_ERROR) { errorMessage = "End Failed"; //Serial.println("End Failed"); } showOtaError(error, errorMessage); }); ArduinoOTA.begin(); tft.println("Started"); // // Set up the PWM board // tft.print("PWM "); pwm.begin(); /* * In theory the internal oscillator (clock) is 25MHz but it really isn't * that precise. You can 'calibrate' this by tweaking this number until * you get the PWM update frequency you're expecting! * The int.osc. for the PCA9685 chip is a range between about 23-27MHz and * is used for calculating things like writeMicroseconds() * Analog servos run at ~50 Hz updates, It is importaint to use an * oscilloscope in setting the int.osc frequency for the I2C PCA9685 chip. * 1) Attach the oscilloscope to one of the PWM signal pins and ground on * the I2C PCA9685 chip you are setting the value for. * 2) Adjust setOscillatorFrequency() until the PWM update frequency is the * expected value (50Hz for most ESCs) * Setting the value here is specific to each individual I2C PCA9685 chip and * affects the calculations for the PWM update frequency. * Failure to correctly set the int.osc value will cause unexpected PWM results */ //pwm.setOscillatorFrequency(25000000); pwm.setPWMFreq(SERVO_FREQ); // Analog servos run at ~50 Hz updates setDefaultFace(); delay(500); tft.println("Started"); // // Setup WebServer // tft.print("Web Server ... "); // Main page to select a Face to show on the Head webServer.on("/", HTTP_GET, [] (AsyncWebServerRequest *request) { drawScreen = true; request->send(SPIFFS, "/mainpage.html", "text/html"); }); // Web Service to display selected face on the head // and return face state webServer.on("/face", handleFace); // Test page to move the servos independently webServer.on("/test", HTTP_GET, [] (AsyncWebServerRequest *request) { drawScreen = true; request->send(SPIFFS, "/testpage.html", "text/html"); }); // Web Service to set a single servo to a specific angle // and return state of all servos webServer.on("/servos", handleServos); webServer.onNotFound(handleNotFound); webServer.begin(); tft.println("Started"); // // Setup WebSocket // tft.print("Web Socket ... "); faceWebSocketServer.onEvent(onFaceWebSocketEvent); webServer.addHandler(&faceWebSocketServer); tft.println("Started"); // // Done with Setup // delay(2000); tft.println(); ticker.detach(); // Stop blinking the LED digitalWrite(ledPin, false); // turn off led tft.println("Setup Complete!"); tft.println(); // Indicate the screen now needs to be drawn drawScreen = true; } /************************************************* * Loop *************************************************/ void loop() { // Handle any requests ArduinoOTA.handle(); faceWebSocketServer.cleanupClients(); //server.handleClient(); // Not needed with AsyncWebServer //MDNS.update(); // Not needed on ESP32 bool isTouched = ts.touched(); if (isTouched) { drawScreen = true; } // Is it time to turn off the screen? if ((screenOn) && ((millis() - lastActivity) > SCREEN_OFF_DELAY)) { turnScreenOff(); } // See if it ia time to rest if (!atRest) { if((millis() - lastFaceChangeMillis) > showFaceDurationMillis) { setDefaultFace(); } else { drawRestStatus(); } } // Does the screen need to be redrawn if (drawScreen) { turnScreenOn(); drawStatus(); lastActivity = millis(); drawScreen = false; } // slow down the loop a little since most activity is covered by event processing delay(50); }
29.860041
177
0.649786
5f81a2abcc92a1c85e45e4f6f0eef014ce0282ea
141
hh
C++
host/device-reference.hh
free-audio/clap-host
4602d26b91a526ac80933bdc9f6fcafdf2423bbf
[ "MIT" ]
24
2021-12-01T13:36:25.000Z
2022-03-17T10:12:29.000Z
host/device-reference.hh
free-audio/clap-host
4602d26b91a526ac80933bdc9f6fcafdf2423bbf
[ "MIT" ]
9
2021-11-02T14:39:54.000Z
2022-03-19T11:04:54.000Z
host/device-reference.hh
free-audio/clap-host
4602d26b91a526ac80933bdc9f6fcafdf2423bbf
[ "MIT" ]
4
2021-11-02T09:01:50.000Z
2022-02-04T20:00:35.000Z
#pragma once #include <QString> struct DeviceReference { QString _api = "(none)"; QString _name = "(noname)"; int _index = 0; };
14.1
30
0.624113
5f81c6c8c4ea9f912d51ed641b32741f6feecb1c
2,784
hpp
C++
accumulate.hpp
dean985/itertools
842715b5fe7db5c74f65da642aa06ae365bb68c2
[ "MIT" ]
null
null
null
accumulate.hpp
dean985/itertools
842715b5fe7db5c74f65da642aa06ae365bb68c2
[ "MIT" ]
2
2020-06-18T11:35:37.000Z
2020-06-18T11:35:45.000Z
accumulate.hpp
dean985/itertools
842715b5fe7db5c74f65da642aa06ae365bb68c2
[ "MIT" ]
null
null
null
#pragma once #include <iostream> namespace itertools { typedef struct { template <typename T> T operator()(T a, T b) { return a + b; } } add; template <typename Container,typename Ftor = add> class accumulate { Ftor _fnctor = [](int x, int y){return x*y;}; Container _container; public: accumulate(Container cont, Ftor func) : _fnctor(func), _container(cont) {} accumulate(Container cont):_fnctor(add()), _container(cont) { } class iterator { typename Container::iterator _iter; typename Container::iterator _current; typename Container::iterator _end; Ftor ftor; typename std::decay<decltype(*_iter)>::type sum; public: explicit iterator(typename Container::iterator iter, typename Container::iterator end, Ftor functor) : _iter(iter), _end(end), _current(_iter), ftor(functor) { if(_iter != _end) sum = *iter; } iterator(iterator &copy) = default; iterator &operator=(const iterator &it) { this->_iter = it->_iter; this->_end = it->_end; this->ftor = it->ftor; return *this; } iterator &operator++() { std::not_equal_to neq; ++_current; if((neq(_current, _end)) ) { sum = ftor(sum, (*_current)); } return (*this); } iterator operator++(int a) { iterator temp(*this); operator++(); return temp; } bool operator==(const iterator &it) { return (it._iter == this->_current) ; } bool operator!=(const iterator &it) { // std::cout<<"in !="<<std::endl; return it._iter != this->_current; } decltype(*_iter) operator*()//// I need to make it template {// i need to put here somthing that will return return sum; } }; iterator begin() { return iterator(_container.begin(), _container.end(), _fnctor); } iterator end() { return iterator(_container.end(), _container.end(), _fnctor); } }; } // namespace itertools
27.029126
91
0.431753
5f83b93ffc743d1c6cb8c993a3e37548387c905c
5,903
cpp
C++
source/octree/linear-octree.cpp
triplu-zero/monte-carlo-ray-tracer
8b36d5154204fc67e13376ad15b8bac33065c2d1
[ "MIT" ]
149
2020-03-06T00:39:43.000Z
2022-03-31T07:28:36.000Z
source/octree/linear-octree.cpp
triplu-zero/monte-carlo-ray-tracer
8b36d5154204fc67e13376ad15b8bac33065c2d1
[ "MIT" ]
4
2020-07-27T15:33:09.000Z
2022-02-24T11:34:40.000Z
source/octree/linear-octree.cpp
triplu-zero/monte-carlo-ray-tracer
8b36d5154204fc67e13376ad15b8bac33065c2d1
[ "MIT" ]
17
2020-03-23T16:05:36.000Z
2022-02-21T02:38:31.000Z
#include "linear-octree.hpp" #include <glm/gtx/norm.hpp> #include "../common/constexpr-math.hpp" #include "../common/util.hpp" template <class Data> LinearOctree<Data>::LinearOctree(Octree<Data> &octree_root) { size_t octree_size = 0, data_size = 0; octreeSize(octree_root, octree_size, data_size); if (octree_size == 0 || data_size == 0) return; uint32_t df_idx = root_idx; uint64_t data_idx = 0; compact(&octree_root, df_idx, data_idx, true); } template <class Data> std::vector<SearchResult<Data>> LinearOctree<Data>::knnSearch(const glm::dvec3& p, size_t k, double radius_est) const { std::vector<SearchResult<Data>> result; if (linear_tree.empty()) return result; if (k > ordered_data.size()) k = ordered_data.size(); result.reserve(k); double min_distance2 = -1.0; double max_distance2 = pow2(radius_est); double distance2 = linear_tree[root_idx].BB.distance2(p); auto to_visit = reservedPriorityQueue<KNNode>(64); KNNode current(root_idx, distance2); while (true) { if (current.octant != null_idx) { if (linear_tree[current.octant].leaf) { uint64_t end_idx = linear_tree[current.octant].start_data + linear_tree[current.octant].num_data; for (uint64_t i = linear_tree[current.octant].start_data; i < end_idx; i++) { double distance2 = glm::distance2(ordered_data[i].pos(), p); if (distance2 <= max_distance2 && distance2 > min_distance2) { to_visit.emplace(distance2, i); } } } else { uint32_t child_octant = current.octant + 1; while (child_octant != null_idx) { const auto& node = linear_tree[child_octant]; distance2 = node.BB.distance2(p); if (distance2 <= max_distance2 && node.BB.max_distance2(p) > min_distance2) { to_visit.emplace(child_octant, distance2); } child_octant = node.next_sibling; } } } else { result.emplace_back(ordered_data[current.data], current.distance2); if (result.size() == k) return result; } if (to_visit.empty()) { // Maximum search sphere doesn't contain k points. Increase radius and // traverse octree again, ignoring the already found closest points. max_distance2 *= 2.0; if (!result.empty()) min_distance2 = result.back().distance2; current = KNNode(root_idx, linear_tree[root_idx].BB.distance2(p)); } else { current = to_visit.top(); to_visit.pop(); } } } template <class Data> std::vector<SearchResult<Data>> LinearOctree<Data>::radiusSearch(const glm::dvec3& p, double radius) const { std::vector<SearchResult<Data>> result; if (linear_tree.empty()) return result; recursiveRadiusSearch(root_idx, p, pow2(radius), result); return result; } template <class Data> void LinearOctree<Data>::recursiveRadiusSearch(const uint32_t current, const glm::dvec3& p, double radius2, std::vector<SearchResult<Data>>& result) const { if (linear_tree[current].leaf) { uint64_t end_idx = linear_tree[current].start_data + linear_tree[current].num_data; for (uint64_t i = linear_tree[current].start_data; i < end_idx; i++) { double distance2 = glm::distance2(ordered_data[i].pos(), p); if (distance2 <= radius2) { result.emplace_back(ordered_data[i], distance2); } } } else { uint32_t child_octant = current + 1; while (child_octant != null_idx) { if (linear_tree[child_octant].BB.distance2(p) <= radius2) { recursiveRadiusSearch(child_octant, p, radius2, result); } child_octant = linear_tree[child_octant].next_sibling; } } } template <class Data> void LinearOctree<Data>::octreeSize(const Octree<Data> &octree_root, size_t &size, size_t &data_size) const { if (octree_root.leaf() && octree_root.data_vec.empty()) return; size++; data_size += octree_root.data_vec.size(); if (!octree_root.leaf()) { for (const auto &octant : octree_root.octants) { octreeSize(*octant, size, data_size); } } } template <class Data> BoundingBox LinearOctree<Data>::compact(Octree<Data> *node, uint32_t &df_idx, uint64_t &data_idx, bool last) { uint32_t idx = df_idx++; linear_tree.emplace_back(); linear_tree[idx].leaf = (uint8_t)node->leaf(); linear_tree[idx].start_data = data_idx; linear_tree[idx].num_data = (uint16_t)node->data_vec.size(); BoundingBox BB; for (auto&& data : node->data_vec) BB.merge(data.pos()); ordered_data.insert(ordered_data.end(), node->data_vec.begin(), node->data_vec.end()); data_idx += node->data_vec.size(); node->data_vec.clear(); node->data_vec.shrink_to_fit(); if (!node->leaf()) { std::vector<size_t> use; for (size_t i = 0; i < node->octants.size(); i++) { if (!(node->octants[i]->leaf() && node->octants[i]->data_vec.empty())) { use.push_back(i); } } for (const auto &i : use) { BB.merge(compact(node->octants[i].get(), df_idx, data_idx, i == use.back())); } } node->octants.clear(); node->octants.shrink_to_fit(); linear_tree[idx].next_sibling = last ? null_idx : df_idx; linear_tree[idx].BB = BB; return BB; }
31.566845
154
0.580891
5f84f5c1e5e2bacec64ab1c2ad6891b75f2c5ec7
3,397
cpp
C++
source/LinearizedImplicitEuler.cpp
sergeneren/BubbleH
e018e5a008e101221a4f8a3bbb25e7ec03fc9662
[ "BSD-3-Clause-Clear" ]
52
2019-10-06T17:25:39.000Z
2022-01-20T23:01:13.000Z
source/LinearizedImplicitEuler.cpp
sergeneren/BubbleH
e018e5a008e101221a4f8a3bbb25e7ec03fc9662
[ "BSD-3-Clause-Clear" ]
1
2019-10-08T18:44:41.000Z
2019-10-09T07:48:31.000Z
source/LinearizedImplicitEuler.cpp
sergeneren/BubbleH
e018e5a008e101221a4f8a3bbb25e7ec03fc9662
[ "BSD-3-Clause-Clear" ]
10
2019-10-07T16:33:24.000Z
2020-10-21T01:09:47.000Z
#include "LinearizedImplicitEuler.h" #include "VS3D.h" // TODO: Save space by creating dx, dv, rhs, A only once. LinearizedImplicitEuler::LinearizedImplicitEuler() : SceneStepper() {} LinearizedImplicitEuler::~LinearizedImplicitEuler() {} bool LinearizedImplicitEuler::stepScene( VS3D& scene, scalar dt ) { const int ndof = scene.constrainedPositions().size() * 3; const VecXd& x = Eigen::Map<VecXd>((double*) &scene.constrainedPositions()[0], ndof); const VecXd& v = Eigen::Map<VecXd>((double*) &scene.constrainedVelocities()[0], ndof); const VecXd& m = Eigen::Map<VecXd>((double*) &scene.constrainedMass()[0], ndof); assert(x.size() == v.size()); assert( ndof % 3 == 0 ); int nprts = scene.constrainedPositions().size(); assert( 3 * nprts == ndof ); // We specify the current iterate as a change from last timestep's solution // Linearizing about the previous timestep's solution implies dx = dt*v0 VectorXs dx = dt*v; // Linearizing about the previous timestep's solution implies dv = 0 VectorXs dv = VectorXs::Zero(ndof); scene.preCompute(dx, dv, dt); // RHS of linear system is force. rhs == f SparseXs A(ndof,ndof); TripletXs tri_A; SparseXs Av(ndof, ndof); TripletXs tri_Av; SparseXs M(ndof, ndof); TripletXs mm; SparseXs C(ndof, ndof); TripletXs cc; for(int i = 0; i < ndof; ++i) { if(scene.constrainedFixed()[i / 3]) { mm.push_back(Triplets(i, i, 1.0)); } else { mm.push_back(Triplets(i, i, m(i))); cc.push_back(Triplets(i, i, 1.0)); } } M.setFromTriplets(mm.begin(), mm.end()); C.setFromTriplets(cc.begin(), cc.end()); tri_A.clear(); scene.accumulateddUdxdx(tri_A); tri_Av.clear(); scene.accumulateddUdxdv(tri_Av); // lhs == -df/dx A.setFromTriplets(tri_A.begin(), tri_A.end()); A *= dt; SparseXs B = A; // lhs == -h*df/dx Av.setFromTriplets(tri_Av.begin(), tri_Av.end()); // lhs == -h*df/dv -h^2*df/dx // lhs == -df/dv -h*df/dx A += Av; // lhs == -h*df/dv -h^2*df/dx A *= dt; // For scripted DoFs, zero out the rows/cols of fixed degrees of freedom A = C * A; // lhs == M -h*df/dv -h^2*df/dx A += M; Eigen::SimplicialLDLT<SparseXs> solver(A); VectorXs rhs = VectorXs::Zero(ndof); scene.accumulateGradU(rhs,dx,dv); rhs *= -1.0; // rhs == f - hessE * v rhs -= C * (B * v); // rhs == h*f rhs *= dt; // For scripted DoFs, zero the elements of fixed degrees of freedom zeroFixedDoFs( scene, rhs ); // Change in velocity returned by linear solve VectorXs dqdot = solver.solve(rhs); Eigen::Map<VecXd>((double*) &scene.constrainedVelocities()[0], ndof) += dqdot; Eigen::Map<VecXd>((double*) &scene.constrainedPositions()[0], ndof) += dt * Eigen::Map<VecXd>((double*) &scene.constrainedVelocities()[0], ndof); return true; } std::string LinearizedImplicitEuler::getName() const { return "Linearized Implicit Euler"; } void LinearizedImplicitEuler::zeroFixedDoFs( const VS3D& scene, VectorXs& vec ) { int nprts = scene.constrainedPositions().size(); for( int i = 0; i < nprts; ++i ) if( scene.constrainedFixed()[i] ) vec.segment<3>(3 * i).setZero(); }
28.308333
149
0.600236
5f86049f22b9d449118b81ec1a272d8b8a360ade
1,433
cpp
C++
android-30/java/util/logging/ErrorManager.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
12
2020-03-26T02:38:56.000Z
2022-03-14T08:17:26.000Z
android-31/java/util/logging/ErrorManager.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
1
2021-01-27T06:07:45.000Z
2021-11-13T19:19:43.000Z
android-29/java/util/logging/ErrorManager.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
3
2021-02-02T12:34:55.000Z
2022-03-08T07:45:57.000Z
#include "../../lang/Exception.hpp" #include "../../../JString.hpp" #include "./ErrorManager.hpp" namespace java::util::logging { // Fields jint ErrorManager::CLOSE_FAILURE() { return getStaticField<jint>( "java.util.logging.ErrorManager", "CLOSE_FAILURE" ); } jint ErrorManager::FLUSH_FAILURE() { return getStaticField<jint>( "java.util.logging.ErrorManager", "FLUSH_FAILURE" ); } jint ErrorManager::FORMAT_FAILURE() { return getStaticField<jint>( "java.util.logging.ErrorManager", "FORMAT_FAILURE" ); } jint ErrorManager::GENERIC_FAILURE() { return getStaticField<jint>( "java.util.logging.ErrorManager", "GENERIC_FAILURE" ); } jint ErrorManager::OPEN_FAILURE() { return getStaticField<jint>( "java.util.logging.ErrorManager", "OPEN_FAILURE" ); } jint ErrorManager::WRITE_FAILURE() { return getStaticField<jint>( "java.util.logging.ErrorManager", "WRITE_FAILURE" ); } // QJniObject forward ErrorManager::ErrorManager(QJniObject obj) : JObject(obj) {} // Constructors ErrorManager::ErrorManager() : JObject( "java.util.logging.ErrorManager", "()V" ) {} // Methods void ErrorManager::error(JString arg0, java::lang::Exception arg1, jint arg2) const { callMethod<void>( "error", "(Ljava/lang/String;Ljava/lang/Exception;I)V", arg0.object<jstring>(), arg1.object(), arg2 ); } } // namespace java::util::logging
19.364865
84
0.677599
5f87173eaafc62afd8454c1067053ee3c35ec14e
759
hpp
C++
cpp/src/vcf/reader.hpp
dylex/wecall
35d24cefa4fba549e737cd99329ae1b17dd0156b
[ "MIT" ]
8
2018-10-08T15:47:21.000Z
2021-11-09T07:13:05.000Z
cpp/src/vcf/reader.hpp
dylex/wecall
35d24cefa4fba549e737cd99329ae1b17dd0156b
[ "MIT" ]
4
2018-11-05T09:16:27.000Z
2020-04-09T12:32:56.000Z
cpp/src/vcf/reader.hpp
dylex/wecall
35d24cefa4fba549e737cd99329ae1b17dd0156b
[ "MIT" ]
4
2019-09-03T15:46:39.000Z
2021-06-04T07:28:33.000Z
// All content Copyright (C) 2018 Genomics plc #ifndef VCF_READER_HPP #define VCF_READER_HPP #include <utils/logging.hpp> #include <fstream> #include <boost/optional/optional.hpp> #include <map> #include <set> #include "vcf/filterDescription.hpp" #include "vcf/record.hpp" #include "utils/timer.hpp" struct shouldParseValidVCFFilterHeaderUpperCaseID; struct shouldParseValidVCFFilterHeaderLowerCaseID; struct shouldParseValidVCFFilterHeaderDigitsAndPunctuation; struct shouldRaiseOnINFOHeaderType; struct shouldRaiseOnInvalidVCFFilterHeader; struct shouldRaiseOnFORMATHeaderType; namespace wecall { namespace vcf { using vcfMetaInformation_t = std::map< std::string, std::string >; Info parseVCFInfo( const std::string & raw_info ); } } #endif
22.323529
70
0.806324
5f87d676b4c228f3da68f6dd69d9f0811cf23a07
18,446
cpp
C++
DotnetLibraryTests/StringTests.cpp
lambertlb/CppTranslator
8d9e94f01a0eb099c224fbd9720a0d060a49bda9
[ "MIT" ]
null
null
null
DotnetLibraryTests/StringTests.cpp
lambertlb/CppTranslator
8d9e94f01a0eb099c224fbd9720a0d060a49bda9
[ "MIT" ]
null
null
null
DotnetLibraryTests/StringTests.cpp
lambertlb/CppTranslator
8d9e94f01a0eb099c224fbd9720a0d060a49bda9
[ "MIT" ]
null
null
null
// Copyright (c) 2019 LLambert // // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #include "gtest/gtest.h" #include <DotnetTypes.h> using namespace DotnetLibrary; TEST(StringTests, ConstructorTest) { String string(L"Test String"); ASSERT_TRUE(!string.IsAllocated()); ASSERT_TRUE(string.get_Length() == 11); ASSERT_TRUE(wcscmp(string.get_Buffer(), L"Test String") == 0); } TEST(StringTests, Constructor2Test) { String string(L"Test String 1234567890", 12, 10); ASSERT_TRUE(string.IsAllocated()); ASSERT_TRUE(string.get_Length() == 10); ASSERT_TRUE(wcscmp(string.get_Buffer(), L"1234567890") == 0); } TEST(StringTests, Constructor3Test) { Array array(CharType, 6); Char data[] = { 'A','B', 'C', 'D', 'E', 'F' }; array.Initialize(data); String string(&array); ASSERT_TRUE(string.IsAllocated()); ASSERT_TRUE(string.get_Length() == 6); ASSERT_TRUE(wcscmp(string.get_Buffer(), L"ABCDEF") == 0); } TEST(StringTests, Constructor4Test) { Array array(CharType, 6); Char data[] = { 'A','B', 'C', 'D', 'E', 'F' }; array.Initialize(data); String string(&array, 3, 3); ASSERT_TRUE(string.IsAllocated()); ASSERT_TRUE(string.get_Length() == 3); ASSERT_TRUE(wcscmp(string.get_Buffer(), L"DEF") == 0); } TEST(StringTests, Constructor5Test) { String string(L'C', 6); ASSERT_TRUE(string.IsAllocated()); ASSERT_TRUE(string.get_Length() == 6); ASSERT_TRUE(wcscmp(string.get_Buffer(), L"CCCCCC") == 0); } TEST(StringTests, GetCharsTest) { String string(L"Test String"); ASSERT_TRUE(string.get_Chars(0) == L'T'); ASSERT_TRUE(string.get_Chars(10) == L'g'); } TEST(StringTests, GetLengthTest) { String string(L"Test String"); ASSERT_TRUE(string.get_Length() == 11); } TEST(StringTests, AddressTest) { String string(L"Test String"); ASSERT_TRUE(*string.Address(0) == L'T'); } TEST(StringTests, CompareTest) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(String::Compare(&string,&string2) == 0); } TEST(StringTests, Compare2Test) { String string(L"ABCDEFGHI"); String string2(L"aBCDEFGHI"); ASSERT_TRUE(String::Compare(&string, &string2) > 0); } TEST(StringTests, Compare3Test) { String string(L"ABCDEFGHI"); String string2(L"aBCDEFGHI"); ASSERT_TRUE(String::Compare(&string, &string2, true) == 0); } TEST(StringTests, Compare4Test) { String string(L"1ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(String::Compare(&string, &string2) < 0); } TEST(StringTests, Compare5Test) { String string(L"1ABCDEFGHI"); String string2(L"ABCXXXXX"); ASSERT_TRUE(String::Compare(&string, 1, &string2, 0 ,3) == 0); } TEST(StringTests, Compare6Test) { String string(L"1ABCDEFGHI"); String string2(L"abcXXXXX"); ASSERT_TRUE(String::Compare(&string, 1, &string2, 0, 3, true) == 0); } TEST(StringTests, CompareOrinalTest) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(String::CompareOrdinal(&string, &string2) == 0); } TEST(StringTests, CompareOrinal2Test) { String string(L"ABCDEFGHI"); String string2(L"aBCDEFGHI"); ASSERT_TRUE(String::CompareOrdinal(&string, &string2) < 0); } TEST(StringTests, CompareOrinal3Test) { String string(L"1ABCDEFGHI"); String string2(L"ABCXXXXX"); ASSERT_TRUE(String::CompareOrdinal(&string, 1, &string2, 0, 3) == 0); } TEST(StringTests, CompareToTest) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(string.CompareTo(&string2) == 0); } TEST(StringTests, CompareTo2Test) { String string(L"ABCDEFGHI"); ASSERT_TRUE(string.CompareTo((String*)nullptr) == 1); } TEST(StringTests, CompareTo3Test) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(string.CompareTo((Object*)&string2) == 0); } TEST(StringTests, ConcatTest) { String string(L"ABC"); String* s2 = String::Concat(&string); ASSERT_TRUE(wcscmp(s2->get_Buffer(), L"ABC") == 0); } TEST(StringTests, Concat2Test) { String string(L"ABC"); String string2(L"DEF"); String string3(L"GHI"); String string4(L"JKL"); String* s2 = String::Concat(&string, &string2, &string3, &string4); ASSERT_TRUE(wcscmp(s2->get_Buffer(), L"ABCDEFGHIJKL") == 0); } TEST(StringTests, Concat3Test) { Array array(ObjectType, 4); String string(L"ABC"); String string2(L"DEF"); String string3(L"GHI"); String string4(L"JKL"); Object* list[4] = { &string, &string2, &string3, &string4 }; array.Initialize(list); String* s2 = String::Concat(&array); ASSERT_TRUE(wcscmp(s2->get_Buffer(), L"ABCDEFGHIJKL") == 0); } TEST(StringTests, ContainsTest) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(string.Contains(&string2)); } TEST(StringTests, Contains2Test) { String string(L"ABCDEFGHI"); String string2(L"DEF"); ASSERT_TRUE(string.Contains(&string2)); } TEST(StringTests, Contains3Test) { String string(L"ABCDEFGHI"); String string2(L"123"); ASSERT_TRUE(!string.Contains(&string2)); } TEST(StringTests, CopyTest) { String string(L"ABCDEFGHI"); String* string2 = String::Copy(&string); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L"ABCDEFGHI") == 0); } TEST(StringTests, CopyToTest) { String string(L"1234567890"); Array array(CharType, 6); Char data[] = { 'A','B', 'C', 'D', 'E', 'F' }; array.Initialize(data); string.CopyTo(3, &array, 2, 3); Char* x = (Char*)array.Address(0); ASSERT_TRUE(wcsncmp((Char*)array.Address(0), L"AB456F", 6) == 0); } TEST(StringTests, EndsWithTest) { String string(L"ABCDEFGHI"); String string1(L"GHI"); ASSERT_TRUE(string.EndsWith(&string1)); } TEST(StringTests, EndsWith2Test) { String string(L"ABCDEFGHI"); String string1(L"ABCDEFGHI"); ASSERT_TRUE(string.EndsWith(&string1)); } TEST(StringTests, EndsWith3Test) { String string(L"ABCDEFGHI"); ASSERT_TRUE(string.EndsWith(L'I')); } TEST(StringTests, EndsWith4Test) { String string(L""); ASSERT_TRUE(!string.EndsWith(L'I')); } TEST(StringTests, EqualsTest) { String string(L"ABCDEFGHI"); ASSERT_TRUE(string.Equals(&string)); } TEST(StringTests, Equals2Test) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(string.Equals(&string2)); } TEST(StringTests, Equals3Test) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(string.Equals((Object*)&string2)); } TEST(StringTests, Equals4Test) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(((Object*)&string)->Equals((Object*)&string2)); } TEST(StringTests, Equals5Test) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(Object::Equals((Object*)&string, (Object*)&string2)); } TEST(StringTests, Equals6Test) { String string(L"ABCDEFGHI"); String string2(L"ABCDEFGHI"); ASSERT_TRUE(String::Equals(&string, (Object*)&string2)); } TEST(StringTests, GetEnumeratorTest) { Char* chars = (Char*)L"ABCDEFGHI"; String string(chars); CharEnumerator* iter = string.GetEnumerator(); Int32 i = 0; while (iter->MoveNext()) { ASSERT_TRUE(iter->get_Current() == chars[i++]); } i = 0; iter->Reset(); while (iter->MoveNext()) { ASSERT_TRUE(iter->get_Current() == chars[i++]); } } TEST(StringTests, IndexOfTest) { String string(L"ABCDEFGHI"); ASSERT_TRUE(string.IndexOf(L'A') == 0); } TEST(StringTests, IndexOf2Test) { String string(L"ABCDEFGHI"); ASSERT_TRUE(string.IndexOf(L'I') == 8); } TEST(StringTests, IndexOf3Test) { String string(L"ABCDEFGHI"); ASSERT_TRUE(string.IndexOf(L'C', 2) == 2); } TEST(StringTests, IndexOf4Test) { String string(L"ABCDEFGHI"); ASSERT_TRUE(string.IndexOf(L'C', 2, 3) == 2); } TEST(StringTests, IndexOf10Test) { String string(L"ABCDEFGHI"); ASSERT_TRUE(string.IndexOf(L'C', 0, 2) == -1); } TEST(StringTests, IndexOf5Test) { String string(L"ABCDEFGHI"); ASSERT_TRUE(string.IndexOf(L'1') == -1); } TEST(StringTests, IndexOfStringTest) { String string(L"ABCDEFGHI"); String string2(L"BCD"); ASSERT_TRUE(string.IndexOf(&string2) == 1); } TEST(StringTests, IndexOfString2Test) { String string(L"ABCDEFGHI"); String string2(L"I"); ASSERT_TRUE(string.IndexOf(&string2, 4) == 8); } TEST(StringTests, IndexOfString3Test) { String string(L"ABCDEFGHI"); String string2(L"EFG"); ASSERT_TRUE(string.IndexOf(&string2, 2, 6) == 4); } TEST(StringTests, IndexOfString4Test) { String string(L"ABCDEFGHI"); String string2(L"123"); ASSERT_TRUE(string.IndexOf(&string2) == -1); } TEST(StringTests, IndexOfString5Test) { String string(L"ABCDEFGHI"); String string2(L"ABC"); ASSERT_TRUE(string.IndexOf(&string2, 2) == -1); } TEST(StringTests, IndexOfAnyTest) { String string(L"12 34 56"); Array array(CharType, 2); Char data[] = { '3','4'}; array.Initialize(data); ASSERT_TRUE(string.IndexOfAny(&array) == 3); } TEST(StringTests, IndexOfAny2Test) { String string(L"12 34 56"); Array array(CharType, 2); Char data[] = { '3','4' }; array.Initialize(data); ASSERT_TRUE(string.IndexOfAny(&array, 3) == 3); } TEST(StringTests, IndexOfAny3Test) { String string(L"12 34 56"); Array array(CharType, 2); Char data[] = { 'X','3' }; array.Initialize(data); ASSERT_TRUE(string.IndexOfAny(&array, 3, 2) == 3); } TEST(StringTests, IndexOfAny4Test) { String string(L"12 34 56"); Array array(CharType, 2); Char data[] = { 'X','Y' }; array.Initialize(data); ASSERT_TRUE(string.IndexOfAny(&array) == -1); } TEST(StringTests, InsertTest) { String string(L"ABCDEFGHI"); String string2(L"123"); String* newStr = string.Insert(3, &string2); ASSERT_TRUE(wcscmp(newStr->get_Buffer(), L"ABC123DEFGHI") == 0); } TEST(StringTests, Insert2Test) { String string(L"ABCDEFGHI"); String string2(L"123"); String* newStr = string.Insert(string.get_Length(), &string2); ASSERT_TRUE(wcscmp(newStr->get_Buffer(), L"ABCDEFGHI123") == 0); } TEST(StringTests, IsNullOrEmptyTest) { ASSERT_TRUE(String::IsNullOrEmpty(String::Empty)); ASSERT_TRUE(String::IsNullOrEmpty(nullptr)); String string2(L"123"); ASSERT_TRUE(!String::IsNullOrEmpty(&string2)); } TEST(StringTests, IsNullOrWhiteSpaceTest) { ASSERT_TRUE(String::IsNullOrWhiteSpace(String::Empty)); ASSERT_TRUE(String::IsNullOrWhiteSpace(nullptr)); String string2(L" 2 "); ASSERT_TRUE(!String::IsNullOrWhiteSpace(&string2)); String string3(L" \t "); ASSERT_TRUE(String::IsNullOrWhiteSpace(&string3)); } TEST(StringTests, JoinTest) { Array array(StringType, 4); String string(L"ABC"); String string2(L"DEF"); String string3(L"GHI"); String string4(L"JKL"); Object* list[4] = { &string, &string2, &string3, &string4 }; array.Initialize(list); String separator(L","); String* s2 = String::Join(&separator, &array); ASSERT_TRUE(wcscmp(s2->get_Buffer(), L"ABC,DEF,GHI,JKL") == 0); } TEST(StringTests, Join2Test) { Array array(StringType, 4); String string(L"ABC"); String string2(L"DEF"); String string3(L"GHI"); String string4(L"JKL"); Object* list[4] = { &string, &string2, &string3, &string4 }; array.Initialize(list); String* s2 = String::Join(String::Empty, &array); ASSERT_TRUE(wcscmp(s2->get_Buffer(), L"ABCDEFGHIJKL") == 0); } TEST(StringTests, Join3Test) { Array array(StringType, 4); String string(L"ABC"); String string2(L"DEF"); String string3(L"GHI"); String string4(L"JKL"); Object* list[4] = { &string, &string2, &string3, &string4 }; array.Initialize(list); String separator(L","); String* s2 = String::Join(&separator, &array, 1); ASSERT_TRUE(wcscmp(s2->get_Buffer(), L"DEF,GHI,JKL") == 0); } TEST(StringTests, Join4Test) { Array array(StringType, 4); String string(L"ABC"); String string2(L"DEF"); String string3(L"GHI"); String string4(L"JKL"); Object* list[4] = { &string, &string2, &string3, &string4 }; array.Initialize(list); String separator(L","); String* s2 = String::Join(&separator, &array, 1, 2); ASSERT_TRUE(wcscmp(s2->get_Buffer(), L"DEF,GHI") == 0); } TEST(StringTests, LastIndexOfTest) { String string(L"11223311"); String subString(L"11"); ASSERT_TRUE(string.LastIndexOf(&subString) == 6); ASSERT_TRUE(string.LastIndexOf(&subString, 4) == 0); ASSERT_TRUE(string.LastIndexOf(&subString, 4, 5) == 0); String subString2(L"1"); ASSERT_TRUE(string.LastIndexOf(&subString2) == 7); } TEST(StringTests, LastIndexOfCharTest) { String string(L"11223311"); ASSERT_TRUE(string.LastIndexOf(L'1') == 7); ASSERT_TRUE(string.LastIndexOf(L'1', 4) == 1); ASSERT_TRUE(string.LastIndexOf(L'1', 4, 4) == 1); } TEST(StringTests, LastIndexOfAnyTest) { String string(L"11223311"); Array array(CharType, 2); Char data[] = { '1','2' }; array.Initialize(data); ASSERT_TRUE(string.LastIndexOfAny(&array) == 7); ASSERT_TRUE(string.LastIndexOfAny(&array, 4) == 3); ASSERT_TRUE(string.LastIndexOfAny(&array, 4, 4) == 3); } TEST(StringTests, PadLeftTest) { String string(L"11223311"); String* rtn = string.PadLeft(13); ASSERT_TRUE(wcscmp(rtn->get_Buffer(), L" 11223311") == 0); String* rtn2 = string.PadLeft(13, L'-'); ASSERT_TRUE(wcscmp(rtn2->get_Buffer(), L"-----11223311") == 0); } TEST(StringTests, PadRightTest) { String string(L"11223311"); String* rtn = string.PadRight(13); ASSERT_TRUE(wcscmp(rtn->get_Buffer(), L"11223311 ") == 0); String* rtn2 = string.PadRight(13, L'-'); ASSERT_TRUE(wcscmp(rtn2->get_Buffer(), L"11223311-----") == 0); } TEST(StringTests, RemoveTest) { String string(L"11223311"); String* rtn = string.Remove(2,2); ASSERT_TRUE(wcscmp(rtn->get_Buffer(), L"113311") == 0); String* rtn2 = string.Remove(6, 2); ASSERT_TRUE(wcscmp(rtn2->get_Buffer(), L"112233") == 0); String* rtn3 = string.Remove(0, 2); ASSERT_TRUE(wcscmp(rtn3->get_Buffer(), L"223311") == 0); } TEST(StringTests, ReplaceCharTest) { String string(L"11223311"); String* rtn = string.Replace(L'1', L'A'); ASSERT_TRUE(wcscmp(rtn->get_Buffer(), L"AA2233AA") == 0); } TEST(StringTests, ReplaceStringTest) { String string(L"11223311"); String search(L"11"); String replacement(L"ZZ"); String* rtn = string.Replace(&search, &replacement); ASSERT_TRUE(wcscmp(rtn->get_Buffer(), L"ZZ2233ZZ") == 0); } TEST(StringTests, StartWithTest) { String string(L"11223311"); String search(L"11"); ASSERT_TRUE(string.StartsWith(&search)); String search2(L"22"); ASSERT_TRUE(!string.StartsWith(&search2)); } TEST(StringTests, SubStringTest) { String string(L"11223311"); String* str1 = string.Substring(2); ASSERT_TRUE(wcscmp(str1->get_Buffer(), L"223311") == 0); String* str2 = string.Substring(6,2); ASSERT_TRUE(wcscmp(str2->get_Buffer(), L"11") == 0); } TEST(StringTests, ToCharArrayTest) { String string(L"11223311"); Array* array = string.ToCharArray(); ASSERT_TRUE(array != nullptr); ASSERT_TRUE(array->get_Length() == string.get_Length()); ASSERT_TRUE(*(Char*)array->Address(1) == string.get_Chars(1)); ASSERT_TRUE(*(Char*)array->Address(7) == string.get_Chars(7)); } TEST(StringTests, ToCharArray2Test) { String string(L"11223311"); Array* array = string.ToCharArray(4, 2); ASSERT_TRUE(array != nullptr); ASSERT_TRUE(array->get_Length() == 2); ASSERT_TRUE(*(Char*)array->Address(0) == L'3'); ASSERT_TRUE(*(Char*)array->Address(1) == L'3'); } TEST(StringTests, ToLowerTest) { String string(L"ABCDEFGHI"); String* string2 = string.ToLower(); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L"abcdefghi") == 0); } TEST(StringTests, ToUpperTest) { String string(L"abcdefghi"); String* string2 = string.ToUpper(); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L"ABCDEFGHI") == 0); } TEST(StringTests, TrimTest) { String string(L" \tABCDEFGHI\n\r"); String* string2 = string.Trim(); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L"ABCDEFGHI") == 0); } TEST(StringTests, Trim2Test) { String string(L" \tABCDEFGHI\n\r"); Array array(CharType, 2); Char data[] = { ' ','\t' }; array.Initialize(data); String* string2 = string.Trim(&array); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L"ABCDEFGHI\n\r") == 0); } TEST(StringTests, Trim3Test) { String string(L" \tABCDEFGHI\n\r"); Array array(CharType, 2); Char data[] = { ' ','\t' }; array.Initialize(data); String* string2 = string.Trim(nullptr); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L"ABCDEFGHI") == 0); } TEST(StringTests, TrimEndTest) { String string(L" \tABCDEFGHI\n\r"); Array array(CharType, 2); Char data[] = { ' ','\t' }; array.Initialize(data); String* string2 = string.TrimEnd(nullptr); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L" \tABCDEFGHI") == 0); } TEST(StringTests, TrimEnd2Test) { String string(L" \tABCDEFGHI\n\r"); Array array(CharType, 2); Char data[] = { ' ','\t' }; array.Initialize(data); String* string2 = string.TrimEnd(&array); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L" \tABCDEFGHI\n\r") == 0); } TEST(StringTests, TrimEnd3Test) { String string(L" \tABCDEFGHI\n\r\t"); Array array(CharType, 2); Char data[] = { ' ','\t' }; array.Initialize(data); String* string2 = string.TrimEnd(&array); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L" \tABCDEFGHI\n\r") == 0); } TEST(StringTests, TrimStartTest) { String string(L" \tABCDEFGHI\n\r"); Array array(CharType, 2); Char data[] = { ' ','\t' }; array.Initialize(data); String* string2 = string.TrimStart(nullptr); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L"ABCDEFGHI\n\r") == 0); } TEST(StringTests, TrimStart2Test) { String string(L" \tABCDEFGHI\n\r"); Array array(CharType, 2); Char data[] = { '\n','\r' }; array.Initialize(data); String* string2 = string.TrimStart(&array); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L" \tABCDEFGHI\n\r") == 0); } TEST(StringTests, TrimStart3Test) { String string(L"\r \tABCDEFGHI\n\r"); Array array(CharType, 2); Char data[] = { '\n','\r' }; array.Initialize(data); String* string2 = string.TrimStart(&array); ASSERT_TRUE(wcscmp(string2->get_Buffer(), L" \tABCDEFGHI\n\r") == 0); }
32.763766
94
0.702862
5f8c4c298e5aaebad3601c5603119c24986e3bb0
1,364
cpp
C++
src/config/LaserConfig.cpp
isaiah-v/rgb-laser-controller
641da5ceab3500432d5cba2cc6789fa635803494
[ "Apache-2.0" ]
null
null
null
src/config/LaserConfig.cpp
isaiah-v/rgb-laser-controller
641da5ceab3500432d5cba2cc6789fa635803494
[ "Apache-2.0" ]
null
null
null
src/config/LaserConfig.cpp
isaiah-v/rgb-laser-controller
641da5ceab3500432d5cba2cc6789fa635803494
[ "Apache-2.0" ]
null
null
null
#include <Arduino.h> #include <config/LaserConfig.h> Pwm pwm = Pwm(PWM_DEFAULT_PERIOD); PwmController pwmController = PwmController( &pwm, PWM_PIN_RED, PWM_PIN_GREEN, PWM_PIN_BLUE); PwmTimerPotentiometerCallback timerPotentiometerCallback = PwmTimerPotentiometerCallback(PWM_PERIOD_MIN, PWM_PERIOD_MAX, &pwm); PwmChannelPotentiometerCallback redPotentiometerCallback = PwmChannelPotentiometerCallback(&pwm, PwmChannel::RED); PwmChannelPotentiometerCallback greenPotentiometerCallback = PwmChannelPotentiometerCallback(&pwm, PwmChannel::GREEN); PwmChannelPotentiometerCallback bluePotentiometerCallback = PwmChannelPotentiometerCallback(&pwm, PwmChannel::BLUE); Potentiometer timmerPotentiometer = Potentiometer( POTENTIOMETER_SIGNAL_OFF, POTENTIOMETER_SIGNAL_ON, POTENTIOMETER_PIN_PERIOD, &timerPotentiometerCallback); Potentiometer redPotentiometer = Potentiometer( POTENTIOMETER_SIGNAL_OFF, POTENTIOMETER_SIGNAL_ON, POTENTIOMETER_PIN_RED, &redPotentiometerCallback); Potentiometer greenPotentiometer = Potentiometer( POTENTIOMETER_SIGNAL_OFF, POTENTIOMETER_SIGNAL_ON, POTENTIOMETER_PIN_GREEN, &greenPotentiometerCallback); Potentiometer bluePotentiometer = Potentiometer( POTENTIOMETER_SIGNAL_OFF, POTENTIOMETER_SIGNAL_ON, POTENTIOMETER_PIN_BLUE, &bluePotentiometerCallback);
34.974359
127
0.82478
5f9546f9a266b3fce0de657ba183711f056e1543
1,336
cpp
C++
Contributor Corner/Mercy/print bracket number/bracket.cpp
hitu1304/interview-corner
97503d1967c646f731275ae3665f142814c6a9d7
[ "MIT" ]
39
2020-11-01T13:58:48.000Z
2021-02-12T08:39:37.000Z
Contributor Corner/Mercy/print bracket number/bracket.cpp
hitu1304/interview-corner
97503d1967c646f731275ae3665f142814c6a9d7
[ "MIT" ]
86
2020-09-25T07:20:40.000Z
2021-02-18T20:36:29.000Z
Contributor Corner/Mercy/print bracket number/bracket.cpp
hitu1304/interview-corner
97503d1967c646f731275ae3665f142814c6a9d7
[ "MIT" ]
43
2020-12-18T03:32:42.000Z
2021-02-19T18:08:19.000Z
#include <bits/stdc++.h> using namespace std; // function to print the bracket number void printBracketNumber(string exp, int n) { // used to print the bracket number // for the left bracket int left_bnum = 1; // used to obtain the bracket number // for the right bracket stack<int> right_bnum; // traverse the given expression 'exp' for (int i = 0; i < n; i++) { // if current character is a left bracket if (exp[i] == '(') { // print 'left_bnum', cout << left_bnum << " "; // push 'left_bum' on to the stack 'right_bnum' right_bnum.push(left_bnum); // increment 'left_bnum' by 1 left_bnum++; } // else if current character is a right bracket else if(exp[i] == ')') { // print the top element of stack 'right_bnum' // it will be the right bracket number cout << right_bnum.top() << " "; // pop the top element from the stack right_bnum.pop(); } } } int main() { string exp = "(a+(b*c))+(d/e)"; int n = exp.size(); printBracketNumber(exp, n); return 0; }
24.740741
60
0.480539
5f956e05336a89eced57b8c577ffb2ab3f908107
269
cpp
C++
DirectXSceneStore/MoveLookControllerKinect.cpp
SBarber95/tutorial
19021ff50e0b42dced87298c8ca4cd6f6540592f
[ "MIT" ]
181
2015-03-25T20:03:04.000Z
2022-01-22T01:06:25.000Z
DirectXSceneStore/MoveLookControllerKinect.cpp
SBarber95/tutorial
19021ff50e0b42dced87298c8ca4cd6f6540592f
[ "MIT" ]
49
2015-03-26T12:41:42.000Z
2022-01-19T19:00:42.000Z
DirectXSceneStore/MoveLookControllerKinect.cpp
eugene2candy/tutorial
19021ff50e0b42dced87298c8ca4cd6f6540592f
[ "MIT" ]
75
2015-04-03T09:33:12.000Z
2022-02-07T10:05:00.000Z
#include "pch.h" #include "MoveLookControllerKinect.h" MoveLookController^ MoveLookControllerKinect::Create() { auto p = ref new MoveLookControllerKinect(); return static_cast<MoveLookController^>(p); } MoveLookControllerKinect::MoveLookControllerKinect() { }
15.823529
54
0.780669
5f963f2c5fc660202b0908998a06753987c7df51
3,465
cpp
C++
src/metafs/mim/meta_io_req_q.cpp
mjlee34/poseidonos
8eff75c5ba7af8090d3ff4ac51d7507b37571f9b
[ "BSD-3-Clause" ]
null
null
null
src/metafs/mim/meta_io_req_q.cpp
mjlee34/poseidonos
8eff75c5ba7af8090d3ff4ac51d7507b37571f9b
[ "BSD-3-Clause" ]
null
null
null
src/metafs/mim/meta_io_req_q.cpp
mjlee34/poseidonos
8eff75c5ba7af8090d3ff4ac51d7507b37571f9b
[ "BSD-3-Clause" ]
null
null
null
/* * BSD LICENSE * Copyright (c) 2021 Samsung Electronics Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "meta_io_req_q.h" #include "mfs_mutex.h" MetaIoQ::MetaIoQ(void) { } bool MetaIoQ::IsEmpty(void) { return q.empty(); } bool MetaIoQ::Enqueue(MetaFsIoReqMsg* msg) { SPIN_LOCK_GUARD_IN_SCOPE(qlock); q.push_back(msg); return true; } MetaFsIoReqMsg* MetaIoQ::Dequeue(void) { SPIN_LOCK_GUARD_IN_SCOPE(qlock); if (unlikely(true == IsEmpty())) { return nullptr; } MetaFsIoReqMsg* msg = q.front(); if (msg != nullptr) { q.pop_front(); } return msg; } MetaIoMultiQ::MetaIoMultiQ(void) { for (uint32_t index = 0; index < MetaFsConfig::DEFAULT_MAX_CORE_COUNT; index++) { msgQ[index] = nullptr; } } MetaIoMultiQ::~MetaIoMultiQ(void) { Clear(); } void MetaIoMultiQ::Init(void) { } void MetaIoMultiQ::Clear(void) { for (uint32_t index = 0; index < MetaFsConfig::DEFAULT_MAX_CORE_COUNT; index++) { if (nullptr != msgQ[index]) { delete msgQ[index]; msgQ[index] = nullptr; } } } bool MetaIoMultiQ::EnqueueReqMsg(uint32_t coreId, MetaFsIoReqMsg& reqMsg) { MetaIoQ* reqMsgQ = msgQ[coreId]; if (unlikely(nullptr == reqMsgQ)) { MetaIoQ* newReqMsgQ = new MetaIoQ(); msgQ[coreId] = newReqMsgQ; reqMsgQ = newReqMsgQ; } bool mioQueued = reqMsgQ->Enqueue(&reqMsg); return mioQueued; } bool MetaIoMultiQ::IsEmpty(int coreId) { MetaIoQ* reqMsgQ = msgQ[coreId]; if (nullptr == reqMsgQ) return true; return msgQ[coreId]->IsEmpty(); } MetaFsIoReqMsg* MetaIoMultiQ::DequeueReqMsg(uint32_t coreId) { MetaIoQ* reqMsgQ = msgQ[coreId]; if (nullptr == reqMsgQ) { return nullptr; } MetaFsIoReqMsg* reqMsg = reqMsgQ->Dequeue(); return reqMsg; }
23.896552
83
0.674459
5f98d36504125aa4f7d3690db1a51afc184288c4
6,406
cpp
C++
core/impl/file/file_obj_mesh.cpp
auyunli/enhance
ca99530c80b42842e713ed4b62e40d12e56ee24a
[ "BSD-2-Clause" ]
null
null
null
core/impl/file/file_obj_mesh.cpp
auyunli/enhance
ca99530c80b42842e713ed4b62e40d12e56ee24a
[ "BSD-2-Clause" ]
null
null
null
core/impl/file/file_obj_mesh.cpp
auyunli/enhance
ca99530c80b42842e713ed4b62e40d12e56ee24a
[ "BSD-2-Clause" ]
null
null
null
#include <fstream> #include <string> #include <sstream> #include <iostream> #include <vector> #include <cmath> #include <tuple> #include <regex> #include <cassert> #include "file_obj_mesh.hpp" #include "renderable_info.hpp" renderable_info_tris file_obj_mesh::calc_renderable_info_tris( file_obj_mesh::data_mesh & dm ){ renderable_info_tris ret {}; //add vertex and normals for rendering for( auto & t : dm._tris ){ for( int i = 0; i < 3; ++i ){ int vert_index = t._vert_indices[ i ]; auto & v = dm._verts[ vert_index ]; ret._pos.push_back( v._pos[0] ); ret._pos.push_back( v._pos[1] ); ret._pos.push_back( v._pos[2] ); ret._normal.push_back( v._normal[0] ); ret._normal.push_back( v._normal[1] ); ret._normal.push_back( v._normal[2] ); ret._uv.push_back( v._tex_coords[0] ); ret._uv.push_back( v._tex_coords[1] ); } } return std::move(ret); } std::pair<bool, file_obj_mesh::data_mesh> file_obj_mesh::process( std::string file_path ){ std::fstream input; input.open( file_path, std::fstream::in ); std::string current; std::stringstream ss; size_t count_normals = 0; size_t count_verts = 0; size_t count_tris = 0; size_t count_tc = 0; std::vector<std::string> vTextureName; int objectCount = 0; int triangleCount = 0; std::string result_obj_name; file_obj_mesh::data_mesh dm {}; std::vector<file_obj_mesh::norm> normals {}; std::vector<file_obj_mesh::texturecoord> textures {}; while (getline(input, current)) { // object name std::regex reg_obj_name("^o (\\w+)"); std::smatch match_obj_name; if (std::regex_search( current, match_obj_name, reg_obj_name ) && match_obj_name.size() > 1 ) { result_obj_name = match_obj_name.str(1); // std::cout << "Object Name: " << result_obj_name << std::endl; continue; } //vertices std::regex reg_vert_coord("^v ([+-]?\\d+(?:\\.\\d+)?) ([+-]?\\d+(?:\\.\\d+)?) ([+-]?\\d+(?:\\.\\d+)?)"); std::smatch match_vert_coord; std::string result_vert_coord; if (std::regex_search( current, match_vert_coord, reg_vert_coord ) && match_vert_coord.size() > 3 ) { file_obj_mesh::vert v; v._index = count_verts++; for( int i = 0; i < 3; ++i ) v._pos[i] = stod( match_vert_coord.str( i + 1 ) ); // std::cout << "Vertice Coord: " << v._pos[0] << ", " << v._pos[1] <<", " << v._pos[2] << std::endl; dm._verts.push_back(v); continue; } //normals std::regex reg_vert_norm("^vn ([+-]?\\d+(?:\\.\\d+)?) ([+-]?\\d+(?:\\.\\d+)?) ([+-]?\\d+(?:\\.\\d+)?)"); std::smatch match_vert_norm; std::string result_vert_norm; if (std::regex_search( current, match_vert_norm, reg_vert_norm ) && match_vert_norm.size() > 3 ) { file_obj_mesh::norm n {}; n._index = count_normals++; for( int i = 0; i < 3; ++i ) n._normal[i] = stod( match_vert_norm.str( i + 1 ) ); // std::cout << "Vertice Normal: " << n._normal[0] << ", " << n._normal[1] <<", " << n._normal[2] << std::endl; normals.push_back( n ); continue; } //texture coordinates std::regex reg_tc("^vt ([+-]?\\d+(?:\\.\\d+)?) ([+-]?\\d+(?:\\.\\d+)?)"); std::smatch match_tc; std::string result_tc; if (std::regex_search( current, match_tc, reg_tc ) && match_tc.size() > 2 ) { file_obj_mesh::texturecoord tc {}; tc._index = count_tc++; for( int i = 0; i < 2; ++i ) tc._tc[i] = stod( match_tc.str( i + 1 ) ); // std::cout << "Texture Coord: " << tc._tc[0] << ", " << tc._tc[1] << std::endl; textures.push_back( tc ); continue; } //triangle faces std::regex reg_face("^f (\\d+)//(\\d+) (\\d+)//(\\d+) (\\d+)//(\\d+)"); // v_coord, v_normal std::regex reg_face_2("^f (\\d+)/(?:\\d+)/(\\d+) (\\d+)/(?:\\d+)/(\\d+) (\\d+)/(?:\\d+)/(\\d+)"); // v_coord, v_texturecoord, v_normal std::smatch match_face; std::string result_face; if (std::regex_search( current, match_face, reg_face ) && match_face.size() > 6 ){ file_obj_mesh::tri t {}; t._index = count_tris++; for( int i = 0; i < 3; ++i ) t._vert_indices[ i ] = stoi( match_face.str( 1 + i * 2 ) ) - 1; dm._tris.push_back( t ); //get normals and copy into vert structure for( int i = 0; i < 3; ++i ){ int index_norm = stoi( match_face.str( 2 + i * 2 ) ) - 1; if( index_norm < 0 || index_norm >= normals.size() ){ assert( 0 && "triangle normal index out of range." ); return { false, {} }; } int index_vert = t._vert_indices[i]; if( index_vert < 0 || index_vert >= dm._verts.size() ){ assert( 0 && "triangle vert index out of range." ); return { false, {} }; } file_obj_mesh::vert & v = dm._verts[ index_vert ]; for( int j = 0; j < 3; ++j ){ v._normal[j] = normals[ index_norm ]._normal[j]; } } continue; } if (std::regex_search( current, match_face, reg_face_2 ) && match_face.size() > 9 ) { tri t {}; t._index = count_tris++; for( int i = 0; i < 3; ++i ) t._vert_indices[ i ] = stoi( match_face.str( 1 + i * 3 ) ) - 1; dm._tris.push_back( t ); for( int i = 0; i < 3; ++i ){ //get normals and copy into vert structure int index_norm = stoi( match_face.str( 3 + i * 3 ) ) - 1; if( index_norm < 0 || index_norm >= normals.size() ){ assert( 0 && "triangle normal index out of range." ); return { false, {} }; } int index_vert = t._vert_indices[i]; if( index_vert < 0 || index_vert >= dm._verts.size() ){ assert( 0 && "triangle vert index out of range." ); return { false, {} }; } vert & v = dm._verts[ index_vert ]; for( int j = 0; j < 3; ++j ){ v._normal[j] = normals[ index_norm ]._normal[j]; } //get texture coordinate indices and copy into vert structure int index_tc = stoi( match_face.str( 2 + i * 3 ) ); if( index_tc < 0 || index_tc >= textures.size() ){ assert( 0 && "triangle texture index out of range." ); return { false, {} }; } file_obj_mesh::texturecoord & tc = textures[ index_tc ]; for( int j = 0; j < 2; ++j ){ v._tex_coords[j] = tc._tc[j]; } } continue; } } input.close(); dm._numverts = dm._verts.size(); dm._numtris = dm._tris.size(); return { true, std::move(dm) }; }
35.787709
135
0.559319
5f9910857c950cc9d8a1e909f4d25ada7ff99d84
1,311
cpp
C++
Sub-stringDivisibility.cpp
AlirezaKamyab/ProjectEuler
7237d2813ec2fe851c77960e41cd2e8e1520bf9f
[ "MIT" ]
null
null
null
Sub-stringDivisibility.cpp
AlirezaKamyab/ProjectEuler
7237d2813ec2fe851c77960e41cd2e8e1520bf9f
[ "MIT" ]
null
null
null
Sub-stringDivisibility.cpp
AlirezaKamyab/ProjectEuler
7237d2813ec2fe851c77960e41cd2e8e1520bf9f
[ "MIT" ]
1
2020-12-28T16:49:06.000Z
2020-12-28T16:49:06.000Z
// This file is written by Alireza Kamyab 3/30/2021 // Solution to problem projecteuler.net/problem=43 #include <iostream> #include <vector> #include <algorithm> #include <cinttypes> using namespace std; bool hasProperty(vector<int> arr); int primeAfter(int number); uint64_t convertVectorToNumber(vector<int> numbers); int main() { vector<int> numbers = { 1,0,2,3,4,5,6,7,8,9 }; uint64_t summation = 0; do { if (hasProperty(numbers)) summation += convertVectorToNumber(numbers); } while (next_permutation(numbers.begin(), numbers.end())); cout << summation << endl; return 0; } uint64_t convertVectorToNumber(vector<int> numbers) { uint64_t result = 0; for (int i = 0; i < numbers.size(); ++i) { result *= 10; result += numbers[i]; } return result; } bool hasProperty(vector<int> arr) { int prime = 2; for (int i = 1; i <= 7; i++) { int number = 0; number += arr[i]; number *= 10; number += arr[i + 1]; number *= 10; number += arr[i + 2]; if (number % prime != 0) return false; prime = primeAfter(prime); } return true; } int primeAfter(int number) { if (number == 2) return 3; if (number == 3) return 5; int remainder = number % 6; int counter = number / 6; if (remainder > 1) { return (counter + 1) * 6 + 1; } else { return (counter + 1) * 6 - 1; } }
20.809524
72
0.641495
5f9c022780dd09af3f0da56b54bbbd1bec455d9e
31
cpp
C++
soplex/src/soplex/git_hash.cpp
avrech/scipoptsuite-6.0.2-avrech
bb4ef31b6e84ff7e1e65cee982acf150739cda86
[ "MIT" ]
null
null
null
soplex/src/soplex/git_hash.cpp
avrech/scipoptsuite-6.0.2-avrech
bb4ef31b6e84ff7e1e65cee982acf150739cda86
[ "MIT" ]
null
null
null
soplex/src/soplex/git_hash.cpp
avrech/scipoptsuite-6.0.2-avrech
bb4ef31b6e84ff7e1e65cee982acf150739cda86
[ "MIT" ]
1
2022-01-19T01:15:11.000Z
2022-01-19T01:15:11.000Z
#define SPX_GITHASH "b8833cd3"
15.5
30
0.806452
5f9e63dab889a49fe82ceaa575f866b943cf2ae3
644
hpp
C++
higan/gb/cartridge/mbc3/mbc3.hpp
13824125580/higan
fbdd3f980b65412c362096579869ae76730e4118
[ "Intel", "ISC" ]
38
2018-04-05T05:00:05.000Z
2022-02-06T00:02:02.000Z
higan/gb/cartridge/mbc3/mbc3.hpp
13824125580/higan
fbdd3f980b65412c362096579869ae76730e4118
[ "Intel", "ISC" ]
1
2018-04-29T19:45:14.000Z
2018-04-29T19:45:14.000Z
higan/gb/cartridge/mbc3/mbc3.hpp
13824125580/higan
fbdd3f980b65412c362096579869ae76730e4118
[ "Intel", "ISC" ]
8
2018-04-16T22:37:46.000Z
2021-02-10T07:37:03.000Z
struct MBC3 : Mapper { auto second() -> void; auto read(uint16 address) -> uint8; auto write(uint16 address, uint8 data) -> void; auto power() -> void; auto serialize(serializer& s) -> void; struct IO { struct ROM { uint8 bank = 0x01; } rom; struct RAM { uint1 enable; uint8 bank; } ram; struct RTC { uint1 halt = true; uint1 latch; uint8 second; uint8 minute; uint8 hour; uint9 day; uint1 dayCarry; uint8 latchSecond; uint8 latchMinute; uint8 latchHour; uint9 latchDay; uint1 latchDayCarry; } rtc; } io; } mbc3;
18.941176
49
0.569876
5fa14f0d066969b5eed836ed5f70579eebf75663
1,612
cpp
C++
src/BitmapReader.cpp
antenous/image
7743a31d87bae1b76efdd4023f21d0f861093057
[ "BSD-3-Clause" ]
null
null
null
src/BitmapReader.cpp
antenous/image
7743a31d87bae1b76efdd4023f21d0f861093057
[ "BSD-3-Clause" ]
null
null
null
src/BitmapReader.cpp
antenous/image
7743a31d87bae1b76efdd4023f21d0f861093057
[ "BSD-3-Clause" ]
null
null
null
/* * BitmapReader.cpp * * Created on: Dec 17, 2017 * Author: Antero Nousiainen */ #include "BitmapReader.hpp" using namespace image; namespace { template<typename T> void read(std::istream & stream, T & t, std::streamsize count = sizeof(T)) { stream.read(reinterpret_cast<char*>(&t), count); } inline void skipPadding(std::istream & from, uint8_t padding) { from.seekg(padding, from.cur); } void read(std::istream & from, Bitmap::Data & data, int32_t height, int32_t width, uint8_t padding) { data.resize(height*width); for (int32_t row(0), firstInRow(0); row < height; ++row, firstInRow += width, skipPadding(from, padding)) read(from, data[firstInRow], width*sizeof(Bitmap::Data::value_type)); } Bitmap readBitmap(std::istream & from) { Bitmap bmp; read(from, bmp.magic); if (!bmp) throw BitmapReader::InvalidType(); read(from, bmp.header.file); read(from, bmp.header.info); read(from, bmp.data, bmp.height(), bmp.width(), bmp.padding()); return bmp; } } BitmapReader::BadFile::BadFile() : std::invalid_argument("bad file") {} BitmapReader::InvalidType::InvalidType() : std::runtime_error("invalid type") {} Bitmap BitmapReader::read(std::istream & from) { if (!from) throw BitmapReader::BadFile(); from.exceptions(std::istream::failbit | std::istream::badbit); try { return readBitmap(from); } catch (const std::istream::failure &) { throw BadFile(); } }
22.082192
113
0.603598
5fa3d390d814fdc6c5f3be91a0f2cb7433526079
167,382
cpp
C++
src/magic/actmagic.cpp
PegasusEpsilon/Barony
6311f7e5da4835eaea65a95b5cc258409bb0dfa4
[ "FTL", "Zlib", "MIT" ]
373
2016-06-28T06:56:46.000Z
2022-03-23T02:32:54.000Z
src/magic/actmagic.cpp
PegasusEpsilon/Barony
6311f7e5da4835eaea65a95b5cc258409bb0dfa4
[ "FTL", "Zlib", "MIT" ]
361
2016-07-06T19:09:25.000Z
2022-03-26T14:14:19.000Z
src/magic/actmagic.cpp
PegasusEpsilon/Barony
6311f7e5da4835eaea65a95b5cc258409bb0dfa4
[ "FTL", "Zlib", "MIT" ]
129
2016-06-29T09:02:49.000Z
2022-01-23T09:56:06.000Z
/*------------------------------------------------------------------------------- BARONY File: actmagic.cpp Desc: behavior function for magic balls Copyright 2013-2016 (c) Turning Wheel LLC, all rights reserved. See LICENSE for details. -------------------------------------------------------------------------------*/ #include "../main.hpp" #include "../game.hpp" #include "../stat.hpp" #include "../entity.hpp" #include "../interface/interface.hpp" #include "../sound.hpp" #include "../items.hpp" #include "../monster.hpp" #include "../net.hpp" #include "../collision.hpp" #include "../paths.hpp" #include "../player.hpp" #include "magic.hpp" #include "../scores.hpp" void actMagiclightBall(Entity* my) { Entity* caster = NULL; if (!my) { return; } my->skill[2] = -10; // so the client sets the behavior of this entity if (clientnum != 0 && multiplayer == CLIENT) { my->removeLightField(); //Light up the area. my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 192); if ( flickerLights ) { //Magic light ball will never flicker if this setting is disabled. lightball_flicker++; } if (lightball_flicker > 5) { lightball_lighting = (lightball_lighting == 1) + 1; if (lightball_lighting == 1) { my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 192); } else { my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 174); } lightball_flicker = 0; } lightball_timer--; return; } my->yaw += .01; if ( my->yaw >= PI * 2 ) { my->yaw -= PI * 2; } /*if (!my->parent) { //This means that it doesn't have a caster. In other words, magic light staff. return; })*/ //list_t *path = NULL; pathnode_t* pathnode = NULL; //TODO: Follow player around (at a distance -- and delay before starting to follow). //TODO: Circle around player's head if they stand still for a little bit. Continue circling even if the player walks away -- until the player is far enough to trigger move (or if the player moved for a bit and then stopped, then update position). //TODO: Don't forget to cast flickering light all around it. //TODO: Move out of creatures' way if they collide. /*if (!my->children) { list_RemoveNode(my->mynode); //Delete the light spell. return; }*/ if (!my->children.first) { list_RemoveNode(my->mynode); //Delete the light spell.C return; } node_t* node = NULL; spell_t* spell = NULL; node = my->children.first; spell = (spell_t*)node->element; if (!spell) { list_RemoveNode(my->mynode); return; //We need the source spell! } caster = uidToEntity(spell->caster); if (caster) { Stat* stats = caster->getStats(); if (stats) { if (stats->HP <= 0) { my->removeLightField(); list_RemoveNode(my->mynode); //Delete the light spell. return; } } } else if (spell->caster >= 1) //So no caster...but uidToEntity returns NULL if entity is already dead, right? And if the uid is supposed to point to an entity, but it doesn't...it means the caster has died. { my->removeLightField(); list_RemoveNode(my->mynode); return; } // if the spell has been unsustained, remove it if ( !spell->magicstaff && !spell->sustain ) { int i = 0; int player = -1; for (i = 0; i < MAXPLAYERS; ++i) { if (players[i]->entity == caster) { player = i; } } if (player > 0 && multiplayer == SERVER) { strcpy( (char*)net_packet->data, "UNCH"); net_packet->data[4] = player; SDLNet_Write32(spell->ID, &net_packet->data[5]); net_packet->address.host = net_clients[player - 1].host; net_packet->address.port = net_clients[player - 1].port; net_packet->len = 9; sendPacketSafe(net_sock, -1, net_packet, player - 1); } my->removeLightField(); list_RemoveNode(my->mynode); return; } if (magic_init) { my->removeLightField(); if (lightball_timer <= 0) { if ( spell->sustain ) { //Attempt to sustain the magic light. if (caster) { //Deduct mana from caster. Cancel spell if not enough mana (simply leave sustained at false). bool deducted = caster->safeConsumeMP(1); //Consume 1 mana every duration / mana seconds if (deducted) { lightball_timer = spell->channel_duration / getCostOfSpell(spell); } else { int i = 0; int player = -1; for (i = 0; i < MAXPLAYERS; ++i) { if (players[i]->entity == caster) { player = i; } } if (player > 0 && multiplayer == SERVER) { strcpy( (char*)net_packet->data, "UNCH"); net_packet->data[4] = player; SDLNet_Write32(spell->ID, &net_packet->data[5]); net_packet->address.host = net_clients[player - 1].host; net_packet->address.port = net_clients[player - 1].port; net_packet->len = 9; sendPacketSafe(net_sock, -1, net_packet, player - 1); } my->removeLightField(); list_RemoveNode(my->mynode); return; } } } } //TODO: Make hovering always smooth. For example, when transitioning from ceiling to no ceiling, don't just have it jump to a new position. Figure out away to transition between the two. if (lightball_hoverangle > 360) { lightball_hoverangle = 0; } if (map.tiles[(int)((my->y / 16) * MAPLAYERS + (my->x / 16) * MAPLAYERS * map.height)]) { //Ceiling. my->z = lightball_hover_basez + ((lightball_hover_basez + LIGHTBALL_HOVER_HIGHPEAK + lightball_hover_basez + LIGHTBALL_HOVER_LOWPEAK) / 2) * sin(lightball_hoverangle * (12.568f / 360.0f)) * 0.1f; } else { //No ceiling. //TODO: Float higher? //my->z = lightball_hover_basez - 4 + ((lightball_hover_basez + LIGHTBALL_HOVER_HIGHPEAK - 4 + lightball_hover_basez + LIGHTBALL_HOVER_LOWPEAK - 4) / 2) * sin(lightball_hoverangle * (12.568f / 360.0f)) * 0.1f; my->z = lightball_hover_basez + ((lightball_hover_basez + LIGHTBALL_HOVER_HIGHPEAK + lightball_hover_basez + LIGHTBALL_HOVER_LOWPEAK) / 2) * sin(lightball_hoverangle * (12.568f / 360.0f)) * 0.1f; } lightball_hoverangle += 1; //Lightball moving. //messagePlayer(0, "*"); Entity* parent = uidToEntity(my->parent); if ( !parent ) { return; } double distance = sqrt(pow(my->x - parent->x, 2) + pow(my->y - parent->y, 2)); if ( distance > MAGICLIGHT_BALL_FOLLOW_DISTANCE || my->path) { lightball_player_lastmove_timer = 0; if (lightball_movement_timer > 0) { lightball_movement_timer--; } else { //messagePlayer(0, "****Moving."); double tangent = atan2(parent->y - my->y, parent->x - my->x); lineTraceTarget(my, my->x, my->y, tangent, 1024, IGNORE_ENTITIES, false, parent); if ( !hit.entity || hit.entity == parent ) //Line of sight to caster? { if (my->path != NULL) { list_FreeAll(my->path); my->path = NULL; } //double tangent = atan2(parent->y - my->y, parent->x - my->x); my->vel_x = cos(tangent) * ((distance - MAGICLIGHT_BALL_FOLLOW_DISTANCE) / MAGICLIGHTBALL_DIVIDE_CONSTANT); my->vel_y = sin(tangent) * ((distance - MAGICLIGHT_BALL_FOLLOW_DISTANCE) / MAGICLIGHTBALL_DIVIDE_CONSTANT); my->x += (my->vel_x < MAGIC_LIGHTBALL_SPEEDLIMIT) ? my->vel_x : MAGIC_LIGHTBALL_SPEEDLIMIT; my->y += (my->vel_y < MAGIC_LIGHTBALL_SPEEDLIMIT) ? my->vel_y : MAGIC_LIGHTBALL_SPEEDLIMIT; //} else if (!map.tiles[(int)(OBSTACLELAYER + (my->y / 16) * MAPLAYERS + (my->x / 16) * MAPLAYERS * map.height)]) { //If not in wall.. } else { //messagePlayer(0, "******Pathfinding."); //Caster is not in line of sight. Calculate a move path. /*if (my->children->first != NULL) { list_RemoveNode(my->children->first); my->children->first = NULL; }*/ if (!my->path) { //messagePlayer(0, "[Light ball] Generating path."); list_t* path = generatePath((int)floor(my->x / 16), (int)floor(my->y / 16), (int)floor(parent->x / 16), (int)floor(parent->y / 16), my, parent); if ( path != NULL ) { my->path = path; } else { //messagePlayer(0, "[Light ball] Failed to generate path (%s line %d).", __FILE__, __LINE__); } } if (my->path) { double total_distance = 0; //Calculate the total distance to the player to get the right move speed. double prevx = my->x; double prevy = my->y; if (my->path != NULL) { for (node = my->path->first; node != NULL; node = node->next) { if (node->element) { pathnode = (pathnode_t*)node->element; //total_distance += sqrt(pow(pathnode->y - prevy, 2) + pow(pathnode->x - prevx, 2) ); total_distance += sqrt(pow(prevx - pathnode->x, 2) + pow(prevy - pathnode->y, 2) ); prevx = pathnode->x; prevy = pathnode->y; } } } else if (my->path) //If the path has been traversed, reset it. { list_FreeAll(my->path); my->path = NULL; } total_distance -= MAGICLIGHT_BALL_FOLLOW_DISTANCE; if (my->path != NULL) { if (my->path->first != NULL) { pathnode = (pathnode_t*)my->path->first->element; //double distance = sqrt(pow(pathnode->y * 16 + 8 - my->y, 2) + pow(pathnode->x * 16 + 8 - my->x, 2) ); //double distance = sqrt(pow((my->y) - ((pathnode->y + 8) * 16), 2) + pow((my->x) - ((pathnode->x + 8) * 16), 2)); double distance = sqrt(pow(((pathnode->y * 16) + 8) - (my->y), 2) + pow(((pathnode->x * 16) + 8) - (my->x), 2)); if (distance <= 4) { list_RemoveNode(pathnode->node); //TODO: Make sure it doesn't get stuck here. Maybe remove the node only if it's the last one? if (!my->path->first) { list_FreeAll(my->path); my->path = NULL; } } else { double target_tangent = atan2((pathnode->y * 16) + 8 - my->y, (pathnode->x * 16) + 8 - my->x); if (target_tangent > my->yaw) //TODO: Do this yaw thing for all movement. { my->yaw = (target_tangent >= my->yaw + MAGIC_LIGHTBALL_TURNSPEED) ? my->yaw + MAGIC_LIGHTBALL_TURNSPEED : target_tangent; } else if (target_tangent < my->yaw) { my->yaw = (target_tangent <= my->yaw - MAGIC_LIGHTBALL_TURNSPEED) ? my->yaw - MAGIC_LIGHTBALL_TURNSPEED : target_tangent; } my->vel_x = cos(my->yaw) * (total_distance / MAGICLIGHTBALL_DIVIDE_CONSTANT); my->vel_y = sin(my->yaw) * (total_distance / MAGICLIGHTBALL_DIVIDE_CONSTANT); my->x += (my->vel_x < MAGIC_LIGHTBALL_SPEEDLIMIT) ? my->vel_x : MAGIC_LIGHTBALL_SPEEDLIMIT; my->y += (my->vel_y < MAGIC_LIGHTBALL_SPEEDLIMIT) ? my->vel_y : MAGIC_LIGHTBALL_SPEEDLIMIT; } } } //else assertion error, hehehe } else //Path failed to generate. Fallback on moving straight to the player. { //messagePlayer(0, "**************NO PATH WHEN EXPECTED PATH."); my->vel_x = cos(tangent) * ((distance) / MAGICLIGHTBALL_DIVIDE_CONSTANT); my->vel_y = sin(tangent) * ((distance) / MAGICLIGHTBALL_DIVIDE_CONSTANT); my->x += (my->vel_x < MAGIC_LIGHTBALL_SPEEDLIMIT) ? my->vel_x : MAGIC_LIGHTBALL_SPEEDLIMIT; my->y += (my->vel_y < MAGIC_LIGHTBALL_SPEEDLIMIT) ? my->vel_y : MAGIC_LIGHTBALL_SPEEDLIMIT; } } /*else { //In a wall. Get out of it. double tangent = atan2(parent->y - my->y, parent->x - my->x); my->vel_x = cos(tangent) * ((distance) / 100); my->vel_y = sin(tangent) * ((distance) / 100); my->x += my->vel_x; my->y += my->vel_y; }*/ } } else { lightball_movement_timer = LIGHTBALL_MOVE_DELAY; /*if (lightball_player_lastmove_timer < LIGHTBALL_CIRCLE_TIME) { lightball_player_lastmove_timer++; } else { //TODO: Orbit the player. Maybe. my->x = parent->x + (lightball_orbit_length * cos(lightball_orbit_angle)); my->y = parent->y + (lightball_orbit_length * sin(lightball_orbit_angle)); lightball_orbit_angle++; if (lightball_orbit_angle > 360) { lightball_orbit_angle = 0; } }*/ if (my->path != NULL) { list_FreeAll(my->path); my->path = NULL; } if (map.tiles[(int)(OBSTACLELAYER + (my->y / 16) * MAPLAYERS + (my->x / 16) * MAPLAYERS * map.height)]) //If the ball has come to rest in a wall, move its butt. { double tangent = atan2(parent->y - my->y, parent->x - my->x); my->vel_x = cos(tangent) * ((distance) / MAGICLIGHTBALL_DIVIDE_CONSTANT); my->vel_y = sin(tangent) * ((distance) / MAGICLIGHTBALL_DIVIDE_CONSTANT); my->x += my->vel_x; my->y += my->vel_y; } } //Light up the area. my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 192); if ( flickerLights ) { //Magic light ball will never flicker if this setting is disabled. lightball_flicker++; } if (lightball_flicker > 5) { lightball_lighting = (lightball_lighting == 1) + 1; if (lightball_lighting == 1) { my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 192); } else { my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 174); } lightball_flicker = 0; } lightball_timer--; } else { //Init the lightball. That is, shoot out from the player. //Move out from the player. my->vel_x = cos(my->yaw) * 4; my->vel_y = sin(my->yaw) * 4; double dist = clipMove(&my->x, &my->y, my->vel_x, my->vel_y, my); unsigned int distance = sqrt(pow(my->x - lightball_player_startx, 2) + pow(my->y - lightball_player_starty, 2)); if (distance > MAGICLIGHT_BALL_FOLLOW_DISTANCE * 2 || dist != sqrt(my->vel_x * my->vel_x + my->vel_y * my->vel_y)) { magic_init = 1; my->sprite = 174; //Go from black ball to white ball. lightball_lighting = 1; lightball_movement_timer = 0; //Start off at 0 so that it moves towards the player as soon as it's created (since it's created farther away from the player). } } } void actMagicMissile(Entity* my) //TODO: Verify this function. { if (!my || !my->children.first || !my->children.first->element) { return; } spell_t* spell = (spell_t*)my->children.first->element; if (!spell) { return; } //node_t *node = NULL; spellElement_t* element = NULL; node_t* node = NULL; int i = 0; int c = 0; Entity* entity = NULL; double tangent; Entity* parent = uidToEntity(my->parent); if (magic_init) { my->removeLightField(); if ( multiplayer != CLIENT ) { //Handle the missile's life. MAGIC_LIFE++; if (MAGIC_LIFE >= MAGIC_MAXLIFE) { my->removeLightField(); list_RemoveNode(my->mynode); return; } if ( spell->ID == SPELL_CHARM_MONSTER || spell->ID == SPELL_ACID_SPRAY ) { Entity* caster = uidToEntity(spell->caster); if ( !caster ) { my->removeLightField(); list_RemoveNode(my->mynode); return; } } node = spell->elements.first; //element = (spellElement_t *) spell->elements->first->element; element = (spellElement_t*)node->element; Sint32 entityHealth = 0; double dist = 0.f; bool hitFromAbove = false; if ( (parent && parent->behavior == &actMagicTrapCeiling) || my->actmagicIsVertical == MAGIC_ISVERTICAL_Z ) { // moving vertically. my->z += my->vel_z; hitFromAbove = my->magicFallingCollision(); if ( !hitFromAbove ) { // nothing hit yet, let's keep trying... } } else if ( my->actmagicIsOrbiting != 0 ) { int turnRate = 4; if ( parent && my->actmagicIsOrbiting == 1 ) { my->yaw += 0.1; my->x = parent->x + my->actmagicOrbitDist * cos(my->yaw); my->y = parent->y + my->actmagicOrbitDist * sin(my->yaw); } else if ( my->actmagicIsOrbiting == 2 ) { my->yaw += 0.2; turnRate = 4; my->x = my->actmagicOrbitStationaryX + my->actmagicOrbitStationaryCurrentDist * cos(my->yaw); my->y = my->actmagicOrbitStationaryY + my->actmagicOrbitStationaryCurrentDist * sin(my->yaw); my->actmagicOrbitStationaryCurrentDist = std::min(my->actmagicOrbitStationaryCurrentDist + 0.5, static_cast<real_t>(my->actmagicOrbitDist)); } hitFromAbove = my->magicOrbitingCollision(); my->z += my->vel_z * my->actmagicOrbitVerticalDirection; if ( my->actmagicIsOrbiting == 2 ) { // we don't change direction, upwards we go! // target speed is actmagicOrbitVerticalSpeed. my->vel_z = std::min(my->actmagicOrbitVerticalSpeed, my->vel_z / 0.95); my->roll += (PI / 8) / (turnRate / my->vel_z) * my->actmagicOrbitVerticalDirection; my->roll = std::max(my->roll, -PI / 4); } else if ( my->z > my->actmagicOrbitStartZ ) { if ( my->actmagicOrbitVerticalDirection == 1 ) { my->vel_z = std::max(0.01, my->vel_z * 0.95); my->roll -= (PI / 8) / (turnRate / my->vel_z) * my->actmagicOrbitVerticalDirection; } else { my->vel_z = std::min(my->actmagicOrbitVerticalSpeed, my->vel_z / 0.95); my->roll += (PI / 8) / (turnRate / my->vel_z) * my->actmagicOrbitVerticalDirection; } } else { if ( my->actmagicOrbitVerticalDirection == 1 ) { my->vel_z = std::min(my->actmagicOrbitVerticalSpeed, my->vel_z / 0.95); my->roll += (PI / 8) / (turnRate / my->vel_z) * my->actmagicOrbitVerticalDirection; } else { my->vel_z = std::max(0.01, my->vel_z * 0.95); my->roll -= (PI / 8) / (turnRate / my->vel_z) * my->actmagicOrbitVerticalDirection; } } if ( my->actmagicIsOrbiting == 1 ) { if ( (my->z > my->actmagicOrbitStartZ + 4) && my->actmagicOrbitVerticalDirection == 1 ) { my->actmagicOrbitVerticalDirection = -1; } else if ( (my->z < my->actmagicOrbitStartZ - 4) && my->actmagicOrbitVerticalDirection != 1 ) { my->actmagicOrbitVerticalDirection = 1; } } } else { if ( my->actmagicIsVertical == MAGIC_ISVERTICAL_XYZ ) { // moving vertically and horizontally, check if we hit the floor my->z += my->vel_z; hitFromAbove = my->magicFallingCollision(); dist = clipMove(&my->x, &my->y, my->vel_x, my->vel_y, my); if ( !hitFromAbove && my->z > -5 ) { // if we didn't hit the floor, process normal horizontal movement collision if we aren't too high if ( dist != sqrt(my->vel_x * my->vel_x + my->vel_y * my->vel_y) ) { hitFromAbove = true; } } if ( my->actmagicProjectileArc > 0 ) { real_t z = -1 - my->z; if ( z > 0 ) { my->pitch = -atan(z * 0.1 / sqrt(my->vel_x * my->vel_x + my->vel_y * my->vel_y)); } else { my->pitch = -atan(z * 0.15 / sqrt(my->vel_x * my->vel_x + my->vel_y * my->vel_y)); } if ( my->actmagicProjectileArc == 1 ) { //messagePlayer(0, "z: %f vel: %f", my->z, my->vel_z); my->vel_z = my->vel_z * 0.9; if ( my->vel_z > -0.1 ) { //messagePlayer(0, "arc down"); my->actmagicProjectileArc = 2; my->vel_z = 0.01; } } else if ( my->actmagicProjectileArc == 2 ) { //messagePlayer(0, "z: %f vel: %f", my->z, my->vel_z); my->vel_z = std::min(0.8, my->vel_z * 1.2); } } } else { dist = clipMove(&my->x, &my->y, my->vel_x, my->vel_y, my); //normal flat projectiles } } if ( hitFromAbove || (my->actmagicIsVertical != MAGIC_ISVERTICAL_XYZ && dist != sqrt(my->vel_x * my->vel_x + my->vel_y * my->vel_y)) ) { node = element->elements.first; //element = (spellElement_t *) element->elements->first->element; element = (spellElement_t*)node->element; //if (hit.entity != NULL) { Stat* hitstats = nullptr; int player = -1; if ( hit.entity ) { hitstats = hit.entity->getStats(); if ( hit.entity->behavior == &actPlayer ) { bool skipMessage = false; if ( !(svFlags & SV_FLAG_FRIENDLYFIRE) && my->actmagicTinkerTrapFriendlyFire == 0 ) { if ( parent && (parent->behavior == &actMonster || parent->behavior == &actPlayer) && parent->checkFriend(hit.entity) ) { skipMessage = true; } } player = hit.entity->skill[2]; if ( my->actmagicCastByTinkerTrap == 1 ) { skipMessage = true; } if ( !skipMessage ) { Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 0); messagePlayerColor(player, color, language[376]); } if ( hitstats ) { entityHealth = hitstats->HP; } } if ( parent && hitstats ) { if ( parent->behavior == &actPlayer ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( strcmp(element->name, spellElement_charmMonster.name) ) { if ( my->actmagicCastByTinkerTrap == 1 ) { //messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[3498], language[3499], MSG_COMBAT); } else { messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[378], language[377], MSG_COMBAT); } } } } } // Handling reflecting the missile int reflection = 0; if ( hitstats ) { if ( !strcmp(map.name, "Hell Boss") && hit.entity->behavior == &actPlayer ) { /* no longer in use */ /*bool founddevil = false; node_t* tempNode; for ( tempNode = map.creatures->first; tempNode != nullptr; tempNode = tempNode->next ) { Entity* tempEntity = (Entity*)tempNode->element; if ( tempEntity->behavior == &actMonster ) { Stat* stats = tempEntity->getStats(); if ( stats ) { if ( stats->type == DEVIL ) { founddevil = true; break; } } } } if ( !founddevil ) { reflection = 3; }*/ } else if ( parent && ( (hit.entity->getRace() == LICH_ICE && parent->getRace() == LICH_FIRE) || ( (hit.entity->getRace() == LICH_FIRE || hitstats->leader_uid == parent->getUID()) && parent->getRace() == LICH_ICE) || (parent->getRace() == LICH_ICE) && !strncmp(hitstats->name, "corrupted automaton", 19) ) ) { reflection = 3; } if ( !reflection ) { reflection = hit.entity->getReflection(); } if ( my->actmagicCastByTinkerTrap == 1 ) { reflection = 0; } if ( reflection == 3 && hitstats->shield && hitstats->shield->type == MIRROR_SHIELD && hitstats->defending ) { if ( my->actmagicIsVertical == MAGIC_ISVERTICAL_Z ) { reflection = 0; } // calculate facing angle to projectile, need to be facing projectile to reflect. else if ( player >= 0 && players[player] && players[player]->entity ) { real_t yawDiff = my->yawDifferenceFromPlayer(player); if ( yawDiff < (6 * PI / 5) ) { reflection = 0; } else { reflection = 3; if ( parent && (parent->behavior == &actMonster || parent->behavior == &actPlayer) ) { my->actmagicMirrorReflected = 1; my->actmagicMirrorReflectedCaster = parent->getUID(); } } } } } if ( reflection ) { spell_t* spellIsReflectingMagic = hit.entity->getActiveMagicEffect(SPELL_REFLECT_MAGIC); playSoundEntity(hit.entity, 166, 128); if ( hit.entity ) { if ( hit.entity->behavior == &actPlayer ) { if ( !strcmp(element->name, spellElement_charmMonster.name) ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[378], language[377], MSG_COMBAT); } if ( !spellIsReflectingMagic ) { messagePlayer(player, language[379]); } else { messagePlayer(player, language[2475]); } } } if ( parent ) { if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[379]); } } if ( hit.side == HORIZONTAL ) { my->vel_x *= -1; my->yaw = atan2(my->vel_y, my->vel_x); } else if ( hit.side == VERTICAL ) { my->vel_y *= -1; my->yaw = atan2(my->vel_y, my->vel_x); } else if ( hit.side == 0 ) { my->vel_x *= -1; my->vel_y *= -1; my->yaw = atan2(my->vel_y, my->vel_x); } if ( hit.entity ) { if ( (parent && parent->behavior == &actMagicTrapCeiling) || my->actmagicIsVertical == MAGIC_ISVERTICAL_Z ) { // this missile came from the ceiling, let's redirect it.. my->x = hit.entity->x + cos(hit.entity->yaw); my->y = hit.entity->y + sin(hit.entity->yaw); my->yaw = hit.entity->yaw; my->z = -1; my->vel_x = 4 * cos(hit.entity->yaw); my->vel_y = 4 * sin(hit.entity->yaw); my->vel_z = 0; my->pitch = 0; } my->parent = hit.entity->getUID(); } // Only degrade the equipment if Friendly Fire is ON or if it is (OFF && target is an enemy) bool bShouldEquipmentDegrade = false; if ( (svFlags & SV_FLAG_FRIENDLYFIRE) ) { // Friendly Fire is ON, equipment should always degrade, as hit will register bShouldEquipmentDegrade = true; } else { // Friendly Fire is OFF, is the target an enemy? if ( parent != nullptr && (parent->checkFriend(hit.entity)) == false ) { // Target is an enemy, equipment should degrade bShouldEquipmentDegrade = true; } } if ( bShouldEquipmentDegrade ) { // Reflection of 3 does not degrade equipment if ( rand() % 2 == 0 && hitstats && reflection < 3 ) { // set armornum to the relevant equipment slot to send to clients int armornum = 5 + reflection; if ( (player >= 0 && players[player]->isLocalPlayer()) || player < 0 ) { if ( reflection == 1 ) { if ( hitstats->cloak->count > 1 ) { newItem(hitstats->cloak->type, hitstats->cloak->status, hitstats->cloak->beatitude, hitstats->cloak->count - 1, hitstats->cloak->appearance, hitstats->cloak->identified, &hitstats->inventory); } } else if ( reflection == 2 ) { if ( hitstats->amulet->count > 1 ) { newItem(hitstats->amulet->type, hitstats->amulet->status, hitstats->amulet->beatitude, hitstats->amulet->count - 1, hitstats->amulet->appearance, hitstats->amulet->identified, &hitstats->inventory); } } else if ( reflection == -1 ) { if ( hitstats->shield->count > 1 ) { newItem(hitstats->shield->type, hitstats->shield->status, hitstats->shield->beatitude, hitstats->shield->count - 1, hitstats->shield->appearance, hitstats->shield->identified, &hitstats->inventory); } } } if ( reflection == 1 ) { hitstats->cloak->count = 1; hitstats->cloak->status = static_cast<Status>(std::max(static_cast<int>(BROKEN), hitstats->cloak->status - 1)); if ( hitstats->cloak->status != BROKEN ) { messagePlayer(player, language[380]); } else { messagePlayer(player, language[381]); playSoundEntity(hit.entity, 76, 64); } } else if ( reflection == 2 ) { hitstats->amulet->count = 1; hitstats->amulet->status = static_cast<Status>(std::max(static_cast<int>(BROKEN), hitstats->amulet->status - 1)); if ( hitstats->amulet->status != BROKEN ) { messagePlayer(player, language[382]); } else { messagePlayer(player, language[383]); playSoundEntity(hit.entity, 76, 64); } } else if ( reflection == -1 ) { hitstats->shield->count = 1; hitstats->shield->status = static_cast<Status>(std::max(static_cast<int>(BROKEN), hitstats->shield->status - 1)); if ( hitstats->shield->status != BROKEN ) { messagePlayer(player, language[384]); } else { messagePlayer(player, language[385]); playSoundEntity(hit.entity, 76, 64); } } if ( player > 0 && multiplayer == SERVER ) { strcpy((char*)net_packet->data, "ARMR"); net_packet->data[4] = armornum; if ( reflection == 1 ) { net_packet->data[5] = hitstats->cloak->status; } else if ( reflection == 2 ) { net_packet->data[5] = hitstats->amulet->status; } else { net_packet->data[5] = hitstats->shield->status; } net_packet->address.host = net_clients[player - 1].host; net_packet->address.port = net_clients[player - 1].port; net_packet->len = 6; sendPacketSafe(net_sock, -1, net_packet, player - 1); } } } if ( spellIsReflectingMagic ) { int spellCost = getCostOfSpell(spell); bool unsustain = false; if ( spellCost >= hit.entity->getMP() ) //Unsustain the spell if expended all mana. { unsustain = true; } hit.entity->drainMP(spellCost); spawnMagicEffectParticles(hit.entity->x, hit.entity->y, hit.entity->z / 2, 174); playSoundEntity(hit.entity, 166, 128); //TODO: Custom sound effect? if ( unsustain ) { spellIsReflectingMagic->sustain = false; if ( hitstats ) { hit.entity->setEffect(EFF_MAGICREFLECT, false, 0, true); messagePlayer(player, language[2476]); } } } return; } // Test for Friendly Fire, if Friendly Fire is OFF, delete the missile if ( !(svFlags & SV_FLAG_FRIENDLYFIRE) ) { if ( !strcmp(element->name, spellElement_telePull.name) || !strcmp(element->name, spellElement_shadowTag.name) || my->actmagicTinkerTrapFriendlyFire == 1 ) { // these spells can hit allies no penalty. } else if ( parent && parent->checkFriend(hit.entity) ) { my->removeLightField(); list_RemoveNode(my->mynode); return; } } // Alerting the hit Entity if ( hit.entity ) { // alert the hit entity if it was a monster if ( hit.entity->behavior == &actMonster && parent != nullptr ) { if ( parent->behavior == &actMagicTrap || parent->behavior == &actMagicTrapCeiling ) { if ( parent->behavior == &actMagicTrap ) { if ( static_cast<int>(parent->y / 16) == static_cast<int>(hit.entity->y / 16) ) { // avoid y axis. int direction = 1; if ( rand() % 2 == 0 ) { direction = -1; } if ( hit.entity->monsterSetPathToLocation(hit.entity->x / 16, (hit.entity->y / 16) + 1 * direction, 0) ) { hit.entity->monsterState = MONSTER_STATE_HUNT; serverUpdateEntitySkill(hit.entity, 0); } else if ( hit.entity->monsterSetPathToLocation(hit.entity->x / 16, (hit.entity->y / 16) - 1 * direction, 0) ) { hit.entity->monsterState = MONSTER_STATE_HUNT; serverUpdateEntitySkill(hit.entity, 0); } else { monsterMoveAside(hit.entity, hit.entity); } } else if ( static_cast<int>(parent->x / 16) == static_cast<int>(hit.entity->x / 16) ) { int direction = 1; if ( rand() % 2 == 0 ) { direction = -1; } // avoid x axis. if ( hit.entity->monsterSetPathToLocation((hit.entity->x / 16) + 1 * direction, hit.entity->y / 16, 0) ) { hit.entity->monsterState = MONSTER_STATE_HUNT; serverUpdateEntitySkill(hit.entity, 0); } else if ( hit.entity->monsterSetPathToLocation((hit.entity->x / 16) - 1 * direction, hit.entity->y / 16, 0) ) { hit.entity->monsterState = MONSTER_STATE_HUNT; serverUpdateEntitySkill(hit.entity, 0); } else { monsterMoveAside(hit.entity, hit.entity); } } else { monsterMoveAside(hit.entity, hit.entity); } } else { monsterMoveAside(hit.entity, hit.entity); } } else { bool alertTarget = true; bool alertAllies = true; if ( parent->behavior == &actMonster && parent->monsterAllyIndex != -1 ) { if ( hit.entity->behavior == &actMonster && hit.entity->monsterAllyIndex != -1 ) { // if a player ally + hit another ally, don't aggro back alertTarget = false; } } if ( !strcmp(element->name, spellElement_telePull.name) || !strcmp(element->name, spellElement_shadowTag.name) ) { alertTarget = false; alertAllies = false; } if ( my->actmagicCastByTinkerTrap == 1 ) { if ( entityDist(hit.entity, parent) > TOUCHRANGE ) { // don't alert if bomb thrower far away. alertTarget = false; alertAllies = false; } } if ( alertTarget && hit.entity->monsterState != MONSTER_STATE_ATTACK && (hitstats->type < LICH || hitstats->type >= SHOPKEEPER) ) { hit.entity->monsterAcquireAttackTarget(*parent, MONSTER_STATE_PATH, true); } if ( parent->behavior == &actPlayer || parent->monsterAllyIndex != -1 ) { if ( hit.entity->behavior == &actPlayer || (hit.entity->behavior == &actMonster && hit.entity->monsterAllyIndex != -1) ) { // if a player ally + hit another ally or player, don't alert other allies. alertAllies = false; } } // alert other monsters too Entity* ohitentity = hit.entity; for ( node = map.creatures->first; node != nullptr && alertAllies; node = node->next ) { entity = (Entity*)node->element; if ( entity->behavior == &actMonster && entity != ohitentity ) { Stat* buddystats = entity->getStats(); if ( buddystats != nullptr ) { if ( hit.entity && hit.entity->checkFriend(entity) ) //TODO: hit.entity->checkFriend() without first checking if it's NULL crashes because hit.entity turns to NULL somewhere along the line. It looks like ohitentity preserves that value though, so....uh...ya, I don't know. { if ( entity->monsterState == MONSTER_STATE_WAIT ) { tangent = atan2( entity->y - ohitentity->y, entity->x - ohitentity->x ); lineTrace(ohitentity, ohitentity->x, ohitentity->y, tangent, 1024, 0, false); if ( hit.entity == entity ) { entity->monsterAcquireAttackTarget(*parent, MONSTER_STATE_PATH); } } } } } } hit.entity = ohitentity; } } } // check for magic resistance... // resistance stacks diminishingly //TODO: EFFECTS[EFF_MAGICRESIST] int resistance = 0; if ( hit.entity ) { resistance = hit.entity->getMagicResistance(); } if ( resistance > 0 ) { if ( parent ) { if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[386]); } } } real_t spellbookDamageBonus = (my->actmagicSpellbookBonus / 100.f); if ( my->actmagicCastByMagicstaff == 0 && my->actmagicCastByTinkerTrap == 0 ) { spellbookDamageBonus += getBonusFromCasterOfSpellElement(parent, element); } if (!strcmp(element->name, spellElement_force.name)) { if (hit.entity) { if (hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer) { Entity* parent = uidToEntity(my->parent); playSoundEntity(hit.entity, 28, 128); int damage = element->damage; damage += (spellbookDamageBonus * damage); //damage += ((element->mana - element->base_mana) / static_cast<double>(element->overload_multiplier)) * element->damage; damage *= hit.entity->getDamageTableMultiplier(*hitstats, DAMAGE_TABLE_MAGIC); damage /= (1 + (int)resistance); hit.entity->modHP(-damage); for (i = 0; i < damage; i += 2) //Spawn a gib for every two points of damage. { Entity* gib = spawnGib(hit.entity); serverSpawnGibForClient(gib); } if (parent) { parent->killedByMonsterObituary(hit.entity); } // update enemy bar for attacker if ( !strcmp(hitstats->name, "") ) { if ( hitstats->type < KOBOLD ) //Original monster count { updateEnemyBar(parent, hit.entity, language[90 + hitstats->type], hitstats->HP, hitstats->MAXHP); } else if ( hitstats->type >= KOBOLD ) //New monsters { updateEnemyBar(parent, hit.entity, language[2000 + (hitstats->type - KOBOLD)], hitstats->HP, hitstats->MAXHP); } } else { updateEnemyBar(parent, hit.entity, hitstats->name, hitstats->HP, hitstats->MAXHP); } if ( hitstats->HP <= 0 && parent) { parent->awardXP( hit.entity, true, true ); } } else if (hit.entity->behavior == &actDoor) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1 + (int)resistance); hit.entity->doorHandleDamageMagic(damage, *my, parent); my->removeLightField(); list_RemoveNode(my->mynode); return; } else if ( hit.entity->behavior == &actChest ) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1 + (int)resistance); hit.entity->chestHandleDamageMagic(damage, *my, parent); my->removeLightField(); list_RemoveNode(my->mynode); return; } else if (hit.entity->behavior == &actFurniture ) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1 + (int)resistance); hit.entity->furnitureHealth -= damage; if ( hit.entity->furnitureHealth < 0 ) { if ( parent ) { if ( parent->behavior == &actPlayer ) { switch ( hit.entity->furnitureType ) { case FURNITURE_CHAIR: messagePlayer(parent->skill[2], language[388]); updateEnemyBar(parent, hit.entity, language[677], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_TABLE: messagePlayer(parent->skill[2], language[389]); updateEnemyBar(parent, hit.entity, language[676], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_BED: messagePlayer(parent->skill[2], language[2508], language[2505]); updateEnemyBar(parent, hit.entity, language[2505], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_BUNKBED: messagePlayer(parent->skill[2], language[2508], language[2506]); updateEnemyBar(parent, hit.entity, language[2506], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_PODIUM: messagePlayer(parent->skill[2], language[2508], language[2507]); updateEnemyBar(parent, hit.entity, language[2507], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; default: break; } } } } playSoundEntity(hit.entity, 28, 128); } } } else if (!strcmp(element->name, spellElement_magicmissile.name)) { spawnExplosion(my->x, my->y, my->z); if (hit.entity) { if (hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer) { Entity* parent = uidToEntity(my->parent); playSoundEntity(hit.entity, 28, 128); int damage = element->damage; damage += (spellbookDamageBonus * damage); //damage += ((element->mana - element->base_mana) / static_cast<double>(element->overload_multiplier)) * element->damage; if ( my->actmagicIsOrbiting == 2 ) { spawnExplosion(my->x, my->y, my->z); if ( parent && my->actmagicOrbitCastFromSpell == 1 ) { // cast through amplify magic effect damage /= 2; } damage = damage - rand() % ((damage / 8) + 1); } damage *= hit.entity->getDamageTableMultiplier(*hitstats, DAMAGE_TABLE_MAGIC); damage /= (1 + (int)resistance); hit.entity->modHP(-damage); for (i = 0; i < damage; i += 2) //Spawn a gib for every two points of damage. { Entity* gib = spawnGib(hit.entity); serverSpawnGibForClient(gib); } // write the obituary if ( parent ) { parent->killedByMonsterObituary(hit.entity); } // update enemy bar for attacker if ( !strcmp(hitstats->name, "") ) { if ( hitstats->type < KOBOLD ) //Original monster count { updateEnemyBar(parent, hit.entity, language[90 + hitstats->type], hitstats->HP, hitstats->MAXHP); } else if ( hitstats->type >= KOBOLD ) //New monsters { updateEnemyBar(parent, hit.entity, language[2000 + (hitstats->type - KOBOLD)], hitstats->HP, hitstats->MAXHP); } } else { updateEnemyBar(parent, hit.entity, hitstats->name, hitstats->HP, hitstats->MAXHP); } if ( hitstats->HP <= 0 && parent) { parent->awardXP( hit.entity, true, true ); } } else if ( hit.entity->behavior == &actDoor ) { int damage = element->damage; damage += (spellbookDamageBonus * damage); //damage += ((element->mana - element->base_mana) / static_cast<double>(element->overload_multiplier)) * element->damage; damage /= (1 + (int)resistance); hit.entity->doorHandleDamageMagic(damage, *my, parent); if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } if ( !(my->actmagicIsOrbiting == 2) ) { my->removeLightField(); list_RemoveNode(my->mynode); } else { spawnExplosion(my->x, my->y, my->z); } return; } else if ( hit.entity->behavior == &actChest ) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1 + (int)resistance); hit.entity->chestHandleDamageMagic(damage, *my, parent); if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } if ( !(my->actmagicIsOrbiting == 2) ) { my->removeLightField(); list_RemoveNode(my->mynode); } else { spawnExplosion(my->x, my->y, my->z); } return; } else if (hit.entity->behavior == &actFurniture ) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1 + (int)resistance); hit.entity->furnitureHealth -= damage; if ( hit.entity->furnitureHealth < 0 ) { if ( parent ) { if ( parent->behavior == &actPlayer ) { switch ( hit.entity->furnitureType ) { case FURNITURE_CHAIR: messagePlayer(parent->skill[2], language[388]); updateEnemyBar(parent, hit.entity, language[677], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_TABLE: messagePlayer(parent->skill[2], language[389]); updateEnemyBar(parent, hit.entity, language[676], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_BED: messagePlayer(parent->skill[2], language[2508], language[2505]); updateEnemyBar(parent, hit.entity, language[2505], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_BUNKBED: messagePlayer(parent->skill[2], language[2508], language[2506]); updateEnemyBar(parent, hit.entity, language[2506], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_PODIUM: messagePlayer(parent->skill[2], language[2508], language[2507]); updateEnemyBar(parent, hit.entity, language[2507], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; default: break; } } } } playSoundEntity(hit.entity, 28, 128); if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } if ( !(my->actmagicIsOrbiting == 2) ) { my->removeLightField(); list_RemoveNode(my->mynode); } else { spawnExplosion(my->x, my->y, my->z); } return; } } } else if (!strcmp(element->name, spellElement_fire.name)) { if ( !(my->actmagicIsOrbiting == 2) ) { spawnExplosion(my->x, my->y, my->z); } if (hit.entity) { // Attempt to set the Entity on fire hit.entity->SetEntityOnFire(); if (hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer) { //playSoundEntity(my, 153, 64); playSoundEntity(hit.entity, 28, 128); //TODO: Apply fire resistances/weaknesses. int damage = element->damage; damage += (spellbookDamageBonus * damage); //damage += ((element->mana - element->base_mana) / static_cast<double>(element->overload_multiplier)) * element->damage; if ( my->actmagicIsOrbiting == 2 ) { spawnExplosion(my->x, my->y, my->z); if ( parent && my->actmagicOrbitCastFromSpell == 0 ) { if ( parent->behavior == &actParticleDot ) { damage = parent->skill[1]; } else if ( parent->behavior == &actPlayer ) { Stat* playerStats = parent->getStats(); if ( playerStats ) { int skillLVL = playerStats->PROFICIENCIES[PRO_ALCHEMY] / 20; damage = (14 + skillLVL * 1.5); } } else { damage = 14; } } else if ( parent && my->actmagicOrbitCastFromSpell == 1 ) { // cast through amplify magic effect damage /= 2; } else { damage = 14; } damage = damage - rand() % ((damage / 8) + 1); } damage *= hit.entity->getDamageTableMultiplier(*hitstats, DAMAGE_TABLE_MAGIC); if ( parent ) { Stat* casterStats = parent->getStats(); if ( casterStats && casterStats->type == LICH_FIRE && parent->monsterLichAllyStatus == LICH_ALLY_DEAD ) { damage *= 2; } } int oldHP = hitstats->HP; damage /= (1 + (int)resistance); hit.entity->modHP(-damage); //for (i = 0; i < damage; i += 2) { //Spawn a gib for every two points of damage. Entity* gib = spawnGib(hit.entity); serverSpawnGibForClient(gib); //} // write the obituary if ( parent ) { if ( my->actmagicIsOrbiting == 2 && parent->behavior == &actParticleDot && parent->skill[1] > 0 ) { if ( hitstats && hitstats->obituary && !strcmp(hitstats->obituary, language[3898]) ) { // was caused by a flaming boulder. hit.entity->setObituary(language[3898]); } else { // blew the brew (alchemy) hit.entity->setObituary(language[3350]); } } else { parent->killedByMonsterObituary(hit.entity); } } if ( hitstats ) { hitstats->burningInflictedBy = static_cast<Sint32>(my->parent); } // update enemy bar for attacker if ( !strcmp(hitstats->name, "") ) { if ( hitstats->type < KOBOLD ) //Original monster count { updateEnemyBar(parent, hit.entity, language[90 + hitstats->type], hitstats->HP, hitstats->MAXHP); } else if ( hitstats->type >= KOBOLD ) //New monsters { updateEnemyBar(parent, hit.entity, language[2000 + (hitstats->type - KOBOLD)], hitstats->HP, hitstats->MAXHP); } } else { updateEnemyBar(parent, hit.entity, hitstats->name, hitstats->HP, hitstats->MAXHP); } if ( oldHP > 0 && hitstats->HP <= 0 ) { if ( parent ) { if ( my->actmagicIsOrbiting == 2 && my->actmagicOrbitCastFromSpell == 0 && parent->behavior == &actPlayer ) { if ( hitstats->type == LICH || hitstats->type == LICH_ICE || hitstats->type == LICH_FIRE ) { if ( client_classes[parent->skill[2]] == CLASS_BREWER ) { steamAchievementClient(parent->skill[2], "BARONY_ACH_SECRET_WEAPON"); } } steamStatisticUpdateClient(parent->skill[2], STEAM_STAT_BOMBARDIER, STEAM_STAT_INT, 1); } if ( my->actmagicCastByTinkerTrap == 1 && parent->behavior == &actPlayer && hitstats->type == MINOTAUR ) { steamAchievementClient(parent->skill[2], "BARONY_ACH_TIME_TO_PLAN"); } parent->awardXP( hit.entity, true, true ); } else { if ( achievementObserver.checkUidIsFromPlayer(my->parent) >= 0 ) { steamAchievementClient(achievementObserver.checkUidIsFromPlayer(my->parent), "BARONY_ACH_TAKING_WITH"); } } } } else if (hit.entity->behavior == &actDoor) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1 + (int)resistance); hit.entity->doorHandleDamageMagic(damage, *my, parent); if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } if ( !(my->actmagicIsOrbiting == 2) ) { my->removeLightField(); list_RemoveNode(my->mynode); } else { spawnExplosion(my->x, my->y, my->z); } return; } else if (hit.entity->behavior == &actChest) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1+(int)resistance); hit.entity->chestHandleDamageMagic(damage, *my, parent); if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } if ( !(my->actmagicIsOrbiting == 2) ) { my->removeLightField(); list_RemoveNode(my->mynode); } else { spawnExplosion(my->x, my->y, my->z); } return; } else if (hit.entity->behavior == &actFurniture ) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1 + (int)resistance); hit.entity->furnitureHealth -= damage; if ( hit.entity->furnitureHealth < 0 ) { if ( parent ) { if ( parent->behavior == &actPlayer ) { switch ( hit.entity->furnitureType ) { case FURNITURE_CHAIR: messagePlayer(parent->skill[2], language[388]); updateEnemyBar(parent, hit.entity, language[677], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_TABLE: messagePlayer(parent->skill[2], language[389]); updateEnemyBar(parent, hit.entity, language[676], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_BED: messagePlayer(parent->skill[2], language[2508], language[2505]); updateEnemyBar(parent, hit.entity, language[2505], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_BUNKBED: messagePlayer(parent->skill[2], language[2508], language[2506]); updateEnemyBar(parent, hit.entity, language[2506], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_PODIUM: messagePlayer(parent->skill[2], language[2508], language[2507]); updateEnemyBar(parent, hit.entity, language[2507], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; default: break; } } } } playSoundEntity(hit.entity, 28, 128); if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } if ( !(my->actmagicIsOrbiting == 2) ) { my->removeLightField(); list_RemoveNode(my->mynode); } else { spawnExplosion(my->x, my->y, my->z); } return; } } } else if (!strcmp(element->name, spellElement_confuse.name)) { if (hit.entity) { if (hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer) { playSoundEntity(hit.entity, 174, 64); hitstats->EFFECTS[EFF_CONFUSED] = true; hitstats->EFFECTS_TIMERS[EFF_CONFUSED] = (element->duration * (((element->mana) / static_cast<double>(element->base_mana)) * element->overload_multiplier)); hitstats->EFFECTS_TIMERS[EFF_CONFUSED] /= (1 + (int)resistance); // If the Entity hit is a Player, update their status to be Slowed if ( hit.entity->behavior == &actPlayer ) { serverUpdateEffects(hit.entity->skill[2]); } hit.entity->skill[1] = 0; //Remove the monster's target. if ( parent ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( parent->behavior == &actPlayer ) { messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[391], language[390], MSG_COMBAT); } } Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 0); if ( player >= 0 ) { messagePlayerColor(player, color, language[392]); } spawnMagicEffectParticles(hit.entity->x, hit.entity->y, hit.entity->z, my->sprite); } } } else if (!strcmp(element->name, spellElement_cold.name)) { playSoundEntity(my, 197, 128); if (hit.entity) { if (hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer) { playSoundEntity(hit.entity, 28, 128); hitstats->EFFECTS[EFF_SLOW] = true; hitstats->EFFECTS_TIMERS[EFF_SLOW] = (element->duration * (((element->mana) / static_cast<double>(element->base_mana)) * element->overload_multiplier)); hitstats->EFFECTS_TIMERS[EFF_SLOW] /= (1 + (int)resistance); // If the Entity hit is a Player, update their status to be Slowed if ( hit.entity->behavior == &actPlayer ) { serverUpdateEffects(hit.entity->skill[2]); } int damage = element->damage; damage += (spellbookDamageBonus * damage); //messagePlayer(0, "damage: %d", damage); if ( my->actmagicIsOrbiting == 2 ) { if ( parent && my->actmagicOrbitCastFromSpell == 0 ) { if ( parent->behavior == &actParticleDot ) { damage = parent->skill[1]; } else if ( parent->behavior == &actPlayer ) { Stat* playerStats = parent->getStats(); if ( playerStats ) { int skillLVL = playerStats->PROFICIENCIES[PRO_ALCHEMY] / 20; damage = (18 + skillLVL * 1.5); } } else { damage = 18; } } else if ( parent && my->actmagicOrbitCastFromSpell == 1 ) { // cast through amplify magic effect damage /= 2; } else { damage = 18; } damage = damage - rand() % ((damage / 8) + 1); } //damage += ((element->mana - element->base_mana) / static_cast<double>(element->overload_multiplier)) * element->damage; int oldHP = hitstats->HP; damage *= hit.entity->getDamageTableMultiplier(*hitstats, DAMAGE_TABLE_MAGIC); damage /= (1 + (int)resistance); hit.entity->modHP(-damage); Entity* gib = spawnGib(hit.entity); serverSpawnGibForClient(gib); // write the obituary if ( parent ) { parent->killedByMonsterObituary(hit.entity); } // update enemy bar for attacker if ( !strcmp(hitstats->name, "") ) { if ( hitstats->type < KOBOLD ) //Original monster count { updateEnemyBar(parent, hit.entity, language[90 + hitstats->type], hitstats->HP, hitstats->MAXHP); } else if ( hitstats->type >= KOBOLD ) //New monsters { updateEnemyBar(parent, hit.entity, language[2000 + (hitstats->type - KOBOLD)], hitstats->HP, hitstats->MAXHP); } } else { updateEnemyBar(parent, hit.entity, hitstats->name, hitstats->HP, hitstats->MAXHP); } if ( parent ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( parent->behavior == &actPlayer ) { messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[394], language[393], MSG_COMBAT); } } Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 0); if ( player >= 0 ) { messagePlayerColor(player, color, language[395]); } spawnMagicEffectParticles(hit.entity->x, hit.entity->y, hit.entity->z, my->sprite); if ( oldHP > 0 && hitstats->HP <= 0 ) { if ( parent ) { parent->awardXP(hit.entity, true, true); if ( my->actmagicIsOrbiting == 2 && my->actmagicOrbitCastFromSpell == 0 && parent->behavior == &actPlayer ) { if ( hitstats->type == LICH || hitstats->type == LICH_ICE || hitstats->type == LICH_FIRE ) { if ( client_classes[parent->skill[2]] == CLASS_BREWER ) { steamAchievementClient(parent->skill[2], "BARONY_ACH_SECRET_WEAPON"); } } steamStatisticUpdateClient(parent->skill[2], STEAM_STAT_BOMBARDIER, STEAM_STAT_INT, 1); } if ( my->actmagicCastByTinkerTrap == 1 && parent->behavior == &actPlayer && hitstats->type == MINOTAUR ) { steamAchievementClient(parent->skill[2], "BARONY_ACH_TIME_TO_PLAN"); } } else { if ( achievementObserver.checkUidIsFromPlayer(my->parent) >= 0 ) { steamAchievementClient(achievementObserver.checkUidIsFromPlayer(my->parent), "BARONY_ACH_TAKING_WITH"); } } } } } } else if (!strcmp(element->name, spellElement_slow.name)) { if (hit.entity) { if (hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer) { playSoundEntity(hit.entity, 396 + rand() % 3, 64); hitstats->EFFECTS[EFF_SLOW] = true; hitstats->EFFECTS_TIMERS[EFF_SLOW] = (element->duration * (((element->mana) / static_cast<double>(element->base_mana)) * element->overload_multiplier)); hitstats->EFFECTS_TIMERS[EFF_SLOW] /= (1 + (int)resistance); // If the Entity hit is a Player, update their status to be Slowed if ( hit.entity->behavior == &actPlayer ) { serverUpdateEffects(hit.entity->skill[2]); } // update enemy bar for attacker if ( parent ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( parent->behavior == &actPlayer ) { messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[394], language[393], MSG_COMBAT); } } Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 0); if ( player >= 0 ) { messagePlayerColor(player, color, language[395]); } spawnMagicEffectParticles(hit.entity->x, hit.entity->y, hit.entity->z, my->sprite); } } } else if (!strcmp(element->name, spellElement_sleep.name)) { if (hit.entity) { if (hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer) { playSoundEntity(hit.entity, 174, 64); int effectDuration = 0; if ( parent && parent->behavior == &actMagicTrapCeiling ) { effectDuration = 200 + rand() % 150; // 4 seconds + 0 to 3 seconds. } else { effectDuration = 600 + rand() % 300; // 12 seconds + 0 to 6 seconds. if ( hitstats ) { effectDuration = std::max(0, effectDuration - ((hitstats->CON % 10) * 50)); // reduce 1 sec every 10 CON. } } effectDuration /= (1 + (int)resistance); bool magicTrapReapplySleep = true; if ( parent && (parent->behavior == &actMagicTrap || parent->behavior == &actMagicTrapCeiling) ) { if ( hitstats && hitstats->EFFECTS[EFF_ASLEEP] ) { // check to see if we're reapplying the sleep effect. int preventSleepRoll = rand() % 4 - resistance; if ( hit.entity->behavior == &actPlayer || (preventSleepRoll <= 0) ) { magicTrapReapplySleep = false; //messagePlayer(0, "Target already asleep!"); } } } if ( magicTrapReapplySleep ) { if ( hit.entity->setEffect(EFF_ASLEEP, true, effectDuration, false) ) { hitstats->OLDHP = hitstats->HP; if ( hit.entity->behavior == &actPlayer ) { serverUpdateEffects(hit.entity->skill[2]); Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 0); messagePlayerColor(hit.entity->skill[2], color, language[396]); } if ( parent ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( parent->behavior == &actPlayer ) { messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[398], language[397], MSG_COMBAT); } } } else { if ( parent ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( parent->behavior == &actPlayer ) { messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[2905], language[2906], MSG_COMBAT); } } } } spawnMagicEffectParticles(hit.entity->x, hit.entity->y, hit.entity->z, my->sprite); } } } else if (!strcmp(element->name, spellElement_lightning.name)) { playSoundEntity(my, 173, 128); if (hit.entity) { if (hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer) { Entity* parent = uidToEntity(my->parent); playSoundEntity(my, 173, 64); playSoundEntity(hit.entity, 28, 128); int damage = element->damage; damage += (spellbookDamageBonus * damage); if ( my->actmagicIsOrbiting == 2 ) { if ( parent && my->actmagicOrbitCastFromSpell == 0 ) { if ( parent->behavior == &actParticleDot ) { damage = parent->skill[1]; } else if ( parent->behavior == &actPlayer ) { Stat* playerStats = parent->getStats(); if ( playerStats ) { int skillLVL = playerStats->PROFICIENCIES[PRO_ALCHEMY] / 20; damage = (22 + skillLVL * 1.5); } } else { damage = 22; } } else if ( parent && my->actmagicOrbitCastFromSpell == 1 ) { // cast through amplify magic effect damage /= 2; } else { damage = 22; } damage = damage - rand() % ((damage / 8) + 1); } //damage += ((element->mana - element->base_mana) / static_cast<double>(element->overload_multiplier)) * element->damage; int oldHP = hitstats->HP; damage *= hit.entity->getDamageTableMultiplier(*hitstats, DAMAGE_TABLE_MAGIC); damage /= (1 + (int)resistance); hit.entity->modHP(-damage); // write the obituary if (parent) { parent->killedByMonsterObituary(hit.entity); } // update enemy bar for attacker if ( !strcmp(hitstats->name, "") ) { if ( hitstats->type < KOBOLD ) //Original monster count { updateEnemyBar(parent, hit.entity, language[90 + hitstats->type], hitstats->HP, hitstats->MAXHP); } else if ( hitstats->type >= KOBOLD ) //New monsters { updateEnemyBar(parent, hit.entity, language[2000 + (hitstats->type - KOBOLD)], hitstats->HP, hitstats->MAXHP); } } else { updateEnemyBar(parent, hit.entity, hitstats->name, hitstats->HP, hitstats->MAXHP); } if ( oldHP > 0 && hitstats->HP <= 0 && parent) { parent->awardXP( hit.entity, true, true ); if ( my->actmagicIsOrbiting == 2 && my->actmagicOrbitCastFromSpell == 0 && parent->behavior == &actPlayer ) { if ( hitstats->type == LICH || hitstats->type == LICH_ICE || hitstats->type == LICH_FIRE ) { if ( client_classes[parent->skill[2]] == CLASS_BREWER ) { steamAchievementClient(parent->skill[2], "BARONY_ACH_SECRET_WEAPON"); } } steamStatisticUpdateClient(parent->skill[2], STEAM_STAT_BOMBARDIER, STEAM_STAT_INT, 1); } } } else if ( hit.entity->behavior == &actDoor ) { int damage = element->damage; damage += (spellbookDamageBonus * damage); //damage += ((element->mana - element->base_mana) / static_cast<double>(element->overload_multiplier)) * element->damage; damage /= (1 + (int)resistance); hit.entity->doorHandleDamageMagic(damage, *my, parent); if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } if ( !(my->actmagicIsOrbiting == 2) ) { my->removeLightField(); list_RemoveNode(my->mynode); } return; } else if ( hit.entity->behavior == &actChest ) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1 + (int)resistance); hit.entity->chestHandleDamageMagic(damage, *my, parent); if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } if ( !(my->actmagicIsOrbiting == 2) ) { my->removeLightField(); list_RemoveNode(my->mynode); } return; } else if (hit.entity->behavior == &actFurniture ) { int damage = element->damage; damage += (spellbookDamageBonus * damage); damage /= (1 + (int)resistance); hit.entity->furnitureHealth -= damage; if ( hit.entity->furnitureHealth < 0 ) { if ( parent ) { if ( parent->behavior == &actPlayer ) { switch ( hit.entity->furnitureType ) { case FURNITURE_CHAIR: messagePlayer(parent->skill[2], language[388]); updateEnemyBar(parent, hit.entity, language[677], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_TABLE: messagePlayer(parent->skill[2], language[389]); updateEnemyBar(parent, hit.entity, language[676], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_BED: messagePlayer(parent->skill[2], language[2508], language[2505]); updateEnemyBar(parent, hit.entity, language[2505], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_BUNKBED: messagePlayer(parent->skill[2], language[2508], language[2506]); updateEnemyBar(parent, hit.entity, language[2506], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; case FURNITURE_PODIUM: messagePlayer(parent->skill[2], language[2508], language[2507]); updateEnemyBar(parent, hit.entity, language[2507], hit.entity->furnitureHealth, hit.entity->furnitureMaxHealth); break; default: break; } } } } playSoundEntity(hit.entity, 28, 128); if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } } } } else if (!strcmp(element->name, spellElement_locking.name)) { if ( hit.entity ) { if (hit.entity->behavior == &actDoor) { if ( parent && parent->behavior == &actPlayer && MFLAG_DISABLEOPENING ) { Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 255); messagePlayerColor(parent->skill[2], 0xFFFFFFFF, language[3096], language[3097]); messagePlayerColor(parent->skill[2], color, language[3101]); // disabled locking spell. } else { playSoundEntity(hit.entity, 92, 64); hit.entity->skill[5] = 1; //Lock the door. if ( parent ) { if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[399]); } } } } else if (hit.entity->behavior == &actChest) { //Lock chest playSoundEntity(hit.entity, 92, 64); if ( !hit.entity->chestLocked ) { if ( parent && parent->behavior == &actPlayer && MFLAG_DISABLEOPENING ) { Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 255); messagePlayerColor(parent->skill[2], 0xFFFFFFFF, language[3096], language[3099]); messagePlayerColor(parent->skill[2], color, language[3100]); // disabled locking spell. } else { hit.entity->lockChest(); if ( parent ) { if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[400]); } } } } } else { if ( parent ) if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[401]); } if ( player >= 0 ) { messagePlayer(player, language[401]); } } spawnMagicEffectParticles(hit.entity->x, hit.entity->y, hit.entity->z, my->sprite); } } else if (!strcmp(element->name, spellElement_opening.name)) { if (hit.entity) { if (hit.entity->behavior == &actDoor) { if ( MFLAG_DISABLEOPENING || hit.entity->doorDisableOpening == 1 ) { if ( parent && parent->behavior == &actPlayer ) { Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 255); messagePlayerColor(parent->skill[2], 0xFFFFFFFF, language[3096], language[3097]); messagePlayerColor(parent->skill[2], color, language[3101]); // disabled opening spell. } } else { // Open the Door playSoundEntity(hit.entity, 91, 64); // "UnlockDoor.ogg" hit.entity->doorLocked = 0; // Unlocks the Door hit.entity->doorPreventLockpickExploit = 1; if ( !hit.entity->skill[0] && !hit.entity->skill[3] ) { hit.entity->skill[3] = 1 + (my->x > hit.entity->x); // Opens the Door playSoundEntity(hit.entity, 21, 96); // "UnlockDoor.ogg" } else if ( hit.entity->skill[0] && !hit.entity->skill[3] ) { hit.entity->skill[3] = 1 + (my->x < hit.entity->x); // Opens the Door playSoundEntity(hit.entity, 21, 96); // "UnlockDoor.ogg" } if ( parent ) { if ( parent->behavior == &actPlayer) { messagePlayer(parent->skill[2], language[402]); } } } } else if ( hit.entity->behavior == &actGate ) { if ( MFLAG_DISABLEOPENING || hit.entity->gateDisableOpening == 1 ) { if ( parent && parent->behavior == &actPlayer ) { Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 255); messagePlayerColor(parent->skill[2], 0xFFFFFFFF, language[3096], language[3098]); messagePlayerColor(parent->skill[2], color, language[3102]); // disabled opening spell. } } else { // Open the Gate if ( (hit.entity->skill[28] != 2 && hit.entity->gateInverted == 0) || (hit.entity->skill[28] != 1 && hit.entity->gateInverted == 1) ) { if ( hit.entity->gateInverted == 1 ) { hit.entity->skill[28] = 1; // Depowers the Gate } else { hit.entity->skill[28] = 2; // Powers the Gate } if ( parent ) { if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[403]); // "The spell opens the gate!" } } } } } else if ( hit.entity->behavior == &actChest ) { // Unlock the Chest if ( hit.entity->chestLocked ) { if ( MFLAG_DISABLEOPENING ) { if ( parent && parent->behavior == &actPlayer ) { Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 255); messagePlayerColor(parent->skill[2], 0xFFFFFFFF, language[3096], language[3099]); messagePlayerColor(parent->skill[2], color, language[3100]); // disabled opening spell. } } else { playSoundEntity(hit.entity, 91, 64); // "UnlockDoor.ogg" hit.entity->unlockChest(); if ( parent ) { if ( parent->behavior == &actPlayer) { messagePlayer(parent->skill[2], language[404]); // "The spell unlocks the chest!" } } } } } else if ( hit.entity->behavior == &actPowerCrystalBase ) { Entity* childentity = nullptr; if ( hit.entity->children.first ) { childentity = static_cast<Entity*>((&hit.entity->children)->first->element); if ( childentity != nullptr ) { //Unlock crystal if ( childentity->crystalSpellToActivate ) { playSoundEntity(hit.entity, 151, 128); childentity->crystalSpellToActivate = 0; // send the clients the updated skill. serverUpdateEntitySkill(childentity, 10); if ( parent ) { if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[2358]); } } } } } } else { if ( parent ) { if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[401]); // "No telling what it did..." } } if ( player >= 0 ) { messagePlayer(player, language[401]); // "No telling what it did..." } } spawnMagicEffectParticles(hit.entity->x, hit.entity->y, hit.entity->z, my->sprite); } } else if (!strcmp(element->name, spellElement_dig.name)) { if ( !hit.entity ) { if ( hit.mapx >= 1 && hit.mapx < map.width - 1 && hit.mapy >= 1 && hit.mapy < map.height - 1 ) { magicDig(parent, my, 8, 4); } } else { if ( hit.entity->behavior == &actBoulder ) { if ( hit.entity->sprite == 989 || hit.entity->sprite == 990 ) { magicDig(parent, my, 0, 1); } else { magicDig(parent, my, 8, 4); } } else { if ( parent ) if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[401]); } if ( player >= 0 ) { messagePlayer(player, language[401]); } } } } else if ( !strcmp(element->name, spellElement_stoneblood.name) ) { if ( hit.entity ) { if ( hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer ) { playSoundEntity(hit.entity, 172, 64); //TODO: Paralyze spell sound. int effectDuration = (element->duration * (((element->mana) / static_cast<double>(element->base_mana)) * element->overload_multiplier)); effectDuration /= (1 + (int)resistance); if ( hit.entity->setEffect(EFF_PARALYZED, true, effectDuration, false) ) { if ( hit.entity->behavior == &actPlayer ) { serverUpdateEffects(hit.entity->skill[2]); } // update enemy bar for attacker if ( parent ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( parent->behavior == &actPlayer ) { messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[2421], language[2420], MSG_COMBAT); } } Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 0); if ( player >= 0 ) { messagePlayerColor(player, color, language[2422]); } } else { if ( parent ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( parent->behavior == &actPlayer ) { messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[2905], language[2906], MSG_COMBAT); } } } spawnMagicEffectParticles(hit.entity->x, hit.entity->y, hit.entity->z, my->sprite); } } } else if ( !strcmp(element->name, spellElement_bleed.name) ) { playSoundEntity(my, 173, 128); if ( hit.entity ) { if ( hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer ) { Entity* parent = uidToEntity(my->parent); playSoundEntity(my, 173, 64); playSoundEntity(hit.entity, 28, 128); int damage = element->damage; damage += (spellbookDamageBonus * damage); //damage += ((element->mana - element->base_mana) / static_cast<double>(element->overload_multiplier)) * element->damage; damage *= hit.entity->getDamageTableMultiplier(*hitstats, DAMAGE_TABLE_MAGIC); if ( parent ) { Stat* casterStats = parent->getStats(); if ( casterStats && casterStats->type == LICH_FIRE && parent->monsterLichAllyStatus == LICH_ALLY_DEAD ) { damage *= 2; } } damage /= (1 + (int)resistance); hit.entity->modHP(-damage); // write the obituary if ( parent ) { parent->killedByMonsterObituary(hit.entity); } int bleedDuration = (element->duration * (((element->mana) / static_cast<double>(element->base_mana)) * element->overload_multiplier)); bleedDuration /= (1 + (int)resistance); if ( hit.entity->setEffect(EFF_BLEEDING, true, bleedDuration, true) ) { if ( parent ) { hitstats->bleedInflictedBy = static_cast<Sint32>(my->parent); } } hitstats->EFFECTS[EFF_SLOW] = true; hitstats->EFFECTS_TIMERS[EFF_SLOW] = (element->duration * (((element->mana) / static_cast<double>(element->base_mana)) * element->overload_multiplier)); hitstats->EFFECTS_TIMERS[EFF_SLOW] /= 4; hitstats->EFFECTS_TIMERS[EFF_SLOW] /= (1 + (int)resistance); if ( hit.entity->behavior == &actPlayer ) { serverUpdateEffects(hit.entity->skill[2]); } // update enemy bar for attacker if ( parent ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( parent->behavior == &actPlayer ) { messagePlayerMonsterEvent(parent->skill[2], color, *hitstats, language[2424], language[2423], MSG_COMBAT); } } // write the obituary if ( parent ) { parent->killedByMonsterObituary(hit.entity); } // update enemy bar for attacker if ( !strcmp(hitstats->name, "") ) { if ( hitstats->type < KOBOLD ) //Original monster count { updateEnemyBar(parent, hit.entity, language[90 + hitstats->type], hitstats->HP, hitstats->MAXHP); } else if ( hitstats->type >= KOBOLD ) //New monsters { updateEnemyBar(parent, hit.entity, language[2000 + (hitstats->type - KOBOLD)], hitstats->HP, hitstats->MAXHP); } } else { updateEnemyBar(parent, hit.entity, hitstats->name, hitstats->HP, hitstats->MAXHP); } if ( hitstats->HP <= 0 && parent ) { parent->awardXP(hit.entity, true, true); if ( hit.entity->behavior == &actMonster ) { bool tryBloodVial = false; if ( gibtype[hitstats->type] == 1 || gibtype[hitstats->type] == 2 ) { for ( c = 0; c < MAXPLAYERS; ++c ) { if ( players[c]->entity && players[c]->entity->playerRequiresBloodToSustain() ) { tryBloodVial = true; break; } } if ( tryBloodVial ) { Item* blood = newItem(FOOD_BLOOD, EXCELLENT, 0, 1, gibtype[hitstats->type] - 1, true, &hitstats->inventory); } } } } Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 0); if ( player >= 0 ) { messagePlayerColor(player, color, language[2425]); } spawnMagicEffectParticles(hit.entity->x, hit.entity->y, hit.entity->z, my->sprite); for ( int gibs = 0; gibs < 10; ++gibs ) { Entity* gib = spawnGib(hit.entity); serverSpawnGibForClient(gib); } } } } else if ( !strcmp(element->name, spellElement_dominate.name) ) { Entity *caster = uidToEntity(spell->caster); if ( caster ) { if ( spellEffectDominate(*my, *element, *caster, parent) ) { //Success } } } else if ( !strcmp(element->name, spellElement_acidSpray.name) ) { Entity* caster = uidToEntity(spell->caster); if ( caster ) { spellEffectAcid(*my, *element, parent, resistance); } } else if ( !strcmp(element->name, spellElement_poison.name) ) { Entity* caster = uidToEntity(spell->caster); if ( caster ) { spellEffectPoison(*my, *element, parent, resistance); } } else if ( !strcmp(element->name, spellElement_sprayWeb.name) ) { Entity* caster = uidToEntity(spell->caster); if ( caster ) { spellEffectSprayWeb(*my, *element, parent, resistance); } } else if ( !strcmp(element->name, spellElement_stealWeapon.name) ) { Entity* caster = uidToEntity(spell->caster); if ( caster ) { spellEffectStealWeapon(*my, *element, parent, resistance); } } else if ( !strcmp(element->name, spellElement_drainSoul.name) ) { Entity* caster = uidToEntity(spell->caster); if ( caster ) { spellEffectDrainSoul(*my, *element, parent, resistance); } } else if ( !strcmp(element->name, spellElement_charmMonster.name) ) { Entity* caster = uidToEntity(spell->caster); if ( caster ) { spellEffectCharmMonster(*my, *element, parent, resistance, static_cast<bool>(my->actmagicCastByMagicstaff)); } } else if ( !strcmp(element->name, spellElement_telePull.name) ) { Entity* caster = uidToEntity(spell->caster); if ( caster ) { spellEffectTeleportPull(my, *element, parent, hit.entity, resistance); } } else if ( !strcmp(element->name, spellElement_shadowTag.name) ) { Entity* caster = uidToEntity(spell->caster); if ( caster ) { spellEffectShadowTag(*my, *element, parent, resistance); } } else if ( !strcmp(element->name, spellElement_demonIllusion.name) ) { Entity* caster = uidToEntity(spell->caster); if ( caster ) { spellEffectDemonIllusion(*my, *element, parent, hit.entity, resistance); } } if ( hitstats ) { if ( player >= 0 ) { entityHealth -= hitstats->HP; if ( entityHealth > 0 ) { // entity took damage, shake screen. if ( multiplayer == SERVER && player > 0 ) { strcpy((char*)net_packet->data, "SHAK"); net_packet->data[4] = 10; // turns into .1 net_packet->data[5] = 10; net_packet->address.host = net_clients[player - 1].host; net_packet->address.port = net_clients[player - 1].port; net_packet->len = 6; sendPacketSafe(net_sock, -1, net_packet, player - 1); } else if (player == 0 || (splitscreen && player > 0) ) { cameravars[player].shakex += .1; cameravars[player].shakey += 10; } } } else { if ( parent && parent->behavior == &actPlayer ) { if ( hitstats->HP <= 0 ) { if ( hitstats->type == SCARAB ) { // killed a scarab with magic. steamAchievementEntity(parent, "BARONY_ACH_THICK_SKULL"); } if ( my->actmagicMirrorReflected == 1 && static_cast<Uint32>(my->actmagicMirrorReflectedCaster) == hit.entity->getUID() ) { // killed a monster with it's own spell with mirror reflection. steamAchievementEntity(parent, "BARONY_ACH_NARCISSIST"); } if ( stats[parent->skill[2]] && stats[parent->skill[2]]->playerRace == RACE_INSECTOID && stats[parent->skill[2]]->appearance == 0 ) { if ( !achievementObserver.playerAchievements[parent->skill[2]].gastricBypass ) { if ( achievementObserver.playerAchievements[parent->skill[2]].gastricBypassSpell.first == spell->ID ) { Uint32 oldTicks = achievementObserver.playerAchievements[parent->skill[2]].gastricBypassSpell.second; if ( parent->ticks - oldTicks < TICKS_PER_SECOND * 5 ) { steamAchievementEntity(parent, "BARONY_ACH_GASTRIC_BYPASS"); achievementObserver.playerAchievements[parent->skill[2]].gastricBypass = true; } } } } } } } } if ( my->actmagicProjectileArc > 0 ) { Entity* caster = uidToEntity(spell->caster); spawnMagicTower(caster, my->x, my->y, spell->ID, nullptr); } if ( !(my->actmagicIsOrbiting == 2) ) { my->removeLightField(); if ( my->mynode ) { list_RemoveNode(my->mynode); } } return; } } //Go down two levels to the next element. This will need to get re-written shortly. node = spell->elements.first; element = (spellElement_t*)node->element; //element = (spellElement_t *)spell->elements->first->element; //element = (spellElement_t *)element->elements->first->element; //Go down two levels to the second element. node = element->elements.first; element = (spellElement_t*)node->element; if (!strcmp(element->name, spellElement_fire.name) || !strcmp(element->name, spellElement_lightning.name)) { //Make the ball light up stuff as it travels. my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 192); if ( flickerLights ) { //Magic light ball will never flicker if this setting is disabled. lightball_flicker++; } my->skill[2] = -11; // so clients know to create a light field if (lightball_flicker > 5) { lightball_lighting = (lightball_lighting == 1) + 1; if (lightball_lighting == 1) { my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 192); } else { my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 174); } lightball_flicker = 0; } } else { my->skill[2] = -12; // so clients know to simply spawn particles } // spawn particles spawnMagicParticle(my); } else { //Any init stuff that needs to happen goes here. magic_init = 1; my->skill[2] = -7; // ordinarily the client won't do anything with this entity if ( my->actmagicIsOrbiting == 1 || my->actmagicIsOrbiting == 2 ) { MAGIC_MAXLIFE = my->actmagicOrbitLifetime; } else if ( my->actmagicIsVertical != MAGIC_ISVERTICAL_NONE ) { MAGIC_MAXLIFE = 512; } } } void actMagicClient(Entity* my) { my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 192); if ( flickerLights ) { //Magic light ball will never flicker if this setting is disabled. lightball_flicker++; } my->skill[2] = -11; // so clients know to create a light field if (lightball_flicker > 5) { lightball_lighting = (lightball_lighting == 1) + 1; if (lightball_lighting == 1) { my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 192); } else { my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 8, 174); } lightball_flicker = 0; } // spawn particles spawnMagicParticle(my); } void actMagicClientNoLight(Entity* my) { spawnMagicParticle(my); // simply spawn particles } void actMagicParticle(Entity* my) { my->x += my->vel_x; my->y += my->vel_y; my->z += my->vel_z; if ( my->sprite == 943 || my->sprite == 979 ) { my->scalex -= 0.05; my->scaley -= 0.05; my->scalez -= 0.05; } my->scalex -= 0.05; my->scaley -= 0.05; my->scalez -= 0.05; if ( my->scalex <= 0 ) { my->scalex = 0; my->scaley = 0; my->scalez = 0; list_RemoveNode(my->mynode); return; } } Entity* spawnMagicParticle(Entity* parentent) { if ( !parentent ) { return nullptr; } Entity* entity; entity = newEntity(parentent->sprite, 1, map.entities, nullptr); //Particle entity. entity->x = parentent->x + (rand() % 50 - 25) / 20.f; entity->y = parentent->y + (rand() % 50 - 25) / 20.f; entity->z = parentent->z + (rand() % 50 - 25) / 20.f; entity->scalex = 0.7; entity->scaley = 0.7; entity->scalez = 0.7; entity->sizex = 1; entity->sizey = 1; entity->yaw = parentent->yaw; entity->pitch = parentent->pitch; entity->roll = parentent->roll; entity->flags[NOUPDATE] = true; entity->flags[PASSABLE] = true; entity->flags[BRIGHT] = true; entity->flags[UNCLICKABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UPDATENEEDED] = false; entity->behavior = &actMagicParticle; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); return entity; } Entity* spawnMagicParticleCustom(Entity* parentent, int sprite, real_t scale, real_t spreadReduce) { if ( !parentent ) { return nullptr; } Entity* entity; entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. int size = 50 / spreadReduce; entity->x = parentent->x + (rand() % size - size / 2) / 20.f; entity->y = parentent->y + (rand() % size - size / 2) / 20.f; entity->z = parentent->z + (rand() % size - size / 2) / 20.f; entity->scalex = scale; entity->scaley = scale; entity->scalez = scale; entity->sizex = 1; entity->sizey = 1; entity->yaw = parentent->yaw; entity->pitch = parentent->pitch; entity->roll = parentent->roll; entity->flags[NOUPDATE] = true; entity->flags[PASSABLE] = true; entity->flags[BRIGHT] = true; entity->flags[UNCLICKABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UPDATENEEDED] = false; entity->behavior = &actMagicParticle; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); return entity; } void spawnMagicEffectParticles(Sint16 x, Sint16 y, Sint16 z, Uint32 sprite) { int c; if ( multiplayer == SERVER ) { for ( c = 1; c < MAXPLAYERS; c++ ) { if ( client_disconnected[c] ) { continue; } strcpy((char*)net_packet->data, "MAGE"); SDLNet_Write16(x, &net_packet->data[4]); SDLNet_Write16(y, &net_packet->data[6]); SDLNet_Write16(z, &net_packet->data[8]); SDLNet_Write32(sprite, &net_packet->data[10]); net_packet->address.host = net_clients[c - 1].host; net_packet->address.port = net_clients[c - 1].port; net_packet->len = 14; sendPacketSafe(net_sock, -1, net_packet, c - 1); } } // boosty boost for ( c = 0; c < 10; c++ ) { Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->x = x - 5 + rand() % 11; entity->y = y - 5 + rand() % 11; entity->z = z - 10 + rand() % 21; entity->scalex = 0.7; entity->scaley = 0.7; entity->scalez = 0.7; entity->sizex = 1; entity->sizey = 1; entity->yaw = (rand() % 360) * PI / 180.f; entity->flags[PASSABLE] = true; entity->flags[BRIGHT] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; entity->behavior = &actMagicParticle; entity->vel_z = -1; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); } } void createParticle1(Entity* caster, int player) { Entity* entity = newEntity(-1, 1, map.entities, nullptr); //Particle entity. entity->sizex = 0; entity->sizey = 0; entity->x = caster->x; entity->y = caster->y; entity->z = -7; entity->vel_z = 0.3; entity->yaw = (rand() % 360) * PI / 180.0; entity->skill[0] = 50; entity->skill[1] = player; entity->fskill[0] = 0.03; entity->light = lightSphereShadow(entity->x / 16, entity->y / 16, 3, 192); entity->behavior = &actParticleCircle; entity->flags[PASSABLE] = true; entity->flags[INVISIBLE] = true; entity->setUID(-3); } void createParticleCircling(Entity* parent, int duration, int sprite) { if ( !parent ) { return; } Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x; entity->y = parent->y; entity->focalx = 8; entity->z = -7; entity->vel_z = 0.15; entity->yaw = (rand() % 360) * PI / 180.0; entity->skill[0] = duration; entity->skill[1] = -1; //entity->scalex = 0.01; //entity->scaley = 0.01; entity->fskill[0] = -0.1; entity->behavior = &actParticleCircle; entity->flags[PASSABLE] = true; entity->setUID(-3); real_t tmp = entity->yaw; entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x; entity->y = parent->y; entity->focalx = 8; entity->z = -7; entity->vel_z = 0.15; entity->yaw = tmp + (2 * PI / 3); entity->particleDuration = duration; entity->skill[1] = -1; //entity->scalex = 0.01; //entity->scaley = 0.01; entity->fskill[0] = -0.1; entity->behavior = &actParticleCircle; entity->flags[PASSABLE] = true; entity->setUID(-3); entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x; entity->y = parent->y; entity->focalx = 8; entity->z = -7; entity->vel_z = 0.15; entity->yaw = tmp - (2 * PI / 3); entity->particleDuration = duration; entity->skill[1] = -1; //entity->scalex = 0.01; //entity->scaley = 0.01; entity->fskill[0] = -0.1; entity->behavior = &actParticleCircle; entity->flags[PASSABLE] = true; entity->setUID(-3); entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x; entity->y = parent->y; entity->focalx = 16; entity->z = -12; entity->vel_z = 0.2; entity->yaw = tmp; entity->particleDuration = duration; entity->skill[1] = -1; //entity->scalex = 0.01; //entity->scaley = 0.01; entity->fskill[0] = 0.1; entity->behavior = &actParticleCircle; entity->flags[PASSABLE] = true; entity->setUID(-3); entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x; entity->y = parent->y; entity->focalx = 16; entity->z = -12; entity->vel_z = 0.2; entity->yaw = tmp + (2 * PI / 3); entity->particleDuration = duration; entity->skill[1] = -1; //entity->scalex = 0.01; //entity->scaley = 0.01; entity->fskill[0] = 0.1; entity->behavior = &actParticleCircle; entity->flags[PASSABLE] = true; entity->setUID(-3); entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x; entity->y = parent->y; entity->focalx = 16; entity->z = -12; entity->vel_z = 0.2; entity->yaw = tmp - (2 * PI / 3); entity->particleDuration = duration; entity->skill[1] = -1; //entity->scalex = 0.01; //entity->scaley = 0.01; entity->fskill[0] = 0.1; entity->behavior = &actParticleCircle; entity->flags[PASSABLE] = true; entity->setUID(-3); } #define PARTICLE_LIFE my->skill[0] #define PARTICLE_CASTER my->skill[1] void actParticleCircle(Entity* my) { if ( PARTICLE_LIFE < 0 ) { list_RemoveNode(my->mynode); return; } else { --PARTICLE_LIFE; my->yaw += my->fskill[0]; if ( my->fskill[0] < 0.4 && my->fskill[0] > (-0.4) ) { my->fskill[0] = my->fskill[0] * 1.05; } my->z += my->vel_z; if ( my->focalx > 0.05 ) { if ( my->vel_z == 0.15 ) { my->focalx = my->focalx * 0.97; } else { my->focalx = my->focalx * 0.97; } } my->scalex *= 0.995; my->scaley *= 0.995; my->scalez *= 0.995; } } void createParticleDot(Entity* parent) { if ( !parent ) { return; } for ( int c = 0; c < 50; c++ ) { Entity* entity = newEntity(576, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x + (-4 + rand() % 9); entity->y = parent->y + (-4 + rand() % 9); entity->z = 7.5 + rand()%50; entity->vel_z = -1; //entity->yaw = (rand() % 360) * PI / 180.0; entity->skill[0] = 10 + rand()% 50; entity->behavior = &actParticleDot; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); } } Entity* createParticleAestheticOrbit(Entity* parent, int sprite, int duration, int effectType) { if ( !parent ) { return nullptr; } Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->actmagicOrbitDist = 6; entity->yaw = parent->yaw; entity->x = parent->x + entity->actmagicOrbitDist * cos(entity->yaw); entity->y = parent->y + entity->actmagicOrbitDist * sin(entity->yaw); entity->z = parent->z; entity->skill[1] = effectType; entity->parent = parent->getUID(); //entity->vel_z = -1; //entity->yaw = (rand() % 360) * PI / 180.0; entity->skill[0] = duration; entity->fskill[0] = entity->x; entity->fskill[1] = entity->y; entity->behavior = &actParticleAestheticOrbit; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[BRIGHT] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); return entity; } void createParticleRock(Entity* parent) { if ( !parent ) { return; } for ( int c = 0; c < 5; c++ ) { Entity* entity = newEntity(78, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x + (-4 + rand() % 9); entity->y = parent->y + (-4 + rand() % 9); entity->z = 7.5; entity->yaw = c * 2 * PI / 5;//(rand() % 360) * PI / 180.0; entity->roll = (rand() % 360) * PI / 180.0; entity->vel_x = 0.2 * cos(entity->yaw); entity->vel_y = 0.2 * sin(entity->yaw); entity->vel_z = 3;// 0.25 - (rand() % 5) / 10.0; entity->skill[0] = 50; // particle life entity->skill[1] = 0; // particle direction, 0 = upwards, 1 = downwards. entity->behavior = &actParticleRock; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); } } void actParticleRock(Entity* my) { if ( PARTICLE_LIFE < 0 || my->z > 10 ) { list_RemoveNode(my->mynode); } else { --PARTICLE_LIFE; my->x += my->vel_x; my->y += my->vel_y; my->roll += 0.1; if ( my->vel_z < 0.01 ) { my->skill[1] = 1; // start moving downwards my->vel_z = 0.1; } if ( my->skill[1] == 0 ) // upwards motion { my->z -= my->vel_z; my->vel_z *= 0.7; } else // downwards motion { my->z += my->vel_z; my->vel_z *= 1.1; } } return; } void actParticleDot(Entity* my) { if ( PARTICLE_LIFE < 0 ) { list_RemoveNode(my->mynode); } else { --PARTICLE_LIFE; my->z += my->vel_z; //my->z -= 0.01; } return; } void actParticleAestheticOrbit(Entity* my) { if ( PARTICLE_LIFE < 0 ) { list_RemoveNode(my->mynode); } else { Entity* parent = uidToEntity(my->parent); if ( !parent ) { list_RemoveNode(my->mynode); return; } Stat* stats = parent->getStats(); if ( my->skill[1] == PARTICLE_EFFECT_SPELLBOT_ORBIT ) { my->yaw = parent->yaw; my->x = parent->x + 2 * cos(parent->yaw); my->y = parent->y + 2 * sin(parent->yaw); my->z = parent->z - 1.5; Entity* particle = spawnMagicParticle(my); if ( particle ) { particle->x = my->x + (-10 + rand() % 21) / (50.f); particle->y = my->y + (-10 + rand() % 21) / (50.f); particle->z = my->z + (-10 + rand() % 21) / (50.f); particle->scalex = my->scalex; particle->scaley = my->scaley; particle->scalez = my->scalez; } //spawnMagicParticle(my); } else if ( my->skill[1] == PARTICLE_EFFECT_SPELL_WEB_ORBIT ) { if ( my->sprite == 863 && !stats->EFFECTS[EFF_WEBBED] ) { list_RemoveNode(my->mynode); return; } my->yaw += 0.2; spawnMagicParticle(my); my->x = parent->x + my->actmagicOrbitDist * cos(my->yaw); my->y = parent->y + my->actmagicOrbitDist * sin(my->yaw); } --PARTICLE_LIFE; } return; } void actParticleTest(Entity* my) { if ( PARTICLE_LIFE < 0 ) { list_RemoveNode(my->mynode); return; } else { --PARTICLE_LIFE; my->x += my->vel_x; my->y += my->vel_y; my->z += my->vel_z; //my->z -= 0.01; } } void createParticleErupt(Entity* parent, int sprite) { if ( !parent ) { return; } real_t yaw = 0; int numParticles = 8; for ( int c = 0; c < 8; c++ ) { Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x; entity->y = parent->y; entity->z = 7.5; // start from the ground. entity->yaw = yaw; entity->vel_x = 0.2; entity->vel_y = 0.2; entity->vel_z = -2; entity->skill[0] = 100; entity->skill[1] = 0; // direction. entity->fskill[0] = 0.1; entity->behavior = &actParticleErupt; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); yaw += 2 * PI / numParticles; } } Entity* createParticleSapCenter(Entity* parent, Entity* target, int spell, int sprite, int endSprite) { if ( !parent || !target ) { return nullptr; } // spawns the invisible 'center' of the magic particle Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = target->x; entity->y = target->y; entity->parent = (parent->getUID()); entity->yaw = parent->yaw + PI; // face towards the caster. entity->skill[0] = 45; entity->skill[2] = -13; // so clients know my behavior. entity->skill[3] = 0; // init entity->skill[4] = sprite; // visible sprites. entity->skill[5] = endSprite; // sprite to spawn on return to caster. entity->skill[6] = spell; entity->behavior = &actParticleSapCenter; if ( target->sprite == 977 ) { // boomerang. entity->yaw = target->yaw; entity->roll = target->roll; entity->pitch = target->pitch; entity->z = target->z; } entity->flags[INVISIBLE] = true; entity->flags[PASSABLE] = true; entity->flags[UPDATENEEDED] = true; entity->flags[UNCLICKABLE] = true; return entity; } void createParticleSap(Entity* parent) { real_t speed = 0.4; if ( !parent ) { return; } for ( int c = 0; c < 4; c++ ) { // 4 particles, in an 'x' pattern around parent sprite. int sprite = parent->sprite; if ( parent->sprite == 977 ) { if ( c > 0 ) { continue; } // boomerang return. sprite = parent->sprite; } if ( parent->skill[6] == SPELL_STEAL_WEAPON || parent->skill[6] == SHADOW_SPELLCAST ) { sprite = parent->sprite; } else if ( parent->skill[6] == SPELL_DRAIN_SOUL ) { if ( c == 0 || c == 3 ) { sprite = parent->sprite; } else { sprite = 599; } } else if ( parent->skill[6] == SPELL_SUMMON ) { sprite = parent->sprite; } else if ( parent->skill[6] == SPELL_FEAR ) { sprite = parent->sprite; } else if ( multiplayer == CLIENT ) { // client won't receive the sprite skill data in time, fix for this until a solution is found! if ( sprite == 598 ) { if ( c == 0 || c == 3 ) { // drain HP particle sprite = parent->sprite; } else { // drain MP particle sprite = 599; } } } Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x; entity->y = parent->y; entity->z = 0; entity->scalex = 0.9; entity->scaley = 0.9; entity->scalez = 0.9; if ( sprite == 598 || sprite == 599 ) { entity->scalex = 0.5; entity->scaley = 0.5; entity->scalez = 0.5; } entity->parent = (parent->getUID()); entity->yaw = parent->yaw; if ( c == 0 ) { entity->vel_z = -speed; entity->vel_x = speed * cos(entity->yaw + PI / 2); entity->vel_y = speed * sin(entity->yaw + PI / 2); entity->yaw += PI / 3; entity->pitch -= PI / 6; entity->fskill[2] = -(PI / 3) / 25; // yaw rate of change. entity->fskill[3] = (PI / 6) / 25; // pitch rate of change. } else if ( c == 1 ) { entity->vel_z = -speed; entity->vel_x = speed * cos(entity->yaw - PI / 2); entity->vel_y = speed * sin(entity->yaw - PI / 2); entity->yaw -= PI / 3; entity->pitch -= PI / 6; entity->fskill[2] = (PI / 3) / 25; // yaw rate of change. entity->fskill[3] = (PI / 6) / 25; // pitch rate of change. } else if ( c == 2 ) { entity->vel_x = speed * cos(entity->yaw + PI / 2); entity->vel_y = speed * sin(entity->yaw + PI / 2); entity->vel_z = speed; entity->yaw += PI / 3; entity->pitch += PI / 6; entity->fskill[2] = -(PI / 3) / 25; // yaw rate of change. entity->fskill[3] = -(PI / 6) / 25; // pitch rate of change. } else if ( c == 3 ) { entity->vel_x = speed * cos(entity->yaw - PI / 2); entity->vel_y = speed * sin(entity->yaw - PI / 2); entity->vel_z = speed; entity->yaw -= PI / 3; entity->pitch += PI / 6; entity->fskill[2] = (PI / 3) / 25; // yaw rate of change. entity->fskill[3] = -(PI / 6) / 25; // pitch rate of change. } entity->skill[3] = c; // particle index entity->fskill[0] = entity->vel_x; // stores the accumulated x offset from center entity->fskill[1] = entity->vel_y; // stores the accumulated y offset from center entity->skill[0] = 200; // lifetime entity->skill[1] = 0; // direction outwards entity->behavior = &actParticleSap; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); if ( sprite == 977 ) // boomerang { entity->z = parent->z; entity->scalex = 1.f; entity->scaley = 1.f; entity->scalez = 1.f; entity->skill[0] = 175; entity->fskill[2] = -((PI / 3) + (PI / 6)) / (150); // yaw rate of change over 3 seconds entity->fskill[3] = 0.f; entity->focalx = 2; entity->focalz = 0.5; entity->pitch = parent->pitch; entity->yaw = parent->yaw; entity->roll = parent->roll; entity->vel_x = 1 * cos(entity->yaw); entity->vel_y = 1 * sin(entity->yaw); int x = entity->x / 16; int y = entity->y / 16; if ( !map.tiles[(MAPLAYERS - 1) + y * MAPLAYERS + x * MAPLAYERS * map.height] ) { // no ceiling, bounce higher. entity->vel_z = -0.4; entity->skill[3] = 1; // high bounce. } else { entity->vel_z = -0.08; } entity->yaw += PI / 3; } } } void createParticleDropRising(Entity* parent, int sprite, double scale) { if ( !parent ) { return; } for ( int c = 0; c < 50; c++ ) { // shoot drops to the sky Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x - 4 + rand() % 9; entity->y = parent->y - 4 + rand() % 9; entity->z = 7.5 + rand() % 50; entity->vel_z = -1; //entity->yaw = (rand() % 360) * PI / 180.0; entity->particleDuration = 10 + rand() % 50; entity->scalex *= scale; entity->scaley *= scale; entity->scalez *= scale; entity->behavior = &actParticleDot; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); } } Entity* createParticleTimer(Entity* parent, int duration, int sprite) { Entity* entity = newEntity(-1, 1, map.entities, nullptr); //Timer entity. entity->sizex = 1; entity->sizey = 1; if ( parent ) { entity->x = parent->x; entity->y = parent->y; entity->parent = (parent->getUID()); } entity->behavior = &actParticleTimer; entity->particleTimerDuration = duration; entity->flags[INVISIBLE] = true; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); return entity; } void actParticleErupt(Entity* my) { if ( PARTICLE_LIFE < 0 ) { list_RemoveNode(my->mynode); return; } else { // particles jump up from the ground then back down again. --PARTICLE_LIFE; my->x += my->vel_x * cos(my->yaw); my->y += my->vel_y * sin(my->yaw); my->scalex *= 0.99; my->scaley *= 0.99; my->scalez *= 0.99; spawnMagicParticle(my); if ( my->skill[1] == 0 ) // rising { my->z += my->vel_z; my->vel_z *= 0.8; my->pitch = std::min<real_t>(my->pitch + my->fskill[0], PI / 2); my->fskill[0] = std::max<real_t>(my->fskill[0] * 0.85, 0.05); if ( my->vel_z > -0.02 ) { my->skill[1] = 1; } } else // falling { my->pitch = std::min<real_t>(my->pitch + my->fskill[0], 15 * PI / 16); my->fskill[0] = std::min<real_t>(my->fskill[0] * (1 / 0.99), 0.1); my->z -= my->vel_z; my->vel_z *= (1 / 0.8); my->vel_z = std::max<real_t>(my->vel_z, -0.8); } } } void actParticleTimer(Entity* my) { if ( PARTICLE_LIFE < 0 ) { if ( multiplayer != CLIENT ) { if ( my->particleTimerEndAction == PARTICLE_EFFECT_INCUBUS_TELEPORT_STEAL ) { // teleport to random location spell. Entity* parent = uidToEntity(my->parent); if ( parent ) { createParticleErupt(parent, my->particleTimerEndSprite); if ( parent->teleportRandom() ) { // teleport success. if ( multiplayer == SERVER ) { serverSpawnMiscParticles(parent, PARTICLE_EFFECT_ERUPT, my->particleTimerEndSprite); } } } } else if ( my->particleTimerEndAction == PARTICLE_EFFECT_INCUBUS_TELEPORT_TARGET ) { // teleport to target spell. Entity* parent = uidToEntity(my->parent); Entity* target = uidToEntity(static_cast<Uint32>(my->particleTimerTarget)); if ( parent && target ) { createParticleErupt(parent, my->particleTimerEndSprite); if ( parent->teleportAroundEntity(target, my->particleTimerVariable1) ) { // teleport success. if ( multiplayer == SERVER ) { serverSpawnMiscParticles(parent, PARTICLE_EFFECT_ERUPT, my->particleTimerEndSprite); } } } } else if ( my->particleTimerEndAction == PARTICLE_EFFECT_TELEPORT_PULL ) { // teleport to target spell. Entity* parent = uidToEntity(my->parent); Entity* target = uidToEntity(static_cast<Uint32>(my->particleTimerTarget)); if ( parent && target ) { real_t oldx = target->x; real_t oldy = target->y; my->flags[PASSABLE] = true; int tx = static_cast<int>(std::floor(my->x)) >> 4; int ty = static_cast<int>(std::floor(my->y)) >> 4; if ( !target->isBossMonster() && target->teleport(tx, ty) ) { // teleport success. if ( parent->behavior == &actPlayer ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); if ( target->getStats() ) { messagePlayerMonsterEvent(parent->skill[2], color, *(target->getStats()), language[3450], language[3451], MSG_COMBAT); } } if ( target->behavior == &actPlayer ) { Uint32 color = SDL_MapRGB(mainsurface->format, 255, 255, 255); messagePlayerColor(target->skill[2], color, language[3461]); } real_t distance = sqrt((target->x - oldx) * (target->x - oldx) + (target->y - oldy) * (target->y - oldy)) / 16.f; //real_t distance = (entityDist(parent, target)) / 16; createParticleErupt(target, my->particleTimerEndSprite); int durationToStun = 0; if ( distance >= 2 ) { durationToStun = 25 + std::min((distance - 4) * 10, 50.0); } if ( target->behavior == &actMonster ) { if ( durationToStun > 0 && target->setEffect(EFF_DISORIENTED, true, durationToStun, false) ) { int numSprites = std::min(3, durationToStun / 25); for ( int i = 0; i < numSprites; ++i ) { spawnFloatingSpriteMisc(134, target->x + (-4 + rand() % 9) + cos(target->yaw) * 2, target->y + (-4 + rand() % 9) + sin(target->yaw) * 2, target->z + rand() % 4); } } target->monsterReleaseAttackTarget(); target->lookAtEntity(*parent); target->monsterLookDir += (PI - PI / 4 + (rand() % 10) * PI / 40); } else if ( target->behavior == &actPlayer ) { durationToStun = std::max(50, durationToStun); target->setEffect(EFF_DISORIENTED, true, durationToStun, false); int numSprites = std::min(3, durationToStun / 50); for ( int i = 0; i < numSprites; ++i ) { spawnFloatingSpriteMisc(134, target->x + (-4 + rand() % 9) + cos(target->yaw) * 2, target->y + (-4 + rand() % 9) + sin(target->yaw) * 2, target->z + rand() % 4); } Uint32 color = SDL_MapRGB(mainsurface->format, 255, 255, 255); messagePlayerColor(target->skill[2], color, language[3462]); } if ( multiplayer == SERVER ) { serverSpawnMiscParticles(target, PARTICLE_EFFECT_ERUPT, my->particleTimerEndSprite); } } } } else if ( my->particleTimerEndAction == PARTICLE_EFFECT_PORTAL_SPAWN ) { Entity* parent = uidToEntity(my->parent); if ( parent ) { parent->flags[INVISIBLE] = false; serverUpdateEntityFlag(parent, INVISIBLE); playSoundEntity(parent, 164, 128); } spawnExplosion(my->x, my->y, 0); } else if ( my->particleTimerEndAction == PARTICLE_EFFECT_SUMMON_MONSTER || my->particleTimerEndAction == PARTICLE_EFFECT_DEVIL_SUMMON_MONSTER ) { playSoundEntity(my, 164, 128); spawnExplosion(my->x, my->y, -4.0); bool forceLocation = false; if ( my->particleTimerEndAction == PARTICLE_EFFECT_DEVIL_SUMMON_MONSTER && !map.tiles[static_cast<int>(my->y / 16) * MAPLAYERS + static_cast<int>(my->x / 16) * MAPLAYERS * map.height] ) { if ( my->particleTimerVariable1 == SHADOW || my->particleTimerVariable1 == CREATURE_IMP ) { forceLocation = true; } } Entity* monster = summonMonster(static_cast<Monster>(my->particleTimerVariable1), my->x, my->y, forceLocation); if ( monster ) { Stat* monsterStats = monster->getStats(); if ( my->parent != 0 && uidToEntity(my->parent) ) { if ( uidToEntity(my->parent)->getRace() == LICH_ICE ) { //monsterStats->leader_uid = my->parent; switch ( monsterStats->type ) { case AUTOMATON: strcpy(monsterStats->name, "corrupted automaton"); monsterStats->EFFECTS[EFF_CONFUSED] = true; monsterStats->EFFECTS_TIMERS[EFF_CONFUSED] = -1; break; default: break; } } else if ( uidToEntity(my->parent)->getRace() == DEVIL ) { monsterStats->LVL = 5; if ( my->particleTimerVariable2 >= 0 && players[my->particleTimerVariable2] && players[my->particleTimerVariable2]->entity ) { monster->monsterAcquireAttackTarget(*(players[my->particleTimerVariable2]->entity), MONSTER_STATE_ATTACK); } } } } } else if ( my->particleTimerEndAction == PARTICLE_EFFECT_SPELL_SUMMON ) { //my->removeLightField(); } else if ( my->particleTimerEndAction == PARTICLE_EFFECT_SHADOW_TELEPORT ) { // teleport to target spell. Entity* parent = uidToEntity(my->parent); if ( parent ) { if ( parent->monsterSpecialState == SHADOW_TELEPORT_ONLY ) { //messagePlayer(0, "Resetting shadow's monsterSpecialState!"); parent->monsterSpecialState = 0; serverUpdateEntitySkill(parent, 33); // for clients to keep track of animation } } Entity* target = uidToEntity(static_cast<Uint32>(my->particleTimerTarget)); if ( parent ) { bool teleported = false; createParticleErupt(parent, my->particleTimerEndSprite); if ( target ) { teleported = parent->teleportAroundEntity(target, my->particleTimerVariable1); } else { teleported = parent->teleportRandom(); } if ( teleported ) { // teleport success. if ( multiplayer == SERVER ) { serverSpawnMiscParticles(parent, PARTICLE_EFFECT_ERUPT, my->particleTimerEndSprite); } } } } else if ( my->particleTimerEndAction == PARTICLE_EFFECT_LICHFIRE_TELEPORT_STATIONARY ) { // teleport to fixed location spell. node_t* node; int c = 0 + rand() % 3; Entity* target = nullptr; for ( node = map.entities->first; node != nullptr; node = node->next ) { target = (Entity*)node->element; if ( target->behavior == &actDevilTeleport ) { if ( (c == 0 && target->sprite == 72) || (c == 1 && target->sprite == 73) || (c == 2 && target->sprite == 74) ) { break; } } } Entity* parent = uidToEntity(my->parent); if ( parent && target ) { createParticleErupt(parent, my->particleTimerEndSprite); if ( parent->teleport(target->x / 16, target->y / 16) ) { // teleport success. if ( multiplayer == SERVER ) { serverSpawnMiscParticles(parent, PARTICLE_EFFECT_ERUPT, my->particleTimerEndSprite); } } } } else if ( my->particleTimerEndAction == PARTICLE_EFFECT_LICH_TELEPORT_ROAMING ) { bool teleported = false; // teleport to target spell. node_t* node; Entity* parent = uidToEntity(my->parent); Entity* target = nullptr; if ( parent ) { for ( node = map.entities->first; node != nullptr; node = node->next ) { target = (Entity*)node->element; if ( target->behavior == &actDevilTeleport && target->sprite == 128 ) { break; // found specified center of map } } if ( target ) { createParticleErupt(parent, my->particleTimerEndSprite); teleported = parent->teleport((target->x / 16) - 11 + rand() % 23, (target->y / 16) - 11 + rand() % 23); if ( teleported ) { // teleport success. if ( multiplayer == SERVER ) { serverSpawnMiscParticles(parent, PARTICLE_EFFECT_ERUPT, my->particleTimerEndSprite); } } } } } else if ( my->particleTimerEndAction == PARTICLE_EFFECT_LICHICE_TELEPORT_STATIONARY ) { // teleport to fixed location spell. node_t* node; Entity* target = nullptr; for ( node = map.entities->first; node != nullptr; node = node->next ) { target = (Entity*)node->element; if ( target->behavior == &actDevilTeleport && target->sprite == 128 ) { break; } } Entity* parent = uidToEntity(my->parent); if ( parent && target ) { createParticleErupt(parent, my->particleTimerEndSprite); if ( parent->teleport(target->x / 16, target->y / 16) ) { // teleport success. if ( multiplayer == SERVER ) { serverSpawnMiscParticles(parent, PARTICLE_EFFECT_ERUPT, my->particleTimerEndSprite); } parent->lichIceCreateCannon(); } } } } my->removeLightField(); list_RemoveNode(my->mynode); return; } else { --PARTICLE_LIFE; if ( my->particleTimerPreDelay <= 0 ) { // shoot particles for the duration of the timer, centered at caster. if ( my->particleTimerCountdownAction == PARTICLE_TIMER_ACTION_SHOOT_PARTICLES ) { Entity* parent = uidToEntity(my->parent); // shoot drops to the sky if ( parent && my->particleTimerCountdownSprite != 0 ) { Entity* entity = newEntity(my->particleTimerCountdownSprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x - 4 + rand() % 9; entity->y = parent->y - 4 + rand() % 9; entity->z = 7.5; entity->vel_z = -1; entity->yaw = (rand() % 360) * PI / 180.0; entity->particleDuration = 10 + rand() % 30; entity->behavior = &actParticleDot; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); } } // fire once off. else if ( my->particleTimerCountdownAction == PARTICLE_TIMER_ACTION_SPAWN_PORTAL ) { Entity* parent = uidToEntity(my->parent); if ( parent && my->particleTimerCountdownAction < 100 ) { playSoundEntityLocal(parent, 167, 128); createParticleDot(parent); createParticleCircling(parent, 100, my->particleTimerCountdownSprite); my->particleTimerCountdownAction = 0; } } // fire once off. else if ( my->particleTimerCountdownAction == PARTICLE_TIMER_ACTION_SUMMON_MONSTER ) { if ( my->particleTimerCountdownAction < 100 ) { my->light = lightSphereShadow(my->x / 16, my->y / 16, 5, 92); playSoundEntityLocal(my, 167, 128); createParticleDropRising(my, 680, 1.0); createParticleCircling(my, 70, my->particleTimerCountdownSprite); my->particleTimerCountdownAction = 0; } } // fire once off. else if ( my->particleTimerCountdownAction == PARTICLE_TIMER_ACTION_DEVIL_SUMMON_MONSTER ) { if ( my->particleTimerCountdownAction < 100 ) { my->light = lightSphereShadow(my->x / 16, my->y / 16, 5, 92); playSoundEntityLocal(my, 167, 128); createParticleDropRising(my, 593, 1.0); createParticleCircling(my, 70, my->particleTimerCountdownSprite); my->particleTimerCountdownAction = 0; } } // continually fire else if ( my->particleTimerCountdownAction == PARTICLE_TIMER_ACTION_SPELL_SUMMON ) { if ( multiplayer != CLIENT && my->particleTimerPreDelay != -100 ) { // once-off hack :) spawnExplosion(my->x, my->y, -1); playSoundEntity(my, 171, 128); my->particleTimerPreDelay = -100; createParticleErupt(my, my->particleTimerCountdownSprite); serverSpawnMiscParticles(my, PARTICLE_EFFECT_ERUPT, my->particleTimerCountdownSprite); } } // fire once off. else if ( my->particleTimerCountdownAction == PARTICLE_EFFECT_TELEPORT_PULL_TARGET_LOCATION ) { createParticleDropRising(my, my->particleTimerCountdownSprite, 1.0); my->particleTimerCountdownAction = 0; } } else { --my->particleTimerPreDelay; } } } void actParticleSap(Entity* my) { real_t decel = 0.9; real_t accel = 0.9; real_t z_accel = accel; real_t z_decel = decel; real_t minSpeed = 0.05; if ( PARTICLE_LIFE < 0 ) { list_RemoveNode(my->mynode); return; } else { if ( my->sprite == 977 ) // boomerang { if ( my->skill[3] == 1 ) { // specific for the animation I want... // magic numbers that take approximately 75 frames (50% of travel time) to go outward or inward. // acceleration is a little faster to overshoot into the right hand side. decel = 0.9718; accel = 0.9710; z_decel = decel; z_accel = z_decel; } else { decel = 0.95; accel = 0.949; z_decel = 0.9935; z_accel = z_decel; } Entity* particle = spawnMagicParticleCustom(my, (rand() % 2) ? 943 : 979, 1, 10); if ( particle ) { particle->focalx = 2; particle->focaly = -2; particle->focalz = 2.5; } if ( PARTICLE_LIFE < 100 && my->ticks % 6 == 0 ) { if ( PARTICLE_LIFE < 70 ) { playSoundEntityLocal(my, 434 + rand() % 10, 64); } else { playSoundEntityLocal(my, 434 + rand() % 10, 32); } } //particle->flags[SPRITE] = true; } else { spawnMagicParticle(my); } Entity* parent = uidToEntity(my->parent); if ( parent ) { my->x = parent->x + my->fskill[0]; my->y = parent->y + my->fskill[1]; } else { list_RemoveNode(my->mynode); return; } if ( my->skill[1] == 0 ) { // move outwards diagonally. if ( abs(my->vel_z) > minSpeed ) { my->fskill[0] += my->vel_x; my->fskill[1] += my->vel_y; my->vel_x *= decel; my->vel_y *= decel; my->z += my->vel_z; my->vel_z *= z_decel; my->yaw += my->fskill[2]; my->pitch += my->fskill[3]; } else { my->skill[1] = 1; my->vel_x *= -1; my->vel_y *= -1; my->vel_z *= -1; } } else if ( my->skill[1] == 1 ) { // move inwards diagonally. if ( (abs(my->vel_z) < 0.08 && my->skill[3] == 0) || (abs(my->vel_z) < 0.4 && my->skill[3] == 1) ) { my->fskill[0] += my->vel_x; my->fskill[1] += my->vel_y; my->vel_x /= accel; my->vel_y /= accel; my->z += my->vel_z; my->vel_z /= z_accel; my->yaw += my->fskill[2]; my->pitch += my->fskill[3]; } else { // movement completed. my->skill[1] = 2; } } my->scalex *= 0.99; my->scaley *= 0.99; my->scalez *= 0.99; if ( my->sprite == 977 ) { my->scalex = 1.f; my->scaley = 1.f; my->scalez = 1.f; my->roll -= 0.5; my->pitch = std::max(my->pitch - 0.015, 0.0); } --PARTICLE_LIFE; } } void actParticleSapCenter(Entity* my) { // init if ( my->skill[3] == 0 ) { // for clients and server spawn the visible arcing particles. my->skill[3] = 1; createParticleSap(my); } if ( multiplayer == CLIENT ) { return; } Entity* parent = uidToEntity(my->parent); if ( parent ) { // if reached the caster, delete self and spawn some particles. if ( my->sprite == 977 && PARTICLE_LIFE > 1 ) { // store these in case parent dies. // boomerang doesn't check for collision until end of life. my->fskill[4] = parent->x; my->fskill[5] = parent->y; } else if ( entityInsideEntity(my, parent) || (my->sprite == 977 && PARTICLE_LIFE == 0) ) { if ( my->skill[6] == SPELL_STEAL_WEAPON ) { if ( my->skill[7] == 1 ) { // found stolen item. Item* item = newItemFromEntity(my); if ( parent->behavior == &actPlayer ) { itemPickup(parent->skill[2], item); } else if ( parent->behavior == &actMonster ) { parent->addItemToMonsterInventory(item); Stat *myStats = parent->getStats(); if ( myStats ) { node_t* weaponNode = itemNodeInInventory(myStats, static_cast<ItemType>(-1), WEAPON); if ( weaponNode ) { swapMonsterWeaponWithInventoryItem(parent, myStats, weaponNode, false, true); if ( myStats->type == INCUBUS ) { parent->monsterSpecialState = INCUBUS_TELEPORT_STEAL; parent->monsterSpecialTimer = 100 + rand() % MONSTER_SPECIAL_COOLDOWN_INCUBUS_TELEPORT_RANDOM; } } } } item = nullptr; } playSoundEntity(parent, 168, 128); spawnMagicEffectParticles(parent->x, parent->y, parent->z, my->skill[5]); } else if ( my->skill[6] == SPELL_DRAIN_SOUL ) { parent->modHP(my->skill[7]); parent->modMP(my->skill[8]); if ( parent->behavior == &actPlayer ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); messagePlayerColor(parent->skill[2], color, language[2445]); } playSoundEntity(parent, 168, 128); spawnMagicEffectParticles(parent->x, parent->y, parent->z, 169); } else if ( my->skill[6] == SHADOW_SPELLCAST ) { parent->shadowSpecialAbility(parent->monsterShadowInitialMimic); playSoundEntity(parent, 166, 128); spawnMagicEffectParticles(parent->x, parent->y, parent->z, my->skill[5]); } else if ( my->skill[6] == SPELL_SUMMON ) { parent->modMP(my->skill[7]); /*if ( parent->behavior == &actPlayer ) { Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); messagePlayerColor(parent->skill[2], color, language[774]); }*/ playSoundEntity(parent, 168, 128); spawnMagicEffectParticles(parent->x, parent->y, parent->z, 169); } else if ( my->skill[6] == SPELL_FEAR ) { playSoundEntity(parent, 168, 128); spawnMagicEffectParticles(parent->x, parent->y, parent->z, 174); Entity* caster = uidToEntity(my->skill[7]); if ( caster ) { spellEffectFear(nullptr, spellElement_fear, caster, parent, 0); } } else if ( my->sprite == 977 ) // boomerang { Item* item = newItemFromEntity(my); if ( parent->behavior == &actPlayer ) { item->ownerUid = parent->getUID(); Item* pickedUp = itemPickup(parent->skill[2], item); Uint32 color = SDL_MapRGB(mainsurface->format, 0, 255, 0); messagePlayerColor(parent->skill[2], color, language[3746], items[item->type].name_unidentified); achievementObserver.awardAchievementIfActive(parent->skill[2], parent, AchievementObserver::BARONY_ACH_IF_YOU_LOVE_SOMETHING); if ( pickedUp ) { if ( parent->skill[2] == 0 || (parent->skill[2] > 0 && splitscreen) ) { // pickedUp is the new inventory stack for server, free the original items free(item); item = nullptr; if ( multiplayer != CLIENT && !stats[parent->skill[2]]->weapon ) { useItem(pickedUp, parent->skill[2]); } auto& hotbar_t = players[parent->skill[2]]->hotbar; if ( hotbar_t.magicBoomerangHotbarSlot >= 0 ) { auto& hotbar = hotbar_t.slots(); hotbar[hotbar_t.magicBoomerangHotbarSlot].item = pickedUp->uid; for ( int i = 0; i < NUM_HOTBAR_SLOTS; ++i ) { if ( i != hotbar_t.magicBoomerangHotbarSlot && hotbar[i].item == pickedUp->uid ) { hotbar[i].item = 0; } } } } else { free(pickedUp); // item is the picked up items (item == pickedUp) } } } else if ( parent->behavior == &actMonster ) { parent->addItemToMonsterInventory(item); Stat *myStats = parent->getStats(); if ( myStats ) { node_t* weaponNode = itemNodeInInventory(myStats, static_cast<ItemType>(-1), WEAPON); if ( weaponNode ) { swapMonsterWeaponWithInventoryItem(parent, myStats, weaponNode, false, true); } } } playSoundEntity(parent, 431 + rand() % 3, 92); item = nullptr; } list_RemoveNode(my->mynode); return; } // calculate direction to caster and move. real_t tangent = atan2(parent->y - my->y, parent->x - my->x); real_t dist = sqrt(pow(my->x - parent->x, 2) + pow(my->y - parent->y, 2)); real_t speed = dist / std::max(PARTICLE_LIFE, 1); my->vel_x = speed * cos(tangent); my->vel_y = speed * sin(tangent); my->x += my->vel_x; my->y += my->vel_y; } else { if ( my->skill[6] == SPELL_SUMMON ) { real_t dist = sqrt(pow(my->x - my->skill[8], 2) + pow(my->y - my->skill[9], 2)); if ( dist < 4 ) { spawnMagicEffectParticles(my->skill[8], my->skill[9], 0, my->skill[5]); Entity* caster = uidToEntity(my->skill[7]); if ( caster && caster->behavior == &actPlayer && stats[caster->skill[2]] ) { // kill old summons. for ( node_t* node = stats[caster->skill[2]]->FOLLOWERS.first; node != nullptr; node = node->next ) { Entity* follower = nullptr; if ( (Uint32*)(node)->element ) { follower = uidToEntity(*((Uint32*)(node)->element)); } if ( follower && follower->monsterAllySummonRank != 0 ) { Stat* followerStats = follower->getStats(); if ( followerStats && followerStats->HP > 0 ) { follower->setMP(followerStats->MAXMP * (followerStats->HP / static_cast<float>(followerStats->MAXHP))); follower->setHP(0); } } } Monster creature = SKELETON; Entity* monster = summonMonster(creature, my->skill[8], my->skill[9]); if ( monster ) { Stat* monsterStats = monster->getStats(); monster->yaw = my->yaw - PI; if ( monsterStats ) { int magicLevel = 1; magicLevel = std::min(7, 1 + (stats[caster->skill[2]]->playerSummonLVLHP >> 16) / 5); monster->monsterAllySummonRank = magicLevel; strcpy(monsterStats->name, "skeleton knight"); forceFollower(*caster, *monster); monster->setEffect(EFF_STUNNED, true, 20, false); bool spawnSecondAlly = false; if ( (caster->getINT() + stats[caster->skill[2]]->PROFICIENCIES[PRO_MAGIC]) >= SKILL_LEVEL_EXPERT ) { spawnSecondAlly = true; } //parent->increaseSkill(PRO_LEADERSHIP); monster->monsterAllyIndex = caster->skill[2]; if ( multiplayer == SERVER ) { serverUpdateEntitySkill(monster, 42); // update monsterAllyIndex for clients. } // change the color of the hit entity. monster->flags[USERFLAG2] = true; serverUpdateEntityFlag(monster, USERFLAG2); if ( monsterChangesColorWhenAlly(monsterStats) ) { int bodypart = 0; for ( node_t* node = (monster)->children.first; node != nullptr; node = node->next ) { if ( bodypart >= LIMB_HUMANOID_TORSO ) { Entity* tmp = (Entity*)node->element; if ( tmp ) { tmp->flags[USERFLAG2] = true; serverUpdateEntityFlag(tmp, USERFLAG2); } } ++bodypart; } } if ( spawnSecondAlly ) { Entity* monster = summonMonster(creature, my->skill[8], my->skill[9]); if ( monster ) { if ( multiplayer != CLIENT ) { spawnExplosion(monster->x, monster->y, -1); playSoundEntity(monster, 171, 128); createParticleErupt(monster, 791); serverSpawnMiscParticles(monster, PARTICLE_EFFECT_ERUPT, 791); } Stat* monsterStats = monster->getStats(); monster->yaw = my->yaw - PI; if ( monsterStats ) { strcpy(monsterStats->name, "skeleton sentinel"); magicLevel = 1; if ( stats[caster->skill[2]] ) { magicLevel = std::min(7, 1 + (stats[caster->skill[2]]->playerSummon2LVLHP >> 16) / 5); } monster->monsterAllySummonRank = magicLevel; forceFollower(*caster, *monster); monster->setEffect(EFF_STUNNED, true, 20, false); monster->monsterAllyIndex = caster->skill[2]; if ( multiplayer == SERVER ) { serverUpdateEntitySkill(monster, 42); // update monsterAllyIndex for clients. } if ( caster && caster->behavior == &actPlayer ) { steamAchievementClient(caster->skill[2], "BARONY_ACH_SKELETON_CREW"); } // change the color of the hit entity. monster->flags[USERFLAG2] = true; serverUpdateEntityFlag(monster, USERFLAG2); if ( monsterChangesColorWhenAlly(monsterStats) ) { int bodypart = 0; for ( node_t* node = (monster)->children.first; node != nullptr; node = node->next ) { if ( bodypart >= LIMB_HUMANOID_TORSO ) { Entity* tmp = (Entity*)node->element; if ( tmp ) { tmp->flags[USERFLAG2] = true; serverUpdateEntityFlag(tmp, USERFLAG2); } } ++bodypart; } } } } } } } } list_RemoveNode(my->mynode); return; } // calculate direction to caster and move. real_t tangent = atan2(my->skill[9] - my->y, my->skill[8] - my->x); real_t speed = dist / PARTICLE_LIFE; my->vel_x = speed * cos(tangent); my->vel_y = speed * sin(tangent); my->x += my->vel_x; my->y += my->vel_y; } else if ( my->skill[6] == SPELL_STEAL_WEAPON ) { Entity* entity = newEntity(-1, 1, map.entities, nullptr); //Item entity. entity->flags[INVISIBLE] = true; entity->flags[UPDATENEEDED] = true; entity->x = my->x; entity->y = my->y; entity->sizex = 4; entity->sizey = 4; entity->yaw = my->yaw; entity->vel_x = (rand() % 20 - 10) / 10.0; entity->vel_y = (rand() % 20 - 10) / 10.0; entity->vel_z = -.5; entity->flags[PASSABLE] = true; entity->flags[USERFLAG1] = true; // speeds up game when many items are dropped entity->behavior = &actItem; entity->skill[10] = my->skill[10]; entity->skill[11] = my->skill[11]; entity->skill[12] = my->skill[12]; entity->skill[13] = my->skill[13]; entity->skill[14] = my->skill[14]; entity->skill[15] = my->skill[15]; entity->itemOriginalOwner = my->itemOriginalOwner; entity->parent = 0; // no parent, no target to travel to. list_RemoveNode(my->mynode); return; } else if ( my->sprite == 977 ) { // calculate direction to caster and move. real_t tangent = atan2(my->fskill[5] - my->y, my->fskill[4] - my->x); real_t dist = sqrt(pow(my->x - my->fskill[4], 2) + pow(my->y - my->fskill[5], 2)); real_t speed = dist / std::max(PARTICLE_LIFE, 1); if ( dist < 4 || (abs(my->fskill[5]) < 0.001 && abs(my->fskill[4]) < 0.001) ) { // reached goal, or goal not set then spawn the item. Entity* entity = newEntity(-1, 1, map.entities, nullptr); //Item entity. entity->flags[INVISIBLE] = true; entity->flags[UPDATENEEDED] = true; entity->x = my->x; entity->y = my->y; entity->sizex = 4; entity->sizey = 4; entity->yaw = my->yaw; entity->vel_x = (rand() % 20 - 10) / 10.0; entity->vel_y = (rand() % 20 - 10) / 10.0; entity->vel_z = -.5; entity->flags[PASSABLE] = true; entity->flags[USERFLAG1] = true; // speeds up game when many items are dropped entity->behavior = &actItem; entity->skill[10] = my->skill[10]; entity->skill[11] = my->skill[11]; entity->skill[12] = my->skill[12]; entity->skill[13] = my->skill[13]; entity->skill[14] = my->skill[14]; entity->skill[15] = my->skill[15]; entity->itemOriginalOwner = 0; entity->parent = 0; list_RemoveNode(my->mynode); return; } my->vel_x = speed * cos(tangent); my->vel_y = speed * sin(tangent); my->x += my->vel_x; my->y += my->vel_y; } else { // no parent, no target to travel to. list_RemoveNode(my->mynode); return; } } if ( PARTICLE_LIFE < 0 ) { list_RemoveNode(my->mynode); return; } else { --PARTICLE_LIFE; } } void createParticleExplosionCharge(Entity* parent, int sprite, int particleCount, double scale) { if ( !parent ) { return; } for ( int c = 0; c < particleCount; c++ ) { // shoot drops to the sky Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = parent->x - 3 + rand() % 7; entity->y = parent->y - 3 + rand() % 7; entity->z = 0 + rand() % 190; if ( parent && parent->behavior == &actPlayer ) { entity->z /= 2; } entity->vel_z = -1; entity->yaw = (rand() % 360) * PI / 180.0; entity->particleDuration = entity->z + 10; /*if ( rand() % 5 > 0 ) { entity->vel_x = 0.5*cos(entity->yaw); entity->vel_y = 0.5*sin(entity->yaw); entity->particleDuration = 6; entity->z = 0; entity->vel_z = 0.5 *(-1 + rand() % 3); }*/ entity->scalex *= scale; entity->scaley *= scale; entity->scalez *= scale; entity->behavior = &actParticleExplosionCharge; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; entity->parent = parent->getUID(); if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); } int radius = STRIKERANGE * 2 / 3; real_t arc = PI / 16; int randScale = 1; for ( int c = 0; c < 128; c++ ) { // shoot drops to the sky Entity* entity = newEntity(670, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->yaw = 0 + c * arc; entity->x = parent->x + (radius * cos(entity->yaw));// - 2 + rand() % 5; entity->y = parent->y + (radius * sin(entity->yaw));// - 2 + rand() % 5; entity->z = radius + 150; entity->particleDuration = entity->z + rand() % 3; entity->vel_z = -1; if ( parent && parent->behavior == &actPlayer ) { entity->z /= 2; } randScale = 1 + rand() % 3; entity->scalex *= (scale / randScale); entity->scaley *= (scale / randScale); entity->scalez *= (scale / randScale); entity->behavior = &actParticleExplosionCharge; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; entity->parent = parent->getUID(); if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); if ( c > 0 && c % 16 == 0 ) { radius -= 2; } } } void actParticleExplosionCharge(Entity* my) { if ( PARTICLE_LIFE < 0 || (my->z < -4 && rand() % 4 == 0) || (ticks % 14 == 0 && uidToEntity(my->parent) == nullptr) ) { list_RemoveNode(my->mynode); } else { --PARTICLE_LIFE; my->yaw += 0.1; my->x += my->vel_x; my->y += my->vel_y; my->z += my->vel_z; my->scalex /= 0.99; my->scaley /= 0.99; my->scalez /= 0.99; //my->z -= 0.01; } return; } bool Entity::magicFallingCollision() { hit.entity = nullptr; if ( z <= -5 || fabs(vel_z) < 0.01 ) { // check if particle stopped or too high. return false; } if ( z >= 7.5 ) { return true; } if ( actmagicIsVertical == MAGIC_ISVERTICAL_Z ) { std::vector<list_t*> entLists = TileEntityList.getEntitiesWithinRadiusAroundEntity(this, 1); for ( std::vector<list_t*>::iterator it = entLists.begin(); it != entLists.end(); ++it ) { list_t* currentList = *it; node_t* node; for ( node = currentList->first; node != nullptr; node = node->next ) { Entity* entity = (Entity*)node->element; if ( entity ) { if ( entity == this ) { continue; } if ( entityInsideEntity(this, entity) && !entity->flags[PASSABLE] && (entity->getUID() != this->parent) ) { hit.entity = entity; //hit.side = HORIZONTAL; return true; } } } } } return false; } bool Entity::magicOrbitingCollision() { hit.entity = nullptr; if ( this->actmagicIsOrbiting == 2 ) { if ( this->ticks == 5 && this->actmagicOrbitHitTargetUID4 != 0 ) { // hit this target automatically Entity* tmp = uidToEntity(actmagicOrbitHitTargetUID4); if ( tmp ) { hit.entity = tmp; return true; } } if ( this->z < -8 || this->z > 3 ) { return false; } else if ( this->ticks >= 12 && this->ticks % 4 != 0 ) // check once every 4 ticks, after the missile is alive for a bit { return false; } } else if ( this->z < -10 ) { return false; } if ( this->actmagicIsOrbiting == 2 ) { if ( this->actmagicOrbitStationaryHitTarget >= 3 ) { return false; } } Entity* caster = uidToEntity(parent); std::vector<list_t*> entLists = TileEntityList.getEntitiesWithinRadiusAroundEntity(this, 1); for ( std::vector<list_t*>::iterator it = entLists.begin(); it != entLists.end(); ++it ) { list_t* currentList = *it; node_t* node; for ( node = currentList->first; node != NULL; node = node->next ) { Entity* entity = (Entity*)node->element; if ( entity == this ) { continue; } if ( entity->behavior != &actMonster && entity->behavior != &actPlayer && entity->behavior != &actDoor && entity->behavior != &::actChest && entity->behavior != &::actFurniture ) { continue; } if ( caster && !(svFlags & SV_FLAG_FRIENDLYFIRE) && caster->checkFriend(entity) ) { continue; } if ( actmagicIsOrbiting == 2 ) { if ( static_cast<Uint32>(actmagicOrbitHitTargetUID1) == entity->getUID() || static_cast<Uint32>(actmagicOrbitHitTargetUID2) == entity->getUID() || static_cast<Uint32>(actmagicOrbitHitTargetUID3) == entity->getUID() || static_cast<Uint32>(actmagicOrbitHitTargetUID4) == entity->getUID() ) { // we already hit these guys. continue; } } if ( entityInsideEntity(this, entity) && !entity->flags[PASSABLE] && (entity->getUID() != this->parent) ) { hit.entity = entity; if ( hit.entity->behavior == &actMonster || hit.entity->behavior == &actPlayer ) { if ( actmagicIsOrbiting == 2 ) { if ( actmagicOrbitHitTargetUID4 != 0 && caster && caster->behavior == &actPlayer ) { if ( actmagicOrbitHitTargetUID1 == 0 && actmagicOrbitHitTargetUID2 == 0 && actmagicOrbitHitTargetUID3 == 0 && hit.entity->behavior == &actMonster ) { steamStatisticUpdateClient(caster->skill[2], STEAM_STAT_VOLATILE, STEAM_STAT_INT, 1); } } ++actmagicOrbitStationaryHitTarget; if ( actmagicOrbitHitTargetUID1 == 0 ) { actmagicOrbitHitTargetUID1 = entity->getUID(); } else if ( actmagicOrbitHitTargetUID2 == 0 ) { actmagicOrbitHitTargetUID2 = entity->getUID(); } else if ( actmagicOrbitHitTargetUID3 == 0 ) { actmagicOrbitHitTargetUID3 = entity->getUID(); } } } return true; } } } return false; } void Entity::castFallingMagicMissile(int spellID, real_t distFromCaster, real_t angleFromCasterDirection, int heightDelay) { spell_t* spell = getSpellFromID(spellID); Entity* entity = castSpell(getUID(), spell, false, true); if ( entity ) { entity->x = x + distFromCaster * cos(yaw + angleFromCasterDirection); entity->y = y + distFromCaster * sin(yaw + angleFromCasterDirection); entity->z = -25 - heightDelay; double missile_speed = 4 * ((double)(((spellElement_t*)(spell->elements.first->element))->mana) / ((spellElement_t*)(spell->elements.first->element))->overload_multiplier); entity->vel_x = 0.0; entity->vel_y = 0.0; entity->vel_z = 0.5 * (missile_speed); entity->pitch = PI / 2; entity->actmagicIsVertical = MAGIC_ISVERTICAL_Z; spawnMagicEffectParticles(entity->x, entity->y, 0, 174); playSoundEntity(entity, spellGetCastSound(spell), 128); } } Entity* Entity::castOrbitingMagicMissile(int spellID, real_t distFromCaster, real_t angleFromCasterDirection, int duration) { spell_t* spell = getSpellFromID(spellID); Entity* entity = castSpell(getUID(), spell, false, true); if ( entity ) { if ( spellID == SPELL_FIREBALL ) { entity->sprite = 671; } else if ( spellID == SPELL_MAGICMISSILE ) { entity->sprite = 679; } entity->yaw = angleFromCasterDirection; entity->x = x + distFromCaster * cos(yaw + entity->yaw); entity->y = y + distFromCaster * sin(yaw + entity->yaw); entity->z = -2.5; double missile_speed = 4 * ((double)(((spellElement_t*)(spell->elements.first->element))->mana) / ((spellElement_t*)(spell->elements.first->element))->overload_multiplier); entity->vel_x = 0.0; entity->vel_y = 0.0; entity->actmagicIsOrbiting = 1; entity->actmagicOrbitDist = distFromCaster; entity->actmagicOrbitStartZ = entity->z; entity->z += 4 * sin(angleFromCasterDirection); entity->roll += (PI / 8) * (1 - abs(sin(angleFromCasterDirection))); entity->actmagicOrbitVerticalSpeed = 0.1; entity->actmagicOrbitVerticalDirection = 1; entity->actmagicOrbitLifetime = duration; entity->vel_z = entity->actmagicOrbitVerticalSpeed; playSoundEntity(entity, spellGetCastSound(spell), 128); //spawnMagicEffectParticles(entity->x, entity->y, 0, 174); } return entity; } Entity* castStationaryOrbitingMagicMissile(Entity* parent, int spellID, real_t centerx, real_t centery, real_t distFromCenter, real_t angleFromCenterDirection, int duration) { spell_t* spell = getSpellFromID(spellID); if ( !parent ) { Entity* entity = newEntity(-1, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = centerx; entity->y = centery; entity->z = 15; entity->vel_z = 0; //entity->yaw = (rand() % 360) * PI / 180.0; entity->skill[0] = 100; entity->skill[1] = 10; entity->behavior = &actParticleDot; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; entity->flags[INVISIBLE] = true; parent = entity; } Stat* stats = parent->getStats(); bool amplify = false; if ( stats ) { amplify = stats->EFFECTS[EFF_MAGICAMPLIFY]; stats->EFFECTS[EFF_MAGICAMPLIFY] = false; // temporary skip amplify effects otherwise recursion. } Entity* entity = castSpell(parent->getUID(), spell, false, true); if ( stats ) { stats->EFFECTS[EFF_MAGICAMPLIFY] = amplify; } if ( entity ) { if ( spellID == SPELL_FIREBALL ) { entity->sprite = 671; } else if ( spellID == SPELL_COLD ) { entity->sprite = 797; } else if ( spellID == SPELL_LIGHTNING ) { entity->sprite = 798; } else if ( spellID == SPELL_MAGICMISSILE ) { entity->sprite = 679; } entity->yaw = angleFromCenterDirection; entity->x = centerx; entity->y = centery; entity->z = 4; double missile_speed = 4 * ((double)(((spellElement_t*)(spell->elements.first->element))->mana) / ((spellElement_t*)(spell->elements.first->element))->overload_multiplier); entity->vel_x = 0.0; entity->vel_y = 0.0; entity->actmagicIsOrbiting = 2; entity->actmagicOrbitDist = distFromCenter; entity->actmagicOrbitStationaryCurrentDist = 0.0; entity->actmagicOrbitStartZ = entity->z; //entity->roll -= (PI / 8); entity->actmagicOrbitVerticalSpeed = -0.3; entity->actmagicOrbitVerticalDirection = 1; entity->actmagicOrbitLifetime = duration; entity->actmagicOrbitStationaryX = centerx; entity->actmagicOrbitStationaryY = centery; entity->vel_z = -0.1; playSoundEntity(entity, spellGetCastSound(spell), 128); //spawnMagicEffectParticles(entity->x, entity->y, 0, 174); } return entity; } void createParticleFollowerCommand(real_t x, real_t y, real_t z, int sprite) { Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. //entity->sizex = 1; //entity->sizey = 1; entity->x = x; entity->y = y; entity->z = 7.5; entity->vel_z = -0.8; //entity->yaw = (rand() % 360) * PI / 180.0; entity->skill[0] = 50; entity->behavior = &actParticleFollowerCommand; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); // boosty boost for ( int c = 0; c < 10; c++ ) { entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity. entity->x = x - 4 + rand() % 9; entity->y = y - 4 + rand() % 9; entity->z = z - 0 + rand() % 11; entity->scalex = 0.7; entity->scaley = 0.7; entity->scalez = 0.7; entity->sizex = 1; entity->sizey = 1; entity->yaw = (rand() % 360) * PI / 180.f; entity->flags[PASSABLE] = true; entity->flags[BRIGHT] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; entity->behavior = &actMagicParticle; entity->vel_z = -1; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); } } void actParticleFollowerCommand(Entity* my) { if ( PARTICLE_LIFE < 0 ) { list_RemoveNode(my->mynode); return; } else { --PARTICLE_LIFE; my->z += my->vel_z; my->yaw += my->vel_z * 2; if ( my->z < -3 ) { my->vel_z *= 0.9; } } } void actParticleShadowTag(Entity* my) { if ( PARTICLE_LIFE < 0 ) { // once off, fire some erupt dot particles at end of life. real_t yaw = 0; int numParticles = 8; for ( int c = 0; c < 8; c++ ) { Entity* entity = newEntity(871, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = my->x; entity->y = my->y; entity->z = -10 + my->fskill[0]; entity->yaw = yaw; entity->vel_x = 0.2; entity->vel_y = 0.2; entity->vel_z = -0.02; entity->skill[0] = 100; entity->skill[1] = 0; // direction. entity->fskill[0] = 0.1; entity->behavior = &actParticleErupt; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); yaw += 2 * PI / numParticles; } if ( multiplayer != CLIENT ) { Uint32 casterUid = static_cast<Uint32>(my->skill[2]); Entity* caster = uidToEntity(casterUid); Entity* parent = uidToEntity(my->parent); if ( caster && caster->behavior == &actPlayer && parent ) { // caster is alive, notify they lost their mark Uint32 color = SDL_MapRGB(mainsurface->format, 255, 255, 255); if ( parent->getStats() ) { messagePlayerMonsterEvent(caster->skill[2], color, *(parent->getStats()), language[3466], language[3467], MSG_COMBAT); parent->setEffect(EFF_SHADOW_TAGGED, false, 0, true); } } } my->removeLightField(); list_RemoveNode(my->mynode); return; } else { --PARTICLE_LIFE; my->removeLightField(); my->light = lightSphereShadow(my->x / 16, my->y / 16, 3, 92); Entity* parent = uidToEntity(my->parent); if ( parent ) { my->x = parent->x; my->y = parent->y; } if ( my->skill[1] >= 50 ) // stop changing size { real_t maxspeed = .03; real_t acceleration = 0.95; if ( my->skill[3] == 0 ) { // once off, store the normal height of the particle. my->skill[3] = 1; my->vel_z = -maxspeed; } if ( my->skill[1] % 5 == 0 ) { Uint32 casterUid = static_cast<Uint32>(my->skill[2]); Entity* caster = uidToEntity(casterUid); if ( caster && caster->creatureShadowTaggedThisUid == my->parent && parent ) { // caster is alive, and they have still marked the parent this particle is following. } else { PARTICLE_LIFE = 0; } } if ( PARTICLE_LIFE > 0 && PARTICLE_LIFE < TICKS_PER_SECOND ) { if ( parent && parent->getStats() && parent->getStats()->EFFECTS[EFF_SHADOW_TAGGED] ) { ++PARTICLE_LIFE; } } // bob up and down movement. if ( my->skill[3] == 1 ) { my->vel_z *= acceleration; if ( my->vel_z > -0.005 ) { my->skill[3] = 2; my->vel_z = -0.005; } my->z += my->vel_z; } else if ( my->skill[3] == 2 ) { my->vel_z /= acceleration; if ( my->vel_z < -maxspeed ) { my->skill[3] = 3; my->vel_z = -maxspeed; } my->z -= my->vel_z; } else if ( my->skill[3] == 3 ) { my->vel_z *= acceleration; if ( my->vel_z > -0.005 ) { my->skill[3] = 4; my->vel_z = -0.005; } my->z -= my->vel_z; } else if ( my->skill[3] == 4 ) { my->vel_z /= acceleration; if ( my->vel_z < -maxspeed ) { my->skill[3] = 1; my->vel_z = -maxspeed; } my->z += my->vel_z; } my->yaw += 0.01; } else { my->z += my->vel_z; my->yaw += my->vel_z * 2; if ( my->scalex < 0.5 ) { my->scalex += 0.02; } else { my->scalex = 0.5; } my->scaley = my->scalex; my->scalez = my->scalex; if ( my->z < -3 + my->fskill[0] ) { my->vel_z *= 0.9; } } // once off, fire some erupt dot particles at start. if ( my->skill[1] == 0 ) { real_t yaw = 0; int numParticles = 8; for ( int c = 0; c < 8; c++ ) { Entity* entity = newEntity(871, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = my->x; entity->y = my->y; entity->z = -10 + my->fskill[0]; entity->yaw = yaw; entity->vel_x = 0.2; entity->vel_y = 0.2; entity->vel_z = -0.02; entity->skill[0] = 100; entity->skill[1] = 0; // direction. entity->fskill[0] = 0.1; entity->behavior = &actParticleErupt; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); yaw += 2 * PI / numParticles; } } ++my->skill[1]; } } void createParticleShadowTag(Entity* parent, Uint32 casterUid, int duration) { if ( !parent ) { return; } Entity* entity = newEntity(870, 1, map.entities, nullptr); //Particle entity. entity->parent = parent->getUID(); entity->x = parent->x; entity->y = parent->y; entity->z = 7.5; entity->fskill[0] = parent->z; entity->vel_z = -0.8; entity->scalex = 0.1; entity->scaley = 0.1; entity->scalez = 0.1; entity->yaw = (rand() % 360) * PI / 180.0; entity->skill[0] = duration; entity->skill[1] = 0; entity->skill[2] = static_cast<Sint32>(casterUid); entity->skill[3] = 0; entity->behavior = &actParticleShadowTag; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); } void createParticleCharmMonster(Entity* parent) { if ( !parent ) { return; } Entity* entity = newEntity(685, 1, map.entities, nullptr); //Particle entity. //entity->sizex = 1; //entity->sizey = 1; entity->parent = parent->getUID(); entity->x = parent->x; entity->y = parent->y; entity->z = 7.5; entity->vel_z = -0.8; entity->scalex = 0.1; entity->scaley = 0.1; entity->scalez = 0.1; entity->yaw = (rand() % 360) * PI / 180.0; entity->skill[0] = 45; entity->behavior = &actParticleCharmMonster; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); } void actParticleCharmMonster(Entity* my) { if ( PARTICLE_LIFE < 0 ) { real_t yaw = 0; int numParticles = 8; for ( int c = 0; c < 8; c++ ) { Entity* entity = newEntity(576, 1, map.entities, nullptr); //Particle entity. entity->sizex = 1; entity->sizey = 1; entity->x = my->x; entity->y = my->y; entity->z = -10; entity->yaw = yaw; entity->vel_x = 0.2; entity->vel_y = 0.2; entity->vel_z = -0.02; entity->skill[0] = 100; entity->skill[1] = 0; // direction. entity->fskill[0] = 0.1; entity->behavior = &actParticleErupt; entity->flags[PASSABLE] = true; entity->flags[NOUPDATE] = true; entity->flags[UNCLICKABLE] = true; if ( multiplayer != CLIENT ) { entity_uids--; } entity->setUID(-3); yaw += 2 * PI / numParticles; } list_RemoveNode(my->mynode); return; } else { --PARTICLE_LIFE; Entity* parent = uidToEntity(my->parent); if ( parent ) { my->x = parent->x; my->y = parent->y; } my->z += my->vel_z; my->yaw += my->vel_z * 2; if ( my->scalex < 0.8 ) { my->scalex += 0.02; } else { my->scalex = 0.8; } my->scaley = my->scalex; my->scalez = my->scalex; if ( my->z < -3 ) { my->vel_z *= 0.9; } } } void spawnMagicTower(Entity* parent, real_t x, real_t y, int spellID, Entity* autoHitTarget, bool castedSpell) { bool autoHit = false; if ( autoHitTarget && (autoHitTarget->behavior == &actPlayer || autoHitTarget->behavior == &actMonster) ) { autoHit = true; if ( parent ) { if ( !(svFlags & SV_FLAG_FRIENDLYFIRE) && parent->checkFriend(autoHitTarget) ) { autoHit = false; // don't hit friendlies } } } Entity* orbit = castStationaryOrbitingMagicMissile(parent, spellID, x, y, 16.0, 0.0, 40); if ( orbit ) { if ( castedSpell ) { orbit->actmagicOrbitCastFromSpell = 1; } if ( autoHit ) { orbit->actmagicOrbitHitTargetUID4 = autoHitTarget->getUID(); } } orbit = castStationaryOrbitingMagicMissile(parent, spellID, x, y, 16.0, 2 * PI / 3, 40); if ( orbit ) { if ( castedSpell ) { orbit->actmagicOrbitCastFromSpell = 1; } if ( autoHit ) { orbit->actmagicOrbitHitTargetUID4 = autoHitTarget->getUID(); } } orbit = castStationaryOrbitingMagicMissile(parent, spellID, x, y, 16.0, 4 * PI / 3, 40); if ( orbit ) { if ( castedSpell ) { orbit->actmagicOrbitCastFromSpell = 1; } if ( autoHit ) { orbit->actmagicOrbitHitTargetUID4 = autoHitTarget->getUID(); } } spawnMagicEffectParticles(x, y, 0, 174); spawnExplosion(x, y, -4 + rand() % 8); } void magicDig(Entity* parent, Entity* projectile, int numRocks, int randRocks) { if ( !hit.entity ) { if ( map.tiles[(int)(OBSTACLELAYER + hit.mapy * MAPLAYERS + hit.mapx * MAPLAYERS * map.height)] != 0 ) { if ( parent && parent->behavior == &actPlayer && MFLAG_DISABLEDIGGING ) { Uint32 color = SDL_MapRGB(mainsurface->format, 255, 0, 255); messagePlayerColor(parent->skill[2], color, language[2380]); // disabled digging. playSoundPos(hit.x, hit.y, 66, 128); // strike wall } else { if ( projectile ) { playSoundEntity(projectile, 66, 128); playSoundEntity(projectile, 67, 128); } // spawn several rock items if ( randRocks <= 0 ) { randRocks = 1; } int i = numRocks + rand() % randRocks; for ( int c = 0; c < i; c++ ) { Entity* rock = newEntity(-1, 1, map.entities, nullptr); //Rock entity. rock->flags[INVISIBLE] = true; rock->flags[UPDATENEEDED] = true; rock->x = hit.mapx * 16 + 4 + rand() % 8; rock->y = hit.mapy * 16 + 4 + rand() % 8; rock->z = -6 + rand() % 12; rock->sizex = 4; rock->sizey = 4; rock->yaw = rand() % 360 * PI / 180; rock->vel_x = (rand() % 20 - 10) / 10.0; rock->vel_y = (rand() % 20 - 10) / 10.0; rock->vel_z = -.25 - (rand() % 5) / 10.0; rock->flags[PASSABLE] = true; rock->behavior = &actItem; rock->flags[USERFLAG1] = true; // no collision: helps performance rock->skill[10] = GEM_ROCK; // type rock->skill[11] = WORN; // status rock->skill[12] = 0; // beatitude rock->skill[13] = 1; // count rock->skill[14] = 0; // appearance rock->skill[15] = 1; // identified } if ( map.tiles[(int)(OBSTACLELAYER + hit.mapy * MAPLAYERS + hit.mapx * MAPLAYERS * map.height)] >= 41 && map.tiles[(int)(OBSTACLELAYER + hit.mapy * MAPLAYERS + hit.mapx * MAPLAYERS * map.height)] <= 49 ) { steamAchievementEntity(parent, "BARONY_ACH_BAD_REVIEW"); } map.tiles[(int)(OBSTACLELAYER + hit.mapy * MAPLAYERS + hit.mapx * MAPLAYERS * map.height)] = 0; // send wall destroy info to clients for ( int c = 1; c < MAXPLAYERS; c++ ) { if ( client_disconnected[c] == true ) { continue; } strcpy((char*)net_packet->data, "WALD"); SDLNet_Write16((Uint16)hit.mapx, &net_packet->data[4]); SDLNet_Write16((Uint16)hit.mapy, &net_packet->data[6]); net_packet->address.host = net_clients[c - 1].host; net_packet->address.port = net_clients[c - 1].port; net_packet->len = 8; sendPacketSafe(net_sock, -1, net_packet, c - 1); } generatePathMaps(); } } } else if ( hit.entity->behavior == &actBoulder ) { int i = numRocks + rand() % 4; // spawn several rock items //TODO: This should really be its own function. int c; for ( c = 0; c < i; c++ ) { Entity* entity = newEntity(-1, 1, map.entities, nullptr); //Rock entity. entity->flags[INVISIBLE] = true; entity->flags[UPDATENEEDED] = true; entity->x = hit.entity->x - 4 + rand() % 8; entity->y = hit.entity->y - 4 + rand() % 8; entity->z = -6 + rand() % 12; entity->sizex = 4; entity->sizey = 4; entity->yaw = rand() % 360 * PI / 180; entity->vel_x = (rand() % 20 - 10) / 10.0; entity->vel_y = (rand() % 20 - 10) / 10.0; entity->vel_z = -.25 - (rand() % 5) / 10.0; entity->flags[PASSABLE] = true; entity->behavior = &actItem; entity->flags[USERFLAG1] = true; // no collision: helps performance entity->skill[10] = GEM_ROCK; // type entity->skill[11] = WORN; // status entity->skill[12] = 0; // beatitude entity->skill[13] = 1; // count entity->skill[14] = 0; // appearance entity->skill[15] = false; // identified } double ox = hit.entity->x; double oy = hit.entity->y; boulderLavaOrArcaneOnDestroy(hit.entity, hit.entity->sprite, nullptr); // destroy the boulder playSoundEntity(hit.entity, 67, 128); list_RemoveNode(hit.entity->mynode); if ( parent ) { if ( parent->behavior == &actPlayer ) { messagePlayer(parent->skill[2], language[405]); } } // on sokoban, destroying boulders spawns scorpions if ( !strcmp(map.name, "Sokoban") ) { Entity* monster = nullptr; if ( rand() % 2 == 0 ) { monster = summonMonster(INSECTOID, ox, oy); } else { monster = summonMonster(SCORPION, ox, oy); } if ( monster ) { int c; for ( c = 0; c < MAXPLAYERS; c++ ) { Uint32 color = SDL_MapRGB(mainsurface->format, 255, 128, 0); messagePlayerColor(c, color, language[406]); } } boulderSokobanOnDestroy(false); } } }
29.783274
282
0.577248
5fa658ac529f8e81773e24942e02add435d07be5
1,504
hpp
C++
quat_ez.hpp
JBannwarth/vrpn_logger
b103beef82d9c5b2bd80f1b8bd1728ebef251f88
[ "MIT" ]
null
null
null
quat_ez.hpp
JBannwarth/vrpn_logger
b103beef82d9c5b2bd80f1b8bd1728ebef251f88
[ "MIT" ]
null
null
null
quat_ez.hpp
JBannwarth/vrpn_logger
b103beef82d9c5b2bd80f1b8bd1728ebef251f88
[ "MIT" ]
null
null
null
/* The MIT License (MIT) Copyright (c) 2015 Jérémie Bannwarth Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef QUAT_EZ #define QUAT_EZ #include "quat.h" struct position { double x, y, z; }; struct rotation_quat { double qx, qy, qz, qw; }; struct rotation_euler { double roll, pitch, yaw; }; extern void quat_to_euler(rotation_euler* euler, rotation_quat* quaternion); extern void euler_to_quat(rotation_quat* quaternion, rotation_euler* euler); extern double radian_to_degree(double angle_radian); #endif
28.923077
78
0.787899
5fa6c1fc9fd0f0600e4fc378eb3b90af03ed94e3
1,148
cc
C++
src/rpc/message_channel.cc
epfl-labos/POCC
6d564356105db6fb5163f8bfa6469ae8ab04852d
[ "Apache-2.0" ]
2
2019-04-12T07:07:18.000Z
2020-08-06T12:37:23.000Z
src/rpc/message_channel.cc
epfl-labos/POCC
6d564356105db6fb5163f8bfa6469ae8ab04852d
[ "Apache-2.0" ]
null
null
null
src/rpc/message_channel.cc
epfl-labos/POCC
6d564356105db6fb5163f8bfa6469ae8ab04852d
[ "Apache-2.0" ]
null
null
null
/* * POCC * * Copyright 2017 Operating Systems Laboratory EPFL * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "rpc/message_channel.h" namespace scc { MessageChannel::MessageChannel(std::string host, unsigned short port) : _host(host), _port(port), _socket(NULL) { // create a socket and connect to the remote server _socket = new TCPSocket(host, port); } // A socket should not be used in multiple message channels. MessageChannel::MessageChannel(TCPSocket* socket) : _host(), _port(-1), _socket(socket) { } MessageChannel::~MessageChannel() { delete _socket; } }
24.956522
75
0.705575
5fbabb6d06829191d76a03b0657e53f2ef2c679f
4,178
cpp
C++
Common/Parse.cpp
d0liver/realpolitik
3aa6d7238f3eb77494637861813206295f44f6e0
[ "Artistic-1.0" ]
null
null
null
Common/Parse.cpp
d0liver/realpolitik
3aa6d7238f3eb77494637861813206295f44f6e0
[ "Artistic-1.0" ]
null
null
null
Common/Parse.cpp
d0liver/realpolitik
3aa6d7238f3eb77494637861813206295f44f6e0
[ "Artistic-1.0" ]
null
null
null
//--------------------------------------------------------------------------------- // Copyright (C) 2001 James M. Van Verth // // This program is free software; you can redistribute it and/or // modify it under the terms of the Clarified Artistic License. // In addition, to meet copyright restrictions you must also own at // least one copy of any of the following board games: // Diplomacy, Deluxe Diplomacy, Colonial Diplomacy or Machiavelli. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // Clarified Artistic License for more details. // // You should have received a copy of the Clarified Artistic License // along with this program; if not, write to the Open Source Initiative // at www.opensource.org //--------------------------------------------------------------------------------- #include <ctype.h> #include "MapData.h" #include "Parse.h" #include "Game.h" /* #include "order.h" #include "fails.h" */ int emptyline (char *s) { if (s == NULL) return 1; while (isspace(*s)) s++; if (*s == '\000') return 1; return 0; } void uppercase (char *s) { if (s == NULL) return; for (; *s; s++) if (islower(*s)) *s = toupper(*s); } void capitalize(char *s) { if (s == NULL) return; if (islower(*s)) *s = toupper(*s); s++; for (; *s; s++) if (isupper(*s)) *s = tolower(*s); } bool strnsame(char *s1, char *s2, int n) { bool same; if (*s1 == NULL || *s2 == NULL) return false; same = 1; for (; *s1 && *s2 && n; s1++, s2++, n--) { if (*s1 != *s2 && toupper(*s1) != *s2 && *s1 != toupper(*s2)) { same = 0; break; } } if (n != 0) return 0; return same; } char * samestring(const char *line, const char *key) { if (line == NULL || key == NULL) return NULL; while (*line != '\0' && (*line == *key || toupper(*line) == *key || *line == toupper(*key))) { line++; key++; } if ( *key == '\0' ) return (char*)line; else return NULL; } void appendtabs (char *s) { if (s == NULL) return; /* strncat(s, "\t\t\t\t\t", 5 - (strlen(s))/TABLEN); */ } /* return pointer to beginning of next word in string s */ /* assumes there might be leading blanks */ char * skipword (char *s) { if (s == NULL) return s; s = skipspace(s); /* skip leading blanks */ while (isgraph(*s)) s++; /* skip word */ s = skipspace(s); /* skip trailing blanks */ if (s == NULL || *s == '\0') /* fell off the end? */ return NULL; return s; } char * skipspace (char *s) { if (s == NULL) return s; while (isspace(*s) || *s == ',' || *s == '.' || *s == ':') s++; if (*s == '\0') return NULL; return s; } /* returns length of next word in string */ /* assumes no leading blanks */ short wordlen (char *s) { char *sp = s; if (s == NULL) return 0; while (isgraph(*sp)) sp++; return sp-s; } /* returns pointer to remainder of s if it's a comment */ /* skips leading blanks */ char * findcomment (char *s) { s = skipspace(s); if (s == NULL) return NULL; if (*s == '#') return s+1; else if (*s == '/' && *(s+1) == '/') return s+2; else return NULL; } /* return text stripped of tabs and deal with comments */ /* affects original text where comments are concerned. */ char * striptext (char *orig) { char *copy, *comment = NULL; copy = skipspace(orig); if (wordlen(copy) == 0) return NULL; while (*copy) { /* strip tab */ if (*copy == '\t') *copy = ' '; /* deal w/comment */ else if ((comment = findcomment(copy)) != NULL) { *copy = '\0'; /* order is everything up to this comment */ break; } copy++; } return comment; }
19.895238
84
0.497367
5fbd26a426fe8d79e8aa012fd3079f39a924a940
6,259
cpp
C++
src/libraries/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolution.cpp
MrAwesomeRocks/caelus-cml
55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7
[ "mpich2" ]
null
null
null
src/libraries/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolution.cpp
MrAwesomeRocks/caelus-cml
55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7
[ "mpich2" ]
null
null
null
src/libraries/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolution.cpp
MrAwesomeRocks/caelus-cml
55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7
[ "mpich2" ]
null
null
null
/*---------------------------------------------------------------------------*\ Copyright (C) 2011-2015 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of CAELUS. CAELUS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CAELUS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CAELUS. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "cloudSolution.hpp" #include "Time.hpp" #include "localEulerDdtScheme.hpp" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // CML::cloudSolution::cloudSolution(const fvMesh& mesh, const dictionary& dict) : mesh_(mesh), dict_(dict), active_(dict.lookup("active")), transient_(false), calcFrequency_(1), maxCo_(0.3), iter_(1), trackTime_(0), coupled_(false), cellValueSourceCorrection_(false), maxTrackTime_(0), resetSourcesOnStartup_(true), schemes_() { if (active_) { read(); } } CML::cloudSolution::cloudSolution ( const cloudSolution& cs ) : mesh_(cs.mesh_), dict_(cs.dict_), active_(cs.active_), transient_(cs.transient_), calcFrequency_(cs.calcFrequency_), maxCo_(cs.maxCo_), iter_(cs.iter_), trackTime_(cs.trackTime_), coupled_(cs.coupled_), cellValueSourceCorrection_(cs.cellValueSourceCorrection_), maxTrackTime_(cs.maxTrackTime_), resetSourcesOnStartup_(cs.resetSourcesOnStartup_), schemes_(cs.schemes_) {} CML::cloudSolution::cloudSolution ( const fvMesh& mesh ) : mesh_(mesh), dict_(dictionary::null), active_(false), transient_(false), calcFrequency_(0), maxCo_(GREAT), iter_(0), trackTime_(0), coupled_(false), cellValueSourceCorrection_(false), maxTrackTime_(0), resetSourcesOnStartup_(false), schemes_() {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // CML::cloudSolution::~cloudSolution() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void CML::cloudSolution::read() { // For transient runs the Lagrangian tracking may be transient or steady transient_ = dict_.lookupOrDefault("transient", false); // For LTS and steady-state runs the Lagrangian tracking cannot be transient if (transient_) { if (fv::localEulerDdt::enabled(mesh_)) { IOWarningInFunction(dict_) << "Transient tracking is not supported for LTS" " simulations, switching to steady state tracking." << endl; transient_ = false; } if (mesh_.steady()) { IOWarningInFunction(dict_) << "Transient tracking is not supported for steady-state" " simulations, switching to steady state tracking." << endl; transient_ = false; } } dict_.lookup("coupled") >> coupled_; dict_.lookup("cellValueSourceCorrection") >> cellValueSourceCorrection_; dict_.readIfPresent("maxCo", maxCo_); if (steadyState()) { dict_.lookup("calcFrequency") >> calcFrequency_; dict_.lookup("maxTrackTime") >> maxTrackTime_; if (coupled_) { dict_.subDict("sourceTerms").lookup("resetOnStartup") >> resetSourcesOnStartup_; } } if (coupled_) { const dictionary& schemesDict(dict_.subDict("sourceTerms").subDict("schemes")); wordList vars(schemesDict.toc()); schemes_.setSize(vars.size()); forAll(vars, i) { // read solution variable name schemes_[i].first() = vars[i]; // set semi-implicit (1) explicit (0) flag Istream& is = schemesDict.lookup(vars[i]); const word scheme(is); if (scheme == "semiImplicit") { schemes_[i].second().first() = true; } else if (scheme == "explicit") { schemes_[i].second().first() = false; } else { FatalErrorInFunction << "Invalid scheme " << scheme << ". Valid schemes are " << "explicit and semiImplicit" << exit(FatalError); } // read under-relaxation factor is >> schemes_[i].second().second(); } } } CML::scalar CML::cloudSolution::relaxCoeff(const word& fieldName) const { forAll(schemes_, i) { if (fieldName == schemes_[i].first()) { return schemes_[i].second().second(); } } FatalErrorInFunction << "Field name " << fieldName << " not found in schemes" << abort(FatalError); return 1; } bool CML::cloudSolution::semiImplicit(const word& fieldName) const { forAll(schemes_, i) { if (fieldName == schemes_[i].first()) { return schemes_[i].second().first(); } } FatalErrorInFunction << "Field name " << fieldName << " not found in schemes" << abort(FatalError); return false; } bool CML::cloudSolution::solveThisStep() const { return active_ && (mesh_.time().timeIndex() % calcFrequency_ == 0); } bool CML::cloudSolution::canEvolve() { if (transient_) { trackTime_ = mesh_.time().deltaTValue(); } else { trackTime_ = maxTrackTime_; } return solveThisStep(); } bool CML::cloudSolution::output() const { return active_ && mesh_.time().outputTime(); } // ************************************************************************* //
25.546939
80
0.550407
5fbd79ada3d0d2bc36c3c2ed324f781e626e4c5e
2,069
cpp
C++
src/ext/transport/FastRTPS/FastRTPSTransport.cpp
r-kurose/OpenRTM-aist
258c922c55a97c6d1265dbf45e1e8b2ea29b2d86
[ "RSA-MD" ]
15
2019-01-08T15:34:04.000Z
2022-03-01T08:36:17.000Z
src/ext/transport/FastRTPS/FastRTPSTransport.cpp
r-kurose/OpenRTM-aist
258c922c55a97c6d1265dbf45e1e8b2ea29b2d86
[ "RSA-MD" ]
448
2018-12-27T03:13:56.000Z
2022-03-24T09:57:03.000Z
src/ext/transport/FastRTPS/FastRTPSTransport.cpp
r-kurose/OpenRTM-aist
258c922c55a97c6d1265dbf45e1e8b2ea29b2d86
[ "RSA-MD" ]
31
2018-12-26T04:34:22.000Z
2021-11-25T04:39:51.000Z
// -*- C++ -*- /*! * @file FastRTPSOutPort.cpp * @brief FastRTPSOutPort class * @date $Date: 2019-01-31 03:08:03 $ * @author Nobuhiko Miyamoto <n-miyamoto@aist.go.jp> * * Copyright (C) 2019 * Nobuhiko Miyamoto * Robot Innovation Research Center, * National Institute of * Advanced Industrial Science and Technology (AIST), Japan * * All rights reserved. * * */ #include "FastRTPSTransport.h" #include "FastRTPSOutPort.h" #include "FastRTPSInPort.h" #include "FastRTPSManager.h" namespace FastRTPSRTC { ManagerActionListener::ManagerActionListener() { } ManagerActionListener::~ManagerActionListener() { } void ManagerActionListener::preShutdown() { } void ManagerActionListener::postShutdown() { RTC::FastRTPSManager::shutdown_global(); } void ManagerActionListener::postReinit() { } void ManagerActionListener::preReinit() { } } extern "C" { /*! * @if jp * @brief モジュール初期化関数 * @else * @brief Module initialization * @endif */ void FastRTPSTransportInit(RTC::Manager* manager) { { RTC::InPortProviderFactory& factory(RTC::InPortProviderFactory::instance()); factory.addFactory("fast-rtps", ::coil::Creator< ::RTC::InPortProvider, ::RTC::FastRTPSInPort>, ::coil::Destructor< ::RTC::InPortProvider, ::RTC::FastRTPSInPort>); } { RTC::InPortConsumerFactory& factory(RTC::InPortConsumerFactory::instance()); factory.addFactory("fast-rtps", ::coil::Creator< ::RTC::InPortConsumer, ::RTC::FastRTPSOutPort>, ::coil::Destructor< ::RTC::InPortConsumer, ::RTC::FastRTPSOutPort>); } FastRTPSRTC::ManagerActionListener *listener = new FastRTPSRTC::ManagerActionListener(); manager->addManagerActionListener(listener); } }
21.778947
92
0.58144
5fbd9bb373456e797a3f5810c8838a8eb569a6ab
3,955
tpp
C++
xolotl/core/include/xolotl/core/network/impl/NucleationReaction.tpp
ORNL-Fusion/xolotl
993434bea0d3bca439a733a12af78034c911690c
[ "BSD-3-Clause" ]
13
2018-06-13T18:08:57.000Z
2021-09-30T02:39:01.000Z
xolotl/core/include/xolotl/core/network/impl/NucleationReaction.tpp
ORNL-Fusion/xolotl
993434bea0d3bca439a733a12af78034c911690c
[ "BSD-3-Clause" ]
97
2018-02-14T15:24:08.000Z
2022-03-29T16:29:48.000Z
xolotl/core/include/xolotl/core/network/impl/NucleationReaction.tpp
ORNL-Fusion/xolotl
993434bea0d3bca439a733a12af78034c911690c
[ "BSD-3-Clause" ]
18
2018-02-13T20:36:03.000Z
2022-01-04T14:54:16.000Z
#pragma once namespace xolotl { namespace core { namespace network { template <typename TNetwork, typename TDerived> KOKKOS_INLINE_FUNCTION NucleationReaction<TNetwork, TDerived>::NucleationReaction( ReactionDataRef reactionData, ClusterDataRef clusterData, IndexType reactionId, IndexType cluster0, IndexType cluster1) : Superclass(reactionData, clusterData, reactionId), _reactant(cluster0), _product(cluster1) { this->initialize(); } template <typename TNetwork, typename TDerived> KOKKOS_INLINE_FUNCTION NucleationReaction<TNetwork, TDerived>::NucleationReaction( ReactionDataRef reactionData, ClusterDataRef clusterData, IndexType reactionId, const detail::ClusterSet& clusterSet) : NucleationReaction(reactionData, clusterData, reactionId, clusterSet.cluster0, clusterSet.cluster1) { } template <typename TNetwork, typename TDerived> KOKKOS_INLINE_FUNCTION double NucleationReaction<TNetwork, TDerived>::computeRate(IndexType gridIndex) { // We say there are 25 bubbles created per fission fragments and there // are 2 fission fragments per fission double rate = 50.0 * this->_clusterData.fissionRate(); return rate; } template <typename TNetwork, typename TDerived> KOKKOS_INLINE_FUNCTION void NucleationReaction<TNetwork, TDerived>::computeConnectivity( const Connectivity& connectivity) { // The reactant connects with the reactant this->addConnectivity(_reactant, _reactant, connectivity); // The product connects with the reactant this->addConnectivity(_product, _reactant, connectivity); } template <typename TNetwork, typename TDerived> KOKKOS_INLINE_FUNCTION void NucleationReaction<TNetwork, TDerived>::computeReducedConnectivity( const Connectivity& connectivity) { // The reactant connects with the reactant this->addConnectivity(_reactant, _reactant, connectivity); // The product connects with the reactant if (_product == _reactant) this->addConnectivity(_product, _reactant, connectivity); } template <typename TNetwork, typename TDerived> KOKKOS_INLINE_FUNCTION void NucleationReaction<TNetwork, TDerived>::computeFlux( ConcentrationsView concentrations, FluxesView fluxes, IndexType gridIndex) { // Get the single concentration to know in which regime we are double singleConc = concentrations(_reactant); // Update the concentrations if (singleConc > 2.0 * this->_rate(gridIndex)) { Kokkos::atomic_sub(&fluxes(_reactant), 2.0 * this->_rate(gridIndex)); Kokkos::atomic_add(&fluxes(_product), this->_rate(gridIndex)); } else { Kokkos::atomic_sub(&fluxes(_reactant), singleConc); Kokkos::atomic_add(&fluxes(_product), singleConc / 2.0); } } template <typename TNetwork, typename TDerived> KOKKOS_INLINE_FUNCTION void NucleationReaction<TNetwork, TDerived>::computePartialDerivatives( ConcentrationsView concentrations, Kokkos::View<double*> values, Connectivity connectivity, IndexType gridIndex) { // Get the single concentration to know in which regime we are double singleConc = concentrations(_reactant); // Update the partials if (singleConc > 2.0 * this->_rate(gridIndex)) { // Nothing } else { Kokkos::atomic_sub(&values(connectivity(_reactant, _reactant)), 1.0); Kokkos::atomic_add(&values(connectivity(_product, _reactant)), 0.5); } } template <typename TNetwork, typename TDerived> KOKKOS_INLINE_FUNCTION void NucleationReaction<TNetwork, TDerived>::computeReducedPartialDerivatives( ConcentrationsView concentrations, Kokkos::View<double*> values, Connectivity connectivity, IndexType gridIndex) { // Get the single concentration to know in which regime we are double singleConc = concentrations(_reactant); // Update the partials if (singleConc > 2.0 * this->_rate(gridIndex)) { // Nothing } else { Kokkos::atomic_sub(&values(connectivity(_reactant, _reactant)), 1.0); if (_product == _reactant) Kokkos::atomic_add(&values(connectivity(_product, _reactant)), 0.5); } } } // namespace network } // namespace core } // namespace xolotl
30.19084
75
0.786599
5fbffc8f4e6528e19ec06dd7271bb63304fe0285
504
cpp
C++
EU4toV2/Source/V2World/Output/outLeader.cpp
GregB76/EU4toVic2
0a8822101a36a16036fdc315e706d113d9231101
[ "MIT" ]
42
2018-12-22T03:59:43.000Z
2022-02-03T10:45:42.000Z
EU4toV2/Source/V2World/Output/outLeader.cpp
IhateTrains/EU4toVic2
061f5e1a0bc1a1f3b54bdfe471b501260149b56b
[ "MIT" ]
336
2018-12-22T17:15:27.000Z
2022-03-02T11:19:32.000Z
EU4toV2/Source/V2World/Output/outLeader.cpp
klorpa/EU4toVic2
e3068eb2aa459f884c1929f162d0047a4cb5f4d4
[ "MIT" ]
56
2018-12-22T19:13:23.000Z
2022-01-01T23:08:53.000Z
#include "output.h" std::ostream& V2::operator<<(std::ostream& output, const Leader& leader) { output << "leader = {\n"; output << "\tname=\"" << leader.name << "\"\n"; output << "\tdate=\"" << leader.activationDate << "\"\n"; if (leader.isLand) { output << "\ttype=land\n"; } else { output << "\ttype=sea\n"; } output << "\tpersonality=\"" << leader.personality << "\"\n"; output << "\tbackground=\"" << leader.background << "\"\n"; output << "}\n"; output << "\n"; return output; }
21.913043
72
0.553571
5fc29ad14d6a097ca6f9bd00e680d43245b810a2
3,387
cpp
C++
capabilities/DavsClient/acsdkDavsClient/test/DavsEndpointHandlerV3Test.cpp
immortalkrazy/avs-device-sdk
703b06188eae146af396f58be4e47442d7ce5b1e
[ "Apache-2.0" ]
1
2018-07-09T16:44:28.000Z
2018-07-09T16:44:28.000Z
capabilities/DavsClient/acsdkDavsClient/test/DavsEndpointHandlerV3Test.cpp
immortalkrazy/avs-device-sdk
703b06188eae146af396f58be4e47442d7ce5b1e
[ "Apache-2.0" ]
null
null
null
capabilities/DavsClient/acsdkDavsClient/test/DavsEndpointHandlerV3Test.cpp
immortalkrazy/avs-device-sdk
703b06188eae146af396f58be4e47442d7ce5b1e
[ "Apache-2.0" ]
2
2019-02-05T23:42:48.000Z
2020-03-01T11:11:30.000Z
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <gtest/gtest.h> #include <string> #include <vector> #include "TestUtil.h" #include "acsdkDavsClient/DavsEndpointHandlerV3.h" using namespace std; using namespace testing; using namespace alexaClientSDK::acsdkAssets::common; using namespace alexaClientSDK::acsdkAssets::commonInterfaces; using namespace alexaClientSDK::acsdkAssets::davs; struct TestDataEndpoints { string description; string segmentId; string locale; string type; string key; DavsRequest::FilterMap filters; Region region; string resultUrl; }; class DavsEndpointHandlerV3Test : public Test , public WithParamInterface<TestDataEndpoints> {}; TEST_F(DavsEndpointHandlerV3Test, InvalidCreate) { // NOLINT ASSERT_EQ(DavsEndpointHandlerV3::create(""), nullptr); } TEST_F(DavsEndpointHandlerV3Test, InvalidInputs) { // NOLINT auto unit = DavsEndpointHandlerV3::create("123"); ASSERT_NE(unit, nullptr); ASSERT_EQ(unit->getDavsUrl(nullptr), ""); } TEST_P(DavsEndpointHandlerV3Test, TestWithVariousEndpointCombinations) { // NOLINT auto& p = GetParam(); auto unit = DavsEndpointHandlerV3::create(p.segmentId, p.locale); auto actualUrl = unit->getDavsUrl(DavsRequest::create(p.type, p.key, p.filters, p.region)); ASSERT_EQ(actualUrl, p.resultUrl); } // clang-format off INSTANTIATE_TEST_CASE_P(EndpointChecks, DavsEndpointHandlerV3Test, ValuesIn<vector<TestDataEndpoints>>( // NOLINT // Description Segment Locale Type Key Filters Region || Result URL {{"NA Endpoint" , "123456", "en-US", "Type1", "Key1", {{"F", {"A", "B"}}}, Region::NA, "https://api.amazonalexa.com/v3/segments/123456/artifacts/Type1/Key1?locale=en-US&encodedFilters=eyJGIjpbIkEiLCJCIl19"}, {"EU Endpoint" , "ABCDEF", "en-US", "Type2", "Key2", {{"F", {"A", "B"}}}, Region::EU, "https://api.eu.amazonalexa.com/v3/segments/ABCDEF/artifacts/Type2/Key2?locale=en-US&encodedFilters=eyJGIjpbIkEiLCJCIl19"}, {"FE Endpoint" , "UVWXYZ", "en-US", "Type3", "Key3", {{"F", {"A", "B"}}}, Region::FE, "https://api.fe.amazonalexa.com/v3/segments/UVWXYZ/artifacts/Type3/Key3?locale=en-US&encodedFilters=eyJGIjpbIkEiLCJCIl19"}, {"No locale" , "123456", "" , "Type4", "Key4", {{"F", {"A", "B"}}}, Region::NA, "https://api.amazonalexa.com/v3/segments/123456/artifacts/Type4/Key4?encodedFilters=eyJGIjpbIkEiLCJCIl19"}, {"No filters" , "123456", "en-GB", "Type5", "Key5", {} , Region::NA, "https://api.amazonalexa.com/v3/segments/123456/artifacts/Type5/Key5?locale=en-GB"}, {"No filters/locale", "123456", "" , "Type6", "Key6", {} , Region::NA, "https://api.amazonalexa.com/v3/segments/123456/artifacts/Type6/Key6"}, }), PrintDescription()); // clang-format on
45.77027
219
0.687924
5fc60f95819d5eb5ddbd3d505bc52540009782ec
10,658
cpp
C++
pluginLite/sysutils.cpp
XULPlayer/XULPlayer-legacy
1ab0ad2a196373d81d350bf45c03f690a0bfb8a2
[ "MIT" ]
3
2017-11-29T07:11:24.000Z
2020-03-03T19:23:33.000Z
pluginLite/sysutils.cpp
XULPlayer/XULPlayer-legacy
1ab0ad2a196373d81d350bf45c03f690a0bfb8a2
[ "MIT" ]
null
null
null
pluginLite/sysutils.cpp
XULPlayer/XULPlayer-legacy
1ab0ad2a196373d81d350bf45c03f690a0bfb8a2
[ "MIT" ]
1
2018-07-12T12:48:52.000Z
2018-07-12T12:48:52.000Z
#include <windows.h> #include <stdio.h> #include <comdef.h> // for using bstr_t class #include <vector> #include <tchar.h> #define SYSTEM_OBJECT_INDEX 2 // 'System' object #define PROCESS_OBJECT_INDEX 230 // 'Process' object #define PROCESSOR_OBJECT_INDEX 238 // 'Processor' object #define TOTAL_PROCESSOR_TIME_COUNTER_INDEX 240 // '% Total processor time' counter (valid in WinNT under 'System' object) #define PROCESSOR_TIME_COUNTER_INDEX 6 // '% processor time' counter (for Win2K/XP) #define TOTALBYTES 100*1024 #define BYTEINCREMENT 10*1024 template <class T> class CPerfCounters { public: CPerfCounters() { } ~CPerfCounters() { } T GetCounterValue(PERF_DATA_BLOCK **pPerfData, DWORD dwObjectIndex, DWORD dwCounterIndex, LPCTSTR pInstanceName = NULL) { QueryPerformanceData(pPerfData, dwObjectIndex, dwCounterIndex); PPERF_OBJECT_TYPE pPerfObj = NULL; T lnValue = {0}; // Get the first object type. pPerfObj = FirstObject( *pPerfData ); // Look for the given object index for( DWORD i=0; i < (*pPerfData)->NumObjectTypes; i++ ) { if (pPerfObj->ObjectNameTitleIndex == dwObjectIndex) { lnValue = GetCounterValue(pPerfObj, dwCounterIndex, pInstanceName); break; } pPerfObj = NextObject( pPerfObj ); } return lnValue; } T GetCounterValueForProcessID(PERF_DATA_BLOCK **pPerfData, DWORD dwObjectIndex, DWORD dwCounterIndex, DWORD dwProcessID) { QueryPerformanceData(pPerfData, dwObjectIndex, dwCounterIndex); PPERF_OBJECT_TYPE pPerfObj = NULL; T lnValue = {0}; // Get the first object type. pPerfObj = FirstObject( *pPerfData ); // Look for the given object index for( DWORD i=0; i < (*pPerfData)->NumObjectTypes; i++ ) { if (pPerfObj->ObjectNameTitleIndex == dwObjectIndex) { lnValue = GetCounterValueForProcessID(pPerfObj, dwCounterIndex, dwProcessID); break; } pPerfObj = NextObject( pPerfObj ); } return lnValue; } protected: class CBuffer { public: CBuffer(UINT Size) { m_Size = Size; m_pBuffer = (LPBYTE) malloc( Size*sizeof(BYTE) ); } ~CBuffer() { free(m_pBuffer); } void *Realloc(UINT Size) { m_Size = Size; m_pBuffer = (LPBYTE) realloc( m_pBuffer, Size ); return m_pBuffer; } void Reset() { memset(m_pBuffer,NULL,m_Size); } operator LPBYTE () { return m_pBuffer; } UINT GetSize() { return m_Size; } public: LPBYTE m_pBuffer; private: UINT m_Size; }; // // The performance data is accessed through the registry key // HKEY_PEFORMANCE_DATA. // However, although we use the registry to collect performance data, // the data is not stored in the registry database. // Instead, calling the registry functions with the HKEY_PEFORMANCE_DATA key // causes the system to collect the data from the appropriate system // object managers. // // QueryPerformanceData allocates memory block for getting the // performance data. // // void QueryPerformanceData(PERF_DATA_BLOCK **pPerfData, DWORD dwObjectIndex, DWORD dwCounterIndex) { // // Since i want to use the same allocated area for each query, // i declare CBuffer as static. // The allocated is changed only when RegQueryValueEx return ERROR_MORE_DATA // static CBuffer Buffer(TOTALBYTES); DWORD BufferSize = Buffer.GetSize(); LONG lRes; TCHAR keyName[32]; _stprintf(keyName, _T("%d"), dwObjectIndex); Buffer.Reset(); while( (lRes = RegQueryValueEx( HKEY_PERFORMANCE_DATA, keyName, NULL, NULL, Buffer, &BufferSize )) == ERROR_MORE_DATA ) { // Get a buffer that is big enough. BufferSize += BYTEINCREMENT; Buffer.Realloc(BufferSize); } *pPerfData = (PPERF_DATA_BLOCK) Buffer.m_pBuffer; } // // GetCounterValue gets performance object structure // and returns the value of given counter index . // This functions iterates through the counters of the input object // structure and looks for the given counter index. // // For objects that have instances, this function returns the counter value // of the instance pInstanceName. // T GetCounterValue(PPERF_OBJECT_TYPE pPerfObj, DWORD dwCounterIndex, LPCTSTR pInstanceName) { PPERF_COUNTER_DEFINITION pPerfCntr = NULL; PPERF_INSTANCE_DEFINITION pPerfInst = NULL; PPERF_COUNTER_BLOCK pCounterBlock = NULL; // Get the first counter. pPerfCntr = FirstCounter( pPerfObj ); for( DWORD j=0; j < pPerfObj->NumCounters; j++ ) { if (pPerfCntr->CounterNameTitleIndex == dwCounterIndex) break; // Get the next counter. pPerfCntr = NextCounter( pPerfCntr ); } if( pPerfObj->NumInstances == PERF_NO_INSTANCES ) { pCounterBlock = (PPERF_COUNTER_BLOCK) ((LPBYTE) pPerfObj + pPerfObj->DefinitionLength); } else { pPerfInst = FirstInstance( pPerfObj ); // Look for instance pInstanceName _bstr_t bstrInstance; _bstr_t bstrInputInstance = pInstanceName; for( int k=0; k < pPerfObj->NumInstances; k++ ) { bstrInstance = (wchar_t *)((PBYTE)pPerfInst + pPerfInst->NameOffset); if (!_tcsicmp((LPCTSTR)bstrInstance, (LPCTSTR)bstrInputInstance)) { pCounterBlock = (PPERF_COUNTER_BLOCK) ((LPBYTE) pPerfInst + pPerfInst->ByteLength); break; } // Get the next instance. pPerfInst = NextInstance( pPerfInst ); } } if (pCounterBlock) { T *lnValue = NULL; lnValue = (T*)((LPBYTE) pCounterBlock + pPerfCntr->CounterOffset); return *lnValue; } return -1; } T GetCounterValueForProcessID(PPERF_OBJECT_TYPE pPerfObj, DWORD dwCounterIndex, DWORD dwProcessID) { int PROC_ID_COUNTER = 784; BOOL bProcessIDExist = FALSE; PPERF_COUNTER_DEFINITION pPerfCntr = NULL; PPERF_COUNTER_DEFINITION pTheRequestedPerfCntr = NULL; PPERF_COUNTER_DEFINITION pProcIDPerfCntr = NULL; PPERF_INSTANCE_DEFINITION pPerfInst = NULL; PPERF_COUNTER_BLOCK pCounterBlock = NULL; // Get the first counter. pPerfCntr = FirstCounter( pPerfObj ); for( DWORD j=0; j < pPerfObj->NumCounters; j++ ) { if (pPerfCntr->CounterNameTitleIndex == PROC_ID_COUNTER) { pProcIDPerfCntr = pPerfCntr; if (pTheRequestedPerfCntr) break; } if (pPerfCntr->CounterNameTitleIndex == dwCounterIndex) { pTheRequestedPerfCntr = pPerfCntr; if (pProcIDPerfCntr) break; } // Get the next counter. pPerfCntr = NextCounter( pPerfCntr ); } if( pPerfObj->NumInstances == PERF_NO_INSTANCES ) { pCounterBlock = (PPERF_COUNTER_BLOCK) ((LPBYTE) pPerfObj + pPerfObj->DefinitionLength); } else { pPerfInst = FirstInstance( pPerfObj ); for( int k=0; k < pPerfObj->NumInstances; k++ ) { pCounterBlock = (PPERF_COUNTER_BLOCK) ((LPBYTE) pPerfInst + pPerfInst->ByteLength); if (pCounterBlock) { int processID = 0; processID = *(T*)((LPBYTE) pCounterBlock + pProcIDPerfCntr->CounterOffset); if (processID == dwProcessID) { bProcessIDExist = TRUE; break; } } // Get the next instance. pPerfInst = NextInstance( pPerfInst ); } } if (bProcessIDExist && pCounterBlock) { T *lnValue = NULL; lnValue = (T*)((LPBYTE) pCounterBlock + pTheRequestedPerfCntr->CounterOffset); return *lnValue; } return -1; } /***************************************************************** * * * Functions used to navigate through the performance data. * * * *****************************************************************/ PPERF_OBJECT_TYPE FirstObject( PPERF_DATA_BLOCK PerfData ) { return( (PPERF_OBJECT_TYPE)((PBYTE)PerfData + PerfData->HeaderLength) ); } PPERF_OBJECT_TYPE NextObject( PPERF_OBJECT_TYPE PerfObj ) { return( (PPERF_OBJECT_TYPE)((PBYTE)PerfObj + PerfObj->TotalByteLength) ); } PPERF_COUNTER_DEFINITION FirstCounter( PPERF_OBJECT_TYPE PerfObj ) { return( (PPERF_COUNTER_DEFINITION) ((PBYTE)PerfObj + PerfObj->HeaderLength) ); } PPERF_COUNTER_DEFINITION NextCounter( PPERF_COUNTER_DEFINITION PerfCntr ) { return( (PPERF_COUNTER_DEFINITION)((PBYTE)PerfCntr + PerfCntr->ByteLength) ); } PPERF_INSTANCE_DEFINITION FirstInstance( PPERF_OBJECT_TYPE PerfObj ) { return( (PPERF_INSTANCE_DEFINITION)((PBYTE)PerfObj + PerfObj->DefinitionLength) ); } PPERF_INSTANCE_DEFINITION NextInstance( PPERF_INSTANCE_DEFINITION PerfInst ) { PPERF_COUNTER_BLOCK PerfCntrBlk; PerfCntrBlk = (PPERF_COUNTER_BLOCK)((PBYTE)PerfInst + PerfInst->ByteLength); return( (PPERF_INSTANCE_DEFINITION)((PBYTE)PerfCntrBlk + PerfCntrBlk->ByteLength) ); } }; typedef enum { WINNT, WIN2K_XP, WIN9X, UNKNOWN }PLATFORM; PLATFORM GetPlatform() { OSVERSIONINFO osvi; osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); if (!GetVersionEx(&osvi)) return UNKNOWN; switch (osvi.dwPlatformId) { case VER_PLATFORM_WIN32_WINDOWS: return WIN9X; case VER_PLATFORM_WIN32_NT: if (osvi.dwMajorVersion == 4) return WINNT; else return WIN2K_XP; } return UNKNOWN; } bool m_bFirstTime = true; LONGLONG m_lnOldValue ; LARGE_INTEGER m_OldPerfTime100nSec; float GetCpuUsage() { static PLATFORM Platform = GetPlatform(); static DWORD dwObjectIndex = (Platform == WINNT ? SYSTEM_OBJECT_INDEX : PROCESSOR_OBJECT_INDEX); static DWORD dwCpuUsageIndex = (Platform == WINNT ? TOTAL_PROCESSOR_TIME_COUNTER_INDEX : PROCESSOR_TIME_COUNTER_INDEX); static TCHAR *szInstance = (Platform == WINNT ? "" : "_Total"); // Cpu usage counter is 8 byte length. CPerfCounters<LONGLONG> PerfCounters; // Note: // ==== // On windows NT, cpu usage counter is '% Total processor time' // under 'System' object. However, in Win2K/XP Microsoft moved // that counter to '% processor time' under '_Total' instance // of 'Processor' object. // Read 'INFO: Percent Total Performance Counter Changes on Windows 2000' // Q259390 in MSDN. int CpuUsage = 0; LONGLONG lnNewValue = 0; PPERF_DATA_BLOCK pPerfData = NULL; LARGE_INTEGER NewPerfTime100nSec = {0}; lnNewValue = PerfCounters.GetCounterValue(&pPerfData, dwObjectIndex, dwCpuUsageIndex, szInstance); NewPerfTime100nSec = pPerfData->PerfTime100nSec; if (m_bFirstTime) { m_bFirstTime = false; m_lnOldValue = lnNewValue; m_OldPerfTime100nSec = NewPerfTime100nSec; return 0; } LONGLONG lnValueDelta = lnNewValue - m_lnOldValue; double DeltaPerfTime100nSec = (double)NewPerfTime100nSec.QuadPart - (double)m_OldPerfTime100nSec.QuadPart; m_lnOldValue = lnNewValue; m_OldPerfTime100nSec = NewPerfTime100nSec; float a = 100 - (float)(lnValueDelta / DeltaPerfTime100nSec) * 100; return a; }
25.806295
122
0.693751
5fc7c5022bb2cd702c6add7ffa1a3a2714535c8d
15,209
cpp
C++
Merrymen/WeaponCS.cpp
Mertank/ToneArm
40c62b0de89ac506bea6674e43578bf4e2631f93
[ "Zlib", "BSD-2-Clause" ]
null
null
null
Merrymen/WeaponCS.cpp
Mertank/ToneArm
40c62b0de89ac506bea6674e43578bf4e2631f93
[ "Zlib", "BSD-2-Clause" ]
null
null
null
Merrymen/WeaponCS.cpp
Mertank/ToneArm
40c62b0de89ac506bea6674e43578bf4e2631f93
[ "Zlib", "BSD-2-Clause" ]
null
null
null
/* ------------------------------------------------------------------------------------------ Copyright (c) 2014 Vinyl Games Studio Author: Mikhail Kutuzov Date: 5/15/2014 4:14:48 PM ------------------------------------------------------------------------------------------ */ #include "WeaponCS.h" #include "Character.h" #include "GameScene.h" #include "ShootingHelperSP.h" #include "../ToneArmEngine/RayCasting.h" #include "../ToneArmEngine/Engine.h" #include "../ToneArmEngine/EngineModule.h" #include "../ToneArmEngine/CachedResourceLoader.h" #include "../ToneArmEngine/InitializationFileResource.h" #include "../ToneArmEngine/SoundModule.h" #include "../ToneArmEngine/ParticleEmitterNode.h" #include "../ToneArmEngine/ParticleEmitterNodePool.h" using namespace merrymen; // // allocates a Weapon object and calls Init() on it // WeaponCS* WeaponCS::Create(const WeaponID& id, Character* const owner, const char* modelFile, char** const soundFiles, const char* iniFile, const char* category) { WeaponCS* weapon = new WeaponCS(); if (weapon && weapon->Init(id, owner, modelFile, soundFiles, iniFile, category)) { return weapon; } delete weapon; return nullptr; } // // default constructor // WeaponCS::WeaponCS() : m_owner(nullptr), m_model(nullptr), m_emitter(nullptr), m_stats(nullptr), m_projectileStats(nullptr), m_cooldownTimer(1.0f), m_reloadTimer(-1.0f), m_active(false), m_shooting(false), m_reloading(false), m_emitterNodePool( NULL ) {} // // destructor // WeaponCS::~WeaponCS() { delete m_stats; delete m_projectileStats; } // // initializes the weapon data with the passed values // bool WeaponCS::Init(const WeaponID& id, Character* const owner, const char* modelFile, char** soundFiles, const char* iniFile, const char* category) { if (Node::Init()) { m_id = id; m_owner = owner; // initialize weapon's stats CachedResourceLoader* loader = Engine::GetInstance()->GetModuleByType<CachedResourceLoader>(EngineModuleType::RESOURCELOADER); std::shared_ptr<InitializationFileResource> ini = loader->LoadResource<InitializationFileResource>(iniFile); m_stats = new WeaponStats<WeaponCS>(this, *ini->GetCategory(category)); m_projectileStats = new ProjectileStats(); // initialize sounds m_sounds.insert(std::pair<WeaponSoundTypes, const char*>(WeaponSoundTypes::ShotSound, soundFiles[0])); m_sounds.insert(std::pair<WeaponSoundTypes, const char*>(WeaponSoundTypes::LoadSound, soundFiles[1])); m_sounds.insert(std::pair<WeaponSoundTypes, const char*>(WeaponSoundTypes::CockSound, soundFiles[2])); m_sounds.insert(std::pair<WeaponSoundTypes, const char*>(WeaponSoundTypes::TriggerClickSound, soundFiles[3])); // create model m_model = ModelNode::Create( modelFile ); m_model->SetVisible(false); m_model->SetPosition(glm::vec3(0.0f, 15.0f, 50.0f)); AddChild(m_model); // TODO: initialize the emitter with respect to the type of the weapon m_emitter = vgs::ParticleEmitterNode::CreateWithSettings(ParticleEmitterSettings(75, 0.1f, 0.05f, 750, 90.0f, glm::vec3(0.85f, 0.75f, 0.0f), 0, 5.0f, 300.0f, 100.0f)); if (id == WeaponID::Pistol) { m_emitter->SetPosition( glm::vec3( -0.898f, 0.3085f, -0.3122f ) * 35.0f); } else if (id == WeaponID::Shotgun) { m_emitter->SetPosition( glm::vec3( -0.898f, 0.3085f, -0.3122f ) * 70.0f); } else if (id == WeaponID::SniperRifle) { m_emitter->SetPosition( glm::vec3( -0.898f, 0.3085f, -0.3122f ) * 85.0f); } m_emitter->SetRotation( glm::vec3( 67.0f, -116.0f, -83.0f ) ); m_model->AddChild(m_emitter); m_emitterNodePool = ParticleEmitterNodePool::CreateEmitterPool( 10 ); AddChild( m_emitterNodePool ); return true; } return false; } // // Weapon object updates it's state // void WeaponCS::Update(float dt) { if (!m_owner->IsOnline() && IsActive()) { UpdateStats(dt); } // cooldown goes on if (m_cooldownTimer > 0.0f) { m_cooldownTimer -= dt; } // reloading timer if (IsReloading()) { m_reloadTimer -= dt; } // auto-reload? if (m_stats->Ammo <= 0 && m_reloadTimer <= -1.0f && !m_owner->IsSprinting()) { Reload(); } Node::Update(dt); } // // weapon updates it's timers and stats // void WeaponCS::UpdateStats(float dt) { if (m_stats->Update(dt)) { m_owner->SetStatsChanged(true); } } // // casts rays to check which objects were hit // void WeaponCS::DoRayCasting(std::multimap<ClientEntity*, float>& hitEntities, std::vector<glm::vec3>& impactPoints) { RayCasting::ColliderResult shotResultPtr; glm::vec3 shotImpactPoint; // prepare data for ray casting std::vector<ColliderComponent*> geometryColliders; ShootingHelperSP helper = ShootingHelperSP(); helper.PreapareGeometryData(this->GetOwner(), geometryColliders, false); GameScene* gs = static_cast<GameScene*>(Engine::GetRunningScene()); std::vector<Character*> targets = gs->GetPlayers(); glm::vec3 shotOrigin = this->GetAbsoluteWorldPosition() + m_owner->GetForward() * WEAPON_LENGTH, shotDirection; // cast as many rays as there are projectiles in one shot for (int i = 0; i < m_projectileStats->ProjectilesPerShot; i++) { // calculate shot direction for that particular projectile glm::vec3 shotDirection = helper.CalculateShotDirection(this->GetOwner(), this->GetWeaponStats()); if (targets.size() > 1) { // cast a ray to each target for (auto target : targets) { bool hitSomething = false; bool hitTheTarget = false; // check what the ray cast from the weapon's position actually hits (target, geometry or nothing) if (target != this->GetOwner() && !target->IsDead()) { ColliderComponent* collider = target->GetComponentOfType<ColliderComponent>(); shotResultPtr = RayCasting::RayCastShot(shotOrigin, shotDirection, geometryColliders, collider); if (shotResultPtr) { ColliderComponent* collider = shotResultPtr.get()->Object; // hit someone if (collider->GetOwner()->GetRTTI().DerivesFrom(ClientEntity::rtti)) { hitEntities.insert(std::pair<ClientEntity*, float>(target, glm::distance(shotOrigin, shotImpactPoint))); } // hit a wall else { impactPoints.push_back(shotResultPtr.get()->Intersection); } } } } } else { std::shared_ptr<RayCasting::RayCastResult<ColliderComponent>> hitObject = RayCasting::RayCastFirst(geometryColliders, shotOrigin, shotDirection); if (hitObject.get()) { impactPoints.push_back(hitObject.get()->Intersection); } } } geometryColliders.clear(); targets.clear(); } // // method that causes damage // void WeaponCS::Shoot() { std::multimap<ClientEntity*, float> hitEntities; std::vector<glm::vec3> impactPoints; // cast rays to check which objects were hit DoRayCasting(hitEntities, impactPoints); // deal damage to the characters which were hit if (hitEntities.size() > 0) { for (std::multimap<ClientEntity*, float>::iterator hitEntitiesItr = hitEntities.begin(); hitEntitiesItr != hitEntities.end(); ++hitEntitiesItr) { int count = hitEntities.count(hitEntitiesItr->first); Damage dmg = Damage::CalculateDamage(count, this->GetWeaponStats().Damage, hitEntitiesItr->second, this->GetWeaponStats().AimingDistance, this->GetProjectileStats()); hitEntitiesItr->first->TakeDamage(dmg, this->GetProjectileStats().Type); std::multimap<ClientEntity*, float>::iterator currentItr = hitEntitiesItr; std::advance(hitEntitiesItr, count - 1); hitEntities.erase(currentItr, hitEntitiesItr); } } // play shot impact effects on the geometry hit by the shot for (auto impactPoint : impactPoints) { PlayShotImpactEffects(impactPoint); } hitEntities.clear(); impactPoints.clear(); } // // handles a shooting command received from the owner // void WeaponCS::HandleShootCommand() { bool canShoot = false; if (m_stats->ShootingType == ShootingType::Automatic) { if (m_stats->Ammo > 0 && m_cooldownTimer <= 0.0f && (!IsReloading() || m_stats->LoadingUnit == LoadingUnit::Bullet)) { canShoot = true; } } // if a weapon is semi-automatic we need to make sure that the fire button was released at least once since the moment of the most recent shot else if (m_stats->ShootingType == ShootingType::Semi_automatic) { if (!IsShooting() && m_stats->Ammo > 0 && m_cooldownTimer <= 0.0f && (!IsReloading() || m_stats->LoadingUnit == LoadingUnit::Bullet)) { canShoot = true; } } // if we have enough ammo, the cooldown has passed and the weapon is not being reloaded a new shot can be performed if (canShoot) { Shoot(); // stop reloading if (IsReloading()) { StopReloading(); } m_stats->Ammo--; m_owner->SetStatsChanged(true); // start cooldown m_cooldownTimer = m_stats->Cooldown; PlayShootingEffects(); m_owner->PlayShootAnimation(); } else if (m_stats->Ammo == 0 && m_cooldownTimer <= 0.0f && !IsShooting()) { m_cooldownTimer = m_stats->Cooldown; if (!IsReloading()) { PlayWeaponSound(WeaponSoundTypes::TriggerClickSound); } } } // // method that handles reloading commands from the owner // void WeaponCS::Reload() { if (!IsReloading() && m_stats->Ammo < m_stats->ClipSize && m_stats->TotalAmmo > 0) { int bulletsToLoad = 1; // set the reload timer to a proper value if (m_stats->LoadingUnit == LoadingUnit::Clip) { m_reloadTimer = m_stats->ReloadTime; } else if (m_stats->LoadingUnit == LoadingUnit::Bullet) { bulletsToLoad = m_stats->TotalAmmo >= m_stats->ClipSize - m_stats->Ammo ? m_stats->ClipSize - m_stats->Ammo : m_stats->TotalAmmo; m_reloadTimer = (m_stats->ReloadTime / m_stats->ClipSize) * bulletsToLoad; } // stop aiming if (m_owner->IsAiming()) { m_owner->SetAiming(false); } // give the player some feedback PlayWeaponSound(WeaponSoundTypes::LoadSound); m_owner->PlayReloadAnimation(bulletsToLoad); m_reloading = true; } } // // describes what needs to happen once the reloading process is finished // void WeaponCS::FinishReloading() { m_reloadTimer = -1.0f; m_reloading = false; m_owner->SetStatsChanged(true); // let the player sprint again if the sprint button was held all the time during reloading if (m_owner->IsSprintInterrupted()) { m_owner->SetSprintInterrupted(false); } // play sound PlayWeaponSound(WeaponSoundTypes::CockSound); // play animation m_owner->PlayCockAnimation(); } // // interrupts reloading // void WeaponCS::StopReloading() { m_reloadTimer = -1.0f; // play some sounds SoundModule* sMod = Engine::GetInstance()->GetModuleByType<SoundModule>(EngineModuleType::SOUNDER); if (sMod) { sMod->StopUniqueSound(m_sounds.at(WeaponSoundTypes::LoadSound)); } SetReloading(false); } // // stops/plays reloading sound depending on whether or not hte weapon is still active (sets the m_active value too of course) // void WeaponCS::SetActive(const bool active) { if (IsReloading()) { // stop reloading sound and restart the timer if (!active) { StopReloading(); } // play the reload sound, the reloading will start automatically in the UpdateStats else { PlayWeaponSound(WeaponSoundTypes::LoadSound); } } m_active = active; } // // plays particle effects on the weapon // void WeaponCS::PlayShootingEffects() { if(m_model->IsVisible()) { m_emitter->Emit(true, 0); } PlayWeaponSound(WeaponSoundTypes::ShotSound); } // // plays particle effects on the projectile impact point // void WeaponCS::PlayShotImpactEffects() { std::multimap<ClientEntity*, float> hitEntities; std::vector<glm::vec3> impactPoints; // cast rays to check which objects were hit DoRayCasting(hitEntities, impactPoints); // play shot impact effects on the geometry hit by the shot for (auto impactPoint : impactPoints) { PlayShotImpactEffects(impactPoint); } hitEntities.clear(); impactPoints.clear(); } // // plays particle effects on the projectile impact point // void WeaponCS::PlayShotImpactEffects(const glm::vec3& impactPoint) { // get an emitter ParticleEmitterNode* emitter = m_emitterNodePool->GetEmitterNode(); // set its parent properly GameScene* gs = static_cast<GameScene*>(Engine::GetRunningScene()); if (gs) { Node* parent = emitter->GetParent(); if (parent && parent != gs) { emitter->RemoveFromParent(); } gs->AddChild(emitter); } // make the emitter look "pretty" emitter->SetEmitterSettings(ParticleEmitterSettings(300, 0.1f, 0.05f, 3000, 180.0f, glm::vec3(0.33f, 0.33f, 0.33f), 0, 4.0f, 200.0f, 50.0f)); // set position of the emitter emitter->SetPosition(impactPoint - m_owner->GetForward()); // rotate the emitter glm::vec3 direction = m_owner->GetAbsoluteWorldPosition() - impactPoint; direction.y = 0.0f; emitter->SetDirection( glm::normalize( direction ) ); emitter->Emit(true, 0); } // // plays the sound of the shot or the sound of a trigger click if the clip is empty // void WeaponCS::PlayWeaponSound(const WeaponSoundTypes& soundType) { // play sound GameScene* gs = static_cast<GameScene*>(Engine::GetRunningScene()); if (gs) { Character* localCharacter = gs->GetLocalCharacter(); if (!localCharacter) { return; } float distance = glm::distance(GetAbsoluteWorldPosition(), localCharacter->GetAbsoluteWorldPosition()); float volume = SoundModule::CalculateVolume(distance); SoundModule* sMod = Engine::GetInstance()->GetModuleByType<SoundModule>(EngineModuleType::SOUNDER); if (!sMod) { std::cout << "Couldn't find sound module in Weapon::PlayWeaponSound" << std::endl; return; } if (soundType == WeaponSoundTypes::ShotSound) { sMod->PlaySound(m_sounds.at(soundType), volume); } else if (GetOwner() == localCharacter) { // if reloading sound needs to be played the duration might need to be adjusted if (soundType == WeaponSoundTypes::LoadSound) { if (m_stats->LoadingUnit == LoadingUnit::Clip) { sMod->PlaySound(m_sounds.at(soundType), volume); } else if (m_stats->LoadingUnit == LoadingUnit::Bullet) { // adjust the duration of the sound with respect to the number of projectiles that need to be loaded unsigned short bulletsToLoad = m_stats->TotalAmmo >= m_stats->ClipSize - m_stats->Ammo ? m_stats->ClipSize - m_stats->Ammo : m_stats->TotalAmmo; float duration = (m_stats->ReloadTime / m_stats->ClipSize) * bulletsToLoad; sMod->PlaySound(m_sounds.at(soundType), volume, duration); } } // there's no need in playing more than one sound of this type at the same time, so PlayUniqueSound() else if (soundType == WeaponSoundTypes::TriggerClickSound) { sMod->PlayUniqueSound(m_sounds.at(soundType), volume); } else if (soundType == WeaponSoundTypes::CockSound) { sMod->StopUniqueSound(m_sounds.at(WeaponSoundTypes::LoadSound)); sMod->PlayUniqueSound(m_sounds.at(soundType), volume); } } } } // // changes visibility of the weapon's model // void WeaponCS::SetVisible(const bool value) { if (m_model) { m_model->SetVisible(value); } } // // reinitializes some member variables // void WeaponCS::Reset() { m_stats->Ammo = m_stats->ClipSize; m_stats->TotalAmmo = m_stats->MaxAmmo; m_cooldownTimer = -1.0f; m_reloadTimer = -1.0f; m_shooting = false; m_reloading = false; m_owner->SetStatsChanged(true); }
27.062278
169
0.700243
5fc99d00f17782788d3657d70f939615415347fe
3,540
cc
C++
src/Video.cc
IntelLabs/vcl
eab97ef1e61a2e0578dc2e5c959522cbcacd4be4
[ "MIT" ]
5
2018-03-07T20:20:57.000Z
2022-02-09T16:54:22.000Z
src/Video.cc
IntelLabs/vcl
eab97ef1e61a2e0578dc2e5c959522cbcacd4be4
[ "MIT" ]
9
2018-03-28T21:05:51.000Z
2019-03-06T16:18:43.000Z
src/Video.cc
IntelLabs/vcl
eab97ef1e61a2e0578dc2e5c959522cbcacd4be4
[ "MIT" ]
5
2019-03-04T23:40:11.000Z
2022-02-09T16:54:12.000Z
/** * @file Video.cc * * @section LICENSE * * The MIT License * * @copyright Copyright (c) 2017 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #include "Video.h" #include "VideoData.h" using namespace VCL; Video::Video() { _video = new VideoData(); } Video::Video(const std::string& fileName) { _video = new VideoData(fileName); } Video::Video(void* buffer, long size) { _video = new VideoData(buffer, size); } Video::Video(const Video &video) { _video = new VideoData(*video._video); } Video::~Video() { delete _video; } void Video::operator=(const Video &vid) { delete _video; _video = new VideoData(*vid._video); } /* *********************** */ /* GET FUNCTIONS */ /* *********************** */ std::string Video::get_video_id() const { return _video->get_video_id(); } Video::Codec Video::get_codec() const { return _video->get_codec(); } cv::Mat Video::get_frame(unsigned frame_number) { return _video->get_frame(frame_number); } long Video::get_frame_count() { return _video->get_frame_count(); } float Video::get_fps() { return _video->get_fps(); } cv::Size Video::get_frame_size() { return _video->get_frame_size(); } Video::VideoSize Video::get_size() { return _video->get_size(); } std::vector<unsigned char> Video::get_encoded() { return _video->get_encoded(); } /* *********************** */ /* SET FUNCTIONS */ /* *********************** */ void Video::set_video_id(const std::string &video_id) { _video->set_video_id(video_id); } void Video::set_codec(Video::Codec codec) { _video->set_codec(codec); } void Video::set_dimensions(const cv::Size& dimensions) { _video->set_dimensions(dimensions); } /* *********************** */ /* Video INTERACTION */ /* *********************** */ void Video::resize(int new_height, int new_width) { _video->resize(new_height, new_width); } void Video::interval(Video::Unit u, int start, int stop, int step) { _video->interval(u, start, stop, step); } void Video::crop(const Rectangle &rect) { _video->crop(rect); } void Video::threshold(int value) { _video->threshold(value); } void Video::store(const std::string &video_id, Video::Codec video_codec) { _video->write(video_id, video_codec); } void Video::delete_video() { std::string fname = _video->get_video_id(); if (exists(fname)) { std::remove(fname.c_str()); } }
21.454545
80
0.651412
5fd04b33e7ffc789fae15e9c81796649dafb244f
4,914
cpp
C++
src/recovery/log_manager.cpp
HumbleHunger/bustub
f5ff23a8ee18c035d220c0835bab185ccf518678
[ "MIT" ]
1
2021-12-20T08:30:32.000Z
2021-12-20T08:30:32.000Z
src/recovery/log_manager.cpp
HumbleHunger/CMU_Bustub
f5ff23a8ee18c035d220c0835bab185ccf518678
[ "MIT" ]
null
null
null
src/recovery/log_manager.cpp
HumbleHunger/CMU_Bustub
f5ff23a8ee18c035d220c0835bab185ccf518678
[ "MIT" ]
null
null
null
//===----------------------------------------------------------------------===// // // BusTub // // log_manager.cpp // // Identification: src/recovery/log_manager.cpp // // Copyright (c) 2015-2019, Carnegie Mellon University Database Group // //===----------------------------------------------------------------------===// #include "recovery/log_manager.h" namespace bustub { /* * set enable_logging = true * Start a separate thread to execute flush to disk operation periodically * The flush can be triggered when timeout or the log buffer is full or buffer * pool manager wants to force flush (it only happens when the flushed page has * a larger LSN than persistent LSN) * * This thread runs forever until system shutdown/StopFlushThread */ void LogManager::RunFlushThread() { if (!enable_logging) { enable_logging = true; flush_thread_ = new std::thread([&]() { while (enable_logging) { std::unique_lock<std::mutex> lock(latch_); // 如果等待超时了并且缓冲区有数据则交换缓冲区 if (cv_.wait_for(lock, log_timeout) == std::cv_status::timeout && offset_ != 0) { swapBuffer(); } // 保存缓冲区最后一条日志的lsn,减小互斥区的长度 lsn_t lsn = flush_lsn_; lock.unlock(); // buffer pool没有在刷新日志 if (enable_logging && !disk_manager_->GetFlushState() && lsn > persistent_lsn_) { // 将日志刷新到磁盘 disk_manager_->WriteLog(flush_buffer_, LOG_BUFFER_SIZE); // 更新持久化日志的顺序号 SetPersistentLSN(lsn); // 写入日志完毕,如果是被buffer pool调用则进行通知 if (promise_ != nullptr) { promise_->set_value(); } } } }); } } /* * Stop and join the flush thread, set enable_logging = false */ void LogManager::StopFlushThread() { if (enable_logging) { std::cout << "stop log thread" << std::endl; enable_logging = false; cv_.notify_one(); std::unique_lock<std::mutex> lock(latch_); if (flush_thread_ && flush_thread_->joinable()) { lock.unlock(); flush_thread_->join(); } // log线程结束后delete掉new的空间 delete flush_thread_; } } inline void LogManager::swapBuffer() { char *tmp = log_buffer_; log_buffer_ = flush_buffer_; flush_buffer_ = tmp; offset_ = 0; flush_lsn_ = next_lsn_ - 1; } /* * wake up flush thread, only called by buffer pool manager * when it wants to force flush */ void LogManager::WakeupFlushThread(std::promise<void> *promise) { { std::lock_guard<std::mutex> lock(latch_); swapBuffer(); SetPromise(promise); } // wake up flush thread cv_.notify_one(); // waiting for flush done if (promise != nullptr) { promise->get_future().wait(); } SetPromise(nullptr); } /* * append a log record into log buffer * you MUST set the log record's lsn within this method * @return: lsn that is assigned to this log record * * * example below * // First, serialize the must have fields(20 bytes in total) * log_record.lsn_ = next_lsn_++; * memcpy(log_buffer_ + offset_, &log_record, 20); * int pos = offset_ + 20; * * if (log_record.log_record_type_ == LogRecordType::INSERT) { * memcpy(log_buffer_ + pos, &log_record.insert_rid_, sizeof(RID)); * pos += sizeof(RID); * // we have provided serialize function for tuple class * log_record.insert_tuple_.SerializeTo(log_buffer_ + pos); * } * */ lsn_t LogManager::AppendLogRecord(LogRecord *log_record) { std::lock_guard<std::mutex> lock(latch_); if (offset_ + log_record->size_ > LOG_BUFFER_SIZE) { swapBuffer(); cv_.notify_one(); } log_record->lsn_ = next_lsn_++; std::cout << offset_ << std::endl; // for begin/commit/abort, we are done memcpy(log_buffer_ + offset_, log_record, LogRecord::HEADER_SIZE); int pos = offset_ + LogRecord::HEADER_SIZE; if (log_record->log_record_type_ == LogRecordType::INSERT) { // for insert memcpy(log_buffer_ + pos, &log_record->insert_rid_, sizeof(RID)); pos += sizeof(RID); log_record->insert_tuple_.SerializeTo(log_buffer_ + pos); } else if (log_record->log_record_type_ == LogRecordType::MARKDELETE || log_record->log_record_type_ == LogRecordType::ROLLBACKDELETE || log_record->log_record_type_ == LogRecordType::APPLYDELETE) { // for delete memcpy(log_buffer_ + pos, &log_record->delete_rid_, sizeof(RID)); pos += sizeof(RID); log_record->delete_tuple_.SerializeTo(log_buffer_ + pos); } else if (log_record->log_record_type_ == LogRecordType::UPDATE) { // for update memcpy(log_buffer_ + pos, &log_record->update_rid_, sizeof(RID)); pos += sizeof(RID); log_record->old_tuple_.SerializeTo(log_buffer_ + pos); pos += log_record->old_tuple_.GetLength(); log_record->new_tuple_.SerializeTo(log_buffer_ + pos); } else if (log_record->log_record_type_ == LogRecordType::NEWPAGE) { // for new page memcpy(log_buffer_ + pos, &log_record->prev_page_id_, sizeof(page_id_t)); } offset_ += log_record->size_; return log_record->lsn_; } } // namespace bustub
28.241379
85
0.657916
5fd39842abda1a0200ca32e1f96fef3c75824d1f
10,470
cc
C++
wrspice/devlib/mos/mossetm.cc
wrcad/xictools
f46ba6d42801426739cc8b2940a809b74f1641e2
[ "Apache-2.0" ]
73
2017-10-26T12:40:24.000Z
2022-03-02T16:59:43.000Z
wrspice/devlib/mos/mossetm.cc
chris-ayala/xictools
4ea72c118679caed700dab3d49a8d36445acaec3
[ "Apache-2.0" ]
12
2017-11-01T10:18:22.000Z
2022-03-20T19:35:36.000Z
wrspice/devlib/mos/mossetm.cc
chris-ayala/xictools
4ea72c118679caed700dab3d49a8d36445acaec3
[ "Apache-2.0" ]
34
2017-10-06T17:04:21.000Z
2022-02-18T16:22:03.000Z
/*========================================================================* * * * Distributed by Whiteley Research Inc., Sunnyvale, California, USA * * http://wrcad.com * * Copyright (C) 2017 Whiteley Research Inc., all rights reserved. * * Author: Stephen R. Whiteley, except as indicated. * * * * As fully as possible recognizing licensing terms and conditions * * imposed by earlier work from which this work was derived, if any, * * this work is released under the Apache License, Version 2.0 (the * * "License"). You may not use this file except in compliance with * * the License, and compliance with inherited licenses which are * * specified in a sub-header below this one if applicable. A copy * * of the License is provided with this distribution, or you may * * obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * See the License for the specific language governing permissions * * and limitations under the License. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- * * INFRINGEMENT. IN NO EVENT SHALL WHITELEY RESEARCH INCORPORATED * * OR STEPHEN R. WHITELEY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * * USE OR OTHER DEALINGS IN THE SOFTWARE. * * * *========================================================================* * XicTools Integrated Circuit Design System * * * * WRspice Circuit Simulation and Analysis Tool: Device Library * * * *========================================================================* $Id:$ *========================================================================*/ /*************************************************************************** JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992 Copyright 1990 Regents of the University of California. All rights reserved. Authors: 1985 Thomas L. Quarles 1989 Takayasu Sakurai 1993 Stephen R. Whiteley ****************************************************************************/ #include "mosdefs.h" int MOSdev::setModl(int param, IFdata *data, sGENmodel *genmod) { sMOSmodel *model = static_cast<sMOSmodel*>(genmod); IFvalue *value = &data->v; switch (param) { case MOS_MOD_LEVEL: model->MOSlevel = value->iValue; model->MOSlevelGiven = true; break; case MOS_MOD_TNOM: model->MOStnom = value->rValue+CONSTCtoK; model->MOStnomGiven = true; break; case MOS_MOD_VTO: model->MOSvt0 = value->rValue; model->MOSvt0Given = true; break; case MOS_MOD_KP: model->MOStransconductance = value->rValue; model->MOStransconductanceGiven = true; break; case MOS_MOD_GAMMA: model->MOSgamma = value->rValue; model->MOSgammaGiven = true; break; case MOS_MOD_PHI: model->MOSphi = value->rValue; model->MOSphiGiven = true; break; case MOS_MOD_RD: model->MOSdrainResistance = value->rValue; model->MOSdrainResistanceGiven = true; break; case MOS_MOD_RS: model->MOSsourceResistance = value->rValue; model->MOSsourceResistanceGiven = true; break; case MOS_MOD_CBD: model->MOScapBD = value->rValue; model->MOScapBDGiven = true; break; case MOS_MOD_CBS: model->MOScapBS = value->rValue; model->MOScapBSGiven = true; break; case MOS_MOD_IS: model->MOSjctSatCur = value->rValue; model->MOSjctSatCurGiven = true; break; case MOS_MOD_PB: model->MOSbulkJctPotential = value->rValue; model->MOSbulkJctPotentialGiven = true; break; case MOS_MOD_CGSO: model->MOSgateSourceOverlapCapFactor = value->rValue; model->MOSgateSourceOverlapCapFactorGiven = true; break; case MOS_MOD_CGDO: model->MOSgateDrainOverlapCapFactor = value->rValue; model->MOSgateDrainOverlapCapFactorGiven = true; break; case MOS_MOD_CGBO: model->MOSgateBulkOverlapCapFactor = value->rValue; model->MOSgateBulkOverlapCapFactorGiven = true; break; case MOS_MOD_CJ: model->MOSbulkCapFactor = value->rValue; model->MOSbulkCapFactorGiven = true; break; case MOS_MOD_MJ: model->MOSbulkJctBotGradingCoeff = value->rValue; model->MOSbulkJctBotGradingCoeffGiven = true; break; case MOS_MOD_CJSW: model->MOSsideWallCapFactor = value->rValue; model->MOSsideWallCapFactorGiven = true; break; case MOS_MOD_MJSW: model->MOSbulkJctSideGradingCoeff = value->rValue; model->MOSbulkJctSideGradingCoeffGiven = true; break; case MOS_MOD_JS: model->MOSjctSatCurDensity = value->rValue; model->MOSjctSatCurDensityGiven = true; break; case MOS_MOD_TOX: model->MOSoxideThickness = value->rValue; model->MOSoxideThicknessGiven = true; break; case MOS_MOD_LD: model->MOSlatDiff = value->rValue; model->MOSlatDiffGiven = true; break; case MOS_MOD_RSH: model->MOSsheetResistance = value->rValue; model->MOSsheetResistanceGiven = true; break; case MOS_MOD_U0: model->MOSsurfaceMobility = value->rValue; model->MOSsurfaceMobilityGiven = true; break; case MOS_MOD_FC: model->MOSfwdCapDepCoeff = value->rValue; model->MOSfwdCapDepCoeffGiven = true; break; case MOS_MOD_NSS: model->MOSsurfaceStateDensity = value->rValue; model->MOSsurfaceStateDensityGiven = true; break; case MOS_MOD_NSUB: model->MOSsubstrateDoping = value->rValue; model->MOSsubstrateDopingGiven = true; break; case MOS_MOD_TPG: model->MOSgateType = value->iValue; model->MOSgateTypeGiven = true; break; case MOS_MOD_NMOS: if(value->iValue) { model->MOStype = 1; model->MOStypeGiven = true; } break; case MOS_MOD_PMOS: if(value->iValue) { model->MOStype = -1; model->MOStypeGiven = true; } break; case MOS_MOD_KF: model->MOSfNcoef = value->rValue; model->MOSfNcoefGiven = true; break; case MOS_MOD_AF: model->MOSfNexp = value->rValue; model->MOSfNexpGiven = true; break; case MOS_MOD_LAMBDA: /* levels 1 and 2 */ model->MOSlambda = value->rValue; model->MOSlambdaGiven = true; break; case MOS_MOD_UEXP: /* level 2 */ model->MOScritFieldExp = value->rValue; model->MOScritFieldExpGiven = true; break; case MOS_MOD_NEFF: /* level 2 */ model->MOSchannelCharge = value->rValue; model->MOSchannelChargeGiven = true; break; case MOS_MOD_UCRIT: /* level 2 */ model->MOScritField = value->rValue; model->MOScritFieldGiven = true; break; case MOS_MOD_NFS: /* levels 2 and 3 */ model->MOSfastSurfaceStateDensity = value->rValue; model->MOSfastSurfaceStateDensityGiven = true; break; case MOS_MOD_DELTA: /* levels 2 and 3 */ model->MOSnarrowFactor = value->rValue; model->MOSnarrowFactorGiven = true; break; case MOS_MOD_VMAX: /* levels 2 and 3 */ model->MOSmaxDriftVel = value->rValue; model->MOSmaxDriftVelGiven = true; break; case MOS_MOD_XJ: /* levels 2 and 3 */ model->MOSjunctionDepth = value->rValue; model->MOSjunctionDepthGiven = true; break; case MOS_MOD_ETA: /* level 3 */ model->MOSeta = value->rValue; model->MOSetaGiven = true; break; case MOS_MOD_THETA: /* level 3 */ model->MOStheta = value->rValue; model->MOSthetaGiven = true; break; case MOS_MOD_KAPPA: /* level 3 */ model->MOSkappa = value->rValue; model->MOSkappaGiven = true; break; case MOS_MOD_KV: /* level 6 */ model->MOSkv = value->rValue; model->MOSkvGiven = true; break; case MOS_MOD_NV: /* level 6 */ model->MOSnv = value->rValue; model->MOSnvGiven = true; break; case MOS_MOD_KC: /* level 6 */ model->MOSkc = value->rValue; model->MOSkcGiven = true; break; case MOS_MOD_NC: /* level 6 */ model->MOSnc = value->rValue; model->MOSncGiven = true; break; case MOS_MOD_GAMMA1: /* level 6 */ model->MOSgamma1 = value->rValue; model->MOSgamma1Given = true; break; case MOS_MOD_SIGMA: /* level 6 */ model->MOSsigma = value->rValue; model->MOSsigmaGiven = true; break; case MOS_MOD_LAMDA0: /* level 6 */ model->MOSlamda0 = value->rValue; model->MOSlamda0Given = true; break; case MOS_MOD_LAMDA1: /* level 6 */ model->MOSlamda1 = value->rValue; model->MOSlamda1Given = true; break; default: return (E_BADPARM); } return (OK); }
35.979381
77
0.533715
5fd3ed70640b9a89771ed8fcac0d039820b56671
20,476
cpp
C++
SimCode/NetworkDriver.cpp
riedlc/SpiteInPrisonersDelight
8ebcf6c4ff398b21084179c3131f647cd6f62df0
[ "MIT" ]
null
null
null
SimCode/NetworkDriver.cpp
riedlc/SpiteInPrisonersDelight
8ebcf6c4ff398b21084179c3131f647cd6f62df0
[ "MIT" ]
null
null
null
SimCode/NetworkDriver.cpp
riedlc/SpiteInPrisonersDelight
8ebcf6c4ff398b21084179c3131f647cd6f62df0
[ "MIT" ]
null
null
null
// If compiled with -fopenmp, include omp (for multithreading) #ifdef _OPENMP #include <omp.h> #else #define omp_get_thread_num() 0 #define omp_get_max_threads() 1 #endif /* A test driver for the Network class (NetworkDriver.cpp) */ #include <stdio.h> #include <sys/stat.h> #include <iostream> #include <memory> #include <fstream> #include <iterator> #include <numeric> #include <string> #include <algorithm> #include <bitset> #include <iomanip> #include <vector> #include <boost/lexical_cast.hpp> #include <boost/random/mersenne_twister.hpp> #include <boost/random/uniform_real.hpp> #include <boost/random/variate_generator.hpp> #include <boost/random/normal_distribution.hpp> #include "Network.h" // using Network class typedef boost::mt19937 Engine; typedef boost::uniform_real<double> UDistribution; typedef boost::variate_generator< Engine &, UDistribution > UGenerator; typedef boost::normal_distribution<double> NDistribution; // Normal Distribution typedef boost::variate_generator<Engine &, NDistribution > NGenerator; // Variate generator // This is for the output formatting, prints one line at a time comma separated except for the end of the line template <typename Stream, typename Iter, typename Infix> inline Stream& infix (Stream &os, Iter from, Iter to, Infix infix_) { if (from == to) return os; os << *from; for (++from; from!=to; ++from) { os << infix_ << *from; } return os; } template <typename Stream, typename Iter> inline Stream& comma_seperated (Stream &os, Iter from, Iter to) { return infix (os, from, to, ", "); } void run_model(UGenerator rng, Game &g, SimTracking &tracking_vars, Network &net); void run_timestep(UGenerator rng, Game &g, SimTracking &tracking_vars, Network &net, int t, std::vector<int> agent_seq); bool is_number(const std::string& s); bool file_exists (const std::string& name); void consider_imitation(UGenerator rng, Network &net); int main(int argc, char *argv[]){ // Command line arguments at runtime char* inputFolder = argv[1]; // Name of input file (decide to include folder here) char* inputFileNumber = argv[2]; // Input file number int thread_ct = atoi(argv[3]); // Number of threads to run in parallel if fopenmp int num_seeds = atoi(argv[4]); // Number of seeds to run int base_seed = atoi(argv[5]); // Starting at this seed int start_key = atoi(argv[6]); // Starting at this key index std::cout << "thread_ct: " << thread_ct << std::endl; std::cout << "num seeds: " << num_seeds << std::endl; std::cout << "base_seed: " << base_seed << std::endl; std::cout << "start_key: " << start_key << std::endl; // Read in seeds ////////////////////////////////////////////////////// std::ifstream seedfile("ESD_Seeds_All_Ordered.csv"); //../Helpers/ESD_Seeds_All_Ordered.csv if (seedfile.fail()){ std::cerr << "Error: " << strerror(errno) << "\n"; } std::vector<int> seeds; int seed_value; while (seedfile >> seed_value) { seeds.push_back(seed_value); } ////////////////////////////////////////////////////// End read // Read input file line by line (discard header) std::string full_input_folder = string_format("IM_Input/Input_IM_%s",inputFolder); std::string inputFilename = string_format("%s/Input_%s.conf",full_input_folder.c_str(),inputFileNumber);//string_format("%s/Input_IM_%s_%s.conf",full_input_folder.c_str(),inputFolder,inputFileNumber); std::ifstream in(inputFilename); std::cout << inputFilename << "\n"; if (in.fail()){ std::cerr << "Error: " << strerror(errno) << "\n"; } std::vector<std::vector<std::string>> all_inputs; std::string header; getline(in, header); if (in) { std::string line; while (std::getline(in, line)) { all_inputs.push_back(std::vector<std::string>()); // Break down the row into column values std::stringstream split(line); //Creates iterator std::string value; // while (split >> value) //Loops while iterator has values to assign all_inputs.back().push_back(value); } } ////////////////////////////////////////////////////// End read // Number of keys is number of lines, or size of all inputs first dimension int num_keys = (int) all_inputs.size(); #ifdef _OPENMP { #pragma omp parallel for num_threads(thread_ct) //start thread_ct parallel for loops (each is one simulation) #endif for(int seeded_run = num_seeds*start_key; seeded_run < num_keys * num_seeds; seeded_run++) { // Set key index and seed index int run_num = seeded_run/num_seeds; int seed_ind = seeded_run%num_seeds; // Locate seed at the relevant index int this_seed = seeds.at(base_seed + seed_ind); // Grab input vector and set simulation parameters //////////////////////////////////////////// std::vector<std::string> these_inputs = all_inputs.at(run_num); double base_in = std::stod(these_inputs.at(0)); int net_pop = std::stoi(these_inputs.at(1)); int tmax_in = std::stoi(these_inputs.at(2)); float netdiscount_in = std::stof(these_inputs.at(3)); float netlearningspeed_in = std::stof(these_inputs.at(4)); bool memorysymmetric_in = boost::lexical_cast<bool>(these_inputs.at(5)); bool netsymmetric_in = boost::lexical_cast<bool>(these_inputs.at(6)); float imitation_tremble = std::stof(these_inputs.at(7)); float nettremble_in = std::stof(these_inputs.at(8)); float strattremble_in = std::stof(these_inputs.at(9)); float imitationRate = std::stof(these_inputs.at(10)); int memory = std::stoi(these_inputs.at(11)); int average_comp_in = std::stof(these_inputs.at(12)); std::string memory_type_in = these_inputs.at(13); std::string game_in = these_inputs.at(14); std::string outputDesc = these_inputs.at(15); std::string key = these_inputs.at(16); std::string mainOutputFolder = string_format("%s_Output_Data",game_in.c_str()); std::string outputFolder = string_format("%s_Output_Data/Output_%s",game_in.c_str(),outputDesc.c_str()); std::string strat_file = string_format("%s/Strategy/Strategy_%s.csv",full_input_folder.c_str(),key.c_str()); struct stat st = {0}; // If output directory doesn't exist, create it if(stat(mainOutputFolder.c_str(), &st) == -1){ mkdir(mainOutputFolder.c_str(), 0700); } // If output directory doesn't exist, create it if(stat(outputFolder.c_str(), &st) == -1){ mkdir(outputFolder.c_str(), 0700); } //////////////////////////////////////////// // Initialize tracking variables and output files SimTracking tracking_vars; tracking_vars.out_avg_payoff_file = string_format("%s/%s_AvgPayoffs_%s_%d.csv",outputFolder.c_str(),game_in.c_str(),key.c_str(), this_seed); tracking_vars.out_network_file = string_format("%s/%s_Weights_%s_%d.csv",outputFolder.c_str(),game_in.c_str(),key.c_str(), this_seed); tracking_vars.out_stats_file = string_format("%s/%s_EvoStats_%s_%d.csv",outputFolder.c_str(),game_in.c_str(),key.c_str(), this_seed); tracking_vars.out_p1strat_file = string_format("%s/%s_Strategy_%s_%d.csv",outputFolder.c_str(),game_in.c_str(),key.c_str(), this_seed); tracking_vars.out_p1_payoffs = string_format("%s/%s_P1Payoffs_%s_%d.csv",outputFolder.c_str(),game_in.c_str(),key.c_str(), this_seed); tracking_vars.out_p2_payoffs = string_format("%s/%s_P2Payoffs_%s_%d.csv",outputFolder.c_str(),game_in.c_str(),key.c_str(), this_seed); tracking_vars.out_partners = string_format("%s/%s_Partners_%s_%d.csv",outputFolder.c_str(),game_in.c_str(),key.c_str(), this_seed); // Check if output files exist (if they already exist, why rerun?) if(!(file_exists(tracking_vars.out_network_file) && file_exists(tracking_vars.out_stats_file) && file_exists(tracking_vars.out_p1strat_file))){ Engine eng(this_seed); UDistribution udst(0.0, 1.0); UGenerator rng(eng, udst); // Construct a Game std::string payoff_filename = string_format("%s/Payoffs/Payoffs_%s.csv",full_input_folder.c_str(),key.c_str()); Game g(payoff_filename, game_in.c_str(), base_in); //Construct a network of Agents Network net(net_pop, strat_file, netlearningspeed_in, netdiscount_in, strattremble_in, nettremble_in, netsymmetric_in, imitationRate, memory, imitation_tremble, memorysymmetric_in, average_comp_in, memory_type_in); // Initialize tracking variables for timestep 0 (initial conditions) tracking_vars.init_Trackers(); tracking_vars.updateData(net, 0); tracking_vars.max_time = tmax_in; //////////////////////////////////////////// // Run single simulation run_model(rng, g, tracking_vars, net); // Output tracking data ///////////////////////////////////////////// std::ofstream avg_out(tracking_vars.out_avg_payoff_file.c_str()); avg_out << std::setprecision(4); for(size_t time_i = 0; time_i < tracking_vars.player_avg_payoff_t.size(); time_i++){ comma_seperated(avg_out, tracking_vars.player_avg_payoff_t.at(time_i).begin(), tracking_vars.player_avg_payoff_t.at(time_i).end()) << std::endl; } std::ofstream net_out(tracking_vars.out_network_file.c_str()); net_out << std::setprecision(4); for(size_t time_i = 0; time_i < tracking_vars.network_weights_t.size(); time_i++){ comma_seperated(net_out, tracking_vars.network_weights_t.at(time_i).begin(), tracking_vars.network_weights_t.at(time_i).end()) << std::endl; } std::ofstream p1_strat_out(tracking_vars.out_p1strat_file.c_str()); p1_strat_out << std::setprecision(3); for(size_t time_i = 0; time_i < tracking_vars.player_strategies_p1_t.size(); time_i++){ comma_seperated(p1_strat_out, tracking_vars.player_strategies_p1_t.at(time_i).begin(), tracking_vars.player_strategies_p1_t.at(time_i).end()) << std::endl; } std::ofstream stats_out(tracking_vars.out_stats_file.c_str()); stats_out << std::setprecision(3); for(size_t time_i = 0; time_i < tracking_vars.prop_interactions_t.size(); time_i++){ comma_seperated(stats_out, tracking_vars.prop_interactions_t.at(time_i).begin(), tracking_vars.prop_interactions_t.at(time_i).end()) << std::endl; } //////////////////////////////////////////// End output } } #ifdef _OPENMP } #endif return 0; } void consider_imitation(UGenerator rng, Network &net){ //consider agents in random order std::random_shuffle(net.agent_seq.begin(), net.agent_seq.end()); int agent; int pop = net.getPop(); //get vector of a link weights (adj matrix) std::vector<double> adj_mat; for(int agent_num = 0; agent_num < pop; agent_num++){ Agent temp_agent = net.GetAgent(agent_num); std::vector<double> friends = temp_agent.getFriends(); adj_mat.insert(adj_mat.end(), friends.begin(), friends.end()); //temp_agent.getFriends().begin(), temp_agent.getFriends().end() } // Get total normalized interaction weights between each pair of agents double row_sum; std::vector<double> norm_adj(pop*pop); for(int up_adj_i = 0; up_adj_i < pop; up_adj_i++){ row_sum = std::accumulate(adj_mat.begin()+up_adj_i*pop, adj_mat.begin()+up_adj_i*pop+pop,0.0); std::transform(adj_mat.begin()+up_adj_i*pop, adj_mat.begin()+up_adj_i*pop+pop, norm_adj.begin() + up_adj_i*pop, std::bind2nd(std::divides<double>(),row_sum)); } // Loop through agents, random order for(int agent_num = 0; agent_num < pop; agent_num++){ agent = net.agent_seq.at(agent_num); // Current agent (shuffled order) Agent &currentAgent = net.GetAgent(agent); std::vector<int> temp_agent_seq(net.agent_seq); temp_agent_seq.erase(std::remove(temp_agent_seq.begin(), temp_agent_seq.end(), agent), temp_agent_seq.end()); int possibleRoleModel = currentAgent.chooseImitationPartner(rng, temp_agent_seq, norm_adj); Agent possibleRoleModelAgent = net.GetAgent(possibleRoleModel); currentAgent.chooseToImitate(rng, possibleRoleModelAgent); } // simultaneous updating of strategy for(int agent_num = 0; agent_num < pop; agent_num++){ agent = net.agent_seq.at(agent_num); // Current agent (shuffled order) Agent &currentAgent = net.GetAgent(agent); currentAgent.setStrategyProfile(currentAgent.getNextStrategyProfile()); } } void die_replace(UGenerator rng, Network &net, Game &g, float total_coop_this_interval){ int pop = net.getPop(); // randomly select agent to die int rand_death_index = (int) (rng() * (pop)); Agent &dead_agent = net.GetAgent(rand_death_index); //need & here?????? // update Dead Agents outgoing weights to initializaiton double net_fill = 19.0/(pop-1); //(19.0/(pop-1))*10 std::vector<double> myfriends(pop); std::fill(myfriends.begin(),myfriends.end(),net_fill); myfriends.at(rand_death_index) = 0; std::cout << "Before: " << dead_agent.getFriends().at(1) << std::endl; dead_agent.setCurFriends(myfriends); // ask about this std::cout << "After: " << dead_agent.getFriends().at(1) << std::endl; // update other Agents ingoing weights to initializaiton for(int agent_num = 0; agent_num < pop; agent_num++){ if (rand_death_index != agent_num){ Agent &currentAgent = net.GetAgent(agent_num); std::vector<double> myfriends = currentAgent.getFriends(); myfriends.at(rand_death_index) = net_fill; currentAgent.setCurFriends(myfriends); } } // Select new strategy type std::vector<double> coop_payoffs = g.getCoopPayoffs(); std::vector<double> defect_payoffs = g.getDefectPayoffs(); float sum_of_coop = std::accumulate(coop_payoffs.begin(), coop_payoffs.end(), 0.0); float sum_of_defect = std::accumulate(defect_payoffs.begin(), defect_payoffs.end(), 0.0); int coop_len = coop_payoffs.size(); int defect_len = defect_payoffs.size(); int numCoop = net.getNumCoop(); float pi; if (true){ float avg_pay_per = (sum_of_coop + sum_of_defect)/(coop_len + defect_len); float avg_pay_per_i = sum_of_coop/coop_len; pi = numCoop*(avg_pay_per_i/(pop*avg_pay_per)); } else { float total_payoff = sum_of_coop + sum_of_defect; float avg_accum = total_payoff/total_coop_this_interval; pi = numCoop*(avg_accum/total_payoff); } double reproduction_tremble = rng(); double reproduction_tremble_rate = 0.001; double strat_draw = rng(); if (reproduction_tremble > reproduction_tremble_rate){ if(strat_draw < pi){ dead_agent.setStrategyProfile(true); } else { dead_agent.setStrategyProfile(false); } } else { if(strat_draw < 0.5){ dead_agent.setStrategyProfile(true); } else { dead_agent.setStrategyProfile(false); } } // clear payoff trackers g.clearPayoffs(); } void run_model(UGenerator rng, Game &g, SimTracking &tracking_vars, Network &net){ // Initialize agent sequence (to be randomized each round tracking_vars.initAgentList(net); float cur_num_coop = 0; float prev_num_coop = 0; float total_coop_this_interval = 0; // Run simulation for max_time timesteps for (int t = 1; t < tracking_vars.max_time+1; t++) { cur_num_coop = net.getNumCoop(); if (cur_num_coop > prev_num_coop){ total_coop_this_interval = total_coop_this_interval + (cur_num_coop - prev_num_coop); } prev_num_coop = cur_num_coop; // Run simulation for one time step, loop through all agents once run_timestep(rng, g, tracking_vars, net, t, net.agent_seq); //********Uncomment code below to run model with Imitation // Agents consider imitating at end of each round consider_imitation(rng, net); //********Uncomment code below to run model with Moran process // Check if agent dies this round //if (t % 10 == 0){ // change to variable mod //die_replace(rng, net, g, total_coop_this_interval); //total_coop_this_interval = 0; //prev_num_coop = 0; //} } } void run_timestep(UGenerator rng, Game &g, SimTracking &tracking_vars, Network &net, int t, std::vector<int> agent_seq){ // Shuffle agents in random order (updating is synchronous anyways so this only serves as another layer of randomness) std::random_shuffle(agent_seq.begin(), agent_seq.end()); ////////////////////////////////////////// int agent; // Loop through agents, random order for(int agent_num = 0; agent_num < net.getPop(); agent_num++) { agent = agent_seq.at(agent_num); // Current agent (shuffled order) // Create temp vector for agent to choose random neighbor from std::vector<int> temp_agent_seq(agent_seq); //Remove current agent from vector temp_agent_seq.erase(std::remove(temp_agent_seq.begin(), temp_agent_seq.end(), agent), temp_agent_seq.end()); // Get the current agent Agent &currentAgent = net.GetAgent(agent); // Choose interaction partner according to network weights int friend_ind = currentAgent.chooseFriend(rng,temp_agent_seq); // Set friend agent Agent &friendAgent = net.GetAgent(friend_ind); friendAgent.setCurrentFriend(agent); //Draw random numbers to determine strategy for host and visitor currentAgent.chooseStrategy(rng, currentAgent.getStrategyProfile()); friendAgent.chooseStrategy(rng, friendAgent.getStrategyProfile()); /* Interact */ g.playGame(currentAgent, friendAgent); /* Update network weights */ currentAgent.discountNeighbors(); currentAgent.addNetworkPayoff(); if(friendAgent.getNetworkSym() == 1) // This mean that agents partner updates their network weights as well { friendAgent.discountNeighbors(); friendAgent.addNetworkPayoff(); } } if(std::find(tracking_vars.times_tracked.begin(), tracking_vars.times_tracked.end(), t) != tracking_vars.times_tracked.end()) { tracking_vars.updateData(net, t); }else{ for(int update_flag = 0; update_flag < net.getPop(); update_flag++){ Agent &curAgent = net.GetAgent(update_flag); curAgent.updateAgent(); } } } bool is_number(const std::string& s) { return !s.empty() && std::find_if(s.begin(), s.end(), [](char c) { return !std::isdigit(c); }) == s.end(); } bool file_exists (const std::string& name) { struct stat buffer; return (stat (name.c_str(), &buffer) == 0); }
41.199195
231
0.611155
5fd4b2a3d3500877f0ea0aaad0d4f55e6984a839
260
cpp
C++
ALGORITHMS/Reccursion/Factorial/Factorial.cpp
anishsingh42/CodeChef
50f5c0438516210895e513bc4ee959b9d99ef647
[ "Apache-2.0" ]
127
2020-10-13T18:04:35.000Z
2022-02-17T10:56:27.000Z
ALGORITHMS/Reccursion/Factorial/Factorial.cpp
anishsingh42/CodeChef
50f5c0438516210895e513bc4ee959b9d99ef647
[ "Apache-2.0" ]
132
2020-10-13T18:06:53.000Z
2021-10-17T18:44:26.000Z
ALGORITHMS/Reccursion/Factorial/Factorial.cpp
anishsingh42/CodeChef
50f5c0438516210895e513bc4ee959b9d99ef647
[ "Apache-2.0" ]
364
2020-10-13T18:04:52.000Z
2022-03-04T14:34:53.000Z
#include <bits/stdc++.h> using namespace std; int factorial(int n) { if (n > 1) n *= factorial(n - 1); return n; } int main() { int n; cin >> n; cout << factorial(n) << endl; return 0; } // Complexity of the above program is O(n)
13.684211
42
0.55
5fd4e83c4342a0a31ee949f1b9e89980fd360f03
11,966
cpp
C++
src/QtAudio/CiosAudio/CaDebug.cpp
Vladimir-Lin/QtAudio
5c58e86cda1a88f03c4dde53883a979bec37b504
[ "MIT" ]
null
null
null
src/QtAudio/CiosAudio/CaDebug.cpp
Vladimir-Lin/QtAudio
5c58e86cda1a88f03c4dde53883a979bec37b504
[ "MIT" ]
null
null
null
src/QtAudio/CiosAudio/CaDebug.cpp
Vladimir-Lin/QtAudio
5c58e86cda1a88f03c4dde53883a979bec37b504
[ "MIT" ]
null
null
null
/***************************************************************************** * * * CIOS Audio Core * * * * Version : 1.5.11 * * Author : Brian Lin <lin.foxman@gmail.com> * * Skpye : wolfram_lin * * Lastest update : 2014/12/18 * * Site : http://ciosaudio.sourceforge.net * * License : LGPLv3 * * * * Documents are separated, you will receive the full document when you * * download the source code. It is all-in-one, there is no comment in the * * source code. * * * *****************************************************************************/ #include "CiosAudioPrivate.hpp" #if _MSC_VER #define VSNPRINTF _vsnprintf #define LOG_BUF_SIZE 2048 #else #define VSNPRINTF vsnprintf #endif #ifdef DONT_USE_NAMESPACE #else namespace CAC_NAMESPACE { #endif typedef struct CaHostErrorInfo { CaHostApiTypeId hostApiType ; /**< the host API which returned the error code */ long errorCode ; /**< the error code returned */ const char * errorText ; /**< a textual description of the error if available, otherwise a zero-length string */ } CaHostErrorInfo ; #define CA_LAST_HOST_ERROR_TEXT_LENGTH_ 1024 static char lastHostErrorText_[ CA_LAST_HOST_ERROR_TEXT_LENGTH_ + 1 ] = {0}; static CaHostErrorInfo lastHostErrorInfo_ = { (CaHostApiTypeId)-1 , 0 , lastHostErrorText_ } ; void SetLastHostErrorInfo ( CaHostApiTypeId hostApiType , long errorCode , const char * errorText ) { lastHostErrorInfo_ . hostApiType = hostApiType ; lastHostErrorInfo_ . errorCode = errorCode ; if ( NULL == errorText ) return ; ::strncpy( lastHostErrorText_ , errorText , CA_LAST_HOST_ERROR_TEXT_LENGTH_ ) ; } Debugger:: Debugger (void) { } Debugger::~Debugger (void) { } const char * Debugger::lastError (void) { return lastHostErrorText_ ; } void Debugger::printf(const char * format,...) { // Optional logging into Output console of Visual Studio #if defined(_MSC_VER) && defined(ENABLE_MSVC_DEBUG_OUTPUT) char buf [ LOG_BUF_SIZE ] ; va_list ap ; va_start ( ap , format ) ; VSNPRINTF ( buf , sizeof(buf) , format , ap ) ; buf[sizeof(buf)-1] = 0 ; OutputDebugStringA ( buf ) ; va_end ( ap ) ; #else va_list ap ; va_start ( ap , format ) ; vfprintf ( stderr , format , ap ) ; va_end ( ap ) ; fflush ( stderr ) ; #endif } const char * Debugger::Error(CaError errorCode) { const char * result = NULL ; switch ( errorCode ) { case NoError : result = "Success" ; break ; case NotInitialized : result = "CIOS Audio Core not initialized" ; break ; case UnanticipatedHostError : result = "Unanticipated host error" ; break ; case InvalidChannelCount : result = "Invalid number of channels" ; break ; case InvalidSampleRate : result = "Invalid sample rate" ; break ; case InvalidDevice : result = "Invalid device" ; break ; case InvalidFlag : result = "Invalid flag" ; break ; case SampleFormatNotSupported : result = "Sample format not supported" ; break ; case BadIODeviceCombination : result = "Illegal combination of I/O devices" ; break ; case InsufficientMemory : result = "Insufficient memory" ; break ; case BufferTooBig : result = "Buffer too big" ; break ; case BufferTooSmall : result = "Buffer too small" ; break ; case NullCallback : result = "No callback routine specified" ; break ; case BadStreamPtr : result = "Invalid stream pointer" ; break ; case TimedOut : result = "Wait timed out" ; break ; case InternalError : result = "Internal CIOS Audio error" ; break ; case DeviceUnavailable : result = "Device unavailable" ; break ; case IncompatibleStreamInfo : result = "Incompatible host API specific stream info" ; break ; case StreamIsStopped : result = "Stream is stopped" ; break ; case StreamIsNotStopped : result = "Stream is not stopped" ; break ; case InputOverflowed : result = "Input overflowed" ; break ; case OutputUnderflowed : result = "Output underflowed" ; break ; case HostApiNotFound : result = "Host API not found" ; break ; case InvalidHostApi : result = "Invalid host API" ; break ; case CanNotReadFromACallbackStream : result = "Can't read from a callback stream" ; break ; case CanNotWriteToACallbackStream : result = "Can't write to a callback stream" ; break ; case CanNotReadFromAnOutputOnlyStream : result = "Can't read from an output only stream" ; break ; case CanNotWriteToAnInputOnlyStream : result = "Can't write to an input only stream" ; break ; case IncompatibleStreamHostApi : result = "Incompatible stream host API" ; break ; case BadBufferPtr : result = "Bad buffer pointer" ; break ; default : if( errorCode > 0 ) result = "Invalid error code (value greater than zero)" ; else result = "Invalid error code" ; break ; } ; return result ; } #ifdef DONT_USE_NAMESPACE #else } #endif
60.434343
120
0.272606
5fd8e47fafc7680ed6025cb53e04e83e34054558
478,011
cpp
C++
Sources/Elastos/LibCore/tests/bak/Namespace/R.cpp
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
7
2017-07-13T10:34:54.000Z
2021-04-16T05:40:35.000Z
Sources/Elastos/LibCore/tests/bak/Namespace/R.cpp
xiaoweiruby/Elastos.RT
238e9b747f70fc129769ae7850def4362c43e443
[ "Apache-2.0" ]
null
null
null
Sources/Elastos/LibCore/tests/bak/Namespace/R.cpp
xiaoweiruby/Elastos.RT
238e9b747f70fc129769ae7850def4362c43e443
[ "Apache-2.0" ]
9
2017-07-13T12:33:20.000Z
2021-06-19T02:46:48.000Z
#include "R.h" namespace Elastos { namespace Droid { const int R::anim::accelerate_decelerate_interpolator=0x010a0004; const int R::anim::accelerate_interpolator=0x010a0005; const int R::anim::activity_close_enter=0x010a000d; const int R::anim::activity_close_exit=0x010a000e; const int R::anim::activity_open_enter=0x010a000f; const int R::anim::activity_open_exit=0x010a0010; const int R::anim::anticipate_interpolator=0x010a0007; const int R::anim::anticipate_overshoot_interpolator=0x010a0009; const int R::anim::app_starting_exit=0x010a0011; const int R::anim::bounce_interpolator=0x010a000a; const int R::anim::cycle_interpolator=0x010a000c; const int R::anim::decelerate_interpolator=0x010a0006; const int R::anim::dialog_enter=0x010a0012; const int R::anim::dialog_exit=0x010a0013; const int R::anim::dock_bottom_enter=0x010a0014; const int R::anim::dock_bottom_exit=0x010a0015; const int R::anim::dock_left_enter=0x010a0016; const int R::anim::dock_left_exit=0x010a0017; const int R::anim::dock_right_enter=0x010a0018; const int R::anim::dock_right_exit=0x010a0019; const int R::anim::dock_top_enter=0x010a001a; const int R::anim::dock_top_exit=0x010a001b; const int R::anim::fade_in=0x010a0000; const int R::anim::fade_out=0x010a0001; const int R::anim::fast_fade_in=0x010a001c; const int R::anim::fast_fade_out=0x010a001d; const int R::anim::grow_fade_in=0x010a001e; const int R::anim::grow_fade_in_center=0x010a001f; const int R::anim::grow_fade_in_from_bottom=0x010a0020; const int R::anim::input_method_enter=0x010a0021; const int R::anim::input_method_exit=0x010a0022; const int R::anim::input_method_extract_enter=0x010a0023; const int R::anim::input_method_extract_exit=0x010a0024; const int R::anim::input_method_fancy_enter=0x010a0025; const int R::anim::input_method_fancy_exit=0x010a0026; const int R::anim::keyguard_action_assist_enter=0x010a0027; const int R::anim::keyguard_action_assist_exit=0x010a0028; const int R::anim::keyguard_security_animate_in=0x010a0029; const int R::anim::keyguard_security_animate_out=0x010a002a; const int R::anim::keyguard_security_fade_in=0x010a002b; const int R::anim::keyguard_security_fade_out=0x010a002c; const int R::anim::linear_interpolator=0x010a000b; const int R::anim::lock_screen_behind_enter=0x010a002d; const int R::anim::lock_screen_enter=0x010a002e; const int R::anim::lock_screen_exit=0x010a002f; const int R::anim::lock_screen_wallpaper_behind_enter=0x010a0030; const int R::anim::options_panel_enter=0x010a0031; const int R::anim::options_panel_exit=0x010a0032; const int R::anim::overshoot_interpolator=0x010a0008; const int R::anim::push_down_in=0x010a0033; const int R::anim::push_down_in_no_alpha=0x010a0034; const int R::anim::push_down_out=0x010a0035; const int R::anim::push_down_out_no_alpha=0x010a0036; const int R::anim::push_up_in=0x010a0037; const int R::anim::push_up_out=0x010a0038; const int R::anim::recent_enter=0x010a0039; const int R::anim::recent_exit=0x010a003a; const int R::anim::recents_fade_in=0x010a003b; const int R::anim::recents_fade_out=0x010a003c; const int R::anim::screen_rotate_0_enter=0x010a003d; const int R::anim::screen_rotate_0_exit=0x010a003e; const int R::anim::screen_rotate_0_frame=0x010a003f; const int R::anim::screen_rotate_180_enter=0x010a0040; const int R::anim::screen_rotate_180_exit=0x010a0041; const int R::anim::screen_rotate_180_frame=0x010a0042; const int R::anim::screen_rotate_finish_enter=0x010a0043; const int R::anim::screen_rotate_finish_exit=0x010a0044; const int R::anim::screen_rotate_finish_frame=0x010a0045; const int R::anim::screen_rotate_minus_90_enter=0x010a0046; const int R::anim::screen_rotate_minus_90_exit=0x010a0047; const int R::anim::screen_rotate_minus_90_frame=0x010a0048; const int R::anim::screen_rotate_plus_90_enter=0x010a0049; const int R::anim::screen_rotate_plus_90_exit=0x010a004a; const int R::anim::screen_rotate_plus_90_frame=0x010a004b; const int R::anim::screen_rotate_start_enter=0x010a004c; const int R::anim::screen_rotate_start_exit=0x010a004d; const int R::anim::screen_rotate_start_frame=0x010a004e; const int R::anim::screen_user_enter=0x010a004f; const int R::anim::screen_user_exit=0x010a0050; const int R::anim::search_bar_enter=0x010a0051; const int R::anim::search_bar_exit=0x010a0052; const int R::anim::shrink_fade_out=0x010a0053; const int R::anim::shrink_fade_out_center=0x010a0054; const int R::anim::shrink_fade_out_from_bottom=0x010a0055; const int R::anim::slide_in_child_bottom=0x010a0056; const int R::anim::slide_in_left=0x010a0002; const int R::anim::slide_in_right=0x010a0057; const int R::anim::slide_in_up=0x010a0058; const int R::anim::slide_out_down=0x010a0059; const int R::anim::slide_out_left=0x010a005a; const int R::anim::slide_out_right=0x010a0003; const int R::anim::slow_fade_in=0x010a005b; const int R::anim::submenu_enter=0x010a005c; const int R::anim::submenu_exit=0x010a005d; const int R::anim::task_close_enter=0x010a005e; const int R::anim::task_close_exit=0x010a005f; const int R::anim::task_open_enter=0x010a0060; const int R::anim::task_open_exit=0x010a0061; const int R::anim::toast_enter=0x010a0062; const int R::anim::toast_exit=0x010a0063; const int R::anim::translucent_enter=0x010a0064; const int R::anim::translucent_exit=0x010a0065; const int R::anim::wallpaper_close_enter=0x010a0066; const int R::anim::wallpaper_close_exit=0x010a0067; const int R::anim::wallpaper_enter=0x010a0068; const int R::anim::wallpaper_exit=0x010a0069; const int R::anim::wallpaper_intra_close_enter=0x010a006a; const int R::anim::wallpaper_intra_close_exit=0x010a006b; const int R::anim::wallpaper_intra_open_enter=0x010a006c; const int R::anim::wallpaper_intra_open_exit=0x010a006d; const int R::anim::wallpaper_open_enter=0x010a006e; const int R::anim::wallpaper_open_exit=0x010a006f; const int R::anim::window_move_from_decor=0x010a0070; const int R::animator::fade_in=0x010b0000; const int R::animator::fade_out=0x010b0001; const int R::animator::fragment_close_enter=0x010b0002; const int R::animator::fragment_close_exit=0x010b0003; const int R::animator::fragment_fade_enter=0x010b0004; const int R::animator::fragment_fade_exit=0x010b0005; const int R::animator::fragment_open_enter=0x010b0006; const int R::animator::fragment_open_exit=0x010b0007; const int R::array::carrier_properties=0x01070038; const int R::array::common_nicknames=0x01070036; const int R::array::config_autoBrightnessButtonBacklightValues=0x0107002b; const int R::array::config_autoBrightnessKeyboardBacklightValues=0x0107002c; const int R::array::config_autoBrightnessLcdBacklightValues=0x0107002a; const int R::array::config_autoBrightnessLevels=0x01070029; const int R::array::config_cdma_dun_supported_types=0x01070020; const int R::array::config_data_usage_network_types=0x01070018; const int R::array::config_defaultNotificationVibePattern=0x01070032; const int R::array::config_keyboardTapVibePattern=0x01070025; const int R::array::config_locationProviderPackageNames=0x0107002d; const int R::array::config_longPressVibePattern=0x01070023; const int R::array::config_masterVolumeRamp=0x01070014; const int R::array::config_mobile_hotspot_provision_app=0x0107001e; const int R::array::config_notificationFallbackVibePattern=0x01070033; const int R::array::config_oemUsbModeOverride=0x01070031; const int R::array::config_protectedNetworks=0x01070016; const int R::array::config_safeModeDisabledVibePattern=0x01070026; const int R::array::config_safeModeEnabledVibePattern=0x01070027; const int R::array::config_scrollBarrierVibePattern=0x01070028; const int R::array::config_serialPorts=0x01070022; const int R::array::config_sms_enabled_locking_shift_tables=0x01070030; const int R::array::config_sms_enabled_single_shift_tables=0x0107002f; const int R::array::config_statusBarIcons=0x01070013; const int R::array::config_tether_bluetooth_regexs=0x0107001c; const int R::array::config_tether_dhcp_range=0x0107001d; const int R::array::config_tether_upstream_types=0x0107001f; const int R::array::config_tether_usb_regexs=0x01070019; const int R::array::config_tether_wifi_regexs=0x0107001a; const int R::array::config_tether_wimax_regexs=0x0107001b; const int R::array::config_twoDigitNumberPattern=0x0107002e; const int R::array::config_usbHostBlacklist=0x01070021; const int R::array::config_virtualKeyVibePattern=0x01070024; const int R::array::emailAddressTypes=0x01070000; const int R::array::imAddressTypes=0x01070037; const int R::array::imProtocols=0x01070001; const int R::array::lockscreen_direction_descriptions=0x0107000b; const int R::array::lockscreen_num_pad_klondike=0x01070012; const int R::array::lockscreen_target_descriptions_unlock_only=0x01070011; const int R::array::lockscreen_target_descriptions_when_silent=0x0107000a; const int R::array::lockscreen_target_descriptions_when_soundon=0x0107000d; const int R::array::lockscreen_target_descriptions_with_camera=0x0107000f; const int R::array::lockscreen_targets_unlock_only=0x01070010; const int R::array::lockscreen_targets_when_silent=0x01070009; const int R::array::lockscreen_targets_when_soundon=0x0107000c; const int R::array::lockscreen_targets_with_camera=0x0107000e; const int R::array::maps_starting_lat_lng=0x01070034; const int R::array::maps_starting_zoom=0x01070035; const int R::array::networkAttributes=0x01070015; const int R::array::organizationTypes=0x01070002; const int R::array::phoneTypes=0x01070003; const int R::array::postalAddressTypes=0x01070004; const int R::array::preloaded_color_state_lists=0x01070006; const int R::array::preloaded_drawables=0x01070005; const int R::array::radioAttributes=0x01070017; const int R::array::special_locale_codes=0x01070007; const int R::array::special_locale_names=0x01070008; const int R::attr::absListViewStyle=0x0101006a; const int R::attr::accessibilityEventTypes=0x01010380; const int R::attr::accessibilityFeedbackType=0x01010382; const int R::attr::accessibilityFlags=0x01010384; const int R::attr::accessibilityFocusedDrawable=0x010103f8; const int R::attr::accountPreferences=0x0101029f; const int R::attr::accountType=0x0101028f; const int R::attr::action=0x0101002d; const int R::attr::actionBarDivider=0x0101039b; const int R::attr::actionBarItemBackground=0x0101039c; const int R::attr::actionBarSize=0x010102eb; const int R::attr::actionBarSplitStyle=0x01010388; const int R::attr::actionBarStyle=0x010102ce; const int R::attr::actionBarTabBarStyle=0x010102f4; const int R::attr::actionBarTabStyle=0x010102f3; const int R::attr::actionBarTabTextStyle=0x010102f5; const int R::attr::actionBarWidgetTheme=0x01010397; const int R::attr::actionButtonStyle=0x010102d8; const int R::attr::actionDropDownStyle=0x010102d7; const int R::attr::actionLayout=0x010102fb; const int R::attr::actionMenuTextAppearance=0x01010360; const int R::attr::actionMenuTextColor=0x01010361; const int R::attr::actionModeBackground=0x010102db; const int R::attr::actionModeCloseButtonStyle=0x010102f7; const int R::attr::actionModeCloseDrawable=0x010102dc; const int R::attr::actionModeCopyDrawable=0x01010312; const int R::attr::actionModeCutDrawable=0x01010311; const int R::attr::actionModeFindDrawable=0x010103e2; const int R::attr::actionModePasteDrawable=0x01010313; const int R::attr::actionModePopupWindowStyle=0x010103e4; const int R::attr::actionModeSelectAllDrawable=0x0101037e; const int R::attr::actionModeShareDrawable=0x010103e1; const int R::attr::actionModeSplitBackground=0x0101039d; const int R::attr::actionModeStyle=0x01010394; const int R::attr::actionModeWebSearchDrawable=0x010103e3; const int R::attr::actionOverflowButtonStyle=0x010102f6; const int R::attr::actionProviderClass=0x01010389; const int R::attr::actionViewClass=0x010102fc; const int R::attr::activatedBackgroundIndicator=0x010102fd; const int R::attr::activityChooserViewStyle=0x010103e0; const int R::attr::activityCloseEnterAnimation=0x010100ba; const int R::attr::activityCloseExitAnimation=0x010100bb; const int R::attr::activityOpenEnterAnimation=0x010100b8; const int R::attr::activityOpenExitAnimation=0x010100b9; const int R::attr::addStatesFromChildren=0x010100f0; const int R::attr::adjustViewBounds=0x0101011e; const int R::attr::alertDialogButtonGroupStyle=0x010103d6; const int R::attr::alertDialogCenterButtons=0x010103d7; const int R::attr::alertDialogIcon=0x01010355; const int R::attr::alertDialogStyle=0x0101005d; const int R::attr::alertDialogTheme=0x01010309; const int R::attr::alignmentMode=0x0101037a; const int R::attr::allContactsName=0x010102cc; const int R::attr::allowBackup=0x01010280; const int R::attr::allowClearUserData=0x01010005; const int R::attr::allowMassStorage=0x01010446; const int R::attr::allowParallelSyncs=0x01010332; const int R::attr::allowScaling=0x0101042c; const int R::attr::allowSingleTap=0x01010259; const int R::attr::allowTaskReparenting=0x01010204; const int R::attr::alpha=0x0101031f; const int R::attr::alphabeticShortcut=0x010101e3; const int R::attr::alwaysDrawnWithCache=0x010100ef; const int R::attr::alwaysRetainTaskState=0x01010203; const int R::attr::alwaysTrackFinger=0x01010435; const int R::attr::angle=0x010101a0; const int R::attr::animateFirstView=0x010102d5; const int R::attr::animateLayoutChanges=0x010102f2; const int R::attr::animateOnClick=0x0101025c; const int R::attr::animation=0x010101cd; const int R::attr::animationCache=0x010100ed; const int R::attr::animationDuration=0x01010112; const int R::attr::animationOrder=0x010101ce; const int R::attr::animationResolution=0x0101031a; const int R::attr::antialias=0x0101011a; const int R::attr::anyDensity=0x0101026c; const int R::attr::apiKey=0x01010211; const int R::attr::aspect=0x01010438; const int R::attr::author=0x010102b4; const int R::attr::authorities=0x01010018; const int R::attr::autoAdvanceViewId=0x0101030f; const int R::attr::autoCompleteTextViewStyle=0x0101006b; const int R::attr::autoLink=0x010100b0; const int R::attr::autoStart=0x010102b5; const int R::attr::autoText=0x0101016a; const int R::attr::autoUrlDetect=0x0101028c; const int R::attr::background=0x010100d4; const int R::attr::backgroundDimAmount=0x01010032; const int R::attr::backgroundDimEnabled=0x0101021f; const int R::attr::backgroundSplit=0x0101038b; const int R::attr::backgroundStacked=0x0101038a; const int R::attr::backupAgent=0x0101027f; const int R::attr::baseline=0x0101031c; const int R::attr::baselineAlignBottom=0x01010122; const int R::attr::baselineAligned=0x01010126; const int R::attr::baselineAlignedChildIndex=0x01010127; const int R::attr::bitmap=0x0101043d; const int R::attr::borderBottom=0x01010408; const int R::attr::borderLeft=0x01010409; const int R::attr::borderRight=0x0101040a; const int R::attr::borderTop=0x01010407; const int R::attr::borderlessButtonStyle=0x0101032b; const int R::attr::bottom=0x010101b0; const int R::attr::bottomBright=0x010100cd; const int R::attr::bottomDark=0x010100c9; const int R::attr::bottomLeftRadius=0x010101ab; const int R::attr::bottomMedium=0x010100ce; const int R::attr::bottomOffset=0x01010257; const int R::attr::bottomRightRadius=0x010101ac; const int R::attr::breadCrumbShortTitle=0x01010304; const int R::attr::breadCrumbTitle=0x01010303; const int R::attr::bufferType=0x0101014e; const int R::attr::button=0x01010107; const int R::attr::buttonBarButtonStyle=0x0101032f; const int R::attr::buttonBarStyle=0x0101032e; const int R::attr::buttonStyle=0x01010048; const int R::attr::buttonStyleInset=0x0101004a; const int R::attr::buttonStyleSmall=0x01010049; const int R::attr::buttonStyleToggle=0x0101004b; const int R::attr::cacheColorHint=0x01010101; const int R::attr::calendarViewShown=0x0101034c; const int R::attr::calendarViewStyle=0x0101035d; const int R::attr::canRetrieveWindowContent=0x01010385; const int R::attr::candidatesTextStyleSpans=0x01010230; const int R::attr::cantSaveState=0x01010456; const int R::attr::capitalize=0x01010169; const int R::attr::centerBright=0x010100cc; const int R::attr::centerColor=0x0101020b; const int R::attr::centerDark=0x010100c8; const int R::attr::centerMedium=0x010100cf; const int R::attr::centerX=0x010101a2; const int R::attr::centerY=0x010101a3; const int R::attr::checkBoxPreferenceStyle=0x0101008f; const int R::attr::checkMark=0x01010108; const int R::attr::checkable=0x010101e5; const int R::attr::checkableBehavior=0x010101e0; const int R::attr::checkboxStyle=0x0101006c; const int R::attr::checked=0x01010106; const int R::attr::checkedButton=0x01010148; const int R::attr::checkedTextViewStyle=0x010103c8; const int R::attr::chevronDrawables=0x0101042f; const int R::attr::childDivider=0x01010111; const int R::attr::childIndicator=0x0101010c; const int R::attr::childIndicatorLeft=0x0101010f; const int R::attr::childIndicatorRight=0x01010110; const int R::attr::choiceMode=0x0101012b; const int R::attr::clearTaskOnLaunch=0x01010015; const int R::attr::clickColor=0x0101040f; const int R::attr::clickable=0x010100e5; const int R::attr::clipChildren=0x010100ea; const int R::attr::clipOrientation=0x0101020a; const int R::attr::clipToPadding=0x010100eb; const int R::attr::codes=0x01010242; const int R::attr::collapseColumns=0x0101014b; const int R::attr::color=0x010101a5; const int R::attr::colorActivatedHighlight=0x01010390; const int R::attr::colorBackground=0x01010031; const int R::attr::colorBackgroundCacheHint=0x010102ab; const int R::attr::colorFocusedHighlight=0x0101038f; const int R::attr::colorForeground=0x01010030; const int R::attr::colorForegroundInverse=0x01010206; const int R::attr::colorLongPressedHighlight=0x0101038e; const int R::attr::colorMultiSelectHighlight=0x01010391; const int R::attr::colorPressedHighlight=0x0101038d; const int R::attr::columnCount=0x01010377; const int R::attr::columnDelay=0x010101cf; const int R::attr::columnOrderPreserved=0x01010378; const int R::attr::columnWidth=0x01010117; const int R::attr::compatibleWidthLimitDp=0x01010365; const int R::attr::completionHint=0x01010172; const int R::attr::completionHintView=0x01010173; const int R::attr::completionThreshold=0x01010174; const int R::attr::configChanges=0x0101001f; const int R::attr::configure=0x0101025d; const int R::attr::constantSize=0x01010196; const int R::attr::content=0x0101025b; const int R::attr::contentAuthority=0x01010290; const int R::attr::contentDescription=0x01010273; const int R::attr::cropToPadding=0x01010123; const int R::attr::cursorVisible=0x01010152; const int R::attr::customNavigationLayout=0x010102d2; const int R::attr::customTokens=0x0101033b; const int R::attr::cycles=0x010101d4; const int R::attr::dashGap=0x010101a7; const int R::attr::dashWidth=0x010101a6; const int R::attr::data=0x0101002e; const int R::attr::datePickerStyle=0x0101035c; const int R::attr::dateTextAppearance=0x01010349; const int R::attr::debuggable=0x0101000f; const int R::attr::defaultValue=0x010101ed; const int R::attr::delay=0x010101cc; const int R::attr::dependency=0x010101ec; const int R::attr::descendantFocusability=0x010100f1; const int R::attr::description=0x01010020; const int R::attr::detachWallpaper=0x010102a6; const int R::attr::detailColumn=0x010102a3; const int R::attr::detailSocialSummary=0x010102a4; const int R::attr::detailsElementBackground=0x0101034e; const int R::attr::dial=0x01010102; const int R::attr::dialogCustomTitleDecorLayout=0x010103e8; const int R::attr::dialogIcon=0x010101f4; const int R::attr::dialogLayout=0x010101f7; const int R::attr::dialogMessage=0x010101f3; const int R::attr::dialogPreferenceStyle=0x01010091; const int R::attr::dialogTheme=0x01010308; const int R::attr::dialogTitle=0x010101f2; const int R::attr::dialogTitleDecorLayout=0x010103e9; const int R::attr::dialogTitleIconsDecorLayout=0x010103e7; const int R::attr::digit=0x01010453; const int R::attr::digits=0x01010166; const int R::attr::direction=0x010101d1; const int R::attr::directionDescriptions=0x010103a1; const int R::attr::directionPriority=0x010101d2; const int R::attr::disableChildrenWhenDisabled=0x01010412; const int R::attr::disableDependentsState=0x010101f1; const int R::attr::disabledAlpha=0x01010033; const int R::attr::displayOptions=0x010102d0; const int R::attr::dither=0x0101011c; const int R::attr::divider=0x01010129; const int R::attr::dividerHeight=0x0101012a; const int R::attr::dividerHorizontal=0x0101032c; const int R::attr::dividerPadding=0x0101032a; const int R::attr::dividerVertical=0x0101030a; const int R::attr::dotSize=0x0101044c; const int R::attr::drawSelectorOnTop=0x010100fc; const int R::attr::drawable=0x01010199; const int R::attr::drawableAlpha=0x01010406; const int R::attr::drawableBottom=0x0101016e; const int R::attr::drawableEnd=0x01010393; const int R::attr::drawableLeft=0x0101016f; const int R::attr::drawablePadding=0x01010171; const int R::attr::drawableRight=0x01010170; const int R::attr::drawableStart=0x01010392; const int R::attr::drawableTop=0x0101016d; const int R::attr::drawingCacheQuality=0x010100e8; const int R::attr::dropDownAnchor=0x01010263; const int R::attr::dropDownHeight=0x01010283; const int R::attr::dropDownHintAppearance=0x01010088; const int R::attr::dropDownHorizontalOffset=0x010102ac; const int R::attr::dropDownItemStyle=0x01010086; const int R::attr::dropDownListViewStyle=0x0101006d; const int R::attr::dropDownSelector=0x01010175; const int R::attr::dropDownSpinnerStyle=0x010102d6; const int R::attr::dropDownVerticalOffset=0x010102ad; const int R::attr::dropDownWidth=0x01010262; const int R::attr::dropdownListPreferredItemHeight=0x010103d4; const int R::attr::duplicateParentState=0x010100e9; const int R::attr::duration=0x01010198; const int R::attr::editTextBackground=0x01010352; const int R::attr::editTextColor=0x01010351; const int R::attr::editTextPreferenceStyle=0x01010092; const int R::attr::editTextStyle=0x0101006e; const int R::attr::editable=0x0101016b; const int R::attr::editorExtras=0x01010224; const int R::attr::ellipsize=0x010100ab; const int R::attr::ems=0x01010158; const int R::attr::emulated=0x01010444; const int R::attr::enabled=0x0101000e; const int R::attr::endColor=0x0101019e; const int R::attr::endYear=0x0101017d; const int R::attr::enterFadeDuration=0x0101030c; const int R::attr::entries=0x010100b2; const int R::attr::entryValues=0x010101f8; const int R::attr::errorMessageAboveBackground=0x010103d2; const int R::attr::errorMessageBackground=0x010103d1; const int R::attr::eventsInterceptionEnabled=0x0101027d; const int R::attr::excludeFromRecents=0x01010017; const int R::attr::exitFadeDuration=0x0101030d; const int R::attr::expandActivityOverflowButtonDrawable=0x01010425; const int R::attr::expandableListPreferredChildIndicatorLeft=0x01010052; const int R::attr::expandableListPreferredChildIndicatorRight=0x01010053; const int R::attr::expandableListPreferredChildPaddingLeft=0x0101004f; const int R::attr::expandableListPreferredItemIndicatorLeft=0x01010050; const int R::attr::expandableListPreferredItemIndicatorRight=0x01010051; const int R::attr::expandableListPreferredItemPaddingLeft=0x0101004e; const int R::attr::expandableListViewStyle=0x0101006f; const int R::attr::expandableListViewWhiteStyle=0x010102b6; const int R::attr::exported=0x01010010; const int R::attr::externalRouteEnabledDrawable=0x01010448; const int R::attr::extraTension=0x0101026b; const int R::attr::factor=0x010101d3; const int R::attr::fadeDuration=0x01010278; const int R::attr::fadeEnabled=0x0101027e; const int R::attr::fadeOffset=0x01010277; const int R::attr::fadeScrollbars=0x010102aa; const int R::attr::fadingEdge=0x010100df; const int R::attr::fadingEdgeLength=0x010100e0; const int R::attr::fastScrollAlwaysVisible=0x01010335; const int R::attr::fastScrollEnabled=0x01010226; const int R::attr::fastScrollOverlayPosition=0x0101033a; const int R::attr::fastScrollPreviewBackgroundLeft=0x01010337; const int R::attr::fastScrollPreviewBackgroundRight=0x01010338; const int R::attr::fastScrollTextColor=0x01010359; const int R::attr::fastScrollThumbDrawable=0x01010336; const int R::attr::fastScrollTrackDrawable=0x01010339; const int R::attr::feedbackCount=0x01010434; const int R::attr::fillAfter=0x010101bd; const int R::attr::fillBefore=0x010101bc; const int R::attr::fillEnabled=0x0101024f; const int R::attr::fillViewport=0x0101017a; const int R::attr::filter=0x0101011b; const int R::attr::filterTouchesWhenObscured=0x010102c4; const int R::attr::findOnPageNextDrawable=0x010103f9; const int R::attr::findOnPagePreviousDrawable=0x010103fa; const int R::attr::finishOnCloseSystemDialogs=0x010102a7; const int R::attr::finishOnTaskLaunch=0x01010014; const int R::attr::firstDayOfWeek=0x0101033d; const int R::attr::firstItemOffset=0x0101042a; const int R::attr::fitsSystemWindows=0x010100dd; const int R::attr::flipInterval=0x01010179; const int R::attr::focusable=0x010100da; const int R::attr::focusableInTouchMode=0x010100db; const int R::attr::focusedMonthDateColor=0x01010343; const int R::attr::fontFamily=0x010103ac; const int R::attr::footerDividersEnabled=0x0101022f; const int R::attr::foreground=0x01010109; const int R::attr::foregroundGravity=0x01010200; const int R::attr::foregroundInsidePadding=0x01010405; const int R::attr::format=0x01010105; const int R::attr::format12Hour=0x010103ca; const int R::attr::format24Hour=0x010103cb; const int R::attr::fragment=0x010102e3; const int R::attr::fragmentCloseEnterAnimation=0x010102e7; const int R::attr::fragmentCloseExitAnimation=0x010102e8; const int R::attr::fragmentFadeEnterAnimation=0x010102e9; const int R::attr::fragmentFadeExitAnimation=0x010102ea; const int R::attr::fragmentOpenEnterAnimation=0x010102e5; const int R::attr::fragmentOpenExitAnimation=0x010102e6; const int R::attr::frameDuration=0x01010421; const int R::attr::framesCount=0x01010422; const int R::attr::freezesText=0x0101016c; const int R::attr::fromAlpha=0x010101ca; const int R::attr::fromDegrees=0x010101b3; const int R::attr::fromXDelta=0x010101c6; const int R::attr::fromXScale=0x010101c2; const int R::attr::fromYDelta=0x010101c8; const int R::attr::fromYScale=0x010101c4; const int R::attr::fullBright=0x010100ca; const int R::attr::fullDark=0x010100c6; const int R::attr::functionalTest=0x01010023; const int R::attr::galleryItemBackground=0x0101004c; const int R::attr::galleryStyle=0x01010070; const int R::attr::gestureColor=0x01010275; const int R::attr::gestureOverlayViewStyle=0x010103db; const int R::attr::gestureStrokeAngleThreshold=0x0101027c; const int R::attr::gestureStrokeLengthThreshold=0x0101027a; const int R::attr::gestureStrokeSquarenessThreshold=0x0101027b; const int R::attr::gestureStrokeType=0x01010279; const int R::attr::gestureStrokeWidth=0x01010274; const int R::attr::glEsVersion=0x01010281; const int R::attr::glowDot=0x0101044e; const int R::attr::glowRadius=0x01010429; const int R::attr::gradientRadius=0x010101a4; const int R::attr::grantUriPermissions=0x0101001b; const int R::attr::gravity=0x010100af; const int R::attr::gridViewStyle=0x01010071; const int R::attr::groupIndicator=0x0101010b; const int R::attr::hand_hour=0x01010103; const int R::attr::hand_minute=0x01010104; const int R::attr::handle=0x0101025a; const int R::attr::handleDrawable=0x0101042e; const int R::attr::handleProfiling=0x01010022; const int R::attr::hapticFeedbackEnabled=0x0101025e; const int R::attr::hardwareAccelerated=0x010102d3; const int R::attr::hasCode=0x0101000c; const int R::attr::headerBackground=0x0101012f; const int R::attr::headerDividersEnabled=0x0101022e; const int R::attr::height=0x01010155; const int R::attr::hint=0x01010150; const int R::attr::homeAsUpIndicator=0x0101030b; const int R::attr::homeLayout=0x0101031d; const int R::attr::horizontalDivider=0x0101012d; const int R::attr::horizontalGap=0x0101023f; const int R::attr::horizontalProgressLayout=0x01010404; const int R::attr::horizontalScrollViewStyle=0x01010353; const int R::attr::horizontalSpacing=0x01010114; const int R::attr::host=0x01010028; const int R::attr::hotSpotX=0x0101043e; const int R::attr::hotSpotY=0x0101043f; const int R::attr::icon=0x01010002; const int R::attr::iconPreview=0x01010249; const int R::attr::iconifiedByDefault=0x010102fa; const int R::attr::id=0x010100d0; const int R::attr::ignoreGravity=0x010101ff; const int R::attr::imageButtonStyle=0x01010072; const int R::attr::imageWellStyle=0x01010073; const int R::attr::imeActionId=0x01010266; const int R::attr::imeActionLabel=0x01010265; const int R::attr::imeExtractEnterAnimation=0x01010268; const int R::attr::imeExtractExitAnimation=0x01010269; const int R::attr::imeFullscreenBackground=0x0101022c; const int R::attr::imeOptions=0x01010264; const int R::attr::imeSubtypeExtraValue=0x010102ee; const int R::attr::imeSubtypeLocale=0x010102ec; const int R::attr::imeSubtypeMode=0x010102ed; const int R::attr::immersive=0x010102c0; const int R::attr::importantForAccessibility=0x010103aa; const int R::attr::inAnimation=0x01010177; const int R::attr::includeFontPadding=0x0101015f; const int R::attr::includeInGlobalSearch=0x0101026e; const int R::attr::indeterminate=0x01010139; const int R::attr::indeterminateBehavior=0x0101013e; const int R::attr::indeterminateDrawable=0x0101013b; const int R::attr::indeterminateDuration=0x0101013d; const int R::attr::indeterminateOnly=0x0101013a; const int R::attr::indeterminateProgressStyle=0x01010318; const int R::attr::indicatorLeft=0x0101010d; const int R::attr::indicatorRight=0x0101010e; const int R::attr::inflatedId=0x010100f3; const int R::attr::initOrder=0x0101001a; const int R::attr::initialActivityCount=0x01010424; const int R::attr::initialKeyguardLayout=0x010103c2; const int R::attr::initialLayout=0x01010251; const int R::attr::innerRadius=0x0101025f; const int R::attr::innerRadiusRatio=0x0101019b; const int R::attr::inputMethod=0x01010168; const int R::attr::inputType=0x01010220; const int R::attr::insetBottom=0x010101ba; const int R::attr::insetLeft=0x010101b7; const int R::attr::insetRight=0x010101b8; const int R::attr::insetTop=0x010101b9; const int R::attr::installLocation=0x010102b7; const int R::attr::internalLayout=0x01010413; const int R::attr::internalMaxHeight=0x0101041d; const int R::attr::internalMaxWidth=0x0101041f; const int R::attr::internalMinHeight=0x0101041c; const int R::attr::internalMinWidth=0x0101041e; const int R::attr::interpolator=0x01010141; const int R::attr::isAlwaysSyncable=0x01010333; const int R::attr::isAuxiliary=0x0101037f; const int R::attr::isDefault=0x01010221; const int R::attr::isIndicator=0x01010147; const int R::attr::isModifier=0x01010246; const int R::attr::isRepeatable=0x01010248; const int R::attr::isScrollContainer=0x0101024e; const int R::attr::isSticky=0x01010247; const int R::attr::isolatedProcess=0x010103a9; const int R::attr::itemBackground=0x01010130; const int R::attr::itemIconDisabledAlpha=0x01010131; const int R::attr::itemPadding=0x0101032d; const int R::attr::itemTextAppearance=0x0101012c; const int R::attr::keepScreenOn=0x01010216; const int R::attr::key=0x010101e8; const int R::attr::keyBackground=0x01010233; const int R::attr::keyEdgeFlags=0x01010245; const int R::attr::keyHeight=0x0101023e; const int R::attr::keyIcon=0x0101024c; const int R::attr::keyLabel=0x0101024b; const int R::attr::keyOutputText=0x0101024a; const int R::attr::keyPreviewHeight=0x01010239; const int R::attr::keyPreviewLayout=0x01010237; const int R::attr::keyPreviewOffset=0x01010238; const int R::attr::keyTextColor=0x01010236; const int R::attr::keyTextSize=0x01010234; const int R::attr::keyWidth=0x0101023d; const int R::attr::keyboardLayout=0x010103ab; const int R::attr::keyboardMode=0x0101024d; const int R::attr::keyboardViewStyle=0x01010426; const int R::attr::keycode=0x010100c5; const int R::attr::killAfterRestore=0x0101029c; const int R::attr::label=0x01010001; const int R::attr::labelFor=0x010103c6; const int R::attr::labelTextSize=0x01010235; const int R::attr::largeHeap=0x0101035a; const int R::attr::largeScreens=0x01010286; const int R::attr::largestWidthLimitDp=0x01010366; const int R::attr::launchMode=0x0101001d; const int R::attr::layerType=0x01010354; const int R::attr::layout=0x010100f2; const int R::attr::layoutAnimation=0x010100ec; const int R::attr::layoutDirection=0x010103b2; const int R::attr::layout_above=0x01010184; const int R::attr::layout_alignBaseline=0x01010186; const int R::attr::layout_alignBottom=0x0101018a; const int R::attr::layout_alignEnd=0x010103ba; const int R::attr::layout_alignLeft=0x01010187; const int R::attr::layout_alignParentBottom=0x0101018e; const int R::attr::layout_alignParentEnd=0x010103bc; const int R::attr::layout_alignParentLeft=0x0101018b; const int R::attr::layout_alignParentRight=0x0101018d; const int R::attr::layout_alignParentStart=0x010103bb; const int R::attr::layout_alignParentTop=0x0101018c; const int R::attr::layout_alignRight=0x01010189; const int R::attr::layout_alignStart=0x010103b9; const int R::attr::layout_alignTop=0x01010188; const int R::attr::layout_alignWithParentIfMissing=0x01010192; const int R::attr::layout_below=0x01010185; const int R::attr::layout_centerHorizontal=0x01010190; const int R::attr::layout_centerInParent=0x0101018f; const int R::attr::layout_centerVertical=0x01010191; const int R::attr::layout_centerWithinArea=0x01010451; const int R::attr::layout_childType=0x01010450; const int R::attr::layout_column=0x0101014c; const int R::attr::layout_columnSpan=0x0101037d; const int R::attr::layout_gravity=0x010100b3; const int R::attr::layout_height=0x010100f5; const int R::attr::layout_margin=0x010100f6; const int R::attr::layout_marginBottom=0x010100fa; const int R::attr::layout_marginEnd=0x010103b6; const int R::attr::layout_marginLeft=0x010100f7; const int R::attr::layout_marginRight=0x010100f9; const int R::attr::layout_marginStart=0x010103b5; const int R::attr::layout_marginTop=0x010100f8; const int R::attr::layout_maxHeight=0x01010436; const int R::attr::layout_maxWidth=0x01010452; const int R::attr::layout_minHeight=0x01010437; const int R::attr::layout_removeBorders=0x0101040b; const int R::attr::layout_row=0x0101037b; const int R::attr::layout_rowSpan=0x0101037c; const int R::attr::layout_scale=0x01010193; const int R::attr::layout_span=0x0101014d; const int R::attr::layout_toEndOf=0x010103b8; const int R::attr::layout_toLeftOf=0x01010182; const int R::attr::layout_toRightOf=0x01010183; const int R::attr::layout_toStartOf=0x010103b7; const int R::attr::layout_weight=0x01010181; const int R::attr::layout_width=0x010100f4; const int R::attr::layout_x=0x0101017f; const int R::attr::layout_y=0x01010180; const int R::attr::left=0x010101ad; const int R::attr::leftToRight=0x0101044f; const int R::attr::lineSpacingExtra=0x01010217; const int R::attr::lineSpacingMultiplier=0x01010218; const int R::attr::lines=0x01010154; const int R::attr::linksClickable=0x010100b1; const int R::attr::listChoiceBackgroundIndicator=0x010102f0; const int R::attr::listChoiceIndicatorMultiple=0x0101021a; const int R::attr::listChoiceIndicatorSingle=0x01010219; const int R::attr::listDivider=0x01010214; const int R::attr::listDividerAlertDialog=0x01010305; const int R::attr::listItemLayout=0x01010402; const int R::attr::listLayout=0x010103ff; const int R::attr::listPopupWindowStyle=0x010102ff; const int R::attr::listPreferredItemHeight=0x0101004d; const int R::attr::listPreferredItemHeightLarge=0x01010386; const int R::attr::listPreferredItemHeightSmall=0x01010387; const int R::attr::listPreferredItemPaddingEnd=0x010103be; const int R::attr::listPreferredItemPaddingLeft=0x010103a3; const int R::attr::listPreferredItemPaddingRight=0x010103a4; const int R::attr::listPreferredItemPaddingStart=0x010103bd; const int R::attr::listSelector=0x010100fb; const int R::attr::listSeparatorTextViewStyle=0x01010208; const int R::attr::listViewStyle=0x01010074; const int R::attr::listViewWhiteStyle=0x01010075; const int R::attr::logo=0x010102be; const int R::attr::longClickable=0x010100e6; const int R::attr::loopViews=0x01010307; const int R::attr::magneticTargets=0x0101042b; const int R::attr::majorWeightMax=0x01010417; const int R::attr::majorWeightMin=0x01010415; const int R::attr::manageSpaceActivity=0x01010004; const int R::attr::mapViewStyle=0x0101008a; const int R::attr::marqueeRepeatLimit=0x0101021d; const int R::attr::max=0x01010136; const int R::attr::maxDate=0x01010340; const int R::attr::maxEms=0x01010157; const int R::attr::maxFileSize=0x01010447; const int R::attr::maxHeight=0x01010120; const int R::attr::maxItems=0x0101040d; const int R::attr::maxItemsPerRow=0x01010134; const int R::attr::maxLength=0x01010160; const int R::attr::maxLevel=0x010101b2; const int R::attr::maxLines=0x01010153; const int R::attr::maxRows=0x01010133; const int R::attr::maxSdkVersion=0x01010271; const int R::attr::maxWidth=0x0101011f; const int R::attr::measureAllChildren=0x0101010a; const int R::attr::measureWithLargestChild=0x010102d4; const int R::attr::mediaRouteButtonStyle=0x010103ad; const int R::attr::mediaRouteTypes=0x010103ae; const int R::attr::menuCategory=0x010101de; const int R::attr::mimeType=0x01010026; const int R::attr::minDate=0x0101033f; const int R::attr::minEms=0x0101015a; const int R::attr::minHeight=0x01010140; const int R::attr::minLevel=0x010101b1; const int R::attr::minLines=0x01010156; const int R::attr::minResizeHeight=0x01010396; const int R::attr::minResizeWidth=0x01010395; const int R::attr::minSdkVersion=0x0101020c; const int R::attr::minWidth=0x0101013f; const int R::attr::minorWeightMax=0x01010418; const int R::attr::minorWeightMin=0x01010416; const int R::attr::mode=0x0101017e; const int R::attr::moreIcon=0x01010135; const int R::attr::mountPoint=0x01010440; const int R::attr::mtpReserve=0x01010445; const int R::attr::multiChoiceItemLayout=0x01010400; const int R::attr::multiprocess=0x01010013; const int R::attr::name=0x01010003; const int R::attr::navigationMode=0x010102cf; const int R::attr::negativeButtonText=0x010101f6; const int R::attr::neverEncrypt=0x01010455; const int R::attr::nextFocusDown=0x010100e4; const int R::attr::nextFocusForward=0x0101033c; const int R::attr::nextFocusLeft=0x010100e1; const int R::attr::nextFocusRight=0x010100e2; const int R::attr::nextFocusUp=0x010100e3; const int R::attr::noHistory=0x0101022d; const int R::attr::normalScreens=0x01010285; const int R::attr::notificationTimeout=0x01010383; const int R::attr::numColumns=0x01010118; const int R::attr::numDots=0x0101044d; const int R::attr::numStars=0x01010144; const int R::attr::numberPickerStyle=0x010103de; const int R::attr::numeric=0x01010165; const int R::attr::numericShortcut=0x010101e4; const int R::attr::onClick=0x0101026f; const int R::attr::oneshot=0x01010197; const int R::attr::opacity=0x0101031e; const int R::attr::order=0x010101ea; const int R::attr::orderInCategory=0x010101df; const int R::attr::ordering=0x010102e2; const int R::attr::orderingFromXml=0x010101e7; const int R::attr::orientation=0x010100c4; const int R::attr::outAnimation=0x01010178; const int R::attr::outerRadius=0x01010431; const int R::attr::outerRingDrawable=0x01010427; const int R::attr::overScrollFooter=0x010102c3; const int R::attr::overScrollHeader=0x010102c2; const int R::attr::overScrollMode=0x010102c1; const int R::attr::overridesImplicitlyEnabledSubtype=0x010103a2; const int R::attr::packageNames=0x01010381; const int R::attr::padding=0x010100d5; const int R::attr::paddingBottom=0x010100d9; const int R::attr::paddingEnd=0x010103b4; const int R::attr::paddingLeft=0x010100d6; const int R::attr::paddingRight=0x010100d8; const int R::attr::paddingStart=0x010103b3; const int R::attr::paddingTop=0x010100d7; const int R::attr::pageSpacing=0x01010449; const int R::attr::panelBackground=0x0101005e; const int R::attr::panelColorBackground=0x01010061; const int R::attr::panelColorForeground=0x01010060; const int R::attr::panelFullBackground=0x0101005f; const int R::attr::panelMenuIsCompact=0x010103d8; const int R::attr::panelMenuListTheme=0x010103da; const int R::attr::panelMenuListWidth=0x010103d9; const int R::attr::panelTextAppearance=0x01010062; const int R::attr::parentActivityName=0x010103a7; const int R::attr::password=0x0101015c; const int R::attr::path=0x0101002a; const int R::attr::pathPattern=0x0101002c; const int R::attr::pathPrefix=0x0101002b; const int R::attr::permission=0x01010006; const int R::attr::permissionFlags=0x010103c7; const int R::attr::permissionGroup=0x0101000a; const int R::attr::permissionGroupFlags=0x010103c5; const int R::attr::persistent=0x0101000d; const int R::attr::persistentDrawingCache=0x010100ee; const int R::attr::phoneNumber=0x01010167; const int R::attr::pivotX=0x010101b5; const int R::attr::pivotY=0x010101b6; const int R::attr::pointDrawable=0x01010428; const int R::attr::pointerIconArrow=0x01010439; const int R::attr::pointerIconSpotAnchor=0x0101043c; const int R::attr::pointerIconSpotHover=0x0101043a; const int R::attr::pointerIconSpotTouch=0x0101043b; const int R::attr::pointerStyle=0x010103f7; const int R::attr::popupAnimationStyle=0x010102c9; const int R::attr::popupBackground=0x01010176; const int R::attr::popupCharacters=0x01010244; const int R::attr::popupKeyboard=0x01010243; const int R::attr::popupLayout=0x0101023b; const int R::attr::popupMenuStyle=0x01010300; const int R::attr::popupPromptView=0x01010411; const int R::attr::popupWindowStyle=0x01010076; const int R::attr::port=0x01010029; const int R::attr::positiveButtonText=0x010101f5; const int R::attr::preferenceCategoryStyle=0x0101008c; const int R::attr::preferenceFragmentStyle=0x010103e5; const int R::attr::preferenceFrameLayoutStyle=0x010103f5; const int R::attr::preferenceInformationStyle=0x0101008d; const int R::attr::preferenceLayoutChild=0x01010094; const int R::attr::preferencePanelStyle=0x010103e6; const int R::attr::preferenceScreenStyle=0x0101008b; const int R::attr::preferenceStyle=0x0101008e; const int R::attr::presentationTheme=0x010103c0; const int R::attr::preserveIconSpacing=0x0101040c; const int R::attr::previewImage=0x010102da; const int R::attr::primary=0x01010442; const int R::attr::primaryUserOnly=0x01010457; const int R::attr::priority=0x0101001c; const int R::attr::privateImeOptions=0x01010223; const int R::attr::process=0x01010011; const int R::attr::progress=0x01010137; const int R::attr::progressBarPadding=0x01010319; const int R::attr::progressBarStyle=0x01010077; const int R::attr::progressBarStyleHorizontal=0x01010078; const int R::attr::progressBarStyleInverse=0x01010287; const int R::attr::progressBarStyleLarge=0x0101007a; const int R::attr::progressBarStyleLargeInverse=0x01010289; const int R::attr::progressBarStyleSmall=0x01010079; const int R::attr::progressBarStyleSmallInverse=0x01010288; const int R::attr::progressBarStyleSmallTitle=0x0101020f; const int R::attr::progressDrawable=0x0101013c; const int R::attr::progressLayout=0x01010403; const int R::attr::prompt=0x0101017b; const int R::attr::propertyName=0x010102e1; const int R::attr::protectionLevel=0x01010009; const int R::attr::publicKey=0x010103a6; const int R::attr::queryActionMsg=0x010101db; const int R::attr::queryAfterZeroResults=0x01010282; const int R::attr::queryHint=0x01010358; const int R::attr::quickContactBadgeOverlay=0x010103dc; const int R::attr::quickContactBadgeStyleSmallWindowLarge=0x010102b3; const int R::attr::quickContactBadgeStyleSmallWindowMedium=0x010102b2; const int R::attr::quickContactBadgeStyleSmallWindowSmall=0x010102b1; const int R::attr::quickContactBadgeStyleWindowLarge=0x010102b0; const int R::attr::quickContactBadgeStyleWindowMedium=0x010102af; const int R::attr::quickContactBadgeStyleWindowSmall=0x010102ae; const int R::attr::quickContactWindowSize=0x01010414; const int R::attr::radioButtonStyle=0x0101007e; const int R::attr::radius=0x010101a8; const int R::attr::rating=0x01010145; const int R::attr::ratingBarStyle=0x0101007c; const int R::attr::ratingBarStyleIndicator=0x01010210; const int R::attr::ratingBarStyleSmall=0x0101007d; const int R::attr::readPermission=0x01010007; const int R::attr::removable=0x01010443; const int R::attr::repeatCount=0x010101bf; const int R::attr::repeatMode=0x010101c0; const int R::attr::reqFiveWayNav=0x01010232; const int R::attr::reqHardKeyboard=0x01010229; const int R::attr::reqKeyboardType=0x01010228; const int R::attr::reqNavigation=0x0101022a; const int R::attr::reqTouchScreen=0x01010227; const int R::attr::required=0x0101028e; const int R::attr::requiresFadingEdge=0x010103a5; const int R::attr::requiresSmallestWidthDp=0x01010364; const int R::attr::resOutColor=0x0101040e; const int R::attr::resizeMode=0x01010363; const int R::attr::resizeable=0x0101028d; const int R::attr::resource=0x01010025; const int R::attr::restoreAnyVersion=0x010102ba; const int R::attr::restoreNeedsApplication=0x0101029d; const int R::attr::right=0x010101af; const int R::attr::ringtonePreferenceStyle=0x01010093; const int R::attr::ringtoneType=0x010101f9; const int R::attr::rotation=0x01010326; const int R::attr::rotationX=0x01010327; const int R::attr::rotationY=0x01010328; const int R::attr::rowCount=0x01010375; const int R::attr::rowDelay=0x010101d0; const int R::attr::rowEdgeFlags=0x01010241; const int R::attr::rowHeight=0x01010132; const int R::attr::rowOrderPreserved=0x01010376; const int R::attr::saveEnabled=0x010100e7; const int R::attr::scaleGravity=0x010101fe; const int R::attr::scaleHeight=0x010101fd; const int R::attr::scaleType=0x0101011d; const int R::attr::scaleWidth=0x010101fc; const int R::attr::scaleX=0x01010324; const int R::attr::scaleY=0x01010325; const int R::attr::scheme=0x01010027; const int R::attr::screenDensity=0x010102cb; const int R::attr::screenOrientation=0x0101001e; const int R::attr::screenSize=0x010102ca; const int R::attr::scrollHorizontally=0x0101015b; const int R::attr::scrollIndicatorPaddingLeft=0x0101044a; const int R::attr::scrollIndicatorPaddingRight=0x0101044b; const int R::attr::scrollViewStyle=0x01010080; const int R::attr::scrollX=0x010100d2; const int R::attr::scrollY=0x010100d3; const int R::attr::scrollbarAlwaysDrawHorizontalTrack=0x01010068; const int R::attr::scrollbarAlwaysDrawVerticalTrack=0x01010069; const int R::attr::scrollbarDefaultDelayBeforeFade=0x010102a9; const int R::attr::scrollbarFadeDuration=0x010102a8; const int R::attr::scrollbarSize=0x01010063; const int R::attr::scrollbarStyle=0x0101007f; const int R::attr::scrollbarThumbHorizontal=0x01010064; const int R::attr::scrollbarThumbVertical=0x01010065; const int R::attr::scrollbarTrackHorizontal=0x01010066; const int R::attr::scrollbarTrackVertical=0x01010067; const int R::attr::scrollbars=0x010100de; const int R::attr::scrollingCache=0x010100fe; const int R::attr::searchButtonText=0x01010205; const int R::attr::searchDialogTheme=0x010103f4; const int R::attr::searchDropdownBackground=0x010103eb; const int R::attr::searchMode=0x010101d5; const int R::attr::searchResultListItemHeight=0x010103d3; const int R::attr::searchSettingsDescription=0x0101028a; const int R::attr::searchSuggestAuthority=0x010101d6; const int R::attr::searchSuggestIntentAction=0x010101d9; const int R::attr::searchSuggestIntentData=0x010101da; const int R::attr::searchSuggestPath=0x010101d7; const int R::attr::searchSuggestSelection=0x010101d8; const int R::attr::searchSuggestThreshold=0x0101026d; const int R::attr::searchViewCloseIcon=0x010103ec; const int R::attr::searchViewEditQuery=0x010103f0; const int R::attr::searchViewEditQueryBackground=0x010103f1; const int R::attr::searchViewGoIcon=0x010103ed; const int R::attr::searchViewSearchIcon=0x010103ee; const int R::attr::searchViewTextField=0x010103f2; const int R::attr::searchViewTextFieldRight=0x010103f3; const int R::attr::searchViewVoiceIcon=0x010103ef; const int R::attr::searchWidgetCorpusItemBackground=0x010103a8; const int R::attr::secondaryProgress=0x01010138; const int R::attr::seekBarStyle=0x0101007b; const int R::attr::segmentedButtonStyle=0x01010330; const int R::attr::selectAllOnFocus=0x0101015e; const int R::attr::selectable=0x010101e6; const int R::attr::selectableItemBackground=0x0101030e; const int R::attr::selectedDateVerticalBar=0x01010347; const int R::attr::selectedWeekBackgroundColor=0x01010342; const int R::attr::selectionDivider=0x01010419; const int R::attr::selectionDividerHeight=0x0101041a; const int R::attr::selectionDividersDistance=0x0101041b; const int R::attr::settingsActivity=0x01010225; const int R::attr::shadowColor=0x01010161; const int R::attr::shadowDx=0x01010162; const int R::attr::shadowDy=0x01010163; const int R::attr::shadowRadius=0x01010164; const int R::attr::shape=0x0101019a; const int R::attr::shareInterpolator=0x010101bb; const int R::attr::sharedUserId=0x0101000b; const int R::attr::sharedUserLabel=0x01010261; const int R::attr::shouldDisableView=0x010101ee; const int R::attr::showAsAction=0x010102d9; const int R::attr::showDefault=0x010101fa; const int R::attr::showDividers=0x01010329; const int R::attr::showOnLockScreen=0x010103c9; const int R::attr::showSilent=0x010101fb; const int R::attr::showWeekNumber=0x0101033e; const int R::attr::shownWeekCount=0x01010341; const int R::attr::shrinkColumns=0x0101014a; const int R::attr::singleChoiceItemLayout=0x01010401; const int R::attr::singleLine=0x0101015d; const int R::attr::singleUser=0x010103bf; const int R::attr::smallIcon=0x0101029e; const int R::attr::smallScreens=0x01010284; const int R::attr::smoothScrollbar=0x01010231; const int R::attr::snapMargin=0x01010433; const int R::attr::solidColor=0x0101034a; const int R::attr::soundEffectsEnabled=0x01010215; const int R::attr::spacing=0x01010113; const int R::attr::spinnerDropDownItemStyle=0x01010087; const int R::attr::spinnerItemStyle=0x01010089; const int R::attr::spinnerMode=0x010102f1; const int R::attr::spinnerStyle=0x01010081; const int R::attr::spinnersShown=0x0101034b; const int R::attr::splitMotionEvents=0x010102ef; const int R::attr::src=0x01010119; const int R::attr::stackFromBottom=0x010100fd; const int R::attr::stackViewStyle=0x010103dd; const int R::attr::starStyle=0x01010082; const int R::attr::startColor=0x0101019d; const int R::attr::startOffset=0x010101be; const int R::attr::startYear=0x0101017c; const int R::attr::stateNotNeeded=0x01010016; const int R::attr::state_above_anchor=0x010100aa; const int R::attr::state_accelerated=0x0101031b; const int R::attr::state_accessibility_focused=0x01010423; const int R::attr::state_activated=0x010102fe; const int R::attr::state_active=0x010100a2; const int R::attr::state_checkable=0x0101009f; const int R::attr::state_checked=0x010100a0; const int R::attr::state_drag_can_accept=0x01010368; const int R::attr::state_drag_hovered=0x01010369; const int R::attr::state_empty=0x010100a9; const int R::attr::state_enabled=0x0101009e; const int R::attr::state_expanded=0x010100a8; const int R::attr::state_first=0x010100a4; const int R::attr::state_focused=0x0101009c; const int R::attr::state_hovered=0x01010367; const int R::attr::state_last=0x010100a6; const int R::attr::state_long_pressable=0x0101023c; const int R::attr::state_middle=0x010100a5; const int R::attr::state_multiline=0x0101034d; const int R::attr::state_pressed=0x010100a7; const int R::attr::state_selected=0x010100a1; const int R::attr::state_single=0x010100a3; const int R::attr::state_window_focused=0x0101009d; const int R::attr::staticWallpaperPreview=0x01010331; const int R::attr::stepSize=0x01010146; const int R::attr::stopWithTask=0x0101036a; const int R::attr::storageDescription=0x01010441; const int R::attr::streamType=0x01010209; const int R::attr::stretchColumns=0x01010149; const int R::attr::stretchMode=0x01010116; const int R::attr::subtitle=0x010102d1; const int R::attr::subtitleTextStyle=0x010102f9; const int R::attr::subtypeExtraValue=0x0101039a; const int R::attr::subtypeId=0x010103c1; const int R::attr::subtypeLocale=0x01010399; const int R::attr::suggestActionMsg=0x010101dc; const int R::attr::suggestActionMsgColumn=0x010101dd; const int R::attr::summary=0x010101e9; const int R::attr::summaryColumn=0x010102a2; const int R::attr::summaryOff=0x010101f0; const int R::attr::summaryOn=0x010101ef; const int R::attr::supportsRtl=0x010103af; const int R::attr::supportsUploading=0x0101029b; const int R::attr::switchMinWidth=0x01010370; const int R::attr::switchPadding=0x01010371; const int R::attr::switchPreferenceStyle=0x0101036d; const int R::attr::switchStyle=0x010103f6; const int R::attr::switchTextAppearance=0x0101036e; const int R::attr::switchTextOff=0x0101036c; const int R::attr::switchTextOn=0x0101036b; const int R::attr::syncable=0x01010019; const int R::attr::tabLayout=0x01010410; const int R::attr::tabStripEnabled=0x010102bd; const int R::attr::tabStripLeft=0x010102bb; const int R::attr::tabStripRight=0x010102bc; const int R::attr::tabWidgetStyle=0x01010083; const int R::attr::tag=0x010100d1; const int R::attr::targetActivity=0x01010202; const int R::attr::targetClass=0x0101002f; const int R::attr::targetDescriptions=0x010103a0; const int R::attr::targetDrawables=0x0101042d; const int R::attr::targetPackage=0x01010021; const int R::attr::targetSdkVersion=0x01010270; const int R::attr::taskAffinity=0x01010012; const int R::attr::taskCloseEnterAnimation=0x010100be; const int R::attr::taskCloseExitAnimation=0x010100bf; const int R::attr::taskOpenEnterAnimation=0x010100bc; const int R::attr::taskOpenExitAnimation=0x010100bd; const int R::attr::taskToBackEnterAnimation=0x010100c2; const int R::attr::taskToBackExitAnimation=0x010100c3; const int R::attr::taskToFrontEnterAnimation=0x010100c0; const int R::attr::taskToFrontExitAnimation=0x010100c1; const int R::attr::tension=0x0101026a; const int R::attr::testOnly=0x01010272; const int R::attr::text=0x0101014f; const int R::attr::textAlignment=0x010103b1; const int R::attr::textAllCaps=0x0101038c; const int R::attr::textAppearance=0x01010034; const int R::attr::textAppearanceAutoCorrectionSuggestion=0x010103ce; const int R::attr::textAppearanceButton=0x01010207; const int R::attr::textAppearanceEasyCorrectSuggestion=0x010103c3; const int R::attr::textAppearanceInverse=0x01010035; const int R::attr::textAppearanceLarge=0x01010040; const int R::attr::textAppearanceLargeInverse=0x01010043; const int R::attr::textAppearanceLargePopupMenu=0x01010301; const int R::attr::textAppearanceListItem=0x0101039e; const int R::attr::textAppearanceListItemSmall=0x0101039f; const int R::attr::textAppearanceMedium=0x01010041; const int R::attr::textAppearanceMediumInverse=0x01010044; const int R::attr::textAppearanceMisspelledSuggestion=0x010103cd; const int R::attr::textAppearanceSearchResultSubtitle=0x010102a0; const int R::attr::textAppearanceSearchResultTitle=0x010102a1; const int R::attr::textAppearanceSmall=0x01010042; const int R::attr::textAppearanceSmallInverse=0x01010045; const int R::attr::textAppearanceSmallPopupMenu=0x01010302; const int R::attr::textCheckMark=0x01010046; const int R::attr::textCheckMarkInverse=0x01010047; const int R::attr::textColor=0x01010098; const int R::attr::textColorAlertDialogListItem=0x01010306; const int R::attr::textColorHighlight=0x01010099; const int R::attr::textColorHighlightInverse=0x0101034f; const int R::attr::textColorHint=0x0101009a; const int R::attr::textColorHintInverse=0x0101003f; const int R::attr::textColorLink=0x0101009b; const int R::attr::textColorLinkInverse=0x01010350; const int R::attr::textColorPrimary=0x01010036; const int R::attr::textColorPrimaryDisableOnly=0x01010037; const int R::attr::textColorPrimaryInverse=0x01010039; const int R::attr::textColorPrimaryInverseDisableOnly=0x0101028b; const int R::attr::textColorPrimaryInverseNoDisable=0x0101003d; const int R::attr::textColorPrimaryNoDisable=0x0101003b; const int R::attr::textColorSearchUrl=0x01010267; const int R::attr::textColorSecondary=0x01010038; const int R::attr::textColorSecondaryInverse=0x0101003a; const int R::attr::textColorSecondaryInverseNoDisable=0x0101003e; const int R::attr::textColorSecondaryNoDisable=0x0101003c; const int R::attr::textColorTertiary=0x01010212; const int R::attr::textColorTertiaryInverse=0x01010213; const int R::attr::textCursorDrawable=0x01010362; const int R::attr::textDirection=0x010103b0; const int R::attr::textEditNoPasteWindowLayout=0x01010315; const int R::attr::textEditPasteWindowLayout=0x01010314; const int R::attr::textEditSideNoPasteWindowLayout=0x0101035f; const int R::attr::textEditSidePasteWindowLayout=0x0101035e; const int R::attr::textEditSuggestionItemLayout=0x01010374; const int R::attr::textFilterEnabled=0x010100ff; const int R::attr::textIsSelectable=0x01010316; const int R::attr::textOff=0x01010125; const int R::attr::textOn=0x01010124; const int R::attr::textScaleX=0x01010151; const int R::attr::textSelectHandle=0x010102c7; const int R::attr::textSelectHandleLeft=0x010102c5; const int R::attr::textSelectHandleRight=0x010102c6; const int R::attr::textSelectHandleWindowStyle=0x010102c8; const int R::attr::textSize=0x01010095; const int R::attr::textStyle=0x01010097; const int R::attr::textSuggestionsWindowStyle=0x01010373; const int R::attr::textUnderlineColor=0x010103cf; const int R::attr::textUnderlineThickness=0x010103d0; const int R::attr::textView=0x01010454; const int R::attr::textViewStyle=0x01010084; const int R::attr::theme=0x01010000; const int R::attr::thickness=0x01010260; const int R::attr::thicknessRatio=0x0101019c; const int R::attr::thumb=0x01010142; const int R::attr::thumbOffset=0x01010143; const int R::attr::thumbTextPadding=0x01010372; const int R::attr::thumbnail=0x010102a5; const int R::attr::tileMode=0x01010201; const int R::attr::timePickerStyle=0x010103df; const int R::attr::timeZone=0x010103cc; const int R::attr::tint=0x01010121; const int R::attr::title=0x010101e1; const int R::attr::titleCondensed=0x010101e2; const int R::attr::titleTextStyle=0x010102f8; const int R::attr::toAlpha=0x010101cb; const int R::attr::toDegrees=0x010101b4; const int R::attr::toXDelta=0x010101c7; const int R::attr::toXScale=0x010101c3; const int R::attr::toYDelta=0x010101c9; const int R::attr::toYScale=0x010101c5; const int R::attr::toastFrameBackground=0x010103ea; const int R::attr::top=0x010101ae; const int R::attr::topBright=0x010100cb; const int R::attr::topDark=0x010100c7; const int R::attr::topLeftRadius=0x010101a9; const int R::attr::topOffset=0x01010258; const int R::attr::topRightRadius=0x010101aa; const int R::attr::track=0x0101036f; const int R::attr::transcriptMode=0x01010100; const int R::attr::transformPivotX=0x01010320; const int R::attr::transformPivotY=0x01010321; const int R::attr::translationX=0x01010322; const int R::attr::translationY=0x01010323; const int R::attr::type=0x010101a1; const int R::attr::typeface=0x01010096; const int R::attr::uiOptions=0x01010398; const int R::attr::uncertainGestureColor=0x01010276; const int R::attr::unfocusedMonthDateColor=0x01010344; const int R::attr::unselectedAlpha=0x0101020e; const int R::attr::updatePeriodMillis=0x01010250; const int R::attr::useDefaultMargins=0x01010379; const int R::attr::useIntrinsicSizeAsMinimum=0x01010310; const int R::attr::useLevel=0x0101019f; const int R::attr::userVisible=0x01010291; const int R::attr::value=0x01010024; const int R::attr::valueFrom=0x010102de; const int R::attr::valueTo=0x010102df; const int R::attr::valueType=0x010102e0; const int R::attr::variablePadding=0x01010195; const int R::attr::versionCode=0x0101021b; const int R::attr::versionName=0x0101021c; const int R::attr::verticalCorrection=0x0101023a; const int R::attr::verticalDivider=0x0101012e; const int R::attr::verticalGap=0x01010240; const int R::attr::verticalScrollbarPosition=0x01010334; const int R::attr::verticalSpacing=0x01010115; const int R::attr::vibrationDuration=0x01010432; const int R::attr::virtualButtonPressedDrawable=0x01010420; const int R::attr::visibility=0x010100dc; const int R::attr::visible=0x01010194; const int R::attr::vmSafeMode=0x010102b8; const int R::attr::voiceLanguage=0x01010255; const int R::attr::voiceLanguageModel=0x01010253; const int R::attr::voiceMaxResults=0x01010256; const int R::attr::voicePromptText=0x01010254; const int R::attr::voiceSearchMode=0x01010252; const int R::attr::wallpaperCloseEnterAnimation=0x01010295; const int R::attr::wallpaperCloseExitAnimation=0x01010296; const int R::attr::wallpaperIntraCloseEnterAnimation=0x01010299; const int R::attr::wallpaperIntraCloseExitAnimation=0x0101029a; const int R::attr::wallpaperIntraOpenEnterAnimation=0x01010297; const int R::attr::wallpaperIntraOpenExitAnimation=0x01010298; const int R::attr::wallpaperOpenEnterAnimation=0x01010293; const int R::attr::wallpaperOpenExitAnimation=0x01010294; const int R::attr::waveDrawable=0x01010430; const int R::attr::webTextViewStyle=0x010102b9; const int R::attr::webViewStyle=0x01010085; const int R::attr::weekDayTextAppearance=0x01010348; const int R::attr::weekNumberColor=0x01010345; const int R::attr::weekSeparatorLineColor=0x01010346; const int R::attr::weightSum=0x01010128; const int R::attr::widgetCategory=0x010103c4; const int R::attr::widgetLayout=0x010101eb; const int R::attr::width=0x01010159; const int R::attr::windowActionBar=0x010102cd; const int R::attr::windowActionBarOverlay=0x010102e4; const int R::attr::windowActionModeOverlay=0x010102dd; const int R::attr::windowAnimationStyle=0x010100ae; const int R::attr::windowBackground=0x01010054; const int R::attr::windowCloseOnTouchOutside=0x0101035b; const int R::attr::windowContentOverlay=0x01010059; const int R::attr::windowDisablePreview=0x01010222; const int R::attr::windowEnableSplitTouch=0x01010317; const int R::attr::windowEnterAnimation=0x010100b4; const int R::attr::windowExitAnimation=0x010100b5; const int R::attr::windowFixedHeightMajor=0x010103fe; const int R::attr::windowFixedHeightMinor=0x010103fc; const int R::attr::windowFixedWidthMajor=0x010103fb; const int R::attr::windowFixedWidthMinor=0x010103fd; const int R::attr::windowFrame=0x01010055; const int R::attr::windowFullscreen=0x0101020d; const int R::attr::windowHideAnimation=0x010100b7; const int R::attr::windowIsFloating=0x01010057; const int R::attr::windowIsTranslucent=0x01010058; const int R::attr::windowMinWidthMajor=0x01010356; const int R::attr::windowMinWidthMinor=0x01010357; const int R::attr::windowNoDisplay=0x0101021e; const int R::attr::windowNoTitle=0x01010056; const int R::attr::windowShowAnimation=0x010100b6; const int R::attr::windowShowWallpaper=0x01010292; const int R::attr::windowSoftInputMode=0x0101022b; const int R::attr::windowSplitActionBar=0x010103d5; const int R::attr::windowTitleBackgroundStyle=0x0101005c; const int R::attr::windowTitleSize=0x0101005a; const int R::attr::windowTitleStyle=0x0101005b; const int R::attr::writePermission=0x01010008; const int R::attr::x=0x010100ac; const int R::attr::xlargeScreens=0x010102bf; const int R::attr::y=0x010100ad; const int R::attr::yesNoPreferenceStyle=0x01010090; const int R::attr::zAdjustment=0x010101c1; const int R::bool_::ImsConnectedDefaultValue=0x0111000e; const int R::bool_::action_bar_embed_tabs=0x01110004; const int R::bool_::action_bar_embed_tabs_pre_jb=0x01110005; const int R::bool_::action_bar_expanded_action_views_exclusive=0x01110009; const int R::bool_::config_actionMenuItemAllCaps=0x0111003d; const int R::bool_::config_allowActionMenuItemTextWithIcon=0x0111003e; const int R::bool_::config_allowAllRotations=0x0111001d; const int R::bool_::config_alwaysUseCdmaRssi=0x0111003a; const int R::bool_::config_animateScreenLights=0x0111001b; const int R::bool_::config_annoy_dianne=0x01110019; const int R::bool_::config_automatic_brightness_available=0x01110018; const int R::bool_::config_batterySdCardAccessibility=0x01110022; const int R::bool_::config_bluetooth_adapter_quick_switch=0x0111002e; const int R::bool_::config_bluetooth_address_validation=0x0111002f; const int R::bool_::config_bluetooth_default_profiles=0x01110032; const int R::bool_::config_bluetooth_sco_off_call=0x0111002c; const int R::bool_::config_bluetooth_wide_band_speech=0x0111002d; const int R::bool_::config_built_in_sip_phone=0x01110034; const int R::bool_::config_camera_sound_forced=0x0111004b; const int R::bool_::config_carDockEnablesAccelerometer=0x01110020; const int R::bool_::config_cellBroadcastAppLinks=0x01110045; const int R::bool_::config_closeDialogWhenTouchOutside=0x01110014; const int R::bool_::config_deskDockEnablesAccelerometer=0x0111001f; const int R::bool_::config_disableMenuKeyInLockScreen=0x01110025; const int R::bool_::config_dontPreferApn=0x0111004c; const int R::bool_::config_dreamsActivatedOnDockByDefault=0x01110042; const int R::bool_::config_dreamsActivatedOnSleepByDefault=0x01110043; const int R::bool_::config_dreamsEnabledByDefault=0x01110041; const int R::bool_::config_dreamsSupported=0x01110040; const int R::bool_::config_duplicate_port_omadm_wappush=0x0111003b; const int R::bool_::config_enableLockBeforeUnlockScreen=0x01110026; const int R::bool_::config_enableLockScreenRotation=0x01110027; const int R::bool_::config_enableScreenshotChord=0x0111001c; const int R::bool_::config_enableWallpaperService=0x0111002b; const int R::bool_::config_enableWifiDisplay=0x01110047; const int R::bool_::config_enable_emergency_call_while_sim_locked=0x01110029; const int R::bool_::config_enable_puk_unlock_screen=0x01110028; const int R::bool_::config_intrusiveNotificationLed=0x01110024; const int R::bool_::config_lidControlsSleep=0x01110021; const int R::bool_::config_mms_content_disposition_support=0x01110039; const int R::bool_::config_reverseDefaultRotation=0x0111001e; const int R::bool_::config_safe_media_volume_enabled=0x01110049; const int R::bool_::config_sendAudioBecomingNoisy=0x01110012; const int R::bool_::config_sf_limitedAlpha=0x0111000d; const int R::bool_::config_sf_slowBlur=0x0111000f; const int R::bool_::config_showMenuShortcutsWhenKeyboardPresent=0x01110036; const int R::bool_::config_showNavigationBar=0x0111003c; const int R::bool_::config_sip_wifi_only=0x01110033; const int R::bool_::config_sms_capable=0x01110031; const int R::bool_::config_sms_utf8_support=0x01110038; const int R::bool_::config_storage_notification=0x01110044; const int R::bool_::config_swipeDisambiguation=0x0111002a; const int R::bool_::config_syncstorageengine_masterSyncAutomatically=0x01110046; const int R::bool_::config_telephony_use_own_number_for_voicemail=0x01110037; const int R::bool_::config_ui_enableFadingMarquee=0x01110013; const int R::bool_::config_unplugTurnsOnScreen=0x0111001a; const int R::bool_::config_useDevInputEventForAudioJack=0x01110048; const int R::bool_::config_useMasterVolume=0x01110010; const int R::bool_::config_useVolumeKeySounds=0x01110011; const int R::bool_::config_use_strict_phone_number_comparation=0x01110023; const int R::bool_::config_voice_capable=0x01110030; const int R::bool_::config_wifiDisplaySupportsProtectedBuffers=0x0111004a; const int R::bool_::config_wifi_background_scan_support=0x01110017; const int R::bool_::config_wifi_dual_band_support=0x01110015; const int R::bool_::config_wifi_p2p_support=0x01110016; const int R::bool_::config_wimaxEnabled=0x0111003f; const int R::bool_::kg_center_small_widgets_vertically=0x01110001; const int R::bool_::kg_enable_camera_default_widget=0x01110000; const int R::bool_::kg_share_status_area=0x0111000b; const int R::bool_::kg_show_ime_at_screen_on=0x01110003; const int R::bool_::kg_sim_puk_account_full_screen=0x0111000c; const int R::bool_::kg_top_align_page_shrink_on_bouncer_visible=0x01110002; const int R::bool_::lockscreen_isPortrait=0x0111004d; const int R::bool_::preferences_prefer_dual_pane=0x01110007; const int R::bool_::show_ongoing_ime_switcher=0x01110008; const int R::bool_::skip_restoring_network_selection=0x01110035; const int R::bool_::split_action_bar_is_narrow=0x01110006; const int R::bool_::target_honeycomb_needs_options_menu=0x0111000a; const int R::color::background_dark=0x0106000e; const int R::color::background_holo_dark=0x0106004a; const int R::color::background_holo_light=0x0106004b; const int R::color::background_light=0x0106000f; const int R::color::black=0x0106000c; const int R::color::bright_foreground_dark=0x0106001d; const int R::color::bright_foreground_dark_disabled=0x0106001f; const int R::color::bright_foreground_dark_inverse=0x01060021; const int R::color::bright_foreground_disabled_holo_dark=0x0106004e; const int R::color::bright_foreground_disabled_holo_light=0x0106004f; const int R::color::bright_foreground_holo_dark=0x0106004c; const int R::color::bright_foreground_holo_light=0x0106004d; const int R::color::bright_foreground_inverse_holo_dark=0x01060050; const int R::color::bright_foreground_inverse_holo_light=0x01060051; const int R::color::bright_foreground_light=0x0106001e; const int R::color::bright_foreground_light_disabled=0x01060020; const int R::color::bright_foreground_light_inverse=0x01060022; const int R::color::config_defaultNotificationColor=0x0106006b; const int R::color::darker_gray=0x01060000; const int R::color::dim_foreground_dark=0x01060023; const int R::color::dim_foreground_dark_disabled=0x01060024; const int R::color::dim_foreground_dark_inverse=0x01060025; const int R::color::dim_foreground_dark_inverse_disabled=0x01060026; const int R::color::dim_foreground_disabled_holo_dark=0x01060053; const int R::color::dim_foreground_disabled_holo_light=0x01060058; const int R::color::dim_foreground_holo_dark=0x01060052; const int R::color::dim_foreground_holo_light=0x01060057; const int R::color::dim_foreground_inverse_disabled_holo_dark=0x01060055; const int R::color::dim_foreground_inverse_disabled_holo_light=0x0106005a; const int R::color::dim_foreground_inverse_holo_dark=0x01060054; const int R::color::dim_foreground_inverse_holo_light=0x01060059; const int R::color::dim_foreground_light=0x01060028; const int R::color::dim_foreground_light_disabled=0x01060029; const int R::color::dim_foreground_light_inverse=0x0106002a; const int R::color::dim_foreground_light_inverse_disabled=0x0106002b; const int R::color::facelock_spotlight_mask=0x01060049; const int R::color::group_button_dialog_focused_holo_dark=0x01060061; const int R::color::group_button_dialog_focused_holo_light=0x01060063; const int R::color::group_button_dialog_pressed_holo_dark=0x01060060; const int R::color::group_button_dialog_pressed_holo_light=0x01060062; const int R::color::highlighted_text_dark=0x0106002d; const int R::color::highlighted_text_holo_dark=0x0106005c; const int R::color::highlighted_text_holo_light=0x0106005d; const int R::color::highlighted_text_light=0x0106002e; const int R::color::hint_foreground_dark=0x01060027; const int R::color::hint_foreground_holo_dark=0x01060056; const int R::color::hint_foreground_holo_light=0x0106005b; const int R::color::hint_foreground_light=0x0106002c; const int R::color::holo_blue_bright=0x0106001b; const int R::color::holo_blue_dark=0x01060013; const int R::color::holo_blue_light=0x01060012; const int R::color::holo_green_dark=0x01060015; const int R::color::holo_green_light=0x01060014; const int R::color::holo_orange_dark=0x01060019; const int R::color::holo_orange_light=0x01060018; const int R::color::holo_purple=0x0106001a; const int R::color::holo_red_dark=0x01060017; const int R::color::holo_red_light=0x01060016; const int R::color::keyguard_avatar_frame_color=0x01060067; const int R::color::keyguard_avatar_frame_pressed_color=0x0106006a; const int R::color::keyguard_avatar_frame_shadow_color=0x01060068; const int R::color::keyguard_avatar_nick_color=0x01060069; const int R::color::keyguard_text_color_decline=0x01060041; const int R::color::keyguard_text_color_normal=0x0106003d; const int R::color::keyguard_text_color_soundoff=0x0106003f; const int R::color::keyguard_text_color_soundon=0x01060040; const int R::color::keyguard_text_color_unlock=0x0106003e; const int R::color::kg_multi_user_text_active=0x01060046; const int R::color::kg_multi_user_text_inactive=0x01060047; const int R::color::kg_widget_pager_gradient=0x01060048; const int R::color::legacy_long_pressed_highlight=0x01060066; const int R::color::legacy_pressed_highlight=0x01060064; const int R::color::legacy_selected_highlight=0x01060065; const int R::color::lighter_gray=0x01060032; const int R::color::link_text_dark=0x0106002f; const int R::color::link_text_holo_dark=0x0106005e; const int R::color::link_text_holo_light=0x0106005f; const int R::color::link_text_light=0x01060030; const int R::color::lockscreen_clock_am_pm=0x01060044; const int R::color::lockscreen_clock_background=0x01060042; const int R::color::lockscreen_clock_foreground=0x01060043; const int R::color::lockscreen_owner_info=0x01060045; const int R::color::perms_costs_money=0x01060036; const int R::color::perms_dangerous_grp_color=0x01060033; const int R::color::perms_dangerous_perm_color=0x01060034; const int R::color::primary_text_dark=0x01060001; const int R::color::primary_text_dark_disable_only=0x0106006c; const int R::color::primary_text_dark_focused=0x0106006d; const int R::color::primary_text_dark_nodisable=0x01060002; const int R::color::primary_text_disable_only_holo_dark=0x0106006e; const int R::color::primary_text_disable_only_holo_light=0x0106006f; const int R::color::primary_text_focused_holo_dark=0x01060070; const int R::color::primary_text_holo_dark=0x01060071; const int R::color::primary_text_holo_light=0x01060072; const int R::color::primary_text_light=0x01060003; const int R::color::primary_text_light_disable_only=0x01060073; const int R::color::primary_text_light_nodisable=0x01060004; const int R::color::primary_text_nodisable_holo_dark=0x01060074; const int R::color::primary_text_nodisable_holo_light=0x01060075; const int R::color::safe_mode_text=0x0106001c; const int R::color::search_url_text=0x01060076; const int R::color::search_url_text_holo=0x01060077; const int R::color::search_url_text_normal=0x01060037; const int R::color::search_url_text_pressed=0x01060039; const int R::color::search_url_text_selected=0x01060038; const int R::color::search_widget_corpus_item_background=0x0106003a; const int R::color::secondary_text_dark=0x01060005; const int R::color::secondary_text_dark_nodisable=0x01060006; const int R::color::secondary_text_holo_dark=0x01060078; const int R::color::secondary_text_holo_light=0x01060079; const int R::color::secondary_text_light=0x01060007; const int R::color::secondary_text_light_nodisable=0x01060008; const int R::color::secondary_text_nodisable_holo_dark=0x0106007a; const int R::color::secondary_text_nodisable_holo_light=0x0106007b; const int R::color::secondary_text_nofocus=0x0106007c; const int R::color::shadow=0x01060035; const int R::color::sliding_tab_text_color_active=0x0106003b; const int R::color::sliding_tab_text_color_shadow=0x0106003c; const int R::color::suggestion_highlight_text=0x01060031; const int R::color::tab_indicator_text=0x01060009; const int R::color::tab_indicator_text_v4=0x0106007d; const int R::color::tertiary_text_dark=0x01060010; const int R::color::tertiary_text_holo_dark=0x0106007e; const int R::color::tertiary_text_holo_light=0x0106007f; const int R::color::tertiary_text_light=0x01060011; const int R::color::transparent=0x0106000d; const int R::color::white=0x0106000b; const int R::color::widget_edittext_dark=0x0106000a; const int R::dimen::accessibility_touch_slop=0x0105006b; const int R::dimen::action_bar_default_height=0x0105003a; const int R::dimen::action_bar_icon_vertical_padding=0x0105003b; const int R::dimen::action_bar_stacked_max_height=0x01050053; const int R::dimen::action_bar_stacked_tab_max_width=0x01050054; const int R::dimen::action_bar_subtitle_bottom_margin=0x0105003f; const int R::dimen::action_bar_subtitle_text_size=0x0105003d; const int R::dimen::action_bar_subtitle_top_margin=0x0105003e; const int R::dimen::action_bar_title_text_size=0x0105003c; const int R::dimen::action_button_min_width=0x01050052; const int R::dimen::activity_chooser_popup_min_width=0x01050047; const int R::dimen::alert_dialog_button_bar_height=0x01050039; const int R::dimen::alert_dialog_title_height=0x01050038; const int R::dimen::app_icon_size=0x01050000; const int R::dimen::config_minScalingSpan=0x01050009; const int R::dimen::config_minScalingTouchMajor=0x0105000a; const int R::dimen::config_prefDialogWidth=0x01050007; const int R::dimen::config_viewConfigurationTouchSlop=0x01050008; const int R::dimen::default_app_widget_padding_bottom=0x01050051; const int R::dimen::default_app_widget_padding_left=0x0105004e; const int R::dimen::default_app_widget_padding_right=0x01050050; const int R::dimen::default_app_widget_padding_top=0x0105004f; const int R::dimen::default_gap=0x01050048; const int R::dimen::dialog_fixed_height_major=0x0105002f; const int R::dimen::dialog_fixed_height_minor=0x01050030; const int R::dimen::dialog_fixed_width_major=0x0105002d; const int R::dimen::dialog_fixed_width_minor=0x0105002e; const int R::dimen::dialog_min_width_major=0x01050003; const int R::dimen::dialog_min_width_minor=0x01050004; const int R::dimen::dropdownitem_icon_width=0x0105004b; const int R::dimen::dropdownitem_text_padding_left=0x01050049; const int R::dimen::dropdownitem_text_padding_right=0x0105004a; const int R::dimen::face_unlock_height=0x01050046; const int R::dimen::fastscroll_overlay_size=0x01050015; const int R::dimen::fastscroll_thumb_height=0x01050017; const int R::dimen::fastscroll_thumb_width=0x01050016; const int R::dimen::glowpadview_glow_radius=0x01050020; const int R::dimen::glowpadview_inner_radius=0x01050022; const int R::dimen::glowpadview_snap_margin=0x01050021; const int R::dimen::glowpadview_target_placement_radius=0x0105001f; const int R::dimen::keyguard_avatar_frame_shadow_radius=0x01050071; const int R::dimen::keyguard_avatar_frame_stroke_width=0x01050070; const int R::dimen::keyguard_avatar_name_size=0x01050073; const int R::dimen::keyguard_avatar_size=0x01050072; const int R::dimen::keyguard_lockscreen_clock_font_size=0x01050040; const int R::dimen::keyguard_lockscreen_outerring_diameter=0x0105001e; const int R::dimen::keyguard_lockscreen_pin_margin_left=0x01050045; const int R::dimen::keyguard_lockscreen_status_line_clockfont_bottom_margin=0x01050044; const int R::dimen::keyguard_lockscreen_status_line_clockfont_top_margin=0x01050043; const int R::dimen::keyguard_lockscreen_status_line_font_right_margin=0x01050042; const int R::dimen::keyguard_lockscreen_status_line_font_size=0x01050041; const int R::dimen::keyguard_muliuser_selector_margin=0x0105006f; const int R::dimen::keyguard_pattern_unlock_clock_font_size=0x01050079; const int R::dimen::keyguard_pattern_unlock_status_line_font_size=0x0105007a; const int R::dimen::keyguard_security_height=0x0105006d; const int R::dimen::keyguard_security_view_margin=0x0105006e; const int R::dimen::keyguard_security_width=0x0105006c; const int R::dimen::kg_clock_top_margin=0x01050060; const int R::dimen::kg_edge_swipe_region_size=0x01050074; const int R::dimen::kg_emergency_button_shift=0x01050077; const int R::dimen::kg_key_horizontal_gap=0x01050061; const int R::dimen::kg_key_vertical_gap=0x01050062; const int R::dimen::kg_pin_key_height=0x01050063; const int R::dimen::kg_runway_lights_height=0x01050065; const int R::dimen::kg_runway_lights_top_margin=0x0105006a; const int R::dimen::kg_runway_lights_vertical_padding=0x01050066; const int R::dimen::kg_secure_padding_height=0x01050064; const int R::dimen::kg_security_panel_height=0x01050058; const int R::dimen::kg_security_view_height=0x01050059; const int R::dimen::kg_small_widget_height=0x01050076; const int R::dimen::kg_squashed_layout_threshold=0x01050075; const int R::dimen::kg_status_clock_font_size=0x0105005c; const int R::dimen::kg_status_date_font_size=0x0105005d; const int R::dimen::kg_status_line_font_right_margin=0x0105005f; const int R::dimen::kg_status_line_font_size=0x0105005e; const int R::dimen::kg_widget_pager_bottom_padding=0x01050069; const int R::dimen::kg_widget_pager_horizontal_padding=0x01050067; const int R::dimen::kg_widget_pager_top_padding=0x01050068; const int R::dimen::kg_widget_view_height=0x0105005b; const int R::dimen::kg_widget_view_width=0x0105005a; const int R::dimen::min_xlarge_screen_width=0x01050018; const int R::dimen::navigation_bar_height=0x0105000d; const int R::dimen::navigation_bar_height_landscape=0x0105000e; const int R::dimen::navigation_bar_height_portrait=0x0105007b; const int R::dimen::navigation_bar_width=0x0105000f; const int R::dimen::notification_large_icon_height=0x01050006; const int R::dimen::notification_large_icon_width=0x01050005; const int R::dimen::notification_subtext_size=0x01050057; const int R::dimen::notification_text_size=0x01050055; const int R::dimen::notification_title_text_size=0x01050056; const int R::dimen::password_keyboard_height=0x01050078; const int R::dimen::password_keyboard_horizontalGap=0x0105001c; const int R::dimen::password_keyboard_key_height_alpha=0x01050019; const int R::dimen::password_keyboard_key_height_numeric=0x0105001a; const int R::dimen::password_keyboard_spacebar_vertical_correction=0x0105001b; const int R::dimen::password_keyboard_verticalGap=0x0105001d; const int R::dimen::preference_breadcrumb_paddingLeft=0x0105002a; const int R::dimen::preference_breadcrumb_paddingRight=0x0105002b; const int R::dimen::preference_child_padding_side=0x01050035; const int R::dimen::preference_fragment_padding_bottom=0x01050028; const int R::dimen::preference_fragment_padding_side=0x01050029; const int R::dimen::preference_icon_minWidth=0x0105002c; const int R::dimen::preference_item_padding_inner=0x01050034; const int R::dimen::preference_item_padding_side=0x01050033; const int R::dimen::preference_screen_bottom_margin=0x01050026; const int R::dimen::preference_screen_header_padding_side=0x01050032; const int R::dimen::preference_screen_header_vertical_padding=0x01050031; const int R::dimen::preference_screen_side_margin=0x01050023; const int R::dimen::preference_screen_side_margin_negative=0x01050024; const int R::dimen::preference_screen_top_margin=0x01050025; const int R::dimen::preference_widget_width=0x01050027; const int R::dimen::search_view_preferred_width=0x01050037; const int R::dimen::search_view_text_min_width=0x01050036; const int R::dimen::status_bar_content_number_size=0x01050011; const int R::dimen::status_bar_edge_ignore=0x01050014; const int R::dimen::status_bar_height=0x0105000c; const int R::dimen::status_bar_icon_size=0x01050010; const int R::dimen::system_bar_height=0x01050012; const int R::dimen::system_bar_icon_size=0x01050013; const int R::dimen::textview_error_popup_default_width=0x0105004c; const int R::dimen::thumbnail_height=0x01050001; const int R::dimen::thumbnail_width=0x01050002; const int R::dimen::toast_y_offset=0x0105000b; const int R::dimen::volume_panel_top=0x0105004d; const int R::drawable::ab_bottom_solid_dark_holo=0x0108009e; const int R::drawable::ab_bottom_solid_inverse_holo=0x0108009f; const int R::drawable::ab_bottom_solid_light_holo=0x010800a0; const int R::drawable::ab_bottom_transparent_dark_holo=0x010800a1; const int R::drawable::ab_bottom_transparent_light_holo=0x010800a2; const int R::drawable::ab_share_pack_holo_dark=0x010800a3; const int R::drawable::ab_share_pack_holo_light=0x010800b4; const int R::drawable::ab_solid_dark_holo=0x010800b5; const int R::drawable::ab_solid_light_holo=0x010800b6; const int R::drawable::ab_solid_shadow_holo=0x010800b7; const int R::drawable::ab_stacked_solid_dark_holo=0x010800b8; const int R::drawable::ab_stacked_solid_inverse_holo=0x010800b9; const int R::drawable::ab_stacked_solid_light_holo=0x010800ba; const int R::drawable::ab_stacked_transparent_dark_holo=0x010800bb; const int R::drawable::ab_stacked_transparent_light_holo=0x010800bc; const int R::drawable::ab_transparent_dark_holo=0x010800bd; const int R::drawable::ab_transparent_light_holo=0x010800be; const int R::drawable::action_bar_background=0x010800bf; const int R::drawable::action_bar_divider=0x010800c0; const int R::drawable::activated_background=0x010800c1; const int R::drawable::activated_background_holo_dark=0x010800c2; const int R::drawable::activated_background_holo_light=0x010800c3; const int R::drawable::activated_background_light=0x010800c4; const int R::drawable::activity_picker_bg=0x010800c5; const int R::drawable::activity_picker_bg_activated=0x010800c6; const int R::drawable::activity_picker_bg_focused=0x010800c7; const int R::drawable::activity_title_bar=0x010800c8; const int R::drawable::alert_dark_frame=0x01080000; const int R::drawable::alert_light_frame=0x01080001; const int R::drawable::app_icon_background=0x010800c9; const int R::drawable::arrow_down_float=0x01080002; const int R::drawable::arrow_up_float=0x01080003; const int R::drawable::background_cache_hint_selector_holo_dark=0x010800ca; const int R::drawable::background_cache_hint_selector_holo_light=0x010800cb; const int R::drawable::background_holo_dark=0x010800cc; const int R::drawable::background_holo_light=0x010800cd; const int R::drawable::battery_charge_background=0x010800ce; const int R::drawable::blank_tile=0x010800cf; const int R::drawable::bottom_bar=0x0108009a; const int R::drawable::box=0x010800d0; const int R::drawable::btn_browser_zoom_fit_page=0x010800d1; const int R::drawable::btn_browser_zoom_page_overview=0x010800d2; const int R::drawable::btn_cab_done_default_holo_dark=0x010800d3; const int R::drawable::btn_cab_done_default_holo_light=0x010800d4; const int R::drawable::btn_cab_done_focused_holo_dark=0x010800d5; const int R::drawable::btn_cab_done_focused_holo_light=0x010800d6; const int R::drawable::btn_cab_done_holo_dark=0x010800d7; const int R::drawable::btn_cab_done_holo_light=0x010800d8; const int R::drawable::btn_cab_done_pressed_holo_dark=0x010800d9; const int R::drawable::btn_cab_done_pressed_holo_light=0x010800da; const int R::drawable::btn_check=0x010800db; const int R::drawable::btn_check_buttonless_off=0x010800dc; const int R::drawable::btn_check_buttonless_on=0x010800dd; const int R::drawable::btn_check_holo_dark=0x010800de; const int R::drawable::btn_check_holo_light=0x010800df; const int R::drawable::btn_check_label_background=0x010800e0; const int R::drawable::btn_check_off=0x010800e1; const int R::drawable::btn_check_off_disable=0x010800e2; const int R::drawable::btn_check_off_disable_focused=0x010800e3; const int R::drawable::btn_check_off_disable_focused_holo_dark=0x010800e4; const int R::drawable::btn_check_off_disable_focused_holo_light=0x010800e5; const int R::drawable::btn_check_off_disable_holo_dark=0x010800e6; const int R::drawable::btn_check_off_disable_holo_light=0x010800e7; const int R::drawable::btn_check_off_disabled_focused_holo_dark=0x010800e8; const int R::drawable::btn_check_off_disabled_focused_holo_light=0x010800e9; const int R::drawable::btn_check_off_disabled_holo_dark=0x010800ea; const int R::drawable::btn_check_off_disabled_holo_light=0x010800eb; const int R::drawable::btn_check_off_focused_holo_dark=0x010800ec; const int R::drawable::btn_check_off_focused_holo_light=0x010800ed; const int R::drawable::btn_check_off_holo=0x010800ee; const int R::drawable::btn_check_off_holo_dark=0x010800ef; const int R::drawable::btn_check_off_holo_light=0x010800f0; const int R::drawable::btn_check_off_normal_holo_dark=0x010800f1; const int R::drawable::btn_check_off_normal_holo_light=0x010800f2; const int R::drawable::btn_check_off_pressed=0x010800f3; const int R::drawable::btn_check_off_pressed_holo_dark=0x010800f4; const int R::drawable::btn_check_off_pressed_holo_light=0x010800f5; const int R::drawable::btn_check_off_selected=0x010800f6; const int R::drawable::btn_check_on=0x010800f7; const int R::drawable::btn_check_on_disable=0x010800f8; const int R::drawable::btn_check_on_disable_focused=0x010800f9; const int R::drawable::btn_check_on_disable_focused_holo_light=0x010800fa; const int R::drawable::btn_check_on_disable_holo_dark=0x010800fb; const int R::drawable::btn_check_on_disable_holo_light=0x010800fc; const int R::drawable::btn_check_on_disabled_focused_holo_dark=0x010800fd; const int R::drawable::btn_check_on_disabled_focused_holo_light=0x010800fe; const int R::drawable::btn_check_on_disabled_holo_dark=0x010800ff; const int R::drawable::btn_check_on_disabled_holo_light=0x01080100; const int R::drawable::btn_check_on_focused_holo_dark=0x01080101; const int R::drawable::btn_check_on_focused_holo_light=0x01080102; const int R::drawable::btn_check_on_holo=0x01080103; const int R::drawable::btn_check_on_holo_dark=0x01080104; const int R::drawable::btn_check_on_holo_light=0x01080105; const int R::drawable::btn_check_on_pressed=0x01080106; const int R::drawable::btn_check_on_pressed_holo_dark=0x01080107; const int R::drawable::btn_check_on_pressed_holo_light=0x01080108; const int R::drawable::btn_check_on_selected=0x01080109; const int R::drawable::btn_circle=0x0108010a; const int R::drawable::btn_circle_disable=0x0108010b; const int R::drawable::btn_circle_disable_focused=0x0108010c; const int R::drawable::btn_circle_normal=0x0108010d; const int R::drawable::btn_circle_pressed=0x0108010e; const int R::drawable::btn_circle_selected=0x0108010f; const int R::drawable::btn_close=0x01080110; const int R::drawable::btn_close_normal=0x01080111; const int R::drawable::btn_close_pressed=0x01080112; const int R::drawable::btn_close_selected=0x01080113; const int R::drawable::btn_code_lock_default=0x01080114; const int R::drawable::btn_code_lock_default_holo=0x01080115; const int R::drawable::btn_code_lock_touched=0x01080116; const int R::drawable::btn_code_lock_touched_holo=0x01080117; const int R::drawable::btn_default=0x01080004; const int R::drawable::btn_default_disabled_focused_holo_dark=0x01080118; const int R::drawable::btn_default_disabled_focused_holo_light=0x01080119; const int R::drawable::btn_default_disabled_holo=0x0108011a; const int R::drawable::btn_default_disabled_holo_dark=0x0108011b; const int R::drawable::btn_default_disabled_holo_light=0x0108011c; const int R::drawable::btn_default_focused_holo=0x0108011d; const int R::drawable::btn_default_focused_holo_dark=0x0108011e; const int R::drawable::btn_default_focused_holo_light=0x0108011f; const int R::drawable::btn_default_holo_dark=0x01080120; const int R::drawable::btn_default_holo_light=0x01080121; const int R::drawable::btn_default_normal=0x01080122; const int R::drawable::btn_default_normal_disable=0x01080123; const int R::drawable::btn_default_normal_disable_focused=0x01080124; const int R::drawable::btn_default_normal_holo=0x01080125; const int R::drawable::btn_default_normal_holo_dark=0x01080126; const int R::drawable::btn_default_normal_holo_light=0x01080127; const int R::drawable::btn_default_pressed=0x01080128; const int R::drawable::btn_default_pressed_holo=0x01080129; const int R::drawable::btn_default_pressed_holo_dark=0x0108012a; const int R::drawable::btn_default_pressed_holo_light=0x0108012b; const int R::drawable::btn_default_selected=0x0108012c; const int R::drawable::btn_default_small=0x01080005; const int R::drawable::btn_default_small_normal=0x0108012d; const int R::drawable::btn_default_small_normal_disable=0x0108012e; const int R::drawable::btn_default_small_normal_disable_focused=0x0108012f; const int R::drawable::btn_default_small_pressed=0x01080130; const int R::drawable::btn_default_small_selected=0x01080131; const int R::drawable::btn_default_transparent=0x01080132; const int R::drawable::btn_default_transparent_normal=0x01080133; const int R::drawable::btn_dialog=0x01080017; const int R::drawable::btn_dialog_disable=0x01080134; const int R::drawable::btn_dialog_normal=0x01080135; const int R::drawable::btn_dialog_pressed=0x01080136; const int R::drawable::btn_dialog_selected=0x01080137; const int R::drawable::btn_dropdown=0x01080006; const int R::drawable::btn_dropdown_disabled=0x01080138; const int R::drawable::btn_dropdown_disabled_focused=0x01080139; const int R::drawable::btn_dropdown_normal=0x0108013a; const int R::drawable::btn_dropdown_pressed=0x0108013b; const int R::drawable::btn_dropdown_selected=0x0108013c; const int R::drawable::btn_erase_default=0x0108013d; const int R::drawable::btn_erase_pressed=0x0108013e; const int R::drawable::btn_erase_selected=0x0108013f; const int R::drawable::btn_global_search=0x01080140; const int R::drawable::btn_global_search_normal=0x01080141; const int R::drawable::btn_group_disabled_holo_dark=0x01080142; const int R::drawable::btn_group_disabled_holo_light=0x01080143; const int R::drawable::btn_group_focused_holo_dark=0x01080144; const int R::drawable::btn_group_focused_holo_light=0x01080145; const int R::drawable::btn_group_holo_dark=0x01080146; const int R::drawable::btn_group_holo_light=0x01080147; const int R::drawable::btn_group_normal_holo_dark=0x01080148; const int R::drawable::btn_group_normal_holo_light=0x01080149; const int R::drawable::btn_group_pressed_holo_dark=0x0108014a; const int R::drawable::btn_group_pressed_holo_light=0x0108014b; const int R::drawable::btn_keyboard_key=0x0108014c; const int R::drawable::btn_keyboard_key_dark_normal_holo=0x0108014d; const int R::drawable::btn_keyboard_key_dark_normal_off_holo=0x0108014e; const int R::drawable::btn_keyboard_key_dark_normal_on_holo=0x0108014f; const int R::drawable::btn_keyboard_key_dark_pressed_holo=0x01080150; const int R::drawable::btn_keyboard_key_dark_pressed_off_holo=0x01080151; const int R::drawable::btn_keyboard_key_dark_pressed_on_holo=0x01080152; const int R::drawable::btn_keyboard_key_fulltrans=0x01080153; const int R::drawable::btn_keyboard_key_fulltrans_normal=0x01080154; const int R::drawable::btn_keyboard_key_fulltrans_normal_off=0x01080155; const int R::drawable::btn_keyboard_key_fulltrans_normal_on=0x01080156; const int R::drawable::btn_keyboard_key_fulltrans_pressed=0x01080157; const int R::drawable::btn_keyboard_key_fulltrans_pressed_off=0x01080158; const int R::drawable::btn_keyboard_key_fulltrans_pressed_on=0x01080159; const int R::drawable::btn_keyboard_key_ics=0x0108015a; const int R::drawable::btn_keyboard_key_light_normal_holo=0x0108015b; const int R::drawable::btn_keyboard_key_light_pressed_holo=0x0108015c; const int R::drawable::btn_keyboard_key_normal=0x0108015d; const int R::drawable::btn_keyboard_key_normal_off=0x0108015e; const int R::drawable::btn_keyboard_key_normal_on=0x0108015f; const int R::drawable::btn_keyboard_key_pressed=0x01080160; const int R::drawable::btn_keyboard_key_pressed_off=0x01080161; const int R::drawable::btn_keyboard_key_pressed_on=0x01080162; const int R::drawable::btn_keyboard_key_trans=0x01080163; const int R::drawable::btn_keyboard_key_trans_normal=0x01080164; const int R::drawable::btn_keyboard_key_trans_normal_off=0x01080165; const int R::drawable::btn_keyboard_key_trans_normal_on=0x01080166; const int R::drawable::btn_keyboard_key_trans_pressed=0x01080167; const int R::drawable::btn_keyboard_key_trans_pressed_off=0x01080168; const int R::drawable::btn_keyboard_key_trans_pressed_on=0x01080169; const int R::drawable::btn_keyboard_key_trans_selected=0x0108016a; const int R::drawable::btn_lock_normal=0x0108016b; const int R::drawable::btn_media_player=0x0108016c; const int R::drawable::btn_media_player_disabled=0x0108016d; const int R::drawable::btn_media_player_disabled_selected=0x0108016e; const int R::drawable::btn_media_player_pressed=0x0108016f; const int R::drawable::btn_media_player_selected=0x01080170; const int R::drawable::btn_minus=0x01080007; const int R::drawable::btn_minus_default=0x01080171; const int R::drawable::btn_minus_disable=0x01080172; const int R::drawable::btn_minus_disable_focused=0x01080173; const int R::drawable::btn_minus_pressed=0x01080174; const int R::drawable::btn_minus_selected=0x01080175; const int R::drawable::btn_plus=0x01080008; const int R::drawable::btn_plus_default=0x01080176; const int R::drawable::btn_plus_disable=0x01080177; const int R::drawable::btn_plus_disable_focused=0x01080178; const int R::drawable::btn_plus_pressed=0x01080179; const int R::drawable::btn_plus_selected=0x0108017a; const int R::drawable::btn_radio=0x01080009; const int R::drawable::btn_radio_holo_dark=0x0108017b; const int R::drawable::btn_radio_holo_light=0x0108017c; const int R::drawable::btn_radio_label_background=0x0108017d; const int R::drawable::btn_radio_off=0x0108017e; const int R::drawable::btn_radio_off_disabled_focused_holo_dark=0x0108017f; const int R::drawable::btn_radio_off_disabled_focused_holo_light=0x01080180; const int R::drawable::btn_radio_off_disabled_holo_dark=0x01080181; const int R::drawable::btn_radio_off_disabled_holo_light=0x01080182; const int R::drawable::btn_radio_off_focused_holo_dark=0x01080183; const int R::drawable::btn_radio_off_focused_holo_light=0x01080184; const int R::drawable::btn_radio_off_holo=0x01080185; const int R::drawable::btn_radio_off_holo_dark=0x01080186; const int R::drawable::btn_radio_off_holo_light=0x01080187; const int R::drawable::btn_radio_off_pressed=0x01080188; const int R::drawable::btn_radio_off_pressed_holo_dark=0x01080189; const int R::drawable::btn_radio_off_pressed_holo_light=0x0108018a; const int R::drawable::btn_radio_off_selected=0x0108018b; const int R::drawable::btn_radio_on=0x0108018c; const int R::drawable::btn_radio_on_disabled_focused_holo_dark=0x0108018d; const int R::drawable::btn_radio_on_disabled_focused_holo_light=0x0108018e; const int R::drawable::btn_radio_on_disabled_holo_dark=0x0108018f; const int R::drawable::btn_radio_on_disabled_holo_light=0x01080190; const int R::drawable::btn_radio_on_focused_holo_dark=0x01080191; const int R::drawable::btn_radio_on_focused_holo_light=0x01080192; const int R::drawable::btn_radio_on_holo=0x01080193; const int R::drawable::btn_radio_on_holo_dark=0x01080194; const int R::drawable::btn_radio_on_holo_light=0x01080195; const int R::drawable::btn_radio_on_pressed=0x01080196; const int R::drawable::btn_radio_on_pressed_holo_dark=0x01080197; const int R::drawable::btn_radio_on_pressed_holo_light=0x01080198; const int R::drawable::btn_radio_on_selected=0x01080199; const int R::drawable::btn_rating_star_off_disabled_focused_holo_dark=0x0108019a; const int R::drawable::btn_rating_star_off_disabled_focused_holo_light=0x0108019b; const int R::drawable::btn_rating_star_off_disabled_holo_dark=0x0108019c; const int R::drawable::btn_rating_star_off_disabled_holo_light=0x0108019d; const int R::drawable::btn_rating_star_off_focused_holo_dark=0x0108019e; const int R::drawable::btn_rating_star_off_focused_holo_light=0x0108019f; const int R::drawable::btn_rating_star_off_normal=0x010801a0; const int R::drawable::btn_rating_star_off_normal_holo_dark=0x010801a1; const int R::drawable::btn_rating_star_off_normal_holo_light=0x010801a2; const int R::drawable::btn_rating_star_off_pressed=0x010801a3; const int R::drawable::btn_rating_star_off_pressed_holo_dark=0x010801a4; const int R::drawable::btn_rating_star_off_pressed_holo_light=0x010801a5; const int R::drawable::btn_rating_star_off_selected=0x010801a6; const int R::drawable::btn_rating_star_on_disabled_focused_holo_dark=0x010801a7; const int R::drawable::btn_rating_star_on_disabled_focused_holo_light=0x010801a8; const int R::drawable::btn_rating_star_on_disabled_holo_dark=0x010801a9; const int R::drawable::btn_rating_star_on_disabled_holo_light=0x010801aa; const int R::drawable::btn_rating_star_on_focused_holo_dark=0x010801ab; const int R::drawable::btn_rating_star_on_focused_holo_light=0x010801ac; const int R::drawable::btn_rating_star_on_normal=0x010801ad; const int R::drawable::btn_rating_star_on_normal_holo_dark=0x010801ae; const int R::drawable::btn_rating_star_on_normal_holo_light=0x010801af; const int R::drawable::btn_rating_star_on_pressed=0x010801b0; const int R::drawable::btn_rating_star_on_pressed_holo_dark=0x010801b1; const int R::drawable::btn_rating_star_on_pressed_holo_light=0x010801b2; const int R::drawable::btn_rating_star_on_selected=0x010801b3; const int R::drawable::btn_search_dialog=0x010801b4; const int R::drawable::btn_search_dialog_default=0x010801b5; const int R::drawable::btn_search_dialog_pressed=0x010801b6; const int R::drawable::btn_search_dialog_selected=0x010801b7; const int R::drawable::btn_search_dialog_voice=0x010801b8; const int R::drawable::btn_search_dialog_voice_default=0x010801b9; const int R::drawable::btn_search_dialog_voice_pressed=0x010801ba; const int R::drawable::btn_search_dialog_voice_selected=0x010801bb; const int R::drawable::btn_square_overlay=0x010801bc; const int R::drawable::btn_square_overlay_disabled=0x010801bd; const int R::drawable::btn_square_overlay_disabled_focused=0x010801be; const int R::drawable::btn_square_overlay_normal=0x010801bf; const int R::drawable::btn_square_overlay_pressed=0x010801c0; const int R::drawable::btn_square_overlay_selected=0x010801c1; const int R::drawable::btn_star=0x0108000a; const int R::drawable::btn_star_big_off=0x0108000b; const int R::drawable::btn_star_big_off_disable=0x010801c2; const int R::drawable::btn_star_big_off_disable_focused=0x010801c3; const int R::drawable::btn_star_big_off_pressed=0x010801c4; const int R::drawable::btn_star_big_off_selected=0x010801c5; const int R::drawable::btn_star_big_on=0x0108000c; const int R::drawable::btn_star_big_on_disable=0x010801c6; const int R::drawable::btn_star_big_on_disable_focused=0x010801c7; const int R::drawable::btn_star_big_on_pressed=0x010801c8; const int R::drawable::btn_star_big_on_selected=0x010801c9; const int R::drawable::btn_star_holo_dark=0x010801ca; const int R::drawable::btn_star_holo_light=0x010801cb; const int R::drawable::btn_star_label_background=0x010801cc; const int R::drawable::btn_star_off_disabled_focused_holo_dark=0x010801cd; const int R::drawable::btn_star_off_disabled_focused_holo_light=0x010801ce; const int R::drawable::btn_star_off_disabled_holo_dark=0x010801cf; const int R::drawable::btn_star_off_disabled_holo_light=0x010801d0; const int R::drawable::btn_star_off_focused_holo_dark=0x010801d1; const int R::drawable::btn_star_off_focused_holo_light=0x010801d2; const int R::drawable::btn_star_off_normal_holo_dark=0x010801d3; const int R::drawable::btn_star_off_normal_holo_light=0x010801d4; const int R::drawable::btn_star_off_pressed_holo_dark=0x010801d5; const int R::drawable::btn_star_off_pressed_holo_light=0x010801d6; const int R::drawable::btn_star_on_disabled_focused_holo_dark=0x010801d7; const int R::drawable::btn_star_on_disabled_focused_holo_light=0x010801d8; const int R::drawable::btn_star_on_disabled_holo_dark=0x010801d9; const int R::drawable::btn_star_on_disabled_holo_light=0x010801da; const int R::drawable::btn_star_on_focused_holo_dark=0x010801db; const int R::drawable::btn_star_on_focused_holo_light=0x010801dc; const int R::drawable::btn_star_on_normal_holo_dark=0x010801dd; const int R::drawable::btn_star_on_normal_holo_light=0x010801de; const int R::drawable::btn_star_on_pressed_holo_dark=0x010801df; const int R::drawable::btn_star_on_pressed_holo_light=0x010801e0; const int R::drawable::btn_toggle=0x010801e1; const int R::drawable::btn_toggle_bg=0x010801e2; const int R::drawable::btn_toggle_holo_dark=0x010801e3; const int R::drawable::btn_toggle_holo_light=0x010801e4; const int R::drawable::btn_toggle_off=0x010801e5; const int R::drawable::btn_toggle_off_disabled_focused_holo_dark=0x010801e6; const int R::drawable::btn_toggle_off_disabled_focused_holo_light=0x010801e7; const int R::drawable::btn_toggle_off_disabled_holo_dark=0x010801e8; const int R::drawable::btn_toggle_off_disabled_holo_light=0x010801e9; const int R::drawable::btn_toggle_off_focused_holo_dark=0x010801ea; const int R::drawable::btn_toggle_off_focused_holo_light=0x010801eb; const int R::drawable::btn_toggle_off_normal_holo_dark=0x010801ec; const int R::drawable::btn_toggle_off_normal_holo_light=0x010801ed; const int R::drawable::btn_toggle_off_pressed_holo_dark=0x010801ee; const int R::drawable::btn_toggle_off_pressed_holo_light=0x010801ef; const int R::drawable::btn_toggle_on=0x010801f0; const int R::drawable::btn_toggle_on_disabled_focused_holo_dark=0x010801f1; const int R::drawable::btn_toggle_on_disabled_focused_holo_light=0x010801f2; const int R::drawable::btn_toggle_on_disabled_holo_dark=0x010801f3; const int R::drawable::btn_toggle_on_disabled_holo_light=0x010801f4; const int R::drawable::btn_toggle_on_focused_holo_dark=0x010801f5; const int R::drawable::btn_toggle_on_focused_holo_light=0x010801f6; const int R::drawable::btn_toggle_on_normal_holo_dark=0x010801f7; const int R::drawable::btn_toggle_on_normal_holo_light=0x010801f8; const int R::drawable::btn_toggle_on_pressed_holo_dark=0x010801f9; const int R::drawable::btn_toggle_on_pressed_holo_light=0x010801fa; const int R::drawable::btn_zoom_down=0x010801fb; const int R::drawable::btn_zoom_down_disabled=0x010801fc; const int R::drawable::btn_zoom_down_disabled_focused=0x010801fd; const int R::drawable::btn_zoom_down_normal=0x010801fe; const int R::drawable::btn_zoom_down_pressed=0x010801ff; const int R::drawable::btn_zoom_down_selected=0x01080200; const int R::drawable::btn_zoom_page=0x01080201; const int R::drawable::btn_zoom_page_normal=0x01080202; const int R::drawable::btn_zoom_page_press=0x01080203; const int R::drawable::btn_zoom_up=0x01080204; const int R::drawable::btn_zoom_up_disabled=0x01080205; const int R::drawable::btn_zoom_up_disabled_focused=0x01080206; const int R::drawable::btn_zoom_up_normal=0x01080207; const int R::drawable::btn_zoom_up_pressed=0x01080208; const int R::drawable::btn_zoom_up_selected=0x01080209; const int R::drawable::button_inset=0x0108020a; const int R::drawable::button_onoff_indicator_off=0x0108000e; const int R::drawable::button_onoff_indicator_on=0x0108000d; const int R::drawable::cab_background_bottom_holo_dark=0x0108020b; const int R::drawable::cab_background_bottom_holo_light=0x0108020c; const int R::drawable::cab_background_top_holo_dark=0x0108020d; const int R::drawable::cab_background_top_holo_light=0x0108020e; const int R::drawable::call_contact=0x0108020f; const int R::drawable::checkbox_off_background=0x0108000f; const int R::drawable::checkbox_on_background=0x01080010; const int R::drawable::clock_dial=0x01080210; const int R::drawable::clock_hand_hour=0x01080211; const int R::drawable::clock_hand_minute=0x01080212; const int R::drawable::code_lock_bottom=0x01080213; const int R::drawable::code_lock_left=0x01080214; const int R::drawable::code_lock_top=0x01080215; const int R::drawable::combobox_disabled=0x01080216; const int R::drawable::combobox_nohighlight=0x01080217; const int R::drawable::compass_arrow=0x01080218; const int R::drawable::compass_base=0x01080219; const int R::drawable::contact_header_bg=0x0108021a; const int R::drawable::create_contact=0x0108021b; const int R::drawable::dark_header=0x010800a5; const int R::drawable::dark_header_dither=0x0108021c; const int R::drawable::day_picker_week_view_dayline_holo=0x0108021d; const int R::drawable::default_wallpaper=0x0108021e; const int R::drawable::dialog_bottom_holo_dark=0x0108021f; const int R::drawable::dialog_bottom_holo_light=0x01080220; const int R::drawable::dialog_divider_horizontal_holo_dark=0x01080221; const int R::drawable::dialog_divider_horizontal_holo_light=0x01080222; const int R::drawable::dialog_divider_horizontal_light=0x01080223; const int R::drawable::dialog_frame=0x01080011; const int R::drawable::dialog_full_holo_dark=0x01080224; const int R::drawable::dialog_full_holo_light=0x01080225; const int R::drawable::dialog_holo_dark_frame=0x010800b2; const int R::drawable::dialog_holo_light_frame=0x010800b3; const int R::drawable::dialog_ic_close_focused_holo_dark=0x01080226; const int R::drawable::dialog_ic_close_focused_holo_light=0x01080227; const int R::drawable::dialog_ic_close_normal_holo_dark=0x01080228; const int R::drawable::dialog_ic_close_normal_holo_light=0x01080229; const int R::drawable::dialog_ic_close_pressed_holo_dark=0x0108022a; const int R::drawable::dialog_ic_close_pressed_holo_light=0x0108022b; const int R::drawable::dialog_middle_holo=0x0108022c; const int R::drawable::dialog_middle_holo_dark=0x0108022d; const int R::drawable::dialog_middle_holo_light=0x0108022e; const int R::drawable::dialog_top_holo_dark=0x0108022f; const int R::drawable::dialog_top_holo_light=0x01080230; const int R::drawable::divider_horizontal_bright=0x01080012; const int R::drawable::divider_horizontal_bright_opaque=0x01080231; const int R::drawable::divider_horizontal_dark=0x01080014; const int R::drawable::divider_horizontal_dark_opaque=0x01080232; const int R::drawable::divider_horizontal_dim_dark=0x01080015; const int R::drawable::divider_horizontal_holo_dark=0x01080233; const int R::drawable::divider_horizontal_holo_light=0x01080234; const int R::drawable::divider_horizontal_textfield=0x01080013; const int R::drawable::divider_strong_holo=0x01080235; const int R::drawable::divider_vertical_bright=0x01080236; const int R::drawable::divider_vertical_bright_opaque=0x01080237; const int R::drawable::divider_vertical_dark=0x01080238; const int R::drawable::divider_vertical_dark_opaque=0x01080239; const int R::drawable::divider_vertical_holo_dark=0x0108023a; const int R::drawable::divider_vertical_holo_light=0x0108023b; const int R::drawable::dropdown_disabled_focused_holo_dark=0x0108023c; const int R::drawable::dropdown_disabled_focused_holo_light=0x0108023d; const int R::drawable::dropdown_disabled_holo_dark=0x0108023e; const int R::drawable::dropdown_disabled_holo_light=0x0108023f; const int R::drawable::dropdown_focused_holo_dark=0x01080240; const int R::drawable::dropdown_focused_holo_light=0x01080241; const int R::drawable::dropdown_ic_arrow_disabled_focused_holo_dark=0x01080242; const int R::drawable::dropdown_ic_arrow_disabled_focused_holo_light=0x01080243; const int R::drawable::dropdown_ic_arrow_disabled_holo_dark=0x01080244; const int R::drawable::dropdown_ic_arrow_disabled_holo_light=0x01080245; const int R::drawable::dropdown_ic_arrow_focused_holo_dark=0x01080246; const int R::drawable::dropdown_ic_arrow_focused_holo_light=0x01080247; const int R::drawable::dropdown_ic_arrow_normal_holo_dark=0x01080248; const int R::drawable::dropdown_ic_arrow_normal_holo_light=0x01080249; const int R::drawable::dropdown_ic_arrow_pressed_holo_dark=0x0108024a; const int R::drawable::dropdown_ic_arrow_pressed_holo_light=0x0108024b; const int R::drawable::dropdown_normal_holo_dark=0x0108024c; const int R::drawable::dropdown_normal_holo_light=0x0108024d; const int R::drawable::dropdown_pressed_holo_dark=0x0108024e; const int R::drawable::dropdown_pressed_holo_light=0x0108024f; const int R::drawable::edit_query=0x01080250; const int R::drawable::edit_query_background=0x01080251; const int R::drawable::edit_query_background_normal=0x01080252; const int R::drawable::edit_query_background_pressed=0x01080253; const int R::drawable::edit_query_background_selected=0x01080254; const int R::drawable::edit_text=0x01080016; const int R::drawable::edit_text_holo_dark=0x01080255; const int R::drawable::edit_text_holo_light=0x01080256; const int R::drawable::editbox_background=0x01080018; const int R::drawable::editbox_background_focus_yellow=0x01080257; const int R::drawable::editbox_background_normal=0x01080019; const int R::drawable::editbox_dropdown_background=0x01080258; const int R::drawable::editbox_dropdown_background_dark=0x01080259; const int R::drawable::editbox_dropdown_dark_frame=0x0108001a; const int R::drawable::editbox_dropdown_light_frame=0x0108001b; const int R::drawable::emo_im_angel=0x0108025a; const int R::drawable::emo_im_cool=0x0108025b; const int R::drawable::emo_im_crying=0x0108025c; const int R::drawable::emo_im_embarrassed=0x0108025d; const int R::drawable::emo_im_foot_in_mouth=0x0108025e; const int R::drawable::emo_im_happy=0x0108025f; const int R::drawable::emo_im_kissing=0x01080260; const int R::drawable::emo_im_laughing=0x01080261; const int R::drawable::emo_im_lips_are_sealed=0x01080262; const int R::drawable::emo_im_money_mouth=0x01080263; const int R::drawable::emo_im_sad=0x01080264; const int R::drawable::emo_im_surprised=0x01080265; const int R::drawable::emo_im_tongue_sticking_out=0x01080266; const int R::drawable::emo_im_undecided=0x01080267; const int R::drawable::emo_im_winking=0x01080268; const int R::drawable::emo_im_wtf=0x01080269; const int R::drawable::emo_im_yelling=0x0108026a; const int R::drawable::expander_close_holo_dark=0x0108026b; const int R::drawable::expander_close_holo_light=0x0108026c; const int R::drawable::expander_group=0x0108026d; const int R::drawable::expander_group_holo_dark=0x0108026e; const int R::drawable::expander_group_holo_light=0x0108026f; const int R::drawable::expander_ic_maximized=0x01080270; const int R::drawable::expander_ic_minimized=0x01080271; const int R::drawable::expander_open_holo_dark=0x01080272; const int R::drawable::expander_open_holo_light=0x01080273; const int R::drawable::fastscroll_label_left_holo_dark=0x01080274; const int R::drawable::fastscroll_label_left_holo_light=0x01080275; const int R::drawable::fastscroll_label_right_holo_dark=0x01080276; const int R::drawable::fastscroll_label_right_holo_light=0x01080277; const int R::drawable::fastscroll_thumb_default_holo=0x01080278; const int R::drawable::fastscroll_thumb_holo=0x01080279; const int R::drawable::fastscroll_thumb_pressed_holo=0x0108027a; const int R::drawable::fastscroll_track_default_holo_dark=0x0108027b; const int R::drawable::fastscroll_track_default_holo_light=0x0108027c; const int R::drawable::fastscroll_track_holo_dark=0x0108027d; const int R::drawable::fastscroll_track_holo_light=0x0108027e; const int R::drawable::fastscroll_track_pressed_holo_dark=0x0108027f; const int R::drawable::fastscroll_track_pressed_holo_light=0x01080280; const int R::drawable::focused_application_background_static=0x01080281; const int R::drawable::frame_gallery_thumb=0x01080282; const int R::drawable::frame_gallery_thumb_pressed=0x01080283; const int R::drawable::frame_gallery_thumb_selected=0x01080284; const int R::drawable::gallery_item_background=0x01080285; const int R::drawable::gallery_selected_default=0x01080286; const int R::drawable::gallery_selected_focused=0x01080287; const int R::drawable::gallery_selected_pressed=0x01080288; const int R::drawable::gallery_thumb=0x0108001c; const int R::drawable::gallery_unselected_default=0x01080289; const int R::drawable::gallery_unselected_pressed=0x0108028a; const int R::drawable::grid_selector_background=0x0108028b; const int R::drawable::grid_selector_background_focus=0x0108028c; const int R::drawable::grid_selector_background_pressed=0x0108028d; const int R::drawable::highlight_disabled=0x0108028e; const int R::drawable::highlight_pressed=0x0108028f; const int R::drawable::highlight_selected=0x01080290; const int R::drawable::ic_ab_back_holo_dark=0x01080291; const int R::drawable::ic_ab_back_holo_light=0x01080292; const int R::drawable::ic_action_assist_focused=0x01080293; const int R::drawable::ic_action_assist_generic=0x01080294; const int R::drawable::ic_action_assist_generic_activated=0x01080295; const int R::drawable::ic_action_assist_generic_normal=0x01080296; const int R::drawable::ic_aggregated=0x01080297; const int R::drawable::ic_audio_alarm=0x01080298; const int R::drawable::ic_audio_alarm_mute=0x01080299; const int R::drawable::ic_audio_bt=0x0108029a; const int R::drawable::ic_audio_bt_mute=0x0108029b; const int R::drawable::ic_audio_notification=0x0108029c; const int R::drawable::ic_audio_notification_mute=0x0108029d; const int R::drawable::ic_audio_phone=0x0108029e; const int R::drawable::ic_audio_ring_notif=0x0108029f; const int R::drawable::ic_audio_ring_notif_mute=0x010802a0; const int R::drawable::ic_audio_ring_notif_vibrate=0x010802a1; const int R::drawable::ic_audio_vol=0x010802a2; const int R::drawable::ic_audio_vol_mute=0x010802a3; const int R::drawable::ic_btn_round_more=0x010802a4; const int R::drawable::ic_btn_round_more_disabled=0x010802a5; const int R::drawable::ic_btn_round_more_normal=0x010802a6; const int R::drawable::ic_btn_search=0x010802a7; const int R::drawable::ic_btn_search_go=0x010802a8; const int R::drawable::ic_btn_speak_now=0x010800a4; const int R::drawable::ic_btn_square_browser_zoom_fit_page=0x010802a9; const int R::drawable::ic_btn_square_browser_zoom_fit_page_disabled=0x010802aa; const int R::drawable::ic_btn_square_browser_zoom_fit_page_normal=0x010802ab; const int R::drawable::ic_btn_square_browser_zoom_page_overview=0x010802ac; const int R::drawable::ic_btn_square_browser_zoom_page_overview_disabled=0x010802ad; const int R::drawable::ic_btn_square_browser_zoom_page_overview_normal=0x010802ae; const int R::drawable::ic_bullet_key_permission=0x010802af; const int R::drawable::ic_cab_done_holo=0x010802b0; const int R::drawable::ic_cab_done_holo_dark=0x010802b1; const int R::drawable::ic_cab_done_holo_light=0x010802b2; const int R::drawable::ic_checkmark_holo_light=0x010802b3; const int R::drawable::ic_clear=0x010802b4; const int R::drawable::ic_clear_disabled=0x010802b5; const int R::drawable::ic_clear_holo_light=0x010802b6; const int R::drawable::ic_clear_normal=0x010802b7; const int R::drawable::ic_clear_search_api_disabled_holo_light=0x010802b8; const int R::drawable::ic_clear_search_api_holo_light=0x010802b9; const int R::drawable::ic_coins_s=0x010802ba; const int R::drawable::ic_commit=0x010802bb; const int R::drawable::ic_commit_search_api_holo_dark=0x010802bc; const int R::drawable::ic_commit_search_api_holo_light=0x010802bd; const int R::drawable::ic_contact_picture=0x010802be; const int R::drawable::ic_contact_picture_2=0x010802bf; const int R::drawable::ic_contact_picture_3=0x010802c0; const int R::drawable::ic_delete=0x0108001d; const int R::drawable::ic_dialog_alert=0x01080027; const int R::drawable::ic_dialog_alert_holo_dark=0x010802c1; const int R::drawable::ic_dialog_alert_holo_light=0x010802c2; const int R::drawable::ic_dialog_close_normal_holo=0x010802c3; const int R::drawable::ic_dialog_close_pressed_holo=0x010802c4; const int R::drawable::ic_dialog_dialer=0x01080028; const int R::drawable::ic_dialog_email=0x01080029; const int R::drawable::ic_dialog_focused_holo=0x010802c5; const int R::drawable::ic_dialog_info=0x0108009b; const int R::drawable::ic_dialog_map=0x0108002a; const int R::drawable::ic_dialog_time=0x010802c6; const int R::drawable::ic_dialog_usb=0x010802c7; const int R::drawable::ic_emergency=0x010802c8; const int R::drawable::ic_facial_backup=0x010802c9; const int R::drawable::ic_find_next_holo_dark=0x010802ca; const int R::drawable::ic_find_next_holo_light=0x010802cb; const int R::drawable::ic_find_previous_holo_dark=0x010802cc; const int R::drawable::ic_find_previous_holo_light=0x010802cd; const int R::drawable::ic_go=0x010802ce; const int R::drawable::ic_go_search_api_holo_light=0x010802cf; const int R::drawable::ic_input_add=0x0108002b; const int R::drawable::ic_input_delete=0x0108002c; const int R::drawable::ic_input_get=0x0108002d; const int R::drawable::ic_jog_dial_answer=0x010802d0; const int R::drawable::ic_jog_dial_answer_and_end=0x010802d1; const int R::drawable::ic_jog_dial_answer_and_hold=0x010802d2; const int R::drawable::ic_jog_dial_decline=0x010802d3; const int R::drawable::ic_jog_dial_sound_off=0x010802d4; const int R::drawable::ic_jog_dial_sound_on=0x010802d5; const int R::drawable::ic_jog_dial_unlock=0x010802d6; const int R::drawable::ic_jog_dial_vibrate_on=0x010802d7; const int R::drawable::ic_launcher_android=0x010802d8; const int R::drawable::ic_lock_airplane_mode=0x010802d9; const int R::drawable::ic_lock_airplane_mode_off=0x010802da; const int R::drawable::ic_lock_idle_alarm=0x0108002e; const int R::drawable::ic_lock_idle_charging=0x0108001e; const int R::drawable::ic_lock_idle_lock=0x0108001f; const int R::drawable::ic_lock_idle_low_battery=0x01080020; const int R::drawable::ic_lock_lock=0x0108002f; const int R::drawable::ic_lock_power_off=0x01080030; const int R::drawable::ic_lock_ringer_off=0x010802db; const int R::drawable::ic_lock_ringer_on=0x010802dc; const int R::drawable::ic_lock_silent_mode=0x01080031; const int R::drawable::ic_lock_silent_mode_off=0x01080032; const int R::drawable::ic_lock_silent_mode_vibrate=0x010802dd; const int R::drawable::ic_lockscreen_alarm=0x010802de; const int R::drawable::ic_lockscreen_camera=0x010802df; const int R::drawable::ic_lockscreen_camera_activated=0x010802e0; const int R::drawable::ic_lockscreen_camera_normal=0x010802e1; const int R::drawable::ic_lockscreen_emergencycall_normal=0x010802e2; const int R::drawable::ic_lockscreen_emergencycall_pressed=0x010802e3; const int R::drawable::ic_lockscreen_forgotpassword_normal=0x010802e4; const int R::drawable::ic_lockscreen_forgotpassword_pressed=0x010802e5; const int R::drawable::ic_lockscreen_glowdot=0x010802e6; const int R::drawable::ic_lockscreen_google_activated=0x010802e7; const int R::drawable::ic_lockscreen_google_focused=0x010802e8; const int R::drawable::ic_lockscreen_google_normal=0x010802e9; const int R::drawable::ic_lockscreen_handle=0x010802ea; const int R::drawable::ic_lockscreen_handle_normal=0x010802eb; const int R::drawable::ic_lockscreen_handle_pressed=0x010802ec; const int R::drawable::ic_lockscreen_ime=0x010802ed; const int R::drawable::ic_lockscreen_lock_normal=0x010802ee; const int R::drawable::ic_lockscreen_lock_pressed=0x010802ef; const int R::drawable::ic_lockscreen_outerring=0x010802f0; const int R::drawable::ic_lockscreen_player_background=0x010802f1; const int R::drawable::ic_lockscreen_search_activated=0x010802f2; const int R::drawable::ic_lockscreen_search_normal=0x010802f3; const int R::drawable::ic_lockscreen_silent=0x010802f4; const int R::drawable::ic_lockscreen_silent_activated=0x010802f5; const int R::drawable::ic_lockscreen_silent_focused=0x010802f6; const int R::drawable::ic_lockscreen_silent_normal=0x010802f7; const int R::drawable::ic_lockscreen_sim=0x010802f8; const int R::drawable::ic_lockscreen_soundon=0x010802f9; const int R::drawable::ic_lockscreen_soundon_activated=0x010802fa; const int R::drawable::ic_lockscreen_soundon_focused=0x010802fb; const int R::drawable::ic_lockscreen_soundon_normal=0x010802fc; const int R::drawable::ic_lockscreen_unlock=0x010802fd; const int R::drawable::ic_lockscreen_unlock_activated=0x010802fe; const int R::drawable::ic_lockscreen_unlock_normal=0x010802ff; const int R::drawable::ic_lockscreen_unlock_phantom=0x01080300; const int R::drawable::ic_maps_indicator_current_position=0x01080301; const int R::drawable::ic_maps_indicator_current_position_anim=0x01080302; const int R::drawable::ic_maps_indicator_current_position_anim1=0x01080303; const int R::drawable::ic_maps_indicator_current_position_anim2=0x01080304; const int R::drawable::ic_maps_indicator_current_position_anim3=0x01080305; const int R::drawable::ic_media_embed_play=0x01080306; const int R::drawable::ic_media_ff=0x01080021; const int R::drawable::ic_media_fullscreen=0x01080307; const int R::drawable::ic_media_group_collapse=0x01080308; const int R::drawable::ic_media_group_expand=0x01080309; const int R::drawable::ic_media_next=0x01080022; const int R::drawable::ic_media_pause=0x01080023; const int R::drawable::ic_media_play=0x01080024; const int R::drawable::ic_media_previous=0x01080025; const int R::drawable::ic_media_rew=0x01080026; const int R::drawable::ic_media_route_connecting_holo_dark=0x0108030a; const int R::drawable::ic_media_route_connecting_holo_light=0x0108030b; const int R::drawable::ic_media_route_disabled_holo_dark=0x0108030c; const int R::drawable::ic_media_route_disabled_holo_light=0x0108030d; const int R::drawable::ic_media_route_holo_dark=0x0108030e; const int R::drawable::ic_media_route_holo_light=0x0108030f; const int R::drawable::ic_media_route_off_holo_dark=0x01080310; const int R::drawable::ic_media_route_off_holo_light=0x01080311; const int R::drawable::ic_media_route_on_0_holo_dark=0x01080312; const int R::drawable::ic_media_route_on_0_holo_light=0x01080313; const int R::drawable::ic_media_route_on_1_holo_dark=0x01080314; const int R::drawable::ic_media_route_on_1_holo_light=0x01080315; const int R::drawable::ic_media_route_on_2_holo_dark=0x01080316; const int R::drawable::ic_media_route_on_2_holo_light=0x01080317; const int R::drawable::ic_media_route_on_holo_dark=0x01080318; const int R::drawable::ic_media_route_on_holo_light=0x01080319; const int R::drawable::ic_media_stop=0x0108031a; const int R::drawable::ic_media_video_poster=0x0108031b; const int R::drawable::ic_menu_account_list=0x0108031c; const int R::drawable::ic_menu_add=0x01080033; const int R::drawable::ic_menu_agenda=0x01080034; const int R::drawable::ic_menu_allfriends=0x0108031d; const int R::drawable::ic_menu_always_landscape_portrait=0x01080035; const int R::drawable::ic_menu_archive=0x0108031e; const int R::drawable::ic_menu_attachment=0x0108031f; const int R::drawable::ic_menu_back=0x01080320; const int R::drawable::ic_menu_block=0x01080321; const int R::drawable::ic_menu_blocked_user=0x01080322; const int R::drawable::ic_menu_btn_add=0x01080323; const int R::drawable::ic_menu_call=0x01080036; const int R::drawable::ic_menu_camera=0x01080037; const int R::drawable::ic_menu_cc=0x01080324; const int R::drawable::ic_menu_chat_dashboard=0x01080325; const int R::drawable::ic_menu_clear_playlist=0x01080326; const int R::drawable::ic_menu_close_clear_cancel=0x01080038; const int R::drawable::ic_menu_compass=0x01080039; const int R::drawable::ic_menu_compose=0x01080327; const int R::drawable::ic_menu_copy=0x01080328; const int R::drawable::ic_menu_copy_holo_dark=0x01080329; const int R::drawable::ic_menu_copy_holo_light=0x0108032a; const int R::drawable::ic_menu_crop=0x0108003a; const int R::drawable::ic_menu_cut=0x0108032b; const int R::drawable::ic_menu_cut_holo_dark=0x0108032c; const int R::drawable::ic_menu_cut_holo_light=0x0108032d; const int R::drawable::ic_menu_day=0x0108003b; const int R::drawable::ic_menu_delete=0x0108003c; const int R::drawable::ic_menu_directions=0x0108003d; const int R::drawable::ic_menu_edit=0x0108003e; const int R::drawable::ic_menu_emoticons=0x0108032e; const int R::drawable::ic_menu_end_conversation=0x0108032f; const int R::drawable::ic_menu_find=0x01080330; const int R::drawable::ic_menu_find_holo_dark=0x01080331; const int R::drawable::ic_menu_find_holo_light=0x01080332; const int R::drawable::ic_menu_forward=0x01080333; const int R::drawable::ic_menu_friendslist=0x01080334; const int R::drawable::ic_menu_gallery=0x0108003f; const int R::drawable::ic_menu_goto=0x01080335; const int R::drawable::ic_menu_help=0x01080040; const int R::drawable::ic_menu_help_holo_light=0x01080336; const int R::drawable::ic_menu_home=0x01080337; const int R::drawable::ic_menu_info_details=0x01080041; const int R::drawable::ic_menu_invite=0x01080338; const int R::drawable::ic_menu_login=0x01080339; const int R::drawable::ic_menu_manage=0x01080042; const int R::drawable::ic_menu_mapmode=0x01080043; const int R::drawable::ic_menu_mark=0x0108033a; const int R::drawable::ic_menu_month=0x01080044; const int R::drawable::ic_menu_more=0x01080045; const int R::drawable::ic_menu_moreoverflow=0x0108033b; const int R::drawable::ic_menu_moreoverflow_focused_holo_dark=0x0108033c; const int R::drawable::ic_menu_moreoverflow_focused_holo_light=0x0108033d; const int R::drawable::ic_menu_moreoverflow_holo_dark=0x0108033e; const int R::drawable::ic_menu_moreoverflow_holo_light=0x0108033f; const int R::drawable::ic_menu_moreoverflow_normal_holo_dark=0x01080340; const int R::drawable::ic_menu_moreoverflow_normal_holo_light=0x01080341; const int R::drawable::ic_menu_my_calendar=0x01080046; const int R::drawable::ic_menu_mylocation=0x01080047; const int R::drawable::ic_menu_myplaces=0x01080048; const int R::drawable::ic_menu_notifications=0x01080342; const int R::drawable::ic_menu_paste=0x01080343; const int R::drawable::ic_menu_paste_holo_dark=0x01080344; const int R::drawable::ic_menu_paste_holo_light=0x01080345; const int R::drawable::ic_menu_play_clip=0x01080346; const int R::drawable::ic_menu_preferences=0x01080049; const int R::drawable::ic_menu_recent_history=0x0108004a; const int R::drawable::ic_menu_refresh=0x01080347; const int R::drawable::ic_menu_report_image=0x0108004b; const int R::drawable::ic_menu_revert=0x0108004c; const int R::drawable::ic_menu_rotate=0x0108004d; const int R::drawable::ic_menu_save=0x0108004e; const int R::drawable::ic_menu_search=0x0108004f; const int R::drawable::ic_menu_search_holo_dark=0x01080348; const int R::drawable::ic_menu_search_holo_light=0x01080349; const int R::drawable::ic_menu_selectall_holo_dark=0x0108034a; const int R::drawable::ic_menu_selectall_holo_light=0x0108034b; const int R::drawable::ic_menu_send=0x01080050; const int R::drawable::ic_menu_set_as=0x01080051; const int R::drawable::ic_menu_settings_holo_light=0x0108034c; const int R::drawable::ic_menu_share=0x01080052; const int R::drawable::ic_menu_share_holo_dark=0x0108034d; const int R::drawable::ic_menu_share_holo_light=0x0108034e; const int R::drawable::ic_menu_slideshow=0x01080053; const int R::drawable::ic_menu_sort_alphabetically=0x0108009c; const int R::drawable::ic_menu_sort_by_size=0x0108009d; const int R::drawable::ic_menu_star=0x0108034f; const int R::drawable::ic_menu_start_conversation=0x01080350; const int R::drawable::ic_menu_stop=0x01080351; const int R::drawable::ic_menu_today=0x01080054; const int R::drawable::ic_menu_upload=0x01080055; const int R::drawable::ic_menu_upload_you_tube=0x01080056; const int R::drawable::ic_menu_view=0x01080057; const int R::drawable::ic_menu_week=0x01080058; const int R::drawable::ic_menu_zoom=0x01080059; const int R::drawable::ic_notification_clear_all=0x0108005a; const int R::drawable::ic_notification_ime_default=0x01080352; const int R::drawable::ic_notification_overlay=0x0108005b; const int R::drawable::ic_notify_wifidisplay=0x01080353; const int R::drawable::ic_partial_secure=0x0108005c; const int R::drawable::ic_popup_disk_full=0x0108005d; const int R::drawable::ic_popup_reminder=0x0108005e; const int R::drawable::ic_popup_sync=0x0108005f; const int R::drawable::ic_popup_sync_1=0x01080354; const int R::drawable::ic_popup_sync_2=0x01080355; const int R::drawable::ic_popup_sync_3=0x01080356; const int R::drawable::ic_popup_sync_4=0x01080357; const int R::drawable::ic_popup_sync_5=0x01080358; const int R::drawable::ic_popup_sync_6=0x01080359; const int R::drawable::ic_search=0x0108035a; const int R::drawable::ic_search_api_holo_light=0x0108035b; const int R::drawable::ic_search_category_default=0x01080060; const int R::drawable::ic_secure=0x01080061; const int R::drawable::ic_settings_language=0x0108035c; const int R::drawable::ic_sysbar_quicksettings=0x0108035d; const int R::drawable::ic_text_dot=0x0108035e; const int R::drawable::ic_vibrate=0x0108035f; const int R::drawable::ic_vibrate_small=0x01080360; const int R::drawable::ic_voice_search=0x01080361; const int R::drawable::ic_voice_search_api_holo_light=0x01080362; const int R::drawable::ic_volume=0x01080363; const int R::drawable::ic_volume_bluetooth_ad2p=0x01080364; const int R::drawable::ic_volume_bluetooth_in_call=0x01080365; const int R::drawable::ic_volume_off=0x01080366; const int R::drawable::ic_volume_off_small=0x01080367; const int R::drawable::ic_volume_small=0x01080368; const int R::drawable::icon_highlight_rectangle=0x01080369; const int R::drawable::icon_highlight_square=0x0108036a; const int R::drawable::ime_qwerty=0x0108036b; const int R::drawable::indicator_check_mark_dark=0x0108036c; const int R::drawable::indicator_check_mark_light=0x0108036d; const int R::drawable::indicator_code_lock_drag_direction_green_up=0x0108036e; const int R::drawable::indicator_code_lock_drag_direction_red_up=0x0108036f; const int R::drawable::indicator_code_lock_point_area_default=0x01080370; const int R::drawable::indicator_code_lock_point_area_default_holo=0x01080371; const int R::drawable::indicator_code_lock_point_area_green=0x01080372; const int R::drawable::indicator_code_lock_point_area_green_holo=0x01080373; const int R::drawable::indicator_code_lock_point_area_red=0x01080374; const int R::drawable::indicator_code_lock_point_area_red_holo=0x01080375; const int R::drawable::indicator_input_error=0x01080376; const int R::drawable::input_method_fullscreen_background=0x01080610; const int R::drawable::input_method_fullscreen_background_holo=0x01080611; const int R::drawable::intro_bg=0x01080377; const int R::drawable::item_background=0x01080378; const int R::drawable::item_background_activated_holo_dark=0x01080379; const int R::drawable::item_background_holo_dark=0x0108037a; const int R::drawable::item_background_holo_light=0x0108037b; const int R::drawable::jog_dial_arrow_long_left_green=0x0108037c; const int R::drawable::jog_dial_arrow_long_left_yellow=0x0108037d; const int R::drawable::jog_dial_arrow_long_middle_yellow=0x0108037e; const int R::drawable::jog_dial_arrow_long_right_red=0x0108037f; const int R::drawable::jog_dial_arrow_long_right_yellow=0x01080380; const int R::drawable::jog_dial_arrow_short_left=0x01080381; const int R::drawable::jog_dial_arrow_short_left_and_right=0x01080382; const int R::drawable::jog_dial_arrow_short_right=0x01080383; const int R::drawable::jog_dial_bg=0x01080384; const int R::drawable::jog_dial_dimple=0x01080385; const int R::drawable::jog_dial_dimple_dim=0x01080386; const int R::drawable::jog_tab_bar_left_answer=0x01080387; const int R::drawable::jog_tab_bar_left_end_confirm_gray=0x01080388; const int R::drawable::jog_tab_bar_left_end_confirm_green=0x01080389; const int R::drawable::jog_tab_bar_left_end_confirm_red=0x0108038a; const int R::drawable::jog_tab_bar_left_end_confirm_yellow=0x0108038b; const int R::drawable::jog_tab_bar_left_end_normal=0x0108038c; const int R::drawable::jog_tab_bar_left_end_pressed=0x0108038d; const int R::drawable::jog_tab_bar_left_generic=0x0108038e; const int R::drawable::jog_tab_bar_left_unlock=0x0108038f; const int R::drawable::jog_tab_bar_right_decline=0x01080390; const int R::drawable::jog_tab_bar_right_end_confirm_gray=0x01080391; const int R::drawable::jog_tab_bar_right_end_confirm_green=0x01080392; const int R::drawable::jog_tab_bar_right_end_confirm_red=0x01080393; const int R::drawable::jog_tab_bar_right_end_confirm_yellow=0x01080394; const int R::drawable::jog_tab_bar_right_end_normal=0x01080395; const int R::drawable::jog_tab_bar_right_end_pressed=0x01080396; const int R::drawable::jog_tab_bar_right_generic=0x01080397; const int R::drawable::jog_tab_bar_right_sound_off=0x01080398; const int R::drawable::jog_tab_bar_right_sound_on=0x01080399; const int R::drawable::jog_tab_left_answer=0x0108039a; const int R::drawable::jog_tab_left_confirm_gray=0x0108039b; const int R::drawable::jog_tab_left_confirm_green=0x0108039c; const int R::drawable::jog_tab_left_confirm_red=0x0108039d; const int R::drawable::jog_tab_left_confirm_yellow=0x0108039e; const int R::drawable::jog_tab_left_generic=0x0108039f; const int R::drawable::jog_tab_left_normal=0x010803a0; const int R::drawable::jog_tab_left_pressed=0x010803a1; const int R::drawable::jog_tab_left_unlock=0x010803a2; const int R::drawable::jog_tab_right_confirm_gray=0x010803a3; const int R::drawable::jog_tab_right_confirm_green=0x010803a4; const int R::drawable::jog_tab_right_confirm_red=0x010803a5; const int R::drawable::jog_tab_right_confirm_yellow=0x010803a6; const int R::drawable::jog_tab_right_decline=0x010803a7; const int R::drawable::jog_tab_right_generic=0x010803a8; const int R::drawable::jog_tab_right_normal=0x010803a9; const int R::drawable::jog_tab_right_pressed=0x010803aa; const int R::drawable::jog_tab_right_sound_off=0x010803ab; const int R::drawable::jog_tab_right_sound_on=0x010803ac; const int R::drawable::jog_tab_target_gray=0x010803ad; const int R::drawable::jog_tab_target_green=0x010803ae; const int R::drawable::jog_tab_target_red=0x010803af; const int R::drawable::jog_tab_target_yellow=0x010803b0; const int R::drawable::keyboard_accessory_bg_landscape=0x010803b1; const int R::drawable::keyboard_background=0x010803b2; const int R::drawable::keyboard_key_feedback=0x010803b3; const int R::drawable::keyboard_key_feedback_background=0x010803b4; const int R::drawable::keyboard_key_feedback_more_background=0x010803b5; const int R::drawable::keyboard_popup_panel_background=0x010803b6; const int R::drawable::keyboard_popup_panel_trans_background=0x010803b7; const int R::drawable::keyguard_expand_challenge_handle=0x010803b8; const int R::drawable::kg_add_widget=0x010803b9; const int R::drawable::kg_bouncer_bg_white=0x010803ba; const int R::drawable::kg_security_grip=0x010803bb; const int R::drawable::kg_security_lock=0x010803bc; const int R::drawable::kg_security_lock_focused=0x010803bd; const int R::drawable::kg_security_lock_normal=0x010803be; const int R::drawable::kg_security_lock_pressed=0x010803bf; const int R::drawable::kg_widget_bg_padded=0x010803c0; const int R::drawable::kg_widget_delete_drop_target=0x010803c1; const int R::drawable::light_header=0x010803c2; const int R::drawable::light_header_dither=0x010803c3; const int R::drawable::list_activated_holo=0x010803c4; const int R::drawable::list_divider_holo_dark=0x010803c5; const int R::drawable::list_divider_holo_light=0x010803c6; const int R::drawable::list_divider_horizontal_holo_dark=0x010803c7; const int R::drawable::list_focused_holo=0x010803c8; const int R::drawable::list_highlight=0x010803c9; const int R::drawable::list_highlight_active=0x010803ca; const int R::drawable::list_highlight_inactive=0x010803cb; const int R::drawable::list_longpressed_holo=0x010803cc; const int R::drawable::list_pressed_holo_dark=0x010803cd; const int R::drawable::list_pressed_holo_light=0x010803ce; const int R::drawable::list_section_divider_holo_dark=0x010803cf; const int R::drawable::list_section_divider_holo_light=0x010803d0; const int R::drawable::list_section_header_holo_dark=0x010803d1; const int R::drawable::list_section_header_holo_light=0x010803d2; const int R::drawable::list_selected_background=0x010803d3; const int R::drawable::list_selected_background_light=0x010803d4; const int R::drawable::list_selected_holo_dark=0x010803d5; const int R::drawable::list_selected_holo_light=0x010803d6; const int R::drawable::list_selector_activated_holo_dark=0x010803d7; const int R::drawable::list_selector_activated_holo_light=0x010803d8; const int R::drawable::list_selector_background=0x01080062; const int R::drawable::list_selector_background_default=0x010803d9; const int R::drawable::list_selector_background_default_light=0x010803da; const int R::drawable::list_selector_background_disabled=0x010803db; const int R::drawable::list_selector_background_disabled_light=0x010803dc; const int R::drawable::list_selector_background_focus=0x010803dd; const int R::drawable::list_selector_background_focused=0x010803de; const int R::drawable::list_selector_background_focused_light=0x010803df; const int R::drawable::list_selector_background_focused_selected=0x010803e0; const int R::drawable::list_selector_background_light=0x010803e1; const int R::drawable::list_selector_background_longpress=0x010803e2; const int R::drawable::list_selector_background_longpress_light=0x010803e3; const int R::drawable::list_selector_background_pressed=0x010803e4; const int R::drawable::list_selector_background_pressed_light=0x010803e5; const int R::drawable::list_selector_background_selected=0x010803e6; const int R::drawable::list_selector_background_selected_light=0x010803e7; const int R::drawable::list_selector_background_transition=0x010803e8; const int R::drawable::list_selector_background_transition_holo_dark=0x010803e9; const int R::drawable::list_selector_background_transition_holo_light=0x010803ea; const int R::drawable::list_selector_background_transition_light=0x010803eb; const int R::drawable::list_selector_disabled_holo_dark=0x010803ec; const int R::drawable::list_selector_disabled_holo_light=0x010803ed; const int R::drawable::list_selector_focused_holo_dark=0x010803ee; const int R::drawable::list_selector_focused_holo_light=0x010803ef; const int R::drawable::list_selector_holo_dark=0x010803f0; const int R::drawable::list_selector_holo_light=0x010803f1; const int R::drawable::list_selector_multiselect_holo_dark=0x010803f2; const int R::drawable::list_selector_multiselect_holo_light=0x010803f3; const int R::drawable::list_selector_pressed_holo_dark=0x010803f4; const int R::drawable::list_selector_pressed_holo_light=0x010803f5; const int R::drawable::load_average_background=0x010803f6; const int R::drawable::loading_tile=0x010803f7; const int R::drawable::loading_tile_android=0x010803f8; const int R::drawable::lockscreen_emergency_button=0x010803f9; const int R::drawable::lockscreen_forgot_password_button=0x010803fa; const int R::drawable::lockscreen_password_field_dark=0x010803fb; const int R::drawable::lockscreen_protection_pattern=0x010803fc; const int R::drawable::magnified_region_frame=0x010803fd; const int R::drawable::maps_google_logo=0x010803fe; const int R::drawable::media_button_background=0x010803ff; const int R::drawable::menu_background=0x01080400; const int R::drawable::menu_background_fill_parent_width=0x01080401; const int R::drawable::menu_dropdown_panel_holo_dark=0x01080402; const int R::drawable::menu_dropdown_panel_holo_light=0x01080403; const int R::drawable::menu_frame=0x01080063; const int R::drawable::menu_full_frame=0x01080064; const int R::drawable::menu_hardkey_panel_holo_dark=0x01080404; const int R::drawable::menu_hardkey_panel_holo_light=0x01080405; const int R::drawable::menu_selector=0x01080406; const int R::drawable::menu_separator=0x01080407; const int R::drawable::menu_submenu_background=0x01080408; const int R::drawable::menuitem_background=0x01080065; const int R::drawable::menuitem_background_focus=0x01080409; const int R::drawable::menuitem_background_pressed=0x0108040a; const int R::drawable::menuitem_background_solid=0x0108040b; const int R::drawable::menuitem_background_solid_focused=0x0108040c; const int R::drawable::menuitem_background_solid_pressed=0x0108040d; const int R::drawable::menuitem_checkbox=0x0108040e; const int R::drawable::menuitem_checkbox_on=0x0108040f; const int R::drawable::minitab_lt=0x01080410; const int R::drawable::minitab_lt_focus=0x01080411; const int R::drawable::minitab_lt_press=0x01080412; const int R::drawable::minitab_lt_selected=0x01080413; const int R::drawable::minitab_lt_unselected=0x01080414; const int R::drawable::minitab_lt_unselected_press=0x01080415; const int R::drawable::no_tile_128=0x01080416; const int R::drawable::no_tile_256=0x01080417; const int R::drawable::notification_bg=0x01080418; const int R::drawable::notification_bg_low=0x01080419; const int R::drawable::notification_bg_low_normal=0x0108041a; const int R::drawable::notification_bg_low_pressed=0x0108041b; const int R::drawable::notification_bg_normal=0x0108041c; const int R::drawable::notification_bg_normal_pressed=0x0108041d; const int R::drawable::notification_item_background_color=0x0108060c; const int R::drawable::notification_item_background_color_pressed=0x0108060d; const int R::drawable::notification_template_icon_bg=0x01080615; const int R::drawable::notification_template_icon_low_bg=0x01080616; const int R::drawable::notify_panel_notification_icon_bg=0x0108041e; const int R::drawable::notify_panel_notification_icon_bg_tile=0x0108041f; const int R::drawable::numberpicker_down_btn=0x01080420; const int R::drawable::numberpicker_down_disabled=0x01080421; const int R::drawable::numberpicker_down_disabled_focused=0x01080422; const int R::drawable::numberpicker_down_normal=0x01080423; const int R::drawable::numberpicker_down_pressed=0x01080424; const int R::drawable::numberpicker_down_selected=0x01080425; const int R::drawable::numberpicker_input=0x01080426; const int R::drawable::numberpicker_input_disabled=0x01080427; const int R::drawable::numberpicker_input_normal=0x01080428; const int R::drawable::numberpicker_input_pressed=0x01080429; const int R::drawable::numberpicker_input_selected=0x0108042a; const int R::drawable::numberpicker_selection_divider=0x0108042b; const int R::drawable::numberpicker_up_btn=0x0108042c; const int R::drawable::numberpicker_up_disabled=0x0108042d; const int R::drawable::numberpicker_up_disabled_focused=0x0108042e; const int R::drawable::numberpicker_up_normal=0x0108042f; const int R::drawable::numberpicker_up_pressed=0x01080430; const int R::drawable::numberpicker_up_selected=0x01080431; const int R::drawable::overscroll_edge=0x01080432; const int R::drawable::overscroll_glow=0x01080433; const int R::drawable::panel_background=0x01080434; const int R::drawable::panel_bg_holo_dark=0x01080435; const int R::drawable::panel_bg_holo_light=0x01080436; const int R::drawable::panel_picture_frame_background=0x01080437; const int R::drawable::panel_picture_frame_bg_focus_blue=0x01080438; const int R::drawable::panel_picture_frame_bg_normal=0x01080439; const int R::drawable::panel_picture_frame_bg_pressed_blue=0x0108043a; const int R::drawable::password_field_default=0x0108043b; const int R::drawable::password_keyboard_background_holo=0x0108043c; const int R::drawable::perm_group_accounts=0x0108043d; const int R::drawable::perm_group_affects_battery=0x0108043e; const int R::drawable::perm_group_app_info=0x0108043f; const int R::drawable::perm_group_audio_settings=0x01080440; const int R::drawable::perm_group_bluetooth=0x01080441; const int R::drawable::perm_group_bookmarks=0x01080442; const int R::drawable::perm_group_calendar=0x01080443; const int R::drawable::perm_group_camera=0x01080444; const int R::drawable::perm_group_device_alarms=0x01080445; const int R::drawable::perm_group_display=0x01080446; const int R::drawable::perm_group_location=0x01080447; const int R::drawable::perm_group_messages=0x01080448; const int R::drawable::perm_group_microphone=0x01080449; const int R::drawable::perm_group_network=0x0108044a; const int R::drawable::perm_group_personal_info=0x0108044b; const int R::drawable::perm_group_phone_calls=0x0108044c; const int R::drawable::perm_group_screenlock=0x0108044d; const int R::drawable::perm_group_shortrange_network=0x0108044e; const int R::drawable::perm_group_social_info=0x0108044f; const int R::drawable::perm_group_status_bar=0x01080450; const int R::drawable::perm_group_storage=0x01080451; const int R::drawable::perm_group_sync_settings=0x01080452; const int R::drawable::perm_group_system_clock=0x01080453; const int R::drawable::perm_group_system_tools=0x01080454; const int R::drawable::perm_group_user_dictionary=0x01080455; const int R::drawable::perm_group_user_dictionary_write=0x01080456; const int R::drawable::perm_group_voicemail=0x01080457; const int R::drawable::perm_group_wallpaper=0x01080458; const int R::drawable::picture_emergency=0x01080459; const int R::drawable::picture_frame=0x01080066; const int R::drawable::platlogo=0x0108045a; const int R::drawable::platlogo_alt=0x0108045b; const int R::drawable::pointer_arrow=0x0108045c; const int R::drawable::pointer_arrow_icon=0x0108045d; const int R::drawable::pointer_spot_anchor=0x0108045e; const int R::drawable::pointer_spot_anchor_icon=0x0108045f; const int R::drawable::pointer_spot_hover=0x01080460; const int R::drawable::pointer_spot_hover_icon=0x01080461; const int R::drawable::pointer_spot_touch=0x01080462; const int R::drawable::pointer_spot_touch_icon=0x01080463; const int R::drawable::popup_bottom_bright=0x01080464; const int R::drawable::popup_bottom_dark=0x01080465; const int R::drawable::popup_bottom_medium=0x01080466; const int R::drawable::popup_center_bright=0x01080467; const int R::drawable::popup_center_dark=0x01080468; const int R::drawable::popup_center_medium=0x01080469; const int R::drawable::popup_full_bright=0x0108046a; const int R::drawable::popup_full_dark=0x0108046b; const int R::drawable::popup_inline_error=0x0108046c; const int R::drawable::popup_inline_error_above=0x0108046d; const int R::drawable::popup_inline_error_above_holo_dark=0x0108046e; const int R::drawable::popup_inline_error_above_holo_light=0x0108046f; const int R::drawable::popup_inline_error_holo_dark=0x01080470; const int R::drawable::popup_inline_error_holo_light=0x01080471; const int R::drawable::popup_top_bright=0x01080472; const int R::drawable::popup_top_dark=0x01080473; const int R::drawable::presence_audio_away=0x010800af; const int R::drawable::presence_audio_busy=0x010800b0; const int R::drawable::presence_audio_online=0x010800b1; const int R::drawable::presence_away=0x01080067; const int R::drawable::presence_busy=0x01080068; const int R::drawable::presence_invisible=0x01080069; const int R::drawable::presence_offline=0x0108006a; const int R::drawable::presence_online=0x0108006b; const int R::drawable::presence_video_away=0x010800ac; const int R::drawable::presence_video_busy=0x010800ad; const int R::drawable::presence_video_online=0x010800ae; const int R::drawable::pressed_application_background_static=0x01080474; const int R::drawable::progress_bg_holo_dark=0x01080475; const int R::drawable::progress_bg_holo_light=0x01080476; const int R::drawable::progress_horizontal=0x0108006c; const int R::drawable::progress_horizontal_holo_dark=0x01080477; const int R::drawable::progress_horizontal_holo_light=0x01080478; const int R::drawable::progress_indeterminate_horizontal=0x0108006d; const int R::drawable::progress_indeterminate_horizontal_holo=0x01080479; const int R::drawable::progress_large=0x0108047a; const int R::drawable::progress_large_holo=0x0108047b; const int R::drawable::progress_large_white=0x0108047c; const int R::drawable::progress_medium=0x0108047d; const int R::drawable::progress_medium_holo=0x0108047e; const int R::drawable::progress_medium_white=0x0108047f; const int R::drawable::progress_primary_holo_dark=0x01080480; const int R::drawable::progress_primary_holo_light=0x01080481; const int R::drawable::progress_secondary_holo_dark=0x01080482; const int R::drawable::progress_secondary_holo_light=0x01080483; const int R::drawable::progress_small=0x01080484; const int R::drawable::progress_small_holo=0x01080485; const int R::drawable::progress_small_titlebar=0x01080486; const int R::drawable::progress_small_white=0x01080487; const int R::drawable::progressbar_indeterminate1=0x01080488; const int R::drawable::progressbar_indeterminate2=0x01080489; const int R::drawable::progressbar_indeterminate3=0x0108048a; const int R::drawable::progressbar_indeterminate_holo1=0x0108048b; const int R::drawable::progressbar_indeterminate_holo2=0x0108048c; const int R::drawable::progressbar_indeterminate_holo3=0x0108048d; const int R::drawable::progressbar_indeterminate_holo4=0x0108048e; const int R::drawable::progressbar_indeterminate_holo5=0x0108048f; const int R::drawable::progressbar_indeterminate_holo6=0x01080490; const int R::drawable::progressbar_indeterminate_holo7=0x01080491; const int R::drawable::progressbar_indeterminate_holo8=0x01080492; const int R::drawable::quickactions_arrowdown_left_holo_dark=0x01080493; const int R::drawable::quickactions_arrowdown_left_holo_light=0x01080494; const int R::drawable::quickactions_arrowdown_right_holo_dark=0x01080495; const int R::drawable::quickactions_arrowdown_right_holo_light=0x01080496; const int R::drawable::quickactions_arrowup_left_holo_dark=0x01080497; const int R::drawable::quickactions_arrowup_left_holo_light=0x01080498; const int R::drawable::quickactions_arrowup_left_right_holo_dark=0x01080499; const int R::drawable::quickactions_arrowup_right_holo_light=0x0108049a; const int R::drawable::quickcontact_badge_overlay_dark=0x0108049b; const int R::drawable::quickcontact_badge_overlay_focused_dark=0x0108049c; const int R::drawable::quickcontact_badge_overlay_focused_light=0x0108049d; const int R::drawable::quickcontact_badge_overlay_light=0x0108049e; const int R::drawable::quickcontact_badge_overlay_normal_dark=0x0108049f; const int R::drawable::quickcontact_badge_overlay_normal_light=0x010804a0; const int R::drawable::quickcontact_badge_overlay_pressed_dark=0x010804a1; const int R::drawable::quickcontact_badge_overlay_pressed_light=0x010804a2; const int R::drawable::radiobutton_off_background=0x0108006e; const int R::drawable::radiobutton_on_background=0x0108006f; const int R::drawable::rate_star_big_half=0x010804a3; const int R::drawable::rate_star_big_half_holo_dark=0x010804a4; const int R::drawable::rate_star_big_half_holo_light=0x010804a5; const int R::drawable::rate_star_big_off=0x010804a6; const int R::drawable::rate_star_big_off_holo_dark=0x010804a7; const int R::drawable::rate_star_big_off_holo_light=0x010804a8; const int R::drawable::rate_star_big_on=0x010804a9; const int R::drawable::rate_star_big_on_holo_dark=0x010804aa; const int R::drawable::rate_star_big_on_holo_light=0x010804ab; const int R::drawable::rate_star_med_half=0x010804ac; const int R::drawable::rate_star_med_half_holo_dark=0x010804ad; const int R::drawable::rate_star_med_half_holo_light=0x010804ae; const int R::drawable::rate_star_med_off=0x010804af; const int R::drawable::rate_star_med_off_holo_dark=0x010804b0; const int R::drawable::rate_star_med_off_holo_light=0x010804b1; const int R::drawable::rate_star_med_on=0x010804b2; const int R::drawable::rate_star_med_on_holo_dark=0x010804b3; const int R::drawable::rate_star_med_on_holo_light=0x010804b4; const int R::drawable::rate_star_small_half=0x010804b5; const int R::drawable::rate_star_small_half_holo_dark=0x010804b6; const int R::drawable::rate_star_small_half_holo_light=0x010804b7; const int R::drawable::rate_star_small_off=0x010804b8; const int R::drawable::rate_star_small_off_holo_dark=0x010804b9; const int R::drawable::rate_star_small_off_holo_light=0x010804ba; const int R::drawable::rate_star_small_on=0x010804bb; const int R::drawable::rate_star_small_on_holo_dark=0x010804bc; const int R::drawable::rate_star_small_on_holo_light=0x010804bd; const int R::drawable::ratingbar=0x010804be; const int R::drawable::ratingbar_full=0x010804bf; const int R::drawable::ratingbar_full_empty=0x010804c0; const int R::drawable::ratingbar_full_empty_holo_dark=0x010804c1; const int R::drawable::ratingbar_full_empty_holo_light=0x010804c2; const int R::drawable::ratingbar_full_filled=0x010804c3; const int R::drawable::ratingbar_full_filled_holo_dark=0x010804c4; const int R::drawable::ratingbar_full_filled_holo_light=0x010804c5; const int R::drawable::ratingbar_full_holo_dark=0x010804c6; const int R::drawable::ratingbar_full_holo_light=0x010804c7; const int R::drawable::ratingbar_holo_dark=0x010804c8; const int R::drawable::ratingbar_holo_light=0x010804c9; const int R::drawable::ratingbar_small=0x010804ca; const int R::drawable::ratingbar_small_holo_dark=0x010804cb; const int R::drawable::ratingbar_small_holo_light=0x010804cc; const int R::drawable::recent_dialog_background=0x010804cd; const int R::drawable::reticle=0x010804ce; const int R::drawable::safe_mode_background=0x0108060f; const int R::drawable::screen_background_dark=0x01080098; const int R::drawable::screen_background_dark_transparent=0x010800a9; const int R::drawable::screen_background_holo_dark=0x01080614; const int R::drawable::screen_background_holo_light=0x01080613; const int R::drawable::screen_background_light=0x01080099; const int R::drawable::screen_background_light_transparent=0x010800aa; const int R::drawable::screen_background_selector_dark=0x010804cf; const int R::drawable::screen_background_selector_light=0x010804d0; const int R::drawable::scrollbar_handle_accelerated_anim2=0x010804d1; const int R::drawable::scrollbar_handle_holo_dark=0x010804d2; const int R::drawable::scrollbar_handle_holo_light=0x010804d3; const int R::drawable::scrollbar_handle_horizontal=0x010804d4; const int R::drawable::scrollbar_handle_vertical=0x010804d5; const int R::drawable::scrubber_control_disabled_holo=0x010804d6; const int R::drawable::scrubber_control_focused_holo=0x010804d7; const int R::drawable::scrubber_control_normal_holo=0x010804d8; const int R::drawable::scrubber_control_pressed_holo=0x010804d9; const int R::drawable::scrubber_control_selector_holo=0x010804da; const int R::drawable::scrubber_primary_holo=0x010804db; const int R::drawable::scrubber_progress_horizontal_holo_dark=0x010804dc; const int R::drawable::scrubber_progress_horizontal_holo_light=0x010804dd; const int R::drawable::scrubber_secondary_holo=0x010804de; const int R::drawable::scrubber_track_holo_dark=0x010804df; const int R::drawable::scrubber_track_holo_light=0x010804e0; const int R::drawable::search_bar_default_color=0x0108060e; const int R::drawable::search_dropdown_background=0x010804e1; const int R::drawable::search_dropdown_dark=0x010804e2; const int R::drawable::search_dropdown_light=0x010804e3; const int R::drawable::search_plate=0x010804e4; const int R::drawable::search_plate_global=0x010804e5; const int R::drawable::search_spinner=0x010804e6; const int R::drawable::seek_thumb=0x010804e7; const int R::drawable::seek_thumb_normal=0x010804e8; const int R::drawable::seek_thumb_pressed=0x010804e9; const int R::drawable::seek_thumb_selected=0x010804ea; const int R::drawable::selected_day_background=0x01080612; const int R::drawable::settings_header=0x010804eb; const int R::drawable::settings_header_raw=0x010804ec; const int R::drawable::silent_mode_indicator=0x010804ed; const int R::drawable::spinner_16_inner_holo=0x010804ee; const int R::drawable::spinner_16_outer_holo=0x010804ef; const int R::drawable::spinner_20_inner_holo=0x010804f0; const int R::drawable::spinner_20_outer_holo=0x010804f1; const int R::drawable::spinner_48_inner_holo=0x010804f2; const int R::drawable::spinner_48_outer_holo=0x010804f3; const int R::drawable::spinner_76_inner_holo=0x010804f4; const int R::drawable::spinner_76_outer_holo=0x010804f5; const int R::drawable::spinner_ab_default_holo_dark=0x010804f6; const int R::drawable::spinner_ab_default_holo_light=0x010804f7; const int R::drawable::spinner_ab_disabled_holo_dark=0x010804f8; const int R::drawable::spinner_ab_disabled_holo_light=0x010804f9; const int R::drawable::spinner_ab_focused_holo_dark=0x010804fa; const int R::drawable::spinner_ab_focused_holo_light=0x010804fb; const int R::drawable::spinner_ab_holo_dark=0x010804fc; const int R::drawable::spinner_ab_holo_light=0x010804fd; const int R::drawable::spinner_ab_pressed_holo_dark=0x010804fe; const int R::drawable::spinner_ab_pressed_holo_light=0x010804ff; const int R::drawable::spinner_background=0x01080070; const int R::drawable::spinner_background_holo_dark=0x01080500; const int R::drawable::spinner_background_holo_light=0x01080501; const int R::drawable::spinner_black_16=0x01080502; const int R::drawable::spinner_black_20=0x01080503; const int R::drawable::spinner_black_48=0x01080504; const int R::drawable::spinner_black_76=0x01080505; const int R::drawable::spinner_default_holo_dark=0x01080506; const int R::drawable::spinner_default_holo_light=0x01080507; const int R::drawable::spinner_disabled_holo_dark=0x01080508; const int R::drawable::spinner_disabled_holo_light=0x01080509; const int R::drawable::spinner_dropdown_background=0x01080071; const int R::drawable::spinner_dropdown_background_down=0x0108050a; const int R::drawable::spinner_dropdown_background_up=0x0108050b; const int R::drawable::spinner_focused_holo_dark=0x0108050c; const int R::drawable::spinner_focused_holo_light=0x0108050d; const int R::drawable::spinner_normal=0x0108050e; const int R::drawable::spinner_press=0x0108050f; const int R::drawable::spinner_pressed_holo_dark=0x01080510; const int R::drawable::spinner_pressed_holo_light=0x01080511; const int R::drawable::spinner_select=0x01080512; const int R::drawable::spinner_white_16=0x01080513; const int R::drawable::spinner_white_48=0x01080514; const int R::drawable::spinner_white_76=0x01080515; const int R::drawable::star_big_off=0x01080073; const int R::drawable::star_big_on=0x01080072; const int R::drawable::star_off=0x01080075; const int R::drawable::star_on=0x01080074; const int R::drawable::stat_ecb_mode=0x01080516; const int R::drawable::stat_notify_call_mute=0x01080076; const int R::drawable::stat_notify_car_mode=0x01080517; const int R::drawable::stat_notify_chat=0x01080077; const int R::drawable::stat_notify_disabled=0x01080518; const int R::drawable::stat_notify_disk_full=0x01080519; const int R::drawable::stat_notify_email_generic=0x0108051a; const int R::drawable::stat_notify_error=0x01080078; const int R::drawable::stat_notify_gmail=0x0108051b; const int R::drawable::stat_notify_missed_call=0x0108007f; const int R::drawable::stat_notify_more=0x01080079; const int R::drawable::stat_notify_rssi_in_range=0x0108051c; const int R::drawable::stat_notify_sdcard=0x0108007a; const int R::drawable::stat_notify_sdcard_prepare=0x010800ab; const int R::drawable::stat_notify_sdcard_usb=0x0108007b; const int R::drawable::stat_notify_sim_toolkit=0x0108051d; const int R::drawable::stat_notify_sync=0x0108007c; const int R::drawable::stat_notify_sync_anim0=0x0108051e; const int R::drawable::stat_notify_sync_error=0x0108051f; const int R::drawable::stat_notify_sync_noanim=0x0108007d; const int R::drawable::stat_notify_voicemail=0x0108007e; const int R::drawable::stat_notify_wifi_in_range=0x01080520; const int R::drawable::stat_sys_adb=0x01080521; const int R::drawable::stat_sys_battery=0x01080522; const int R::drawable::stat_sys_battery_0=0x01080523; const int R::drawable::stat_sys_battery_10=0x01080524; const int R::drawable::stat_sys_battery_100=0x01080525; const int R::drawable::stat_sys_battery_15=0x01080526; const int R::drawable::stat_sys_battery_20=0x01080527; const int R::drawable::stat_sys_battery_28=0x01080528; const int R::drawable::stat_sys_battery_40=0x01080529; const int R::drawable::stat_sys_battery_43=0x0108052a; const int R::drawable::stat_sys_battery_57=0x0108052b; const int R::drawable::stat_sys_battery_60=0x0108052c; const int R::drawable::stat_sys_battery_71=0x0108052d; const int R::drawable::stat_sys_battery_80=0x0108052e; const int R::drawable::stat_sys_battery_85=0x0108052f; const int R::drawable::stat_sys_battery_charge=0x01080530; const int R::drawable::stat_sys_battery_charge_anim0=0x01080531; const int R::drawable::stat_sys_battery_charge_anim1=0x01080532; const int R::drawable::stat_sys_battery_charge_anim100=0x01080533; const int R::drawable::stat_sys_battery_charge_anim15=0x01080534; const int R::drawable::stat_sys_battery_charge_anim2=0x01080535; const int R::drawable::stat_sys_battery_charge_anim28=0x01080536; const int R::drawable::stat_sys_battery_charge_anim3=0x01080537; const int R::drawable::stat_sys_battery_charge_anim4=0x01080538; const int R::drawable::stat_sys_battery_charge_anim43=0x01080539; const int R::drawable::stat_sys_battery_charge_anim5=0x0108053a; const int R::drawable::stat_sys_battery_charge_anim57=0x0108053b; const int R::drawable::stat_sys_battery_charge_anim71=0x0108053c; const int R::drawable::stat_sys_battery_charge_anim85=0x0108053d; const int R::drawable::stat_sys_battery_unknown=0x0108053e; const int R::drawable::stat_sys_data_bluetooth=0x01080080; const int R::drawable::stat_sys_data_usb=0x0108053f; const int R::drawable::stat_sys_data_wimax_signal_3_fully=0x01080540; const int R::drawable::stat_sys_data_wimax_signal_disconnected=0x01080541; const int R::drawable::stat_sys_download=0x01080081; const int R::drawable::stat_sys_download_anim0=0x01080542; const int R::drawable::stat_sys_download_anim1=0x01080543; const int R::drawable::stat_sys_download_anim2=0x01080544; const int R::drawable::stat_sys_download_anim3=0x01080545; const int R::drawable::stat_sys_download_anim4=0x01080546; const int R::drawable::stat_sys_download_anim5=0x01080547; const int R::drawable::stat_sys_download_done=0x01080082; const int R::drawable::stat_sys_download_done_static=0x01080548; const int R::drawable::stat_sys_gps_on=0x01080549; const int R::drawable::stat_sys_headset=0x01080083; const int R::drawable::stat_sys_phone_call=0x01080084; const int R::drawable::stat_sys_phone_call_forward=0x01080085; const int R::drawable::stat_sys_phone_call_on_hold=0x01080086; const int R::drawable::stat_sys_r_signal_0_cdma=0x0108054a; const int R::drawable::stat_sys_r_signal_1_cdma=0x0108054b; const int R::drawable::stat_sys_r_signal_2_cdma=0x0108054c; const int R::drawable::stat_sys_r_signal_3_cdma=0x0108054d; const int R::drawable::stat_sys_r_signal_4_cdma=0x0108054e; const int R::drawable::stat_sys_ra_signal_0_cdma=0x0108054f; const int R::drawable::stat_sys_ra_signal_1_cdma=0x01080550; const int R::drawable::stat_sys_ra_signal_2_cdma=0x01080551; const int R::drawable::stat_sys_ra_signal_3_cdma=0x01080552; const int R::drawable::stat_sys_ra_signal_4_cdma=0x01080553; const int R::drawable::stat_sys_secure=0x01080554; const int R::drawable::stat_sys_signal_0_cdma=0x01080555; const int R::drawable::stat_sys_signal_1_cdma=0x01080556; const int R::drawable::stat_sys_signal_2_cdma=0x01080557; const int R::drawable::stat_sys_signal_3_cdma=0x01080558; const int R::drawable::stat_sys_signal_4_cdma=0x01080559; const int R::drawable::stat_sys_signal_evdo_0=0x0108055a; const int R::drawable::stat_sys_signal_evdo_1=0x0108055b; const int R::drawable::stat_sys_signal_evdo_2=0x0108055c; const int R::drawable::stat_sys_signal_evdo_3=0x0108055d; const int R::drawable::stat_sys_signal_evdo_4=0x0108055e; const int R::drawable::stat_sys_speakerphone=0x01080087; const int R::drawable::stat_sys_tether_bluetooth=0x0108055f; const int R::drawable::stat_sys_tether_general=0x01080560; const int R::drawable::stat_sys_tether_usb=0x01080561; const int R::drawable::stat_sys_tether_wifi=0x01080562; const int R::drawable::stat_sys_throttled=0x01080563; const int R::drawable::stat_sys_upload=0x01080088; const int R::drawable::stat_sys_upload_anim0=0x01080564; const int R::drawable::stat_sys_upload_anim1=0x01080565; const int R::drawable::stat_sys_upload_anim2=0x01080566; const int R::drawable::stat_sys_upload_anim3=0x01080567; const int R::drawable::stat_sys_upload_anim4=0x01080568; const int R::drawable::stat_sys_upload_anim5=0x01080569; const int R::drawable::stat_sys_upload_done=0x01080089; const int R::drawable::stat_sys_vp_phone_call=0x010800a7; const int R::drawable::stat_sys_vp_phone_call_on_hold=0x010800a8; const int R::drawable::stat_sys_warning=0x0108008a; const int R::drawable::status_bar_background=0x0108056a; const int R::drawable::status_bar_closed_default_background=0x0108060a; const int R::drawable::status_bar_header_background=0x0108056b; const int R::drawable::status_bar_item_app_background=0x0108008b; const int R::drawable::status_bar_item_app_background_normal=0x0108056c; const int R::drawable::status_bar_item_background=0x0108008c; const int R::drawable::status_bar_item_background_focus=0x0108056d; const int R::drawable::status_bar_item_background_normal=0x0108056e; const int R::drawable::status_bar_item_background_pressed=0x0108056f; const int R::drawable::status_bar_opened_default_background=0x0108060b; const int R::drawable::statusbar_background=0x01080570; const int R::drawable::submenu_arrow=0x01080571; const int R::drawable::submenu_arrow_nofocus=0x01080572; const int R::drawable::switch_bg_disabled_holo_dark=0x01080573; const int R::drawable::switch_bg_disabled_holo_light=0x01080574; const int R::drawable::switch_bg_focused_holo_dark=0x01080575; const int R::drawable::switch_bg_focused_holo_light=0x01080576; const int R::drawable::switch_bg_holo_dark=0x01080577; const int R::drawable::switch_bg_holo_light=0x01080578; const int R::drawable::switch_inner_holo_dark=0x01080579; const int R::drawable::switch_inner_holo_light=0x0108057a; const int R::drawable::switch_thumb_activated_holo_dark=0x0108057b; const int R::drawable::switch_thumb_activated_holo_light=0x0108057c; const int R::drawable::switch_thumb_disabled_holo_dark=0x0108057d; const int R::drawable::switch_thumb_disabled_holo_light=0x0108057e; const int R::drawable::switch_thumb_holo_dark=0x0108057f; const int R::drawable::switch_thumb_holo_light=0x01080580; const int R::drawable::switch_thumb_pressed_holo_dark=0x01080581; const int R::drawable::switch_thumb_pressed_holo_light=0x01080582; const int R::drawable::switch_track_holo_dark=0x01080583; const int R::drawable::switch_track_holo_light=0x01080584; const int R::drawable::sym_action_add=0x01080585; const int R::drawable::sym_action_call=0x0108008d; const int R::drawable::sym_action_chat=0x0108008e; const int R::drawable::sym_action_email=0x0108008f; const int R::drawable::sym_app_on_sd_unavailable_icon=0x01080586; const int R::drawable::sym_call_incoming=0x01080090; const int R::drawable::sym_call_missed=0x01080091; const int R::drawable::sym_call_outgoing=0x01080092; const int R::drawable::sym_contact_card=0x01080094; const int R::drawable::sym_def_app_icon=0x01080093; const int R::drawable::sym_keyboard_delete=0x01080587; const int R::drawable::sym_keyboard_delete_dim=0x01080588; const int R::drawable::sym_keyboard_delete_holo=0x01080589; const int R::drawable::sym_keyboard_enter=0x0108058a; const int R::drawable::sym_keyboard_feedback_delete=0x0108058b; const int R::drawable::sym_keyboard_feedback_ok=0x0108058c; const int R::drawable::sym_keyboard_feedback_return=0x0108058d; const int R::drawable::sym_keyboard_feedback_shift=0x0108058e; const int R::drawable::sym_keyboard_feedback_shift_locked=0x0108058f; const int R::drawable::sym_keyboard_feedback_space=0x01080590; const int R::drawable::sym_keyboard_num0_no_plus=0x01080591; const int R::drawable::sym_keyboard_num1=0x01080592; const int R::drawable::sym_keyboard_num2=0x01080593; const int R::drawable::sym_keyboard_num3=0x01080594; const int R::drawable::sym_keyboard_num4=0x01080595; const int R::drawable::sym_keyboard_num5=0x01080596; const int R::drawable::sym_keyboard_num6=0x01080597; const int R::drawable::sym_keyboard_num7=0x01080598; const int R::drawable::sym_keyboard_num8=0x01080599; const int R::drawable::sym_keyboard_num9=0x0108059a; const int R::drawable::sym_keyboard_ok=0x0108059b; const int R::drawable::sym_keyboard_ok_dim=0x0108059c; const int R::drawable::sym_keyboard_return=0x0108059d; const int R::drawable::sym_keyboard_return_holo=0x0108059e; const int R::drawable::sym_keyboard_shift=0x0108059f; const int R::drawable::sym_keyboard_shift_locked=0x010805a0; const int R::drawable::sym_keyboard_space=0x010805a1; const int R::drawable::tab_bottom_holo=0x010805a2; const int R::drawable::tab_bottom_left=0x010805a3; const int R::drawable::tab_bottom_left_v4=0x010805a4; const int R::drawable::tab_bottom_right=0x010805a5; const int R::drawable::tab_bottom_right_v4=0x010805a6; const int R::drawable::tab_focus=0x010805a7; const int R::drawable::tab_focus_bar_left=0x010805a8; const int R::drawable::tab_focus_bar_right=0x010805a9; const int R::drawable::tab_indicator=0x010805aa; const int R::drawable::tab_indicator_ab_holo=0x010805ab; const int R::drawable::tab_indicator_holo=0x010805ac; const int R::drawable::tab_indicator_v4=0x010805ad; const int R::drawable::tab_press=0x010805ae; const int R::drawable::tab_press_bar_left=0x010805af; const int R::drawable::tab_press_bar_right=0x010805b0; const int R::drawable::tab_pressed_holo=0x010805b1; const int R::drawable::tab_selected=0x010805b2; const int R::drawable::tab_selected_bar_left=0x010805b3; const int R::drawable::tab_selected_bar_left_v4=0x010805b4; const int R::drawable::tab_selected_bar_right=0x010805b5; const int R::drawable::tab_selected_bar_right_v4=0x010805b6; const int R::drawable::tab_selected_focused_holo=0x010805b7; const int R::drawable::tab_selected_holo=0x010805b8; const int R::drawable::tab_selected_pressed_holo=0x010805b9; const int R::drawable::tab_selected_v4=0x010805ba; const int R::drawable::tab_unselected=0x010805bb; const int R::drawable::tab_unselected_focused_holo=0x010805bc; const int R::drawable::tab_unselected_holo=0x010805bd; const int R::drawable::tab_unselected_pressed_holo=0x010805be; const int R::drawable::tab_unselected_v4=0x010805bf; const int R::drawable::text_cursor_holo_dark=0x010805c0; const int R::drawable::text_cursor_holo_light=0x010805c1; const int R::drawable::text_edit_paste_window=0x010805c2; const int R::drawable::text_edit_side_paste_window=0x010805c3; const int R::drawable::text_edit_suggestions_window=0x010805c4; const int R::drawable::text_select_handle_left=0x010805c5; const int R::drawable::text_select_handle_middle=0x010805c6; const int R::drawable::text_select_handle_right=0x010805c7; const int R::drawable::textfield_activated_holo_dark=0x010805c8; const int R::drawable::textfield_activated_holo_light=0x010805c9; const int R::drawable::textfield_bg_activated_holo_dark=0x010805ca; const int R::drawable::textfield_bg_default_holo_dark=0x010805cb; const int R::drawable::textfield_bg_disabled_focused_holo_dark=0x010805cc; const int R::drawable::textfield_bg_disabled_holo_dark=0x010805cd; const int R::drawable::textfield_bg_focused_holo_dark=0x010805ce; const int R::drawable::textfield_default=0x010805cf; const int R::drawable::textfield_default_holo_dark=0x010805d0; const int R::drawable::textfield_default_holo_light=0x010805d1; const int R::drawable::textfield_disabled=0x010805d2; const int R::drawable::textfield_disabled_focused_holo_dark=0x010805d3; const int R::drawable::textfield_disabled_focused_holo_light=0x010805d4; const int R::drawable::textfield_disabled_holo_dark=0x010805d5; const int R::drawable::textfield_disabled_holo_light=0x010805d6; const int R::drawable::textfield_disabled_selected=0x010805d7; const int R::drawable::textfield_focused_holo_dark=0x010805d8; const int R::drawable::textfield_focused_holo_light=0x010805d9; const int R::drawable::textfield_longpress_holo=0x010805da; const int R::drawable::textfield_multiline_activated_holo_dark=0x010805db; const int R::drawable::textfield_multiline_activated_holo_light=0x010805dc; const int R::drawable::textfield_multiline_default_holo_dark=0x010805dd; const int R::drawable::textfield_multiline_default_holo_light=0x010805de; const int R::drawable::textfield_multiline_disabled_focused_holo_dark=0x010805df; const int R::drawable::textfield_multiline_disabled_focused_holo_light=0x010805e0; const int R::drawable::textfield_multiline_disabled_holo_dark=0x010805e1; const int R::drawable::textfield_multiline_disabled_holo_light=0x010805e2; const int R::drawable::textfield_multiline_focused_holo_dark=0x010805e3; const int R::drawable::textfield_multiline_focused_holo_light=0x010805e4; const int R::drawable::textfield_pressed_holo=0x010805e5; const int R::drawable::textfield_search=0x010805e6; const int R::drawable::textfield_search_default=0x010805e7; const int R::drawable::textfield_search_default_holo_dark=0x010805e8; const int R::drawable::textfield_search_default_holo_light=0x010805e9; const int R::drawable::textfield_search_empty=0x010805ea; const int R::drawable::textfield_search_empty_default=0x010805eb; const int R::drawable::textfield_search_empty_pressed=0x010805ec; const int R::drawable::textfield_search_empty_selected=0x010805ed; const int R::drawable::textfield_search_pressed=0x010805ee; const int R::drawable::textfield_search_right_default_holo_dark=0x010805ef; const int R::drawable::textfield_search_right_default_holo_light=0x010805f0; const int R::drawable::textfield_search_right_selected_holo_dark=0x010805f1; const int R::drawable::textfield_search_right_selected_holo_light=0x010805f2; const int R::drawable::textfield_search_selected=0x010805f3; const int R::drawable::textfield_search_selected_holo_dark=0x010805f4; const int R::drawable::textfield_search_selected_holo_light=0x010805f5; const int R::drawable::textfield_searchview_holo_dark=0x010805f6; const int R::drawable::textfield_searchview_holo_light=0x010805f7; const int R::drawable::textfield_searchview_right_holo_dark=0x010805f8; const int R::drawable::textfield_searchview_right_holo_light=0x010805f9; const int R::drawable::textfield_selected=0x010805fa; const int R::drawable::title_bar=0x01080095; const int R::drawable::title_bar_medium=0x010805fb; const int R::drawable::title_bar_portrait=0x010805fc; const int R::drawable::title_bar_shadow=0x010805fd; const int R::drawable::title_bar_tall=0x010800a6; const int R::drawable::toast_frame=0x01080096; const int R::drawable::toast_frame_holo=0x010805fe; const int R::drawable::transportcontrol_bg=0x010805ff; const int R::drawable::unknown_image=0x01080600; const int R::drawable::unlock_default=0x01080601; const int R::drawable::unlock_halo=0x01080602; const int R::drawable::unlock_ring=0x01080603; const int R::drawable::unlock_wave=0x01080604; const int R::drawable::usb_android=0x01080605; const int R::drawable::usb_android_connected=0x01080606; const int R::drawable::view_accessibility_focused=0x01080607; const int R::drawable::vpn_connected=0x01080608; const int R::drawable::vpn_disconnected=0x01080609; const int R::drawable::zoom_plate=0x01080097; const int R::fraction::config_dimBehindFadeDuration=0x01120000; const int R::id::KEYCODE_0=0x0102008f; const int R::id::KEYCODE_1=0x01020090; const int R::id::KEYCODE_2=0x01020091; const int R::id::KEYCODE_3=0x01020092; const int R::id::KEYCODE_3D_MODE=0x01020156; const int R::id::KEYCODE_4=0x01020093; const int R::id::KEYCODE_5=0x01020094; const int R::id::KEYCODE_6=0x01020095; const int R::id::KEYCODE_7=0x01020096; const int R::id::KEYCODE_8=0x01020097; const int R::id::KEYCODE_9=0x01020098; const int R::id::KEYCODE_A=0x010200a5; const int R::id::KEYCODE_ALTERNATE=0x01020174; const int R::id::KEYCODE_ALT_LEFT=0x010200c1; const int R::id::KEYCODE_ALT_RIGHT=0x010200c2; const int R::id::KEYCODE_APOSTROPHE=0x010200d3; const int R::id::KEYCODE_APP_SWITCH=0x01020143; const int R::id::KEYCODE_ASSIST=0x01020163; const int R::id::KEYCODE_AT=0x010200d5; const int R::id::KEYCODE_AVR_INPUT=0x0102013e; const int R::id::KEYCODE_AVR_POWER=0x0102013d; const int R::id::KEYCODE_B=0x010200a6; const int R::id::KEYCODE_BACK=0x0102008c; const int R::id::KEYCODE_BACKSLASH=0x010200d1; const int R::id::KEYCODE_BOOKMARK=0x01020136; const int R::id::KEYCODE_BREAK=0x01020101; const int R::id::KEYCODE_BUTTON_1=0x01020144; const int R::id::KEYCODE_BUTTON_10=0x0102014d; const int R::id::KEYCODE_BUTTON_11=0x0102014e; const int R::id::KEYCODE_BUTTON_12=0x0102014f; const int R::id::KEYCODE_BUTTON_13=0x01020150; const int R::id::KEYCODE_BUTTON_14=0x01020151; const int R::id::KEYCODE_BUTTON_15=0x01020152; const int R::id::KEYCODE_BUTTON_16=0x01020153; const int R::id::KEYCODE_BUTTON_2=0x01020145; const int R::id::KEYCODE_BUTTON_3=0x01020146; const int R::id::KEYCODE_BUTTON_4=0x01020147; const int R::id::KEYCODE_BUTTON_5=0x01020148; const int R::id::KEYCODE_BUTTON_6=0x01020149; const int R::id::KEYCODE_BUTTON_7=0x0102014a; const int R::id::KEYCODE_BUTTON_8=0x0102014b; const int R::id::KEYCODE_BUTTON_9=0x0102014c; const int R::id::KEYCODE_BUTTON_A=0x010200e8; const int R::id::KEYCODE_BUTTON_B=0x010200e9; const int R::id::KEYCODE_BUTTON_C=0x010200ea; const int R::id::KEYCODE_BUTTON_L1=0x010200ee; const int R::id::KEYCODE_BUTTON_L2=0x010200f0; const int R::id::KEYCODE_BUTTON_MODE=0x010200f6; const int R::id::KEYCODE_BUTTON_R1=0x010200ef; const int R::id::KEYCODE_BUTTON_R2=0x010200f1; const int R::id::KEYCODE_BUTTON_SELECT=0x010200f5; const int R::id::KEYCODE_BUTTON_START=0x010200f4; const int R::id::KEYCODE_BUTTON_THUMBL=0x010200f2; const int R::id::KEYCODE_BUTTON_THUMBR=0x010200f3; const int R::id::KEYCODE_BUTTON_X=0x010200eb; const int R::id::KEYCODE_BUTTON_Y=0x010200ec; const int R::id::KEYCODE_BUTTON_Z=0x010200ed; const int R::id::KEYCODE_C=0x010200a7; const int R::id::KEYCODE_CALCULATOR=0x0102015a; const int R::id::KEYCODE_CALENDAR=0x01020158; const int R::id::KEYCODE_CALL=0x0102008d; const int R::id::KEYCODE_CAMERA=0x010200a3; const int R::id::KEYCODE_CAPS_LOCK=0x010200fb; const int R::id::KEYCODE_CAPTIONS=0x01020137; const int R::id::KEYCODE_CHANNEL_DOWN=0x0102012f; const int R::id::KEYCODE_CHANNEL_UP=0x0102012e; const int R::id::KEYCODE_CLEAR=0x010200a4; const int R::id::KEYCODE_COMMA=0x010200bf; const int R::id::KEYCODE_CONTACTS=0x01020157; const int R::id::KEYCODE_CTRL_LEFT=0x010200f9; const int R::id::KEYCODE_CTRL_RIGHT=0x010200fa; const int R::id::KEYCODE_D=0x010200a8; const int R::id::KEYCODE_DEL=0x010200cb; const int R::id::KEYCODE_DPAD_CENTER=0x0102009f; const int R::id::KEYCODE_DPAD_DOWN=0x0102009c; const int R::id::KEYCODE_DPAD_LEFT=0x0102009d; const int R::id::KEYCODE_DPAD_RIGHT=0x0102009e; const int R::id::KEYCODE_DPAD_UP=0x0102009b; const int R::id::KEYCODE_DVR=0x01020135; const int R::id::KEYCODE_E=0x010200a9; const int R::id::KEYCODE_EARLY_POWER=0x0102016b; const int R::id::KEYCODE_EISU=0x0102015c; const int R::id::KEYCODE_ENDCALL=0x0102008e; const int R::id::KEYCODE_ENTER=0x010200ca; const int R::id::KEYCODE_ENVELOPE=0x010200c9; const int R::id::KEYCODE_EQUALS=0x010200ce; const int R::id::KEYCODE_ESCAPE=0x010200f7; const int R::id::KEYCODE_EXPLORER=0x010200c8; const int R::id::KEYCODE_F=0x010200aa; const int R::id::KEYCODE_F1=0x0102010b; const int R::id::KEYCODE_F10=0x01020114; const int R::id::KEYCODE_F11=0x01020115; const int R::id::KEYCODE_F12=0x01020116; const int R::id::KEYCODE_F2=0x0102010c; const int R::id::KEYCODE_F3=0x0102010d; const int R::id::KEYCODE_F4=0x0102010e; const int R::id::KEYCODE_F5=0x0102010f; const int R::id::KEYCODE_F6=0x01020110; const int R::id::KEYCODE_F7=0x01020111; const int R::id::KEYCODE_F8=0x01020112; const int R::id::KEYCODE_F9=0x01020113; const int R::id::KEYCODE_FOCUS=0x010200d8; const int R::id::KEYCODE_FORWARD=0x01020105; const int R::id::KEYCODE_FORWARD_DEL=0x010200f8; const int R::id::KEYCODE_FUNCTION=0x010200ff; const int R::id::KEYCODE_G=0x010200ab; const int R::id::KEYCODE_GRAVE=0x010200cc; const int R::id::KEYCODE_GUIDE=0x01020134; const int R::id::KEYCODE_H=0x010200ac; const int R::id::KEYCODE_HEADSETHOOK=0x010200d7; const int R::id::KEYCODE_HENKAN=0x0102015e; const int R::id::KEYCODE_HOME=0x0102008b; const int R::id::KEYCODE_I=0x010200ad; const int R::id::KEYCODE_INFO=0x0102012d; const int R::id::KEYCODE_INSERT=0x01020104; const int R::id::KEYCODE_J=0x010200ae; const int R::id::KEYCODE_K=0x010200af; const int R::id::KEYCODE_KANA=0x01020162; const int R::id::KEYCODE_KATAKANA_HIRAGANA=0x0102015f; const int R::id::KEYCODE_L=0x010200b0; const int R::id::KEYCODE_LANGUAGE_SWITCH=0x01020154; const int R::id::KEYCODE_LEFT_BRACKET=0x010200cf; const int R::id::KEYCODE_M=0x010200b1; const int R::id::KEYCODE_MANNER_MODE=0x01020155; const int R::id::KEYCODE_MEDIA_CLOSE=0x01020108; const int R::id::KEYCODE_MEDIA_EJECT=0x01020109; const int R::id::KEYCODE_MEDIA_FAST_FORWARD=0x010200e2; const int R::id::KEYCODE_MEDIA_NEXT=0x010200df; const int R::id::KEYCODE_MEDIA_PAUSE=0x01020107; const int R::id::KEYCODE_MEDIA_PLAY=0x01020106; const int R::id::KEYCODE_MEDIA_PLAY_PAUSE=0x010200dd; const int R::id::KEYCODE_MEDIA_PREVIOUS=0x010200e0; const int R::id::KEYCODE_MEDIA_RECORD=0x0102010a; const int R::id::KEYCODE_MEDIA_REWIND=0x010200e1; const int R::id::KEYCODE_MEDIA_STOP=0x010200de; const int R::id::KEYCODE_MENU=0x010200da; const int R::id::KEYCODE_META_LEFT=0x010200fd; const int R::id::KEYCODE_META_RIGHT=0x010200fe; const int R::id::KEYCODE_MINUS=0x010200cd; const int R::id::KEYCODE_MOVE_END=0x01020103; const int R::id::KEYCODE_MOVE_HOME=0x01020102; const int R::id::KEYCODE_MUHENKAN=0x0102015d; const int R::id::KEYCODE_MUSIC=0x01020159; const int R::id::KEYCODE_MUTE=0x010200e3; const int R::id::KEYCODE_N=0x010200b2; const int R::id::KEYCODE_NOTIFICATION=0x010200db; const int R::id::KEYCODE_NUM=0x010200d6; const int R::id::KEYCODE_NUMPAD_0=0x01020118; const int R::id::KEYCODE_NUMPAD_1=0x01020119; const int R::id::KEYCODE_NUMPAD_2=0x0102011a; const int R::id::KEYCODE_NUMPAD_3=0x0102011b; const int R::id::KEYCODE_NUMPAD_4=0x0102011c; const int R::id::KEYCODE_NUMPAD_5=0x0102011d; const int R::id::KEYCODE_NUMPAD_6=0x0102011e; const int R::id::KEYCODE_NUMPAD_7=0x0102011f; const int R::id::KEYCODE_NUMPAD_8=0x01020120; const int R::id::KEYCODE_NUMPAD_9=0x01020121; const int R::id::KEYCODE_NUMPAD_ADD=0x01020125; const int R::id::KEYCODE_NUMPAD_COMMA=0x01020127; const int R::id::KEYCODE_NUMPAD_DIVIDE=0x01020122; const int R::id::KEYCODE_NUMPAD_DOT=0x01020126; const int R::id::KEYCODE_NUMPAD_ENTER=0x01020128; const int R::id::KEYCODE_NUMPAD_EQUALS=0x01020129; const int R::id::KEYCODE_NUMPAD_LEFT_PAREN=0x0102012a; const int R::id::KEYCODE_NUMPAD_MULTIPLY=0x01020123; const int R::id::KEYCODE_NUMPAD_RIGHT_PAREN=0x0102012b; const int R::id::KEYCODE_NUMPAD_SUBTRACT=0x01020124; const int R::id::KEYCODE_NUM_LOCK=0x01020117; const int R::id::KEYCODE_O=0x010200b3; const int R::id::KEYCODE_P=0x010200b4; const int R::id::KEYCODE_PAGE_DOWN=0x010200e5; const int R::id::KEYCODE_PAGE_UP=0x010200e4; const int R::id::KEYCODE_PERIOD=0x010200c0; const int R::id::KEYCODE_PICTSYMBOLS=0x010200e6; const int R::id::KEYCODE_PLUS=0x010200d9; const int R::id::KEYCODE_POUND=0x0102009a; const int R::id::KEYCODE_POWER=0x010200a2; const int R::id::KEYCODE_PROG_BLUE=0x01020142; const int R::id::KEYCODE_PROG_GRED=0x0102013f; const int R::id::KEYCODE_PROG_GREEN=0x01020140; const int R::id::KEYCODE_PROG_YELLOW=0x01020141; const int R::id::KEYCODE_Q=0x010200b5; const int R::id::KEYCODE_R=0x010200b6; const int R::id::KEYCODE_RIGHT_BRACKET=0x010200d0; const int R::id::KEYCODE_RO=0x01020161; const int R::id::KEYCODE_S=0x010200b7; const int R::id::KEYCODE_SCROLL_LOCK=0x010200fc; const int R::id::KEYCODE_SEARCH=0x010200dc; const int R::id::KEYCODE_SEMICOLON=0x010200d2; const int R::id::KEYCODE_SETTINGS=0x01020138; const int R::id::KEYCODE_SHIFT_LEFT=0x010200c3; const int R::id::KEYCODE_SHIFT_RIGHT=0x010200c4; const int R::id::KEYCODE_SLASH=0x010200d4; const int R::id::KEYCODE_SOFT_LEFT=0x01020089; const int R::id::KEYCODE_SOFT_RIGHT=0x0102008a; const int R::id::KEYCODE_SPACE=0x010200c6; const int R::id::KEYCODE_STAR=0x01020099; const int R::id::KEYCODE_STB_INPUT=0x0102013c; const int R::id::KEYCODE_STB_POWER=0x0102013b; const int R::id::KEYCODE_SWITCH_CHARSET=0x010200e7; const int R::id::KEYCODE_SYM=0x010200c7; const int R::id::KEYCODE_SYSRQ=0x01020100; const int R::id::KEYCODE_T=0x010200b8; const int R::id::KEYCODE_TAB=0x010200c5; const int R::id::KEYCODE_TV=0x01020132; const int R::id::KEYCODE_TV_BROWSER=0x01020173; const int R::id::KEYCODE_TV_INPUT=0x0102013a; const int R::id::KEYCODE_TV_POWER=0x01020139; const int R::id::KEYCODE_TV_REPEAT=0x0102016e; const int R::id::KEYCODE_TV_SHORTCUTKEY_3DMODE=0x01020166; const int R::id::KEYCODE_TV_SHORTCUTKEY_DISPAYMODE=0x01020167; const int R::id::KEYCODE_TV_SHORTCUTKEY_GLOBALSETUP=0x01020164; const int R::id::KEYCODE_TV_SHORTCUTKEY_SOURCE_LIST=0x01020165; const int R::id::KEYCODE_TV_SHORTCUTKEY_TVINFO=0x0102016a; const int R::id::KEYCODE_TV_SHORTCUTKEY_VIEWMODE=0x01020168; const int R::id::KEYCODE_TV_SHORTCUTKEY_VOICEMODE=0x01020169; const int R::id::KEYCODE_TV_SLEEP=0x0102016c; const int R::id::KEYCODE_TV_SOUND_CHANNEL=0x0102016d; const int R::id::KEYCODE_TV_SUBTITLE=0x0102016f; const int R::id::KEYCODE_TV_SWITCH=0x01020170; const int R::id::KEYCODE_TV_VTION=0x01020172; const int R::id::KEYCODE_TV_WASU=0x01020171; const int R::id::KEYCODE_U=0x010200b9; const int R::id::KEYCODE_UNKNOWN=0x01020088; const int R::id::KEYCODE_V=0x010200ba; const int R::id::KEYCODE_VOLUME_DOWN=0x010200a1; const int R::id::KEYCODE_VOLUME_MUTE=0x0102012c; const int R::id::KEYCODE_VOLUME_UP=0x010200a0; const int R::id::KEYCODE_W=0x010200bb; const int R::id::KEYCODE_WINDOW=0x01020133; const int R::id::KEYCODE_X=0x010200bc; const int R::id::KEYCODE_Y=0x010200bd; const int R::id::KEYCODE_YEN=0x01020160; const int R::id::KEYCODE_Z=0x010200be; const int R::id::KEYCODE_ZENKAKU_HANKAKU=0x0102015b; const int R::id::KEYCODE_ZOOM_IN=0x01020130; const int R::id::KEYCODE_ZOOM_OUT=0x01020131; const int R::id::accountPreferences=0x01020254; const int R::id::account_name=0x0102029c; const int R::id::account_row_icon=0x01020287; const int R::id::account_row_text=0x01020288; const int R::id::account_type=0x0102029b; const int R::id::action0=0x01020331; const int R::id::action1=0x01020333; const int R::id::action2=0x01020334; const int R::id::actionDone=0x0102006b; const int R::id::actionGo=0x01020067; const int R::id::actionNext=0x0102006a; const int R::id::actionNone=0x01020066; const int R::id::actionPrevious=0x0102006c; const int R::id::actionSearch=0x01020068; const int R::id::actionSend=0x01020069; const int R::id::actionUnspecified=0x01020065; const int R::id::action_bar=0x0102036c; const int R::id::action_bar_container=0x0102036b; const int R::id::action_bar_overlay_layout=0x0102036f; const int R::id::action_bar_subtitle=0x01020260; const int R::id::action_bar_title=0x0102025f; const int R::id::action_context_bar=0x0102036d; const int R::id::action_divider=0x0102033b; const int R::id::action_menu_divider=0x01020259; const int R::id::action_menu_presenter=0x0102025c; const int R::id::action_mode_bar=0x01020367; const int R::id::action_mode_bar_stub=0x01020366; const int R::id::action_mode_close_button=0x01020261; const int R::id::actions=0x01020332; const int R::id::activity_chooser_view_content=0x01020262; const int R::id::addToDictionary=0x0102002a; const int R::id::adjustNothing=0x01020037; const int R::id::adjustPan=0x01020036; const int R::id::adjustResize=0x01020035; const int R::id::adjustUnspecified=0x01020034; const int R::id::afterDescendants=0x01020195; const int R::id::alarm=0x01020201; const int R::id::alarm_status=0x010202f5; const int R::id::albumart=0x01020316; const int R::id::alertTitle=0x0102026a; const int R::id::alignBounds=0x01020086; const int R::id::alignMargins=0x01020087; const int R::id::all=0x01020083; const int R::id::allow_button=0x010202a1; const int R::id::alternative=0x010201fb; const int R::id::always=0x0102017f; const int R::id::alwaysScroll=0x010201b2; const int R::id::alwaysUse=0x01020275; const int R::id::amPm=0x010203a4; const int R::id::animation=0x01020192; const int R::id::anyRtl=0x0102018a; const int R::id::app_widget_container=0x010202c5; const int R::id::ask_checkbox=0x01020278; const int R::id::atThumb=0x01020039; const int R::id::authtoken_type=0x0102029d; const int R::id::auto_=0x0102017c; const int R::id::auto_fit=0x010201b9; const int R::id::back_button=0x01020356; const int R::id::background=0x01020000; const int R::id::backspace=0x010202ff; const int R::id::banner=0x010203b2; const int R::id::batteryInfo=0x010202e9; const int R::id::batteryInfoIcon=0x010202ea; const int R::id::batteryInfoSpacer=0x010202ec; const int R::id::batteryInfoText=0x010202eb; const int R::id::beforeDescendants=0x01020194; const int R::id::beginning=0x010201c1; const int R::id::behind=0x01020225; const int R::id::big_picture=0x0102033c; const int R::id::big_text=0x0102033a; const int R::id::blocksDescendants=0x01020196; const int R::id::body=0x0102035b; const int R::id::bold=0x0102003f; const int R::id::bottom=0x01020075; const int R::id::bottom_to_top=0x010201ea; const int R::id::breadcrumb_section=0x01020282; const int R::id::btn_next=0x01020319; const int R::id::btn_play=0x01020318; const int R::id::btn_prev=0x01020317; const int R::id::button0=0x0102035d; const int R::id::button1=0x01020019; const int R::id::button2=0x0102001a; const int R::id::button3=0x0102001b; const int R::id::button4=0x0102035e; const int R::id::button5=0x0102035f; const int R::id::button6=0x01020360; const int R::id::button7=0x01020361; const int R::id::buttonPanel=0x0102026c; const int R::id::button_always=0x01020364; const int R::id::button_bar=0x0102028a; const int R::id::button_once=0x01020365; const int R::id::buttons=0x0102029f; const int R::id::by_common=0x01020393; const int R::id::by_common_header=0x01020392; const int R::id::by_org=0x01020395; const int R::id::by_org_header=0x01020394; const int R::id::by_org_unit=0x01020397; const int R::id::by_org_unit_header=0x01020396; const int R::id::calendar_view=0x0102028f; const int R::id::cancel=0x01020286; const int R::id::cancel_button=0x010202fa; const int R::id::candidatesArea=0x0102001d; const int R::id::carrier=0x010202f7; const int R::id::center=0x0102007c; const int R::id::centerCrop=0x010201bf; const int R::id::centerInside=0x010201c0; const int R::id::center_horizontal=0x0102007a; const int R::id::center_vertical=0x01020078; const int R::id::challenge=0x01020212; const int R::id::characterPicker=0x01020285; const int R::id::characters=0x010201cb; const int R::id::check=0x0102032f; const int R::id::checkbox=0x01020001; const int R::id::chronometer=0x01020337; const int R::id::clamp=0x010201e1; const int R::id::clearDefaultHint=0x01020276; const int R::id::clip_horizontal=0x0102007f; const int R::id::clip_vertical=0x0102007e; const int R::id::clock_text=0x01020314; const int R::id::clock_view=0x01020313; const int R::id::closeButton=0x01020027; const int R::id::collapseActionView=0x010201fe; const int R::id::collapsing=0x010201d0; const int R::id::column=0x010201eb; const int R::id::columnWidth=0x010201b7; const int R::id::compat_checkbox=0x01020277; const int R::id::container=0x010201f8; const int R::id::content=0x01020002; const int R::id::contentPanel=0x0102026f; const int R::id::copy=0x01020021; const int R::id::copyUrl=0x01020023; const int R::id::costsMoney=0x0102021d; const int R::id::custom=0x0102002b; const int R::id::customPanel=0x01020271; const int R::id::cut=0x01020020; const int R::id::cycle=0x010201c3; const int R::id::dangerous=0x01020218; const int R::id::date=0x01020063; const int R::id::datePicker=0x01020290; const int R::id::datetime=0x01020062; const int R::id::day=0x0102028d; const int R::id::day_names=0x01020284; const int R::id::decimal=0x010201c8; const int R::id::decrement=0x01020349; const int R::id::defaultPosition=0x01020182; const int R::id::default_activity_button=0x01020265; const int R::id::default_loading_view=0x01020362; const int R::id::delete_button=0x010202d5; const int R::id::deny_button=0x010202a0; const int R::id::description=0x01020289; const int R::id::development=0x0102021b; const int R::id::dialog=0x010201cd; const int R::id::disableHome=0x0102020e; const int R::id::disabled=0x010201b1; const int R::id::divider=0x010203a6; const int R::id::dpad=0x01020242; const int R::id::dropdown=0x010201ce; const int R::id::edit=0x01020003; const int R::id::edit_query=0x01020374; const int R::id::editable=0x010201c5; const int R::id::edittext_container=0x01020351; const int R::id::eight=0x010203ae; const int R::id::email=0x01020081; const int R::id::emergencyCallButton=0x010202e1; const int R::id::emergency_call_button=0x010202b9; const int R::id::empty=0x01020004; const int R::id::end=0x01020044; const int R::id::enter_pin=0x01020304; const int R::id::enter_pin_section=0x010203bc; const int R::id::enter_puk=0x01020303; const int R::id::expandChallengeHandle=0x01020216; const int R::id::expand_activities_button=0x01020263; const int R::id::expand_button=0x0102032e; const int R::id::expand_button_divider=0x010203b7; const int R::id::expanded_menu=0x01020293; const int R::id::expires_on=0x0102039c; const int R::id::expires_on_header=0x0102039b; const int R::id::extended_settings=0x0102032d; const int R::id::extractArea=0x0102001c; const int R::id::face_unlock_area_view=0x010202bd; const int R::id::face_unlock_cancel_button=0x010202bf; const int R::id::feedbackAllMask=0x010201ad; const int R::id::feedbackAudible=0x010201aa; const int R::id::feedbackGeneric=0x010201ac; const int R::id::feedbackHaptic=0x010201a9; const int R::id::feedbackSpoken=0x010201a8; const int R::id::feedbackVisual=0x010201ab; const int R::id::ffwd=0x01020327; const int R::id::fill=0x0102007d; const int R::id::fillInIntent=0x01020256; const int R::id::fill_horizontal=0x0102007b; const int R::id::fill_parent=0x01020197; const int R::id::fill_vertical=0x01020079; const int R::id::find=0x010203c8; const int R::id::find_next=0x010203cb; const int R::id::find_prev=0x010203ca; const int R::id::finger=0x0102023d; const int R::id::fingerprints=0x0102039d; const int R::id::firstStrong=0x01020189; const int R::id::fitCenter=0x010201bd; const int R::id::fitEnd=0x010201be; const int R::id::fitStart=0x010201bc; const int R::id::fitXY=0x010201bb; const int R::id::five=0x010203ab; const int R::id::flagDefault=0x010201ae; const int R::id::flagForceAscii=0x01020073; const int R::id::flagIncludeNotImportantViews=0x010201af; const int R::id::flagNavigateNext=0x0102006f; const int R::id::flagNavigatePrevious=0x0102006e; const int R::id::flagNoAccessoryAction=0x01020071; const int R::id::flagNoEnterAction=0x01020072; const int R::id::flagNoExtractUi=0x01020070; const int R::id::flagNoFullscreen=0x0102006d; const int R::id::flagRequestTouchExplorationMode=0x010201b0; const int R::id::floatType=0x010201ed; const int R::id::floating=0x01020038; const int R::id::fontScale=0x01020239; const int R::id::forgotPatternButton=0x0102030a; const int R::id::forgot_password_button=0x010202ba; const int R::id::four=0x010203aa; const int R::id::fullSensor=0x0102022c; const int R::id::fullscreenArea=0x010202ab; const int R::id::glow_pad_view=0x010202c1; const int R::id::gone=0x01020177; const int R::id::grant_credentials_permission_message_footer=0x0102029e; const int R::id::grant_credentials_permission_message_header=0x01020298; const int R::id::gravity=0x0102018b; const int R::id::hard_keyboard_section=0x010202af; const int R::id::hard_keyboard_switch=0x010202b0; const int R::id::hardware=0x01020184; const int R::id::hdpi=0x0102024d; const int R::id::headerSimBad1=0x010202e7; const int R::id::headerSimBad2=0x010202e8; const int R::id::headerSimOk1=0x010202e5; const int R::id::headerSimOk2=0x010202e6; const int R::id::headerText=0x010202fc; const int R::id::headers=0x01020352; const int R::id::high=0x0102017e; const int R::id::hint=0x01020005; const int R::id::home=0x0102002c; const int R::id::homeAsUp=0x0102020b; const int R::id::home_screen=0x01020204; const int R::id::horizontal=0x01020084; const int R::id::hour=0x010203a2; const int R::id::icon=0x01020006; const int R::id::icon1=0x01020007; const int R::id::icon2=0x01020008; const int R::id::icon_menu=0x010202aa; const int R::id::icon_menu_presenter=0x0102025a; const int R::id::ifContentScrolls=0x01020180; const int R::id::ifRoom=0x010201fc; const int R::id::image=0x01020264; const int R::id::inbox_end_pad=0x01020346; const int R::id::inbox_more=0x01020345; const int R::id::inbox_text0=0x0102033e; const int R::id::inbox_text1=0x0102033f; const int R::id::inbox_text2=0x01020340; const int R::id::inbox_text3=0x01020341; const int R::id::inbox_text4=0x01020342; const int R::id::inbox_text5=0x01020343; const int R::id::inbox_text6=0x01020344; const int R::id::increment=0x01020347; const int R::id::index=0x01020330; const int R::id::infinite=0x010201e3; const int R::id::info=0x01020339; const int R::id::inherit=0x01020187; const int R::id::input=0x01020009; const int R::id::inputArea=0x0102001e; const int R::id::inputExtractAccessories=0x010202ac; const int R::id::inputExtractAction=0x010202ad; const int R::id::inputExtractEditButton=0x010202ae; const int R::id::inputExtractEditText=0x01020025; const int R::id::insideInset=0x01020179; const int R::id::insideOverlay=0x01020178; const int R::id::instructions=0x010202e4; const int R::id::intType=0x010201ee; const int R::id::integer=0x010201c6; const int R::id::internalEmpty=0x01020321; const int R::id::internalOnly=0x01020245; const int R::id::invisible=0x01020176; const int R::id::issued_on=0x0102039a; const int R::id::issued_on_header=0x01020399; const int R::id::issued_to_header=0x01020389; const int R::id::italic=0x01020040; const int R::id::key0=0x010202df; const int R::id::key1=0x010202d6; const int R::id::key2=0x010202d7; const int R::id::key3=0x010202d8; const int R::id::key4=0x010202d9; const int R::id::key5=0x010202da; const int R::id::key6=0x010202db; const int R::id::key7=0x010202dc; const int R::id::key8=0x010202dd; const int R::id::key9=0x010202de; const int R::id::keyPad=0x01020301; const int R::id::key_enter=0x010202e0; const int R::id::keyboard=0x01020230; const int R::id::keyboardHidden=0x01020231; const int R::id::keyboardView=0x01020026; const int R::id::keyguard=0x01020205; const int R::id::keyguard_account_view=0x010202b3; const int R::id::keyguard_add_widget=0x010202b7; const int R::id::keyguard_add_widget_view=0x010202b8; const int R::id::keyguard_bouncer_frame=0x010202bc; const int R::id::keyguard_click_area=0x01020291; const int R::id::keyguard_face_unlock_view=0x010202bb; const int R::id::keyguard_host_view=0x010202c2; const int R::id::keyguard_message_area=0x01020292; const int R::id::keyguard_multi_user_selector=0x010202cd; const int R::id::keyguard_password_view=0x010202ce; const int R::id::keyguard_pattern_view=0x010202d1; const int R::id::keyguard_pin_view=0x010202d3; const int R::id::keyguard_security_container=0x010202c6; const int R::id::keyguard_selector_fade_container=0x010202c0; const int R::id::keyguard_selector_view=0x0102030c; const int R::id::keyguard_selector_view_frame=0x0102030d; const int R::id::keyguard_sim_pin_view=0x0102030e; const int R::id::keyguard_sim_puk_view=0x0102030f; const int R::id::keyguard_status_area=0x01020310; const int R::id::keyguard_status_view=0x01020311; const int R::id::keyguard_status_view_face_palm=0x01020312; const int R::id::keyguard_transport_control=0x0102031a; const int R::id::keyguard_user_avatar=0x010202c9; const int R::id::keyguard_user_name=0x010202ca; const int R::id::keyguard_user_selector=0x010202cb; const int R::id::keyguard_users_grid=0x010202cc; const int R::id::keyguard_widget_pager_delete_target=0x010202c4; const int R::id::label=0x010202b2; const int R::id::landscape=0x01020223; const int R::id::large=0x01020249; const int R::id::launchRecognizer=0x010201f7; const int R::id::launchWebSearch=0x010201f6; const int R::id::layoutDirection=0x01020238; const int R::id::ldpi=0x0102024b; const int R::id::left=0x01020076; const int R::id::leftSpacer=0x0102026d; const int R::id::left_icon=0x0102024f; const int R::id::left_to_right=0x010201e7; const int R::id::line=0x010201d9; const int R::id::line1=0x01020336; const int R::id::line3=0x01020338; const int R::id::linear=0x010201db; const int R::id::list=0x0102000a; const int R::id::listContainer=0x01020320; const int R::id::listMode=0x01020207; const int R::id::list_footer=0x01020353; const int R::id::list_item=0x01020266; const int R::id::list_menu_presenter=0x0102025b; const int R::id::liveAudio=0x0102020f; const int R::id::locale=0x01020188; const int R::id::lockInstructions=0x010202f1; const int R::id::lockPattern=0x0102030b; const int R::id::lockPatternView=0x010202d2; const int R::id::lock_screen=0x01020253; const int R::id::login=0x010202b4; const int R::id::low=0x0102017d; const int R::id::ltr=0x01020185; const int R::id::main=0x010203b1; const int R::id::map=0x01020082; const int R::id::marquee=0x01020045; const int R::id::marquee_forever=0x010201cc; const int R::id::match_parent=0x01020198; const int R::id::matches=0x010203bb; const int R::id::matrix=0x010201ba; const int R::id::mcc=0x0102022d; const int R::id::mdpi=0x0102024c; const int R::id::mediacontroller_progress=0x0102032a; const int R::id::menu=0x01020250; const int R::id::message=0x0102000b; const int R::id::middle=0x01020043; const int R::id::minute=0x010203a3; const int R::id::mirror=0x010201e2; const int R::id::mnc=0x0102022e; const int R::id::modeLarge=0x010201d6; const int R::id::modeMedium=0x010201d5; const int R::id::modeSmall=0x010201d4; const int R::id::mode_normal=0x010203c5; const int R::id::monospace=0x0102003e; const int R::id::month=0x0102028c; const int R::id::month_name=0x01020283; const int R::id::mount_button=0x010203b3; const int R::id::multi_pane_challenge=0x010202c3; const int R::id::multiple=0x010201d3; const int R::id::multipleChoice=0x010201b4; const int R::id::multipleChoiceModal=0x010201b5; const int R::id::music=0x01020203; const int R::id::name=0x010203be; const int R::id::navigation=0x01020232; const int R::id::never=0x01020181; const int R::id::new_app_action=0x010202a8; const int R::id::new_app_description=0x010202a9; const int R::id::new_app_icon=0x010202a7; const int R::id::next=0x01020328; const int R::id::nextAlarmInfo=0x010202ed; const int R::id::nextAlarmSpacer=0x010202ef; const int R::id::nextAlarmText=0x010202ee; const int R::id::next_button=0x01020358; const int R::id::nine=0x010203af; const int R::id::no=0x01020191; const int R::id::no_applications_message=0x0102035c; const int R::id::no_permissions=0x01020280; const int R::id::nokeys=0x0102023e; const int R::id::nonav=0x01020241; const int R::id::none=0x01020041; const int R::id::normal=0x0102003b; const int R::id::nosensor=0x01020227; const int R::id::notification=0x01020200; const int R::id::notouch=0x0102023b; const int R::id::number=0x0102005d; const int R::id::numberDecimal=0x0102005f; const int R::id::numberPassword=0x01020060; const int R::id::numberSigned=0x0102005e; const int R::id::numberpicker_input=0x01020348; const int R::id::off=0x0102034e; const int R::id::ok=0x010202b6; const int R::id::old_app_action=0x010202a4; const int R::id::old_app_description=0x010202a5; const int R::id::old_app_icon=0x010202a3; const int R::id::one=0x010203a7; const int R::id::oneLine=0x010201cf; const int R::id::opaque=0x010201de; const int R::id::option1=0x01020295; const int R::id::option2=0x01020296; const int R::id::option3=0x01020297; const int R::id::orientation=0x01020233; const int R::id::original_app_icon=0x0102031d; const int R::id::original_message=0x0102031e; const int R::id::outsideInset=0x0102017b; const int R::id::outsideOverlay=0x0102017a; const int R::id::oval=0x010201d8; const int R::id::overflow_divider=0x0102033d; const int R::id::overflow_menu_presenter=0x0102025d; const int R::id::overlay_display_window_texture=0x0102034a; const int R::id::overlay_display_window_title=0x0102034b; const int R::id::owner_info=0x01020307; const int R::id::package_icon=0x0102034c; const int R::id::package_label=0x0102034d; const int R::id::packages_list=0x01020299; const int R::id::pageDeleteDropTarget=0x01020217; const int R::id::parentPanel=0x01020267; const int R::id::password=0x010202b5; const int R::id::passwordEntry=0x010202cf; const int R::id::paste=0x01020022; const int R::id::pause=0x01020326; const int R::id::perm_icon=0x0102027a; const int R::id::perm_money_icon=0x0102027c; const int R::id::perm_money_label=0x0102027d; const int R::id::perm_name=0x0102027b; const int R::id::permission_group=0x0102027e; const int R::id::permission_icon=0x0102029a; const int R::id::permission_list=0x0102027f; const int R::id::perms_list=0x01020281; const int R::id::personalInfo=0x0102021c; const int R::id::phone=0x01020061; const int R::id::pickers=0x0102028b; const int R::id::pinDel=0x010202f8; const int R::id::pinDisplay=0x010202fe; const int R::id::pinDisplayGroup=0x010202fd; const int R::id::pinEntry=0x010202d4; const int R::id::placeholder=0x01020387; const int R::id::popup_submenu_presenter=0x0102025e; const int R::id::portrait=0x01020224; const int R::id::preferExternal=0x01020246; const int R::id::prefs=0x01020355; const int R::id::prefs_frame=0x01020354; const int R::id::prev=0x01020324; const int R::id::primary=0x0102000c; const int R::id::progress=0x0102000d; const int R::id::progressContainer=0x0102031f; const int R::id::progress_circular=0x01020369; const int R::id::progress_horizontal=0x0102036a; const int R::id::progress_number=0x01020274; const int R::id::progress_percent=0x01020273; const int R::id::pukDel=0x01020306; const int R::id::pukDisplay=0x01020305; const int R::id::queryRewriteFromData=0x010201f3; const int R::id::queryRewriteFromText=0x010201f4; const int R::id::qwerty=0x0102023f; const int R::id::radial=0x010201dc; const int R::id::radio=0x01020323; const int R::id::radio_power=0x01020350; const int R::id::random=0x010201e6; const int R::id::reask_hint=0x01020279; const int R::id::rectangle=0x010201d7; const int R::id::repeat=0x010201c2; const int R::id::replace_app_icon=0x0102031b; const int R::id::replace_message=0x0102031c; const int R::id::resolver_grid=0x01020363; const int R::id::restart=0x010201e4; const int R::id::reverse=0x010201e5; const int R::id::reverseLandscape=0x0102022a; const int R::id::reversePortrait=0x0102022b; const int R::id::rew=0x01020325; const int R::id::right=0x01020077; const int R::id::rightSpacer=0x0102026e; const int R::id::right_container=0x01020368; const int R::id::right_icon=0x01020251; const int R::id::right_to_left=0x010201e8; const int R::id::ring=0x010201da; const int R::id::ringtone=0x010201ff; const int R::id::root=0x010202f2; const int R::id::row=0x010201ec; const int R::id::rowTypeId=0x01020257; const int R::id::rtl=0x01020186; const int R::id::sans=0x0102003c; const int R::id::screenLayout=0x01020234; const int R::id::screenLocked=0x01020309; const int R::id::screenLockedInfo=0x010202f0; const int R::id::screenSize=0x01020236; const int R::id::scrim=0x01020214; const int R::id::scrollView=0x01020270; const int R::id::scrolling=0x01020193; const int R::id::search_app_icon=0x01020372; const int R::id::search_badge=0x01020375; const int R::id::search_bar=0x01020371; const int R::id::search_button=0x01020376; const int R::id::search_close_btn=0x0102037b; const int R::id::search_edit_frame=0x01020377; const int R::id::search_go_btn=0x0102037d; const int R::id::search_mag_icon=0x01020378; const int R::id::search_plate=0x01020379; const int R::id::search_src_text=0x0102037a; const int R::id::search_view=0x01020373; const int R::id::search_voice_btn=0x0102037e; const int R::id::secondary=0x010201fa; const int R::id::secondaryProgress=0x0102000f; const int R::id::seekbar=0x01020359; const int R::id::selectAll=0x0102001f; const int R::id::selectTextMode=0x0102002d; const int R::id::select_all=0x010203c6; const int R::id::select_dialog_listview=0x0102037f; const int R::id::selectedIcon=0x0102000e; const int R::id::sensor=0x01020226; const int R::id::sensorLandscape=0x01020228; const int R::id::sensorPortrait=0x01020229; const int R::id::sentences=0x010201c9; const int R::id::sequentially=0x010201f0; const int R::id::serial_number=0x01020391; const int R::id::serial_number_header=0x01020390; const int R::id::serif=0x0102003d; const int R::id::seven=0x010203ad; const int R::id::sha1_fingerprint=0x010203a1; const int R::id::sha1_fingerprint_header=0x010203a0; const int R::id::sha256_fingerprint=0x0102039f; const int R::id::sha256_fingerprint_header=0x0102039e; const int R::id::share=0x010203c7; const int R::id::shortcut=0x01020322; const int R::id::showCustom=0x0102020d; const int R::id::showHome=0x0102020a; const int R::id::showSearchIconAsBadge=0x010201f2; const int R::id::showSearchLabelAsBadge=0x010201f1; const int R::id::showTitle=0x0102020c; const int R::id::showVoiceSearchButton=0x010201f5; const int R::id::signature=0x01020219; const int R::id::signatureOrSystem=0x0102021a; const int R::id::signed_=0x010201c7; const int R::id::silent=0x0102034f; const int R::id::single=0x010201d2; const int R::id::singleChoice=0x010201b3; const int R::id::singleInstance=0x01020221; const int R::id::singleTask=0x01020220; const int R::id::singleTop=0x0102021f; const int R::id::six=0x010203ac; const int R::id::skip_button=0x01020357; const int R::id::slider_group=0x010203b6; const int R::id::sliding_layout=0x010202c8; const int R::id::small=0x01020248; const int R::id::smallIcon=0x01020255; const int R::id::smallestScreenSize=0x01020237; const int R::id::sms_short_code_coins_icon=0x01020382; const int R::id::sms_short_code_confirm_message=0x01020380; const int R::id::sms_short_code_detail_layout=0x01020381; const int R::id::sms_short_code_detail_message=0x01020383; const int R::id::sms_short_code_remember_choice_checkbox=0x01020384; const int R::id::sms_short_code_remember_choice_text=0x01020385; const int R::id::sms_short_code_remember_undo_instruction=0x01020386; const int R::id::software=0x01020183; const int R::id::spacerBottom=0x01020302; const int R::id::spacerTop=0x010202e3; const int R::id::spacingWidth=0x010201b6; const int R::id::spacingWidthUniform=0x010201b8; const int R::id::spannable=0x010201c4; const int R::id::splashscreen=0x010203ba; const int R::id::splitActionBarWhenNarrow=0x01020247; const int R::id::split_action_bar=0x0102036e; const int R::id::spotlightMask=0x010202be; const int R::id::standard=0x0102021e; const int R::id::start=0x01020042; const int R::id::startSelectingText=0x01020028; const int R::id::stateAlwaysHidden=0x01020031; const int R::id::stateAlwaysVisible=0x01020033; const int R::id::stateHidden=0x01020030; const int R::id::stateUnchanged=0x0102002f; const int R::id::stateUnspecified=0x0102002e; const int R::id::stateVisible=0x01020032; const int R::id::status=0x01020294; const int R::id::status1=0x010202f6; const int R::id::status_bar_latest_event_content=0x01020335; const int R::id::stopSelectingText=0x01020029; const int R::id::stream_icon=0x010203b8; const int R::id::stylus=0x0102023c; const int R::id::submit_area=0x0102037c; const int R::id::summary=0x01020010; const int R::id::sweep=0x010201dd; const int R::id::switchInputMethod=0x01020024; const int R::id::switchWidget=0x0102035a; const int R::id::switch_ime_button=0x010202d0; const int R::id::switch_new=0x010202a6; const int R::id::switch_old=0x010202a2; const int R::id::system=0x010201f9; const int R::id::tabMode=0x01020208; const int R::id::tabcontent=0x01020011; const int R::id::tabhost=0x01020012; const int R::id::tabs=0x01020013; const int R::id::text=0x01020046; const int R::id::text1=0x01020014; const int R::id::text2=0x01020015; const int R::id::textAutoComplete=0x0102004b; const int R::id::textAutoCorrect=0x0102004a; const int R::id::textCapCharacters=0x01020047; const int R::id::textCapSentences=0x01020049; const int R::id::textCapWords=0x01020048; const int R::id::textEmailAddress=0x01020050; const int R::id::textEmailSubject=0x01020051; const int R::id::textEnd=0x0102018d; const int R::id::textFilter=0x01020059; const int R::id::textImeMultiLine=0x0102004d; const int R::id::textLongMessage=0x01020053; const int R::id::textMultiLine=0x0102004c; const int R::id::textNoSuggestions=0x0102004e; const int R::id::textPassword=0x01020056; const int R::id::textPersonName=0x01020054; const int R::id::textPhonetic=0x0102005a; const int R::id::textPostalAddress=0x01020055; const int R::id::textShortMessage=0x01020052; const int R::id::textStart=0x0102018c; const int R::id::textUri=0x0102004f; const int R::id::textVisiblePassword=0x01020057; const int R::id::textWebEditText=0x01020058; const int R::id::textWebEmailAddress=0x0102005b; const int R::id::textWebPassword=0x0102005c; const int R::id::three=0x010203a9; const int R::id::time=0x01020064; const int R::id::timeDisplayBackground=0x010202f3; const int R::id::timeDisplayForeground=0x010202f4; const int R::id::timePicker=0x010203a5; const int R::id::time_current=0x01020329; const int R::id::title=0x01020016; const int R::id::titleDivider=0x0102026b; const int R::id::titleDividerTop=0x01020272; const int R::id::title_container=0x01020252; const int R::id::title_separator=0x01020388; const int R::id::title_template=0x01020269; const int R::id::to_common=0x0102038b; const int R::id::to_common_header=0x0102038a; const int R::id::to_org=0x0102038d; const int R::id::to_org_header=0x0102038c; const int R::id::to_org_unit=0x0102038f; const int R::id::to_org_unit_header=0x0102038e; const int R::id::together=0x010201ef; const int R::id::toggle=0x01020017; const int R::id::top=0x01020074; const int R::id::topDisplayGroup=0x01020300; const int R::id::topHeader=0x010202e2; const int R::id::topPanel=0x01020268; const int R::id::top_action_bar=0x01020370; const int R::id::top_to_bottom=0x010201e9; const int R::id::touchscreen=0x0102022f; const int R::id::trackball=0x01020243; const int R::id::translucent=0x010201e0; const int R::id::transparent=0x010201df; const int R::id::transport=0x010202f9; const int R::id::transport_bg_protect=0x010202fb; const int R::id::transport_controls=0x01020315; const int R::id::twelvekey=0x01020240; const int R::id::two=0x010203a8; const int R::id::twoLine=0x010201d1; const int R::id::typeAllMask=0x010201a7; const int R::id::typeNotificationStateChanged=0x0102019f; const int R::id::typeTouchExplorationGestureEnd=0x010201a3; const int R::id::typeTouchExplorationGestureStart=0x010201a2; const int R::id::typeViewClicked=0x01020199; const int R::id::typeViewFocused=0x0102019c; const int R::id::typeViewHoverEnter=0x010201a0; const int R::id::typeViewHoverExit=0x010201a1; const int R::id::typeViewLongClicked=0x0102019a; const int R::id::typeViewScrolled=0x010201a5; const int R::id::typeViewSelected=0x0102019b; const int R::id::typeViewTextChanged=0x0102019d; const int R::id::typeViewTextSelectionChanged=0x010201a6; const int R::id::typeWindowContentChanged=0x010201a4; const int R::id::typeWindowStateChanged=0x0102019e; const int R::id::uiMode=0x01020235; const int R::id::unbounded=0x01020206; const int R::id::undefined=0x0102023a; const int R::id::unlock_widget=0x01020308; const int R::id::unmount_button=0x010203b4; const int R::id::unspecified=0x01020222; const int R::id::up=0x01020258; const int R::id::useLogo=0x01020209; const int R::id::user=0x01020210; const int R::id::userSwitcher=0x01020213; const int R::id::validity_header=0x01020398; const int R::id::value=0x010202b1; const int R::id::vertical=0x01020085; const int R::id::viewEnd=0x0102018f; const int R::id::viewStart=0x0102018e; const int R::id::view_flipper=0x010202c7; const int R::id::visible=0x01020175; const int R::id::visible_panel=0x010203b5; const int R::id::voice=0x01020202; const int R::id::volume_icon=0x0102032b; const int R::id::volume_slider=0x0102032c; const int R::id::web=0x01020080; const int R::id::websearch=0x010203c9; const int R::id::webview=0x010203b9; const int R::id::wheel=0x01020244; const int R::id::widget=0x01020211; const int R::id::widget_frame=0x01020018; const int R::id::widgets=0x01020215; const int R::id::wifi_p2p_wps_pin=0x010203bd; const int R::id::withText=0x010201fd; const int R::id::words=0x010201ca; const int R::id::wrap_content=0x0102003a; const int R::id::xhdpi=0x0102024e; const int R::id::xlarge=0x0102024a; const int R::id::year=0x0102028e; const int R::id::yes=0x01020190; const int R::id::zero=0x010203b0; const int R::id::zoomControls=0x010203c1; const int R::id::zoomIn=0x010203c3; const int R::id::zoomMagnify=0x010203c4; const int R::id::zoomOut=0x010203c2; const int R::id::zoom_fit_page=0x010203bf; const int R::id::zoom_page_overview=0x010203c0; const int R::integer::config_MaxConcurrentDownloadsAllowed=0x010e0032; const int R::integer::config_activityDefaultDur=0x010e0007; const int R::integer::config_activityShortDur=0x010e0006; const int R::integer::config_carDockKeepsScreenOn=0x010e0014; const int R::integer::config_carDockRotation=0x010e0011; const int R::integer::config_criticalBatteryWarningLevel=0x010e0018; const int R::integer::config_cursorWindowSize=0x010e0034; const int R::integer::config_datause_notification_type=0x010e002d; const int R::integer::config_datause_polling_period_sec=0x010e002a; const int R::integer::config_datause_threshold_bytes=0x010e002b; const int R::integer::config_datause_throttle_kbitsps=0x010e002c; const int R::integer::config_defaultNotificationLedOff=0x010e001d; const int R::integer::config_defaultNotificationLedOn=0x010e001c; const int R::integer::config_defaultUiModeType=0x010e0012; const int R::integer::config_defaultWallPaper_height=0x010e0039; const int R::integer::config_defaultWallPaper_width=0x010e0038; const int R::integer::config_deskDockKeepsScreenOn=0x010e0013; const int R::integer::config_deskDockRotation=0x010e0010; const int R::integer::config_downloadDataDirLowSpaceThreshold=0x010e0033; const int R::integer::config_downloadDataDirSize=0x010e0031; const int R::integer::config_lidKeyboardAccessibility=0x010e0015; const int R::integer::config_lidNavigationAccessibility=0x010e0016; const int R::integer::config_lidOpenRotation=0x010e000f; const int R::integer::config_lightSensorWarmupTime=0x010e0028; const int R::integer::config_lockSoundVolumeDb=0x010e0005; const int R::integer::config_longAnimTime=0x010e0002; const int R::integer::config_longPressOnHomeBehavior=0x010e0023; const int R::integer::config_longPressOnPowerBehavior=0x010e0017; const int R::integer::config_lowBatteryCloseWarningLevel=0x010e001b; const int R::integer::config_lowBatteryWarningLevel=0x010e001a; const int R::integer::config_maxResolverActivityColumns=0x010e0037; const int R::integer::config_max_pan_devices=0x010e000a; const int R::integer::config_mediumAnimTime=0x010e0001; const int R::integer::config_multiuserMaximumUsers=0x010e003a; const int R::integer::config_networkPolicyDefaultWarning=0x010e0036; const int R::integer::config_networkTransitionTimeout=0x010e0009; const int R::integer::config_notificationsBatteryFullARGB=0x010e0020; const int R::integer::config_notificationsBatteryLedOff=0x010e0022; const int R::integer::config_notificationsBatteryLedOn=0x010e0021; const int R::integer::config_notificationsBatteryLowARGB=0x010e001e; const int R::integer::config_notificationsBatteryMediumARGB=0x010e001f; const int R::integer::config_ntpTimeout=0x010e0035; const int R::integer::config_radioScanningTimeout=0x010e0008; const int R::integer::config_safe_media_volume_index=0x010e003b; const int R::integer::config_screenBrightnessDim=0x010e0027; const int R::integer::config_screenBrightnessSettingDefault=0x010e0026; const int R::integer::config_screenBrightnessSettingMaximum=0x010e0025; const int R::integer::config_screenBrightnessSettingMinimum=0x010e0024; const int R::integer::config_shortAnimTime=0x010e0000; const int R::integer::config_shutdownBatteryTemperature=0x010e0019; const int R::integer::config_soundEffectVolumeDb=0x010e0004; const int R::integer::config_virtualKeyQuietTimeMillis=0x010e0029; const int R::integer::config_wifi_driver_stop_delay=0x010e000e; const int R::integer::config_wifi_framework_scan_interval=0x010e000d; const int R::integer::config_wifi_scan_interval_p2p_connected=0x010e000c; const int R::integer::config_wifi_supplicant_scan_interval=0x010e000b; const int R::integer::db_connection_pool_size=0x010e002e; const int R::integer::db_journal_size_limit=0x010e002f; const int R::integer::db_wal_autocheckpoint=0x010e0030; const int R::integer::kg_carousel_angle=0x010e0041; const int R::integer::kg_glowpad_rotation_offset=0x010e0044; const int R::integer::kg_security_fade_duration=0x010e0043; const int R::integer::kg_security_flip_duration=0x010e0042; const int R::integer::kg_security_flipper_weight=0x010e0047; const int R::integer::kg_selector_gravity=0x010e0045; const int R::integer::kg_widget_region_weight=0x010e0046; const int R::integer::max_action_buttons=0x010e003c; const int R::integer::preference_fragment_scrollbarStyle=0x010e0040; const int R::integer::preference_screen_header_scrollbarStyle=0x010e003f; const int R::integer::preferences_left_pane_weight=0x010e003d; const int R::integer::preferences_right_pane_weight=0x010e003e; const int R::integer::status_bar_notification_info_maxnum=0x010e0003; const int R::interpolator::accelerate_cubic=0x010c0002; const int R::interpolator::accelerate_decelerate=0x010c0006; const int R::interpolator::accelerate_quad=0x010c0000; const int R::interpolator::accelerate_quint=0x010c0004; const int R::interpolator::anticipate=0x010c0007; const int R::interpolator::anticipate_overshoot=0x010c0009; const int R::interpolator::bounce=0x010c000a; const int R::interpolator::cycle=0x010c000c; const int R::interpolator::decelerate_cubic=0x010c0003; const int R::interpolator::decelerate_quad=0x010c0001; const int R::interpolator::decelerate_quint=0x010c0005; const int R::interpolator::linear=0x010c000b; const int R::interpolator::overshoot=0x010c0008; const int R::layout::action_bar_home=0x01090018; const int R::layout::action_bar_title_item=0x01090019; const int R::layout::action_menu_item_layout=0x0109001a; const int R::layout::action_menu_layout=0x0109001b; const int R::layout::action_mode_bar=0x0109001c; const int R::layout::action_mode_close_item=0x0109001d; const int R::layout::activity_chooser_view=0x0109001e; const int R::layout::activity_chooser_view_list_item=0x0109001f; const int R::layout::activity_list=0x01090020; const int R::layout::activity_list_item=0x01090000; const int R::layout::activity_list_item_2=0x01090021; const int R::layout::adaptive_notification_wrapper=0x01090022; const int R::layout::alert_dialog=0x01090023; const int R::layout::alert_dialog_holo=0x01090024; const int R::layout::alert_dialog_progress=0x01090025; const int R::layout::alert_dialog_progress_holo=0x01090026; const int R::layout::always_use_checkbox=0x01090027; const int R::layout::am_compat_mode_dialog=0x01090028; const int R::layout::app_permission_item=0x01090029; const int R::layout::app_permission_item_money=0x0109002a; const int R::layout::app_permission_item_old=0x0109002b; const int R::layout::app_perms_summary=0x0109002c; const int R::layout::auto_complete_list=0x0109002d; const int R::layout::breadcrumbs_in_fragment=0x0109002e; const int R::layout::browser_link_context_header=0x0109000e; const int R::layout::calendar_view=0x0109002f; const int R::layout::character_picker=0x01090030; const int R::layout::character_picker_button=0x01090031; const int R::layout::choose_account=0x01090032; const int R::layout::choose_account_row=0x01090033; const int R::layout::choose_account_type=0x01090034; const int R::layout::choose_type_and_account=0x01090035; const int R::layout::date_picker=0x01090036; const int R::layout::date_picker_dialog=0x01090037; const int R::layout::date_picker_holo=0x01090038; const int R::layout::default_navigation=0x01090039; const int R::layout::dialog_custom_title=0x0109003a; const int R::layout::dialog_custom_title_holo=0x0109003b; const int R::layout::dialog_title=0x0109003c; const int R::layout::dialog_title_holo=0x0109003d; const int R::layout::dialog_title_icons=0x0109003e; const int R::layout::dialog_title_icons_holo=0x0109003f; const int R::layout::expandable_list_content=0x01090001; const int R::layout::expanded_menu_layout=0x01090040; const int R::layout::fragment_bread_crumb_item=0x01090041; const int R::layout::fragment_bread_crumbs=0x01090042; const int R::layout::global_actions_item=0x01090043; const int R::layout::global_actions_silent_mode=0x01090044; const int R::layout::grant_credentials_permission=0x01090045; const int R::layout::heavy_weight_switcher=0x01090046; const int R::layout::icon_menu_item_layout=0x01090047; const int R::layout::icon_menu_layout=0x01090048; const int R::layout::input_method=0x01090049; const int R::layout::input_method_extract_view=0x0109004a; const int R::layout::input_method_switch_dialog_title=0x0109004b; const int R::layout::js_prompt=0x0109004c; const int R::layout::keyboard_key_preview=0x0109004d; const int R::layout::keyboard_popup_keyboard=0x0109004e; const int R::layout::keyguard=0x0109004f; const int R::layout::keyguard_account_view=0x01090050; const int R::layout::keyguard_add_widget=0x01090051; const int R::layout::keyguard_eca=0x010900ee; const int R::layout::keyguard_emergency_carrier_area=0x01090052; const int R::layout::keyguard_emergency_carrier_area_empty=0x01090053; const int R::layout::keyguard_face_unlock_view=0x01090054; const int R::layout::keyguard_glow_pad_container=0x01090055; const int R::layout::keyguard_glow_pad_view=0x01090056; const int R::layout::keyguard_host_view=0x01090057; const int R::layout::keyguard_message_area=0x01090058; const int R::layout::keyguard_message_area_large=0x01090059; const int R::layout::keyguard_multi_user_avatar=0x0109005a; const int R::layout::keyguard_multi_user_selector=0x0109005b; const int R::layout::keyguard_multi_user_selector_widget=0x0109005c; const int R::layout::keyguard_navigation=0x0109005d; const int R::layout::keyguard_password_view=0x0109005e; const int R::layout::keyguard_pattern_view=0x0109005f; const int R::layout::keyguard_pin_view=0x01090060; const int R::layout::keyguard_screen_glogin_unlock=0x01090061; const int R::layout::keyguard_screen_lock=0x01090062; const int R::layout::keyguard_screen_password_landscape=0x01090063; const int R::layout::keyguard_screen_password_portrait=0x01090064; const int R::layout::keyguard_screen_sim_pin_landscape=0x01090065; const int R::layout::keyguard_screen_sim_pin_portrait=0x01090066; const int R::layout::keyguard_screen_sim_puk_landscape=0x01090067; const int R::layout::keyguard_screen_sim_puk_portrait=0x01090068; const int R::layout::keyguard_screen_status_land=0x01090069; const int R::layout::keyguard_screen_status_port=0x0109006a; const int R::layout::keyguard_screen_tab_unlock=0x0109006b; const int R::layout::keyguard_screen_tab_unlock_land=0x0109006c; const int R::layout::keyguard_screen_unlock_landscape=0x0109006d; const int R::layout::keyguard_screen_unlock_portrait=0x0109006e; const int R::layout::keyguard_selector_view=0x0109006f; const int R::layout::keyguard_sim_pin_view=0x01090070; const int R::layout::keyguard_sim_puk_pin_account_navigation=0x01090071; const int R::layout::keyguard_sim_puk_pin_navigation=0x01090072; const int R::layout::keyguard_sim_puk_view=0x01090073; const int R::layout::keyguard_status_area=0x01090074; const int R::layout::keyguard_status_view=0x01090075; const int R::layout::keyguard_transport_control=0x01090076; const int R::layout::keyguard_transport_control_view=0x01090077; const int R::layout::keyguard_widget_pager=0x01090078; const int R::layout::keyguard_widget_remove_drop_target=0x01090079; const int R::layout::launch_warning=0x0109007a; const int R::layout::list_content=0x01090014; const int R::layout::list_content_simple=0x0109007b; const int R::layout::list_gestures_overlay=0x0109007c; const int R::layout::list_menu_item_checkbox=0x0109007d; const int R::layout::list_menu_item_icon=0x0109007e; const int R::layout::list_menu_item_layout=0x0109007f; const int R::layout::list_menu_item_radio=0x01090080; const int R::layout::locale_picker_item=0x01090081; const int R::layout::media_controller=0x01090082; const int R::layout::media_route_chooser_layout=0x01090083; const int R::layout::media_route_list_item=0x01090084; const int R::layout::media_route_list_item_checkable=0x01090085; const int R::layout::media_route_list_item_collapse_group=0x01090086; const int R::layout::media_route_list_item_section_header=0x01090087; const int R::layout::media_route_list_item_top_header=0x01090088; const int R::layout::menu_item=0x01090089; const int R::layout::notification_action=0x0109008a; const int R::layout::notification_action_list=0x0109008b; const int R::layout::notification_action_tombstone=0x0109008c; const int R::layout::notification_intruder_content=0x0109008d; const int R::layout::notification_template_base=0x0109008e; const int R::layout::notification_template_big_base=0x0109008f; const int R::layout::notification_template_big_picture=0x01090090; const int R::layout::notification_template_big_text=0x01090091; const int R::layout::notification_template_inbox=0x01090092; const int R::layout::notification_template_part_chronometer=0x01090093; const int R::layout::notification_template_part_time=0x01090094; const int R::layout::number_picker=0x01090095; const int R::layout::number_picker_with_selector_wheel=0x01090096; const int R::layout::overlay_display_window=0x01090097; const int R::layout::permissions_account_and_authtokentype=0x01090098; const int R::layout::permissions_package_list_item=0x01090099; const int R::layout::popup_menu_item_layout=0x0109009a; const int R::layout::power_dialog=0x0109009b; const int R::layout::preference=0x0109009c; const int R::layout::preference_category=0x01090002; const int R::layout::preference_category_holo=0x0109009d; const int R::layout::preference_child=0x0109009e; const int R::layout::preference_child_holo=0x0109009f; const int R::layout::preference_dialog_edittext=0x010900a0; const int R::layout::preference_header_item=0x010900a1; const int R::layout::preference_holo=0x010900a2; const int R::layout::preference_information=0x010900a3; const int R::layout::preference_information_holo=0x010900a4; const int R::layout::preference_list_content=0x010900a5; const int R::layout::preference_list_content_single=0x010900a6; const int R::layout::preference_list_fragment=0x010900a7; const int R::layout::preference_widget_checkbox=0x010900a8; const int R::layout::preference_widget_seekbar=0x010900a9; const int R::layout::preference_widget_switch=0x010900aa; const int R::layout::preferences=0x010900ab; const int R::layout::progress_dialog=0x010900ac; const int R::layout::progress_dialog_holo=0x010900ad; const int R::layout::recent_apps_dialog=0x010900ae; const int R::layout::recent_apps_icon=0x010900af; const int R::layout::remote_views_adapter_default_loading_view=0x010900b0; const int R::layout::resolve_list_item=0x010900b1; const int R::layout::resolver_grid=0x010900b2; const int R::layout::safe_mode=0x010900b3; const int R::layout::screen=0x010900b4; const int R::layout::screen_action_bar=0x010900b5; const int R::layout::screen_action_bar_overlay=0x010900b6; const int R::layout::screen_custom_title=0x010900b7; const int R::layout::screen_progress=0x010900b8; const int R::layout::screen_simple=0x010900b9; const int R::layout::screen_simple_overlay_action_mode=0x010900ba; const int R::layout::screen_title=0x010900bb; const int R::layout::screen_title_icons=0x010900bc; const int R::layout::search_bar=0x010900bd; const int R::layout::search_dropdown_item_1line=0x010900be; const int R::layout::search_dropdown_item_icons_2line=0x010900bf; const int R::layout::search_view=0x010900c0; const int R::layout::seekbar_dialog=0x010900c1; const int R::layout::select_dialog=0x010900c2; const int R::layout::select_dialog_holo=0x010900c3; const int R::layout::select_dialog_item=0x01090011; const int R::layout::select_dialog_item_holo=0x010900c4; const int R::layout::select_dialog_multichoice=0x01090013; const int R::layout::select_dialog_multichoice_holo=0x010900c5; const int R::layout::select_dialog_singlechoice=0x01090012; const int R::layout::select_dialog_singlechoice_holo=0x010900c6; const int R::layout::simple_dropdown_hint=0x010900c7; const int R::layout::simple_dropdown_item_1line=0x0109000a; const int R::layout::simple_dropdown_item_2line=0x010900c8; const int R::layout::simple_expandable_list_item_1=0x01090006; const int R::layout::simple_expandable_list_item_2=0x01090007; const int R::layout::simple_gallery_item=0x0109000b; const int R::layout::simple_list_item_1=0x01090003; const int R::layout::simple_list_item_2=0x01090004; const int R::layout::simple_list_item_2_single_choice=0x010900c9; const int R::layout::simple_list_item_activated_1=0x01090016; const int R::layout::simple_list_item_activated_2=0x01090017; const int R::layout::simple_list_item_checked=0x01090005; const int R::layout::simple_list_item_multiple_choice=0x01090010; const int R::layout::simple_list_item_single_choice=0x0109000f; const int R::layout::simple_selectable_list_item=0x01090015; const int R::layout::simple_spinner_dropdown_item=0x01090009; const int R::layout::simple_spinner_item=0x01090008; const int R::layout::sms_short_code_confirmation_dialog=0x010900ca; const int R::layout::ssl_certificate=0x010900cb; const int R::layout::status_bar_latest_event_content=0x010900cc; const int R::layout::status_bar_latest_event_ticker=0x010900cd; const int R::layout::status_bar_latest_event_ticker_large_icon=0x010900ce; const int R::layout::tab_content=0x010900cf; const int R::layout::tab_indicator=0x010900d0; const int R::layout::tab_indicator_holo=0x010900d1; const int R::layout::test_list_item=0x0109000c; const int R::layout::text_drag_thumbnail=0x010900d2; const int R::layout::text_edit_action_popup_text=0x010900d3; const int R::layout::text_edit_no_paste_window=0x010900d4; const int R::layout::text_edit_paste_window=0x010900d5; const int R::layout::text_edit_side_no_paste_window=0x010900d6; const int R::layout::text_edit_side_paste_window=0x010900d7; const int R::layout::text_edit_suggestion_item=0x010900d8; const int R::layout::text_edit_suggestions_window=0x010900d9; const int R::layout::textview_hint=0x010900da; const int R::layout::time_picker=0x010900db; const int R::layout::time_picker_dialog=0x010900dc; const int R::layout::time_picker_holo=0x010900dd; const int R::layout::transient_notification=0x010900de; const int R::layout::twelve_key_entry=0x010900df; const int R::layout::two_line_list_item=0x0109000d; const int R::layout::typing_filter=0x010900e0; const int R::layout::usb_storage_activity=0x010900e1; const int R::layout::volume_adjust=0x010900e2; const int R::layout::volume_adjust_item=0x010900e3; const int R::layout::web_runtime=0x010900e4; const int R::layout::web_text_view_dropdown=0x010900e5; const int R::layout::webview_find=0x010900e6; const int R::layout::webview_select_singlechoice=0x010900e7; const int R::layout::wifi_p2p_dialog=0x010900e8; const int R::layout::wifi_p2p_dialog_row=0x010900e9; const int R::layout::zoom_browser_accessory_buttons=0x010900ea; const int R::layout::zoom_container=0x010900eb; const int R::layout::zoom_controls=0x010900ec; const int R::layout::zoom_magnify=0x010900ed; const int R::menu::webview_copy=0x01140000; const int R::menu::webview_find=0x01140001; const int R::mipmap::sym_app_on_sd_unavailable_icon=0x010d0001; const int R::mipmap::sym_def_app_icon=0x010d0000; const int R::plurals::abbrev_in_num_days=0x01130010; const int R::plurals::abbrev_in_num_hours=0x0113000f; const int R::plurals::abbrev_in_num_minutes=0x0113000e; const int R::plurals::abbrev_in_num_seconds=0x0113000d; const int R::plurals::abbrev_num_days_ago=0x0113000c; const int R::plurals::abbrev_num_hours_ago=0x0113000b; const int R::plurals::abbrev_num_minutes_ago=0x0113000a; const int R::plurals::abbrev_num_seconds_ago=0x01130009; const int R::plurals::in_num_days=0x01130008; const int R::plurals::in_num_hours=0x01130007; const int R::plurals::in_num_minutes=0x01130006; const int R::plurals::in_num_seconds=0x01130005; const int R::plurals::last_num_days=0x01130003; const int R::plurals::matches_found=0x01130013; const int R::plurals::num_days_ago=0x01130004; const int R::plurals::num_hours_ago=0x01130002; const int R::plurals::num_minutes_ago=0x01130001; const int R::plurals::num_seconds_ago=0x01130000; const int R::plurals::wifi_available=0x01130011; const int R::plurals::wifi_available_detailed=0x01130012; const int R::raw::accessibility_gestures=0x01100000; const int R::raw::fallbackring=0x01100001; const int R::raw::incognito_mode_start_page=0x01100002; const int R::raw::loaderror=0x01100003; const int R::raw::nodomain=0x01100004; const int R::string::BaMmi=0x0104008b; const int R::string::CLIRDefaultOffNextCallOff=0x01040097; const int R::string::CLIRDefaultOffNextCallOn=0x01040096; const int R::string::CLIRDefaultOnNextCallOff=0x01040095; const int R::string::CLIRDefaultOnNextCallOn=0x01040094; const int R::string::CLIRPermanent=0x01040099; const int R::string::CfMmi=0x01040089; const int R::string::ClipMmi=0x01040087; const int R::string::ClirMmi=0x01040088; const int R::string::CndMmi=0x01040092; const int R::string::CnipMmi=0x0104008e; const int R::string::CnirMmi=0x0104008f; const int R::string::CwMmi=0x0104008a; const int R::string::DndMmi=0x01040093; const int R::string::Midnight=0x010403be; const int R::string::Noon=0x010403bc; const int R::string::PinMmi=0x0104008d; const int R::string::PwdMmi=0x0104008c; const int R::string::RestrictedChangedTitle=0x0104009a; const int R::string::RestrictedOnAll=0x010400a2; const int R::string::RestrictedOnAllVoice=0x0104009e; const int R::string::RestrictedOnData=0x0104009b; const int R::string::RestrictedOnEmergency=0x0104009c; const int R::string::RestrictedOnNormal=0x0104009d; const int R::string::RestrictedOnSms=0x0104009f; const int R::string::RestrictedOnVoiceData=0x010400a0; const int R::string::RestrictedOnVoiceSms=0x010400a1; const int R::string::RuacMmi=0x01040091; const int R::string::SetupCallDefault=0x0104052c; const int R::string::ThreeWCMmi=0x01040090; const int R::string::VideoView_error_button=0x01040010; const int R::string::VideoView_error_text_invalid_progressive_playback=0x01040015; const int R::string::VideoView_error_text_unknown=0x01040011; const int R::string::VideoView_error_title=0x01040012; const int R::string::abbrev_month=0x0104003f; const int R::string::abbrev_month_day=0x0104003e; const int R::string::abbrev_month_day_year=0x0104003a; const int R::string::abbrev_month_year=0x01040040; const int R::string::abbrev_wday_month_day_no_year=0x01040063; const int R::string::abbrev_wday_month_day_year=0x01040064; const int R::string::accept=0x01040412; const int R::string::accessibility_binding_label=0x010404a3; const int R::string::accessibility_enabled=0x01040567; const int R::string::action_bar_home_description=0x01040502; const int R::string::action_bar_up_description=0x01040503; const int R::string::action_menu_overflow_description=0x01040504; const int R::string::action_mode_done=0x010404c0; const int R::string::activity_chooser_view_dialog_title_default=0x01040526; const int R::string::activity_chooser_view_see_all=0x01040525; const int R::string::activity_list_empty=0x01040488; const int R::string::activity_resolver_use_always=0x0104052d; const int R::string::activity_resolver_use_once=0x0104052e; const int R::string::activitychooserview_choose_application=0x010404f2; const int R::string::adb_active_notification_message=0x01040455; const int R::string::adb_active_notification_title=0x01040454; const int R::string::addToDictionary=0x010403c4; const int R::string::add_account_button_label=0x010404da; const int R::string::add_account_label=0x010404d9; const int R::string::aerr_application=0x010403d4; const int R::string::aerr_process=0x010403d5; const int R::string::aerr_title=0x010403d3; const int R::string::allow=0x0104049d; const int R::string::alternate_eri_file=0x010404a6; const int R::string::alwaysUse=0x010403ce; const int R::string::android_system_label=0x010400f1; const int R::string::android_upgrading_apk=0x010403e8; const int R::string::android_upgrading_complete=0x010403ea; const int R::string::android_upgrading_starting_apps=0x010403e9; const int R::string::android_upgrading_title=0x010403e7; const int R::string::anr_activity_application=0x010403d7; const int R::string::anr_activity_process=0x010403d8; const int R::string::anr_application_process=0x010403d9; const int R::string::anr_process=0x010403da; const int R::string::anr_title=0x010403d6; const int R::string::autofill_address_line_1_label_re=0x01040350; const int R::string::autofill_address_line_1_re=0x0104034f; const int R::string::autofill_address_line_2_re=0x01040351; const int R::string::autofill_address_line_3_re=0x01040352; const int R::string::autofill_address_name_separator=0x01040348; const int R::string::autofill_address_summary_format=0x0104034b; const int R::string::autofill_address_summary_name_format=0x01040349; const int R::string::autofill_address_summary_separator=0x0104034a; const int R::string::autofill_address_type_same_as_re=0x01040358; const int R::string::autofill_address_type_use_my_re=0x01040359; const int R::string::autofill_area=0x0104037f; const int R::string::autofill_area_code_notext_re=0x01040372; const int R::string::autofill_area_code_re=0x01040365; const int R::string::autofill_attention_ignored_re=0x0104034c; const int R::string::autofill_billing_designator_re=0x0104035a; const int R::string::autofill_card_cvc_re=0x0104036b; const int R::string::autofill_card_ignored_re=0x0104036f; const int R::string::autofill_card_number_re=0x0104036c; const int R::string::autofill_city_re=0x01040356; const int R::string::autofill_company_re=0x0104034e; const int R::string::autofill_country_code_re=0x01040371; const int R::string::autofill_country_re=0x01040353; const int R::string::autofill_county=0x01040379; const int R::string::autofill_department=0x0104037c; const int R::string::autofill_district=0x0104037b; const int R::string::autofill_email_re=0x0104035c; const int R::string::autofill_emirate=0x01040380; const int R::string::autofill_expiration_date_re=0x0104036e; const int R::string::autofill_expiration_month_re=0x0104036d; const int R::string::autofill_fax_re=0x01040370; const int R::string::autofill_first_name_re=0x01040360; const int R::string::autofill_island=0x0104037a; const int R::string::autofill_last_name_re=0x01040363; const int R::string::autofill_middle_initial_re=0x01040361; const int R::string::autofill_middle_name_re=0x01040362; const int R::string::autofill_name_on_card_contextual_re=0x0104036a; const int R::string::autofill_name_on_card_re=0x01040369; const int R::string::autofill_name_re=0x0104035e; const int R::string::autofill_name_specific_re=0x0104035f; const int R::string::autofill_parish=0x0104037e; const int R::string::autofill_phone_extension_re=0x01040368; const int R::string::autofill_phone_prefix_re=0x01040366; const int R::string::autofill_phone_prefix_separator_re=0x01040373; const int R::string::autofill_phone_re=0x01040364; const int R::string::autofill_phone_suffix_re=0x01040367; const int R::string::autofill_phone_suffix_separator_re=0x01040374; const int R::string::autofill_postal_code=0x01040376; const int R::string::autofill_prefecture=0x0104037d; const int R::string::autofill_province=0x01040375; const int R::string::autofill_region_ignored_re=0x0104034d; const int R::string::autofill_shipping_designator_re=0x0104035b; const int R::string::autofill_state=0x01040377; const int R::string::autofill_state_re=0x01040357; const int R::string::autofill_this_form=0x01040346; const int R::string::autofill_username_re=0x0104035d; const int R::string::autofill_zip_4_re=0x01040355; const int R::string::autofill_zip_code=0x01040378; const int R::string::autofill_zip_code_re=0x01040354; const int R::string::back_button_label=0x010404b7; const int R::string::badPin=0x0104007e; const int R::string::badPuk=0x0104007f; const int R::string::beforeOneMonthDurationPast=0x010403a8; const int R::string::bluetooth_a2dp_audio_route_name=0x01040534; const int R::string::bugreport_message=0x010400e9; const int R::string::bugreport_title=0x010400e8; const int R::string::byteShort=0x0104006c; const int R::string::cancel=0x01040000; const int R::string::candidates_style=0x0104045f; const int R::string::capital_off=0x010403cc; const int R::string::capital_on=0x010403cb; const int R::string::car_mode_disable_notification_message=0x010404b4; const int R::string::car_mode_disable_notification_title=0x010404b3; const int R::string::cfTemplateForwarded=0x010400ba; const int R::string::cfTemplateForwardedTime=0x010400bb; const int R::string::cfTemplateNotForwarded=0x010400b9; const int R::string::cfTemplateRegistered=0x010400bc; const int R::string::cfTemplateRegisteredTime=0x010400bd; const int R::string::chooseActivity=0x010403d0; const int R::string::chooseUsbActivity=0x010403d1; const int R::string::choose_account_label=0x010404d8; const int R::string::chooser_wallpaper=0x010404a5; const int R::string::clearDefaultHintMsg=0x010403cf; const int R::string::common_last_name_prefixes=0x01040067; const int R::string::common_name=0x0104051a; const int R::string::common_name_conjunctions=0x01040068; const int R::string::common_name_prefixes=0x01040065; const int R::string::common_name_suffixes=0x01040066; const int R::string::config_datause_iface=0x0104001e; const int R::string::config_default_dns_server=0x0104001f; const int R::string::config_dreamsDefaultComponent=0x0104002c; const int R::string::config_ethernet_iface_regex=0x01040018; const int R::string::config_isoImagePath=0x01040025; const int R::string::config_ntpServer=0x01040026; const int R::string::config_tether_apndata=0x01040019; const int R::string::config_useragentprofile_url=0x01040024; const int R::string::config_wifi_p2p_device_type=0x0104001a; const int R::string::config_wimaxManagerClassname=0x01040029; const int R::string::config_wimaxNativeLibLocation=0x01040028; const int R::string::config_wimaxServiceClassname=0x0104002a; const int R::string::config_wimaxServiceJarLocation=0x01040027; const int R::string::config_wimaxStateTrackerClassname=0x0104002b; const int R::string::configure_input_methods=0x01040458; const int R::string::contentServiceSync=0x010400cf; const int R::string::contentServiceSyncNotificationTitle=0x010400d0; const int R::string::contentServiceTooManyDeletesNotificationDesc=0x010400d1; const int R::string::content_description_sliding_handle=0x010404f5; const int R::string::continue_to_enable_accessibility=0x01040566; const int R::string::copy=0x01040001; const int R::string::copyUrl=0x01040002; const int R::string::create_contact_using=0x01040499; const int R::string::cut=0x01040003; const int R::string::data_usage_3g_limit_snoozed_title=0x01040510; const int R::string::data_usage_3g_limit_title=0x0104050b; const int R::string::data_usage_4g_limit_snoozed_title=0x01040511; const int R::string::data_usage_4g_limit_title=0x0104050c; const int R::string::data_usage_limit_body=0x0104050f; const int R::string::data_usage_limit_snoozed_body=0x01040514; const int R::string::data_usage_mobile_limit_snoozed_title=0x01040512; const int R::string::data_usage_mobile_limit_title=0x0104050d; const int R::string::data_usage_restricted_body=0x01040516; const int R::string::data_usage_restricted_title=0x01040515; const int R::string::data_usage_warning_body=0x0104050a; const int R::string::data_usage_warning_title=0x01040509; const int R::string::data_usage_wifi_limit_snoozed_title=0x01040513; const int R::string::data_usage_wifi_limit_title=0x0104050e; const int R::string::date1_date2=0x01040042; const int R::string::date1_time1_date2_time2=0x0104004d; const int R::string::date_and_time=0x01040037; const int R::string::date_picker_decrement_day_button=0x010404e8; const int R::string::date_picker_decrement_month_button=0x010404e6; const int R::string::date_picker_decrement_year_button=0x010404ea; const int R::string::date_picker_dialog_title=0x01040430; const int R::string::date_picker_increment_day_button=0x010404e7; const int R::string::date_picker_increment_month_button=0x010404e5; const int R::string::date_picker_increment_year_button=0x010404e9; const int R::string::date_time=0x01040038; const int R::string::date_time_done=0x01040432; const int R::string::date_time_set=0x01040431; const int R::string::day=0x010403ae; const int R::string::days=0x010403af; const int R::string::db_default_journal_mode=0x01040021; const int R::string::db_default_sync_mode=0x01040022; const int R::string::db_wal_sync_mode=0x01040023; const int R::string::decline=0x01040413; const int R::string::defaultMsisdnAlphaTag=0x01040005; const int R::string::defaultVoiceMailAlphaTag=0x01040004; const int R::string::default_audio_route_category_name=0x01040533; const int R::string::default_audio_route_name=0x0104052f; const int R::string::default_audio_route_name_dock_speakers=0x01040531; const int R::string::default_audio_route_name_headphones=0x01040530; const int R::string::default_media_route_name_hdmi=0x01040532; const int R::string::default_text_encoding=0x01040069; const int R::string::default_wallpaper_component=0x0104001d; const int R::string::delete_=0x010403c2; const int R::string::deleteText=0x010403c5; const int R::string::deny=0x0104049e; const int R::string::description_direction_down=0x010404f7; const int R::string::description_direction_left=0x010404f8; const int R::string::description_direction_right=0x010404f9; const int R::string::description_direction_up=0x010404f6; const int R::string::description_target_camera=0x010404fb; const int R::string::description_target_search=0x010404fe; const int R::string::description_target_silent=0x010404fc; const int R::string::description_target_soundon=0x010404fd; const int R::string::description_target_unlock=0x010404fa; const int R::string::description_target_unlock_tablet=0x010404ff; const int R::string::dial_number_using=0x01040498; const int R::string::dialog_alert_title=0x01040014; const int R::string::display_manager_built_in_display_name=0x0104053b; const int R::string::display_manager_hdmi_display_name=0x0104053c; const int R::string::display_manager_overlay_display_name=0x0104053d; const int R::string::display_manager_overlay_display_title=0x0104053e; const int R::string::dlg_confirm_kill_storage_users_text=0x01040449; const int R::string::dlg_confirm_kill_storage_users_title=0x01040448; const int R::string::dlg_error_title=0x0104044a; const int R::string::dlg_ok=0x0104044b; const int R::string::double_tap_toast=0x01040345; const int R::string::editTextMenuTitle=0x010403c7; const int R::string::elapsed_time_short_format_h_mm_ss=0x010403c0; const int R::string::elapsed_time_short_format_mm_ss=0x010403bf; const int R::string::ellipsis=0x01040073; const int R::string::ellipsis_two_dots=0x01040074; const int R::string::emailTypeCustom=0x010402af; const int R::string::emailTypeHome=0x010402b0; const int R::string::emailTypeMobile=0x010402b3; const int R::string::emailTypeOther=0x010402b2; const int R::string::emailTypeWork=0x010402b1; const int R::string::emergency_call_dialog_number_for_display=0x010402e5; const int R::string::emergency_calls_only=0x01040300; const int R::string::emptyPhoneNumber=0x01040006; const int R::string::enable_accessibility_canceled=0x01040568; const int R::string::enable_explore_by_touch_warning_message=0x010403a6; const int R::string::enable_explore_by_touch_warning_title=0x010403a5; const int R::string::eventTypeAnniversary=0x010402ad; const int R::string::eventTypeBirthday=0x010402ac; const int R::string::eventTypeCustom=0x010402ab; const int R::string::eventTypeOther=0x010402ae; const int R::string::expires_on=0x01040520; const int R::string::ext2_media_badremoval_notification_message=0x0104047a; const int R::string::ext2_media_badremoval_notification_title=0x01040477; const int R::string::ext2_media_checking_notification_message=0x01040465; const int R::string::ext2_media_checking_notification_title=0x01040461; const int R::string::ext2_media_nofs_notification_message=0x0104046b; const int R::string::ext2_media_nofs_notification_title=0x01040467; const int R::string::ext2_media_nomedia_notification_message=0x01040486; const int R::string::ext2_media_nomedia_notification_title=0x01040483; const int R::string::ext2_media_safe_unmount_notification_message=0x01040480; const int R::string::ext2_media_safe_unmount_notification_title=0x0104047d; const int R::string::ext2_media_unmountable_notification_message=0x01040473; const int R::string::ext2_media_unmountable_notification_title=0x0104046f; const int R::string::ext_media_badremoval_notification_message=0x01040479; const int R::string::ext_media_badremoval_notification_title=0x01040476; const int R::string::ext_media_checking_notification_message=0x01040464; const int R::string::ext_media_checking_notification_title=0x01040460; const int R::string::ext_media_nofs_notification_message=0x0104046a; const int R::string::ext_media_nofs_notification_title=0x01040466; const int R::string::ext_media_nomedia_notification_message=0x01040485; const int R::string::ext_media_nomedia_notification_title=0x01040482; const int R::string::ext_media_safe_unmount_notification_message=0x0104047f; const int R::string::ext_media_safe_unmount_notification_title=0x0104047c; const int R::string::ext_media_unmountable_notification_message=0x01040472; const int R::string::ext_media_unmountable_notification_title=0x0104046e; const int R::string::external_storage_unplug_notification_message=0x01040443; const int R::string::external_storage_unplug_notification_title=0x01040442; const int R::string::extmedia_format_button_format=0x01040453; const int R::string::extmedia_format_message=0x01040452; const int R::string::extmedia_format_title=0x01040451; const int R::string::extract_edit_menu_button=0x01040508; const int R::string::faceunlock_multiple_failures=0x010402f0; const int R::string::factorytest_failed=0x0104033b; const int R::string::factorytest_no_action=0x0104033d; const int R::string::factorytest_not_system=0x0104033c; const int R::string::factorytest_reboot=0x0104033e; const int R::string::fast_scroll_alphabet=0x0104045d; const int R::string::fast_scroll_numeric_alphabet=0x0104045e; const int R::string::fcComplete=0x010400be; const int R::string::fcError=0x010400bf; const int R::string::fileSizeSuffix=0x01040072; const int R::string::find=0x010404ca; const int R::string::find_next=0x010404cc; const int R::string::find_on_page=0x010404bf; const int R::string::find_previous=0x010404cd; const int R::string::fingerprints=0x01040522; const int R::string::force_close=0x010403db; const int R::string::format_error=0x010404c3; const int R::string::full_wday_month_day_no_year=0x01040062; const int R::string::gadget_host_error_inflating=0x01040490; const int R::string::gigabyteShort=0x0104006f; const int R::string::global_action_bug_report=0x010400e7; const int R::string::global_action_lock=0x010400e5; const int R::string::global_action_power_off=0x010400e6; const int R::string::global_action_silent_mode_off_status=0x010400ec; const int R::string::global_action_silent_mode_on_status=0x010400eb; const int R::string::global_action_toggle_silent_mode=0x010400ea; const int R::string::global_actions=0x010400e4; const int R::string::global_actions_airplane_mode_off_status=0x010400ef; const int R::string::global_actions_airplane_mode_on_status=0x010400ee; const int R::string::global_actions_toggle_airplane_mode=0x010400ed; const int R::string::gpsNotifMessage=0x010404d0; const int R::string::gpsNotifTicker=0x010404ce; const int R::string::gpsNotifTitle=0x010404cf; const int R::string::gpsVerifNo=0x010404d2; const int R::string::gpsVerifYes=0x010404d1; const int R::string::grant_credentials_permission_message_footer=0x0104049b; const int R::string::grant_credentials_permission_message_header=0x0104049a; const int R::string::grant_permissions_header_text=0x0104049c; const int R::string::granularity_label_character=0x01040335; const int R::string::granularity_label_line=0x01040338; const int R::string::granularity_label_link=0x01040337; const int R::string::granularity_label_word=0x01040336; const int R::string::gsm_alphabet_default_charset=0x01040020; const int R::string::hardware=0x0104045a; const int R::string::heavy_weight_notification=0x010403eb; const int R::string::heavy_weight_notification_detail=0x010403ec; const int R::string::heavy_weight_switcher_text=0x010403ee; const int R::string::heavy_weight_switcher_title=0x010403ed; const int R::string::hour=0x010403b0; const int R::string::hour_ampm=0x01040339; const int R::string::hour_cap_ampm=0x0104033a; const int R::string::hour_minute_24=0x0104002d; const int R::string::hour_minute_ampm=0x0104002e; const int R::string::hour_minute_cap_ampm=0x0104002f; const int R::string::hours=0x010403b1; const int R::string::httpError=0x010400c1; const int R::string::httpErrorAuth=0x010400c4; const int R::string::httpErrorBadUrl=0x01040007; const int R::string::httpErrorConnect=0x010400c6; const int R::string::httpErrorFailedSslHandshake=0x010400ca; const int R::string::httpErrorFile=0x010400cb; const int R::string::httpErrorFileNotFound=0x010400cc; const int R::string::httpErrorIO=0x010400c7; const int R::string::httpErrorLookup=0x010400c2; const int R::string::httpErrorOk=0x010400c0; const int R::string::httpErrorProxyAuth=0x010400c5; const int R::string::httpErrorRedirectLoop=0x010400c9; const int R::string::httpErrorTimeout=0x010400c8; const int R::string::httpErrorTooManyRequests=0x010400cd; const int R::string::httpErrorUnsupportedAuthScheme=0x010400c3; const int R::string::httpErrorUnsupportedScheme=0x01040008; const int R::string::imProtocolAim=0x010402bd; const int R::string::imProtocolCustom=0x010402bc; const int R::string::imProtocolGoogleTalk=0x010402c2; const int R::string::imProtocolIcq=0x010402c3; const int R::string::imProtocolJabber=0x010402c4; const int R::string::imProtocolMsn=0x010402be; const int R::string::imProtocolNetMeeting=0x010402c5; const int R::string::imProtocolQq=0x010402c1; const int R::string::imProtocolSkype=0x010402c0; const int R::string::imProtocolYahoo=0x010402bf; const int R::string::imTypeCustom=0x010402b8; const int R::string::imTypeHome=0x010402b9; const int R::string::imTypeOther=0x010402bb; const int R::string::imTypeWork=0x010402ba; const int R::string::ime_action_default=0x01040497; const int R::string::ime_action_done=0x01040495; const int R::string::ime_action_go=0x01040491; const int R::string::ime_action_next=0x01040494; const int R::string::ime_action_previous=0x01040496; const int R::string::ime_action_search=0x01040492; const int R::string::ime_action_send=0x01040493; const int R::string::imei=0x01040085; const int R::string::inputMethod=0x010403c6; const int R::string::input_method_binding_label=0x010404a1; const int R::string::int_media_checking_notification_title=0x01040462; const int R::string::int_media_nofs_notification_message=0x0104046c; const int R::string::int_media_nofs_notification_title=0x01040468; const int R::string::int_media_unmountable_notification_message=0x01040474; const int R::string::int_media_unmountable_notification_title=0x01040470; const int R::string::invalidPin=0x01040081; const int R::string::invalidPuk=0x01040082; const int R::string::issued_by=0x0104051d; const int R::string::issued_on=0x0104051f; const int R::string::issued_to=0x01040519; const int R::string::js_dialog_before_unload=0x01040343; const int R::string::js_dialog_title=0x01040341; const int R::string::js_dialog_title_default=0x01040342; const int R::string::keyboard_headset_required_to_hear_password=0x01040500; const int R::string::keyboard_password_character_no_headset=0x01040501; const int R::string::keyboardview_keycode_alt=0x010404eb; const int R::string::keyboardview_keycode_cancel=0x010404ec; const int R::string::keyboardview_keycode_delete=0x010404ed; const int R::string::keyboardview_keycode_done=0x010404ee; const int R::string::keyboardview_keycode_enter=0x010404f1; const int R::string::keyboardview_keycode_mode_change=0x010404ef; const int R::string::keyboardview_keycode_shift=0x010404f0; const int R::string::keygaurd_accessibility_media_controls=0x01040326; const int R::string::keyguard_accessibility_add_widget=0x0104031e; const int R::string::keyguard_accessibility_camera=0x01040325; const int R::string::keyguard_accessibility_expand_lock_area=0x0104032a; const int R::string::keyguard_accessibility_face_unlock=0x0104032d; const int R::string::keyguard_accessibility_password_unlock=0x0104032f; const int R::string::keyguard_accessibility_pattern_area=0x01040330; const int R::string::keyguard_accessibility_pattern_unlock=0x0104032c; const int R::string::keyguard_accessibility_pin_unlock=0x0104032e; const int R::string::keyguard_accessibility_slide_area=0x01040331; const int R::string::keyguard_accessibility_slide_unlock=0x0104032b; const int R::string::keyguard_accessibility_status=0x01040324; const int R::string::keyguard_accessibility_unlock_area_collapsed=0x01040321; const int R::string::keyguard_accessibility_unlock_area_expanded=0x01040320; const int R::string::keyguard_accessibility_user_selector=0x01040323; const int R::string::keyguard_accessibility_widget=0x01040322; const int R::string::keyguard_accessibility_widget_deleted=0x01040329; const int R::string::keyguard_accessibility_widget_empty_slot=0x0104031f; const int R::string::keyguard_accessibility_widget_reorder_end=0x01040328; const int R::string::keyguard_accessibility_widget_reorder_start=0x01040327; const int R::string::keyguard_label_text=0x010402e4; const int R::string::keyguard_password_enter_password_code=0x010402e1; const int R::string::keyguard_password_enter_pin_code=0x010402dc; const int R::string::keyguard_password_enter_pin_password_code=0x010402e2; const int R::string::keyguard_password_enter_pin_prompt=0x010402df; const int R::string::keyguard_password_enter_puk_code=0x010402dd; const int R::string::keyguard_password_enter_puk_prompt=0x010402de; const int R::string::keyguard_password_entry_touch_hint=0x010402e0; const int R::string::keyguard_password_wrong_pin_code=0x010402e3; const int R::string::kg_emergency_call_label=0x01040542; const int R::string::kg_enter_confirm_pin_hint=0x0104054e; const int R::string::kg_failed_attempts_almost_at_login=0x01040562; const int R::string::kg_failed_attempts_almost_at_wipe=0x01040560; const int R::string::kg_failed_attempts_now_wiping=0x01040561; const int R::string::kg_forgot_pattern_button_text=0x01040543; const int R::string::kg_invalid_confirm_pin_hint=0x01040554; const int R::string::kg_invalid_puk=0x01040553; const int R::string::kg_invalid_sim_pin_hint=0x01040551; const int R::string::kg_invalid_sim_puk_hint=0x01040552; const int R::string::kg_login_account_recovery_hint=0x0104055b; const int R::string::kg_login_checking_password=0x0104055c; const int R::string::kg_login_instructions=0x01040556; const int R::string::kg_login_invalid_input=0x0104055a; const int R::string::kg_login_password_hint=0x01040558; const int R::string::kg_login_submit_button=0x01040559; const int R::string::kg_login_too_many_attempts=0x01040555; const int R::string::kg_login_username_hint=0x01040557; const int R::string::kg_password_instructions=0x0104054b; const int R::string::kg_password_wrong_pin_code=0x01040550; const int R::string::kg_pattern_instructions=0x01040548; const int R::string::kg_pin_instructions=0x0104054a; const int R::string::kg_puk_enter_pin_hint=0x0104054d; const int R::string::kg_puk_enter_puk_hint=0x0104054c; const int R::string::kg_reordering_delete_drop_target_text=0x01040564; const int R::string::kg_sim_pin_instructions=0x01040549; const int R::string::kg_sim_unlock_progress_dialog_message=0x0104054f; const int R::string::kg_text_message_separator=0x01040563; const int R::string::kg_too_many_failed_attempts_countdown=0x01040547; const int R::string::kg_too_many_failed_password_attempts_dialog_message=0x0104055e; const int R::string::kg_too_many_failed_pattern_attempts_dialog_message=0x0104055f; const int R::string::kg_too_many_failed_pin_attempts_dialog_message=0x0104055d; const int R::string::kg_wrong_password=0x01040545; const int R::string::kg_wrong_pattern=0x01040544; const int R::string::kg_wrong_pin=0x01040546; const int R::string::kilobyteShort=0x0104006d; const int R::string::last_month=0x010403a9; const int R::string::launchBrowserDefault=0x0104052b; const int R::string::launch_warning_original=0x010403e1; const int R::string::launch_warning_replace=0x010403e0; const int R::string::launch_warning_title=0x010403df; const int R::string::list_delimeter=0x01040529; const int R::string::loading=0x010403ca; const int R::string::locale_replacement=0x01040456; const int R::string::lock_pattern_view_aspect=0x0104006a; const int R::string::lockscreen_access_pattern_cell_added=0x0104031c; const int R::string::lockscreen_access_pattern_cleared=0x0104031b; const int R::string::lockscreen_access_pattern_detected=0x0104031d; const int R::string::lockscreen_access_pattern_start=0x0104031a; const int R::string::lockscreen_battery_short=0x010402f3; const int R::string::lockscreen_carrier_default=0x010402e6; const int R::string::lockscreen_charged=0x010402f2; const int R::string::lockscreen_emergency_call=0x010402eb; const int R::string::lockscreen_failed_attempts_almost_at_wipe=0x0104030a; const int R::string::lockscreen_failed_attempts_almost_glogin=0x01040309; const int R::string::lockscreen_failed_attempts_now_wiping=0x0104030b; const int R::string::lockscreen_forgot_pattern_button_text=0x0104030d; const int R::string::lockscreen_glogin_account_recovery_hint=0x01040315; const int R::string::lockscreen_glogin_checking_password=0x01040316; const int R::string::lockscreen_glogin_forgot_pattern=0x0104030e; const int R::string::lockscreen_glogin_instructions=0x01040310; const int R::string::lockscreen_glogin_invalid_input=0x01040314; const int R::string::lockscreen_glogin_password_hint=0x01040312; const int R::string::lockscreen_glogin_submit_button=0x01040313; const int R::string::lockscreen_glogin_too_many_attempts=0x0104030f; const int R::string::lockscreen_glogin_username_hint=0x01040311; const int R::string::lockscreen_instructions_when_pattern_disabled=0x010402e9; const int R::string::lockscreen_instructions_when_pattern_enabled=0x010402e8; const int R::string::lockscreen_low_battery=0x010402f4; const int R::string::lockscreen_missing_sim_instructions=0x010402f7; const int R::string::lockscreen_missing_sim_instructions_long=0x010402f8; const int R::string::lockscreen_missing_sim_message=0x010402f6; const int R::string::lockscreen_missing_sim_message_short=0x010402f5; const int R::string::lockscreen_network_locked_message=0x01040301; const int R::string::lockscreen_password_wrong=0x010402ef; const int R::string::lockscreen_pattern_correct=0x010402ed; const int R::string::lockscreen_pattern_instructions=0x010402ea; const int R::string::lockscreen_pattern_wrong=0x010402ee; const int R::string::lockscreen_permanent_disabled_sim_instructions=0x010402fa; const int R::string::lockscreen_permanent_disabled_sim_message_short=0x010402f9; const int R::string::lockscreen_plugged_in=0x010402f1; const int R::string::lockscreen_return_to_call=0x010402ec; const int R::string::lockscreen_screen_locked=0x010402e7; const int R::string::lockscreen_sim_locked_message=0x01040304; const int R::string::lockscreen_sim_puk_locked_instructions=0x01040303; const int R::string::lockscreen_sim_puk_locked_message=0x01040302; const int R::string::lockscreen_sim_unlock_progress_dialog_message=0x01040305; const int R::string::lockscreen_sound_off_label=0x01040319; const int R::string::lockscreen_sound_on_label=0x01040318; const int R::string::lockscreen_too_many_failed_attempts_countdown=0x0104030c; const int R::string::lockscreen_too_many_failed_attempts_dialog_message=0x01040306; const int R::string::lockscreen_too_many_failed_password_attempts_dialog_message=0x01040307; const int R::string::lockscreen_too_many_failed_pin_attempts_dialog_message=0x01040308; const int R::string::lockscreen_transport_next_description=0x010402fc; const int R::string::lockscreen_transport_pause_description=0x010402fd; const int R::string::lockscreen_transport_play_description=0x010402fe; const int R::string::lockscreen_transport_prev_description=0x010402fb; const int R::string::lockscreen_transport_stop_description=0x010402ff; const int R::string::lockscreen_unlock_label=0x01040317; const int R::string::low_internal_storage_view_text=0x010403c9; const int R::string::low_internal_storage_view_title=0x010403c8; const int R::string::low_memory=0x010400d2; const int R::string::me=0x010400d3; const int R::string::media_bad_removal=0x010404c4; const int R::string::media_checking=0x010404c5; const int R::string::media_removed=0x010404c6; const int R::string::media_route_button_content_description=0x01040536; const int R::string::media_route_chooser_grouping_done=0x01040535; const int R::string::media_route_status_available=0x01040539; const int R::string::media_route_status_connecting=0x01040538; const int R::string::media_route_status_not_available=0x0104053a; const int R::string::media_route_status_scanning=0x01040537; const int R::string::media_shared=0x010404c7; const int R::string::media_unknown_state=0x010404c8; const int R::string::megabyteShort=0x0104006e; const int R::string::meid=0x01040086; const int R::string::menu_delete_shortcut_label=0x0104039f; const int R::string::menu_enter_shortcut_label=0x0104039e; const int R::string::menu_space_shortcut_label=0x0104039d; const int R::string::midnight=0x010403bd; const int R::string::minute=0x010403b2; const int R::string::minutes=0x010403b3; const int R::string::mismatchPin=0x01040080; const int R::string::mmiComplete=0x0104007d; const int R::string::mmiError=0x01040075; const int R::string::mmiFdnError=0x01040076; const int R::string::month=0x0104003c; const int R::string::month_day=0x0104003b; const int R::string::month_day_year=0x01040035; const int R::string::month_year=0x0104003d; const int R::string::more_item_label=0x0104039b; const int R::string::needPuk=0x01040083; const int R::string::needPuk2=0x01040084; const int R::string::network_available_sign_in=0x01040408; const int R::string::network_available_sign_in_detailed=0x01040409; const int R::string::new_app_action=0x010403f1; const int R::string::new_app_description=0x010403f2; const int R::string::next_button_label=0x010404b8; const int R::string::no=0x01040009; const int R::string::noApplications=0x010403d2; const int R::string::no_file_chosen=0x010404b0; const int R::string::no_matches=0x010404be; const int R::string::no_permissions=0x01040435; const int R::string::no_recent_tasks=0x010400e3; const int R::string::noon=0x010403bb; const int R::string::notification_title=0x010400ce; const int R::string::number_picker_decrement_button=0x010404dc; const int R::string::number_picker_increment_button=0x010404db; const int R::string::number_picker_increment_scroll_action=0x010404de; const int R::string::number_picker_increment_scroll_mode=0x010404dd; const int R::string::numeric_date=0x01040032; const int R::string::numeric_date_format=0x01040033; const int R::string::numeric_date_template=0x01040034; const int R::string::numeric_md1_md2=0x01040043; const int R::string::numeric_md1_time1_md2_time2=0x01040048; const int R::string::numeric_mdy1_mdy2=0x01040045; const int R::string::numeric_mdy1_time1_mdy2_time2=0x0104004a; const int R::string::numeric_wday1_md1_time1_wday2_md2_time2=0x01040049; const int R::string::numeric_wday1_md1_wday2_md2=0x01040044; const int R::string::numeric_wday1_mdy1_time1_wday2_mdy2_time2=0x01040047; const int R::string::numeric_wday1_mdy1_wday2_mdy2=0x01040046; const int R::string::ok=0x0104000a; const int R::string::old_app_action=0x010403ef; const int R::string::old_app_description=0x010403f0; const int R::string::older=0x010403aa; const int R::string::oneMonthDurationPast=0x010403a7; const int R::string::open_permission_deny=0x01040399; const int R::string::orgTypeCustom=0x010402c8; const int R::string::orgTypeOther=0x010402c7; const int R::string::orgTypeWork=0x010402c6; const int R::string::org_name=0x0104051b; const int R::string::org_unit=0x0104051c; const int R::string::other_ext_media_badremoval_notification_message=0x0104047b; const int R::string::other_ext_media_badremoval_notification_title=0x01040478; const int R::string::other_ext_media_checking_notification_title=0x01040463; const int R::string::other_ext_media_nofs_notification_message=0x0104046d; const int R::string::other_ext_media_nofs_notification_title=0x01040469; const int R::string::other_ext_media_nomedia_notification_message=0x01040487; const int R::string::other_ext_media_nomedia_notification_title=0x01040484; const int R::string::other_ext_media_safe_unmount_notification_message=0x01040481; const int R::string::other_ext_media_safe_unmount_notification_title=0x0104047e; const int R::string::other_ext_media_unmountable_notification_message=0x01040475; const int R::string::other_ext_media_unmountable_notification_title=0x01040471; const int R::string::owner_name=0x0104056a; const int R::string::passwordIncorrect=0x0104007c; const int R::string::password_keyboard_label_alpha_key=0x01040333; const int R::string::password_keyboard_label_alt_key=0x01040334; const int R::string::password_keyboard_label_symbol_key=0x01040332; const int R::string::paste=0x0104000b; const int R::string::perm_costs_money=0x01040436; const int R::string::permdesc_accessCoarseLocation=0x010401ef; const int R::string::permdesc_accessContentProvidersExternally=0x01040392; const int R::string::permdesc_accessFineLocation=0x010401ed; const int R::string::permdesc_accessLocationExtraCommands=0x010401e9; const int R::string::permdesc_accessMockLocation=0x010401e7; const int R::string::permdesc_accessMtp=0x01040217; const int R::string::permdesc_accessNetworkState=0x01040245; const int R::string::permdesc_accessSurfaceFlinger=0x010401f1; const int R::string::permdesc_accessWifiState=0x01040251; const int R::string::permdesc_accessWimaxState=0x01040259; const int R::string::permdesc_accountManagerService=0x0104023b; const int R::string::permdesc_addVoicemail=0x01040388; const int R::string::permdesc_anyCodecForPlayback=0x010401bf; const int R::string::permdesc_asec_access=0x01040207; const int R::string::permdesc_asec_create=0x01040209; const int R::string::permdesc_asec_destroy=0x0104020b; const int R::string::permdesc_asec_mount_unmount=0x0104020d; const int R::string::permdesc_asec_rename=0x0104020f; const int R::string::permdesc_authenticateAccounts=0x0104023f; const int R::string::permdesc_backup=0x01040185; const int R::string::permdesc_batteryStats=0x01040181; const int R::string::permdesc_bindAccessibilityService=0x01040199; const int R::string::permdesc_bindDeviceAdmin=0x010401a3; const int R::string::permdesc_bindGadget=0x01040225; const int R::string::permdesc_bindInputMethod=0x01040197; const int R::string::permdesc_bindPackageVerifier=0x0104038e; const int R::string::permdesc_bindRemoteViews=0x010401a1; const int R::string::permdesc_bindTextService=0x0104019b; const int R::string::permdesc_bindVpnService=0x0104019d; const int R::string::permdesc_bindWallpaper=0x0104019f; const int R::string::permdesc_bluetooth=0x0104025d; const int R::string::permdesc_bluetoothAdmin=0x01040257; const int R::string::permdesc_brick=0x010401ff; const int R::string::permdesc_broadcastPackageRemoved=0x01040177; const int R::string::permdesc_broadcastSmsReceived=0x01040179; const int R::string::permdesc_broadcastSticky=0x010401d1; const int R::string::permdesc_broadcastWapPush=0x0104017b; const int R::string::permdesc_cache_filesystem=0x01040279; const int R::string::permdesc_callPhone=0x0104021b; const int R::string::permdesc_callPrivileged=0x0104021d; const int R::string::permdesc_camera=0x010401fd; const int R::string::permdesc_changeBackgroundDataSetting=0x0104024f; const int R::string::permdesc_changeComponentState=0x010401c3; const int R::string::permdesc_changeConfiguration=0x0104015b; const int R::string::permdesc_changeNetworkState=0x0104024b; const int R::string::permdesc_changeTetherState=0x0104024d; const int R::string::permdesc_changeWifiMulticastState=0x01040255; const int R::string::permdesc_changeWifiState=0x01040253; const int R::string::permdesc_changeWimaxState=0x0104025b; const int R::string::permdesc_checkinProperties=0x01040223; const int R::string::permdesc_clearAppCache=0x010401b9; const int R::string::permdesc_clearAppUserData=0x010401b1; const int R::string::permdesc_configureWifiDisplay=0x010401f5; const int R::string::permdesc_confirm_full_backup=0x01040187; const int R::string::permdesc_controlWifiDisplay=0x010401f7; const int R::string::permdesc_copyProtectedData=0x0104048c; const int R::string::permdesc_createNetworkSockets=0x01040247; const int R::string::permdesc_deleteCacheFiles=0x010401b3; const int R::string::permdesc_deletePackages=0x010401af; const int R::string::permdesc_devicePower=0x0104022d; const int R::string::permdesc_diagnostic=0x010401c1; const int R::string::permdesc_disableKeyguard=0x01040261; const int R::string::permdesc_dump=0x01040165; const int R::string::permdesc_enableCarMode=0x0104015d; const int R::string::permdesc_expandStatusBar=0x01040131; const int R::string::permdesc_factoryTest=0x0104022f; const int R::string::permdesc_filter_events=0x0104016d; const int R::string::permdesc_flashlight=0x01040213; const int R::string::permdesc_forceBack=0x01040163; const int R::string::permdesc_forceStopPackages=0x01040161; const int R::string::permdesc_freezeScreen=0x01040191; const int R::string::permdesc_getAccounts=0x0104023d; const int R::string::permdesc_getDetailedTasks=0x0104014f; const int R::string::permdesc_getPackageSize=0x010401b5; const int R::string::permdesc_getTasks=0x01040147; const int R::string::permdesc_grantRevokePermissions=0x010401c5; const int R::string::permdesc_hardware_test=0x01040219; const int R::string::permdesc_injectEvents=0x01040193; const int R::string::permdesc_installLocationProvider=0x010401eb; const int R::string::permdesc_installPackages=0x010401b7; const int R::string::permdesc_interactAcrossUsers=0x01040149; const int R::string::permdesc_interactAcrossUsersFull=0x0104014b; const int R::string::permdesc_internalSystemWindow=0x01040189; const int R::string::permdesc_killBackgroundProcesses=0x0104015f; const int R::string::permdesc_locationUpdates=0x01040221; const int R::string::permdesc_magnify_display=0x0104016f; const int R::string::permdesc_manageAccounts=0x01040241; const int R::string::permdesc_manageAppTokens=0x0104018f; const int R::string::permdesc_manageNetworkPolicy=0x0104027f; const int R::string::permdesc_manageUsb=0x01040215; const int R::string::permdesc_manageUsers=0x0104014d; const int R::string::permdesc_masterClear=0x01040235; const int R::string::permdesc_mediaStorageWrite=0x01040275; const int R::string::permdesc_modifyAudioSettings=0x010401f9; const int R::string::permdesc_modifyNetworkAccounting=0x01040281; const int R::string::permdesc_modifyPhoneState=0x01040227; const int R::string::permdesc_mount_format_filesystems=0x01040205; const int R::string::permdesc_mount_unmount_filesystems=0x01040203; const int R::string::permdesc_movePackage=0x010401bb; const int R::string::permdesc_nfc=0x0104025f; const int R::string::permdesc_packageVerificationAgent=0x0104038c; const int R::string::permdesc_performCdmaProvisioning=0x0104021f; const int R::string::permdesc_persistentActivity=0x010401ad; const int R::string::permdesc_pkgUsageStats=0x0104048a; const int R::string::permdesc_processOutgoingCalls=0x01040133; const int R::string::permdesc_readCalendar=0x010401e3; const int R::string::permdesc_readCallLog=0x010401d7; const int R::string::permdesc_readCellBroadcasts=0x0104013b; const int R::string::permdesc_readContacts=0x010401d3; const int R::string::permdesc_readDictionary=0x0104026d; const int R::string::permdesc_readFrameBuffer=0x010401f3; const int R::string::permdesc_readHistoryBookmarks=0x01040382; const int R::string::permdesc_readInputState=0x01040195; const int R::string::permdesc_readLogs=0x010401bd; const int R::string::permdesc_readNetworkUsageHistory=0x0104027d; const int R::string::permdesc_readPhoneState=0x01040229; const int R::string::permdesc_readProfile=0x010401db; const int R::string::permdesc_readSms=0x01040141; const int R::string::permdesc_readSocialStream=0x010401df; const int R::string::permdesc_readSyncSettings=0x01040263; const int R::string::permdesc_readSyncStats=0x01040267; const int R::string::permdesc_reboot=0x01040201; const int R::string::permdesc_receiveBootCompleted=0x010401cf; const int R::string::permdesc_receiveEmergencyBroadcast=0x01040139; const int R::string::permdesc_receiveMms=0x01040137; const int R::string::permdesc_receiveSms=0x01040135; const int R::string::permdesc_receiveWapPush=0x01040145; const int R::string::permdesc_recordAudio=0x010401fb; const int R::string::permdesc_removeTasks=0x01040153; const int R::string::permdesc_reorderTasks=0x01040151; const int R::string::permdesc_retrieve_window_content=0x01040167; const int R::string::permdesc_retrieve_window_info=0x0104016b; const int R::string::permdesc_route_media_output=0x0104048e; const int R::string::permdesc_runSetActivityWatcher=0x01040175; const int R::string::permdesc_sdcardAccessAll=0x01040277; const int R::string::permdesc_sdcardRead=0x01040271; const int R::string::permdesc_sdcardWrite=0x01040273; const int R::string::permdesc_sendSms=0x0104013d; const int R::string::permdesc_sendSmsNoConfirmation=0x0104013f; const int R::string::permdesc_serialPort=0x01040390; const int R::string::permdesc_setAlarm=0x01040386; const int R::string::permdesc_setAlwaysFinish=0x0104017f; const int R::string::permdesc_setAnimationScale=0x0104018d; const int R::string::permdesc_setDebugApp=0x01040159; const int R::string::permdesc_setKeyboardLayout=0x010401a9; const int R::string::permdesc_setOrientation=0x010401a5; const int R::string::permdesc_setPointerSpeed=0x010401a7; const int R::string::permdesc_setPreferredApplications=0x010401c7; const int R::string::permdesc_setProcessLimit=0x0104017d; const int R::string::permdesc_setScreenCompatibility=0x01040157; const int R::string::permdesc_setTime=0x01040237; const int R::string::permdesc_setTimeZone=0x01040239; const int R::string::permdesc_setWallpaper=0x01040231; const int R::string::permdesc_setWallpaperHints=0x01040233; const int R::string::permdesc_shutdown=0x01040171; const int R::string::permdesc_signalPersistentProcesses=0x010401ab; const int R::string::permdesc_startAnyActivity=0x01040155; const int R::string::permdesc_statusBar=0x0104012d; const int R::string::permdesc_statusBarService=0x0104012f; const int R::string::permdesc_stopAppSwitches=0x01040173; const int R::string::permdesc_subscribedFeedsRead=0x01040269; const int R::string::permdesc_subscribedFeedsWrite=0x0104026b; const int R::string::permdesc_systemAlertWindow=0x0104018b; const int R::string::permdesc_temporary_enable_accessibility=0x01040169; const int R::string::permdesc_updateBatteryStats=0x01040183; const int R::string::permdesc_updateLock=0x01040394; const int R::string::permdesc_useCredentials=0x01040243; const int R::string::permdesc_use_sip=0x0104027b; const int R::string::permdesc_vibrate=0x01040211; const int R::string::permdesc_wakeLock=0x0104022b; const int R::string::permdesc_writeApnSettings=0x01040249; const int R::string::permdesc_writeCalendar=0x010401e5; const int R::string::permdesc_writeCallLog=0x010401d9; const int R::string::permdesc_writeContacts=0x010401d5; const int R::string::permdesc_writeDictionary=0x0104026f; const int R::string::permdesc_writeGeolocationPermissions=0x0104038a; const int R::string::permdesc_writeGservices=0x010401cd; const int R::string::permdesc_writeHistoryBookmarks=0x01040384; const int R::string::permdesc_writeProfile=0x010401dd; const int R::string::permdesc_writeSecureSettings=0x010401cb; const int R::string::permdesc_writeSettings=0x010401c9; const int R::string::permdesc_writeSms=0x01040143; const int R::string::permdesc_writeSocialStream=0x010401e1; const int R::string::permdesc_writeSyncSettings=0x01040265; const int R::string::permgroupdesc_accounts=0x0104011f; const int R::string::permgroupdesc_affectsBattery=0x01040103; const int R::string::permgroupdesc_appInfo=0x01040115; const int R::string::permgroupdesc_audioSettings=0x01040101; const int R::string::permgroupdesc_bluetoothNetwork=0x010400ff; const int R::string::permgroupdesc_bookmarks=0x0104010b; const int R::string::permgroupdesc_calendar=0x01040105; const int R::string::permgroupdesc_camera=0x01040113; const int R::string::permgroupdesc_costMoney=0x010400f3; const int R::string::permgroupdesc_developmentTools=0x01040127; const int R::string::permgroupdesc_deviceAlarms=0x0104010d; const int R::string::permgroupdesc_dictionary=0x01040107; const int R::string::permgroupdesc_display=0x01040129; const int R::string::permgroupdesc_hardwareControls=0x01040121; const int R::string::permgroupdesc_location=0x010400fb; const int R::string::permgroupdesc_messages=0x010400f5; const int R::string::permgroupdesc_microphone=0x01040111; const int R::string::permgroupdesc_network=0x010400fd; const int R::string::permgroupdesc_personalInfo=0x010400f7; const int R::string::permgroupdesc_phoneCalls=0x01040123; const int R::string::permgroupdesc_socialInfo=0x010400f9; const int R::string::permgroupdesc_statusBar=0x0104011b; const int R::string::permgroupdesc_storage=0x0104012b; const int R::string::permgroupdesc_syncSettings=0x0104011d; const int R::string::permgroupdesc_systemClock=0x01040119; const int R::string::permgroupdesc_systemTools=0x01040125; const int R::string::permgroupdesc_voicemail=0x0104010f; const int R::string::permgroupdesc_wallpaper=0x01040117; const int R::string::permgroupdesc_writeDictionary=0x01040109; const int R::string::permgrouplab_accounts=0x0104011e; const int R::string::permgrouplab_affectsBattery=0x01040102; const int R::string::permgrouplab_appInfo=0x01040114; const int R::string::permgrouplab_audioSettings=0x01040100; const int R::string::permgrouplab_bluetoothNetwork=0x010400fe; const int R::string::permgrouplab_bookmarks=0x0104010a; const int R::string::permgrouplab_calendar=0x01040104; const int R::string::permgrouplab_camera=0x01040112; const int R::string::permgrouplab_costMoney=0x010400f2; const int R::string::permgrouplab_developmentTools=0x01040126; const int R::string::permgrouplab_deviceAlarms=0x0104010c; const int R::string::permgrouplab_dictionary=0x01040106; const int R::string::permgrouplab_display=0x01040128; const int R::string::permgrouplab_hardwareControls=0x01040120; const int R::string::permgrouplab_location=0x010400fa; const int R::string::permgrouplab_messages=0x010400f4; const int R::string::permgrouplab_microphone=0x01040110; const int R::string::permgrouplab_network=0x010400fc; const int R::string::permgrouplab_personalInfo=0x010400f6; const int R::string::permgrouplab_phoneCalls=0x01040122; const int R::string::permgrouplab_socialInfo=0x010400f8; const int R::string::permgrouplab_statusBar=0x0104011a; const int R::string::permgrouplab_storage=0x0104012a; const int R::string::permgrouplab_syncSettings=0x0104011c; const int R::string::permgrouplab_systemClock=0x01040118; const int R::string::permgrouplab_systemTools=0x01040124; const int R::string::permgrouplab_voicemail=0x0104010e; const int R::string::permgrouplab_wallpaper=0x01040116; const int R::string::permgrouplab_writeDictionary=0x01040108; const int R::string::permission_request_notification_title=0x0104049f; const int R::string::permission_request_notification_with_subtitle=0x010404a0; const int R::string::permlab_accessCoarseLocation=0x010401ee; const int R::string::permlab_accessContentProvidersExternally=0x01040391; const int R::string::permlab_accessFineLocation=0x010401ec; const int R::string::permlab_accessLocationExtraCommands=0x010401e8; const int R::string::permlab_accessMockLocation=0x010401e6; const int R::string::permlab_accessMtp=0x01040216; const int R::string::permlab_accessNetworkState=0x01040244; const int R::string::permlab_accessSurfaceFlinger=0x010401f0; const int R::string::permlab_accessWifiState=0x01040250; const int R::string::permlab_accessWimaxState=0x01040258; const int R::string::permlab_accountManagerService=0x0104023a; const int R::string::permlab_addVoicemail=0x01040387; const int R::string::permlab_anyCodecForPlayback=0x010401be; const int R::string::permlab_asec_access=0x01040206; const int R::string::permlab_asec_create=0x01040208; const int R::string::permlab_asec_destroy=0x0104020a; const int R::string::permlab_asec_mount_unmount=0x0104020c; const int R::string::permlab_asec_rename=0x0104020e; const int R::string::permlab_authenticateAccounts=0x0104023e; const int R::string::permlab_backup=0x01040184; const int R::string::permlab_batteryStats=0x01040180; const int R::string::permlab_bindAccessibilityService=0x01040198; const int R::string::permlab_bindDeviceAdmin=0x010401a2; const int R::string::permlab_bindGadget=0x01040224; const int R::string::permlab_bindInputMethod=0x01040196; const int R::string::permlab_bindPackageVerifier=0x0104038d; const int R::string::permlab_bindRemoteViews=0x010401a0; const int R::string::permlab_bindTextService=0x0104019a; const int R::string::permlab_bindVpnService=0x0104019c; const int R::string::permlab_bindWallpaper=0x0104019e; const int R::string::permlab_bluetooth=0x0104025c; const int R::string::permlab_bluetoothAdmin=0x01040256; const int R::string::permlab_brick=0x010401fe; const int R::string::permlab_broadcastPackageRemoved=0x01040176; const int R::string::permlab_broadcastSmsReceived=0x01040178; const int R::string::permlab_broadcastSticky=0x010401d0; const int R::string::permlab_broadcastWapPush=0x0104017a; const int R::string::permlab_cache_filesystem=0x01040278; const int R::string::permlab_callPhone=0x0104021a; const int R::string::permlab_callPrivileged=0x0104021c; const int R::string::permlab_camera=0x010401fc; const int R::string::permlab_changeBackgroundDataSetting=0x0104024e; const int R::string::permlab_changeComponentState=0x010401c2; const int R::string::permlab_changeConfiguration=0x0104015a; const int R::string::permlab_changeNetworkState=0x0104024a; const int R::string::permlab_changeTetherState=0x0104024c; const int R::string::permlab_changeWifiMulticastState=0x01040254; const int R::string::permlab_changeWifiState=0x01040252; const int R::string::permlab_changeWimaxState=0x0104025a; const int R::string::permlab_checkinProperties=0x01040222; const int R::string::permlab_clearAppCache=0x010401b8; const int R::string::permlab_clearAppUserData=0x010401b0; const int R::string::permlab_configureWifiDisplay=0x010401f4; const int R::string::permlab_confirm_full_backup=0x01040186; const int R::string::permlab_controlWifiDisplay=0x010401f6; const int R::string::permlab_copyProtectedData=0x0104048b; const int R::string::permlab_createNetworkSockets=0x01040246; const int R::string::permlab_deleteCacheFiles=0x010401b2; const int R::string::permlab_deletePackages=0x010401ae; const int R::string::permlab_devicePower=0x0104022c; const int R::string::permlab_diagnostic=0x010401c0; const int R::string::permlab_disableKeyguard=0x01040260; const int R::string::permlab_dump=0x01040164; const int R::string::permlab_enableCarMode=0x0104015c; const int R::string::permlab_expandStatusBar=0x01040130; const int R::string::permlab_factoryTest=0x0104022e; const int R::string::permlab_filter_events=0x0104016c; const int R::string::permlab_flashlight=0x01040212; const int R::string::permlab_forceBack=0x01040162; const int R::string::permlab_forceStopPackages=0x01040160; const int R::string::permlab_freezeScreen=0x01040190; const int R::string::permlab_getAccounts=0x0104023c; const int R::string::permlab_getDetailedTasks=0x0104014e; const int R::string::permlab_getPackageSize=0x010401b4; const int R::string::permlab_getTasks=0x01040146; const int R::string::permlab_grantRevokePermissions=0x010401c4; const int R::string::permlab_hardware_test=0x01040218; const int R::string::permlab_injectEvents=0x01040192; const int R::string::permlab_installLocationProvider=0x010401ea; const int R::string::permlab_installPackages=0x010401b6; const int R::string::permlab_interactAcrossUsers=0x01040148; const int R::string::permlab_interactAcrossUsersFull=0x0104014a; const int R::string::permlab_internalSystemWindow=0x01040188; const int R::string::permlab_killBackgroundProcesses=0x0104015e; const int R::string::permlab_locationUpdates=0x01040220; const int R::string::permlab_magnify_display=0x0104016e; const int R::string::permlab_manageAccounts=0x01040240; const int R::string::permlab_manageAppTokens=0x0104018e; const int R::string::permlab_manageNetworkPolicy=0x0104027e; const int R::string::permlab_manageUsb=0x01040214; const int R::string::permlab_manageUsers=0x0104014c; const int R::string::permlab_masterClear=0x01040234; const int R::string::permlab_mediaStorageWrite=0x01040274; const int R::string::permlab_modifyAudioSettings=0x010401f8; const int R::string::permlab_modifyNetworkAccounting=0x01040280; const int R::string::permlab_modifyPhoneState=0x01040226; const int R::string::permlab_mount_format_filesystems=0x01040204; const int R::string::permlab_mount_unmount_filesystems=0x01040202; const int R::string::permlab_movePackage=0x010401ba; const int R::string::permlab_nfc=0x0104025e; const int R::string::permlab_packageVerificationAgent=0x0104038b; const int R::string::permlab_performCdmaProvisioning=0x0104021e; const int R::string::permlab_persistentActivity=0x010401ac; const int R::string::permlab_pkgUsageStats=0x01040489; const int R::string::permlab_processOutgoingCalls=0x01040132; const int R::string::permlab_readCalendar=0x010401e2; const int R::string::permlab_readCallLog=0x010401d6; const int R::string::permlab_readCellBroadcasts=0x0104013a; const int R::string::permlab_readContacts=0x010401d2; const int R::string::permlab_readDictionary=0x0104026c; const int R::string::permlab_readFrameBuffer=0x010401f2; const int R::string::permlab_readHistoryBookmarks=0x01040381; const int R::string::permlab_readInputState=0x01040194; const int R::string::permlab_readLogs=0x010401bc; const int R::string::permlab_readNetworkUsageHistory=0x0104027c; const int R::string::permlab_readPhoneState=0x01040228; const int R::string::permlab_readProfile=0x010401da; const int R::string::permlab_readSms=0x01040140; const int R::string::permlab_readSocialStream=0x010401de; const int R::string::permlab_readSyncSettings=0x01040262; const int R::string::permlab_readSyncStats=0x01040266; const int R::string::permlab_reboot=0x01040200; const int R::string::permlab_receiveBootCompleted=0x010401ce; const int R::string::permlab_receiveEmergencyBroadcast=0x01040138; const int R::string::permlab_receiveMms=0x01040136; const int R::string::permlab_receiveSms=0x01040134; const int R::string::permlab_receiveWapPush=0x01040144; const int R::string::permlab_recordAudio=0x010401fa; const int R::string::permlab_removeTasks=0x01040152; const int R::string::permlab_reorderTasks=0x01040150; const int R::string::permlab_retrieve_window_content=0x01040166; const int R::string::permlab_retrieve_window_info=0x0104016a; const int R::string::permlab_route_media_output=0x0104048d; const int R::string::permlab_runSetActivityWatcher=0x01040174; const int R::string::permlab_sdcardAccessAll=0x01040276; const int R::string::permlab_sdcardRead=0x01040270; const int R::string::permlab_sdcardWrite=0x01040272; const int R::string::permlab_sendSms=0x0104013c; const int R::string::permlab_sendSmsNoConfirmation=0x0104013e; const int R::string::permlab_serialPort=0x0104038f; const int R::string::permlab_setAlarm=0x01040385; const int R::string::permlab_setAlwaysFinish=0x0104017e; const int R::string::permlab_setAnimationScale=0x0104018c; const int R::string::permlab_setDebugApp=0x01040158; const int R::string::permlab_setKeyboardLayout=0x010401a8; const int R::string::permlab_setOrientation=0x010401a4; const int R::string::permlab_setPointerSpeed=0x010401a6; const int R::string::permlab_setPreferredApplications=0x010401c6; const int R::string::permlab_setProcessLimit=0x0104017c; const int R::string::permlab_setScreenCompatibility=0x01040156; const int R::string::permlab_setTime=0x01040236; const int R::string::permlab_setTimeZone=0x01040238; const int R::string::permlab_setWallpaper=0x01040230; const int R::string::permlab_setWallpaperHints=0x01040232; const int R::string::permlab_shutdown=0x01040170; const int R::string::permlab_signalPersistentProcesses=0x010401aa; const int R::string::permlab_startAnyActivity=0x01040154; const int R::string::permlab_statusBar=0x0104012c; const int R::string::permlab_statusBarService=0x0104012e; const int R::string::permlab_stopAppSwitches=0x01040172; const int R::string::permlab_subscribedFeedsRead=0x01040268; const int R::string::permlab_subscribedFeedsWrite=0x0104026a; const int R::string::permlab_systemAlertWindow=0x0104018a; const int R::string::permlab_temporary_enable_accessibility=0x01040168; const int R::string::permlab_updateBatteryStats=0x01040182; const int R::string::permlab_updateLock=0x01040393; const int R::string::permlab_useCredentials=0x01040242; const int R::string::permlab_use_sip=0x0104027a; const int R::string::permlab_vibrate=0x01040210; const int R::string::permlab_wakeLock=0x0104022a; const int R::string::permlab_writeApnSettings=0x01040248; const int R::string::permlab_writeCalendar=0x010401e4; const int R::string::permlab_writeCallLog=0x010401d8; const int R::string::permlab_writeContacts=0x010401d4; const int R::string::permlab_writeDictionary=0x0104026e; const int R::string::permlab_writeGeolocationPermissions=0x01040389; const int R::string::permlab_writeGservices=0x010401cc; const int R::string::permlab_writeHistoryBookmarks=0x01040383; const int R::string::permlab_writeProfile=0x010401dc; const int R::string::permlab_writeSecureSettings=0x010401ca; const int R::string::permlab_writeSettings=0x010401c8; const int R::string::permlab_writeSms=0x01040142; const int R::string::permlab_writeSocialStream=0x010401e0; const int R::string::permlab_writeSyncSettings=0x01040264; const int R::string::perms_description_app=0x01040434; const int R::string::perms_new_perm_prefix=0x01040433; const int R::string::petabyteShort=0x01040071; const int R::string::phoneTypeAssistant=0x010402a9; const int R::string::phoneTypeCallback=0x0104029e; const int R::string::phoneTypeCar=0x0104029f; const int R::string::phoneTypeCompanyMain=0x010402a0; const int R::string::phoneTypeCustom=0x01040296; const int R::string::phoneTypeFaxHome=0x0104029b; const int R::string::phoneTypeFaxWork=0x0104029a; const int R::string::phoneTypeHome=0x01040297; const int R::string::phoneTypeIsdn=0x010402a1; const int R::string::phoneTypeMain=0x010402a2; const int R::string::phoneTypeMms=0x010402aa; const int R::string::phoneTypeMobile=0x01040298; const int R::string::phoneTypeOther=0x0104029d; const int R::string::phoneTypeOtherFax=0x010402a3; const int R::string::phoneTypePager=0x0104029c; const int R::string::phoneTypeRadio=0x010402a4; const int R::string::phoneTypeTelex=0x010402a5; const int R::string::phoneTypeTtyTdd=0x010402a6; const int R::string::phoneTypeWork=0x01040299; const int R::string::phoneTypeWorkMobile=0x010402a7; const int R::string::phoneTypeWorkPager=0x010402a8; const int R::string::policydesc_disableCamera=0x01040293; const int R::string::policydesc_disableKeyguardFeatures=0x01040295; const int R::string::policydesc_encryptedStorage=0x01040291; const int R::string::policydesc_expirePassword=0x0104028f; const int R::string::policydesc_forceLock=0x01040289; const int R::string::policydesc_limitPassword=0x01040283; const int R::string::policydesc_resetPassword=0x01040287; const int R::string::policydesc_setGlobalProxy=0x0104028d; const int R::string::policydesc_watchLogin=0x01040285; const int R::string::policydesc_wipeData=0x0104028b; const int R::string::policylab_disableCamera=0x01040292; const int R::string::policylab_disableKeyguardFeatures=0x01040294; const int R::string::policylab_encryptedStorage=0x01040290; const int R::string::policylab_expirePassword=0x0104028e; const int R::string::policylab_forceLock=0x01040288; const int R::string::policylab_limitPassword=0x01040282; const int R::string::policylab_resetPassword=0x01040286; const int R::string::policylab_setGlobalProxy=0x0104028c; const int R::string::policylab_watchLogin=0x01040284; const int R::string::policylab_wipeData=0x0104028a; const int R::string::postalTypeCustom=0x010402b4; const int R::string::postalTypeHome=0x010402b5; const int R::string::postalTypeOther=0x010402b7; const int R::string::postalTypeWork=0x010402b6; const int R::string::power_dialog=0x010400d4; const int R::string::power_off=0x010400d9; const int R::string::prepend_shortcut_label=0x0104039c; const int R::string::preposition_for_date=0x010403ab; const int R::string::preposition_for_time=0x010403ac; const int R::string::preposition_for_year=0x010403ad; const int R::string::progress_erasing=0x010404c2; const int R::string::progress_unmounting=0x010404c1; const int R::string::reboot_safemode_confirm=0x010400e1; const int R::string::reboot_safemode_title=0x010400e0; const int R::string::recent_tasks_title=0x010400e2; const int R::string::relationTypeAssistant=0x010402ca; const int R::string::relationTypeBrother=0x010402cb; const int R::string::relationTypeChild=0x010402cc; const int R::string::relationTypeCustom=0x010402c9; const int R::string::relationTypeDomesticPartner=0x010402cd; const int R::string::relationTypeFather=0x010402ce; const int R::string::relationTypeFriend=0x010402cf; const int R::string::relationTypeManager=0x010402d0; const int R::string::relationTypeMother=0x010402d1; const int R::string::relationTypeParent=0x010402d2; const int R::string::relationTypePartner=0x010402d3; const int R::string::relationTypeReferredBy=0x010402d4; const int R::string::relationTypeRelative=0x010402d5; const int R::string::relationTypeSister=0x010402d6; const int R::string::relationTypeSpouse=0x010402d7; const int R::string::relative_time=0x010403ba; const int R::string::replace=0x010403c1; const int R::string::report=0x010403dc; const int R::string::reset=0x010404b1; const int R::string::ringtone_default=0x01040402; const int R::string::ringtone_default_with_actual=0x01040403; const int R::string::ringtone_picker_title=0x01040405; const int R::string::ringtone_silent=0x01040404; const int R::string::ringtone_unknown=0x01040406; const int R::string::roamingText0=0x010400ab; const int R::string::roamingText1=0x010400ac; const int R::string::roamingText10=0x010400b5; const int R::string::roamingText11=0x010400b6; const int R::string::roamingText12=0x010400b7; const int R::string::roamingText2=0x010400ad; const int R::string::roamingText3=0x010400ae; const int R::string::roamingText4=0x010400af; const int R::string::roamingText5=0x010400b0; const int R::string::roamingText6=0x010400b1; const int R::string::roamingText7=0x010400b2; const int R::string::roamingText8=0x010400b3; const int R::string::roamingText9=0x010400b4; const int R::string::roamingTextSearching=0x010400b8; const int R::string::safeMode=0x010400f0; const int R::string::safe_media_volume_warning=0x01040565; const int R::string::same_month_md1_md2=0x0104005c; const int R::string::same_month_md1_time1_md2_time2=0x01040054; const int R::string::same_month_mdy1_mdy2=0x0104005f; const int R::string::same_month_mdy1_time1_mdy2_time2=0x01040058; const int R::string::same_month_wday1_md1_time1_wday2_md2_time2=0x01040056; const int R::string::same_month_wday1_md1_wday2_md2=0x0104005d; const int R::string::same_month_wday1_mdy1_time1_wday2_mdy2_time2=0x0104005a; const int R::string::same_month_wday1_mdy1_wday2_mdy2=0x0104005b; const int R::string::same_year_md1_md2=0x01040051; const int R::string::same_year_md1_time1_md2_time2=0x01040053; const int R::string::same_year_mdy1_mdy2=0x0104005e; const int R::string::same_year_mdy1_time1_mdy2_time2=0x01040057; const int R::string::same_year_wday1_md1_time1_wday2_md2_time2=0x01040055; const int R::string::same_year_wday1_md1_wday2_md2=0x01040052; const int R::string::same_year_wday1_mdy1_time1_wday2_mdy2_time2=0x01040059; const int R::string::same_year_wday1_mdy1_wday2_mdy2=0x01040060; const int R::string::save_password_label=0x01040344; const int R::string::save_password_message=0x01040395; const int R::string::save_password_never=0x01040398; const int R::string::save_password_notnow=0x01040396; const int R::string::save_password_remember=0x01040397; const int R::string::screen_compat_mode_hint=0x010403e4; const int R::string::screen_compat_mode_scale=0x010403e2; const int R::string::screen_compat_mode_show=0x010403e3; const int R::string::screen_lock=0x010400d8; const int R::string::search_go=0x0104000c; const int R::string::searchview_description_clear=0x010403a2; const int R::string::searchview_description_query=0x010403a1; const int R::string::searchview_description_search=0x010403a0; const int R::string::searchview_description_submit=0x010403a3; const int R::string::searchview_description_voice=0x010403a4; const int R::string::second=0x010403b4; const int R::string::seconds=0x010403b5; const int R::string::selectAll=0x0104000d; const int R::string::selectTextMode=0x01040016; const int R::string::select_character=0x0104041b; const int R::string::select_input_method=0x01040457; const int R::string::select_keyboard_layout_notification_message=0x0104045c; const int R::string::select_keyboard_layout_notification_title=0x0104045b; const int R::string::sendText=0x010403f3; const int R::string::sending=0x0104052a; const int R::string::serial_number=0x01040521; const int R::string::serviceClassData=0x010400a4; const int R::string::serviceClassDataAsync=0x010400a7; const int R::string::serviceClassDataSync=0x010400a8; const int R::string::serviceClassFAX=0x010400a5; const int R::string::serviceClassPAD=0x010400aa; const int R::string::serviceClassPacket=0x010400a9; const int R::string::serviceClassSMS=0x010400a6; const int R::string::serviceClassVoice=0x010400a3; const int R::string::serviceDisabled=0x01040079; const int R::string::serviceEnabled=0x01040077; const int R::string::serviceEnabledFor=0x01040078; const int R::string::serviceErased=0x0104007b; const int R::string::serviceNotProvisioned=0x01040098; const int R::string::serviceRegistered=0x0104007a; const int R::string::setup_autofill=0x01040347; const int R::string::sha1_fingerprint=0x01040524; const int R::string::sha256_fingerprint=0x01040523; const int R::string::share=0x010404c9; const int R::string::share_action_provider_share_with=0x01040527; const int R::string::shareactionprovider_share_with=0x010404f3; const int R::string::shareactionprovider_share_with_application=0x010404f4; const int R::string::short_format_month=0x01040061; const int R::string::shutdown_confirm=0x010400de; const int R::string::shutdown_confirm_question=0x010400df; const int R::string::shutdown_progress=0x010400dd; const int R::string::silent_mode=0x010400d5; const int R::string::silent_mode_ring=0x010400dc; const int R::string::silent_mode_silent=0x010400da; const int R::string::silent_mode_vibrate=0x010400db; const int R::string::sim_added_message=0x0104042d; const int R::string::sim_added_title=0x0104042c; const int R::string::sim_done_button=0x0104042b; const int R::string::sim_removed_message=0x0104042a; const int R::string::sim_removed_title=0x01040429; const int R::string::sim_restart_button=0x0104042e; const int R::string::sipAddressTypeCustom=0x010402d8; const int R::string::sipAddressTypeHome=0x010402d9; const int R::string::sipAddressTypeOther=0x010402db; const int R::string::sipAddressTypeWork=0x010402da; const int R::string::skip_button_label=0x010404b9; const int R::string::sms_control_message=0x0104041d; const int R::string::sms_control_no=0x0104041f; const int R::string::sms_control_title=0x0104041c; const int R::string::sms_control_yes=0x0104041e; const int R::string::sms_premium_short_code_details=0x01040422; const int R::string::sms_short_code_confirm_allow=0x01040423; const int R::string::sms_short_code_confirm_always_allow=0x01040427; const int R::string::sms_short_code_confirm_deny=0x01040424; const int R::string::sms_short_code_confirm_message=0x01040420; const int R::string::sms_short_code_confirm_never_allow=0x01040428; const int R::string::sms_short_code_details=0x01040421; const int R::string::sms_short_code_remember_choice=0x01040425; const int R::string::sms_short_code_remember_undo_instruction=0x01040426; const int R::string::smv_application=0x010403e5; const int R::string::smv_process=0x010403e6; const int R::string::ssl_certificate=0x01040517; const int R::string::ssl_certificate_is_valid=0x01040518; const int R::string::status_bar_device_locked=0x01040528; const int R::string::status_bar_notification_info_overflow=0x01040017; const int R::string::storage_internal=0x01040505; const int R::string::storage_sd_card=0x01040506; const int R::string::storage_usb=0x01040507; const int R::string::submit=0x010404b2; const int R::string::sync_binding_label=0x010404a2; const int R::string::sync_do_nothing=0x010404d7; const int R::string::sync_really_delete=0x010404d5; const int R::string::sync_too_many_deletes=0x010404d3; const int R::string::sync_too_many_deletes_desc=0x010404d4; const int R::string::sync_undo_deletes=0x010404d6; const int R::string::terabyteShort=0x01040070; const int R::string::tethered_notification_message=0x010404b6; const int R::string::tethered_notification_title=0x010404b5; const int R::string::textSelectionCABTitle=0x010403c3; const int R::string::text_copied=0x0104039a; const int R::string::throttle_warning_notification_message=0x010404bb; const int R::string::throttle_warning_notification_title=0x010404ba; const int R::string::throttled_notification_message=0x010404bd; const int R::string::throttled_notification_title=0x010404bc; const int R::string::time1_time2=0x01040041; const int R::string::time_date=0x01040039; const int R::string::time_of_day=0x01040036; const int R::string::time_picker_decrement_hour_button=0x010404e2; const int R::string::time_picker_decrement_minute_button=0x010404e0; const int R::string::time_picker_decrement_set_am_button=0x010404e4; const int R::string::time_picker_dialog_title=0x0104042f; const int R::string::time_picker_increment_hour_button=0x010404e1; const int R::string::time_picker_increment_minute_button=0x010404df; const int R::string::time_picker_increment_set_pm_button=0x010404e3; const int R::string::time_picker_separator=0x0104006b; const int R::string::time_wday=0x01040050; const int R::string::time_wday_date=0x0104004e; const int R::string::turn_off_radio=0x010400d7; const int R::string::turn_on_radio=0x010400d6; const int R::string::tutorial_double_tap_to_zoom_message_short=0x0104048f; const int R::string::twelve_hour_time_format=0x01040030; const int R::string::twenty_four_hour_time_format=0x01040031; const int R::string::unknownName=0x0104000e; const int R::string::untitled=0x0104000f; const int R::string::upload_file=0x010404af; const int R::string::usb_accessory_notification_title=0x0104044f; const int R::string::usb_cd_installer_notification_title=0x0104044e; const int R::string::usb_mtp_notification_title=0x0104044c; const int R::string::usb_notification_message=0x01040450; const int R::string::usb_ptp_notification_title=0x0104044d; const int R::string::usb_storage_activity_title=0x01040437; const int R::string::usb_storage_button_mount=0x0104043a; const int R::string::usb_storage_disconnect_notification_message=0x01040441; const int R::string::usb_storage_disconnect_notification_title=0x01040440; const int R::string::usb_storage_error_message=0x0104043b; const int R::string::usb_storage_message=0x01040439; const int R::string::usb_storage_notification_message=0x0104043d; const int R::string::usb_storage_notification_title=0x0104043c; const int R::string::usb_storage_stop_button_mount=0x01040446; const int R::string::usb_storage_stop_error_message=0x01040447; const int R::string::usb_storage_stop_message=0x01040445; const int R::string::usb_storage_stop_notification_message=0x0104043f; const int R::string::usb_storage_stop_notification_title=0x0104043e; const int R::string::usb_storage_stop_title=0x01040444; const int R::string::usb_storage_title=0x01040438; const int R::string::use_physical_keyboard=0x01040459; const int R::string::user_switched=0x01040569; const int R::string::validity_period=0x0104051e; const int R::string::volume_alarm=0x010403fa; const int R::string::volume_bluetooth_call=0x010403f9; const int R::string::volume_call=0x010403f8; const int R::string::volume_icon_description_bluetooth=0x010403fd; const int R::string::volume_icon_description_incall=0x010403ff; const int R::string::volume_icon_description_media=0x01040400; const int R::string::volume_icon_description_notification=0x01040401; const int R::string::volume_icon_description_ringer=0x010403fe; const int R::string::volume_music=0x010403f5; const int R::string::volume_music_hint_playing_through_bluetooth=0x010403f6; const int R::string::volume_music_hint_silent_ringtone_selected=0x010403f7; const int R::string::volume_notification=0x010403fb; const int R::string::volume_ringtone=0x010403f4; const int R::string::volume_unknown=0x010403fc; const int R::string::vpn_lockdown_connected=0x010404ac; const int R::string::vpn_lockdown_connecting=0x010404ab; const int R::string::vpn_lockdown_error=0x010404ad; const int R::string::vpn_lockdown_reset=0x010404ae; const int R::string::vpn_text=0x010404a9; const int R::string::vpn_text_long=0x010404aa; const int R::string::vpn_title=0x010404a7; const int R::string::vpn_title_long=0x010404a8; const int R::string::wait=0x010403dd; const int R::string::wallpaper_binding_label=0x010404a4; const int R::string::wday1_date1_time1_wday2_date2_time2=0x0104004b; const int R::string::wday1_date1_wday2_date2=0x0104004c; const int R::string::wday_date=0x0104004f; const int R::string::web_user_agent=0x0104033f; const int R::string::web_user_agent_target_content=0x01040340; const int R::string::webpage_unresponsive=0x010403de; const int R::string::websearch=0x010404cb; const int R::string::week=0x010403b6; const int R::string::weeks=0x010403b7; const int R::string::whichApplication=0x010403cd; const int R::string::widget_default_class_name=0x0104001c; const int R::string::widget_default_package_name=0x0104001b; const int R::string::wifi_available_sign_in=0x01040407; const int R::string::wifi_display_notification_disconnect=0x01040541; const int R::string::wifi_display_notification_message=0x01040540; const int R::string::wifi_display_notification_title=0x0104053f; const int R::string::wifi_p2p_dialog_title=0x0104040d; const int R::string::wifi_p2p_enabled_notification_message=0x01040411; const int R::string::wifi_p2p_enabled_notification_title=0x01040410; const int R::string::wifi_p2p_enter_pin_message=0x01040418; const int R::string::wifi_p2p_failed_message=0x0104040f; const int R::string::wifi_p2p_frequency_conflict_message=0x0104041a; const int R::string::wifi_p2p_from_message=0x01040416; const int R::string::wifi_p2p_invitation_sent_title=0x01040414; const int R::string::wifi_p2p_invitation_to_connect_title=0x01040415; const int R::string::wifi_p2p_show_pin_message=0x01040419; const int R::string::wifi_p2p_to_message=0x01040417; const int R::string::wifi_p2p_turnon_message=0x0104040e; const int R::string::wifi_tether_configure_ssid_default=0x0104040c; const int R::string::wifi_watchdog_network_disabled=0x0104040a; const int R::string::wifi_watchdog_network_disabled_detailed=0x0104040b; const int R::string::year=0x010403b8; const int R::string::years=0x010403b9; const int R::string::yes=0x01040013; const int R::style::ActiveWallpaperSettings=0x010302ef; const int R::style::AlertDialog=0x010301e0; const int R::style::AlertDialog_DeviceDefault=0x010302e7; const int R::style::AlertDialog_DeviceDefault_Light=0x010302e8; const int R::style::AlertDialog_Holo=0x01030297; const int R::style::AlertDialog_Holo_Light=0x01030298; const int R::style::Animation=0x01030000; const int R::style::Animation_Activity=0x01030001; const int R::style::Animation_DeviceDefault_Activity=0x010302e9; const int R::style::Animation_DeviceDefault_Dialog=0x010302ea; const int R::style::Animation_Dialog=0x01030002; const int R::style::Animation_Dream=0x010301f1; const int R::style::Animation_DropDownDown=0x010301e7; const int R::style::Animation_DropDownUp=0x010301e8; const int R::style::Animation_Holo=0x01030294; const int R::style::Animation_Holo_Activity=0x01030295; const int R::style::Animation_Holo_Dialog=0x01030296; const int R::style::Animation_InputMethod=0x01030056; const int R::style::Animation_InputMethodFancy=0x010301e9; const int R::style::Animation_LockScreen=0x010301e2; const int R::style::Animation_OptionsPanel=0x010301e3; const int R::style::Animation_PopupWindow=0x010301ee; const int R::style::Animation_PopupWindow_ActionMode=0x010301ef; const int R::style::Animation_RecentApplications=0x010301ed; const int R::style::Animation_SearchBar=0x010301ea; const int R::style::Animation_SubMenuPanel=0x010301e4; const int R::style::Animation_TextSelectHandle=0x01030236; const int R::style::Animation_Toast=0x01030004; const int R::style::Animation_Translucent=0x01030003; const int R::style::Animation_TypingFilter=0x010301e5; const int R::style::Animation_TypingFilterRestore=0x010301e6; const int R::style::Animation_VolumePanel=0x010301f0; const int R::style::Animation_Wallpaper=0x010301ec; const int R::style::Animation_ZoomButtons=0x010301eb; const int R::style::ButtonBar=0x01030058; const int R::style::DeviceDefault_ButtonBar=0x010301cf; const int R::style::DeviceDefault_ButtonBar_AlertDialog=0x010301d0; const int R::style::DeviceDefault_Light_ButtonBar=0x010301d2; const int R::style::DeviceDefault_Light_ButtonBar_AlertDialog=0x010301d3; const int R::style::DeviceDefault_Light_SegmentedButton=0x010301d4; const int R::style::DeviceDefault_SegmentedButton=0x010301d1; const int R::style::DialogWindowTitle=0x010301df; const int R::style::DialogWindowTitle_DeviceDefault=0x010302eb; const int R::style::DialogWindowTitle_DeviceDefault_Light=0x010302ec; const int R::style::DialogWindowTitle_Holo=0x0103029b; const int R::style::DialogWindowTitle_Holo_Light=0x0103029c; const int R::style::Holo=0x0103025a; const int R::style::Holo_ButtonBar=0x010300e5; const int R::style::Holo_ButtonBar_AlertDialog=0x010300e7; const int R::style::Holo_Light=0x0103025b; const int R::style::Holo_Light_ButtonBar=0x010300e6; const int R::style::Holo_Light_ButtonBar_AlertDialog=0x010300e8; const int R::style::Holo_Light_SegmentedButton=0x010300ea; const int R::style::Holo_SegmentedButton=0x010300e9; const int R::style::MediaButton=0x01030037; const int R::style::MediaButton_Ffwd=0x0103003b; const int R::style::MediaButton_Next=0x01030039; const int R::style::MediaButton_Pause=0x0103003d; const int R::style::MediaButton_Play=0x0103003a; const int R::style::MediaButton_Previous=0x01030038; const int R::style::MediaButton_Rew=0x0103003c; const int R::style::Pointer=0x0103029e; const int R::style::Preference=0x0103021b; const int R::style::Preference_Category=0x0103021e; const int R::style::Preference_CheckBoxPreference=0x0103021f; const int R::style::Preference_DeviceDefault=0x010302dd; const int R::style::Preference_DeviceDefault_Category=0x010302de; const int R::style::Preference_DeviceDefault_CheckBoxPreference=0x010302df; const int R::style::Preference_DeviceDefault_DialogPreference=0x010302e0; const int R::style::Preference_DeviceDefault_DialogPreference_EditTextPreference=0x010302e1; const int R::style::Preference_DeviceDefault_DialogPreference_YesNoPreference=0x010302e2; const int R::style::Preference_DeviceDefault_Information=0x010302e3; const int R::style::Preference_DeviceDefault_PreferenceScreen=0x010302e4; const int R::style::Preference_DeviceDefault_RingtonePreference=0x010302e5; const int R::style::Preference_DeviceDefault_SwitchPreference=0x010302e6; const int R::style::Preference_DialogPreference=0x01030222; const int R::style::Preference_DialogPreference_EditTextPreference=0x01030224; const int R::style::Preference_DialogPreference_YesNoPreference=0x01030223; const int R::style::Preference_Holo=0x01030226; const int R::style::Preference_Holo_Category=0x01030229; const int R::style::Preference_Holo_CheckBoxPreference=0x0103022a; const int R::style::Preference_Holo_DialogPreference=0x0103022d; const int R::style::Preference_Holo_DialogPreference_EditTextPreference=0x0103022f; const int R::style::Preference_Holo_DialogPreference_YesNoPreference=0x0103022e; const int R::style::Preference_Holo_Information=0x01030228; const int R::style::Preference_Holo_PreferenceScreen=0x0103022c; const int R::style::Preference_Holo_RingtonePreference=0x01030230; const int R::style::Preference_Holo_SwitchPreference=0x0103022b; const int R::style::Preference_Information=0x0103021d; const int R::style::Preference_PreferenceScreen=0x01030221; const int R::style::Preference_RingtonePreference=0x01030225; const int R::style::Preference_SwitchPreference=0x01030220; const int R::style::PreferenceFragment=0x0103021c; const int R::style::PreferenceFragment_Holo=0x01030227; const int R::style::PreferencePanel=0x01030231; const int R::style::PreferencePanel_Dialog=0x01030232; const int R::style::PreviewWallpaperSettings=0x010302f0; const int R::style::SegmentedButton=0x01030234; const int R::style::TextAppearance=0x0103003e; const int R::style::TextAppearance_AutoCorrectionSuggestion=0x010301fc; const int R::style::TextAppearance_DeviceDefault=0x010301ad; const int R::style::TextAppearance_DeviceDefault_DialogWindowTitle=0x010301b8; const int R::style::TextAppearance_DeviceDefault_Inverse=0x010301ae; const int R::style::TextAppearance_DeviceDefault_Large=0x010301af; const int R::style::TextAppearance_DeviceDefault_Large_Inverse=0x010301b0; const int R::style::TextAppearance_DeviceDefault_Light=0x010302d0; const int R::style::TextAppearance_DeviceDefault_Light_Inverse=0x010302d1; const int R::style::TextAppearance_DeviceDefault_Light_Large=0x010302d2; const int R::style::TextAppearance_DeviceDefault_Light_Large_Inverse=0x010302d3; const int R::style::TextAppearance_DeviceDefault_Light_Medium=0x010302d4; const int R::style::TextAppearance_DeviceDefault_Light_Medium_Inverse=0x010302d5; const int R::style::TextAppearance_DeviceDefault_Light_SearchResult_Subtitle=0x010302d6; const int R::style::TextAppearance_DeviceDefault_Light_SearchResult_Title=0x010302d7; const int R::style::TextAppearance_DeviceDefault_Light_Small=0x010302d8; const int R::style::TextAppearance_DeviceDefault_Light_Small_Inverse=0x010302d9; const int R::style::TextAppearance_DeviceDefault_Light_Widget_Button=0x010302da; const int R::style::TextAppearance_DeviceDefault_Light_Widget_PopupMenu_Large=0x010302db; const int R::style::TextAppearance_DeviceDefault_Light_Widget_PopupMenu_Small=0x010302dc; const int R::style::TextAppearance_DeviceDefault_Medium=0x010301b1; const int R::style::TextAppearance_DeviceDefault_Medium_Inverse=0x010301b2; const int R::style::TextAppearance_DeviceDefault_SearchResult_Subtitle=0x010301b6; const int R::style::TextAppearance_DeviceDefault_SearchResult_Title=0x010301b5; const int R::style::TextAppearance_DeviceDefault_Small=0x010301b3; const int R::style::TextAppearance_DeviceDefault_Small_Inverse=0x010301b4; const int R::style::TextAppearance_DeviceDefault_Widget=0x010301b9; const int R::style::TextAppearance_DeviceDefault_Widget_ActionBar_Menu=0x010301ce; const int R::style::TextAppearance_DeviceDefault_Widget_ActionBar_Subtitle=0x010301c7; const int R::style::TextAppearance_DeviceDefault_Widget_ActionBar_Subtitle_Inverse=0x010301cb; const int R::style::TextAppearance_DeviceDefault_Widget_ActionBar_Title=0x010301c6; const int R::style::TextAppearance_DeviceDefault_Widget_ActionBar_Title_Inverse=0x010301ca; const int R::style::TextAppearance_DeviceDefault_Widget_ActionMode_Subtitle=0x010301c9; const int R::style::TextAppearance_DeviceDefault_Widget_ActionMode_Subtitle_Inverse=0x010301cd; const int R::style::TextAppearance_DeviceDefault_Widget_ActionMode_Title=0x010301c8; const int R::style::TextAppearance_DeviceDefault_Widget_ActionMode_Title_Inverse=0x010301cc; const int R::style::TextAppearance_DeviceDefault_Widget_Button=0x010301ba; const int R::style::TextAppearance_DeviceDefault_Widget_DropDownHint=0x010301bf; const int R::style::TextAppearance_DeviceDefault_Widget_DropDownItem=0x010301c0; const int R::style::TextAppearance_DeviceDefault_Widget_EditText=0x010301c2; const int R::style::TextAppearance_DeviceDefault_Widget_IconMenu_Item=0x010301bb; const int R::style::TextAppearance_DeviceDefault_Widget_PopupMenu=0x010301c3; const int R::style::TextAppearance_DeviceDefault_Widget_PopupMenu_Large=0x010301c4; const int R::style::TextAppearance_DeviceDefault_Widget_PopupMenu_Small=0x010301c5; const int R::style::TextAppearance_DeviceDefault_Widget_TabWidget=0x010301bc; const int R::style::TextAppearance_DeviceDefault_Widget_TextView=0x010301bd; const int R::style::TextAppearance_DeviceDefault_Widget_TextView_PopupMenu=0x010301be; const int R::style::TextAppearance_DeviceDefault_Widget_TextView_SpinnerItem=0x010301c1; const int R::style::TextAppearance_DeviceDefault_WindowTitle=0x010301b7; const int R::style::TextAppearance_DialogWindowTitle=0x01030041; const int R::style::TextAppearance_EasyCorrectSuggestion=0x010301fa; const int R::style::TextAppearance_Holo=0x010300fb; const int R::style::TextAppearance_Holo_CalendarViewWeekDayView=0x01030242; const int R::style::TextAppearance_Holo_DialogWindowTitle=0x01030117; const int R::style::TextAppearance_Holo_Inverse=0x010300fc; const int R::style::TextAppearance_Holo_Large=0x010300fd; const int R::style::TextAppearance_Holo_Large_Inverse=0x010300fe; const int R::style::TextAppearance_Holo_Light=0x01030243; const int R::style::TextAppearance_Holo_Light_CalendarViewWeekDayView=0x01030259; const int R::style::TextAppearance_Holo_Light_DialogWindowTitle=0x01030258; const int R::style::TextAppearance_Holo_Light_Inverse=0x01030244; const int R::style::TextAppearance_Holo_Light_Large=0x01030245; const int R::style::TextAppearance_Holo_Light_Large_Inverse=0x01030248; const int R::style::TextAppearance_Holo_Light_Medium=0x01030246; const int R::style::TextAppearance_Holo_Light_Medium_Inverse=0x01030249; const int R::style::TextAppearance_Holo_Light_SearchResult=0x0103024b; const int R::style::TextAppearance_Holo_Light_SearchResult_Subtitle=0x0103024d; const int R::style::TextAppearance_Holo_Light_SearchResult_Title=0x0103024c; const int R::style::TextAppearance_Holo_Light_Small=0x01030247; const int R::style::TextAppearance_Holo_Light_Small_Inverse=0x0103024a; const int R::style::TextAppearance_Holo_Light_Widget=0x0103024e; const int R::style::TextAppearance_Holo_Light_Widget_ActionMode_Subtitle=0x01030256; const int R::style::TextAppearance_Holo_Light_Widget_ActionMode_Title=0x01030255; const int R::style::TextAppearance_Holo_Light_Widget_Button=0x0103024f; const int R::style::TextAppearance_Holo_Light_Widget_DropDownHint=0x01030254; const int R::style::TextAppearance_Holo_Light_Widget_EditText=0x01030250; const int R::style::TextAppearance_Holo_Light_Widget_PopupMenu=0x01030251; const int R::style::TextAppearance_Holo_Light_Widget_PopupMenu_Large=0x01030252; const int R::style::TextAppearance_Holo_Light_Widget_PopupMenu_Small=0x01030253; const int R::style::TextAppearance_Holo_Light_Widget_Switch=0x01030241; const int R::style::TextAppearance_Holo_Light_WindowTitle=0x01030257; const int R::style::TextAppearance_Holo_Medium=0x010300ff; const int R::style::TextAppearance_Holo_Medium_Inverse=0x01030100; const int R::style::TextAppearance_Holo_SearchResult=0x0103023e; const int R::style::TextAppearance_Holo_SearchResult_Subtitle=0x01030104; const int R::style::TextAppearance_Holo_SearchResult_Title=0x01030103; const int R::style::TextAppearance_Holo_Small=0x01030101; const int R::style::TextAppearance_Holo_Small_Inverse=0x01030102; const int R::style::TextAppearance_Holo_Widget=0x01030105; const int R::style::TextAppearance_Holo_Widget_ActionBar_Menu=0x01030120; const int R::style::TextAppearance_Holo_Widget_ActionBar_Subtitle=0x01030113; const int R::style::TextAppearance_Holo_Widget_ActionBar_Subtitle_Inverse=0x0103011d; const int R::style::TextAppearance_Holo_Widget_ActionBar_Title=0x01030112; const int R::style::TextAppearance_Holo_Widget_ActionBar_Title_Inverse=0x0103011c; const int R::style::TextAppearance_Holo_Widget_ActionMode=0x0103023f; const int R::style::TextAppearance_Holo_Widget_ActionMode_Subtitle=0x01030115; const int R::style::TextAppearance_Holo_Widget_ActionMode_Subtitle_Inverse=0x0103011f; const int R::style::TextAppearance_Holo_Widget_ActionMode_Title=0x01030114; const int R::style::TextAppearance_Holo_Widget_ActionMode_Title_Inverse=0x0103011e; const int R::style::TextAppearance_Holo_Widget_Button=0x01030106; const int R::style::TextAppearance_Holo_Widget_DropDownHint=0x0103010b; const int R::style::TextAppearance_Holo_Widget_DropDownItem=0x0103010c; const int R::style::TextAppearance_Holo_Widget_EditText=0x0103010e; const int R::style::TextAppearance_Holo_Widget_IconMenu_Item=0x01030107; const int R::style::TextAppearance_Holo_Widget_PopupMenu=0x0103010f; const int R::style::TextAppearance_Holo_Widget_PopupMenu_Large=0x01030110; const int R::style::TextAppearance_Holo_Widget_PopupMenu_Small=0x01030111; const int R::style::TextAppearance_Holo_Widget_Switch=0x01030240; const int R::style::TextAppearance_Holo_Widget_TabWidget=0x01030108; const int R::style::TextAppearance_Holo_Widget_TextView=0x01030109; const int R::style::TextAppearance_Holo_Widget_TextView_PopupMenu=0x0103010a; const int R::style::TextAppearance_Holo_Widget_TextView_SpinnerItem=0x0103010d; const int R::style::TextAppearance_Holo_WindowTitle=0x01030116; const int R::style::TextAppearance_Inverse=0x0103003f; const int R::style::TextAppearance_Large=0x01030042; const int R::style::TextAppearance_Large_Inverse=0x01030043; const int R::style::TextAppearance_Large_Inverse_NumberPickerInputText=0x01030219; const int R::style::TextAppearance_Medium=0x01030044; const int R::style::TextAppearance_Medium_Inverse=0x01030045; const int R::style::TextAppearance_MisspelledSuggestion=0x010301fb; const int R::style::TextAppearance_NumPadKey=0x010302a4; const int R::style::TextAppearance_NumPadKey_Klondike=0x010302a5; const int R::style::TextAppearance_SearchResult=0x01030218; const int R::style::TextAppearance_SearchResult_Subtitle=0x01030064; const int R::style::TextAppearance_SearchResult_Title=0x01030063; const int R::style::TextAppearance_SlidingTabActive=0x01030217; const int R::style::TextAppearance_SlidingTabNormal=0x01030216; const int R::style::TextAppearance_Small=0x01030046; const int R::style::TextAppearance_Small_CalendarViewWeekDayView=0x010301f8; const int R::style::TextAppearance_Small_Inverse=0x01030047; const int R::style::TextAppearance_StatusBar=0x010301f2; const int R::style::TextAppearance_StatusBar_EventContent=0x01030067; const int R::style::TextAppearance_StatusBar_EventContent_Emphasis=0x010301f7; const int R::style::TextAppearance_StatusBar_EventContent_Info=0x010301f5; const int R::style::TextAppearance_StatusBar_EventContent_Line2=0x010301f4; const int R::style::TextAppearance_StatusBar_EventContent_Time=0x010301f6; const int R::style::TextAppearance_StatusBar_EventContent_Title=0x01030068; const int R::style::TextAppearance_StatusBar_Icon=0x01030066; const int R::style::TextAppearance_StatusBar_Ticker=0x010301f3; const int R::style::TextAppearance_StatusBar_Title=0x01030065; const int R::style::TextAppearance_Suggestion=0x010301f9; const int R::style::TextAppearance_SuggestionHighlight=0x01030118; const int R::style::TextAppearance_Theme=0x01030040; const int R::style::TextAppearance_Theme_Dialog=0x01030048; const int R::style::TextAppearance_Theme_Dialog_AppError=0x01030215; const int R::style::TextAppearance_Widget=0x01030049; const int R::style::TextAppearance_Widget_ActionBar_Subtitle=0x0103023a; const int R::style::TextAppearance_Widget_ActionBar_Title=0x01030239; const int R::style::TextAppearance_Widget_ActionMode_Subtitle=0x0103023c; const int R::style::TextAppearance_Widget_ActionMode_Title=0x0103023b; const int R::style::TextAppearance_Widget_Button=0x0103004a; const int R::style::TextAppearance_Widget_DropDownHint=0x01030050; const int R::style::TextAppearance_Widget_DropDownItem=0x01030051; const int R::style::TextAppearance_Widget_EditText=0x0103004c; const int R::style::TextAppearance_Widget_IconMenu_Item=0x0103004b; const int R::style::TextAppearance_Widget_PopupMenu=0x0103023d; const int R::style::TextAppearance_Widget_PopupMenu_Large=0x01030080; const int R::style::TextAppearance_Widget_PopupMenu_Small=0x01030081; const int R::style::TextAppearance_Widget_TabWidget=0x0103004d; const int R::style::TextAppearance_Widget_TextView=0x0103004e; const int R::style::TextAppearance_Widget_TextView_PopupMenu=0x0103004f; const int R::style::TextAppearance_Widget_TextView_SpinnerItem=0x01030052; const int R::style::TextAppearance_WindowTitle=0x01030053; const int R::style::Theme=0x01030005; const int R::style::Theme_Black=0x01030008; const int R::style::Theme_Black_NoTitleBar=0x01030009; const int R::style::Theme_Black_NoTitleBar_Fullscreen=0x0103000a; const int R::style::Theme_DeviceDefault=0x01030128; const int R::style::Theme_DeviceDefault_Dialog=0x0103012e; const int R::style::Theme_DeviceDefault_Dialog_Alert=0x0103030e; const int R::style::Theme_DeviceDefault_Dialog_FixedSize=0x01030308; const int R::style::Theme_DeviceDefault_Dialog_MinWidth=0x0103012f; const int R::style::Theme_DeviceDefault_Dialog_NoActionBar=0x01030130; const int R::style::Theme_DeviceDefault_Dialog_NoActionBar_FixedSize=0x01030309; const int R::style::Theme_DeviceDefault_Dialog_NoActionBar_MinWidth=0x01030131; const int R::style::Theme_DeviceDefault_Dialog_NoFrame=0x01030312; const int R::style::Theme_DeviceDefault_Dialog_Presentation=0x0103030c; const int R::style::Theme_DeviceDefault_DialogWhenLarge=0x01030136; const int R::style::Theme_DeviceDefault_DialogWhenLarge_NoActionBar=0x01030137; const int R::style::Theme_DeviceDefault_InputMethod=0x0103013e; const int R::style::Theme_DeviceDefault_Light=0x0103012b; const int R::style::Theme_DeviceDefault_Light_DarkActionBar=0x0103013f; const int R::style::Theme_DeviceDefault_Light_Dialog=0x01030132; const int R::style::Theme_DeviceDefault_Light_Dialog_Alert=0x0103030f; const int R::style::Theme_DeviceDefault_Light_Dialog_FixedSize=0x0103030a; const int R::style::Theme_DeviceDefault_Light_Dialog_MinWidth=0x01030133; const int R::style::Theme_DeviceDefault_Light_Dialog_NoActionBar=0x01030134; const int R::style::Theme_DeviceDefault_Light_Dialog_NoActionBar_FixedSize=0x0103030b; const int R::style::Theme_DeviceDefault_Light_Dialog_NoActionBar_MinWidth=0x01030135; const int R::style::Theme_DeviceDefault_Light_Dialog_Presentation=0x0103030d; const int R::style::Theme_DeviceDefault_Light_DialogWhenLarge=0x01030138; const int R::style::Theme_DeviceDefault_Light_DialogWhenLarge_NoActionBar=0x01030139; const int R::style::Theme_DeviceDefault_Light_NoActionBar=0x0103012c; const int R::style::Theme_DeviceDefault_Light_NoActionBar_Fullscreen=0x0103012d; const int R::style::Theme_DeviceDefault_Light_Panel=0x0103013b; const int R::style::Theme_DeviceDefault_Light_SearchBar=0x01030311; const int R::style::Theme_DeviceDefault_NoActionBar=0x01030129; const int R::style::Theme_DeviceDefault_NoActionBar_Fullscreen=0x0103012a; const int R::style::Theme_DeviceDefault_Panel=0x0103013a; const int R::style::Theme_DeviceDefault_SearchBar=0x01030310; const int R::style::Theme_DeviceDefault_Wallpaper=0x0103013c; const int R::style::Theme_DeviceDefault_Wallpaper_NoTitleBar=0x0103013d; const int R::style::Theme_Dialog=0x0103000b; const int R::style::Theme_Dialog_Alert=0x010302f2; const int R::style::Theme_Dialog_AppError=0x010302fb; const int R::style::Theme_Dialog_NoFrame=0x010302f1; const int R::style::Theme_Dialog_RecentApplications=0x010302fc; const int R::style::Theme_ExpandedMenu=0x010302f8; const int R::style::Theme_GlobalSearchBar=0x010302f6; const int R::style::Theme_Holo=0x0103006b; const int R::style::Theme_Holo_CompactMenu=0x010302f9; const int R::style::Theme_Holo_Dialog=0x0103006f; const int R::style::Theme_Holo_Dialog_Alert=0x01030302; const int R::style::Theme_Holo_Dialog_FixedSize=0x010302ff; const int R::style::Theme_Holo_Dialog_MinWidth=0x01030070; const int R::style::Theme_Holo_Dialog_NoActionBar=0x01030071; const int R::style::Theme_Holo_Dialog_NoActionBar_FixedSize=0x01030300; const int R::style::Theme_Holo_Dialog_NoActionBar_MinWidth=0x01030072; const int R::style::Theme_Holo_Dialog_NoFrame=0x01030301; const int R::style::Theme_Holo_Dialog_Presentation=0x01030303; const int R::style::Theme_Holo_DialogWhenLarge=0x01030077; const int R::style::Theme_Holo_DialogWhenLarge_NoActionBar=0x01030078; const int R::style::Theme_Holo_InputMethod=0x0103007f; const int R::style::Theme_Holo_Light=0x0103006e; const int R::style::Theme_Holo_Light_CompactMenu=0x010302fa; const int R::style::Theme_Holo_Light_DarkActionBar=0x01030119; const int R::style::Theme_Holo_Light_Dialog=0x01030073; const int R::style::Theme_Holo_Light_Dialog_Alert=0x01030306; const int R::style::Theme_Holo_Light_Dialog_FixedSize=0x01030304; const int R::style::Theme_Holo_Light_Dialog_MinWidth=0x01030074; const int R::style::Theme_Holo_Light_Dialog_NoActionBar=0x01030075; const int R::style::Theme_Holo_Light_Dialog_NoActionBar_FixedSize=0x01030305; const int R::style::Theme_Holo_Light_Dialog_NoActionBar_MinWidth=0x01030076; const int R::style::Theme_Holo_Light_Dialog_Presentation=0x01030307; const int R::style::Theme_Holo_Light_DialogWhenLarge=0x01030079; const int R::style::Theme_Holo_Light_DialogWhenLarge_NoActionBar=0x0103007a; const int R::style::Theme_Holo_Light_NoActionBar=0x010300f0; const int R::style::Theme_Holo_Light_NoActionBar_Fullscreen=0x010300f1; const int R::style::Theme_Holo_Light_Panel=0x0103007c; const int R::style::Theme_Holo_Light_SearchBar=0x010302f5; const int R::style::Theme_Holo_NoActionBar=0x0103006c; const int R::style::Theme_Holo_NoActionBar_Fullscreen=0x0103006d; const int R::style::Theme_Holo_Panel=0x0103007b; const int R::style::Theme_Holo_SearchBar=0x010302f4; const int R::style::Theme_Holo_Wallpaper=0x0103007d; const int R::style::Theme_Holo_Wallpaper_NoTitleBar=0x0103007e; const int R::style::Theme_IconMenu=0x010302f7; const int R::style::Theme_InputMethod=0x01030054; const int R::style::Theme_Light=0x0103000c; const int R::style::Theme_Light_NoTitleBar=0x0103000d; const int R::style::Theme_Light_NoTitleBar_Fullscreen=0x0103000e; const int R::style::Theme_Light_Panel=0x0103005a; const int R::style::Theme_Light_WallpaperSettings=0x01030062; const int R::style::Theme_NoDisplay=0x01030055; const int R::style::Theme_NoTitleBar=0x01030006; const int R::style::Theme_NoTitleBar_Fullscreen=0x01030007; const int R::style::Theme_NoTitleBar_OverlayActionModes=0x0103006a; const int R::style::Theme_Panel=0x01030059; const int R::style::Theme_Panel_Volume=0x010302fe; const int R::style::Theme_SearchBar=0x010302f3; const int R::style::Theme_Toast=0x010302fd; const int R::style::Theme_Translucent=0x0103000f; const int R::style::Theme_Translucent_NoTitleBar=0x01030010; const int R::style::Theme_Translucent_NoTitleBar_Fullscreen=0x01030011; const int R::style::Theme_Wallpaper=0x0103005e; const int R::style::Theme_Wallpaper_NoTitleBar=0x0103005f; const int R::style::Theme_Wallpaper_NoTitleBar_Fullscreen=0x01030060; const int R::style::Theme_WallpaperSettings=0x01030061; const int R::style::Theme_WithActionBar=0x01030069; const int R::style::Widget=0x01030012; const int R::style::Widget_AbsListView=0x01030013; const int R::style::Widget_ActionBar=0x01030082; const int R::style::Widget_ActionBar_TabBar=0x010300f4; const int R::style::Widget_ActionBar_TabText=0x010300f3; const int R::style::Widget_ActionBar_TabView=0x010300f2; const int R::style::Widget_ActionButton=0x01030084; const int R::style::Widget_ActionButton_CloseMode=0x01030088; const int R::style::Widget_ActionButton_Overflow=0x01030087; const int R::style::Widget_ActionMode=0x01030238; const int R::style::Widget_ActivityChooserView=0x0103021a; const int R::style::Widget_AutoCompleteTextView=0x01030027; const int R::style::Widget_Button=0x01030014; const int R::style::Widget_Button_Inset=0x01030015; const int R::style::Widget_Button_NumPadKey=0x010302a3; const int R::style::Widget_Button_Small=0x01030016; const int R::style::Widget_Button_Toggle=0x01030017; const int R::style::Widget_Button_Transparent=0x010301ff; const int R::style::Widget_CalendarView=0x010300eb; const int R::style::Widget_CheckedTextView=0x01030203; const int R::style::Widget_CompoundButton=0x01030018; const int R::style::Widget_CompoundButton_CheckBox=0x01030019; const int R::style::Widget_CompoundButton_RadioButton=0x0103001a; const int R::style::Widget_CompoundButton_Star=0x0103001b; const int R::style::Widget_CompoundButton_Switch=0x01030214; const int R::style::Widget_DatePicker=0x010300ee; const int R::style::Widget_DeviceDefault=0x01030140; const int R::style::Widget_DeviceDefault_AbsListView=0x010302a6; const int R::style::Widget_DeviceDefault_ActionBar=0x0103016b; const int R::style::Widget_DeviceDefault_ActionBar_Solid=0x01030173; const int R::style::Widget_DeviceDefault_ActionBar_TabBar=0x01030172; const int R::style::Widget_DeviceDefault_ActionBar_TabText=0x01030171; const int R::style::Widget_DeviceDefault_ActionBar_TabView=0x01030170; const int R::style::Widget_DeviceDefault_ActionButton=0x01030166; const int R::style::Widget_DeviceDefault_ActionButton_CloseMode=0x0103016a; const int R::style::Widget_DeviceDefault_ActionButton_Overflow=0x01030167; const int R::style::Widget_DeviceDefault_ActionButton_TextButton=0x01030168; const int R::style::Widget_DeviceDefault_ActionMode=0x01030169; const int R::style::Widget_DeviceDefault_AutoCompleteTextView=0x01030147; const int R::style::Widget_DeviceDefault_Button=0x01030141; const int R::style::Widget_DeviceDefault_Button_Borderless=0x0103016c; const int R::style::Widget_DeviceDefault_Button_Borderless_Small=0x01030145; const int R::style::Widget_DeviceDefault_Button_Inset=0x01030143; const int R::style::Widget_DeviceDefault_Button_Small=0x01030142; const int R::style::Widget_DeviceDefault_Button_Toggle=0x01030144; const int R::style::Widget_DeviceDefault_CalendarView=0x0103016e; const int R::style::Widget_DeviceDefault_CheckedTextView=0x010301db; const int R::style::Widget_DeviceDefault_CompoundButton_CheckBox=0x01030148; const int R::style::Widget_DeviceDefault_CompoundButton_RadioButton=0x01030159; const int R::style::Widget_DeviceDefault_CompoundButton_Star=0x0103015d; const int R::style::Widget_DeviceDefault_CompoundButton_Switch=0x010302a9; const int R::style::Widget_DeviceDefault_DatePicker=0x0103016f; const int R::style::Widget_DeviceDefault_DropDownItem=0x01030161; const int R::style::Widget_DeviceDefault_DropDownItem_Spinner=0x01030162; const int R::style::Widget_DeviceDefault_EditText=0x0103014a; const int R::style::Widget_DeviceDefault_ExpandableListView=0x0103014b; const int R::style::Widget_DeviceDefault_ExpandableListView_White=0x010302aa; const int R::style::Widget_DeviceDefault_Gallery=0x010302ab; const int R::style::Widget_DeviceDefault_GestureOverlayView=0x010302ac; const int R::style::Widget_DeviceDefault_GridView=0x0103014c; const int R::style::Widget_DeviceDefault_HorizontalScrollView=0x0103015b; const int R::style::Widget_DeviceDefault_ImageButton=0x0103014d; const int R::style::Widget_DeviceDefault_ImageWell=0x010302ad; const int R::style::Widget_DeviceDefault_KeyboardView=0x010302ae; const int R::style::Widget_DeviceDefault_Light=0x01030174; const int R::style::Widget_DeviceDefault_Light_AbsListView=0x010302c1; const int R::style::Widget_DeviceDefault_Light_ActionBar=0x010301a3; const int R::style::Widget_DeviceDefault_Light_ActionBar_Solid=0x010301a7; const int R::style::Widget_DeviceDefault_Light_ActionBar_Solid_Inverse=0x010301a8; const int R::style::Widget_DeviceDefault_Light_ActionBar_TabBar=0x010301a6; const int R::style::Widget_DeviceDefault_Light_ActionBar_TabBar_Inverse=0x010301a9; const int R::style::Widget_DeviceDefault_Light_ActionBar_TabText=0x010301a5; const int R::style::Widget_DeviceDefault_Light_ActionBar_TabText_Inverse=0x010301ab; const int R::style::Widget_DeviceDefault_Light_ActionBar_TabView=0x010301a4; const int R::style::Widget_DeviceDefault_Light_ActionBar_TabView_Inverse=0x010301aa; const int R::style::Widget_DeviceDefault_Light_ActionButton=0x0103019f; const int R::style::Widget_DeviceDefault_Light_ActionButton_CloseMode=0x010301a2; const int R::style::Widget_DeviceDefault_Light_ActionButton_Overflow=0x010301a0; const int R::style::Widget_DeviceDefault_Light_ActionMode=0x010301a1; const int R::style::Widget_DeviceDefault_Light_ActionMode_Inverse=0x010301ac; const int R::style::Widget_DeviceDefault_Light_AutoCompleteTextView=0x0103017b; const int R::style::Widget_DeviceDefault_Light_Button=0x01030175; const int R::style::Widget_DeviceDefault_Light_Button_Borderless=0x010302c4; const int R::style::Widget_DeviceDefault_Light_Button_Borderless_Small=0x01030179; const int R::style::Widget_DeviceDefault_Light_Button_Inset=0x01030177; const int R::style::Widget_DeviceDefault_Light_Button_Small=0x01030176; const int R::style::Widget_DeviceDefault_Light_Button_Toggle=0x01030178; const int R::style::Widget_DeviceDefault_Light_CalendarView=0x0103019e; const int R::style::Widget_DeviceDefault_Light_CheckedTextView=0x010301dc; const int R::style::Widget_DeviceDefault_Light_CompoundButton_CheckBox=0x0103017c; const int R::style::Widget_DeviceDefault_Light_CompoundButton_RadioButton=0x01030190; const int R::style::Widget_DeviceDefault_Light_CompoundButton_Star=0x01030194; const int R::style::Widget_DeviceDefault_Light_DatePicker=0x010302c5; const int R::style::Widget_DeviceDefault_Light_DropDownItem=0x01030198; const int R::style::Widget_DeviceDefault_Light_DropDownItem_Spinner=0x01030199; const int R::style::Widget_DeviceDefault_Light_EditText=0x0103017e; const int R::style::Widget_DeviceDefault_Light_ExpandableListView=0x0103017f; const int R::style::Widget_DeviceDefault_Light_ExpandableListView_White=0x010302c6; const int R::style::Widget_DeviceDefault_Light_Gallery=0x010302c7; const int R::style::Widget_DeviceDefault_Light_GestureOverlayView=0x010302c8; const int R::style::Widget_DeviceDefault_Light_GridView=0x01030180; const int R::style::Widget_DeviceDefault_Light_HorizontalScrollView=0x01030192; const int R::style::Widget_DeviceDefault_Light_ImageButton=0x01030181; const int R::style::Widget_DeviceDefault_Light_ImageWell=0x010302c9; const int R::style::Widget_DeviceDefault_Light_ListPopupWindow=0x0103019b; const int R::style::Widget_DeviceDefault_Light_ListView=0x01030182; const int R::style::Widget_DeviceDefault_Light_ListView_DropDown=0x0103017d; const int R::style::Widget_DeviceDefault_Light_ListView_White=0x010302ca; const int R::style::Widget_DeviceDefault_Light_MediaRouteButton=0x010301d8; const int R::style::Widget_DeviceDefault_Light_NumberPicker=0x010302cb; const int R::style::Widget_DeviceDefault_Light_PopupMenu=0x0103019c; const int R::style::Widget_DeviceDefault_Light_PopupWindow=0x01030183; const int R::style::Widget_DeviceDefault_Light_PopupWindow_ActionMode=0x010302c3; const int R::style::Widget_DeviceDefault_Light_ProgressBar=0x01030184; const int R::style::Widget_DeviceDefault_Light_ProgressBar_Horizontal=0x01030185; const int R::style::Widget_DeviceDefault_Light_ProgressBar_Inverse=0x01030189; const int R::style::Widget_DeviceDefault_Light_ProgressBar_Large=0x01030188; const int R::style::Widget_DeviceDefault_Light_ProgressBar_Large_Inverse=0x0103018b; const int R::style::Widget_DeviceDefault_Light_ProgressBar_Small=0x01030186; const int R::style::Widget_DeviceDefault_Light_ProgressBar_Small_Inverse=0x0103018a; const int R::style::Widget_DeviceDefault_Light_ProgressBar_Small_Title=0x01030187; const int R::style::Widget_DeviceDefault_Light_RatingBar=0x0103018d; const int R::style::Widget_DeviceDefault_Light_RatingBar_Indicator=0x0103018e; const int R::style::Widget_DeviceDefault_Light_RatingBar_Small=0x0103018f; const int R::style::Widget_DeviceDefault_Light_ScrollView=0x01030191; const int R::style::Widget_DeviceDefault_Light_SeekBar=0x0103018c; const int R::style::Widget_DeviceDefault_Light_Spinner=0x01030193; const int R::style::Widget_DeviceDefault_Light_Spinner_DropDown=0x010302cc; const int R::style::Widget_DeviceDefault_Light_Spinner_DropDown_ActionBar=0x010302c2; const int R::style::Widget_DeviceDefault_Light_Tab=0x0103019d; const int R::style::Widget_DeviceDefault_Light_TabWidget=0x01030195; const int R::style::Widget_DeviceDefault_Light_TextSuggestionsPopupWindow=0x010302cf; const int R::style::Widget_DeviceDefault_Light_TextView=0x0103017a; const int R::style::Widget_DeviceDefault_Light_TextView_ListSeparator=0x010302cd; const int R::style::Widget_DeviceDefault_Light_TextView_SpinnerItem=0x0103019a; const int R::style::Widget_DeviceDefault_Light_TimePicker=0x010302ce; const int R::style::Widget_DeviceDefault_Light_WebTextView=0x01030196; const int R::style::Widget_DeviceDefault_Light_WebView=0x01030197; const int R::style::Widget_DeviceDefault_ListPopupWindow=0x01030164; const int R::style::Widget_DeviceDefault_ListView=0x0103014e; const int R::style::Widget_DeviceDefault_ListView_DropDown=0x01030149; const int R::style::Widget_DeviceDefault_ListView_White=0x010302af; const int R::style::Widget_DeviceDefault_MediaRouteButton=0x010301d7; const int R::style::Widget_DeviceDefault_NumberPicker=0x010302b0; const int R::style::Widget_DeviceDefault_PopupMenu=0x01030165; const int R::style::Widget_DeviceDefault_PopupWindow=0x0103014f; const int R::style::Widget_DeviceDefault_PopupWindow_ActionMode=0x010302a8; const int R::style::Widget_DeviceDefault_PreferenceFrameLayout=0x010302b1; const int R::style::Widget_DeviceDefault_ProgressBar=0x01030150; const int R::style::Widget_DeviceDefault_ProgressBar_Horizontal=0x01030151; const int R::style::Widget_DeviceDefault_ProgressBar_Inverse=0x010302b2; const int R::style::Widget_DeviceDefault_ProgressBar_Large=0x01030154; const int R::style::Widget_DeviceDefault_ProgressBar_Large_Inverse=0x010302b3; const int R::style::Widget_DeviceDefault_ProgressBar_Small=0x01030152; const int R::style::Widget_DeviceDefault_ProgressBar_Small_Inverse=0x010302b4; const int R::style::Widget_DeviceDefault_ProgressBar_Small_Title=0x01030153; const int R::style::Widget_DeviceDefault_QuickContactBadge_WindowLarge=0x010302b5; const int R::style::Widget_DeviceDefault_QuickContactBadge_WindowMedium=0x010302b6; const int R::style::Widget_DeviceDefault_QuickContactBadge_WindowSmall=0x010302b7; const int R::style::Widget_DeviceDefault_QuickContactBadgeSmall_WindowLarge=0x010302b8; const int R::style::Widget_DeviceDefault_QuickContactBadgeSmall_WindowMedium=0x010302b9; const int R::style::Widget_DeviceDefault_QuickContactBadgeSmall_WindowSmall=0x010302ba; const int R::style::Widget_DeviceDefault_RatingBar=0x01030156; const int R::style::Widget_DeviceDefault_RatingBar_Indicator=0x01030157; const int R::style::Widget_DeviceDefault_RatingBar_Small=0x01030158; const int R::style::Widget_DeviceDefault_ScrollView=0x0103015a; const int R::style::Widget_DeviceDefault_SeekBar=0x01030155; const int R::style::Widget_DeviceDefault_Spinner=0x0103015c; const int R::style::Widget_DeviceDefault_Spinner_DropDown=0x010302bb; const int R::style::Widget_DeviceDefault_Spinner_DropDown_ActionBar=0x010302a7; const int R::style::Widget_DeviceDefault_StackView=0x010302bc; const int R::style::Widget_DeviceDefault_Tab=0x0103016d; const int R::style::Widget_DeviceDefault_TabWidget=0x0103015e; const int R::style::Widget_DeviceDefault_TextSelectHandle=0x010302bd; const int R::style::Widget_DeviceDefault_TextSuggestionsPopupWindow=0x010302be; const int R::style::Widget_DeviceDefault_TextView=0x01030146; const int R::style::Widget_DeviceDefault_TextView_ListSeparator=0x010302bf; const int R::style::Widget_DeviceDefault_TextView_SpinnerItem=0x01030163; const int R::style::Widget_DeviceDefault_TimePicker=0x010302c0; const int R::style::Widget_DeviceDefault_WebTextView=0x0103015f; const int R::style::Widget_DeviceDefault_WebView=0x01030160; const int R::style::Widget_DropDownItem=0x0103002b; const int R::style::Widget_DropDownItem_Spinner=0x0103002c; const int R::style::Widget_EditText=0x01030023; const int R::style::Widget_ExpandableListView=0x01030024; const int R::style::Widget_ExpandableListView_White=0x01030206; const int R::style::Widget_FragmentBreadCrumbs=0x01030089; const int R::style::Widget_Gallery=0x01030035; const int R::style::Widget_GenericQuickContactBadge=0x0103020b; const int R::style::Widget_GestureOverlayView=0x010301fd; const int R::style::Widget_GestureOverlayView_White=0x010301fe; const int R::style::Widget_GridView=0x01030032; const int R::style::Widget_Holo=0x0103008a; const int R::style::Widget_Holo_AbsListView=0x01030260; const int R::style::Widget_Holo_ActionBar=0x010300b4; const int R::style::Widget_Holo_ActionBar_Solid=0x01030121; const int R::style::Widget_Holo_ActionBar_TabBar=0x010300f7; const int R::style::Widget_Holo_ActionBar_TabText=0x010300f6; const int R::style::Widget_Holo_ActionBar_TabView=0x010300f5; const int R::style::Widget_Holo_ActionButton=0x010300af; const int R::style::Widget_Holo_ActionButton_CloseMode=0x010300b3; const int R::style::Widget_Holo_ActionButton_Overflow=0x010300b0; const int R::style::Widget_Holo_ActionButton_TextButton=0x010300b1; const int R::style::Widget_Holo_ActionMode=0x010300b2; const int R::style::Widget_Holo_ActivityChooserView=0x01030267; const int R::style::Widget_Holo_AutoCompleteTextView=0x01030090; const int R::style::Widget_Holo_Button=0x0103008b; const int R::style::Widget_Holo_Button_Borderless=0x010300e2; const int R::style::Widget_Holo_Button_Borderless_Small=0x0103011a; const int R::style::Widget_Holo_Button_Inset=0x0103008d; const int R::style::Widget_Holo_Button_Small=0x0103008c; const int R::style::Widget_Holo_Button_Toggle=0x0103008e; const int R::style::Widget_Holo_ButtonBar=0x01030278; const int R::style::Widget_Holo_ButtonBar_Button=0x01030279; const int R::style::Widget_Holo_CalendarView=0x010300ec; const int R::style::Widget_Holo_CheckedTextView=0x010301d9; const int R::style::Widget_Holo_CompoundButton=0x01030261; const int R::style::Widget_Holo_CompoundButton_CheckBox=0x01030091; const int R::style::Widget_Holo_CompoundButton_RadioButton=0x010300a2; const int R::style::Widget_Holo_CompoundButton_Star=0x010300a6; const int R::style::Widget_Holo_CompoundButton_Switch=0x0103027a; const int R::style::Widget_Holo_DatePicker=0x010300ef; const int R::style::Widget_Holo_DropDownItem=0x010300aa; const int R::style::Widget_Holo_DropDownItem_Spinner=0x010300ab; const int R::style::Widget_Holo_EditText=0x01030093; const int R::style::Widget_Holo_ExpandableListView=0x01030094; const int R::style::Widget_Holo_ExpandableListView_White=0x01030262; const int R::style::Widget_Holo_Gallery=0x01030263; const int R::style::Widget_Holo_GestureOverlayView=0x01030264; const int R::style::Widget_Holo_GridView=0x01030095; const int R::style::Widget_Holo_HorizontalScrollView=0x010300a4; const int R::style::Widget_Holo_ImageButton=0x01030096; const int R::style::Widget_Holo_ImageWell=0x01030268; const int R::style::Widget_Holo_KeyboardView=0x01030271; const int R::style::Widget_Holo_Light=0x010300b5; const int R::style::Widget_Holo_Light_AbsListView=0x0103027f; const int R::style::Widget_Holo_Light_ActionBar=0x010300e1; const int R::style::Widget_Holo_Light_ActionBar_Solid=0x01030122; const int R::style::Widget_Holo_Light_ActionBar_Solid_Inverse=0x01030123; const int R::style::Widget_Holo_Light_ActionBar_TabBar=0x010300fa; const int R::style::Widget_Holo_Light_ActionBar_TabBar_Inverse=0x01030124; const int R::style::Widget_Holo_Light_ActionBar_TabText=0x010300f9; const int R::style::Widget_Holo_Light_ActionBar_TabText_Inverse=0x01030126; const int R::style::Widget_Holo_Light_ActionBar_TabView=0x010300f8; const int R::style::Widget_Holo_Light_ActionBar_TabView_Inverse=0x01030125; const int R::style::Widget_Holo_Light_ActionButton=0x010300dd; const int R::style::Widget_Holo_Light_ActionButton_CloseMode=0x010300e0; const int R::style::Widget_Holo_Light_ActionButton_Overflow=0x010300de; const int R::style::Widget_Holo_Light_ActionMode=0x010300df; const int R::style::Widget_Holo_Light_ActionMode_Inverse=0x01030127; const int R::style::Widget_Holo_Light_ActivityChooserView=0x01030286; const int R::style::Widget_Holo_Light_AutoCompleteTextView=0x010300bb; const int R::style::Widget_Holo_Light_Button=0x010300b6; const int R::style::Widget_Holo_Light_Button_Borderless=0x0103027b; const int R::style::Widget_Holo_Light_Button_Borderless_Small=0x0103011b; const int R::style::Widget_Holo_Light_Button_Inset=0x010300b8; const int R::style::Widget_Holo_Light_Button_Small=0x010300b7; const int R::style::Widget_Holo_Light_Button_Toggle=0x010300b9; const int R::style::Widget_Holo_Light_CalendarView=0x010300ed; const int R::style::Widget_Holo_Light_CheckedTextView=0x010301da; const int R::style::Widget_Holo_Light_CompoundButton_CheckBox=0x010300bc; const int R::style::Widget_Holo_Light_CompoundButton_RadioButton=0x010300d0; const int R::style::Widget_Holo_Light_CompoundButton_Star=0x010300d4; const int R::style::Widget_Holo_Light_CompoundButton_Switch=0x01030293; const int R::style::Widget_Holo_Light_DatePicker=0x01030285; const int R::style::Widget_Holo_Light_DropDownItem=0x010300d8; const int R::style::Widget_Holo_Light_DropDownItem_Spinner=0x010300d9; const int R::style::Widget_Holo_Light_EditText=0x010300be; const int R::style::Widget_Holo_Light_ExpandableListView=0x010300bf; const int R::style::Widget_Holo_Light_ExpandableListView_White=0x01030280; const int R::style::Widget_Holo_Light_Gallery=0x01030281; const int R::style::Widget_Holo_Light_GestureOverlayView=0x01030282; const int R::style::Widget_Holo_Light_GridView=0x010300c0; const int R::style::Widget_Holo_Light_HorizontalScrollView=0x010300d2; const int R::style::Widget_Holo_Light_ImageButton=0x010300c1; const int R::style::Widget_Holo_Light_ImageWell=0x01030287; const int R::style::Widget_Holo_Light_KeyboardView=0x0103028c; const int R::style::Widget_Holo_Light_ListPopupWindow=0x010300db; const int R::style::Widget_Holo_Light_ListView=0x010300c2; const int R::style::Widget_Holo_Light_ListView_DropDown=0x010300bd; const int R::style::Widget_Holo_Light_ListView_White=0x01030288; const int R::style::Widget_Holo_Light_MediaRouteButton=0x010301d6; const int R::style::Widget_Holo_Light_NumberPicker=0x01030283; const int R::style::Widget_Holo_Light_PopupMenu=0x010300dc; const int R::style::Widget_Holo_Light_PopupWindow=0x010300c3; const int R::style::Widget_Holo_Light_PopupWindow_ActionMode=0x01030289; const int R::style::Widget_Holo_Light_ProgressBar=0x010300c4; const int R::style::Widget_Holo_Light_ProgressBar_Horizontal=0x010300c5; const int R::style::Widget_Holo_Light_ProgressBar_Inverse=0x010300c9; const int R::style::Widget_Holo_Light_ProgressBar_Large=0x010300c8; const int R::style::Widget_Holo_Light_ProgressBar_Large_Inverse=0x010300cb; const int R::style::Widget_Holo_Light_ProgressBar_Small=0x010300c6; const int R::style::Widget_Holo_Light_ProgressBar_Small_Inverse=0x010300ca; const int R::style::Widget_Holo_Light_ProgressBar_Small_Title=0x010300c7; const int R::style::Widget_Holo_Light_QuickContactBadge_WindowLarge=0x0103028f; const int R::style::Widget_Holo_Light_QuickContactBadge_WindowMedium=0x0103028e; const int R::style::Widget_Holo_Light_QuickContactBadge_WindowSmall=0x0103028d; const int R::style::Widget_Holo_Light_QuickContactBadgeSmall_WindowLarge=0x01030292; const int R::style::Widget_Holo_Light_QuickContactBadgeSmall_WindowMedium=0x01030291; const int R::style::Widget_Holo_Light_QuickContactBadgeSmall_WindowSmall=0x01030290; const int R::style::Widget_Holo_Light_RatingBar=0x010300cd; const int R::style::Widget_Holo_Light_RatingBar_Indicator=0x010300ce; const int R::style::Widget_Holo_Light_RatingBar_Small=0x010300cf; const int R::style::Widget_Holo_Light_ScrollView=0x010300d1; const int R::style::Widget_Holo_Light_SeekBar=0x010300cc; const int R::style::Widget_Holo_Light_Spinner=0x010300d3; const int R::style::Widget_Holo_Light_Spinner_DropDown=0x0103028a; const int R::style::Widget_Holo_Light_Spinner_DropDown_ActionBar=0x0103028b; const int R::style::Widget_Holo_Light_Tab=0x010300e4; const int R::style::Widget_Holo_Light_TabWidget=0x010300d5; const int R::style::Widget_Holo_Light_TextSelectHandle=0x0103027d; const int R::style::Widget_Holo_Light_TextSuggestionsPopupWindow=0x0103027e; const int R::style::Widget_Holo_Light_TextView=0x010300ba; const int R::style::Widget_Holo_Light_TextView_ListSeparator=0x0103027c; const int R::style::Widget_Holo_Light_TextView_SpinnerItem=0x010300da; const int R::style::Widget_Holo_Light_TimePicker=0x01030284; const int R::style::Widget_Holo_Light_WebTextView=0x010300d6; const int R::style::Widget_Holo_Light_WebView=0x010300d7; const int R::style::Widget_Holo_ListPopupWindow=0x010300ad; const int R::style::Widget_Holo_ListView=0x01030097; const int R::style::Widget_Holo_ListView_DropDown=0x01030092; const int R::style::Widget_Holo_ListView_White=0x01030269; const int R::style::Widget_Holo_MediaRouteButton=0x010301d5; const int R::style::Widget_Holo_NumberPicker=0x01030265; const int R::style::Widget_Holo_PopupMenu=0x010300ae; const int R::style::Widget_Holo_PopupWindow=0x01030098; const int R::style::Widget_Holo_PopupWindow_ActionMode=0x0103026a; const int R::style::Widget_Holo_PreferenceFrameLayout=0x0103029d; const int R::style::Widget_Holo_ProgressBar=0x01030099; const int R::style::Widget_Holo_ProgressBar_Horizontal=0x0103009a; const int R::style::Widget_Holo_ProgressBar_Inverse=0x0103026b; const int R::style::Widget_Holo_ProgressBar_Large=0x0103009d; const int R::style::Widget_Holo_ProgressBar_Large_Inverse=0x0103026d; const int R::style::Widget_Holo_ProgressBar_Small=0x0103009b; const int R::style::Widget_Holo_ProgressBar_Small_Inverse=0x0103026c; const int R::style::Widget_Holo_ProgressBar_Small_Title=0x0103009c; const int R::style::Widget_Holo_QuickContactBadge_WindowLarge=0x01030274; const int R::style::Widget_Holo_QuickContactBadge_WindowMedium=0x01030273; const int R::style::Widget_Holo_QuickContactBadge_WindowSmall=0x01030272; const int R::style::Widget_Holo_QuickContactBadgeSmall_WindowLarge=0x01030277; const int R::style::Widget_Holo_QuickContactBadgeSmall_WindowMedium=0x01030276; const int R::style::Widget_Holo_QuickContactBadgeSmall_WindowSmall=0x01030275; const int R::style::Widget_Holo_RatingBar=0x0103009f; const int R::style::Widget_Holo_RatingBar_Indicator=0x010300a0; const int R::style::Widget_Holo_RatingBar_Small=0x010300a1; const int R::style::Widget_Holo_ScrollView=0x010300a3; const int R::style::Widget_Holo_SeekBar=0x0103009e; const int R::style::Widget_Holo_Spinner=0x010300a5; const int R::style::Widget_Holo_Spinner_DropDown=0x0103026e; const int R::style::Widget_Holo_Spinner_DropDown_ActionBar=0x0103026f; const int R::style::Widget_Holo_StackView=0x0103025c; const int R::style::Widget_Holo_Tab=0x010300e3; const int R::style::Widget_Holo_TabText=0x01030270; const int R::style::Widget_Holo_TabWidget=0x010300a7; const int R::style::Widget_Holo_TextSelectHandle=0x0103025e; const int R::style::Widget_Holo_TextSuggestionsPopupWindow=0x0103025f; const int R::style::Widget_Holo_TextView=0x0103008f; const int R::style::Widget_Holo_TextView_ListSeparator=0x0103025d; const int R::style::Widget_Holo_TextView_SpinnerItem=0x010300ac; const int R::style::Widget_Holo_TimePicker=0x01030266; const int R::style::Widget_Holo_WebTextView=0x010300a8; const int R::style::Widget_Holo_WebView=0x010300a9; const int R::style::Widget_HorizontalScrollView=0x01030209; const int R::style::Widget_ImageButton=0x01030026; const int R::style::Widget_ImageWell=0x01030025; const int R::style::Widget_KeyboardView=0x01030057; const int R::style::Widget_ListPopupWindow=0x01030085; const int R::style::Widget_ListView=0x0103002e; const int R::style::Widget_ListView_DropDown=0x01030030; const int R::style::Widget_ListView_Menu=0x01030031; const int R::style::Widget_ListView_White=0x0103002f; const int R::style::Widget_NumberPicker=0x01030207; const int R::style::Widget_PopupMenu=0x01030086; const int R::style::Widget_PopupWindow=0x01030036; const int R::style::Widget_PreferenceFrameLayout=0x010301e1; const int R::style::Widget_ProgressBar=0x0103001c; const int R::style::Widget_ProgressBar_Horizontal=0x0103001f; const int R::style::Widget_ProgressBar_Inverse=0x0103005b; const int R::style::Widget_ProgressBar_Large=0x0103001d; const int R::style::Widget_ProgressBar_Large_Inverse=0x0103005c; const int R::style::Widget_ProgressBar_Small=0x0103001e; const int R::style::Widget_ProgressBar_Small_Inverse=0x0103005d; const int R::style::Widget_ProgressBar_Small_Title=0x01030200; const int R::style::Widget_QuickContactBadge=0x0103020c; const int R::style::Widget_QuickContactBadge_WindowLarge=0x01030210; const int R::style::Widget_QuickContactBadge_WindowMedium=0x0103020f; const int R::style::Widget_QuickContactBadge_WindowSmall=0x0103020e; const int R::style::Widget_QuickContactBadgeSmall=0x0103020d; const int R::style::Widget_QuickContactBadgeSmall_WindowLarge=0x01030213; const int R::style::Widget_QuickContactBadgeSmall_WindowMedium=0x01030212; const int R::style::Widget_QuickContactBadgeSmall_WindowSmall=0x01030211; const int R::style::Widget_RatingBar=0x01030021; const int R::style::Widget_RatingBar_Indicator=0x01030201; const int R::style::Widget_RatingBar_Small=0x01030202; const int R::style::Widget_ScrollView=0x0103002d; const int R::style::Widget_SeekBar=0x01030020; const int R::style::Widget_Spinner=0x01030028; const int R::style::Widget_Spinner_DropDown=0x01030083; const int R::style::Widget_TabWidget=0x01030034; const int R::style::Widget_TextSelectHandle=0x01030235; const int R::style::Widget_TextSuggestionsPopupWindow=0x01030237; const int R::style::Widget_TextView=0x01030022; const int R::style::Widget_TextView_ListSeparator=0x01030204; const int R::style::Widget_TextView_ListSeparator_White=0x01030205; const int R::style::Widget_TextView_PopupMenu=0x01030029; const int R::style::Widget_TextView_SpinnerItem=0x0103002a; const int R::style::Widget_TimePicker=0x01030208; const int R::style::Widget_WebTextView=0x0103020a; const int R::style::Widget_WebView=0x01030033; const int R::style::WindowTitle=0x010301de; const int R::style::WindowTitle_DeviceDefault=0x010302ed; const int R::style::WindowTitle_Holo=0x0103029a; const int R::style::WindowTitleBackground=0x010301dd; const int R::style::WindowTitleBackground_DeviceDefault=0x010302ee; const int R::style::WindowTitleBackground_Holo=0x01030299; const int R::style::ZoomControls=0x01030233; const int R::style::wifi_item=0x0103029f; const int R::style::wifi_item_content=0x010302a1; const int R::style::wifi_item_label=0x010302a0; const int R::style::wifi_section=0x010302a2; const int R::xml::apns=0x010f0000; const int R::xml::autotext=0x010f0001; const int R::xml::eri=0x010f0002; const int R::xml::kg_password_kbd_numeric=0x010f0003; const int R::xml::password_kbd_extension=0x010f0004; const int R::xml::password_kbd_numeric=0x010f0005; const int R::xml::password_kbd_popup_template=0x010f0006; const int R::xml::password_kbd_qwerty=0x010f0007; const int R::xml::password_kbd_qwerty_shifted=0x010f0008; const int R::xml::password_kbd_symbols=0x010f0009; const int R::xml::password_kbd_symbols_shift=0x010f000a; const int R::xml::power_profile=0x010f000b; const int R::xml::preferred_time_zones=0x010f000c; const int R::xml::sms_short_codes=0x010f000d; const int R::xml::storage_list=0x010f000e; const int R::xml::time_zones_by_country=0x010f000f; const int R::styleable::AbsListView[] = { 0x010100fb, 0x010100fc, 0x010100fd, 0x010100fe, 0x010100ff, 0x01010100, 0x01010101, 0x0101012b, 0x01010226, 0x01010231, 0x01010335 }; const int R::AbsListView_cacheColorHint = 6; const int R::AbsListView_choiceMode = 7; const int R::AbsListView_drawSelectorOnTop = 1; const int R::AbsListView_fastScrollAlwaysVisible = 10; const int R::AbsListView_fastScrollEnabled = 8; const int R::AbsListView_listSelector = 0; const int R::AbsListView_scrollingCache = 3; const int R::AbsListView_smoothScrollbar = 9; const int R::AbsListView_stackFromBottom = 2; const int R::AbsListView_textFilterEnabled = 4; const int R::AbsListView_transcriptMode = 5; const int R::styleable::AbsSpinner[] = { 0x010100b2 }; const int R::AbsSpinner_entries = 0; const int R::styleable::AbsoluteLayout_Layout[] = { 0x0101017f, 0x01010180 }; const int R::AbsoluteLayout_Layout_layout_x = 0; const int R::AbsoluteLayout_Layout_layout_y = 1; const int R::styleable::AccelerateInterpolator[] = { 0x010101d3 }; const int R::AccelerateInterpolator_factor = 0; const int R::styleable::AccessibilityService[] = { 0x01010020, 0x01010225, 0x01010380, 0x01010381, 0x01010382, 0x01010383, 0x01010384, 0x01010385 }; const int R::AccessibilityService_accessibilityEventTypes = 2; const int R::AccessibilityService_accessibilityFeedbackType = 4; const int R::AccessibilityService_accessibilityFlags = 6; const int R::AccessibilityService_canRetrieveWindowContent = 7; const int R::AccessibilityService_description = 0; const int R::AccessibilityService_notificationTimeout = 5; const int R::AccessibilityService_packageNames = 3; const int R::AccessibilityService_settingsActivity = 1; const int R::styleable::AccountAuthenticator[] = { 0x01010001, 0x01010002, 0x0101028f, 0x0101029e, 0x0101029f, 0x0101033b }; const int R::AccountAuthenticator_accountPreferences = 4; const int R::AccountAuthenticator_accountType = 2; const int R::AccountAuthenticator_customTokens = 5; const int R::AccountAuthenticator_icon = 1; const int R::AccountAuthenticator_label = 0; const int R::AccountAuthenticator_smallIcon = 3; const int R::styleable::ActionBar[] = { 0x01010002, 0x01010077, 0x010100d4, 0x01010129, 0x01010155, 0x010101e1, 0x010102be, 0x010102cf, 0x010102d0, 0x010102d1, 0x010102d2, 0x010102f8, 0x010102f9, 0x01010318, 0x01010319, 0x0101031d, 0x0101032d, 0x0101038a, 0x0101038b }; const int R::ActionBar_background = 2; const int R::ActionBar_backgroundSplit = 18; const int R::ActionBar_backgroundStacked = 17; const int R::ActionBar_customNavigationLayout = 10; const int R::ActionBar_displayOptions = 8; const int R::ActionBar_divider = 3; const int R::ActionBar_height = 4; const int R::ActionBar_homeLayout = 15; const int R::ActionBar_icon = 0; const int R::ActionBar_indeterminateProgressStyle = 13; const int R::ActionBar_itemPadding = 16; const int R::ActionBar_logo = 6; const int R::ActionBar_navigationMode = 7; const int R::ActionBar_progressBarPadding = 14; const int R::ActionBar_progressBarStyle = 1; const int R::ActionBar_subtitle = 9; const int R::ActionBar_subtitleTextStyle = 12; const int R::ActionBar_title = 5; const int R::ActionBar_titleTextStyle = 11; const int R::styleable::ActionBar_LayoutParams[] = { 0x010100b3 }; const int R::ActionBar_LayoutParams_layout_gravity = 0; const int R::styleable::ActionMenuItemView[] = { 0x0101013f }; const int R::ActionMenuItemView_minWidth = 0; const int R::styleable::ActionMode[] = { 0x010100d4, 0x01010155, 0x010102f8, 0x010102f9, 0x0101038b }; const int R::ActionMode_background = 0; const int R::ActionMode_backgroundSplit = 4; const int R::ActionMode_height = 1; const int R::ActionMode_subtitleTextStyle = 3; const int R::ActionMode_titleTextStyle = 2; const int R::styleable::ActivityChooserView[] = { 0x01010424, 0x01010425 }; const int R::ActivityChooserView_expandActivityOverflowButtonDrawable = 1; const int R::ActivityChooserView_initialActivityCount = 0; const int R::styleable::AdapterViewAnimator[] = { 0x01010177, 0x01010178, 0x010102d5, 0x01010307 }; const int R::AdapterViewAnimator_animateFirstView = 2; const int R::AdapterViewAnimator_inAnimation = 0; const int R::AdapterViewAnimator_loopViews = 3; const int R::AdapterViewAnimator_outAnimation = 1; const int R::styleable::AdapterViewFlipper[] = { 0x01010179, 0x010102b5 }; const int R::AdapterViewFlipper_autoStart = 1; const int R::AdapterViewFlipper_flipInterval = 0; const int R::styleable::AlertDialog[] = { 0x010100c6, 0x010100c7, 0x010100c8, 0x010100c9, 0x010100ca, 0x010100cb, 0x010100cc, 0x010100cd, 0x010100ce, 0x010100cf, 0x010100f2, 0x010103ff, 0x01010400, 0x01010401, 0x01010402, 0x01010403, 0x01010404 }; const int R::AlertDialog_bottomBright = 7; const int R::AlertDialog_bottomDark = 3; const int R::AlertDialog_bottomMedium = 8; const int R::AlertDialog_centerBright = 6; const int R::AlertDialog_centerDark = 2; const int R::AlertDialog_centerMedium = 9; const int R::AlertDialog_fullBright = 4; const int R::AlertDialog_fullDark = 0; const int R::AlertDialog_horizontalProgressLayout = 16; const int R::AlertDialog_layout = 10; const int R::AlertDialog_listItemLayout = 14; const int R::AlertDialog_listLayout = 11; const int R::AlertDialog_multiChoiceItemLayout = 12; const int R::AlertDialog_progressLayout = 15; const int R::AlertDialog_singleChoiceItemLayout = 13; const int R::AlertDialog_topBright = 5; const int R::AlertDialog_topDark = 1; const int R::styleable::AlphaAnimation[] = { 0x010101ca, 0x010101cb }; const int R::AlphaAnimation_fromAlpha = 0; const int R::AlphaAnimation_toAlpha = 1; const int R::styleable::AnalogClock[] = { 0x01010102, 0x01010103, 0x01010104 }; const int R::AnalogClock_dial = 0; const int R::AnalogClock_hand_hour = 1; const int R::AnalogClock_hand_minute = 2; const int R::styleable::AndroidManifest[] = { 0x0101000b, 0x0101021b, 0x0101021c, 0x01010261, 0x010102b7 }; const int R::AndroidManifest_installLocation = 4; const int R::AndroidManifest_sharedUserId = 0; const int R::AndroidManifest_sharedUserLabel = 3; const int R::AndroidManifest_versionCode = 1; const int R::AndroidManifest_versionName = 2; const int R::styleable::AndroidManifestAction[] = { 0x01010003 }; const int R::AndroidManifestAction_name = 0; const int R::styleable::AndroidManifestActivity[] = { 0x01010000, 0x01010001, 0x01010002, 0x01010003, 0x01010006, 0x0101000e, 0x01010010, 0x01010011, 0x01010012, 0x01010013, 0x01010014, 0x01010015, 0x01010016, 0x01010017, 0x0101001d, 0x0101001e, 0x0101001f, 0x01010020, 0x01010203, 0x01010204, 0x0101022b, 0x0101022d, 0x010102a7, 0x010102be, 0x010102c0, 0x010102d3, 0x01010398, 0x010103a7, 0x010103bf, 0x010103c9, 0x01010457 }; const int R::AndroidManifestActivity_allowTaskReparenting = 19; const int R::AndroidManifestActivity_alwaysRetainTaskState = 18; const int R::AndroidManifestActivity_clearTaskOnLaunch = 11; const int R::AndroidManifestActivity_configChanges = 16; const int R::AndroidManifestActivity_description = 17; const int R::AndroidManifestActivity_enabled = 5; const int R::AndroidManifestActivity_excludeFromRecents = 13; const int R::AndroidManifestActivity_exported = 6; const int R::AndroidManifestActivity_finishOnCloseSystemDialogs = 22; const int R::AndroidManifestActivity_finishOnTaskLaunch = 10; const int R::AndroidManifestActivity_hardwareAccelerated = 25; const int R::AndroidManifestActivity_icon = 2; const int R::AndroidManifestActivity_immersive = 24; const int R::AndroidManifestActivity_label = 1; const int R::AndroidManifestActivity_launchMode = 14; const int R::AndroidManifestActivity_logo = 23; const int R::AndroidManifestActivity_multiprocess = 9; const int R::AndroidManifestActivity_name = 3; const int R::AndroidManifestActivity_noHistory = 21; const int R::AndroidManifestActivity_parentActivityName = 27; const int R::AndroidManifestActivity_permission = 4; const int R::AndroidManifestActivity_primaryUserOnly = 30; const int R::AndroidManifestActivity_process = 7; const int R::AndroidManifestActivity_screenOrientation = 15; const int R::AndroidManifestActivity_showOnLockScreen = 29; const int R::AndroidManifestActivity_singleUser = 28; const int R::AndroidManifestActivity_stateNotNeeded = 12; const int R::AndroidManifestActivity_taskAffinity = 8; const int R::AndroidManifestActivity_theme = 0; const int R::AndroidManifestActivity_uiOptions = 26; const int R::AndroidManifestActivity_windowSoftInputMode = 20; const int R::styleable::AndroidManifestActivityAlias[] = { 0x01010001, 0x01010002, 0x01010003, 0x01010006, 0x0101000e, 0x01010010, 0x01010020, 0x01010202, 0x010102be, 0x010103a7 }; const int R::AndroidManifestActivityAlias_description = 6; const int R::AndroidManifestActivityAlias_enabled = 4; const int R::AndroidManifestActivityAlias_exported = 5; const int R::AndroidManifestActivityAlias_icon = 1; const int R::AndroidManifestActivityAlias_label = 0; const int R::AndroidManifestActivityAlias_logo = 8; const int R::AndroidManifestActivityAlias_name = 2; const int R::AndroidManifestActivityAlias_parentActivityName = 9; const int R::AndroidManifestActivityAlias_permission = 3; const int R::AndroidManifestActivityAlias_targetActivity = 7; const int R::styleable::AndroidManifestApplication[] = { 0x01010000, 0x01010001, 0x01010002, 0x01010003, 0x01010004, 0x01010005, 0x01010006, 0x0101000c, 0x0101000d, 0x0101000e, 0x0101000f, 0x01010011, 0x01010012, 0x01010020, 0x01010204, 0x01010272, 0x0101027f, 0x01010280, 0x0101029c, 0x0101029d, 0x010102b8, 0x010102ba, 0x010102be, 0x010102d3, 0x0101035a, 0x01010398, 0x010103af, 0x01010455, 0x01010456 }; const int R::AndroidManifestApplication_allowBackup = 17; const int R::AndroidManifestApplication_allowClearUserData = 5; const int R::AndroidManifestApplication_allowTaskReparenting = 14; const int R::AndroidManifestApplication_backupAgent = 16; const int R::AndroidManifestApplication_cantSaveState = 28; const int R::AndroidManifestApplication_debuggable = 10; const int R::AndroidManifestApplication_description = 13; const int R::AndroidManifestApplication_enabled = 9; const int R::AndroidManifestApplication_hardwareAccelerated = 23; const int R::AndroidManifestApplication_hasCode = 7; const int R::AndroidManifestApplication_icon = 2; const int R::AndroidManifestApplication_killAfterRestore = 18; const int R::AndroidManifestApplication_label = 1; const int R::AndroidManifestApplication_largeHeap = 24; const int R::AndroidManifestApplication_logo = 22; const int R::AndroidManifestApplication_manageSpaceActivity = 4; const int R::AndroidManifestApplication_name = 3; const int R::AndroidManifestApplication_neverEncrypt = 27; const int R::AndroidManifestApplication_permission = 6; const int R::AndroidManifestApplication_persistent = 8; const int R::AndroidManifestApplication_process = 11; const int R::AndroidManifestApplication_restoreAnyVersion = 21; const int R::AndroidManifestApplication_restoreNeedsApplication = 19; const int R::AndroidManifestApplication_supportsRtl = 26; const int R::AndroidManifestApplication_taskAffinity = 12; const int R::AndroidManifestApplication_testOnly = 15; const int R::AndroidManifestApplication_theme = 0; const int R::AndroidManifestApplication_uiOptions = 25; const int R::AndroidManifestApplication_vmSafeMode = 20; const int R::styleable::AndroidManifestCategory[] = { 0x01010003 }; const int R::AndroidManifestCategory_name = 0; const int R::styleable::AndroidManifestCompatibleScreensScreen[] = { 0x010102ca, 0x010102cb }; const int R::AndroidManifestCompatibleScreensScreen_screenDensity = 1; const int R::AndroidManifestCompatibleScreensScreen_screenSize = 0; const int R::styleable::AndroidManifestData[] = { 0x01010026, 0x01010027, 0x01010028, 0x01010029, 0x0101002a, 0x0101002b, 0x0101002c }; const int R::AndroidManifestData_host = 2; const int R::AndroidManifestData_mimeType = 0; const int R::AndroidManifestData_path = 4; const int R::AndroidManifestData_pathPattern = 6; const int R::AndroidManifestData_pathPrefix = 5; const int R::AndroidManifestData_port = 3; const int R::AndroidManifestData_scheme = 1; const int R::styleable::AndroidManifestGrantUriPermission[] = { 0x0101002a, 0x0101002b, 0x0101002c }; const int R::AndroidManifestGrantUriPermission_path = 0; const int R::AndroidManifestGrantUriPermission_pathPattern = 2; const int R::AndroidManifestGrantUriPermission_pathPrefix = 1; const int R::styleable::AndroidManifestInstrumentation[] = { 0x01010001, 0x01010002, 0x01010003, 0x01010021, 0x01010022, 0x01010023, 0x010102be }; const int R::AndroidManifestInstrumentation_functionalTest = 5; const int R::AndroidManifestInstrumentation_handleProfiling = 4; const int R::AndroidManifestInstrumentation_icon = 1; const int R::AndroidManifestInstrumentation_label = 0; const int R::AndroidManifestInstrumentation_logo = 6; const int R::AndroidManifestInstrumentation_name = 2; const int R::AndroidManifestInstrumentation_targetPackage = 3; const int R::styleable::AndroidManifestIntentFilter[] = { 0x01010001, 0x01010002, 0x0101001c, 0x010102be }; const int R::AndroidManifestIntentFilter_icon = 1; const int R::AndroidManifestIntentFilter_label = 0; const int R::AndroidManifestIntentFilter_logo = 3; const int R::AndroidManifestIntentFilter_priority = 2; const int R::styleable::AndroidManifestMetaData[] = { 0x01010003, 0x01010024, 0x01010025 }; const int R::AndroidManifestMetaData_name = 0; const int R::AndroidManifestMetaData_resource = 2; const int R::AndroidManifestMetaData_value = 1; const int R::styleable::AndroidManifestOriginalPackage[] = { 0x01010003 }; const int R::AndroidManifestOriginalPackage_name = 0; const int R::styleable::AndroidManifestPackageVerifier[] = { 0x01010003, 0x010103a6 }; const int R::AndroidManifestPackageVerifier_name = 0; const int R::AndroidManifestPackageVerifier_publicKey = 1; const int R::styleable::AndroidManifestPathPermission[] = { 0x01010006, 0x01010007, 0x01010008, 0x0101002a, 0x0101002b, 0x0101002c }; const int R::AndroidManifestPathPermission_path = 3; const int R::AndroidManifestPathPermission_pathPattern = 5; const int R::AndroidManifestPathPermission_pathPrefix = 4; const int R::AndroidManifestPathPermission_permission = 0; const int R::AndroidManifestPathPermission_readPermission = 1; const int R::AndroidManifestPathPermission_writePermission = 2; const int R::styleable::AndroidManifestPermission[] = { 0x01010001, 0x01010002, 0x01010003, 0x01010009, 0x0101000a, 0x01010020, 0x010102be, 0x010103c7 }; const int R::AndroidManifestPermission_description = 5; const int R::AndroidManifestPermission_icon = 1; const int R::AndroidManifestPermission_label = 0; const int R::AndroidManifestPermission_logo = 6; const int R::AndroidManifestPermission_name = 2; const int R::AndroidManifestPermission_permissionFlags = 7; const int R::AndroidManifestPermission_permissionGroup = 4; const int R::AndroidManifestPermission_protectionLevel = 3; const int R::styleable::AndroidManifestPermissionGroup[] = { 0x01010001, 0x01010002, 0x01010003, 0x0101001c, 0x01010020, 0x010102be, 0x010103c5 }; const int R::AndroidManifestPermissionGroup_description = 4; const int R::AndroidManifestPermissionGroup_icon = 1; const int R::AndroidManifestPermissionGroup_label = 0; const int R::AndroidManifestPermissionGroup_logo = 5; const int R::AndroidManifestPermissionGroup_name = 2; const int R::AndroidManifestPermissionGroup_permissionGroupFlags = 6; const int R::AndroidManifestPermissionGroup_priority = 3; const int R::styleable::AndroidManifestPermissionTree[] = { 0x01010001, 0x01010002, 0x01010003, 0x010102be }; const int R::AndroidManifestPermissionTree_icon = 1; const int R::AndroidManifestPermissionTree_label = 0; const int R::AndroidManifestPermissionTree_logo = 3; const int R::AndroidManifestPermissionTree_name = 2; const int R::styleable::AndroidManifestProtectedBroadcast[] = { 0x01010003 }; const int R::AndroidManifestProtectedBroadcast_name = 0; const int R::styleable::AndroidManifestProvider[] = { 0x01010001, 0x01010002, 0x01010003, 0x01010006, 0x01010007, 0x01010008, 0x0101000e, 0x01010010, 0x01010011, 0x01010013, 0x01010018, 0x01010019, 0x0101001a, 0x0101001b, 0x01010020, 0x010102be, 0x010103bf }; const int R::AndroidManifestProvider_authorities = 10; const int R::AndroidManifestProvider_description = 14; const int R::AndroidManifestProvider_enabled = 6; const int R::AndroidManifestProvider_exported = 7; const int R::AndroidManifestProvider_grantUriPermissions = 13; const int R::AndroidManifestProvider_icon = 1; const int R::AndroidManifestProvider_initOrder = 12; const int R::AndroidManifestProvider_label = 0; const int R::AndroidManifestProvider_logo = 15; const int R::AndroidManifestProvider_multiprocess = 9; const int R::AndroidManifestProvider_name = 2; const int R::AndroidManifestProvider_permission = 3; const int R::AndroidManifestProvider_process = 8; const int R::AndroidManifestProvider_readPermission = 4; const int R::AndroidManifestProvider_singleUser = 16; const int R::AndroidManifestProvider_syncable = 11; const int R::AndroidManifestProvider_writePermission = 5; const int R::styleable::AndroidManifestReceiver[] = { 0x01010001, 0x01010002, 0x01010003, 0x01010006, 0x0101000e, 0x01010010, 0x01010011, 0x01010020, 0x010102be, 0x010103bf }; const int R::AndroidManifestReceiver_description = 7; const int R::AndroidManifestReceiver_enabled = 4; const int R::AndroidManifestReceiver_exported = 5; const int R::AndroidManifestReceiver_icon = 1; const int R::AndroidManifestReceiver_label = 0; const int R::AndroidManifestReceiver_logo = 8; const int R::AndroidManifestReceiver_name = 2; const int R::AndroidManifestReceiver_permission = 3; const int R::AndroidManifestReceiver_process = 6; const int R::AndroidManifestReceiver_singleUser = 9; const int R::styleable::AndroidManifestService[] = { 0x01010001, 0x01010002, 0x01010003, 0x01010006, 0x0101000e, 0x01010010, 0x01010011, 0x01010020, 0x010102be, 0x0101036a, 0x010103a9, 0x010103bf }; const int R::AndroidManifestService_description = 7; const int R::AndroidManifestService_enabled = 4; const int R::AndroidManifestService_exported = 5; const int R::AndroidManifestService_icon = 1; const int R::AndroidManifestService_isolatedProcess = 10; const int R::AndroidManifestService_label = 0; const int R::AndroidManifestService_logo = 8; const int R::AndroidManifestService_name = 2; const int R::AndroidManifestService_permission = 3; const int R::AndroidManifestService_process = 6; const int R::AndroidManifestService_singleUser = 11; const int R::AndroidManifestService_stopWithTask = 9; const int R::styleable::AndroidManifestSupportsScreens[] = { 0x0101026c, 0x01010284, 0x01010285, 0x01010286, 0x0101028d, 0x010102bf, 0x01010364, 0x01010365, 0x01010366 }; const int R::AndroidManifestSupportsScreens_anyDensity = 0; const int R::AndroidManifestSupportsScreens_compatibleWidthLimitDp = 7; const int R::AndroidManifestSupportsScreens_largeScreens = 3; const int R::AndroidManifestSupportsScreens_largestWidthLimitDp = 8; const int R::AndroidManifestSupportsScreens_normalScreens = 2; const int R::AndroidManifestSupportsScreens_requiresSmallestWidthDp = 6; const int R::AndroidManifestSupportsScreens_resizeable = 4; const int R::AndroidManifestSupportsScreens_smallScreens = 1; const int R::AndroidManifestSupportsScreens_xlargeScreens = 5; const int R::styleable::AndroidManifestUsesConfiguration[] = { 0x01010227, 0x01010228, 0x01010229, 0x0101022a, 0x01010232 }; const int R::AndroidManifestUsesConfiguration_reqFiveWayNav = 4; const int R::AndroidManifestUsesConfiguration_reqHardKeyboard = 2; const int R::AndroidManifestUsesConfiguration_reqKeyboardType = 1; const int R::AndroidManifestUsesConfiguration_reqNavigation = 3; const int R::AndroidManifestUsesConfiguration_reqTouchScreen = 0; const int R::styleable::AndroidManifestUsesFeature[] = { 0x01010003, 0x01010281, 0x0101028e }; const int R::AndroidManifestUsesFeature_glEsVersion = 1; const int R::AndroidManifestUsesFeature_name = 0; const int R::AndroidManifestUsesFeature_required = 2; const int R::styleable::AndroidManifestUsesLibrary[] = { 0x01010003, 0x0101028e }; const int R::AndroidManifestUsesLibrary_name = 0; const int R::AndroidManifestUsesLibrary_required = 1; const int R::styleable::AndroidManifestUsesPermission[] = { 0x01010003 }; const int R::AndroidManifestUsesPermission_name = 0; const int R::styleable::AndroidManifestUsesSdk[] = { 0x0101020c, 0x01010270, 0x01010271 }; const int R::AndroidManifestUsesSdk_maxSdkVersion = 2; const int R::AndroidManifestUsesSdk_minSdkVersion = 0; const int R::AndroidManifestUsesSdk_targetSdkVersion = 1; const int R::styleable::AnimatedRotateDrawable[] = { 0x01010194, 0x01010199, 0x010101b5, 0x010101b6, 0x01010421, 0x01010422 }; const int R::AnimatedRotateDrawable_drawable = 1; const int R::AnimatedRotateDrawable_frameDuration = 4; const int R::AnimatedRotateDrawable_framesCount = 5; const int R::AnimatedRotateDrawable_pivotX = 2; const int R::AnimatedRotateDrawable_pivotY = 3; const int R::AnimatedRotateDrawable_visible = 0; const int R::styleable::Animation[] = { 0x010100d4, 0x01010141, 0x01010198, 0x010101bc, 0x010101bd, 0x010101be, 0x010101bf, 0x010101c0, 0x010101c1, 0x0101024f, 0x010102a6 }; const int R::Animation_background = 0; const int R::Animation_detachWallpaper = 10; const int R::Animation_duration = 2; const int R::Animation_fillAfter = 4; const int R::Animation_fillBefore = 3; const int R::Animation_fillEnabled = 9; const int R::Animation_interpolator = 1; const int R::Animation_repeatCount = 6; const int R::Animation_repeatMode = 7; const int R::Animation_startOffset = 5; const int R::Animation_zAdjustment = 8; const int R::styleable::AnimationDrawable[] = { 0x01010194, 0x01010195, 0x01010197 }; const int R::AnimationDrawable_oneshot = 2; const int R::AnimationDrawable_variablePadding = 1; const int R::AnimationDrawable_visible = 0; const int R::styleable::AnimationDrawableItem[] = { 0x01010198, 0x01010199 }; const int R::AnimationDrawableItem_drawable = 1; const int R::AnimationDrawableItem_duration = 0; const int R::styleable::AnimationSet[] = { 0x01010198, 0x010101bb, 0x010101bc, 0x010101bd, 0x010101be, 0x010101c0 }; const int R::AnimationSet_duration = 0; const int R::AnimationSet_fillAfter = 3; const int R::AnimationSet_fillBefore = 2; const int R::AnimationSet_repeatMode = 5; const int R::AnimationSet_shareInterpolator = 1; const int R::AnimationSet_startOffset = 4; const int R::styleable::Animator[] = { 0x01010141, 0x01010198, 0x010101be, 0x010101bf, 0x010101c0, 0x010102de, 0x010102df, 0x010102e0 }; const int R::Animator_duration = 1; const int R::Animator_interpolator = 0; const int R::Animator_repeatCount = 3; const int R::Animator_repeatMode = 4; const int R::Animator_startOffset = 2; const int R::Animator_valueFrom = 5; const int R::Animator_valueTo = 6; const int R::Animator_valueType = 7; const int R::styleable::AnimatorSet[] = { 0x010102e2 }; const int R::AnimatorSet_ordering = 0; const int R::styleable::AnticipateInterpolator[] = { 0x0101026a }; const int R::AnticipateInterpolator_tension = 0; const int R::styleable::AnticipateOvershootInterpolator[] = { 0x0101026a, 0x0101026b }; const int R::AnticipateOvershootInterpolator_extraTension = 1; const int R::AnticipateOvershootInterpolator_tension = 0; const int R::styleable::AppWidgetProviderInfo[] = { 0x0101013f, 0x01010140, 0x01010250, 0x01010251, 0x0101025d, 0x010102da, 0x0101030f, 0x01010363, 0x01010395, 0x01010396, 0x010103c2, 0x010103c4 }; const int R::AppWidgetProviderInfo_autoAdvanceViewId = 6; const int R::AppWidgetProviderInfo_configure = 4; const int R::AppWidgetProviderInfo_initialKeyguardLayout = 10; const int R::AppWidgetProviderInfo_initialLayout = 3; const int R::AppWidgetProviderInfo_minHeight = 1; const int R::AppWidgetProviderInfo_minResizeHeight = 9; const int R::AppWidgetProviderInfo_minResizeWidth = 8; const int R::AppWidgetProviderInfo_minWidth = 0; const int R::AppWidgetProviderInfo_previewImage = 5; const int R::AppWidgetProviderInfo_resizeMode = 7; const int R::AppWidgetProviderInfo_updatePeriodMillis = 2; const int R::AppWidgetProviderInfo_widgetCategory = 11; const int R::styleable::AutoCompleteTextView[] = { 0x01010172, 0x01010173, 0x01010174, 0x01010175, 0x01010220, 0x01010262, 0x01010263, 0x01010283, 0x010102ac, 0x010102ad }; const int R::AutoCompleteTextView_completionHint = 0; const int R::AutoCompleteTextView_completionHintView = 1; const int R::AutoCompleteTextView_completionThreshold = 2; const int R::AutoCompleteTextView_dropDownAnchor = 6; const int R::AutoCompleteTextView_dropDownHeight = 7; const int R::AutoCompleteTextView_dropDownHorizontalOffset = 8; const int R::AutoCompleteTextView_dropDownSelector = 3; const int R::AutoCompleteTextView_dropDownVerticalOffset = 9; const int R::AutoCompleteTextView_dropDownWidth = 5; const int R::AutoCompleteTextView_inputType = 4; const int R::styleable::BitmapDrawable[] = { 0x010100af, 0x01010119, 0x0101011a, 0x0101011b, 0x0101011c, 0x01010201 }; const int R::BitmapDrawable_antialias = 2; const int R::BitmapDrawable_dither = 4; const int R::BitmapDrawable_filter = 3; const int R::BitmapDrawable_gravity = 0; const int R::BitmapDrawable_src = 1; const int R::BitmapDrawable_tileMode = 5; const int R::styleable::Button[] = { }; const int R::styleable::CalendarView[] = { 0x0101033d, 0x0101033e, 0x0101033f, 0x01010340, 0x01010341, 0x01010342, 0x01010343, 0x01010344, 0x01010345, 0x01010346, 0x01010347, 0x01010348, 0x01010349 }; const int R::CalendarView_dateTextAppearance = 12; const int R::CalendarView_firstDayOfWeek = 0; const int R::CalendarView_focusedMonthDateColor = 6; const int R::CalendarView_maxDate = 3; const int R::CalendarView_minDate = 2; const int R::CalendarView_selectedDateVerticalBar = 10; const int R::CalendarView_selectedWeekBackgroundColor = 5; const int R::CalendarView_showWeekNumber = 1; const int R::CalendarView_shownWeekCount = 4; const int R::CalendarView_unfocusedMonthDateColor = 7; const int R::CalendarView_weekDayTextAppearance = 11; const int R::CalendarView_weekNumberColor = 8; const int R::CalendarView_weekSeparatorLineColor = 9; const int R::styleable::CheckBoxPreference[] = { 0x010101ef, 0x010101f0, 0x010101f1 }; const int R::CheckBoxPreference_disableDependentsState = 2; const int R::CheckBoxPreference_summaryOff = 1; const int R::CheckBoxPreference_summaryOn = 0; const int R::styleable::CheckedTextView[] = { 0x01010106, 0x01010108 }; const int R::CheckedTextView_checkMark = 1; const int R::CheckedTextView_checked = 0; const int R::styleable::Chronometer[] = { 0x01010105 }; const int R::Chronometer_format = 0; const int R::styleable::ClipDrawable[] = { 0x010100af, 0x01010199, 0x0101020a }; const int R::ClipDrawable_clipOrientation = 2; const int R::ClipDrawable_drawable = 1; const int R::ClipDrawable_gravity = 0; const int R::styleable::ColorDrawable[] = { 0x010101a5 }; const int R::ColorDrawable_color = 0; const int R::styleable::CompoundButton[] = { 0x01010106, 0x01010107 }; const int R::CompoundButton_button = 1; const int R::CompoundButton_checked = 0; const int R::styleable::ContactsDataKind[] = { 0x01010002, 0x01010026, 0x010102a2, 0x010102a3, 0x010102a4, 0x010102cc }; const int R::ContactsDataKind_allContactsName = 5; const int R::ContactsDataKind_detailColumn = 3; const int R::ContactsDataKind_detailSocialSummary = 4; const int R::ContactsDataKind_icon = 0; const int R::ContactsDataKind_mimeType = 1; const int R::ContactsDataKind_summaryColumn = 2; const int R::styleable::CycleInterpolator[] = { 0x010101d4 }; const int R::CycleInterpolator_cycles = 0; const int R::styleable::DatePicker[] = { 0x0101017c, 0x0101017d, 0x0101033f, 0x01010340, 0x0101034b, 0x0101034c, 0x01010413 }; const int R::DatePicker_calendarViewShown = 5; const int R::DatePicker_endYear = 1; const int R::DatePicker_internalLayout = 6; const int R::DatePicker_maxDate = 3; const int R::DatePicker_minDate = 2; const int R::DatePicker_spinnersShown = 4; const int R::DatePicker_startYear = 0; const int R::styleable::DecelerateInterpolator[] = { 0x010101d3 }; const int R::DecelerateInterpolator_factor = 0; const int R::styleable::DeviceAdmin[] = { 0x01010194 }; const int R::DeviceAdmin_visible = 0; const int R::styleable::DialogPreference[] = { 0x010101f2, 0x010101f3, 0x010101f4, 0x010101f5, 0x010101f6, 0x010101f7 }; const int R::DialogPreference_dialogIcon = 2; const int R::DialogPreference_dialogLayout = 5; const int R::DialogPreference_dialogMessage = 1; const int R::DialogPreference_dialogTitle = 0; const int R::DialogPreference_negativeButtonText = 4; const int R::DialogPreference_positiveButtonText = 3; const int R::styleable::Drawable[] = { 0x01010194 }; const int R::Drawable_visible = 0; const int R::styleable::DrawableCorners[] = { 0x010101a8, 0x010101a9, 0x010101aa, 0x010101ab, 0x010101ac }; const int R::DrawableCorners_bottomLeftRadius = 3; const int R::DrawableCorners_bottomRightRadius = 4; const int R::DrawableCorners_radius = 0; const int R::DrawableCorners_topLeftRadius = 1; const int R::DrawableCorners_topRightRadius = 2; const int R::styleable::DrawableStates[] = { 0x0101009c, 0x0101009d, 0x0101009e, 0x0101009f, 0x010100a0, 0x010100a1, 0x010100a2, 0x010100a3, 0x010100a4, 0x010100a5, 0x010100a6, 0x010100a7, 0x010102fe, 0x0101031b, 0x01010367, 0x01010368, 0x01010369, 0x01010423 }; const int R::DrawableStates_state_accelerated = 13; const int R::DrawableStates_state_accessibility_focused = 17; const int R::DrawableStates_state_activated = 12; const int R::DrawableStates_state_active = 6; const int R::DrawableStates_state_checkable = 3; const int R::DrawableStates_state_checked = 4; const int R::DrawableStates_state_drag_can_accept = 15; const int R::DrawableStates_state_drag_hovered = 16; const int R::DrawableStates_state_enabled = 2; const int R::DrawableStates_state_first = 8; const int R::DrawableStates_state_focused = 0; const int R::DrawableStates_state_hovered = 14; const int R::DrawableStates_state_last = 10; const int R::DrawableStates_state_middle = 9; const int R::DrawableStates_state_pressed = 11; const int R::DrawableStates_state_selected = 5; const int R::DrawableStates_state_single = 7; const int R::DrawableStates_state_window_focused = 1; const int R::styleable::Dream[] = { 0x01010225 }; const int R::Dream_settingsActivity = 0; const int R::styleable::EditText[] = { }; const int R::styleable::ExpandableListChildIndicatorState[] = { 0x010100a6 }; const int R::ExpandableListChildIndicatorState_state_last = 0; const int R::styleable::ExpandableListGroupIndicatorState[] = { 0x010100a8, 0x010100a9 }; const int R::ExpandableListGroupIndicatorState_state_empty = 1; const int R::ExpandableListGroupIndicatorState_state_expanded = 0; const int R::styleable::ExpandableListView[] = { 0x0101010b, 0x0101010c, 0x0101010d, 0x0101010e, 0x0101010f, 0x01010110, 0x01010111 }; const int R::ExpandableListView_childDivider = 6; const int R::ExpandableListView_childIndicator = 1; const int R::ExpandableListView_childIndicatorLeft = 4; const int R::ExpandableListView_childIndicatorRight = 5; const int R::ExpandableListView_groupIndicator = 0; const int R::ExpandableListView_indicatorLeft = 2; const int R::ExpandableListView_indicatorRight = 3; const int R::styleable::Extra[] = { 0x01010003, 0x01010024 }; const int R::Extra_name = 0; const int R::Extra_value = 1; const int R::styleable::Fragment[] = { 0x01010003, 0x010100d0, 0x010100d1 }; const int R::Fragment_id = 1; const int R::Fragment_name = 0; const int R::Fragment_tag = 2; const int R::styleable::FragmentAnimation[] = { 0x010102e5, 0x010102e6, 0x010102e7, 0x010102e8, 0x010102e9, 0x010102ea }; const int R::FragmentAnimation_fragmentCloseEnterAnimation = 2; const int R::FragmentAnimation_fragmentCloseExitAnimation = 3; const int R::FragmentAnimation_fragmentFadeEnterAnimation = 4; const int R::FragmentAnimation_fragmentFadeExitAnimation = 5; const int R::FragmentAnimation_fragmentOpenEnterAnimation = 0; const int R::FragmentAnimation_fragmentOpenExitAnimation = 1; const int R::styleable::FragmentBreadCrumbs[] = { 0x010100af }; const int R::FragmentBreadCrumbs_gravity = 0; const int R::styleable::FrameLayout[] = { 0x01010109, 0x0101010a, 0x01010200, 0x01010405 }; const int R::FrameLayout_foreground = 0; const int R::FrameLayout_foregroundGravity = 2; const int R::FrameLayout_foregroundInsidePadding = 3; const int R::FrameLayout_measureAllChildren = 1; const int R::styleable::FrameLayout_Layout[] = { 0x010100b3 }; const int R::FrameLayout_Layout_layout_gravity = 0; const int R::styleable::Gallery[] = { 0x010100af, 0x01010112, 0x01010113, 0x0101020e }; const int R::Gallery_animationDuration = 1; const int R::Gallery_gravity = 0; const int R::Gallery_spacing = 2; const int R::Gallery_unselectedAlpha = 3; const int R::styleable::GestureOverlayView[] = { 0x010100c4, 0x01010274, 0x01010275, 0x01010276, 0x01010277, 0x01010278, 0x01010279, 0x0101027a, 0x0101027b, 0x0101027c, 0x0101027d, 0x0101027e }; const int R::GestureOverlayView_eventsInterceptionEnabled = 10; const int R::GestureOverlayView_fadeDuration = 5; const int R::GestureOverlayView_fadeEnabled = 11; const int R::GestureOverlayView_fadeOffset = 4; const int R::GestureOverlayView_gestureColor = 2; const int R::GestureOverlayView_gestureStrokeAngleThreshold = 9; const int R::GestureOverlayView_gestureStrokeLengthThreshold = 7; const int R::GestureOverlayView_gestureStrokeSquarenessThreshold = 8; const int R::GestureOverlayView_gestureStrokeType = 6; const int R::GestureOverlayView_gestureStrokeWidth = 1; const int R::GestureOverlayView_orientation = 0; const int R::GestureOverlayView_uncertainGestureColor = 3; const int R::styleable::GlowPadView[] = { 0x010100af, 0x0101025f, 0x010103a0, 0x010103a1, 0x01010427, 0x01010428, 0x01010429, 0x0101042a, 0x0101042b, 0x0101042c, 0x0101042d, 0x0101042e, 0x01010431, 0x01010432, 0x01010433, 0x01010434, 0x01010435 }; const int R::GlowPadView_allowScaling = 9; const int R::GlowPadView_alwaysTrackFinger = 16; const int R::GlowPadView_directionDescriptions = 3; const int R::GlowPadView_feedbackCount = 15; const int R::GlowPadView_firstItemOffset = 7; const int R::GlowPadView_glowRadius = 6; const int R::GlowPadView_gravity = 0; const int R::GlowPadView_handleDrawable = 11; const int R::GlowPadView_innerRadius = 1; const int R::GlowPadView_magneticTargets = 8; const int R::GlowPadView_outerRadius = 12; const int R::GlowPadView_outerRingDrawable = 4; const int R::GlowPadView_pointDrawable = 5; const int R::GlowPadView_snapMargin = 14; const int R::GlowPadView_targetDescriptions = 2; const int R::GlowPadView_targetDrawables = 10; const int R::GlowPadView_vibrationDuration = 13; const int R::styleable::GradientDrawable[] = { 0x0101011c, 0x01010194, 0x0101019a, 0x0101019b, 0x0101019c, 0x0101019f, 0x0101025f, 0x01010260 }; const int R::GradientDrawable_dither = 0; const int R::GradientDrawable_innerRadius = 6; const int R::GradientDrawable_innerRadiusRatio = 3; const int R::GradientDrawable_shape = 2; const int R::GradientDrawable_thickness = 7; const int R::GradientDrawable_thicknessRatio = 4; const int R::GradientDrawable_useLevel = 5; const int R::GradientDrawable_visible = 1; const int R::styleable::GradientDrawableGradient[] = { 0x0101019d, 0x0101019e, 0x0101019f, 0x010101a0, 0x010101a1, 0x010101a2, 0x010101a3, 0x010101a4, 0x0101020b }; const int R::GradientDrawableGradient_angle = 3; const int R::GradientDrawableGradient_centerColor = 8; const int R::GradientDrawableGradient_centerX = 5; const int R::GradientDrawableGradient_centerY = 6; const int R::GradientDrawableGradient_endColor = 1; const int R::GradientDrawableGradient_gradientRadius = 7; const int R::GradientDrawableGradient_startColor = 0; const int R::GradientDrawableGradient_type = 4; const int R::GradientDrawableGradient_useLevel = 2; const int R::styleable::GradientDrawablePadding[] = { 0x010101ad, 0x010101ae, 0x010101af, 0x010101b0 }; const int R::GradientDrawablePadding_bottom = 3; const int R::GradientDrawablePadding_left = 0; const int R::GradientDrawablePadding_right = 2; const int R::GradientDrawablePadding_top = 1; const int R::styleable::GradientDrawableSize[] = { 0x01010155, 0x01010159 }; const int R::GradientDrawableSize_height = 0; const int R::GradientDrawableSize_width = 1; const int R::styleable::GradientDrawableSolid[] = { 0x010101a5 }; const int R::GradientDrawableSolid_color = 0; const int R::styleable::GradientDrawableStroke[] = { 0x01010159, 0x010101a5, 0x010101a6, 0x010101a7 }; const int R::GradientDrawableStroke_color = 1; const int R::GradientDrawableStroke_dashGap = 3; const int R::GradientDrawableStroke_dashWidth = 2; const int R::GradientDrawableStroke_width = 0; const int R::styleable::GridLayout[] = { 0x010100c4, 0x01010375, 0x01010376, 0x01010377, 0x01010378, 0x01010379, 0x0101037a }; const int R::GridLayout_alignmentMode = 6; const int R::GridLayout_columnCount = 3; const int R::GridLayout_columnOrderPreserved = 4; const int R::GridLayout_orientation = 0; const int R::GridLayout_rowCount = 1; const int R::GridLayout_rowOrderPreserved = 2; const int R::GridLayout_useDefaultMargins = 5; const int R::styleable::GridLayoutAnimation[] = { 0x010101cf, 0x010101d0, 0x010101d1, 0x010101d2 }; const int R::GridLayoutAnimation_columnDelay = 0; const int R::GridLayoutAnimation_direction = 2; const int R::GridLayoutAnimation_directionPriority = 3; const int R::GridLayoutAnimation_rowDelay = 1; const int R::styleable::GridLayout_Layout[] = { 0x010100b3, 0x0101014c, 0x0101037b, 0x0101037c, 0x0101037d }; const int R::GridLayout_Layout_layout_column = 1; const int R::GridLayout_Layout_layout_columnSpan = 4; const int R::GridLayout_Layout_layout_gravity = 0; const int R::GridLayout_Layout_layout_row = 2; const int R::GridLayout_Layout_layout_rowSpan = 3; const int R::styleable::GridView[] = { 0x010100af, 0x01010114, 0x01010115, 0x01010116, 0x01010117, 0x01010118 }; const int R::GridView_columnWidth = 4; const int R::GridView_gravity = 0; const int R::GridView_horizontalSpacing = 1; const int R::GridView_numColumns = 5; const int R::GridView_stretchMode = 3; const int R::GridView_verticalSpacing = 2; const int R::styleable::HorizontalScrollView[] = { 0x0101017a }; const int R::HorizontalScrollView_fillViewport = 0; const int R::styleable::Icon[] = { 0x01010002, 0x01010026 }; const int R::Icon_icon = 0; const int R::Icon_mimeType = 1; const int R::styleable::IconDefault[] = { 0x01010002 }; const int R::IconDefault_icon = 0; const int R::styleable::IconMenuView[] = { 0x01010132, 0x01010133, 0x01010134, 0x01010135, 0x0101040d }; const int R::IconMenuView_maxItems = 4; const int R::IconMenuView_maxItemsPerRow = 2; const int R::IconMenuView_maxRows = 1; const int R::IconMenuView_moreIcon = 3; const int R::IconMenuView_rowHeight = 0; const int R::styleable::ImageSwitcher[] = { }; const int R::styleable::ImageView[] = { 0x01010119, 0x0101011d, 0x0101011e, 0x0101011f, 0x01010120, 0x01010121, 0x01010122, 0x01010123, 0x0101031c, 0x01010406 }; const int R::ImageView_adjustViewBounds = 2; const int R::ImageView_baseline = 8; const int R::ImageView_baselineAlignBottom = 6; const int R::ImageView_cropToPadding = 7; const int R::ImageView_drawableAlpha = 9; const int R::ImageView_maxHeight = 4; const int R::ImageView_maxWidth = 3; const int R::ImageView_scaleType = 1; const int R::ImageView_src = 0; const int R::ImageView_tint = 5; const int R::styleable::InputExtras[] = { }; const int R::styleable::InputMethod[] = { 0x01010221, 0x01010225 }; const int R::InputMethod_isDefault = 0; const int R::InputMethod_settingsActivity = 1; const int R::styleable::InputMethodService[] = { 0x0101022c, 0x01010268, 0x01010269 }; const int R::InputMethodService_imeExtractEnterAnimation = 1; const int R::InputMethodService_imeExtractExitAnimation = 2; const int R::InputMethodService_imeFullscreenBackground = 0; const int R::styleable::InputMethod_Subtype[] = { 0x01010001, 0x01010002, 0x010102ec, 0x010102ed, 0x010102ee, 0x0101037f, 0x010103a2, 0x010103c1 }; const int R::InputMethod_Subtype_icon = 1; const int R::InputMethod_Subtype_imeSubtypeExtraValue = 4; const int R::InputMethod_Subtype_imeSubtypeLocale = 2; const int R::InputMethod_Subtype_imeSubtypeMode = 3; const int R::InputMethod_Subtype_isAuxiliary = 5; const int R::InputMethod_Subtype_label = 0; const int R::InputMethod_Subtype_overridesImplicitlyEnabledSubtype = 6; const int R::InputMethod_Subtype_subtypeId = 7; const int R::styleable::InsetDrawable[] = { 0x01010194, 0x01010199, 0x010101b7, 0x010101b8, 0x010101b9, 0x010101ba }; const int R::InsetDrawable_drawable = 1; const int R::InsetDrawable_insetBottom = 5; const int R::InsetDrawable_insetLeft = 2; const int R::InsetDrawable_insetRight = 3; const int R::InsetDrawable_insetTop = 4; const int R::InsetDrawable_visible = 0; const int R::styleable::Intent[] = { 0x01010021, 0x01010026, 0x0101002d, 0x0101002e, 0x0101002f }; const int R::Intent_action = 2; const int R::Intent_data = 3; const int R::Intent_mimeType = 1; const int R::Intent_targetClass = 4; const int R::Intent_targetPackage = 0; const int R::styleable::IntentCategory[] = { 0x01010003 }; const int R::IntentCategory_name = 0; const int R::styleable::Keyboard[] = { 0x0101023d, 0x0101023e, 0x0101023f, 0x01010240 }; const int R::Keyboard_horizontalGap = 2; const int R::Keyboard_keyHeight = 1; const int R::Keyboard_keyWidth = 0; const int R::Keyboard_verticalGap = 3; const int R::styleable::KeyboardLayout[] = { 0x01010001, 0x01010003, 0x010103ab }; const int R::KeyboardLayout_keyboardLayout = 2; const int R::KeyboardLayout_label = 0; const int R::KeyboardLayout_name = 1; const int R::styleable::KeyboardView[] = { 0x01010161, 0x01010164, 0x01010233, 0x01010234, 0x01010235, 0x01010236, 0x01010237, 0x01010238, 0x01010239, 0x0101023a, 0x0101023b, 0x01010426 }; const int R::KeyboardView_keyBackground = 2; const int R::KeyboardView_keyPreviewHeight = 8; const int R::KeyboardView_keyPreviewLayout = 6; const int R::KeyboardView_keyPreviewOffset = 7; const int R::KeyboardView_keyTextColor = 5; const int R::KeyboardView_keyTextSize = 3; const int R::KeyboardView_keyboardViewStyle = 11; const int R::KeyboardView_labelTextSize = 4; const int R::KeyboardView_popupLayout = 10; const int R::KeyboardView_shadowColor = 0; const int R::KeyboardView_shadowRadius = 1; const int R::KeyboardView_verticalCorrection = 9; const int R::styleable::KeyboardViewPreviewState[] = { 0x0101023c }; const int R::KeyboardViewPreviewState_state_long_pressable = 0; const int R::styleable::Keyboard_Key[] = { 0x01010242, 0x01010243, 0x01010244, 0x01010245, 0x01010246, 0x01010247, 0x01010248, 0x01010249, 0x0101024a, 0x0101024b, 0x0101024c, 0x0101024d }; const int R::Keyboard_Key_codes = 0; const int R::Keyboard_Key_iconPreview = 7; const int R::Keyboard_Key_isModifier = 4; const int R::Keyboard_Key_isRepeatable = 6; const int R::Keyboard_Key_isSticky = 5; const int R::Keyboard_Key_keyEdgeFlags = 3; const int R::Keyboard_Key_keyIcon = 10; const int R::Keyboard_Key_keyLabel = 9; const int R::Keyboard_Key_keyOutputText = 8; const int R::Keyboard_Key_keyboardMode = 11; const int R::Keyboard_Key_popupCharacters = 2; const int R::Keyboard_Key_popupKeyboard = 1; const int R::styleable::Keyboard_Row[] = { 0x01010241, 0x0101024d }; const int R::Keyboard_Row_keyboardMode = 1; const int R::Keyboard_Row_rowEdgeFlags = 0; const int R::styleable::KeyguardGlowStripView[] = { 0x0101044c, 0x0101044d, 0x0101044e, 0x0101044f }; const int R::KeyguardGlowStripView_dotSize = 0; const int R::KeyguardGlowStripView_glowDot = 2; const int R::KeyguardGlowStripView_leftToRight = 3; const int R::KeyguardGlowStripView_numDots = 1; const int R::styleable::KeyguardSecurityViewFlipper_Layout[] = { 0x01010436, 0x01010452 }; const int R::KeyguardSecurityViewFlipper_Layout_layout_maxHeight = 0; const int R::KeyguardSecurityViewFlipper_Layout_layout_maxWidth = 1; const int R::styleable::LayerDrawable[] = { 0x0101031e }; const int R::LayerDrawable_opacity = 0; const int R::styleable::LayerDrawableItem[] = { 0x010100d0, 0x01010199, 0x010101ad, 0x010101ae, 0x010101af, 0x010101b0 }; const int R::LayerDrawableItem_bottom = 5; const int R::LayerDrawableItem_drawable = 1; const int R::LayerDrawableItem_id = 0; const int R::LayerDrawableItem_left = 2; const int R::LayerDrawableItem_right = 4; const int R::LayerDrawableItem_top = 3; const int R::styleable::LayoutAnimation[] = { 0x01010141, 0x010101cc, 0x010101cd, 0x010101ce }; const int R::LayoutAnimation_animation = 2; const int R::LayoutAnimation_animationOrder = 3; const int R::LayoutAnimation_delay = 1; const int R::LayoutAnimation_interpolator = 0; const int R::styleable::LevelListDrawableItem[] = { 0x01010199, 0x010101b1, 0x010101b2 }; const int R::LevelListDrawableItem_drawable = 0; const int R::LevelListDrawableItem_maxLevel = 2; const int R::LevelListDrawableItem_minLevel = 1; const int R::styleable::LinearLayout[] = { 0x010100af, 0x010100c4, 0x01010126, 0x01010127, 0x01010128, 0x01010129, 0x010102d4, 0x01010329, 0x0101032a }; const int R::LinearLayout_baselineAligned = 2; const int R::LinearLayout_baselineAlignedChildIndex = 3; const int R::LinearLayout_divider = 5; const int R::LinearLayout_dividerPadding = 8; const int R::LinearLayout_gravity = 0; const int R::LinearLayout_measureWithLargestChild = 6; const int R::LinearLayout_orientation = 1; const int R::LinearLayout_showDividers = 7; const int R::LinearLayout_weightSum = 4; const int R::styleable::LinearLayout_Layout[] = { 0x010100b3, 0x010100f4, 0x010100f5, 0x01010181 }; const int R::LinearLayout_Layout_layout_gravity = 0; const int R::LinearLayout_Layout_layout_height = 2; const int R::LinearLayout_Layout_layout_weight = 3; const int R::LinearLayout_Layout_layout_width = 1; const int R::styleable::ListPreference[] = { 0x010100b2, 0x010101f8 }; const int R::ListPreference_entries = 0; const int R::ListPreference_entryValues = 1; const int R::styleable::ListView[] = { 0x010100b2, 0x01010129, 0x0101012a, 0x0101022e, 0x0101022f, 0x010102c2, 0x010102c3 }; const int R::ListView_divider = 1; const int R::ListView_dividerHeight = 2; const int R::ListView_entries = 0; const int R::ListView_footerDividersEnabled = 4; const int R::ListView_headerDividersEnabled = 3; const int R::ListView_overScrollFooter = 6; const int R::ListView_overScrollHeader = 5; const int R::styleable::LockPatternView[] = { 0x01010438 }; const int R::LockPatternView_aspect = 0; const int R::styleable::MapView[] = { 0x01010211 }; const int R::MapView_apiKey = 0; const int R::styleable::MediaRouteButton[] = { 0x0101013f, 0x01010140, 0x010103ae, 0x01010448 }; const int R::MediaRouteButton_externalRouteEnabledDrawable = 3; const int R::MediaRouteButton_mediaRouteTypes = 2; const int R::MediaRouteButton_minHeight = 1; const int R::MediaRouteButton_minWidth = 0; const int R::styleable::Menu[] = { }; const int R::styleable::MenuGroup[] = { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 }; const int R::MenuGroup_checkableBehavior = 5; const int R::MenuGroup_enabled = 0; const int R::MenuGroup_id = 1; const int R::MenuGroup_menuCategory = 3; const int R::MenuGroup_orderInCategory = 4; const int R::MenuGroup_visible = 2; const int R::styleable::MenuItem[] = { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x010102d9, 0x010102fb, 0x010102fc, 0x01010389 }; const int R::MenuItem_actionLayout = 14; const int R::MenuItem_actionProviderClass = 16; const int R::MenuItem_actionViewClass = 15; const int R::MenuItem_alphabeticShortcut = 9; const int R::MenuItem_checkable = 11; const int R::MenuItem_checked = 3; const int R::MenuItem_enabled = 1; const int R::MenuItem_icon = 0; const int R::MenuItem_id = 2; const int R::MenuItem_menuCategory = 5; const int R::MenuItem_numericShortcut = 10; const int R::MenuItem_onClick = 12; const int R::MenuItem_orderInCategory = 6; const int R::MenuItem_showAsAction = 13; const int R::MenuItem_title = 7; const int R::MenuItem_titleCondensed = 8; const int R::MenuItem_visible = 4; const int R::styleable::MenuItemCheckedFocusedState[] = { 0x0101009c, 0x0101009f, 0x010100a0 }; const int R::MenuItemCheckedFocusedState_state_checkable = 1; const int R::MenuItemCheckedFocusedState_state_checked = 2; const int R::MenuItemCheckedFocusedState_state_focused = 0; const int R::styleable::MenuItemCheckedState[] = { 0x0101009f, 0x010100a0 }; const int R::MenuItemCheckedState_state_checkable = 0; const int R::MenuItemCheckedState_state_checked = 1; const int R::styleable::MenuItemUncheckedFocusedState[] = { 0x0101009c, 0x0101009f }; const int R::MenuItemUncheckedFocusedState_state_checkable = 1; const int R::MenuItemUncheckedFocusedState_state_focused = 0; const int R::styleable::MenuItemUncheckedState[] = { 0x0101009f }; const int R::MenuItemUncheckedState_state_checkable = 0; const int R::styleable::MenuView[] = { 0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e, 0x0101012f, 0x01010130, 0x01010131, 0x0101040c }; const int R::MenuView_headerBackground = 4; const int R::MenuView_horizontalDivider = 2; const int R::MenuView_itemBackground = 5; const int R::MenuView_itemIconDisabledAlpha = 6; const int R::MenuView_itemTextAppearance = 1; const int R::MenuView_preserveIconSpacing = 7; const int R::MenuView_verticalDivider = 3; const int R::MenuView_windowAnimationStyle = 0; const int R::styleable::MipmapDrawableItem[] = { 0x01010199 }; const int R::MipmapDrawableItem_drawable = 0; const int R::styleable::MultiPaneChallengeLayout[] = { 0x010100c4 }; const int R::MultiPaneChallengeLayout_orientation = 0; const int R::styleable::MultiPaneChallengeLayout_Layout[] = { 0x010100b3, 0x01010436, 0x01010450, 0x01010451, 0x01010452 }; const int R::MultiPaneChallengeLayout_Layout_layout_centerWithinArea = 3; const int R::MultiPaneChallengeLayout_Layout_layout_childType = 2; const int R::MultiPaneChallengeLayout_Layout_layout_gravity = 0; const int R::MultiPaneChallengeLayout_Layout_layout_maxHeight = 1; const int R::MultiPaneChallengeLayout_Layout_layout_maxWidth = 4; const int R::styleable::MultiSelectListPreference[] = { 0x010100b2, 0x010101f8 }; const int R::MultiSelectListPreference_entries = 0; const int R::MultiSelectListPreference_entryValues = 1; const int R::styleable::MultiWaveView[] = { 0x010103a0, 0x010103a1, 0x0101042d, 0x0101042e, 0x0101042f, 0x01010430, 0x01010431, 0x01010432, 0x01010433, 0x01010434, 0x01010435 }; const int R::MultiWaveView_alwaysTrackFinger = 10; const int R::MultiWaveView_chevronDrawables = 4; const int R::MultiWaveView_directionDescriptions = 1; const int R::MultiWaveView_feedbackCount = 9; const int R::MultiWaveView_handleDrawable = 3; const int R::MultiWaveView_outerRadius = 6; const int R::MultiWaveView_snapMargin = 8; const int R::MultiWaveView_targetDescriptions = 0; const int R::MultiWaveView_targetDrawables = 2; const int R::MultiWaveView_vibrationDuration = 7; const int R::MultiWaveView_waveDrawable = 5; const int R::styleable::NinePatchDrawable[] = { 0x01010119, 0x0101011c }; const int R::NinePatchDrawable_dither = 1; const int R::NinePatchDrawable_src = 0; const int R::styleable::NumPadKey[] = { 0x01010453, 0x01010454 }; const int R::NumPadKey_digit = 0; const int R::NumPadKey_textView = 1; const int R::styleable::NumberPicker[] = { 0x0101034a, 0x01010413, 0x01010419, 0x0101041a, 0x0101041b, 0x0101041c, 0x0101041d, 0x0101041e, 0x0101041f, 0x01010420 }; const int R::NumberPicker_internalLayout = 1; const int R::NumberPicker_internalMaxHeight = 6; const int R::NumberPicker_internalMaxWidth = 8; const int R::NumberPicker_internalMinHeight = 5; const int R::NumberPicker_internalMinWidth = 7; const int R::NumberPicker_selectionDivider = 2; const int R::NumberPicker_selectionDividerHeight = 3; const int R::NumberPicker_selectionDividersDistance = 4; const int R::NumberPicker_solidColor = 0; const int R::NumberPicker_virtualButtonPressedDrawable = 9; const int R::styleable::OvershootInterpolator[] = { 0x0101026a }; const int R::OvershootInterpolator_tension = 0; const int R::styleable::PagedView[] = { 0x01010449, 0x0101044a, 0x0101044b }; const int R::PagedView_pageSpacing = 0; const int R::PagedView_scrollIndicatorPaddingLeft = 1; const int R::PagedView_scrollIndicatorPaddingRight = 2; const int R::styleable::Pointer[] = { 0x01010439, 0x0101043a, 0x0101043b, 0x0101043c }; const int R::Pointer_pointerIconArrow = 0; const int R::Pointer_pointerIconSpotAnchor = 3; const int R::Pointer_pointerIconSpotHover = 1; const int R::Pointer_pointerIconSpotTouch = 2; const int R::styleable::PointerIcon[] = { 0x0101043d, 0x0101043e, 0x0101043f }; const int R::PointerIcon_bitmap = 0; const int R::PointerIcon_hotSpotX = 1; const int R::PointerIcon_hotSpotY = 2; const int R::styleable::PopupWindow[] = { 0x01010176, 0x010102c9 }; const int R::PopupWindow_popupAnimationStyle = 1; const int R::PopupWindow_popupBackground = 0; const int R::styleable::PopupWindowBackgroundState[] = { 0x010100aa }; const int R::PopupWindowBackgroundState_state_above_anchor = 0; const int R::styleable::Preference[] = { 0x01010002, 0x0101000d, 0x0101000e, 0x010100f2, 0x010101e1, 0x010101e6, 0x010101e8, 0x010101e9, 0x010101ea, 0x010101eb, 0x010101ec, 0x010101ed, 0x010101ee, 0x010102e3 }; const int R::Preference_defaultValue = 11; const int R::Preference_dependency = 10; const int R::Preference_enabled = 2; const int R::Preference_fragment = 13; const int R::Preference_icon = 0; const int R::Preference_key = 6; const int R::Preference_layout = 3; const int R::Preference_order = 8; const int R::Preference_persistent = 1; const int R::Preference_selectable = 5; const int R::Preference_shouldDisableView = 12; const int R::Preference_summary = 7; const int R::Preference_title = 4; const int R::Preference_widgetLayout = 9; const int R::styleable::PreferenceFrameLayout[] = { 0x01010407, 0x01010408, 0x01010409, 0x0101040a }; const int R::PreferenceFrameLayout_borderBottom = 1; const int R::PreferenceFrameLayout_borderLeft = 2; const int R::PreferenceFrameLayout_borderRight = 3; const int R::PreferenceFrameLayout_borderTop = 0; const int R::styleable::PreferenceFrameLayout_Layout[] = { 0x0101040b }; const int R::PreferenceFrameLayout_Layout_layout_removeBorders = 0; const int R::styleable::PreferenceGroup[] = { 0x010101e7 }; const int R::PreferenceGroup_orderingFromXml = 0; const int R::styleable::PreferenceHeader[] = { 0x01010002, 0x010100d0, 0x010101e1, 0x010101e9, 0x010102e3, 0x01010303, 0x01010304 }; const int R::PreferenceHeader_breadCrumbShortTitle = 6; const int R::PreferenceHeader_breadCrumbTitle = 5; const int R::PreferenceHeader_fragment = 4; const int R::PreferenceHeader_icon = 0; const int R::PreferenceHeader_id = 1; const int R::PreferenceHeader_summary = 3; const int R::PreferenceHeader_title = 2; const int R::styleable::ProgressBar[] = { 0x0101011f, 0x01010120, 0x01010136, 0x01010137, 0x01010138, 0x01010139, 0x0101013a, 0x0101013b, 0x0101013c, 0x0101013d, 0x0101013e, 0x0101013f, 0x01010140, 0x01010141, 0x0101031a }; const int R::ProgressBar_animationResolution = 14; const int R::ProgressBar_indeterminate = 5; const int R::ProgressBar_indeterminateBehavior = 10; const int R::ProgressBar_indeterminateDrawable = 7; const int R::ProgressBar_indeterminateDuration = 9; const int R::ProgressBar_indeterminateOnly = 6; const int R::ProgressBar_interpolator = 13; const int R::ProgressBar_max = 2; const int R::ProgressBar_maxHeight = 1; const int R::ProgressBar_maxWidth = 0; const int R::ProgressBar_minHeight = 12; const int R::ProgressBar_minWidth = 11; const int R::ProgressBar_progress = 3; const int R::ProgressBar_progressDrawable = 8; const int R::ProgressBar_secondaryProgress = 4; const int R::styleable::PropertyAnimator[] = { 0x010102e1 }; const int R::PropertyAnimator_propertyName = 0; const int R::styleable::QuickContactBadge[] = { 0x01010414 }; const int R::QuickContactBadge_quickContactWindowSize = 0; const int R::styleable::RadioGroup[] = { 0x010100c4, 0x01010148 }; const int R::RadioGroup_checkedButton = 1; const int R::RadioGroup_orientation = 0; const int R::styleable::RatingBar[] = { 0x01010144, 0x01010145, 0x01010146, 0x01010147 }; const int R::RatingBar_isIndicator = 3; const int R::RatingBar_numStars = 0; const int R::RatingBar_rating = 1; const int R::RatingBar_stepSize = 2; const int R::styleable::RecognitionService[] = { 0x01010225 }; const int R::RecognitionService_settingsActivity = 0; const int R::styleable::RelativeLayout[] = { 0x010100af, 0x010101ff }; const int R::RelativeLayout_gravity = 0; const int R::RelativeLayout_ignoreGravity = 1; const int R::styleable::RelativeLayout_Layout[] = { 0x01010182, 0x01010183, 0x01010184, 0x01010185, 0x01010186, 0x01010187, 0x01010188, 0x01010189, 0x0101018a, 0x0101018b, 0x0101018c, 0x0101018d, 0x0101018e, 0x0101018f, 0x01010190, 0x01010191, 0x01010192, 0x010103b7, 0x010103b8, 0x010103b9, 0x010103ba, 0x010103bb, 0x010103bc }; const int R::RelativeLayout_Layout_layout_above = 2; const int R::RelativeLayout_Layout_layout_alignBaseline = 4; const int R::RelativeLayout_Layout_layout_alignBottom = 8; const int R::RelativeLayout_Layout_layout_alignEnd = 20; const int R::RelativeLayout_Layout_layout_alignLeft = 5; const int R::RelativeLayout_Layout_layout_alignParentBottom = 12; const int R::RelativeLayout_Layout_layout_alignParentEnd = 22; const int R::RelativeLayout_Layout_layout_alignParentLeft = 9; const int R::RelativeLayout_Layout_layout_alignParentRight = 11; const int R::RelativeLayout_Layout_layout_alignParentStart = 21; const int R::RelativeLayout_Layout_layout_alignParentTop = 10; const int R::RelativeLayout_Layout_layout_alignRight = 7; const int R::RelativeLayout_Layout_layout_alignStart = 19; const int R::RelativeLayout_Layout_layout_alignTop = 6; const int R::RelativeLayout_Layout_layout_alignWithParentIfMissing = 16; const int R::RelativeLayout_Layout_layout_below = 3; const int R::RelativeLayout_Layout_layout_centerHorizontal = 14; const int R::RelativeLayout_Layout_layout_centerInParent = 13; const int R::RelativeLayout_Layout_layout_centerVertical = 15; const int R::RelativeLayout_Layout_layout_toEndOf = 18; const int R::RelativeLayout_Layout_layout_toLeftOf = 0; const int R::RelativeLayout_Layout_layout_toRightOf = 1; const int R::RelativeLayout_Layout_layout_toStartOf = 17; const int R::styleable::RingtonePreference[] = { 0x010101f9, 0x010101fa, 0x010101fb }; const int R::RingtonePreference_ringtoneType = 0; const int R::RingtonePreference_showDefault = 1; const int R::RingtonePreference_showSilent = 2; const int R::styleable::RotarySelector[] = { 0x010100c4 }; const int R::RotarySelector_orientation = 0; const int R::styleable::RotateAnimation[] = { 0x010101b3, 0x010101b4, 0x010101b5, 0x010101b6 }; const int R::RotateAnimation_fromDegrees = 0; const int R::RotateAnimation_pivotX = 2; const int R::RotateAnimation_pivotY = 3; const int R::RotateAnimation_toDegrees = 1; const int R::styleable::RotateDrawable[] = { 0x01010194, 0x01010199, 0x010101b3, 0x010101b4, 0x010101b5, 0x010101b6 }; const int R::RotateDrawable_drawable = 1; const int R::RotateDrawable_fromDegrees = 2; const int R::RotateDrawable_pivotX = 4; const int R::RotateDrawable_pivotY = 5; const int R::RotateDrawable_toDegrees = 3; const int R::RotateDrawable_visible = 0; const int R::styleable::ScaleAnimation[] = { 0x010101b5, 0x010101b6, 0x010101c2, 0x010101c3, 0x010101c4, 0x010101c5 }; const int R::ScaleAnimation_fromXScale = 2; const int R::ScaleAnimation_fromYScale = 4; const int R::ScaleAnimation_pivotX = 0; const int R::ScaleAnimation_pivotY = 1; const int R::ScaleAnimation_toXScale = 3; const int R::ScaleAnimation_toYScale = 5; const int R::styleable::ScaleDrawable[] = { 0x01010199, 0x010101fc, 0x010101fd, 0x010101fe, 0x01010310 }; const int R::ScaleDrawable_drawable = 0; const int R::ScaleDrawable_scaleGravity = 3; const int R::ScaleDrawable_scaleHeight = 2; const int R::ScaleDrawable_scaleWidth = 1; const int R::ScaleDrawable_useIntrinsicSizeAsMinimum = 4; const int R::styleable::ScrollView[] = { 0x0101017a }; const int R::ScrollView_fillViewport = 0; const int R::styleable::SearchView[] = { 0x0101011f, 0x01010220, 0x01010264, 0x010102fa, 0x01010358 }; const int R::SearchView_iconifiedByDefault = 3; const int R::SearchView_imeOptions = 2; const int R::SearchView_inputType = 1; const int R::SearchView_maxWidth = 0; const int R::SearchView_queryHint = 4; const int R::styleable::Searchable[] = { 0x01010001, 0x01010002, 0x01010150, 0x010101d5, 0x010101d6, 0x010101d7, 0x010101d8, 0x010101d9, 0x010101da, 0x01010205, 0x01010220, 0x01010252, 0x01010253, 0x01010254, 0x01010255, 0x01010256, 0x01010264, 0x0101026d, 0x0101026e, 0x01010282, 0x0101028a, 0x0101028c }; const int R::Searchable_autoUrlDetect = 21; const int R::Searchable_hint = 2; const int R::Searchable_icon = 1; const int R::Searchable_imeOptions = 16; const int R::Searchable_includeInGlobalSearch = 18; const int R::Searchable_inputType = 10; const int R::Searchable_label = 0; const int R::Searchable_queryAfterZeroResults = 19; const int R::Searchable_searchButtonText = 9; const int R::Searchable_searchMode = 3; const int R::Searchable_searchSettingsDescription = 20; const int R::Searchable_searchSuggestAuthority = 4; const int R::Searchable_searchSuggestIntentAction = 7; const int R::Searchable_searchSuggestIntentData = 8; const int R::Searchable_searchSuggestPath = 5; const int R::Searchable_searchSuggestSelection = 6; const int R::Searchable_searchSuggestThreshold = 17; const int R::Searchable_voiceLanguage = 14; const int R::Searchable_voiceLanguageModel = 12; const int R::Searchable_voiceMaxResults = 15; const int R::Searchable_voicePromptText = 13; const int R::Searchable_voiceSearchMode = 11; const int R::styleable::SearchableActionKey[] = { 0x010100c5, 0x010101db, 0x010101dc, 0x010101dd }; const int R::SearchableActionKey_keycode = 0; const int R::SearchableActionKey_queryActionMsg = 1; const int R::SearchableActionKey_suggestActionMsg = 2; const int R::SearchableActionKey_suggestActionMsgColumn = 3; const int R::styleable::SeekBar[] = { 0x01010142, 0x01010143 }; const int R::SeekBar_thumb = 0; const int R::SeekBar_thumbOffset = 1; const int R::styleable::SelectionModeDrawables[] = { 0x01010311, 0x01010312, 0x01010313, 0x0101037e }; const int R::SelectionModeDrawables_actionModeCopyDrawable = 1; const int R::SelectionModeDrawables_actionModeCutDrawable = 0; const int R::SelectionModeDrawables_actionModePasteDrawable = 2; const int R::SelectionModeDrawables_actionModeSelectAllDrawable = 3; const int R::styleable::ShapeDrawable[] = { 0x0101011c, 0x01010155, 0x01010159, 0x010101a5 }; const int R::ShapeDrawable_color = 3; const int R::ShapeDrawable_dither = 0; const int R::ShapeDrawable_height = 1; const int R::ShapeDrawable_width = 2; const int R::styleable::ShapeDrawablePadding[] = { 0x010101ad, 0x010101ae, 0x010101af, 0x010101b0 }; const int R::ShapeDrawablePadding_bottom = 3; const int R::ShapeDrawablePadding_left = 0; const int R::ShapeDrawablePadding_right = 2; const int R::ShapeDrawablePadding_top = 1; const int R::styleable::SizeAdaptiveLayout[] = { }; const int R::styleable::SizeAdaptiveLayout_Layout[] = { 0x01010436, 0x01010437 }; const int R::SizeAdaptiveLayout_Layout_layout_maxHeight = 0; const int R::SizeAdaptiveLayout_Layout_layout_minHeight = 1; const int R::styleable::SlidingChallengeLayout_Layout[] = { 0x01010436, 0x01010450 }; const int R::SlidingChallengeLayout_Layout_layout_childType = 1; const int R::SlidingChallengeLayout_Layout_layout_maxHeight = 0; const int R::styleable::SlidingDrawer[] = { 0x010100c4, 0x01010257, 0x01010258, 0x01010259, 0x0101025a, 0x0101025b, 0x0101025c }; const int R::SlidingDrawer_allowSingleTap = 3; const int R::SlidingDrawer_animateOnClick = 6; const int R::SlidingDrawer_bottomOffset = 1; const int R::SlidingDrawer_content = 5; const int R::SlidingDrawer_handle = 4; const int R::SlidingDrawer_orientation = 0; const int R::SlidingDrawer_topOffset = 2; const int R::styleable::SlidingTab[] = { 0x010100c4 }; const int R::SlidingTab_orientation = 0; const int R::styleable::SpellChecker[] = { 0x01010001, 0x01010225 }; const int R::SpellChecker_label = 0; const int R::SpellChecker_settingsActivity = 1; const int R::styleable::SpellChecker_Subtype[] = { 0x01010001, 0x01010399, 0x0101039a }; const int R::SpellChecker_Subtype_label = 0; const int R::SpellChecker_Subtype_subtypeExtraValue = 2; const int R::SpellChecker_Subtype_subtypeLocale = 1; const int R::styleable::Spinner[] = { 0x010100af, 0x01010175, 0x01010176, 0x0101017b, 0x01010262, 0x010102ac, 0x010102ad, 0x010102f1, 0x01010411, 0x01010412 }; const int R::Spinner_disableChildrenWhenDisabled = 9; const int R::Spinner_dropDownHorizontalOffset = 5; const int R::Spinner_dropDownSelector = 1; const int R::Spinner_dropDownVerticalOffset = 6; const int R::Spinner_dropDownWidth = 4; const int R::Spinner_gravity = 0; const int R::Spinner_popupBackground = 2; const int R::Spinner_popupPromptView = 8; const int R::Spinner_prompt = 3; const int R::Spinner_spinnerMode = 7; const int R::styleable::StackView[] = { 0x0101040e, 0x0101040f }; const int R::StackView_clickColor = 1; const int R::StackView_resOutColor = 0; const int R::styleable::StateListDrawable[] = { 0x0101011c, 0x01010194, 0x01010195, 0x01010196, 0x0101030c, 0x0101030d }; const int R::StateListDrawable_constantSize = 3; const int R::StateListDrawable_dither = 0; const int R::StateListDrawable_enterFadeDuration = 4; const int R::StateListDrawable_exitFadeDuration = 5; const int R::StateListDrawable_variablePadding = 2; const int R::StateListDrawable_visible = 1; const int R::styleable::Storage[] = { 0x01010440, 0x01010441, 0x01010442, 0x01010443, 0x01010444, 0x01010445, 0x01010446, 0x01010447 }; const int R::Storage_allowMassStorage = 6; const int R::Storage_emulated = 4; const int R::Storage_maxFileSize = 7; const int R::Storage_mountPoint = 0; const int R::Storage_mtpReserve = 5; const int R::Storage_primary = 2; const int R::Storage_removable = 3; const int R::Storage_storageDescription = 1; const int R::styleable::SuggestionSpan[] = { 0x010103cf, 0x010103d0 }; const int R::SuggestionSpan_textUnderlineColor = 0; const int R::SuggestionSpan_textUnderlineThickness = 1; const int R::styleable::Switch[] = { 0x01010124, 0x01010125, 0x01010142, 0x0101036e, 0x0101036f, 0x01010370, 0x01010371, 0x01010372 }; const int R::Switch_switchMinWidth = 5; const int R::Switch_switchPadding = 6; const int R::Switch_switchTextAppearance = 3; const int R::Switch_textOff = 1; const int R::Switch_textOn = 0; const int R::Switch_thumb = 2; const int R::Switch_thumbTextPadding = 7; const int R::Switch_track = 4; const int R::styleable::SwitchPreference[] = { 0x010101ef, 0x010101f0, 0x010101f1, 0x0101036b, 0x0101036c }; const int R::SwitchPreference_disableDependentsState = 2; const int R::SwitchPreference_summaryOff = 1; const int R::SwitchPreference_summaryOn = 0; const int R::SwitchPreference_switchTextOff = 4; const int R::SwitchPreference_switchTextOn = 3; const int R::styleable::SyncAdapter[] = { 0x01010225, 0x0101028f, 0x01010290, 0x01010291, 0x0101029b, 0x01010332, 0x01010333 }; const int R::SyncAdapter_accountType = 1; const int R::SyncAdapter_allowParallelSyncs = 5; const int R::SyncAdapter_contentAuthority = 2; const int R::SyncAdapter_isAlwaysSyncable = 6; const int R::SyncAdapter_settingsActivity = 0; const int R::SyncAdapter_supportsUploading = 4; const int R::SyncAdapter_userVisible = 3; const int R::styleable::TabWidget[] = { 0x01010129, 0x010102bb, 0x010102bc, 0x010102bd, 0x01010410 }; const int R::TabWidget_divider = 0; const int R::TabWidget_tabLayout = 4; const int R::TabWidget_tabStripEnabled = 3; const int R::TabWidget_tabStripLeft = 1; const int R::TabWidget_tabStripRight = 2; const int R::styleable::TableLayout[] = { 0x01010149, 0x0101014a, 0x0101014b }; const int R::TableLayout_collapseColumns = 2; const int R::TableLayout_shrinkColumns = 1; const int R::TableLayout_stretchColumns = 0; const int R::styleable::TableRow[] = { }; const int R::styleable::TableRow_Cell[] = { 0x0101014c, 0x0101014d }; const int R::TableRow_Cell_layout_column = 0; const int R::TableRow_Cell_layout_span = 1; const int R::styleable::TextAppearance[] = { 0x01010095, 0x01010096, 0x01010097, 0x01010098, 0x01010099, 0x0101009a, 0x0101009b, 0x0101038c, 0x010103ac }; const int R::TextAppearance_fontFamily = 8; const int R::TextAppearance_textAllCaps = 7; const int R::TextAppearance_textColor = 3; const int R::TextAppearance_textColorHighlight = 4; const int R::TextAppearance_textColorHint = 5; const int R::TextAppearance_textColorLink = 6; const int R::TextAppearance_textSize = 0; const int R::TextAppearance_textStyle = 2; const int R::TextAppearance_typeface = 1; const int R::styleable::TextClock[] = { 0x010103ca, 0x010103cb, 0x010103cc }; const int R::TextClock_format12Hour = 0; const int R::TextClock_format24Hour = 1; const int R::TextClock_timeZone = 2; const int R::styleable::TextSwitcher[] = { }; const int R::styleable::TextToSpeechEngine[] = { 0x01010225 }; const int R::TextToSpeechEngine_settingsActivity = 0; const int R::styleable::TextView[] = { 0x0101000e, 0x01010034, 0x01010095, 0x01010096, 0x01010097, 0x01010098, 0x01010099, 0x0101009a, 0x0101009b, 0x010100ab, 0x010100af, 0x010100b0, 0x010100b1, 0x0101011f, 0x01010120, 0x0101013f, 0x01010140, 0x0101014e, 0x0101014f, 0x01010150, 0x01010151, 0x01010152, 0x01010153, 0x01010154, 0x01010155, 0x01010156, 0x01010157, 0x01010158, 0x01010159, 0x0101015a, 0x0101015b, 0x0101015c, 0x0101015d, 0x0101015e, 0x0101015f, 0x01010160, 0x01010161, 0x01010162, 0x01010163, 0x01010164, 0x01010165, 0x01010166, 0x01010167, 0x01010168, 0x01010169, 0x0101016a, 0x0101016b, 0x0101016c, 0x0101016d, 0x0101016e, 0x0101016f, 0x01010170, 0x01010171, 0x01010217, 0x01010218, 0x0101021d, 0x01010220, 0x01010223, 0x01010224, 0x01010264, 0x01010265, 0x01010266, 0x010102c5, 0x010102c6, 0x010102c7, 0x01010314, 0x01010315, 0x01010316, 0x0101035e, 0x0101035f, 0x01010362, 0x01010374, 0x0101038c, 0x01010392, 0x01010393, 0x010103ac }; const int R::TextView_autoLink = 11; const int R::TextView_autoText = 45; const int R::TextView_bufferType = 17; const int R::TextView_capitalize = 44; const int R::TextView_cursorVisible = 21; const int R::TextView_digits = 41; const int R::TextView_drawableBottom = 49; const int R::TextView_drawableEnd = 74; const int R::TextView_drawableLeft = 50; const int R::TextView_drawablePadding = 52; const int R::TextView_drawableRight = 51; const int R::TextView_drawableStart = 73; const int R::TextView_drawableTop = 48; const int R::TextView_editable = 46; const int R::TextView_editorExtras = 58; const int R::TextView_ellipsize = 9; const int R::TextView_ems = 27; const int R::TextView_enabled = 0; const int R::TextView_fontFamily = 75; const int R::TextView_freezesText = 47; const int R::TextView_gravity = 10; const int R::TextView_height = 24; const int R::TextView_hint = 19; const int R::TextView_imeActionId = 61; const int R::TextView_imeActionLabel = 60; const int R::TextView_imeOptions = 59; const int R::TextView_includeFontPadding = 34; const int R::TextView_inputMethod = 43; const int R::TextView_inputType = 56; const int R::TextView_lineSpacingExtra = 53; const int R::TextView_lineSpacingMultiplier = 54; const int R::TextView_lines = 23; const int R::TextView_linksClickable = 12; const int R::TextView_marqueeRepeatLimit = 55; const int R::TextView_maxEms = 26; const int R::TextView_maxHeight = 14; const int R::TextView_maxLength = 35; const int R::TextView_maxLines = 22; const int R::TextView_maxWidth = 13; const int R::TextView_minEms = 29; const int R::TextView_minHeight = 16; const int R::TextView_minLines = 25; const int R::TextView_minWidth = 15; const int R::TextView_numeric = 40; const int R::TextView_password = 31; const int R::TextView_phoneNumber = 42; const int R::TextView_privateImeOptions = 57; const int R::TextView_scrollHorizontally = 30; const int R::TextView_selectAllOnFocus = 33; const int R::TextView_shadowColor = 36; const int R::TextView_shadowDx = 37; const int R::TextView_shadowDy = 38; const int R::TextView_shadowRadius = 39; const int R::TextView_singleLine = 32; const int R::TextView_text = 18; const int R::TextView_textAllCaps = 72; const int R::TextView_textAppearance = 1; const int R::TextView_textColor = 5; const int R::TextView_textColorHighlight = 6; const int R::TextView_textColorHint = 7; const int R::TextView_textColorLink = 8; const int R::TextView_textCursorDrawable = 70; const int R::TextView_textEditNoPasteWindowLayout = 66; const int R::TextView_textEditPasteWindowLayout = 65; const int R::TextView_textEditSideNoPasteWindowLayout = 69; const int R::TextView_textEditSidePasteWindowLayout = 68; const int R::TextView_textEditSuggestionItemLayout = 71; const int R::TextView_textIsSelectable = 67; const int R::TextView_textScaleX = 20; const int R::TextView_textSelectHandle = 64; const int R::TextView_textSelectHandleLeft = 62; const int R::TextView_textSelectHandleRight = 63; const int R::TextView_textSize = 2; const int R::TextView_textStyle = 4; const int R::TextView_typeface = 3; const int R::TextView_width = 28; const int R::styleable::TextViewAppearance[] = { 0x01010034 }; const int R::TextViewAppearance_textAppearance = 0; const int R::styleable::TextViewMultiLineBackgroundState[] = { 0x0101034d }; const int R::TextViewMultiLineBackgroundState_state_multiline = 0; const int R::styleable::Theme[] = { 0x01010030, 0x01010031, 0x01010032, 0x01010033, 0x01010034, 0x01010035, 0x01010036, 0x01010037, 0x01010038, 0x01010039, 0x0101003a, 0x0101003b, 0x0101003c, 0x0101003d, 0x0101003e, 0x0101003f, 0x01010040, 0x01010041, 0x01010042, 0x01010043, 0x01010044, 0x01010045, 0x01010046, 0x01010047, 0x01010048, 0x01010049, 0x0101004a, 0x0101004b, 0x0101004c, 0x0101004d, 0x0101004e, 0x0101004f, 0x01010050, 0x01010051, 0x01010052, 0x01010053, 0x01010054, 0x01010055, 0x01010056, 0x01010057, 0x01010058, 0x01010059, 0x0101005a, 0x0101005b, 0x0101005c, 0x0101005d, 0x0101005e, 0x0101005f, 0x01010060, 0x01010061, 0x01010062, 0x0101006a, 0x0101006b, 0x0101006c, 0x0101006d, 0x0101006e, 0x0101006f, 0x01010070, 0x01010071, 0x01010072, 0x01010073, 0x01010074, 0x01010075, 0x01010076, 0x01010077, 0x01010078, 0x01010079, 0x0101007a, 0x0101007b, 0x0101007c, 0x0101007d, 0x0101007e, 0x01010080, 0x01010081, 0x01010082, 0x01010083, 0x01010084, 0x01010085, 0x01010086, 0x01010087, 0x01010088, 0x01010089, 0x0101008a, 0x0101008b, 0x0101008c, 0x0101008d, 0x0101008e, 0x0101008f, 0x01010090, 0x01010091, 0x01010092, 0x01010093, 0x01010094, 0x010100ae, 0x01010206, 0x01010207, 0x01010208, 0x0101020d, 0x0101020f, 0x01010210, 0x01010212, 0x01010213, 0x01010214, 0x01010219, 0x0101021a, 0x0101021e, 0x0101021f, 0x01010222, 0x0101022b, 0x01010230, 0x01010267, 0x01010287, 0x01010288, 0x01010289, 0x0101028b, 0x01010292, 0x010102a0, 0x010102a1, 0x010102ab, 0x010102ae, 0x010102af, 0x010102b0, 0x010102b1, 0x010102b2, 0x010102b3, 0x010102b6, 0x010102b9, 0x010102c5, 0x010102c6, 0x010102c7, 0x010102c8, 0x010102cd, 0x010102ce, 0x010102d6, 0x010102d7, 0x010102d8, 0x010102db, 0x010102dc, 0x010102dd, 0x010102e4, 0x010102eb, 0x010102f0, 0x010102f3, 0x010102f4, 0x010102f5, 0x010102f6, 0x010102f7, 0x010102fd, 0x010102ff, 0x01010300, 0x01010301, 0x01010302, 0x01010305, 0x01010306, 0x01010308, 0x01010309, 0x0101030a, 0x0101030b, 0x0101030e, 0x01010311, 0x01010312, 0x01010313, 0x01010314, 0x01010315, 0x01010317, 0x0101032b, 0x0101032c, 0x0101032e, 0x0101032f, 0x01010330, 0x01010336, 0x01010337, 0x01010338, 0x01010339, 0x0101033a, 0x0101034e, 0x0101034f, 0x01010350, 0x01010351, 0x01010352, 0x01010353, 0x01010355, 0x01010359, 0x0101035b, 0x0101035c, 0x0101035d, 0x0101035e, 0x0101035f, 0x01010360, 0x01010361, 0x0101036d, 0x01010373, 0x01010374, 0x0101037e, 0x01010386, 0x01010387, 0x01010388, 0x0101038d, 0x0101038e, 0x0101038f, 0x01010390, 0x01010391, 0x01010394, 0x01010397, 0x0101039b, 0x0101039c, 0x0101039d, 0x0101039e, 0x0101039f, 0x010103a3, 0x010103a4, 0x010103a8, 0x010103ad, 0x010103bd, 0x010103be, 0x010103c0, 0x010103c3, 0x010103c8, 0x010103cd, 0x010103ce, 0x010103cf, 0x010103d0, 0x010103d1, 0x010103d2, 0x010103d3, 0x010103d4, 0x010103d5, 0x010103d6, 0x010103d7, 0x010103d8, 0x010103d9, 0x010103da, 0x010103db, 0x010103dc, 0x010103dd, 0x010103de, 0x010103df, 0x010103e0, 0x010103e1, 0x010103e2, 0x010103e3, 0x010103e4, 0x010103e5, 0x010103e6, 0x010103e7, 0x010103e8, 0x010103e9, 0x010103ea, 0x010103eb, 0x010103ec, 0x010103ed, 0x010103ee, 0x010103ef, 0x010103f0, 0x010103f1, 0x010103f2, 0x010103f3, 0x010103f4, 0x010103f5, 0x010103f6, 0x010103f7, 0x010103f8, 0x010103f9, 0x010103fa }; const int R::Theme_absListViewStyle = 51; const int R::Theme_accessibilityFocusedDrawable = 261; const int R::Theme_actionBarDivider = 204; const int R::Theme_actionBarItemBackground = 205; const int R::Theme_actionBarSize = 140; const int R::Theme_actionBarSplitStyle = 196; const int R::Theme_actionBarStyle = 132; const int R::Theme_actionBarTabBarStyle = 143; const int R::Theme_actionBarTabStyle = 142; const int R::Theme_actionBarTabTextStyle = 144; const int R::Theme_actionBarWidgetTheme = 203; const int R::Theme_actionButtonStyle = 135; const int R::Theme_actionDropDownStyle = 134; const int R::Theme_actionMenuTextAppearance = 188; const int R::Theme_actionMenuTextColor = 189; const int R::Theme_actionModeBackground = 136; const int R::Theme_actionModeCloseButtonStyle = 146; const int R::Theme_actionModeCloseDrawable = 137; const int R::Theme_actionModeCopyDrawable = 160; const int R::Theme_actionModeCutDrawable = 159; const int R::Theme_actionModeFindDrawable = 239; const int R::Theme_actionModePasteDrawable = 161; const int R::Theme_actionModePopupWindowStyle = 241; const int R::Theme_actionModeSelectAllDrawable = 193; const int R::Theme_actionModeShareDrawable = 238; const int R::Theme_actionModeSplitBackground = 206; const int R::Theme_actionModeStyle = 202; const int R::Theme_actionModeWebSearchDrawable = 240; const int R::Theme_actionOverflowButtonStyle = 145; const int R::Theme_activatedBackgroundIndicator = 147; const int R::Theme_activityChooserViewStyle = 237; const int R::Theme_alertDialogButtonGroupStyle = 227; const int R::Theme_alertDialogCenterButtons = 228; const int R::Theme_alertDialogIcon = 181; const int R::Theme_alertDialogStyle = 45; const int R::Theme_alertDialogTheme = 155; const int R::Theme_autoCompleteTextViewStyle = 52; const int R::Theme_backgroundDimAmount = 2; const int R::Theme_backgroundDimEnabled = 106; const int R::Theme_borderlessButtonStyle = 165; const int R::Theme_buttonBarButtonStyle = 168; const int R::Theme_buttonBarStyle = 167; const int R::Theme_buttonStyle = 24; const int R::Theme_buttonStyleInset = 26; const int R::Theme_buttonStyleSmall = 25; const int R::Theme_buttonStyleToggle = 27; const int R::Theme_calendarViewStyle = 185; const int R::Theme_candidatesTextStyleSpans = 109; const int R::Theme_checkBoxPreferenceStyle = 87; const int R::Theme_checkboxStyle = 53; const int R::Theme_checkedTextViewStyle = 217; const int R::Theme_colorActivatedHighlight = 200; const int R::Theme_colorBackground = 1; const int R::Theme_colorBackgroundCacheHint = 118; const int R::Theme_colorFocusedHighlight = 199; const int R::Theme_colorForeground = 0; const int R::Theme_colorForegroundInverse = 94; const int R::Theme_colorLongPressedHighlight = 198; const int R::Theme_colorMultiSelectHighlight = 201; const int R::Theme_colorPressedHighlight = 197; const int R::Theme_datePickerStyle = 184; const int R::Theme_detailsElementBackground = 175; const int R::Theme_dialogCustomTitleDecorLayout = 245; const int R::Theme_dialogPreferenceStyle = 89; const int R::Theme_dialogTheme = 154; const int R::Theme_dialogTitleDecorLayout = 246; const int R::Theme_dialogTitleIconsDecorLayout = 244; const int R::Theme_disabledAlpha = 3; const int R::Theme_dividerHorizontal = 166; const int R::Theme_dividerVertical = 156; const int R::Theme_dropDownHintAppearance = 80; const int R::Theme_dropDownItemStyle = 78; const int R::Theme_dropDownListViewStyle = 54; const int R::Theme_dropDownSpinnerStyle = 133; const int R::Theme_dropdownListPreferredItemHeight = 225; const int R::Theme_editTextBackground = 179; const int R::Theme_editTextColor = 178; const int R::Theme_editTextPreferenceStyle = 90; const int R::Theme_editTextStyle = 55; const int R::Theme_errorMessageAboveBackground = 223; const int R::Theme_errorMessageBackground = 222; const int R::Theme_expandableListPreferredChildIndicatorLeft = 34; const int R::Theme_expandableListPreferredChildIndicatorRight = 35; const int R::Theme_expandableListPreferredChildPaddingLeft = 31; const int R::Theme_expandableListPreferredItemIndicatorLeft = 32; const int R::Theme_expandableListPreferredItemIndicatorRight = 33; const int R::Theme_expandableListPreferredItemPaddingLeft = 30; const int R::Theme_expandableListViewStyle = 56; const int R::Theme_expandableListViewWhiteStyle = 125; const int R::Theme_fastScrollOverlayPosition = 174; const int R::Theme_fastScrollPreviewBackgroundLeft = 171; const int R::Theme_fastScrollPreviewBackgroundRight = 172; const int R::Theme_fastScrollTextColor = 182; const int R::Theme_fastScrollThumbDrawable = 170; const int R::Theme_fastScrollTrackDrawable = 173; const int R::Theme_findOnPageNextDrawable = 262; const int R::Theme_findOnPagePreviousDrawable = 263; const int R::Theme_galleryItemBackground = 28; const int R::Theme_galleryStyle = 57; const int R::Theme_gestureOverlayViewStyle = 232; const int R::Theme_gridViewStyle = 58; const int R::Theme_homeAsUpIndicator = 157; const int R::Theme_horizontalScrollViewStyle = 180; const int R::Theme_imageButtonStyle = 59; const int R::Theme_imageWellStyle = 60; const int R::Theme_listChoiceBackgroundIndicator = 141; const int R::Theme_listChoiceIndicatorMultiple = 104; const int R::Theme_listChoiceIndicatorSingle = 103; const int R::Theme_listDivider = 102; const int R::Theme_listDividerAlertDialog = 152; const int R::Theme_listPopupWindowStyle = 148; const int R::Theme_listPreferredItemHeight = 29; const int R::Theme_listPreferredItemHeightLarge = 194; const int R::Theme_listPreferredItemHeightSmall = 195; const int R::Theme_listPreferredItemPaddingEnd = 214; const int R::Theme_listPreferredItemPaddingLeft = 209; const int R::Theme_listPreferredItemPaddingRight = 210; const int R::Theme_listPreferredItemPaddingStart = 213; const int R::Theme_listSeparatorTextViewStyle = 96; const int R::Theme_listViewStyle = 61; const int R::Theme_listViewWhiteStyle = 62; const int R::Theme_mapViewStyle = 82; const int R::Theme_mediaRouteButtonStyle = 212; const int R::Theme_numberPickerStyle = 235; const int R::Theme_panelBackground = 46; const int R::Theme_panelColorBackground = 49; const int R::Theme_panelColorForeground = 48; const int R::Theme_panelFullBackground = 47; const int R::Theme_panelMenuIsCompact = 229; const int R::Theme_panelMenuListTheme = 231; const int R::Theme_panelMenuListWidth = 230; const int R::Theme_panelTextAppearance = 50; const int R::Theme_pointerStyle = 260; const int R::Theme_popupMenuStyle = 149; const int R::Theme_popupWindowStyle = 63; const int R::Theme_preferenceCategoryStyle = 84; const int R::Theme_preferenceFragmentStyle = 242; const int R::Theme_preferenceFrameLayoutStyle = 258; const int R::Theme_preferenceInformationStyle = 85; const int R::Theme_preferenceLayoutChild = 92; const int R::Theme_preferencePanelStyle = 243; const int R::Theme_preferenceScreenStyle = 83; const int R::Theme_preferenceStyle = 86; const int R::Theme_presentationTheme = 215; const int R::Theme_progressBarStyle = 64; const int R::Theme_progressBarStyleHorizontal = 65; const int R::Theme_progressBarStyleInverse = 111; const int R::Theme_progressBarStyleLarge = 67; const int R::Theme_progressBarStyleLargeInverse = 113; const int R::Theme_progressBarStyleSmall = 66; const int R::Theme_progressBarStyleSmallInverse = 112; const int R::Theme_progressBarStyleSmallTitle = 98; const int R::Theme_quickContactBadgeOverlay = 233; const int R::Theme_quickContactBadgeStyleSmallWindowLarge = 124; const int R::Theme_quickContactBadgeStyleSmallWindowMedium = 123; const int R::Theme_quickContactBadgeStyleSmallWindowSmall = 122; const int R::Theme_quickContactBadgeStyleWindowLarge = 121; const int R::Theme_quickContactBadgeStyleWindowMedium = 120; const int R::Theme_quickContactBadgeStyleWindowSmall = 119; const int R::Theme_radioButtonStyle = 71; const int R::Theme_ratingBarStyle = 69; const int R::Theme_ratingBarStyleIndicator = 99; const int R::Theme_ratingBarStyleSmall = 70; const int R::Theme_ringtonePreferenceStyle = 91; const int R::Theme_scrollViewStyle = 72; const int R::Theme_searchDialogTheme = 257; const int R::Theme_searchDropdownBackground = 248; const int R::Theme_searchResultListItemHeight = 224; const int R::Theme_searchViewCloseIcon = 249; const int R::Theme_searchViewEditQuery = 253; const int R::Theme_searchViewEditQueryBackground = 254; const int R::Theme_searchViewGoIcon = 250; const int R::Theme_searchViewSearchIcon = 251; const int R::Theme_searchViewTextField = 255; const int R::Theme_searchViewTextFieldRight = 256; const int R::Theme_searchViewVoiceIcon = 252; const int R::Theme_searchWidgetCorpusItemBackground = 211; const int R::Theme_seekBarStyle = 68; const int R::Theme_segmentedButtonStyle = 169; const int R::Theme_selectableItemBackground = 158; const int R::Theme_spinnerDropDownItemStyle = 79; const int R::Theme_spinnerItemStyle = 81; const int R::Theme_spinnerStyle = 73; const int R::Theme_stackViewStyle = 234; const int R::Theme_starStyle = 74; const int R::Theme_switchPreferenceStyle = 190; const int R::Theme_switchStyle = 259; const int R::Theme_tabWidgetStyle = 75; const int R::Theme_textAppearance = 4; const int R::Theme_textAppearanceAutoCorrectionSuggestion = 219; const int R::Theme_textAppearanceButton = 95; const int R::Theme_textAppearanceEasyCorrectSuggestion = 216; const int R::Theme_textAppearanceInverse = 5; const int R::Theme_textAppearanceLarge = 16; const int R::Theme_textAppearanceLargeInverse = 19; const int R::Theme_textAppearanceLargePopupMenu = 150; const int R::Theme_textAppearanceListItem = 207; const int R::Theme_textAppearanceListItemSmall = 208; const int R::Theme_textAppearanceMedium = 17; const int R::Theme_textAppearanceMediumInverse = 20; const int R::Theme_textAppearanceMisspelledSuggestion = 218; const int R::Theme_textAppearanceSearchResultSubtitle = 116; const int R::Theme_textAppearanceSearchResultTitle = 117; const int R::Theme_textAppearanceSmall = 18; const int R::Theme_textAppearanceSmallInverse = 21; const int R::Theme_textAppearanceSmallPopupMenu = 151; const int R::Theme_textCheckMark = 22; const int R::Theme_textCheckMarkInverse = 23; const int R::Theme_textColorAlertDialogListItem = 153; const int R::Theme_textColorHighlightInverse = 176; const int R::Theme_textColorHintInverse = 15; const int R::Theme_textColorLinkInverse = 177; const int R::Theme_textColorPrimary = 6; const int R::Theme_textColorPrimaryDisableOnly = 7; const int R::Theme_textColorPrimaryInverse = 9; const int R::Theme_textColorPrimaryInverseDisableOnly = 114; const int R::Theme_textColorPrimaryInverseNoDisable = 13; const int R::Theme_textColorPrimaryNoDisable = 11; const int R::Theme_textColorSearchUrl = 110; const int R::Theme_textColorSecondary = 8; const int R::Theme_textColorSecondaryInverse = 10; const int R::Theme_textColorSecondaryInverseNoDisable = 14; const int R::Theme_textColorSecondaryNoDisable = 12; const int R::Theme_textColorTertiary = 100; const int R::Theme_textColorTertiaryInverse = 101; const int R::Theme_textEditNoPasteWindowLayout = 163; const int R::Theme_textEditPasteWindowLayout = 162; const int R::Theme_textEditSideNoPasteWindowLayout = 187; const int R::Theme_textEditSidePasteWindowLayout = 186; const int R::Theme_textEditSuggestionItemLayout = 192; const int R::Theme_textSelectHandle = 129; const int R::Theme_textSelectHandleLeft = 127; const int R::Theme_textSelectHandleRight = 128; const int R::Theme_textSelectHandleWindowStyle = 130; const int R::Theme_textSuggestionsWindowStyle = 191; const int R::Theme_textUnderlineColor = 220; const int R::Theme_textUnderlineThickness = 221; const int R::Theme_textViewStyle = 76; const int R::Theme_timePickerStyle = 236; const int R::Theme_toastFrameBackground = 247; const int R::Theme_webTextViewStyle = 126; const int R::Theme_webViewStyle = 77; const int R::Theme_windowActionBar = 131; const int R::Theme_windowActionBarOverlay = 139; const int R::Theme_windowActionModeOverlay = 138; const int R::Theme_windowAnimationStyle = 93; const int R::Theme_windowBackground = 36; const int R::Theme_windowCloseOnTouchOutside = 183; const int R::Theme_windowContentOverlay = 41; const int R::Theme_windowDisablePreview = 107; const int R::Theme_windowEnableSplitTouch = 164; const int R::Theme_windowFrame = 37; const int R::Theme_windowFullscreen = 97; const int R::Theme_windowIsFloating = 39; const int R::Theme_windowIsTranslucent = 40; const int R::Theme_windowNoDisplay = 105; const int R::Theme_windowNoTitle = 38; const int R::Theme_windowShowWallpaper = 115; const int R::Theme_windowSoftInputMode = 108; const int R::Theme_windowSplitActionBar = 226; const int R::Theme_windowTitleBackgroundStyle = 44; const int R::Theme_windowTitleSize = 42; const int R::Theme_windowTitleStyle = 43; const int R::Theme_yesNoPreferenceStyle = 88; const int R::styleable::TimePicker[] = { 0x01010413 }; const int R::TimePicker_internalLayout = 0; const int R::styleable::ToggleButton[] = { 0x01010033, 0x01010124, 0x01010125 }; const int R::ToggleButton_disabledAlpha = 0; const int R::ToggleButton_textOff = 2; const int R::ToggleButton_textOn = 1; const int R::styleable::TranslateAnimation[] = { 0x010101c6, 0x010101c7, 0x010101c8, 0x010101c9 }; const int R::TranslateAnimation_fromXDelta = 0; const int R::TranslateAnimation_fromYDelta = 2; const int R::TranslateAnimation_toXDelta = 1; const int R::TranslateAnimation_toYDelta = 3; const int R::styleable::TwoLineListItem[] = { 0x0101017e }; const int R::TwoLineListItem_mode = 0; const int R::styleable::VerticalSlider_Layout[] = { 0x01010193 }; const int R::VerticalSlider_Layout_layout_scale = 0; const int R::styleable::View[] = { 0x01010063, 0x01010064, 0x01010065, 0x01010066, 0x01010067, 0x01010068, 0x01010069, 0x0101007f, 0x010100d0, 0x010100d1, 0x010100d2, 0x010100d3, 0x010100d4, 0x010100d5, 0x010100d6, 0x010100d7, 0x010100d8, 0x010100d9, 0x010100da, 0x010100db, 0x010100dc, 0x010100dd, 0x010100de, 0x010100df, 0x010100e0, 0x010100e1, 0x010100e2, 0x010100e3, 0x010100e4, 0x010100e5, 0x010100e6, 0x010100e7, 0x010100e8, 0x010100e9, 0x0101013f, 0x01010140, 0x01010215, 0x01010216, 0x0101024e, 0x0101025e, 0x0101026f, 0x01010273, 0x010102a8, 0x010102a9, 0x010102aa, 0x010102c1, 0x010102c4, 0x0101031f, 0x01010320, 0x01010321, 0x01010322, 0x01010323, 0x01010324, 0x01010325, 0x01010326, 0x01010327, 0x01010328, 0x01010334, 0x0101033c, 0x01010354, 0x010103a5, 0x010103aa, 0x010103b0, 0x010103b1, 0x010103b2, 0x010103b3, 0x010103b4, 0x010103c6 }; const int R::View_alpha = 47; const int R::View_background = 12; const int R::View_clickable = 29; const int R::View_contentDescription = 41; const int R::View_drawingCacheQuality = 32; const int R::View_duplicateParentState = 33; const int R::View_fadeScrollbars = 44; const int R::View_fadingEdge = 23; const int R::View_fadingEdgeLength = 24; const int R::View_filterTouchesWhenObscured = 46; const int R::View_fitsSystemWindows = 21; const int R::View_focusable = 18; const int R::View_focusableInTouchMode = 19; const int R::View_hapticFeedbackEnabled = 39; const int R::View_id = 8; const int R::View_importantForAccessibility = 61; const int R::View_isScrollContainer = 38; const int R::View_keepScreenOn = 37; const int R::View_labelFor = 67; const int R::View_layerType = 59; const int R::View_layoutDirection = 64; const int R::View_longClickable = 30; const int R::View_minHeight = 35; const int R::View_minWidth = 34; const int R::View_nextFocusDown = 28; const int R::View_nextFocusForward = 58; const int R::View_nextFocusLeft = 25; const int R::View_nextFocusRight = 26; const int R::View_nextFocusUp = 27; const int R::View_onClick = 40; const int R::View_overScrollMode = 45; const int R::View_padding = 13; const int R::View_paddingBottom = 17; const int R::View_paddingEnd = 66; const int R::View_paddingLeft = 14; const int R::View_paddingRight = 16; const int R::View_paddingStart = 65; const int R::View_paddingTop = 15; const int R::View_requiresFadingEdge = 60; const int R::View_rotation = 54; const int R::View_rotationX = 55; const int R::View_rotationY = 56; const int R::View_saveEnabled = 31; const int R::View_scaleX = 52; const int R::View_scaleY = 53; const int R::View_scrollX = 10; const int R::View_scrollY = 11; const int R::View_scrollbarAlwaysDrawHorizontalTrack = 5; const int R::View_scrollbarAlwaysDrawVerticalTrack = 6; const int R::View_scrollbarDefaultDelayBeforeFade = 43; const int R::View_scrollbarFadeDuration = 42; const int R::View_scrollbarSize = 0; const int R::View_scrollbarStyle = 7; const int R::View_scrollbarThumbHorizontal = 1; const int R::View_scrollbarThumbVertical = 2; const int R::View_scrollbarTrackHorizontal = 3; const int R::View_scrollbarTrackVertical = 4; const int R::View_scrollbars = 22; const int R::View_soundEffectsEnabled = 36; const int R::View_tag = 9; const int R::View_textAlignment = 63; const int R::View_textDirection = 62; const int R::View_transformPivotX = 48; const int R::View_transformPivotY = 49; const int R::View_translationX = 50; const int R::View_translationY = 51; const int R::View_verticalScrollbarPosition = 57; const int R::View_visibility = 20; const int R::styleable::ViewAnimator[] = { 0x01010177, 0x01010178, 0x010102d5 }; const int R::ViewAnimator_animateFirstView = 2; const int R::ViewAnimator_inAnimation = 0; const int R::ViewAnimator_outAnimation = 1; const int R::styleable::ViewDrawableStates[] = { 0x0101009c, 0x0101009d, 0x0101009e, 0x010100a1, 0x010100a7, 0x010102fe, 0x0101031b, 0x01010367, 0x01010368, 0x01010369 }; const int R::ViewDrawableStates_state_accelerated = 6; const int R::ViewDrawableStates_state_activated = 5; const int R::ViewDrawableStates_state_drag_can_accept = 8; const int R::ViewDrawableStates_state_drag_hovered = 9; const int R::ViewDrawableStates_state_enabled = 2; const int R::ViewDrawableStates_state_focused = 0; const int R::ViewDrawableStates_state_hovered = 7; const int R::ViewDrawableStates_state_pressed = 4; const int R::ViewDrawableStates_state_selected = 3; const int R::ViewDrawableStates_state_window_focused = 1; const int R::styleable::ViewFlipper[] = { 0x01010179, 0x010102b5 }; const int R::ViewFlipper_autoStart = 1; const int R::ViewFlipper_flipInterval = 0; const int R::styleable::ViewGroup[] = { 0x010100ea, 0x010100eb, 0x010100ec, 0x010100ed, 0x010100ee, 0x010100ef, 0x010100f0, 0x010100f1, 0x010102ef, 0x010102f2 }; const int R::ViewGroup_addStatesFromChildren = 6; const int R::ViewGroup_alwaysDrawnWithCache = 5; const int R::ViewGroup_animateLayoutChanges = 9; const int R::ViewGroup_animationCache = 3; const int R::ViewGroup_clipChildren = 0; const int R::ViewGroup_clipToPadding = 1; const int R::ViewGroup_descendantFocusability = 7; const int R::ViewGroup_layoutAnimation = 2; const int R::ViewGroup_persistentDrawingCache = 4; const int R::ViewGroup_splitMotionEvents = 8; const int R::styleable::ViewGroup_Layout[] = { 0x010100f4, 0x010100f5 }; const int R::ViewGroup_Layout_layout_height = 1; const int R::ViewGroup_Layout_layout_width = 0; const int R::styleable::ViewGroup_MarginLayout[] = { 0x010100f4, 0x010100f5, 0x010100f6, 0x010100f7, 0x010100f8, 0x010100f9, 0x010100fa, 0x010103b5, 0x010103b6 }; const int R::ViewGroup_MarginLayout_layout_height = 1; const int R::ViewGroup_MarginLayout_layout_margin = 2; const int R::ViewGroup_MarginLayout_layout_marginBottom = 6; const int R::ViewGroup_MarginLayout_layout_marginEnd = 8; const int R::ViewGroup_MarginLayout_layout_marginLeft = 3; const int R::ViewGroup_MarginLayout_layout_marginRight = 5; const int R::ViewGroup_MarginLayout_layout_marginStart = 7; const int R::ViewGroup_MarginLayout_layout_marginTop = 4; const int R::ViewGroup_MarginLayout_layout_width = 0; const int R::styleable::ViewStub[] = { 0x010100f2, 0x010100f3 }; const int R::ViewStub_inflatedId = 1; const int R::ViewStub_layout = 0; const int R::styleable::ViewSwitcher[] = { }; const int R::styleable::VolumePreference[] = { 0x01010209 }; const int R::VolumePreference_streamType = 0; const int R::styleable::Wallpaper[] = { 0x01010020, 0x01010225, 0x010102a5, 0x010102b4 }; const int R::Wallpaper_author = 3; const int R::Wallpaper_description = 0; const int R::Wallpaper_settingsActivity = 1; const int R::Wallpaper_thumbnail = 2; const int R::styleable::WallpaperPreviewInfo[] = { 0x01010331 }; const int R::WallpaperPreviewInfo_staticWallpaperPreview = 0; const int R::styleable::WeightedLinearLayout[] = { 0x01010415, 0x01010416, 0x01010417, 0x01010418 }; const int R::WeightedLinearLayout_majorWeightMax = 2; const int R::WeightedLinearLayout_majorWeightMin = 0; const int R::WeightedLinearLayout_minorWeightMax = 3; const int R::WeightedLinearLayout_minorWeightMin = 1; const int R::styleable::Window[] = { 0x01010032, 0x01010054, 0x01010055, 0x01010056, 0x01010057, 0x01010058, 0x01010059, 0x01010098, 0x010100ae, 0x0101020d, 0x0101021e, 0x0101021f, 0x01010222, 0x0101022b, 0x01010292, 0x010102cd, 0x010102dd, 0x010102e4, 0x01010317, 0x01010356, 0x01010357, 0x0101035b, 0x010103d5, 0x010103fb, 0x010103fc, 0x010103fd, 0x010103fe }; const int R::Window_backgroundDimAmount = 0; const int R::Window_backgroundDimEnabled = 11; const int R::Window_textColor = 7; const int R::Window_windowActionBar = 15; const int R::Window_windowActionBarOverlay = 17; const int R::Window_windowActionModeOverlay = 16; const int R::Window_windowAnimationStyle = 8; const int R::Window_windowBackground = 1; const int R::Window_windowCloseOnTouchOutside = 21; const int R::Window_windowContentOverlay = 6; const int R::Window_windowDisablePreview = 12; const int R::Window_windowEnableSplitTouch = 18; const int R::Window_windowFixedHeightMajor = 26; const int R::Window_windowFixedHeightMinor = 24; const int R::Window_windowFixedWidthMajor = 23; const int R::Window_windowFixedWidthMinor = 25; const int R::Window_windowFrame = 2; const int R::Window_windowFullscreen = 9; const int R::Window_windowIsFloating = 4; const int R::Window_windowIsTranslucent = 5; const int R::Window_windowMinWidthMajor = 19; const int R::Window_windowMinWidthMinor = 20; const int R::Window_windowNoDisplay = 10; const int R::Window_windowNoTitle = 3; const int R::Window_windowShowWallpaper = 14; const int R::Window_windowSoftInputMode = 13; const int R::Window_windowSplitActionBar = 22; const int R::styleable::WindowAnimation[] = { 0x010100b4, 0x010100b5, 0x010100b6, 0x010100b7, 0x010100b8, 0x010100b9, 0x010100ba, 0x010100bb, 0x010100bc, 0x010100bd, 0x010100be, 0x010100bf, 0x010100c0, 0x010100c1, 0x010100c2, 0x010100c3, 0x01010293, 0x01010294, 0x01010295, 0x01010296, 0x01010297, 0x01010298, 0x01010299, 0x0101029a }; const int R::WindowAnimation_activityCloseEnterAnimation = 6; const int R::WindowAnimation_activityCloseExitAnimation = 7; const int R::WindowAnimation_activityOpenEnterAnimation = 4; const int R::WindowAnimation_activityOpenExitAnimation = 5; const int R::WindowAnimation_taskCloseEnterAnimation = 10; const int R::WindowAnimation_taskCloseExitAnimation = 11; const int R::WindowAnimation_taskOpenEnterAnimation = 8; const int R::WindowAnimation_taskOpenExitAnimation = 9; const int R::WindowAnimation_taskToBackEnterAnimation = 14; const int R::WindowAnimation_taskToBackExitAnimation = 15; const int R::WindowAnimation_taskToFrontEnterAnimation = 12; const int R::WindowAnimation_taskToFrontExitAnimation = 13; const int R::WindowAnimation_wallpaperCloseEnterAnimation = 18; const int R::WindowAnimation_wallpaperCloseExitAnimation = 19; const int R::WindowAnimation_wallpaperIntraCloseEnterAnimation = 22; const int R::WindowAnimation_wallpaperIntraCloseExitAnimation = 23; const int R::WindowAnimation_wallpaperIntraOpenEnterAnimation = 20; const int R::WindowAnimation_wallpaperIntraOpenExitAnimation = 21; const int R::WindowAnimation_wallpaperOpenEnterAnimation = 16; const int R::WindowAnimation_wallpaperOpenExitAnimation = 17; const int R::WindowAnimation_windowEnterAnimation = 0; const int R::WindowAnimation_windowExitAnimation = 1; const int R::WindowAnimation_windowHideAnimation = 3; const int R::WindowAnimation_windowShowAnimation = 2; }; };
51.107773
95
0.816339
5fde1048e3ba09396e3eb85d31727a63a0b41224
5,841
hh
C++
cc/record.hh
skepner/dtra2
5aeeb66cd8e42217976ae0ad481dcc42549e6bf0
[ "MIT" ]
null
null
null
cc/record.hh
skepner/dtra2
5aeeb66cd8e42217976ae0ad481dcc42549e6bf0
[ "MIT" ]
null
null
null
cc/record.hh
skepner/dtra2
5aeeb66cd8e42217976ae0ad481dcc42549e6bf0
[ "MIT" ]
null
null
null
#pragma once #include <string> #include "date.hh" // ---------------------------------------------------------------------- namespace xlnt { class cell; } namespace dtra { inline namespace v2 { class Directory; // -------------------------------------------------- class Record { public: void importer_default(const xlnt::cell& cell); void exporter_default(xlnt::cell& cell) const; std::string csv_exporter_default() const { return {}; } void allow_zero_date(bool allow_zero_date); std::string validate(const Directory& locations, const Directory& birds); std::pair<std::string, bool> merge(const Record& rec, bool resolve_conflict_with_merge_in); static std::string new_record_id(); void reset_record_id() { record_id_ = new_record_id(); } static constexpr const char* re_sample_id = "^(217|DT)-[0-9]+$"; static constexpr const char* sample_id_message = "expected: 217-xxxxx, DT-xxxxx"; static constexpr const char* re_ct = "^[<>]?[0-9]+(\\.[0-9][0-9]?)?$"; static constexpr const char* ct_message = "expected: valid CT Value"; static constexpr const char* re_h_status = "^(P|N)$"; static constexpr const char* h_status_message = "expected: P or N"; static constexpr const char* re_pathotype = "^(LPAI|HPAI)$"; static constexpr const char* pathotype_message = "expected: LPAI or HPAI"; static constexpr const char* re_egg_passage = "^(0|1)$"; static constexpr const char* egg_passage_message = "expected: 0 or 1"; static std::string new_record_id_; field::Uppercase sample_id_{re_sample_id, sample_id_message, field::can_be_empty::no}; field::Date collection_date_{field::can_be_empty::no}; field::Text species_; field::Uppercase age_{"^[HAU]$", "expected: H, A, U", field::can_be_empty::no}; field::Uppercase sex_{"^[MFU]$", "expected Sex: M, F, U", field::can_be_empty::no}; field::Text ring_number_; field::Uppercase host_identifier_{re_sample_id, sample_id_message}; field::Text host_species_; field::Text host_common_name_; field::Uppercase health_{"^[HSDU]$", "expected: H(ealthy), S(ick), D(ead), U(undetermined)"}; field::Uppercase capture_method_status_{"^(A|K|O|M|P|Z|F|U|OT.*)$", "expected: A, K, O, M, P, Z, F, OT-<text>, U"}; // see bottom of record.cc field::Uppercase behavior_{"^(W|D|CW|U)$", "expected: W(ild), D(omestic), CW (captive-wild), U(known)"}; field::Text location_{field::can_be_empty::no}; field::Text province_; field::Text country_; field::Float latitude_{-90, 90}; field::Float longitude_{-180, 180}; field::Uppercase sample_material_{"^(TS|OP|C|F|COP|B|SR|TT|CF|TB|TO|L|S|W|O[- ].+|X.*)$", "expected: TS, OP, C, F, COP, B, SR, TT, CF, TB, TO, L, S, W, O -<text>, X-<text>"}; // see bottom of record.cc field::Uppercase test_for_influenza_virus_; // {"^RRT-PCR +MA( *,? *RRT-PCR +H5( *,? *RRT-PCR +H7)?)?$", "expected: RRT-PCR MA, RRT-PCR H5, RRT-PCR H7"} field::Date date_of_testing_; field::Uppercase pool_id_{"^[0-9\\.]+$", "expected: numeric value"}; field::Uppercase influenza_test_result_{"^(P|N)$", "expected: P, N"}; field::Uppercase ma_ct_value_{re_ct, ct_message}; field::Uppercase h5_status_{re_h_status, h_status_message}; field::Uppercase h5_ct_value_{re_ct, ct_message}; field::Uppercase h5_pathotype_{re_pathotype, pathotype_message}; field::Uppercase h7_status_{re_h_status, h_status_message}; field::Uppercase h7_ct_value_{re_ct, ct_message}; field::Uppercase h7_pathotype_{re_pathotype, pathotype_message}; field::Uppercase h9_status_{re_h_status, h_status_message}; field::Uppercase h9_ct_value_{re_ct, ct_message}; field::Text emc_id_; field::Text ahvla_id_; field::Uppercase first_egg_passage_{re_egg_passage, egg_passage_message}; field::Uppercase second_egg_passage_{re_egg_passage, egg_passage_message}; field::Uppercase passage_isolation_{"^(E1|E2|NOT *PERFORMED|NEGATIVE)$", "expected: E1, E2, not performed"}; field::Uppercase virus_pathotype_{"^(LPAI|HPAI|NOT *IDENTIFIABLE)$", "expected: LPAI, HPAI, notidentifiable"}; field::Uppercase haemagglutinin_subtype_{"^((H[1-9]|H1[0-6])(/(H[1-9]|H1[0-6]))*|MIXED|H +NOT +DETERMINED)$", "expected: H1-H16, mixed, H not determined"}; field::Uppercase neuraminidase_subtype_{"^(N[1-9](/N[1-9])*|MIXED|N +NOT +DETERMINED)$", "expected: N1-N9, mixed, N not determined"}; field::Uppercase serology_sample_id_{re_sample_id, sample_id_message}; field::Date serology_testing_date_; field::Uppercase serology_status_{"^(\\+|-|\\*)$", "expected: +, -, *"}; field::Text record_id_; private: void validate_hostspecies_commonname(const Directory& birds, std::vector<std::string>& reports); void check_dates(std::vector<std::string>& reports); void update_locations(const Directory& locations, std::vector<std::string>& reports); void update_behavior(std::vector<std::string>& reports); }; } // namespace v2 } // namespace dtra // ---------------------------------------------------------------------- /// Local Variables: /// eval: (if (fboundp 'eu-rename-buffer) (eu-rename-buffer)) /// End:
54.588785
213
0.588255
5fe35e13763aab39c3aa3d34251ef07e01a67fae
921
cpp
C++
HDUOJ/1020.cpp
Accelerator404/Algorithm-Demonstration
e40a499c23a56d363c743c76ac967d9c4247a4be
[ "Apache-2.0" ]
1
2019-09-18T23:45:27.000Z
2019-09-18T23:45:27.000Z
HDUOJ/1020.cpp
Accelerator404/Algorithm-Demonstration
e40a499c23a56d363c743c76ac967d9c4247a4be
[ "Apache-2.0" ]
null
null
null
HDUOJ/1020.cpp
Accelerator404/Algorithm-Demonstration
e40a499c23a56d363c743c76ac967d9c4247a4be
[ "Apache-2.0" ]
1
2019-09-18T23:45:28.000Z
2019-09-18T23:45:28.000Z
#include <iostream> #include <cstdio> #include <string> #include <algorithm> using namespace std; //to_string要求C++11 int main() { int N; cin >> N; for(int i=1;i <= N;i++){ char target; string input,output; int count = 0; cin >> input; for(int j = 0;j < input.length();j++){ if(j == 0){ target = input[j]; count++; } else if(target != input[j]){ if(count>1){ output.append(to_string(count)); } output+=target; count = 0; target = input[j]; count++; } else{ count++; } } if(count>1){ output.append(to_string(count)); } output+=target; cout << output << endl; } return 0; }
20.931818
52
0.394137
5fea1034974be509fb893f4ef79ba7f60bff7ad6
1,739
cpp
C++
vstgui/tests/unittest/lib/cpoint_test.cpp
GizzZmo/vstgui
477a3de78ecbcf25f52cce9ad49c5feb0b15ea9e
[ "BSD-3-Clause" ]
205
2019-06-09T18:40:27.000Z
2022-03-24T01:53:49.000Z
vstgui/tests/unittest/lib/cpoint_test.cpp
GizzZmo/vstgui
477a3de78ecbcf25f52cce9ad49c5feb0b15ea9e
[ "BSD-3-Clause" ]
11
2019-02-09T16:15:34.000Z
2021-03-24T06:28:56.000Z
vstgui/tests/unittest/lib/cpoint_test.cpp
GizzZmo/vstgui
477a3de78ecbcf25f52cce9ad49c5feb0b15ea9e
[ "BSD-3-Clause" ]
30
2019-06-11T04:05:46.000Z
2022-03-29T15:52:14.000Z
// This file is part of VSTGUI. It is subject to the license terms // in the LICENSE file found in the top-level directory of this // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE #include "../../../lib/cpoint.h" #include "../unittests.h" namespace VSTGUI { TESTCASE(CPointTest, TEST(unequal, EXPECT(CPoint (0, 0) != CPoint (1, 1)); EXPECT(CPoint (0, 0) != CPoint (0, 1)); EXPECT(CPoint (0, 0) != CPoint (1, 0)); ); TEST(equal, EXPECT(CPoint (0, 0) == CPoint (0, 0)); ); TEST(operatorAddAssign, CPoint p (1, 1); p += CPoint (1, 1); EXPECT(p == CPoint (2, 2)); ); TEST(operatorSubtractAssign, CPoint p (2, 2); p -= CPoint (1, 1); EXPECT(p == CPoint (1, 1)); ); TEST(operatorAdd, CPoint p (2, 2); auto p2 = p + CPoint (1, 1); EXPECT(p2 == CPoint (3, 3)); EXPECT(p == CPoint (2, 2)); ); TEST(operatorSubtract, CPoint p (2, 2); auto p2 = p - CPoint (1, 1); EXPECT(p2 == CPoint (1, 1)); EXPECT(p == CPoint (2, 2)); ); TEST(operatorInverse, CPoint p (2, 2); auto p2 = -p; EXPECT(p2 == CPoint (-2, -2)); EXPECT(p == CPoint (2, 2)); ); TEST(offsetCoords, CPoint p (1, 2); p.offset (1, 2); EXPECT(p == CPoint (2, 4)); ); TEST(offsetPoint, CPoint p (1, 2); p.offset (CPoint (2, 3)); EXPECT(p == CPoint (3, 5)); ); TEST(offsetInverse, CPoint p (5, 3); p.offsetInverse (CPoint(2, 1)); EXPECT(p == CPoint (3, 2)); ); TEST(makeIntegral, CPoint p (5.3, 4.2); p.makeIntegral (); EXPECT(p == CPoint (5, 4)); p (5.5, 4.5); p.makeIntegral (); EXPECT(p == CPoint (6, 5)); p (5.9, 4.1); p.makeIntegral (); EXPECT(p == CPoint (6, 4)); p (5.1, 4.501); p.makeIntegral (); EXPECT(p == CPoint (5, 5)); ); ); } // VSTGUI
19.539326
70
0.565267
5feb4e69c10ca0a874238cb07dbe30865b23f5dc
658
cpp
C++
modules/augment/src/uniformnoise.cpp
FadyEssam/opencv_contrib
8ebe2629ec7ae17338f6dc7acceada82151185ed
[ "BSD-3-Clause" ]
null
null
null
modules/augment/src/uniformnoise.cpp
FadyEssam/opencv_contrib
8ebe2629ec7ae17338f6dc7acceada82151185ed
[ "BSD-3-Clause" ]
1
2019-07-11T20:21:36.000Z
2019-07-11T20:21:36.000Z
modules/augment/src/uniformnoise.cpp
FadyEssam/opencv_contrib
8ebe2629ec7ae17338f6dc7acceada82151185ed
[ "BSD-3-Clause" ]
null
null
null
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #include "precomp.hpp" namespace cv { namespace augment { UniformNoise::UniformNoise(float _low, float _high) { low = _low; high = _high; } void UniformNoise::image(InputArray src, OutputArray dst) { addWeighted(src, 1.0, noise, 1.0, 0.0, dst); } Rect2f UniformNoise::rectangle(const Rect2f& src) { return src; } void UniformNoise::init(const Mat& srcImage) { noise = Mat(srcImage.size(), srcImage.type(),Scalar(0)); randu(noise, low, high); } }}
21.933333
90
0.711246
5fedfe656a8f4eb606b3b48b506acf7b76af47db
32,654
cpp
C++
src/main/cpp/driver/ps_ds4_controller.cpp
morrky89/PSMoveSteamVRBridge
03d29b14d1738597523bd059d30736cb0d075d37
[ "Apache-2.0" ]
147
2017-03-28T21:32:25.000Z
2022-01-03T14:43:58.000Z
src/main/cpp/driver/ps_ds4_controller.cpp
morrky89/PSMoveSteamVRBridge
03d29b14d1738597523bd059d30736cb0d075d37
[ "Apache-2.0" ]
129
2017-04-01T20:34:52.000Z
2021-04-06T07:34:49.000Z
src/main/cpp/driver/ps_ds4_controller.cpp
morrky89/PSMoveSteamVRBridge
03d29b14d1738597523bd059d30736cb0d075d37
[ "Apache-2.0" ]
53
2017-03-29T19:31:40.000Z
2022-03-13T11:38:23.000Z
#define _USE_MATH_DEFINES #include "constants.h" #include "server_driver.h" #include "utils.h" #include "settings_util.h" #include "driver.h" #include "facing_handsolver.h" #include "ps_ds4_controller.h" #include "trackable_device.h" #include <assert.h> namespace steamvrbridge { // -- PSDualshock4ControllerConfig ----- configuru::Config PSDualshock4ControllerConfig::WriteToJSON() { configuru::Config &pt= ControllerConfig::WriteToJSON(); // Throwing power settings pt["linear_velocity_multiplier"] = linear_velocity_multiplier; pt["linear_velocity_exponent"] = linear_velocity_exponent; // General Settings pt["rumble_suppressed"] = rumble_suppressed; pt["extend_y_cm"] = extend_Y_meters * 100.f; pt["extend_x_cm"] = extend_Z_meters * 100.f; pt["rotate_z_90"] = z_rotate_90_degrees; pt["calibration_offset_cm"] = calibration_offset_meters * 100.f; pt["thumbstick_deadzone"] = thumbstick_deadzone; pt["disable_alignment_gesture"] = disable_alignment_gesture; pt["use_orientation_in_hmd_alignment"] = use_orientation_in_hmd_alignment; //PSMove controller button -> fake touchpad mappings WriteEmulatedTouchpadAction(pt, k_PSMButtonID_PS); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_Triangle); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_Circle); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_Cross); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_Square); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_DPad_Left); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_DPad_Up); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_DPad_Right); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_DPad_Down); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_Options); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_Share); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_Touchpad); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_LeftJoystick); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_RightJoystick); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_LeftShoulder); WriteEmulatedTouchpadAction(pt, k_PSMButtonID_RightShoulder); return pt; } bool PSDualshock4ControllerConfig::ReadFromJSON(const configuru::Config &pt) { if (!ControllerConfig::ReadFromJSON(pt)) return false; // Throwing power settings linear_velocity_multiplier = pt.get_or<float>("linear_velocity_multiplier", linear_velocity_multiplier); linear_velocity_exponent = pt.get_or<float>("linear_velocity_exponent", linear_velocity_exponent); // General Settings rumble_suppressed = pt.get_or<bool>("rumble_suppressed", rumble_suppressed); extend_Y_meters = pt.get_or<float>("extend_y_cm", 0.f) / 100.f; extend_Z_meters = pt.get_or<float>("extend_x_cm", 0.f) / 100.f; z_rotate_90_degrees = pt.get_or<bool>("rotate_z_90", z_rotate_90_degrees); calibration_offset_meters = pt.get_or<float>("calibration_offset_cm", 6.f) / 100.f; thumbstick_deadzone = pt.get_or<float>("thumbstick_deadzone", thumbstick_deadzone); disable_alignment_gesture = pt.get_or<bool>("disable_alignment_gesture", disable_alignment_gesture); use_orientation_in_hmd_alignment = pt.get_or<bool>("use_orientation_in_hmd_alignment", use_orientation_in_hmd_alignment); // DS4 controller button -> fake touchpad mappings ReadEmulatedTouchpadAction(pt, k_PSMButtonID_PS); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_Triangle); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_Circle); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_Cross); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_Square); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_DPad_Left); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_DPad_Up); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_DPad_Right); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_DPad_Down); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_Options); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_Share); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_Touchpad); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_LeftJoystick); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_RightJoystick); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_LeftShoulder); ReadEmulatedTouchpadAction(pt, k_PSMButtonID_RightShoulder); return true; } // -- PSDualshock4Controller ----- PSDualshock4Controller::PSDualshock4Controller( PSMControllerID psmControllerId, vr::ETrackedControllerRole trackedControllerRole, const char *psmSerialNo) : Controller() , m_parentController(nullptr) , m_nPSMControllerId(psmControllerId) , m_PSMServiceController(nullptr) , m_nPoseSequenceNumber(0) , m_resetPoseButtonPressTime() , m_bResetPoseRequestSent(false) , m_resetAlignButtonPressTime() , m_bResetAlignRequestSent(false) , m_touchpadDirectionsUsed(false) , m_bUseControllerOrientationInHMDAlignment(false) , m_lastSanitizedLeftThumbstick_X(0.f) , m_lastSanitizedLeftThumbstick_Y(0.f) , m_lastSanitizedRightThumbstick_X(0.f) , m_lastSanitizedRightThumbstick_Y(0.f) { char svrIdentifier[256]; Utils::GenerateControllerSteamVRIdentifier(svrIdentifier, sizeof(svrIdentifier), psmControllerId); m_strSteamVRSerialNo = svrIdentifier; m_lastTouchpadPressTime = std::chrono::high_resolution_clock::now(); if (psmSerialNo != NULL) { m_strPSMControllerSerialNo = psmSerialNo; } // Tell PSM Client API that we are listening to this controller id PSM_AllocateControllerListener(psmControllerId); m_PSMServiceController = PSM_GetController(psmControllerId); m_TrackedControllerRole = trackedControllerRole; m_trackingStatus = vr::TrackingResult_Uninitialized; } PSDualshock4Controller::~PSDualshock4Controller() { PSM_FreeControllerListener(m_PSMServiceController->ControllerID); m_PSMServiceController = nullptr; } vr::EVRInitError PSDualshock4Controller::Activate(vr::TrackedDeviceIndex_t unObjectId) { vr::EVRInitError result = Controller::Activate(unObjectId); if (result == vr::VRInitError_None) { Logger::Info("PSDualshock4Controller::Activate - Controller %d Activated\n", unObjectId); // If we aren't doing the alignment gesture then just pretend we have tracking // This will suppress the alignment gesture dialog in the monitor if (getConfig()->disable_alignment_gesture || CServerDriver_PSMoveService::getInstance()->IsHMDTrackingSpaceCalibrated()) { m_trackingStatus = vr::TrackingResult_Running_OK; } else { CServerDriver_PSMoveService::getInstance()->LaunchPSMoveMonitor(); } PSMRequestID requestId; if (PSM_StartControllerDataStreamAsync( m_PSMServiceController->ControllerID, PSMStreamFlags_includePositionData | PSMStreamFlags_includePhysicsData, &requestId) != PSMResult_Error) { PSM_RegisterCallback(requestId, PSDualshock4Controller::start_controller_response_callback, this); } // Setup controller properties { vr::CVRPropertyHelpers *properties = vr::VRProperties(); properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceOff_String, "{psmove}gamepad_status_off.png"); properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceSearching_String, "{psmove}gamepad_status_ready.png"); properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceSearchingAlert_String, "{psmove}gamepad_status_ready_alert.png"); properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceReady_String, "{psmove}gamepad_status_ready.png"); properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceReadyAlert_String, "{psmove}gamepad_status_ready_alert.png"); properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceNotReady_String, "{psmove}gamepad_status_error.png"); properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceStandby_String, "{psmove}gamepad_status_ready.png"); properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceAlertLow_String, "{psmove}gamepad_status_ready_low.png"); properties->SetBoolProperty(m_ulPropertyContainer, vr::Prop_WillDriftInYaw_Bool, true); properties->SetBoolProperty(m_ulPropertyContainer, vr::Prop_DeviceIsWireless_Bool, true); properties->SetBoolProperty(m_ulPropertyContainer, vr::Prop_DeviceProvidesBatteryStatus_Bool, false); properties->SetInt32Property(m_ulPropertyContainer, vr::Prop_DeviceClass_Int32, vr::TrackedDeviceClass_Controller); // The {psmove} syntax lets us refer to rendermodels that are installed // in the driver's own resources/rendermodels directory. The driver can // still refer to SteamVR models like "generic_hmd". if (getConfig()->override_model.length() > 0) { properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_RenderModelName_String, getConfig()->override_model.c_str()); } else { properties->SetStringProperty(m_ulPropertyContainer, vr::Prop_RenderModelName_String, "{psmove}dualshock4_controller"); } // Set device properties vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, vr::Prop_ControllerRoleHint_Int32, m_TrackedControllerRole); vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ManufacturerName_String, "Sony"); vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_HardwareRevision_Uint64, 1313); vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_FirmwareVersion_Uint64, 1315); vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ModelNumber_String, "Dualshock4"); vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_SerialNumber_String, m_strPSMControllerSerialNo.c_str()); } } return result; } void PSDualshock4Controller::start_controller_response_callback( const PSMResponseMessage *response, void *userdata) { PSDualshock4Controller *controller = reinterpret_cast<PSDualshock4Controller *>(userdata); if (response->result_code == PSMResult::PSMResult_Success) { Logger::Info("PSDualshock4Controller::start_controller_response_callback - Controller stream started\n"); // Create the special case system button (bound to PS button) controller->CreateButtonComponent(k_PSMButtonID_System); // Create buttons components controller->CreateButtonComponent(k_PSMButtonID_PS); controller->CreateButtonComponent(k_PSMButtonID_Triangle); controller->CreateButtonComponent(k_PSMButtonID_Circle); controller->CreateButtonComponent(k_PSMButtonID_Cross); controller->CreateButtonComponent(k_PSMButtonID_Square); controller->CreateButtonComponent(k_PSMButtonID_DPad_Up); controller->CreateButtonComponent(k_PSMButtonID_DPad_Down); controller->CreateButtonComponent(k_PSMButtonID_DPad_Left); controller->CreateButtonComponent(k_PSMButtonID_DPad_Right); controller->CreateButtonComponent(k_PSMButtonID_Options); controller->CreateButtonComponent(k_PSMButtonID_Share); controller->CreateButtonComponent(k_PSMButtonID_Touchpad); controller->CreateButtonComponent(k_PSMButtonID_LeftJoystick); controller->CreateButtonComponent(k_PSMButtonID_RightJoystick); controller->CreateButtonComponent(k_PSMButtonID_LeftShoulder); controller->CreateButtonComponent(k_PSMButtonID_RightShoulder); // Create axis components controller->CreateAxisComponent(k_PSMAxisID_LeftTrigger); controller->CreateAxisComponent(k_PSMAxisID_RightTrigger); controller->CreateAxisComponent(k_PSMAxisID_LeftJoystick_X); controller->CreateAxisComponent(k_PSMAxisID_LeftJoystick_Y); controller->CreateAxisComponent(k_PSMAxisID_RightJoystick_X); controller->CreateAxisComponent(k_PSMAxisID_RightJoystick_Y); // Create components for emulated trackpad controller->CreateButtonComponent(k_PSMButtonID_EmulatedTrackpadTouched); controller->CreateButtonComponent(k_PSMButtonID_EmulatedTrackpadPressed); controller->CreateAxisComponent(k_PSMAxisID_EmulatedTrackpad_X); controller->CreateAxisComponent(k_PSMAxisID_EmulatedTrackpad_Y); // Create haptic components controller->CreateHapticComponent(k_PSMHapticID_LeftRumble); controller->CreateHapticComponent(k_PSMHapticID_RightRumble); } } void PSDualshock4Controller::Deactivate() { Logger::Info("PSDualshock4Controller::Deactivate - Controller stream stopped\n"); PSM_StopControllerDataStreamAsync(m_PSMServiceController->ControllerID, nullptr); Controller::Deactivate(); } void PSDualshock4Controller::UpdateControllerState() { static const uint64_t s_kTouchpadButtonMask = vr::ButtonMaskFromId(vr::k_EButton_SteamVR_Touchpad); assert(m_PSMServiceController != nullptr); assert(m_PSMServiceController->IsConnected); const PSMDualShock4 &clientView = m_PSMServiceController->ControllerState.PSDS4State; const bool bStartRealignHMDTriggered = (clientView.ShareButton == PSMButtonState_PRESSED && clientView.OptionsButton == PSMButtonState_PRESSED) || (clientView.ShareButton == PSMButtonState_PRESSED && clientView.OptionsButton == PSMButtonState_DOWN) || (clientView.ShareButton == PSMButtonState_DOWN && clientView.OptionsButton == PSMButtonState_PRESSED); // See if the recenter button has been held for the requisite amount of time bool bRecenterRequestTriggered = false; { PSMButtonState resetPoseButtonState = clientView.OptionsButton; switch (resetPoseButtonState) { case PSMButtonState_PRESSED: { m_resetPoseButtonPressTime = std::chrono::high_resolution_clock::now(); } break; case PSMButtonState_DOWN: { if (!m_bResetPoseRequestSent) { const float k_hold_duration_milli = 250.f; std::chrono::time_point<std::chrono::high_resolution_clock> now = std::chrono::high_resolution_clock::now(); std::chrono::duration<float, std::milli> pressDurationMilli = now - m_resetPoseButtonPressTime; if (pressDurationMilli.count() >= k_hold_duration_milli) { bRecenterRequestTriggered = true; } } } break; case PSMButtonState_RELEASED: { m_bResetPoseRequestSent = false; } break; } } // If SHARE was just pressed while and OPTIONS was held or vice versa, // recenter the controller orientation pose and start the realignment of the controller to HMD tracking space. if (bStartRealignHMDTriggered && !getConfig()->disable_alignment_gesture) { Logger::Info("PSDualshock4Controller::UpdateControllerState(): Calling StartRealignHMDTrackingSpace() in response to controller chord.\n"); PSM_ResetControllerOrientationAsync(m_PSMServiceController->ControllerID, k_psm_quaternion_identity, nullptr); m_bResetPoseRequestSent = true; // We have the transform of the HMD in world space. // The controller's position is a few inches ahead of the HMD's on the HMD's local -Z axis. PSMVector3f controllerLocalOffsetFromHmdPosition = *k_psm_float_vector3_zero; controllerLocalOffsetFromHmdPosition = { 0.0f, 0.0f, -1.0f * getConfig()->calibration_offset_meters }; try { PSMPosef hmdPose = Utils::GetHMDPoseInMeters(); PSMPosef realignedPose = Utils::RealignHMDTrackingSpace(*k_psm_quaternion_identity, controllerLocalOffsetFromHmdPosition, m_PSMServiceController->ControllerID, hmdPose, getConfig()->use_orientation_in_hmd_alignment); CServerDriver_PSMoveService::getInstance()->SetHMDTrackingSpace(realignedPose); } catch (std::exception & e) { // Log an error message and safely carry on Logger::Error(e.what()); } m_bResetAlignRequestSent = true; } else if (bRecenterRequestTriggered) { Logger::Info("PSDualshock4Controller::UpdateControllerState(): Calling ClientPSMoveAPI::reset_orientation() in response to controller button press.\n"); PSM_ResetControllerOrientationAsync(m_PSMServiceController->ControllerID, k_psm_quaternion_identity, nullptr); m_bResetPoseRequestSent = true; } else { // System Button hard-coded to PS button Controller::UpdateButton(k_PSMButtonID_System, clientView.PSButton); // Process all the native buttons Controller::UpdateButton(k_PSMButtonID_PS, clientView.PSButton); Controller::UpdateButton(k_PSMButtonID_Triangle, clientView.TriangleButton); Controller::UpdateButton(k_PSMButtonID_Circle, clientView.CircleButton); Controller::UpdateButton(k_PSMButtonID_Cross, clientView.CrossButton); Controller::UpdateButton(k_PSMButtonID_Square, clientView.SquareButton); Controller::UpdateButton(k_PSMButtonID_DPad_Up, clientView.DPadUpButton); Controller::UpdateButton(k_PSMButtonID_DPad_Down, clientView.DPadDownButton); Controller::UpdateButton(k_PSMButtonID_DPad_Left, clientView.DPadLeftButton); Controller::UpdateButton(k_PSMButtonID_DPad_Right, clientView.DPadRightButton); Controller::UpdateButton(k_PSMButtonID_Options, clientView.OptionsButton); Controller::UpdateButton(k_PSMButtonID_Share, clientView.ShareButton); Controller::UpdateButton(k_PSMButtonID_Touchpad, clientView.TrackPadButton); Controller::UpdateButton(k_PSMButtonID_LeftJoystick, clientView.L3Button); Controller::UpdateButton(k_PSMButtonID_RightJoystick, clientView.R3Button); Controller::UpdateButton(k_PSMButtonID_LeftShoulder, clientView.L1Button); Controller::UpdateButton(k_PSMButtonID_RightShoulder, clientView.R1Button); // Thumbstick handling UpdateThumbsticks(); // Touchpad handling UpdateEmulatedTrackpad(); // Trigger handling Controller::UpdateAxis(k_PSMAxisID_LeftTrigger, clientView.LeftTriggerValue / 255.f); Controller::UpdateAxis(k_PSMAxisID_RightTrigger, clientView.RightTriggerValue / 255.f); } } void PSDualshock4Controller::RemapThumbstick( const float thumb_stick_x, const float thumb_stick_y, float &out_sanitized_x, float &out_sanitized_y) { const float thumb_stick_radius = sqrtf(thumb_stick_x*thumb_stick_x + thumb_stick_y * thumb_stick_y); // Moving a thumb-stick outside of the deadzone is consider a touchpad touch if (thumb_stick_radius >= getConfig()->thumbstick_deadzone) { // Rescale the thumb-stick position to hide the dead zone const float rescaledRadius = (thumb_stick_radius - getConfig()->thumbstick_deadzone) / (1.f - getConfig()->thumbstick_deadzone); // Set the thumb-stick axis out_sanitized_x = (rescaledRadius / thumb_stick_radius) * thumb_stick_x; out_sanitized_y = (rescaledRadius / thumb_stick_radius) * thumb_stick_y; } else { out_sanitized_x= 0.f; out_sanitized_y= 0.f; } } void PSDualshock4Controller::UpdateThumbsticks() { const PSMDualShock4 &clientView = m_PSMServiceController->ControllerState.PSDS4State; RemapThumbstick( clientView.LeftAnalogX, clientView.LeftAnalogY, m_lastSanitizedLeftThumbstick_X, m_lastSanitizedLeftThumbstick_Y); RemapThumbstick( clientView.RightAnalogX, clientView.RightAnalogY, m_lastSanitizedRightThumbstick_X, m_lastSanitizedRightThumbstick_Y); Controller::UpdateAxis(k_PSMAxisID_LeftJoystick_X, m_lastSanitizedLeftThumbstick_X); Controller::UpdateAxis(k_PSMAxisID_LeftJoystick_Y, m_lastSanitizedLeftThumbstick_Y); Controller::UpdateAxis(k_PSMAxisID_RightJoystick_X, m_lastSanitizedRightThumbstick_X); Controller::UpdateAxis(k_PSMAxisID_RightJoystick_Y, m_lastSanitizedRightThumbstick_Y); } // Updates the state of the controllers touchpad axis relative to its position over time and active state. void PSDualshock4Controller::UpdateEmulatedTrackpad() { // Bail if the config hasn't enabled the emulated trackpad if (!HasButton(k_PSMButtonID_EmulatedTrackpadPressed) && !HasButton(k_PSMButtonID_EmulatedTrackpadPressed)) return; // Find the highest priority emulated touch pad action (if any) eEmulatedTrackpadAction highestPriorityAction= k_EmulatedTrackpadAction_None; for (int buttonIndex = 0; buttonIndex < static_cast<int>(k_PSMButtonID_Count); ++buttonIndex) { eEmulatedTrackpadAction action= getConfig()->ps_button_id_to_emulated_touchpad_action[buttonIndex]; if (action != k_EmulatedTrackpadAction_None) { PSMButtonState button_state= PSMButtonState_UP; if (Controller::GetButtonState((ePSMButtonID)buttonIndex, button_state)) { if (button_state == PSMButtonState_DOWN || button_state == PSMButtonState_PRESSED) { if (action >= highestPriorityAction) { highestPriorityAction= action; } if (action >= k_EmulatedTrackpadAction_Press) { break; } } } } } float touchpad_x = 0.f; float touchpad_y = 0.f; PSMButtonState emulatedTouchPadTouchedState= PSMButtonState_UP; PSMButtonState emulatedTouchPadPressedState= PSMButtonState_UP; if (highestPriorityAction == k_EmulatedTrackpadAction_Touch) { emulatedTouchPadTouchedState= PSMButtonState_DOWN; } else if (highestPriorityAction == k_EmulatedTrackpadAction_Press) { emulatedTouchPadTouchedState= PSMButtonState_DOWN; emulatedTouchPadPressedState= PSMButtonState_DOWN; } if (highestPriorityAction > k_EmulatedTrackpadAction_Press) { emulatedTouchPadTouchedState= PSMButtonState_DOWN; emulatedTouchPadPressedState= PSMButtonState_DOWN; // If the action specifies a specific trackpad direction, // then use the given trackpad axis switch (highestPriorityAction) { case k_EmulatedTrackpadAction_Left: touchpad_x= -1.f; touchpad_y= 0.f; break; case k_EmulatedTrackpadAction_Up: touchpad_x= 0.f; touchpad_y= 1.f; break; case k_EmulatedTrackpadAction_Right: touchpad_x= 1.f; touchpad_y= 0.f; break; case k_EmulatedTrackpadAction_Down: touchpad_x= 0.f; touchpad_y= -1.f; break; case k_EmulatedTrackpadAction_UpLeft: touchpad_x = -0.707f; touchpad_y = 0.707f; break; case k_EmulatedTrackpadAction_UpRight: touchpad_x = 0.707f; touchpad_y = 0.707f; break; case k_EmulatedTrackpadAction_DownLeft: touchpad_x = -0.707f; touchpad_y = -0.707f; break; case k_EmulatedTrackpadAction_DownRight: touchpad_x = 0.707f; touchpad_y = -0.707f; break; } } else if (getConfig()->ps_button_id_to_emulated_touchpad_action[k_PSMButtonID_LeftJoystick] != k_EmulatedTrackpadAction_None) { // Consider the touchpad pressed if the left thumbstick is deflected at all. const bool bIsTouched= fabsf(m_lastSanitizedLeftThumbstick_X) + fabsf(m_lastSanitizedLeftThumbstick_Y) > 0.f; if (bIsTouched) { emulatedTouchPadTouchedState= PSMButtonState_DOWN; emulatedTouchPadPressedState= PSMButtonState_DOWN; touchpad_x= m_lastSanitizedLeftThumbstick_X; touchpad_y= m_lastSanitizedLeftThumbstick_Y; } } else if (getConfig()->ps_button_id_to_emulated_touchpad_action[k_PSMButtonID_RightJoystick] != k_EmulatedTrackpadAction_None) { // Consider the touchpad pressed if the right thumbstick is deflected at all. const bool bIsTouched= fabsf(m_lastSanitizedRightThumbstick_X) + fabsf(m_lastSanitizedRightThumbstick_Y) > 0.f; if (bIsTouched) { emulatedTouchPadTouchedState= PSMButtonState_DOWN; emulatedTouchPadPressedState= PSMButtonState_DOWN; touchpad_x= m_lastSanitizedRightThumbstick_X; touchpad_y= m_lastSanitizedRightThumbstick_Y; } } Controller::UpdateButton(k_PSMButtonID_EmulatedTrackpadTouched, emulatedTouchPadTouchedState); Controller::UpdateButton(k_PSMButtonID_EmulatedTrackpadPressed, emulatedTouchPadPressedState); Controller::UpdateAxis(k_PSMAxisID_EmulatedTrackpad_X, touchpad_x); Controller::UpdateAxis(k_PSMAxisID_EmulatedTrackpad_Y, touchpad_y); } void PSDualshock4Controller::UpdateTrackingState() { assert(m_PSMServiceController != nullptr); assert(m_PSMServiceController->IsConnected); const PSMDualShock4 &view = m_PSMServiceController->ControllerState.PSDS4State; // The tracking status will be one of the following states: m_Pose.result = m_trackingStatus; m_Pose.deviceIsConnected = m_PSMServiceController->IsConnected; // These should always be false from any modern driver. These are for Oculus DK1-like // rotation-only tracking. Support for that has likely rotted in vrserver. m_Pose.willDriftInYaw = false; m_Pose.shouldApplyHeadModel = false; // No prediction since that's already handled in the psmove service m_Pose.poseTimeOffset = -0.016f; // No transform due to the current HMD orientation m_Pose.qDriverFromHeadRotation.w = 1.f; m_Pose.qDriverFromHeadRotation.x = 0.0f; m_Pose.qDriverFromHeadRotation.y = 0.0f; m_Pose.qDriverFromHeadRotation.z = 0.0f; m_Pose.vecDriverFromHeadTranslation[0] = 0.f; m_Pose.vecDriverFromHeadTranslation[1] = 0.f; m_Pose.vecDriverFromHeadTranslation[2] = 0.f; // Set position { const PSMVector3f &position = view.Pose.Position; m_Pose.vecPosition[0] = position.x * k_fScalePSMoveAPIToMeters; m_Pose.vecPosition[1] = position.y * k_fScalePSMoveAPIToMeters; m_Pose.vecPosition[2] = position.z * k_fScalePSMoveAPIToMeters; } // virtual extend controllers if (getConfig()->extend_Y_meters != 0.0f || getConfig()->extend_Z_meters != 0.0f) { const PSMQuatf &orientation = view.Pose.Orientation; PSMVector3f shift = { (float)m_Pose.vecPosition[0], (float)m_Pose.vecPosition[1], (float)m_Pose.vecPosition[2] }; if (getConfig()->extend_Z_meters != 0.0f) { PSMVector3f local_forward = { 0, 0, -1 }; PSMVector3f global_forward = PSM_QuatfRotateVector(&orientation, &local_forward); shift = PSM_Vector3fScaleAndAdd(&global_forward, getConfig()->extend_Z_meters, &shift); } if (getConfig()->extend_Y_meters != 0.0f) { PSMVector3f local_forward = { 0, -1, 0 }; PSMVector3f global_forward = PSM_QuatfRotateVector(&orientation, &local_forward); shift = PSM_Vector3fScaleAndAdd(&global_forward, getConfig()->extend_Y_meters, &shift); } m_Pose.vecPosition[0] = shift.x; m_Pose.vecPosition[1] = shift.y; m_Pose.vecPosition[2] = shift.z; } // Set rotational coordinates { const PSMQuatf &orientation = view.Pose.Orientation; m_Pose.qRotation.w = getConfig()->z_rotate_90_degrees ? -orientation.w : orientation.w; m_Pose.qRotation.x = orientation.x; m_Pose.qRotation.y = orientation.y; m_Pose.qRotation.z = getConfig()->z_rotate_90_degrees ? -orientation.z : orientation.z; } // Set the physics state of the controller /*{ const PSMPhysicsData &physicsData = view.PhysicsData; m_Pose.vecVelocity[0] = physicsData.LinearVelocityCmPerSec.x * abs(pow(abs(physicsData.LinearVelocityCmPerSec.x), m_fLinearVelocityExponent)) * k_fScalePSMoveAPIToMeters * m_fLinearVelocityMultiplier; m_Pose.vecVelocity[1] = physicsData.LinearVelocityCmPerSec.y * abs(pow(abs(physicsData.LinearVelocityCmPerSec.y), m_fLinearVelocityExponent)) * k_fScalePSMoveAPIToMeters * m_fLinearVelocityMultiplier; m_Pose.vecVelocity[2] = physicsData.LinearVelocityCmPerSec.z * abs(pow(abs(physicsData.LinearVelocityCmPerSec.z), m_fLinearVelocityExponent)) * k_fScalePSMoveAPIToMeters * m_fLinearVelocityMultiplier; m_Pose.vecAcceleration[0] = physicsData.LinearAccelerationCmPerSecSqr.x * k_fScalePSMoveAPIToMeters; m_Pose.vecAcceleration[1] = physicsData.LinearAccelerationCmPerSecSqr.y * k_fScalePSMoveAPIToMeters; m_Pose.vecAcceleration[2] = physicsData.LinearAccelerationCmPerSecSqr.z * k_fScalePSMoveAPIToMeters; m_Pose.vecAngularVelocity[0] = physicsData.AngularVelocityRadPerSec.x; m_Pose.vecAngularVelocity[1] = physicsData.AngularVelocityRadPerSec.y; m_Pose.vecAngularVelocity[2] = physicsData.AngularVelocityRadPerSec.z; m_Pose.vecAngularAcceleration[0] = physicsData.AngularAccelerationRadPerSecSqr.x; m_Pose.vecAngularAcceleration[1] = physicsData.AngularAccelerationRadPerSecSqr.y; m_Pose.vecAngularAcceleration[2] = physicsData.AngularAccelerationRadPerSecSqr.z; }*/ m_Pose.poseIsValid = view.bIsPositionValid && view.bIsOrientationValid; // This call posts this pose to shared memory, where all clients will have access to it the next // moment they want to predict a pose. vr::VRServerDriverHost()->TrackedDevicePoseUpdated(m_unSteamVRTrackedDeviceId, m_Pose, sizeof(vr::DriverPose_t)); } // TODO - Make use of amplitude and frequency for Buffered Haptics, will give us patterning and panning vibration // See: https://developer.oculus.com/documentation/pcsdk/latest/concepts/dg-input-touch-haptic/ void PSDualshock4Controller::UpdateRumbleState(PSMControllerRumbleChannel channel) { Controller::HapticState *haptic_state= GetHapticState( channel == PSMControllerRumbleChannel_Left ? k_PSMHapticID_LeftRumble : k_PSMHapticID_RightRumble); if (haptic_state == nullptr) return; if (!getConfig()->rumble_suppressed) { // pulse duration - the length of each pulse // amplitude - strength of vibration // frequency - speed of each pulse // convert to microseconds, the max duration received from OpenVR appears to be 5 micro seconds uint16_t pendingHapticPulseDurationMicroSecs = static_cast<uint16_t>(haptic_state->pendingHapticDurationSecs * 1000000); const float k_max_rumble_update_rate = 33.f; // Don't bother trying to update the rumble faster than 30fps (33ms) const float k_max_pulse_microseconds = 5000.f; // Docs suggest max pulse duration of 5ms, but we'll call 1ms max std::chrono::time_point<std::chrono::high_resolution_clock> now = std::chrono::high_resolution_clock::now(); bool bTimoutElapsed = true; if (haptic_state->lastTimeRumbleSentValid) { std::chrono::duration<double, std::milli> timeSinceLastSend = now - haptic_state->lastTimeRumbleSent; bTimoutElapsed = timeSinceLastSend.count() >= k_max_rumble_update_rate; } // See if a rumble request hasn't come too recently if (bTimoutElapsed) { float rumble_fraction = (static_cast<float>(pendingHapticPulseDurationMicroSecs) / k_max_pulse_microseconds) * haptic_state->pendingHapticAmplitude; if (rumble_fraction > 0) { steamvrbridge::Logger::Debug( "PSDualshock4Controller::UpdateRumble: m_pendingHapticPulseDurationSecs=%f, pendingHapticPulseDurationMicroSecs=%d, rumble_fraction=%f\n", haptic_state->pendingHapticDurationSecs, pendingHapticPulseDurationMicroSecs, rumble_fraction); } // Unless a zero rumble intensity was explicitly set, // don't rumble less than 35% (no enough to feel) if (haptic_state->pendingHapticDurationSecs != 0) { if (rumble_fraction < 0.35f) { // rumble values less 35% isn't noticeable rumble_fraction = 0.35f; } } // Keep the pulse intensity within reasonable bounds if (rumble_fraction > 1.f) { rumble_fraction = 1.f; } // Actually send the rumble to the server PSM_SetControllerRumble(m_PSMServiceController->ControllerID, channel, rumble_fraction); // Remember the last rumble we went and when we sent it haptic_state->lastTimeRumbleSent = now; haptic_state->lastTimeRumbleSentValid = true; // Reset the pending haptic pulse duration. // If another call to TriggerHapticPulse() is made later, it will stomp this value. // If no future haptic event is received by ServerDriver then the next call to UpdateRumbleState() // in k_max_rumble_update_rate milliseconds will set the rumble_fraction to 0.f // This effectively makes the shortest rumble pulse k_max_rumble_update_rate milliseconds. haptic_state->pendingHapticDurationSecs = DEFAULT_HAPTIC_DURATION; haptic_state->pendingHapticAmplitude = DEFAULT_HAPTIC_AMPLITUDE; haptic_state->pendingHapticFrequency = DEFAULT_HAPTIC_FREQUENCY; } } else { // Reset the pending haptic pulse duration since rumble is suppressed. haptic_state->pendingHapticDurationSecs = DEFAULT_HAPTIC_DURATION; haptic_state->pendingHapticAmplitude = DEFAULT_HAPTIC_AMPLITUDE; haptic_state->pendingHapticFrequency = DEFAULT_HAPTIC_FREQUENCY; } } void PSDualshock4Controller::Update() { Controller::Update(); if (IsActivated() && m_PSMServiceController->IsConnected) { int seq_num = m_PSMServiceController->OutputSequenceNum; // Only other updating incoming state if it actually changed and is due for one if (m_nPoseSequenceNumber < seq_num) { m_nPoseSequenceNumber = seq_num; UpdateTrackingState(); UpdateControllerState(); } // Update the outgoing state UpdateRumbleState(PSMControllerRumbleChannel_Left); UpdateRumbleState(PSMControllerRumbleChannel_Right); } } void PSDualshock4Controller::RefreshWorldFromDriverPose() { TrackableDevice::RefreshWorldFromDriverPose(); // Mark the calibration process as done once we have setup the world from driver pose m_trackingStatus = vr::TrackingResult_Running_OK; } }
43.772118
155
0.784866