Updated a comment in the `filesystem/linux` isolator.

--- src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
+++ src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
@@ -763,8 +763,10 @@
       }
     }

-    // If `namespaces/ipc` isolator is not enabled, /dev/shm will be
-    // handled there.
+    // If `namespaces/ipc` isolator is not enabled, for backward compatibility
+    // we will keep the previous behavior: if the container has its own rootfs,
+    // it will have its own /dev/shm, otherwise it will share agent's /dev/shm.
+    // If `namespaces/ipc` isolator is enabled, /dev/shm will be handled there.
     if (!strings::contains(flags.isolation, "namespaces/ipc")) {
       *launchInfo.add_mounts() = createContainerMount(
           "tmpfs",


I guess K&R is GNU K&R

I guess K&R is GNU K&R

--- elsa/cc_lang.cc
+++ elsa/cc_lang.cc
@@ -41,6 +41,9 @@
   allowCallToUndeclFunc = true;
   allow_KR_ParamOmit = true;
   allowImplicitInt = true;
+
+  // our K&R is really GNU K&R ...
+  declareGNUBuiltins = true;
 }

 void CCLang::ANSI_C99()


Add consts and remove some unnecessary local variables in direct driver

--- src/sparql/drivers/tracker_direct/qsparql_tracker_direct.cpp
+++ src/sparql/drivers/tracker_direct/qsparql_tracker_direct.cpp
@@ -108,7 +108,7 @@
         break;
     case TRACKER_SPARQL_VALUE_TYPE_BOOLEAN:
     {
-        bool isTrue = (qstrcmp(value, "1") == 0 || qstricmp(value, "true") == 0);
+        const bool isTrue = (qstrcmp(value, "1") == 0 || qstricmp(value, "true") == 0);
         return QVariant(isTrue);
     }
     default:
@@ -120,7 +120,7 @@

 QVariant readVariant(TrackerSparqlCursor* cursor, int col)
 {
-    TrackerSparqlValueType type =
+    const TrackerSparqlValueType type =
         tracker_sparql_cursor_get_value_type(cursor, col);
     glong len;
     const gchar* data = tracker_sparql_cursor_get_string(cursor, col, &len);
@@ -378,10 +378,9 @@
                                                     &error );
     if (error != 0 || d->cursor == 0) {
         QMutexLocker resultLocker(&(d->resultMutex));
-        QSparqlError e(QString::fromUtf8(error ? error->message : "unknown error"),
+        setLastError(QSparqlError(QString::fromUtf8(error ? error->message : "unknown error"),
                         QSparqlError::StatementError,
-                        error ? error->code : -1);
-        setLastError(e);
+                        error ? error->code : -1));
         if (error)
             g_error_free(error);
         qWarning() << "QTrackerDirectResult:" << lastError() << query();
@@ -400,11 +399,10 @@
     gboolean active = tracker_sparql_cursor_next(d->cursor, 0, &error);

     if (error != 0) {
-        QSparqlError e(QString::fromUtf8(error->message),
+        setLastError(QSparqlError(QString::fromUtf8(error->message),
                        errorCodeToType(error->code),
-                       error->code);
+                       error->code));
         g_error_free(error);
-        setLastError(e);
         qWarning() << "QTrackerDirectResult:" << lastError() << query();
         terminate();
         return false;
@@ -417,7 +415,7 @@

     QMutexLocker resultLocker(&(d->resultMutex));

-    gint n_columns = tracker_sparql_cursor_get_n_columns(d->cursor);
+    const gint n_columns = tracker_sparql_cursor_get_n_columns(d->cursor);

     if (d->columnNames.empty()) {
         for (int i = 0; i < n_columns; i++) {
@@ -446,11 +444,10 @@
     GError * error = 0;
     tracker_sparql_cursor_next(d->cursor, 0, &error);
     if (error != 0) {
-        QSparqlError e(QString::fromUtf8(error->message),
+        setLastError(QSparqlError(QString::fromUtf8(error->message),
                        errorCodeToType(error->code),
-                       error->code);
+                       error->code));
         g_error_free(error);
-        setLastError(e);
         qWarning() << "QTrackerDirectResult:" << lastError() << query();
         terminate();
         return false;
@@ -460,7 +457,7 @@

     if (tracker_sparql_cursor_get_n_columns(d->cursor) == 1)  {
         QString value = QString::fromUtf8(tracker_sparql_cursor_get_string(d->cursor, 0, 0));
-        TrackerSparqlValueType type = tracker_sparql_cursor_get_value_type(d->cursor, 0);
+        const TrackerSparqlValueType type = tracker_sparql_cursor_get_value_type(d->cursor, 0);

         if (    type == TRACKER_SPARQL_VALUE_TYPE_BOOLEAN
                 && (value == QLatin1String("1") || value.toLower() == QLatin1String("true")) )
@@ -488,7 +485,7 @@
     // A special case: we store TRACKER_SPARQL_VALUE_TYPE_INTEGER as longlong,
     // but its data type uri should be xsd:integer. Set it manually here.
     QSparqlBinding b;
-    QVariant value = d->results[pos()][field];
+    const QVariant& value = d->results[pos()][field];
     if (value.type() == QVariant::LongLong) {
         b.setValue(value.toString(), *XSD::Integer());
     }
@@ -747,10 +744,9 @@
     GError * error = 0;
     d->cursor = tracker_sparql_connection_query(d->driverPrivate->connection, query().toUtf8().constData(), 0, &error);
     if (error != 0 || d->cursor == 0) {
-        QSparqlError e(QString::fromUtf8(error ? error->message : "unknown error"),
+        setLastError(QSparqlError(QString::fromUtf8(error ? error->message : "unknown error"),
                         QSparqlError::StatementError,
-                        error ? error->code : -1);
-        setLastError(e);
+                        error ? error->code : -1));
         if (error != 0)
             g_error_free(error);
         qWarning() << "QTrackerDirectSyncResult:" << lastError() << query();
@@ -768,11 +764,10 @@
     GError * error = 0;
     tracker_sparql_connection_update(d->driverPrivate->connection, query().toUtf8().constData(), 0, 0, &error);
     if (error != 0) {
-        QSparqlError e(QString::fromUtf8(error->message),
+        setLastError(QSparqlError(QString::fromUtf8(error->message),
                         errorCodeToType(error->code),
-                        error->code);
+                        error->code));
         g_error_free(error);
-        setLastError(e);
         qWarning() << "QTrackerDirectSyncResult:" << lastError() << query();
     }
 }
@@ -783,14 +778,13 @@
         return false;

     GError * error = 0;
-    gboolean active = tracker_sparql_cursor_next(d->cursor, 0, &error);
+    const gboolean active = tracker_sparql_cursor_next(d->cursor, 0, &error);

     if (error != 0) {
-        QSparqlError e(QString::fromUtf8(error->message),
+        setLastError(QSparqlError(QString::fromUtf8(error->message),
                        errorCodeToType(error->code),
-                       error->code);
+                       error->code));
         g_error_free(error);
-        setLastError(e);
         qWarning() << "QTrackerDirectSyncResult:" << lastError() << query();
         g_object_unref(d->cursor);
         d->cursor = 0;
@@ -803,7 +797,7 @@
         updatePos(QSparql::AfterLastRow);
         return false;
     }
-    int oldPos = pos();
+    const int oldPos = pos();
     if (oldPos == QSparql::BeforeFirstRow)
         updatePos(0);
     else
@@ -842,7 +836,7 @@
         return QSparqlBinding();

     const gchar* name = tracker_sparql_cursor_get_variable_name(d->cursor, i);
-    QVariant value = readVariant(d->cursor, i);
+    const QVariant& value = readVariant(d->cursor, i);

     // A special case: we store TRACKER_SPARQL_VALUE_TYPE_INTEGER as longlong,
     // but its data type uri should be xsd:integer. Set it manually here.


Fix test

Fix test

--- test/test_parse.cpp
+++ test/test_parse.cpp
@@ -9,7 +9,7 @@
         std::string data = "";

         data += "main =>\n";
-        data += "    40 + 2";
+        data += "    40 + 2\n";

         parser.parse("test.nolang", data);


reading from RecoParam low and high amplitudes to be taken into account

--- T0/AliT0Reconstructor.cxx
+++ T0/AliT0Reconstructor.cxx
@@ -290,7 +290,8 @@
       low[i0] = Int_t (GetRecoParam()->GetLow(i0));
       high[i0] = Int_t (GetRecoParam()->GetHigh(i0));
       }
-
+  Float_t lowAmpThreshold =  GetRecoParam()->GetLow(200);
+  Float_t highAmpThreshold =  GetRecoParam()->GetHigh(200);
   Double32_t besttimeA=9999999;
   Double32_t besttimeC=9999999;
   Int_t pmtBestA=99999;
@@ -437,7 +438,7 @@
        }
        fESDTZEROfriend->SetT0timeCorr(noncalibtime) ;
        for (Int_t ipmt=0; ipmt<12; ipmt++){
-	 if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>0.1 )
+	 if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>lowAmpThreshold  && adc[ipmt]<highAmpThreshold)
 	   {
 	     if(time[ipmt]<besttimeC){
 		  besttimeC=time[ipmt]; //timeC
@@ -447,7 +448,7 @@
        }
        for ( Int_t ipmt=12; ipmt<24; ipmt++)
 	 {
-	   if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>0.1)
+	   if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>lowAmpThreshold && adc[ipmt]<highAmpThreshold)
 	     {
 	       if(time[ipmt]<besttimeA) {
 		 besttimeA=time[ipmt]; //timeA


Fix missed <memory> header in utility

Fix missed <memory> header in utility

--- TIMLE/Include/utility.hpp
+++ TIMLE/Include/utility.hpp
@@ -2,6 +2,7 @@
 #define UTILITY_HPP

 #include <iterator>
+#include <memory>
 #include <sstream>
 #include <utility>
 #include <vector>


Fix Lambda Integration Tests

Fix Lambda Integration Tests

Lambda no longer support NodeJS 4.3 runtime, recommended runtime version is 8.10.

--- aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp
+++ aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp
@@ -267,14 +267,14 @@

         functionCode.SetZipFile(Aws::Utils::ByteBuffer((unsigned char*)buffer.str().c_str(), buffer.str().length()));
         createFunctionRequest.SetCode(functionCode);
-        createFunctionRequest.SetRuntime(Aws::Lambda::Model::Runtime::nodejs4_3);
+        createFunctionRequest.SetRuntime(Aws::Lambda::Model::Runtime::nodejs8_10);

         CreateFunctionOutcome createFunctionOutcome = m_client->CreateFunction(createFunctionRequest);
         ASSERT_TRUE(createFunctionOutcome.IsSuccess());
         ASSERT_EQ(functionName,createFunctionOutcome.GetResult().GetFunctionName());
         ASSERT_EQ("test.handler",createFunctionOutcome.GetResult().GetHandler());
         ASSERT_EQ(roleARN,createFunctionOutcome.GetResult().GetRole());
-        ASSERT_EQ(Aws::Lambda::Model::Runtime::nodejs4_3, createFunctionOutcome.GetResult().GetRuntime());
+        ASSERT_EQ(Aws::Lambda::Model::Runtime::nodejs8_10, createFunctionOutcome.GetResult().GetRuntime());
         functionArnMapping[functionName] = createFunctionOutcome.GetResult().GetFunctionArn();

         WaitForFunctionStatus(functionName, ResourceStatusType::READY);
@@ -414,7 +414,7 @@
     EXPECT_TRUE(getFunctionOutcome.IsSuccess());

     GetFunctionResult getFunctionResult = getFunctionOutcome.GetResult();
-    EXPECT_EQ(Runtime::nodejs4_3, getFunctionResult.GetConfiguration().GetRuntime());
+    EXPECT_EQ(Runtime::nodejs8_10, getFunctionResult.GetConfiguration().GetRuntime());
     EXPECT_EQ("test.handler",getFunctionResult.GetConfiguration().GetHandler());
     EXPECT_EQ(simpleFunctionName,getFunctionResult.GetConfiguration().GetFunctionName());
     //Just see that is looks like an aws url
@@ -432,7 +432,7 @@
     EXPECT_TRUE(getFunctionConfigurationOutcome.IsSuccess());

     GetFunctionConfigurationResult getFunctionConfigurationResult = getFunctionConfigurationOutcome.GetResult();
-    EXPECT_EQ(Runtime::nodejs4_3, getFunctionConfigurationResult.GetRuntime());
+    EXPECT_EQ(Runtime::nodejs8_10, getFunctionConfigurationResult.GetRuntime());
     EXPECT_EQ("test.handler",getFunctionConfigurationResult.GetHandler());
     EXPECT_EQ(simpleFunctionName,getFunctionConfigurationResult.GetFunctionName());
 }


Use resize

Use resize

--- pybind_interface/pybind_main.cpp
+++ pybind_interface/pybind_main.cpp
@@ -594,7 +594,7 @@
     // Aggregate expectation values for noisy circuits.
     for (unsigned i = 0; i < opsums_and_qubit_counts.size(); ++i) {
       auto& counts = std::get<1>(opsums_and_qubit_counts[i]);
-      results[i] = std::vector<std::complex<double>>(counts.size(), 0);
+      results[i].resize(counts.size(), 0);
     }
     for (unsigned rep = 0; rep < helper.noisy_reps; ++rep) {
       // Init outside of simulation to enable stepping.


Mise à jour du test avec le titre du morceau

--- test/test_track.cpp
+++ test/test_track.cpp
@@ -14,8 +14,9 @@
   ContextData data(artist, album, 0.5);
   //cout << data.getArtistName() << endl;
   SignalData sign(0.2,0.3,0.4);
-  Track test(1, sign ,data);
+  Track test(1, "Seven Nations Army", sign ,data);
   cout << "Track id : " << test.getId() << endl;
+  cout << "Track Title : " << test.getTitle() << endl;
   cout << "Artist id : " << test.getContextData().getArtist().getId() << endl;
   cout << "Artist name : " <<  test.getContextData().getArtist().getName() << endl;
   cout << "Artist familiarity : " << test.getContextData().getArtist().getFamiliarity() << endl;


Корректировки в пакете текстового диалога.

--- OrionUO/Network/Packets.cpp
+++ OrionUO/Network/Packets.cpp
@@ -660,11 +660,11 @@
 	WriteUInt8(0xAC);
 	WriteUInt16BE(size);
 	WriteUInt32BE(gump->Serial);
-	WriteUInt8(gump->Variant);
 	WriteUInt8(gump->ButtonID);
+	WriteUInt8(0);
 	WriteUInt8(code ? 0x01 : 0x00);

-	WriteUInt16BE(len);
+	WriteUInt16BE(len + 1);

 	WriteString(entry->c_str(), len);
 }


Привел в нормальное состояние функцию для расчета смещений анимации персонажей при перемещении.

--- OrionUO/Walker/WalkData.cpp
+++ OrionUO/Walker/WalkData.cpp
@@ -11,59 +11,57 @@
 //----------------------------------------------------------------------------------
 void CWalkData::GetOffset(float &x, float &y, float &steps)
 {
-	uchar dir = m_Direction + 1;
-
 	float step_NESW_D = 44.0f / steps; //NW NE SW SE
 	float step_NESW = 22.0f / steps; //N E S W

-	switch (dir & 7)
+	switch (m_Direction & 7)
 	{
-		case 0: //NW
-		{
-			x = 0.0f;
-			y *= -step_NESW_D;
-			break;
-		}
-		case 1: //N
+		case 0: //W
 		{
 			x *= step_NESW;
 			y *= -step_NESW;
 			break;
 		}
-		case 2: //NE
+		case 1: //NW
 		{
 			x *= step_NESW_D;
 			y = 0.0f;
 			break;
 		}
-		case 3: //E
+		case 2: //N
 		{
 			x *= step_NESW;
 			y *= step_NESW;
 			break;
 		}
-		case 4: //SE
+		case 3: //NE
 		{
 			x = 0.0f;
 			y *= step_NESW_D;
 			break;
 		}
-		case 5: //S
+		case 4: //E
 		{
 			x *= -step_NESW;
 			y *= step_NESW;
 			break;
 		}
-		case 6: //SW
+		case 5: //SE
 		{
 			x *= -step_NESW_D;
 			y = 0.0f;
 			break;
 		}
-		case 7: //W
+		case 6: //S
 		{
 			x *= -step_NESW;
 			y *= -step_NESW;
+			break;
+		}
+		case 7: //SW
+		{
+			x = 0.0f;
+			y *= -step_NESW_D;
 			break;
 		}
 		default:


bug fix using the v0 time offset

bug fix using the v0 time offset

--- PWG0/AliTriggerAnalysis.cxx
+++ PWG0/AliTriggerAnalysis.cxx
@@ -585,7 +585,6 @@
       Float_t correctedTime = V0CorrectLeadingTime(i, esdV0->GetTime(i), esdV0->GetAdc(i));
       Float_t timeWeight = V0LeadingTimeWeight(esdV0->GetAdc(i));
       time += correctedTime*timeWeight;
-      time += fV0TimeOffset;

       weight += timeWeight;
     }
@@ -593,6 +592,7 @@

   if (weight > 0)
     time /= weight;
+  time += fV0TimeOffset;

   if (fillHists)
   {


fix warning

fix warning

--- test/unit_tests.cpp
+++ test/unit_tests.cpp
@@ -127,6 +127,7 @@

 class HackXmlGeneratorListener : public ::iutest::DefaultXmlGeneratorListener
 {
+    HackXmlGeneratorListener() : ::iutest::DefaultXmlGeneratorListener("") {}
 public:
     using DefaultXmlGeneratorListener::EscapeXmlAttribute;
     using DefaultXmlGeneratorListener::EscapeXmlText;


Removed datTest.cpp From Main/

Removed datTest.cpp From Main/

There's a backup in Plugins/datTest/

--- Plugins/datTest/datTest.cpp
+++ Plugins/datTest/datTest.cpp
@@ -1,65 +0,0 @@
-// "Walk Of Life" Data Structure Test
-//Only ever include the data structure - insures only registered plugins work
-#include "dataStructure.h"
-#include <random>
-#include <iostream>
-using namespace std;
-
-int main()
-{
-    //Random number stuff
-    random_device seed;
-    mt19937 gen(seed());
-    uniform_real_distribution<double> randRange(0.0, 500.0);
-
-    cout << "/////////////////////// Bin tests ///////////////////////\n";
-    cout << "byType tests:\n";
-    Bin bin(500, 500, 50);
-
-    //Make 100 random dogs and flowers
-    for(int numOfNodes = 0; numOfNodes < 100; ++numOfNodes)
-    {
-        bin.insert(new Flower(randRange(gen), randRange(gen)));
-        bin.insert(new Dog(randRange(gen), randRange(gen)));
-    }
-
-    //Make every dog bark
-    cout << "Doggie Chior:\n";
-    for(const Dog& dog : bin.getAllOfType<Dog>())
-        dog.bark();
-
-    //Change somethings about every flower
-    for(Flower& flower : bin.getAllOfType<Flower>())
-    {
-        flower.thingy = 1;
-        flower.otherThingy();
-        //bin.remove(&flower);
-    }
-
-    //Check all flowers
-    cout << "\nFlower values:\n";
-    for(const Flower& flower : bin.getAllOfType<Flower>())
-    {
-        cout << flower.thingy << " ";
-        cout << flower.thingy2 << " ";
-    }
-    cout << endl;
-
-    cout << "\nbyLocal tests:\n";
-
-    Flower* myHeapFlower = new Flower(100, 100);
-    bin.insert(myHeapFlower);
-    //bin.remove(myHeapFlower);
-
-    //Make 100 random dogs and flowers
-    for(int numOfNodes = 0; numOfNodes < 100; ++numOfNodes)
-    {
-        bin.insert(new Flower(randRange(gen), randRange(gen)));
-        bin.insert(new Dog(randRange(gen), randRange(gen)));
-    }
-
-    auto thingything = bin.getNear(myHeapFlower);
-    cout << "Nearby flowers: " << thingything.size() << endl;
-
-    cout << "All done!\n";
-}


INTEGRATION: CWS warnings01 (1.3.16); FILE MERGED 2005/09/23 02:08:41 sb 1.3.16.2: RESYNC: (1.3-1.4); FILE MERGED 2005/09/09 15:31:19 sb 1.3.16.1: #i53898# Made code warning-free.

--- pyuno/source/module/pyuno_gc.cxx
+++ pyuno/source/module/pyuno_gc.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: pyuno_gc.cxx,v $
  *
- *  $Revision: 1.4 $
+ *  $Revision: 1.5 $
  *
- *  last change: $Author: rt $ $Date: 2005-09-08 16:52:36 $
+ *  last change: $Author: hr $ $Date: 2006-06-20 05:03:48 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -32,8 +32,8 @@
  *    MA  02111-1307  USA
  *
  ************************************************************************/
+#include <pyuno_impl.hxx>
 #include <osl/thread.hxx>
-#include <pyuno_impl.hxx>
 namespace pyuno
 {

@@ -63,7 +63,7 @@

 GCThread::GCThread( PyInterpreterState *interpreter, PyObject * object ) :
-    mPyInterpreter( interpreter ), mPyObject( object )
+    mPyObject( object ), mPyInterpreter( interpreter )
 {}

 void GCThread::run()
@@ -73,7 +73,7 @@
         return;
     try
     {
-        PyThreadAttach guard( (PyInterpreterState*)mPyInterpreter );
+        PyThreadAttach g( (PyInterpreterState*)mPyInterpreter );
         {
             Runtime runtime;


Tests to ensure get_meta doesn't break get/set/delete semantics

Following scenarios are covered:
1. get_meta followed by get for an existing key: get passes
2. get_meta followed by get for a deleted key: get fails
3. get_meta followed by get for a nonexistent key: get fails

4. get_meta followed by set for an existing key: set passes
5. get_meta followed by set for a deleted key: set passes
6. get_meta followed by set for a nonexistent key: set passes

7. get_meta followed by delete for an existing key: delete passes
8. get_meta followed by delete for a deleted key: delete fails
9. get_meta followed by delete for a nonexistent key: delete fails

Change-Id: Ie2b7938662559f85a9d28208726a1405ab033b25
Reviewed-on: http://review.couchbase.org/15437
Tested-by: Srinivas Vadlamani <4036f57732a648e71da3ac2c829c8239a16a4c5d@couchbase.com>
Reviewed-by: Chiyoung Seo <8b279095f11c26cc21045fda5a3e51debb005aa9@gmail.com>
Tested-by: Chiyoung Seo <8b279095f11c26cc21045fda5a3e51debb005aa9@gmail.com>

--- ep_testsuite.cc
+++ ep_testsuite.cc
@@ -5260,6 +5260,109 @@
     item_metadata itm_meta;
     check(!get_meta(h, h1, key, itm_meta), "Expected get meta to return false");
     check(last_status == PROTOCOL_BINARY_RESPONSE_KEY_ENOENT, "Expected enoent");
+
+    return SUCCESS;
+}
+
+static enum test_result test_get_meta_with_get(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1)
+{
+    char const *key1 = "key1";
+    char const *key2 = "key2";
+
+    item *i = NULL;
+    item_metadata itm_meta;
+
+    // test get_meta followed by get for an existing key. should pass.
+    check(store(h, h1, NULL, OPERATION_SET, key1, "somevalue", &i) == ENGINE_SUCCESS,
+          "Failed set.");
+    wait_for_flusher_to_settle(h, h1);
+    check(get_meta(h, h1, key1, itm_meta), "Expected to get meta");
+    check(last_status == PROTOCOL_BINARY_RESPONSE_SUCCESS, "Expected success");
+    check(h1->get(h, NULL, &i, key1, strlen(key1), 0) == ENGINE_SUCCESS, "Expected get success");
+
+    // test get_meta followed by get for a deleted key. should fail.
+    check(h1->remove(h, NULL, key1, strlen(key1), 0, 0) == ENGINE_SUCCESS,
+          "Delete failed");
+    wait_for_flusher_to_settle(h, h1);
+    check(get_meta(h, h1, key1, itm_meta), "Expected to get meta");
+    check(last_status == PROTOCOL_BINARY_RESPONSE_SUCCESS, "Expected success");
+    check(last_deleted_flag, "Expected deleted flag to be set");
+    check(h1->get(h, NULL, &i, key1, strlen(key1), 0) == ENGINE_KEY_ENOENT, "Expected enoent");
+
+    // test get_meta followed by get for a nonexistent key. should fail.
+    check(!get_meta(h, h1, key2, itm_meta), "Expected get meta to return false");
+    check(last_status == PROTOCOL_BINARY_RESPONSE_KEY_ENOENT, "Expected enoent");
+    check(h1->get(h, NULL, &i, key2, strlen(key2), 0) == ENGINE_KEY_ENOENT, "Expected enoent");
+
+    return SUCCESS;
+}
+
+static enum test_result test_get_meta_with_set(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1)
+{
+    char const *key1 = "key1";
+    char const *key2 = "key2";
+
+    item *i = NULL;
+    item_metadata itm_meta;
+
+    // test get_meta followed by set for an existing key. should pass.
+    check(store(h, h1, NULL, OPERATION_SET, key1, "somevalue", &i) == ENGINE_SUCCESS,
+          "Failed set.");
+    wait_for_flusher_to_settle(h, h1);
+    check(get_meta(h, h1, key1, itm_meta), "Expected to get meta");
+    check(last_status == PROTOCOL_BINARY_RESPONSE_SUCCESS, "Expected success");
+    check(store(h, h1, NULL, OPERATION_SET, key1, "someothervalue", &i) == ENGINE_SUCCESS,
+          "Failed set.");
+
+    // test get_meta followed by set for a deleted key. should pass.
+    check(h1->remove(h, NULL, key1, strlen(key1), 0, 0) == ENGINE_SUCCESS,
+          "Delete failed");
+    wait_for_flusher_to_settle(h, h1);
+    check(get_meta(h, h1, key1, itm_meta), "Expected to get meta");
+    check(last_status == PROTOCOL_BINARY_RESPONSE_SUCCESS, "Expected success");
+    check(last_deleted_flag, "Expected deleted flag to be set");
+    check(store(h, h1, NULL, OPERATION_SET, key1, "someothervalue", &i) == ENGINE_SUCCESS,
+          "Failed set.");
+
+    // test get_meta followed by set for a nonexistent key. should pass.
+    check(!get_meta(h, h1, key2, itm_meta), "Expected get meta to return false");
+    check(last_status == PROTOCOL_BINARY_RESPONSE_KEY_ENOENT, "Expected enoent");
+    check(store(h, h1, NULL, OPERATION_SET, key2, "someothervalue", &i) == ENGINE_SUCCESS,
+          "Failed set.");
+
+    return SUCCESS;
+}
+
+static enum test_result test_get_meta_with_delete(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1)
+{
+    char const *key1 = "key1";
+    char const *key2 = "key2";
+
+    item *i = NULL;
+    item_metadata itm_meta;
+
+    // test get_meta followed by delete for an existing key. should pass.
+    check(store(h, h1, NULL, OPERATION_SET, key1, "somevalue", &i) == ENGINE_SUCCESS,
+          "Failed set.");
+    wait_for_flusher_to_settle(h, h1);
+    check(get_meta(h, h1, key1, itm_meta), "Expected to get meta");
+    check(last_status == PROTOCOL_BINARY_RESPONSE_SUCCESS, "Expected success");
+    check(h1->remove(h, NULL, key1, strlen(key1), 0, 0) == ENGINE_SUCCESS,
+          "Delete failed");
+
+    // test get_meta followed by delete for a deleted key. should fail.
+    wait_for_flusher_to_settle(h, h1);
+    check(get_meta(h, h1, key1, itm_meta), "Expected to get meta");
+    check(last_status == PROTOCOL_BINARY_RESPONSE_SUCCESS, "Expected success");
+    check(last_deleted_flag, "Expected deleted flag to be set");
+    check(h1->remove(h, NULL, key1, strlen(key1), 0, 0) == ENGINE_KEY_ENOENT,
+          "Expected enoent");
+
+    // test get_meta followed by delete for a nonexistent key. should fail.
+    check(!get_meta(h, h1, key2, itm_meta), "Expected get meta to return false");
+    check(last_status == PROTOCOL_BINARY_RESPONSE_KEY_ENOENT, "Expected enoent");
+    check(h1->remove(h, NULL, key2, strlen(key2), 0, 0) == ENGINE_KEY_ENOENT,
+          "Expected enoent");

     return SUCCESS;
 }
@@ -6348,6 +6451,15 @@
         TestCase("get meta nonexistent", test_get_meta_nonexistent, NULL,
                  teardown, NULL, prepare, cleanup, BACKEND_COUCH),

+        TestCase("get meta followed by get", test_get_meta_with_get, NULL,
+                 teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+
+        TestCase("get meta followed by set", test_get_meta_with_set, NULL,
+                 teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+
+        TestCase("get meta followed by delete", test_get_meta_with_delete, NULL,
+                 teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+
         TestCase("add with meta", test_add_with_meta, NULL,
                  teardown, NULL, prepare, cleanup, BACKEND_ALL),


bug fixed

bug fixed

--- arduino/opencr_arduino/opencr/libraries/OpenManipulator/src/open_manipulator/OMManager.cpp
+++ arduino/opencr_arduino/opencr/libraries/OpenManipulator/src/open_manipulator/OMManager.cpp
@@ -637,7 +637,7 @@

   for (it = component_.begin(); it != component_.end(); it++)
   {
-    if (component_.at(it->first).tool.id != -1) // Check whether Tool or not
+    if (component_.at(it->first).tool.id == -1) // Check whether Tool or not
     {
       // This is not Tool -> This is Joint
       result_vector.push_back(component_.at(it->first).joint.angle);
@@ -653,8 +653,9 @@

   for (it = component_.begin(); it != component_.end(); it++)
   {
-    if (component_.at(it->first).joint.id != -1)
-    {
+    if (component_.at(it->first).joint.id != -1) // Check whether Active or Passive
+    {
+      // Active
       result_vector.push_back(component_.at(it->first).joint.angle);
     }
   }


SinglePointArea: Removed unused signal

SinglePointArea: Removed unused signal

--- raintk/RainTkSinglePointArea.hpp
+++ raintk/RainTkSinglePointArea.hpp
@@ -54,7 +54,6 @@
         ks::Signal<> signal_pressed;
         ks::Signal<> signal_released;
         ks::Signal<> signal_clicked;
-        ks::Signal<> signal_canceled;

     private:
         Response handleInput(Point const &,bool) override;


adjust diff since abs is too large

adjust diff since abs is too large

test=develop

--- paddle/fluid/inference/tests/api/analyzer_seq_pool1_tester.cc
+++ paddle/fluid/inference/tests/api/analyzer_seq_pool1_tester.cc
@@ -327,7 +327,9 @@
             native_outputs.front().data.length());
   auto *native_data = static_cast<float *>(native_outputs.front().data.data());
   for (size_t i = 0; i < zerocopy_output.size(); ++i) {
-    EXPECT_NEAR(zerocopy_output[i], native_data[i], 1e-3);
+    EXPECT_LT(
+        std::fabs((zerocopy_output[i] - native_data[i]) / zerocopy_output[i]),
+        1e-3);
   }
 }


OPENGL VERSION CHANGE TO 3.1. Engine camera was working only on NVIDIA gpu drivers cause of opengl version. I was running on 2.1 and needed 3.1 or upper.  Was missing all opengl attributes for initialitzation said on class 03.

--- ROF_Engine/ModuleWindow.cpp
+++ ROF_Engine/ModuleWindow.cpp
@@ -33,8 +33,14 @@
 		int height = SCREEN_HEIGHT * SCREEN_SIZE;
 		Uint32 flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;

-		//Use OpenGL 2.1
-		SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
+		//SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG);
+		SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
+		SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+		SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
+		SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
+
+		//Use OpenGL 3.1
+		SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
 		SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);

 		if(WIN_FULLSCREEN == true)


Fix DrawFunctions fuzzer to initialize bitmaps

Patch by f9e5434e3b68eac9b39b7f4aae862e551e71a2e4@mozilla.com

BUG=skia:5997

Change-Id: I3d4edd9fa5c8f5f2a5184d42b1c4944a1353556f
Reviewed-on: https://skia-review.googlesource.com/5304
Reviewed-by: f9e5434e3b68eac9b39b7f4aae862e551e71a2e4@mozilla.com <f9e5434e3b68eac9b39b7f4aae862e551e71a2e4@mozilla.com>
Commit-Queue: Kevin Lubick <7cdab2cfab351f23814786ba39716e90eed69047@google.com>

--- fuzz/FuzzDrawFunctions.cpp
+++ fuzz/FuzzDrawFunctions.cpp
@@ -19,6 +19,53 @@
 static const int kMaxY = 250;
 static const int kPtsLen = 10;
 static const int kTxtLen = 5;
+
+static void init_string(Fuzz* fuzz, char* str, size_t bufSize) {
+    for (size_t i = 0; i < bufSize-1; ++i) {
+        fuzz->nextRange(&str[i], 0x20, 0x7E); // printable ASCII
+    }
+    str[bufSize-1] = '\0';
+}
+
+// make_paint mostly borrowed from FilterFuzz.cpp
+static void init_paint(Fuzz* fuzz, SkPaint* p) {
+    bool b;
+    fuzz->next(&b);
+    p->setAntiAlias(b);
+
+    uint8_t tmp_u8;
+    fuzz->nextRange(&tmp_u8, 0, (int)SkBlendMode::kLastMode);
+    p->setBlendMode(static_cast<SkBlendMode>(tmp_u8));
+
+    SkColor co;
+    fuzz->next(&co);
+    p->setColor(co);
+
+    fuzz->next(&b);
+    p->setDither(b);
+
+    fuzz->nextRange(&tmp_u8, 0, (int)kHigh_SkFilterQuality);
+    p->setFilterQuality(static_cast<SkFilterQuality>(tmp_u8));
+
+    fuzz->nextRange(&tmp_u8, 0, (int)SkPaint::kFull_Hinting);
+    p->setHinting(static_cast<SkPaint::Hinting>(tmp_u8));
+
+    fuzz->nextRange(&tmp_u8, 0, (int)SkPaint::kLast_Cap);
+    p->setStrokeCap(static_cast<SkPaint::Cap>(tmp_u8));
+
+    fuzz->nextRange(&tmp_u8, 0, (int)SkPaint::kLast_Join);
+    p->setStrokeJoin(static_cast<SkPaint::Join>(tmp_u8));
+
+    SkScalar sc;
+    fuzz->next(&sc);
+    p->setStrokeMiter(sc);
+
+    fuzz->next(&sc);
+    p->setStrokeWidth(sc);
+
+    fuzz->nextRange(&tmp_u8, 0, (int)SkPaint::kStrokeAndFill_Style);
+    p->setStyle(static_cast<SkPaint::Style>(tmp_u8));
+}

 static void init_bitmap(Fuzz* fuzz, SkBitmap* bmp) {
     uint8_t colorType;
@@ -30,66 +77,22 @@
     if (!bmp->tryAllocPixels(info)) {
         SkDebugf("Bitmap not allocated\n");
     }
+    SkCanvas canvas(*bmp);
+    canvas.clear(0);
+
     bool b;
     fuzz->next(&b);
-    if (b) { // initialize
-        SkCanvas canvas(*bmp);
-        canvas.clear(0);
+    SkPaint p;
+    if (b) {
+        init_paint(fuzz, &p);
+    }
+    else {
         SkColor c;
         fuzz->next(&c);
-        SkPaint p; // TODO: maybe init_paint?
         p.setColor(c);
-        canvas.drawRect(SkRect::MakeXYWH(0, 0, kBmpSize, kBmpSize), p);
-    }
-}
-
-static void init_string(Fuzz* fuzz, char* str, size_t bufSize) {
-    for (size_t i = 0; i < bufSize-1; ++i) {
-        fuzz->nextRange(&str[i], 0x20, 0x7E); // printable ASCII
-    }
-    str[bufSize-1] = '\0';
-}
-
-// make_paint mostly borrowed from FilterFuzz.cpp
-static void init_paint(Fuzz* fuzz, SkPaint* p) {
-    bool b;
-    fuzz->next(&b);
-    p->setAntiAlias(b);
-
-    uint8_t tmp_u8;
-    fuzz->nextRange(&tmp_u8, 0, (int)SkBlendMode::kLastMode);
-    p->setBlendMode(static_cast<SkBlendMode>(tmp_u8));
-
-    SkColor co;
-    fuzz->next(&co);
-    p->setColor(co);
-
-    fuzz->next(&b);
-    p->setDither(b);
-
-    fuzz->nextRange(&tmp_u8, 0, (int)kHigh_SkFilterQuality);
-    p->setFilterQuality(static_cast<SkFilterQuality>(tmp_u8));
-
-    fuzz->nextRange(&tmp_u8, 0, (int)SkPaint::kFull_Hinting);
-    p->setHinting(static_cast<SkPaint::Hinting>(tmp_u8));
-
-    fuzz->nextRange(&tmp_u8, 0, (int)SkPaint::kLast_Cap);
-    p->setStrokeCap(static_cast<SkPaint::Cap>(tmp_u8));
-
-    fuzz->nextRange(&tmp_u8, 0, (int)SkPaint::kLast_Join);
-    p->setStrokeJoin(static_cast<SkPaint::Join>(tmp_u8));
-
-    SkScalar sc;
-    fuzz->next(&sc);
-    p->setStrokeMiter(sc);
-
-    fuzz->next(&sc);
-    p->setStrokeWidth(sc);
-
-    fuzz->nextRange(&tmp_u8, 0, (int)SkPaint::kStrokeAndFill_Style);
-    p->setStyle(static_cast<SkPaint::Style>(tmp_u8));
-}
-
+    }
+    canvas.drawRect(SkRect::MakeXYWH(0, 0, kBmpSize, kBmpSize), p);
+}

 static void init_surface(Fuzz* fuzz, sk_sp<SkSurface>* s) {
     uint8_t x, y;


Fix ARB detection on Mac and probably others.

git-svn-id: 83c4c97093aeea62ac982fbfd516bf9db27f5c99@1576 c36c8488-0289-0348-9b64-b301f74bd9a7

--- Renderer/GL/GLSLProgram.cpp
+++ Renderer/GL/GLSLProgram.cpp
@@ -273,7 +273,7 @@
             (const char*)glGetString(GL_VENDOR));
     if (atof((const char*)glGetString(GL_VERSION)) >= 2.0) {
       MESSAGE("OpenGL 2.0 supported");
-      gl::arb = m_bGLUseARB = false;
+      gl::arb = m_bGLUseARB = true;
     } else { // check for ARB extensions
       if (glewGetExtension("GL_ARB_shader_objects"))
         MESSAGE("ARB_shader_objects supported.");


planning: fixed side pass stage.

planning: fixed side pass stage.

--- modules/planning/scenarios/side_pass/side_pass_stage.cc
+++ modules/planning/scenarios/side_pass/side_pass_stage.cc
@@ -49,6 +49,8 @@
       frame->reference_line_info().front().AdcSlBoundary();
   const PathDecision& path_decision =
       frame->reference_line_info().front().path_decision();
+
+  bool has_blocking_obstacle = false;
   for (const auto* obstacle : path_decision.obstacles().Items()) {
     if (obstacle->IsVirtual() || !obstacle->IsStatic()) {
       continue;
@@ -69,6 +71,9 @@
         obstacle->PerceptionSLBoundary().end_l() < -1.0) {
       continue;
     }
+    has_blocking_obstacle = true;
+  }
+  if (!has_blocking_obstacle) {
     next_stage_ = ScenarioConfig::NO_STAGE;
     return Stage::FINISHED;
   }


Apply clang-tidy fixes for performance-for-range-copy in chlo_ops.cc (NFC)

PiperOrigin-RevId: 418623132
Change-Id: Ic726902326ce2d7c348660a091776f6a7d20e83d

--- tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/IR/chlo_ops.cc
+++ tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/IR/chlo_ops.cc
@@ -113,7 +113,7 @@
                                           shape_large.end());

   // Update according to the broadcast dimensions.
-  for (auto index_pair : llvm::enumerate(broadcast_dimensions)) {
+  for (const auto& index_pair : llvm::enumerate(broadcast_dimensions)) {
     auto old_value = out_shape[index_pair.value()];
     auto new_value = shape_small[index_pair.index()];
     if (old_value != -1 && (new_value == -1 || new_value > old_value)) {


Remove dependency on RepeatedField::iterator being implemented as a pointer

PiperOrigin-RevId: 426267884
Change-Id: Ia846483b753fe4060a6d3483d85d5dd047783099

--- tensorflow/compiler/mlir/tensorflow/utils/translate_utils.cc
+++ tensorflow/compiler/mlir/tensorflow/utils/translate_utils.cc
@@ -29,7 +29,8 @@
   auto bad_consumers = b.getNamedAttr(
       "bad_consumers",
       b.getI32ArrayAttr(llvm::ArrayRef<int32_t>(
-          versions.bad_consumers().begin(), versions.bad_consumers().end())));
+          versions.bad_consumers().data(),
+          versions.bad_consumers().data() + versions.bad_consumers().size())));
   module->setAttr("tf.versions",
                   b.getDictionaryAttr(llvm::ArrayRef<mlir::NamedAttribute>(
                       {producer, min_consumer, bad_consumers})));


[XLA:GPU] Add more logging to nccl_all_reduce_thunk.

PiperOrigin-RevId: 296541308
Change-Id: I54d33a55791a79b1183f55b13f937c9d65aefd71

--- tensorflow/compiler/xla/service/gpu/nccl_all_reduce_thunk.cc
+++ tensorflow/compiler/xla/service/gpu/nccl_all_reduce_thunk.cc
@@ -577,12 +577,20 @@
   RendezvousKey rendezvous_key = RendezvousKey::FromInstruction(
       params.run_id, global_devices, local_devices.size(), hlo_instruction());

-  VLOG(2) << "Rendezvous key: " << rendezvous_key.ToString()
-          << ", global participating replicas: "
-          << absl::StrJoin(global_participating_replicas, ", ")
-          << ", global participating devices: "
-          << GlobalDeviceIdsToString(global_devices);
-
+  if (VLOG_IS_ON(2)) {
+    std::vector<std::string> local_participants;
+    for (const auto& entry : local_devices) {
+      local_participants.push_back(absl::StrFormat(
+          "global=%d/local=%d", entry.first.value(), entry.second));
+    }
+    VLOG(2) << "Rendezvous key: " << rendezvous_key.ToString()
+            << ", global participating replicas: "
+            << absl::StrJoin(global_participating_replicas, ", ")
+            << ", global participating devices: "
+            << GlobalDeviceIdsToString(global_devices)
+            << ", local participants: "
+            << absl::StrJoin(local_participants, ",");
+  }
   AllReduceParticipantData participant(rendezvous_key);
   participant.device_ordinal = local_device_ordinal;
   for (size_t i = 0; i < buffers_.size(); ++i) {


Use std::lock_guard instead of manual locking in condition variable test

--- test/ConditionVariable/ConditionVariablePriorityTestCase.cpp
+++ test/ConditionVariable/ConditionVariablePriorityTestCase.cpp
@@ -2,7 +2,7 @@
  * \file
  * \brief ConditionVariablePriorityTestCase class implementation
  *
- * \author Copyright (C) 2014-2017 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
+ * \author Copyright (C) 2014-2018 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
  *
  * \par License
  * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
@@ -18,6 +18,8 @@
 #include "distortos/DynamicThread.hpp"
 #include "distortos/Mutex.hpp"
 #include "distortos/statistics.hpp"
+
+#include <mutex>

 namespace distortos
 {
@@ -53,10 +55,10 @@
 void thread(SequenceAsserter& sequenceAsserter, const unsigned int sequencePoint, ConditionVariable& conditionVariable,
 		Mutex& mutex)
 {
-	mutex.lock();
+	const std::lock_guard<distortos::Mutex> lock {mutex};
+
 	conditionVariable.wait(mutex);
 	sequenceAsserter.sequencePoint(sequencePoint);
-	mutex.unlock();
 }

 /**


Integrate JoyBus checksum

Integrate JoyBus checksum

--- Runtime/MP1/CGBASupport.cpp
+++ Runtime/MP1/CGBASupport.cpp
@@ -21,6 +21,11 @@
 #define GBA_JOYBOOT_UNKNOWN_STATE       3
 #define GBA_JOYBOOT_ERR_INVALID         4

+static void GBAInit()
+{
+
+}
+
 static s32 GBAJoyBootAsync(s32 chan, s32 paletteColor, s32 paletteSpeed,
                            u8* programp, s32 length, u8* status)
 {
@@ -50,6 +55,30 @@
 static s32 GBAWrite(s32 chan, u8* src, u8* status)
 {
     return GBA_READY;
+}
+
+static u32 calculateJBusChecksum(const u8* data, size_t len)
+{
+    const u8* ptr = data;
+    u32 sum = -1;
+    for (int i = len ; i > 0; --i)
+    {
+        u8 ch = *ptr;
+        ptr++;
+        sum ^= ch;
+        for (int j = 0; j < 8; ++j)
+        {
+            if ((sum & 1))
+            {
+                sum >>= 1;
+                sum ^= 0xb010;
+            }
+            else
+                sum >>= 1;
+        }
+    }
+
+    return sum;
 }

 CGBASupport* CGBASupport::SharedInstance = nullptr;
@@ -60,7 +89,7 @@
     x28_fileSize = ROUND_UP_32(Length());
     x2c_buffer.reset(new u8[x28_fileSize]);
     x30_dvdReq = AsyncRead(x2c_buffer.get(), x28_fileSize);
-    //GBAInit();
+    GBAInit();
     SharedInstance = this;
 }

@@ -123,7 +152,9 @@
     if (GBARead(x40_siChan, bytes, &status) != GBA_READY)
         return false;

-    /* CRC Here */
+    u32 swapped = hecl::SBig(reinterpret_cast<u32&>(bytes));
+    if (bytes[0] != calculateJBusChecksum(reinterpret_cast<u8*>(&swapped), 3))
+        return false;

     x44_fusionLinked = (bytes[2] & 0x2) != 0;
     if (x44_fusionLinked && (bytes[2] & 0x1) != 0)


Remove xfail tag for darwin from quick_exit test

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@222406 91177308-0d34-0410-b5e6-96231b3b80d8

--- test/language.support/support.start.term/quick_exit.pass.cpp
+++ test/language.support/support.start.term/quick_exit.pass.cpp
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: apple-darwin

 // test quick_exit and at_quick_exit


Remove creation of unused TreeT (Laurent)

--- STEER/AliReconstruction.cxx
+++ STEER/AliReconstruction.cxx
@@ -1303,18 +1303,12 @@
     return kFALSE;
   }

-  // create Tracks
-  fLoader[iDet]->LoadTracks("update");
-  fLoader[iDet]->CleanTracks();
-  fLoader[iDet]->MakeTracksContainer();
-
   // read RecPoints
   fLoader[iDet]->LoadRecPoints("read");
+
   tracker->LoadClusters(fLoader[iDet]->TreeR());

   Int_t rv = tracker->Clusters2Tracks(esd);
-
-  fLoader[iDet]->UnloadRecPoints();

   if ( rv )
   {
@@ -1322,13 +1316,10 @@
     return kFALSE;
   }

+  fLoader[iDet]->UnloadRecPoints();
+
   tracker->UnloadClusters();

-  fLoader[iDet]->UnloadRecPoints();
-
-  fLoader[iDet]->WriteTracks("OVERWRITE");
-  fLoader[iDet]->UnloadTracks();
-
   delete tracker;

   return kTRUE;


[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)

--- test/unit/math/prim/fun/offset_multiplier_transform_test.cpp
+++ test/unit/math/prim/fun/offset_multiplier_transform_test.cpp
@@ -598,12 +598,12 @@
 TEST(prob_transform, offset_multiplier_consistent_sizes) {
   Eigen::VectorXd x(4);
   x << 1.0, 2.0, 3.0, 4.0;
-
+
   double mu = 2.0;

   Eigen::MatrixXd sigma(2, 2);
   sigma << 1.0, 2.0, 3.0, 4.0;

-  EXPECT_THROW(stan::math::offset_multiplier_free(x, mu, sigma), std::invalid_argument);
-
-}
+  EXPECT_THROW(stan::math::offset_multiplier_free(x, mu, sigma),
+               std::invalid_argument);
+}


Add -floor, -ceil, and -round options to calculate-element-wise

--- Applications/src/calculate-element-wise.cc
+++ Applications/src/calculate-element-wise.cc
@@ -220,6 +220,12 @@
   cout << "      Compute logarithm to base 10, alias for :option:`-log` with base 10.\n";
   cout << "  -mod, -fmod <denominator>\n";
   cout << "      Compute modulo division of each value with specified denominator.\n";
+  cout << "  -floor\n";
+  cout << "      Round floating point values to largest integer value that is not greater.\n";
+  cout << "  -ceil\n";
+  cout << "      Round floating point values to smallest integer value that is greater.\n";
+  cout << "  -round\n";
+  cout << "      Round floating point values to the nearest integer value, away from zero for halfway cases.\n";
   cout << "\n";
   cout << "Data output options:\n";
   cout << "  -out, -o, -output <file> [<type>] [<name>]\n";
@@ -884,6 +890,12 @@
         exit(1);
       }
       ops.push_back(UniquePtr<Op>(new Mod(denominator)));
+    } else if (OPTION("-floor")) {
+      ops.push_back(UniquePtr<Op>(new Floor()));
+    } else if (OPTION("-ceil")) {
+      ops.push_back(UniquePtr<Op>(new Ceil()));
+    } else if (OPTION("-round")) {
+      ops.push_back(UniquePtr<Op>(new Round()));
     } else if (OPTION("=")) {
       const char *fname = ARGUMENT;
       #if MIRTK_Image_WITH_VTK


Memory leak fixed (Andrea)

Memory leak fixed (Andrea)

--- STEER/AliVertexerTracks.cxx
+++ STEER/AliVertexerTracks.cxx
@@ -805,7 +805,8 @@
   SetDCAcut(cuts[0]);
   SetDCAcutIter0(cuts[1]);
   SetMaxd0z0(cuts[2]);
-  SetMinClusters((Int_t)(cuts[3]));
+  if(fMode==0 && cuts[3]<0) SetITSrefitNotRequired();
+  SetMinClusters((Int_t)(TMath::Abs(cuts[3])));
   SetMinTracks((Int_t)(cuts[4]));
   SetNSigmad0(cuts[5]);
   SetMinDetFitter(cuts[6]);
@@ -830,11 +831,15 @@
 //  Cut values for ITS mode
 //
   fMode = 0;
-  SetITSrefitRequired();
+  if(minCls>0) {
+    SetITSrefitRequired();
+  } else {
+    SetITSrefitNotRequired();
+  }
   SetDCAcut(dcacut);
   SetDCAcutIter0(dcacutIter0);
   SetMaxd0z0(maxd0z0);
-  SetMinClusters(minCls);
+  SetMinClusters(TMath::Abs(minCls));
   SetMinTracks(mintrks);
   SetNSigmad0(nsigma);
   SetMinDetFitter(mindetfitter);
@@ -1154,7 +1159,7 @@
   pos[2] = fNominalPos[2];
   err[2] = TMath::Sqrt(fNominalCov[5]);
   Int_t    ncontr = (err[0]>1. ? -1 : -3);
-  fCurrentVertex = 0;
+  if(fCurrentVertex) { delete fCurrentVertex; fCurrentVertex=0; }
   fCurrentVertex = new AliESDVertex(pos,err);
   fCurrentVertex->SetNContributors(ncontr);

@@ -1438,6 +1443,7 @@
   // for correct chi2/ndf, count constraint as additional "track"
   if(fConstraint) nTrksUsed++;
   // store data in the vertex object
+  if(fCurrentVertex) { delete fCurrentVertex; fCurrentVertex=0; }
   fCurrentVertex = new AliESDVertex(position,covmatrix,chi2,nTrksUsed);

   if(fDebug) {
@@ -1457,7 +1463,7 @@
 //
 // Return vertex from tracks (AliExternalTrackParam) in array
 //
-
+  fCurrentVertex = 0;
   SetConstraintOff();

   // get tracks and propagate them to initial vertex position


update blosc tests

update blosc tests

- add test combination for new option `threshold`
- add test combination for shuffling

--- testing/adios2/engine/bp/operations/TestBPWriteReadBlosc.cpp
+++ testing/adios2/engine/bp/operations/TestBPWriteReadBlosc.cpp
@@ -8,6 +8,7 @@
 #include <iostream>
 #include <numeric> //std::iota
 #include <stdexcept>
+#include <tuple>

 #include <adios2.h>

@@ -15,11 +16,13 @@

 std::string engineName; // comes from command line

-void BloscAccuracy1D(const std::string accuracy)
+void BloscAccuracy1D(const std::string accuracy, const std::string threshold,
+                     const std::string doshuffle)
 {
     // Each process would write a 1x8 array and all processes would
     // form a mpiSize * Nx 1D array
-    const std::string fname("BPWR_Blosc_1D_" + accuracy + ".bp");
+    const std::string fname("BPWR_Blosc_1D_" + accuracy + "_" + threshold +
+                            "_" + doshuffle + ".bp");

     int mpiRank = 0, mpiSize = 1;
     // Number of rows
@@ -72,9 +75,13 @@
             adios.DefineOperator("BloscCompressor", adios2::ops::LosslessBlosc);

         var_r32.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});
         var_r64.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});

         adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

@@ -150,11 +157,13 @@
     }
 }

-void BloscAccuracy2D(const std::string accuracy)
+void BloscAccuracy2D(const std::string accuracy, const std::string threshold,
+                     const std::string doshuffle)
 {
     // Each process would write a 1x8 array and all processes would
     // form a mpiSize * Nx 1D array
-    const std::string fname("BPWRBlosc2D_" + accuracy + ".bp");
+    const std::string fname("BPWRBlosc2D_" + accuracy + "_" + threshold +
+                            threshold + "_" + doshuffle + ".bp");

     int mpiRank = 0, mpiSize = 1;
     // Number of rows
@@ -208,9 +217,13 @@
             adios.DefineOperator("BloscCompressor", adios2::ops::LosslessBlosc);

         var_r32.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});
         var_r64.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});

         adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

@@ -288,11 +301,13 @@
     }
 }

-void BloscAccuracy3D(const std::string accuracy)
+void BloscAccuracy3D(const std::string accuracy, const std::string threshold,
+                     const std::string doshuffle)
 {
     // Each process would write a 1x8 array and all processes would
     // form a mpiSize * Nx 1D array
-    const std::string fname("BPWRBlosc3D_" + accuracy + ".bp");
+    const std::string fname("BPWRBlosc3D_" + accuracy + "_" + threshold +
+                            threshold + "_" + doshuffle + ".bp");

     int mpiRank = 0, mpiSize = 1;
     // Number of rows
@@ -347,9 +362,13 @@
             adios.DefineOperator("BloscCompressor", adios2::ops::LosslessBlosc);

         var_r32.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});
         var_r64.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});

         adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

@@ -429,11 +448,13 @@
     }
 }

-void BloscAccuracy1DSel(const std::string accuracy)
+void BloscAccuracy1DSel(const std::string accuracy, const std::string threshold,
+                        const std::string doshuffle)
 {
     // Each process would write a 1x8 array and all processes would
     // form a mpiSize * Nx 1D array
-    const std::string fname("BPWRBlosc1DSel_" + accuracy + ".bp");
+    const std::string fname("BPWRBlosc1DSel_" + accuracy + "_" + threshold +
+                            threshold + "_" + doshuffle + ".bp");

     int mpiRank = 0, mpiSize = 1;
     // Number of rows
@@ -486,9 +507,13 @@
             adios.DefineOperator("BloscCompressor", adios2::ops::LosslessBlosc);

         var_r32.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});
         var_r64.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});

         adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

@@ -564,11 +589,13 @@
     }
 }

-void BloscAccuracy2DSel(const std::string accuracy)
+void BloscAccuracy2DSel(const std::string accuracy, const std::string threshold,
+                        const std::string doshuffle)
 {
     // Each process would write a 1x8 array and all processes would
     // form a mpiSize * Nx 1D array
-    const std::string fname("BPWRBlosc2DSel_" + accuracy + ".bp");
+    const std::string fname("BPWRBlosc2DSel_" + accuracy + "_" + threshold +
+                            threshold + "_" + doshuffle + ".bp");

     int mpiRank = 0, mpiSize = 1;
     // Number of rows
@@ -622,9 +649,13 @@
             adios.DefineOperator("BloscCompressor", adios2::ops::LosslessBlosc);

         var_r32.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});
         var_r64.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});

         adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

@@ -702,11 +733,13 @@
     }
 }

-void BloscAccuracy3DSel(const std::string accuracy)
+void BloscAccuracy3DSel(const std::string accuracy, const std::string threshold,
+                        const std::string doshuffle)
 {
     // Each process would write a 1x8 array and all processes would
     // form a mpiSize * Nx 1D array
-    const std::string fname("BPWRBlosc3DSel_" + accuracy + ".bp");
+    const std::string fname("BPWRBlosc3DSel_" + accuracy + "_" + threshold +
+                            threshold + "_" + doshuffle + ".bp");

     int mpiRank = 0, mpiSize = 1;
     // Number of rows
@@ -761,9 +794,13 @@
             adios.DefineOperator("BloscCompressor", adios2::ops::LosslessBlosc);

         var_r32.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle},
+                              {adios2::ops::blosc::key::threshold, threshold}});
         var_r64.AddOperation(BloscOp,
-                             {{adios2::ops::blosc::key::clevel, accuracy}});
+                             {{adios2::ops::blosc::key::clevel, accuracy},
+                              {adios2::ops::blosc::key::threshold, threshold},
+                              {adios2::ops::blosc::key::doshuffle, doshuffle}});

         adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

@@ -845,7 +882,8 @@
     }
 }

-class BPWriteReadBlosc : public ::testing::TestWithParam<std::string>
+class BPWriteReadBlosc : public ::testing::TestWithParam<
+                             std::tuple<std::string, std::string, std::string>>
 {
 public:
     BPWriteReadBlosc() = default;
@@ -855,40 +893,55 @@

 TEST_P(BPWriteReadBlosc, ADIOS2BPWriteReadBlosc1D)
 {
-    BloscAccuracy1D(GetParam());
+    BloscAccuracy1D(std::get<0>(GetParam()), std::get<1>(GetParam()),
+                    std::get<2>(GetParam()));
 }
 TEST_P(BPWriteReadBlosc, ADIOS2BPWriteReadBlosc2D)
 {
-    BloscAccuracy2D(GetParam());
+    BloscAccuracy2D(std::get<0>(GetParam()), std::get<1>(GetParam()),
+                    std::get<2>(GetParam()));
 }
 TEST_P(BPWriteReadBlosc, ADIOS2BPWriteReadBlosc3D)
 {
-    BloscAccuracy3D(GetParam());
+    BloscAccuracy3D(std::get<0>(GetParam()), std::get<1>(GetParam()),
+                    std::get<2>(GetParam()));
 }
 TEST_P(BPWriteReadBlosc, ADIOS2BPWriteReadBlosc1DSel)
 {
-    BloscAccuracy1DSel(GetParam());
+    BloscAccuracy1DSel(std::get<0>(GetParam()), std::get<1>(GetParam()),
+                       std::get<2>(GetParam()));
 }
 TEST_P(BPWriteReadBlosc, ADIOS2BPWriteReadBlosc2DSel)
 {
-    BloscAccuracy2DSel(GetParam());
+    BloscAccuracy2DSel(std::get<0>(GetParam()), std::get<1>(GetParam()),
+                       std::get<2>(GetParam()));
 }
 TEST_P(BPWriteReadBlosc, ADIOS2BPWriteReadBlosc3DSel)
 {
-    BloscAccuracy3DSel(GetParam());
+    BloscAccuracy3DSel(std::get<0>(GetParam()), std::get<1>(GetParam()),
+                       std::get<2>(GetParam()));
 }

 INSTANTIATE_TEST_SUITE_P(
     BloscAccuracy, BPWriteReadBlosc,
-    ::testing::Values(adios2::ops::blosc::value::clevel_1,
-                      adios2::ops::blosc::value::clevel_2,
-                      adios2::ops::blosc::value::clevel_3,
-                      adios2::ops::blosc::value::clevel_4,
-                      adios2::ops::blosc::value::clevel_5,
-                      adios2::ops::blosc::value::clevel_6,
-                      adios2::ops::blosc::value::clevel_7,
-                      adios2::ops::blosc::value::clevel_8,
-                      adios2::ops::blosc::value::clevel_9));
+    ::testing::Combine(
+        // test compression level
+        ::testing::Values(adios2::ops::blosc::value::clevel_1,
+                          adios2::ops::blosc::value::clevel_2,
+                          adios2::ops::blosc::value::clevel_3,
+                          adios2::ops::blosc::value::clevel_4,
+                          adios2::ops::blosc::value::clevel_5,
+                          adios2::ops::blosc::value::clevel_6,
+                          adios2::ops::blosc::value::clevel_7,
+                          adios2::ops::blosc::value::clevel_8,
+                          adios2::ops::blosc::value::clevel_9),
+        // test threshold: 128 is equal to the default, 1 GiB is used to disable
+        // compression
+        ::testing::Values("128", "1073741824"),
+        // test shuffling
+        ::testing::Values(adios2::ops::blosc::value::doshuffle_shuffle,
+                          adios2::ops::blosc::value::doshuffle_noshuffle,
+                          adios2::ops::blosc::value::doshuffle_bitshuffle)));

 int main(int argc, char **argv)
 {


Rollback changes to default params

Rollback changes to default params

--- Baikal/SceneGraph/camera.cpp
+++ Baikal/SceneGraph/camera.cpp
@@ -34,8 +34,6 @@
     using namespace RadeonRays;

     Camera::Camera(float3 const& eye, float3 const& at, float3 const& up)
-    : m_zcap(0.f, 1000.f)
-    , m_dim(0.1f, 0.1f)
     {
         LookAt(eye, at, up);
     }


(Overlay::Overlay): Removed the second parameter from the `LayoutAlign' ctor invocation.

--- Berlin/modules/Layout/Box.hh
+++ Berlin/modules/Layout/Box.hh
@@ -103,7 +103,7 @@
 class Overlay : public Box
 {
 public:
-  Overlay() : Box(new LayoutSuperpose(new LayoutAlign(Warsaw::xaxis, true), new LayoutAlign(Warsaw::yaxis, true))) {}
+  Overlay() : Box(new LayoutSuperpose(new LayoutAlign(Warsaw::xaxis), new LayoutAlign(Warsaw::yaxis))) {}
 };

 #endif


x Compilation fails with some defines

x Compilation fails with some defines

git-svn-id: 294f12855175db510999321cff72188496f07bec@5384 45c5ae6f-87cc-4fd0-92ee-e4f023fd80da

--- Source/MediaInfo/Multiple/File__ReferenceFilesHelper.cpp
+++ Source/MediaInfo/Multiple/File__ReferenceFilesHelper.cpp
@@ -93,13 +93,15 @@
 {
     if (!Init_Done)
     {
-        if (MI->Config->File_Filter_Audio_Get())
-            for (size_t Pos=0; Pos<References.size(); Pos++)
-                if (References[Pos].StreamKind!=Stream_Audio)
-                {
-                    References.erase(References.begin()+Pos);
-                    Pos--;
-                }
+        #if MEDIAINFO_FILTER
+            if (MI->Config->File_Filter_Audio_Get())
+                for (size_t Pos=0; Pos<References.size(); Pos++)
+                    if (References[Pos].StreamKind!=Stream_Audio)
+                    {
+                        References.erase(References.begin()+Pos);
+                        Pos--;
+                    }
+        #endif //MEDIAINFO_FILTER

         //Testing IDs
         std::sort(References.begin(), References.end(), File__ReferenceFilesHelper_Algo1);


Update find-peak-element-ii.cpp

Update find-peak-element-ii.cpp

--- C++/find-peak-element-ii.cpp
+++ C++/find-peak-element-ii.cpp
@@ -1,7 +1,7 @@
 // Time:  O(max(m, n))
 // Space: O(1)

-class Solution { // TLE
+class Solution { // TLE, test case #15 it never returns even if the function directly returns without computing.
 public:
     /**
      * @param A: An integer matrix


PTX: ID was wrong in demux event

PTX: ID was wrong in demux event

git-svn-id: 294f12855175db510999321cff72188496f07bec@6144 45c5ae6f-87cc-4fd0-92ee-e4f023fd80da

--- Source/MediaInfo/Multiple/File__ReferenceFilesHelper.cpp
+++ Source/MediaInfo/Multiple/File__ReferenceFilesHelper.cpp
@@ -337,7 +337,10 @@
             for (Reference=References.begin(); Reference<References.end(); ++Reference)
                 (*Reference).StreamID=Reference-References.begin()+1;
         if (References.size()==1 && References.begin()->StreamID==(int64u)-1)
+        {
             ContainerHasNoId=true;
+            MI->StreamIDs_Width[MI->StreamIDs_Size-1]=0;
+        }
         std::sort(References.begin(), References.end(), File__ReferenceFilesHelper_Algo1);
         std::sort(References.begin(), References.end(), File__ReferenceFilesHelper_Algo2);
         std::sort(References.begin(), References.end(), File__ReferenceFilesHelper_Algo3);


Cleanup and debugging of getLiquidTransportData.

git-svn-id: 59bbd8f472be218d95e3540f3dc18de7c9bdf231@195 02a645c2-efd0-11dd-984d-ab748d24aa7e

--- Cantera/src/transport/TransportFactory.cpp
+++ Cantera/src/transport/TransportFactory.cpp
@@ -805,6 +805,7 @@
     for (i = 0; i < nsp; i++) {
       const XML_Node& sp = *xspecies[i];
       name = sp["name"];
+      std::cout << "Processing node for " << name << std::endl;

       // put in a try block so that species with no 'transport'
       // child are skipped, instead of throwing an exception.
@@ -913,7 +914,8 @@
     doublereal A_thcond, n_thcond, Tact_thcond;

     int nsp = static_cast<int>(xspecies.size());
-
+      std::cout << "Size of xspecies " << nsp << std::endl;
+
     // read all entries in database into 'datatable' and check for
     // errors. Note that this procedure validates all entries, not
     // only those for the species listed in 'names'.
@@ -923,19 +925,19 @@
     for (i = 0; i < nsp; i++) {
       const XML_Node& sp = *xspecies[i];
       name = sp["name"];
-
-      std::cout << "Processing Liquid Transport for " << name;
+      std::cout << "Processing node for " << name << std::endl;
+
       // put in a try block so that species with no 'transport'
       // child are skipped, instead of throwing an exception.
       try {
-	XML_Node& trParam = sp.child("transport");
-
-	hydrodynamic_radius = getFloat(trParam, "hydrodynamic_radius");
-
-	XML_Node& visc = trParam.child("viscosity");
+	XML_Node& trNode = sp.child("transport");
+
+	hydrodynamic_radius = getFloat(trNode, "hydrodynamic_radius");
+
+	XML_Node& visc = trNode.child("viscosity");
 	getArrhenius(visc, A_visc, n_visc, Tact_visc );

-	XML_Node& thermCond = trParam.child("thermal_conductivity");
+	XML_Node& thermCond = trNode.child("thermal_conductivity");
 	getArrhenius(thermCond, A_thcond, n_thcond, Tact_thcond );

 	LiquidTransportData data;


support for upcoming linux dlopen() refactoring

--- Source/UnrealEnginePython/Private/UnrealEnginePython.cpp
+++ Source/UnrealEnginePython/Private/UnrealEnginePython.cpp
@@ -3,6 +3,10 @@
 #include "UnrealEnginePythonPrivatePCH.h"

 void unreal_engine_init_py_module();
+
+#if UNREAL_ENGINE_PYTHON_ON_LINUX
+const char *ue4_module_options = "linux_global_symbols";
+#endif

 #if PY_MAJOR_VERSION < 3
 char *PyUnicode_AsUTF8(PyObject *py_str) {


rollback to rev 1.25,  since rev 1.26 was accidentially based on rev 1.23

--- Core/Interactions/mitkAffineInteractor.cpp
+++ Core/Interactions/mitkAffineInteractor.cpp
@@ -8,11 +8,10 @@
 #include "mitkDisplayPositionEvent.h"
 #include "vtkTransform.h"
 #include <mitkRenderWindow.h>
-#include <mitkBoolProperty.h>
-#include <mitkFloatProperty.h>
 #include <mitkProperties.h>
 #include <itkBoundingBox.h>
 #include <itkFixedArray.h>
+#include <mitkAction.h>

 #include "mitkBoundingObject.h"

@@ -38,7 +37,7 @@
 {
 }

-bool mitk::AffineInteractor::ExecuteAction(int actionId, mitk::StateEvent const* stateEvent, int objectEventId, int groupEventId)
+bool mitk::AffineInteractor::ExecuteAction(Action* action, mitk::StateEvent const* stateEvent, int objectEventId, int groupEventId)
 {
   bool ok = false;

@@ -50,271 +49,263 @@
   /* Display  events - 2D coordinates from a 3D window */
   mitk::DisplayPositionEvent const  *displayEvent = dynamic_cast <const mitk::DisplayPositionEvent *> (stateEvent->GetEvent());
   /* Each case must watch the type of the event! */
-  switch (actionId)
-  {
-  case AcINITAFFINEINTERACTIONS:
-    {
+  switch (action->GetActionId())
+  {
+    case AcINITAFFINEINTERACTIONS:
+      {
+        ok = true;
+        break;
+      }
+    case AcFINISHAFFINEINTERACTIONS:
+      {
+        ok = true;
+        break;
+      }
+    case AcNEWPOINT:
+      {
+        //ok = true;
+        break;
+      }
+    case AcCHECKELEMENT:
+      {
+        mitk::Point3D worldPoint;
+        if (posEvent != NULL)   // Event in 2D Window with 3D coordinates
+        {
+          worldPoint = posEvent->GetWorldPosition();
+        }
+        else if (displayEvent != NULL)  // Event in 3D window with 2D coordinates
+        {
+          /* pick a Prop3D and assume its position as event 3D coordinates */
+          const mitk::Point2D displayPoint = displayEvent->GetDisplayPosition();
+          mitk::GlobalInteraction* globalInteraction = dynamic_cast<mitk::GlobalInteraction*>(mitk::EventMapper::GetGlobalStateMachine());
+          if (globalInteraction == NULL)
+            return false;
+          const FocusManager::FocusElement* fe = globalInteraction->GetFocus();
+          FocusManager::FocusElement* fe2 =  const_cast <FocusManager::FocusElement*>(fe);
+          mitk::OpenGLRenderer* glRenderer = dynamic_cast<mitk::OpenGLRenderer*>(fe2);
+          if (glRenderer == NULL)
+            return false;
+          mitk::Point3D objectPoint;
+          vtkPicker* picker =	vtkPicker::New();
+          picker->SetTolerance (0.0001);
+          picker->Pick(displayPoint.x, displayPoint.y, 0, glRenderer->GetVtkRenderer());
+          if (picker->GetProp3D() == NULL)
+            return false;
+          worldPoint.x = picker->GetPickPosition()[0];
+          worldPoint.y = picker->GetPickPosition()[1];
+          worldPoint.z = picker->GetPickPosition()[2];
+        }
+        else  // neither 2D nor 3D coordinates available
+          return false;
+
+        /* now we have a worldpoint. check if it is inside our object and select/deselect it accordingly */
+        mitk::BoolProperty::Pointer selected;
+        mitk::ColorProperty::Pointer color;
+        mitk::StateEvent* newStateEvent = NULL;
+        if (this->CheckSelected(worldPoint))
+        {
+          newStateEvent = new mitk::StateEvent(StYES, posEvent);
+          selected = new mitk::BoolProperty(true);
+          color = new mitk::ColorProperty(1.0, 1.0, 0.0); // if selected, color is yellow
+        }
+        else
+        {
+          newStateEvent = new mitk::StateEvent(StNO, posEvent);
+          selected = new mitk::BoolProperty(false);
+          mitk::BoundingObject* b = dynamic_cast<mitk::BoundingObject*>(m_DataTreeNode->GetData());
+          if(b != NULL)
+          {
+            color = (b->GetPositive())? new mitk::ColorProperty(1.0, 0.0, 0.0) : new mitk::ColorProperty(0.0, 0.0, 1.0);  // if deselected, a boundingobject is colored according to its positive/negative state
+          }
+          else
+            color = new mitk::ColorProperty(1.0, 1.0, 1.0);   // if deselcted and no bounding object, color is white
+        }
+
+        /* write new state (selected/not selected) to the property */
+        m_DataTreeNode->GetPropertyList()->SetProperty("selected", selected);
+        m_DataTreeNode->GetPropertyList()->SetProperty("color", color);
+        this->HandleEvent( newStateEvent, objectEventId, groupEventId );
+        ok = true;
+        break;
+      }
+    case AcADD:
+      {
+        if (posEvent == NULL)   // @TODO: this should work with displayEvent too
+          return false;
+        mitk::Point3D worldPoint = posEvent->GetWorldPosition();
+        mitk::StateEvent* newStateEvent = NULL;
+        if (this->CheckSelected(worldPoint))
+        {
+          newStateEvent = new mitk::StateEvent(StYES, posEvent);
+          m_DataTreeNode->GetPropertyList()->SetProperty("selected", new mitk::BoolProperty(true));  // TODO: Generate an Select Operation and send it to the undo controller ?
+        }
+        else  // if not selected, do nothing (don't deselect)
+        {
+          newStateEvent = new mitk::StateEvent(StNO, posEvent);
+        }
+        //call HandleEvent to leave the guard-state
+        this->HandleEvent( newStateEvent, objectEventId, groupEventId );
+        ok = true;
+        break;
+      }
+    case AcTRANSLATESTART:
+    case AcROTATESTART:
+    case AcSCALESTART:
+      {
+        if (posEvent != NULL)
+        {
+          mitk::vm2itk(posEvent->GetWorldPosition(), m_LastMousePosition);
+          ok = true;
+        }
+        else if (displayEvent != NULL)  // 2D coordinate in event
+        {
+          ok = ConvertDisplayEventToWorldPosition(displayEvent, m_LastMousePosition);
+        }
+        else
+          ok = false;
+        break;
+      }
+    case AcTRANSLATE:
+      {
+        mitk::ITKPoint3D newPosition;
+        if (posEvent != NULL)   // 3D coordinate in event
+        {
+          mitk::vm2itk(posEvent->GetWorldPosition(), newPosition);          //converting from Point3D to itk::Point
+          newPosition -=  m_LastMousePosition.GetVectorFromOrigin();        // compute difference between actual and last mouse position
+          mitk::vm2itk(posEvent->GetWorldPosition(), m_LastMousePosition);  // save current mouse position as last position
+        }
+        else if (displayEvent != NULL)  // 2D coordinate in event
+        {
+          mitk::ITKPoint3D p;
+          if(ConvertDisplayEventToWorldPosition(displayEvent, p) == false)
+            return false;
+          newPosition = p - m_LastMousePosition.GetVectorFromOrigin();        // compute difference between actual and last mouse position
+          m_LastMousePosition = p;    // save current mouse position as last position
+        }
+        /* create operation with position difference */
+        mitk::PointOperation* doOp = new mitk::PointOperation(OpMOVE, newPosition, 0); // Index is not used here
+        if (m_UndoEnabled)	//write to UndoMechanism
+        {
+          mitk::ScalarType pos[3];
+          geometry->GetVtkTransform()->GetPosition(pos);
+          mitk::ITKPoint3D oldPosition;
+          oldPosition[0] = pos[0];
+          oldPosition[1] = pos[1];
+          oldPosition[2] = pos[2];
+
+          PointOperation* undoOp = new mitk::PointOperation(OpMOVE, oldPosition, 0);
+          OperationEvent *operationEvent = new OperationEvent(geometry, doOp, undoOp, objectEventId, groupEventId);
+          m_UndoController->SetOperationEvent(operationEvent);
+        }
+        /* execute the Operation */
+        geometry->ExecuteOperation(doOp);
+        ok = true;
+        break;
+      }
+    case AcROTATE:
+      {
+        mitk::ITKPoint3D p;
+        if (posEvent != NULL)   // 3D coordinate in event
+        {
+          mitk::vm2itk(posEvent->GetWorldPosition(), p);          //converting from Point3D to itk::Point
+        }
+        else if (displayEvent != NULL)  // 2D coordinate in event
+        {
+          if(ConvertDisplayEventToWorldPosition(displayEvent, p) == false)
+            return false;
+        }
+        mitk::ITKVector3D newPosition = p.GetVectorFromOrigin();
+
+        mitk::ScalarType position[3];
+        geometry->GetVtkTransform()->GetPosition(position);
+        mitk::ITKVector3D dataPosition = position;
+
+        newPosition -= dataPosition;  // calculate vector from center of the data object to the current mouse position
+
+        mitk::ITKVector3D startPosition = m_LastMousePosition.GetVectorFromOrigin() - dataPosition;  // calculate vector from center of the data object to the last mouse position
+
+        /* calculate rotation axis (by calculating the cross produkt of the vectors) */
+        mitk::ITKVector3D rotationaxis;
+        rotationaxis[0] =  startPosition[1] * newPosition[2] - startPosition[2] * newPosition[1];
+        rotationaxis[1] =  startPosition[2] * newPosition[0] - startPosition[0] * newPosition[2];
+        rotationaxis[2] =  startPosition[0] * newPosition[1] - startPosition[1] * newPosition[0];
+
+        /* calculate rotation angle in degrees */
+        mitk::ScalarType angle = atan2(rotationaxis.GetNorm(), newPosition * startPosition) * (180/vnl_math::pi);
+        m_LastMousePosition = p; // save current mouse position as last mouse position
+
+        /* create operation with center of rotation, angle and axis and send it to the geometry and Undo controller */
+        mitk::RotationOperation* doOp = new mitk::RotationOperation(OpROTATE, ITKPoint3D(position) , rotationaxis, angle);
+
+        if (m_UndoEnabled)	//write to UndoMechanism
+        {
+          RotationOperation* undoOp = new mitk::RotationOperation(OpROTATE, ITKPoint3D(position) , rotationaxis, -angle);
+          OperationEvent *operationEvent = new OperationEvent(geometry, doOp, undoOp, objectEventId, groupEventId);
+          m_UndoController->SetOperationEvent(operationEvent);
+        }
+        /* execute the Operation */
+        geometry->ExecuteOperation(doOp);
+        ok = true;
+        break;
+      }
+    case AcSCALE:
+      {
+        mitk::ITKPoint3D p;
+        if (posEvent != NULL)   // 3D coordinate in event
+        {
+          mitk::vm2itk(posEvent->GetWorldPosition(), p);          //converting from Point3D to itk::Point
+        }
+        else if (displayEvent != NULL)  // 2D coordinate in event
+        {
+          if(ConvertDisplayEventToWorldPosition(displayEvent, p) == false)
+            return false;
+        }
+        mitk::ITKVector3D v = p - m_LastMousePosition;
+        /* calculate scale changes */
+        mitk::ITKPoint3D newScale;
+        newScale[0] = (geometry->GetXAxis() * v) / geometry->GetXAxis().GetNorm();  // Scalarprodukt of normalized Axis
+        newScale[1] = (geometry->GetYAxis() * v) / geometry->GetYAxis().GetNorm();  // and direction vector of mouse movement
+        newScale[2] = (geometry->GetZAxis() * v) / geometry->GetZAxis().GetNorm();  // is the length of the movement vectors
+        // projection onto the axis
+        /* convert movement to local object coordinate system and mirror it to the positive quadrant */
+        ITKVector3D start;
+        ITKVector3D end;
+        mitk::ScalarType convert[3];
+        itk2vtk(m_LastMousePosition, convert);
+        geometry->GetVtkTransform()->GetInverse()->TransformPoint(convert, convert);  // transform start point to local object coordinates
+        start[0] = fabs(convert[0]);  start[1] = fabs(convert[1]);  start[2] = fabs(convert[2]);  // mirror it to the positive quadrant
+        itk2vtk(p, convert);
+        geometry->GetVtkTransform()->GetInverse()->TransformPoint(convert, convert);  // transform end point to local object coordinates
+        end[0] = fabs(convert[0]);  end[1] = fabs(convert[1]);  end[2] = fabs(convert[2]);  // mirror it to the positive quadrant
+
+        /* check if mouse movement is towards or away from the objects axes and adjust scale factors accordingly */
+        ITKVector3D vLocal = start - end;
+        newScale[0] = (vLocal[0] > 0.0) ? -fabs(newScale[0]) : +fabs(newScale[0]);
+        newScale[1] = (vLocal[1] > 0.0) ? -fabs(newScale[1]) : +fabs(newScale[1]);
+        newScale[2] = (vLocal[2] > 0.0) ? -fabs(newScale[2]) : +fabs(newScale[2]);
+
+        m_LastMousePosition = p;  // update lastPosition for next mouse move
+
+        /* generate Operation and send it to the receiving geometry */
+        PointOperation* doOp = new mitk::PointOperation(OpSCALE, newScale, 0); // Index is not used here
+        if (m_UndoEnabled)	//write to UndoMechanism
+        {
+          mitk::ITKPoint3D oldScaleData;
+          oldScaleData[0] = -newScale[0];
+          oldScaleData[1] = -newScale[1];
+          oldScaleData[2] = -newScale[2];
+
+          PointOperation* undoOp = new mitk::PointOperation(OpSCALE, oldScaleData, 0);
+          OperationEvent *operationEvent = new OperationEvent(geometry, doOp, undoOp, objectEventId, groupEventId);
+          m_UndoController->SetOperationEvent(operationEvent);
+        }
+        /* execute the Operation */
+        geometry->ExecuteOperation(doOp);
+        ok = true;
+        break;
+      }
+    default:
       ok = true;
-      break;
-    }
-  case AcFINISHAFFINEINTERACTIONS:
-    {
-      ok = true;
-      break;
-    }
-  case AcNEWPOINT:
-    {
-      //ok = true;
-      break;
-    }
-  case AcCHECKELEMENT:
-    {
-      mitk::Point3D worldPoint;
-      if (posEvent != NULL)   // Event in 2D Window with 3D coordinates
-      {
-        worldPoint = posEvent->GetWorldPosition();
-      }
-      else if (displayEvent != NULL)  // Event in 3D window with 2D coordinates
-      {
-        /* pick a Prop3D and assume its position as event 3D coordinates */
-        const mitk::Point2D displayPoint = displayEvent->GetDisplayPosition();
-        mitk::GlobalInteraction* globalInteraction = dynamic_cast<mitk::GlobalInteraction*>(mitk::EventMapper::GetGlobalStateMachine());
-        if (globalInteraction == NULL)
-          return false;
-        const FocusManager::FocusElement* fe = globalInteraction->GetFocus();
-        FocusManager::FocusElement* fe2 =  const_cast <FocusManager::FocusElement*>(fe);
-        mitk::OpenGLRenderer* glRenderer = dynamic_cast<mitk::OpenGLRenderer*>(fe2);
-        if (glRenderer == NULL)
-          return false;
-        mitk::Point3D objectPoint;
-        vtkPicker* picker =	vtkPicker::New();
-        picker->SetTolerance (0.0001);
-        picker->Pick(displayPoint.x, displayPoint.y, 0, glRenderer->GetVtkRenderer());
-        if (picker->GetProp3D() == NULL)
-          return false;
-        worldPoint.x = picker->GetPickPosition()[0];
-        worldPoint.y = picker->GetPickPosition()[1];
-        worldPoint.z = picker->GetPickPosition()[2];
-      }
-      else  // neither 2D nor 3D coordinates available
-        return false;
-
-      /* now we have a worldpoint. check if it is inside our object and select/deselect it accordingly */
-      mitk::BoolProperty::Pointer selected;
-      mitk::ColorProperty::Pointer color;
-      mitk::StateEvent* newStateEvent = NULL;
-      if (this->CheckSelected(worldPoint))
-      {
-        newStateEvent = new mitk::StateEvent(StYES, posEvent);
-        selected = new mitk::BoolProperty(true);
-        color = new mitk::ColorProperty(1.0, 1.0, 0.0); // if selected, color is yellow
-      }
-      else
-      {
-        newStateEvent = new mitk::StateEvent(StNO, posEvent);
-        selected = new mitk::BoolProperty(false);
-        mitk::BoundingObject* b = dynamic_cast<mitk::BoundingObject*>(m_DataTreeNode->GetData());
-        if(b != NULL)
-        {
-          color = (b->GetPositive())? new mitk::ColorProperty(1.0, 0.0, 0.0) : new mitk::ColorProperty(0.0, 0.0, 1.0);  // if deselected, a boundingobject is colored according to its positive/negative state
-        }
-        else
-          color = new mitk::ColorProperty(1.0, 1.0, 1.0);   // if deselcted and no bounding object, color is white
-      }
-
-      /* write new state (selected/not selected) to the property */
-      m_DataTreeNode->GetPropertyList()->SetProperty("selected", selected);
-      m_DataTreeNode->GetPropertyList()->SetProperty("color", color);
-      this->HandleEvent( newStateEvent, objectEventId, groupEventId );
-      ok = true;
-      break;
-    }
-  case AcADD:
-    {
-      if (posEvent == NULL)   // @TODO: this should work with displayEvent too
-        return false;
-      mitk::Point3D worldPoint = posEvent->GetWorldPosition();
-      mitk::StateEvent* newStateEvent = NULL;
-      if (this->CheckSelected(worldPoint))
-      {
-        newStateEvent = new mitk::StateEvent(StYES, posEvent);
-        m_DataTreeNode->GetPropertyList()->SetProperty("selected", new mitk::BoolProperty(true));  // TODO: Generate an Select Operation and send it to the undo controller ?
-      }
-      else  // if not selected, do nothing (don't deselect)
-      {
-        newStateEvent = new mitk::StateEvent(StNO, posEvent);
-      }
-      //call HandleEvent to leave the guard-state
-      this->HandleEvent( newStateEvent, objectEventId, groupEventId );
-      ok = true;
-      break;
-    }
-  case AcTRANSLATESTART:
-  case AcROTATESTART:
-  case AcSCALESTART:
-    {
-      if (posEvent != NULL)
-      {
-        mitk::vm2itk(posEvent->GetWorldPosition(), m_LastMousePosition);
-        ok = true;
-      }
-      else if (displayEvent != NULL)  // 2D coordinate in event
-      {
-        ok = ConvertDisplayEventToWorldPosition(displayEvent, m_LastMousePosition);
-      }
-      else
-        ok = false;
-      break;
-    }
-  case AcTRANSLATE:
-    {
-      mitk::ITKPoint3D newPosition;
-      if (posEvent != NULL)   // 3D coordinate in event
-      {
-        mitk::vm2itk(posEvent->GetWorldPosition(), newPosition);          //converting from Point3D to itk::Point
-        newPosition -=  m_LastMousePosition.GetVectorFromOrigin();        // compute difference between actual and last mouse position
-        mitk::vm2itk(posEvent->GetWorldPosition(), m_LastMousePosition);  // save current mouse position as last position
-      }
-      else if (displayEvent != NULL)  // 2D coordinate in event
-      {
-        mitk::ITKPoint3D p;
-        if(ConvertDisplayEventToWorldPosition(displayEvent, p) == false)
-          return false;
-        newPosition = p - m_LastMousePosition.GetVectorFromOrigin();        // compute difference between actual and last mouse position
-        m_LastMousePosition = p;    // save current mouse position as last position
-      }
-      /* create operation with position difference */
-      mitk::PointOperation* doOp = new mitk::PointOperation(OpMOVE, newPosition, 0); // Index is not used here
-      if (m_UndoEnabled)	//write to UndoMechanism
-      {
-        mitk::ScalarType pos[3];
-        geometry->GetVtkTransform()->GetPosition(pos);
-        mitk::ITKPoint3D oldPosition;
-        oldPosition[0] = pos[0];
-        oldPosition[1] = pos[1];
-        oldPosition[2] = pos[2];
-
-        PointOperation* undoOp = new mitk::PointOperation(OpMOVE, oldPosition, 0);
-        OperationEvent *operationEvent = new OperationEvent(geometry, doOp, undoOp, objectEventId, groupEventId);
-        m_UndoController->SetOperationEvent(operationEvent);
-      }
-      /* execute the Operation */
-      geometry->ExecuteOperation(doOp);
-      ok = true;
-      break;
-    }
-  case AcROTATE:
-    {
-      mitk::ITKPoint3D p;
-      if (posEvent != NULL)   // 3D coordinate in event
-      {
-        mitk::vm2itk(posEvent->GetWorldPosition(), p);          //converting from Point3D to itk::Point
-      }
-      else if (displayEvent != NULL)  // 2D coordinate in event
-      {
-        if(ConvertDisplayEventToWorldPosition(displayEvent, p) == false)
-          return false;
-      }
-      mitk::ITKVector3D newPosition = p.GetVectorFromOrigin();
-
-      mitk::ScalarType position[3];
-      geometry->GetVtkTransform()->GetPosition(position);
-      mitk::ITKVector3D dataPosition = position;
-
-      newPosition -= dataPosition;  // calculate vector from center of the data object to the current mouse position
-
-      mitk::ITKVector3D startPosition = m_LastMousePosition.GetVectorFromOrigin() - dataPosition;  // calculate vector from center of the data object to the last mouse position
-
-      /* calculate rotation axis (by calculating the cross produkt of the vectors) */
-      mitk::ITKVector3D rotationaxis;
-      rotationaxis[0] =  startPosition[1] * newPosition[2] - startPosition[2] * newPosition[1];
-      rotationaxis[1] =  startPosition[2] * newPosition[0] - startPosition[0] * newPosition[2];
-      rotationaxis[2] =  startPosition[0] * newPosition[1] - startPosition[1] * newPosition[0];
-
-      /* calculate rotation angle in degrees */
-      mitk::ScalarType angle = atan2(rotationaxis.GetNorm(), newPosition * startPosition) * (180/vnl_math::pi);
-      m_LastMousePosition = p; // save current mouse position as last mouse position
-
-      /* create operation with center of rotation, angle and axis and send it to the geometry and Undo controller */
-      mitk::RotationOperation* doOp = new mitk::RotationOperation(OpROTATE, ITKPoint3D(position) , rotationaxis, angle);
-
-      if (m_UndoEnabled)	//write to UndoMechanism
-      {
-        RotationOperation* undoOp = new mitk::RotationOperation(OpROTATE, ITKPoint3D(position) , rotationaxis, -angle);
-        OperationEvent *operationEvent = new OperationEvent(geometry, doOp, undoOp, objectEventId, groupEventId);
-        m_UndoController->SetOperationEvent(operationEvent);
-      }
-      /* execute the Operation */
-      geometry->ExecuteOperation(doOp);
-      ok = true;
-      break;
-    }
-  case AcSCALE:
-    {
-      mitk::ITKPoint3D p;
-      if (posEvent != NULL)   // 3D coordinate in event
-      {
-        mitk::vm2itk(posEvent->GetWorldPosition(), p);          //converting from Point3D to itk::Point
-      }
-      else if (displayEvent != NULL)  // 2D coordinate in event
-      {
-        if(ConvertDisplayEventToWorldPosition(displayEvent, p) == false)
-          return false;
-      }
-      mitk::ITKVector3D v = p - m_LastMousePosition;
-      /* calculate scale changes */
-      mitk::ITKPoint3D newScale;
-      newScale[0] = (geometry->GetXAxis() * v) / geometry->GetXAxis().GetNorm();  // Scalarprodukt of normalized Axis
-      newScale[1] = (geometry->GetYAxis() * v) / geometry->GetYAxis().GetNorm();  // and direction vector of mouse movement
-      newScale[2] = (geometry->GetZAxis() * v) / geometry->GetZAxis().GetNorm();  // is the length of the movement vectors
-      // projection onto the axis
-      /* convert movement to local object coordinate system and mirror it to the positive quadrant */
-      ITKVector3D start;
-      ITKVector3D end;
-      mitk::ScalarType convert[3];
-      itk2vtk(m_LastMousePosition, convert);
-      geometry->GetVtkTransform()->GetInverse()->TransformPoint(convert, convert);  // transform start point to local object coordinates
-      start[0] = fabs(convert[0]);  start[1] = fabs(convert[1]);  start[2] = fabs(convert[2]);  // mirror it to the positive quadrant
-      itk2vtk(p, convert);
-      geometry->GetVtkTransform()->GetInverse()->TransformPoint(convert, convert);  // transform end point to local object coordinates
-      end[0] = fabs(convert[0]);  end[1] = fabs(convert[1]);  end[2] = fabs(convert[2]);  // mirror it to the positive quadrant
-
-      /* check if mouse movement is towards or away from the objects axes and adjust scale factors accordingly */
-      ITKVector3D vLocal = start - end;
-      newScale[0] = (vLocal[0] > 0.0) ? -fabs(newScale[0]) : +fabs(newScale[0]);
-      newScale[1] = (vLocal[1] > 0.0) ? -fabs(newScale[1]) : +fabs(newScale[1]);
-      newScale[2] = (vLocal[2] > 0.0) ? -fabs(newScale[2]) : +fabs(newScale[2]);
-
-      m_LastMousePosition = p;  // update lastPosition for next mouse move
-
-      /* generate Operation and send it to the receiving geometry */
-      PointOperation* doOp = new mitk::PointOperation(OpSCALE, newScale, 0); // Index is not used here
-      if (m_UndoEnabled)	//write to UndoMechanism
-      {
-        mitk::ITKPoint3D oldScaleData;
-        oldScaleData[0] = -newScale[0];
-        oldScaleData[1] = -newScale[1];
-        oldScaleData[2] = -newScale[2];
-
-        PointOperation* undoOp = new mitk::PointOperation(OpSCALE, oldScaleData, 0);
-        OperationEvent *operationEvent = new OperationEvent(geometry, doOp, undoOp, objectEventId, groupEventId);
-        m_UndoController->SetOperationEvent(operationEvent);
-      }
-      /* execute the Operation */
-      geometry->ExecuteOperation(doOp);
-
-      /* Update Volume Property with new value */
-      mitk::BoundingObject* b = dynamic_cast<mitk::BoundingObject*>(m_DataTreeNode->GetData());
-      if (b != NULL)
-      {
-        m_DataTreeNode->GetPropertyList()->SetProperty("volume", new FloatProperty(b->GetVolume()));
-        //std::cout << "Volume of Boundingobject is " << b->GetVolume()/1000.0 << " ml" << std::endl;
-      }
-      ok = true;
-      break;
-    }
-  default:
-    ok = true;
   }
   mitk::RenderWindow::UpdateAllInstances();
   return ok;
@@ -392,11 +383,5 @@
     worldPoint[2] = position[2] / position[3];
     position[3] = 1.0;
   }
-  else
-  {
-    worldPoint[0] = position[0];
-    worldPoint[1] = position[1];
-    worldPoint[2] = position[2];
-  }
   return true;
 }


Added another test case for complement

Added another test case for complement

--- Core/tests/linearSetAlgebra/range_test.cpp
+++ Core/tests/linearSetAlgebra/range_test.cpp
@@ -420,6 +420,21 @@
         QVERIFY(reg.Contains(i));
     QVERIFY(reg.Contains(-INFINITY));
     QVERIFY(reg.Contains(INFINITY));
+
+    /*    |---|   |--->   becomes...   <---|   |----|    */
+    r = IntegerRange();
+    r.SetLowerBound(20);
+    reg = IntegerRegion::Union(IntegerRange(0, 10), r).Complement();
+    for(int i = -20; i <= -1; i++)
+        QVERIFY(reg.Contains(i));
+    for(int i = 0; i <= 10; i++)
+        QVERIFY(!reg.Contains(i));
+    for(int i = 11; i <= 19; i++)
+        QVERIFY(reg.Contains(i));
+    for(int i = 20; i <= 30; i++)
+        QVERIFY(!reg.Contains(i));
+    QVERIFY(reg.Contains(-INFINITY));
+    QVERIFY(!reg.Contains(INFINITY));
 }

 void RangeTest::testSymmetricDifference()


Fix tests due to regression from the DataStore changes

--- You-DataStore-Tests/internal/internal_datastore_test.cpp
+++ You-DataStore-Tests/internal/internal_datastore_test.cpp
@@ -30,6 +30,7 @@
 	TEST_METHOD_INITIALIZE(clearDataStoreState) {
 		DataStore::get().document.reset();
 		std::remove("data.xml");
+		DataStore::get().loadData();
 	}

 	TEST_METHOD_CLEANUP(cleanUpDataStoreState) {
@@ -71,18 +72,18 @@
 		// is empty

 		// document must not change without commit
-		Assert::IsTrue(sut.document.first_child().first_child().empty());
+		Assert::IsTrue(sut.root.first_child().first_child().empty());
 		t.commit();
 		// document changes after commit
-		Assert::IsFalse(sut.document.first_child().first_child().empty());
+		Assert::IsFalse(sut.root.first_child().first_child().empty());

 		Transaction t2(sut.begin());
 		sut.erase(TASKS_NODE, L"10");
 		// document must not change without commit
-		Assert::IsFalse(sut.document.first_child().first_child().empty());
+		Assert::IsFalse(sut.root.first_child().first_child().empty());
 		t2.commit();
 		// document changes after commit
-		Assert::IsTrue(sut.document.first_child().first_child().empty());
+		Assert::IsTrue(sut.root.first_child().first_child().empty());
 	}

 	/// Checks if rollback cleans up the transaction stack too
@@ -100,7 +101,7 @@
 		DataStore& sut = DataStore::get();

 		// Create mock
-		sut.document.append_child(L"tasks").append_child(L"task").
+		sut.root.append_child(L"tasks").append_child(L"task").
 			append_child(pugi::xml_node_type::node_pcdata).set_value(L"what");

 		std::vector<KeyValuePairs> result = sut.getAll(L"tasks");
@@ -113,7 +114,7 @@
 		DataStore& sut = DataStore::get();

 		// Create mock
-		sut.document.append_child(L"tasks").append_child(L"task").
+		sut.root.append_child(L"tasks").append_child(L"task").
 			append_child(pugi::xml_node_type::node_pcdata).set_value(L"what");
 		sut.document.save_file(sut.FILE_PATH.c_str());
 		sut.document.reset();
@@ -197,6 +198,7 @@
 	}

 	TEST_METHOD(xmlParseErrorThrowsException) {
+		DataStore::get().wipeData();
 		createDummyDataXml();
 		auto fun = [] { Internal::DataStore::get().loadData(); };
 		Assert::ExpectException<NotWellFormedXmlException>(fun);


this was broken by the fix for #42

this was broken by the fix for #42

--- Code/GraphMol/molopstest.cpp
+++ Code/GraphMol/molopstest.cpp
@@ -4240,7 +4240,7 @@
   RDLog::InitLogs();
   //boost::logging::enable_logs("rdApp.debug");

-#if 0
+#if 1
   test1();
   test2();
   test3();


Correct Disk II sleeping test to allow for spin-down.

--- Components/DiskII/DiskII.cpp
+++ Components/DiskII/DiskII.cpp
@@ -137,10 +137,15 @@

 	// If in read mode, clocking is either:
 	//
-	//	just-in-time, if drives are running or the shift register has any 1s in it or a flux event hasn't yet passed; or
-	//	none, given that drives are not running, the shift register has already emptied and there's no flux about to be received.
+	//	just-in-time, if drives are running or the shift register has any 1s in it and shifting may occur, or a flux event hasn't yet passed; or
+	//	none, given that drives are not running, the shift register has already emptied or stopped and there's no flux about to be received.
 	if(!(inputs_ & ~input_flux)) {
-		clocking_preference_ = (!motor_is_enabled_ && !shift_register_ && (inputs_&input_flux)) ? ClockingHint::Preference::None : ClockingHint::Preference::JustInTime;
+		const bool is_stuck_at_nop =
+			!flux_duration_ && state_machine_[(state_ & 0xf0) | inputs_ | ((shift_register_&0x80) >> 6)] == state_  && (state_ &0xf) == 0x8;
+
+		clocking_preference_ =
+			(drive_is_sleeping_[0] && drive_is_sleeping_[1] && (!shift_register_ || is_stuck_at_nop) && (inputs_&input_flux))
+				? ClockingHint::Preference::None : ClockingHint::Preference::JustInTime;
 	}

 	// If in writing mode, clocking is real time.


Safety checks added in MyFS example.

Safety checks added in MyFS example.

--- examples/MyFS/myfs.cpp
+++ examples/MyFS/myfs.cpp
@@ -711,6 +711,7 @@
 {
     if ((fd >= openFiles.count()) || (!openFiles.at(fd).nodeAddr) || (!openFiles.at(fd).isRegular))
         return -EBADF;
+    if (this->fd < 0) return -EIO;
     OpenFile &myFile = openFiles[fd];
     if (!(myFile.flags & OPEN_FILE_FLAGS_PREAD))
         return -EBADF;
@@ -762,6 +763,7 @@
 {
     if ((fd >= openFiles.count()) || (!openFiles.at(fd).nodeAddr) || (!openFiles.at(fd).isRegular))
         return -EBADF;
+    if (this->fd < 0) return -EIO;
     OpenFile &myFile = openFiles[fd];
     if (!(myFile.flags & OPEN_FILE_FLAGS_PWRITE))
         return -EBADF;
@@ -828,6 +830,7 @@
     OpenFile *file = &openFiles[fd];
     if (file->flags & OPEN_FILE_FLAGS_MODIFIED)
     {
+        if (this->fd < 0) return -EIO;
         if (lseek(this->fd, file->nodeAddr + 8, SEEK_SET) == SEEK_ERROR)
             return -EIO;
         quint32 mytime = htonl(time(0));
@@ -965,12 +968,18 @@

 int MyFS::sFTruncate(int fd, off_t newsize)
 {
+#if READONLY_FS
+    Q_UNUSED(fd);
+    Q_UNUSED(newsize);
+    return -EROFS;
+#else
     if ((fd >= openFiles.count()) || (!openFiles.at(fd).nodeAddr) || (!openFiles.at(fd).isRegular))
         return -EBADF;
     if (this->fd < 0) return -EIO;
     OpenFile *file = &openFiles[fd];
     file->fileLength = newsize;
     return myTruncate(file.nodeAddr, file.fileLength);
+#endif /* READONLY_FS */
 }

 int MyFS::sFGetAttr(int fd, sAttr &attr)


Renamed some test resource files for consistency.

--- gameplay/src/Animation.cpp
+++ gameplay/src/Animation.cpp
@@ -18,7 +18,7 @@
 Animation::Animation(const char* id, AnimationTarget* target, int propertyId, unsigned int keyCount, unsigned int* keyTimes, float* keyValues, unsigned int type)
     : _controller(Game::getInstance()->getAnimationController()), _id(id), _duration(0L), _defaultClip(NULL), _clips(NULL)
 {
-    createChannel(target, propertyId, keyCount, keyTimes, keyValues, type);
+    createChannel(target, propertyId, keyCount, keyTimes, keyValues, type);

     // Release the animation because a newly created animation has a ref count of 1 and the channels hold the ref to animation.
     release();


[cros] System setting change is correctly reported to a single JS callback.

BUG=106138
TEST=Manual: see bug comment #2

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

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

--- chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
+++ chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc
@@ -227,9 +227,11 @@
     NOTREACHED();
     return;
   }
-  for (PreferenceCallbackMap::const_iterator iter =
-      pref_callback_map_.find(*setting_name);
-      iter != pref_callback_map_.end(); ++iter) {
+  std::pair<PreferenceCallbackMap::const_iterator,
+            PreferenceCallbackMap::const_iterator> range =
+      pref_callback_map_.equal_range(*setting_name);
+  for (PreferenceCallbackMap::const_iterator iter = range.first;
+      iter != range.second; ++iter) {
     const std::wstring& callback_function = iter->second;
     ListValue result_value;
     result_value.Append(base::Value::CreateStringValue(setting_name->c_str()));


Disable flaky PhishingClassifierDelegateTest.DuplicatePageCapture on ASAN
TBR=bryner@chromium.org

BUG=384583

Review URL: https://codereview.chromium.org/335003002

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

--- chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
+++ chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
@@ -567,7 +567,13 @@
   EXPECT_CALL(*classifier_, CancelPendingClassification());
 }

-IN_PROC_BROWSER_TEST_F(PhishingClassifierDelegateTest, DuplicatePageCapture) {
+#if defined(ADDERSS_SANITIZER)
+#define Maybe_DuplicatePageCapture DISABLED_DuplicatePageCapture
+#else
+#define Maybe_DuplicatePageCapture DuplicatePageCapture
+#endif
+IN_PROC_BROWSER_TEST_F(PhishingClassifierDelegateTest,
+                       DISABLED_DuplicatePageCapture) {
   // Tests that a second PageCaptured notification causes classification to
   // be cancelled.
   MockScorer scorer;