Support header-only libraries and add their include folder to the include path.

--- src/automeka.cpp
+++ src/automeka.cpp
@@ -144,6 +144,10 @@
   }

   struct project {
+    project() = default;
+    project(std::string name, fs::path path, std::vector<fs::path> sources, std::vector<fs::path> tests)
+      : name(std::move(name)), path(std::move(path)), sources(std::move(sources)), tests(std::move(tests)) {}
+
     std::string           name;
     fs::path              path;
     std::vector<fs::path> sources;
@@ -156,6 +160,9 @@
   auto const find_sources = [](fs::path root) {
     auto sources = std::vector<fs::path> {};

+    if (!fs::exists(root / folder::src))
+      return std::move(sources);
+
     for (auto it = fs::recursive_directory_iterator{root / folder::src}, end = fs::recursive_directory_iterator {}; it != end; ++it) {
       if (!fs::is_file(it))
         continue;
@@ -178,7 +185,27 @@
   auto const find_tests = [](fs::path root) {
     auto tests = std::vector<fs::path> {};

-    for (auto it = fs::recursive_directory_iterator{root / folder::src}, end = fs::recursive_directory_iterator {}; it != end; ++it) {
+    if (fs::exists(root / folder::src)) {
+      for (auto it = fs::recursive_directory_iterator{root / folder::src}, end = fs::recursive_directory_iterator {}; it != end; ++it) {
+        if (!fs::is_file(it))
+          continue;
+
+        auto const path = *it;
+        auto const ext  = fs::extension(path);
+        if (std::find(std::begin(extension::cpp), std::end(extension::cpp), ext) == std::end(extension::cpp))
+          continue;
+
+        if (!boost::algorithm::ends_with(fs::filename(path), suffix::test + ext))
+          continue;
+
+        tests.emplace_back(fs::relative(root, *it));
+      }
+    }
+
+    if (!fs::exists(root / folder::test))
+      return std::move(tests);
+
+    for (auto it = fs::recursive_directory_iterator{root / folder::test}, end = fs::recursive_directory_iterator {}; it != end; ++it) {
       if (!fs::is_file(it))
         continue;

@@ -187,24 +214,6 @@
       if (std::find(std::begin(extension::cpp), std::end(extension::cpp), ext) == std::end(extension::cpp))
         continue;

-      if (!boost::algorithm::ends_with(fs::filename(path), suffix::test + ext))
-        continue;
-
-      tests.emplace_back(fs::relative(root, *it));
-    }
-
-    if (!fs::exists(root / folder::test))
-      return std::move(tests);
-
-    for (auto it = fs::recursive_directory_iterator{root / folder::test}, end = fs::recursive_directory_iterator {}; it != end; ++it) {
-      if (!fs::is_file(it))
-        continue;
-
-      auto const path = *it;
-      auto const ext  = fs::extension(path);
-      if (std::find(std::begin(extension::cpp), std::end(extension::cpp), ext) == std::end(extension::cpp))
-        continue;
-
       tests.emplace_back(fs::relative(root, *it));
     }

@@ -225,7 +234,10 @@
         continue;
       }

-      if (base != folder::src)
+      if (base == folder::include && fs::exists(*it / ".." / folder::src))
+        continue;
+
+      if (base != folder::src && base != folder::include)
         continue;

       it.no_push();
@@ -239,7 +251,7 @@
       }
       names.insert(name);

-      projects.push_back({ name, relp, find_sources(path), find_tests(path) });
+      projects.emplace_back(name, relp, find_sources(path), find_tests(path));
     }

     return std::move(projects);


Fix P calculation

Fix P calculation

--- src/balancer.cpp
+++ src/balancer.cpp
@@ -174,7 +174,7 @@

       // delta t
       double delta_t = req.time_delta.toSec();
-      ROS_INFO_STREAM("delta_t: " << delta_t);
+      ROS_DEBUG_STREAM("delta_t: " << delta_t);

       // Working vector
       Vector3d temp_vector;
@@ -295,7 +295,7 @@
       ROS_DEBUG("Calculating P");
       MatrixNd P(POLE_DOF + req.joint_velocity.size(), req.joint_velocity.size());
       P.set_zero();
-      P.set_sub_mat(POLE_DOF, 0, MatrixNd::identity(req.joint_velocity.size()));
+      P.set_sub_mat(0, 0, MatrixNd::identity(req.joint_velocity.size()));

       // Result vector
       // Torques, f_n, f_s, f_t, f_robot, v_(t + t_delta)
@@ -350,10 +350,12 @@
       ROS_DEBUG("Inverting M");
       MatrixNd M_inverse = M;
       linAlgd.invert(M_inverse);
+      ROS_DEBUG_STREAM("M_inverse: " << endl << M_inverse);

       ROS_DEBUG("Calculating M_inverse P");
       MatrixNd M_inverse_P(M_inverse.rows(), P.columns());
       M_inverse.mult(P, M_inverse_P);
+      ROS_DEBUG_STREAM("M_inverse_P" << M_inverse_P);
       M_inverse_P *= delta_t;
       A.set_sub_mat(idx, torque_idx, M_inverse_P);

@@ -361,20 +363,24 @@
       MatrixNd M_inverse_N(M_inverse.rows(), N.columns());
       M_inverse.mult(N, M_inverse_N);
       A.set_sub_mat(idx, f_n_idx, M_inverse_N);
+      ROS_DEBUG_STREAM("M_inverse_N" << M_inverse_N);

       ROS_DEBUG("Calculating M_inverse S");
       MatrixNd M_inverse_S(M_inverse.rows(), S.columns());
       M_inverse.mult(S, M_inverse_S);
+      ROS_DEBUG_STREAM("M_inverse_S" << M_inverse_S);
       A.set_sub_mat(idx, f_s_idx, M_inverse_S);

       ROS_DEBUG("Calculating M_inverse T");
       MatrixNd M_inverse_T(M_inverse.rows(), T.columns());
       M_inverse.mult(T, M_inverse_T);
+      ROS_DEBUG_STREAM("M_inverse_T" << M_inverse_S);
       A.set_sub_mat(idx, f_t_idx, M_inverse_T);

       ROS_DEBUG("Calculating M_inverse Q");
       MatrixNd M_inverse_Q(M_inverse.rows(), Q.columns());
       M_inverse.mult(Q, M_inverse_Q);
+      ROS_DEBUG_STREAM("M_inverse_Q" << M_inverse_Q);
       M_inverse_Q *= delta_t;
       A.set_sub_mat(idx, f_robot_idx, M_inverse_Q);

@@ -384,7 +390,9 @@
       VectorNd M_inverse_F_ext(POLE_DOF);
       M_inverse_F_ext.set_zero();
       M_inverse.mult(f_ext, M_inverse_F_ext, delta_t);
+      ROS_DEBUG_STREAM("M_inverse F_ext" << M_inverse_F_ext);
       M_inverse_F_ext.negate() -= v;
+      ROS_DEBUG_STREAM("-v - M_inverse F_ext" << M_inverse_F_ext);
       b.set_sub_vec(idx, M_inverse_F_ext);

       // Linear inequality constraints
@@ -479,9 +487,7 @@
       z.get_sub_vec(v_t_delta_robot_idx, v_t_delta_robot_idx + req.torque_limits.size(), arm_velocities);
       ROS_INFO_STREAM("arm_velocities: " << arm_velocities);

-      ROS_INFO_STREAM("f_robot: " << z[f_robot_idx]);
-
-      ROS_INFO_STREAM("f_n: " << z[f_n_idx] << " f_s: " << z[f_s_idx] << " f_t: " << z[f_t_idx]);
+      ROS_INFO_STREAM("f_robot: " << z[f_robot_idx] << " f_n: " << z[f_n_idx] << " f_s: " << z[f_s_idx] << " f_t: " << z[f_t_idx]);

       res.torques.reserve(req.torque_limits.size());
       for (unsigned int i = torque_idx; i < torque_idx + req.torque_limits.size(); ++i) {


Remove unused and untested function.

Remove unused and untested function.

--- src/DO/Core/Image.hpp
+++ src/DO/Core/Image.hpp
@@ -117,28 +117,6 @@
     { return Filter<Color, N>(*this)(param); }
   };

-  // ====================================================================== //
-  // Construct image views from row major multi-array.
-  //! \todo Check this functionality...
-#define DEFINE_IMAGE_VIEW_FROM_COLMAJOR_MULTIARRAY(Colorspace)          \
-  /*! \brief Reinterpret column-major matrix as an image. */            \
-  template <typename T>                                                 \
-  inline Image<Color<T, Colorspace>, Colorspace::size>                  \
-  as##Colorspace##Image(const MultiArray<Matrix<T,3,1>,                 \
-                                         Colorspace::size,              \
-                                         ColMajor>& M)                  \
-  {                                                                     \
-    return Image<Color<T, Colorspace> >(                                \
-      reinterpret_cast<Color<T, Colorspace> *>(M.data()),               \
-      M.sizes() );                                                      \
-  }
-
-  DEFINE_IMAGE_VIEW_FROM_COLMAJOR_MULTIARRAY(Rgb)
-  DEFINE_IMAGE_VIEW_FROM_COLMAJOR_MULTIARRAY(Rgba)
-  DEFINE_IMAGE_VIEW_FROM_COLMAJOR_MULTIARRAY(Cmyk)
-  DEFINE_IMAGE_VIEW_FROM_COLMAJOR_MULTIARRAY(Yuv)
-#undef DEFINE_IMAGE_VIEW_FROM_COLMAJOR_MULTIARRAY
-

   // ====================================================================== //
   // Generic image conversion function.


fix(bar): Improve error message for unparsable color

--- src/components/bar.cpp
+++ src/components/bar.cpp
@@ -180,18 +180,26 @@
     }
   }

+  const auto parse_or_throw = [&](string key, string def) {
+    try {
+      return color::parse(m_conf.get(bs, key, def));
+    } catch (const exception& err) {
+      throw application_error(sstream() << "Failed to set " << key << " (reason: " << err.what() << ")");
+    }
+  };
+
   // Load foreground/background
-  m_opts.background = color::parse(m_conf.get(bs, "background", color_util::hex<uint16_t>(m_opts.background)));
-  m_opts.foreground = color::parse(m_conf.get(bs, "foreground", color_util::hex<uint16_t>(m_opts.foreground)));
+  m_opts.background = parse_or_throw("background", color_util::hex<uint16_t>(m_opts.background));
+  m_opts.foreground = parse_or_throw("foreground", color_util::hex<uint16_t>(m_opts.foreground));

   // Load over-/underline color and size (warn about deprecated params if used)
-  auto line_color = color::parse(m_conf.get(bs, "line-color", "#f00"s));
+  auto line_color = parse_or_throw("line-color", "#f00"s);
   auto line_size = m_conf.get(bs, "line-size", 0);

   m_opts.overline.size = m_conf.get(bs, "overline-size", line_size);
-  m_opts.overline.color = color::parse(m_conf.get(bs, "overline-color", line_color));
+  m_opts.overline.color = parse_or_throw("overline-color", line_color);
   m_opts.underline.size = m_conf.get(bs, "underline-size", line_size);
-  m_opts.underline.color = color::parse(m_conf.get(bs, "underline-color", line_color));
+  m_opts.underline.color = parse_or_throw("underline-color", line_color);

   // Load border settings
   auto border_size = m_conf.get(bs, "border-size", 0);
@@ -199,16 +207,16 @@

   m_opts.borders.emplace(edge::TOP, border_settings{});
   m_opts.borders[edge::TOP].size = m_conf.deprecated(bs, "border-top", "border-top-size", border_size);
-  m_opts.borders[edge::TOP].color = color::parse(m_conf.get(bs, "border-top-color", border_color));
+  m_opts.borders[edge::TOP].color = parse_or_throw("border-top-color", border_color);
   m_opts.borders.emplace(edge::BOTTOM, border_settings{});
   m_opts.borders[edge::BOTTOM].size = m_conf.deprecated(bs, "border-bottom", "border-bottom-size", border_size);
-  m_opts.borders[edge::BOTTOM].color = color::parse(m_conf.get(bs, "border-bottom-color", border_color));
+  m_opts.borders[edge::BOTTOM].color = parse_or_throw("border-bottom-color", border_color);
   m_opts.borders.emplace(edge::LEFT, border_settings{});
   m_opts.borders[edge::LEFT].size = m_conf.deprecated(bs, "border-left", "border-left-size", border_size);
-  m_opts.borders[edge::LEFT].color = color::parse(m_conf.get(bs, "border-left-color", border_color));
+  m_opts.borders[edge::LEFT].color = parse_or_throw("border-left-color", border_color);
   m_opts.borders.emplace(edge::RIGHT, border_settings{});
   m_opts.borders[edge::RIGHT].size = m_conf.deprecated(bs, "border-right", "border-right-size", border_size);
-  m_opts.borders[edge::RIGHT].color = color::parse(m_conf.get(bs, "border-right-color", border_color));
+  m_opts.borders[edge::RIGHT].color = parse_or_throw("border-right-color", border_color);

   // Load geometry values
   auto w = m_conf.get(m_conf.section(), "width", "100%"s);


fix: Allow explicit override with property shorthand

Refs #375

--- src/components/bar.cpp
+++ src/components/bar.cpp
@@ -137,23 +137,15 @@
   m_opts.locale = m_conf.get(bs, "locale", ""s);
   m_opts.radius = m_conf.get(bs, "radius", m_opts.radius);

-  try {
-    auto padding = m_conf.get<decltype(m_opts.padding.left)>(bs, "padding");
-    m_opts.padding.left = padding;
-    m_opts.padding.right = padding;
-  } catch (const key_error& err) {
-    m_opts.padding.left = m_conf.get(bs, "padding-left", m_opts.padding.left);
-    m_opts.padding.right = m_conf.get(bs, "padding-right", m_opts.padding.right);
-  }
-
-  try {
-    auto margin = m_conf.get<decltype(m_opts.padding.left)>(bs, "module-margin");
-    m_opts.module_margin.left = margin;
-    m_opts.module_margin.right = margin;
-  } catch (const key_error& err) {
-    m_opts.module_margin.left = m_conf.get(bs, "module-margin-left", m_opts.module_margin.left);
-    m_opts.module_margin.right = m_conf.get(bs, "module-margin-right", m_opts.module_margin.right);
-  }
+  auto padding = m_conf.get<unsigned int>(bs, "padding", 0U);
+  m_opts.padding.left = padding;
+  m_opts.padding.right = padding;
+  m_opts.padding.left = m_conf.get(bs, "padding-left", padding);
+  m_opts.padding.right = m_conf.get(bs, "padding-right", padding);
+
+  auto margin = m_conf.get<unsigned int>(bs, "module-margin", 0U);
+  m_opts.module_margin.left = m_conf.get(bs, "module-margin-left", margin);
+  m_opts.module_margin.right = m_conf.get(bs, "module-margin-right", margin);

   if (only_initialize_values) {
     return;


use GCD of array to solve it elegant, refer to other's algorithm, good

--- codeforces/2/201/C.cpp
+++ codeforces/2/201/C.cpp
@@ -1,67 +1,65 @@
-#include <iostream>
-#include <vector>
-#include <set>
-#include <string>
-#include <algorithm>
-#include <cmath>
-using namespace std;
-
-int main()
-{
-    int n = 0;
-    cin >> n;
-    vector<long long> v(n, 0);
-    for (int i = 0; i < n; ++i)
-    {
-        cin >> v[i];
-    }
-
-
-    // Alice opration
-    bool Alicefound = false;
-    long long diff = 0;
-    while (true)
-    {
-AliceOperation:for (int i = 0; i < v.size(); ++i)
-        {
-            for (int j = i + 1; j < v.size(); ++j)
-            {
-                diff = abs(v[i] - v[j]);
-                if (count(v.begin(), v.end(), diff) == 0)
-                {
-                    v.push_back(diff);
-                    Alicefound = true;
-                    goto BobOperation;
-                }
-            }
-        }
-
-        if (!Alicefound)
-        {
-            cout << "Bob" << endl;
-            break;
-        }
-
-        // Bob operation
-BobOperation: for (int i = 0; i < v.size(); ++i)
-        {
-            for (int j = i + 1; j < v.size(); ++j)
-            {
-                diff = abs(v[i] - v[j]);
-                if (count(v.begin(), v.end(), diff) == 0)
-                {
-                    v.push_back(diff);
-                    Alicefound = false;
-                    goto AliceOperation;
-                }
-            }
-        }
-
-        if (Alicefound)
-        {
-            cout << "Alice" << endl;
-            break;
-        }
-    }
-    return 0;
-}
+#include <iostream>
+#include <string>
+#include <vector>
+#include <algorithm>
+using namespace std;
+
+// Greatest Common Divisor between a and b
+long long gcd(long long a, long long b)
+{
+	while (b != 0)
+	{
+		long long r = a % b;
+		a = b;
+		b = r;
+	}
+	return a;
+}
+
+
+// return the greatest common divisor among all values in v
+// Time complexity:
+long long arrayGcd(vector<long long> v)
+{
+	long long result = v[0];
+	for (int i = 1; i < v.size(); ++i)
+	{
+		result = gcd(result, v[i]);
+	}
+
+    return result;
+}
+
+int main()
+{
+	// read input
+	int n = 0;
+	cin >> n;
+	vector<long long> v(n, 0);
+	for (int i = 0; i < n; ++i)
+	{
+		cin >> v[i];
+	}
+
+
+	long long max_elem = *max_element(v.begin(), v.end());
+	long long d = arrayGcd(v);
+
+	long long remain_round = max_elem / d - v.size();
+	if (remain_round % 2 == 1)
+	{
+		cout << "Alice" << endl;
+	}
+	else
+	{
+		cout << "Bob" << endl;
+	}
+	return 0;
+}
+
+
+// Summary:
+// 1. calculate GCD use Euler Algorithm
+// 2. calculate other GCD always depends on Euler's GCD Algorithm
+// 3. figure out why we can achieve all the differece |x-y| in such
+//    way, what's behind ? Number Theory ?


Add operator= that gcc wants to use

Add operator= that gcc wants to use

--- libraries/api/include/bts/api/api_metadata.hpp
+++ libraries/api/include/bts/api/api_metadata.hpp
@@ -54,6 +54,14 @@
       classification(classification),
       default_value(default_value)
     {}
+    parameter_data& operator=(const parameter_data& rhs)
+    {
+      name = rhs.name;
+      type = rhs.type;
+      classification = rhs.classification;
+      default_value = rhs.default_value;
+      return *this;
+    }
   };

   typedef std::function<fc::variant(const fc::variants& params)> json_api_method_type;


Added throws on error conditions on inserting and retrieving values from a CircularBuffer.

Signed-off-by: Steve S. Sylvester <b0839a0405c3f908ea9b10b668e5564aefda5af5@intel.com>

--- src/CircularBuffer.hpp
+++ src/CircularBuffer.hpp
@@ -36,6 +36,8 @@
 #include <stdlib.h>
 #include <vector>

+#include "Exception.hpp"
+
 namespace geopm
 {
     /// @brief Templated container for a circular buffer implementation.
@@ -172,6 +174,9 @@
     template <class type>
     void CircularBuffer<type>::insert(const type value)
     {
+        if (m_max_size < 1) {
+            throw Exception("CircularBuffer::insert(): Cannot insert into a bufffer of 0 size", GEOPM_ERROR_RUNTIME, __FILE__, __LINE__);
+        }
         if (m_count < m_max_size) {
             m_buffer.push_back(value);
             m_count++;
@@ -185,6 +190,9 @@
     template <class type>
     type CircularBuffer<type>::value(const unsigned int index) const
     {
+        if (index >= m_count) {
+            throw Exception("CircularBuffer::value(): index is out of bounds", GEOPM_ERROR_INVALID, __FILE__, __LINE__);
+        }
         return m_buffer[(m_head+index) % m_max_size];
     }
 }


add warn_once which will print any given warning message only once.

--- src/base/misc.hh
+++ src/base/misc.hh
@@ -76,6 +76,19 @@
 #define warn(args...) \
     __warn__(args, cp::ArgListNull())

+// Only print the warning message the first time it is seen.  This
+// doesn't check the warning string itself, it just only lets one
+// warning come from the statement. So, even if the arguments change
+// and that would have resulted in a different warning message,
+// subsequent messages would still be supressed.
+#define warn_once(args...) do {                     \
+        static bool once = false;                   \
+        if (!once) {                                \
+            __warn__(args, cp::ArgListNull());      \
+            once = true;                            \
+        }                                           \
+    } while (0)
+
 //
 // assert() that prints out the current cycle
 //


Penalty term temporary set to zero.

Penalty term temporary set to zero.

--- library/SolverUtils/Diffusion/DiffusionLDG.cpp
+++ library/SolverUtils/Diffusion/DiffusionLDG.cpp
@@ -61,7 +61,7 @@
             const Array<OneD, Array<OneD, NekDouble> >        &inarray,
                   Array<OneD, Array<OneD, NekDouble> >        &outarray)
         {
-            //cout<<setprecision(16);
+            cout<<setprecision(16);
             int i, j, k, num;
             int nDim      = fields[0]->GetCoordim(0);
             int nPts      = fields[0]->GetTotPoints();
@@ -297,7 +297,7 @@
             int nvariables = fields.num_elements();
             int nDim       = qfield.num_elements();

-            NekDouble C11 = 1.0;
+            NekDouble C11 = 0.0;
             Array<OneD, NekDouble > Fwd(nTracePts);
             Array<OneD, NekDouble > Bwd(nTracePts);
             Array<OneD, NekDouble > Vn (nTracePts, 0.0);


menu typo

menu typo

--- src/bedtools.cpp
+++ src/bedtools.cpp
@@ -208,7 +208,7 @@
     cout  << "[ Format conversion ]" << endl;
     cout  << "    bamtobed      "  << "Convert BAM alignments to BED (& other) formats.\n";
     cout  << "    bedtobam      "  << "Convert intervals to BAM records.\n";
-    cout  << "    bedtofastq    "  << "Convert BAM records to FASTQ records.\n";
+    cout  << "    bamtofastq    "  << "Convert BAM records to FASTQ records.\n";
     cout  << "    bedpetobam    "  << "Convert BEDPE intervals to BAM records.\n";
     cout  << "    bed12tobed6   "  << "Breaks BED12 intervals into discrete BED6 intervals.\n";


golangcode: update cgo

golangcode: update cgo

--- liteidex/src/plugins/golangcode/golangcode.cpp
+++ liteidex/src/plugins/golangcode/golangcode.cpp
@@ -338,7 +338,8 @@
           << "char" << "schar" << "uchar"
           << "long" << "ulong"
           << "longlong" << "ulonglong"
-          << "float" << "double";
+          << "float" << "double"
+          << "complexfloat" << "complexdouble";
     QIcon icon = m_golangAst->iconFromTagEnum(LiteApi::TagType,true);
     foreach(QString item, types) {
         m_completer->appendChildItem(root,item,"type","",icon,true);
@@ -348,6 +349,7 @@
     m_completer->appendChildItem(root,"GoString","func","func(*C.char) string",icon,true);
     m_completer->appendChildItem(root,"GoStringN","func","func(*C.char, C.int) string",icon,true);
     m_completer->appendChildItem(root,"GoBytes","func","func(unsafe.Pointer, C.int) []byte",icon,true);
+    m_completer->appendChildItem(root,"CBytes","func","func([]byte) unsafe.Pointer",icon,true);
     m_completer->updateCompleterModel();
     m_completer->showPopup();
 }


Fix typo in oracle command call.

Fix typo in oracle command call.

--- liteidex/src/plugins/golangedit/golangedit.cpp
+++ liteidex/src/plugins/golangedit/golangedit.cpp
@@ -811,7 +811,7 @@

 void GolangEdit::oracleCallees()
 {
-    runOracle("calless");
+    runOracle("callees");
 }

 void GolangEdit::oracleCallers()


Move unnamed namespace out of extern "C" - there's really no need for that.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@32518 27541ba8-7e3a-0410-8455-c3a389f83636

--- cint/cint/src/ifunc.cxx
+++ cint/cint/src/ifunc.cxx
@@ -20,6 +20,15 @@

 extern "C" void G__exec_alloc_lock();
 extern "C" void G__exec_alloc_unlock();
+
+//______________________________________________________________________________
+namespace {
+static std::map<int /*tagnum*/, std::set<G__ifunc_table> > & G__ifunc_refs()
+{
+   static std::map<int /*tagnum*/, std::set<G__ifunc_table> > ifunc_refs;
+   return ifunc_refs;
+}
+} // unnamed namespace

 extern "C" {

@@ -7256,15 +7265,6 @@

 //______________________________________________________________________________
-namespace {
-static std::map<int /*tagnum*/, std::set<G__ifunc_table> > & G__ifunc_refs()
-{
-   static std::map<int /*tagnum*/, std::set<G__ifunc_table> > ifunc_refs;
-   return ifunc_refs;
-}
-} // unnamed namespace
-
-//______________________________________________________________________________
 struct G__ifunc_table* G__get_ifunc_ref(struct G__ifunc_table_internal* ifunc)
 {
    // -- Returns the G__ifunc_table reference object for an internal G__ifunc_table_internal and creates it if it doesn't exist.


Fix output path for LMTV vehicle demo

Fix output path for LMTV vehicle demo

--- src/demos/vehicle/demo_LMTV/demo_VEH_LMTV_ride.cpp
+++ src/demos/vehicle/demo_LMTV/demo_VEH_LMTV_ride.cpp
@@ -83,7 +83,7 @@
 double target_speed = 5 * mph_to_ms;

 // output directory
-const std::string out_dir = "../LMTV_QUALITY";
+const std::string out_dir = GetChronoOutputPath() + "LMTV_QUALITY";
 const std::string pov_dir = out_dir + "/POVRAY";
 bool povray_output = false;
 bool data_output = true;


Fix null pointer deref (in case wher index is pointing to the temporary file)

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@34965 27541ba8-7e3a-0410-8455-c3a389f83636

--- cint/cint/src/tmplt.cxx
+++ cint/cint/src/tmplt.cxx
@@ -2207,7 +2207,7 @@
       int index = gValue.tagnum;
       index = G__struct.filenum[index];
       if( index < 0 ) return -3;
-      if (G__srcfile[index].filename[0] == '{')
+      if (G__srcfile[index].filename && G__srcfile[index].filename[0] == '{')
          // ignore "{CINTEX dictionary translator}"
          return -4;
       index = G__findSrcFile(index, gValue.tagnum, headers, fwdDecls, unknown);


MSVC: Adding defines for alignof and alignas

--- utils/memory_arena.hpp
+++ utils/memory_arena.hpp
@@ -6,6 +6,11 @@
 #include <utility>
 #include <vector>
 #include "slice.hpp"
+
+#ifdef _MSC_VER
+#define alignof(T) __alignof(T)
+#define alignas(T) __declspec(align(T))
+#endif

 /**
  * A memory arena.


Insure that dictionary for climit and valarray also include algorithm and using namespace std
Fix a problem with the wrapper around function returning a function pointer (For G__c_xlib)

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@12397 27541ba8-7e3a-0410-8455-c3a389f83636

--- cint/src/v6_newlink.cxx
+++ cint/src/v6_newlink.cxx
@@ -729,7 +729,8 @@
          strcmp(fname,"deque")==0 || strcmp(fname,"map")==0 ||
          strcmp(fname,"multimap")==0 || strcmp(fname,"set")==0 ||
          strcmp(fname,"multiset")==0 || strcmp(fname,"stack")==0 ||
-         strcmp(fname,"queue")==0) {
+         strcmp(fname,"queue")==0 || strcmp(fname,"climits")==0 ||
+         strcmp(fname,"valarray")==0) {
         algoflag |= 1;
       }
       if(strcmp(fname,"vector.h")==0 || strcmp(fname,"list.h")==0 ||
@@ -3898,6 +3899,10 @@
     fprintf(fp,"      ");
     sprintf(endoffunc,";");
     return(0);
+  case '1':
+    fprintf(fp,"      G__letint(result7,%d,(long)",type);
+    sprintf(endoffunc,");");
+    return(0);
   case 'e':
   case 'c':
   case 's':


Fix motor invert

Fix motor invert

--- src/StepperControl.cpp
+++ src/StepperControl.cpp
@@ -1028,9 +1028,9 @@
   stepsAcc[1] = ParameterList::getInstance()->getValue(MOVEMENT_STEPS_ACC_DEC_Y);
   stepsAcc[2] = ParameterList::getInstance()->getValue(MOVEMENT_STEPS_ACC_DEC_Z);

-  motorInv[0] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_MOTOR_X);
-  motorInv[1] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_MOTOR_Y);
-  motorInv[2] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_MOTOR_Z);
+  motorInv[0] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_INVERT_MOTOR_X));
+  motorInv[1] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_INVERT_MOTOR_Y));
+  motorInv[2] = intToBool(ParameterList::getInstance()->getValue(MOVEMENT_INVERT_MOTOR_Z));

   endStInv[0] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_ENDPOINTS_X);
   endStInv[1] = ParameterList::getInstance()->getValue(MOVEMENT_INVERT_ENDPOINTS_Y);


removed unused StragglerEvent file

removed unused StragglerEvent file

--- src/StragglerEvent.hpp
+++ src/StragglerEvent.hpp
@@ -1,30 +0,0 @@
-#ifndef STRAGGLER_EVENT_HPP
-#define STRAGGLER_EVENT_HPP
-
-namespace warped {
-
-// This is a Straggler event class
-class StragglerEvent : public Event {
-public:
-    StragglerEvent() = default;
-    StragglerEvent( const std::string& receiver_name,
-                    const std::string& sender_name,
-                    unsigned int timestamp )
-        :   receiver_name_(receiver_name),
-            sender_name_(sender_name),
-            timestamp_(timestamp)
-    {}
-
-    const std::string& receiverName() const { return receiver_name_; }
-    const std::string& senderName() const { return sender_name_; }
-    unsigned int timestamp() const { return timestamp_; }
-
-    std::string receiver_name_;
-    std::string sender_name_;
-    unsigned int timestamp_;
-    const std::vector<const std::unique_ptr<Event>> events_to_cancel_;
-};
-
-} // namespace warped
-
-#endif


[clangd] Add TUScheduler.h to CodeComplete.cpp to unbreak builds

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@370895 91177308-0d34-0410-b5e6-96231b3b80d8

--- clangd/CodeComplete.cpp
+++ clangd/CodeComplete.cpp
@@ -31,6 +31,7 @@
 #include "Protocol.h"
 #include "Quality.h"
 #include "SourceCode.h"
+#include "TUScheduler.h"
 #include "Threading.h"
 #include "Trace.h"
 #include "URI.h"


doofit::roofit::functions::pdfs::bdecay::Coefficient: corrected wrong sign in osh coefficient

--- src/doofit/roofit/functions/bdecay/Coefficient.cxx
+++ src/doofit/roofit/functions/bdecay/Coefficient.cxx
@@ -51,11 +51,11 @@
     return +1.0 * cp_coeff_ * ( tag_ - production_asym_ * ( 1.0 - tag_ * mistag_b_ + tag_ * mistag_bbar_ ) - tag_ * ( mistag_b_ + mistag_bbar_ ) );
   }
   else if (coeff_type_ == kSinh){
-    // TODO: Implement Sinh coefficient if necessary!
+    // TODO: Implement Sinh coefficient
     return cp_coeff_;
   }
   else if (coeff_type_ == kCosh){
-    return cp_coeff_ * ( 1.0 + tag_ * production_asym_ * ( 1.0 - mistag_b_ - mistag_bbar_ ) + tag_ * ( mistag_b_ - mistag_bbar_ ) );
+    return cp_coeff_ * ( 1.0 - tag_ * production_asym_ * ( 1.0 - mistag_b_ - mistag_bbar_ ) - tag_ * ( mistag_b_ - mistag_bbar_ ) );
   }
   else{
     std::cout << "ERROR\t" << "Coefficient::evaluate(): No valid coefficient type!" << std::endl;
@@ -124,6 +124,7 @@
   }
 }

+
 } // namespace bdecay
 } // namespace functions
 } // namespace roofit


fill values only when needed in reader

fill values only when needed in reader

--- src/dtkDistributed/dtkDistributedGraphTopology.tpp
+++ src/dtkDistributed/dtkDistributedGraphTopology.tpp
@@ -359,7 +359,9 @@
                     v_gid = std::stoi (linestd, &sz) -1;
                     linestd2 = linestd.substr(sz);
                     val = std::stoi (linestd2, &sz) -1;
-                    value = (is_double) ? std::stod (linestd2.substr(sz)) : std::stoi (linestd2.substr(sz));
+                    if (values) {
+                        value = (is_double) ? std::stod (linestd2.substr(sz)) : std::stoi (linestd2.substr(sz));
+                    }
                     ++e_local_count;
                     ++edges_size;
                     ++e_gid;
@@ -415,7 +417,7 @@
                         }

                     } else if (v_gid < v_last_line) {
-                        qCritical() << "i values should be sorted !, aborting reading of "<< filename;
+                        qCritical() << "i values should be sorted !, aborting reading of "<< filename <<v_gid << v_last_line;
                         return false;
                     } else { // new vertex


Implement clConvolutionEx

Implement clConvolutionEx

--- clguetzli/clguetzli.cpp
+++ clguetzli/clguetzli.cpp
@@ -243,14 +243,51 @@
 		memcpy(channel, resultPtr, sizeof(cl_float) * xsize * ysize);
 	}
 }
-//=========================================================
-// ian todo
-void clConvolutionEx(cl_mem image, size_t xsize, size_t ysize,
-				     cl_mem expn, size_t expn_size,
-                     int step, int offset, double border_ratio,
+
+void clConvolutionEx(cl_mem inp, size_t xsize, size_t ysize,
+				     cl_mem multipliers, size_t len,
+                     int xstep, int offset, double border_ratio,
                      cl_mem result/*out*/)
 {
-	// Convolution
+	cl_int err = CL_SUCCESS;
+	ocl_args_d_t &ocl = getOcl();
+
+	size_t oxsize = xsize / xstep;
+
+	ocl.allocA(sizeof(cl_float) * len);
+	ocl.allocB(sizeof(cl_float) * xsize * ysize);
+	ocl.allocC(sizeof(cl_float) * oxsize * ysize);
+
+	memcpy(ocl.inputA, multipliers, sizeof(cl_float) * len);
+	memcpy(ocl.inputB, inp, sizeof(cl_float) * xsize * ysize);
+
+	cl_int clxsize = xsize;
+	cl_int clxstep = xstep;
+	cl_int cllen = len;
+	cl_int cloffset = offset;
+	cl_float clborder_ratio = border_ratio;
+
+	cl_kernel kernel = ocl.kernel[KERNEL_CONVOLUTION];
+	clSetKernelArg(kernel, 0, sizeof(cl_mem), (void*)&multipliers);
+	clSetKernelArg(kernel, 1, sizeof(cl_mem), (void*)&inp);
+	clSetKernelArg(kernel, 2, sizeof(cl_mem), (void*)&result);
+	clSetKernelArg(kernel, 3, sizeof(cl_int), (void*)&clxsize);
+	clSetKernelArg(kernel, 4, sizeof(cl_int), (void*)&clxstep);
+	clSetKernelArg(kernel, 5, sizeof(cl_int), (void*)&cllen);
+	clSetKernelArg(kernel, 6, sizeof(cl_int), (void*)&cloffset);
+	clSetKernelArg(kernel, 7, sizeof(cl_float), (void*)&clborder_ratio);
+
+	size_t globalWorkSize[2] = { oxsize, ysize };
+	err = clEnqueueNDRangeKernel(ocl.commandQueue, kernel, 2, NULL, globalWorkSize, NULL, 0, NULL, NULL);
+	if (CL_SUCCESS != err)
+	{
+		LogError("Error: clBuildProgram() for source program returned %s.\n", TranslateOpenCLError(err));
+	}
+	err = clFinish(ocl.commandQueue);
+	if (CL_SUCCESS != err)
+	{
+		LogError("Error: clBuildProgram() for source program returned %s.\n", TranslateOpenCLError(err));
+	}
 }

 // ian todo


Patch from Philippe fixing a problem preventing a correct generation of TBenchDict.cxx

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@5324 27541ba8-7e3a-0410-8455-c3a389f83636

--- utils/src/rootcint.cxx
+++ utils/src/rootcint.cxx
@@ -1,4 +1,4 @@
-// @(#)root/utils:$Name:  $:$Id: rootcint.cxx,v 1.99 2002/09/12 16:25:01 brun Exp $
+// @(#)root/utils:$Name:  $:$Id: rootcint.cxx,v 1.100 2002/09/16 16:19:41 brun Exp $
 // Author: Fons Rademakers   13/07/96

 /*************************************************************************
@@ -836,7 +836,7 @@
    string stlType;
    stlType = ShortTypeName(m.Type()->Name());
    string stlName;
-   stlName = stlName,ShortTypeName(m.Name());
+   stlName = ShortTypeName(m.Name());

    string fulName1,fulName2;
    const char *tcl1=0,*tcl2=0;


INTEGRATION: CWS ooo19126 (1.5.430); FILE MERGED 2005/09/05 14:15:46 rt 1.5.430.1: #i54170# Change license header: remove SISSL

--- svx/inc/macropg.hxx
+++ svx/inc/macropg.hxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: macropg.hxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.6 $
  *
- *  last change: $Author: kz $ $Date: 2005-01-21 14:55:52 $
+ *  last change: $Author: rt $ $Date: 2005-09-08 18:02:51 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (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.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    This library 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
+ *    Lesser General Public License for more details.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/
 #ifndef _MACROPG_HXX


lib/core/chrono/time_li: accept Time in ctor and set().

--- lib/core/src/quanta/core/chrono/time_li.cpp
+++ lib/core/src/quanta/core/chrono/time_li.cpp
@@ -15,7 +15,10 @@
 namespace time {

 TOGO_LI_FUNC_DEF(__mm_ctor) {
-	lua::new_userdata<Time>(L);
+	auto t = lua::new_userdata<Time>(L);
+	if (!lua_isnone(L, 1)) {
+		*t = *lua::get_pointer<Time>(L, 1);
+	}
 	return 1;
 }

@@ -194,10 +197,14 @@

 TOGO_LI_FUNC_DEF(set) {
 	auto t = lua::get_pointer<Time>(L, 1);
-	auto h = luaL_checkinteger(L, 2);
-	auto m = luaL_checkinteger(L, 3);
-	auto s = luaL_checkinteger(L, 4);
-	time::set(*t, h, m, s);
+	if (lua_type(L, 1) != LUA_TNUMBER) {
+		*t = *lua::get_pointer<Time>(L, 1);
+	} else {
+		auto h = luaL_checkinteger(L, 2);
+		auto m = luaL_checkinteger(L, 3);
+		auto s = luaL_checkinteger(L, 4);
+		time::set(*t, h, m, s);
+	}
 	return 0;
 }


PTA: fix compatibility with LLVM < 3.7

PTA: fix compatibility with LLVM < 3.7

Replace indices() with getIndices()
(the former returns range and the latter ArrayRef,
but the latter is defined even for LLVM < 3.7).

This with the previous commit fixes #268.

--- lib/llvm/analysis/PointsTo/Instructions.cpp
+++ lib/llvm/analysis/PointsTo/Instructions.cpp
@@ -116,7 +116,7 @@
         = llvm::dyn_cast<llvm::CompositeType>(EV->getAggregateOperand()->getType());
     assert(type && "Don't have composite type in extractvalue");

-    for (unsigned idx : EV->indices()) {
+    for (unsigned idx : EV->getIndices()) {
         assert(type->indexValid(idx) && "Invalid index");
         if (llvm::StructType *STy = llvm::dyn_cast<llvm::StructType>(type)) {
             const llvm::StructLayout *SL = DL.getStructLayout(STy);


Changed the format_time from MM/DD/YY to MM/DD/YYYY.

--- src/condor_c++_util/format_time.C
+++ src/condor_c++_util/format_time.C
@@ -60,8 +60,8 @@
 	}

     tm = localtime( &date );
-    sprintf( buf, "%2d/%02d/%-2d %02d:%02d",
-        (tm->tm_mon)+1, tm->tm_mday, tm->tm_year, tm->tm_hour, tm->tm_min
+    sprintf( buf, "%2d/%02d/%-4d %02d:%02d",
+        (tm->tm_mon)+1, tm->tm_mday, (tm->tm_year + 1900), tm->tm_hour, tm->tm_min
     );
     return buf;
 }


file types.h has gone away, so we shouldn't include it!

--- src/condor_c++_util/format_time.C
+++ src/condor_c++_util/format_time.C
@@ -23,9 +23,6 @@

 #include "condor_common.h"

-#ifndef WIN32
-#include "types.h"
-#endif

 /*
   Format a date expressed in "UNIX time" into "month/day hour:minute".


deleted some spaces.

deleted some spaces.

--- src/ekf.cpp
+++ src/ekf.cpp
@@ -35,8 +35,8 @@

 // (6x1) state_, fSystem, KIMU, stateUpdate
 typedef Matrix<double, 6, 1> Vector6d;
-// (6x6) cov_, Q_, FSystem, covUpdate
-typedef Matrix<double, 6, 6, RowMajor> Matrix6d;
+// (6x6) cov_, Q_, FSystem, covUpdate
+typedef Matrix<double, 6, 6, RowMajor> Matrix6d;
 // (1x6) HIMU
 typedef Matrix<double, 1, 6> Matrix16;
 // (2x6) HEnc
@@ -80,7 +80,7 @@
   else{
     cf = sin(omega*dt/2)/(omega*dt/2);
   }
-
+
   // deltaX and deltaY are used a lot later. So, it makes sense to calculate them once now.
   double deltaX = cf*v*dt*cos(theta+omega*dt/2);
   double deltaY = cf*v*dt*sin(theta+omega*dt/2);
@@ -163,7 +163,7 @@
        0,   0,   1,   0,  dt,   0,
        0,   0,   0,   1,   0,   0,
        0,   0,   0,   0,   1,   0,
-       0,   0,   0,   0,   0,   1;
+       0,   0,   0,   0,   0,   1;
   return F;
 }


whitespace tweak

whitespace tweak

--- src/env.cpp
+++ src/env.cpp
@@ -1,6 +1,7 @@
 #include "env.hpp"

 namespace Vole {
+
   Env::Env(Env* par)
   : parent(par) { }


simplify: Refactor simplification algorithm into functions

This may or may not improve readability of the source code, but what it
definitely does improve is ability to profile this code by more clearly
attributing cost to various stages of the algorithm.

--- src/simplifier.cpp
+++ src/simplifier.cpp
@@ -429,7 +429,7 @@
 	Q.c *= s;
 }

-static float quadricError(Quadric& Q, const Vector3& v)
+static float quadricError(const Quadric& Q, const Vector3& v)
 {
 	float xx = v.x * v.x;
 	float xy = v.x * v.y;
@@ -490,6 +490,117 @@
 	quadricMul(Q, length * length * weight);
 }

+static void fillFaceQuadrics(Quadric* vertex_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap)
+{
+	for (size_t i = 0; i < index_count; i += 3)
+	{
+		unsigned int i0 = indices[i + 0];
+		unsigned int i1 = indices[i + 1];
+		unsigned int i2 = indices[i + 2];
+
+		// TODO: degenerate triangles can produce degenerate quadrics
+		// assert(i0 != i1 && i0 != i2 && i1 != i2);
+
+		Quadric Q;
+		quadricFromTriangle(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2]);
+
+		quadricAdd(vertex_quadrics[remap[i0]], Q);
+		quadricAdd(vertex_quadrics[remap[i1]], Q);
+		quadricAdd(vertex_quadrics[remap[i2]], Q);
+	}
+}
+
+static size_t fillEdgeQuadrics(Quadric* vertex_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap, const unsigned char* vertex_kind, const EdgeAdjacency& adjacency)
+{
+	size_t boundary = 0;
+
+	for (size_t i = 0; i < index_count; i += 3)
+	{
+		static const int next[3] = {1, 2, 0};
+
+		for (int e = 0; e < 3; ++e)
+		{
+			unsigned int i0 = indices[i + e];
+			unsigned int i1 = indices[i + next[e]];
+
+			// TODO: do we need to check vertex_kind[i1]? i0 can be locked and i1 can be seam...
+			if (vertex_kind[i0] != Kind_Border && vertex_kind[i0] != Kind_Seam)
+				continue;
+
+			// TODO: should this use wedge or edge search?
+			if (findEdge(adjacency, i1, i0))
+				continue;
+
+			unsigned int i2 = indices[i + next[next[e]]];
+
+			// TODO: degenerate triangles can produce degenerate quadrics
+			// assert(i0 != i1 && i0 != i2 && i1 != i2);
+
+			float edgeWeight = vertex_kind[i0] == Kind_Seam ? 1.f : 10.f;
+
+			Quadric Q;
+			quadricFromTriangleEdge(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], edgeWeight);
+
+			quadricAdd(vertex_quadrics[remap[i0]], Q);
+			quadricAdd(vertex_quadrics[remap[i1]], Q);
+
+			boundary++;
+		}
+	}
+
+	return boundary;
+}
+
+static size_t fillEdgeCollapses(Collapse* collapses, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const Quadric* vertex_quadrics, const unsigned int* remap, const unsigned char* vertex_kind)
+{
+	size_t collapse_count = 0;
+
+	for (size_t i = 0; i < index_count; i += 3)
+	{
+		static const int next[3] = {1, 2, 0};
+
+		for (int e = 0; e < 3; ++e)
+		{
+			unsigned int i0 = indices[i + e];
+			unsigned int i1 = indices[i + next[e]];
+
+			// TODO: i0==i1 is an interesting condition... it seems like it can arise when collapsing a seam loop
+			if (remap[i0] == remap[i1])
+				continue;
+
+			if (!kCanCollapse[vertex_kind[i0]][vertex_kind[i1]])
+				continue;
+
+			// TODO: Garland97 uses Q1+Q2 for error estimation; here we asssume that V1 produces zero error for Q1 but it actually gets larger with more collapses
+			if (vertex_kind[i0] == vertex_kind[i1])
+			{
+				// manifold edges should occur twice (i0->i1 and i1->i0) - skip redundant edges
+				// TODO: this should also work for seam edges, but it increases the error on some models...
+				if (vertex_kind[i0] == Kind_Manifold && i1 > i0)
+					continue;
+
+				// if vertex kinds match, we can collapse the edge in either direction - pick the one with minimum error
+				Collapse c01 = {i0, i1, {quadricError(vertex_quadrics[remap[i0]], vertex_positions[i1])}};
+				Collapse c10 = {i1, i0, {quadricError(vertex_quadrics[remap[i1]], vertex_positions[i0])}};
+				Collapse c = c01.error <= c10.error ? c01 : c10;
+				assert(c.error >= 0);
+
+				collapses[collapse_count++] = c;
+			}
+			else
+			{
+				// if vertex kinds are different, edge can only be collapsed in one direction
+				Collapse c = {i0, i1, {quadricError(vertex_quadrics[remap[i0]], vertex_positions[i1])}};
+				assert(c.error >= 0);
+
+				collapses[collapse_count++] = c;
+			}
+		}
+	}
+
+	return collapse_count;
+}
+
 static void sortEdgeCollapses(unsigned int* sort_order, const Collapse* collapses, size_t collapse_count)
 {
 	const int sort_bits = 11;
@@ -525,6 +636,87 @@

 		sort_order[histogram[key]++] = unsigned(i);
 	}
+}
+
+static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* collapse_locked, Quadric* vertex_quadrics, const Collapse* collapses, size_t collapse_count, const unsigned int* collapse_order, const unsigned int* remap, const unsigned int* wedge, const unsigned char* vertex_kind, size_t collapse_limit, float error_limit, float& pass_error)
+{
+	size_t pass_collapses = 0;
+
+	for (size_t i = 0; i < collapse_count; ++i)
+	{
+		const Collapse& c = collapses[collapse_order[i]];
+
+		unsigned int r0 = remap[c.v0];
+		unsigned int r1 = remap[c.v1];
+
+		if (collapse_locked[r0] || collapse_locked[r1])
+			continue;
+
+		if (c.error > error_limit)
+			break;
+
+		assert(collapse_remap[r0] == r0);
+		assert(collapse_remap[r1] == r1);
+
+		// TODO: this artificially magnifies future error with each collapse even for coplanar triangles
+		quadricAdd(vertex_quadrics[r1], vertex_quadrics[r0]);
+
+		if (vertex_kind[c.v0] == Kind_Seam)
+		{
+			// remap v0 to v1 and seam pair of v0 to seam pair of v1
+			unsigned int s0 = wedge[c.v0];
+			unsigned int s1 = wedge[c.v1];
+
+			assert(s0 != c.v0 && s1 != c.v1);
+
+			collapse_remap[c.v0] = c.v1;
+			collapse_remap[s0] = s1;
+		}
+		else
+		{
+			assert(wedge[c.v0] == c.v0);
+
+			collapse_remap[c.v0] = c.v1;
+		}
+
+		collapse_locked[r0] = 1;
+		collapse_locked[r1] = 1;
+
+		pass_collapses++;
+		pass_error = c.error;
+
+		if (pass_collapses >= collapse_limit)
+			break;
+	}
+
+	return pass_collapses;
+}
+
+static size_t remapIndexBuffer(unsigned int* indices, size_t index_count, const unsigned int* collapse_remap)
+{
+	size_t write = 0;
+
+	for (size_t i = 0; i < index_count; i += 3)
+	{
+		unsigned int v0 = collapse_remap[indices[i + 0]];
+		unsigned int v1 = collapse_remap[indices[i + 1]];
+		unsigned int v2 = collapse_remap[indices[i + 2]];
+
+		assert(collapse_remap[v0] == v0);
+		assert(collapse_remap[v1] == v1);
+		assert(collapse_remap[v2] == v2);
+
+		if (v0 != v1 && v0 != v2 && v1 != v2)
+		{
+			indices[write + 0] = v0;
+			indices[write + 1] = v1;
+			indices[write + 2] = v2;
+			write += 3;
+		}
+	}
+
+	assert(write < index_count);
+	return write;
 }

 } // namespace meshopt
@@ -587,69 +779,17 @@
 	meshopt_Buffer<Quadric> vertex_quadrics(vertex_count);
 	memset(vertex_quadrics.data, 0, vertex_count * sizeof(Quadric));

-	// face quadrics
-	for (size_t i = 0; i < index_count; i += 3)
-	{
-		unsigned int i0 = indices[i + 0];
-		unsigned int i1 = indices[i + 1];
-		unsigned int i2 = indices[i + 2];
-
-		// TODO: degenerate triangles can produce degenerate quadrics
-		// assert(i0 != i1 && i0 != i2 && i1 != i2);
-
-		Quadric Q;
-		quadricFromTriangle(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2]);
-
-		quadricAdd(vertex_quadrics[remap[i0]], Q);
-		quadricAdd(vertex_quadrics[remap[i1]], Q);
-		quadricAdd(vertex_quadrics[remap[i2]], Q);
-	}
-
-	// edge quadrics for boundary edges
-	size_t boundary = 0;
-
-	for (size_t i = 0; i < index_count; i += 3)
-	{
-		static const int next[3] = {1, 2, 0};
-
-		for (int e = 0; e < 3; ++e)
-		{
-			unsigned int i0 = indices[i + e];
-			unsigned int i1 = indices[i + next[e]];
-
-			// TODO: do we need to check vertex_kind[i1]? i0 can be locked and i1 can be seam...
-			if (vertex_kind[i0] != Kind_Border && vertex_kind[i0] != Kind_Seam)
-				continue;
-
-			// TODO: should this use wedge or edge search?
-			if (findEdge(adjacency, i1, i0))
-				continue;
-
-			unsigned int i2 = indices[i + next[next[e]]];
-
-			// TODO: degenerate triangles can produce degenerate quadrics
-			// assert(i0 != i1 && i0 != i2 && i1 != i2);
-
-			float edgeWeight = vertex_kind[i0] == Kind_Seam ? 1.f : 10.f;
-
-			Quadric Q;
-			quadricFromTriangleEdge(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], edgeWeight);
-
-			quadricAdd(vertex_quadrics[remap[i0]], Q);
-			quadricAdd(vertex_quadrics[remap[i1]], Q);
-
-			boundary++;
-		}
-	}
+	fillFaceQuadrics(vertex_quadrics.data, indices, index_count, vertex_positions.data, remap.data);
+
+	size_t boundary = fillEdgeQuadrics(vertex_quadrics.data, indices, index_count, vertex_positions.data, remap.data, vertex_kind.data, adjacency);
+	(void)boundary;

 #if TRACE
 	printf("vertices: %d, half-edges: %d, boundary: %d\n", int(vertex_count), int(index_count), int(boundary));
 #endif

 	if (result != indices)
-	{
 		memcpy(result, indices, index_count * sizeof(unsigned int));
-	}

 	size_t pass_count = 0;
 	float worst_error = 0;
@@ -657,54 +797,13 @@
 	meshopt_Buffer<Collapse> edge_collapses(index_count);
 	meshopt_Buffer<unsigned int> collapse_order(index_count);
 	meshopt_Buffer<unsigned int> collapse_remap(vertex_count);
-	meshopt_Buffer<char> collapse_locked(vertex_count);
-
-	while (index_count > target_index_count)
-	{
-		size_t edge_collapse_count = 0;
-
-		for (size_t i = 0; i < index_count; i += 3)
-		{
-			static const int next[3] = {1, 2, 0};
-
-			for (int e = 0; e < 3; ++e)
-			{
-				unsigned int i0 = result[i + e];
-				unsigned int i1 = result[i + next[e]];
-
-				// TODO: i0==i1 is an interesting condition... it seems like it can arise when collapsing a seam loop
-				if (remap[i0] == remap[i1])
-					continue;
-
-				if (!kCanCollapse[vertex_kind[i0]][vertex_kind[i1]])
-					continue;
-
-				// TODO: Garland97 uses Q1+Q2 for error estimation; here we asssume that V1 produces zero error for Q1 but it actually gets larger with more collapses
-				if (vertex_kind[i0] == vertex_kind[i1])
-				{
-					// manifold edges should occur twice (i0->i1 and i1->i0) - skip redundant edges
-					// TODO: this should also work for seam edges, but it increases the error on some models...
-					if (vertex_kind[i0] == Kind_Manifold && i1 > i0)
-						continue;
-
-					// if vertex kinds match, we can collapse the edge in either direction - pick the one with minimum error
-					Collapse c01 = {i0, i1, {quadricError(vertex_quadrics[remap[i0]], vertex_positions[i1])}};
-					Collapse c10 = {i1, i0, {quadricError(vertex_quadrics[remap[i1]], vertex_positions[i0])}};
-					Collapse c = c01.error <= c10.error ? c01 : c10;
-					assert(c.error >= 0);
-
-					edge_collapses[edge_collapse_count++] = c;
-				}
-				else
-				{
-					// if vertex kinds are different, edge can only be collapsed in one direction
-					Collapse c = {i0, i1, {quadricError(vertex_quadrics[remap[i0]], vertex_positions[i1])}};
-					assert(c.error >= 0);
-
-					edge_collapses[edge_collapse_count++] = c;
-				}
-			}
-		}
+	meshopt_Buffer<unsigned char> collapse_locked(vertex_count);
+
+	size_t result_count = index_count;
+
+	while (result_count > target_index_count)
+	{
+		size_t edge_collapse_count = fillEdgeCollapses(edge_collapses.data, result, result_count, vertex_positions.data, vertex_quadrics.data, remap.data, vertex_kind.data);

 		// no edges can be collapsed any more due to topology restrictions => bail out
 		if (edge_collapse_count == 0)
@@ -712,19 +811,9 @@

 		sortEdgeCollapses(collapse_order.data, edge_collapses.data, edge_collapse_count);

-		for (size_t i = 0; i < vertex_count; ++i)
-		{
-			collapse_remap[i] = unsigned(i);
-		}
-
-		memset(collapse_locked.data, 0, vertex_count);
-
 		// each collapse removes 2 triangles
 		// TODO: except for border collapses :) this can lead to a few small passes in the end
-		size_t edge_collapse_goal = (index_count - target_index_count) / 6 + 1;
-
-		size_t collapses = 0;
-		float pass_error = 0;
+		size_t edge_collapse_goal = (result_count - target_index_count) / 6 + 1;

 		float error_goal = edge_collapse_goal < edge_collapse_count ? edge_collapses[collapse_order[edge_collapse_goal]].error * 1.5f : FLT_MAX;
 		float error_limit = error_goal > target_error ? target_error : error_goal;
@@ -733,62 +822,16 @@
 		if (edge_collapses[collapse_order[0]].error > error_limit)
 			break;

-		for (size_t i = 0; i < edge_collapse_count; ++i)
-		{
-			const Collapse& c = edge_collapses[collapse_order[i]];
-
-			unsigned int r0 = remap[c.v0];
-			unsigned int r1 = remap[c.v1];
-
-			if (collapse_locked[r0] || collapse_locked[r1])
-				continue;
-
-			if (c.error > error_limit)
-				break;
-
-#if TRACE > 1
-			printf("collapse: %d (kind %d r %d w %d) => %d (kind %d r %d w %d); error %e\n",
-			       c.v0, vertex_kind[c.v0], remap[c.v0], wedge[c.v0],
-			       c.v1, vertex_kind[c.v1], remap[c.v1], wedge[c.v1],
-			       c.error);
-#endif
-
-			assert(collapse_remap[r0] == r0);
-			assert(collapse_remap[r1] == r1);
-
-			// TODO: this artificially magnifies future error with each collapse even for coplanar triangles
-			quadricAdd(vertex_quadrics[r1], vertex_quadrics[r0]);
-
-			if (vertex_kind[c.v0] == Kind_Seam)
-			{
-				// remap v0 to v1 and seam pair of v0 to seam pair of v1
-				unsigned int s0 = wedge[c.v0];
-				unsigned int s1 = wedge[c.v1];
-
-				assert(s0 != c.v0 && s1 != c.v1);
-
-				collapse_remap[c.v0] = c.v1;
-				collapse_remap[s0] = s1;
-			}
-			else
-			{
-				assert(wedge[c.v0] == c.v0);
-
-				collapse_remap[c.v0] = c.v1;
-			}
-
-			collapse_locked[r0] = 1;
-			collapse_locked[r1] = 1;
-
-			collapses++;
-			pass_error = c.error;
-
-			if (collapses >= edge_collapse_goal)
-				break;
-		}
+		for (size_t i = 0; i < vertex_count; ++i)
+			collapse_remap[i] = unsigned(i);
+
+		memset(collapse_locked.data, 0, vertex_count);
+
+		float pass_error = 0;
+		size_t collapses = performEdgeCollapses(collapse_remap.data, collapse_locked.data, vertex_quadrics.data, edge_collapses.data, edge_collapse_count, collapse_order.data, remap.data, wedge.data, vertex_kind.data, edge_collapse_goal, error_limit, pass_error);

 #if TRACE
-		printf("pass %d: triangles: %d, collapses: %d/%d (target %d), error: %e\n", int(pass_count), int(index_count / 3), int(collapses), int(edge_collapse_count), int(edge_collapse_goal), pass_error);
+		printf("pass %d: triangles: %d, collapses: %d/%d (target %d), error: %e\n", int(pass_count), int(result_count / 3), int(collapses), int(edge_collapse_count), int(edge_collapse_goal), pass_error);
 #endif

 		pass_count++;
@@ -798,29 +841,7 @@
 		if (collapses == 0)
 			break;

-		size_t write = 0;
-
-		for (size_t i = 0; i < index_count; i += 3)
-		{
-			unsigned int v0 = collapse_remap[result[i + 0]];
-			unsigned int v1 = collapse_remap[result[i + 1]];
-			unsigned int v2 = collapse_remap[result[i + 2]];
-
-			assert(collapse_remap[v0] == v0);
-			assert(collapse_remap[v1] == v1);
-			assert(collapse_remap[v2] == v2);
-
-			if (v0 != v1 && v0 != v2 && v1 != v2)
-			{
-				result[write + 0] = v0;
-				result[write + 1] = v1;
-				result[write + 2] = v2;
-				write += 3;
-			}
-		}
-
-		assert(write < index_count);
-		index_count = write;
+		result_count = remapIndexBuffer(result, result_count, collapse_remap.data);
 	}

 #if TRACE
@@ -828,7 +849,7 @@

 	size_t locked_collapses[Kind_Count][Kind_Count] = {};

-	for (size_t i = 0; i < index_count; i += 3)
+	for (size_t i = 0; i < result_count; i += 3)
 	{
 		static const int next[3] = {1, 2, 0};

@@ -850,5 +871,5 @@
 				printf("locked collapses %d -> %d: %d\n", k0, k1, int(locked_collapses[k0][k1]));
 #endif

-	return index_count;
-}
+	return result_count;
+}


Dimension-dependent bounds for NDGrid

Dimension-dependent bounds for NDGrid

--- libgibbs/include/optimizer/utils/ndgrid.hpp
+++ libgibbs/include/optimizer/utils/ndgrid.hpp
@@ -11,8 +11,38 @@
 #define INCLUDED_NDGRID

 #include <vector>
+#include <utility>

 struct NDGrid {
+	template <typename Func> static void sample(
+			const std::vector<std::pair<double,double> > &extents,
+			const double grid_points_per_major_axis,
+			const Func &func,
+			std::vector<double>& address) {
+		if (address.size() == extents.size()) {
+			// terminating condition; address is complete
+			func(address);
+		}
+		else {
+			const double max_extent = extents[address.size()].second;
+			const double min_extent = extents[address.size()].first;
+			double step = (max_extent - min_extent) / grid_points_per_major_axis;
+			for (auto j = 0; j <= grid_points_per_major_axis; ++j) {
+				double location = step*j + min_extent;
+				address.push_back(location);
+				// recursive step
+				NDGrid::sample(extents, grid_points_per_major_axis, func, address);
+				address.pop_back(); // remove the element we just added (this way avoids copying)
+			}
+		}
+	}
+	template <typename Func> static inline void sample(
+			const std::vector<std::pair<double,double> > &extents,
+			const double grid_points_per_major_axis,
+			const Func &func) {
+		std::vector<double> address;
+		NDGrid::sample(extents, grid_points_per_major_axis, func, address);
+	}
 	template <typename Func> static void sample(
 			const double min_extent,
 			const double max_extent,


small fix for SSE impl on Windows

small fix for SSE impl on Windows

--- libhmsbeagle/CPU/BeagleCPU4StateSSEImpl.hpp
+++ libhmsbeagle/CPU/BeagleCPU4StateSSEImpl.hpp
@@ -317,7 +317,7 @@

         for (int k = 0; k < kPatternCount; k++) {

-#           if 1
+#           if 1 && !defined(_WIN32)
             __builtin_prefetch (&partials_q[v+64]);
             __builtin_prefetch (&partials_r[v+64]);
 //            __builtin_prefetch (destPvec+32,1,0);
@@ -442,7 +442,7 @@

         for (int k = 0; k < kPatternCount; k++) {

-#           if 1
+#           if 1 && !defined(_WIN32)
             __builtin_prefetch (&partials_q[v+64]);
             __builtin_prefetch (&partials_r[v+64]);
             //            __builtin_prefetch (destPvec+32,1,0);


Improve log messages

Improve log messages

Change-Id: I47d2f03bacf9599eb9b6da7e1eb8a2cf652d9642

--- libqimessaging/qt/src/qitransportsocket.cpp
+++ libqimessaging/qt/src/qitransportsocket.cpp
@@ -150,6 +150,8 @@

 void QiTransportSocket::connectToHost(const QUrl& address)
 {
+  qiLogDebug("QiTransportSocket") << "Connecting to " << address.toString().toUtf8().constData();
+
   if (address.scheme() == "tcp")
   {
     QTcpSocket* socket = new QTcpSocket(this);
@@ -174,10 +176,12 @@
     _p->_peer = address;
     _p->_device = socket;
   }
-
-  qiLogError("QiTransportServer") << "Protocol `"
-                                  << address.scheme().toUtf8().constData()
-                                  << "' is not supported, can't connect";
+  else
+  {
+    qiLogError("QiTransportServer") << "Protocol `"
+                                    << address.scheme().toUtf8().constData()
+                                    << "' is not supported, can't connect";
+  }
 }

 QUrl QiTransportSocket::peer()


correct default return value for softAP

correct default return value for softAP

--- libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp
+++ libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp
@@ -101,7 +101,7 @@
         return false;
     }

-    bool ret = false;
+    bool ret = true;

     struct softap_config conf;
     strcpy(reinterpret_cast<char*>(conf.ssid), ssid);


[CVehicleVelCmd_Holo::cmdVel_limits] Remove unnecessary cast and assertion

--- libs/kinematics/src/CVehicleVelCmd_Holo.cpp
+++ libs/kinematics/src/CVehicleVelCmd_Holo.cpp
@@ -113,8 +113,6 @@
 void CVehicleVelCmd_Holo::cmdVel_limits(const mrpt::kinematics::CVehicleVelCmd &prev_vel_cmd, const double beta, const TVelCmdParams &params)
 {
 	ASSERTMSG_(params.robotMax_V_mps >= .0, "[CVehicleVelCmd_Holo] `robotMax_V_mps` must be set to valid values: either assign values programatically or call loadConfigFile()");
-	const mrpt::kinematics::CVehicleVelCmd_Holo *prevcmd = dynamic_cast<const mrpt::kinematics::CVehicleVelCmd_Holo*>(&prev_vel_cmd);
-	ASSERTMSG_(prevcmd, "Expected prevcmd of type `CVehicleVelCmd_Holo`");

 	double f = 1.0;
 	if (vel>params.robotMax_V_mps) f = params.robotMax_V_mps / vel;


Updated to v4.2.0-alpha.35

Updated to v4.2.0-alpha.35

--- src/BabylonCpp/src/inputs/input_manager.cpp
+++ src/BabylonCpp/src/inputs/input_manager.cpp
@@ -66,6 +66,11 @@
   return _pointerOverMesh;
 }

+AbstractMeshPtr InputManager::getMeshUnderPointerByPointerId(size_t pointerId)
+{
+  return pointerId < _meshUnderPointerId.size() ? _meshUnderPointerId[pointerId] : nullptr;
+}
+
 Vector2& InputManager::get_unTranslatedPointer()
 {
   _unTranslatedPointer = Vector2(_unTranslatedPointerX, _unTranslatedPointerY);
@@ -127,7 +132,7 @@

   auto isMeshPicked = pickResult && pickResult->hit && pickResult->pickedMesh;
   if (isMeshPicked) {
-    scene.setPointerOverMesh(pickResult->pickedMesh.get());
+    scene.setPointerOverMesh(pickResult->pickedMesh.get(), evt.pointerId);

     if (_pointerOverMesh && _pointerOverMesh->actionManager
         && _pointerOverMesh->actionManager->hasPointerTriggers()) {
@@ -142,7 +147,7 @@
     }
   }
   else {
-    scene.setPointerOverMesh(nullptr);
+    scene.setPointerOverMesh(nullptr, evt.pointerId);
   }

   for (const auto& step : scene._pointerMoveStage) {
@@ -709,9 +714,9 @@
   };

   _onPointerUp = [this, elementToAttachTo](PointerEvent&& evt) {
-    if (_totalPointersPressed == 0) { // We are attaching the pointer up to
-                                      // windows because of a bug in FF
-      return;                         // So we need to test it the pointer down was pressed before.
+    if (_totalPointersPressed == 0) {
+      // We are attaching the pointer up to windows because of a bug in FF
+      return; // So we need to test it the pointer down was pressed before.
     }

     auto& scene = *_scene;
@@ -917,26 +922,42 @@
   _alreadyAttached = false;
 }

-void InputManager::setPointerOverMesh(const AbstractMeshPtr& mesh)
-{
-  if (_pointerOverMesh == mesh) {
+void InputManager::setPointerOverMesh(const AbstractMeshPtr& mesh, int pointerId)
+{
+  // Sanity check
+  if (pointerId < 0) {
+    pointerId = 0;
+  }
+  if (static_cast<size_t>(pointerId) < _meshUnderPointerId.size()
+      && _meshUnderPointerId[pointerId] == mesh) {
     return;
   }

+  AbstractMeshPtr underPointerMesh = static_cast<size_t>(pointerId) < _meshUnderPointerId.size() ?
+                                       _meshUnderPointerId[pointerId] :
+                                       nullptr;
+
   AbstractActionManagerPtr actionManager = nullptr;
-  if (_pointerOverMesh) {
+  if (underPointerMesh) {
     actionManager
-      = _pointerOverMesh->_getActionManagerForTrigger(Constants::ACTION_OnPointerOutTrigger);
+      = underPointerMesh->_getActionManagerForTrigger(Constants::ACTION_OnPointerOutTrigger);
     if (actionManager) {
       actionManager->processTrigger(Constants::ACTION_OnPointerOutTrigger,
                                     ActionEvent::CreateNew(_pointerOverMesh));
     }
   }

-  _pointerOverMesh = mesh;
-  if (_pointerOverMesh) {
+  if (static_cast<size_t>(pointerId) > _meshUnderPointerId.size()) {
+    _meshUnderPointerId.resize(static_cast<size_t>(pointerId + 1));
+  }
+
+  _meshUnderPointerId[pointerId] = mesh;
+  _pointerOverMesh               = mesh;
+
+  underPointerMesh = _meshUnderPointerId[pointerId];
+  if (underPointerMesh) {
     actionManager
-      = _pointerOverMesh->_getActionManagerForTrigger(Constants::ACTION_OnPointerOverTrigger);
+      = underPointerMesh->_getActionManagerForTrigger(Constants::ACTION_OnPointerOverTrigger);
     if (actionManager) {
       actionManager->processTrigger(Constants::ACTION_OnPointerOverTrigger,
                                     ActionEvent::CreateNew(_pointerOverMesh));


Fix an invalid early return.

Fix an invalid early return.

I'm surprised of this code.
I believe this is the right fix, could you double check.

R=alyssar@google.com,rch@chromium.org

BUG=

Review URL: https://chromiumcodereview.appspot.com/22929026

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@219245 0039d316-1c4b-4281-b951-d872f2087c98

--- net/tools/quic/test_tools/http_message_test_utils.cc
+++ net/tools/quic/test_tools/http_message_test_utils.cc
@@ -54,7 +54,6 @@
 // - Neither Transfer-Encoding nor Content-Length is present and message
 //   is tagged as complete.
 bool IsCompleteMessage(const HTTPMessage& message) {
-  return true;
   const BalsaHeaders* headers = message.headers();
   StringPiece content_length = headers->GetHeader(kContentLength);
   if (!content_length.empty()) {


Import fix for a unwanted truncation of authentication error messages

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@40436 27541ba8-7e3a-0410-8455-c3a389f83636

--- net/xrootd/src/xrootd/src/XrdClient/XrdClientConn.cc
+++ net/xrootd/src/xrootd/src/XrdClient/XrdClientConn.cc
@@ -1815,7 +1815,7 @@
       // Set error, in case of need
       fOpenError = kXR_NotAuthorized;
       LastServerError.errnum = fOpenError;
-      strcpy(LastServerError.errmsg, "unable to get protocol object.");
+      strcat(LastServerError.errmsg, ": unable to get protocol object.");
    }

    // Return the result of the negotiation


more integration with the minisat

more integration with the minisat

--- src/constraint_solver/booleans.cc
+++ src/constraint_solver/booleans.cc
@@ -177,6 +177,16 @@
                           const std::vector<IntVar*>& vars,
                           IntVar* const target) {
   return false;
+  if (!sat->Check(vars) || !sat->Check(target)) {
+    return false;
+  }
+  Minisat::Lit target_lit = sat->Literal(target);
+  std::vector<Minisat::Lit> lits(vars.size() + 1);
+  for (int i = 0; i < vars.size(); ++i) {
+    lits[i] = sat->Literal(vars[i]);
+  }
+  lits[vars.size()] = ~target_lit;
+  sat->AddClause(lits);

 }

@@ -185,10 +195,24 @@
   if (!sat->Check(vars)) {
     return false;
   }
-  std::vector<Minisat::Lit> atoms(vars.size());
+  std::vector<Minisat::Lit> lits(vars.size());
   for (int i = 0; i < vars.size(); ++i) {
-    atoms[i] = sat->Literal(vars[i]);
-  }
+    lits[i] = sat->Literal(vars[i]);
+  }
+  sat->AddClause(lits);
   return false;
 }
+
+bool AddBoolAndArrayEqualFalse(SatPropagator* const sat,
+                               const std::vector<IntVar*>& vars) {
+  if (!sat->Check(vars)) {
+    return false;
+  }
+  std::vector<Minisat::Lit> lits(vars.size());
+  for (int i = 0; i < vars.size(); ++i) {
+    lits[i] = ~sat->Literal(vars[i]);
+  }
+  sat->AddClause(lits);
+  return false;
+}
 }  // namespace operations_research


Fixed spelling error. :-)

Fixed spelling error. :-)

git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@9548 8cc4aa7f-3514-0410-904f-f2cc9021211c

--- plugins/aws/awsmgr.cpp
+++ plugins/aws/awsmgr.cpp
@@ -964,11 +964,11 @@
   GetPrefMgr ()->RegisterConstant ("gbcWest", 17);
   GetPrefMgr ()->RegisterConstant ("gbcNorthWest", 18);

-  GetPregMgr ()->RegisterConstant ("blCenter", 0);
-  GetPregMgr ()->RegisterConstant ("blNorth", 1);
-  GetPregMgr ()->RegisterConstant ("blEast", 2);
-  GetPregMgr ()->RegisterConstant ("blSouth", 3);
-  GetPregMgr ()->RegisterConstant ("blWest", 4);
+  GetPrefMgr ()->RegisterConstant ("blCenter", 0);
+  GetPrefMgr ()->RegisterConstant ("blNorth", 1);
+  GetPrefMgr ()->RegisterConstant ("blEast", 2);
+  GetPrefMgr ()->RegisterConstant ("blSouth", 3);
+  GetPrefMgr ()->RegisterConstant ("blWest", 4);

 }


Guard against overflow

Guard against overflow

--- binding.cc
+++ binding.cc
@@ -110,17 +110,17 @@
 // helpers

 NAN_METHOD(sodium_memcmp) {
-  ASSERT_BUFFER(info[0], b1)
-  ASSERT_BUFFER(info[1], b2)
   ASSERT_UINT(info[2], length)
+  ASSERT_BUFFER_MIN_LENGTH(info[0], b1, length)
+  ASSERT_BUFFER_MIN_LENGTH(info[1], b2, length)

   CALL_SODIUM_BOOL(sodium_memcmp(CDATA(b1), CDATA(b2), length))
 }

 NAN_METHOD(sodium_compare) {
-  ASSERT_BUFFER(info[0], b1)
-  ASSERT_BUFFER(info[1], b2)
   ASSERT_UINT(info[2], length)
+  ASSERT_BUFFER_MIN_LENGTH(info[0], b1, length)
+  ASSERT_BUFFER_MIN_LENGTH(info[1], b2, length)

   info.GetReturnValue().Set(Nan::New<v8::Number>(sodium_compare(CDATA(b1), CDATA(b2), length)));
 }


only the producer and consumer objects need alignment, the private fields within them do not require it

--- src/container/spsc_ring_queue.hpp
+++ src/container/spsc_ring_queue.hpp
@@ -2,7 +2,6 @@
 #define TURBO_CONTAINER_SPSC_RING_QUEUE_HPP

 #include <cstdint>
-#include <array>
 #include <atomic>
 #include <functional>
 #include <memory>
@@ -33,9 +32,9 @@
     result try_enqueue_copy(const value_t& input);
     result try_enqueue_move(value_t&& input);
 private:
-    alignas(LEVEL1_DCACHE_LINESIZE) std::vector<value_t, allocator_t>& buffer_;
-    alignas(LEVEL1_DCACHE_LINESIZE) std::atomic<uint32_t>& head_;
-    alignas(LEVEL1_DCACHE_LINESIZE) std::atomic<uint32_t>& tail_;
+    std::vector<value_t, allocator_t>& buffer_;
+    std::atomic<uint32_t>& head_;
+    std::atomic<uint32_t>& tail_;
 };

 template <class value_t, class allocator_t = std::allocator<value_t>>
@@ -57,9 +56,9 @@
     result try_dequeue_copy(value_t& output);
     result try_dequeue_move(value_t& output);
 private:
-    alignas(LEVEL1_DCACHE_LINESIZE) std::vector<value_t, allocator_t>& buffer_;
-    alignas(LEVEL1_DCACHE_LINESIZE) std::atomic<uint32_t>& head_;
-    alignas(LEVEL1_DCACHE_LINESIZE) std::atomic<uint32_t>& tail_;
+    std::vector<value_t, allocator_t>& buffer_;
+    std::atomic<uint32_t>& head_;
+    std::atomic<uint32_t>& tail_;
 };

 template <class value_t, class allocator_t = std::allocator<value_t>>
@@ -78,8 +77,8 @@
     alignas(LEVEL1_DCACHE_LINESIZE) std::vector<value_t, allocator_t> buffer_;
     alignas(LEVEL1_DCACHE_LINESIZE) std::atomic<uint32_t> head_;
     alignas(LEVEL1_DCACHE_LINESIZE) std::atomic<uint32_t> tail_;
-    producer producer_;
-    consumer consumer_;
+    alignas(LEVEL1_DCACHE_LINESIZE) producer producer_;
+    alignas(LEVEL1_DCACHE_LINESIZE) consumer consumer_;
 };

 } // namespace container


Don't allow setting grid snap less than 1

--- src/Editor/Editor.cpp
+++ src/Editor/Editor.cpp
@@ -473,6 +473,8 @@
         EditorSettings::GetInstance().SetBool("Grid Snap", gridSettings.gridSnap);
         ImGui::DragInt("Snap Size", &gridSettings.snapOption, 1.0f, 1, 100);
         EditorSettings::GetInstance().SetLong("Grid Snap Size", gridSettings.snapOption);
+        if (gridSettings.snapOption < 1)
+            gridSettings.snapOption = 1;
         ImGui::End();
     }
 }


S.D.G.

S.D.G.

--- binding.cc
+++ binding.cc
@@ -443,3 +443,5 @@
 }

 NODE_MODULE(binding, Init);
+
+// S.D.G.


Expose RCVMORE and EVENTS socket options.

--- binding.cc
+++ binding.cc
@@ -269,6 +269,10 @@
         NODE_DEFINE_CONSTANT(t, ZMQ_PULL);
         NODE_DEFINE_CONSTANT(t, ZMQ_PAIR);

+        NODE_DEFINE_CONSTANT(t, ZMQ_POLLIN);
+        NODE_DEFINE_CONSTANT(t, ZMQ_POLLOUT);
+        NODE_DEFINE_CONSTANT(t, ZMQ_POLLERR);
+
         NODE_SET_PROTOTYPE_METHOD(t, "bind", Bind);
         NODE_SET_PROTOTYPE_METHOD(t, "connect", Connect);
         NODE_SET_PROTOTYPE_METHOD(t, "subscribe", Subscribe);
@@ -330,6 +334,13 @@
         return Undefined();
     }

+    Handle<Value> GetUIntSockOpt(int option) {
+        uint32_t value = 0;
+        size_t len = sizeof(value);
+        zmq_getsockopt(socket_, option, &value, &len);
+        return v8::Integer::New(value);
+    }
+
     Handle<Value> GetBytesSockOpt(int option) {
         char value[1024] = {0};
         size_t len = 1023;
@@ -401,9 +412,9 @@
         Socket *socket = GetSocket(info);

         if (name->Equals(v8::String::New("highwaterMark"))) {
-          return socket->GetULongSockOpt(ZMQ_HWM);
+            return socket->GetULongSockOpt(ZMQ_HWM);
         } else if (name->Equals(v8::String::New("diskOffloadSize"))) {
-          return socket->GetLongSockOpt(ZMQ_SWAP);
+            return socket->GetLongSockOpt(ZMQ_SWAP);
         } else if (name->Equals(v8::String::New("identity"))) {
             return socket->GetBytesSockOpt(ZMQ_IDENTITY);
         } else if (name->Equals(v8::String::New("multicastDataRate"))) {
@@ -416,6 +427,10 @@
             return socket->GetULongSockOpt(ZMQ_SNDBUF);
         } else if (name->Equals(v8::String::New("receiveBufferSize"))) {
             return socket->GetULongSockOpt(ZMQ_RCVBUF);
+        } else if (name->Equals(v8::String::New("receiveMoreParts"))) {
+            return socket->GetULongSockOpt(ZMQ_RCVMORE);
+        } else if (name->Equals(v8::String::New("currentEvents"))) {
+            return socket->GetUIntSockOpt(ZMQ_EVENTS);
         }

         return Undefined();
@@ -425,9 +440,9 @@
         Socket *socket = GetSocket(info);

         if (name->Equals(v8::String::New("highwaterMark"))) {
-          socket->SetULongSockOpt(ZMQ_HWM, value);
+            socket->SetULongSockOpt(ZMQ_HWM, value);
         } else if (name->Equals(v8::String::New("diskOffloadSize"))) {
-          socket->SetLongSockOpt(ZMQ_SWAP, value);
+            socket->SetLongSockOpt(ZMQ_SWAP, value);
         } else if (name->Equals(v8::String::New("identity"))) {
             socket->SetBytesSockOpt(ZMQ_IDENTITY, value);
         } else if (name->Equals(v8::String::New("multicastDataRate"))) {


reformed eval's syntax dispatcher

reformed eval's syntax dispatcher

--- src/eval.cc
+++ src/eval.cc
@@ -593,13 +593,24 @@
   auto wargs = pick_whole_arg();
   if(!wargs) return;

-  auto c = wargs.get<Cons*>()->cdr().get<Cons*>();
-
-  VM.return_value() = c->car();
-
-  if(!nullp(c->cdr())){
-    fprintf(stderr, "eval warning: quote has two or more args. ignored.\n");
-  }
+  Lisp_ptr val;
+
+  bind_cons_list(wargs,
+                 [](Cons*){},
+                 [&](Cons* c){
+                   val = c->car();
+                 },
+                 [](Cons*){
+                   fprintf(stderr, "eval warning: quote has two or more args. ignored.\n");
+                 });
+
+  if(!val){
+    fprintf(stderr, "eval error: quote has no args.\n");
+    VM.return_value() = {};
+    return;
+  }
+
+  VM.return_value() = val;
 }

@@ -813,61 +824,8 @@
         break;
       }

-      auto first = c->car();
-
-      // special operator?
-      if(auto sym = first.get<Symbol*>()){
-        auto k = sym->to_keyword();
-
-        if(k != Keyword::not_keyword){
-          Lisp_ptr r = c->cdr();
-          if(!r.get<Cons*>()){
-            fprintf(stderr, "eval error: expresssion (<KEYWORD>%s) is informal!\n",
-                    (r.tag() == Ptr_tag::cons) ? "" : ". #");
-            VM.return_value() = {};
-            break;
-          }
-
-          switch(k){
-          case Keyword::not_keyword: break;
-          case Keyword::quote:  goto call;
-          case Keyword::lambda: goto call;
-          case Keyword::if_:    goto call;
-          case Keyword::set_:   goto call;
-          case Keyword::define: goto call;
-          case Keyword::begin:  goto call;
-          case Keyword::quasiquote:
-            goto call;
-
-          case Keyword::cond:
-          case Keyword::case_:
-          case Keyword::and_:
-          case Keyword::or_:
-          case Keyword::let:
-          case Keyword::let_star:
-          case Keyword::letrec:
-          case Keyword::do_:
-          case Keyword::delay:
-            goto call;
-
-          case Keyword::unquote:
-          case Keyword::unquote_splicing:
-            goto call;
-
-          case Keyword::else_:
-          case Keyword::r_arrow:
-            goto call;
-
-          default:
-            UNEXP_DEFAULT();
-          }
-          break;
-        }
-      }
-      call:
-      // procedure/macro call?
       VM.code().push(Lisp_ptr(vm_op_call));
-      VM.code().push(first);
+      VM.code().push(c->car());
       VM.stack().push(p);
       break;
     }


Fix pose trajectory in Playback mode

Fix pose trajectory in Playback mode

Change-Id: Id1244a5457e3899d049a1831053f95b283efa6e2

--- common/model-views.cpp
+++ common/model-views.cpp
@@ -1398,6 +1398,16 @@
     {
         viewer.not_model.add_log("Stopping streaming");

+        // TODO  - refactor tm2 from viewer to subdevice
+        for_each(stream_display_names.begin(), stream_display_names.end(), [&viewer](auto& kvp)
+        {
+            if ("Pose" == kvp.second)
+            {
+                viewer.tm2.reset_trajectory();
+                viewer.tm2.record_trajectory(false);
+            }
+        });
+
         streaming = false;
         _pause = false;

@@ -1440,6 +1450,13 @@
         }
         ss << "...";
         viewer.not_model.add_log(ss.str());
+
+        // TODO  - refactor tm2 from viewer to subdevice
+        for_each(stream_display_names.begin(), stream_display_names.end(), [&viewer](auto& kvp)
+        {
+            if ("Pose" == kvp.second)
+                viewer.tm2.record_trajectory(true);
+        });

         s->open(profiles);


fix compile issue of  last commit

fix compile issue of  last commit

--- src/sio_socket.cpp
+++ src/sio_socket.cpp
@@ -420,7 +420,8 @@

     void socket::impl::ack(int msgId, const string &name, const message::ptr &ack_message)
     {
-        packet p(m_nsp, make_message(name, ack_message),msgId,true);
+        message::list li(ack_message);
+        packet p(m_nsp, li.to_array_message(name),msgId,true);
         send_packet(p);
     }


cleanup some vmop

cleanup some vmop

--- src/eval.cc
+++ src/eval.cc
@@ -378,13 +378,9 @@
   assert(vm.code.back().get<VMop>() == vm_op_move_values);

   vm.code.pop_back();
-  int argc = 0;
-
-  for(auto i = vm.return_value.begin(), e = vm.return_value.end();
-      i != e; ++i){
-    vm.stack.push_back(*i);
-    ++argc;
-  }
+  int argc = vm.return_value.size();
+
+  vm.stack.insert(vm.stack.end(), vm.return_value.begin(), vm.return_value.end());
   vm.stack.push_back({Ptr_tag::vm_argcount, argc});

   vm.return_value.resize(1);
@@ -589,8 +585,7 @@
     vm.code.push_back(vm_op_leave_frame);
   }

-  vm.code.push_back(vm_op_call);
-  vm.code.push_back(proc);
+  vm.code.insert(vm.code.end(), {vm_op_call, proc});
   vm.stack.push_back(push_cons_list({}, gl_vals.extract()));
   vm.return_value[0] = {};
 }
@@ -733,11 +728,10 @@
     return;
   }

+  vm.enter_frame(d->env());
   vm.stack.push_back(arg);
-  vm.code.push_back(vm_op_force);
-  vm.enter_frame(d->env());
-  vm.code.push_back(vm_op_leave_frame);
-  vm.code.push_back(d->get());
+  vm.code.insert(vm.code.end(),
+                 {vm_op_force, vm_op_leave_frame, d->get()});
 }

 void call_with_values(){
@@ -760,9 +754,7 @@
   }

   // second proc call
-  vm.code.push_back(args[1]);
-  vm.code.push_back(vm_op_proc_enter);
-  vm.code.push_back(vm_op_move_values);
+  vm.code.insert(vm.code.end(), {args[1], vm_op_proc_enter, vm_op_move_values});

   // first proc, calling with zero args.
   vm.stack.push_back({Ptr_tag::vm_argcount, 0});
@@ -784,8 +776,7 @@
   }

   auto cont = new Continuation(vm);
-  vm.stack.push_back(cont);
-  vm.stack.push_back({Ptr_tag::vm_argcount, 1});
+  vm.stack.insert(vm.stack.end(), {cont, {Ptr_tag::vm_argcount, 1}});

   proc_enter_entrypoint(args[0]); // direct jump to proc_enter()
 }


Added IntToType<>

Added IntToType<>

--- libuavcan/include/uavcan/util/templates.hpp
+++ libuavcan/include/uavcan/util/templates.hpp
@@ -105,6 +105,8 @@
 template <bool> struct UAVCAN_EXPORT BooleanType { };
 typedef BooleanType<true> TrueType;
 typedef BooleanType<false> FalseType;
+
+template <int N> struct IntToType { };

 /**
  * Relations


Quick fix for warning in vktSampleVerifier.cpp am: 5bffef48d5 am: cddd73d649
am: 6e53a18230

Change-Id: I47c99d3703e822c668fbde142a63a98580735f58

--- external/vulkancts/modules/vulkan/texture_filtering/vktSampleVerifier.cpp
+++ external/vulkancts/modules/vulkan/texture_filtering/vktSampleVerifier.cpp
@@ -676,8 +676,8 @@
 	deInt32			lodStepsMin;
 	deInt32			lodStepsMax;

-	deUint8			levels;
-	deUint8			levelLo;
+	int				levels;
+	int				levelLo;

 	if (levelHi == m_imParams.levels - 1 || mipmapFilter == VK_SAMPLER_MIPMAP_MODE_NEAREST)
 	{
@@ -688,7 +688,7 @@
 	else
 	{
 		levels = 2;
-		levelLo = (deUint8) 1 + levelHi;
+		levelLo = 1 + levelHi;
 	}

 	getWeightStepBounds(unnormalizedCoordHi, weightStepsMin[0], weightStepsMax[0], texelBase[0]);
@@ -732,7 +732,7 @@

 			if (mipmapFilter == VK_SAMPLER_MIPMAP_MODE_LINEAR)
 			{
-				idealSampleLo = getFilteredSample(texelBase[1], roundedWeightsLo, layer, levelLo);
+				idealSampleLo = getFilteredSample(texelBase[1], roundedWeightsLo, layer, (deUint8)levelLo);

 				report << "Ideal lo sample: " << idealSampleLo << "\n";
 			}
@@ -746,7 +746,7 @@

 			if (mipmapFilter == VK_SAMPLER_MIPMAP_MODE_LINEAR)
 			{
-				idealSampleLo = fetchTexel(floor(unnormalizedCoordLo).cast<deInt32>(), layer, levelLo, VK_FILTER_NEAREST);
+				idealSampleLo = fetchTexel(floor(unnormalizedCoordLo).cast<deInt32>(), layer, (deUint8)levelLo, VK_FILTER_NEAREST);

 				report << "Ideal lo sample: " << idealSampleLo << "\n";
 			}


Output fwidth with dFdx/dFdy in ESSL 100

This assumes GL_OES_standard_derivatives is enabled by the renderer

--- src/Compiler/Backend/GLSL/GLSLGenerator.cpp
+++ src/Compiler/Backend/GLSL/GLSLGenerator.cpp
@@ -2595,6 +2595,18 @@
     {
         if (!IsWrappedIntrinsic(funcCall->intrinsic))
         {
+            /* Support for fwidth in ESSL 100 */
+            if (versionOut_ == OutputShaderVersion::ESSL100 &&
+                funcCall->intrinsic == Intrinsic::FWidth) {
+                // fwidth(x) => (abs(dFdx(x)) + abs(dFdy(x)))
+                Write("( abs(dFdx(");
+                WriteCallExprArguments(funcCall);
+                Write(")) + abs(dFdy(");
+                WriteCallExprArguments(funcCall);
+                Write(")) )");
+                return; // prevent writing expr arguments later
+            }
+
             bool useDefaultIntrinsic = true;

             /* Support for old intrinsics (GLSL <= 120 & ESSL 100) */


fix back behaviour for iOS

fix back behaviour for iOS

--- src/FWApplication.cpp
+++ src/FWApplication.cpp
@@ -197,9 +197,14 @@
   if (ev.getType() == SysEvent::BACK) {
     int poppedView = popViewBackHistory();
     if (poppedView != 0) {
+#ifdef __ANDROID__
       Command c(Command::SET_INT_VALUE, poppedView);
       c.setValue(3);
       sendCommand(c);
+#else
+      Element * e = getRegisteredElement(poppedView);
+      if (e) e->show();
+#endif
     } else {
       Command c(Command::QUIT_APP, poppedView);
       sendCommand(c);


added printing of TrackerHits charge+chargeError and of TrackerPulse covariance (charge, time)

--- src/cpp/src/UTIL/LCTOOLS.cc
+++ src/cpp/src/UTIL/LCTOOLS.cc
@@ -430,7 +430,7 @@
     int nPrint = nHits > MAX_HITS ? MAX_HITS : nHits ;

     std::cout << endl
-	      << " [   id   ] | position (x,y,z)                | dEdx      | time     |  type"
+	      << " [   id   ] | position (x,y,z)                | dEdx      | time      |type |  charge   | charge_err"
 	      << endl
 	      << endl ;

@@ -443,7 +443,7 @@
       //       if( hit->getRawDataHit() != 0 )
       // 	rawHitId = hit->getRawDataHit()->id()  ;

-      printf(" [%8.8x] | (%5.3e,%5.3e,%5.3e) | %5.3e | %5.3e | [%d] \n"
+      printf(" [%8.8x] | (%5.3e,%5.3e,%5.3e) | %5.3e | %5.3e | [%d] | %4.3e | %4.3e \n"
 	     , hit->id()
 	     , hit->getPosition()[0]
 	     , hit->getPosition()[1]
@@ -451,7 +451,10 @@
 	     , hit->getdEdx()
 	     , hit->getTime()
 	     , hit->getType()
+         , hit->getCharge()
+         , hit->getChargeError()
 	     ) ;
+
       const LCObjectVec& rawHits = hit->getRawHits() ;
       cout << "    rawHits: " ;
       try{
@@ -624,7 +627,8 @@
 	 << "  flag:  0x" << hex  << col->getFlag() << dec << endl ;

     LCFlagImpl flag( col->getFlag() ) ;
-    cout << "     LCIO::TRAWBIT_ID1    : " << flag.bitSet( LCIO::TRAWBIT_ID1 ) << endl ;
+    cout << "     LCIO::TRAWBIT_ID1    : " << flag.bitSet( LCIO::TRAWBIT_ID1 )
+         << "     LCIO::TRAWBIT_CM     : " << flag.bitSet( LCIO::TRAWBIT_CM ) << endl ;

     printParameters( col->getParameters() ) ;

@@ -634,7 +638,7 @@
     CellIDDecoder<TrackerPulse> id( col ) ;

     std::cout << endl
-	      << " [   id   ] | cellid0  | cellid1  | time | charge | quality  |corr.Data | cellid-fields: |"
+	      << " [   id   ] | cellid0  | cellid1  | time | charge | quality  |corr.Data | cellid-fields: | cov(c,c), cov(t,c), cov(t,t)"
  	      << endl
 	      << endl ;

@@ -658,7 +662,13 @@

       printf("[%8.8x] ",   ( corr != 0 ? corr->id() : 0 ) ) ;

-      std::cout << " " << id( hit ).valueString() << "|" << std::endl ;
+      std::cout << " " << id( hit ).valueString() << " | " ;
+
+      for( unsigned int j=0; j < hit->getCovMatrix().size(); j++ ){
+	    printf("%4.2e, ", hit->getCovMatrix()[j] ) ;
+      }
+
+	  cout << "|" << endl ;

     }
     cout << endl


[timing] Resolve another merge conflict

[timing] Resolve another merge conflict

--- common/place_common.cc
+++ common/place_common.cc
@@ -36,8 +36,8 @@
     bool driver_gb = ctx->getBelGlobalBuf(driver_cell->bel);
     if (driver_gb)
         return 0;
-    IdString clock_port;
-    bool timing_driven = ctx->timing_driven && type == MetricType::COST && ctx->getPortTimingClass(driver_cell, net->driver.port, clock_port) != TMG_IGNORE;
+    int clock_count;
+    bool timing_driven = ctx->timing_driven && type == MetricType::COST && ctx->getPortTimingClass(driver_cell, net->driver.port, clock_count) != TMG_IGNORE;
     delay_t negative_slack = 0;
     delay_t worst_slack = std::numeric_limits<delay_t>::max();
     Loc driver_loc = ctx->getBelLocation(driver_cell->bel);


FIX: The Windows utf-16 / wchar_t patch adding support for filenames encoded as utf16 was missing support for that facility in the DefaultResourceProvider::getResourceGroupFileNames function.  This fix adds that support.

--- cegui/src/CEGUIDefaultResourceProvider.cpp
+++ cegui/src/CEGUIDefaultResourceProvider.cpp
@@ -50,6 +50,24 @@
 }

 //----------------------------------------------------------------------------//
+CEGUI::String Utf16ToString(const wchar_t* const utf16text)
+{
+    const int len = WideCharToMultiByte(CP_UTF8, 0, utf16text, -1,
+                                        0, 0, 0, 0);
+    if (!len)
+        throw CEGUI::InvalidRequestException(
+            "Utf16ToUtf8 - WideCharToMultiByte failed");
+
+    CEGUI::utf8* buff = new CEGUI::utf8[len + 1];
+    WideCharToMultiByte(CP_UTF8, 0, utf16text, -1,
+                        reinterpret_cast<char*>(buff), len, 0, 0);
+    const CEGUI::String result(buff);
+    delete[] buff;
+
+    return result;
+}
+
+//----------------------------------------------------------------------------//
 #else
 #   include <sys/types.h>
 #   include <sys/stat.h>
@@ -193,19 +211,19 @@
 // Win32 code.
 #if defined(__WIN32__) || defined(_WIN32)
     intptr_t f;
-    struct _finddata_t fd;
-
-    if ((f = _findfirst((dir_name + file_pattern).c_str(), &fd)) != -1)
+    struct _wfinddata_t fd;
+
+    if ((f = _wfindfirst(Utf8ToUtf16((dir_name + file_pattern).c_str()).c_str(), &fd)) != -1)
     {
         do
         {
             if ((fd.attrib & _A_SUBDIR))
                 continue;

-            out_vec.push_back(fd.name);
+            out_vec.push_back(Utf16ToString(fd.name));
             ++entries;
         }
-        while (_findnext(f, &fd) == 0);
+        while (_wfindnext(f, &fd) == 0);

         _findclose(f);
     }


made buffered_socket_t non-copyable

made buffered_socket_t non-copyable

--- common/sys/network.cpp
+++ common/sys/network.cpp
@@ -77,7 +77,12 @@
         delete[] ibuf; ibuf = nullptr;
         delete[] obuf; obuf = nullptr;
       }
-
+
+    private:
+      buffered_socket_t (const buffered_socket_t& other) DELETED; // do not implement
+      buffered_socket_t& operator= (const buffered_socket_t& other) DELETED; // do not implement
+
+    public:
       SOCKET fd;               //!< file descriptor of the socket
       char* ibuf;
       size_t isize;


Made Ogre renderer OpenGL shaders use older version to make it work better on linux

--- cegui/src/RendererModules/Ogre/Shaders.inl
+++ cegui/src/RendererModules/Ogre/Shaders.inl
@@ -163,7 +163,7 @@

 //! A string containing an OpenGL3 vertex shader for solid colouring of a polygon
 static Ogre::String VertexShaderColoured_GLSL(""
-    "#version 150 core\n"
+    "#version 130 core\n"

     "uniform mat4 worldViewProjMatrix;\n"

@@ -182,7 +182,7 @@

 //! A string containing an OpenGL3 fragment shader for solid colouring of a polygon
 static Ogre::String PixelShaderColoured_GLSL(""
-    "#version 150 core\n"
+    "#version 130 core\n"

     "in vec4 exColour;\n"

@@ -203,7 +203,7 @@
 supplied to the shader, resulting in the final colour.
 */
 static Ogre::String VertexShaderTextured_GLSL(""
-    "#version 150 core\n"
+    "#version 130 core\n"

     "uniform mat4 worldViewProjMatrix;\n"

@@ -229,7 +229,7 @@
 supplied to the shader, resulting in the final colour.
 */
 static Ogre::String PixelShaderTextured_GLSL(""
-    "#version 150 core\n"
+    "#version 130 core\n"

     "uniform sampler2D texture0;\n"
     "uniform float alphaPercentage;\n"


(CSSMediaRuleImp::getCssText) : Fix a bug

--- src/css/CSSMediaRuleImp.cpp
+++ src/css/CSSMediaRuleImp.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010, 2011 Esrille Inc.
+ * Copyright 2010-2013 Esrille Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,13 +34,10 @@

 std::u16string CSSMediaRuleImp::getCssText()
 {
-    std::u16string text = u"@media " + mediaList.getMediaText() + u" {";
+    std::u16string text = u"@media " + mediaList.getMediaText() + u" { ";
     for (auto i = ruleList.begin(); i != ruleList.end(); ++i)
-        text += (*i).getCssText();
-    text += u"}";
-    std::u16string media = mediaList.getMediaText();
-    if (!media.empty())
-        text += u" " + media;
+        text += (*i).getCssText() + u" ";
+    text += u'}';
     return text;
 }


Disable Transactions_ConcurrentFrozenQueryAndObjAndTransactionClose

Change-Id: I22911cf4c015e3a428736782b312c7a0818b004f

--- test/test_lang_bind_helper.cpp
+++ test/test_lang_bind_helper.cpp
@@ -244,6 +244,7 @@
 // but the goal is none the less to "harden" Core against just crashing
 // **           THIS TEST MAY CRASH OCCASIONALLY          **
 // ** if so, disable it and run it in a different setting **
+#if 0 // it actually fails occationally
 TEST_IF(Transactions_ConcurrentFrozenQueryAndObjAndTransactionClose, !REALM_TSAN)
 {
     SHARED_GROUP_TEST_PATH(path);
@@ -292,7 +293,7 @@
     for (int j = 0; j < 100; ++j)
         threads[j].join();
 }
-
+#endif

 class MyHistory : public _impl::History {
 public:


compute compile flags in Makefile only

compute compile flags in Makefile only

--- compiler/util/files.cpp
+++ compiler/util/files.cpp
@@ -553,24 +553,12 @@
   // factor of 5 or so in time in running the test system, as opposed
   // to specifying BINNAME on the C compiler command line.

-  fprintf(makefile.fptr, "COMP_GEN_CFLAGS =");
-  if (ccwarnings) {
-    fprintf(makefile.fptr, " $(WARN_GEN_CFLAGS)");
-  }
-  if (debugCCode) {
-    fprintf(makefile.fptr, " $(DEBUG_CFLAGS)");
-  }
-  if (optimizeCCode) {
-    fprintf(makefile.fptr, " $(OPT_CFLAGS)");
-  }
-  if (specializeCCode) {
-    fprintf(makefile.fptr, " $(SPECIALIZE_CFLAGS)");
-  }
-  if (fieeefloat) {
-    fprintf(makefile.fptr, " $(IEEE_FLOAT_GEN_CFLAGS)");
-  } else {
-    fprintf(makefile.fptr, " $(NO_IEEE_FLOAT_GEN_CFLAGS)");
-  }
+  fprintf(makefile.fptr, "COMP_GEN_WARN = %i", ccwarnings!=0);
+  fprintf(makefile.fptr, "COMP_GEN_DEBUG = %i", debugCCode!=0);
+  fprintf(makefile.fptr, "COMP_GEN_OPT = %i", optimizeCCode!=0);
+  fprintf(makefile.fptr, "COMP_GEN_SPECIALIZE = %i", specializeCCode!=0);
+  fprintf(makefile.fptr, "COMP_GEN_IEEE_FLOAT = %i", fieeefloat!=0);
+
   if (fLibraryCompile && (fLinkStyle==LS_DYNAMIC))
     fprintf(makefile.fptr, " $(SHARED_LIB_CFLAGS)");
   forv_Vec(const char*, dirName, incDirs) {


Remove redundant copy

Remove redundant copy

--- chainerx_cc/chainerx/routines/reduction.cc
+++ chainerx_cc/chainerx/routines/reduction.cc
@@ -100,11 +100,13 @@

 Array Cumsum(const Array& a, absl::optional<int8_t> axis) {
     int8_t axis_norm;
-    Array a_reshaped = Copy(a);
+    Array a_reshaped{};
     if (axis.has_value()) {
         axis_norm = internal::NormalizeAxis(*axis, a.ndim());
+        a_reshaped = Copy(a);
     } else {
         axis_norm = 0;
+        // TODO(imanishi): Fix after chainerx::Ravel is supported.
         a_reshaped = a.Reshape(Shape{a.GetTotalSize()});
     }


cosmetic

cosmetic

--- plugins/ftp/FtpAPI.cpp
+++ plugins/ftp/FtpAPI.cpp
@@ -3,7 +3,7 @@

 #include "Int.h"

-BOOL ParseDirLine(Connection *Connect,BOOL AllFiles,FTPFileInfo* lpFindFileData);
+static BOOL ParseDirLine(Connection *Connect, FTPFileInfo* lpFindFileData);

 //--------------------------------------------------------------------------------
 BOOL FtpKeepAlive(Connection *hConnect)
@@ -95,8 +95,7 @@
 {
 	Assert(hConnect && "FtpFindFirstFile");
 	String Command;
-	int    AllFiles = StrCmp(lpszSearchFile,"*")==0 ||
-	                  StrCmp(lpszSearchFile,"*.*")==0;
+	int    AllFiles = StrCmp(lpszSearchFile,"*")==0 || StrCmp(lpszSearchFile,"*.*")==0;
 	int    FromCache = 0;

 	if(ResetCache && *ResetCache == TRUE)
@@ -155,14 +154,14 @@
 	if(AllFiles && !FromCache)
 		hConnect->CacheAdd();

-	return ParseDirLine(hConnect,AllFiles,lpFindFileData);
+	return ParseDirLine(hConnect, lpFindFileData);
 }

 BOOL FtpFindNextFile(Connection *hConnect,FTPFileInfo* lpFindFileData)
 {
 	Assert(hConnect && "FtpFindNextFile");
-	return ParseDirLine(hConnect,TRUE,lpFindFileData);
+	return ParseDirLine(hConnect, lpFindFileData);
 }

 BOOL FtpGetCurrentDirectory(Connection *hConnect,String& s)
@@ -706,9 +705,9 @@
 		return ((WORD)rc) == 0 ? FTP_TYPE_DETECT : ((WORD)rc-2);
 }

-BOOL ParseDirLine(Connection *Connect,BOOL AllFiles,FTPFileInfo* p)
-{
-	PROC(("ParseDirLine", "%p,%d", Connect, AllFiles))
+static BOOL ParseDirLine(Connection *Connect, FTPFileInfo* p)
+{
+	PROC(("ParseDirLine", "%p", Connect))
 	String        Line, Line1;
 	FTPDirList    dl;
 	FTPServerInfo si;
@@ -813,10 +812,7 @@
 		//Skip entryes
 		char *CurName = FTP_FILENAME(p);

-		if(p->FileType == NET_SKIP ||
-		        !CurName[0] ||
-		        StrCmp(CurName,".") == 0 ||
-		        /*!AllFiles &&*/ StrCmp(CurName,"..") == 0)
+		if(p->FileType==NET_SKIP || !CurName[0] || StrCmp(CurName,".")==0 || StrCmp(CurName,"..")==0)
 			continue;

 		//Correct attrs


Improve angle precision of Hough

Improve angle precision of Hough

--- src/binarize.cpp
+++ src/binarize.cpp
@@ -688,7 +688,7 @@
     constexpr const size_t CANNY_THRESHOLD = 60;
     cv::Canny(binary_image, binary_image, CANNY_THRESHOLD, CANNY_THRESHOLD * 3, 5);

-    HoughLines(binary_image, lines, 1, CV_PI/180, 125, 0, 0);
+    HoughLines(binary_image, lines, 1, CV_PI/270, 125, 0, 0);

     if(lines.size() > 250){
         std::cout << "Too many lines" << std::endl;


Fix joystick crash when mapping is -1

Fix joystick crash when mapping is -1

--- main/input_default.cpp
+++ main/input_default.cpp
@@ -912,6 +912,7 @@

 	if (joy.mapping == -1) {
 		_axis_event(p_device, p_axis, val);
+		return;
 	};

 	Map<int, JoyEvent>::Element *el = map_db[joy.mapping].axis.find(p_axis);


extended multithreaded scenario to include use of table view

--- test/test_lang_bind_helper.cpp
+++ test/test_lang_bind_helper.cpp
@@ -2549,15 +2549,20 @@
     Query q = tr->where().equal(0, 42);
     int idx = q.find();
     Row r = (*tr)[idx];
+    TableView tv = q.find_all();
     while (1)
     {
         int val = r.get_int(0);
+        tv.sync_if_needed();
         if (val == 43) break;
-        CHECK_EQUAL(42, val);
+        CHECK_EQUAL(42, val);
+        CHECK_EQUAL(1,tv.size());
+        CHECK_EQUAL(42, tv.get_int(0,0));
         while (!sg.has_changed())
             sched_yield();
         LangBindHelper::advance_read(sg, *wlr);
     }
+    CHECK_EQUAL(0,tv.size());
     sg.end_read();
 }


use local time, not gm time

use local time, not gm time

--- pcbnew/dialog_drc.cpp
+++ pcbnew/dialog_drc.cpp
@@ -1065,9 +1065,10 @@

     fprintf( fp, "** Drc report for %s **\n",
             CONV_TO_UTF8( m_Parent->GetScreen()->m_FileName ) );
-
-    char line[256];
-    fprintf( fp, "** Created on %s **\n", DateAndTime( line ) );    //@todo make DateAndTime use localtime, not gmtime
+
+    wxDateTime now = wxDateTime::Now();
+
+    fprintf( fp, "** Created on %s **\n", CONV_TO_UTF8(now.Format( wxT("%F %T"))) );

     count = m_ClearanceListBox->GetItemCount();


Avoid creating joy_names map entries when using Map operator[]

--- main/input_default.cpp
+++ main/input_default.cpp
@@ -1216,9 +1216,10 @@
 	if (p_update_existing) {
 		Vector<String> entry = p_mapping.split(",");
 		String uid = entry[0];
-		for (int i = 0; i < joy_names.size(); i++) {
-			if (uid == joy_names[i].uid) {
-				joy_names[i].mapping = map_db.size() - 1;
+		for (Map<int, Joypad>::Element *E = joy_names.front(); E; E = E->next()) {
+			Joypad &joy = E->get();
+			if (joy.uid == uid) {
+				joy.mapping = map_db.size() - 1;
 			}
 		}
 	}
@@ -1230,9 +1231,10 @@
 			map_db.remove(i);
 		}
 	}
-	for (int i = 0; i < joy_names.size(); i++) {
-		if (joy_names[i].uid == p_guid) {
-			joy_names[i].mapping = -1;
+	for (Map<int, Joypad>::Element *E = joy_names.front(); E; E = E->next()) {
+		Joypad &joy = E->get();
+		if (joy.uid == p_guid) {
+			joy.mapping = -1;
 		}
 	}
 }
@@ -1259,8 +1261,13 @@

 //platforms that use the remapping system can override and call to these ones
 bool InputDefault::is_joy_mapped(int p_device) {
-	int mapping = joy_names[p_device].mapping;
-	return mapping != -1 ? (mapping != fallback_mapping) : false;
+	if (joy_names.has(p_device)) {
+		int mapping = joy_names[p_device].mapping;
+		if (mapping != -1 && mapping != fallback_mapping) {
+			return true;
+		}
+	}
+	return false;
 }

 String InputDefault::get_joy_guid_remapped(int p_device) const {