polygons union using boost - c++

I'm using boost::geometry::union_ to merge a vector of random polygons, and here what I wrote:
#include <iostream>
#include <vector>
#include <fstream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/io/wkt/wkt.hpp>
#include <boost/foreach.hpp>
typedef boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double> > polygon;
void union_polys(std::vector<polygon> In_polys,std::vector<polygon> &Out_polys)
{
std::vector<polygon> temp_polys;
bool *considered = new bool [In_polys.size()];
for(unsigned i = 0 ; i < In_polys.size() ; i++) considered[i] = false;
for(unsigned i = 0 ; i < In_polys.size()/2; i++)
{
if(!considered[i])
{
polygon inetr = In_polys.at(i);
for(unsigned j = i + 1 ; j < In_polys.size() ; j++)
{
if(!considered[j])
{
temp_polys.clear();
boost::geometry::union_(inetr, In_polys.at(j) , temp_polys);
if(temp_polys.size() == 1)
{
inetr = temp_polys.at(0);
considered[j] = true;
j = i;
}
}
}
Out_polys.push_back(inetr);
}
}
}
int main()
{
std::ifstream file("test01.txt");
polygon *poly;
std::vector<polygon> input;
while(!file.eof())
{
poly = new polygon;
std::string poly_str;
std::getline(file, poly_str);
boost::geometry::read_wkt(poly_str, *poly);
boost::geometry::correct(*poly);
input.push_back(*poly);
}
std::cout << " input size is : " << input.size() << std::endl;
std::vector<polygon> output;
union_polys(input, output);
std::cout << " output size is : " << output.size() << std::endl;
int i = 0;
std::cout << "green || blue:" << std::endl;
BOOST_FOREACH(polygon const& p, output)
{
std::cout << i++ << ": " << boost::geometry::area(p) << std::endl;
}
system("pause");
return 0;
}
I tested this function union_polys with two different polygon sets:
test 01
test 02
It works for the first test but it fails for the second, I searched but I can't spot the mistake, can any one helps ?

The problem is your second file contains a self-intersecting polygon. This is not allowed.
You can enable debugging by defining
#define BOOST_GEOMETRY_DEBUG_HAS_SELF_INTERSECTIONS
before inclusion of the Boost Geometry headers.
The documentation says: http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/reference/concepts/concept_polygon.html#geometry.reference.concepts.concept_polygon.rules
Rules
Besides the Concepts, which are checks on compile-time, there are some other rules that valid polygons must fulfill. This follows the opengeospatial rules (see link above).
Polygons are simple geometric objects (See also wiki but holes are allowed in Boost.Geometry polygons).
If the polygons underlying ring_type is defined as clockwise, the exterior ring must have the clockwise orientation, and any interior ring must be reversed w.r.t. the defined orientation (so: counter clockwise for clockwise exterior rings). If the ring_type is defined counter clockwise, it is vice versa.
If the polygons underlying ring_type is defined as closed, all rings must be closed: the first point must be spatially equal to the last point.
The interior is a connected point set.
There should be no self intersections, but self tangencies (between exterior/interior rings) are allowed (as long as the interior is a connected point set.
There should be no cut lines, spikes or punctures.
The interior rings should be located within the exterior ring. Interior rings may not be located within each other.
The algorithms such as intersection, area, centroid, union, etc. do not check validity. There will be an algorithm is_valid which checks for validity against these rules, at runtime, and which can be called (by the library user) before.
So currently, the self-intersection is only available in the implementation details of the library
If you don't mind using these you can e.g. use the following to weed out the offending polygons:
std::string poly_str;
while(std::getline(file, poly_str))
{
polygon poly;
boost::geometry::read_wkt(poly_str, poly);
boost::geometry::correct(poly);
try
{
bool ignored = boost::geometry::detail::overlay::has_self_intersections(poly);
// redundant:
if (ignored)
throw boost::geometry::overlay_invalid_input_exception();
input.push_back(std::move(poly));
} catch(boost::geometry::overlay_invalid_input_exception const& e)
{
std::cerr << "Self intersecing polygon ignored: " << boost::geometry::dsv(poly) << "\n";
}
}
(Note the removal of memory leaks from your code and the fixed loop condition)
Self intersecing polygon ignored: (((449719, 4.04975e+06), (449720, 4.04976e+06), (449721, 4.04976e+06), (449727, 4.04976e+06), (449734, 4.04976e+06), (449736, 4.04976e+06), (449739, 4.04975e+06), (449742, 4.04975e+06), (449744, 4.04975e+06), (449745, 4.04974e+06), (449744, 4.04973e+06), (449741, 4.04973e+06), (449737, 4.04973e+06), (449734, 4.04973e+06), (449728, 4.04972e+06), (449725, 4.04972e+06), (449721, 4.04973e+06), (449716, 4.04973e+06), (449712, 4.04973e+06), (449711, 4.04974e+06), (449710, 4.04974e+06), (449711, 4.04975e+06), (449714, 4.04975e+06), (449718, 4.04976e+06), (449721, 4.04975e+06), (449721, 4.04975e+06), (449719, 4.04975e+06), (449718, 4.04974e+06), (449719, 4.04974e+06), (449719, 4.04974e+06), (449721, 4.04974e+06), (449724, 4.04973e+06), (449726, 4.04973e+06), (449728, 4.04973e+06), (449731, 4.04973e+06), (449733, 4.04973e+06), (449734, 4.04974e+06), (449736, 4.04974e+06), (449737, 4.04974e+06), (449736, 4.04975e+06), (449735, 4.04975e+06), (449734, 4.04975e+06), (449732, 4.04975e+06), (449731, 4.04975e+06), (449727, 4.04975e+06), (449724, 4.04975e+06), (449719, 4.04975e+06)))
Self intersecing polygon ignored: (((451355, 4.04939e+06), (451363, 4.0494e+06), (451365, 4.0494e+06), (451368, 4.0494e+06), (451369, 4.04939e+06), (451370, 4.04939e+06), (451368, 4.04938e+06), (451366, 4.04938e+06), (451362, 4.04938e+06), (451359, 4.04938e+06), (451355, 4.04938e+06), (451351, 4.04938e+06), (451347, 4.04938e+06), (451345, 4.04939e+06), (451345, 4.04939e+06), (451346, 4.04939e+06), (451348, 4.0494e+06), (451351, 4.0494e+06), (451355, 4.0494e+06), (451362, 4.0494e+06), (451356, 4.04939e+06), (451357, 4.04939e+06), (451355, 4.04939e+06), (451354, 4.04939e+06), (451354, 4.04939e+06), (451353, 4.04939e+06), (451353, 4.04939e+06), (451354, 4.04939e+06), (451355, 4.04939e+06), (451356, 4.04938e+06), (451358, 4.04938e+06), (451359, 4.04938e+06), (451360, 4.04939e+06), (451361, 4.04939e+06), (451361, 4.04939e+06), (451361, 4.04939e+06), (451361, 4.04939e+06), (451360, 4.04939e+06), (451355, 4.04939e+06)))
Self intersecing polygon ignored: (((451353, 4.04937e+06), (451361, 4.04938e+06), (451360, 4.04938e+06), (451380, 4.04937e+06), (451403, 4.04936e+06), (451427, 4.04936e+06), (451442, 4.04935e+06), (451466, 4.04934e+06), (451489, 4.04933e+06), (451508, 4.04932e+06), (451517, 4.04933e+06), (451518, 4.04933e+06), (451524, 4.04936e+06), (451526, 4.04937e+06), (451534, 4.04939e+06), (451541, 4.04942e+06), (451542, 4.04942e+06), (451557, 4.04944e+06), (451558, 4.04944e+06), (451577, 4.04946e+06), (451579, 4.04946e+06), (451601, 4.04947e+06), (451620, 4.04948e+06), (451630, 4.04949e+06), (451635, 4.0495e+06), (451640, 4.04952e+06), (451645, 4.04955e+06), (451646, 4.04955e+06), (451649, 4.04956e+06), (451654, 4.04959e+06), (451655, 4.04959e+06), (451660, 4.04962e+06), (451664, 4.04964e+06), (451669, 4.04966e+06), (451674, 4.04969e+06), (451675, 4.04969e+06), (451680, 4.04972e+06), (451686, 4.04974e+06), (451688, 4.04975e+06), (451696, 4.04977e+06), (451701, 4.04976e+06), (451696, 4.04975e+06), (451694, 4.04974e+06), (451689, 4.04972e+06), (451683, 4.04969e+06), (451682, 4.04969e+06), (451677, 4.04966e+06), (451673, 4.04964e+06), (451668, 4.04961e+06), (451663, 4.04959e+06), (451661, 4.04958e+06), (451655, 4.04955e+06), (451653, 4.04954e+06), (451653, 4.04954e+06), (451648, 4.04952e+06), (451642, 4.04949e+06), (451636, 4.04948e+06), (451624, 4.04947e+06), (451606, 4.04946e+06), (451584, 4.04945e+06), (451583, 4.04945e+06), (451564, 4.04944e+06), (451550, 4.04942e+06), (451549, 4.04941e+06), (451542, 4.04939e+06), (451535, 4.04937e+06), (451531, 4.04935e+06), (451526, 4.04933e+06), (451521, 4.04932e+06), (451509, 4.04931e+06), (451486, 4.04932e+06), (451463, 4.04933e+06), (451440, 4.04934e+06), (451424, 4.04935e+06), (451400, 4.04936e+06), (451377, 4.04936e+06), (451357, 4.04937e+06), (451353, 4.04937e+06)))
Self intersecing polygon ignored: (((451703, 4.04978e+06), (451693, 4.04978e+06), (451693, 4.04978e+06), (451691, 4.04978e+06), (451688, 4.04978e+06), (451686, 4.04978e+06), (451683, 4.04978e+06), (451681, 4.04978e+06), (451679, 4.04977e+06), (451678, 4.04977e+06), (451679, 4.04977e+06), (451680, 4.04977e+06), (451682, 4.04976e+06), (451685, 4.04976e+06), (451688, 4.04976e+06), (451691, 4.04976e+06), (451693, 4.04976e+06), (451694, 4.04977e+06), (451695, 4.04977e+06), (451693, 4.04978e+06), (451703, 4.04977e+06), (451704, 4.04977e+06), (451702, 4.04976e+06), (451699, 4.04976e+06), (451695, 4.04976e+06), (451689, 4.04975e+06), (451683, 4.04975e+06), (451678, 4.04976e+06), (451673, 4.04976e+06), (451670, 4.04977e+06), (451670, 4.04977e+06), (451672, 4.04978e+06), (451674, 4.04978e+06), (451679, 4.04979e+06), (451685, 4.04979e+06), (451690, 4.04979e+06), (451696, 4.04978e+06), (451700, 4.04978e+06), (451703, 4.04978e+06)))
Self intersecing polygon ignored: (((452873, 4.05001e+06), (452866, 4.05e+06), (452863, 4.05e+06), (452854, 4.04999e+06), (452841, 4.04998e+06), (452818, 4.04997e+06), (452817, 4.04997e+06), (452793, 4.04997e+06), (452783, 4.04997e+06), (452773, 4.04997e+06), (452750, 4.04998e+06), (452741, 4.04999e+06), (452737, 4.04999e+06), (452731, 4.04999e+06), (452719, 4.04998e+06), (452699, 4.04997e+06), (452685, 4.04997e+06), (452680, 4.04997e+06), (452680, 4.04997e+06), (452679, 4.04997e+06), (452679, 4.04996e+06), (452677, 4.04995e+06), (452678, 4.04995e+06), (452687, 4.04994e+06), (452697, 4.04994e+06), (452705, 4.04993e+06), (452713, 4.04992e+06), (452729, 4.04992e+06), (452747, 4.04992e+06), (452762, 4.04991e+06), (452772, 4.04991e+06), (452779, 4.04991e+06), (452770, 4.0499e+06), (452768, 4.0499e+06), (452759, 4.04991e+06), (452746, 4.04991e+06), (452728, 4.04991e+06), (452708, 4.04991e+06), (452699, 4.04992e+06), (452692, 4.04993e+06), (452683, 4.04994e+06), (452674, 4.04994e+06), (452668, 4.04994e+06), (452671, 4.04996e+06), (452670, 4.04997e+06), (452672, 4.04997e+06), (452674, 4.04998e+06), (452684, 4.04998e+06), (452698, 4.04998e+06), (452716, 4.04999e+06), (452729, 4.04999e+06), (452737, 4.05e+06), (452745, 4.04999e+06), (452753, 4.04999e+06), (452753, 4.04999e+06), (452776, 4.04998e+06), (452786, 4.04998e+06), (452793, 4.04998e+06), (452815, 4.04998e+06), (452837, 4.04999e+06), (452848, 4.05e+06), (452861, 4.05001e+06), (452873, 4.05001e+06)))
Self intersecing polygon ignored: (((452726, 4.04987e+06), (452733, 4.04986e+06), (452731, 4.04985e+06), (452730, 4.04985e+06), (452722, 4.04985e+06), (452722, 4.04985e+06), (452726, 4.04987e+06)))
Self intersecing polygon ignored: (((440107, 4.04713e+06), (440102, 4.04714e+06), (440112, 4.04717e+06), (440122, 4.04719e+06), (440132, 4.04721e+06), (440134, 4.04722e+06), (440143, 4.04724e+06), (440153, 4.04726e+06), (440163, 4.04728e+06), (440173, 4.04731e+06), (440183, 4.04733e+06), (440186, 4.04734e+06), (440196, 4.04736e+06), (440206, 4.04738e+06), (440215, 4.04741e+06), (440225, 4.04743e+06), (440227, 4.04744e+06), (440238, 4.04746e+06), (440247, 4.04748e+06), (440255, 4.0475e+06), (440259, 4.04752e+06), (440262, 4.04753e+06), (440267, 4.04754e+06), (440273, 4.04755e+06), (440289, 4.04756e+06), (440311, 4.04757e+06), (440325, 4.04758e+06), (440342, 4.04758e+06), (440346, 4.04759e+06), (440362, 4.0476e+06), (440363, 4.04761e+06), (440374, 4.04762e+06), (440388, 4.04763e+06), (440391, 4.04764e+06), (440392, 4.04765e+06), (440390, 4.04765e+06), (440382, 4.04768e+06), (440381, 4.04768e+06), (440378, 4.04769e+06), (440377, 4.04769e+06), (440376, 4.04769e+06), (440376, 4.04769e+06), (440375, 4.04767e+06), (440372, 4.04767e+06), (440368, 4.04766e+06), (440363, 4.04766e+06), (440356, 4.04766e+06), (440331, 4.04765e+06), (440319, 4.04765e+06), (440304, 4.04765e+06), (440288, 4.04765e+06), (440263, 4.04765e+06), (440253, 4.04765e+06), (440244, 4.04766e+06), (440238, 4.04767e+06), (440237, 4.04768e+06), (440238, 4.04768e+06), (440245, 4.04769e+06), (440258, 4.0477e+06), (440265, 4.04771e+06), (440270, 4.04772e+06), (440272, 4.04772e+06), (440271, 4.04774e+06), (440266, 4.04776e+06), (440266, 4.04777e+06), (440271, 4.04779e+06), (440276, 4.04781e+06), (440278, 4.04782e+06), (440277, 4.04783e+06), (440273, 4.04783e+06), (440266, 4.04784e+06), (440254, 4.04784e+06), (440237, 4.04785e+06), (440217, 4.04786e+06), (440214, 4.04786e+06), (440194, 4.04788e+06), (440191, 4.04788e+06), (440178, 4.0479e+06), (440170, 4.04791e+06), (440164, 4.04792e+06), (440158, 4.04794e+06), (440154, 4.04795e+06), (440147, 4.04795e+06), (440127, 4.04796e+06), (440106, 4.04796e+06), (440082, 4.04797e+06), (440079, 4.04797e+06), (440069, 4.04798e+06), (440061, 4.04798e+06), (440051, 4.04798e+06), (440028, 4.04797e+06), (440018, 4.04797e+06), (440006, 4.04797e+06), (439997, 4.04798e+06), (439986, 4.04798e+06), (439975, 4.04799e+06), (439964, 4.04801e+06), (439952, 4.04803e+06), (439950, 4.04804e+06), (439937, 4.04806e+06), (439931, 4.04807e+06), (439918, 4.04809e+06), (439905, 4.04811e+06), (439902, 4.04812e+06), (439892, 4.04814e+06), (439891, 4.04815e+06), (439893, 4.04816e+06), (439906, 4.04818e+06), (439917, 4.0482e+06), (439930, 4.04822e+06), (439930, 4.04822e+06), (439939, 4.04823e+06), (439953, 4.04824e+06), (439967, 4.04825e+06), (439970, 4.04825e+06), (439972, 4.04826e+06), (439971, 4.04826e+06), (439967, 4.04826e+06), (439951, 4.04827e+06), (439932, 4.04828e+06), (439913, 4.0483e+06), (439893, 4.04831e+06), (439874, 4.04833e+06), (439854, 4.04835e+06), (439845, 4.04835e+06), (439831, 4.04836e+06), (439818, 4.04837e+06), (439813, 4.04838e+06), (439816, 4.04839e+06), (439825, 4.04839e+06), (439835, 4.04839e+06), (439859, 4.04838e+06), (439884, 4.04838e+06), (439889, 4.04838e+06), (439914, 4.04837e+06), (439935, 4.04837e+06), (439959, 4.04836e+06), (439984, 4.04836e+06), (440009, 4.04836e+06), (440034, 4.04835e+06), (440058, 4.04835e+06), (440083, 4.04835e+06), (440108, 4.04834e+06), (440118, 4.04834e+06), (440143, 4.04834e+06), (440152, 4.04834e+06), (440166, 4.04834e+06), (440179, 4.04834e+06), (440200, 4.04835e+06), (440216, 4.04836e+06), (440230, 4.04837e+06), (440240, 4.04838e+06), (440251, 4.04839e+06), (440265, 4.04841e+06), (440265, 4.04841e+06), (440277, 4.04844e+06), (440283, 4.04845e+06), (440294, 4.04847e+06), (440301, 4.04849e+06), (440310, 4.04851e+06), (440319, 4.04853e+06), (440323, 4.04855e+06), (440324, 4.04856e+06), (440323, 4.04858e+06), (440319, 4.04861e+06), (440316, 4.04863e+06), (440310, 4.04865e+06), (440304, 4.04867e+06), (440303, 4.04868e+06), (440296, 4.04871e+06), (440294, 4.04871e+06), (440287, 4.04873e+06), (440281, 4.04874e+06), (440270, 4.04875e+06), (440254, 4.04877e+06), (440254, 4.04877e+06), (440241, 4.04879e+06), (440240, 4.0488e+06), (440235, 4.04881e+06), (440230, 4.04882e+06), (440226, 4.04885e+06), (440225, 4.04885e+06), (440217, 4.04887e+06), (440217, 4.04887e+06), (440206, 4.04889e+06), (440192, 4.04891e+06), (440186, 4.04892e+06), (440172, 4.04894e+06), (440157, 4.04896e+06), (440143, 4.04898e+06), (440136, 4.04899e+06), (440119, 4.04901e+06), (440103, 4.04903e+06), (440087, 4.04905e+06), (440071, 4.04907e+06), (440064, 4.04908e+06), (440047, 4.0491e+06), (440044, 4.0491e+06), (440054, 4.0491e+06), (440070, 4.04908e+06), (440077, 4.04907e+06), (440093, 4.04905e+06), (440110, 4.04904e+06), (440126, 4.04902e+06), (440142, 4.049e+06), (440149, 4.04899e+06), (440164, 4.04897e+06), (440178, 4.04895e+06), (440193, 4.04893e+06), (440199, 4.04892e+06), (440213, 4.0489e+06), (440224, 4.04888e+06), (440225, 4.04888e+06), (440233, 4.04885e+06), (440234, 4.04885e+06), (440238, 4.04883e+06), (440243, 4.04881e+06), (440247, 4.0488e+06), (440260, 4.04878e+06), (440276, 4.04876e+06), (440288, 4.04874e+06), (440294, 4.04873e+06), (440301, 4.04871e+06), (440304, 4.04871e+06), (440311, 4.04868e+06), (440312, 4.04868e+06), (440318, 4.04865e+06), (440324, 4.04863e+06), (440327, 4.04861e+06), (440331, 4.04858e+06), (440332, 4.04856e+06), (440332, 4.04855e+06), (440327, 4.04853e+06), (440327, 4.04853e+06), (440318, 4.0485e+06), (440309, 4.04848e+06), (440301, 4.04847e+06), (440291, 4.04844e+06), (440284, 4.04843e+06), (440272, 4.04841e+06), (440271, 4.04841e+06), (440257, 4.04839e+06), (440246, 4.04837e+06), (440236, 4.04836e+06), (440221, 4.04835e+06), (440203, 4.04834e+06), (440182, 4.04833e+06), (440168, 4.04833e+06), (440152, 4.04833e+06), (440140, 4.04833e+06), (440116, 4.04833e+06), (440107, 4.04834e+06), (440082, 4.04834e+06), (440057, 4.04834e+06), (440032, 4.04835e+06), (440007, 4.04835e+06), (439983, 4.04835e+06), (439958, 4.04836e+06), (439933, 4.04836e+06), (439912, 4.04836e+06), (439887, 4.04837e+06), (439883, 4.04837e+06), (439859, 4.04838e+06), (439834, 4.04838e+06), (439826, 4.04838e+06), (439823, 4.04838e+06), (439822, 4.04838e+06), (439825, 4.04837e+06), (439835, 4.04837e+06), (439849, 4.04836e+06), (439859, 4.04835e+06), (439879, 4.04834e+06), (439898, 4.04832e+06), (439918, 4.0483e+06), (439937, 4.04829e+06), (439955, 4.04828e+06), (439970, 4.04827e+06), (439978, 4.04827e+06), (439980, 4.04826e+06), (439978, 4.04825e+06), (439971, 4.04824e+06), (439957, 4.04823e+06), (439945, 4.04823e+06), (439937, 4.04822e+06), (439937, 4.04822e+06), (439924, 4.04819e+06), (439913, 4.04818e+06), (439901, 4.04816e+06), (439900, 4.04815e+06), (439900, 4.04814e+06), (439909, 4.04812e+06), (439912, 4.04812e+06), (439925, 4.04809e+06), (439939, 4.04807e+06), (439944, 4.04806e+06), (439957, 4.04804e+06), (439958, 4.04804e+06), (439970, 4.04802e+06), (439982, 4.048e+06), (439990, 4.04799e+06), (439999, 4.04798e+06), (440007, 4.04798e+06), (440018, 4.04798e+06), (440027, 4.04798e+06), (440050, 4.04798e+06), (440062, 4.04798e+06), (440071, 4.04798e+06), (440082, 4.04798e+06), (440085, 4.04798e+06), (440108, 4.04797e+06), (440129, 4.04796e+06), (440149, 4.04796e+06), (440159, 4.04796e+06), (440166, 4.04795e+06), (440172, 4.04793e+06), (440178, 4.04791e+06), (440184, 4.0479e+06), (440196, 4.04789e+06), (440199, 4.04789e+06), (440219, 4.04787e+06), (440221, 4.04787e+06), (440241, 4.04785e+06), (440256, 4.04785e+06), (440270, 4.04784e+06), (440279, 4.04784e+06), (440285, 4.04783e+06), (440286, 4.04782e+06), (440284, 4.04781e+06), (440279, 4.04778e+06), (440275, 4.04777e+06), (440275, 4.04776e+06), (440279, 4.04774e+06), (440280, 4.04772e+06), (440278, 4.04771e+06), (440272, 4.0477e+06), (440264, 4.04769e+06), (440250, 4.04768e+06), (440246, 4.04768e+06), (440245, 4.04768e+06), (440246, 4.04767e+06), (440250, 4.04767e+06), (440256, 4.04766e+06), (440264, 4.04766e+06), (440289, 4.04766e+06), (440304, 4.04766e+06), (440318, 4.04766e+06), (440329, 4.04766e+06), (440354, 4.04766e+06), (440359, 4.04767e+06), (440362, 4.04767e+06), (440365, 4.04767e+06), (440367, 4.04768e+06), (440368, 4.04769e+06), (440370, 4.04769e+06), (440376, 4.04769e+06), (440382, 4.04769e+06), (440388, 4.04769e+06), (440390, 4.04768e+06), (440398, 4.04766e+06), (440400, 4.04765e+06), (440399, 4.04764e+06), (440395, 4.04762e+06), (440380, 4.04761e+06), (440369, 4.0476e+06), (440368, 4.0476e+06), (440352, 4.04758e+06), (440345, 4.04757e+06), (440328, 4.04757e+06), (440315, 4.04756e+06), (440294, 4.04755e+06), (440278, 4.04754e+06), (440274, 4.04754e+06), (440270, 4.04753e+06), (440267, 4.04751e+06), (440263, 4.0475e+06), (440255, 4.04748e+06), (440246, 4.04746e+06), (440235, 4.04743e+06), (440232, 4.04743e+06), (440223, 4.0474e+06), (440213, 4.04738e+06), (440204, 4.04736e+06), (440194, 4.04733e+06), (440189, 4.04732e+06), (440179, 4.0473e+06), (440169, 4.04728e+06), (440159, 4.04725e+06), (440149, 4.04723e+06), (440139, 4.04721e+06), (440137, 4.0472e+06), (440127, 4.04718e+06), (440117, 4.04716e+06), (440107, 4.04713e+06)))
Self intersecing polygon ignored: (((440604, 4.04772e+06), (440595, 4.04772e+06), (440593, 4.04772e+06), (440593, 4.04773e+06), (440597, 4.04773e+06), (440601, 4.04774e+06), (440608, 4.04775e+06), (440618, 4.04776e+06), (440628, 4.04776e+06), (440638, 4.04776e+06), (440650, 4.04776e+06), (440642, 4.04775e+06), (440637, 4.04775e+06), (440630, 4.04775e+06), (440623, 4.04775e+06), (440615, 4.04774e+06), (440608, 4.04773e+06), (440603, 4.04773e+06), (440601, 4.04772e+06), (440601, 4.04772e+06), (440604, 4.04772e+06)))
Self intersecing polygon ignored: (((448423, 4.04808e+06), (448424, 4.04809e+06), (448446, 4.0481e+06), (448458, 4.04811e+06), (448479, 4.04812e+06), (448485, 4.04812e+06), (448504, 4.04814e+06), (448510, 4.04815e+06), (448525, 4.04817e+06), (448533, 4.04818e+06), (448546, 4.0482e+06), (448559, 4.04822e+06), (448572, 4.04824e+06), (448578, 4.04825e+06), (448582, 4.04822e+06), (448584, 4.04821e+06), (448595, 4.04819e+06), (448598, 4.04819e+06), (448613, 4.04817e+06), (448623, 4.04815e+06), (448643, 4.04814e+06), (448664, 4.04812e+06), (448671, 4.04812e+06), (448692, 4.0481e+06), (448712, 4.04809e+06), (448734, 4.04808e+06), (448756, 4.04807e+06), (448778, 4.04806e+06), (448800, 4.04804e+06), (448807, 4.04804e+06), (448798, 4.04804e+06), (448796, 4.04804e+06), (448774, 4.04805e+06), (448752, 4.04806e+06), (448730, 4.04807e+06), (448708, 4.04808e+06), (448687, 4.0481e+06), (448666, 4.04811e+06), (448658, 4.04812e+06), (448637, 4.04813e+06), (448617, 4.04815e+06), (448605, 4.04816e+06), (448591, 4.04818e+06), (448587, 4.04819e+06), (448576, 4.04821e+06), (448573, 4.04823e+06), (448568, 4.04825e+06), (448565, 4.04824e+06), (448557, 4.04822e+06), (448548, 4.04819e+06), (448540, 4.04817e+06), (448531, 4.04816e+06), (448516, 4.04814e+06), (448509, 4.04813e+06), (448490, 4.04812e+06), (448483, 4.04811e+06), (448462, 4.0481e+06), (448445, 4.04809e+06), (448423, 4.04808e+06)))
Self intersecing polygon ignored: (((448741, 4.04925e+06), (448751, 4.04925e+06), (448753, 4.04924e+06), (448755, 4.04923e+06), (448752, 4.04922e+06), (448747, 4.04922e+06), (448739, 4.04921e+06), (448729, 4.04921e+06), (448722, 4.04922e+06), (448715, 4.04922e+06), (448710, 4.04923e+06), (448708, 4.04924e+06), (448711, 4.04924e+06), (448716, 4.04925e+06), (448724, 4.04926e+06), (448733, 4.04926e+06), (448742, 4.04926e+06), (448750, 4.04925e+06), (448741, 4.04925e+06), (448738, 4.04925e+06), (448732, 4.04925e+06), (448727, 4.04925e+06), (448722, 4.04925e+06), (448718, 4.04924e+06), (448717, 4.04924e+06), (448718, 4.04923e+06), (448720, 4.04923e+06), (448726, 4.04923e+06), (448732, 4.04922e+06), (448736, 4.04922e+06), (448741, 4.04922e+06), (448745, 4.04923e+06), (448746, 4.04923e+06), (448745, 4.04924e+06), (448741, 4.04925e+06)))
Self intersecing polygon ignored: (((451354, 4.04907e+06), (451363, 4.04908e+06), (451384, 4.04907e+06), (451406, 4.04905e+06), (451427, 4.04904e+06), (451427, 4.04904e+06), (451432, 4.04902e+06), (451420, 4.04901e+06), (451403, 4.04903e+06), (451386, 4.04904e+06), (451385, 4.04905e+06), (451364, 4.04906e+06), (451362, 4.04906e+06), (451340, 4.04907e+06), (451325, 4.04909e+06), (451320, 4.0491e+06), (451305, 4.04912e+06), (451289, 4.04914e+06), (451288, 4.04914e+06), (451288, 4.04915e+06), (451287, 4.04916e+06), (451288, 4.04917e+06), (451296, 4.04917e+06), (451295, 4.04916e+06), (451296, 4.04914e+06), (451297, 4.04914e+06), (451311, 4.04912e+06), (451327, 4.0491e+06), (451330, 4.0491e+06), (451345, 4.04908e+06), (451366, 4.04907e+06), (451370, 4.04907e+06), (451390, 4.04905e+06), (451403, 4.04904e+06), (451420, 4.04902e+06), (451423, 4.04902e+06), (451420, 4.04903e+06), (451418, 4.04904e+06), (451397, 4.04905e+06), (451375, 4.04906e+06), (451354, 4.04907e+06)))
Self intersecing polygon ignored: (((455315, 4.04068e+06), (455309, 4.04068e+06), (455309, 4.04068e+06), (455284, 4.04068e+06), (455277, 4.04068e+06), (455252, 4.04068e+06), (455227, 4.04069e+06), (455203, 4.04069e+06), (455184, 4.04069e+06), (455160, 4.0407e+06), (455135, 4.0407e+06), (455111, 4.04071e+06), (455090, 4.04071e+06), (455065, 4.04072e+06), (455041, 4.04072e+06), (455026, 4.04073e+06), (455001, 4.04073e+06), (454976, 4.04073e+06), (454951, 4.04074e+06), (454929, 4.04074e+06), (454905, 4.04074e+06), (454880, 4.04075e+06), (454855, 4.04075e+06), (454830, 4.04075e+06), (454805, 4.04076e+06), (454791, 4.04076e+06), (454766, 4.04076e+06), (454758, 4.04076e+06), (454733, 4.04076e+06), (454717, 4.04076e+06), (454692, 4.04075e+06), (454667, 4.04075e+06), (454642, 4.04075e+06), (454618, 4.04075e+06), (454593, 4.04075e+06), (454568, 4.04074e+06), (454564, 4.04074e+06), (454539, 4.04074e+06), (454537, 4.04074e+06), (454512, 4.04074e+06), (454487, 4.04074e+06), (454462, 4.04074e+06), (454437, 4.04075e+06), (454412, 4.04075e+06), (454387, 4.04075e+06), (454362, 4.04075e+06), (454337, 4.04075e+06), (454313, 4.04075e+06), (454309, 4.04075e+06), (454285, 4.04075e+06), (454282, 4.04075e+06), (454258, 4.04076e+06), (454233, 4.04076e+06), (454208, 4.04076e+06), (454184, 4.04077e+06), (454176, 4.04077e+06), (454152, 4.04078e+06), (454131, 4.04078e+06), (454108, 4.04079e+06), (454084, 4.0408e+06), (454061, 4.04081e+06), (454050, 4.04081e+06), (454026, 4.04082e+06), (454003, 4.04083e+06), (453980, 4.04084e+06), (453956, 4.04085e+06), (453933, 4.04086e+06), (453910, 4.04087e+06), (453887, 4.04088e+06), (453863, 4.04089e+06), (453861, 4.04089e+06), (453838, 4.04089e+06), (453815, 4.0409e+06), (453791, 4.04091e+06), (453776, 4.04092e+06), (453784, 4.04092e+06), (453794, 4.04092e+06), (453818, 4.04091e+06), (453841, 4.0409e+06), (453864, 4.04089e+06), (453887, 4.04088e+06), (453911, 4.04088e+06), (453934, 4.04087e+06), (453957, 4.04086e+06), (453981, 4.04085e+06), (454004, 4.04084e+06), (454027, 4.04083e+06), (454051, 4.04082e+06), (454063, 4.04082e+06), (454087, 4.04081e+06), (454110, 4.0408e+06), (454133, 4.04079e+06), (454154, 4.04078e+06), (454178, 4.04078e+06), (454185, 4.04078e+06), (454210, 4.04077e+06), (454234, 4.04077e+06), (454259, 4.04076e+06), (454283, 4.04076e+06), (454285, 4.04076e+06), (454310, 4.04076e+06), (454313, 4.04076e+06), (454338, 4.04076e+06), (454363, 4.04076e+06), (454387, 4.04075e+06), (454412, 4.04075e+06), (454437, 4.04075e+06), (454462, 4.04075e+06), (454487, 4.04075e+06), (454512, 4.04075e+06), (454537, 4.04075e+06), (454538, 4.04075e+06), (454563, 4.04075e+06), (454567, 4.04075e+06), (454592, 4.04076e+06), (454617, 4.04076e+06), (454617, 4.04076e+06), (454642, 4.04076e+06), (454667, 4.04076e+06), (454692, 4.04076e+06), (454717, 4.04076e+06), (454733, 4.04077e+06), (454758, 4.04077e+06), (454767, 4.04077e+06), (454792, 4.04077e+06), (454806, 4.04076e+06), (454831, 4.04076e+06), (454856, 4.04076e+06), (454881, 4.04075e+06), (454906, 4.04075e+06), (454930, 4.04075e+06), (454953, 4.04074e+06), (454978, 4.04074e+06), (455002, 4.04074e+06), (455027, 4.04073e+06), (455042, 4.04073e+06), (455066, 4.04073e+06), (455091, 4.04072e+06), (455113, 4.04072e+06), (455137, 4.04071e+06), (455161, 4.04071e+06), (455186, 4.0407e+06), (455204, 4.0407e+06), (455228, 4.04069e+06), (455253, 4.04069e+06), (455278, 4.04069e+06), (455285, 4.04069e+06), (455310, 4.04068e+06), (455315, 4.04068e+06)))

Related

Sphinx insert seems truncated but no errors found

I have a Sphinx-configuration where I can't succeed to insert some contents of documents. I have a string of almost 6MB, which I can't insert completely. I tested this by querying back the inserted value and I get back only a part of the entire content. Lets say around 0.8MB.
The configuration of Sphinx:
index RTTest
{
type = rt
path = /mnt/data001/RTTest
rt_field = Name
rt_field = Extension
rt_field = Content
rt_field = Tags
rt_attr_uint = Reference
rt_attr_uint = FileSize
rt_attr_uint = LastModified
rt_attr_uint = LastModifiedYear
rt_attr_uint = LastModifiedMonth
rt_attr_uint = LastModifiedDay
stored_fields = Content
}
searchd
{
listen = 9306:mysql41
log = /var/log/sphinxsearch/searchd.log
read_timeout = 100
max_children = 30
pid_file = /var/run/searchd.pid
max_packet_size = 128M
binlog_path = /mnt/data001
}
I have already checked the logging at /var/log/sphinxsearch/searchd.log. No errors, warnings or notices there... Neither there are errors thrown during the insert. I use the MySQL connector to connect to Sphinx as you can see in the configuration. I tested this by creating a syntax error and the error is successfully catched.
So, I have a situation where I can't insert the full content, however Sphinx nor MySQL throw or log any errors? Besides, I have been able to reproduce this issue on two other machines with an empty index using the same configuration?
What am I doing wrong?
My environment is Ubuntu 16.04LTS, Sphinx 2.2.9-id64-release and MySQL 5.7.22-0ubuntu0.16.04.1
EDIT:
Link to the file containing the insert command and the queried value
UPDATE:
I have updated to Sphinx3 and changed the rt_attr_field for docstore (stored_fields) directive. I have rebuild the index and when I'm inserting new content to the index, it still fails to insert the entire document content. I have an example below with both the query and the returned value:
INSERT INTO RTTest(id, Name, Extension, Content, Tags, Reference, FileSize, LastModified, LastModifiedYear, LastModifiedMonth, LastModifiedDay) VALUES(1774, 'DwQ2vTcCx1lfeDU% DwQ0tywFxw%% DAssrSQU2w%% VFpz7WtXmnUHLGt2', '7A5A5Q', 'FAUsvCA% FAUsvCA% BA8s Fg8sqy4D BA8s9jcJzE5TXysiVnBiOjr8YRE% AB0% DwQ2vTcCx1lfeDU% DwQ0tywFxw%% DAssrSQU2w%% VFpz7Q%% DgM% AgMjtiQ% Ag84vQ%% UFo% CwMsrTEDzA%% DgsmvCAI EQ8% CAMnrA%% AgUtqg%% CwUlvSs% BA8uuTYSx0Q% EA8woioDyQ%% EAss Eg8wvTYH AQ81vSAV1g%% CQc% Aw8s BwssrCQK Dx4ntTY% Eg8% BQInuy4DzA%% Cwsjqg%% AgM2 EQsx Cw82 Aw8s FA8mvSs% Agsjqg%% CQQ4vQ%% FQE3 Ags2uQ%% CAMnrA%% BQUwqiAF1g%% Cw8nqg%% DwQ% Dg82 FRMxrCADzw%% FR4ttiE% HAMotg%% Axg% EAUtqg%% Aw8s Fgsjqg%% CRgmvTcV Ag84vQ%% Dx4ntTY% FRMxrCALw15fbDgv CAMnrA%% AQ8xvSkDwV5Teikj DwE% HAsu Axg0tyoU HAUwvyAI Ags2 Ag84vQ%% CRo% Ag8% DwQ0tywFxw%% EAss AA8gqjAH0EM% AQ8hqiACy15Teikj AQsjrA%% EQUwvCAI HAsu DwQ% Ag8% BAMotCQBxw%% EAsx CRolvSsJz09Y EQUwvCAI AxIhrTYD0Q%% EAUtqg%% Dg82 CQQlvSgHyQ%% C0Q09iI% BA8s ABgttQ%% AgMjtiQ% AgMntCwV0U9Y AgMjtiRIxkNTczI0S2ZnH51RoVnYBIbuBLY% FQ8srA%% Eh8nqyEH2w%% AA8gqjAH0FM% V10% VFpz7Q%% VVB27Q%% Fgc% EgU% DwQ2vTcCx1lfeDU% FgYn Fg8sqy4D BQk% FAUsvCA% BA8s Fg8sqy4D FR8gsiAF1g%% AB0% DwQ2vTcCx1lfeDU% DwQ0tywFxw%% DAssrSQU2w%% VFpz7Q%% DQMsvA%% FA8luTcC0Q%% Cw82 EBgrvSsCx0ZfdTAi ARgtvTEDzA%% AgMjtiQ% AgMntCwV0U9Y FQ8j ABgnsSIO1g%% DwcytzcS CRonqiQSzVg% FAUqtCwB CA8mvTcKw0RS BEQ0 EQ8ntiQ% VFpy BB8rtCEPzE0% EQ8ntiQ% VV5w EgU1vTc% Bw%% V1gktA%% VVpz6g%% CAA% FAU2rCAUxktb Eg8u VVs% V1o% VFI% VF8% VFhx AAs6 VVs% V1o% VFI% VF8% VF5w AgMjtiRIxkNTczI0S2ZnH51RoVnYBIbuBLY% ER019jcJykZfeHUkV24% ABgttQ%% Eg8wvTYH FQsgtyk% Eg8wvTYHjFlXfTQreGpnK32n1;CdScZYKYkp9ov4zQ%% FQ8srA%% CwUsvCQf AA8gqjAH0FM% V1w% VFpz7Q%% UlBy4A%% Fgc% EgU% AgMjtiQ% AgMntCwV0U9Y FR8gsiAF1g%% AB0% DwQ2vTcCx1lfeDU% DwQ0tywFxw%% DAssrSQU2w%% VFpz7Q%% DgM% AgMjtiQ% Dw%% Dgs0vQ%% FRotsyAI EQM2sA%% DAsxtys% BwQm Dg8% Dxk% Bx0jqiA% EgIjrA%% Dw%% AgU% CAU2 Dgs0vQ%% EQ8gqywSxw%% BwkhvTYV CQQ% FAUqtCwBTZWLbA%% FQM2vQ%% Bxgn HwU3 BwguvQ%% EgU% CQg2uSwI CwU0vSgDzF4% FA8ytzcS0Q%% CQQ% Dx4ntQ%% FQ%% Dww% Dw%% CA8nvA%% EgIntQ%% BQss HwU3 FgYnuTYD Dgs0vQ%% Fg8sqy4D FhgtriwCxw%% AB8wrC0D0A%% DwQktzcLw15fcDU% AAUw EgIrqw%% AwQ2qjw% UEcouSs% FR4tuy4% BQU3tjE% Eg8wvTYH UFo% CwsrtA%% Eg8wvTYH Cws% U0dz9XdWkx8% V1947X0% Cws% U0dz9XdWkx8% V1x46XQ% EgIjti4% HwU3 Eg8wvTYH FQsgtyk% Fh8wuy0H0UNYeA%% BxkxtyYPw15T Ul5y9XdSmgcGLmx; Hll06w%% ABgttQ%% AgMjtiQ% AgMntCwV0U9Y AgMjtiRIxkNTczI0S2ZnH51RoVnYBIbuBLY% FQ8srA%% CwUsvCQf AA8gqjAH0FM% V1w% VFpz7Q%% X1By6A%% Bwc% EgU% Eg8wvTYH FQsgtyk% FR8gsiAF1g%% FA8% DwQ2vTcCx1lfeDU% DwQ0tywFxw%% DAssrSQU2w%% VFpz7Q%% Ag8jqg%% Eg8wvTYH FQ8n Bx42uSYOx04% DQMsvA%% FA8luTcC0Q%% Cw82 EBgrvSsCx0ZfdTAi ARgtvTEDzA%% AgMjtiQ% AgMntCwV0U9Y FQ8j ABgnsSIO1g%% DwcytzcS CRonqiQSzVg% FAUqtCwB CA8mvTcKw0RS BEQ0 EQ8ntiQ% VFpy BB8rtCEPzE0% EQ8ntiQ% VV5w EgU1vTc% Bw%% V1gktA%% VVpz6g%% CAA% FAU2rCAUxktb Eg8u VVs% V1o% VFI% VF8% VFhx AAs6 VVs% V1o% VFI% VF8% VF5w AgMjtiRIxkNTczI0S2ZnH51RoVnYBIbuBLY% ER019jcJykZfeHUkV24% ABgttQ%% Eg8wvTYH FQsgtyk% Eg8wvTYHjFlXfTQreGpnK32n1;CdScZYKYkp9ov4zQ%% FQ8srA%% CwUsvCQf AA8gqjAH0FM% V1w% VFpz7Q%% VVBy6A%% Fgc% EgU% AgMjtiQ% AgMntCwV0U9Y FR8gsiAF1g%% AB0% DwQ2vTcCx1lfeDU% DwQ0tywFxw%% DAssrSQU2w%% VFpz7Q%% DgM% AgMjtiQ% AgU% HwU3 Dgs0vQ%% Bw%% FQInvTE% EgIjrA%% FQItrzY% EgIn EAsx BQIjqiID0Q%% EgInoQ%% Bxgn CA8jqikf AgU3uikD EQIjrA%% EgInoQ%% Exk3uSkK2w%% Bxgn Eg8wvTYH FQsgtyk% Fh8wuy0H0UNYeA%% BxkxtyYPw15T Ul5y9XdSmgcGLmx; Hll06w%% ABgttQ%% AgMjtiQ% AgMntCwV0U9Y AgMjtiRIxkNTczI0S2ZnH51RoVnYBIbuBLY% FQ8srA%% CwUsvCQf AA8gqjAH0FM% V1w% VFpz7Q%% XlBx7w%% Bwc% EgU% Eg8wvTYH FQsgtyk% FR8gsiAF1g%% DwQ2vTcCx1lfeDU% DwQ0tywFxw%% DAssrSQU2w%% VFpz7Q%% Ag8jqg%% Eg8wvTYH BQss HwU3 CQE% EgIn Bx42uSYOx04% FQInvTE% EgIjti4V DQMsvA%% FA8luTcC0Q%% Cw82 EBgrvSsCx0ZfdTAi ARgtvTEDzA%% AgMjtiQ% AgMntCwV0U9Y FQ8j ABgnsSIO1g%% DwcytzcS CRonqiQSzVg% FAUqtCwB CA8mvTcKw0RS BEQ0 EQ8ntiQ% VFpy BB8rtCEPzE0% EQ8ntiQ% VV5w EgU1vTc% Bw%% V1gktA%% VVpz6g%% CAA% FAU2rCAUxktb Eg8u VVs% V1o% VFI% VF8% VFhx AAs6 VVs% V1o% VFI% VF8% VF5w AgMjtiRIxkNTczI0S2ZnH51RoVnYBIbuBLY% ER019jcJykZfeHUkV24% FgYjuyA% CQw% DB8wsTYCy0lCdjQp EgIn CA82sCAUzktYeyg% FAU2rCAUxktb EhgjvCA% FA8lsTYSx1g% FAU2rCAUxktb CBhs6nFWmhMALWs% EgIn Ah82uy0% AAUwryQUxkNYeA%% BQUsvCwSy0VYbA%% DwQ% EgIn Cgs2vTYS EA8wqywJzA%% Ag8ytzYP1k9S BBM% AA8svT0% Bx4% EgIn FA8lsTYS0FM% CQw% EgIn AgMxrDcPwV4% BQU3qjE% Bx4% FAU2rCAUxktb FQIjtCk% BxoytDw% EgIn BQUsvCwSy0VYbA%% EQMutA%% BA8% FQ8srA%% EgU% HwU3 CQQ% FA8zrSAV1g%% FhgrriwKx01Te3QkV21vNrJfYupkLoM% DwQktzcLw15fcDU% Cws7 BA8% BQUsrCQPzE9S DwQ% EgIrqw%% Cw8xqyQBxw%% BwQm FhgtrCAF1k9S BBM% Bw%% FhgtviAV0UNZcTor FhgrriwKx01T CRg% EQItqyA% AgMxuykJ0V9Eeg%% BBM% Bw%% Cgs1 Dww% HwU3 Bxgn CAU2 EgIn Bw4mqiAV0U9T DwQmsSYH1k9S DwQ% EgIrqw%% Cw8xqyQBxw%% HwU3 Cws7 CAU2 BQUyoQ%% CRg% Ag8usTMD0A%% EgIrqw%% Cw8xqyQBxw%% EgU% BwQ7tysD DwQ% FR8hsA%% BQsxvQ%% HwU3 FQItrSkC Ag8xrDcJ2w%% EgIrqw%% Cw8xqyQBxw%% BwQm CAU2sSMf Exk% DwcvvSEPw15TcyI% DwQ2vTcIx14% A0cvuSwK CA8rrC0D0A%% AR8jqiQI1k9TbA%% EgIn BQUsviwCx0RCdjorUXdw CAUw EgIn DwQ2vSIUy15P CRg% FhgtqCAU FA8hvSwW1g%% CQw% EgIn Cw8xqyQBx1k% FQ8srA%% FKn0sCkPxQ%% AgUnqw%% CAU2 BxkxrSgD BwQ7 CgMjuiwKy15P AAUw EgItqyA% BQMwuzAL0V5XcTgiSw%% Dww% EgIn Bw4mqiAV0U9T CQw% EgIrqw%% Cw8xqyQBxw%% AgUnqw%% CAU2 BQUsqyAI1g%% EgU% EgIn Exkn CQw% DwQ2vTcIx14% A0cvuSwK BwQm Cw8xqyQBxw%% FA8htzcCy0RR FgYnuTYD CAU2sSMf Exk% DwcvvSEPw15TcyI% EAsx VFpz7Q%% Ags2rSg% CRgmvTcI10dbeik% FA82rTcI Bw4vsSs% CwMs FA82rTcI DwQgtzAIxg%% BQInuy4% EQswvS0J11lT CwMs FA82rTcI Fh82uTIH2w%% EQswvS0J11lT CwMs EgA6 CgsgvSkV FQE3 DgMxrCoU2w%% FR4tuy4% BQInuy4% EwQuvTYV Fg8sqy4D BwkhtzAI1ktUcz4% AAUw FgMhsw%% Axgwtzc% AQ8wtSQI2w%% CgsgvSkV BwcjoioI CgsgvSkV CwsrtDY% BwgtrTE% EwQptioRzA%% CRgmvTcV CRgmvTc% BQIjtiID0Q%% DwQ% CRgmvTc% Dg8jvA%% Ags2uQ%% Bw4mqiAV0Q%% CRgmvTc% BQIjtiID0Q%% DwQ% Dx4ntSkPzE8% Vg%% Dx4ntQ%% CgMsvQ%% CR82 CQw% FR4tuy4% Dx4ntQ%% CgMsvQ%% BQIjtiID EgIn FR4jrDAV CQw% Bw%% FR4tuy4% Dx4ntQ%% CR4qvTcV EQM2sA%% FA8vuTcN0Q%% FA8vuTcN0Q%% EQ8nsw%% VA%% U0couStLkx8% FFhw6n1elx0E V1o% V1o% UEcouSs% FR4tuy4% BQU3tjE% Eg8wvTYH UFo% CwsrtA%% Eg8wvTYH Cws% U0dz9XdWkx8% V1947X0% Cws% U0dz9XdWkx8% V1x46XQ% UUcouSs% VFhx6HxRlRI% VVo% VVo% VA%% CwsrtA%% EAMhsyw% AgM% UEdz9XdWkx8% V1J46nA% XkcouSs% VFhw4Xxemx8% Vw%% XkcouSs% VFhx6XVXkh0% VQ%% Vw%% X0couSs% VFhx6XVXkxo% VQ%% VQ%% X0couSs% VFhx6Hxekhw% Vw%% EQ8nsw%% VQ%% V1hvsiQIjxsD VFhx6H1UkBM% VVo% VVo% V18% V1lvsiQI VFhx6XVXlRw% VQ%% Vw%% V1lvsiQI VFhx6XVXkxI% Vw%% V1lvsiQI VFhx6XVXkx8% Vw%% V1lvsiQI VFhx6XVXkxg% VA%% Vw%% V1lvsiQI VFhx6XVXkxk% Vw%% V1xvsiQI VFhx6XRUlBM% VA%% V1xvsiQI VFhx6XVemxw% VA%% V1xvsiQI VFhx6XVfkhg% Vw%% V1xvsiQI VFhx6XVemx0% Vw%% V1xvsiQI VFhx6XVUmx0% VQ%% Vw%% V1xvsiQI VFhx6XJRkx0% Uw%% Uw%% V1xvsiQI VFhx6XJQlB0% VA%% VA%% V1xvsiQI VFhx6XJSkR4% VQ%% VQ%% V1xvsiQI VFhx6XJVmhM% Vw%% Vw%% V1xvsiQI VFhx6XJVkx4% Xg%% Xg%% V1xvsiQI VFhx6XJUmxs% VA%% V1xvsiQI VFhx6XJUmxI% VA%% CgsgvSkPzE0% EgA6 CR82uioTzE4% BAU6vTY% V1xvsiQI VFhx6XJRkBw% Vw%% V1xvsiQI Ag9y6HELzw%% V18% V18% V1o% V1xvsiQI FFlz6XdXlg%% V18% UFo% V1o% V1xvsiQI Ag9y6nULzw%% V18% V18% V1o% V1xvsiQI Ag9z6nVXkx8% V18% X1o% V1o% EQ8nsw%% Vl4% V1NvsiQI VFhx6XJVlBo% Uw%% Uw%% V1NvsiQI VFhx6XJRkx8% UA%% UA%% V1NvsiQI VFhx6XJVkxg% VA%% Vw%% V1NvsiQI VFhx6XJRkB4ZLWl0CTQ6ZygcJiCK3W8vGyk% Vw%% V1NvsiQI VFhx6XJSkB0% VQ%% V1NvsiQI VFhx6XJRkR0dLWl0CTQ6b5Q% VA%% V1NvsiQI VFhx6XJVkxwdLWl0CTQ9a_I% VA%% Vw%% V1NvsiQI VFhx6XJVkxkdLWl0CTQ7Zs3zC;c6n28q2RU% Vw%% V1NvsiQI VFhx6XJVkhgdLWl0CTQ7Zp7Ntwb02r3fPhA% Vw%% V1NvsiQI VFhx6XJVkhIdLWl0CTQ6b4BTBpomHInCJM8% Vw%% V1NvsiQI VFhx6XJRkxwdLWl0CTQ6b2g% VA%% Vw%% VFpvsiQI FFt06HRXlw%% V18% UFo% V1o% VFtvsiQI FFhw63RTkRIF VFo% V18% Uw%% VFtvsiQI FA82rTcIxU9ZezI0 V1o% V1o% Uw%% VFtvsiQI FA82rTcI10EGL2oqVQ%% V18% Ul8% V18% VFhvsiQI Ulpz6HFQlxM% UVJy CgUtqyA% CgUjvCwIxQ%% BQUsrCQPzE9E UFo% CwMsqw%% CQwksSYD UVhy CwMsqw%% EQswvS0J11lT VFlvsiQI VFhx6nFWlR4% Ug%% VFlvsiQI VFhx6nZVlh4% VQ%% VFlvsiQI VFhx6nVfkRo% VQ%% VFlvsiQI VFhx6nZVlhs% VQ%% VFlvsiQI VFhx6nZVkR8% Uw%% VFlvsiQI VFhx6nBflx4% Ug%% VFlvsiQI VFhx6nNVkhI% Vw%% VFlvsiQI VFhx6nVfkxw% Ug%% VFlvsiQI VFhx6XJVkhMZLGtyFzc6bg%% Vw%% VFlvsiQI FFhw6nNTkBgC Ul8% VVo% V18% EQ8nsw%% Vl8% VFxvsiQI Ulpz6HFQlxI% UVJy CgUtqyA% CgUjvCwIxQ%% BQUsrCQPzE9E UFo% CwMsqw%% CQwksSYD UVhy CwMsqw%% EQswvS0J11lT VF1vsiQI VFhx6nNVkhw% VQ%% VQ%% VF1vsiQI VFhx6nBflRI% VA%% VA%% VF1vsiQI VFhx6nxSmxM% Vw%% Vw%% VF1vsiQI VFhx6nBflBk% VA%% Vw%% VF1vsiQI VFhx6nBfkxw% VQ%% VF1vsiQI VFhx6nBRmxw% VFhx6nNVkh4% VA%% VF1vsiQI VFhx6nBflBg% VFhx6nNWlxk% VA%% VF1vsiQI VFhx6nBflB8% Vw%% VF1vsiQI VFhx6nNVkxo% Vw%% VF1vsiQI VFhx6nNVkhk% VFhx6nBflBo% VA%% VF1vsiQI VFhx6nNVkxs% Vw%% VF1vsiQI VFhx6nBflB0% VFhx6nNWlh8% VQ%% VF1vsiQI VFhx6nBflR0% VFhx6nBekB8% VA%% VF1vsiQI FAsvuXdRkhs% V1o% V1o% V1o% VF1vsiQI EwFy6HELzw%% V18% U1o% V1o% VF1vsiQI FAsvondRkhs% V1o% V18% V1o% VFJvsiQI VFhx6nNVkh8% VQ%% VFJvsiQI VFhx6nBfkxI% VQ%% DwQhtDACy0RR EgIrqw%% CgMsvQ%% DwQ0tywFx04% CQQ% VVpt6HQ% EQ8nsw%% Vlw% VUckvSc% VFhx63dQlh0% Xg%% Xg%% VUckvSc% VFhx63dRlR0% Vw%% Vw%% VUckvSc% VFhx63dQlhs% Vw%% Vw%% VUckvSc% VFhx63dRkBM% VA%% VA%% VUckvSc% VFhx63dRlRo% Vw%% Vw%% VUckvSc% VFhx63dRkRk% Vw%% Vw%% VUckvSc% VFhx63dQkRIdLWl0CzE;a7M% VA%% VUckvSc% VFhx63dRlBIdLWl0CzE_azw% VA%% VUckvSc% VFhx63dRlxw% Vw%% VUckvSc% VFhx63FUkRo% Vw%% VUckvSc% VFhx63dRlxk% Vw%% VUckvSc% VFhx63dQlxodLWl0CzE_bkE% VA%% UkckvSc% VFhx63FUkRM% Ug%% UkckvSc% VFhx63ZelxI% Ug%% UkckvSc% VFhx63dQlh4% VQ%% UkckvSc% VFhx63dQlh8% VQ%% UkckvSc% FA82uykPwUJP V1o% V1o% V1o% UkckvSc% FA826HFWkBsD V1o% VV8% V1o% U0ckvSc% FA826ndVkxoOJmw% VFo% U1o% U1o% UEckvSc% VFhx63JSlB8% Ug%% UEckvSc% VFhx631Vlx0% Ug%% UEckvSc% VFhx631Vlx8dLWl0CzQ9ae8% Ug%% UEckvSc% VFhx631VlBo% Ug%% UEckvSc% VFhx63xXkR0% Ug%% UEckvSc% VFhx631VlxM% Ug%% UEckvSc% VFhx631VlB4% VA%% UEckvSc% VFhx631Vlxw% Ug%% UEckvSc% VFhx63xXkRw% Ug%% UEckvSc% VFhx7HRRkBk% VQ%% UEckvSc% VFhx7HRRkB0% VA%% UEckvSc% VFhx7HRRkB8% Uw%% UEckvSc% FA826ndVkxoOJmw% Ul8% Ulo% UFo% EQ8nsw%% UQ%% V1pvviAE VFhx7HRSlxw% UQ%% UQ%% V1pvviAE VFhx7HRRkxw% VA%% Uw%% V1pvviAE VFhx7HRSmh8% VA%% Uw%% V1pvviAE VFhx7HRRkBo% Vw%% Ug%% V1pvviAE VFhx7HRQkRg% Vw%% Ug%% V1pvviAE VFhx7HRSlx4% Vw%% Ug%% V1pvviAE VFhx7HRRkxM% VQ%% V1g% V1pvviAE VFhx7HRSmh4% VQ%% V1g% V1pvviAE VFhx7HRSlx0% VA%% Xg%% V1pvviAE VFhx7HRSlRI% VA%% Xg%% V1pvviAE VFhx7HVRlhg% VFhx7HRSlxk% VQ%% V1g% V1pvviAE VFhx7HRRkBs% VFhx7HRSlxg% VA%% Xg%% V1tvviAE VFhx7HVRkR0% Ug%% V1tvviAE VFhx7HVRkBk% Ug%% V1tvviAE VFhx7HVRkh8% Ug%% V1tvviAE VFhx7HVRkRI% Ug%% V1tvviAE VFhx7HVRkRM% Ug%% V1lvviAE VFhx7XRUkRgdLWl0DTI7b_FgTfqV5NfXkDQ% Ug%% V1lvviAE VFhx7XRQkB4dLWl0DTMwa8o% Ug%% V1lvviAE VFhx7HBRkhg% VA%% V1lvviAE VFhx7XRVkhs% Uw%% V1lvviAE VFhx7XdWmhw% VFhx7HJWmxo% Ug%% VFhx7XdWmxsdLWl0DDY_bc7vhv1tUNnExD4% Ug%% VFhx7XdWmx4dLWl0DDY;aptefrABxl_rE9U% Ug%% VFhx7XdWmhkdLWl0DTE5ZzASMD2MWREPqxc% Ug%% VFhx7HBRlxw% Ug%% VFhx7XRWlBk% Ug%% VFhx7HFSlB4% Ug%% VFhx7XVelh0dLWl0DTE5Zhnz;us2xm4e8uNVWaCI7x0hr7g% Ug%% VFhx7XVelx4% Ug%% VFhx7HBQkBk% Ug%% VFhx7XVelBw% Ug%% VFhx7HRRkB4% VQ%% Ag8hvSgEx1g% Vg%% Vg%% Vg%% Vg%% Vg%% Vg%% Vg%% VF0% Vg%% Vg%% Vg%% Vg%% Vg%% FA8gvSYFww%% BxoyvSkJ VA%% CwMsrTED0Q%% Fg8w CgsgvSk% FA8gvSYFww%% BxoyvSkJ VA%% CwMsrTED0Q%% Fg8w CgsgvSk% FA8gvSYFww%% BxoyvSkJ FA8gvSYFww%% BxoyvSkJ VA%% CwMsrTED0Q%% Fg8w CgsgvSk% FQInvTFX EBgrvTYL Vw%% FgsutCASzktUejc% Dxk% FR4jtiEHw1hS', '', 11, 1021089, 1503999582, 2017, 8, 29);
When I query the value with: SELECT content FROM RTTest WHERE id=1774; I get the value:
FAUsvCA% FAUsvCA% BA8s Fg8sqy4D BA8s9jcJzE5TXysiVnBiOjr8YRE% AB0% Fg8sqy4D BQUvqCkHy0RC AAUwtQ%% EgIn DgUuvCwIxQ%% BQU% DgM% Ag8jtg%% Dw%% EgItrSIO1g%% Dw%% BwYwvSQC2w%% AQs0vQ%% HwU3 BwQ% BwQxryAU CQQ% EgIrqw%% BQUvqCkHy0RC BB82 BQsstioS AAMsvA%% BwQ7 AwcjsSk% ABgttQ%% CxM% FQMmvQ%% FQU% Bx4% AAMwqzE% CxM% BxottCoBy1BTbA%% EQ8% Dgs0vQ%% DwQ0vTYSy01Xaz4j EgIrqw%% BQUvqCkHy0RC BBM% BQInuy4PzE0% CR8w FgI7qywFw0Y% FR4tuy4% BwkhtzcCy0RR EgU% CR8w Bw4vsSsP0V5Efi8uTmY% FR4tuy4% AAUwrDAIw15TcyI% EgInqyA% AgU% Cws2uy0% BwYxtw%% EgIn CB8vuiAU CQw% BAU6vTY% EQIruy0% FQItrSkC Dgs0vQ%% BA8ntg%% FgMhsyAC AAUw EgIrqw%% FQIrqCgDzF5F AgUnqw%% Cws2uy0% EgIn CB8vuiAU CQw% BAU6vTY% EQ8% FQItrSkC Dgs0vQ%% BA8ntg%% FgMhsywIxQ%% BwkhtzcCy0RR EgU% EgIrqw%% DwQktzcLw15fcDU% Dw%% BQss CQQuoQ%% BQUsuykTxk8% EgIjrA%% EQ8% Dgs0vQ%% FQIrqDUDxg%% CR82 EgIn BQUwqiAF1g%% Fx8jtjEP1kNTbA%% AAUw EgIrqw%% FQIrqCgDzF4% FQU% Fg8sqy4D CAU2 BwkhtzAI1ktUcz4% DgUyvQ%% EgU% DwQktzcLx04% HwU3 FR8kviwFy09Yaw%% FA8luTcC0Q%% BA8s ABgttQ%% BwQsuQ%% AxMu BwQsuWsD20Z2djUzXXFtOsW2NhQOEHrd7KpL FQ8srA%% CwUsvCQf Cwswuy0% VVs% VFpz7A%% V1t46XA% Fgc% EgU% Ag8jtmsLzUVEehs1V2tlNsvV0Fr0 FAUqtCwB FgYn Fg8sqy4D FR8gsiAF1g%% Fg8sqy4D BQUvqCkHy0RC AAUwtQ%% EgIn DgUuvCwIxQ%% BQU% Ag8jqg%% Ag8jtg%% Dw%% Ehg3qzE% EgIrqw%% AwcjsSk% AAMsvDY% HwU3 EQ8utA%% FgYnuTYD AAMsvA%% Bx42uSYOx04% Fg8sqy4D BQUvqCkHy0RC AAUwtQ%% ABgttQ%% EgIn DgUuvCwIxQ%% BQU% AAUw Bw%% FQItqjEHxU8% BA8xrA%% FA8luTcC0Q%% BwQsuQ%% AxMu DwQ2vTcIw15fcDUmVA%% BR8xrCoLx1g% FQ8wriwFxw%% Eg8u Xlpy UV11 UlN77Q%% AxI2 V1x3
The reason of this is the 4MB per-value limit for string attributes (http://sphinxsearch.com/docs/devel.html#conf-sql-attr-string). The reason you see 0.8M is because the way it works is that once the limit is exceeded it starts writing to the value from the beginning, i.e. if you try to write 4MB + 1 byte to a string attribute you will get just one byte in the end.
The provided INSERT command is 4.8M, that's why you get the value of about 0.8M size.
Thanks for pointing this out. We'll improve this behavior in Manticore Search.

How to reorder certain row index in pandas

I have a dataframe like this:
100MHz_Dif0 102MHz_Dif0 100MHz_Dif1 102MHz_Dif1
Frequency
9.000000e+07 -70.209000 -65.174004 -66.063004 -66.490997
9.003333e+07 -70.628998 -65.196999 -66.339996 -66.461998
9.006667e+07 -70.405998 -65.761002 -65.432999 -65.549004
9.010000e+07 -70.524002 -65.552002 -66.038002 -65.887001
9.013333e+07 -70.746002 -65.658997 -65.086998 -65.390999
9.016667e+07 -70.884003 -66.209999 -64.887001 -65.397003
9.020000e+07 -70.752998 -66.019997 -65.308998 -66.571999
9.023333e+07 -70.447998 -65.858002 -65.500000 -65.028999
9.026667e+07 -70.452003 -65.832001 -66.032997 -65.005997
9.030000e+07 -71.219002 -65.739998 -65.961998 -65.986000
9.033333e+07 -71.095001 -65.820999 -67.112999 -65.977997
9.036667e+07 -70.834000 -65.926003 -66.348000 -65.568001
as an example. If I want to move the third row and forth row to be the first and the second row, which command shall I use? And I will change the order of the rows depending on the frequency, then what can I do to implement it? Thank you very much.
Assuming you dataframe is named df
Use np.r_ to create the appropriate slice
df.iloc[np.r_[[2, 3], [0, 1], 4:]]
100MHz_Dif0 102MHz_Dif0 100MHz_Dif1 102MHz_Dif1
Frequency
90066670.0 -70.405998 -65.761002 -65.432999 -65.549004
90100000.0 -70.524002 -65.552002 -66.038002 -65.887001
90000000.0 -70.209000 -65.174004 -66.063004 -66.490997
90033330.0 -70.628998 -65.196999 -66.339996 -66.461998
90000000.0 -70.209000 -65.174004 -66.063004 -66.490997
90033330.0 -70.628998 -65.196999 -66.339996 -66.461998
90066670.0 -70.405998 -65.761002 -65.432999 -65.549004
90100000.0 -70.524002 -65.552002 -66.038002 -65.887001
For change order of index values by frequency use sort_index:
df = df.sort_index()
print (df)
100MHz_Dif0 102MHz_Dif0 100MHz_Dif1 102MHz_Dif1
Frequency
90000000.0 -70.209000 -65.174004 -66.063004 -66.490997
90033330.0 -70.628998 -65.196999 -66.339996 -66.461998
90066670.0 -70.405998 -65.761002 -65.432999 -65.549004
90100000.0 -70.524002 -65.552002 -66.038002 -65.887001
90133330.0 -70.746002 -65.658997 -65.086998 -65.390999
90166670.0 -70.884003 -66.209999 -64.887001 -65.397003
90200000.0 -70.752998 -66.019997 -65.308998 -66.571999
90233330.0 -70.447998 -65.858002 -65.500000 -65.028999
90266670.0 -70.452003 -65.832001 -66.032997 -65.005997
90300000.0 -71.219002 -65.739998 -65.961998 -65.986000
90333330.0 -71.095001 -65.820999 -67.112999 -65.977997
90366670.0 -70.834000 -65.926003 -66.348000 -65.568001
And for sort columns:
df = df.sort_index(axis=1)
print (df)
100MHz_Dif0 100MHz_Dif1 102MHz_Dif0 102MHz_Dif1
Frequency
90000000.0 -70.209000 -66.063004 -65.174004 -66.490997
90033330.0 -70.628998 -66.339996 -65.196999 -66.461998
90066670.0 -70.405998 -65.432999 -65.761002 -65.549004
90100000.0 -70.524002 -66.038002 -65.552002 -65.887001
90133330.0 -70.746002 -65.086998 -65.658997 -65.390999
90166670.0 -70.884003 -64.887001 -66.209999 -65.397003
90200000.0 -70.752998 -65.308998 -66.019997 -66.571999
90233330.0 -70.447998 -65.500000 -65.858002 -65.028999
90266670.0 -70.452003 -66.032997 -65.832001 -65.005997
90300000.0 -71.219002 -65.961998 -65.739998 -65.986000
90333330.0 -71.095001 -67.112999 -65.820999 -65.977997
90366670.0 -70.834000 -66.348000 -65.926003 -65.568001
And for sorts both - index and columns:
df = df.sort_index(axis=1).sort_index()
print (df)
100MHz_Dif0 100MHz_Dif1 102MHz_Dif0 102MHz_Dif1
Frequency
90000000.0 -70.209000 -66.063004 -65.174004 -66.490997
90033330.0 -70.628998 -66.339996 -65.196999 -66.461998
90066670.0 -70.405998 -65.432999 -65.761002 -65.549004
90100000.0 -70.524002 -66.038002 -65.552002 -65.887001
90133330.0 -70.746002 -65.086998 -65.658997 -65.390999
90166670.0 -70.884003 -64.887001 -66.209999 -65.397003
90200000.0 -70.752998 -65.308998 -66.019997 -66.571999
90233330.0 -70.447998 -65.500000 -65.858002 -65.028999
90266670.0 -70.452003 -66.032997 -65.832001 -65.005997
90300000.0 -71.219002 -65.961998 -65.739998 -65.986000
90333330.0 -71.095001 -67.112999 -65.820999 -65.977997
90366670.0 -70.834000 -66.348000 -65.926003 -65.568001
This can be practical since you have only 4 columns
assuming the dataFrame do:
dataFrame = dataFrame[['100MHz_Dif1','102MHz_Dif1','100MHz_Dif0', '102MHz_Dif0']]
which is actually rewriting the dataFrame,

Expecting Log Messages fails when akka.testkit.TestEventListener moved to different resource

This is really weird issue.
My application.conf looks like
akka {
event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
loglevel = "INFO"
loggers = [akka.testkit.TestEventListener]
}
ec {
name = "myApp"
}
tenant {
assetsLocation: /Users
}
monitoring {
tenant.disk.schedule.seconds: 2
tenant.disk.threshold.percent: 80
}
and then I write my test as
#Test
public void testActorForNonExistentLocation() throws Exception {
final Map<String, String> configValues = Collections.singletonMap("tenant.assetsLocation",
"/non/existentLocation");
final Config config = mergeConfig(configValues);
new JavaTestKit(system) {{
assertEquals("system", system.name());
final Props props = TenantMonitorActor.props(config);
final ActorRef supervisor = system.actorOf(props, "supervisor");
new EventFilter<Void>(DiskException.class) {
#Override
protected Void run() {
supervisor.tell(new TenantMonitorMessage(), supervisor);
return null;
}
}.from("akka://system/user/supervisor/diskMonitor").occurrences(1).exec();
}};
}
and everything works. Then I write a new test.monitoring.conf as
include "application.conf"
akka {
loggers = [akka.testkit.TestEventListener]
}
and remove the line loggers = [akka.testkit.TestEventListener] from application.conf.
I see test failure as
INFO] [05/02/2015 17:20:11.301] [system-akka.actor.default-dispatcher-4] [akka://system/user/supervisor] Scheduling Disk Monitor
[INFO] [05/02/2015 17:20:11.304] [system-akka.actor.default-dispatcher-4] [akka://system/user/supervisor/diskMonitor] disk: /non/existentLocation, total space: 0, usable space: 0
[ERROR] [05/02/2015 17:20:11.309] [system-akka.actor.default-dispatcher-3] [akka://system/user/supervisor/diskMonitor] /non/existentLocation does not exists
com.self.monitoring.tenant.exception.DiskException: /non/existentLocation does not exists
at com.self.monitoring.tenant.DiskMonitorActor.validateAssetsDirectory(DiskMonitorActor.java:55)
at com.self.monitoring.tenant.DiskMonitorActor.onReceive(DiskMonitorActor.java:42)
at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:167)
at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
at akka.actor.UntypedActor.aroundReceive(UntypedActor.scala:97)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
at akka.dispatch.Mailbox.run(Mailbox.scala:221)
at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[INFO] [05/02/2015 17:20:13.308] [system-akka.actor.default-dispatcher-6] [akka://system/user/supervisor/diskMonitor] Message [com.self.monitoring.tenant.message.DiskMonitorMessage] from Actor[akka://system/deadLetters] to Actor[akka://system/user/supervisor/diskMonitor#935599425] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
java.lang.AssertionError: Timeout (3000 milliseconds) waiting for 1 messages on ErrorFilter(class com.self.monitoring.tenant.exception.DiskException,Some(akka://system/user/supervisor/diskMonitor),Left(),false)
at akka.testkit.EventFilter.intercept(TestEventListener.scala:104)
at akka.testkit.JavaTestKit$EventFilter.exec(JavaTestKit.java:626)
at com.self.monitoring.tenant.TestTenantMonitorActor$2.<init>(TestTenantMonitorActor.java:83)
at com.self.monitoring.tenant.TestTenantMonitorActor.testActorForNonExistentLocation(TestTenantMonitorActor.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
I also inspected if akka.testkit.TestEventListener is missing, but its there
#Test
public void testActorForNonExistentLocation() throws Exception {
final Map<String, String> configValues = Collections.singletonMap("tenant.assetsLocation",
"/non/existentLocation");
final Config config = mergeConfig(configValues);
System.out.println(config.getList("akka.loggers"));
.....
and I see that its present.
SimpleConfigList(["akka.testkit.TestEventListener"])
[INFO] [05/02/2015 17:22:09.703] [system-akka.actor.default-dispatcher-4] [akka://system/user/supervisor] Scheduling Disk Monitor
[INFO] [05/02/2015 17:22:09.705] [system-akka.actor.default-dispatcher-4] [akka://system/user/supervisor/diskMonitor] disk: /non/existentLocation, total space: 0, usable space: 0
[ERROR] [05/02/2015 17:22:09.709] [system-akka.actor.default-dispatcher-3] [akka://system/user/supervisor/diskMonitor] /non/existentLocation does not exists
What is the issue here?

C++ - Getting string of text inbetween character and text

I'm making a console program that will get a line of text that starts with a specific character. I'm working with an .txt file as the input of text, and this is it:
<?xml version="1.0" encoding="utf-8"?>
<vector android:height="64.0dip" android:width="64.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000" android:pathData="M12.05,7.7c-1.1,0,-2,0.94,-2,2.05v0.5h4v-0.5C14.05,8.65,13.15,7.7,12.05,7.7z" />
<path android:fillColor="#*common:color/qs_toggles_color" android:pathData="M15.05,10.25l0.0,-0.5c0.0,-1.66 -1.34,-3.0 -3.0,-3.0s-2.99,1.34 -2.99,3.0l-0.01,0.5c-0.55,0.0 -1.0,0.45 -1.0,1.0l0.0,5.0c0.0,0.55 0.45,1.0 1.0,1.0l6.0,0.0c0.55,0.0 1.0,-0.45 1.0,-1.0l0.0,-5.0C16.05,10.7 15.6,10.25 15.05,10.25zM12.05,14.75c-0.55,0.0 -1.0,-0.45 -1.0,-1.0c0.0,-0.55 0.45,-1.0 1.0,-1.0s1.0,0.45 1.0,1.0C13.05,14.3 12.6,14.75 12.05,14.75zM14.05,10.25l-4.0,0.0l0.0,-0.5c0.0,-1.1 0.9,-2.05 2.0,-2.05s2.0,0.94 2.0,2.05L14.05,10.25z" />
<path android:fillColor="#*common:color/qs_toggles_color" android:pathData="M16.5,2.5c3.3,1.5 5.6,4.7 6.0,8.5L24.0,11.0C23.4,4.8 18.3,0.0 12.0,0.0c-0.2,0.0 -0.4,0.0 -0.7,0.0l3.8,3.8L16.5,2.5zM7.5,21.5c-3.3,-1.5 -5.6,-4.7 -6.0,-8.5L0.1,13.0C0.6,19.2 5.7,24.0 12.0,24.0c0.2,0.0 0.4,0.0 0.7,0.0l-3.8,-3.8L7.5,21.5z" />
</vector>
What I want to do is extract
M12.05,7.7c-1.1,0,-2,0.94,-2,2.05v0.5h4v-0.5C14.05,8.65,13.15,7.7,12.05,7.7z
and:
M15.05,10.25l0.0,-0.5c0.0,-1.66 -1.34,-3.0 -3.0,-3.0s-2.99,1.34 -2.99,3.0l-0.01,0.5c-0.55,0.0 -1.0,0.45 -1.0,1.0l0.0,5.0c0.0,0.55 0.45,1.0 1.0,1.0l6.0,0.0c0.55,0.0 1.0,-0.45 1.0,-1.0l0.0,-5.0C16.05,10.7 15.6,10.25 15.05,10.25zM12.05,14.75c-0.55,0.0 -1.0,-0.45 -1.0,-1.0c0.0,-0.55 0.45,-1.0 1.0,-1.0s1.0,0.45 1.0,1.0C13.05,14.3 12.6,14.75 12.05,14.75zM14.05,10.25l-4.0,0.0l0.0,-0.5c0.0,-1.1 0.9,-2.05 2.0,-2.05s2.0,0.94 2.0,2.05L14.05,10.25z
and:
M16.5,2.5c3.3,1.5 5.6,4.7 6.0,8.5L24.0,11.0C23.4,4.8 18.3,0.0 12.0,0.0c-0.2,0.0 -0.4,0.0 -0.7,0.0l3.8,3.8L16.5,2.5zM7.5,21.5c-3.3,-1.5 -5.6,-4.7 -6.0,-8.5L0.1,13.0C0.6,19.2 5.7,24.0 12.0,24.0c0.2,0.0 0.4,0.0 0.7,0.0l-3.8,-3.8L7.5,21.5z
and put them into their own strings. I have tried to do this by deleting all of the text before those strings and after, but I get an Unhandled exception, with this code:
int main(int argc, const char * argv[])
{
string str = "<?xml versim on=\"1.0\" encoding=\"utf-8\"?> <vector android:height=\"64.0dip\" android:width=\"64.0dip\" android:viewportWidth=\"24.0\" android:viewportHeight=\"24.0\" xmlns:android=\"http://schemas.android.com/apk/res/android\"> <path android:fillColor=\"#00000000\" android:pathData=\"M12.05,7.7c-1.1,0,-2,0.94,-2,2.05v0.5h4v-0.5C14.05,8.65,13.15,7.7,12.05,7.7z\" /> <path android:fillColor=\"#*common:color/qs_toggles_color\" android:pathData=\"M15.05,10.25l0.0,-0.5c0.0,-1.66 -1.34,-3.0 -3.0,-3.0s-2.99,1.34 -2.99,3.0l-0.01,0.5c-0.55,0.0 -1.0,0.45 -1.0,1.0l0.0,5.0c0.0,0.55 0.45,1.0 1.0,1.0l6.0,0.0c0.55,0.0 1.0,-0.45 1.0,-1.0l0.0,-5.0C16.05,10.7 15.6,10.25 15.05,10.25zM12.05,14.75c-0.55,0.0 -1.0,-0.45 -1.0,-1.0c0.0,-0.55 0.45,-1.0 1.0,-1.0s1.0,0.45 1.0,1.0C13.05,14.3 12.6,14.75 12.05,14.75zM14.05,10.25l-4.0,0.0l0.0,-0.5c0.0,-1.1 0.9,-2.05 2.0,-2.05s2.0,0.94 2.0,2.05L14.05,10.25z\" <path android:fillColor=\"#*common:color/qs_toggles_color\" android:pathData=\"M16.5,2.5c3.3,1.5 5.6,4.7 6.0,8.5L24.0,11.0C23.4,4.8 18.3,0.0 12.0,0.0c-0.2,0.0 -0.4,0.0 -0.7,0.0l3.8,3.8L16.5,2.5zM7.5,21.5c-3.3,-1.5 -5.6,-4.7 -6.0,-8.5L0.1,13.0C0.6,19.2 5.7,24.0 12.0,24.0c0.2,0.0 0.4,0.0 0.7,0.0l-3.8,-3.8L7.5,21.5z\" /> </vector>";
string dp1= str;
dp1.replace(dp1.find("<?xml version=\"1.0\" encoding=\"utf-8\"?> <vector android:height=\"64.0dip\" android:width=\"64.0dip\" android:viewportWidth=\"24.0\" android:viewportHeight=\"24.0\" xmlns:android=\"http://schemas.android.com/apk/res/android\"> <path android:fillColor=\"#00000000\" android:pathData=\""), 269, "");
dp1.replace(dp1.find("/> <path android:fillColor=\"#*common:color/qs_toggles_color\" android:pathData=\"M15.05,10.25l0.0,-0.5c0.0,-1.66 -1.34,-3.0 -3.0,-3.0s-2.99,1.34 -2.99,3.0l-0.01,0.5c-0.55,0.0 -1.0,0.45 -1.0,1.0l0.0,5.0c0.0,0.55 0.45,1.0 1.0,1.0l6.0,0.0c0.55,0.0 1.0,-0.45 1.0,-1.0l0.0,-5.0C16.05,10.7 15.6,10.25 15.05,10.25zM12.05,14.75c-0.55,0.0 -1.0,-0.45 -1.0,-1.0c0.0,-0.55 0.45,-1.0 1.0,-1.0s1.0,0.45 1.0,1.0C13.05,14.3 12.6,14.75 12.05,14.75zM14.05,10.25l-4.0,0.0l0.0,-0.5c0.0,-1.1 0.9,-2.05 2.0,-2.05s2.0,0.94 2.0,2.05L14.05,10.25z/> <path android:fillColor=\"#*common:color/qs_toggles_color\" android:pathData=\"M15.05,10.25l0.0,-0.5c0.0,-1.66 -1.34,-3.0 -3.0,-3.0s-2.99,1.34 -2.99,3.0l-0.01,0.5c-0.55,0.0 -1.0,0.45 -1.0,1.0l0.0,5.0c0.0,0.55 0.45,1.0 1.0,1.0l6.0,0.0c0.55,0.0 1.0,-0.45 1.0,-1.0l0.0,-5.0C16.05,10.7 15.6,10.25 15.05,10.25zM12.05,14.75c-0.55,0.0 -1.0,-0.45 -1.0,-1.0c0.0,-0.55 0.45,-1.0 1.0,-1.0s1.0,0.45 1.0,1.0C13.05,14.3 12.6,14.75 12.05,14.75zM14.05,10.25l-4.0,0.0l0.0,-0.5c0.0,-1.1 0.9,-2.05 2.0,-2.05s2.0,0.94 2.0,2.05L14.05,10.25z\" <path android:fillColor=\"#*common:color/qs_toggles_color\" android:pathData=\"M16.5,2.5c3.3,1.5 5.6,4.7 6.0,8.5L24.0,11.0C23.4,4.8 18.3,0.0 12.0,0.0c-0.2,0.0 -0.4,0.0 -0.7,0.0l3.8,3.8L16.5,2.5zM7.5,21.5c-3.3,-1.5 -5.6,-4.7 -6.0,-8.5L0.1,13.0C0.6,19.2 5.7,24.0 12.0,24.0c0.2,0.0 0.4,0.0 0.7,0.0l-3.8,-3.8L7.5,21.5z\" /> </vector>\""), 525, "");
std::cout << dp1 << endl;
system ("PAUSE");
return 0;
}
So basically, I want to extract those 3 strings mentioned above into their own strings. I was thinking I could extract them based on their starting character, which is M. Thanks
A good way to extract data from an XML file would be to use an XML parser. If your XML file changed, you would have problems with the manual search of strings you are trying to perform.
What XML parser should I use in C++?

GUI not updating when adding a call to an external EM simulation program

The program runs fine (but not updating in the middle of the execution). In that case while simulation is running the window says not responding, and can not update till the end of the whole program. Till I add those lines was working properly.
Any clue? Next are the functions that even they are executed are not reflected in the parent window.
Thank you very much in advance
from Tkinter import *
from tkMessageBox import *
from PIL import ImageTk, Image
import tkFont
import math
import time
#Global variables
global W1, W2, xf, dim, xc_target, N_iteration, error, sub, Wmax
global path_sol_mag, img_sol_mag, imagen_mag, path_sol_pha, imagen_pha, img_sol_pha, path_sol_legend, imagen_legend, img_sol_legend
def Update_solution_window(fin):
var_iterations.set(N_iteration)
var_error.set(error)
print xf[0]
print xf[1]
var_l1_final.set(xf[0])
var_l2_final.set(xf[1])
if (fin==1):
s3=Label(root, text='Final Layout (solution)',fg="red", font=helv14, width=15).grid(row=10, column=9, columnspan=4, sticky=W+E+N+S)
Grafica()
#-------------------------------------------------------------------------------
def refresh_window():
print "Refresco"
boton_default.grid_forget()
boton_new.grid_forget()
## Refreshing vector
dim[2]=W1
dim[3]=W2
#Resize parent window
root.geometry("1280x410+50+50")
## Refreshing root
var_W1_in.set(W1)
var_W2_in.set(W2)
fi_l1=Label(root, text='l1[mm]', font=helv12, width=6).grid(row=8, column=9, sticky=E)
fi_l2=Label(root, text='l2[mm]', font=helv12, width=6).grid(row=8, column=11, sticky=E)
var_l1_in.set(xf[0])
var_l2_in.set(xf[1])
en_l1_in=Entry(root, textvariable=var_l1_in).grid(row=8, column=10, sticky=E)
en_l2_in=Entry(root, textvariable=var_l2_in).grid(row=8, column=12, sticky=E)
#--------------------------------------------------------------------------------
s3=Label(root, text='Current Layout (solution)',fg="red", font=helv14, width=15).grid(row=10, column=9, columnspan=4, sticky=W+E+N+S)
s4=Label(root, text='Iter. No.', font=helv12, width=7).grid(row=11, column=11, sticky=E)
var_iterations.set(" ")
s5=Label(root, text='Error[%]', font=helv12, width=7).grid(row=12, column=11, sticky=E)
var_error.set(" ")
en_iter=Entry(root, textvariable=var_iterations).grid(row=11, column=12, sticky=E)
en_error=Entry(root, textvariable=var_error).grid(row=12, column=12, sticky=E)
fo_w1=Label(root, text='W1[mm]', font=helv12, width=7).grid(row=13, column=9, sticky=E)
var_W1_final.set(W1)
en_W1_final=Entry(root, textvariable=var_W1_final).grid(row=13, column=10, sticky=W)
fo_l2=Label(root, text='W2[mm]', font=helv12, width=7).grid(row=13, column=11, sticky=E)
var_W2_final.set(W2)
en_W2_final=Entry(root, textvariable=var_W2_final).grid(row=13, column=12, sticky=E)
fo_l1=Label(root, text='l1[mm]', font=helv12, width=6).grid(row=14, column=9, sticky=E)
var_l1_final.set(" ")
en_l1_final=Entry(root, textvariable=var_l1_final).grid(row=14, column=10, sticky=W)
fo_l2=Label(root, text='l2[mm]', font=helv12, width=6).grid(row=14, column=11, sticky=E)
var_l2_final.set(" ")
en_l2_final=Entry(root, textvariable=var_l2_final).grid(row=14, column=12, sticky=E)
salir.grid_forget()
salir.grid(row=15, rowspan=2, column=9, columnspan=4, sticky=W+E+N+S)
I would imagine that you are interrupting the mainloop whilst running your simulation. If you want to do both at the same time, you may need to look into making your program multi threaded so that both the mainloop and your simulation can run concurrently.