細かい修正

細かい修正

--- LJ_Argon_MD.cpp
+++ LJ_Argon_MD.cpp
@@ -11,6 +11,8 @@
 #include <array>									// for std::array
 #include <memory>									// for std::unique_ptr
 #include <vector>									// for std::vector
+#include <boost/cast.hpp>							// for boost::numeric_cast
+#include <boost/range/algorithm/max_element.hpp>	// for boost::max_element

 //! A global variable (constant).
 /*!
@@ -101,7 +103,7 @@
     g_pWorldVariable->SetMatrix(reinterpret_cast<float *>(const_cast<D3DXMATRIX *>(&(*g_Camera.GetWorldMatrix()))));
     g_pViewVariable->SetMatrix(reinterpret_cast<float *>(const_cast<D3DXMATRIX *>(&(*g_Camera.GetViewMatrix()))));
     g_pProjectionVariable->SetMatrix(reinterpret_cast<float *>(const_cast<D3DXMATRIX *>(&(*g_Camera.GetProjMatrix()))));
-
+
     D3D10_TECHNIQUE_DESC techDesc;
     g_pRender->GetDesc(&techDesc);

@@ -126,15 +128,22 @@
     }

     auto const size = pmeshvec.size();
+	auto const origin = boost::numeric_cast<float>(*boost::max_element(armd.X())) / 2.0f;
+
     for (auto i = 0U; i < size; i++) {
         g_pColorVariable->SetFloatVector(reinterpret_cast<float *>(&g_Colors[1]));

-        D3DXMATRIX  World;
-        D3DXMatrixTranslation(&World, armd.X()[i], armd.Y()[i], armd.Z()[i]);
+        D3DXMATRIX World;
+        D3DXMatrixTranslation(
+			&World,
+			boost::numeric_cast<float>(armd.X()[i]) - origin,
+			boost::numeric_cast<float>(armd.Y()[i]) - origin,
+			boost::numeric_cast<float>(armd.Z()[i]) - origin);
         D3DXMatrixMultiply(&World, &(*g_Camera.GetWorldMatrix()), &World);

-        // Update variables
-        g_pWorldVariable->SetMatrix(World);
+		// Update variables
+		auto mWorld = World * (*g_Camera.GetWorldMatrix());
+		g_pWorldVariable->SetMatrix(reinterpret_cast<float *>(&mWorld));

         UINT NumSubsets;
         pmeshvec[i]->GetAttributeTable(nullptr, &NumSubsets);
@@ -288,7 +297,7 @@
     utility::v_return(pd3dDevice->CreateBuffer(&bd, &InitData, &pIndexBuffertmp));
 	pIndexBuffer.reset(pIndexBuffertmp);

-    D3DXVECTOR3 vEye(15.0f, 15.0f, 15.0f);
+    D3DXVECTOR3 vEye(0.0f, 5.0f, 10.0f);
 	D3DXVECTOR3 vLook(0.0f, 0.0f, 0.0f);
     D3DXVECTOR3 const Up(0.0f, 1.0f, 0.0f);
     D3DXMatrixLookAtLH(&g_View, &vEye, &vLook, &Up);


Try std::map for dupmarking

Try std::map for dupmarking

--- SNAPLib/Bam.cpp
+++ SNAPLib/Bam.cpp
@@ -872,6 +872,16 @@
     {
         return ! ((*this) == b);
     }
+
+    bool operator<(const DuplicateReadKey& b) const
+    {
+        return locations[0] < b.locations[0] ||
+            (locations[0] == b.locations[0] &&
+                (locations[1] < b.locations[1] ||
+                    (locations[1] == b.locations[1] &&
+                        isRC[0] * 2 + isRC[1] <  b.isRC[0] *2 + b.isRC[1])));
+    }
+

     // required for use as a key in VariableSizeMap template
     DuplicateReadKey(int x)
@@ -906,7 +916,7 @@
 public:
     BAMDupMarkFilter(const Genome* i_genome) :
         BAMFilter(DataWriter::ModifyFilter),
-        genome(i_genome), runOffset(0), runLocation(UINT32_MAX), runCount(0), mates(128)
+        genome(i_genome), runOffset(0), runLocation(UINT32_MAX), runCount(0), mates()
     {}

     ~BAMDupMarkFilter() {}
@@ -925,7 +935,8 @@
     size_t runOffset; // offset in file of first read in run
     _uint32 runLocation; // location in genome
     int runCount; // number of aligned reads
-    typedef VariableSizeMap<DuplicateReadKey,DuplicateMateInfo,150,MapNumericHash<DuplicateReadKey>,90,0,-2,-3> MateMap;
+    //typedef VariableSizeMap<DuplicateReadKey,DuplicateMateInfo,150,MapNumericHash<DuplicateReadKey>,90,0,-2,-3> MateMap;
+    typedef std::map<DuplicateReadKey,DuplicateMateInfo> MateMap;
     MateMap mates;
 };

@@ -951,14 +962,16 @@
             for (BAMAlignment* record = getRead(offset); record != lastBam; record = getNextRead(record, &offset)) {
                 _ASSERT(record->refID >= -1 && record->refID < genome->getNumPieces()); // simple sanity check
                 DuplicateReadKey key(record, genome);
-                DuplicateMateInfo* info = mates.tryFind(key);
+                MateMap::iterator i = mates.find(key);
                 bool isSecond = (record->FLAG & SAM_LAST_SEGMENT) != 0;
-                if (info == NULL) {
+                DuplicateMateInfo* info;
+                if (i != mates.end()) {
+                    info = &i->second;
+                } else {
                     if (isSecond) {
                         continue; // mate wasn't in a run, so it can't be a duplicate pair
                     }
-                    bool ok = mates.tryAdd(key, DuplicateMateInfo(), &info);
-                    _ASSERT(ok);
+                    info = &mates[key];
                     info->firstRunOffset = offset;
                     info->firstRunEndOffset = lastOffset;
                 }
@@ -999,10 +1012,11 @@
             VariableSizeVector<DuplicateMateInfo*>* failedBackpatch = NULL;
             for (BAMAlignment* record = getRead(offset); record != lastBam; record = getNextRead(record, &offset)) {
                 DuplicateReadKey key(record, genome);
-                DuplicateMateInfo* info = mates.tryFind(key);
-                if (info == NULL) {
+                MateMap::iterator i = mates.find(key);
+                if (i == mates.end()) {
                     continue; // one end in a run, other not
                 }
+                DuplicateMateInfo* info = &i->second;
                 bool pass = info->bestReadQuality[1] != 0; // 1 for second pass, 0 for first pass
                 bool isSecond = (record->FLAG & SAM_LAST_SEGMENT) != 0;
                 static const int index[2][2] = {{0, 3}, {2, 1}};


Add built-in documentation for MPI parametric test with real data

--- Infovis/Testing/Cxx/TestRealDataPDescriptiveStatisticsMPI.cxx
+++ Infovis/Testing/Cxx/TestRealDataPDescriptiveStatisticsMPI.cxx
@@ -475,10 +475,19 @@
                      vtksys::CommandLineArguments::MULTI_ARGUMENT,
                      &procDim, "Dimensions of the input data");

-  // If incorrect arguments were provided, terminate in error.
+  // If incorrect arguments were provided, provide some help and terminate in error.
   if ( ! clArgs.Parse() )
     {
-    vtkGenericWarningMacro("Incorrect input data arguments were provided.");
+    if ( com->GetLocalProcessId() == ioRank )
+      {
+      cerr << "Usage: "
+           << clArgs.GetHelp()
+           << "\n";
+      }
+
+    controller->Finalize();
+    controller->Delete();
+
     return 1;
     }


synaptics: set the clickpad property before clickpad behaviour tests

In case it wasn't set automatically, so the tests can still run

Signed-off-by: Peter Hutterer <b9c50af7afa7642f6f854434cda9ffe54ece8b85@who-t.net>

--- tests/synaptics.cpp
+++ tests/synaptics.cpp
@@ -267,6 +267,22 @@
     std::auto_ptr<xorg::testing::evemu::Device> dev;
 };

+static void
+set_clickpad_property(Display *dpy, const char* name)
+{
+    int deviceid;
+    ASSERT_EQ(FindInputDeviceByName(dpy, name, &deviceid), 1);
+
+    Atom clickpad_prop = XInternAtom(dpy, "Synaptics ClickPad", True);
+    ASSERT_NE(clickpad_prop, (Atom)None);
+
+    unsigned char data = 1;
+
+    XIChangeProperty(dpy, deviceid, clickpad_prop, XA_INTEGER, 8,
+                     PropModeReplace, &data, 1);
+    XSync(dpy, False);
+}
+
 TEST_F(SynapticsDriverClickpadTest, ClickpadProperties)
 {
 #ifndef INPUT_PROP_BUTTONPAD
@@ -330,6 +346,7 @@

 TEST_F(SynapticsDriverClickpadTest, Tap)
 {
+    set_clickpad_property(Display(), "--device--");
     XSelectInput(Display(), DefaultRootWindow(Display()), ButtonPressMask | ButtonReleaseMask);
     XSync(Display(), False);

@@ -353,6 +370,7 @@

 TEST_F(SynapticsDriverClickpadTest, VertScrollDown)
 {
+    set_clickpad_property(Display(), "--device--");
     XSelectInput(Display(), DefaultRootWindow(Display()), ButtonPressMask | ButtonReleaseMask);
     XSync(Display(), False);

@@ -376,6 +394,7 @@

 TEST_F(SynapticsDriverClickpadTest, VertScrollUp)
 {
+    set_clickpad_property(Display(), "--device--");
     XSelectInput(Display(), DefaultRootWindow(Display()), ButtonPressMask | ButtonReleaseMask);
     XSync(Display(), False);

@@ -414,6 +433,7 @@
         config.AddDefaultScreenWithDriver();
         config.AddInputSection("synaptics", "--device--",
                                "Option \"CorePointer\"         \"on\"\n"
+                               "Option \"ClickPad\"            \"on\"\n"
                                "Option \"GrabEventDevice\"     \"0\"\n"
                                "Option \"SoftButtonAreas\"     \"50% 0 82% 0 0 0 0 0\"\n"
                                "Option \"Device\"              \"" + dev->GetDeviceNode() + "\"\n");


typo in recent fix for Foundation/IO/FileAccessException DoThrow

--- Library/Sources/Stroika/Foundation/IO/FileAccessException.inl
+++ Library/Sources/Stroika/Foundation/IO/FileAccessException.inl
@@ -41,7 +41,7 @@
             [[noreturn]]    inline  void    Throw (const IO::FileAccessException& e2Throw)
             {
 #if     qStroika_Foundation_Exection_Exceptions_TraceThrowpointBacktrace
-                DbgTrace (L"Throwing FileAccessException: fFileName='%s'; FileAccessMode=%s from %s", e2Throw.GetFileName ().c_str (), Configuration::DefaultNames<IO::FileAccessMode>::k.GetName (e2Throw.GetFileAccessMode ()), Private_::GetBT_s ().c_str ());
+                DbgTrace (L"Throwing FileAccessException: fFileName='%s'; FileAccessMode=%s from %s", e2Throw.GetFileName ().c_str (), Configuration::DefaultNames<IO::FileAccessMode>::k.GetName (e2Throw.GetFileAccessMode ()), Private_::GetBT_ws ().c_str ());
 #else
                 DbgTrace (L"Throwing FileAccessException: fFileName='%s'; FileAccessMode=%s", e2Throw.GetFileName ().c_str (), Configuration::DefaultNames<IO::FileAccessMode>::k.GetName (e2Throw.GetFileAccessMode ()));
 #endif


fix include for recent socket changes

fix include for recent socket changes

--- Library/Sources/Stroika/Foundation/IO/Network/LinkMonitor.cpp
+++ Library/Sources/Stroika/Foundation/IO/Network/LinkMonitor.cpp
@@ -36,7 +36,7 @@
 #endif
 #include "../../IO/Network/DNS.h"

-#include "Socket.h"
+#include "ConnectionlessSocket.h"

 #include "LinkMonitor.h"


tests/task: handle fail cmd: "command not found"

--- tests/task/main.cpp
+++ tests/task/main.cpp
@@ -12,6 +12,7 @@
     void sleep_fail();
     void sleep_crash();
     void sleep_filenotfound();
+    void cmd_filenotfound();

 private:
     QString get_script(QString scriptname);
@@ -83,5 +84,19 @@
     QVERIFY(sig_fin.takeFirst().at(1).toInt() == 127);
 }

+void TestTask::cmd_filenotfound()
+{
+    TarsnapTask *task = new TarsnapTask();
+    QSignalSpy   sig_started(task, SIGNAL(started(QVariant)));
+    QSignalSpy sig_fin(task, SIGNAL(finished(QVariant, int, QString, QString)));
+    QSignalSpy sig_dequeue(task, SIGNAL(dequeue()));
+
+    task->setCommand("/fake/dir/fake-cmd");
+    task->run();
+    // We got a "finished" signal, with exit code EXIT_DID_NOT_START.
+    QVERIFY(sig_fin.count() == 1);
+    QVERIFY(sig_fin.takeFirst().at(1).toInt() == EXIT_DID_NOT_START);
+}
+
 QTEST_MAIN(TestTask)
 #include "main.moc"


changed line that was breaking

changed line that was breaking

--- Modules/ThirdParty/VNL/src/vxl/v3p/netlib/linalg/lsqrBase.cxx
+++ Modules/ThirdParty/VNL/src/vxl/v3p/netlib/linalg/lsqrBase.cxx
@@ -562,7 +562,7 @@
     // See if it is time to print something.
     //----------------------------------------------------------------
     bool prnt = false;
-    if (nout > 0)
+    if (this->nout)
       {
       if (n     <=        40) prnt = true;
       if (this->itn   <=        10) prnt = true;


Update in Dpt Dpt Corr:prabhst

Update in Dpt Dpt Corr:prabhst

--- PWGCF/Correlations/DPhi/AliAnalysisTaskDptDptCorrelations.cxx
+++ PWGCF/Correlations/DPhi/AliAnalysisTaskDptDptCorrelations.cxx
@@ -4,6 +4,7 @@
 Authors:      P.Pujahari & C. Pruneau
               Wayne State University
 Dated:        March 15, 2013
+Code verII: Vertex Z for Systematics (check binning)
 */
 //================================
 #include "TChain.h"
@@ -82,7 +83,7 @@
 _sameFilter    ( false),
 _rejectPileup  ( 1),
 _rejectPairConversion ( 0),
-  _vertexZMin           ( -5), //10
+_vertexZMin           ( -5), //10
 _vertexZMax           (  5),
 _vertexXYMin          ( -10),
 _vertexXYMax          (  10),


PWGCF: PionPionAnalysis - Correct check for string "emptiness"

--- PWGCF/FEMTOSCOPY/macros/Train/PionPionFemto/AddTaskPionPion.C
+++ PWGCF/FEMTOSCOPY/macros/Train/PionPionFemto/AddTaskPionPion.C
@@ -97,7 +97,7 @@
   macro.ReplaceAll("%%", AUTO_DIRECTORY);

   // Dealing with subwagons
-  if (subwagon_suffix) {
+  if (!subwagon_suffix.IsWhitespace()) {
     subwagon_type.ToLower();

     if (subwagon_type == "centrality") {


add back

add back


Added `Try` constructors from `_Some`.

Added `Try` constructors from `_Some`.

This is necessary in cases such as constructing
`Result<T>` from `T`:
```
  Result(const T& _t)
    : data(Some(_t)) {}
```
to avoid unnecessary implicit conversions and copies.

Review: https://reviews.apache.org/r/70171

--- 3rdparty/stout/include/stout/try.hpp
+++ 3rdparty/stout/include/stout/try.hpp
@@ -54,6 +54,12 @@

   Try(T&& t)
     : data(Some(std::move(t))) {}
+
+  template <typename U>
+  Try(const _Some<U>& some) : data(some) {}
+
+  template <typename U>
+  Try(_Some<U>&& some) : data(std::move(some)) {}

   // We don't need to implement these because we are leveraging
   // Option<T>.


Use seamless cubemap filtering.

Use seamless cubemap filtering.

--- example-game/example-game.cpp
+++ example-game/example-game.cpp
@@ -55,12 +55,10 @@
     load_cube_face(cube_tex, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, "assets/negy.jpg");
     load_cube_face(cube_tex, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, "assets/posz.jpg");
     load_cube_face(cube_tex, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, "assets/negz.jpg");
-    glGenerateTextureMipmap(cube_tex);
+    glGenerateTextureMipmap(cube_tex);
     glTextureParameteri(cube_tex, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
     glTextureParameteri(cube_tex, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-    glTextureParameteri(cube_tex, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
-    glTextureParameteri(cube_tex, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-    glTextureParameteri(cube_tex, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+    glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);

     auto program = link_program({
         compile_shader(GL_VERTEX_SHADER, R"(#version 450


Added rate in gcs_control_node

Added rate in gcs_control_node

--- GCS/src/gcs_control_node.cpp
+++ GCS/src/gcs_control_node.cpp
@@ -214,6 +214,7 @@
 	{
 		gcs.run();
 		ros::spinOnce();
+		rate.sleep();
 	}
 	return 0;
 }


checking stub EP from loader *.map file

checking stub EP from loader *.map file

--- Remote_DLL_Injector/StealthInjectionLib/src/StealthInject.cpp
+++ Remote_DLL_Injector/StealthInjectionLib/src/StealthInject.cpp
@@ -6,6 +6,11 @@

 #include <boost/filesystem/fstream.hpp>
 #include <boost/filesystem/operations.hpp>
+#include <boost/iostreams/device/file.hpp>
+#include <boost/iostreams/stream.hpp>
+#include <boost/algorithm/string/split.hpp>
+#include <boost/algorithm/string/classification.hpp>
+#include <boost/lexical_cast.hpp>
 #include <boost/optional.hpp>
 #include <map>
 #include <limits>
@@ -13,7 +18,15 @@
 #include <Shlwapi.h>
 using namespace std;

-#define HEADER_SIZE 0x1000
+struct LoaderX86Info
+{
+  std::string stubName = "loader_x86.stub";
+  std::string mapFileName = "loader_x86.map";
+  std::string loader_ep_function_name = "StubEP"; // entry point
+  uint16_t headerSize = 0x1000;
+};
+
+static LoaderX86Info loader_x86_info;

 LPVOID GetStubCodePtr(const std::string& stubName) noexcept
 {
@@ -40,6 +53,74 @@
   loaderFile.close();

   return reinterpret_cast<LPVOID>(loaderData.data());
+}
+
+struct MapFileLine
+{
+  uint16_t section;
+  unsigned long offset;
+  std::string mangledName;
+  uint64_t functionRVA;
+  std::string unkStr0;
+  std::string objFileName;
+};
+
+MapFileLine LineToMapFileLine(std::string line)
+{
+  std::vector<std::string> lines;
+  boost::split(lines, line, boost::is_any_of(" :\t"));
+
+  if (lines.empty())
+  {
+    throw std::runtime_error("error parsing string");
+  }
+
+  auto end = std::remove_if(lines.begin(), lines.end(), [](const auto& ln) {
+    return ln.empty();
+  });
+  lines.erase(end, lines.end());
+
+  return{
+    boost::lexical_cast<decltype(MapFileLine::section)>(lines[0]),
+    std::stoul(lines[1], nullptr, 16),
+    lines[2],
+    boost::lexical_cast<decltype(MapFileLine::functionRVA)>(lines[3]),
+    lines[4],
+    lines[5]
+  };
+}
+
+auto GetFunctionOffsetFromMapFile(const std::string& mapFileName, const std::string& functionName)
+{
+  decltype(MapFileLine::offset) offset{};
+
+  // load loader data
+  static std::vector<char> mapFileData;
+
+  // todo(azerg): add ability to use alternative loader's storage path, instead of current dir
+  boost::filesystem::path loaderFullPath{ boost::filesystem::current_path() };
+  loaderFullPath /= mapFileName;
+
+  if (!boost::filesystem::exists(loaderFullPath))
+    throw std::runtime_error("no map file found");
+
+  boost::iostreams::stream<boost::iostreams::file_source> file(loaderFullPath.string().c_str());
+
+  std::string mangledFunctionName = "?" + functionName + "@@";
+
+  std::string line;
+  while (std::getline(file, line))
+  {
+    if (line.find(mangledFunctionName) != std::string::npos)
+    {
+      // sample line here:  0001:00000150       ?StartOriginalPE@@YAXPAUStubParams@@@Z 00401150 f   loader.obj
+
+      auto mapFileLine = LineToMapFileLine(line);
+      return mapFileLine.offset;
+    }
+  }
+
+  return offset;
 }

 boost::optional<StubParams> FillStubParams(StealthParamsIn* in, StealthParamsOut* out, int targetPID, PEFile& dllToInjectFile)
@@ -52,7 +133,7 @@
   stubData.dllBase = out->dllBase;
   stubData.entryPoint = (DllMainProc)((ULONG_PTR)out->dllBase + dllToInjectFile.getNtHeaders32()->OptionalHeader.AddressOfEntryPoint);
   out->dllEntryPoint = (DWORD)stubData.entryPoint;
-  memcpy(stubData.stub, GetStubCodePtr({"loader_x86.stub"}), sizeof(stubData.stub));
+  memcpy(stubData.stub, GetStubCodePtr({ loader_x86_info.stubName }), sizeof(stubData.stub));

   stubData.pGetModuleHandle = cmn::getProcAddressEx(targetPID, "kernel32.dll", "GetModuleHandleW");
   stubData.pGetProcAddress = cmn::getProcAddressEx(targetPID, "kernel32.dll", "GetProcAddress");
@@ -103,7 +184,7 @@
   memcpy((LPVOID)((DWORD)out->prepDllAlloc + out->randomHead), stubData.get_ptr(), sizeof(StubParams));

   // copy pe header, real header size is in IMAGE_FIRST_SECTION (peFile.getNtHeaders32())->PointerToRawData), but 0x1000 works well too
-  memcpy(out->prepDllBase, in->dllToInject.data(), HEADER_SIZE);
+  memcpy(out->prepDllBase, in->dllToInject.data(), loader_x86_info.headerSize);

   // copy sections
   char sectionName[10]{};
@@ -130,7 +211,7 @@
   }

   if (in->removePEHeader)
-    memset(out->prepDllBase, 0, HEADER_SIZE);
+    memset(out->prepDllBase, 0, loader_x86_info.headerSize);

   if (in->removeExtraSections)
   {
@@ -154,9 +235,11 @@
     return SI_FailedToWriteDll;
   }

+  auto stubEPOffset = GetFunctionOffsetFromMapFile(loader_x86_info.mapFileName, loader_x86_info.loader_ep_function_name);
+
   // create the stub thread, stub is located at allocationBase+randomHead, this is the start of StubParams, and the first
   // param is the stub itself!
-  auto pRemoteAddr = out->allocationBase + out->randomHead;
+  auto pRemoteAddr = out->allocationBase + out->randomHead + stubEPOffset;
   if (!CreateThread(targetProcess, pRemoteAddr, out->allocationBase + out->randomHead))
   {
     CONSOLE("Error: FailedToCreateThread in target process");


Remove duplicate definitions

Remove duplicate definitions

--- include/abc/stl/memory.hxx
+++ include/abc/stl/memory.hxx
@@ -667,21 +667,17 @@

    /** See exception::exception().
    */
-   bad_weak_ptr() {
-   }
+   bad_weak_ptr();

    /** Destructor.
    */
-   virtual ~bad_weak_ptr() {
-   }
+   virtual ~bad_weak_ptr();

    /** See exception::what().
    */
-   virtual char const * what() const {
-      return "std::bad_weak_ptr";
-   }
+   virtual char const * what() const;
 };

 } //namespace std


Use the default signed difference type for iterators instead of the unsigned size_t

--- include/adapters/array.hpp
+++ include/adapters/array.hpp
@@ -311,7 +311,7 @@
 /*Mutable iterator class template*/
 template <typename T, size_t N>
 class DataApapterIterator<T[N]>
-    : public std::iterator<std::random_access_iterator_tag, T, size_t> {
+    : public std::iterator<std::random_access_iterator_tag, T> {
     public:
         typedef std::iterator<std::random_access_iterator_tag, T> iterator_traits;

@@ -431,7 +431,7 @@

 /*Immutable iterator class template*/
 template <typename T, size_t N>
-class DataApapterIterator<const T[N]> : public std::iterator<std::random_access_iterator_tag, T, size_t> {
+class DataApapterIterator<const T[N]> : public std::iterator<std::random_access_iterator_tag, T> {
     public:
         typedef std::iterator<std::random_access_iterator_tag, T> iterator_traits;


fix(i3): Conditionally load i3_utils

fix(i3): Conditionally load i3_utils

--- include/components/bar.hpp
+++ include/components/bar.hpp
@@ -18,10 +18,12 @@
 #include "components/x11/xlib.hpp"
 #include "components/x11/xutils.hpp"
 #include "utils/bspwm.hpp"
-#include "utils/i3.hpp"
 #include "utils/math.hpp"
 #include "utils/string.hpp"
 #include "utils/threading.hpp"
+#if ENABLE_I3
+#include "utils/i3.hpp"
+#endif

 LEMONBUDDY_NS

@@ -340,8 +342,10 @@
       if (wm_restack == "bspwm") {
         restacked = bspwm_util::restack_above_root(m_connection, m_bar.monitor, m_window);

-      } else if (wm_restack == "i3" && m_bar.dock) {
+      } else if (wm_restack == "i3" && m_bar.dock && ENABLE_I3) {
+#if ENABLE_I3
         restacked = i3_util::restack_above_root(m_connection, m_bar.monitor, m_window);
+#endif

       } else if (wm_restack == "i3" && !m_bar.dock) {
         m_log.warn("Ignoring restack of i3 window (not needed when dock = false)");


修改类型名

修改类型名

--- include/covscript/core.hpp
+++ include/covscript/core.hpp
@@ -509,7 +509,7 @@

 	name_space_t make_shared_namespace(name_space &ns)
 	{
-		return std::make_shared<extension_holder>(&ns);
+		return std::make_shared<name_space_holder>(&ns);
 	}

 // Implement


correct comment

correct comment

--- include/gemmi/to_mmcif.hpp
+++ include/gemmi/to_mmcif.hpp
@@ -28,7 +28,7 @@
 #include <string>
 #include <utility>  // std::pair
 #include "sprintf.hpp"
-#include "entstr.hpp" // for entity_type_to_string, polymer_type_to_string
+#include "entstr.hpp" // for entity_type_to_string, polymer_type_to_qstring
 #include "calculate.hpp"  // for count_atom_sites

 namespace gemmi {


refs #88, fix signed/unsigned issue

refs #88, fix signed/unsigned issue

--- include/ghc/filesystem.hpp
+++ include/ghc/filesystem.hpp
@@ -2711,7 +2711,7 @@
         else {
             auto piter = end();
             auto iter = piter.decrement(_path.end());
-            if(iter > _path.begin() + rootPathLen && *iter != '/') {
+            if(iter > _path.begin() + static_cast<long>(rootPathLen) && *iter != '/') {
                 --iter;
             }
             return path(_path.begin(), iter, format::generic_format);


setting up for mapnik v3.0.10 release [skip ci]

--- include/mapnik/version.hpp
+++ include/mapnik/version.hpp
@@ -25,7 +25,7 @@

 #define MAPNIK_MAJOR_VERSION 3
 #define MAPNIK_MINOR_VERSION 0
-#define MAPNIK_PATCH_VERSION 9
+#define MAPNIK_PATCH_VERSION 10

 #define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION)


remove logging.hpp

remove logging.hpp

--- include/pfasst/logging.hpp
+++ include/pfasst/logging.hpp
@@ -97,7 +97,6 @@
 #include <leathers/all>
 #include <pfasst/easylogging++.h>
 #include <leathers/pop>
-#include <pfasst/metalog.hpp>

 #ifndef ML_NOLOG
   #define ML_LOG(level, x) LOG(level) << x


add host-factory mode to shared http client pool

--- include/ten/http/client.hh
+++ include/ten/http/client.hh
@@ -178,19 +178,20 @@

 public:
     using scoped_resource = detail::http_scoped_resource;
-
-    http_pool(const std::string &host_,
-            uint16_t port_,
-            optional<size_t> max_conn = nullopt,
-            http_client::lifetime_t lifetime_ = nullopt,
-            optional_timeout conn_timeout_ = nullopt)
+    using host_port_t = std::pair<std::string, uint16_t>;
+
+    // general case: arbitrary host generator
+    http_pool(std::string name_,
+              std::function< host_port_t() > host_factory_,
+              optional<size_t> max_conn_ = nullopt,
+              http_client::lifetime_t lifetime_ = nullopt,
+              optional_timeout conn_timeout_ = nullopt)
         : shared_pool<http_client>(
-            "http://" + host_ + ":" + std::to_string(port_),
-            std::bind(&http_pool::new_resource, this),
-            max_conn
+            name_,
+            [this]{ return new_resource(); },
+            max_conn_
           ),
-          _host(host_),
-          _port(port_),
+          _host_factory(host_factory_),
           _lifetime(lifetime_),
           _conn_timeout(conn_timeout_)
     {
@@ -204,9 +205,23 @@
         }
     }

+    // simple case: one host
+    http_pool(std::string host_,
+              uint16_t port_,
+              optional<size_t> max_conn_ = nullopt,
+              http_client::lifetime_t lifetime_ = nullopt,
+              optional_timeout conn_timeout_ = nullopt)
+        : http_pool(
+            "http://" + host_ + ":" + std::to_string(port_),
+            [=]{ return host_port_t{ host_, port_ }; },
+            max_conn_,
+            lifetime_,
+            conn_timeout_
+          )
+    {}
+
 protected:
-    std::string _host;
-    uint16_t _port;
+    std::function< host_port_t() > _host_factory;
     http_client::lifetime_t _lifetime;
     optional_timeout _conn_timeout;

@@ -222,8 +237,9 @@
     std::shared_ptr<lt_state> _lt;

     res_ptr new_resource() {
-        VLOG(3) << name() << ": new http_client resource " << _host << ":" << _port;
-        return std::make_shared<http_client>(_host, _port, _lifetime, _conn_timeout);
+        const auto hp = _host_factory();
+        VLOG(3) << name() << ": new http_client resource " << hp.first << ":" << hp.second;
+        return std::make_shared<http_client>(hp.first, hp.second, _lifetime, _conn_timeout);
     }

     // periodically check the items at the front of the avail queue.


input and output m128i as chars

input and output m128i as chars

--- include/vsmc/rng/m128i.hpp
+++ include/vsmc/rng/m128i.hpp
@@ -72,7 +72,7 @@
     return sa == sb;
 }

-/// \brief Write an __m128i object into an output stream as two 64-bits
+/// \brief Write an __m128i object into an output stream as 16 bytes
 /// unsigned integers
 /// \ingroup RNG
 template <typename CharT, typename Traits>
@@ -80,7 +80,7 @@
         std::basic_ostream<CharT, Traits> &os, const __m128i &a)
 {
     if (os) {
-        StaticVector<uint64_t, 2> sa;
+        StaticVector<unsigned char, 16> sa;
         m128i_unpack<0>(a, sa);
         os << sa;
     }
@@ -88,7 +88,7 @@
     return os;
 }

-/// \brief Input an __m128i object from an input stream as two 64-bits
+/// \brief Input an __m128i object from an input stream as 16 bytes
 /// unsigned integers written by m128i_output
 /// \ingroup RNG
 template <typename CharT, typename Traits>
@@ -96,7 +96,7 @@
         std::basic_istream<CharT, Traits> &is, __m128i &a)
 {
     if (is) {
-        StaticVector<uint64_t, 2> sa;
+        StaticVector<unsigned char, 16> sa;
         is >> sa;
         if (is) m128i_pack<0>(sa, a);
     }


Return std::pair occurrence

Return std::pair occurrence

--- include/xwidgets/xlink.hpp
+++ include/xwidgets/xlink.hpp
@@ -9,6 +9,8 @@
 #ifndef XWIDGETS_LINK_HPP
 #define XWIDGETS_LINK_HPP

+#include <string>
+#include <tuple>
 #include <utility>

 #include "xholder.hpp"
@@ -59,7 +61,7 @@
      * directional_link declaration *
      ********************************/

-    using xdirectional_link_pair_type = std::pair<xholder<xtransport>, std::string>;
+    using xdirectional_link_pair_type = std::tuple<xholder<xtransport>, std::string>;

     template <class D>
     class xdirectional_link : public xobject<D>


Fixed leak when empty input.

Fixed leak when empty input.

--- Graphics/vtkStreamTracer.cxx
+++ Graphics/vtkStreamTracer.cxx
@@ -28,7 +28,7 @@
 #include "vtkRungeKutta4.h"
 #include "vtkRungeKutta45.h"

-vtkCxxRevisionMacro(vtkStreamTracer, "1.13");
+vtkCxxRevisionMacro(vtkStreamTracer, "1.14");
 vtkStandardNewMacro(vtkStreamTracer);
 vtkCxxSetObjectMacro(vtkStreamTracer,Integrator,vtkInitialValueProblemSolver);

@@ -532,8 +532,6 @@
   vtkDataArray* inVectors = 0;

   int direction=1;
-  // Used in GetCell()
-  vtkGenericCell* cell = vtkGenericCell::New();

   // Set the function set to be integrated
   vtkInterpolatedVelocityField* func = vtkInterpolatedVelocityField::New();
@@ -565,6 +563,7 @@
   if ( numInputs == 0 )
     {
     vtkErrorMacro("No appropriate inputs have been found. Can not execute.");
+    func->Delete();
     return;
     }

@@ -578,9 +577,11 @@
     {
     vtkErrorMacro("No integrator is specified.");
     func->Delete();
-    cell->Delete();
     return;
     }
+
+  // Used in GetCell()
+  vtkGenericCell* cell = vtkGenericCell::New();

   // Create a new integrator, the type is the same as Integrator
   vtkInitialValueProblemSolver* integrator =


fontawesome menu icon fix

fontawesome menu icon fix

--- Service/Cms.cpp
+++ Service/Cms.cpp
@@ -118,7 +118,7 @@
                     WString("
 {1}
")
                     .arg(tr("cms-dashboard-newsletter")), TextFormat::XHTMLUnsafeText);
         WText *subscribers = new WText(
-                    WString("
 {1}
")
+                    WString("
 {1}
")
                     .arg(tr("cms-dashboard-subscribers")), TextFormat::XHTMLUnsafeText);
         WText *contacts = new WText(
                     WString("
 {1}
")


Switching back to computing particles on the GPU.
Decreasing the number of particles by 4 times.

git-svn-id: f6f47f0a6375c1440c859a5b92b3b3fbb75bb58e@2465 afdca40c-03d6-0310-8ede-e9f093b21075

--- examples/particle/main.cpp
+++ examples/particle/main.cpp
@@ -39,7 +39,7 @@
 using namespace std;

 // defines
-#define NUM_PARTICLES 65536
+#define NUM_PARTICLES 16384

 // forward declarations
 void init_shaders(void);
@@ -328,7 +328,10 @@

   try
     {
-
+    if (argc > 1) {
+      shUseBackend(argv[1]);
+    }
+
     init_shaders();
     init_streams();

@@ -371,7 +374,7 @@
   {
   // Specifiy the generic particle update program, later it will
   // be specialized for the the actual particle update.
-  particle = SH_BEGIN_PROGRAM("cpu:stream") {
+  particle = SH_BEGIN_PROGRAM("stream") {
     ShInOutPoint3f pos;
     ShInOutVector3f vel;
     ShInputVector3f acc;


Call delete on the deserialized TranslationUnit object.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@49136 91177308-0d34-0410-b5e6-96231b3b80d8

--- Driver/SerializationTest.cpp
+++ Driver/SerializationTest.cpp
@@ -99,6 +99,8 @@
     for (TranslationUnit::iterator I=NewTU->begin(), E=NewTU->end(); I!=E; ++I)
       FilePrinter->HandleTopLevelDecl(*I);
   }
+
+  delete NewTU;

   return true;
 }


handle exceptions parsing log file names

--- moveit_ros/visualization/motion_planning_rviz_plugin/src/motion_planning_frame_queries.cpp
+++ moveit_ros/visualization/motion_planning_rviz_plugin/src/motion_planning_frame_queries.cpp
@@ -1102,9 +1102,18 @@

 void MotionPlanningFrame::computeLoadBenchmarkResults(const std::string &file)
 {
-  std::string logid = file.substr( file.find_last_of(".", file.length()-5) + 1, file.find_last_of(".") - file.find_last_of(".", file.length()-5) - 1 );
-  std::string basename = file.substr(0, file.find_last_of(".", file.length()-5));
-  std::string logid_text = logid.substr(logid.find_first_of("_"), logid.length() - logid.find_first_of("_"));
+  std::string logid, basename, logid_text;
+  try
+  {
+    logid = file.substr( file.find_last_of(".", file.length()-5) + 1, file.find_last_of(".") - file.find_last_of(".", file.length()-5) - 1 );
+    basename = file.substr(0, file.find_last_of(".", file.length()-5));
+    logid_text = logid.substr(logid.find_first_of("_"), logid.length() - logid.find_first_of("_"));
+  }
+  catch (...)
+  {
+    ROS_ERROR("Invalid benchmark log file. Cannot load results.");
+    return;
+  }

   int count = 1;
   bool more_files = true;


Disable Mac-specific UA spoofing for iOS

iOS should not be spoofing as desktop Mac for Silverlight pages.

BUG=None

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

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

--- webkit/common/user_agent/user_agent.cc
+++ webkit/common/user_agent/user_agent.cc
@@ -60,7 +60,7 @@
 }

 bool IsMicrosoftSiteThatNeedsSpoofingForSilverlight(const GURL& url) {
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) && !defined(OS_IOS)
   // The landing page for updating Silverlight gives a confusing experience
   // in browsers that Silverlight doesn't officially support; spoof as
   // Safari to reduce the chance that users won't complete updates.
@@ -74,7 +74,7 @@
 }

 bool IsYahooSiteThatNeedsSpoofingForSilverlight(const GURL& url) {
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) && !defined(OS_IOS)
   if ((url.host() == "downloads.yahoo.co.jp" &&
       StartsWithASCII(url.path(), "/docs/silverlight/", true)) ||
       url.host() == "gyao.yahoo.co.jp") {
@@ -99,7 +99,7 @@
     if (IsMicrosoftSiteThatNeedsSpoofingForSilverlight(url) ||
         IsYahooSiteThatNeedsSpoofingForSilverlight(url)) {
       if (user_agent_for_spoofing_hack_.empty()) {
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) && !defined(OS_IOS)
         user_agent_for_spoofing_hack_ =
             BuildUserAgentFromProduct("Version/5.1.1 Safari/534.51.22");
 #elif defined(OS_WIN)


ChromiumOS build fix attempt for 86988

ChromiumOS build fix attempt for 86988

BUG=none
TEST=none
TBR=msw

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

--- webkit/fileapi/file_writer_delegate.cc
+++ webkit/fileapi/file_writer_delegate.cc
@@ -277,7 +277,8 @@

 void FileWriterDelegate::OnProgress(int bytes_written, bool done) {
   DCHECK(bytes_written + bytes_written_backlog_ >= bytes_written_backlog_);
-  if (bytes_written > 0 &&
+  if (quota_util() &&
+      bytes_written > 0 &&
       total_bytes_written_ + bytes_written + offset_ > size_) {
     int overlapped = 0;
     if (total_bytes_written_ + offset_ < size_)


Update advance.cpp

Update advance.cpp

.....

--- Src/advance.cpp
+++ Src/advance.cpp
@@ -101,6 +101,7 @@
                 case '{':
                     if (add == 1)
                     {
+                        Store_in_list(token_list_elem::token_list_elem::OPERATOR,"$");
                         Store_in_list(token_list_elem::token_list_elem::VAR_DEFINE,"@");
                         Store_in_list(token_list_elem::token_list_elem::BLOCK_BEGIN,"{");
                     }
@@ -129,6 +130,7 @@
                         //printf("!!!!!!!!!create_string:%s!!!!!!!!!!!!!!\n",create_string(pp,tmp));
                         pp = ++tmp;
                         Store_in_list(token_list_elem::token_list_elem::BLOCK_END,"}");
+                        Store_in_list(token_list_elem::token_list_elem::OPERATOR,"$");
                         have = 'n';
                     }
                     if (have == 'n')


fixed parameter order to memset() in testring.cpp

Change-Id: Iec8c9b291a14273a38f5b916feeeef50fbb9d6d8

--- examples/ring/testring.cpp
+++ examples/ring/testring.cpp
@@ -478,7 +478,7 @@
     }
   }
   /* pass 2, non blocking tests */
-  memset(scratchBuffer, scratch_sz, 0);
+  memset(scratchBuffer, 0, scratch_sz);
   for (i = 0; i < 256; i += 1) {
     scratchBuffer[i] = i;
   }


CDrone: Correct Z component calculation in TargetCover()

GM8E v0 multiplies by one in this case, not zero

--- Runtime/MP1/World/CDrone.cpp
+++ Runtime/MP1/World/CDrone.cpp
@@ -536,10 +536,12 @@
 }

 void CDrone::TargetCover(CStateManager& mgr, EStateMsg msg, float dt) {
-  if (msg != EStateMsg::Update)
-    return;
-  /* Don't ask I have no idea.... */
-  const zeus::CVector3f vec = {1.f * x5e4_ * 0.f, 1.f * x5e4_ * 0.f, 1.f * x5e4_ * 0.f};
+  if (msg != EStateMsg::Update) {
+    return;
+  }
+
+  // Don't ask I have no idea....
+  const zeus::CVector3f vec{1.f * x5e4_ * 0.f, 1.f * x5e4_ * 0.f, 1.f * x5e4_ * 1.f};
   ApplyImpulseWR(GetMoveToORImpulseWR(GetTransform().transposeRotate(vec), 1.f), {});
 }


OfxEffectInstance: add warning (TODO: fix it)

--- Engine/OfxEffectInstance.cpp
+++ Engine/OfxEffectInstance.cpp
@@ -146,7 +146,12 @@
         if (!effect_->getClipPreferences()) {
            qDebug() << "The plugin failed in the getClipPreferencesAction.";
         }
-
+#pragma message WARN("FIXME: Check here that bitdepth and components given by getClipPreferences are supported by the effect")
+        // FIXME: Check here that bitdepth and components given by getClipPreferences are supported by the effect.
+        // If we don't, the following assert will crash at the beginning of EffectInstance::renderRoIInternal():
+        // assert(isSupportedBitDepth(outputDepth) && isSupportedComponent(-1, outputComponents));
+        // If a component/bitdepth is not supported (this is probably a plugin bug), use the closest one, but don't crash Natron.
+
         // check that the plugin supports kOfxImageComponentRGBA for all the clips
         const std::vector<OFX::Host::ImageEffect::ClipDescriptor*>& clips = effectInstance()->getDescriptor().getClipsByOrder();
         for (U32 i = 0; i < clips.size(); ++i) {


update server example

update server example

--- examples/server/server.cpp
+++ examples/server/server.cpp
@@ -11,6 +11,7 @@
 #include <ednio/EdNio.h>
 #include <cahttp/CaHttpServer.h>
 #include <climits>
+#include <iostream>
 #include <cahttp/HttpFileReadStream.h>
 #include "FileUtil.h"

@@ -55,9 +56,10 @@
 class DirUrl: public CaHttpUrlCtrl {
 	void OnHttpReqMsg() override {
 		auto mph = getUrlMatchStr();
+
 		string dirpath = gApp.rootDir;
 		for(auto &ps: mph) {
-			dirpath += "/" + ps;
+			dirpath += ps;
 		}

 		string resp;
@@ -66,11 +68,11 @@
 		auto fl = FileUtil::getFileList(dirpath.data(), FileUtil::DIR_ONLY);
 		ls = "
";
 		for(auto &f: fl) {
-			ls += "
"+f+"
\n";
+			ls += "
"+f+"
\n";
 		}
 		fl = FileUtil::getFileList(dirpath.data(), FileUtil::FILE_ONLY);
 		for(auto &f: fl) {
-			ls += "
" + f+  "
\n";
+			ls += "
" + f+  "
\n";
 		}
 		ls += "
\n";
 		resp += ls;
@@ -114,7 +116,8 @@
 		if (msg.msgid == EDM_INIT) {
 			mServer.config("port", to_string(gApp.port).data());
 			mServer.setUrl<ListFileUrl>(HTTP_GET, "/file/list");
-			mServer.setUrlRegEx<DirUrl>(HTTP_GET, "/file/dir/(.*)");
+			mServer.setUrlRegEx<DirUrl>(HTTP_GET, "/file/dir(/[^\\?]*)");
+//			mServer.setUrlRegEx<DirUrl>(HTTP_GET, "/file/dir(/[^\\?]*)(.*)");
 			mServer.setUrlRegEx<DownloadUrl>(HTTP_GET, "/file/download/(.*)");
 			mServer.start(0);
 		}


Added XML registry and shell of net_server registry to Doxygen documentation.

Signed-off-by: Adam Hintz <96c833980ca266d81f358ac8bd40898278f74af6@gmail.com>

--- Engine/Scripting/LuaBind.cpp
+++ Engine/Scripting/LuaBind.cpp
@@ -566,6 +566,38 @@
 	}
 	return 3;
 }
+
+/**
+ * @page lua_xml The Lua Net Server Registry
+ * This page contains information about the Lua net server registry.
+ *
+ * This registry contains functions related to running a multiplayer server. In Lua, they are all
+ * called like so: "net_server.function_name()" (for example: "startup" becomes
+ * "net_server.startup(port, password)").
+ *
+ * Note: Somebody else will need to complete this registry, I don't know anything about it right now.
+ *
+ * @subsection startup
+ *
+ * @subsection shutdown
+ *
+ * @subsection running
+ *
+ * @subsection client_count
+ *
+ * @subsection kill
+ *
+ * @subsection connected
+ *
+ * @subsection send
+ *
+ * @subsection broadcast
+ *
+ * @subsection get
+ *
+ * @todo Complete the @ref lua_xml registry.
+ *
+ */

 luaL_Reg registryNetServer[] =
 {
@@ -664,6 +696,21 @@
 	return 1;
 }

+/**
+ * @page lua_xml The Lua XML Registry
+ * This page contains information about the Lua XML registry.
+ *
+ * This registry currently only contains one function. In Lua, it is called called like so:
+ * "xml.load(file)".
+ *
+ * @subsection load
+ * Loads and parses an XML file\n
+ * Parameters:\n
+ * name - The name of the mode that the game is currently in.\n
+ * Returns:\n
+ * A table with the contents of the file in it.
+ */
+
 luaL_Reg registryXML[] =
 {
 	"load", XML_ParseFile,


Move GCC specific pragma into #ifdef

Move GCC specific pragma into #ifdef

Refs: gh-119
Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- examples/spline/spline.cpp
+++ examples/spline/spline.cpp
@@ -202,8 +202,8 @@
 }

 // Point3 Spline::GetValueAlice(Point2 ab) const {{{1
+#ifdef Vc_GCC
 #pragma GCC diagnostic ignored "-Wold-style-cast"
-#ifdef Vc_GCC
 __attribute__((optimize("no-tree-vectorize")))
 #endif
 Point3 Spline::GetValueAlice(Point2 ab) const


Some extentions for a isobaric/isothermal ensemble

--- examples/twobody/twobody.C
+++ examples/twobody/twobody.C
@@ -9,53 +9,54 @@
  */

 #include <iostream>
+#include "io.h"
 #include "analysis.h"
-#include "mcloop.h"
+#include "potentials.h"
+#include "container.h"
+#include "countdown.h"
+#include "histogram.h"
+#include "inputfile.h"
 typedef pot_coulomb T_pairpot;         // Specific pair interaction function
 #include "markovmove.h"

 using namespace std;

 int main() {
+  enum dstkeys { Q1=0,Q2,MU1,MU2, LAST };
   slump slump;                          // A random number generator
   inputfile in("twobody.conf");         // Read input file
-  mcloop loop(in);                      // Set Markov chain loop lengths
   cell cell(in);                        // We want a spherical, hard cell
   canonical nvt;                        // Use the canonical ensemble
   pot_setup cfg(in);                    // Setup pair potential (default values)
   interaction<T_pairpot> pot(cfg);      // Functions for interactions
+  countdown<int> clock(10);             // Estimate simulation time
   ioxyz xyz(cell);                      // xyz output for VMD etc.
-  distributions dst;                    // Distance dep. averages
-  rdf saltrdf(particle::NA,particle::CL, .5, cell.r);
+  distributions dst(LAST,0,180);
+  rdf saltrdf(particle::NA,particle::SO4, .5, cell.r);

   vector<macromolecule> g;              // Group for proteins
   dualmove dm(nvt, cell, pot);          //   Class for 1D macromolecular translation
   dm.load( in, g, 40.);                 //   Load proteins and separate them
-  dm.rmax=60;
   salt salt;                            // Group for mobile ions
   salt.add(cell, in);                   //   Add salt particles
   saltmove sm(nvt, cell, pot);          // Class for salt movements
   macrorot mr(nvt, cell, pot);          // Class for macromolecule rotation

-  dm.dp=6;                              // Set displacement parameters
-  sm.dp=90;                             // Set displacement parameters
-
   ioaam aam(cell);                      // Protein input file format is AAM
   if (aam.load(cell,"confout.aam")) {
-    g[0].masscenter(cell);              // Load old config (if present)
-    g[1].masscenter(cell);              // ...and recalc mass centers
+    g[0].masscenter(cell.p);            // Load old config (if present)
+    g[1].masscenter(cell.p);            // ...and recalc mass centers
   }
-  chargereg tit(nvt,cell,pot,salt,4.0); // Prepare titration.
+  chargereg tit(nvt,cell,pot,salt,5.0); // Prepare titration.
   systemenergy sys(pot.energy(cell.p)); // System energy analysis
-  cout << cell.info() << pot.info()     // Print information to screen
-    << tit.info();
+  cout << cell.info() << pot.info();    // Print information to screen

   #ifdef GROMACS
   ioxtc xtc(cell, cell.r);              // Gromacs xtc output (if installed)
   #endif

-  for (int macro=1; macro<=loop.macro; macro++) {//Markov chain
-    for (int micro=1; micro<=loop.micro; micro++) {
+  for (int macro=1; macro<=10; macro++) {       // Markov chain
+    for (int micro=1; micro<=2e5; micro++) {
       short i,n;
       switch (rand() % 4) {                     // Pick a random MC move
         case 0:                                 // Displace salt
@@ -72,12 +73,10 @@
           break;
         case 3:                                 // Fluctuate charges
           sys+=tit.titrateall();                // Titrate sites on the protein
-          if (tit.du!=0) {                      // Average charges and dipoles
-            dst.add("Q1",dm.r, g[0].charge(cell.p));
-            dst.add("Q2",dm.r, g[1].charge(cell.p));
-            dst.add("MU1",dm.r,g[0].dipole(cell.p));
-            dst.add("MU2",dm.r,g[1].dipole(cell.p));
-          }
+          dst.add(Q1,dm.r, g[0].charge(cell.p));// Re-calc. protein charges
+          dst.add(Q2,dm.r, g[1].charge(cell.p));
+          dst.add(MU1,dm.r,g[0].dipole(cell.p));// ..and dipole moments
+          dst.add(MU2,dm.r,g[1].dipole(cell.p));
           break;
       }
       if (slump.random_one()>.8 && macro>1)
@@ -87,17 +86,19 @@
       if (slump.random_one()>.95 && macro>1)
         xtc.save("ignored-name.xtc", cell.p);   // Save trajectory
       #endif
+
     } // End of inner loop

     sys.update(pot.energy(cell.p));             // Update system energy averages
     cell.check_vector();                        // Check sanity of particle vector

-    dm.gofr.write("rdfprot.dat");               // Write interprotein g(r)
-    saltrdf.write("rdfsalt.dat");               // Write salt g(r)
-    dst.write("distributions.dat");             // Write other distributions
     xyz.save("coord.xyz", cell.p);              // Write .xyz coordinate file
     aam.save("confout.aam", cell.p);            // Save config. for next run
-    cout << loop.timing(macro);                 // Show progress
+    dm.gofr.write("rdfprot.dat");
+    saltrdf.write("rdfsalt.dat");
+    cout << "Macro step " << macro
+         << " completed. ETA: " << clock.eta(macro);
+
   } // End of outer loop

   cout << salt.info(cell)                       // Final information...


COSMIC and LASER run types added.

COSMIC and LASER run types added.

--- STEER/AliGRPPreprocessor.cxx
+++ STEER/AliGRPPreprocessor.cxx
@@ -190,6 +190,8 @@
 {
 	// constructor - shuttle must be instantiated!

+	AddRunType("COSMIC");
+	AddRunType("LASER");
 	AddRunType("PHYSICS");
 }


ENH: put the system path after the paths specified on to the FIND command

--- SystemTools.cxx
+++ SystemTools.cxx
@@ -1016,10 +1016,12 @@
 kwsys_std::string SystemTools::FindFile(const char* name,
                                        const kwsys_std::vector<kwsys_std::string>& userPaths)
 {
-  // Add the system search path to our path.
-  kwsys_std::vector<kwsys_std::string> path = userPaths;
+  // Add the system search path to our path first
+  kwsys_std::vector<kwsys_std::string> path;
   SystemTools::GetPath(path);
-
+  // now add the additional paths
+  path.insert(path.end(), userPaths.begin(), userPaths.end());
+  // now look for the file
   kwsys_std::string tryPath;
   for(kwsys_std::vector<kwsys_std::string>::const_iterator p = path.begin();
       p != path.end(); ++p)
@@ -1065,12 +1067,14 @@
     }

   // Add the system search path to our path.
-  kwsys_std::vector<kwsys_std::string> path = userPaths;
+  kwsys_std::vector<kwsys_std::string> path;
   if (!no_system_path)
     {
     SystemTools::GetPath(path);
     }
-
+  // now add the additional paths
+  path.insert(path.end(), userPaths.begin(), userPaths.end());
+
   for(kwsys_std::vector<kwsys_std::string>::const_iterator p = path.begin();
       p != path.end(); ++p)
     {
@@ -1122,9 +1126,10 @@
     }

   // Add the system search path to our path.
-  kwsys_std::vector<kwsys_std::string> path = userPaths;
+  kwsys_std::vector<kwsys_std::string> path;
   SystemTools::GetPath(path);
-
+   // now add the additional paths
+  path.insert(path.end(), userPaths.begin(), userPaths.end());
   kwsys_std::string tryPath;
   for(kwsys_std::vector<kwsys_std::string>::const_iterator p = path.begin();
       p != path.end(); ++p)


Coverity fix.

Coverity fix.

--- STEER/AliGRPPreprocessor.cxx
+++ STEER/AliGRPPreprocessor.cxx
@@ -2334,9 +2334,9 @@
 			arrayWeights[i-ientrySOR] = (Double_t)(timestamp2 - (Int_t)v->GetTimeStamp());
 			arrayValues[i-ientrySOR] = (Float_t)v->GetUInt();
 		}
+		aDCSArrayMean = TMath::Mean(iCountsRun,arrayValues,arrayWeights);
 		delete [] arrayValues;
 		delete [] arrayWeights;
-		aDCSArrayMean = TMath::Mean(iCountsRun,arrayValues,arrayWeights);
 	}
 	else if (iCountsRun == 1){
 		AliDCSValue* v = (AliDCSValue *)array->At(ientrySOR);


Remove test layout

Remove test layout

--- excercise04/sort/quick.cpp
+++ excercise04/sort/quick.cpp
@@ -12,12 +12,6 @@
 {
     int size = end - start + 1;

-#ifdef TESTLAYOUT
-    printf("START %d : END %d : PIVOT %d\n", start, end, data[end]);
-    for(int i = start; i <= end; ++i) printf(" %2d  ", data[i]);
-    printf("\n");
-#endif
-
     if(start >= end) return; /* Base case */

     /* Conquer */
@@ -29,19 +23,6 @@
         while(ps < pe && data[ps] < data[pivot]) ++ps;
         while(ps < pe && data[pe] >= data[pivot]) --pe;

-#ifdef TESTLAYOUT
-        for(int i = start; i <= end; ++i)
-        {
-            if(i == ps && i == pe)
-                printf("(%2d) ", data[i]);
-            else if(i == ps || i == pe)
-                printf("[%2d] ", data[i]);
-            else
-                printf(" %2d  ", data[i]);
-        }
-        printf("  (%d, %d)\n", ps, pe);
-#endif
-
         if(ps < pe) swap(data[ps], data[pe]);
     }

@@ -50,11 +31,6 @@
     else if(pe == end - 1)
         ++pe;

-#ifdef TESTLAYOUT
-    for(int i = start; i <= end; ++i) printf(" %2d  ", data[i]);
-    printf("\n");
-#endif
-
     /* Divide */
     quick(data, start, pe - 1);
     quick(data, pe + 1, end);


Refactor a distortion sample

Refactor a distortion sample


Rename IOBufEqual to IOBufEqualTo

Rename IOBufEqual to IOBufEqualTo

Summary: [Folly] Rename `IOBufEqual` to `IOBufEqualTo` to correspond with the standard naming of `std::equal_to`.

Reviewed By: Orvid

Differential Revision: D7596716

fbshipit-source-id: 2e87aa4b62a002520bdd53b5b7eaba7d9bd822da

--- mcrouter/lib/carbon/test/CarbonMessageConversionUtilsTest.cpp
+++ mcrouter/lib/carbon/test/CarbonMessageConversionUtilsTest.cpp
@@ -304,7 +304,7 @@
       r.testLongString());
   const folly::IOBuf expectedIobuf(
       folly::IOBuf::CopyBufferOp(), folly::StringPiece("iobuf string here..."));
-  EXPECT_TRUE(folly::IOBufEqual()(expectedIobuf, r.testIobuf()));
+  EXPECT_TRUE(folly::IOBufEqualTo()(expectedIobuf, r.testIobuf()));

   EXPECT_EQ(7, r.testStruct().int32Member());
   EXPECT_EQ("I'm nested!", r.testStruct().stringMember());


draw text at top-left of image

draw text at top-left of image

--- tests/test_image.cc
+++ tests/test_image.cc
@@ -169,7 +169,7 @@
         euco::Image image;
         image.SetupNoAlphaSupport(width, height);
         euco::DrawRect(&image, euco::Color::White, euco::WholeImage(image));
-        euco::DrawText(&image, euco::vec2i(0,0), text, euco::Color::Black, euco::LoadCharactersFromBuiltin());
+        euco::DrawText(&image, euco::vec2i(0,height-8), text, euco::Color::Black, euco::LoadCharactersFromBuiltin());
         const auto table = euco::ImageToStringTableExact(
             image,
             { {'#', euco::Color::Black}, {' ', euco::Color::White} }, '?');
@@ -189,7 +189,7 @@
     "                #####                           "
         }));

-    CHECK(StringEq(draw_text("CAT", 8, 8),
+    CHECK(StringEq(draw_text("CAT", 8, 8+1),
         {
             "  ####  ",
             " ##  ## ",
@@ -198,6 +198,7 @@
             "##      ",
             " ##  ## ",
             "  ####  ",
+            "        ",
             "        "
         }));
 }


Add NULL-check around |url| in TemplateURLService::SetDefaultSearchProviderNoNotify

BUG=109808
TEST=

Review URL: http://codereview.chromium.org/9147050

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

--- chrome/browser/search_engines/template_url_service.cc
+++ chrome/browser/search_engines/template_url_service.cc
@@ -1605,7 +1605,7 @@

     // If we are syncing, we want to set the synced pref that will notify other
     // instances to change their default to this new search provider.
-    if (sync_processor_ && !url->sync_guid().empty() && GetPrefs()) {
+    if (sync_processor_ && url && !url->sync_guid().empty() && GetPrefs()) {
       GetPrefs()->SetString(prefs::kSyncedDefaultSearchProviderGUID,
                             url->sync_guid());
     }


Don't set the URL on folders, even to an empty string.

This suppresses a harmless LOG(ERROR) on SPECIFICS / SERVER_SPECIFICS not
matching.  That's because the server doesn't return preserve a URL field on
folder entities, so if we set it locally (even to the empty string), it won't be
returned in the result message.

BUG=45610
TEST=create a folder, rename it, verify no 'LOG(WARNING) << "Specifics mismatch"' from syncer_util.cc

Review URL: http://codereview.chromium.org/2904013

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

--- chrome/browser/sync/glue/bookmark_change_processor.cc
+++ chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -50,7 +50,8 @@
   // Set the properties of the item.
   dst->SetIsFolder(src->is_folder());
   dst->SetTitle(src->GetTitle());
-  dst->SetURL(src->GetURL());
+  if (!src->is_folder())
+    dst->SetURL(src->GetURL());
   SetSyncNodeFavicon(src, model, dst);
 }


another attempt for flickering removed, high expectations now, 4

--- KWAddOn/vtkKWPreviewPage.cxx
+++ KWAddOn/vtkKWPreviewPage.cxx
@@ -115,7 +115,6 @@
   view->SetRenderWindow (widget->GetRenderWindow());
 }

-
 //----------------------------------------------------------------------------
 void vtkKWPreviewPage::AddPreviewImage (vtkImageData* image, const char* name, vtkMatrix4x4* matrix )
 {
@@ -145,12 +144,12 @@
   this->RenderWidgetList->AddItem (widget);

   this->GlobalView->AddExtraPlane (view->GetImageActor());
-
+  widget->SetBinding("<Expose>", this, "Render");
+
   view->Delete();
   widget->Delete();

   this->Update();
-  this->Render();
 }

 //----------------------------------------------------------------------------


Documented the global class definition of Client

--- ext/nginx/HelperServer.cpp
+++ ext/nginx/HelperServer.cpp
@@ -100,6 +100,12 @@
  * A representation of a Client from the Server's point of view. This class
  * contains the methods used to communicate from a server to a connected
  * client, i.e. it is a client handler.
+ * These Client instances will communicate concurrently with the server through
+ * threads. Considering the overhead of these threads, i.e. setup and teardown
+ * costs and the volatility of client requests, these client instances will be
+ * pooled. It is for this reason that the State design pattern has been applied:
+ * this class can be considered as a skeleton implemention whose state --e.g.
+ * client file descriptor-- needs to be provided in order to properly function.
  */
 class Client {
 private:
@@ -107,6 +113,8 @@

 	/** The client number for this Client object, assigned by Server. */
 	unsigned int number;
+
+	/** The application pool to which this Client object belongs to. */
 	StandardApplicationPoolPtr pool;

 	/* This clients password. */
@@ -114,6 +122,8 @@

 	/* The server socket file descriptor. */
 	int serverSocket;
+
+	/* This client thread. */
 	oxt::thread *thr;

 	/**


feat(improve-tool): Fix Codacy issues

feat(improve-tool): Fix Codacy issues

- Variable 'abilityStrMap' is assigned a value that is never used.

--- Extensions/HSppTool/main.cpp
+++ Extensions/HSppTool/main.cpp
@@ -43,6 +43,9 @@

 inline std::vector<GameTag> CheckAbilityImpl(const std::string& path)
 {
+    std::vector<GameTag> result;
+
+#ifndef HEARTHSTONEPP_MACOSX
     std::map<std::string, GameTag> abilityStrMap = {
         { "Adapt", GameTag::ADAPT },
         { "Charge", GameTag::CHARGE },
@@ -54,9 +57,6 @@
         { "Windfury", GameTag::WINDFURY }
     };

-    std::vector<GameTag> result;
-
-#ifndef HEARTHSTONEPP_MACOSX
     const filesystem::path p(
         path + "/Tests/UnitTests/Tasks/BasicTasks/CombatTaskTests.cpp");


[ci skip] [WIP] feat(improve-tool): Add logic to check implemented card

- Define CheckAbilityImpl() function

--- Extensions/HSppTool/main.cpp
+++ Extensions/HSppTool/main.cpp
@@ -41,6 +41,11 @@
     return oss.str();
 }

+inline std::vector<GameTag> CheckAbilityImpl()
+{
+    // TODO: Check ability tests in CombatTaskTests.cpp
+}
+
 inline std::vector<Card> QueryCardSetList(CardSet cardSet, bool implCardOnly)
 {
     if (cardSet == +CardSet::ALL)
@@ -48,7 +53,26 @@
         return Cards::GetInstance()->GetAllCards();
     }

-    return Cards::GetInstance()->FindCardBySet(cardSet);
+    std::vector<GameTag> implementedAbilityList;
+    if (implCardOnly)
+    {
+        implementedAbilityList = CheckAbilityImpl();
+    }
+
+    std::vector<Card> result;
+    for (auto& card : Cards::GetInstance()->FindCardBySet(cardSet))
+    {
+        if (implCardOnly)
+        {
+            // TODO: Check abilities in card are all implemented
+        }
+        else
+        {
+            result.emplace_back(card);
+        }
+    }
+
+    return result;
 }

 inline bool CheckCardImpl(const std::string& path, const std::string& id)


Fix test.

Fix test.

--- format-test.cc
+++ format-test.cc
@@ -251,9 +251,11 @@
 TEST(UtilTest, StrError) {
   using fmt::internal::StrError;
   char *message = 0;
+  char buffer[BUFFER_SIZE];
+#ifndef NDEBUG
   EXPECT_DEBUG_DEATH(StrError(EDOM, message = 0, 0), "Assertion");
-  char buffer[BUFFER_SIZE];
   EXPECT_DEBUG_DEATH(StrError(EDOM, message = buffer, 0), "Assertion");
+#endif
   buffer[0] = 'x';
 #ifdef _GNU_SOURCE
   // Use invalid error code to make sure that StrError returns an error


Fix test.

Fix test.

--- format-test.cc
+++ format-test.cc
@@ -281,12 +281,28 @@
   EXPECT_EQ(42, e.error_code());
 }

-#ifndef _WIN32
-const int TEST_ERROR = EDOM;
-std::string GetTestErrorMessage() { return strerror(TEST_ERROR); }
-#else
-const int TEST_ERROR = ERROR_FILE_EXISTS;
-std::string GetTestErrorMessage() {
+TEST(UtilTest, ThrowSystemError) {
+  const int TEST_ERROR = EDOM;
+  fmt::SystemError error("", 0);
+  try {
+    fmt::ThrowSystemError(TEST_ERROR, "test {}") << "error";
+  } catch (const fmt::SystemError &e) {
+    error = e;
+  }
+  EXPECT_EQ(str(fmt::Format("test error: {}") << strerror(TEST_ERROR)),
+      error.what());
+  EXPECT_EQ(TEST_ERROR, error.error_code());
+}
+
+#ifdef _WIN32
+TEST(UtilTest, ThrowWinError) {
+  const int TEST_ERROR = ERROR_FILE_EXISTS;
+  fmt::SystemError error("", 0);
+  try {
+    fmt::ThrowSystemError(TEST_ERROR, "test {}") << "error";
+  } catch (const fmt::SystemError &e) {
+    error = e;
+  }
   LPWSTR message = 0;
   FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
       FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0,
@@ -294,21 +310,11 @@
       reinterpret_cast<LPWSTR>(&message), 0, 0);
   fmt::internal::UTF16ToUTF8 utf8_message(message);
   LocalFree(message);
-  return fmt::str(utf8_message);
-}
-#endif
-
-TEST(UtilTest, ThrowSystemError) {
-  fmt::SystemError error("", 0);
-  try {
-    fmt::ThrowSystemError(TEST_ERROR, "test {}") << "error";
-  } catch (const fmt::SystemError &e) {
-    error = e;
-  }
-  EXPECT_EQ(str(fmt::Format("test error: {}") << GetTestErrorMessage()),
+  EXPECT_EQ(str(fmt::Format("test error: {}") << fmt::str(utf8_message)),
       error.what());
   EXPECT_EQ(TEST_ERROR, error.error_code());
 }
+#endif

 class TestString {
  private:


fix FPSCounter

fix FPSCounter

--- FSE/FSEObject/FPSCounter.cpp
+++ FSE/FSEObject/FPSCounter.cpp
@@ -44,7 +44,7 @@
 	void FPSCounter::draw(sf::RenderTarget& target)
 	{
 		current_time_ = measureclock_.restart().asSeconds();
-		fps_ = static_cast<int>((fps_ * smoothing_) + ((1 / current_time_) * (1.0 - smoothing_)));
+		fps_ = (fps_ * smoothing_) + ((1 / current_time_) * (1.0 - smoothing_));
 		if (updclock_.getElapsedTime().asMilliseconds() > 250)
 		{
 			fps_text_.setString(std::wstring(L"FPS: " + std::to_wstring(static_cast<int>(fps_))));


r1027/sofa-dev : ignore Point/Point proximities (it creates wrong  contact constraints)

--- modules/sofa/component/collision/MinProximityIntersection.cpp
+++ modules/sofa/component/collision/MinProximityIntersection.cpp
@@ -69,7 +69,8 @@
     intersectors.add<LineModel, LineModel, intersectionLineLine, distCorrectionLineLine, false>();
     intersectors.add<PointModel, TriangleModel, intersectionPointTriangle, distCorrectionPointTriangle, true>();
     intersectors.add<PointModel, LineModel, intersectionPointLine, distCorrectionPointLine, true>();
-    intersectors.add<PointModel, PointModel, intersectionPointPoint, distCorrectionPointPoint, false>();
+    intersectors.ignore<PointModel, PointModel, false>();
+    //intersectors.add<PointModel, PointModel, intersectionPointPoint, distCorrectionPointPoint, false>();

     if (useSphereTriangle.getValue())
     {


r2946/sofa-dev : FIX : missing include of TriangleSetTopologyAlgorithms.h

--- modules/sofa/component/collision/TopologicalChangeManager.cpp
+++ modules/sofa/component/collision/TopologicalChangeManager.cpp
@@ -34,9 +34,12 @@
 #include <sofa/component/topology/EdgeSetTopologyContainer.h>
 #include <sofa/component/topology/TriangleSetTopologyContainer.h>
 #include <sofa/component/topology/TriangleSetTopologyModifier.h>
+#include <sofa/component/topology/TriangleSetTopologyAlgorithms.h>
 #include <sofa/component/topology/TetrahedronSetTopologyContainer.h>
 #include <sofa/component/topology/QuadSetTopologyContainer.h>
 #include <sofa/component/topology/HexahedronSetTopologyContainer.h>
+
+#include <sofa/defaulttype/VecTypes.h>

 namespace sofa
 {


r1729/sofa-dev : FIX Linux Compilation

r1729/sofa-dev : FIX Linux Compilation

--- modules/sofa/component/forcefield/TriangularFEMForceField.cpp
+++ modules/sofa/component/forcefield/TriangularFEMForceField.cpp
@@ -381,9 +381,9 @@

                     if (vertexInfo[mostDeformableVertexIndex].meanStrainDirection.norm() != 0.0)
                     {
-                        if (abs(vertexInfo[mostDeformableVertexIndex].meanStrainDirection * (x[b] - x[a])) < minDotProduct)
+                        if (fabs(vertexInfo[mostDeformableVertexIndex].meanStrainDirection * (x[b] - x[a])) < minDotProduct)
                         {
-                            minDotProduct = abs(vertexInfo[mostDeformableVertexIndex].meanStrainDirection * (x[b] - x[a]));
+                            minDotProduct = fabs(vertexInfo[mostDeformableVertexIndex].meanStrainDirection * (x[b] - x[a]));
                             fracturableIndex = *it;
                             fracture = true;
                         }
@@ -874,9 +874,9 @@
         double maxEigenValue;
         computeEigenStrain(v, J, D, maxEigenValue);

-        if (abs(maxEigenValue) > 0.1)
-        {
-            triangleInfo[elementIndex].eigenValue = abs(maxEigenValue);
+        if (fabs(maxEigenValue) > 0.1)
+        {
+            triangleInfo[elementIndex].eigenValue = fabs(maxEigenValue);
         }
         else
         {


'or' to indicate config methods are alternative options

--- moveit_setup_assistant/src/widgets/planning_groups_widget.cpp
+++ moveit_setup_assistant/src/widgets/planning_groups_widget.cpp
@@ -104,8 +104,8 @@
   // Top Label Area ------------------------------------------------
   HeaderWidget* header = new HeaderWidget(
       "Planning Groups", "Create and edit planning groups for your robot based on joint collections, "
-                         "link collections, kinematic chains and subgroups.\n"
-                         "A planning group defines the set of (joint, link) pairs considered for planning. "
+                         "link collections, kinematic chains or subgroups.\n"
+                         "A planning group defines the set of (joint, link) pairs considered for planning.\n"
                          "Define individual groups for each subset of the robot you want to plan for.",
       this);
   layout->addWidget(header);


Fix signed/unsigned compare warning

Fix signed/unsigned compare warning

The underlying type of DC::EnumType is implementation dependent.
It might be better to construct a vtkDICOMTag from DC::EnumType,
but that might impact performance.  Actually the use of DC::EnumType
for an array of tags is not ideal, for two reasons:
1) this might actually be a 64-bit type when only 32 bits are needed,
2) there are valid tags that are not DC::EnumType members.

--- Source/vtkDICOMGenerator.cxx
+++ Source/vtkDICOMGenerator.cxx
@@ -1051,7 +1051,7 @@
         const DC::EnumType *tags = blacklist;
         while (*tags != DC::ItemDelimitationItem)
         {
-          if (*tags++ == tag.GetKey())
+          if (static_cast<unsigned int>(*tags++) == tag.GetKey())
           {
             blacklisted = true;
             break;


Improved noncentral chi-squared cdf

Improved noncentral chi-squared cdf

--- distributions/univariate/continuous/NoncentralChiSquared.cpp
+++ distributions/univariate/continuous/NoncentralChiSquared.cpp
@@ -49,13 +49,25 @@
         }, 0, x);
     }

-    // TODO: improve
-    if (x <= MIN_POSITIVE)
-        return 0;
-    return RandMath::integral([this] (double t)
+    // TODO: find a min for bessel function
+    static constexpr double minBound = 0.01;
+    if (x < minBound) {
+        return RandMath::integral([this] (double t)
+        {
+            return f(t);
+        }, -MIN_POSITIVE, x);
+    }
+
+    // TODO: this value can be counted only once for fixed parameters
+    double y1 = RandMath::integral([this] (double t)
     {
         return f(t);
-    }, MIN_POSITIVE, x);
+    }, -MIN_POSITIVE, minBound);
+
+    return y1 + RandMath::integral([this] (double t)
+    {
+        return f(t);
+    }, minBound, x);
 }

 double NoncentralChiSquared::variateForDegreeEqualOne() const


Fix error in feedback doc sample snippet tag

--- doc/src/snippets/qtfeedbackdocsample/qtfeedbackdocsample.cpp
+++ doc/src/snippets/qtfeedbackdocsample/qtfeedbackdocsample.cpp
@@ -53,5 +53,5 @@
     //TODO..
 //! [Complete example]
     // Coming soon...
-//! [COMPLETE example]
+//! [Complete example]
 }


App: set window title from app name

App: set window title from app name

This will set the title of newly created windows to the app name if the
window title is not given.

--- allocore/src/io/al_App.cpp
+++ allocore/src/io/al_App.cpp
@@ -301,26 +301,25 @@
 	Window::DisplayMode mode,
 	int flags
 ){
-	//ViewpointWindow * win = new ViewpointWindow(dims, title, fps, mode);
-
-	ViewpointWindow * win = new ViewpointWindow;
-	win->dimensions(dims);
-	win->title(title);
-	win->fps(fps);
-	win->displayMode(mode);
-
-	mFacViewpoints.push_back(new Viewpoint);
-
-	int last = mFacViewpoints.size()-1;
-	{
-		Viewpoint& vp = *mFacViewpoints[last];
-		vp.parentTransform(nav().transformed());
-		win->add(vp);
-	}
-
-	mFacWindows.push_back(win);
-	add(*win);
-	return win;
+	auto& win = *new ViewpointWindow;
+	win.dimensions(dims);
+	if(title.empty()){ // if no title, use app name, if any
+		if(!name().empty()) win.title(name());
+	} else {
+		win.title(title);
+	}
+
+	win.fps(fps);
+	win.displayMode(mode);
+
+	auto& newVP = *new Viewpoint;
+	mFacViewpoints.push_back(&newVP);
+	newVP.parentTransform(nav().transformed());
+	win.add(newVP);
+
+	mFacWindows.push_back(&win);
+	add(win);
+	return &win;
 }


Fix failure caused by accessing nullopt

Fix failure caused by accessing nullopt

--- xchainer/check_backward.cc
+++ xchainer/check_backward.cc
@@ -18,7 +18,9 @@
 namespace xchainer {
 namespace {

-Arrays BackwardGradients(std::function<Arrays(const Arrays&)> func, const Arrays& inputs, const Arrays& grad_outputs) {
+using OptionalArrays = std::vector<nonstd::optional<Array>>;
+
+OptionalArrays BackwardGradients(std::function<Arrays(const Arrays&)> func, const Arrays& inputs, const Arrays& grad_outputs) {
     Arrays outputs = func(inputs);

     const int nout = outputs.size();
@@ -32,8 +34,8 @@
     }
     Backward(outputs[0]);

-    Arrays backward_grads;
-    std::transform(inputs.begin(), inputs.end(), std::back_inserter(backward_grads), [](const Array& input) { return *input.grad(); });
+    OptionalArrays backward_grads;
+    std::transform(inputs.begin(), inputs.end(), std::back_inserter(backward_grads), [](const Array& input) { return input.grad(); });

     return backward_grads;
 }
@@ -43,22 +45,24 @@
 void CheckBackwardComputation(std::function<Arrays(const Arrays&)> func, const Arrays& inputs, const Arrays& grad_outputs,
                               const Arrays& eps, float atol, float rtol) {
     const Arrays numerical_grads = CalculateNumericalGradient(func, inputs, grad_outputs, eps);
-    const Arrays backward_grads = BackwardGradients(func, inputs, grad_outputs);
+    const OptionalArrays backward_grads = BackwardGradients(func, inputs, grad_outputs);
     assert(backward_grads.size() == numerical_grads.size());

     std::ostringstream failure_os;
     const int nin = backward_grads.size();
     for (int i = 0; i < nin; ++i) {
-        if (!AllClose(backward_grads[i], numerical_grads[i], atol, rtol)) {
-            failure_os << "Backward check failure on input " << i << " (Total inputs: " << inputs.size() << ")\n"
-                       << "Atol: " << atol << "\n"
-                       << "Rtol: " << rtol << "\n"
-                       << "Eps (perturbation):\n"
-                       << eps[i] << "\n"
-                       << "Backward gradients:\n"
-                       << backward_grads[i] << "\n"
-                       << "Numerical gradients:\n"
-                       << numerical_grads[i];
+        if (backward_grads[i]) {  // All inputs do not necessarily require gradients
+            if (!AllClose(*backward_grads[i], numerical_grads[i], atol, rtol)) {
+                failure_os << "Backward check failure on input " << i << " (Total inputs: " << inputs.size() << ")\n"
+                           << "Atol: " << atol << "\n"
+                           << "Rtol: " << rtol << "\n"
+                           << "Eps (perturbation):\n"
+                           << eps[i] << "\n"
+                           << "Backward gradients:\n"
+                           << *backward_grads[i] << "\n"
+                           << "Numerical gradients:\n"
+                           << numerical_grads[i];
+            }
         }
     }


Reorder help listing of options and relabel the -S option to -IK

--- Applications/opensense/opensense.cpp
+++ Applications/opensense/opensense.cpp
@@ -273,16 +273,18 @@
     aOStream << "------             --------             --------------\n";
     aOStream << "-Help, -H                               Print the command-line options for " << progName << ".\n";
     aOStream << "-PrintSetup, -PS                        Generates a template Setup file to customize the scaling\n";
-    aOStream << "-Setup, -S         SetupFileName        Specify an xml setup file for solving an inverse kinematics problem.\n";
     aOStream << "-PropertyInfo, -PI                      Print help information for properties in setup files.\n";
-    aOStream << "-ReadX, -RX  directory settingsFile.xml   Parse Xsens exported files from directory using settingsFile.xml.\n";
-    aOStream << "-ReadA, -RA  datafile.csv settingsFile.xml   Parse single csv file provided by APDM using specified settingsFile.xml.\n";
-    aOStream << "-Calibrate, -C modelPoseFile.osim calibrationOrientations.sto  Calibrate the modelPoseFile.osim model by registering\n";
+    aOStream << "-ReadX, -RX  directory settings.xml     Parse Xsens exported files from directory using settingsFile.xml.\n";
+    aOStream << "-ReadA, -RA  datafile.csv settings.xml  Parse single csv file provided by APDM using specified settingsFile.xml.\n";
+    aOStream << "-Calibrate, -C modelPoseFile.osim calibrationOrientations.sto.\n";
+    aOStream << "                                        Calibrate the modelPoseFile.osim model by registering\n";
     aOStream << "                                        IMU frames whose orientations in the sensor world frame are\n";
     aOStream << "                                        specified in calibrationOrientations.sto. and assuming \n";
     aOStream << "                                        the model's default pose is the calibration pose. The resultant\n";
     aOStream << "                                        model with IMU frames registered is written to file as\n";
     aOStream << "                                        calibrated_modelPoseFile.osim\n";
+    aOStream << "-InverseKinematics, -IK ik_settings.xml Run IK using an xml settings file to define the inverse kinematics problem.\n";
+
     aOStream << endl;
 }


Removed redundant functions.

Removed redundant functions.

--- functions/functions.hpp
+++ functions/functions.hpp
@@ -1,26 +1,11 @@
 class RMM {
-	class client {
-//		class taskhint {};
-//		class taskupdate {};
-	};
 	class common {
 		class ExMP {};
-//		class failSafeLS {};
-//		class isAlive {};
-//		class landForTime {};
-//		class supplyDrop {};
-	};
-	class server {
-//		class spawnVehiclePath {};
-//		class taskDefend {};
 	};
 };
 class CRB {
 	class common {
 		class selectRandomBias {};
-	};
-	class server {
-//		class initLocations {};
 	};
 };
 class BIS {


Implemented iAnimatedMesh::HitBeamObject and HitBeamOutline

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

--- plugins/mesh/animesh/object/animesh.cpp
+++ plugins/mesh/animesh/object/animesh.cpp
@@ -21,6 +21,8 @@
 #include "csgeom/math3d.h"
 #include "csgfx/renderbuffer.h"
 #include "csgfx/vertexlistwalker.h"
+#include "csgfx/trianglestream.h"
+#include "cstool/rbuflock.h"
 #include "cstool/rviewclipper.h"
 #include "csutil/objreg.h"
 #include "csutil/scf.h"
@@ -773,6 +775,38 @@
   bool AnimeshObject::HitBeamOutline (const csVector3& start,
     const csVector3& end, csVector3& isect, float* pr)
   {
+    // TODO: use a pre-test on the collision boxes of each bones
+
+    csSegment3 seg (start, end);
+    csRenderBufferLock<csVector3> vrt (skeleton ? skinnedVertices : postMorphVertices);
+
+    // Iterate all submeshes...
+    for (size_t i = 0; i < submeshes.GetSize (); ++i)
+    {
+      if (!submeshes[i]->isRendering)
+        continue;
+
+      FactorySubmesh* fsm = factory->submeshes[i];
+      for (size_t j = 0; j < fsm->indexBuffers.GetSize (); ++j)
+      {
+	iRenderBuffer* indexBuffer = submeshes[i]->GetFactorySubMesh ()->GetIndices (j);
+	CS::TriangleIndicesStream<uint> triangles (indexBuffer,
+						   CS_MESHTYPE_TRIANGLES);
+	while (triangles.HasNext())
+	{
+	  CS::TriangleT<uint> t (triangles.Next());
+	  if (csIntersect3::SegmentTriangle (seg,
+					     vrt[t.a], vrt[t.b], vrt[t.c],
+					     isect))
+	  {
+	    if (pr) *pr = csQsqrt (csSquaredDist::PointPoint (start, isect) /
+				   csSquaredDist::PointPoint (start, end));
+	    return true;
+	  }
+	}
+      }
+    }
+
     return false;
   }

@@ -780,8 +814,57 @@
     csVector3& isect, float* pr, int* polygon_idx,
     iMaterialWrapper** material, iMaterialArray* materials)
   {
-    return csIntersect3::BoxSegment (factory->factoryBB, csSegment3 (start, end),
-      isect, pr) != 0;
+    // TODO: use a pre-test on the collision boxes of each bones
+
+    csSegment3 seg (start, end);
+    float tot_dist = csSquaredDist::PointPoint (start, end);
+    float dist, temp;
+    float itot_dist = 1 / tot_dist;
+    dist = temp = tot_dist;
+    csVector3 tmp;
+    iMaterialWrapper* mat = 0;
+    csRenderBufferLock<csVector3> vrt (skeleton ? skinnedVertices : postMorphVertices);
+
+    // Iterate all submeshes...
+    for (size_t i = 0; i < submeshes.GetSize (); ++i)
+    {
+      if (!submeshes[i]->isRendering)
+        continue;
+
+      FactorySubmesh* fsm = factory->submeshes[i];
+      for (size_t j = 0; j < fsm->indexBuffers.GetSize (); ++j)
+      {
+	iRenderBuffer* indexBuffer = submeshes[i]->GetFactorySubMesh ()->GetIndices (j);
+	CS::TriangleIndicesStream<uint> triangles (indexBuffer,
+						   CS_MESHTYPE_TRIANGLES);
+	while (triangles.HasNext())
+	{
+	  CS::TriangleT<uint> t (triangles.Next());
+	  if (csIntersect3::SegmentTriangle (seg,
+					     vrt[t.a], vrt[t.b], vrt[t.c],
+					     isect))
+	  {
+	    temp = csSquaredDist::PointPoint (start, tmp);
+	    if (temp < dist)
+	    {
+	      isect = tmp;
+	      dist = temp;
+	      //if (polygon_idx) *polygon_idx = i; // @@@ Uh, how to handle?
+	      mat = submeshes[i]->GetMaterial ();
+	    }
+	  }
+	}
+      }
+    }
+
+    if (pr) *pr = csQsqrt (dist * itot_dist);
+    if (dist >= tot_dist)
+      return false;
+
+    if (material) *material = mat;
+    if (materials) materials->Push (mat);
+
+    return true;
   }

   void AnimeshObject::SetMeshWrapper (iMeshWrapper* lp)


[gripper] Increased number of parallel threads to 4 (up from 1)

--- baxter_collaboration_lib/src/robot_interface/gripper.cpp
+++ baxter_collaboration_lib/src/robot_interface/gripper.cpp
@@ -8,7 +8,7 @@

 Gripper::Gripper(std::string _limb, bool _use_robot) :
                  rnh(_limb), limb(_limb), use_robot(_use_robot), first_run(true), prop_set(false),
-                 spinner(1), cmd_sequence(0), cmd_sender(ros::this_node::getName())
+                 spinner(4), cmd_sequence(0), cmd_sender(ros::this_node::getName())
 {
     if (not use_robot) return;

@@ -71,6 +71,7 @@

 void Gripper::gripperCb(const EndEffectorState &msg)
 {
+    ROS_DEBUG("[%s_gripper] Received new state", getGripperLimb().c_str());
     setGripperState(msg);

     if (first_run)
@@ -94,6 +95,7 @@

 void Gripper::gripperPropCb(const EndEffectorProperties &msg)
 {
+    ROS_DEBUG("[%s_gripper] Received gripper properties", getGripperLimb().c_str());
     setGripperProperties(msg);
     prop_set = true;

@@ -360,6 +362,7 @@
         ee_cmd.args = _args;
     }

+    ROS_DEBUG("[%s_gripper] Publishing: %s", getGripperLimb().c_str(), _cmd.c_str());
     pub_cmd.publish(ee_cmd);

     if(_block)


Fix a tblgen subtargetemitter bug, for future Swift support.

This fixes some of the ridiculously complex code for optimizing the
machine model tables that are shared among all processors of a given
target. A9 and Swift both use the "special" feature that maps old
itinerary classes to new machine model defs. They map different
overlapping subsets of instructions, which wasn't handled correctly.

git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@183302 91177308-0d34-0410-b5e6-96231b3b80d8

--- TableGen/CodeGenSchedule.cpp
+++ TableGen/CodeGenSchedule.cpp
@@ -710,16 +710,35 @@
     ArrayRef<Record*> InstDefs = ClassInstrs[CIdx].second;
     // If the all instrs in the current class are accounted for, then leave
     // them mapped to their old class.
-    if (OldSCIdx && SchedClasses[OldSCIdx].InstRWs.size() == InstDefs.size()) {
-      assert(SchedClasses[OldSCIdx].ProcIndices[0] == 0 &&
-             "expected a generic SchedClass");
-      continue;
+    if (OldSCIdx) {
+      const RecVec &RWDefs = SchedClasses[OldSCIdx].InstRWs;
+      if (!RWDefs.empty()) {
+        const RecVec *OrigInstDefs = Sets.expand(RWDefs[0]);
+        unsigned OrigNumInstrs = 0;
+        for (RecIter I = OrigInstDefs->begin(), E = OrigInstDefs->end();
+             I != E; ++I) {
+          if (InstrClassMap[*I] == OldSCIdx)
+            ++OrigNumInstrs;
+        }
+        if (OrigNumInstrs == InstDefs.size()) {
+          assert(SchedClasses[OldSCIdx].ProcIndices[0] == 0 &&
+                 "expected a generic SchedClass");
+          DEBUG(dbgs() << "InstRW: Reuse SC " << OldSCIdx << ":"
+                << SchedClasses[OldSCIdx].Name << " on "
+                << InstRWDef->getValueAsDef("SchedModel")->getName() << "\n");
+          SchedClasses[OldSCIdx].InstRWs.push_back(InstRWDef);
+          continue;
+        }
+      }
     }
     unsigned SCIdx = SchedClasses.size();
     SchedClasses.resize(SCIdx+1);
     CodeGenSchedClass &SC = SchedClasses.back();
     SC.Index = SCIdx;
     SC.Name = createSchedClassName(InstDefs);
+    DEBUG(dbgs() << "InstRW: New SC " << SCIdx << ":" << SC.Name << " on "
+          << InstRWDef->getValueAsDef("SchedModel")->getName() << "\n");
+
     // Preserve ItinDef and Writes/Reads for processors without an InstRW entry.
     SC.ItinClassDef = SchedClasses[OldSCIdx].ItinClassDef;
     SC.Writes = SchedClasses[OldSCIdx].Writes;


Add a few comments.

Add a few comments.

git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@55157 91177308-0d34-0410-b5e6-96231b3b80d8

--- TableGen/FastISelEmitter.cpp
+++ TableGen/FastISelEmitter.cpp
@@ -181,6 +181,7 @@
   typedef std::map<OperandsSignature, OpcodeTypePredMap> OperandsOpcodeTypePredMap;
   OperandsOpcodeTypePredMap SimplePatterns;

+  // Scan through all the patterns and record the simple ones.
   for (CodeGenDAGPatterns::ptm_iterator I = CGP.ptm_begin(),
        E = CGP.ptm_end(); I != E; ++I) {
     const PatternToMatch &Pattern = *I;
@@ -394,6 +395,9 @@
       OS << "\n";
     }

+    OS << "// Top-level FastEmit function.\n";
+    OS << "\n";
+
     // Emit one function for the operand signature that demultiplexes based
     // on opcode and type.
     OS << "unsigned FastISel::FastEmit_";


Fixed crash while exporting MultiMaterial

--- xs/src/libslic3r/GCode.cpp
+++ xs/src/libslic3r/GCode.cpp
@@ -1384,7 +1384,7 @@

 void GCode::append_full_config(const Print& print, std::string& str)
 {
-    char buff[1024];
+    char buff[4096];

     const StaticPrintConfig *configs[] = { &print.config, &print.default_object_config, &print.default_region_config };
     for (size_t i = 0; i < sizeof(configs) / sizeof(configs[0]); ++i) {


fix fuzzer. should be correct.

fix fuzzer. should be correct.

--- fuzz/driver.cc
+++ fuzz/driver.cc
@@ -358,11 +358,11 @@
         hostconf = h2o_config_register_host(&config, h2o_iovec_init(H2O_STRLIT(unix_listener)), 65535);
         register_handler(hostconf, "/chunked-test", chunked_test);
         h2o_url_parse(unix_listener, strlen(unix_listener), &upstream);
-        h2o_socketpool_t sockpool = {};
-        h2o_socketpool_init_specific(&sockpool, SIZE_MAX /* FIXME */, &upstream, 1, NULL, NULL, NULL);
-        h2o_socketpool_set_timeout(&sockpool, 2000);
-        h2o_socketpool_set_ssl_ctx(&sockpool, NULL);
-        h2o_proxy_register_reverse_proxy(h2o_config_register_path(hostconf, "/reproxy-test", 0), &proxy_config, &sockpool);
+        h2o_socketpool_t *sockpool = new h2o_socketpool_t();
+        h2o_socketpool_init_specific(sockpool, SIZE_MAX /* FIXME */, &upstream, 1, NULL, NULL, NULL);
+        h2o_socketpool_set_timeout(sockpool, 2000);
+        h2o_socketpool_set_ssl_ctx(sockpool, NULL);
+        h2o_proxy_register_reverse_proxy(h2o_config_register_path(hostconf, "/reproxy-test", 0), &proxy_config, sockpool);
         h2o_file_register(h2o_config_register_path(hostconf, "/", 0), "./examples/doc_root", NULL, NULL, 0);

         loop = h2o_evloop_create();


Undid string replacements

Undid string replacements

--- Source/CSBackend/Platform/RPi/Core/Base/SystemInfoFactory.cpp
+++ Source/CSBackend/Platform/RPi/Core/Base/SystemInfoFactory.cpp
@@ -77,12 +77,12 @@
             utsname info;
             uname(&info);

-            std::string osVersion("info.version");
-            std::string machineType("info.machine");
+            std::string osVersion(info.version);
+            std::string machineType(info.machine);
             std::locale globalLocale; //Creating with the default constructor will set it to the global locale

             // Create DeviceInfo.
-            ChilliSource::DeviceInfo deviceInfo(k_deviceModel, machineType, k_deviceManufacturer, k_deviceUdid, "globalLocale.name()", "ParseLanguageFromLocale(globalLocale.name())", osVersion, 1);
+            ChilliSource::DeviceInfo deviceInfo(k_deviceModel, machineType, k_deviceManufacturer, k_deviceUdid, globalLocale.name(), ParseLanguageFromLocale(globalLocale.name()), osVersion, get_nprocs());

             // Create ScreenInfo.
             //ChilliSource::ScreenInfo screenInfo(GetScreenResolution(), 1.0f, 1.0f, GetSupportedResolutions());


fix regex incorporate USER keyword

fix regex incorporate USER keyword

--- gateway/src/gateway.cpp
+++ gateway/src/gateway.cpp
@@ -1325,6 +1325,7 @@
 	std::string use("USE");
 	std::string from("FROM");
 	std::string keyspace("KEYSPACE");
+	std::string user("USER");
 	std::string into("INTO");
 	std::string update("UPDATE");
 	std::string schema("SCHEMA");
@@ -1344,6 +1345,7 @@
 	my_exps.push_back(std::string("INTO (.*?)[ ]{1,}"));
 	my_exps.push_back(std::string("USE[\\s]+[A-Za-z0-9\"]+(;)*"));
 	my_exps.push_back(std::string("(KEYSPACE|SCHEMA) (IF NOT EXISTS )*[A-Za-z0-9]+(([ ]{1,})|;)"));
+	my_exps.push_back(std::string("USER[\\s]+[A-Za-z0-9]+(([ ]{1,})|;)"));
 	my_exps.push_back(std::string("UPDATE (.*?)[ ]{1,}"));
 	my_exps.push_back(std::string("TABLE (.*?)(([ ]{1,})|;)"));
 	my_exps.push_back(std::string("ON (.*?)(([ ]{1,})|;)"));
@@ -1379,8 +1381,12 @@
                         }
 			int bx = fields.size();
 			std::string quote("\"");
+			std::string single("\'");
 			if ( custom_replace(fields[bx - 1], std::string("\""), std::string(""))){
 				prefix = quote + prefix;
+			}
+			if ( custom_replace(fields[bx - 1], std::string("\'"), std::string(""))){
+				prefix = single + prefix;
 			}
 			if(fields[0].compare(use) == 0){
 				std::string app( "USE " + prefix + fields[1]);
@@ -1404,6 +1410,16 @@
                                 replacements[str] = app;
 				}
                         } else if (fields[0].compare(keyspace) == 0 || fields[0].compare(schema) == 0){
+				int n = fields.size();
+				std::string feed("");
+				int j = 0;
+				fields[n - 1] = prefix + fields[n - 1];
+				while ( j < n ){
+					feed = feed + fields[j] + ((j == n - 1) ? "" : " ");
+					j++;
+				}
+				replacements[str] = feed;
+			} else if (fields[0].compare(user) == 0 ){
 				int n = fields.size();
 				std::string feed("");
 				int j = 0;


remove sample project

remove sample project

--- samples/learn_depth_segmentation/learn_depth_segmentation.cpp
+++ samples/learn_depth_segmentation/learn_depth_segmentation.cpp
@@ -1,46 +0,0 @@
-#include <iostream>
-
-#include <boost/filesystem.hpp>
-
-#include <opencv2/highgui/highgui.hpp>
-
-#include "elm/core/core.h"
-#include "elm/core/cv/mat_utils.h"
-#include "elm/core/debug_utils.h"
-#include "elm/core/layerconfig.h"
-#include "elm/core/inputname.h"
-#include "elm/io/readnyudepthv2labeled.h"
-#include "elm/layers/layerfactory.h"
-#include "elm/layers/mlp.h"
-
-using namespace std;
-namespace bfs=boost::filesystem;
-using namespace cv;
-using namespace elm;
-
-int main() {
-
-    cout<<elm::GetVersion()<<endl;
-
-    bfs::path p("/media/win/Users/woodstock/dev/data/nyu_depth_v2_labeled.mat");
-
-    ReadNYUDepthV2Labeled reader;
-    int nb_items = reader.ReadHeader(p.string());
-
-    ELM_COUT_VAR(nb_items);
-
-    for(int i=0; i<10; i++) {
-
-        ELM_COUT_VAR(i);
-
-        cv::Mat bgr, labels, depth;
-        reader.Next(bgr, depth, labels);
-
-        cv::imshow("image", bgr);
-        cv::imshow("depth", elm::ConvertTo8U(depth));
-        cv::imshow("labels", elm::ConvertTo8U(labels));
-        cv::waitKey(0);
-    }
-
-    return 0;
-}


WIP: Removed previous debug change.

WIP: Removed previous debug change.

--- Source/CSBackend/Rendering/OpenGL/Base/RenderCapabilities.cpp
+++ Source/CSBackend/Rendering/OpenGL/Base/RenderCapabilities.cpp
@@ -48,8 +48,6 @@
             //----------------------------------------------------------
             bool CheckForOpenGLExtension(const std::string& in_extension)
             {
-                return false;
-
                 std::string extensions = (const char*)glGetString(GL_EXTENSIONS);
                 return extensions.find(in_extension) != extensions.npos;
             }


Removed extra double quote

Removed extra double quote

svn path=/trunk/KDE/kdenetwork/kopete/; revision=879362

--- plugins/translator/translatorplugin.cpp
+++ plugins/translator/translatorplugin.cpp
@@ -307,7 +307,7 @@
 {
 	QString body = QString(QUrl::toPercentEncoding( msg));
 	QString lp = from + '_' + to;
-	QString gurl = "http://babelfish.yahoo.com/translate_txt?"&lp=" + lp  + "&text=" + body ;
+	QString gurl = "http://babelfish.yahoo.com/translate_txt?&lp=" + lp  + "&text=" + body;
 	KUrl geturl ( gurl );

 	kDebug( 14308 ) << "URL: " << gurl;


Fix coding conventions.

Fix coding conventions.

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

--- gdml/src/TGDMLParse.cxx
+++ gdml/src/TGDMLParse.cxx
@@ -1,4 +1,4 @@
-/* @(#)root/gdml:$Name:  $:$Id: TGDMLParse.cxx,v 1.12 2007/08/07 07:53:05 brun Exp $ */
+/* @(#)root/gdml:$Name:  $:$Id: TGDMLParse.cxx,v 1.13 2007/08/24 08:40:11 brun Exp $ */
 // Author: Ben Lloyd 09/11/06

 /*************************************************************************
@@ -412,7 +412,7 @@

          findStr = strstr(outStr,nameStr);                                         // Try to find constant by its name in the expression

-	 if (findStr==0) continue;                                                 // Skip if not found, otherwise replace
+         if (findStr==0) continue;                                                 // Skip if not found, otherwise replace

          strcpy(tempStr,outStr);                                                   // We need a copy of the string
          strcpy(outStr+offset,valueStr);					   // Substitue value of the constant
@@ -1228,19 +1228,19 @@
    TGeoShape* first = 0;
    TGeoShape* second = 0;

-   TGeoTranslation* FirstPos = new TGeoTranslation(0,0,0);
-   TGeoTranslation* SecondPos = new TGeoTranslation(0,0,0);
-
-   TGeoRotation* FirstRot = new TGeoRotation();
-   TGeoRotation* SecondRot = new TGeoRotation();
-
-   FirstRot->RotateZ(0);
-   FirstRot->RotateY(0);
-   FirstRot->RotateX(0);
-
-   SecondRot->RotateZ(0);
-   SecondRot->RotateY(0);
-   SecondRot->RotateX(0);
+   TGeoTranslation* firstPos = new TGeoTranslation(0,0,0);
+   TGeoTranslation* secondPos = new TGeoTranslation(0,0,0);
+
+   TGeoRotation* firstRot = new TGeoRotation();
+   TGeoRotation* secondRot = new TGeoRotation();
+
+   firstRot->RotateZ(0);
+   firstRot->RotateY(0);
+   firstRot->RotateX(0);
+
+   secondRot->RotateZ(0);
+   secondRot->RotateY(0);
+   secondRot->RotateX(0);

    const char* name = gdml->GetAttr(node, "name");

@@ -1275,7 +1275,7 @@
          if((strcmp(fCurrentFile,fStartFile)) != 0){
             reftemp = Form("%s_%s", reftemp, fCurrentFile);
          }
-         SecondPos = fposmap[reftemp];
+         secondPos = fposmap[reftemp];
       }
       else if((strcmp(tempattr, "positionref")) == 0){
          reftemp = gdml->GetAttr(child, "ref");
@@ -1283,7 +1283,7 @@
             reftemp = Form("%s_%s", reftemp, fCurrentFile);
          }
          if(fposmap.find(reftemp) != fposmap.end()){
-            SecondPos = fposmap[reftemp];
+            secondPos = fposmap[reftemp];
          }
       }
       else if((strcmp(tempattr, "rotation")) == 0){
@@ -1293,7 +1293,7 @@
          if((strcmp(fCurrentFile,fStartFile)) != 0){
             reftemp = Form("%s_%s", reftemp, fCurrentFile);
          }
-         SecondRot = frotmap[reftemp];
+         secondRot = frotmap[reftemp];
       }
       else if((strcmp(tempattr, "rotationref")) == 0){
          reftemp = gdml->GetAttr(child, "ref");
@@ -1301,7 +1301,7 @@
             reftemp = Form("%s_%s", reftemp, fCurrentFile);
          }
          if(frotmap.find(reftemp) != frotmap.end()){
-            SecondRot = frotmap[reftemp];
+            secondRot = frotmap[reftemp];
          }
       }
       else if((strcmp(tempattr, "firstposition")) == 0){
@@ -1311,7 +1311,7 @@
          if((strcmp(fCurrentFile,fStartFile)) != 0){
             reftemp = Form("%s_%s", reftemp, fCurrentFile);
          }
-         FirstPos = fposmap[reftemp];
+         firstPos = fposmap[reftemp];
       }
       else if((strcmp(tempattr, "firstpositionref")) == 0){
          reftemp = gdml->GetAttr(child, "ref");
@@ -1319,7 +1319,7 @@
             reftemp = Form("%s_%s", reftemp, fCurrentFile);
          }
          if(fposmap.find(reftemp) != fposmap.end()){
-            FirstPos = fposmap[reftemp];
+            firstPos = fposmap[reftemp];
          }
       }
       else if((strcmp(tempattr, "firstrotation")) == 0){
@@ -1329,7 +1329,7 @@
          if((strcmp(fCurrentFile,fStartFile)) != 0){
             reftemp = Form("%s_%s", reftemp, fCurrentFile);
          }
-         FirstRot = frotmap[reftemp];
+         firstRot = frotmap[reftemp];
       }
       else if((strcmp(tempattr, "firstrotationref")) == 0){
          reftemp = gdml->GetAttr(child, "ref");
@@ -1337,21 +1337,21 @@
             reftemp = Form("%s_%s", reftemp, fCurrentFile);
          }
          if(frotmap.find(reftemp) != frotmap.end()){
-            FirstRot = frotmap[reftemp];
+            firstRot = frotmap[reftemp];
          }
       }
       child = gdml->GetNext(child);
    }

-   TGeoMatrix* FirstMatrix = new TGeoCombiTrans(*FirstPos,FirstRot->Inverse());
-   TGeoMatrix* SecondMatrix = new TGeoCombiTrans(*SecondPos,SecondRot->Inverse());
+   TGeoMatrix* firstMatrix = new TGeoCombiTrans(*firstPos,firstRot->Inverse());
+   TGeoMatrix* secondMatrix = new TGeoCombiTrans(*secondPos,secondRot->Inverse());

    TGeoCompositeShape* boolean = 0;

    switch (num) {
-   case 1: boolean = new TGeoCompositeShape(NameShort(name),new TGeoSubtraction(first,second,FirstMatrix,SecondMatrix)); break;      // SUBTRACTION
-   case 2: boolean = new TGeoCompositeShape(NameShort(name),new TGeoIntersection(first,second,FirstMatrix,SecondMatrix)); break;     // INTERSECTION
-   case 3: boolean = new TGeoCompositeShape(NameShort(name),new TGeoUnion(first,second,FirstMatrix,SecondMatrix)); break;            // UNION
+   case 1: boolean = new TGeoCompositeShape(NameShort(name),new TGeoSubtraction(first,second,firstMatrix,secondMatrix)); break;      // SUBTRACTION
+   case 2: boolean = new TGeoCompositeShape(NameShort(name),new TGeoIntersection(first,second,firstMatrix,secondMatrix)); break;     // INTERSECTION
+   case 3: boolean = new TGeoCompositeShape(NameShort(name),new TGeoUnion(first,second,firstMatrix,secondMatrix)); break;            // UNION
    default:
     break;
    }


INTEGRATION: CWS impress44 (1.14.10); FILE MERGED 2005/04/06 13:18:57 af 1.14.10.1: #i46675# Integrated part of i43687. Added argument to Rearrange() method.

--- sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: SlideSorterController.cxx,v $
  *
- *  $Revision: 1.15 $
- *
- *  last change: $Author: hr $ $Date: 2005-04-08 16:17:29 $
+ *  $Revision: 1.16 $
+ *
+ *  last change: $Author: obo $ $Date: 2005-04-12 16:56:22 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -1059,7 +1059,7 @@

-Rectangle  SlideSorterController::Rearrange (void)
+Rectangle  SlideSorterController::Rearrange (bool bForce)
 {
     Rectangle aNewContentArea (maTotalWindowArea);

@@ -1069,10 +1069,17 @@
         // Place the scroll bars.
         aNewContentArea = GetScrollBarManager().PlaceScrollBars(maTotalWindowArea);

-        Rectangle aCurrentContentArea (
-            pWindow->GetPosPixel(),
-            pWindow->GetOutputSizePixel());
-        if (aNewContentArea != aCurrentContentArea)
+        bool bSizeHasChanged (false);
+        // Only when bForce is not true we have to test for a size change in
+        // order to determine whether the window and the view have to be resized.
+        if ( ! bForce)
+        {
+            Rectangle aCurrentContentArea (
+                pWindow->GetPosPixel(),
+                pWindow->GetOutputSizePixel());
+            bSizeHasChanged = (aNewContentArea != aCurrentContentArea);
+        }
+        if (bForce || bSizeHasChanged)
         {
             // The browser window gets the remaining space.
             pWindow->SetPosSizePixel (aNewContentArea.TopLeft(), aNewContentArea.GetSize());
@@ -1081,7 +1088,7 @@

         // Adapt the scroll bars to the new zoom factor of the browser
         // window and the arrangement of the page objects.
-        GetScrollBarManager().UpdateScrollBars();
+        GetScrollBarManager().UpdateScrollBars(false, !bForce);
     }

     return aNewContentArea;


Update nanoFramework.Hardware.Stm32 version to 1.0.2-preview-019 (#1042)

--- targets/CMSIS-OS/ChibiOS/nanoCLR/nanoFramework.Hardware.Stm32/nf_hardware_stm32_native.cpp
+++ targets/CMSIS-OS/ChibiOS/nanoCLR/nanoFramework.Hardware.Stm32/nf_hardware_stm32_native.cpp
@@ -55,5 +55,5 @@
     "nanoFramework.Hardware.Stm32",
     0x0427DBEE,
     method_lookup,
-    { 1, 0, 2, 17 }
+    { 1, 0, 2, 19 }
 };


little code fixing

little code fixing

--- plugins/robots/robotsInterpreter/details/d2RobotModel/d2ModelWidget.cpp
+++ plugins/robots/robotsInterpreter/details/d2RobotModel/d2ModelWidget.cpp
@@ -1094,7 +1094,8 @@

 void D2ModelWidget::setCursorType(enums::cursorType::CursorType cursor)
 {
-	mCursorType = mNoneCursorType = cursor;
+	mNoneCursorType = cursor;
+	mCursorType = mNoneCursorType;
 	qReal::SettingsManager::setValue("2dCursorType", cursor);
 	mUi->graphicsView->setDragMode(cursorTypeToDragType(cursor));
 	mUi->graphicsView->setCursor(cursorTypeToCursor(cursor));


Fix bug 560208, EnterLockInit/EnterLockDestroy should be repeatable/symmetric (r=lhansen)

--- MMgc/GCHeap.cpp
+++ MMgc/GCHeap.cpp
@@ -2830,6 +2830,7 @@
     {
         GCAssert(instanceEnterLockInitialized);
         VMPI_lockDestroy(&instanceEnterLock);
+        instanceEnterLockInitialized = false;
     }

     GCHeap::Region::Region(GCHeap *heap, char *baseAddr, char *rTop, char *cTop, size_t blockId)


- чистка кода

 - чистка кода

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@10229 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/app/rdo_studio/branches/dev_qt_migration/edit_ctrls/rdobaseedit.cpp
+++ rdo/app/rdo_studio/branches/dev_qt_migration/edit_ctrls/rdobaseedit.cpp
@@ -148,7 +148,6 @@
 //	ON_UPDATE_COMMAND_UI(ID_SEARCH_FIND, OnUpdateSearchFind)
 //	ON_UPDATE_COMMAND_UI(ID_SEARCH_REPLACE, OnUpdateSearchReplace)
 //	ON_UPDATE_COMMAND_UI( ID_SEARCH_FIND_PREVIOUS, OnUpdateSearchFindNextPrev )
-//	ON_COMMAND(ID_SEARCH_GOTO_LINE, OnSearchGotoLine)
 //
 //	ON_REGISTERED_MESSAGE( FIND_REPLASE_MSG, OnFindReplaceMsg )
 //