performance improvements

performance improvements

 - use QStringRef so we don't allocate
 - remove trim since RFC states that whitespaces are not allowed here
 - remove toLower since we already do that on .get

Signed-off-by: Petar Koretic <0bdc63247af490de2e3f3da15a8939ec28fc7d99@gmail.com>

--- request.hpp
+++ request.hpp
@@ -144,7 +144,7 @@
         return true;
     }

-    QStringList data_list = this->data.split("\r\n");
+    auto data_list = this->data.splitRef("\r\n");
     bool is_body = false;

     for (int i = 0; i < data_list.size(); ++i)
@@ -156,7 +156,7 @@
             continue;
         }

-        QStringList entity_item = data_list.at(i).split(":");
+        auto entity_item = data_list.at(i).split(":");

         if (entity_item.length() < 2 && entity_item.at(0).size() < 1 && !is_body)
         {
@@ -165,15 +165,15 @@
         }
         else if (i == 0 && entity_item.length() < 2)
         {
-            QStringList first_line = entity_item.at(0).split(" ");
-            this->method = first_line.at(0);
-            this->url = first_line.at(1).trimmed();
+            auto first_line = entity_item.at(0).split(" ");
+            this->method = first_line.at(0).toString();
+            this->url = first_line.at(1).toString();
             this->query.setQuery(this->url.query());
-            this->protocol = first_line.at(2).trimmed();
+            this->protocol = first_line.at(2).toString();
             continue;
         }

-        m_header[entity_item.at(0).toLower()] = entity_item.at(1).trimmed().toLower();
+        m_header[entity_item.at(0).toString()] = entity_item.at(1).toString();
     }

     if (m_header.contains("host"))
@@ -183,19 +183,19 @@
     // eg: USER_TOKEN=Yes;test=val
     if (m_header.contains("cookie"))
     {
-        for (const QString &cookie : this->get("cookie").split(";"))
-        {
-            int split = cookie.trimmed().indexOf("=");
+        for (const auto &cookie : this->get("cookie").splitRef(";"))
+        {
+            int split = cookie.indexOf("=");
             if (split == -1)
                 continue;

-            QString key = cookie.left(split).trimmed();
+            auto key = cookie.left(split);
             if (!key.size())
                 continue;

-            QString value = cookie.mid(split + 1).trimmed();
-
-            this->cookies[key.toLower()] = value.toLower();
+            auto value = cookie.mid(split + 1);
+
+            this->cookies[key.toString().toLower()] = value.toString().toLower();
         }
     }


fixed a non-terminating test case

fixed a non-terminating test case

--- examples/undocumented/libshogun/statistics.cpp
+++ examples/undocumented/libshogun/statistics.cpp
@@ -42,8 +42,10 @@
 	difference=CMath::abs(difference);
 	ASSERT(difference<=10E-15);

-	difference=CStatistics::inverse_incomplete_gamma(0, 1-0.95)*3;
-	ASSERT(difference==0);
+	difference=CStatistics::inverse_incomplete_gamma(0.1, 1-0.95)*3;
+	difference-=1.741305315969402;
+	difference=CMath::abs(difference);
+	ASSERT(difference<=10E-15)

 	difference=CStatistics::inverse_incomplete_gamma(2, 1-0.95)*0.1;
 	difference-=0.474386451839058;


When forwarding application stdout and stderr, do not print the usual Passenger logging prefix, making messages more consise and easier to read

--- ext/common/ApplicationPool2/Implementation.cpp
+++ ext/common/ApplicationPool2/Implementation.cpp
@@ -1279,8 +1279,11 @@
 			}
 		} else if (ret == 1 && buf[0] == '\n') {
 			UPDATE_TRACE_POINT();
-			P_LOG(print ? LVL_INFO : LVL_DEBUG,
-				"[App " << pid << " " << name << "] ");
+			if (print) {
+				printf("App %d %s: \n", (int) pid, name);
+			} else {
+				P_DEBUG("App " << pid << " " << name << ": ");
+			}
 		} else {
 			UPDATE_TRACE_POINT();
 			vector<StaticString> lines;
@@ -1290,8 +1293,18 @@
 			}
 			split(StaticString(buf, ret2), '\n', lines);
 			foreach (const StaticString line, lines) {
-				P_LOG(print ? LVL_INFO : LVL_DEBUG,
-					"[App " << pid << " " << name << "] " << line);
+				if (print) {
+					string message = "App ";
+					message.append(toString(pid));
+					message.append(" ");
+					message.append(name);
+					message.append(": ");
+					message.append(line.data(), line.size());
+					message.append("\n");
+					fwrite(message.data(), 1, message.size(), stdout);
+				} else {
+					P_DEBUG("App " << pid << " " << name << ": " << line);
+				}
 			}
 		}


shorten lines

shorten lines

--- clm/clm.cpp
+++ clm/clm.cpp
@@ -356,7 +356,7 @@

         if (span_probability > _cutoff) {
           if (span_probability > max_prob) max_prob = span_probability;
-          buffer << _corpus_names[corpus];
+          buffer << corpus;
           for (int jj = start; jj <= ii; ++jj) {
             buffer << "_";
             if (_censor_slop && _slop_mask[jj]) buffer << "SLOP";


Wccp: CV - fix compile issues with ats_scoped_fd

--- lib/wccp/WccpEndPoint.cc
+++ lib/wccp/WccpEndPoint.cc
@@ -431,7 +431,7 @@
     zret = true; // No process to track, always chatter
   } else {
     // Look for the pid file
-    ats_scoped_fd fd = open(proc_pid_path, O_RDONLY);
+    ats_scoped_fd fd{open(proc_pid_path, O_RDONLY)};
     if (fd >= 0) {
       char buffer[256];
       ssize_t read_count = read(fd, buffer, sizeof(buffer) - 1);
@@ -441,7 +441,7 @@
         if (pid > 0) {
           // If the process is still running, it has an entry in the proc file system, (Linux only)
           sprintf(buffer, "/proc/%d/status", pid);
-          ats_scoped_fd fd2 = open(buffer, O_RDONLY);
+          ats_scoped_fd fd2{open(buffer, O_RDONLY)};
           if (fd2 >= 0) {
             zret = true;
           }


fixing typo

fixing typo

--- extensions/WindowFunctionLib/HammingWindow.cpp
+++ extensions/WindowFunctionLib/HammingWindow.cpp
@@ -7,6 +7,7 @@
  */

 #include "HammingWindow.h"
+

 #define thisTTClass			HammingWindow
 #define thisTTClassName		"hamming"
@@ -29,7 +30,7 @@
 // hanning(x) = 0.5 + 0.5*cos(2*PI*(x-0.5))
 TTErr HammingWindow::calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt data)
 {
-	y = 0.54 + 0.46*cos(kTTwoTPi*(x-0.5));
+	y = 0.54 + 0.46*cos(kTTTwoPi*(x-0.5));
 	return kTTErrNone;
 }


Path.

Path.

--- journal/player_test.cpp
+++ journal/player_test.cpp
@@ -93,14 +93,13 @@
   }
 }

-#if 0
 // This test is only run if the --gtest_filter flag names it explicitly.
 TEST_F(PlayerTest, Debug) {
   if (testing::FLAGS_gtest_filter == test_case_name_ + "." + test_name_) {
     // An example of how journaling may be used for debugging.  You must set
     // |path| and fill the |method_in| and |method_out_return| protocol buffers.
     std::string path =
-        R"(P:\Public Mockingbird\Principia\Journals\JOURNAL.20170312-191519)";
+        R"(P:\Public Mockingbird\Principia\Journals\JOURNAL.20170317-181650)";
     Player player(path);
     int count = 0;
     while (player.Play()) {
@@ -132,7 +131,6 @@
 #endif
   }
 }
-#endif

 }  // namespace journal
 }  // namespace principia


Fix assertion

Fix assertion

--- deltamain/colstore/ColumnMapPage.cpp
+++ deltamain/colstore/ColumnMapPage.cpp
@@ -238,7 +238,7 @@
                         mCleanActions.emplace_back(mUpdatePage, mUpdateStartIdx, mUpdateEndIdx, 0);
                         mUpdateStartIdx = mUpdateEndIdx;
                     }
-                    LOG_ASSERT(mainEndIdx != copyStartIdx, "This case was handled earlier");
+                    LOG_ASSERT(mainEndIdx == 0u || mainEndIdx != copyStartIdx, "This case was handled earlier");
                     mainStartIdx = copyStartIdx;
                     mainEndIdx = copyEndIdx;
                 }


TGeant3::IsNewTrack corrected by F.Carminati

--- TGeant3/TGeant3.cxx
+++ TGeant3/TGeant3.cxx
@@ -15,6 +15,9 @@

 /*
 $Log$
+Revision 1.31  2000/07/13 16:19:10  fca
+Mainly coding conventions + some small bug fixes
+
 Revision 1.30  2000/07/12 08:56:30  fca
 Coding convention correction and warning removal

@@ -1312,7 +1315,7 @@
   //
   // True if the track is not at the boundary of the current volume
   //
-  return (fGctrak->sleng>0);
+  return (fGctrak->sleng==0);
 }

 //_____________________________________________________________________________


INTEGRATION: CWS oj14 (1.16.66); FILE MERGED 2006/12/18 16:54:32 oj 1.16.66.3: RESYNC: (1.17-1.18); FILE MERGED 2006/11/07 12:09:38 oj 1.16.66.2: RESYNC: (1.16-1.17); FILE MERGED 2006/07/04 11:07:27 oj 1.16.66.1: property browser adjustments to remove form dependency

--- extensions/source/propctrlr/propertyeditor.cxx
+++ extensions/source/propctrlr/propertyeditor.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: propertyeditor.cxx,v $
  *
- *  $Revision: 1.18 $
- *
- *  last change: $Author: kz $ $Date: 2006-12-13 12:02:43 $
+ *  $Revision: 1.19 $
+ *
+ *  last change: $Author: rt $ $Date: 2007-07-06 08:52:44 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -307,7 +307,7 @@
     }

     //------------------------------------------------------------------
-    void OPropertyEditor::EnableUpdate()
+    void OPropertyEditor::Update(const ::std::mem_fun_t<void,OBrowserListBox>& _aUpdateFunction)
     {
         // forward this to all our pages
         sal_uInt16 nCount = m_aTabControl.GetPageCount();
@@ -316,22 +316,18 @@
             sal_uInt16 nID = m_aTabControl.GetPageId(i);
             OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
             if (pPage)
-                pPage->getListBox().EnableUpdate();
-        }
-    }
-
+                _aUpdateFunction(&pPage->getListBox());
+        }
+    }
+    //------------------------------------------------------------------
+    void OPropertyEditor::EnableUpdate()
+    {
+        Update(::std::mem_fun(&OBrowserListBox::EnableUpdate));
+    }
     //------------------------------------------------------------------
     void OPropertyEditor::DisableUpdate()
     {
-        // forward this to all our pages
-        sal_uInt16 nCount = m_aTabControl.GetPageCount();
-        for (sal_uInt16 i=0;i<nCount;++i)
-        {
-            sal_uInt16 nID = m_aTabControl.GetPageId(i);
-            OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
-            if (pPage)
-                pPage->getListBox().DisableUpdate();
-        }
+        Update(::std::mem_fun(&OBrowserListBox::DisableUpdate));
     }

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


Fixed bug in anim rotation state checker

--- TemplePlus/anim.cpp
+++ TemplePlus/anim.cpp
@@ -1646,17 +1646,22 @@
 	auto &rot = slot.pCurrentGoal->scratchVal2.floatNum;
 	rot = (float)(M_PI_2 + M_PI * 0.75 - atan2(nodeAbsY - objAbsY, nodeAbsX - objAbsX) );
 	if (rot < 0.0) {
-		rot += (float)6.2831855;//M_PI * 2;
+		rot += (float)6.2831853;//M_PI * 2;
 	}
-	if (rot > 6.2831855) {
-		rot -= (float) 6.2831855;//M_PI * 2;
+	if (rot > 6.2831853) {
+		rot -= (float) 6.2831853;//M_PI * 2;
 	}

-
+
 	auto objRot = obj->GetFloat(obj_f_rotation);
-	if (fabs(objRot - rot) > 0.017453292) {   // 1 degree
+
+
+	if (sin(objRot - rot) > 0.017453292)    // 1 degree
 		return 0;
-	}
+
+	if (cos(objRot) - cos(rot) > 0.017453292) // in case it's a 180 degrees difference
+		return 0;
+
 	return 1;
 }


Lookup all terminal capabilities on initialisation.

--- src/main/cpp/posix.cpp
+++ src/main/cpp/posix.cpp
@@ -90,7 +90,15 @@
  * Terminfo functions
  */

-int current_terminal = -1;
+#define NORMAL_TEXT 0
+#define BRIGHT_TEXT 1
+#define FOREGROUND_COLOR 2
+#define CURSOR_UP 3
+#define CURSOR_DOWN 4
+#define CURSOR_LEFT 5
+#define CURSOR_RIGHT 6
+#define CURSOR_START_LINE 7
+#define CLEAR_END_OF_LINE 8

 #ifdef SOLARIS
 #define TERMINAL_CHAR_TYPE char
@@ -98,36 +106,37 @@
 #define TERMINAL_CHAR_TYPE int
 #endif

+int current_terminal = -1;
+const char* terminal_capabilities[9];
+
 int write_to_terminal(TERMINAL_CHAR_TYPE ch) {
     write(current_terminal, &ch, 1);
 }

 void write_capability(JNIEnv *env, const char* capability, jobject result) {
-    char* cap = tgetstr((char*)capability, NULL);
-    if (cap == NULL) {
+    if (capability == NULL) {
         mark_failed_with_message(env, "unknown terminal capability", result);
         return;
     }
-    if (tputs(cap, 1, write_to_terminal) == ERR) {
+    if (tputs(capability, 1, write_to_terminal) == ERR) {
         mark_failed_with_message(env, "could not write to terminal", result);
         return;
     }
 }

 void write_param_capability(JNIEnv *env, const char* capability, int count, jobject result) {
-    char* cap = tgetstr((char*)capability, NULL);
-    if (cap == NULL) {
+    if (capability == NULL) {
         mark_failed_with_message(env, "unknown terminal capability", result);
         return;
     }

-    cap = tparm(cap, count, 0, 0, 0, 0, 0, 0, 0, 0);
-    if (cap == NULL) {
+    capability = tparm((char*)capability, count, 0, 0, 0, 0, 0, 0, 0, 0);
+    if (capability == NULL) {
         mark_failed_with_message(env, "could not format terminal capability string", result);
         return;
     }

-    if (tputs(cap, 1, write_to_terminal) == ERR) {
+    if (tputs(capability, 1, write_to_terminal) == ERR) {
         mark_failed_with_message(env, "could not write to terminal", result);
         return;
     }
@@ -139,72 +148,82 @@
         mark_failed_with_message(env, "not a terminal", result);
         return;
     }
-    char* termType = getenv("TERM");
-    if (termType == NULL) {
-        mark_failed_with_message(env, "$TERM not set", result);
-        return;
-    }
-    int retval = tgetent(NULL, termType);
-    if (retval != 1) {
-        mark_failed_with_message(env, "could not get termcap entry", result);
-        return;
+    if (current_terminal < 0) {
+        char* termType = getenv("TERM");
+        if (termType == NULL) {
+            mark_failed_with_message(env, "$TERM not set", result);
+            return;
+        }
+        int retval = tgetent(NULL, termType);
+        if (retval != 1) {
+            mark_failed_with_message(env, "could not get termcap entry", result);
+            return;
+        }
+        terminal_capabilities[NORMAL_TEXT] = tgetstr((char*)"me", NULL);
+        terminal_capabilities[BRIGHT_TEXT] = tgetstr((char*)"md", NULL);
+        terminal_capabilities[FOREGROUND_COLOR] = tgetstr((char*)"AF", NULL);
+        terminal_capabilities[CURSOR_UP] = tgetstr((char*)"up", NULL);
+        terminal_capabilities[CURSOR_DOWN] = tgetstr((char*)"do", NULL);
+        terminal_capabilities[CURSOR_LEFT] = tgetstr((char*)"le", NULL);
+        terminal_capabilities[CURSOR_RIGHT] = tgetstr((char*)"nd", NULL);
+        terminal_capabilities[CURSOR_START_LINE] = tgetstr((char*)"cr", NULL);
+        terminal_capabilities[CLEAR_END_OF_LINE] = tgetstr((char*)"ce", NULL);
     }
     current_terminal = output + 1;
-    write_capability(env, "me", result);
+    write_capability(env, terminal_capabilities[NORMAL_TEXT], result);
 }

 JNIEXPORT void JNICALL
 Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_bold(JNIEnv *env, jclass target, jobject result) {
-    write_capability(env, "md", result);
+    write_capability(env, terminal_capabilities[BRIGHT_TEXT], result);
 }

 JNIEXPORT void JNICALL
 Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_reset(JNIEnv *env, jclass target, jobject result) {
-    write_capability(env, "me", result);
+    write_capability(env, terminal_capabilities[NORMAL_TEXT], result);
 }

 JNIEXPORT void JNICALL
 Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_foreground(JNIEnv *env, jclass target, jint color, jobject result) {
-    write_param_capability(env, "AF", color, result);
+    write_param_capability(env, terminal_capabilities[FOREGROUND_COLOR], color, result);
 }

 JNIEXPORT void JNICALL
 Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_up(JNIEnv *env, jclass target, jint count, jobject result) {
     for (jint i = 0; i < count; i++) {
-        write_capability(env, "up", result);
+        write_capability(env, terminal_capabilities[CURSOR_UP], result);
     }
 }

 JNIEXPORT void JNICALL
 Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_down(JNIEnv *env, jclass target, jint count, jobject result) {
     for (jint i = 0; i < count; i++) {
-        write_capability(env, "do", result);
+        write_capability(env, terminal_capabilities[CURSOR_DOWN], result);
     }
 }

 JNIEXPORT void JNICALL
 Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_left(JNIEnv *env, jclass target, jint count, jobject result) {
     for (jint i = 0; i < count; i++) {
-        write_capability(env, "le", result);
+        write_capability(env, terminal_capabilities[CURSOR_LEFT], result);
     }
 }

 JNIEXPORT void JNICALL
 Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_right(JNIEnv *env, jclass target, jint count, jobject result) {
     for (jint i = 0; i < count; i++) {
-        write_capability(env, "nd", result);
+        write_capability(env, terminal_capabilities[CURSOR_RIGHT], result);
     }
 }

 JNIEXPORT void JNICALL
 Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_startLine(JNIEnv *env, jclass target, jobject result) {
-    write_capability(env, "cr", result);
+    write_capability(env, terminal_capabilities[CURSOR_START_LINE], result);
 }

 JNIEXPORT void JNICALL
 Java_net_rubygrapefruit_platform_internal_jni_TerminfoFunctions_clearToEndOfLine(JNIEnv *env, jclass target, jobject result) {
-    write_capability(env, "ce", result);
-}
-
+    write_capability(env, terminal_capabilities[CLEAR_END_OF_LINE], result);
+}

 #endif


- using fatal's benchmark framework in existing benchmarks

--- fatal/type/benchmark/prefix_tree_benchmark.cpp
+++ fatal/type/benchmark/prefix_tree_benchmark.cpp
@@ -73,7 +73,7 @@
   static void prefix_tree_benchmark() {
     unsigned count = 0;

-    BENCHMARK_SUSPEND {}
+    FATAL_BENCHMARK_SUSPEND {}

     for (auto const &s: str) {
       prefix_tree::template match<>::exact(
@@ -87,7 +87,7 @@
   static void sequential_ifs_benchmark() {
     unsigned count = 0;

-    BENCHMARK_SUSPEND {}
+    FATAL_BENCHMARK_SUSPEND {}

     for (auto const &s: str) {
       sequential_ifs_impl<TStrings...>::match(s, count);
@@ -100,7 +100,7 @@
     std::array<std::string, list::size> c = str;
     unsigned count = 0;

-    BENCHMARK_SUSPEND {
+    FATAL_BENCHMARK_SUSPEND {
       std::sort(c.begin(), c.end());
     }

@@ -115,7 +115,7 @@
     std::vector<std::string> c;
     unsigned count = 0;

-    BENCHMARK_SUSPEND {
+    FATAL_BENCHMARK_SUSPEND {
       for (auto const &s: str) {
         c.push_back(s);
       }
@@ -134,7 +134,7 @@
     std::set<std::string> c;
     unsigned count = 0;

-    BENCHMARK_SUSPEND {
+    FATAL_BENCHMARK_SUSPEND {
       for (auto const &s: str) {
         c.insert(s);
       }
@@ -152,7 +152,7 @@
     std::unordered_set<std::string> c;
     unsigned count = 0;

-    BENCHMARK_SUSPEND {
+    FATAL_BENCHMARK_SUSPEND {
       for (auto const &s: str) {
         c.insert(s);
       }
@@ -190,27 +190,27 @@
     folly::doNotOptimizeAway(count); \
     return count; \
   }(); \
-  BENCHMARK(name##_type_prefix_tree) { \
+  FATAL_BENCHMARK(name##_type_prefix_tree) { \
     folly::doNotOptimizeAway(name##_warmup); \
     name##_impl::prefix_tree_benchmark(); \
   } \
-  BENCHMARK_RELATIVE(name##_sorted_std_array) { \
+  FATAL_BENCHMARK(name##_sorted_std_array) { \
     folly::doNotOptimizeAway(name##_warmup); \
     name##_impl::sorted_std_array_benchmark(); \
   } \
-  BENCHMARK_RELATIVE(name##_sorted_std_vector) { \
+  FATAL_BENCHMARK(name##_sorted_std_vector) { \
     folly::doNotOptimizeAway(name##_warmup); \
     name##_impl::sorted_std_vector_benchmark(); \
   } \
-  BENCHMARK_RELATIVE(name##_std_unordered_set) { \
+  FATAL_BENCHMARK(name##_std_unordered_set) { \
     folly::doNotOptimizeAway(name##_warmup); \
     name##_impl::std_unordered_set_benchmark(); \
   } \
-  BENCHMARK_RELATIVE(name##_std_set) { \
+  FATAL_BENCHMARK(name##_std_set) { \
     folly::doNotOptimizeAway(name##_warmup); \
     name##_impl::std_set_benchmark(); \
   } \
-  BENCHMARK_RELATIVE(name##_sequential_ifs) { \
+  FATAL_BENCHMARK(name##_sequential_ifs) { \
     folly::doNotOptimizeAway(name##_warmup); \
     name##_impl::sequential_ifs_benchmark(); \
   }
@@ -363,7 +363,6 @@
 CREATE_BENCHMARK(n1_len10, s10_00);
 CREATE_BENCHMARK(n1_len20, s20_00);
 CREATE_BENCHMARK(n1_len30, s30_00);
-BENCHMARK_DRAW_LINE();

 ///////////
 // n = 2 //
@@ -373,7 +372,6 @@
 CREATE_BENCHMARK(n2_len10, s10_00, s10_01);
 CREATE_BENCHMARK(n2_len20, s20_00, s20_01);
 CREATE_BENCHMARK(n2_len30, s30_00, s30_01);
-BENCHMARK_DRAW_LINE();

 ///////////
 // n = 3 //
@@ -383,7 +381,6 @@
 CREATE_BENCHMARK(n3_len10, s10_00, s10_01, s10_02);
 CREATE_BENCHMARK(n3_len20, s20_00, s20_01, s20_02);
 CREATE_BENCHMARK(n3_len30, s30_00, s30_01, s30_02);
-BENCHMARK_DRAW_LINE();

 ///////////
 // n = 4 //
@@ -393,7 +390,6 @@
 CREATE_BENCHMARK(n4_len10, s10_00, s10_01, s10_02, s10_03);
 CREATE_BENCHMARK(n4_len20, s20_00, s20_01, s20_02, s20_03);
 CREATE_BENCHMARK(n4_len30, s30_00, s30_01, s30_02, s30_03);
-BENCHMARK_DRAW_LINE();

 ///////////
 // n = 5 //
@@ -403,7 +399,6 @@
 CREATE_BENCHMARK(n5_len10, s10_00, s10_01, s10_02, s10_03, s10_04);
 CREATE_BENCHMARK(n5_len20, s20_00, s20_01, s20_02, s20_03, s20_04);
 CREATE_BENCHMARK(n5_len30, s30_00, s30_01, s30_02, s30_03, s30_04);
-BENCHMARK_DRAW_LINE();

 ////////////
 // n = 10 //
@@ -428,8 +423,6 @@
   s30_00, s30_01, s30_02, s30_03, s30_04,
   s30_05, s30_06, s30_07, s30_08, s30_09
 );
-
-BENCHMARK_DRAW_LINE();

 ////////////
 // n = 20 //
@@ -462,8 +455,6 @@
   s30_10, s30_11, s30_12, s30_13, s30_14,
   s30_15, s30_16, s30_17, s30_18, s30_19
 );
-
-BENCHMARK_DRAW_LINE();

 ////////////
 // n = 30 //


Don't re-create the QueryResult every time the View is changed.

--- src/mainframe_impl.cpp
+++ src/mainframe_impl.cpp
@@ -297,13 +297,8 @@
 	wxListCtrl* list = this->activeView->serverList;
 	std::vector<Label*>	columns = this->GetViewableLabels();

-	if( this->activeView->result == NULL )
+	if( this->activeView->result == NULL )
 		this->activeView->result = app.dataControl.search(this->activeView->query);
-	else {
-		wxLogDebug(_T("Using QueryResult %p"), this->activeView->result);
-		delete this->activeView->result;
-		this->activeView->result = app.dataControl.search(this->activeView->query);
-	}

 	wxLogDebug(_T("Query: '%s' found %d matches"), this->activeView->query.get().c_str(), this->activeView->result->size());


CPU memory size allocation fixes

CPU memory size allocation fixes

--- cnn/init.cc
+++ cnn/init.cc
@@ -83,8 +83,8 @@
             fxs = new AlignedMemoryPool<ALIGN>(512UL * (1UL << 20));
             dEdfs = new AlignedMemoryPool<ALIGN>(512UL * (1UL << 20));
 #else
-            fxs = new AlignedMemoryPool<ALIGN>(512UL * (1UL << 24));
-            dEdfs = new AlignedMemoryPool<ALIGN>(512UL * (1UL << 24));
+            fxs = new AlignedMemoryPool<ALIGN>(512UL * (1UL << 22));
+            dEdfs = new AlignedMemoryPool<ALIGN>(512UL * (1UL << 22));
 #endif
         }
         cerr << "Done.\n";


Fixes: NB#203668 - M_STYLE_MODE macro only accepts valid C++ identifier

RevBy: Holger Schröder
MR: 1688

Details:
Prepends an underscore to the style mode names from from MGen so it
allows the usage of non-C++ identifiers (like digits).

--- mgen/mgen_processor.cpp
+++ mgen/mgen_processor.cpp
@@ -618,7 +618,7 @@
         h << "private:\n";
         QList<QString>::const_iterator iterator = modes.constBegin();
         for (; iterator != modes.constEnd(); ++iterator) {
-            h << "    const MStyle* " << iterator->toLower() << "Style[2];\n";
+            h << "    const MStyle* _" << iterator->toLower() << "Style[2];\n";
         }

         h << "};\n\n";
@@ -884,8 +884,8 @@
         cpp << "{\n";
         QList<QString>::const_iterator iterator = modes.constBegin();
         for (; iterator != modes.constEnd(); ++iterator) {
-            cpp << "    " << iterator->toLower() << "Style[M::Landscape] = NULL;\n";
-            cpp << "    " << iterator->toLower() << "Style[M::Portrait] = NULL;\n";
+            cpp << "    _" << iterator->toLower() << "Style[M::Landscape] = NULL;\n";
+            cpp << "    _" << iterator->toLower() << "Style[M::Portrait] = NULL;\n";
         }
         cpp << "}\n\n";

@@ -894,8 +894,8 @@
         cpp << "{\n";
         iterator = modes.begin();
         for (; iterator != modes.end(); ++iterator) {
-            cpp << "    MTheme::releaseStyle(" << iterator->toLower() << "Style[M::Landscape]);\n";
-            cpp << "    MTheme::releaseStyle(" << iterator->toLower() << "Style[M::Portrait]);\n";
+            cpp << "    MTheme::releaseStyle(_" << iterator->toLower() << "Style[M::Landscape]);\n";
+            cpp << "    MTheme::releaseStyle(_" << iterator->toLower() << "Style[M::Portrait]);\n";
         }
         cpp << "}\n\n\n";


DDF: Extract function to get Simple Descriptor for server cluster

--- device.cpp
+++ device.cpp
@@ -303,6 +303,26 @@
     }
 }

+/*! Returns the first Simple Descriptor for a given server \p clusterId or nullptr if not found.
+ */
+const deCONZ::SimpleDescriptor *DEV_GetSimpleDescriptorForServerCluster(const Device *device, deCONZ::ZclClusterId_t clusterId)
+{
+    for (const auto &sd : device->node()->simpleDescriptors())
+    {
+        const auto cluster = std::find(sd.inClusters().cbegin(), sd.inClusters().cend(), [clusterId](const deCONZ::ZclCluster &cl)
+        {
+            return cl.id_t() == clusterId;
+        });
+
+        if (cluster != sd.inClusters().cend())
+        {
+            return &sd;
+        }
+    }
+
+    return nullptr;
+}
+
 /*! #4 This state checks that modelId of the device is known.
     TODO this should read all common basic cluster attributes needed to match a DDF,
     e.g. modelId, manufacturer name, application version, etc.
@@ -342,43 +362,28 @@
         }
         else // query modelId from basic cluster
         {
-            quint8 basicClusterEp = 0x00;
-
-            for (const auto ep : device->node()->endpoints())
-            {
-                deCONZ::SimpleDescriptor sd;
-                if (device->node()->copySimpleDescriptor(ep, &sd) == 0)
-                {
-                    const auto *cluster = sd.cluster(0x0000, deCONZ::ServerCluster);
-                    if (cluster)
-                    {
-                        basicClusterEp = ep;
-                        break;
-                    }
-                }
-            }
-
-            if (basicClusterEp != 0x00)
-            {
-                modelId->setReadParameters({QLatin1String("readGenericAttribute/4"), basicClusterEp, 0x0000, 0x0005, 0x0000});
-                modelId->setParseParameters({QLatin1String("parseGenericAttribute/4"), basicClusterEp, 0x0000, 0x0005, "$raw"});
+            const auto *sd = DEV_GetSimpleDescriptorForServerCluster(device, 0x0000_clid);
+
+            if (sd)
+            {
+                modelId->setReadParameters({QLatin1String("readGenericAttribute/4"), sd->endpoint(), 0x0000, 0x0005, 0x0000});
+                modelId->setParseParameters({QLatin1String("parseGenericAttribute/4"), sd->endpoint(), 0x0000, 0x0005, "$raw"});
                 auto readFunction = getReadFunction(readFunctions, modelId->readParameters());

                 if (readFunction && readFunction(device, modelId, deCONZ::ApsController::instance()))
                 {
-
+                    device->startStateTimer(MinMacPollRxOn);
                 }
                 else
                 {
-                    DBG_Printf(DBG_INFO, "Failed to read %s: 0x%016llX on endpoint: 0x%02X\n", modelId->descriptor().suffix, device->key(), basicClusterEp);
+                    DBG_Printf(DBG_INFO, "Failed to read %s: 0x%016llX on endpoint: 0x%02X\n", modelId->descriptor().suffix, device->key(), sd->endpoint());
                 }
             }
             else
             {
                 DBG_Printf(DBG_INFO, "TODO no basic cluster found to read modelId: 0x%016llX\n", device->key());
-            }
-
-            device->startStateTimer(MinMacPollRxOn);
+                device->setState(DEV_InitStateHandler);
+            }
         }
     }
     else if (event.what() == RAttrModelId)


Get a reference of session manager on service handler construction

--- server/handlers/MediaSessionServiceHandler.cpp
+++ server/handlers/MediaSessionServiceHandler.cpp
@@ -11,9 +11,11 @@
 namespace com { namespace kurento { namespace kms {

 MediaSessionServiceHandler::MediaSessionServiceHandler() {
+	manager = MediaSessionManager::getInstance();
 }

 MediaSessionServiceHandler::~MediaSessionServiceHandler() {
+	MediaSessionManager::releaseInstance(manager);
 }

 void


Coverity 18434

Coverity 18434

--- ITS/AliITSV0Finder.cxx
+++ ITS/AliITSV0Finder.cxx
@@ -555,7 +555,8 @@
       //
       //
       //
-      Double_t phase[2][2],radius[2];
+      Double_t phase[2][2]={0.,0.,0.,0.};
+      Double_t radius[2]={0.,0.};
       Int_t  points = h1.GetRPHIintersections(h2, phase, radius);
       if    (points==0) {
 	//	cutN=1;


mem: Fix for 100% write threshold in DRAM controller

This patch fixes the controller when a write threshold of 100% is
used.  Earlier for 100% write threshold no data is written to memory
as writes never get triggered since this corner case is not
considered.

--- src/mem/simple_dram.cc
+++ src/mem/simple_dram.cc
@@ -563,7 +563,7 @@
     accessAndRespond(pkt, frontendLatency);

     // If your write buffer is starting to fill up, drain it!
-    if (writeQueue.size() > writeThreshold && !stopReads){
+    if (writeQueue.size() >= writeThreshold && !stopReads){
         triggerWrites();
     }
 }


optimization of level scheduling

optimization of level scheduling

--- LevelSchedule.cpp
+++ LevelSchedule.cpp
@@ -324,7 +324,7 @@
           int jEnd = extptr[pred];
           for (int j = jBegin; j < jEnd; ++j) {
             int succ = colidx[j] - BASE;
-            if (succ < 0 || succ >= m) continue; // for a "fat" matrices with halo
+            if (succ >= m) continue; // for a "fat" matrices with halo
             --nparents[succ];
             assert(nparents[succ] >= 0);
             if (nparents[succ] == 0) {
@@ -405,7 +405,7 @@
         int jEnd = extptr[pred];
         for (int j = jBegin; j < jEnd; ++j) {
           int succ = colidx[j] - BASE;
-          if (succ < 0 || succ >= m) continue; // for a "fat" matrices with halo
+          if (succ >= m) continue; // for a "fat" matrices with halo
           if (__sync_fetch_and_add(nparents + succ, -1) == 1) {
             *tailPtr = succ;
             *(rowPtr + 1) =
@@ -546,11 +546,7 @@

 #pragma omp for
   for (int i = 0; i < n; ++i) {
-    int cnt = 0;
-    for (int j = rowptr[i]; j < diagptr[i]; ++j) {
-      if (colidx[j] >= 0) ++cnt;
-    }
-    nparents[i] = cnt;
+    nparents[i] = diagptr[i] - rowptr[i];
     if (nparents[i] == 0) {
       *tailPtr = i;
       *(rowPtr + 1) = *rowPtr + extptr[i] - diagptr[i] - 1;
@@ -941,15 +937,8 @@
     int invSize = 0;
     for (int i1Perm = taskBoundaries[v1]; i1Perm < taskBoundaries[v1 + 1]; ++i1Perm) {
       int i1 = threadContToOrigPerm[i1Perm];
-
-      for (int j = rowptr[i1]; j < diagptr[i1]; ++j) {
-        if (colidx[j] - BASE >= 0 && colidx[j] - BASE < m) ++invSize;
-      }
-      ++invSize; // additional 1 for intra-thread dependency
-
-      for (int j = diagptr[i1] + 1; j < extptr[i1]; ++j) {
-        if (colidx[j] - BASE >= 0 && colidx[j] - BASE < m) ++size;
-      }
+      size += extptr[i1] - diagptr[i1] - 1;
+      invSize += diagptr[i1] - rowptr[i1] + 1; // additional 1 for intra-thread
     }
     taskAdjacency.rowptr[v1] = origRowPtrCnt;
     taskInvAdjacency.rowptr[v1] = origInvRowPtrCnt;
@@ -1052,7 +1041,6 @@
         int begin = diagptr[i1] + 1;
         int end = extptr[i1];
         for (int j = begin; j < end; ++j) {
-          if (colidx[j] - BASE < 0 || colidx[j] - BASE >= m) continue;
           int v = origRowIdToTaskId[colidx[j] - BASE];
           if (v < boundaryBegin || v >= boundaryEnd) {
             i2s[size] = v;
@@ -1389,7 +1377,7 @@

   printf(
     "average degree = %f\n",
-    (double)perThreadRowPtrSum[nthreads]/(levIndices.size() - 2)/nthreads);
+    (double)perThreadRowPtrSum[nthreads]/(schedule->levIndices.size() - 2)/nthreads);
   fflush(stdout);

   t = __rdtsc();
@@ -1736,7 +1724,7 @@
   }
   printf(
     "average degree after reduction = %f\n",
-    (double)numNewEdgesSum/(levIndices.size() - 2)/nthreads);
+    (double)numNewEdgesSum/(schedule->levIndices.size() - 2)/nthreads);
 #endif

   if (useMemoryPool) {
@@ -1770,7 +1758,7 @@
   printf("mergables = %f\n", (double)mergeables/threadBoundariesForward[nthreads]);*/

 #ifdef TRSOLVER_LOG
-  printf("parallelism = %f\n", (double)m/(levIndices.size() - 1));
+  printf("parallelism = %f\n", (double)m/(schedule->levIndices.size() - 1));
 #endif
 }


INTEGRATION: CWS changefileheader (1.2.224); FILE MERGED 2008/04/01 15:18:16 thb 1.2.224.3: #i85898# Stripping all external header guards 2008/04/01 10:57:46 thb 1.2.224.2: #i85898# Stripping all external header guards 2008/03/28 15:34:36 rt 1.2.224.1: #i87441# Change license header to LPGL v3.

--- framework/inc/dispatch/popupmenudispatcher.hxx
+++ framework/inc/dispatch/popupmenudispatcher.hxx
@@ -1,35 +1,30 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
- *
- *  $RCSfile: popupmenudispatcher.hxx,v $
- *
- *  $Revision: 1.2 $
- *
- *  last change: $Author: kz $ $Date: 2006-12-13 15:03:56 $
- *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
- *
- *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: popupmenudispatcher.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

@@ -40,84 +35,37 @@
 //  my own includes
 //_________________________________________________________________________________________________________________

-#ifndef __FRAMEWORK_SERVICES_FRAME_HXX_
 #include <services/frame.hxx>
-#endif
 /*
-#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_
 #include <macros/generic.hxx>
-#endif
 */
-#ifndef __FRAMEWORK_MACROS_XINTERFACE_HXX_
 #include <macros/xinterface.hxx>
-#endif
-#ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
 #include <macros/xtypeprovider.hxx>
-#endif
-#ifndef __FRAMEWORK_MACROS_XSERVICEINFO_HXX_
 #include <macros/xserviceinfo.hxx>
-#endif
 /*
-#ifndef __FRAMEWORK_MACROS_DEBUG_HXX_
 #include <macros/debug.hxx>
-#endif
 */
-#ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_
 #include <threadhelp/threadhelpbase.hxx>
-#endif
-#ifndef __FRAMEWORK_GENERAL_H_
 #include <general.h>
-#endif
-#ifndef __FRAMEWORK_STDTYPES_H_
 #include <stdtypes.h>
-#endif

 //_________________________________________________________________________________________________________________
 //  interface includes
 //_________________________________________________________________________________________________________________
-
-#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
 #include <com/sun/star/lang/XTypeProvider.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
 #include <com/sun/star/frame/XDispatch.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
 #include <com/sun/star/frame/XDispatchProvider.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UTIL_URL_HPP_
 #include <com/sun/star/util/URL.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_DISPATCHDESCRIPTOR_HPP_
 #include <com/sun/star/frame/DispatchDescriptor.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
 #include <com/sun/star/beans/PropertyValue.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_
 #include <com/sun/star/frame/XStatusListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XFRAMELOADER_HPP_
 #include <com/sun/star/frame/XFrameLoader.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XLOADEVENTLISTENER_HPP_
 #include <com/sun/star/frame/XLoadEventListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
 #include <com/sun/star/frame/XDesktop.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_FEATURESTATEEVENT_HPP_
 #include <com/sun/star/frame/FeatureStateEvent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HPP_
 #include <com/sun/star/frame/XFrameActionListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
 #include <com/sun/star/lang/XInitialization.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
 #include <com/sun/star/container/XNameAccess.hpp>
-#endif
 #ifndef _COM_SUN_STAR_URI_XURLREFERENCEFACTORY_HPP_
 #include <com/sun/star/uri/XUriReferenceFactory.hpp>
 #endif
@@ -128,16 +76,9 @@
 //_________________________________________________________________________________________________________________
 //  other includes
 //_________________________________________________________________________________________________________________
-
-#ifndef _CPPUHELPER_WEAK_HXX_
 #include <cppuhelper/weak.hxx>
-#endif
-#ifndef _CPPUHELPER_WEAKREF_HXX_
 #include <cppuhelper/weakref.hxx>
-#endif
-#ifndef _CPPUHELPER_INTERFACECONTAINER_H_
 #include <cppuhelper/interfacecontainer.h>
-#endif

 //_________________________________________________________________________________________________________________
 //  namespace


INTEGRATION: CWS warnings01 (1.4.32); FILE MERGED 2005/11/16 13:10:35 pl 1.4.32.1: #i55991# removed warnings

--- framework/source/dispatch/mailtodispatcher.cxx
+++ framework/source/dispatch/mailtodispatcher.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: mailtodispatcher.cxx,v $
  *
- *  $Revision: 1.4 $
- *
- *  last change: $Author: rt $ $Date: 2005-09-09 01:20:36 $
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: hr $ $Date: 2006-06-19 11:16:25 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -176,8 +176,8 @@
     @modified   02.05.2002 15:25, as96863
 */
 css::uno::Reference< css::frame::XDispatch > SAL_CALL MailToDispatcher::queryDispatch( const css::util::URL&  aURL    ,
-                                                                                const ::rtl::OUString& sTarget ,
-                                                                                sal_Int32        nFlags  ) throw( css::uno::RuntimeException )
+                                                                                const ::rtl::OUString& /*sTarget*/ ,
+                                                                                sal_Int32        /*nFlags*/  ) throw( css::uno::RuntimeException )
 {
     css::uno::Reference< css::frame::XDispatch > xDispatcher;
     if (aURL.Complete.compareToAscii(PROTOCOL_VALUE,PROTOCOL_LENGTH)==0)
@@ -292,7 +292,7 @@
     @modified   30.04.2002 14:49, as96863
 */
 sal_Bool MailToDispatcher::implts_dispatch( const css::util::URL&                                  aURL       ,
-                                            const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException )
+                                            const css::uno::Sequence< css::beans::PropertyValue >& /*lArguments*/ ) throw( css::uno::RuntimeException )
 {
     sal_Bool bSuccess = sal_False;

@@ -339,16 +339,16 @@

     @modified   30.04.2002 14:49, as96863
 */
-void SAL_CALL MailToDispatcher::addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
-                                                   const css::util::URL&                                     aURL      ) throw( css::uno::RuntimeException )
+void SAL_CALL MailToDispatcher::addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xListener*/ ,
+                                                   const css::util::URL&                                     /*aURL*/      ) throw( css::uno::RuntimeException )
 {
     // not suported yet
 }

 //_________________________________________________________________________________________________________________

-void SAL_CALL MailToDispatcher::removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
-                                                      const css::util::URL&                                     aURL      ) throw( css::uno::RuntimeException )
+void SAL_CALL MailToDispatcher::removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xListener*/ ,
+                                                      const css::util::URL&                                     /*aURL*/      ) throw( css::uno::RuntimeException )
 {
     // not suported yet
 }


enabled sparse dist matrix (preliminary)

--- ripser.cpp
+++ ripser.cpp
@@ -258,32 +258,38 @@
 	return i == j ? 0 : i > j ? rows[j][i] : rows[i][j];
 }

-//struct sparse_distance_matrix {
-//	std::vector<std::vector<index_diameter_t>> neighbors;
-//
-//	index_t num_edges;
-//
-//	mutable std::vector<std::vector<index_diameter_t>::const_reverse_iterator> neighbor_it;
-//	mutable std::vector<std::vector<index_diameter_t>::const_reverse_iterator> neighbor_end;
-//
-//	sparse_distance_matrix(std::vector<std::vector<index_diameter_t>>&& _neighbors,
-//	                       index_t _num_edges)
-//	    : neighbors(std::move(_neighbors)), num_edges(_num_edges) {}
-//
-//	template <typename DistanceMatrix>
-//	sparse_distance_matrix(const DistanceMatrix& mat, const value_t threshold)
-//	    : neighbors(mat.size()), num_edges(0) {
-//
-//		for (size_t i = 0; i < size(); ++i)
-//			for (size_t j = 0; j < size(); ++j)
-//				if (i != j && mat(i, j) <= threshold) {
-//					++num_edges;
-//					neighbors[i].push_back({j, mat(i, j)});
-//				}
-//	}
-//
-//	size_t size() const { return neighbors.size(); }
-//};
+struct sparse_distance_matrix {
+	std::vector<std::vector<index_diameter_t>> neighbors;
+
+	index_t num_edges;
+
+	mutable std::vector<std::vector<index_diameter_t>::const_reverse_iterator> neighbor_it;
+	mutable std::vector<std::vector<index_diameter_t>::const_reverse_iterator> neighbor_end;
+
+	sparse_distance_matrix(std::vector<std::vector<index_diameter_t>>&& _neighbors,
+	                       index_t _num_edges)
+	    : neighbors(std::move(_neighbors)), num_edges(_num_edges) {}
+
+	template <typename DistanceMatrix>
+	sparse_distance_matrix(const DistanceMatrix& mat, const value_t threshold)
+	    : neighbors(mat.size()), num_edges(0) {
+
+		for (size_t i = 0; i < size(); ++i)
+			for (size_t j = 0; j < size(); ++j)
+				if (i != j && mat(i, j) <= threshold) {
+					++num_edges;
+					neighbors[i].push_back({j, mat(i, j)});
+				}
+	}
+
+	value_t operator()(const index_t i, const index_t j) const {
+		for (auto neighbor: neighbors[i])
+			if (get_index(neighbor) == j) return get_diameter(neighbor);
+		return std::numeric_limits<value_t>::infinity();
+	}
+
+	size_t size() const { return neighbors.size(); }
+};

 struct euclidean_distance_matrix {
 	std::vector<std::vector<value_t>> points;
@@ -453,7 +459,6 @@
 		std::vector<index_t>& vertices;
 		const diameter_entry_t simplex;
 		const coefficient_t modulus;
-		const compressed_lower_distance_matrix& dist;
 		const binomial_coeff_table& binomial_coeff;
 		const index_t dim;
 		const ripser& parent;
@@ -462,7 +467,7 @@
 		simplex_boundary_enumerator(const diameter_entry_t _simplex, const index_t _dim,
 									const ripser& _parent)
 		: idx_below(get_index(_simplex)), idx_above(0), v(_parent.n - 1), k(_dim + 1),
-		vertices(_parent.vertices), simplex(_simplex), modulus(_parent.modulus), dist(_parent.dist),
+		vertices(_parent.vertices), simplex(_simplex), modulus(_parent.modulus),
 		binomial_coeff(_parent.binomial_coeff), dim(_dim), parent(_parent) {
 			vertices.resize(dim + 1);
 			parent.get_simplex_vertices(get_index(_simplex), _dim, parent.n, vertices.begin());
@@ -581,7 +586,7 @@

 #ifdef INDICATE_PROGRESS
 		std::cerr << clear_line << "sorting " << columns_to_reduce.size() << " columns"
-		          << std::endl;
+		          << std::flush;
 #endif

 		std::sort(columns_to_reduce.begin(), columns_to_reduce.end(),
@@ -865,68 +870,68 @@
 	}
 };

-//template <> class ripser<sparse_distance_matrix>::simplex_coboundary_enumerator {
-//	const ripser& parent;
-//	index_t idx_below, idx_above, k;
-//	std::vector<index_t> vertices;
-//	const diameter_entry_t simplex;
-//	const coefficient_t modulus;
-//	const sparse_distance_matrix& dist;
-//	const binomial_coeff_table& binomial_coeff;
-//	std::vector<std::vector<index_diameter_t>::const_reverse_iterator>& neighbor_it;
-//	std::vector<std::vector<index_diameter_t>::const_reverse_iterator>& neighbor_end;
-//	index_diameter_t neighbor;
-//
-//public:
-//	simplex_coboundary_enumerator(const diameter_entry_t _simplex, const index_t _dim,
-//	                              const ripser& _parent)
-//	    : parent(_parent), idx_below(get_index(_simplex)), idx_above(0), k(_dim + 1),
-//	      vertices(_dim + 1), simplex(_simplex), modulus(parent.modulus), dist(parent.dist),
-//	      binomial_coeff(parent.binomial_coeff), neighbor_it(dist.neighbor_it),
-//	      neighbor_end(dist.neighbor_end) {
-//		neighbor_it.clear();
-//		neighbor_end.clear();
-//
-//		parent.get_simplex_vertices(idx_below, _dim, parent.n, vertices.rbegin());
-//		for (auto v : vertices) {
-//			neighbor_it.push_back(dist.neighbors[v].rbegin());
-//			neighbor_end.push_back(dist.neighbors[v].rend());
-//		}
-//	}
-//
-//	bool has_next(bool all_cofacets = true) {
-//		for (auto &it0 = neighbor_it[0], &end0 = neighbor_end[0]; it0 != end0; ++it0) {
-//			neighbor = *it0;
-//			for (size_t idx = 1; idx < neighbor_it.size(); ++idx) {
-//				auto &it = neighbor_it[idx], end = neighbor_end[idx];
-//				while (get_index(*it) > get_index(neighbor))
-//					if (++it == end) return false;
-//				if (get_index(*it) != get_index(neighbor))
-//					goto continue_outer;
-//				else
-//					neighbor = std::max(neighbor, *it);
-//			}
-//			while (k > 0 && vertices[k - 1] > get_index(neighbor)) {
-//				if (!all_cofacets) return false;
-//				idx_below -= binomial_coeff(vertices[k - 1], k);
-//				idx_above += binomial_coeff(vertices[k - 1], k + 1);
-//				--k;
-//			}
-//			return true;
-//		continue_outer:;
-//		}
-//		return false;
-//	}
-//
-//	diameter_entry_t next() {
-//		++neighbor_it[0];
-//		value_t cofacet_diameter = std::max(get_diameter(simplex), get_diameter(neighbor));
-//		index_t cofacet_index = idx_above + binomial_coeff(get_index(neighbor), k + 1) + idx_below;
-//		coefficient_t cofacet_coefficient =
-//		    (k & 1 ? modulus - 1 : 1) * get_coefficient(simplex) % modulus;
-//		return diameter_entry_t(cofacet_diameter, cofacet_index, cofacet_coefficient);
-//	}
-//};
+template <> class ripser<sparse_distance_matrix>::simplex_coboundary_enumerator {
+	const ripser& parent;
+	index_t idx_below, idx_above, k;
+	std::vector<index_t> vertices;
+	const diameter_entry_t simplex;
+	const coefficient_t modulus;
+	const sparse_distance_matrix& dist;
+	const binomial_coeff_table& binomial_coeff;
+	std::vector<std::vector<index_diameter_t>::const_reverse_iterator>& neighbor_it;
+	std::vector<std::vector<index_diameter_t>::const_reverse_iterator>& neighbor_end;
+	index_diameter_t neighbor;
+
+public:
+	simplex_coboundary_enumerator(const diameter_entry_t _simplex, const index_t _dim,
+	                              const ripser& _parent)
+	    : parent(_parent), idx_below(get_index(_simplex)), idx_above(0), k(_dim + 1),
+	      vertices(_dim + 1), simplex(_simplex), modulus(parent.modulus), dist(parent.dist),
+	      binomial_coeff(parent.binomial_coeff), neighbor_it(dist.neighbor_it),
+	      neighbor_end(dist.neighbor_end) {
+		neighbor_it.clear();
+		neighbor_end.clear();
+
+		parent.get_simplex_vertices(idx_below, _dim, parent.n, vertices.rbegin());
+		for (auto v : vertices) {
+			neighbor_it.push_back(dist.neighbors[v].rbegin());
+			neighbor_end.push_back(dist.neighbors[v].rend());
+		}
+	}
+
+	bool has_next(bool all_cofacets = true) {
+		for (auto &it0 = neighbor_it[0], &end0 = neighbor_end[0]; it0 != end0; ++it0) {
+			neighbor = *it0;
+			for (size_t idx = 1; idx < neighbor_it.size(); ++idx) {
+				auto &it = neighbor_it[idx], end = neighbor_end[idx];
+				while (get_index(*it) > get_index(neighbor))
+					if (++it == end) return false;
+				if (get_index(*it) != get_index(neighbor))
+					goto continue_outer;
+				else
+					neighbor = std::max(neighbor, *it);
+			}
+			while (k > 0 && vertices[k - 1] > get_index(neighbor)) {
+				if (!all_cofacets) return false;
+				idx_below -= binomial_coeff(vertices[k - 1], k);
+				idx_above += binomial_coeff(vertices[k - 1], k + 1);
+				--k;
+			}
+			return true;
+		continue_outer:;
+		}
+		return false;
+	}
+
+	diameter_entry_t next() {
+		++neighbor_it[0];
+		value_t cofacet_diameter = std::max(get_diameter(simplex), get_diameter(neighbor));
+		index_t cofacet_index = idx_above + binomial_coeff(get_index(neighbor), k + 1) + idx_below;
+		coefficient_t cofacet_coefficient =
+		    (k & 1 ? modulus - 1 : 1) * get_coefficient(simplex) % modulus;
+		return diameter_entry_t(cofacet_diameter, cofacet_index, cofacet_coefficient);
+	}
+};

 template <> std::vector<diameter_index_t> ripser<compressed_lower_distance_matrix>::get_edges() {
 	std::vector<diameter_index_t> edges;
@@ -939,15 +944,15 @@
 	return edges;
 }

-//template <> std::vector<diameter_index_t> ripser<sparse_distance_matrix>::get_edges() {
-//	std::vector<diameter_index_t> edges;
-//	for (index_t i = 0; i < n; ++i)
-//		for (auto n : dist.neighbors[i]) {
-//			index_t j = get_index(n);
-//			if (i > j) edges.push_back({get_diameter(n), get_edge_index(i, j)});
-//		}
-//	return edges;
-//}
+template <> std::vector<diameter_index_t> ripser<sparse_distance_matrix>::get_edges() {
+	std::vector<diameter_index_t> edges;
+	for (index_t i = 0; i < n; ++i)
+		for (auto n : dist.neighbors[i]) {
+			index_t j = get_index(n);
+			if (i > j) edges.push_back({get_diameter(n), get_edge_index(i, j)});
+		}
+	return edges;
+}

 enum file_format {
 	LOWER_DISTANCE_MATRIX,
@@ -993,31 +998,31 @@
 	return compressed_lower_distance_matrix(std::move(distances));
 }

-//sparse_distance_matrix read_sparse_distance_matrix(std::istream& input_stream) {
-//	std::vector<std::vector<index_diameter_t>> neighbors;
-//	index_t num_edges = 0;
-//
-//	std::string line;
-//	while (std::getline(input_stream, line)) {
-//		std::istringstream s(line);
-//		size_t i, j;
-//		value_t value;
-//		s >> i;
-//		s >> j;
-//		s >> value;
-//		if (i != j) {
-//			neighbors.resize(std::max({neighbors.size(), i + 1, j + 1}));
-//			neighbors[i].push_back({j, value});
-//			neighbors[j].push_back({i, value});
-//			++num_edges;
-//		}
-//	}
-//
-//	for (size_t i = 0; i < neighbors.size(); ++i)
-//		std::sort(neighbors[i].begin(), neighbors[i].end());
-//
-//	return sparse_distance_matrix(std::move(neighbors), num_edges);
-//}
+sparse_distance_matrix read_sparse_distance_matrix(std::istream& input_stream) {
+	std::vector<std::vector<index_diameter_t>> neighbors;
+	index_t num_edges = 0;
+
+	std::string line;
+	while (std::getline(input_stream, line)) {
+		std::istringstream s(line);
+		size_t i, j;
+		value_t value;
+		s >> i;
+		s >> j;
+		s >> value;
+		if (i != j) {
+			neighbors.resize(std::max({neighbors.size(), i + 1, j + 1}));
+			neighbors[i].push_back({j, value});
+			neighbors[j].push_back({i, value});
+			++num_edges;
+		}
+	}
+
+	for (size_t i = 0; i < neighbors.size(); ++i)
+		std::sort(neighbors[i].begin(), neighbors[i].end());
+
+	return sparse_distance_matrix(std::move(neighbors), num_edges);
+}

 compressed_lower_distance_matrix read_lower_distance_matrix(std::istream& input_stream) {
 	std::vector<value_t> distances;
@@ -1203,16 +1208,16 @@
 		exit(-1);
 	}

-//	if (format == SPARSE) {
-//		sparse_distance_matrix dist =
-//		    read_sparse_distance_matrix(filename ? file_stream : std::cin);
-//		std::cout << "sparse distance matrix with " << dist.size() << " points and "
-//		          << dist.num_edges << "/" << (dist.size() * (dist.size() - 1)) / 2 << " entries"
-//		          << std::endl;
-//
-//		ripser<sparse_distance_matrix>(std::move(dist), dim_max, threshold, ratio, modulus)
-//		    .compute_barcodes();
-//	} else {
+	if (format == SPARSE) {
+		sparse_distance_matrix dist =
+		    read_sparse_distance_matrix(filename ? file_stream : std::cin);
+		std::cout << "sparse distance matrix with " << dist.size() << " points and "
+		          << dist.num_edges << "/" << (dist.size() * (dist.size() - 1)) / 2 << " entries"
+		          << std::endl;
+
+		ripser<sparse_distance_matrix>(std::move(dist), dim_max, threshold, ratio, modulus)
+		    .compute_barcodes();
+	} else {
 		compressed_lower_distance_matrix dist =
 		    read_file(filename ? file_stream : std::cin, format);

@@ -1239,20 +1244,20 @@
 		}
 		std::cout << "value range: [" << min << "," << max_finite << "]" << std::endl;

-//		if (threshold >= max) {
+		if (threshold >= max) {
 			std::cout << "distance matrix with " << dist.size() << " points" << std::endl;
 			ripser<compressed_lower_distance_matrix>(std::move(dist), dim_max, threshold, ratio,
 			                                         modulus)
 			    .compute_barcodes();
-//		} else {
-//			std::cout << "sparse distance matrix with " << dist.size() << " points and "
-//			          << num_edges << "/" << (dist.size() * dist.size() - 1) / 2 << " entries"
-//			          << std::endl;
-//
-//			ripser<sparse_distance_matrix>(sparse_distance_matrix(std::move(dist), threshold),
-//			                               dim_max, threshold, ratio, modulus)
-//			    .compute_barcodes();
-//		}
+		} else {
+			std::cout << "sparse distance matrix with " << dist.size() << " points and "
+			          << num_edges << "/" << (dist.size() * dist.size() - 1) / 2 << " entries"
+			          << std::endl;
+
+			ripser<sparse_distance_matrix>(sparse_distance_matrix(std::move(dist), threshold),
+			                               dim_max, threshold, ratio, modulus)
+			    .compute_barcodes();
+		}
 		exit(0);
-//	}
-}
+	}
+}


Add DetPid in ConvertTRD

Add DetPid in ConvertTRD


INTEGRATION: CWS ooo19126 (1.22.50); FILE MERGED 2005/09/05 17:13:29 rt 1.22.50.1: #i54170# Change license header: remove SISSL

--- fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
+++ fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: WinFileOpenImpl.cxx,v $
  *
- *  $Revision: 1.22 $
+ *  $Revision: 1.23 $
  *
- *  last change: $Author: vg $ $Date: 2005-02-16 15:34:46 $
+ *  last change: $Author: rt $ $Date: 2005-09-08 23:39:55 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/


WaE: passing NULL to non-pointer argument

--- fpicker/source/win32/filepicker/helppopupwindow.cxx
+++ fpicker/source/win32/filepicker/helppopupwindow.cxx
@@ -147,7 +147,7 @@
     // and the dimensions and resize the window

     m_hwnd = CreateWindowEx(
-        NULL,
+        0,
         HELPPOPUPWND_CLASS_NAME,
         NULL,
         WS_POPUP,


debug

debug

--- contrib/other-builds/extract-mixed-syntax/Rule.cpp
+++ contrib/other-builds/extract-mixed-syntax/Rule.cpp
@@ -84,11 +84,11 @@

   for (size_t i = 0; i < m_arcs.size(); ++i) {
 	  const LatticeArc &arc = *m_arcs[i];
-	  if (arc.GetStart() < targetStart) {
-		  targetStart = arc.GetStart();
-	  }
-	  if (arc.GetEnd() > targetEnd) {
-		  targetEnd = arc.GetEnd();
+	  if (arc.GetLowestAlignment() < targetStart) {
+		  targetStart = arc.GetLowestAlignment();
+	  }
+	  if (arc.GetHighestAlignment() > targetEnd) {
+		  targetEnd = arc.GetHighestAlignment();
 	  }
   }

@@ -183,7 +183,7 @@
 void Rule::Output(std::ostream &out) const
 {
 	Output(out, m_arcs);
-	out << " ||| ";
+	out << "||| ";
 	Output(out, m_arcs);
 }


bugfix: call of creator function for HOMER writers

--- HLT/BASE/AliHLTHOMERLibManager.cxx
+++ HLT/BASE/AliHLTHOMERLibManager.cxx
@@ -137,9 +137,9 @@
   }

   AliHLTHOMERWriter* pWriter=NULL;
-//   if (fFctCreateWriter!=NULL && (pWriter=(((AliHLTHOMERWriterCreate_t)fFctCreateWriter)()))==NULL) {
+  if (fFctCreateWriter!=NULL && (pWriter=(((AliHLTHOMERWriterCreate_t)fFctCreateWriter)()))==NULL) {
 //     HLTError("can not create instance of HOMER writer (function %p)", fFctCreateWriter);
-//   }
+  }

   return pWriter;
 }


Retains the default window background colour until a machine is running.

--- OSBindings/Qt/scantargetwidget.cpp
+++ OSBindings/Qt/scantargetwidget.cpp
@@ -10,11 +10,12 @@
 ScanTargetWidget::~ScanTargetWidget() {}

 void ScanTargetWidget::initializeGL() {
-	glClearColor(0.5, 0.5, 1.0, 1.0);
+	// Retain the default background colour.
+	const QColor backgroundColour = palette().color(QWidget::backgroundRole());
+	glClearColor(backgroundColour.redF(), backgroundColour.greenF(), backgroundColour.blueF(), 1.0);

 	// Follow each swapped frame with an additional update.
 	connect(this, &QOpenGLWidget::frameSwapped, this, &ScanTargetWidget::vsync);
-//	qDebug() << "share context: " << bool(context()->shareGroup());
 }

 void ScanTargetWidget::paintGL() {
@@ -24,15 +25,6 @@
 		scanTarget->update(width(), height());
 		scanTarget->draw(width(), height());
 		vsync_predictor_.end_redraw();
-
-//		static int64_t start = 0;
-//		static int frames = 0;
-//		if(!start) start = Time::nanos_now();
-//		else {
-//			++frames;
-//			const int64_t now = Time::nanos_now();
-//			qDebug() << double(frames) * 1e9 / double(now - start);
-//		}
 	}
 }


rescaling pixmap

rescaling pixmap

--- die-tk/linux/components/ImageX11.cpp
+++ die-tk/linux/components/ImageX11.cpp
@@ -111,8 +111,8 @@
 // TODO melhorar esse algoritmo
 char * bitmapResize(XImage const * imagePtr, WDims dims) {
 	auto lineSize = bitmapLineSize(imagePtr->width);
-	char * result = new char[imagePtr->height * lineSize];
-	std::fill_n(result,imagePtr->height * lineSize,0);
+	char * result = new char[dims.height * lineSize];
+	std::fill_n(result,dims.height * lineSize,0);

 	auto dst = result;
 	int dx = 0;
@@ -419,11 +419,11 @@
 void ImageX11Transparent::drawInto(CanvasX11 & canvas, Rect destrect) {
 	if( dims() == destrect.dims() ) {
 		ClipMaskGuard guard(canvas,transparentMask.get(),destrect.topLeft());
-		ImageX11::drawInto(canvas, destrect);
+		ImageX11::drawInto(canvas,destrect);
 	} else {
 		auto resizedMask = scoped::Pixmap(resizedTransparentMask(destrect.dims()));
 		ClipMaskGuard guard(canvas,resizedMask.get(),destrect.topLeft());
-		ImageX11::drawInto(canvas, destrect);
+		ImageX11::drawInto(canvas,destrect);
 	}
 }


chrono::duration is not zero-initialized #31991

Change-Id: I8f460e1687e25e497067e771d707887302660c60
Reviewed-on: http://gerrit.aldebaran.lan/62109
Reviewed-by: sbarthelemy <9c154f64c36738f8e44d945c231ac417d15bd66e@aldebaran.com>
Tested-by: sbarthelemy <9c154f64c36738f8e44d945c231ac417d15bd66e@aldebaran.com>

--- tests/qi/test_qiclock.cpp
+++ tests/qi/test_qiclock.cpp
@@ -17,17 +17,11 @@

 TEST(QiClock, initialization)
 {
-  qi::Duration d0;
+  qi::Duration d0 = qi::Duration::zero();
   EXPECT_EQ(0, d0.count());

-  qi::Duration d1 = qi::Duration::zero();
+  qi::Duration d1(0);
   EXPECT_EQ(0, d1.count());
-
-  qi::Duration d2 = qi::Duration();
-  EXPECT_EQ(0, d2.count());
-
-  qi::Duration d3(0);
-  EXPECT_EQ(0, d3.count());

   qi::Clock::time_point t0;
   EXPECT_EQ(0, t0.time_since_epoch().count());


wp8: no encytion for you :P

wp8: no encytion for you :P

--- qgvdial/features/openssl/wp8/OSDCipher.cpp
+++ qgvdial/features/openssl/wp8/OSDCipher.cpp
@@ -28,5 +28,13 @@
 bool
 OsdCipher::_cipher(const QByteArray &byIn, QByteArray &byOut, bool bEncrypt)
 {
+    // Do I reeealy need to encrypt anything when the app is entirely sandboxed?
+
+    if (bEncrypt) {
+        byOut = byIn.toBase64();
+    } else {
+        byOut = QByteArray::fromBase64(byIn);
+    }
+
     return (true);
 }//OsdCipher::cipher


Change orientation for symbian

Change orientation for symbian

--- qttasserver/services/foregroundservice.cpp
+++ qttasserver/services/foregroundservice.cpp
@@ -67,7 +67,8 @@
         }
     }
     else if (model.service() == "changeOrientation" ){
-        TasCommand* command = getCommandParameters(model, "changeOrientation");
+        status = true;
+        TasCommand* command = getCommandParameters(model, "ChangeOrientation");
         if(command){
             TasNativeUtils::changeOrientation(command->parameter("direction"));
         }


Fix orphaned timer errors.

Fix orphaned timer errors.

--- questions/eventloop-hang-25038829/main.cpp
+++ questions/eventloop-hang-25038829/main.cpp
@@ -23,11 +23,57 @@
 }

 /// A safely destructible thread for perusal by QObjects.
-class Thread : public QThread {
-  using QThread::run;
-public:
-  explicit Thread(QObject * parent = 0) : QThread(parent) {}
-  ~Thread() { quit(); wait(); }
+class Thread final : public QThread {
+  Q_OBJECT
+  void run() override {
+    connect(QAbstractEventDispatcher::instance(this),
+            &QAbstractEventDispatcher::aboutToBlock,
+            this, &Thread::aboutToBlock);
+    QThread::run();
+  }
+  QAtomicInt inDestructor;
+public:
+  using QThread::QThread;
+  /// Take an object and prevent timer resource leaks when the object is about
+  /// to become threadless.
+  void takeObject(QObject *obj) {
+    // Work around to prevent
+    // QBasicTimer::stop: Failed. Possibly trying to stop from a different thread
+    static constexpr char kRegistered[] = "__ThreadRegistered";
+    static constexpr char kMoved[] = "__Moved";
+    if (!obj->property(kRegistered).isValid()) {
+      QObject::connect(this, &Thread::finished, obj, [this, obj]{
+        if (!inDestructor.load() || obj->thread() != this)
+          return;
+        // The object is about to become threadless
+        Q_ASSERT(obj->thread() == QThread::currentThread());
+        obj->setProperty(kMoved, true);
+        obj->moveToThread(this->thread());
+      }, Qt::DirectConnection);
+      QObject::connect(this, &QObject::destroyed, obj, [obj]{
+        if (!obj->thread()) {
+          obj->moveToThread(QThread::currentThread());
+          obj->setProperty(kRegistered, {});
+        }
+        else if (obj->thread() == QThread::currentThread() && obj->property(kMoved).isValid()) {
+          obj->setProperty(kMoved, {});
+          QCoreApplication::sendPostedEvents(obj, QEvent::MetaCall);
+        }
+        else if (obj->thread()->eventDispatcher())
+          QTimer::singleShot(0, obj, [obj]{ obj->setProperty(kRegistered, {}); });
+      }, Qt::DirectConnection);
+
+      obj->setProperty(kRegistered, true);
+    }
+    obj->moveToThread(this);
+  }
+  ~Thread() override {
+    inDestructor.store(1);
+    requestInterruption();
+    quit();
+    wait();
+  }
+  Q_SIGNAL void aboutToBlock();
 };

 /// An application that monitors event loops in all threads.
@@ -243,16 +289,18 @@

 class WorkerObject : public QObject {
   Q_OBJECT
-  int m_trials;
-  double m_probability;
+  int m_trials = 2000;
+  double m_probability = 0.2;
   QBasicTimer m_timer;
-  void timerEvent(QTimerEvent * ev) {
+  void timerEvent(QTimerEvent * ev) override {
     if (ev->timerId() != m_timer.timerId()) return;
     QThread::msleep(std::binomial_distribution<>(m_trials, m_probability)(reng));
   }
 public:
-  WorkerObject(QObject * parent = 0) : QObject(parent), m_trials(2000), m_probability(0.2) {}
+  using QObject::QObject;
+  Q_SIGNAL void stopped();
   Q_SLOT void start() { m_timer.start(0, this); }
+  Q_SLOT void stop() { m_timer.stop(); emit stopped(); }
   int trials() const { return m_trials; }
   Q_SLOT void setTrials(int trials) { m_trials = trials; }
   double probability() const { return m_probability; }
@@ -311,14 +359,16 @@
   wLayout.addWidget(&probabilityLabel, 1, 1);
   wLayout.addWidget(&probability, 2, 1);

+  QObject::connect(&workerObject, &WorkerObject::stopped, &workerThread, &Thread::quit);
   QObject::connect(&worker, &QGroupBox::toggled, [&](bool run) {
     if (run) {
       workerThread.start();
       QMetaObject::invokeMethod(&workerObject, "start");
-    } else workerThread.quit();
+    } else
+      QMetaObject::invokeMethod(&workerObject, "stop");
   });
   QObject::connect(&timeout, &QAbstractSlider::valueChanged, &app, &MonitoringApp::setTimeout);
-  workerObject.moveToThread(&workerThread);
+  workerThread.takeObject(&workerObject);
   w.show();
   return app.exec();
 }


Fixed MIMOSA_DEF_PTR by using ::mimosa::

--- mimosa/ref-countable.hh
+++ mimosa/ref-countable.hh
@@ -55,12 +55,12 @@
       delete obj;
   }

-# define MIMOSA_DEF_PTR(T...)                   \
-  typedef RefCountedPtr<T > Ptr;                \
-  typedef RefCountedPtr<const T > ConstPtr
+# define MIMOSA_DEF_PTR(T...)                           \
+  typedef ::mimosa::RefCountedPtr<T > Ptr;              \
+  typedef ::mimosa::RefCountedPtr<const T > ConstPtr

   template <typename T >
-  class RefCountable : public RefCountableBase
+  class RefCountable : public ::mimosa::RefCountableBase
   {
   public:
     MIMOSA_DEF_PTR(T);


make compile with 1.8 and above

make compile with 1.8 and above

--- interface/root_bind.cpp
+++ interface/root_bind.cpp
@@ -42,7 +42,7 @@
 #include <OgreConfigFile.h>
 #include "ogre_manager.h"

-template<> OgreManager* Ogre::Singleton<OgreManager>::ms_Singleton = 0;
+template<> OgreManager* Ogre::Singleton<OgreManager>::msSingleton = 0;

 void load_ogre_plugin(const char* plugin);


also support theme based colors in xlsx

also support theme based colors in xlsx

Change-Id: I6a159d7e5a9315b23a5ff7ee6487ee65457552ff

--- sc/source/filter/oox/condformatbuffer.cxx
+++ sc/source/filter/oox/condformatbuffer.cxx
@@ -51,6 +51,7 @@
 #include "addressconverter.hxx"
 #include "biffinputstream.hxx"
 #include "stylesbuffer.hxx"
+#include "themebuffer.hxx"

 #include "colorscale.hxx"
 #include "document.hxx"
@@ -206,7 +207,14 @@

 void ColorScaleRule::importColor( const AttributeList& rAttribs )
 {
-    sal_Int32 nColor = rAttribs.getIntegerHex( XML_rgb, API_RGB_TRANSPARENT );
+    sal_Int32 nColor = 0;
+    if( rAttribs.hasAttribute( XML_rgb ) )
+        nColor = rAttribs.getIntegerHex( XML_rgb, API_RGB_TRANSPARENT );
+    else if( rAttribs.hasAttribute( XML_theme ) )
+    {
+        sal_uInt32 nThemeIndex = rAttribs.getUnsigned( XML_theme, 0 );
+        nColor = getTheme().getColorByToken( nThemeIndex );
+    }

     ::Color aColor = RgbToRgbComponents( nColor );


little clean-up for the color format case

Change-Id: I8e42a2494e9f7761ca55beb465c3f20d2b057060

--- sc/source/ui/condformat/condformatdlg.cxx
+++ sc/source/ui/condformat/condformatdlg.cxx
@@ -52,9 +52,6 @@
 #include "condformatdlgentry.hxx"

 #include "globstr.hrc"
-
-#include <cassert>
-#include <iostream>

 ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocument* pDoc, const ScConditionalFormat* pFormat,
                                 const ScRangeList& rRanges, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType):
@@ -191,35 +188,33 @@
             break;
     }
     if(itr == maEntries.end())
-        return 0;;
+        return 0;

     sal_Int32 nPos = pBox->GetSelectEntryPos();
     switch(nPos)
     {
         case 0:
-            if(itr->GetType() != condformat::entry::COLORSCALE2)
-            {
-                maEntries.replace( itr, new ScColorScale2FrmtEntry( this, mpDoc, maPos ) );
-                static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData();
-            }
+            if(itr->GetType() == condformat::entry::COLORSCALE2)
+                return 0;
+
+            maEntries.replace( itr, new ScColorScale2FrmtEntry( this, mpDoc, maPos ) );
             break;
         case 1:
-            if(itr->GetType() != condformat::entry::COLORSCALE3)
-            {
-                maEntries.replace( itr, new ScColorScale3FrmtEntry( this, mpDoc, maPos ) );
-                static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData();
-            }
+            if(itr->GetType() == condformat::entry::COLORSCALE3)
+                return 0;
+
+            maEntries.replace( itr, new ScColorScale3FrmtEntry( this, mpDoc, maPos ) );
             break;
         case 2:
-            if(itr->GetType() != condformat::entry::DATABAR)
-            {
-                maEntries.replace( itr, new ScDataBarFrmtEntry( this, mpDoc, maPos ) );
-                static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData();
-            }
+            if(itr->GetType() == condformat::entry::DATABAR)
+                return 0;
+
+            maEntries.replace( itr, new ScDataBarFrmtEntry( this, mpDoc, maPos ) );
             break;
         default:
             break;
     }
+    static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData();
     itr->SetActive();
     RecalcAll();
     return 0;


INTEGRATION: CWS dr7ui (1.9.54); FILE MERGED 2003/08/07 10:08:59 dr 1.9.54.1: #111629# exceptions for XAccessibleTable functions

--- sc/source/ui/inc/AccessibleCsvControl.hxx
+++ sc/source/ui/inc/AccessibleCsvControl.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: AccessibleCsvControl.hxx,v $
  *
- *  $Revision: 1.9 $
- *
- *  last change: $Author: vg $ $Date: 2003-05-22 13:46:02 $
+ *  $Revision: 1.10 $
+ *
+ *  last change: $Author: obo $ $Date: 2003-09-04 08:03:14 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -484,19 +484,17 @@
     virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
         throw( ::com::sun::star::uno::RuntimeException );

-    // XAccessibleExtendedTable -----------------------------------------------
-
     /** Returns the child index of the cell at the specified position. */
     virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
-        throw( ::com::sun::star::uno::RuntimeException );
+        throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );

     /** Returns the row index of the specified child. */
     virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex )
-        throw( ::com::sun::star::uno::RuntimeException );
+        throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );

     /** Returns the column index of the specified child. */
     virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex )
-        throw( ::com::sun::star::uno::RuntimeException );
+        throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException );

     // XAccessibleSelection ---------------------------------------------------


Small fixes to the comments and to the code.

--- copasi/bindings/cpp_examples/example7/example7.cpp
+++ copasi/bindings/cpp_examples/example7/example7.cpp
@@ -1,9 +1,9 @@
 // Begin CVS Header
 //   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/bindings/cpp_examples/example7/example7.cpp,v $
-//   $Revision: 1.2 $
+//   $Revision: 1.3 $
 //   $Name:  $
 //   $Author: gauges $
-//   $Date: 2009/08/31 18:36:12 $
+//   $Date: 2009/08/31 19:34:31 $
 // End CVS Header

 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
@@ -96,9 +96,9 @@
   // reaction converts S to P
   // we can set these on the chemical equation of the reaction
   CChemEq* pChemEq = &pReaction->getChemEq();
-  // glucose is a substrate with stoichiometry 1
+  // S is a substrate with stoichiometry 1
   pChemEq->addMetabolite(pS->getKey(), 1.0, CChemEq::SUBSTRATE);
-  // glucose-6-phosphate is a product with stoichiometry 1
+  // P is a product with stoichiometry 1
   pChemEq->addMetabolite(pP->getKey(), 1.0, CChemEq::PRODUCT);
   assert(pChemEq->getSubstrates().size() == 1);
   assert(pChemEq->getProducts().size() == 1);
@@ -109,12 +109,9 @@
   CModelValue* pMV = pModel->createModelValue("K", 42.0);
   // set the status to FIXED
   pMV->setStatus(CModelValue::FIXED);
-
   assert(pMV != NULL);
-
   pObject = pMV->getObject(CCopasiObjectName("Reference=InitialValue"));
   assert(pObject != NULL);
-
   changedObjects.insert(pObject);
   assert(pModel->getModelValues().size() == 1);

@@ -154,7 +151,7 @@
   pParam->setUsage(CFunctionParameter::SUBSTRATE);

   // set the rate law for the reaction
-  pReaction->setFunction(pRateLaw);
+  pReaction->setFunction(pFunction);
   assert(pReaction->getFunction() != NULL);

   // COPASI also needs to know what object it has to assocuiate with the individual function parameters


Fix use of memory tracker on non-Windows platforms (std::cerr, not std::err)

--HG--
branch : v1-7

--- OgreMain/src/OgreMemoryTracker.cpp
+++ OgreMain/src/OgreMemoryTracker.cpp
@@ -39,8 +39,8 @@
 #	define Ogre_OutputCString(str) ::OutputDebugStringA(str)
 #	define Ogre_OutputWString(str) ::OutputDebugStringW(str)
 #else
-#	define Ogre_OutputCString(str) std::err << str
-#	define Ogre_OutputWString(str) std::err << str
+#	define Ogre_OutputCString(str) std::cerr << str
+#	define Ogre_OutputWString(str) std::cerr << str
 #endif

 #if OGRE_MEMORY_TRACKER


Uncommented failed tests, passing fine via 180bc3

--- tests/src/hipStreamL5.cpp
+++ tests/src/hipStreamL5.cpp
@@ -36,6 +36,7 @@
 a test for Ker, D2D, D2H, H2H, H2D is given as test34512();
 Note that all memory copies are Async.

+invalid{
 *WARNING: The commented out assertions are failing cases.
 According to my observation, they are happening with tests
 which end in HostToHost and take data from previous
@@ -49,6 +50,7 @@
 test24513
 test25134
 test34512
+}
 */

 template<typename T>
@@ -260,7 +262,7 @@
 	D2H(Eh, Cd, size);

 	HIPASSERT(Eh[0] == Dh[0] + T(1));
-	//HIPASSERT(Ah[0] == Ch[0]);
+	HIPASSERT(Ah[0] == Ch[0]);
 }

 template<typename T>
@@ -299,7 +301,7 @@

 	HIPCHECK(hipDeviceSynchronize());

-	//HIPASSERT(Ah[10] == Ch[10]);
+	HIPASSERT(Ah[10] == Ch[10]);
 	HIPASSERT(Dh[10] + T(1) == Eh[10]);
 }

@@ -370,7 +372,7 @@
 	D2H(Dh, Cd, size);

 	HIPCHECK(hipDeviceSynchronize());
-	//HIPASSERT( Ah[10] + T(1) == Dh[10] );
+	HIPASSERT( Ah[10] + T(1) == Dh[10] );
 }

 template<typename T>
@@ -483,7 +485,7 @@
 	HIPCHECK(hipDeviceSynchronize());
 	D2H(Dh, Ad, size);

-	//HIPASSERT(Ah[10] == Ch[10]);
+	HIPASSERT(Ah[10] == Ch[10]);
 	HIPASSERT(Eh[10] + T(1) == Dh[10]);

 }
@@ -592,7 +594,7 @@

 	HIPCHECK(hipDeviceSynchronize());
 	HIPASSERT(Dh[10] == Eh[10]);
-	//HIPASSERT(Ah[10] + T(1) == Ch[10]);
+	HIPASSERT(Ah[10] + T(1) == Ch[10]);
 }

 template<typename T>
@@ -627,7 +629,7 @@

 	D2H(Ch, Cd, size);
 	HIPCHECK(hipDeviceSynchronize());
-	//HIPASSERT( Dh[10] + T(1) == Ch[10]);
+	HIPASSERT( Dh[10] + T(1) == Ch[10]);
 }

 template<typename T>


sstables: Remove debug printout from test_write_many_partitions

Signed-off-by: Piotr Jastrzebski <2c0eb4a25a7cde333ff2d0860cb06051925fd74f@scylladb.com>

--- tests/sstable_3_x_test.cc
+++ tests/sstable_3_x_test.cc
@@ -3450,9 +3450,7 @@
     }

     bool compressed = cp.get_compressor() != nullptr;
-    std::cout << (compressed ? "compressed " : "uncompressed") << std::endl;
     tmpdir tmp = write_and_compare_sstables(s, mt, table_name, compressed);
-    std::cout << "wrote and compared\n";
     boost::sort(muts, mutation_decorated_key_less_comparator());
     validate_read(s, tmp.path, muts);
 }


Model constructProperties->constructInfrastructure.

--- OpenSim/Simulation/Model/Model.cpp
+++ OpenSim/Simulation/Model/Model.cpp
@@ -94,7 +94,7 @@
     _system(NULL),
     _workingState()
 {
-    constructProperties();
+    constructInfrastructure();
     setNull();
     createGroundBodyIfNecessary();
 }
@@ -112,7 +112,7 @@
     _system(NULL),
     _workingState()
 {
-    constructProperties();
+    constructInfrastructure();
     setNull();
     updateFromXMLDocument();


(change:minor) In dcs::network::ip4_packet class, use constant header_size in place of sizeof(...)

--- inc/dcs/network/ip.hpp
+++ inc/dcs/network/ip.hpp
@@ -440,9 +440,9 @@
 				   DCS_EXCEPTION_THROW(::std::runtime_error,
 									   "IP packet shorter than expected"));

-		if ((hlen - sizeof(ip4_header)) > 0)
+		if ((hlen - header_size) > 0)
 		{
-			p_opts_hdr_ = reinterpret_cast<ip4_options_header const*>(data+sizeof(ip4_header));
+			p_opts_hdr_ = reinterpret_cast<ip4_options_header const*>(data+header_size);
 		}

 		p_data_ = data+hlen;


removed ineffective argument to sendto

removed ineffective argument to sendto

--- code/disc_spirit.cc
+++ code/disc_spirit.cc
@@ -596,7 +596,7 @@
   affectedData aff;
   int found = FALSE;
   if (bSuccess(caster, bKnown, SPELL_CLOUD_OF_CONCEALMENT)) {
-    caster->sendTo(fmt("You focus your powers and cause a cloud to materialize around your group.\n\r") %ANSI_GRAY);
+    caster->sendTo("You focus your powers and cause a cloud to materialize around your group.\n\r");
     act("$n invokes some magic and produces huge volumes of vaporous smoke.",
         TRUE,caster,0,0,TO_ROOM,ANSI_GRAY);


Using constant instead of local memory for the weights.

--- include/BeamFormer.hpp
+++ include/BeamFormer.hpp
@@ -64,28 +64,20 @@
   std::string * code = new std::string();

   // Begin kernel's template
-  *code = "__kernel void beamFormer(__global const " + dataType + "4 * restrict const samples, __global " + dataType + "4 * restrict const output, __global const float2 * restrict const weights) {\n"
+  *code = "__kernel void beamFormer(__global const " + dataType + "4 * restrict const samples, __global " + dataType + "4 * restrict const output, __constant const float2 * restrict const weights) {\n"
     "const unsigned int channel = get_group_id(2);\n"
     "const unsigned int beam = (get_group_id(1) * " + isa::utils::toString(nrBeamsPerBlock * nrBeamsPerThread) + ") + (get_local_id(1) * " + isa::utils::toString(nrBeamsPerThread) + ");\n"
     "<%DEF_SAMPLES%>"
     "<%DEF_SUMS%>"
     + dataType + "4 sample = (" + dataType + "4)(0);\n";
   if ( local ) {
-    *code += "__local float2 localWeights[" + isa::utils::toString(nrBeamsPerBlock * nrBeamsPerThread) + "];\n"
-      "__local float localSamples[" + isa::utils::toString(isa::utils::pad(nrSamplesPerBlock * nrSamplesPerThread, observation.getPadding()) * 4) + "];\n";
+    *code += "__local float localSamples[" + isa::utils::toString(isa::utils::pad(nrSamplesPerBlock * nrSamplesPerThread, observation.getPadding()) * 4) + "];\n";
   }
   *code += "float2 weight = (float2)(0);\n"
     "\n"
     "for ( unsigned int station = 0; station < " + isa::utils::toString(observation.getNrStations()) + "; station++ ) {\n";
   if ( local ) {
-    *code += "unsigned int itemGlobal = (channel * " + isa::utils::toString(observation.getNrStations() * observation.getNrPaddedBeams()) + ") + (station * " + isa::utils::toString(observation.getNrPaddedBeams()) + ") + (get_group_id(1) * " + isa::utils::toString(nrBeamsPerBlock * nrBeamsPerThread) + ") + (get_local_id(1) * " + isa::utils::toString(nrSamplesPerBlock) + ") + get_local_id(0);\n"
-      "unsigned int itemLocal = (get_local_id(1) * " + isa::utils::toString(nrSamplesPerBlock) + ") + get_local_id(0);\n"
-      "while ( itemLocal < " + isa::utils::toString(nrBeamsPerBlock * nrBeamsPerThread) + ") {\n"
-      "localWeights[itemLocal] = weights[itemGlobal];\n"
-      "itemLocal += " + isa::utils::toString(nrSamplesPerBlock * nrBeamsPerBlock) + ";\n"
-      "itemGlobal += " + isa::utils::toString(nrSamplesPerBlock * nrBeamsPerBlock) + ";\n"
-      "}\n"
-      "itemGlobal = (channel * " + isa::utils::toString(observation.getNrStations() * observation.getNrSamplesPerPaddedSecond()) + ") + (station * " + isa::utils::toString(observation.getNrSamplesPerPaddedSecond()) + ") + (get_group_id(0) * " + isa::utils::toString(nrSamplesPerBlock * nrSamplesPerThread) + ") + (get_local_id(1) * " + isa::utils::toString(nrSamplesPerBlock) + ") + get_local_id(0);\n"
+    *code += "itemGlobal = (channel * " + isa::utils::toString(observation.getNrStations() * observation.getNrSamplesPerPaddedSecond()) + ") + (station * " + isa::utils::toString(observation.getNrSamplesPerPaddedSecond()) + ") + (get_group_id(0) * " + isa::utils::toString(nrSamplesPerBlock * nrSamplesPerThread) + ") + (get_local_id(1) * " + isa::utils::toString(nrSamplesPerBlock) + ") + get_local_id(0);\n"
       "itemLocal = (get_local_id(1) * " + isa::utils::toString(nrSamplesPerBlock) + ") + get_local_id(0);\n"
       "while ( itemLocal < " + isa::utils::toString(nrSamplesPerBlock * nrSamplesPerThread) + ") {\n"
       "sample = samples[itemGlobal];\n"
@@ -115,13 +107,8 @@
    loadComputeTemplate += "sample = samples[(channel * " + isa::utils::toString(observation.getNrStations() * observation.getNrSamplesPerPaddedSecond()) + ") + (station * " + isa::utils::toString(observation.getNrSamplesPerPaddedSecond()) + ") + sample<%SNUM%>];\n";
   }
   loadComputeTemplate += "<%SUMS%>";
-  std::string sumsTemplate;
-  if ( local ) {
-    sumsTemplate += "weight = localWeights[(get_local_id(1) * " + isa::utils::toString(nrBeamsPerThread) + ") + <%BNUM%>];\n";
-  } else {
-    sumsTemplate += "weight = weights[(channel * " + isa::utils::toString(observation.getNrStations() * observation.getNrPaddedBeams()) + ") + (station * " + isa::utils::toString(observation.getNrPaddedBeams()) + ") + beam + <%BNUM%>];\n";
-  }
-  sumsTemplate += "beam<%BNUM%>s<%SNUM%>.x += (sample.x * weight.x) - (sample.y * weight.y);\n"
+  std::string sumsTemplate = "weight = weights[(channel * " + isa::utils::toString(observation.getNrStations() * observation.getNrPaddedBeams()) + ") + (station * " + isa::utils::toString(observation.getNrPaddedBeams()) + ") + beam + <%BNUM%>];\n"
+    "beam<%BNUM%>s<%SNUM%>.x += (sample.x * weight.x) - (sample.y * weight.y);\n"
     "beam<%BNUM%>s<%SNUM%>.y += (sample.x * weight.y) + (sample.y * weight.x);\n"
     "beam<%BNUM%>s<%SNUM%>.z += (sample.z * weight.x) - (sample.w * weight.y);\n"
     "beam<%BNUM%>s<%SNUM%>.w += (sample.z * weight.y) + (sample.w * weight.x);\n";


Fix graphLoader

Fix graphLoader

--- runtime/cpp/Builtins.hpp
+++ runtime/cpp/Builtins.hpp
@@ -218,36 +218,37 @@
     unit_t sleep(int n);

     template <template <class> class M, template <class> class C,
-              template <typename...> class R>
-    unit_t loadGraph(string_impl filepath, M<R<int, C<R_elem<int>>>>& c) {
-      std::string tmp_buffer;
-      std::ifstream in(filepath);
-
-      int source;
-      std::size_t position;
-      while (!in.eof()) {
-        C<R_elem<int>> edge_list;
-
-        std::size_t start = 0;
-        std::size_t end = start;
-        std::getline(in, tmp_buffer);
-
-        end = tmp_buffer.find(",", start);
-        source = std::atoi(tmp_buffer.substr(start, end - start).c_str());
-
-        start = end + 1;
-
-        while (end != std::string::npos) {
+              template <typename...> class R, class C2>
+    unit_t loadGraph(const C2& filepaths, M<R<int, C<R_elem<int>>>>& c) {
+      for (const auto& filepath : filepaths) {
+        std::string tmp_buffer;
+        std::ifstream in(filepath.path);
+
+        int source;
+        std::size_t position;
+        while (!in.eof()) {
+          C<R_elem<int>> edge_list;
+
+          std::size_t start = 0;
+          std::size_t end = start;
+          std::getline(in, tmp_buffer);
+
           end = tmp_buffer.find(",", start);
-          edge_list.insert(R_elem<int>(
-              std::atoi(tmp_buffer.substr(start, end - start).c_str())));
+          source = std::atoi(tmp_buffer.substr(start, end - start).c_str());
+
           start = end + 1;
+
+          while (end != std::string::npos) {
+            end = tmp_buffer.find(",", start);
+            edge_list.insert(R_elem<int>(
+                std::atoi(tmp_buffer.substr(start, end - start).c_str())));
+            start = end + 1;
+          }
+
+          c.insert(R<int, C<R_elem<int>>>{source, std::move(edge_list)});
+          in >> std::ws;
         }
-
-        c.insert(R<int, C<R_elem<int>>>{source, std::move(edge_list)});
-        in >> std::ws;
-      }
-
+      }
       return unit_t{};
     }


tests: check for exception in allocator tests

--- tests/stack_allocator.cxx
+++ tests/stack_allocator.cxx
@@ -12,7 +12,7 @@

 	REQUIRE(p2 - p1 == 1);
 	REQUIRE(p3 != nullptr);
-	REQUIRE(alloc.allocate(1) == nullptr);
+	REQUIRE_THROWS(alloc.allocate(1));
 	REQUIRE(alloc.available() == 0);

 	alloc.deallocate(p1, 1);


Also read the block information when appending.

--- src/mesh/exodusII_io.C
+++ src/mesh/exodusII_io.C
@@ -630,6 +630,9 @@
           // certain aspects of the Helper object itself, such as the number of nodes
           // and elements.  We do that by reading the header...
           exio_helper->read_header();
+
+          // ...and reading the block info
+          exio_helper->read_block_info();
         }
       else
         {


remove debug

remove debug

--- PWG/EMCAL/AliAnalysisTaskEmcal.cxx
+++ PWG/EMCAL/AliAnalysisTaskEmcal.cxx
@@ -768,9 +768,12 @@
 Bool_t AliAnalysisTaskEmcal::HasTriggerType(TriggerType trigger)
 {
   // Check if event has a given trigger type
+  if(trigger==kND) {
+    AliWarning(Form("%s: Requesting undefined trigger type!", GetName()));
+    return kFALSE;
+  }
   //MV: removing this logic which as far as I can see doesn't make any sense
   // if(trigger & kND){
-  //   Printf("Resetting fTriggers %d %d",trigger,kND);
   //   return fTriggers == 0;
   // }
   return TESTBIT(fTriggers, trigger);
@@ -857,44 +860,10 @@
   }

   if (fTriggerTypeSel != kND) {
-
-    /*
-    //Dirty business: keeping debugging block for now. Will remove once confirmed.
-    //    fTriggers = GetTriggerList();
-    //loop over patches to define trigger type of event
-    Int_t nG1 = 0;
-    Int_t nG2 = 0;
-    Int_t nJ1 = 0;
-    Int_t nJ2 = 0;
-    Int_t nL0 = 0;
-    AliEmcalTriggerPatchInfo *patch;
-    Int_t nPatch = fTriggerPatchInfo->GetEntries();
-    for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
-      patch = (AliEmcalTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
-      if (patch->IsGammaHigh()) nG1++;
-      if (patch->IsGammaLow())  nG2++;
-      if (patch->IsJetHigh()) nJ1++;
-      if (patch->IsJetLow())  nJ2++;
-      if (patch->IsLevel0())  nL0++;
-    }
-
-    Printf("New event");
-    Printf( "Patch summary: ");
-    Printf( "Number of patches: %d", nPatch);
-    Printf( "Jet:   low[%d], high[%d]" ,nJ2, nJ1);
-    Printf( "Gamma: low[%d], high[%d]" ,nG2, nG1);
-
-    Printf("TESTBIT kJ1 %d -> %d",kJ1,TESTBIT(fTriggers, kJ1));
-    Printf("TESTBIT kJ2 %d -> %d",kJ2,TESTBIT(fTriggers, kJ2));
-
-    Printf("Requesting fTriggerTypeSel: %d",fTriggerTypeSel);
-    */
     if (!HasTriggerType(fTriggerTypeSel)) {
       if (fGeneralHistograms) fHistEventRejection->Fill("trigTypeSel",1);
-      //   Printf("Not found fTriggerTypeSel: %d\n",fTriggerTypeSel);
-      return kFALSE;
-    }
-    //    Printf("Found fTriggerTypeSel: %d\n",fTriggerTypeSel);
+      return kFALSE;
+    }
   }

   if ((fMinCent != -999) && (fMaxCent != -999)) {


Only show current time step in 2-d surface mapper

--- Modules/Core/src/Rendering/mitkSurfaceVtkMapper2D.cpp
+++ Modules/Core/src/Rendering/mitkSurfaceVtkMapper2D.cpp
@@ -123,30 +123,45 @@
 void mitk::SurfaceVtkMapper2D::Update(mitk::BaseRenderer *renderer)
 {
   const mitk::DataNode *node = GetDataNode();
+
   if (node == nullptr)
-    return;
+  {
+    this->ResetMapper(renderer);
+    return;
+  }
+
   bool visible = true;
   node->GetVisibility(visible, renderer, "visible");
+
   if (!visible)
-    return;
+  {
+    this->ResetMapper(renderer);
+    return;
+  }

   auto *surface = static_cast<mitk::Surface *>(node->GetData());
+
   if (surface == nullptr)
-    return;
+  {
+    this->ResetMapper(renderer);
+    return;
+  }
+
+  const auto* worldGeometry = renderer->GetWorldTimeGeometry();
+  const auto timeBounds = worldGeometry->GetTimeBounds(renderer->GetTimeStep());
+
+  if (!surface->GetTimeGeometry()->IsValidTimePoint(timeBounds[0]))
+  {
+    this->ResetMapper(renderer);
+    return;
+  }

   // Calculate time step of the input data for the specified renderer (integer value)
   this->CalculateTimeStep(renderer);

-  // Check if time step is valid
-  const mitk::TimeGeometry *dataTimeGeometry = surface->GetTimeGeometry();
-  if ((dataTimeGeometry == nullptr) || (dataTimeGeometry->CountTimeSteps() == 0) ||
-      (!dataTimeGeometry->IsValidTimeStep(this->GetTimestep())))
-  {
-    return;
-  }
-
   surface->UpdateOutputInformation();
   LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
+  localStorage->m_PropAssembly->VisibilityOn();

   // check if something important has changed and we need to rerender
   if ((localStorage->m_LastUpdateTime < node->GetMTime()) // was the node modified?


Add comparison operators for Dimention class.

--- include/Dimentions.hpp
+++ include/Dimentions.hpp
@@ -8,4 +8,14 @@
     Dimentions(int w, int h) : W(w), H(h) {}
 };

+inline bool operator==(const Dimentions& lhs, const Dimentions& rhs)
+{
+    return lhs.W == rhs.W && lhs.H == rhs.H;
+}
+
+inline bool operator!=(const Dimentions& lhs, const Dimentions& rhs)
+{
+    return !(lhs == rhs);
+}
+
 #endif // DIMENTIONS_HPP


[vm] Remove NoReloadScope from Exceptions::Create.

TEST=reload bots
Bug: https://github.com/dart-lang/sdk/issues/46731
Change-Id: If347196567f1c19516a5ae52ebfa1073d7ece634
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208685
Reviewed-by: Alexander Aprelev <dfb74c35a357c2059971a4bf7fe26b6a7c18085d@google.com>
Commit-Queue: Ryan Macnak <d738b7f001baf9789095d7dc549cff6de60b011d@google.com>

--- runtime/vm/exceptions.cc
+++ runtime/vm/exceptions.cc
@@ -1139,8 +1139,6 @@
       break;
   }

-  Thread* thread = Thread::Current();
-  NoReloadScope no_reload_scope(thread);
   return DartLibraryCalls::InstanceCreate(library, *class_name,
                                           *constructor_name, arguments);
 }


Fix compilation error on Intel-15 compilers with GCC 4.3 STL.

This was a fairly weird issue.  It turns out that this particular
compiler can compile std::tr1::unordered_{map,set} but not
std::tr1::hash because... things.  But this is OK because actually
using std::tr1::unordered_{map,set} does not require std::tr1::hash.

We should only require hash function specializations for pointer types
when LIBMESH_BEST_UNORDERED_MAP is actually __gnu_cxx::hash_map, and
ensuring that we include LIBMESH_INCLUDE_HASH should handle this case.

Addresses #538.

--- src/mesh/serial_mesh.C
+++ src/mesh/serial_mesh.C
@@ -27,6 +27,7 @@

 #include LIBMESH_INCLUDE_UNORDERED_MAP
 #include LIBMESH_INCLUDE_UNORDERED_SET
+#include LIBMESH_INCLUDE_HASH
 LIBMESH_DEFINE_HASH_POINTERS


fixed dump for  event system

fixed dump for  event system

--- NFComm/NFEventProcessPlugin/NFCEventProcessModule.cpp
+++ NFComm/NFEventProcessPlugin/NFCEventProcessModule.cpp
@@ -45,7 +45,7 @@
 bool NFCEventProcessModule::AddEventCallBack(const NFIDENTID& objectID, const int nEventID, const EVENT_PROCESS_FUNCTOR_PTR& cb)
 {
     NF_SHARE_PTR<NFCObjectEventInfo> pObjectEventInfo = mObjectEventInfoMapEx.GetElement(objectID);
-    if (nullptr != pObjectEventInfo)
+    if (nullptr == pObjectEventInfo)
     {
         pObjectEventInfo = NF_SHARE_PTR<NFCObjectEventInfo>(NF_NEW NFCObjectEventInfo());
         mObjectEventInfoMapEx.AddElement(objectID, pObjectEventInfo);
@@ -54,7 +54,7 @@
     assert(nullptr != pObjectEventInfo);

     NF_SHARE_PTR<NFEventList> pEventInfo = pObjectEventInfo->GetElement(nEventID);
-    if (nullptr != pEventInfo)
+    if (nullptr == pEventInfo)
     {
         pEventInfo = NF_SHARE_PTR<NFEventList>(NF_NEW NFEventList());
         pObjectEventInfo->AddElement(nEventID, pEventInfo);


Revert "Reader now returns values with no precision loss"

This reverts commit 4acd4b2bffc163348f5e03caf67fd2fcdb4a533f.

--- include/LuaContext.hpp
+++ include/LuaContext.hpp
@@ -2204,7 +2204,7 @@
 			typename std::enable_if<std::is_integral<TType>::value>::type
 		>
 {
-	using ReturnType = lua_Integer;
+	using ReturnType = TType;

 	static auto read(lua_State* state, int index)
 		-> boost::optional<TType>
@@ -2225,7 +2225,7 @@
 			typename std::enable_if<std::is_floating_point<TType>::value>::type
 		>
 {
-	using ReturnType = lua_Number;
+	using ReturnType = TType;

 	static auto read(lua_State* state, int index)
 		-> boost::optional<TType>


Support for constant expression in first parameter of SOUND

--- intybasic/IntyBASIC.cpp
+++ intybasic/IntyBASIC.cpp
@@ -186,6 +186,8 @@
 //                         DO followed by colon now isn't taken as label.
 //                         Updated copyright.
 //  Revision: Jan/23/2016. Added MUSIC JUMP statement.
+//  Revision: Jan/25/2016. SOUND now allows constant expressions as first
+//                         parameter.
 //

 //  TODO:
@@ -212,7 +214,7 @@
 #include "code.h"       // Class code
 #include "node.h"       // Class node

-const string VERSION = "v1.2.5 Jan/23/2016";      // Compiler version
+const string VERSION = "v1.2.5 Jan/25/2016";      // Compiler version

 const string LABEL_PREFIX = "Q";    // Prefix for BASIC labels
 const string TEMP_PREFIX = "T";     // Prefix for temporal labels
@@ -2016,17 +2018,18 @@
                         }
                     }
                 } else if (name == "SOUND") {
+                    class node *tree;
                     int channel;

                     get_lex();
-                    if (lex != C_NUM) {
-                        emit_error("bad syntax for SOUND");
+                    tree = eval_level0();
+                    if (tree->node_type() != C_NUM) {
+                        emit_error("only constant expression for first SOUND parameter");
                         channel = 0;
                     } else {
-                        channel = value;
+                        channel = tree->node_value();
                         if (channel < 0 || channel > 9)
                             emit_error("bad channel for SOUND");
-                        get_lex();
                         if (channel >= 5)
                             ecs_used = true;
                     }