Completed rewrite of https://analitiqa.atlassian.net/browse/AII-27 - Execution::Platform::AIX::GetEXEPathWithHintT - still sucks - but at least no popen

--- Library/Sources/Stroika/Foundation/Execution/Platform/AIX/GetEXEPathWithHint.cpp
+++ Library/Sources/Stroika/Foundation/Execution/Platform/AIX/GetEXEPathWithHint.cpp
@@ -10,6 +10,7 @@
 #include    <sys/sysmacros.h>
 #include    <sys/types.h>
 #include    <unistd.h>
+#include    <fstream>
 #endif

 #include    "../../../Cache/CallerStalenessCache.h"
@@ -31,43 +32,35 @@
 using   Characters::String_Constant;

-
+//
 // Comment this in to turn on aggressive noisy DbgTrace in this module
+// NB: CURRENTLY safe to turn on (2016-04-01) - but risky if triggered loading with TraceLog file getting its name from
+// calling here...
 //#define   USE_NOISY_TRACE_IN_THIS_MODULE_       1
-
-
-// Comment this in to turn on aggressive noisy DbgTrace in this module
+//
+
+
+//
+// Comment this in to turn on somewhat noisy timing DbgTrace in this module
+// NB: This timing trace code contains HACK - to NOT report anyhting for processID==getpid () - since
+// that is called early on trying to get the EXE name for this process - before main - for the tracelog
+// and doing DbgTrace calls in response causes grave disorder
+//
 //#define   USE_TIMING_TRACE_IN_THIS_MODULE_       1
-
+//

 namespace {
-    SDKString   myProcessRunnerFirstLine_ (const SDKString& cmdLine)
-    {
-        /*
-         *      NOTE - we intentionally use popen here avoid helpful Stroika code like ProcessRunner (), ThrowIfNull, etc,
-         *      so that this code remains low level, and doesnt invoke any tracelog code, which would result in a deadlock/loop....
-         *
-         */
-        FILE*   p = ::popen (cmdLine.c_str (), "r");
-        string  accum;
-        if (p != nullptr) {
-            char    buf[10 * 1024];
-            while (::fgets (buf, NEltsOf (buf), p) != nullptr) {
-                accum += buf;
-                size_t i = accum.rfind ('\n');
-                if (i != -1) {
-                    accum.erase (i);
-                }
-                break;  // minor speed hack since we always use with just one line
-            }
-            int result  =   ::pclose (p);
-            // cannot report to avoid TRACE ;-(
-        }
-        return accum;
-    }
+    bool    IsProcessSafeToLogFor_ (pid_t p)
+    {
+        return p != getpid ();
+    }
+}
+
+
+namespace {
     // find %s -xdev -type f -inum %lld -print 2> /dev/null - but much faster.
     // @todo - xdev part. Not only possible speed hack, but also needed for correctness since
     // we could match the wrong inode if we crossed filesystems.
@@ -104,7 +97,7 @@
     }
     SDKString   FindPath2Inode_Caching_ (const SDKString& dir, dev_t restrictToDev, ino_t inodeNumber)
     {
-        const   Time::DurationSecondsType   kTimeValidFor_      =   60.0;   // no good way to parameterize
+        const   Time::DurationSecondsType   kTimeValidFor_      =   5 * 60.0;   // no good way to parameterize
         using   KEY = tuple<SDKString, dev_t, ino_t>;
         static  Synchronized<Cache::CallerStalenessCache<KEY, SDKString>>   sCache_;
         Time::DurationSecondsType       noOlderThan = Time::GetTickCount () - kTimeValidFor_;
@@ -124,31 +117,92 @@
         }
         return SDKString ();
     }
+    SDKString   GetBlockDeviceFileName2MajorMinorDev_ (int majorDev, int minorDev)
+    {
+        /*
+         *
+         *  if (majorDev != -1 and minorDev != -1) {
+         *      // ls -l /dev/ | egrep \"^b.*%d, *%d.+$\"", majorDev, minorDev
+         *      char buf[1024];
+         *      (void)::snprintf (buf, NEltsOf (buf), "ls -l /dev/ | egrep \"^b.*%d, *%d.+$\"", majorDev, minorDev);
+         *      SDKString   devfsline = myProcessRunnerFirstLine_ (buf);
+         *      int     beforeFSName     =  devfsline.rfind (' ');
+         *      if (beforeFSName != string::npos) {
+         *          fsBlockName = devfsline.substr (beforeFSName + 1);
+         *      }
+         *  }
+         */
+        // NOTE - this could probably be memoized/cached, as the list of block devices on a machine probably doesn't change much ;-)
+        DIR*       dirIt    { ::opendir ("/dev") };
+        if (dirIt != nullptr) {
+            auto&& cleanup  =   Finally ([dirIt] () noexcept { ::closedir (dirIt); });
+            for (dirent* cur = ::readdir (dirIt); cur != nullptr; cur = ::readdir (dirIt)) {
+                SDKString   filePath = SDKString { "/dev/" } + cur->d_name;
+                struct  stat    s;
+                if (::stat (filePath.c_str (), &s) == 0) {
+                    if (S_ISBLK(s.st_mode) and major (s.st_rdev) == majorDev and minor (s.st_rdev) == minorDev) {
+                        return filePath;
+                    }
+                }
+            }
+        }
+        return SDKString {};
+    }
+    SDKString   GetFSNameForBlockName_ (const SDKString& blockDeviceName)
+    {
+        /*
+         *  What we used to do:
+         *      if (not fsBlockName.empty ()) {
+         *          char buf[1024];
+         *          (void)::snprintf (buf, NEltsOf (buf), "df | grep %s", fsBlockName.c_str ());    // not - unreliable - could match multiple...
+         *          SDKString   devfsline = myProcessRunnerFirstLine_ (buf);
+         *          int     beforeFSName     =  devfsline.rfind (' ');
+         *          if (beforeFSName != string::npos) {
+         *              return devfsline.substr (beforeFSName + 1);
+         *          }
+         *      }
+         *
+         *  Weak way - but probably better then what we used to do:
+         *      read /etc/filesystem
+         */
+        ifstream    fsFile ("/etc/filesystems");
+        char line[4 * 1024];
+        string  readingFilesystem;
+        string  forDev;
+        while (fsFile.getline (line, NEltsOf (line))) {
+            if (line[0] == '/') {
+                char* p = ::strchr (line, ':');
+                if (p != nullptr) {
+                    *p = '\0';
+                    readingFilesystem = line;
+                    forDev = string {};
+                }
+            }
+            if (not readingFilesystem.empty () and forDev.empty () and ::strstr (line, "dev") != nullptr) {
+                char* p = ::strchr (line, '=');
+                if (p != nullptr) {
+                    p++;
+                    while (*p and isspace (*p)) {
+                        ++p;
+                    }
+                }
+                if (p != nullptr and * p != '\0') {
+                    forDev = p;
+                }
+            }
+            if (blockDeviceName == forDev) {
+                return readingFilesystem;
+            }
+        }
+        return SDKString {};
+    }
     SDKString   FindFSForMajorMinorDev_LowLevel_ (int majorDev, int minorDev)
     {
-        // @todo - this isn't truely safe... Esp df|grep part...
-        string  fsBlockName;
-        if (majorDev != -1 and minorDev != -1) {
-            // ls -l /dev/ | egrep \"^b.*%d, *%d.+$\"", majorDev, minorDev
-            char buf[1024];
-            (void)::snprintf (buf, NEltsOf (buf), "ls -l /dev/ | egrep \"^b.*%d, *%d.+$\"", majorDev, minorDev);
-            SDKString   devfsline = myProcessRunnerFirstLine_ (buf);
-            int     beforeFSName     =  devfsline.rfind (' ');
-            if (beforeFSName != string::npos) {
-                fsBlockName = devfsline.substr (beforeFSName + 1);
-            }
-        }
-        string  fsName;
+        SDKString fsBlockName = GetBlockDeviceFileName2MajorMinorDev_ (majorDev, minorDev);
         if (not fsBlockName.empty ()) {
-            char buf[1024];
-            (void)::snprintf (buf, NEltsOf (buf), "df | grep %s", fsBlockName.c_str ());    // not - unreliable - could match multiple...
-            SDKString   devfsline = myProcessRunnerFirstLine_ (buf);
-            int     beforeFSName     =  devfsline.rfind (' ');
-            if (beforeFSName != string::npos) {
-                fsName = devfsline.substr (beforeFSName + 1);
-            }
-        }
-        return fsName;
+            return GetFSNameForBlockName_ (fsBlockName);
+        }
+        return SDKString {};
     }
     SDKString   FindFSForMajorMinorDev_WithCaching_ (int majorDev, int minorDev)
     {
@@ -169,8 +223,8 @@
          *      http://unix.stackexchange.com/questions/109175/how-to-identify-executable-path-with-its-pid-on-aix-5-or-more
          *
          *  This is INSANELY slow and kludgey. If we need to support this, we will need to find a better way.
-         *  We can code all this direclty in C++, without popen, but with a bit of work.
-         *      --
+         *
+         *  In the meantime, I at least rewrote it all without popen, so a bit faster, but still aweful.
          *
          *  NOTE - PART of this I think I can do better/faster with stat!!!
          */
@@ -224,13 +278,17 @@
                 if (::stat (o->c_str (), &hintStats) == 0) {
                     if (hintStats.st_ino == inode and hintStats.st_dev == makedev (majorDev, minorDev)) {
 #if     USE_NOISY_TRACE_IN_THIS_MODULE_
-                        DbgTrace (L"CacheHit for hint '%s' (maps to '%s')", hint->c_str (), String::FromSDKString (*o).c_str ());
+                        if (IsProcessSafeToLogFor_ (pid)) {
+                            DbgTrace (L"CacheHit for hint '%s' (maps to '%s')", hint->c_str (), String::FromSDKString (*o).c_str ());
+                        }
 #endif
                         return *o;
                     }
                 }
 #if     USE_NOISY_TRACE_IN_THIS_MODULE_
-                DbgTrace (L"CacheMiss for hint '%s'", hint->c_str ());
+                if (IsProcessSafeToLogFor_ (pid)) {
+                    DbgTrace (L"CacheMiss for hint '%s'", hint->c_str ());
+                }
 #endif
             }
         }
@@ -241,7 +299,9 @@
         }
         if (hint != nullptr and not exeName.empty ()) {
 #if     USE_NOISY_TRACE_IN_THIS_MODULE_
-            DbgTrace ("Priming cache for hint '%s' (maps to '%s')", hint->c_str (), exeName.c_str ());
+            if (IsProcessSafeToLogFor_ (pid)) {
+                DbgTrace ("Priming cache for hint '%s' (maps to '%s')", hint->c_str (), exeName.c_str ());
+            }
 #endif
             sHintCache_->Add (*hint, exeName);
         }
@@ -261,14 +321,14 @@
 SDKString   Execution::Platform::AIX::GetEXEPathWithHintT (pid_t processID)
 {
 #if     USE_TIMING_TRACE_IN_THIS_MODULE_
-    Debug::TimingTrace ctx { L"Platform::AIX::GetEXEPathWithHintT/1", 0.1 };
+    Debug::TimingTrace ctx { L"Platform::AIX::GetEXEPathWithHintT/1", IsProcessSafeToLogFor_ (processID) ? 0.001 : 1000.0 };
 #endif
     return AIX_GET_EXE_PATH_ (processID, nullptr);
 }
 SDKString   Execution::Platform::AIX::GetEXEPathWithHintT (pid_t processID, const SDKString& associationHint)
 {
 #if     USE_TIMING_TRACE_IN_THIS_MODULE_
-    Debug::TimingTrace ctx { L"Platform::AIX::GetEXEPathWithHintT/2", 0.1 };
+    Debug::TimingTrace ctx { L"Platform::AIX::GetEXEPathWithHintT/2", IsProcessSafeToLogFor_ (processID) ? 0.001 : 1000.0 };
 #endif
     String tmp { String::FromSDKString (associationHint) };
     return AIX_GET_EXE_PATH_ (processID, &tmp);
@@ -286,14 +346,14 @@
 String   Execution::Platform::AIX::GetEXEPathWithHint (pid_t processID)
 {
 #if     USE_TIMING_TRACE_IN_THIS_MODULE_
-    Debug::TimingTrace ctx { L"Platform::AIX::GetEXEPathWithHint/1", 0.1 };
+    Debug::TimingTrace ctx { L"Platform::AIX::GetEXEPathWithHint/1", IsProcessSafeToLogFor_ (processID) ? 0.001 : 1000.0 };
 #endif
     return String::FromSDKString (AIX_GET_EXE_PATH_ (processID, nullptr));
 }
 String   Execution::Platform::AIX::GetEXEPathWithHint (pid_t processID, const String& associationHint)
 {
 #if     USE_TIMING_TRACE_IN_THIS_MODULE_
-    Debug::TimingTrace ctx { L"Platform::AIX::GetEXEPathWithHint/2", 0.1 };
+    Debug::TimingTrace ctx { L"Platform::AIX::GetEXEPathWithHint/2", IsProcessSafeToLogFor_ (processID) ? 0.001 : 1000.0 };
 #endif
     return String::FromSDKString (AIX_GET_EXE_PATH_ (processID, &associationHint));
 }


properties

properties

--- packages/segmentation/src/irtkSegmentationFunction.cc
+++ packages/segmentation/src/irtkSegmentationFunction.cc
@@ -1,3 +1,15 @@
+/*=========================================================================
+
+  Library   : Image Registration Toolkit (IRTK)
+  Module    : $Id$
+  Copyright : Imperial College, Department of Computing
+              Visual Information Processing (VIP), 2009 onwards
+  Date      : $Date$
+  Version   : $Revision$
+  Changes   : $Author$
+
+=========================================================================*/
+
 #include "irtkSegmentationFunction.h"
 #ifdef HAS_OPENCV
 /// detect possible presence of the object at threshold == 3


cleanup Execution/Platform/AIX/GetEXEPathWithHint using Finally

--- Library/Sources/Stroika/Foundation/Execution/Platform/AIX/GetEXEPathWithHint.cpp
+++ Library/Sources/Stroika/Foundation/Execution/Platform/AIX/GetEXEPathWithHint.cpp
@@ -18,6 +18,7 @@
 #include    "../../../Debug/TimingTrace.h"
 #include    "../../../Memory/SmallStackBuffer.h"
 #include    "../../ErrNoException.h"
+#include    "../../Finally.h"

 #include    "GetEXEPathWithHint.h"

@@ -76,17 +77,7 @@
         if (dirIt == nullptr) {
             return SDKString ();
         }
-        struct CLEANUP_ {
-            DIR*       fDirIt_;
-            CLEANUP_ (DIR* d) : fDirIt_ (d) {}
-            ~CLEANUP_ ()
-            {
-                if (fDirIt_ != nullptr) {
-                    ::closedir (fDirIt_);
-                }
-            }
-        };
-        CLEANUP_ c { dirIt };
+        auto&& cleanup  =   Finally ([dirIt] () noexcept { ::closedir (dirIt); });
         for (dirent* cur = ::readdir (dirIt); cur != nullptr; cur = ::readdir (dirIt)) {
             if (::strcmp (cur->d_name, ".") == 0 or ::strcmp (cur->d_name, "..") == 0) {
                 continue;


[fixed] static cell ids loading order

[fixed] static cell ids loading order

git-svn-id: c34995188cc7e843f8a799edec2d9d4b36f36456@2178 c3d1530f-68f5-4bd0-87dc-8ef779617e40

--- MMOCoreORB/src/server/zone/managers/structure/StructureManagerImplementation.cpp
+++ MMOCoreORB/src/server/zone/managers/structure/StructureManagerImplementation.cpp
@@ -627,7 +627,7 @@

 	StringBuffer query;
 	query << "SELECT * FROM staticobjects WHERE file = 'object/cell/shared_cell.iff'";
-	query << " AND parentid = " << building->getObjectID();
+	query << " AND parentid = " << building->getObjectID() << " order by objectid asc";

 	try {
 		ResultSet* result = ServerDatabase::instance()->executeQuery(query);


Adds `default` to make it explicit that `fetch_address` is initialised.

--- Machines/AppleII/Video.hpp
+++ Machines/AppleII/Video.hpp
@@ -351,6 +351,7 @@
 						const int fetch_end = std::min(40, ending_column);
 						uint16_t fetch_address;
 						switch(line_mode) {
+							default:
 							case GraphicsMode::Text:
 							case GraphicsMode::DoubleText:
 							case GraphicsMode::LowRes:


add play control

add play control

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

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

--- media/tools/player_x11/player_x11.cc
+++ media/tools/player_x11/player_x11.cc
@@ -4,6 +4,7 @@

 #include <iostream>
 #include <signal.h>
+#include <X11/keysym.h>
 #include <X11/Xlib.h>

 #include "base/at_exit.h"
@@ -59,7 +60,8 @@
                                  BlackPixel(g_display, screen));
   XStoreName(g_display, g_window, "X11 Media Player");

-  XSelectInput(g_display, g_window, ExposureMask | ButtonPressMask);
+  XSelectInput(g_display, g_window,
+               ExposureMask | ButtonPressMask | KeyPressMask);
   XMapWindow(g_display, g_window);
   return true;
 }
@@ -124,7 +126,10 @@
   g_running = false;
 }

-void PeriodicalUpdate(MessageLoop* message_loop, bool audio_only) {
+void PeriodicalUpdate(
+    media::PipelineImpl* pipeline,
+    MessageLoop* message_loop,
+    bool audio_only) {
   if (!g_running) {
     message_loop->Quit();
     return;
@@ -134,23 +139,57 @@
   while (XPending(g_display)) {
     XEvent e;
     XNextEvent(g_display, &e);
-    if (e.type == Expose) {
-      if (!audio_only) {
-        // Tell the renderer to paint.
-        DCHECK(Renderer::instance());
-        Renderer::instance()->Paint();
-      }
-    } else if (e.type == ButtonPress) {
-      g_running = false;
-      // QuitNow is more responsive than Quit since renderer_base is till
-      // posting paint messages.
-      message_loop->QuitNow();
-      return;
+    switch (e.type) {
+      case Expose:
+        if (!audio_only) {
+          // Tell the renderer to paint.
+          DCHECK(Renderer::instance());
+          Renderer::instance()->Paint();
+        }
+        break;
+      case ButtonPress:
+        {
+          Window window;
+          int x, y;
+          unsigned int width, height, border_width, depth;
+          XGetGeometry(g_display,
+                       g_window,
+                       &window,
+                       &x,
+                       &y,
+                       &width,
+                       &height,
+                       &border_width,
+                       &depth);
+          base::TimeDelta time = pipeline->GetMediaDuration();
+          pipeline->Seek(time*e.xbutton.x/width, NULL);
+        }
+        break;
+      case KeyPress:
+        {
+          KeySym key = XKeycodeToKeysym(g_display, e.xkey.keycode, 0);
+          if (key == XK_Escape) {
+            g_running = false;
+            // QuitNow is more responsive than Quit since renderer_base is till
+            // posting paint messages.
+            message_loop->QuitNow();
+            return;
+          } else if (key == XK_space) {
+            if (pipeline->GetPlaybackRate() < 0.01f) // paused
+              pipeline->SetPlaybackRate(1.0f);
+            else
+              pipeline->SetPlaybackRate(0.0f);
+          }
+        }
+        break;
+      default:
+        break;
     }
   }

   message_loop->PostDelayedTask(FROM_HERE,
-      NewRunnableFunction(PeriodicalUpdate, message_loop, audio_only), 10);
+      NewRunnableFunction(PeriodicalUpdate, pipeline,
+                          message_loop, audio_only), 10);
 }

 int main(int argc, char** argv) {
@@ -161,7 +200,10 @@
               << "Optional arguments:" << std::endl
               << "  [--enable-openmax]"
               << "  [--audio]"
-              << "  [--alsa-device=DEVICE]" << std::endl;
+              << "  [--alsa-device=DEVICE]" << std::endl
+              << " Press [ESC] to stop" << std::endl
+              << " Press [SPACE] to toggle pause/play" << std::endl
+              << " Press mouse left button to seek" << std::endl;
     return 1;
   }

@@ -202,7 +244,8 @@
     }

     message_loop.PostTask(FROM_HERE,
-        NewRunnableFunction(PeriodicalUpdate, &message_loop, audio_only));
+        NewRunnableFunction(PeriodicalUpdate, pipeline.get(),
+                            &message_loop, audio_only));
     message_loop.Run();

     // Need to wait for pipeline to be fully stopped before stopping the thread.


correct the allowed dimension size (#30326)

--- paddle/fluid/operators/mkldnn/activation_mkldnn_op.cc
+++ paddle/fluid/operators/mkldnn/activation_mkldnn_op.cc
@@ -94,8 +94,10 @@
   }

   PADDLE_ENFORCE(
-      x->dims().size() == 2 || x->dims().size() == 3 || x->dims().size() == 4,
-      platform::errors::Unimplemented("Input dim must be with 2, 3 or 4"));
+      x->dims().size() >= 1 || x->dims().size() <= 6,
+      platform::errors::Unimplemented("Input dimension size can be 1, 2, 3, 4, "
+                                      "5, or 6, but now the dimension size is",
+                                      x->dims().size()));

   auto src_tz = framework::vectorize<int64_t>(x->dims());


L3 update -- p9_htm_setup/pause/start/stop HWPs

Change-Id: I247f6804e15cc31e8f3ecf17000b42c1da20ccc2
Original-Change-Id: Ib08d967d8d70a8ec8ba9c1c53adb3291d1d2135c
RTC:139541
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41498
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Joseph J. McGill <4a85c6614f9f065f63d8fd57cde15e48af07ea2a@us.ibm.com>
Reviewed-by: Benjamin Gass <d33fb9b956fd4e7c201de67e681adf83a89c45b0@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/nest/p9_htm_adu_ctrl.C
+++ src/import/chips/p9/procedures/hwp/nest/p9_htm_adu_ctrl.C
@@ -31,7 +31,7 @@
 /// *HWP HWP Owner   : Joe McGill <jmcgill@us.ibm.com>
 /// *HWP FW Owner    : Thi Tran <thi@us.ibm.com>
 /// *HWP Team        : Nest
-/// *HWP Level       : 2
+/// *HWP Level       : 3
 /// *HWP Consumed by : HB
 ///----------------------------------------------------------------------------

@@ -70,21 +70,16 @@
     l_adu_oper_flag.setTransactionSize(p9_ADU_oper_flag::TSIZE_2);

     // Acquire ADU lock
-    l_rc = p9_adu_coherent_manage_lock( i_target,
-                                        false,
-                                        true,           // Acquire lock
-                                        l_num_attempts);
-
-    if (l_rc)
-    {
-        FAPI_ERR("Error from p9_adu_coherent_manage_lock (acquire all)");
-        goto fapi_try_exit;
-    }
+    FAPI_TRY(p9_adu_coherent_manage_lock( i_target,
+                                          false,
+                                          true,           // Acquire lock
+                                          l_num_attempts),
+             "Error from p9_adu_coherent_manage_lock (acquire all)");

     // NOTE: lock is now held, if an operation fails from this point
-    //       to the end of the procedure.
-    // Reset lock
+    //       to the end of the procedure, need to reset and unlock.
     l_adu_is_dirty = true;
+
     // Reset ADU
     l_rc = p9_adu_coherent_utils_reset_adu(i_target);

@@ -94,7 +89,7 @@
         goto adu_reset_unlock;
     }

-    // issue operation
+    // Issue operation
     l_rc = p9_adu_coherent_setup_adu(i_target,
                                      i_addr,
                                      false,      // write
@@ -156,7 +151,7 @@
     }

     FAPI_DBG("All ADU locks released");
-    // no error for entire operation
+    // No error for entire operation
     l_adu_is_dirty = false;

 adu_reset_unlock:


COMP Remove falsely added line (in merge-conflict)

--- Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/QmitkPreprocessingView.cpp
+++ Plugins/org.mitk.gui.qt.diffusionimaging/src/internal/QmitkPreprocessingView.cpp
@@ -1729,8 +1729,6 @@
   if ( image == nullptr ) { return; }

   bool multiComponentVolume = (image->GetPixelType().GetNumberOfComponents() > 1);
-
-  bool foundSingleImageVolume = foundDwiVolume || (foundImageVolume && (!multiComponentVolume));
   bool threeDplusTVolume = (image->GetTimeSteps() > 1);

   // we do not support multi-component and 3D+t images in the widget, check early to avoid access exception


Update OCC,PBA,CME FIR handling based on the recent RAS specification

Change-Id: I71a766a32e24fdcf8ef1bffc337b6c3d36b25a69
Original-Change-Id: I4950c75c65563229c7a6831c63e375a9c4823f2f
RTC: 158180
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27978
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: PPE CI <dc75934ba5befb9221434e67a247b93aec46b36b@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Brian T. Vanderpool <80bf54c65fef5142bcd6ac0d0b8f1646681d56b8@us.ibm.com>
Reviewed-by: Gregory S. Still <4249770c9038596e9483266bcd48707ac69ee60b@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/pm/p9_pm_occ_firinit.C
+++ src/import/chips/p9/procedures/hwp/pm/p9_pm_occ_firinit.C
@@ -232,7 +232,7 @@
     FAPI_TRY(l_occFir.setMalfAlert(CME_ERR_NOTIFY),
              "ERROR: Failed to set Malf alert");
     FAPI_TRY(l_occFir.setRecvAttn(STOP_RCV_NOTIFY_PRD),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setMalfAlert(OCC_HB_NOTIFY),
              "ERROR: Failed to set Malf alert");
     FAPI_TRY(l_occFir.mask(GPE0_WD_TIMEOUT),
@@ -243,32 +243,32 @@
              "ERROR: Failed to set Malf alert");
     FAPI_TRY(l_occFir.mask(GPE3_WD_TIMEOUT),
              "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(GPE0_ERR),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(GPE1_ERR),
-             "ERROR: Failed to mask bit");
+    FAPI_TRY(l_occFir.setRecvAttn(GPE0_ERR),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(GPE1_ERR),
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvIntr(GPE2_ERR),
-             "ERROR: Failed to set recovery interrupt");
+             "ERROR: Failed to set recovery on interrupt");
     FAPI_TRY(l_occFir.setMalfAlert(GPE3_ERR),
              "ERROR: Failed to set Malf alert");
     FAPI_TRY(l_occFir.mask(OCB_ERR),
              "ERROR: Failed to mask bit");
     FAPI_TRY(l_occFir.setRecvAttn(SRT_UE),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRT_CE),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRT_READ_ERR),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRT_WRITE_ERR),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRT_DATAOUT_PERR),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRT_OCI_WDATA_PARITY),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRT_OCI_BE_PARITY_ERR),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRT_OCI_ADDR_PARITY_ERR),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.mask(GPE0_HALTED),
              "ERROR: Failed to mask bit");
     FAPI_TRY(l_occFir.mask(GPE1_HALTED),
@@ -289,76 +289,70 @@
              "ERROR: Failed to mask bit");
     FAPI_TRY(l_occFir.mask(PPC405_DBGSTOPACK),
              "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(OCB_DB_OCI_TIMEOUT),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(OCB_DB_OCI_RDATA_PARITY),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(OCB_DB_OCI_SLVERR),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(OCB_PIB_ADDR_PARITY_ERR),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(OCB_DB_PIB_DATA_PARITY_ERR),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(OCB_IDC0_ERR),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(OCB_IDC1_ERR),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(OCB_IDC2_ERR),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(OCB_IDC3_ERR),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(SRT_FSM_ERR),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(JTAGACC_ERR),
-             "ERROR: Failed to mask bit");
+    FAPI_TRY(l_occFir.setRecvAttn(OCB_DB_OCI_TIMEOUT),
+             "ERROR: Failed to set recoverable atention");
+    FAPI_TRY(l_occFir.setRecvAttn(OCB_DB_OCI_RDATA_PARITY),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(OCB_DB_OCI_SLVERR),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(OCB_PIB_ADDR_PARITY_ERR),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(OCB_DB_PIB_DATA_PARITY_ERR),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(OCB_IDC0_ERR),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(OCB_IDC1_ERR),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(OCB_IDC2_ERR),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(OCB_IDC3_ERR),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(SRT_FSM_ERR),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(JTAGACC_ERR),
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.mask(SPARE_ERR_38),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to mask bit");
     FAPI_TRY(l_occFir.setRecvAttn(C405_ECC_UE),
-             "ERROR: Failed to set recovery attention");
-    FAPI_TRY(l_occFir.mask(C405_ECC_CE),
-             "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.mask(C405_OCI_MC_CHK),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(C405_ECC_CE),
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(C405_OCI_MC_CHK),
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRAM_SPARE_DIRERR0),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRAM_SPARE_DIRERR1),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRAM_SPARE_DIRERR2),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(SRAM_SPARE_DIRERR3),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(GPE0_OCISLV_ERR),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(GPE1_OCISLV_ERR),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(GPE2_OCISLV_ERR),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(GPE3_OCISLV_ERR),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(C405ICU_M_TIMEOUT),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
+    FAPI_TRY(l_occFir.setRecvAttn(C405DCU_M_TIMEOUT),
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(OCC_CMPLX_FAULT),
-             "ERROR: Failed to set recovery attention");
-    FAPI_TRY(l_occFir.mask(OCC_CMPLX_NOTIFY),
-             "ERROR: Failed to mask bit");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.setRecvAttn(OCC_CMPLX_NOTIFY),
-             "ERROR: Failed to set recovery attention");
+             "ERROR: Failed to set recoverable attention");
     FAPI_TRY(l_occFir.mask(SPARE_59),
              "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.setRecvAttn(SPARE_59),
-             "ERROR: Failed to set recovery attention");
     FAPI_TRY(l_occFir.mask(SPARE_60),
              "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.setRecvAttn(SPARE_60),
-             "ERROR: Failed to set recovery attention");
     FAPI_TRY(l_occFir.mask(SPARE_61),
              "ERROR: Failed to mask bit");
-    FAPI_TRY(l_occFir.setRecvAttn(SPARE_61),
-             "ERROR: Failed to set recovery attention");
-    FAPI_TRY(l_occFir.setRecvAttn(FIR_PARITY_ERR_DUP),
-             "ERROR: Failed to set recovery attention");
-    FAPI_TRY(l_occFir.setRecvAttn(FIR_PARITY_ERR),
-             "ERROR: Failed to set recovery attention");
+    FAPI_TRY(l_occFir.mask(FIR_PARITY_ERR_DUP),
+             "ERROR: Failed to mask bit");
+    FAPI_TRY(l_occFir.mask(FIR_PARITY_ERR),
+             "ERROR: Failed to mask bit");

     if (firinit_done_flag)
     {


Coverity fixes

Coverity fixes

--- STEER/AliMathBase.cxx
+++ STEER/AliMathBase.cxx
@@ -277,7 +277,7 @@
   }
 }

-Double_t  AliMathBase::FitGaus(TH1F* his, TVectorD *param, TMatrixD *matrix, Float_t xmin, Float_t xmax, Bool_t verbose){
+Double_t  AliMathBase::FitGaus(TH1F* his, TVectorD *param, TMatrixD */*matrix*/, Float_t xmin, Float_t xmax, Bool_t verbose){
   //
   //  Fit histogram with gaussian function
   //
@@ -355,7 +355,7 @@
   Double_t chi2 = fitter.GetChisquare()/Float_t(npoints);
   //fitter.GetParameters();
   if (!param)  param  = new TVectorD(3);
-  if (!matrix) matrix = new TMatrixD(3,3);
+  //if (!matrix) matrix = new TMatrixD(3,3);
   (*param)[1] = par[1]/(-2.*par[2]);
   (*param)[2] = 1./TMath::Sqrt(TMath::Abs(-2.*par[2]));
   (*param)[0] = TMath::Exp(par[0]+ par[1]* (*param)[1] +  par[2]*(*param)[1]*(*param)[1]);
@@ -373,7 +373,7 @@
   return chi2;
 }

-Double_t  AliMathBase::FitGaus(Float_t *arr, Int_t nBins, Float_t xMin, Float_t xMax, TVectorD *param, TMatrixD *matrix, Bool_t verbose){
+Double_t  AliMathBase::FitGaus(Float_t *arr, Int_t nBins, Float_t xMin, Float_t xMax, TVectorD *param, TMatrixD */*matrix*/, Bool_t verbose){
   //
   //  Fit histogram with gaussian function
   //
@@ -414,7 +414,7 @@
   Float_t entries = 0;
   Int_t nfilled=0;

-  if (!param) { cerr<<"Zero param pointer"<<endl; return 1e10; }
+  if (!param)  param  = new TVectorD(4);

   for (Int_t i=0; i<nBins; i++){
       entries+=arr[i];
@@ -473,9 +473,9 @@
       if (TMath::Abs(par[1])<kTol) return -4;
       if (TMath::Abs(par[2])<kTol) return -4;

-      if (!param)  param  = new TVectorD(4);
+      //if (!param)  param  = new TVectorD(4);
       if ( param->GetNrows()<4 ) param->ResizeTo(4);
-      if (!matrix) matrix = new TMatrixD(3,3);  // !!!!might be a memory leek. use dummy matrix pointer to call this function!
+      //if (!matrix) matrix = new TMatrixD(3,3);  // !!!!might be a memory leek. use dummy matrix pointer to call this function!

       (*param)[1] = par[1]/(-2.*par[2]);
       (*param)[2] = 1./TMath::Sqrt(TMath::Abs(-2.*par[2]));


BUG: Set Size and Spacing to 1 if not define  in the header (previous value was 0)

--- MetaImage/MetaImageLib.cxx
+++ MetaImage/MetaImageLib.cxx
@@ -159,7 +159,7 @@

    if(_eSize == NULL)
       for(i=0; i<iNDims; i++)
-         eSize[i] = 0;
+         eSize[i] = 1;
      else
       for(i=0; i<iNDims; i++)
          eSize[i] = _eSize[i];
@@ -221,10 +221,10 @@
       {
       iDimSize[i] = 0;
       iSubQuantity[i] = 0;
-      eSize[i] = 0;
+      eSize[i] = 1;
       iPosition[i] = 0;
       pPosition[i] = 0;
-      eSpacing[i] = 0;
+      eSpacing[i] = 1;
       }
    for(i=0; i<6; i++)
       iOrientation[i] = 0;
@@ -599,14 +599,14 @@
          eSize[i] = f[c].val[i];
      else
       for(i=0; i<iNDims; i++)
-         eSize[i] = 0;
+         eSize[i] = 1;

    if(f[++c].defined)
       for(i=0; i<iNDims; i++)
          eSpacing[i] = f[c].val[i];
      else
       for(i=0; i<iNDims; i++)
-         eSpacing[i] = 0;
+         eSpacing[i] = 1;

    if(f[++c].defined)
       eType = MET_StringToType((char *)f[c].val);


fix another malformed query

fix another malformed query


Fix the way built-in solvers are added

Fix the way built-in solvers are added

--- MiniZincIDE/mainwindow.cpp
+++ MiniZincIDE/mainwindow.cpp
@@ -748,105 +748,46 @@
     IDE::instance()->setEditorFont(editorFont);

     Solver g12fd("G12 fd","flatzinc","-Gg12_fd","",true,false,true);
-    bool hadg12fd = false;
     Solver g12lazyfd("G12 lazyfd","flatzinc","-Gg12_lazyfd","-b lazy",true,false,true);
-    bool hadg12lazyfd = false;
     Solver g12mip("G12 MIP","flatzinc","-Glinear","-b mip",true,false,true);
-    bool hadg12mip = false;
 #ifdef MINIZINC_IDE_BUNDLED
     Solver gecode("Gecode (bundled)","fzn-gecode","-Ggecode","",true,false,true);
-    bool hadgecode = false;
 #ifdef Q_OS_WIN
     Solver gecodeGist("Gecode (Gist, bundled)","fzn-gecode-gist.bat","-Ggecode","",true,true,true);
 #else
     Solver gecodeGist("Gecode (Gist, bundled)","fzn-gecode-gist","-Ggecode","",true,true,true);
 #endif
-    bool hadgecodegist = false;
     Solver chuffed("Chuffed (bundled)","fzn-chuffed","-Gchuffed","",true,false,true);
-    bool hadchuffed = false;
     Solver cbc("COIN-OR CBC (bundled)","mzn-cbc","-Glinear","",true,false,true);
-    bool hadcbc = false;
     Solver gurobi("Gurobi (bundled)","mzn-gurobi","-Glinear","",true,false,true);
-    bool hadgurobi = false;
 #endif

     int nsolvers = settings.beginReadArray("solvers");
-    if (nsolvers==0) {
 #ifdef MINIZINC_IDE_BUNDLED
-        solvers.append(gecode);
-        solvers.append(gecodeGist);
+    solvers.append(gecode);
+    solvers.append(gecodeGist);
+    solvers.append(chuffed);
+    solvers.append(cbc);
+    solvers.append(gurobi);
 #endif
-        solvers.append(g12fd);
-        solvers.append(g12lazyfd);
-        solvers.append(g12mip);
-    } else {
-        IDE::instance()->stats.solvers.clear();
-        for (int i=0; i<nsolvers; i++) {
-            settings.setArrayIndex(i);
-            Solver solver;
-            solver.name = settings.value("name").toString();
-            solver.executable = settings.value("executable").toString();
-            solver.mznlib = settings.value("mznlib").toString();
-            solver.backend = settings.value("backend").toString();
-            solver.builtin = settings.value("builtin").toBool();
-            solver.detach = settings.value("detach",false).toBool();
-            solver.needs_mzn2fzn= settings.value("needs_mzn2fzn",true).toBool();
-            if (solver.builtin) {
-                if (solver.name=="G12 fd") {
-                    solver = g12fd;
-                    hadg12fd = true;
-                } else if (solver.name=="G12 lazyfd") {
-                    solver = g12lazyfd;
-                    hadg12lazyfd = true;
-                } else if (solver.name=="G12 MIP") {
-                    solver = g12mip;
-                    hadg12mip = true;
-                }
-#ifdef MINIZINC_IDE_BUNDLED
-                else if (solver.name=="Gecode (bundled)") {
-                    solver = gecode;
-                    hadgecode = true;
-                }
-                else if (solver.name=="Gecode (Gist, bundled)") {
-                    solver = gecodeGist;
-                    hadgecodegist = true;
-                }
-                else if (solver.name=="COIN-OR CBC (bundled)") {
-                    solver = cbc;
-                    hadcbc= true;
-                }
-                else if (solver.name=="Gurobi (bundled)") {
-                    solver = gurobi;
-                    hadgurobi= true;
-                }
-                else if (solver.name=="Chuffed (bundled)") {
-                    solver = chuffed ;
-                    hadchuffed = true;
-                }
-#endif
-            } else {
-                IDE::instance()->stats.solvers.append(solver.name);
-            }
-            solvers.append(solver);
-        }
-        if (!hadg12fd)
-            solvers.append(g12fd);
-        if (!hadg12lazyfd)
-            solvers.append(g12lazyfd);
-        if (!hadg12mip)
-            solvers.append(g12mip);
-#ifdef MINIZINC_IDE_BUNDLED
-        if (!hadgurobi)
-            solvers.push_front(gurobi);
-        if (!hadcbc)
-            solvers.push_front(cbc);
-        if (!hadchuffed)
-            solvers.push_back(chuffed);
-        if (!hadgecodegist)
-            solvers.push_front(gecodeGist);
-        if (!hadgecode)
-            solvers.push_front(gecode);
-#endif
+    solvers.append(g12fd);
+    solvers.append(g12lazyfd);
+    solvers.append(g12mip);
+    IDE::instance()->stats.solvers.clear();
+    for (int i=0; i<nsolvers; i++) {
+        settings.setArrayIndex(i);
+        if (settings.value("builtin").toBool())
+            continue;
+        Solver solver;
+        solver.name = settings.value("name").toString();
+        solver.executable = settings.value("executable").toString();
+        solver.mznlib = settings.value("mznlib").toString();
+        solver.backend = settings.value("backend").toString();
+        solver.builtin = settings.value("builtin").toBool();
+        solver.detach = settings.value("detach",false).toBool();
+        solver.needs_mzn2fzn= settings.value("needs_mzn2fzn",true).toBool();
+        IDE::instance()->stats.solvers.append(solver.name);
+        solvers.append(solver);
     }
     settings.endArray();
     settings.beginGroup("minizinc");


adds exit to home page

adds exit to home page

--- Service/RootLogin.cpp
+++ Service/RootLogin.cpp
@@ -546,7 +546,28 @@
 void RootLogin::Impl::OnGoToHomePageButtonPressed()
 {
     CgiRoot *cgiRoot = static_cast<CgiRoot *>(WApplication::instance());
-    cgiRoot->Exit("/");
+    CgiEnv *cgiEnv = cgiRoot->GetCgiEnvInstance();
+
+    string homePageFields;
+    if (cgiEnv->GetCurrentLanguage() == CgiEnv::Language::Fa) {
+        homePageFields = "homepage_url_fa";
+    } else {
+        homePageFields = "homepage_url_en";
+    }
+
+    result r = Pool::Database()->Sql()
+            << (format("SELECT %1%"
+                       " FROM \"%2%\" WHERE pseudo_id = '0';")
+                % homePageFields
+                % Pool::Database()->GetTableName("SETTINGS")).str()
+            << row;
+
+    string homePageUrl;
+    if (!r.empty()) {
+        r >> homePageUrl;
+    }
+
+    cgiRoot->Exit(homePageUrl);
 }

 void RootLogin::Impl::OnSignInAgainButtonPressed()


add device status callback

add device status callback

--- mining/include/minterfacemgrimpl.hpp
+++ mining/include/minterfacemgrimpl.hpp
@@ -10,32 +10,50 @@

 inline MiningInterfaceMgr::MiningInterfaceMgr(u32 id,
 			Factory &pFactory, MiningInterface * pDevice)
-:m_id(id), m_pDevice(pDevice), m_pFactory(pFactory)
+:m_id(id), m_pDevice(pDevice), m_pFactory(pFactory),
+ m_type(MM_STREAM_LAST)
 {
 	Init();
 }
 inline MiningInterfaceMgr::~MiningInterfaceMgr()
 {
+	Cleanup();
 }

 inline BOOL MiningInterfaceMgr::Init()
 {
 	/* Reg the data callback from factory */
-	MMReqStream type = MM_STREAM_LAST;
-	m_pDevice->GetReqStream( type);
+
+	m_pDevice->GetReqStream( m_type);
 	/* Current we only use sub raw stream */
-	if (type & MM_STREAM_SUB_RAW != 0)
+	if ((m_type & MM_STREAM_SUB_RAW) != 0)
 	{
 		m_pFactory.RegSubRawCallback(m_id,
 			(DeviceRawCallbackFunctionPtr)MiningInterfaceMgr::RawHandler,
 				(void *)this);
 	}

-	if (type & MM_STREAM_SEQ != 0)
+	if ((m_type & MM_STREAM_SEQ) != 0)
 	{
 		m_pFactory.RegSeqCallback(m_id,
 			(DeviceSeqCallbackFunctionPtr)MiningInterfaceMgr::SeqHandler,
 				(void *)this);
+	}
+	//TODO add callback RetCallback from process module
+	return TRUE;
+}
+
+inline BOOL MiningInterfaceMgr::Cleanup()
+{
+	/* Current we only use sub raw stream */
+	if (m_type & MM_STREAM_SUB_RAW != 0)
+	{
+		m_pFactory.UnRegSubRawCallback(m_id, (void *)this);
+	}
+
+	if (m_type & MM_STREAM_SEQ != 0)
+	{
+		m_pFactory.UnRegSeqCallback(m_id, (void *)this);
 	}
 	//TODO add callback RetCallback from process module
 	return TRUE;


add forgotten virtual to GlobalPotentialBase

--- mjolnir/core/GlobalPotentialBase.hpp
+++ mjolnir/core/GlobalPotentialBase.hpp
@@ -14,9 +14,9 @@

     virtual ~GlobalPotentialBase(){};

-    real_type
+    virtual real_type
     potential(const std::size_t i, const std::size_t j, const real_type r) = 0;
-    real_type
+    virtual real_type
     derivative(const std::size_t i, const std::size_t j, const real_type r) = 0;

 };


regression: dictionary key no autocomplete fix

Fix: #38998

--- modules/gdscript/gdscript_editor.cpp
+++ modules/gdscript/gdscript_editor.cpp
@@ -2082,7 +2082,11 @@

 				if (!p_only_functions) {
 					List<PropertyInfo> members;
-					tmp.get_property_list(&members);
+					if (p_base.value.get_type() != Variant::NIL) {
+						p_base.value.get_property_list(&members);
+					} else {
+						tmp.get_property_list(&members);
+					}

 					for (List<PropertyInfo>::Element *E = members.front(); E; E = E->next()) {
 						if (String(E->get().name).find("/") == -1) {


Qt4: grammar

Qt4: grammar

--- modules/gui/qt4/dialogs/firstrun.cpp
+++ modules/gui/qt4/dialogs/firstrun.cpp
@@ -70,13 +70,13 @@
     QGridLayout *blablaLayout = new QGridLayout( blabla );
     QLabel *text = new QLabel( qtr(
         "
In order to protect your privacy, the VLC media player "
-        "does not collect personal informations or transmit them, "
+        "does not collect personal data or transmit them, "
         "not even in anonymized form, to anyone."
         "
\n"
         "
Nevertheless, VLC is able to automatically retrieve "
-        "informations about the media in your playlist from third party "
-        "Internet-based services. These informations include covert arts, "
-        "track names, authoring and other meta-data."
+        "information about the media in your playlist from third party "
+        "Internet-based services. That includes covert arts, track names, "
+        "authoring and other meta-data."
         "
\n"
         "That may entail identifying some of your media files to third party "
         "entities. Therefore the VLC developers require your express "


Qt: Cosmetics and msg_Dbg.

Qt: Cosmetics and msg_Dbg.

--- modules/gui/qt4/dialogs_provider.cpp
+++ modules/gui/qt4/dialogs_provider.cpp
@@ -569,7 +569,7 @@
 void DialogsProvider::streamingDialog( QWidget *parent, QString mrl,
                                        bool b_transcode_only )
 {
-    const char *psz_option;
+    char *psz_option;
     if( !b_transcode_only )
     {
         SoutDialog *s = SoutDialog::getInstance( parent, p_intf, mrl );
@@ -599,8 +599,7 @@

     if( !EMPTY_STR( psz_option ) )
     {
-
-        msg_Dbg( p_intf, "Sout mrl %s", psz_option );
+        msg_Dbg( p_intf, "Streaming MRL is: %s", psz_option );
         playlist_AddExt( THEPL, qtu( mrl ), _("Streaming"),
                          PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END,
                         -1, 1, &psz_option, VLC_INPUT_OPTION_TRUSTED, true, pl_Unlocked );


qt4: fix windows build after 6ea38362e66

--- modules/gui/qt4/styles/seekstyle.hpp
+++ modules/gui/qt4/styles/seekstyle.hpp
@@ -23,6 +23,7 @@
 #ifndef SEEKSTYLE_HPP
 #define SEEKSTYLE_HPP

+#include <inttypes.h>
 #include <QProxyStyle>
 #include <QStyleOptionSlider>


imgcodecs(tiff): check TIFF tile size

imgcodecs(tiff): check TIFF tile size

oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13280
oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13283

--- modules/imgcodecs/src/grfmt_tiff.cpp
+++ modules/imgcodecs/src/grfmt_tiff.cpp
@@ -400,6 +400,10 @@
             if (tile_height0 == 0 ||
                     (!is_tiled && tile_height0 == std::numeric_limits<uint32>::max()) )
                 tile_height0 = m_height;
+
+            CV_Assert((int)tile_width0 > 0 && (int)tile_width0 < std::numeric_limits<int>::max());
+            CV_Assert((int)tile_height0 > 0 && (int)tile_height0 < std::numeric_limits<int>::max());
+            CV_Assert(((uint64_t)tile_width0 * tile_height0 * ncn * (bpp / bitsPerByte) < (CV_BIG_UINT(1) << 30)) && "TIFF tile size is too large: >= 1Gb");

             if (dst_bpp == 8)
             {


Fix creepy "dump master.passwd to stderr" failure.

--- Mach/Inject.cpp
+++ Mach/Inject.cpp
@@ -207,6 +207,7 @@

     baton->dyld = info.all_image_info_addr;
     baton->pid = getpid();
+    memset(baton->error, 0, sizeof(baton->error));
     memcpy(baton->library, library, length);

     mach_vm_size_t size(depth + Stack_);


PanasonicDecompressorV6: narrow some variables if possible (-6%)

--- src/librawspeed/decompressors/PanasonicDecompressorV6.cpp
+++ src/librawspeed/decompressors/PanasonicDecompressorV6.cpp
@@ -36,7 +36,7 @@

 namespace {
 struct pana_cs6_page_decoder {
-  std::array<unsigned int, 14> pixelbuffer;
+  std::array<uint16_t, 14> pixelbuffer;
   unsigned char current = 0;

   explicit pana_cs6_page_decoder(const ByteStream& bs) {
@@ -59,7 +59,7 @@
     pixelbuffer[13] = ((bs.peekByte(1) << 4) | (bs.peekByte(0) >> 4)) & 0x3ff;
   }

-  unsigned int nextpixel() { return pixelbuffer[current++]; }
+  uint16_t nextpixel() { return pixelbuffer[current++]; }
 };
 } // namespace

@@ -89,14 +89,14 @@
   pana_cs6_page_decoder page(
       rowInput->getStream(PanasonicDecompressorV6::BytesPerBlock));

-  std::array<unsigned int, 2> oddeven = {0, 0};
-  std::array<unsigned int, 2> nonzero = {0, 0};
+  std::array<unsigned, 2> oddeven = {0, 0};
+  std::array<unsigned, 2> nonzero = {0, 0};
   unsigned pmul = 0;
   unsigned pixel_base = 0;
   for (int pix = 0; pix < PanasonicDecompressorV6::PixelsPerBlock;
        pix++, col++) {
     if (pix % 3 == 2) {
-      unsigned base = page.nextpixel();
+      uint16_t base = page.nextpixel();
       if (base > 3)
         ThrowRDE("Invariant failure");
       if (base == 3)
@@ -104,7 +104,7 @@
       pixel_base = 0x200 << base;
       pmul = 1 << base;
     }
-    unsigned epixel = page.nextpixel();
+    uint16_t epixel = page.nextpixel();
     if (oddeven[pix % 2]) {
       epixel *= pmul;
       if (pixel_base < 0x2000 && nonzero[pix % 2] > pixel_base)
@@ -121,7 +121,7 @@
     if (spix <= 0xffff)
       out(row, col) = spix & 0xffff;
     else {
-      epixel = static_cast<signed int>(epixel + 0x7ffffff1) >> 0x1f;
+      epixel = static_cast<int>(epixel + 0x7ffffff1) >> 0x1f;
       out(row, col) = epixel & 0x3fff;
     }
   }


Conform to coding/style conventions

Conform to coding/style conventions

--- naturalneighbor/cnaturalneighbor.cpp
+++ naturalneighbor/cnaturalneighbor.cpp
@@ -54,15 +54,14 @@
         ob = Py_InitModule3(name, methods, doc);
 #endif

-MOD_INIT(cnaturalneighbor)
-{
+MOD_INIT(cnaturalneighbor) {
     PyObject* m;

-    MOD_DEF(m, "cnaturalneighbor", module_docstring,
-            module_methods)
-
-    if (m == NULL)
+    MOD_DEF(m, "cnaturalneighbor", module_docstring, module_methods);
+
+    if (m == NULL) {
         return MOD_ERROR_VAL;
+    }

     import_array();


Implemented constructors and Advance

Implemented constructors and Advance

--- ModelObject.cpp
+++ ModelObject.cpp
@@ -1,4 +1,34 @@
 #include "ModelObject.h"
+#include <cmath>
+
+// default ctor
+ModelObject::ModelObject()
+  : position_(0, 0, 0), velocity_(0, 0, 0), force_(0, 0, 0), mass_(0), radius_(0)
+{}
+
+// position, velocity, force, mass, radius
+ModelObject::ModelObject(
+  Vector3D position,
+  Vector3D velocity,
+  Vector3D force,
+  double mass,
+  double radius)
+  : position_(position),
+    velocity_(velocity),
+    force_(force),
+    mass_(mass),
+    radius_(radius)
+{}
+
+void ModelObject::Advance(double time)
+{
+  Vector3 acceleration = force_ * (1.0f / mass_);
+
+  position_ += velocity_ * time; // v(0) * t
+  position_ += acceleration * 0.5 * std::pow(time, 2.0); // 1/2 * a * t^2
+
+  velocity_ += acceleration * time; // v(t) = v(0) + at
+}

 // getters
 const ModelObject::Vector3D ModelObject::Position() const


bug fix

bug fix

--- drv_brain/src/drv_brain.cpp
+++ drv_brain/src/drv_brain.cpp
@@ -105,14 +105,14 @@
   ros::param::set(param_vision_feedback_track, 0);
   ros::param::set(param_vision_feedback_grasp, 0);
   ros::param::set(param_vision_feedback_face, 0);
-
+
   tgtType_ = t_null;
   targetLabel_ = "";
-
+
   isTargetSet_ = false;
   foundTarget_ = false;
   putSuccess_ = 0;
-
+
   modeType_ = m_wander;

   ros::param::set(param_comm_target_set, false);
@@ -160,19 +160,19 @@
 {
   if (msg->data.empty() || (msg->data[0] == 0 && msg->data[1] == 0))
     return;
-
+
   int pitch_temp = pitchAngle_ + msg->data[0];
   if (pitch_temp < pitch_min_ || pitch_temp > pitch_max_)
     return;
   else
     pitchAngle_ = pitch_temp;
-
+
   int yaw_temp = yawAngle_ - msg->data[1];
   if (yaw_temp < yaw_min_ || yaw_temp > yaw_max_)
     return;
   else
     yawAngle_ = yaw_temp;
-
+
   int power = 4;
   pubServo(pitchAngle_, yawAngle_, power);
 }
@@ -182,7 +182,7 @@
   // This callback should always active
   pitchAngle_ = msg->data[0];
   yawAngle_ = msg->data[1];
-
+
   ros::param::set(param_servo_pitch, pitchAngle_);
   ros::param::set(param_servo_yaw, yawAngle_);
 }
@@ -288,16 +288,16 @@
 int main(int argc, char **argv)
 {
   ros::init(argc, argv, "drv_brain");
-
+
   ros::NodeHandle nh;
   ros::NodeHandle pnh("~");
-
+
   // Servo's max angle to rotate
   pnh.getParam("pitch_min", pitch_min_);
   pnh.getParam("pitch_max", pitch_max_);
   pnh.getParam("yaw_min", yaw_min_);
   pnh.getParam("yaw_max", yaw_max_);
-
+
   servoPub_ = nh.advertise<UInt16MultiArray>("servo", 1, true);
   // For publishing mode info
   drvPubMode_ = nh.advertise<String>("/comm/msg/vision/mode", 1);
@@ -305,7 +305,7 @@

   // Function feedback publishers
   drvPubPutResult_ = nh.advertise<Int8>("/feed/vision/put/result", 1);
-
+
   // Don't change the order without reason
   ros::Subscriber sub_servo_ctrl = nh.subscribe<Int32MultiArray>("/joy_teleop/servo", 1, teleOpCallback);
   ros::Subscriber sub_servo = nh.subscribe<UInt16MultiArray>("servo", 1, servoCallback);
@@ -315,15 +315,15 @@
   ros::Subscriber sub_gp = nh.subscribe<Int8>("status/grasp/feedback", 1, graspCallback);
   ros::Subscriber sub_pt = nh.subscribe<Int8>("status/put/feedback", 1, putCallback);
   ros::Subscriber sub_fr = nh.subscribe<Bool>("status/face/feedback", 1, faceRecognizeCallback);
-
+
   FaceListener fl;
   TargetListener tl;
   TargetSelecter ts;

   resetStatus();
-
+
   pubInfo("Deep Robot Vision system initialized!");
-
+
   while (ros::ok()) {
     // Main on/off control
     if (ros::param::has(param_vision_shared_switch)) {
@@ -333,23 +333,23 @@
         ROS_WARN_COND(!centralSwitch_, "Brain: Central switch is ON.");
       centralSwitch_ = temp;
     }
-
+
     if (!centralSwitch_) {
       ROS_WARN_THROTTLE(9, "Brain: Central switch is OFF.");
       resetStatus();
       continue;
     }
-
+
     // Initialize servo position
     if (!servo_initialized_) {
       pubServo(90, 90, 1);
       servo_initialized_ = true;
       ROS_INFO("Brain: Servo reset.");
     }
-
+
     // Get feedback to determine whether target were found
     ros::spinOnce();
-
+
     // Get target label if the params were set
     tl.getTargetStatus(isTargetSet_, targetLabel_, isPut_);
     ros::param::set(param_target_label, targetLabel_);
@@ -363,10 +363,10 @@
       }
       targetSetTemp_ = isTargetSet_;
     }
-
+
     // If user selects target on cellphone, publish the target
     ts.publishOnceIfTargetSelected(isTargetSet_, foundTarget_);
-
+
     // Mode selection, notice that modeType_ should only be set by central control
     if (isTargetSet_) {
       if (foundTarget_) {
@@ -390,14 +390,18 @@
         if (putSuccess_ == 0) {
           modeType_ = m_put;
         }
-      }
-      modeType_ = m_wander;
-      fl.isNeedRecognizeFace(); // Only recognize face in wander mode
-    }
-
+        else
+          modeType_ = m_wander;
+      }
+      else {
+        modeType_ = m_wander;
+        fl.isNeedRecognizeFace(); // Only recognize face in wander mode
+      }
+    }
+
     // Set private running mode
     ros::param::set(param_running_mode, modeType_);
-
+
     if (modeType_ != modeTypeTemp_) {
       String mode_msg;
       mode_msg.data = modeName[modeType_];
@@ -410,7 +414,7 @@
       }
     }
   }
-
+
   return 0;
 }


[common.string] allow vectors to be created from scalars

Historically it was possible to create any type of vector of any requested
length from an expression of the form "1" or "[1]" by interpreting this as
the scalar 1 and filling all components of the vector with this value. That
somehow got lost in the re-factoring of string/configuration; this commit
restores the old behavior.

We could argue, though, that we only want vectors of arbitrary length to be
created from "1", not from "[1]", as the latter looks like an explicit wish
for a vector of length 1.

--- dune/stuff/common/string.hh
+++ dune/stuff/common/string.hh
@@ -202,7 +202,7 @@
     const size_t actual_size = VectorAbstraction< VectorType >::has_static_size
                                ? VectorAbstraction< VectorType >::static_size
                                : automatic_size;
-    if (actual_size > automatic_size)
+    if (actual_size > automatic_size && automatic_size != 1)
       DUNE_THROW(Exceptions::conversion_error,
                  "Vector expression (see below) has only " << automatic_size << " elements but " << actual_size
                  << " elements are required for this VectorType (" << Typename< VectorType >::value() << ")!" << "\n"


Fix issues when skipping l10n for script variables

--- editor/editor_inspector.cpp
+++ editor/editor_inspector.cpp
@@ -2456,8 +2456,6 @@
 		_parse_added_editors(main_vbox, ped);
 	}

-	bool in_script_variables = false;
-
 	// Get the lists of editors for properties.
 	for (List<PropertyInfo>::Element *E_property = plist.front(); E_property; E_property = E_property->next()) {
 		PropertyInfo &p = E_property->get();
@@ -2549,9 +2547,6 @@
 				if (category->icon.is_null() && has_theme_icon(base_type, SNAME("EditorIcons"))) {
 					category->icon = get_theme_icon(base_type, SNAME("EditorIcons"));
 				}
-				in_script_variables = true;
-			} else {
-				in_script_variables = false;
 			}
 			if (category->icon.is_null()) {
 				if (!type.is_empty()) { // Can happen for built-in scripts.
@@ -2687,9 +2682,9 @@
 			}
 		}

-		// Don't localize properties in Script Variables category.
+		// Don't localize script variables.
 		EditorPropertyNameProcessor::Style name_style = property_name_style;
-		if (in_script_variables && name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
+		if ((p.usage & PROPERTY_USAGE_SCRIPT_VARIABLE) && name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
 			name_style = EditorPropertyNameProcessor::STYLE_CAPITALIZED;
 		}
 		const String property_label_string = EditorPropertyNameProcessor::get_singleton()->process_name(name_override, name_style) + feature_tag;
@@ -2745,9 +2740,15 @@
 				String label;
 				String tooltip;

+				// Don't localize groups for script variables.
+				EditorPropertyNameProcessor::Style section_name_style = property_name_style;
+				if ((p.usage & PROPERTY_USAGE_SCRIPT_VARIABLE) && section_name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
+					section_name_style = EditorPropertyNameProcessor::STYLE_CAPITALIZED;
+				}
+
 				// Only process group label if this is not the group or subgroup.
 				if ((i == 0 && component == group) || (i == 1 && component == subgroup)) {
-					if (property_name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
+					if (section_name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
 						label = TTRGET(component);
 						tooltip = component;
 					} else {
@@ -2755,8 +2756,8 @@
 						tooltip = TTRGET(component);
 					}
 				} else {
-					label = EditorPropertyNameProcessor::get_singleton()->process_name(component, property_name_style);
-					tooltip = EditorPropertyNameProcessor::get_singleton()->process_name(component, EditorPropertyNameProcessor::get_tooltip_style(property_name_style));
+					label = EditorPropertyNameProcessor::get_singleton()->process_name(component, section_name_style);
+					tooltip = EditorPropertyNameProcessor::get_singleton()->process_name(component, EditorPropertyNameProcessor::get_tooltip_style(section_name_style));
 				}

 				Color c = sscolor;


Add a silly splash

Add a silly splash

Otherwise, I would think it's bugged.

--- ncurses-version/CConsoleRenderer.cpp
+++ ncurses-version/CConsoleRenderer.cpp
@@ -35,6 +35,8 @@
         init_pair(3, COLOR_CYAN, COLOR_BLACK);
         init_pair(4, COLOR_GREEN, COLOR_BLACK);
         init_pair(5, COLOR_WHITE, COLOR_BLACK);
+
+        printw( "Dungeons Of Noudar\nCore edition.\nPress any key");
     }

     CConsoleRenderer::~CConsoleRenderer() {


set set "CHUNK_SZ" for fragmented signal to real value added API_TRACE code removed old implementation of fragmented signal

--- ndb/src/ndbapi/TransporterFacade.cpp
+++ ndb/src/ndbapi/TransporterFacade.cpp
@@ -835,13 +835,26 @@
   return (ss == SEND_OK ? 0 : -1);
 }

-#define CHUNK_SZ NDB_SECTION_SEGMENT_SZ*1
+#define CHUNK_SZ NDB_SECTION_SEGMENT_SZ*64 // related to MAX_MESSAGE_SIZE
 int
 TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode,
 					LinearSectionPtr ptr[3], Uint32 secs)
 {
   if(getIsNodeSendable(aNode) != true)
     return -1;
+
+#ifdef API_TRACE
+  if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){
+    Uint32 tmp = aSignal->theSendersBlockRef;
+    aSignal->theSendersBlockRef = numberToRef(tmp, theOwnId);
+    signalLogger.sendSignal(* aSignal,
+			    1,
+			    aSignal->getDataPtrSend(),
+			    aNode,
+			    ptr, secs);
+    aSignal->theSendersBlockRef = tmp;
+  }
+#endif

   NdbApiSignal tmp_signal(*(SignalHeader*)aSignal);
   LinearSectionPtr tmp_ptr[3];
@@ -942,71 +955,6 @@
   return ret;
 }

-#if 0
-int
-TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode,
-					LinearSectionPtr ptr[3], Uint32 secs){
-  aSignal->m_noOfSections = secs;
-  if(getIsNodeSendable(aNode) == true){
-#ifdef API_TRACE
-    if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){
-      Uint32 tmp = aSignal->theSendersBlockRef;
-      aSignal->theSendersBlockRef = numberToRef(tmp, theOwnId);
-      signalLogger.sendSignal(* aSignal,
-			      1,
-			      aSignal->getDataPtrSend(),
-			      aNode,
-                              ptr, secs);
-      signalLogger.flushSignalLog();
-      aSignal->theSendersBlockRef = tmp;
-    }
-#endif
-    SendStatus ss = theTransporterRegistry->prepareSend
-      (aSignal,
-       1, // JBB
-       aSignal->getDataPtrSend(),
-       aNode,
-       ptr);
-    assert(ss != SEND_MESSAGE_TOO_BIG);
-    aSignal->m_noOfSections = 0;
-    return (ss == SEND_OK ? 0 : -1);
-  }
-  aSignal->m_noOfSections = 0;
-  return -1;
-}
-#endif
-
-
-int
-TransporterFacade::sendFragmentedSignalUnCond(NdbApiSignal* aSignal,
-					      NodeId aNode,
-					      LinearSectionPtr ptr[3],
-					      Uint32 secs){
-  aSignal->m_noOfSections = secs;
-
-#ifdef API_TRACE
-  if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){
-    Uint32 tmp = aSignal->theSendersBlockRef;
-    aSignal->theSendersBlockRef = numberToRef(tmp, theOwnId);
-    signalLogger.sendSignal(* aSignal,
-			    1,
-			    aSignal->getDataPtrSend(),
-			    aNode,
-			    ptr, secs);
-      aSignal->theSendersBlockRef = tmp;
-  }
-#endif
-  SendStatus ss =
-    theTransporterRegistry->prepareSend(aSignal, 1, // JBB
-					aSignal->getDataPtrSend(),
-					aNode, ptr);
-  assert(ss != SEND_MESSAGE_TOO_BIG);
-  aSignal->m_noOfSections = 0;
-  return (ss == SEND_OK ? 0 : -1);
-}
-
-
-
 /******************************************************************************
  * CONNECTION METHODS  Etc
  ******************************************************************************/


fixed warning.

fixed warning.

--- Visualization_Library_SDK/src/vl/VisualizationLibrary.hpp
+++ Visualization_Library_SDK/src/vl/VisualizationLibrary.hpp
@@ -80,7 +80,7 @@
     /** If \p true VL checks that there are no duplicates in a Transform children list.
       * \note This can slow down considerably the insertion of new child Transforms.
       * Enabled by default in DEBUG mode only. */
-    bool setCheckTransformSiblings(bool check_on) { mCheckTransformSiblings = check_on; }
+    void setCheckTransformSiblings(bool check_on) { mCheckTransformSiblings = check_on; }

     /** If \p true VL checks that there are no duplicates in a Transform children list.
       * \note This can slow down considerably the insertion of new child Transforms.


Lint.

Lint.

--- numerics/frequency_analysis_test.cpp
+++ numerics/frequency_analysis_test.cpp
@@ -504,18 +504,17 @@
       [&series, t_min, t_max, &ω_index, &ωs](
           auto const& residual) -> std::optional<AngularFrequency> {
     for (int i = 0; i <= 100; ++i) {
-      EXPECT_THAT(
-          Abs(residual(t_min + i * (t_max - t_min) / 100)),
-          ω_index == 0
-              ? AllOf(Gt(12 * Metre), Lt(32 * Metre))
-              : ω_index == 1
-                    ? AllOf(Gt(5.2e-3 * Metre), Lt(9.0 * Metre))
-                    : ω_index == 2
-                          ? AllOf(Gt(7.0e-3 * Metre), Lt(3.1 * Metre))
-                          : ω_index == 3
-                                ? AllOf(Gt(1.1e-14 * Metre), Lt(1.7e-10 * Metre))
-                                : AllOf(Gt(-1.0e-100 * Metre),
-                                        Lt(2.4e-14 * Metre)))
+      EXPECT_THAT(Abs(residual(t_min + i * (t_max - t_min) / 100)),
+                  ω_index == 0
+                      ? AllOf(Gt(12 * Metre), Lt(32 * Metre))
+                      : ω_index == 1
+                            ? AllOf(Gt(5.2e-3 * Metre), Lt(9.0 * Metre))
+                            : ω_index == 2
+                                  ? AllOf(Gt(7.0e-3 * Metre), Lt(3.1 * Metre))
+                                  : ω_index == 3 ? AllOf(Gt(1.1e-14 * Metre),
+                                                         Lt(1.7e-10 * Metre))
+                                                 : AllOf(Gt(-1.0e-100 * Metre),
+                                                         Lt(2.4e-14 * Metre)))
           << ω_index;
     }
     if (ω_index == ωs.size()) {


SlitScan: doc

SlitScan: doc

--- SlitScan/SlitScan.cpp
+++ SlitScan/SlitScan.cpp
@@ -115,7 +115,7 @@
 #define kParamRetimeFunctionOptionVerticalSlit "Vertical Slit"
 #define kParamRetimeFunctionOptionVerticalSlitHint "A horizontal ramp (alinear function of x) which is 0 at the center of the leftmost image line, and 1 at the center of the rightmost image line."
 #define kParamRetimeFunctionOptionRetimeMap "Retime Map"
-#define kParamRetimeFunctionOptionRetimeMapHint "The single-channel image from the \"Retime Map\" input."
+#define kParamRetimeFunctionOptionRetimeMapHint "The single-channel image from the \"Retime Map\" input (zero if not connected)."
 #define kParamRetimeFunctionDefault eRetimeFunctionHorizontalSlit
 enum RetimeFunctionEnum {
     eRetimeFunctionHorizontalSlit,


Modified collision box

Modified collision box

--- PC/src/Game.cpp
+++ PC/src/Game.cpp
@@ -260,11 +260,11 @@
 			//		this->_messageLine->ShowText(ss.str(), 1500, vec3(0.9f), vec3(0.7f));
 			//	}
 			//	break;
-		case ActionKeysDebug:
-			debugPaint = !debugPaint;
-			ss << "Debug paint: " << (debugPaint ? "ON" : "OFF");
-			this->_messageLine->ShowText(ss.str(), 1500, vec3(0.9f), vec3(0.7f));
-			break;
+		//case ActionKeysDebug:
+		//	debugPaint = !debugPaint;
+		//	ss << "Debug paint: " << (debugPaint ? "ON" : "OFF");
+		//	this->_messageLine->ShowText(ss.str(), 1500, vec3(0.9f), vec3(0.7f));
+		//	break;
 		case ActionKeysStopRecording:
 			// Dejamos de guardar despus de guardar la pulsacin de la tecla de grabar. As la grabacin
 			// durar hasta el momento en el que se ha pulsado la tecla.
@@ -282,34 +282,34 @@
 				this->_messageLine->ShowText((""), 1, color1, color2);
 			}
 			break;
-		case ActionKeysNextScreen:
-			if (this->_currentStatus == "Stage") {
-				map<string, IGameState*>::iterator it = _states.find(_currentStatus);
-				if (it != _states.end()) {
-					IGameState *state = it->second;
-					Stage* s = (Stage*)state;
-					int nextIdx = s->RoomIndex + 1;
-					if (nextIdx < (int)s->Rooms.size()) {
-						s->GoToRoom(nextIdx);
-						this->_messageLine->ShowText("Next room", 1500, color1, color2);
-					}
-				}
-			}
-			break;
-		case ActionKeysPreviousScreen:
-			if (this->_currentStatus == "Stage") {
-				map<string, IGameState*>::iterator it = _states.find(_currentStatus);
-				if (it != _states.end()) {
-					IGameState *state = it->second;
-					Stage* s = (Stage*)state;
-					int nextIdx = s->RoomIndex - 1;
-					if (nextIdx >= 0) {
-						s->GoToRoom(nextIdx);
-						this->_messageLine->ShowText("Previous room", 1500, color1, color2);
-					}
-				}
-			}
-			break;
+		//case ActionKeysNextScreen:
+		//	if (this->_currentStatus == "Stage") {
+		//		map<string, IGameState*>::iterator it = _states.find(_currentStatus);
+		//		if (it != _states.end()) {
+		//			IGameState *state = it->second;
+		//			Stage* s = (Stage*)state;
+		//			int nextIdx = s->RoomIndex + 1;
+		//			if (nextIdx < (int)s->Rooms.size()) {
+		//				s->GoToRoom(nextIdx);
+		//				this->_messageLine->ShowText("Next room", 1500, color1, color2);
+		//			}
+		//		}
+		//	}
+		//	break;
+		//case ActionKeysPreviousScreen:
+		//	if (this->_currentStatus == "Stage") {
+		//		map<string, IGameState*>::iterator it = _states.find(_currentStatus);
+		//		if (it != _states.end()) {
+		//			IGameState *state = it->second;
+		//			Stage* s = (Stage*)state;
+		//			int nextIdx = s->RoomIndex - 1;
+		//			if (nextIdx >= 0) {
+		//				s->GoToRoom(nextIdx);
+		//				this->_messageLine->ShowText("Previous room", 1500, color1, color2);
+		//			}
+		//		}
+		//	}
+		//	break;
 		case ActionKeysToggleInertia:
 			this->_stage->Player->toggleInertia();
 			ss << "Inertia: " << (this->_stage->Player->hasInertia() ? "ON" : "OFF - Really??");


more family filter fixes

more family filter fixes

--- PageResults.cpp
+++ PageResults.cpp
@@ -285,6 +285,9 @@
 		// show gigabits?
 		long gb = hr->getLong("gigabits",0);
 		if ( gb >= 1 ) sb.safePrintf("&gigabits=%li",gb);
+		// forward the "ff" family filter as well
+		long ff = hr->getLong("ff",0);
+		if ( ff ) sb.safePrintf("&ff=%li",ff);
 		// provide hash of the query so clients can't just pass in
 		// a bogus id to get search results from us
 		unsigned long h32 = hash32n(qstr);


~ fixed Spawn Active applying more Spawns than Waves

--- Source/GA/GAWaves.cpp
+++ Source/GA/GAWaves.cpp
@@ -59,7 +59,7 @@

 void AGAWaves::SetSpawnActive(){
 	if (Role == ROLE_Authority){
-		if (SpawnTimer >= NextSpawnActiveTimer && !IsSpawnSetActive){
+		if (SpawnTimer >= NextSpawnActiveTimer && !IsSpawnSetActive && SpawnWaveIndex <= Waves.Num() - 1){
 			// Use a random Spawnlocation
 			RandIndex = FMath::RandRange(0, EnemySpawns.Num() - 1);
 			((AGAEnemySpawn*)EnemySpawns[RandIndex])->SetSpawnActivationStatusTo(true);


fix latitude calculations.

fix latitude calculations.

--- Source/VectorTile.cpp
+++ Source/VectorTile.cpp
@@ -264,25 +264,31 @@
 // *********************************************

 // https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#C.2FC.2B.2B
-int long2tilex(double lon, int z)
-{
-	return (int)(floor((lon + 180.0) / 360.0 * pow(2.0, z)));
+int long2tilex(double lon, int z)
+{
+	return (int)(floor((lon + 180.0) / 360.0 * pow(2.0, z)));
 }

 int lat2tiley(double lat, int z)
-{
-	return (int)(floor((1.0 - log( tan(lat * M_PI/180.0) + 1.0 / cos(lat * M_PI/180.0)) / M_PI) / 2.0 * pow(2.0, z)));
-}
-
-double tilex2long(int x, int z)
+{
+	int y = (int)(floor((1.0 - log( tan(lat * M_PI/180.0) + 1.0 / cos(lat * M_PI/180.0)) / M_PI) / 2.0 * pow(2.0, z)));
+	int ymax  = 1 << z;
+	y = ymax - y - 1;
+	return y;
+}
+
+double tilex2long(int x, int z)
 {
 	return x / pow(2.0, z) * 360.0 - 180;
 }

-double tiley2lat(int y, int z)
-{
-	double n = M_PI - 2.0 * M_PI * y / pow(2.0, z);
-	return 180.0 / M_PI * atan(0.5 * (exp(n) - exp(-n)));
+double tiley2lat(int y, int z)
+{
+	double n = pow(2.0,z);
+	int ymax  = 1 << z;
+	y = ymax - y - 1;
+	double latRad = atan(sinh(M_PI*(1-(2*y/n))));
+	return 180.0 / M_PI * latRad;
 }

 // ***********************************************


Items have the right entityType

Items have the right entityType

--- Swashbuckler/item.cpp
+++ Swashbuckler/item.cpp
@@ -4,6 +4,7 @@
 {
 	name = itemName;
 	description = itemDescription;
+	entityType = item;
 	pickable = isPickable;
 }


Make copy of the TPC parameters (Marian)

--- TPC/AliTPCcalibDB.cxx
+++ TPC/AliTPCcalibDB.cxx
@@ -191,7 +191,7 @@
   if (entry){
     //if (fPadNoise) delete fPadNoise;
     entry->SetOwner(kTRUE);
-    fParam = (AliTPCParam*)entry->GetObject();
+    fParam = (AliTPCParam*)(entry->GetObject()->Clone());
   }


change error to warning in stk

change error to warning in stk

--- Opcodes/stk/stkOpcodes.cpp
+++ Opcodes/stk/stkOpcodes.cpp
@@ -717,8 +717,8 @@
 #endif
     if(!path)
       {
-        csound->ErrorMsg(csound,
-                         Str("Error: define environment variable RAWWAVE_PATH\n"
+        csound->Warning(csound,
+                        Str("STK opodes not available: define environment variable RAWWAVE_PATH\n"
                              "(points to rawwaves directory) to use STK opcodes."));
         return 0;
       }


Fixed another build error

Fixed another build error

--- Permutation.cpp
+++ Permutation.cpp
@@ -80,9 +80,6 @@
         i++;
     } while(std::next_permutation(nums, nums + n));

-    if(i != *count) {
-        printf("ERROR: count != factorial(n).\n");
-    }

     delete [] nums;


MacOS old readline

MacOS old readline

--- V8/v8-line-editor.cpp
+++ V8/v8-line-editor.cpp
@@ -200,7 +200,7 @@
     if (result[0][n-1] == ')') {
       result[0][n-1] = '\0';

-#if RL_READLINE_VERSION < 0x0500
+#if RL_READLINE_VERSION >= 0x0500
       rl_completion_suppress_append = 1;
 #endif
     }


Removed useless check in IPv4Layer::isDataValid

--- Packet++/src/IPv4Layer.cpp
+++ Packet++/src/IPv4Layer.cpp
@@ -558,13 +558,10 @@

 bool IPv4Layer::isDataValid(const uint8_t* data, size_t dataLen)
 {
-	if (dataLen >= 20)
+	if (dataLen >= sizeof(iphdr))
 	{
 		const iphdr* hdr = reinterpret_cast<const iphdr*>(data);
-
-		return hdr->ipVersion == 4
-			&& hdr->internetHeaderLength >= 5
-			&& be16toh(hdr->totalLength) <= 65535;
+		return hdr->ipVersion == 4 && hdr->internetHeaderLength >= 5;
 	}
 	return false;
 }


AliFemto: removal of unwanted file

AliFemto: removal of unwanted file

--- PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2017/Amara/AddTaskFemto.C
+++ PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2017/Amara/AddTaskFemto.C
@@ -1,67 +0,0 @@
-//=============================================================================
-// test
-// *** AddTaskFemto.C ***
-//
-// This macro initialize a complete AnalysisTask object for femtoscopy.
-//
-//=============================================================================
-
-AliAnalysisTaskFemto *AddTaskFemto(const char *configMacroName="ConfigFemtoAnalysis.C", const char *configMacroParameters="" )
-{
-// Creates a proton analysis task and adds it to the analysis manager.
-
-  // A. Get the pointer to the existing analysis manager via the static access method.
-  //==============================================================================
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  if (!mgr) {
-    Error("AddTaskFemto", "No analysis manager to connect to.");
-    return NULL;
-  }
-
-  // B. Check the analysis type using the event handlers connected to the analysis
-  //    manager. The availability of MC handler cann also be checked here.
-  //==============================================================================
-  if (!mgr->GetInputEventHandler()) {
-    ::Error("AddTaskFemto", "This task requires an input event handler");
-    return NULL;
-  }
-  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
-  cout << "Found " <<type << " event handler" << endl;
-
-  // C. Create the task, add it to manager.
-  //===========================================================================
-//  gSystem->SetIncludePath("-I$ROOTSYS/include  -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I$ALICE_ROOT/include");
-
-  if (TProofMgr::GetListOfManagers()->GetEntries()) {
-//     if (dynamic_cast<TProofLite *> gProof) {
-//       char *macrocommand[10000];
-//       sprintf(macrocommand, ".L %s", configMacroName);
-//       gProof->Exec(macrocommand);
-//     }
-//     else
-    gProof->Load(configMacroName);
-  }
-  //  gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
-
-  AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName,configMacroParameters);
-  mgr->AddTask(taskfemto);
-
-  // D. Configure the analysis task. Extra parameters can be used via optional
-  // arguments of the AddTaskXXX() function.
-  //===========================================================================
-
-  // E. Create ONLY the output containers for the data produced by the task.
-  // Get and connect other common input/output containers via the manager as below
-  //==============================================================================
-  TString outputfile = AliAnalysisManager::GetCommonFileName();
-  outputfile += ":PWG2FEMTO";
-  AliAnalysisDataContainer *cout_femto  = mgr->CreateContainer("femtolist",  TList::Class(),
-  							       AliAnalysisManager::kOutputContainer,outputfile);
-
-
-   mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
-   mgr->ConnectOutput(taskfemto, 0, cout_femto);
-
-   // Return task pointer at the end
-   return taskfemto;
-}


fix mass cut

fix mass cut

--- PWGLF/RESONANCES/PostProcessing/Xi1530/AliAnalysisTaskXi1530.cxx
+++ PWGLF/RESONANCES/PostProcessing/Xi1530/AliAnalysisTaskXi1530.cxx
@@ -1689,8 +1689,8 @@
                             continue;

                         // Mass window
-                        double massEXO = vecsum2.M();
-                        if (abs(massEXO - massXi1530) > 0.05)
+                        double mXi1530 = vecsum.M();
+                        if (abs(mXi1530 - massXi1530) > 0.05)
                             continue;

                         int sign2 = kData;
@@ -2005,8 +2005,8 @@
                             continue;

                         // Mass window
-                        double massEXO = vecsum2.M();
-                        if (abs(massEXO - massXi1530) > 0.05)
+                        double mXi1530 = vecsum.M();
+                        if (abs(mXi1530 - massXi1530) > 0.05)
                             continue;

                         int sign2 = kMixing;
@@ -2363,8 +2363,8 @@
                             continue;

                         // Mass window
-                        double massEXO = vecsum2.M();
-                        if (abs(massEXO - massXi1530) > 0.05)
+                        double mXi1530 = vecsum.M();
+                        if (abs(mXi1530 - massXi1530) > 0.05)
                             continue;

                         int sign2 = kData;
@@ -2674,8 +2674,8 @@
                             continue;

                         // Mass window
-                        double massEXO = vecsum2.M();
-                        if (abs(massEXO - massXi1530) > 0.05)
+                        double mXi1530 = vecsum.M();
+                        if (abs(mXi1530 - massXi1530) > 0.05)
                             continue;

                         int sign2 = kMixing;


Modified macros for phi analysis: improved pseudorapidity cut flexibility (A.Knospe)

--- PWGLF/RESONANCES/macros/lego_train/AddRsnDaughterCutsPhiNsigma.C
+++ PWGLF/RESONANCES/macros/lego_train/AddRsnDaughterCutsPhiNsigma.C
@@ -1,242 +1,248 @@
-#ifndef __CINT__
-#include <AliRsnCutTrackQuality.h>
-#endif
-Int_t AddRsnDaughterCutsPhiNsigma(AliPID::EParticleType type1,AliPID::EParticleType type2,TString opt,AliRsnInputHandler *rsnIH=0,AliAnalysisTaskSE *task=0)
-{
-
-   if (!rsnIH) return 0;
-
-   Bool_t valid = kTRUE;
-//   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);
-   Int_t useCommonQualityCut = AliRsnTrainManager::GetGlobalInt("RsnCommonQualityCut",valid);
-   TString rsnQualityCut = AliRsnTrainManager::GetGlobalStr("RsnQualityCut",valid);
-   Int_t isMC = AliRsnTrainManager::GetGlobalInt("IsMC",valid);
-   Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);
-   Int_t isMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid);
-
-   // experts only (don't touch)
-   Int_t isRsnDev = AliAnalysisManager::GetGlobalInt("rsnUseRSNParDev",valid);
-
-   // === USER HAS TO SET CORRECT NUMBER OF CUTS SETS =====
-   Int_t numberOfCuts = 1;
-
-   //---------------------------------------------
-   //  Define single cuts
-   //---------------------------------------------
-
-   Printf("AliRsnCutPIDNSigma Option : %s",opt.Data());
-
-   Double_t nSigmaTPC=3.0;
-   Double_t nSigmaTOF=3.0;
-   Double_t etaRange=0.8;
-   Double_t trackPtMin=0.;
-   Double_t trackPtMax=1.e10;
-   Int_t NclTPC=70;
-   Char_t DCAxyFormula[100]="0.0182+0.035/pt^1.01";
-
-   Bool_t useTPC_K=kFALSE;
-   Bool_t useTOF_K=kFALSE;
-   Bool_t useTrackPtCut=kFALSE;
-
-   if (opt.Contains("qualityonly")) {
-      useTPC_K=kFALSE;
-      useTOF_K=kFALSE;
-   } else if (!opt.Contains("nsig")) {
-      useTPC_K=kTRUE;
-      useTOF_K=kTRUE;
-   }
-
-   if (opt.Contains("KTPCnsig"))  useTPC_K=kTRUE;
-   if (opt.Contains("KTOFnsig"))  useTOF_K=kTRUE;
-
-   if (opt.Contains("KTPCnsig05")) nSigmaTPC = 0.5;
-   if (opt.Contains("KTPCnsig08")) nSigmaTPC = 0.8;
-   if (opt.Contains("KTPCnsig10")) nSigmaTPC = 1.0;
-   if (opt.Contains("KTPCnsig15")) nSigmaTPC = 1.5;
-   if (opt.Contains("KTPCnsig20")) nSigmaTPC = 2.0;
-   if (opt.Contains("KTPCnsig25")) nSigmaTPC = 2.5;
-   if (opt.Contains("KTPCnsig30")) nSigmaTPC = 3.0;
-   if (opt.Contains("KTPCnsig40")) nSigmaTPC = 4.0;
-   if (opt.Contains("KTPCnsig50")) nSigmaTPC = 5.0;
-   if (opt.Contains("KTPCnsig1000")) nSigmaTPC = 100.0;
-
-   if (opt.Contains("KTOFnsig10")) nSigmaTOF = 1.0;
-   if (opt.Contains("KTOFnsig15")) nSigmaTOF = 1.5;
-   if (opt.Contains("KTOFnsig20")) nSigmaTOF = 2.0;
-   if (opt.Contains("KTOFnsig25")) nSigmaTOF = 2.5;
-   if (opt.Contains("KTOFnsig30")) nSigmaTOF = 3.0;
-   if (opt.Contains("KTOFnsig1000")) nSigmaTOF = 100.0;
-
-   if (opt.Contains("trackPt")) {
-      useTrackPtCut = kTRUE;
-      if (opt.Contains("trackPtMin015")) trackPtMin = 0.15;
-      if (opt.Contains("trackPtMin02")) trackPtMin = 0.2;
-      if (opt.Contains("trackPtMin05")) trackPtMin = 0.5;
-      if (opt.Contains("trackPtMin06")) trackPtMin = 0.6;
-
-      if (opt.Contains("trackPtMax18")) trackPtMax = 1.8;
-      if (opt.Contains("trackPtMax20")) trackPtMax = 2.0;
-      if (opt.Contains("trackPtMax25")) trackPtMax = 2.5;
-   }
-
-   Bool_t usePDG=kFALSE;
-   if (opt.Contains("pdg")) {
-      Printf("Using PDG");
-      usePDG = kTRUE;
-   }
-
-   Bool_t useEta = kFALSE;
-   if (opt.Contains("eta")) {
-      if(opt.Contains("eta09")) etaRange=0.9;
-      if(opt.Contains("eta08")) etaRange=0.8;
-      if(opt.Contains("eta07")) etaRange=0.7;
-      if(opt.Contains("eta06")) etaRange=0.6;
-      Printf("Using ETA range (%.2f,%.2f)",-etaRange,etaRange);
-      useEta = kTRUE;
-   }
-
-   Bool_t useNclTPC = kFALSE;
-   if (opt.Contains("NclTPC")) {
-      if (opt.Contains("NclTPC70")) NclTPC=70;
-      if (opt.Contains("NclTPC75")) NclTPC=75;
-      if (opt.Contains("NclTPC80")) NclTPC=80;
-      if (opt.Contains("NclTPC85")) NclTPC=85;
-      if (opt.Contains("NclTPC90")) NclTPC=90;
-      useNclTPC = kTRUE;
-   }
-
-   Bool_t useDCAxy = kFALSE;
-   if (opt.Contains("DCAxy")) {
-      if (opt.Contains("DCAxyFormula7s")) sprintf(DCAxyFormula,"0.0182+0.035/pt^1.01");
-      if (opt.Contains("DCAxyFormula6s")) sprintf(DCAxyFormula,"0.0156+0.03/pt^1.01");
-      if (opt.Contains("DCAxyFormula5s")) sprintf(DCAxyFormula,"0.013+0.025/pt^1.01");
-      useDCAxy = kTRUE;
-   }
-
-//---------------------------------------------
-//  Combine cuts
-//---------------------------------------------
-
-   TString cutname = "K_Phi";
-   if (!opt.IsNull()) cutname += Form("_%s",opt.Data());
-   AliRsnCutSet *cuts = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter);
-
-   TString scheme="";
-   AliRsnCutTrackQuality *qualityCut = new AliRsnCutTrackQuality("cutQualityK");
-   if (!rsnQualityCut.IsNull()) {
-      AliESDtrackCuts *esdTK = RsnQualityCut(rsnQualityCut.Data());
-      if(useDCAxy) esdTK->SetMaxDCAToVertexXYPtDep(DCAxyFormula);
-      qualityCut->SetESDtrackCuts(esdTK);
-   } else {
-      if (useCommonQualityCut>=0) {
-         qualityCut->SetAODTestFilterBit(useCommonQualityCut);
-         if(useDCAxy) {qualityCut->SetCheckOnlyFilterBit(kFALSE); qualityCut->SetDCARPtFormula(DCAxyFormula);}
-      } else {
-         qualityCut->SetDefaults2010();
-         if(useDCAxy) qualityCut->SetDCARPtFormula(DCAxyFormula);
-      }
-   }
-
-   cuts->AddCut(qualityCut);
-   if (!scheme.IsNull()) scheme += "&";
-   scheme += qualityCut->GetName();
-
-
-   if (useTPC_K) {
-      AliRsnCutPIDNSigma *cutKTPC = new AliRsnCutPIDNSigma("cutPIDNSigmaTPCK",AliPID::kKaon,AliRsnCutPIDNSigma::kTPC);
-      cutKTPC->SinglePIDRange(nSigmaTPC);
-      cuts->AddCut(cutKTPC);
-      if (!scheme.IsNull()) scheme += "&";
-      scheme += cutKTPC->GetName();
-   }
-
-   if (useTOF_K) {
-      AliRsnCutPIDNSigma *cutKTOF = new AliRsnCutPIDNSigma("cutPIDNSigmaTOFK",AliPID::kKaon,AliRsnCutPIDNSigma::kTOF);
-      cutKTOF->SinglePIDRange(nSigmaTOF);
-      cuts->AddCut(cutKTOF);
-      if (!scheme.IsNull()) scheme += "&";
-      scheme += cutKTOF->GetName();
-   }
-
-   if (useEta) {
-      Printf("Adding ETA ...");
-      AliRsnValueDaughter *valEta = new AliRsnValueDaughter(Form("val%sETA%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kEta);
-      AliRsnCutValue *cutEta = new AliRsnCutValue(Form("cut%sETA%s",AliPID::ParticleName(type1),opt.Data()),-etaRange,etaRange);
-      cutEta->SetTargetType(AliRsnTarget::kDaughter);
-      cutEta->SetValueObj(valEta);
-      cuts->AddCut(cutEta);
-      if (!scheme.IsNull()) scheme += "&";
-      scheme += cutEta->GetName();
-   }
-
-   if (useTrackPtCut) {
-      Printf("Adding Pt min=%.3f max=%.3f ...",trackPtMin,trackPtMax);
-      AliRsnValueDaughter *valTrackPt = new AliRsnValueDaughter(Form("val%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kPt);
-
-      AliRsnCutValue *cutTrackPt = new AliRsnCutValue(Form("cut%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),trackPtMin,trackPtMax);
-      cutTrackPt->SetTargetType(AliRsnTarget::kDaughter);
-      cutTrackPt->SetValueObj(valTrackPt);
-      cuts->AddCut(cutTrackPt);
-      if (!scheme.IsNull()) scheme += "&";
-      scheme += cutTrackPt->GetName();
-   }
-
-   if (useNclTPC) {
-      Printf("Adding NclTPC >= %i",NclTPC);
-      AliRsnValueDaughter *valNclTPC = new AliRsnValueDaughter(Form("val%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kNTPCclusters);
-      AliRsnCutValue *cutNclTPC = new AliRsnCutValue(Form("cut%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),NclTPC-0.1,1000.);
-      cutNclTPC->SetTargetType(AliRsnTarget::kDaughter);
-      cutNclTPC->SetValueObj(valNclTPC);
-      cuts->AddCut(cutNclTPC);
-      if (!scheme.IsNull()) scheme += "&";
-      scheme += cutNclTPC->GetName();
-   }
-
-   if (usePDG) {
-      Printf("Adding PDG ...");
-      AliRsnCutPID *cutPDG = new AliRsnCutPID(Form("cut%sPDG%s",AliPID::ParticleName(type1),opt.Data()),type1,0.0,kTRUE);
-      cuts->AddCut(cutPDG);
-      if (!scheme.IsNull()) scheme += "&";
-      scheme += cutPDG->GetName();
-   }
-
-   Printf ("CUT Scheme is '%s'",scheme.Data());
-   cuts->SetCutScheme(scheme.Data());
-
-   if (opt.Contains("mon")) {
-      AddMonitorOutput(cuts->GetMonitorOutput(),opt);
-   }
-   if (isRsnMini) {
-      AliRsnMiniAnalysisTask *taskRsnMini = (AliRsnMiniAnalysisTask *)task;
-      if (taskRsnMini) {
-         taskRsnMini->AddTrackCuts(cuts);
-      }
-   } else {
-      AliRsnDaughterSelector *sel = rsnIH->GetSelector();
-//       sel->SetLabelCheck(kFALSE);
-      sel->Add(cuts, kTRUE);
-      if (isRsnDev>=0 && opt.Contains("pairPID")) {
-         AliRsnActPostDaughterSelection *pairPID = new AliRsnActPostDaughterSelection();
-         pairPID->SetID(0);
-
-         const char *fn="rsnRange.txt";
-         if (!gSystem->AccessPathName(fn)) {
-            TString minStr = gSystem->GetFromPipe(TString::Format("head -n 1 %s").Data());
-            TString maxStr = gSystem->GetFromPipe(TString::Format("tail -n 1 %s").Data());
-            pairPID->SetMass(minStr.Atof(),maxStr.Atof());
-         } else {
-            //       pairPID->SetMass(1.01,1.03);
-            pairPID->SetMass(1.015,1.025);
-            pairPID->SetMass(1.019,1.021);
-            pairPID->SetMass(1.0195,1.0205);
-            pairPID->SetMass(1.1000,1.1005);
-            //       pairPID->SetMass(1.1005,1.1010);
-         }
-         sel->AddAction(pairPID);
-      }
-
-   }
-   return numberOfCuts;
-
-}
-
+#ifndef __CINT__
+#include <AliRsnCutTrackQuality.h>
+#endif
+Int_t AddRsnDaughterCutsPhiNsigma(AliPID::EParticleType type1,AliPID::EParticleType type2,TString opt,AliRsnInputHandler *rsnIH=0,AliAnalysisTaskSE *task=0)
+{
+
+  if (!rsnIH) return 0;
+
+  Bool_t valid = kTRUE;
+  //   Int_t collisionType = AliRsnTrainManager::GetGlobalInt("IsCollisionType",valid);
+  Int_t useCommonQualityCut = AliRsnTrainManager::GetGlobalInt("RsnCommonQualityCut",valid);
+  TString rsnQualityCut = AliRsnTrainManager::GetGlobalStr("RsnQualityCut",valid);
+  Int_t isMC = AliRsnTrainManager::GetGlobalInt("IsMC",valid);
+  Int_t isRsnMini = AliRsnTrainManager::GetGlobalInt("IsRsnMini",valid);
+  Int_t isMixing = AliRsnTrainManager::GetGlobalInt("IsMixing",valid);
+
+  // experts only (don't touch)
+  Int_t isRsnDev = AliAnalysisManager::GetGlobalInt("rsnUseRSNParDev",valid);
+
+  // === USER HAS TO SET CORRECT NUMBER OF CUTS SETS =====
+  Int_t numberOfCuts = 1;
+
+  //---------------------------------------------
+  //  Define single cuts
+  //---------------------------------------------
+
+  Printf("AliRsnCutPIDNSigma Option : %s",opt.Data());
+
+  Double_t nSigmaTPC=3.0;
+  Double_t nSigmaTOF=3.0;
+  Double_t etaMin=-0.8;
+  Double_t etaMax=0.8;
+  Double_t trackPtMin=0.;
+  Double_t trackPtMax=1.e10;
+  Int_t NclTPC=70;
+  Char_t DCAxyFormula[100]="0.0182+0.035/pt^1.01";
+
+  Bool_t useTPC_K=kFALSE;
+  Bool_t useTOF_K=kFALSE;
+  Bool_t useTrackPtCut=kFALSE;
+
+  if (opt.Contains("qualityonly")) {
+    useTPC_K=kFALSE;
+    useTOF_K=kFALSE;
+  } else if (!opt.Contains("nsig")) {
+    useTPC_K=kTRUE;
+    useTOF_K=kTRUE;
+  }
+
+  if (opt.Contains("KTPCnsig"))  useTPC_K=kTRUE;
+  if (opt.Contains("KTOFnsig"))  useTOF_K=kTRUE;
+
+  if (opt.Contains("KTPCnsig05")) nSigmaTPC = 0.5;
+  if (opt.Contains("KTPCnsig08")) nSigmaTPC = 0.8;
+  if (opt.Contains("KTPCnsig10")) nSigmaTPC = 1.0;
+  if (opt.Contains("KTPCnsig15")) nSigmaTPC = 1.5;
+  if (opt.Contains("KTPCnsig20")) nSigmaTPC = 2.0;
+  if (opt.Contains("KTPCnsig25")) nSigmaTPC = 2.5;
+  if (opt.Contains("KTPCnsig30")) nSigmaTPC = 3.0;
+  if (opt.Contains("KTPCnsig40")) nSigmaTPC = 4.0;
+  if (opt.Contains("KTPCnsig50")) nSigmaTPC = 5.0;
+  if (opt.Contains("KTPCnsig1000")) nSigmaTPC = 100.0;
+
+  if (opt.Contains("KTOFnsig10")) nSigmaTOF = 1.0;
+  if (opt.Contains("KTOFnsig15")) nSigmaTOF = 1.5;
+  if (opt.Contains("KTOFnsig20")) nSigmaTOF = 2.0;
+  if (opt.Contains("KTOFnsig25")) nSigmaTOF = 2.5;
+  if (opt.Contains("KTOFnsig30")) nSigmaTOF = 3.0;
+  if (opt.Contains("KTOFnsig1000")) nSigmaTOF = 100.0;
+
+  if (opt.Contains("trackPt")) {
+    useTrackPtCut = kTRUE;
+    if (opt.Contains("trackPtMin015")) trackPtMin = 0.15;
+    if (opt.Contains("trackPtMin02")) trackPtMin = 0.2;
+    if (opt.Contains("trackPtMin05")) trackPtMin = 0.5;
+    if (opt.Contains("trackPtMin06")) trackPtMin = 0.6;
+
+    if (opt.Contains("trackPtMax18")) trackPtMax = 1.8;
+    if (opt.Contains("trackPtMax20")) trackPtMax = 2.0;
+    if (opt.Contains("trackPtMax25")) trackPtMax = 2.5;
+  }
+
+  Bool_t usePDG=kFALSE;
+  if (opt.Contains("pdg")) {
+    Printf("Using PDG");
+    usePDG = kTRUE;
+  }
+
+  Bool_t useEta = kFALSE;
+  if (opt.Contains("eta")) {
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("eta0%i",j))){etaMin=-0.1*j; etaMax=0.1*j;}
+
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMinMinus0%i",j))) etaMin=-0.1*j;
+    if(opt.Contains("etaMin00")) etaMin=0.;
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMinPlus0%i",j))) etaMin=0.1*j;
+
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMaxMinus0%i",j))) etaMax=-0.1*j;
+    if(opt.Contains("etaMax00")) etaMax=0.;
+    for(int j=1;j<=9;j++) if(opt.Contains(Form("etaMaxPlus0%i",j))) etaMax=0.1*j;
+
+    Printf("Using ETA range (%.2f,%.2f)",etaMin,etaMax);
+    useEta = kTRUE;
+  }
+
+  Bool_t useNclTPC = kFALSE;
+  if (opt.Contains("NclTPC")) {
+    if (opt.Contains("NclTPC70")) NclTPC=70;
+    if (opt.Contains("NclTPC75")) NclTPC=75;
+    if (opt.Contains("NclTPC80")) NclTPC=80;
+    if (opt.Contains("NclTPC85")) NclTPC=85;
+    if (opt.Contains("NclTPC90")) NclTPC=90;
+    useNclTPC = kTRUE;
+  }
+
+  Bool_t useDCAxy = kFALSE;
+  if (opt.Contains("DCAxy")) {
+    if (opt.Contains("DCAxyFormula7s")) sprintf(DCAxyFormula,"0.0182+0.035/pt^1.01");
+    if (opt.Contains("DCAxyFormula6s")) sprintf(DCAxyFormula,"0.0156+0.03/pt^1.01");
+    if (opt.Contains("DCAxyFormula5s")) sprintf(DCAxyFormula,"0.013+0.025/pt^1.01");
+    useDCAxy = kTRUE;
+  }
+
+  //---------------------------------------------
+  //  Combine cuts
+  //---------------------------------------------
+
+  TString cutname = "K_Phi";
+  if (!opt.IsNull()) cutname += Form("_%s",opt.Data());
+  AliRsnCutSet *cuts = new AliRsnCutSet(cutname.Data(), AliRsnTarget::kDaughter);
+
+  TString scheme="";
+  AliRsnCutTrackQuality *qualityCut = new AliRsnCutTrackQuality("cutQualityK");
+  if (!rsnQualityCut.IsNull()) {
+    AliESDtrackCuts *esdTK = RsnQualityCut(rsnQualityCut.Data());
+    if(useDCAxy) esdTK->SetMaxDCAToVertexXYPtDep(DCAxyFormula);
+    qualityCut->SetESDtrackCuts(esdTK);
+  } else {
+    if (useCommonQualityCut>=0) {
+      qualityCut->SetAODTestFilterBit(useCommonQualityCut);
+      if(useDCAxy) {qualityCut->SetCheckOnlyFilterBit(kFALSE); qualityCut->SetDCARPtFormula(DCAxyFormula);}
+    } else {
+      qualityCut->SetDefaults2010();
+      if(useDCAxy) qualityCut->SetDCARPtFormula(DCAxyFormula);
+    }
+  }
+
+  cuts->AddCut(qualityCut);
+  if (!scheme.IsNull()) scheme += "&";
+  scheme += qualityCut->GetName();
+
+
+  if (useTPC_K) {
+    AliRsnCutPIDNSigma *cutKTPC = new AliRsnCutPIDNSigma("cutPIDNSigmaTPCK",AliPID::kKaon,AliRsnCutPIDNSigma::kTPC);
+    cutKTPC->SinglePIDRange(nSigmaTPC);
+    cuts->AddCut(cutKTPC);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutKTPC->GetName();
+  }
+
+  if (useTOF_K) {
+    AliRsnCutPIDNSigma *cutKTOF = new AliRsnCutPIDNSigma("cutPIDNSigmaTOFK",AliPID::kKaon,AliRsnCutPIDNSigma::kTOF);
+    cutKTOF->SinglePIDRange(nSigmaTOF);
+    cuts->AddCut(cutKTOF);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutKTOF->GetName();
+  }
+
+  if (useEta) {
+    Printf("Adding ETA ...");
+    AliRsnValueDaughter *valEta = new AliRsnValueDaughter(Form("val%sETA%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kEta);
+    AliRsnCutValue *cutEta = new AliRsnCutValue(Form("cut%sETA%s",AliPID::ParticleName(type1),opt.Data()),etaMin,etaMax);
+    cutEta->SetTargetType(AliRsnTarget::kDaughter);
+    cutEta->SetValueObj(valEta);
+    cuts->AddCut(cutEta);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutEta->GetName();
+  }
+
+  if (useTrackPtCut) {
+    Printf("Adding Pt min=%.3f max=%.3f ...",trackPtMin,trackPtMax);
+    AliRsnValueDaughter *valTrackPt = new AliRsnValueDaughter(Form("val%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kPt);
+
+    AliRsnCutValue *cutTrackPt = new AliRsnCutValue(Form("cut%sTrackPt%s",AliPID::ParticleName(type1),opt.Data()),trackPtMin,trackPtMax);
+    cutTrackPt->SetTargetType(AliRsnTarget::kDaughter);
+    cutTrackPt->SetValueObj(valTrackPt);
+    cuts->AddCut(cutTrackPt);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutTrackPt->GetName();
+  }
+
+  if (useNclTPC) {
+    Printf("Adding NclTPC >= %i",NclTPC);
+    AliRsnValueDaughter *valNclTPC = new AliRsnValueDaughter(Form("val%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),AliRsnValueDaughter::kNTPCclusters);
+    AliRsnCutValue *cutNclTPC = new AliRsnCutValue(Form("cut%sNclTPC%s",AliPID::ParticleName(type1),opt.Data()),NclTPC-0.1,1000.);
+    cutNclTPC->SetTargetType(AliRsnTarget::kDaughter);
+    cutNclTPC->SetValueObj(valNclTPC);
+    cuts->AddCut(cutNclTPC);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutNclTPC->GetName();
+  }
+
+  if (usePDG) {
+    Printf("Adding PDG ...");
+    AliRsnCutPID *cutPDG = new AliRsnCutPID(Form("cut%sPDG%s",AliPID::ParticleName(type1),opt.Data()),type1,0.0,kTRUE);
+    cuts->AddCut(cutPDG);
+    if (!scheme.IsNull()) scheme += "&";
+    scheme += cutPDG->GetName();
+  }
+
+  Printf ("CUT Scheme is '%s'",scheme.Data());
+  cuts->SetCutScheme(scheme.Data());
+
+  if (opt.Contains("mon")) {
+    AddMonitorOutput(cuts->GetMonitorOutput(),opt);
+  }
+  if (isRsnMini) {
+    AliRsnMiniAnalysisTask *taskRsnMini = (AliRsnMiniAnalysisTask *)task;
+    if (taskRsnMini) {
+      taskRsnMini->AddTrackCuts(cuts);
+    }
+  } else {
+    AliRsnDaughterSelector *sel = rsnIH->GetSelector();
+    //       sel->SetLabelCheck(kFALSE);
+    sel->Add(cuts, kTRUE);
+    if (isRsnDev>=0 && opt.Contains("pairPID")) {
+      AliRsnActPostDaughterSelection *pairPID = new AliRsnActPostDaughterSelection();
+      pairPID->SetID(0);
+
+      const char *fn="rsnRange.txt";
+      if (!gSystem->AccessPathName(fn)) {
+	TString minStr = gSystem->GetFromPipe(TString::Format("head -n 1 %s").Data());
+	TString maxStr = gSystem->GetFromPipe(TString::Format("tail -n 1 %s").Data());
+	pairPID->SetMass(minStr.Atof(),maxStr.Atof());
+      } else {
+	//       pairPID->SetMass(1.01,1.03);
+	pairPID->SetMass(1.015,1.025);
+	pairPID->SetMass(1.019,1.021);
+	pairPID->SetMass(1.0195,1.0205);
+	pairPID->SetMass(1.1000,1.1005);
+	//       pairPID->SetMass(1.1005,1.1010);
+      }
+      sel->AddAction(pairPID);
+    }
+
+  }
+  return numberOfCuts;
+
+}


Fill helper histo

Fill helper histo

--- PWGLF/STRANGENESS/Cascades/Run2/AliAnalysisTaskMCPredictions.cxx
+++ PWGLF/STRANGENESS/Cascades/Run2/AliAnalysisTaskMCPredictions.cxx
@@ -1028,6 +1028,7 @@
         if( lCheckHFFeeddown[ih] == kTRUE && AliVertexingHFUtils::CheckOrigin(lMCevent, lMCPart, kTRUE)!=4 ) continue;
         //Fill Histograms
         if(fHistEta[ih] && lDistanceFromZero > 1e-12 ) fHistEta[ih] -> Fill ( lPart -> Eta() );
+        if(fHistEtaTriggeredMeson[ih] && lNXiC > 0 && lDistanceFromZero > 1e-12 ) fHistEtaTriggeredMeson[ih] -> Fill ( lPart -> Eta(), lThisPt );
         if(fHistEtaTriggeredCharm[ih] && lNXiC > 0 && lDistanceFromZero > 1e-12 ) fHistEtaTriggeredCharm[ih] -> Fill ( lPart -> Eta(), lThisPt );
         if(fHistEtaTriggeredBeauty[ih] && lNXiB > 0 && lDistanceFromZero > 1e-12 ) fHistEtaTriggeredBeauty[ih] -> Fill ( lPart -> Eta(), lThisPt );
         if(fHistEtaVsSPDMult[ih]) fHistEtaVsSPDMult[ih] -> Fill( lNchEtaWide, lPart -> Eta() );