Disabling all the WebUIBidi*RTL.TestSettings* tests on windows for being flaky.

TBR=jeremy@chromium.org
BUG=95425
TEST=

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

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

--- chrome/browser/ui/webui/bidi_checker_web_ui_test.cc
+++ chrome/browser/ui/webui/bidi_checker_web_ui_test.cc
@@ -340,8 +340,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsContentSettingsPage) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsContentSettingsPage DISABLED_TestSettingsContentSettingsPage
+#else
+#define MAYBE_TestSettingsContentSettingsPage TestSettingsContentSettingsPage
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsContentSettingsPage) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += std::string(chrome::kContentSettingsSubPage);
   RunBidiCheckerOnPage(url);
@@ -396,8 +403,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsSearchEnginesOptionsPage) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsSearchEnginesOptionsPage DISABLED_TestSettingsSearchEnginesOptionsPage
+#else
+#define MAYBE_TestSettingsSearchEnginesOptionsPage TestSettingsSearchEnginesOptionsPage
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsSearchEnginesOptionsPage) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += std::string(chrome::kSearchEnginesSubPage);
   RunBidiCheckerOnPage(url);
@@ -414,8 +428,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFrameSyncSetup) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFrameSyncSetup DISABLED_TestSettingsFrameSyncSetup
+#else
+#define MAYBE_TestSettingsFrameSyncSetup TestSettingsFrameSyncSetup
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFrameSyncSetup) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += std::string(chrome::kSyncSetupSubPage);
   RunBidiCheckerOnPage(url);
@@ -432,8 +453,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFrameStartup) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFrameStartup DISABLED_TestSettingsFrameStartup
+#else
+#define MAYBE_TestSettingsFrameStartup TestSettingsFrameStartup
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFrameStartup) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += "startup";
   RunBidiCheckerOnPage(url);
@@ -450,8 +478,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFrameImportData) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFrameImportData DISABLED_TestSettingsFrameImportData
+#else
+#define MAYBE_TestSettingsFrameImportData TestSettingsFrameImportData
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFrameImportData) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += chrome::kImportDataSubPage;
   RunBidiCheckerOnPage(url);
@@ -468,8 +503,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFrameMangageProfile) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFrameMangageProfile DISABLED_TestSettingsFrameMangageProfile
+#else
+#define MAYBE_TestSettingsFrameMangageProfile TestSettingsFrameMangageProfile
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFrameMangageProfile) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += chrome::kManageProfileSubPage;
   RunBidiCheckerOnPage(url);
@@ -487,8 +529,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFrameContentExceptionsCookies) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFrameContentExceptionsCookies DISABLED_TestSettingsFrameContentExceptionsCookies
+#else
+#define MAYBE_TestSettingsFrameContentExceptionsCookies TestSettingsFrameContentExceptionsCookies
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFrameContentExceptionsCookies) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += chrome::kContentSettingsExceptionsSubPage;
   url += "#cookies";
@@ -507,8 +556,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFrameContentExceptionsImages) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFrameContentExceptionsImages DISABLED_TestSettingsFrameContentExceptionsImages
+#else
+#define MAYBE_TestSettingsFrameContentExceptionsImages TestSettingsFrameContentExceptionsImages
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFrameContentExceptionsImages) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += chrome::kContentSettingsExceptionsSubPage;
   url += "#images";
@@ -527,8 +583,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFrameContentExceptionsJavascript) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFrameContentExceptionsJavascript DISABLED_TestSettingsFrameContentExceptionsJavascript
+#else
+#define MAYBE_TestSettingsFrameContentExceptionsJavascript TestSettingsFrameContentExceptionsJavascript
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFrameContentExceptionsJavascript) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += chrome::kContentSettingsExceptionsSubPage;
   url += "#javascript";
@@ -547,8 +610,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFrameContentExceptionsPlugins) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFrameContentExceptionsPlugins DISABLED_TestSettingsFrameContentExceptionsPlugins
+#else
+#define MAYBE_TestSettingsFrameContentExceptionsPlugins TestSettingsFrameContentExceptionsPlugins
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFrameContentExceptionsPlugins) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += chrome::kContentSettingsExceptionsSubPage;
   url += "#plugins";
@@ -621,8 +691,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFrameContentExceptionsNotifications) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFrameContentExceptionsNotifications DISABLED_TestSettingsFrameContentExceptionsNotifications
+#else
+#define MAYBE_TestSettingsFrameContentExceptionsNotifications TestSettingsFrameContentExceptionsNotifications
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFrameContentExceptionsNotifications) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += chrome::kContentSettingsExceptionsSubPage;
   url += "#notifications";
@@ -720,8 +797,15 @@
   RunBidiCheckerOnPage(url);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
-                       TestSettingsFramePasswords) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestSettingsFramePasswords DISABLED_TestSettingsFramePasswords
+#else
+#define MAYBE_TestSettingsFramePasswords TestSettingsFramePasswords
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
+                       MAYBE_TestSettingsFramePasswords) {
   std::string url(chrome::kChromeUISettingsFrameURL);
   url += "passwords";
   RunBidiCheckerOnPage(url);
@@ -775,7 +859,14 @@
   RunBidiCheckerOnPage(chrome::kChromeUIHelpFrameURL);
 }

-IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestHelpFrame) {
+#if defined(OS_WIN)
+// TestSettings tests are flaky http://crbug.com/95425
+#define MAYBE_TestHelpFrame DISABLED_TestHelpFrame
+#else
+#define MAYBE_TestHelpFrame TestHelpFrame
+#endif
+
+IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, MAYBE_TestHelpFrame) {
   RunBidiCheckerOnPage(chrome::kChromeUIHelpFrameURL);
 }


Fixes bug in tab dragging when rtl where the dragged tab was
incorrectly positioned.

BUG=51219
TEST=see bug

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

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

--- chrome/browser/views/tabs/dragged_tab_controller.cc
+++ chrome/browser/views/tabs/dragged_tab_controller.cc
@@ -720,6 +720,8 @@

   attached_tab_->SchedulePaint();
   attached_tab_->SetX(dragged_view_point.x());
+  attached_tab_->SetX(
+      attached_tabstrip_->MirroredLeftPointForRect(attached_tab_->bounds()));
   attached_tab_->SetY(dragged_view_point.y());
   attached_tab_->SchedulePaint();
 }


added --lower-bound and --upper-bound args

git-svn-id: c57083cae03de9a0803956a3abd65044d17a906b@413 3bbcab3b-a713-480a-a40a-1fdaa183d0c8

--- main/solveMDP.cc
+++ main/solveMDP.cc
@@ -1,5 +1,5 @@
 /********** tell emacs we use -*- c++ -*- style comments *******************
- $Revision: 1.2 $  $Author: trey $  $Date: 2006-04-07 20:15:40 $
+ $Revision: 1.3 $  $Author: trey $  $Date: 2006-04-10 20:27:05 $

  @file    solveMDP.cc
  @brief   No brief
@@ -72,6 +72,8 @@
   double minWait;
   bool useInterleave;
   bool useHeuristic;
+  bool forceLowerBound;
+  bool forceUpperBoundActionSelection;
 };

 struct EnumEntry {
@@ -140,8 +142,7 @@

 void testBatchIncremental(const SolveMDPParams& p)
 {
-
-  cout << "CFLAGS = " << CFLAGS << endl;
+  init_matrix_utils();

   MDP* problem;
   AbstractSim* sim;
@@ -158,55 +159,44 @@
     assert(0); // never reach this point
   }

-  // this is a bit of a hack...
-  bool useLowerBound;
+  Solver* solver;
   switch (p.strategy) {
   case S_RTDP:
+    solver = new RTDP();
+    break;
   case S_LRTDP:
-    useLowerBound = false;
-    break;
+    solver = new LRTDP();
+   break;
   case S_HDP:
+    solver = new HDP();
+    break;
   case S_FRTDP:
-    useLowerBound = true;
+    solver = new FRTDP();
     break;
   default:
     assert(0); // never reach this point
   };

+  bool keepLowerBound = p.forceLowerBound
+    || ((RTDPCore *) solver)->getUseLowerBound();
   IncrementalBounds* bounds;
-  PointBounds* pb;
   switch (p.valueRepr) {
   case V_POINT:
+    PointBounds* pb;
+    AbstractBound *initLowerBound, *initUpperBound;
+
     pb = new PointBounds();
-    AbstractBound* initUpperBound;
+    initLowerBound = keepLowerBound ? problem->newLowerBound() : NULL;
     if (p.useHeuristic && T_POMDP != p.probType) {
       initUpperBound = new RelaxUBInitializer(problem);
     } else {
       initUpperBound = problem->newUpperBound();
     }
-    pb->setBounds(problem->newLowerBound(), initUpperBound);
+    pb->setBounds(initLowerBound, initUpperBound, p.forceUpperBoundActionSelection);
     bounds = pb;
     break;
   case V_CONVEX:
-    bounds = new ConvexBounds(useLowerBound);
-    break;
-  default:
-    assert(0); // never reach this point
-  };
-
-  Solver* solver;
-  switch (p.strategy) {
-  case S_RTDP:
-    solver = new RTDP();
-    break;
-  case S_LRTDP:
-    solver = new LRTDP();
-   break;
-  case S_HDP:
-    solver = new HDP();
-    break;
-  case S_FRTDP:
-    solver = new FRTDP();
+    bounds = new ConvexBounds(keepLowerBound, p.forceUpperBoundActionSelection);
     break;
   default:
     assert(0); // never reach this point
@@ -265,6 +255,10 @@
     "  --weak-heuristic       Avoid spending time generating a good upper bound heuristic\n"
     "                           (only valid for some problems, interpretation depends on\n"
     "                            the problem; e.g. sets h_U = 0 for racetrack)\n"
+    "  --lower-bound          Forces solveMDP to maintain a lower bound and use it for\n"
+    "                           action selection, even if it is not used during search.\n"
+    "  --upper-bound          Forces solveMDP to use the upper bound for action selection\n"
+    "                           (normally the lower bound is used if it is available).\n"
     "  --min-eval             If minEval=k, start logging policy evaluation epochs\n"
     "                           after 10^k seconds of policy improvement [default: 0]\n"
     "  --max-eval             If maxEval=k, run ends after at most 10^k seconds of policy\n"
@@ -286,8 +280,6 @@
 }

 int main(int argc, char **argv) {
-  init_matrix_utils();
-
   static char shortOptions[] = "hs:t:v:fi:p:w:";
   static struct option longOptions[]={
     {"help",          0,NULL,'h'},
@@ -299,6 +291,8 @@
     {"iterations",    1,NULL,'i'},
     {"precision",     1,NULL,'p'},
     {"weak-heuristic",0,NULL,'W'},
+    {"lower-bound",   0,NULL,'L'},
+    {"upper-bound",   0,NULL,'U'},
     {"min-eval",      1,NULL,'X'},
     {"max-eval",      1,NULL,'Y'},
     {"interleave",    1,NULL,'I'},
@@ -319,6 +313,13 @@
   p.minWait = 0;
   p.useInterleave = false;
   p.useHeuristic = true;
+  p.forceLowerBound = false;
+  p.forceUpperBoundActionSelection = false;
+
+  ostringstream outs;
+  for (int i=1; i < argc; i++) {
+    outs << argv[i] << " ";
+  }

   while (1) {
     char optchar = getopt_long(argc,argv,shortOptions,longOptions,NULL);
@@ -352,6 +353,12 @@
       break;
     case 'W': // weak-heuristic
       p.useHeuristic = false;
+      break;
+    case 'L': // lower-bound
+      p.forceLowerBound = true;
+      break;
+    case 'U': // upper-bound
+      p.forceUpperBoundActionSelection = true;
       break;
     case 'X': // min-eval
       p.minOrder = atoi(optarg);
@@ -390,7 +397,7 @@
     } else if (endsWith(p.probName, ".pomdp")) {
       p.probType = T_POMDP;
     } else {
-      fprintf(stderr, "ERROR: couldn't infer problem type from problem filename %s\n\n",
+      fprintf(stderr, "ERROR: couldn't infer problem type from problem filename %s (use -t option)\n\n",
 	      p.probName);
       usage(argv[0]);
       exit(EXIT_FAILURE);
@@ -410,7 +417,9 @@
     p.maxOrder = 3; // default
   }

-  cerr << "done arg parsing" << endl;
+  printf("CFLAGS = %s\n", CFLAGS);
+  printf("ARGS = %s\n", outs.str().c_str());
+  fflush(stdout);

   testBatchIncremental(p);

@@ -425,6 +434,9 @@
 /***************************************************************************
  * REVISION HISTORY:
  * $Log: not supported by cvs2svn $
+ * Revision 1.2  2006/04/07 20:15:40  trey
+ * solveMDP now uses a strong heuristic by default; improved usage() help
+ *
  * Revision 1.1  2006/04/07 19:40:41  trey
  * switched back to a unified binary for all algorithms, turns out it cuts down on code maintenance
  *


Add back localization code to web resource service, for localized promos.

BUG=72342
TEST=manual

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

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@74208 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

--- chrome/browser/web_resource/web_resource_service.cc
+++ chrome/browser/web_resource/web_resource_service.cc
@@ -89,8 +89,12 @@
     else
       web_resource_service_->in_fetch_ = true;

+    std::string locale = g_browser_process->GetApplicationLocale();
+    std::string web_resource_server = kDefaultWebResourceServer;
+    web_resource_server.append(locale);
+
     url_fetcher_.reset(new URLFetcher(GURL(
-        kDefaultWebResourceServer),
+        web_resource_server),
         URLFetcher::GET, this));
     // Do not let url fetcher affect existing state in profile (by setting
     // cookies, for example.
@@ -224,7 +228,7 @@
 // Server for dynamically loaded NTP HTML elements. TODO(mirandac): append
 // locale for future usage, when we're serving localizable strings.
 const char* WebResourceService::kDefaultWebResourceServer =
-    "https://www.google.com/support/chrome/bin/topic/1142433/inproduct";
+    "https://www.google.com/support/chrome/bin/topic/1142433/inproduct?hl=";

 WebResourceService::WebResourceService(Profile* profile)
     : prefs_(profile->GetPrefs()),


The WebResourceService was overrunning the int value used to store the time used to update the NTP cache -- thus the cache wasn't being updated soon enough.

BUG=71129
TEST=Promos appear immediately if enabled on the correct build; no need to reload or restart browser.
Review URL: http://codereview.chromium.org/6336017

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@72976 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

--- chrome/browser/web_resource/web_resource_service.cc
+++ chrome/browser/web_resource/web_resource_service.cc
@@ -68,7 +68,7 @@

   // Delay initial load of resource data into cache so as not to interfere
   // with startup time.
-  void StartAfterDelay(int delay_ms) {
+  void StartAfterDelay(int64 delay_ms) {
     MessageLoop::current()->PostDelayedTask(FROM_HERE,
       fetcher_factory_.NewRunnableMethod(&WebResourceFetcher::StartFetch),
                                          delay_ms);
@@ -282,11 +282,11 @@
 void WebResourceService::ScheduleNotification(double promo_start,
                                               double promo_end) {
   if (promo_start > 0 && promo_end > 0 && !web_resource_update_scheduled_) {
-    int ms_until_start =
-        static_cast<int>((base::Time::FromDoubleT(
+    int64 ms_until_start =
+        static_cast<int64>((base::Time::FromDoubleT(
             promo_start) - base::Time::Now()).InMilliseconds());
-    int ms_until_end =
-        static_cast<int>((base::Time::FromDoubleT(
+    int64 ms_until_end =
+        static_cast<int64>((base::Time::FromDoubleT(
             promo_end) - base::Time::Now()).InMilliseconds());
     if (ms_until_start > 0) {
       web_resource_update_scheduled_ = true;
@@ -310,7 +310,7 @@
 }

 void WebResourceService::StartAfterDelay() {
-  int delay = kStartResourceFetchDelay;
+  int64 delay = kStartResourceFetchDelay;
   // Check whether we have ever put a value in the web resource cache;
   // if so, pull it out and see if it's time to update again.
   if (prefs_->HasPrefPath(prefs::kNTPWebResourceCacheUpdate)) {
@@ -319,8 +319,8 @@
     if (!last_update_pref.empty()) {
       double last_update_value;
       base::StringToDouble(last_update_pref, &last_update_value);
-      int ms_until_update = cache_update_delay_ -
-          static_cast<int>((base::Time::Now() - base::Time::FromDoubleT(
+      int64 ms_until_update = cache_update_delay_ -
+          static_cast<int64>((base::Time::Now() - base::Time::FromDoubleT(
           last_update_value)).InMilliseconds());
       delay = ms_until_update > cache_update_delay_ ?
           cache_update_delay_ : (ms_until_update < kStartResourceFetchDelay ?
@@ -328,7 +328,7 @@
     }
   }
   // Start fetch and wait for UpdateResourceCache.
-  web_resource_fetcher_->StartAfterDelay(static_cast<int>(delay));
+  web_resource_fetcher_->StartAfterDelay(delay);
 }

 void WebResourceService::UpdateResourceCache(const std::string& json_data) {


Signal events in WebDataService unit tests -- shave 24 seconds off the test runtime

BUG=none
TEST=none

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

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

--- chrome/browser/webdata/web_data_service_unittest.cc
+++ chrome/browser/webdata/web_data_service_unittest.cc
@@ -263,7 +263,7 @@
               Source<WebDataService>(wds_.get()),
               Property(&Details<const AutofillProfileChange>::ptr,
                        Pointee(expected_change)))).
-      WillOnce(DoDefault());
+      WillOnce(SignalEvent(&done_event_));

   wds_->AddAutoFillProfile(profile);
   done_event_.TimedWait(test_timeout_);
@@ -306,7 +306,7 @@
               Source<WebDataService>(wds_.get()),
               Property(&Details<const AutofillProfileChange>::ptr,
                        Pointee(expected_change)))).
-      WillOnce(DoDefault());
+      WillOnce(SignalEvent(&done_event_));

   // Remove the profile.
   wds_->RemoveAutoFillProfile(profile.guid());
@@ -354,7 +354,7 @@
               Source<WebDataService>(wds_.get()),
               Property(&Details<const AutofillProfileChange>::ptr,
                        Pointee(expected_change)))).
-      WillOnce(DoDefault());
+      WillOnce(SignalEvent(&done_event_));

   // Update the profile.
   wds_->UpdateAutoFillProfile(profile1_changed);


Add Japanese inactive user toast experiments.

(patch from Dominic Cooney, already reviewed here: http://codereview.chromium.org/5270011/)

TBR=finnur
BUG=58886
TEST=None

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

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@69465 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

--- chrome/installer/util/google_chrome_distribution.cc
+++ chrome/installer/util/google_chrome_distribution.cc
@@ -569,11 +569,18 @@
   }

   // This ends up being processed by ShowTryChromeDialog to show different
-  // experiments.  Only run the experiment in en-US.
+  // experiments.  Only run the experiment in en-US and ja.
   int flavor = 0;
   std::wstring language;
-  if (GoogleUpdateSettings::GetLanguage(&language) && (language == L"en-US"))
-    flavor = base::RandInt(0, 3);
+  if (GoogleUpdateSettings::GetLanguage(&language)) {
+    if (language == L"en-US") {
+      // en-US has four different toasts.
+      flavor = base::RandInt(0, 3);
+    } else if (language == L"ja") {
+      // ja has three different toasts.
+      flavor = base::RandInt(0, 2);
+    }
+  }

   std::wstring brand;
   if (GoogleUpdateSettings::GetBrand(&brand) && (brand == L"CHXX")) {


refs #82, remove checkpoint_1.cc for TokuDB 7.1.0, may bring it back fixed later. That is still open

--- src/tests/checkpoint_1.cc
+++ src/tests/checkpoint_1.cc
@@ -1,313 +0,0 @@
-/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
-/*
-COPYING CONDITIONS NOTICE:
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of version 2 of the GNU General Public License as
-  published by the Free Software Foundation, and provided that the
-  following conditions are met:
-
-      * Redistributions of source code must retain this COPYING
-        CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
-        DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
-        PATENT MARKING NOTICE (below), and the PATENT RIGHTS
-        GRANT (below).
-
-      * Redistributions in binary form must reproduce this COPYING
-        CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
-        DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
-        PATENT MARKING NOTICE (below), and the PATENT RIGHTS
-        GRANT (below) in the documentation and/or other materials
-        provided with the distribution.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-  02110-1301, USA.
-
-COPYRIGHT NOTICE:
-
-  TokuDB, Tokutek Fractal Tree Indexing Library.
-  Copyright (C) 2007-2013 Tokutek, Inc.
-
-DISCLAIMER:
-
-  This program 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
-  General Public License for more details.
-
-UNIVERSITY PATENT NOTICE:
-
-  The technology is licensed by the Massachusetts Institute of
-  Technology, Rutgers State University of New Jersey, and the Research
-  Foundation of State University of New York at Stony Brook under
-  United States of America Serial No. 11/760379 and to the patents
-  and/or patent applications resulting from it.
-
-PATENT MARKING NOTICE:
-
-  This software is covered by US Patent No. 8,185,551.
-  This software is covered by US Patent No. 8,489,638.
-
-PATENT RIGHTS GRANT:
-
-  "THIS IMPLEMENTATION" means the copyrightable works distributed by
-  Tokutek as part of the Fractal Tree project.
-
-  "PATENT CLAIMS" means the claims of patents that are owned or
-  licensable by Tokutek, both currently or in the future; and that in
-  the absence of this license would be infringed by THIS
-  IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
-
-  "PATENT CHALLENGE" shall mean a challenge to the validity,
-  patentability, enforceability and/or non-infringement of any of the
-  PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
-
-  Tokutek hereby grants to you, for the term and geographical scope of
-  the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
-  irrevocable (except as stated in this section) patent license to
-  make, have made, use, offer to sell, sell, import, transfer, and
-  otherwise run, modify, and propagate the contents of THIS
-  IMPLEMENTATION, where such license applies only to the PATENT
-  CLAIMS.  This grant does not include claims that would be infringed
-  only as a consequence of further modifications of THIS
-  IMPLEMENTATION.  If you or your agent or licensee institute or order
-  or agree to the institution of patent litigation against any entity
-  (including a cross-claim or counterclaim in a lawsuit) alleging that
-  THIS IMPLEMENTATION constitutes direct or contributory patent
-  infringement, or inducement of patent infringement, then any rights
-  granted to you under this License shall terminate as of the date
-  such litigation is filed.  If you or your agent or exclusive
-  licensee institute or order or agree to the institution of a PATENT
-  CHALLENGE, then Tokutek may terminate any rights granted to you
-  under this License.
-*/
-
-#ident "Copyright (c) 2007-2013 Tokutek Inc.  All rights reserved."
-#ident "$Id$"
-#include "test.h"
-#include <db.h>
-#include <sys/stat.h>
-
-#include "checkpoint_test.h"
-
-
-// Only useful for single threaded testing,
-// but can be accessed from checkpoint_callback.
-static DICTIONARY test_dictionary = NULL;
-static int iter = 0;  // horrible technique, but quicker than putting in extra (this is just test code, not product code)
-
-
-static void
-checkpoint_test_1(uint32_t flags, uint32_t n, int snap_all) {
-    if (verbose) {
-        printf("%s(%s):%d, n=0x%03x, checkpoint=%01x, flags=0x%05x\n",
-               __FILE__, __FUNCTION__, __LINE__,
-               n, snap_all, flags);
-        fflush(stdout);
-    }
-    dir_create(TOKU_TEST_FILENAME);
-    env_startup(TOKU_TEST_FILENAME, 0, 0);
-    int run;
-    int r;
-    DICTIONARY_S db_control;
-    init_dictionary(&db_control, flags, "control");
-    DICTIONARY_S db_test;
-    init_dictionary(&db_test, flags, "test");
-    test_dictionary = &db_test;
-
-    db_startup(&db_test, NULL);
-    db_startup(&db_control, NULL);
-    const int num_runs = 4;
-    for (run = 0; run < num_runs; run++) {
-        uint32_t i;
-        for (i=0; i < n/2/num_runs; i++) {
-            insert_random(db_test.db, db_control.db, NULL);
-        }
-        snapshot(&db_test, snap_all);
-        for (i=0; i < n/2/num_runs; i++) {
-            insert_random(db_test.db, NULL, NULL);
-        }
-        db_replace(TOKU_TEST_FILENAME, &db_test, NULL);
-        r = compare_dbs(db_test.db, db_control.db);
-	assert(r==0);
-    }
-    db_shutdown(&db_test);
-    db_shutdown(&db_control);
-    env_shutdown();
-}
-
-static void
-checkpoint_test_2(uint32_t flags, uint32_t n) {
-    if (verbose) {
-        printf("%s(%s):%d, n=0x%03x, checkpoint=%01x, flags=0x%05x\n",
-               __FILE__, __FUNCTION__, __LINE__,
-               n, 1, flags);
-	printf("Verify that inserts done during checkpoint are effective\n");
-        fflush(stdout);
-    }
-    dir_create(TOKU_TEST_FILENAME);
-    env_startup(TOKU_TEST_FILENAME, 0, 0);
-    int run;
-    int r;
-    DICTIONARY_S db_control;
-    init_dictionary(&db_control, flags, "control");
-    DICTIONARY_S db_test;
-    init_dictionary(&db_test, flags, "test");
-    test_dictionary = &db_test;
-
-    db_startup(&db_test, NULL);
-    db_startup(&db_control, NULL);
-    const int num_runs = 4;
-    for (run = 0; run < num_runs; run++) {
-	iter = run;
-        uint32_t i;
-        for (i=0; i < n/2/num_runs; i++)
-            insert_random(db_test.db, db_control.db, NULL);
-	r = compare_dbs(db_test.db, db_control.db);
-	assert(r==0);
-        snapshot(&db_test, true);  // take checkpoint, insert into test db during checkpoint callback
-	r = compare_dbs(db_test.db, db_control.db);
-	// test and control should be different
-	assert(r!=0);
-	// now insert same rows into control and they should be same
-	insert_n_fixed(db_control.db, NULL, NULL, iter * NUM_FIXED_ROWS, NUM_FIXED_ROWS);
-	r = compare_dbs(db_test.db, db_control.db);
-	assert(r==0);
-    }
-    // now close db_test via checkpoint callback (i.e. during checkpoint)
-    iter = -1;
-    snapshot(&db_test, true);
-    db_shutdown(&db_control);
-    env_shutdown();
-}
-
-
-
-
-// Purpose is to scribble over test db while checkpoint is
-// in progress.
-static void checkpoint_callback_1(void * extra) {
-    DICTIONARY d = *(DICTIONARY*) extra;
-    int i;
-    char name[MAX_NAME*2];
-    fill_name(d, name, sizeof(name));
-
-    if (verbose) {
-	printf("checkpoint_callback_1 inserting randomly into %s\n",
-	       name);
-	fflush(stdout);
-    }
-    for (i=0; i < 1024; i++)
-	insert_random(d->db, NULL, NULL);
-
-}
-
-static void checkpoint_callback_2(void * extra) {
-    DICTIONARY d = *(DICTIONARY*) extra;
-    assert(d==test_dictionary);
-    char name[MAX_NAME*2];
-    fill_name(d, name, sizeof(name));
-
-    if (iter >= 0) {
-	if (verbose) {
-	    printf("checkpoint_callback_2 inserting fixed rows into %s\n",
-		   name);
-	    fflush(stdout);
-	}
-	insert_n_fixed(d->db, NULL, NULL, iter * NUM_FIXED_ROWS, NUM_FIXED_ROWS);
-    }
-    else {
-	DICTIONARY_S db_temp;
-	init_dictionary(&db_temp, 0, "temp");
-	int i;
-	if (verbose) {
-	    printf("checkpoint_callback_2 closing %s\n",
-		   name);
-	    fflush(stdout);
-	}
-	db_shutdown(d);
-	if (verbose) {
-	    printf("checkpoint_callback_2 opening and closing unrelated dictionary\n");
-	    fflush(stdout);
-	}
-	db_startup(&db_temp, NULL);
-	for (i=0; i<1025; i++)
-	    insert_random(db_temp.db, NULL, NULL);
-	db_shutdown(&db_temp);
-    }
-}
-
-
-int
-test_main (int argc, char * const argv[]) {
-    parse_args(argc, argv);
-    uint32_t n;
-    int snap;
-
-    n = 0;
-    for (snap = 0; snap < 2; snap++) {
-        checkpoint_test_1(0, n, snap);
-    }
-    for (n = 1; n <= 1<<9; n*= 2) {
-        for (snap = 0; snap < 2; snap++) {
-            checkpoint_test_1(0, n, snap);
-        }
-    }
-
-    db_env_set_checkpoint_callback(checkpoint_callback_1, &test_dictionary);
-    checkpoint_test_1(0,4096,1);
-    db_env_set_checkpoint_callback(checkpoint_callback_2, &test_dictionary);
-    checkpoint_test_2(0,4096);
-    db_env_set_checkpoint_callback(NULL, NULL);
-
-    return 0;
-}
-
-#if 0
- checkpoint_1:
-   create two dbs, db_test (observed) and db_control (expected)
-   loop n times:
-     modify both dbs
-     checkpoint db_test
-     modify db_test only
-     copy db_test file (system(cp)) to db_temp
-     compare db_temp with db_control
-     continue test using db_temp as db_test instead of db_test
-     delete old db_test
- checkpoint_2,3 were subsumed into 1.
-
-
-TODO: Add callback to toku_checkpoint(), called after ydb lock is released.
-      (Note, checkpoint_safe_lock is still held.)
-
- checkpoint_4:
-   Callback can do some inserts, guaranteeing that we are testing that inserts
-   are done "during" a checkpoint.
-
- checkpoint_5:
-    Callback does unrelated open, close, and related close.
-
- checkpoint_6:
-    Callback triggers a thread that will perform same operations as:
-     * checkpoint_4
-     * checkpoint_5
-     * delete (relevant db)
-     * delete (irrelevant db)
-     * take checkpoint safe lock using YDB api, do something like insert and release it
-    but those operations happen during execution of toku_cachetable_end_checkpoint().
-
- checkpoint_7
-   take atomic operation lock
-   perform some inserts
-   on another thread, call toku_checkpoint()
-   sleep a few seconds
-   perform more inserts
-   release atomic operations lock
-   wait for checkpoint thread to complete
-   verify that checkpointed db has all data inserted
-
-
-#endif


glretrace: Limit the maximum number of glGetError warnings.

Just like we do for KHR_debug messages.

--- retrace/glretrace_main.cpp
+++ retrace/glretrace_main.cpp
@@ -82,47 +82,63 @@
 static void APIENTRY
 debugOutputCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam);

+// Limit certain warnings
+// TODO: expose this via a command line option.
+static const unsigned
+maxWarningCount = 100;
+
+static std::map< uint64_t, unsigned > errorCounts;
+
 void
 checkGlError(trace::Call &call) {
     GLenum error = glGetError();
     while (error != GL_NO_ERROR) {
-        std::ostream & os = retrace::warning(call);
-
-        os << "glGetError(";
-        os << call.name();
-        os << ") = ";
-
-        switch (error) {
-        case GL_INVALID_ENUM:
-            os << "GL_INVALID_ENUM";
-            break;
-        case GL_INVALID_VALUE:
-            os << "GL_INVALID_VALUE";
-            break;
-        case GL_INVALID_OPERATION:
-            os << "GL_INVALID_OPERATION";
-            break;
-        case GL_STACK_OVERFLOW:
-            os << "GL_STACK_OVERFLOW";
-            break;
-        case GL_STACK_UNDERFLOW:
-            os << "GL_STACK_UNDERFLOW";
-            break;
-        case GL_OUT_OF_MEMORY:
-            os << "GL_OUT_OF_MEMORY";
-            break;
-        case GL_INVALID_FRAMEBUFFER_OPERATION:
-            os << "GL_INVALID_FRAMEBUFFER_OPERATION";
-            break;
-        case GL_TABLE_TOO_LARGE:
-            os << "GL_TABLE_TOO_LARGE";
-            break;
-        default:
-            os << error;
-            break;
-        }
-        os << "\n";
-
+        uint64_t errorHash = call.sig->id ^ uint64_t(error) << 32;
+        size_t errorCount = errorCounts[errorHash]++;
+        if (errorCount <= maxWarningCount) {
+            std::ostream & os = retrace::warning(call);
+
+            os << "glGetError(";
+            os << call.name();
+            os << ") = ";
+
+            switch (error) {
+            case GL_INVALID_ENUM:
+                os << "GL_INVALID_ENUM";
+                break;
+            case GL_INVALID_VALUE:
+                os << "GL_INVALID_VALUE";
+                break;
+            case GL_INVALID_OPERATION:
+                os << "GL_INVALID_OPERATION";
+                break;
+            case GL_STACK_OVERFLOW:
+                os << "GL_STACK_OVERFLOW";
+                break;
+            case GL_STACK_UNDERFLOW:
+                os << "GL_STACK_UNDERFLOW";
+                break;
+            case GL_OUT_OF_MEMORY:
+                os << "GL_OUT_OF_MEMORY";
+                break;
+            case GL_INVALID_FRAMEBUFFER_OPERATION:
+                os << "GL_INVALID_FRAMEBUFFER_OPERATION";
+                break;
+            case GL_TABLE_TOO_LARGE:
+                os << "GL_TABLE_TOO_LARGE";
+                break;
+            default:
+                os << error;
+                break;
+            }
+
+            if (errorCount == maxWarningCount) {
+                os << ": too many identical messages; ignoring";
+            }
+
+            os << std::endl;
+        }
+
         error = glGetError();
     }
 }
@@ -447,11 +463,6 @@
 }

-// Limit messages
-// TODO: expose this via a command line option.
-static const unsigned
-maxMessageCount = 100;
-
 static std::map< uint64_t, unsigned > messageCounts;

@@ -480,7 +491,7 @@
                          + ((uint64_t)type     << 32)
                          + ((uint64_t)source   << 48);
     size_t messageCount = messageCounts[messageHash]++;
-    if (messageCount > maxMessageCount) {
+    if (messageCount > maxWarningCount) {
         return;
     }

@@ -572,7 +583,7 @@

     std::cerr << ": ";

-    if (messageCount == maxMessageCount) {
+    if (messageCount == maxWarningCount) {
         std::cerr << "too many identical messages; ignoring"
                   << highlighter.normal()
                   << std::endl;


glretrace: Remove spurious line in previous commit.

--- retrace/glstate_images.cpp
+++ retrace/glstate_images.cpp
@@ -1001,7 +1001,6 @@
     Context context;

     GLenum type = GL_UNSIGNED_BYTE;
-    getFormat(internalFormat);
     image::ChannelType channelType = image::TYPE_UNORM8;

     if (format == GL_DEPTH_COMPONENT) {


fix code scanning issue

fix code scanning issue

--- src/Dumper.cpp
+++ src/Dumper.cpp
@@ -500,9 +500,9 @@
       if (options->binaryAsHex) {
         _sink->push_back('"');
         ValueLength len;
-        uint8_t const *bin = slice->getBinary(len);
-        for (uint8_t i = 0; i < len; i++) {
-          uint8_t value = *(bin+i);
+        uint8_t const* bin = slice->getBinary(len);
+        for (ValueLength i = 0; i < len; ++i) {
+          uint8_t value = bin[i];
           uint8_t x = value / 16;
           _sink->push_back((x < 10 ? ('0' + x) : ('a' + x - 10)));
           x = value % 16;


Fix for bug #3073481, in MouseLeave set ptMouseLast to (-1,-1) so will not send dwell start on timer. Send dwell end for mouse leave.

--- src/Editor.cxx
+++ src/Editor.cxx
@@ -5833,6 +5833,10 @@

 void Editor::MouseLeave() {
 	SetHotSpotRange(NULL);
+	if (!HaveMouseCapture()) {
+		ptMouseLast = Point(-1,-1);
+		DwellEnd(true);
+	}
 }

 static bool AllowVirtualSpace(int virtualSpaceOptions, bool rectangular) {
@@ -6221,7 +6225,8 @@
 	}
 	if ((dwellDelay < SC_TIME_FOREVER) &&
 	        (ticksToDwell > 0) &&
-	        (!HaveMouseCapture())) {
+	        (!HaveMouseCapture()) &&
+	        (ptMouseLast.y >= 0)) {
 		ticksToDwell -= timer.tickSize;
 		if (ticksToDwell <= 0) {
 			dwelling = true;


Issue #21: one-for-all app saving frames from file working now

--- src/tests/save_frames.cpp
+++ src/tests/save_frames.cpp
@@ -36,6 +36,7 @@
 int i = 0;
 VideoFrame_BGRA frame;
 cv::Mat image(height * square_size, width * square_size, CV_8UC4);
+cv::VideoCapture cap;

 void parse_args(int argc, char ** argv)
 {
@@ -56,8 +57,26 @@

     if (args[1]=="file")
     {
-        // TODO
-        return;
+        test_mode = TestMode::File;
+
+        if (argc < 4)
+        {
+            synopsis(); exit(-1);
+        }
+
+        cap.open(args[2]);
+        if (not cap.isOpened())
+        {
+            std::cerr << "File " << args[2]
+                      << " could not be opened"
+                      << std::endl;
+            exit(-1);
+        }
+
+        codec_string = args[3];
+        num_frames = cap.get(CV_CAP_PROP_FRAME_COUNT);
+        fps = cap.get(CV_CAP_PROP_FPS);
+        duration = (num_frames / fps) / 60;
     }

     if (args[1]=="chess")
@@ -97,8 +116,12 @@
         // TODO
         break;
     case TestMode::File:
-        // TODO
-        break;
+        filename.append(std::to_string(duration))
+                .append("min_")
+                .append(codec_string)
+                .append("_from_file.")
+                .append(filetype);
+        return filename;
     case TestMode::Chessboard:
         filename.append("1min_")
                 .append(codec_string)
@@ -145,7 +168,9 @@
         // TODO
         break;
     case TestMode::File:
-        // TODO
+        cap >> image;
+        cv::cvtColor(image, image, CV_BGR2BGRA);
+        frame.init_from_opencv_mat(image);
         break;
     default:
         std::cerr << "Test mode not set" << std::endl;


Feature #3520037. Restore Ctrl+Triple Click adding a line to the selection. Collapse selection if multiple selection turned off. From Marko Njezic.

--- src/Editor.cxx
+++ src/Editor.cxx
@@ -6233,7 +6233,7 @@
 	if (((curTime - lastClickTime) < Platform::DoubleClickTime()) && Close(pt, lastClick)) {
 		//Platform::DebugPrintf("Double click %d %d = %d\n", curTime, lastClickTime, curTime - lastClickTime);
 		SetMouseCapture(true);
-		if ((!ctrl) || (selectionType != selChar))
+		if (!ctrl || !multipleSelection || (selectionType != selChar && selectionType != selWord))
 			SetEmptySelection(newPos.Position());
 		bool doubleClick = false;
 		// Stop mouse button bounce changing selection type


[Code Style] Removed unused typedef.

[Code Style] Removed unused typedef.

--- src/tests/test_Config.cpp
+++ src/tests/test_Config.cpp
@@ -32,7 +32,6 @@
     ASSERT_TRUE(actual.naming.find("message") != actual.naming.end());
     EXPECT_EQ("@message", actual.naming["message"]);

-    typedef std::unordered_map<std::string, routing_t::routes_t> specified_positioning_t;
     ASSERT_TRUE(actual.routing.specified.find("message") != actual.routing.specified.end());
     EXPECT_EQ(std::vector<std::string>({}), actual.routing.specified["message"]);
     EXPECT_EQ(std::vector<std::string>({ "fields" }), actual.routing.unspecified);


Change creation of stippled pixmaps to use FillRectangle calls rather than LineTo to avoid blurry images when using an antialiased drawing library like Cairo.

--- src/Editor.cxx
+++ src/Editor.cxx
@@ -3165,11 +3165,11 @@
 		}

 		pixmapSelPattern->FillRectangle(rcPattern, colourFMFill);
-		pixmapSelPattern->PenColour(colourFMStripes);
-		for (int stripe = 0; stripe < patternSize; stripe++) {
-			// Alternating 1 pixel stripes is same as checkerboard.
-			pixmapSelPattern->MoveTo(0, stripe * 2);
-			pixmapSelPattern->LineTo(patternSize, stripe * 2 - patternSize);
+		for (int y = 0; y < patternSize; y++) {
+			for (int x = y % 2; x < patternSize; x+=2) {
+				PRectangle rcPixel(x, y, x+1, y+1);
+				pixmapSelPattern->FillRectangle(rcPixel, colourFMStripes);
+			}
 		}
 	}

@@ -3183,10 +3183,9 @@
 		pixmapIndentGuideHighlight->FillRectangle(rcIG, vs.styles[STYLE_BRACELIGHT].back.allocated);
 		pixmapIndentGuideHighlight->PenColour(vs.styles[STYLE_BRACELIGHT].fore.allocated);
 		for (int stripe = 1; stripe < vs.lineHeight + 1; stripe += 2) {
-			pixmapIndentGuide->MoveTo(0, stripe);
-			pixmapIndentGuide->LineTo(2, stripe);
-			pixmapIndentGuideHighlight->MoveTo(0, stripe);
-			pixmapIndentGuideHighlight->LineTo(2, stripe);
+			PRectangle rcPixel(0, stripe, 1, stripe+1);
+			pixmapIndentGuide->FillRectangle(rcPixel, vs.styles[STYLE_INDENTGUIDE].fore.allocated);
+			pixmapIndentGuideHighlight->FillRectangle(rcPixel, vs.styles[STYLE_BRACELIGHT].fore.allocated);
 		}
 	}


Fixed GCC 4.4. warnings.

Fixed GCC 4.4. warnings.

--- src/tests/test_Filter.cpp
+++ src/tests/test_Filter.cpp
@@ -548,8 +548,8 @@
 }

 TEST(FilterCustomAttribute, CombinationOfLogicOperatorsWithEqFilter) {
-    auto filter = expr::get_attr<std::int32_t>("custom-1") == 42 &&
-            expr::get_attr<std::int32_t>("custom-2") == 100500 ||
+    auto filter = (expr::get_attr<std::int32_t>("custom-1") == 42 &&
+                   expr::get_attr<std::int32_t>("custom-2") == 100500) ||
             expr::get_attr<std::int32_t>("custom-3") == 666;

     log::attributes_t attributes = {
@@ -597,48 +597,48 @@

 TEST(FilterCustomAttribute, ReversedCombinationOfLogicOperatorsWithEqFilter) {
     auto filter = expr::get_attr<std::int32_t>("custom-1") == 42 ||
-            expr::get_attr<std::int32_t>("custom-2") == 100500 &&
-            expr::get_attr<std::int32_t>("custom-3") == 666;
-
-    log::attributes_t attributes = {
-        {"custom-1", log::attribute_t(42)},
-        {"custom-2", log::attribute_t(100500)},
-        {"custom-3", log::attribute_t(666)},
-    };
-    EXPECT_TRUE(filter(attributes));
-
-    attributes = {
-        {"custom-1", log::attribute_t(42)},
-        {"custom-2", log::attribute_t(100501)},
-        {"custom-3", log::attribute_t(666)},
-    };
-    EXPECT_TRUE(filter(attributes));
-
-    attributes = {
-        {"custom-1", log::attribute_t(42)},
-        {"custom-2", log::attribute_t(100500)},
-        {"custom-3", log::attribute_t(667)},
-    };
-    EXPECT_TRUE(filter(attributes));
-
-    attributes = {
-        {"custom-1", log::attribute_t(41)},
-        {"custom-2", log::attribute_t(100500)},
-        {"custom-3", log::attribute_t(666)},
-    };
-    EXPECT_TRUE(filter(attributes));
-
-    attributes = {
-        {"custom-1", log::attribute_t(41)},
-        {"custom-2", log::attribute_t(100501)},
-        {"custom-3", log::attribute_t(666)},
-    };
-    EXPECT_FALSE(filter(attributes));
-
-    attributes = {
-        {"custom-1", log::attribute_t(41)},
-        {"custom-2", log::attribute_t(100500)},
-        {"custom-3", log::attribute_t(667)},
-    };
-    EXPECT_FALSE(filter(attributes));
-}
+            (expr::get_attr<std::int32_t>("custom-2") == 100500 &&
+             expr::get_attr<std::int32_t>("custom-3") == 666);
+
+    log::attributes_t attributes = {
+        {"custom-1", log::attribute_t(42)},
+        {"custom-2", log::attribute_t(100500)},
+        {"custom-3", log::attribute_t(666)},
+    };
+    EXPECT_TRUE(filter(attributes));
+
+    attributes = {
+        {"custom-1", log::attribute_t(42)},
+        {"custom-2", log::attribute_t(100501)},
+        {"custom-3", log::attribute_t(666)},
+    };
+    EXPECT_TRUE(filter(attributes));
+
+    attributes = {
+        {"custom-1", log::attribute_t(42)},
+        {"custom-2", log::attribute_t(100500)},
+        {"custom-3", log::attribute_t(667)},
+    };
+    EXPECT_TRUE(filter(attributes));
+
+    attributes = {
+        {"custom-1", log::attribute_t(41)},
+        {"custom-2", log::attribute_t(100500)},
+        {"custom-3", log::attribute_t(666)},
+    };
+    EXPECT_TRUE(filter(attributes));
+
+    attributes = {
+        {"custom-1", log::attribute_t(41)},
+        {"custom-2", log::attribute_t(100501)},
+        {"custom-3", log::attribute_t(666)},
+    };
+    EXPECT_FALSE(filter(attributes));
+
+    attributes = {
+        {"custom-1", log::attribute_t(41)},
+        {"custom-2", log::attribute_t(100500)},
+        {"custom-3", log::attribute_t(667)},
+    };
+    EXPECT_FALSE(filter(attributes));
+}


commenting out debug printouts, ready for merge

--- db/shard.cc
+++ db/shard.cc
@@ -748,7 +748,7 @@
         // map from node_handle, lookup_pair to node_prog_running_state
         S->node_prog_running_states_mutex.lock();
         S->node_prog_running_states[lookup_pair] = fstate;
-        WDEBUG << "Inserting prog state with lookup pair where local_node_handle is " << local_node_handle << std::endl;
+        //WDEBUG << "Inserting prog state with lookup pair where local_node_handle is " << local_node_handle << std::endl;
         S->node_prog_running_states_mutex.unlock();
         for (auto& shard_list_pair : contexts_to_fetch){
             std::unique_ptr<message::message> m(new message::message()); // XXX can we re-use messages?
@@ -937,7 +937,7 @@
     message::unpack_message(*msg, message::NODE_CONTEXT_REPLY, pType, req_id, vt_id, req_vclock, lookup_pair, contexts_to_add);

     S->node_prog_running_states_mutex.lock();
-    WDEBUG << "unpacking context reply for node: " << lookup_pair.second << " where exists is " << (S->node_prog_running_states.count(lookup_pair) > 0) << std::endl;
+    //WDEBUG << "unpacking context reply for node: " << lookup_pair.second << " where exists is " << (S->node_prog_running_states.count(lookup_pair) > 0) << std::endl;
     struct fetch_state<ParamsType, NodeStateType> *fstate = (struct fetch_state<ParamsType, NodeStateType> *) S->node_prog_running_states.at(lookup_pair);
     S->node_prog_running_states_mutex.unlock();

@@ -949,7 +949,7 @@
         assert(fstate->prog_state.cache_value); // cache value should exist
         node_prog_loop<ParamsType, NodeStateType>(enclosed_node_prog_func, fstate->prog_state);
         fstate->counter_mutex.unlock();
-        WDEBUG << "deleting lookup pair for node: " << lookup_pair.second << std::endl;
+        //WDEBUG << "deleting lookup pair for node: " << lookup_pair.second << std::endl;
         //remove from map
         S->node_prog_running_states_mutex.lock();
         size_t num_erased = S->node_prog_running_states.erase(lookup_pair);


Wrap lines if needed when moving to a position. Bug #3487397. From Marko Njezic.

--- src/Editor.cxx
+++ src/Editor.cxx
@@ -909,7 +909,12 @@
 		SetEmptySelection(newPos);
 	}
 	ShowCaretAtCurrentPosition();
+
+	int currentLine = pdoc->LineFromPosition(newPos.Position());
 	if (ensureVisible) {
+		// In case in need of wrapping to ensure DisplayFromDoc works.
+		if (currentLine >= wrapStart)
+			WrapLines(true, -1);
 		XYScrollPosition newXY = XYScrollToMakeVisible(true, true, true);
 		if (simpleCaret && (newXY.xOffset == xOffset)) {
 			// simple vertical scroll then invalidate
@@ -919,8 +924,6 @@
 			SetXYScroll(newXY);
 		}
 	}
-
-	int currentLine = pdoc->LineFromPosition(newPos.Position());

 	if (highlightDelimiter.NeedsDrawing(currentLine)) {
 		RedrawSelMargin();
@@ -6891,7 +6894,8 @@
 void Editor::EnsureLineVisible(int lineDoc, bool enforcePolicy) {

 	// In case in need of wrapping to ensure DisplayFromDoc works.
-	WrapLines(true, -1);
+	if (lineDoc >= wrapStart)
+		WrapLines(true, -1);

 	if (!cs.GetVisible(lineDoc)) {
 		int lookLine = lineDoc;


Avoid warning for unused assignment.

Avoid warning for unused assignment.

--- src/Editor.cxx
+++ src/Editor.cxx
@@ -2042,7 +2042,7 @@
 			ll->edgeColumn = -1;
 		}

-		char styleByte = 0;
+		char styleByte;
 		const int styleMask = pdoc->stylingBitsMask;
 		ll->styleBitsSet = 0;
 		// Fill base line layout


Fix compilation issues on Mac for UE 4.11

--- Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp
+++ Source/VaRestEditorPlugin/Private/VaRest_BreakJson.cpp
@@ -274,3 +274,5 @@
 {
 	return LOCTEXT("VaRest_Break_Json.NodeTitle", "Break Json");
 }
+
+#undef LOCTEXT_NAMESPACE


Some minor cleaning up related to issue #721 [ci skip].

--- src/plugins/support/StandardSupport/src/standardfilemanager.cpp
+++ src/plugins/support/StandardSupport/src/standardfilemanager.cpp
@@ -153,7 +153,7 @@
         // considered as being a file)?

         if (isFile(pFileName))
-            qobject_cast<StandardFile *>(crtFile)->reload();
+            static_cast<StandardFile *>(crtFile)->reload();
         else
             unmanageFile(pFileName);
     } else {
@@ -166,7 +166,7 @@
         crtFile = file(pFileName);

         if (crtFile)
-            qobject_cast<StandardFile *>(crtFile)->load();
+            static_cast<StandardFile *>(crtFile)->load();
     }
 }

@@ -188,7 +188,7 @@

     // We also need to ensure that our file object has its file name updated

-    qobject_cast<StandardFile *>(crtFile)->setFileName(pNewFileName);
+    static_cast<StandardFile *>(crtFile)->setFileName(pNewFileName);
 }

 //==============================================================================


Fixing strCmp.

Fixing strCmp.

--- src/string.cpp
+++ src/string.cpp
@@ -187,7 +187,7 @@
 			}
 		}

-		return 0 == max ? 0 : fn(*_lhs) - fn(*_rhs);
+		return 0 == max && _lhsMax == _rhsMax ? 0 : fn(*_lhs) - fn(*_rhs);
 	}

 	int32_t strCmp(const StringView& _lhs, const StringView& _rhs, int32_t _max)
@@ -272,7 +272,7 @@
 			return (_lhs[ii] - '0') - (_rhs[ii] - '0');
 		}

-		return 0 == max ? 0 : _lhs[ii] - _rhs[ii];
+		return 0 == max && _lhsMax == _rhsMax ? 0 : _lhs[ii] - _rhs[ii];
 	}

 	int32_t strCmpV(const StringView& _lhs, const StringView& _rhs, int32_t _max)


Avoid drawing alpha rectangles that extend well before the left of the window as that causes allocation of large buffers on some platforms.

--- src/Editor.cxx
+++ src/Editor.cxx
@@ -3044,7 +3044,7 @@
 	}

 	// Draw any translucent whole line states
-	rcSegment.left = xStart;
+	rcSegment.left = 0;
 	rcSegment.right = rcLine.right - 1;
 	if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) {
 		SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground.allocated, vsDraw.caretLineAlpha);


strmap: add copy constructor

strmap: add copy constructor

--- src/strmap.cxx
+++ src/strmap.cxx
@@ -49,6 +49,16 @@
     mutable Map::const_iterator cursor;

     explicit strmap(struct pool &_pool):pool(_pool) {}
+
+    strmap(struct pool &_pool, const strmap &src):pool(_pool) {
+        const auto hint = map.end();
+        for (auto &i : src.map) {
+            Item *item = NewFromPool<Item>(&pool,
+                                           p_strdup(&pool, i.key),
+                                           p_strdup(&pool, i.value));
+            map.insert(hint, *item);
+        }
+    }

     strmap(const strmap &) = delete;

@@ -115,17 +125,9 @@
 }

 struct strmap *gcc_malloc
-strmap_dup(struct pool *pool, struct strmap *src, unsigned capacity)
+strmap_dup(struct pool *pool, struct strmap *src, gcc_unused unsigned capacity)
 {
-    struct strmap *dest = strmap_new(pool, capacity);
-    const struct strmap_pair *pair;
-
-    strmap_rewind(src);
-    while ((pair = strmap_next(src)) != nullptr)
-        strmap_add(dest, p_strdup(pool, pair->key),
-                   p_strdup(pool, pair->value));
-
-    return dest;
+    return NewFromPool<struct strmap>(pool, *pool, *src);
 }

 void


Use command line args for client endpoint

--- Examples/ClientExample.cpp
+++ Examples/ClientExample.cpp
@@ -2,7 +2,8 @@

 int main(int argc, char* argv[])
 {
-   Kontroller::Client client;
+   const char* endpoint = argc > 1 ? argv[1] : "127.0.0.1";
+   Kontroller::Client client(endpoint);

    client.setButtonCallback([](Kontroller::Button button, bool pressed)
    {


ENH: added test of RemoveObserver

--- Testing/Code/BasicFilters/itkBasicArchitectureTest.cxx
+++ Testing/Code/BasicFilters/itkBasicArchitectureTest.cxx
@@ -198,7 +198,7 @@
   allEvents = itk::MemberCommand<AllEvents>::New();
   allEvents->SetCallbackFunction(&allWatch,
                                  &AllEvents::WatchEvents);
-  shrink->AddObserver(itk::Command::AnyEvent, allEvents);
+  unsigned long tag = shrink->AddObserver(itk::Command::AnyEvent, allEvents);

   // Create a mapper (in this case a writer). A mapper
   // is templated on the input type.
@@ -218,6 +218,9 @@
   rawWriter->SetByteOrderToBigEndian();
   rawWriter->Write();

+  // test RemoveObserver code
+  shrink->RemoveObserver( tag );
+
   return EXIT_SUCCESS;
 }


Made backspace work better for multi-selection. Check virtual space options when mouse clicked in virtual space.

--- src/Editor.cxx
+++ src/Editor.cxx
@@ -3919,31 +3919,13 @@
 				sel.ClearVirtualSpace(r);
 			}
 		}
-		/*
-		if (!RangeContainsProtected(sel.MainCaret() - 1, sel.MainCaret())) {
-			int lineCurrentPos = pdoc->LineFromPosition(sel.MainCaret());
-			if (allowLineStartDeletion || (pdoc->LineStart(lineCurrentPos) != sel.MainCaret())) {
-				if (pdoc->GetColumn(sel.MainCaret()) <= pdoc->GetLineIndentation(lineCurrentPos) &&
-				        pdoc->GetColumn(sel.MainCaret()) > 0 && pdoc->backspaceUnindents) {
-					pdoc->BeginUndoAction();
-					int indentation = pdoc->GetLineIndentation(lineCurrentPos);
-					int indentationStep = pdoc->IndentSize();
-					if (indentation % indentationStep == 0) {
-						pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep);
-					} else {
-						pdoc->SetLineIndentation(lineCurrentPos, indentation - (indentation % indentationStep));
-					}
-					SetEmptySelection(pdoc->GetLineIndentPosition(lineCurrentPos));
-					pdoc->EndUndoAction();
-				} else {
-					pdoc->DelCharBack(sel.MainCaret());
-				}
-			}
-		}
-		*/
 	} else {
 		ClearSelection();
-		SetEmptySelection(sel.MainCaret());
+		if (sel.IsRectangular()) {
+			sel.selType = Selection::selThin;
+			sel.Rectangular() = SelectionRange(sel.Rectangular().caret, sel.Range(0).anchor);
+		}
+		//SetEmptySelection(sel.MainCaret());
 	}
 	if (undoBracketNeeded)
 		pdoc->EndUndoAction();
@@ -5527,7 +5509,7 @@
 void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) {
 	//Platform::DebugPrintf("ButtonDown %d %d = %d alt=%d %d\n", curTime, lastClickTime, curTime - lastClickTime, alt, inDragDrop);
 	ptMouseLast = pt;
-	SelectionPosition newPos = SPositionFromLocation(pt);
+	SelectionPosition newPos = SPositionFromLocation(pt, false, false, (virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0);
 	newPos = MovePositionOutsideChar(newPos, sel.MainCaret() - newPos.Position());
 	inDragDrop = ddNone;
 	sel.SetMoveExtends(false);
@@ -5700,7 +5682,7 @@
 		DwellEnd(true);
 	}

-	SelectionPosition movePos = SPositionFromLocation(pt);
+	SelectionPosition movePos = SPositionFromLocation(pt, false, false, (virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0);
 	movePos = MovePositionOutsideChar(movePos, sel.MainCaret() - movePos.Position());

 	if (inDragDrop == ddInitial) {
@@ -5805,7 +5787,7 @@

 void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
 	//Platform::DebugPrintf("ButtonUp %d %d\n", HaveMouseCapture(), inDragDrop);
-	SelectionPosition newPos = SPositionFromLocation(pt);
+	SelectionPosition newPos = SPositionFromLocation(pt, false, false, (virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0);
 	newPos = MovePositionOutsideChar(newPos, sel.MainCaret() - newPos.Position());
 	if (inDragDrop == ddInitial) {
 		inDragDrop = ddNone;


DOC: fix the call to Update() after mail at otb-users

--- Examples/IO/ExtractROI.cxx
+++ Examples/IO/ExtractROI.cxx
@@ -168,14 +168,14 @@
   //  Software Guide : BeginLatex
   //
   //  Since the number of bands of the input image is dynamically set
-  //  at runtime, the \code{Update} method of the reader must be
+  //  at runtime, the \code{UpdateOutputInformation} method of the reader must be
   //  called before using the extractor filter.
   //
   //  Software Guide : EndLatex

   // Software Guide : BeginCodeSnippet
   reader->SetFileName( inputFilename  );
-  reader->Update();
+  reader->UpdateOutputInformation();
   writer->SetFileName( outputFilenameRGB );
   // Software Guide : EndCodeSnippet


Polyline2D support, additional Polyline / Vertex properties

--- lib/dwg/r2000.cpp
+++ lib/dwg/r2000.cpp
@@ -586,6 +586,8 @@
     oHeader.addValue( CADHeader::FINGERPRINTGUID, ReadTV( pabyBuf, nBitOffsetFromStart ) );
     oHeader.addValue( CADHeader::VERSIONGUID, ReadTV( pabyBuf, nBitOffsetFromStart ) );

+
+
     CADHandle stBlockRecordPaperSpace = ReadHANDLE( pabyBuf, nBitOffsetFromStart );
     oTables.AddTable( CADTables::BlockRecordPaperSpace, stBlockRecordPaperSpace );
     // TODO: is this part of the header?
@@ -596,7 +598,8 @@
     {
         // Is this part of the header?

-        /*CADHandle LTYPE_BYLAYER = */ReadHANDLE( pabyBuf, nBitOffsetFromStart );
+        /*CADHandle LTYPE_
+		= */ReadHANDLE( pabyBuf, nBitOffsetFromStart );
         /*CADHandle LTYPE_BYBLOCK = */ReadHANDLE( pabyBuf, nBitOffsetFromStart );
         /*CADHandle LTYPE_CONTINUOUS = */ReadHANDLE( pabyBuf, nBitOffsetFromStart );

@@ -879,6 +882,9 @@
             case CADObject::TEXT:
                 return getText( dObjectSize, stCommonEntityData, pabySectionContent, nBitOffsetFromStart );

+			case CADObject::VERTEX2D:
+				return getVertex2D(dObjectSize, stCommonEntityData, pabySectionContent, nBitOffsetFromStart);
+
             case CADObject::VERTEX3D:
                 return getVertex3D( dObjectSize, stCommonEntityData, pabySectionContent, nBitOffsetFromStart );

@@ -1029,6 +1035,9 @@
             CADPolyline3DObject * cadPolyline3D          = static_cast<CADPolyline3DObject *>(
                     readedObject.get());

+			polyline->setClosed(cadPolyline3D->bClosed);
+			polyline->setSplined(cadPolyline3D->bSplined);
+
             // TODO: code can be much simplified if CADHandle will be used.
             // to do so, == and ++ operators should be implemented.
             unique_ptr<CADVertex3DObject> vertex;
@@ -1042,7 +1051,8 @@
                     break;

                 currentVertexH = vertex->stCed.hObjectHandle.getAsLong();
-                polyline->addVertex( vertex->vertPosition );
+				if (! (vertex->vFlags & 2 || vertex->vFlags & 16)) // ignore tangent / spline frame pts
+					polyline->addVertex( vertex->vertPosition );
                 if( vertex->stCed.bNoLinks == true )
                 {
                     ++currentVertexH;
@@ -1056,7 +1066,8 @@
                 {
                     vertex.reset( static_cast<CADVertex3DObject *>(
                                           GetObject( currentVertexH )) );
-                    polyline->addVertex( vertex->vertPosition );
+					if (!( vertex->vFlags & 2 || vertex->vFlags & 16 )) // ignore tangent / spline frame pts
+						polyline->addVertex( vertex->vertPosition );
                     break;
                 }
             }
@@ -1071,18 +1082,83 @@
             CADLWPolylineObject * cadlwPolyline = static_cast<CADLWPolylineObject *>(
                     readedObject.get());

-            lwPolyline->setBulges( cadlwPolyline->adfBulges );
-            lwPolyline->setClosed( cadlwPolyline->bClosed );
-            lwPolyline->setConstWidth( cadlwPolyline->dfConstWidth );
-            lwPolyline->setElevation( cadlwPolyline->dfElevation );
+			lwPolyline->setBulges(cadlwPolyline->adfBulges);
+            lwPolyline->setClosed(cadlwPolyline->bClosed );
+            lwPolyline->setConstWidth(cadlwPolyline->dfConstWidth );
+            lwPolyline->setElevation(cadlwPolyline->dfElevation );
             for( const CADVector& vertex : cadlwPolyline->avertVertexes )
-                lwPolyline->addVertex( vertex );
-            lwPolyline->setVectExtrusion( cadlwPolyline->vectExtrusion );
+                lwPolyline->addVertex(vertex );
+            lwPolyline->setVectExtrusion(cadlwPolyline->vectExtrusion );
             lwPolyline->setWidths( cadlwPolyline->astWidths );

             poGeometry = lwPolyline;
             break;
         }
+
+		case CADObject::POLYLINE2D:
+		{
+			CADPolyline2D       * polyline2D = new CADPolyline2D();
+			CADPolyline2DObject * cadPolyline2D = static_cast<CADPolyline2DObject *>(
+                    readedObject.get());
+
+			polyline2D->setClosed(cadPolyline2D->bClosed);
+			polyline2D->setSplined(cadPolyline2D->bSplined);
+			polyline2D->setStartSegWidth(cadPolyline2D->dfStartWidth);
+			polyline2D->setEndSegWidth(cadPolyline2D->dfEndWidth);
+			polyline2D->setElevation(cadPolyline2D->dfElevation);
+			polyline2D->setVectExtrusion(cadPolyline2D->vectExtrusion);
+
+			std::vector<double> bulges;
+			vector<pair<double, double> > widths;
+
+			// TODO: code can be much simplified if CADHandle will be used.
+			// to do so, == and ++ operators should be implemented.
+			unique_ptr<CADVertex2DObject> vertex;
+			long                          currentVertexH = cadPolyline2D->hVertexes[0].getAsLong();
+			while (currentVertexH != 0)
+			{
+				vertex.reset(static_cast<CADVertex2DObject *>(
+					GetObject(currentVertexH)));
+
+				if (vertex == nullptr)
+					break;
+
+				currentVertexH = vertex->stCed.hObjectHandle.getAsLong();
+				if ( !( vertex->vFlags & 2 || vertex->vFlags & 16 )) // ignore tangent / spline frame pts
+				{
+					polyline2D->addVertex( CADVector( vertex->vertPosition ));
+					bulges.push_back( vertex->dfBulge);
+					widths.push_back( make_pair(vertex->dfStartWidth, vertex->dfEndWidth ));
+				}
+				if (vertex->stCed.bNoLinks == true)
+				{
+					++currentVertexH;
+				}
+				else
+				{
+					currentVertexH = vertex->stChed.hNextEntity.getAsLong(vertex->stCed.hObjectHandle);
+				}
+
+				// Last vertex is reached. read it and break reading.
+				if (currentVertexH == cadPolyline2D->hVertexes[1].getAsLong())
+				{
+					vertex.reset(static_cast<CADVertex2DObject *>(
+						GetObject(currentVertexH)));
+					if (!( vertex->vFlags & 2 || vertex->vFlags & 16 )) // ignore tangent / spline frame pts
+					{
+						polyline2D->addVertex( CADVector( vertex->vertPosition ));
+						widths.push_back( make_pair( vertex->dfStartWidth, vertex->dfEndWidth ));
+					}
+					break;
+				}
+			}
+
+			polyline2D->setBulges(bulges);
+			polyline2D->setWidths(widths);
+
+			poGeometry = polyline2D;
+            break;
+		}

         case CADObject::CIRCLE:
         {
@@ -1746,8 +1822,17 @@
     polyline->setSize( dObjectSize );
     polyline->stCed = stCommonEntityData;

-    polyline->SplinedFlags = ReadCHAR( pabyInput, nBitOffsetFromStart );
-    polyline->ClosedFlags  = ReadCHAR( pabyInput, nBitOffsetFromStart );
+	polyline->SplinedFlags = ReadCHAR(pabyInput, nBitOffsetFromStart);
+	if ( polyline->SplinedFlags & 0x1 || polyline->SplinedFlags & 0x2 ) // quadratic or cubic spline fit
+		polyline->bSplined = true;
+	else
+		polyline->bSplined = false;
+
+	polyline->ClosedFlags = ReadCHAR( pabyInput, nBitOffsetFromStart );
+	if ( polyline->ClosedFlags & 0x1 )
+		polyline->bClosed = true;
+	else
+		polyline->bClosed = false;

     fillCommonEntityHandleData( polyline, pabyInput, nBitOffsetFromStart );

@@ -1949,6 +2034,46 @@
     return text;
 }

+CADVertex2DObject * DWGFileR2000::getVertex2D( long dObjectSize, CADCommonED stCommonEntityData, const char * pabyInput,
+	size_t& nBitOffsetFromStart )
+{
+	CADVertex2DObject * vertex = new CADVertex2DObject();
+
+	vertex->setSize( dObjectSize );
+	vertex->stCed = stCommonEntityData;
+
+	vertex->vFlags = ReadCHAR( pabyInput, nBitOffsetFromStart );
+
+	CADVector vertPosition = ReadVector( pabyInput, nBitOffsetFromStart );
+	vertex->vertPosition = vertPosition; // z must be taken from polyline elevation
+
+	vertex->dfStartWidth = ReadBITDOUBLE( pabyInput, nBitOffsetFromStart );
+	if (vertex->dfStartWidth < 0) // if negative, abs start value is applicable for both start and end
+	{
+		vertex->dfStartWidth = fabs( vertex->dfStartWidth );
+		vertex->dfEndWidth = fabs(vertex->dfStartWidth);
+	}
+	else
+		vertex->dfEndWidth = ReadBITDOUBLE(pabyInput, nBitOffsetFromStart);
+
+	vertex->dfBulge = ReadBITDOUBLE(pabyInput, nBitOffsetFromStart);
+
+	vertex->dfTangentDir = ReadBITDOUBLE(pabyInput, nBitOffsetFromStart);
+
+
+	fillCommonEntityHandleData(vertex, pabyInput, nBitOffsetFromStart);
+
+	nBitOffsetFromStart += 8 - (nBitOffsetFromStart % 8); // padding bits to next byte boundary
+	vertex->setCRC(ReadRAWSHORT(pabyInput, nBitOffsetFromStart));
+
+#ifdef _DEBUG
+	if ((nBitOffsetFromStart / 8) != (dObjectSize + 4))
+		DebugMsg("Assertion failed at %d in %s\nSize difference: %d\n", __LINE__, __FILE__,
+		(nBitOffsetFromStart / 8 - dObjectSize - 4));
+#endif // _DEBUG
+	return vertex;
+}
+
 CADVertex3DObject * DWGFileR2000::getVertex3D( long dObjectSize, CADCommonED stCommonEntityData, const char * pabyInput,
                                                size_t& nBitOffsetFromStart )
 {
@@ -1957,7 +2082,7 @@
     vertex->setSize( dObjectSize );
     vertex->stCed = stCommonEntityData;

-    /*unsigned char Flags = */ReadCHAR( pabyInput, nBitOffsetFromStart );
+	vertex->vFlags = ReadCHAR(pabyInput, nBitOffsetFromStart);

     CADVector vertPosition = ReadVector( pabyInput, nBitOffsetFromStart );;
     vertex->vertPosition = vertPosition;
@@ -2042,6 +2167,17 @@

     polyline->dFlags                = ReadBITSHORT( pabyInput, nBitOffsetFromStart );
     polyline->dCurveNSmoothSurfType = ReadBITSHORT( pabyInput, nBitOffsetFromStart );
+
+	if ( polyline->dFlags & 0x1 )
+		polyline->bClosed = true;
+	else
+		polyline->bClosed = false;
+
+	if (polyline->dFlags & 0x4 ) // spline fit
+		polyline->bSplined = true;
+	else
+		polyline->bSplined = false;
+

     polyline->dfStartWidth = ReadBITDOUBLE( pabyInput, nBitOffsetFromStart );
     polyline->dfEndWidth   = ReadBITDOUBLE( pabyInput, nBitOffsetFromStart );
@@ -2583,11 +2719,11 @@

     short dFlags = ReadBITSHORT( pabyInput, nBitOffsetFromStart );
     layer->bFrozen           = dFlags & 0x01;
-    layer->bOn               = dFlags & 0x02;
+    layer->bOn               = !(dFlags & 0x02); // bit seems to indicate off, rather than on (as in ODA spec)
     layer->bFrozenInNewVPORT = dFlags & 0x04;
     layer->bLocked           = dFlags & 0x08;
     layer->bPlottingFlag     = dFlags & 0x10;
-    layer->dLineWeight       = dFlags & 0x03E0;
+    layer->dLineWeight       = dFlags & 0x03E0; //
     layer->dCMColor          = ReadBITSHORT( pabyInput, nBitOffsetFromStart );
     layer->hLayerControl     = ReadHANDLE( pabyInput, nBitOffsetFromStart );
     for( long i = 0; i < layer->nNumReactors; ++i )


fixes #743. Instead of PI, multiplied by 2 and called it TWO_PI

--- src/stan/prob/distributions/univariate/continuous/von_mises.hpp
+++ src/stan/prob/distributions/univariate/continuous/von_mises.hpp
@@ -160,9 +160,9 @@

       double U3 = uniform_rng(0.0, 1.0, rng) - 0.5;
       double sign = ((U3 >= 0) - (U3 <= 0));
-      double PI = stan::math::pi();
+      const double TWO_PI = 2 * stan::math::pi();

-      return sign * std::acos(W) + fmod(fmod(mu,2*PI)+2*PI,2*PI);
+      return sign * std::acos(W) + fmod(fmod(mu,TWO_PI)+TWO_PI,TWO_PI);
     }

   }


Removed performance tracing as it cused a divide by zero for Carl.

--- src/Editor.cxx
+++ src/Editor.cxx
@@ -1587,9 +1587,9 @@
 		surfaceWindow->SetClip(rcTextArea);

 		// Loop on visible lines
-		double durLayout = 0.0;
-		double durPaint = 0.0;
-		double durCopy = 0.0;
+		//double durLayout = 0.0;
+		//double durPaint = 0.0;
+		//double durCopy = 0.0;
 		int lineDocPrevious = -1;	// Used to avoid laying out one document line multiple times
 		LineLayout ll;
 		while (visibleLine < cs.LinesDisplayed() && yposScreen < rcArea.bottom) {
@@ -1603,12 +1603,12 @@

 			// Copy this line and its styles from the document into local arrays
 			// and determine the x position at which each character starts.
-			ElapsedTime et;
+			//ElapsedTime et;
 			if (lineDoc != lineDocPrevious) {
 				LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
 				lineDocPrevious = lineDoc;
 			}
-			durLayout += et.Duration(true);
+			//durLayout += et.Duration(true);

 			ll.selStart = SelectionStart(lineDoc);
 			ll.selEnd = SelectionEnd(lineDoc);
@@ -1645,7 +1645,7 @@

 			// Draw the line
 			DrawLine(surface, vs, lineDoc, visibleLine, xStart, rcLine, ll, subLine);
-			durPaint += et.Duration(true);
+			//durPaint += et.Duration(true);

 			bool expanded = cs.GetExpanded(lineDoc);
 			if ( (expanded && (foldFlags & 2)) || (!expanded && (foldFlags & 4)) ) {
@@ -1708,7 +1708,7 @@
 						      rcClient.right, yposScreen + vs.lineHeight);
 				surfaceWindow->Copy(rcCopyArea, from, *pixmapLine);
 			}
-			durCopy += et.Duration(true);
+			//durCopy += et.Duration(true);

 			if (!bufferedDraw) {
 				ypos += vs.lineHeight;
@@ -1718,7 +1718,7 @@
 			visibleLine++;
 			//gdk_flush();
 		}
-		Platform::DebugPrintf("Layout:%9.6g    Paint:%9.6g    Ratio:%9.6g   Copy:%9.6g\n", durLayout, durPaint, durLayout / durPaint, durCopy);
+		//Platform::DebugPrintf("Layout:%9.6g    Paint:%9.6g    Ratio:%9.6g   Copy:%9.6g\n", durLayout, durPaint, durLayout / durPaint, durCopy);

 		// Right column limit indicator
 		PRectangle rcBeyondEOF = rcClient;


BUG: Gray/WhiteMatterLabels were hardcoded at 2/3

--- Examples/KellyKapowski.cxx
+++ Examples/KellyKapowski.cxx
@@ -149,8 +149,8 @@
       ThresholderType;
     typename ThresholderType::Pointer thresholder = ThresholderType::New();
     thresholder->SetInput( segmentationImage );
-    thresholder->SetLowerThreshold( 2 );
-    thresholder->SetUpperThreshold( 2 );
+    thresholder->SetLowerThreshold( direct->GetGrayMatterLabel() );
+    thresholder->SetUpperThreshold( direct->GetGrayMatterLabel() );
     thresholder->SetInsideValue( 1 );
     thresholder->SetOutsideValue( 0 );

@@ -193,8 +193,8 @@
       ThresholderType;
     typename ThresholderType::Pointer thresholder = ThresholderType::New();
     thresholder->SetInput( segmentationImage );
-    thresholder->SetLowerThreshold( 3 );
-    thresholder->SetUpperThreshold( 3 );
+    thresholder->SetLowerThreshold( direct->GetWhiteMatterLabel() );
+    thresholder->SetUpperThreshold( direct->GetWhiteMatterLabel() );
     thresholder->SetInsideValue( 1 );
     thresholder->SetOutsideValue( 0 );


fixed NULL conversion warning

fixed NULL conversion warning

--- test/test_column_float.cpp
+++ test/test_column_float.cpp
@@ -319,7 +319,7 @@
     t.remove_column(1);
     t.add_empty_row();
     t.add_column(type_Mixed, "doesn't work");
-    CHECK_EQUAL(NULL, t.get_mixed(1,0));
+    CHECK_EQUAL(0, t.get_mixed(1,0));
 }


Fix for issue https://github.com/craigsapp/humlib/issues/39

--- src/tool-musicxml2hum.cpp
+++ src/tool-musicxml2hum.cpp
@@ -3439,10 +3439,6 @@
 							}
 							grandchild = grandchild.next_sibling();
 						}
-
-						transpositions[pindex].push_back(child);
-						hastransposition = true;
-						foundnongrace = true;
 					}

 					if (nodeType(child, "time")) {


* Android: Renenable RTSS workaround

* Android: Renenable RTSS workaround

--- Components/RTShaderSystem/src/OgreShaderGLSLESProgramWriter.cpp
+++ Components/RTShaderSystem/src/OgreShaderGLSLESProgramWriter.cpp
@@ -311,6 +311,15 @@

                 // The function name must always main.
                 os << "void main() {" << std::endl;
+
+				if (gpuType == GPT_FRAGMENT_PROGRAM)
+				{
+					os << "\tvec4 outputColor;" << std::endl;
+				}
+				else if (gpuType == GPT_VERTEX_PROGRAM)
+				{
+					os << "\tvec4 outputPosition;" << std::endl;
+				}

                 // Write local parameters.
                 const ShaderParameterList& localParams = curFunction->getLocalParameters();
@@ -514,7 +523,16 @@
                     localOs << std::endl;
                     os << localOs.str();
                 }
-
+
+				if (gpuType == GPT_FRAGMENT_PROGRAM)
+				{
+					os << "\tgl_FragColor = outputColor;" << std::endl;
+				}
+				else if (gpuType == GPT_VERTEX_PROGRAM)
+				{
+					os << "\tgl_Position = outputPosition;" << std::endl;
+				}
+
                 os << "}" << std::endl;
             }
             os << std::endl;
@@ -614,7 +632,7 @@
                     // GLSL vertex program has to write always gl_Position
                     if(pParam->getContent() == Parameter::SPC_POSITION_PROJECTIVE_SPACE)
                     {
-                        mInputToGLStatesMap[pParam->getName()] = "gl_Position";
+                        mInputToGLStatesMap[pParam->getName()] = "outputPosition";
                     }
                     else
                     {
@@ -633,7 +651,7 @@
                         pParam->getSemantic() == Parameter::SPS_COLOR)
                 {
                     // GLSL ES fragment program has to always write gl_FragColor
-                    mInputToGLStatesMap[pParam->getName()] = "gl_FragColor";
+                    mInputToGLStatesMap[pParam->getName()] = "outputColor";
                 }
             }
         }


Iterate over columns instead of rows

Iterate over columns instead of rows

--- test/test_index_string.cpp
+++ test/test_index_string.cpp
@@ -93,7 +93,7 @@
     table->add_column(type_Float, "float");
     table->add_column(type_Binary, "binary");

-    for (size_t i = 0; i < table->size(); i++) {
+    for (size_t i = 0; i < table->get_column_count(); i++) {
         CHECK_LOGIC_ERROR(table->add_search_index(i), LogicError::illegal_combination);
     }
 }


csg_resample added derivative option

csg_resample added derivative option

--- src/tools/csg_resample.cc
+++ src/tools/csg_resample.cc
@@ -47,7 +47,7 @@
 {
     string in_file, out_file, grid, spfit;
     CubicSpline spline;
-    Table in, out;
+    Table in, out, der;

     // program options
     po::options_description desc("Allowed options");
@@ -55,6 +55,7 @@
     desc.add_options()
       ("in", po::value<string>(&in_file), "table to read")
       ("out", po::value<string>(&out_file), "table to write")
+      ("derivative", po::value<string>(), "table to write")
       ("grid", po::value<string>(&grid), "new grid spacing (min:step:max)")
       ("spfit", po::value<string>(&spfit), "specify spline fit grid. if option is not specified, normal spline interpolation is performed")
       //("bc", po::)
@@ -139,6 +140,12 @@

     out.Save(out_file);

+    if (vm.count("derivative")) {
+        der.GenerateGridSpacing(min, max, step);
+        der.flags() = ub::scalar_vector<double>(der.flags().size(), 'o');
+        spline.CalculateDerivative(der.x(), der.y());
+        der.Save(vm["derivative"].as<string>());
+    }
     return 0;
 }


minor cleanup in prep for V2 support.

minor cleanup in prep for V2 support.

git-svn-id: 7e36d3665aeca4d4e1f6df8911a80efc6ef565e7@171 1f79f812-37fb-46fe-a122-30589dd2bf55

--- pwsafe/pwsafe/DboxMain.cpp
+++ pwsafe/pwsafe/DboxMain.cpp
@@ -538,8 +538,7 @@
    {
       POSITION itemPos = Find(getSelectedItem());

-      CMyString curPassString;
-      m_core.GetEntryAt(itemPos).GetPassword(curPassString);
+      CMyString curPassString = m_core.GetEntryAt(itemPos).GetPassword();

       uGlobalMemSize = curPassString.GetLength()+1;
       hGlobalMemory = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE, uGlobalMemSize);
@@ -831,9 +830,9 @@

   while (listPos != NULL)
   {
-      m_core.GetEntryAt(listPos).GetName(curname);
+      curname = m_core.GetEntryAt(listPos).GetName();
       savecurname = curname; // keep original for finding in m_listctrl
-      m_core.GetEntryAt(listPos).GetNotes(curnotes);
+      curnotes = m_core.GetEntryAt(listPos).GetNotes();

       if (!CaseSensitive) {
           curname.MakeLower();
@@ -1136,7 +1135,7 @@
    POSITION itemPos = Find(getSelectedItem());

    CMyString title, junk, username;
-   m_core.GetEntryAt(itemPos).GetName(title);
+   title = m_core.GetEntryAt(itemPos).GetName();
    m_core.SplitName(title, junk, username);

    if (username.GetLength() == 0)


again corrected compilation errors

again corrected compilation errors

--- src/tools/csg_reupdate.cc
+++ src/tools/csg_reupdate.cc
@@ -411,29 +411,6 @@
          PotentialInfo *i = new PotentialInfo(worker->_potentials.size(),
                                               false,
                                               worker->_nlamda, *iter);
-        // generate the bead lists
-        BeadList beads1, beads2;
-
-        beads1.Generate(*top, (*iter)->get("type1").value());
-        beads2.Generate(*top, (*iter)->get("type2").value());
-
-        /*
-        if (beads1.size() == 0)
-            throw std::runtime_error("Topology does not have beads of type \""
-                + (*iter)->get("type1").value() + "\"\n"
-                "This was specified in type1 of interaction \"" + name + "\"");
-        if (beads2.size() == 0)
-            throw std::runtime_error("Topology does not have beads of type \""
-                + (*iter)->get("type2").value() + "\"\n"
-                "This was specified in type2 of interaction \"" + name + "\"");
-        // calculate normalization factor for rdf
-         */
-
-        if ((*iter)->get("type1").value() == (*iter)->get("type2").value())
-            i->rdf_norm = (beads1.size()*(beads2.size()) / 2.) /
-            top->BoxVolume();
-        else
-            i->rdf_norm = (beads1.size() * beads2.size()) / top->BoxVolume();

         // update parameter counter
         worker->_nlamda += i->ucg->getOptParamSize();


xen: linearize packet before transmitting

Since we haven't negotiated the scatter/gather capability yet, and we
don't support the scatter protocol, linearize the packet before sending it.

--- net/xenfront.cc
+++ net/xenfront.cc
@@ -99,6 +99,10 @@
     // use a pre-determined page for data.
     //
     // In-kernel should be fine
+
+    // FIXME: negotiate and use scatter/gather
+    _p.linearize();
+
     return _tx_ring.free_idx().then([this, p = std::move(_p), frag] (uint32_t idx)  {

         auto req_prod = _tx_ring._sring->req_prod;


Create an implicit vkUnmapMemory() in vkFreeMemory() (Refs #179)

* It's legal to free memory while still mapped and this should be
  handled, so here we clean up any mapped state that's present when
  destroying a memory resource record.

--- renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp
+++ renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp
@@ -288,6 +288,18 @@

 	VkDeviceMemory unwrappedMem = wrapped->real.As<VkDeviceMemory>();

+	// there is an implicit unmap on free, so make sure to tidy up
+	if(wrapped->record->memMapState && wrapped->record->memMapState->refData)
+		Serialiser::FreeAlignedBuffer(wrapped->record->memMapState->refData);
+
+	{
+		SCOPED_LOCK(m_CoherentMapsLock);
+
+		auto it = std::find(m_CoherentMaps.begin(), m_CoherentMaps.end(), wrapped->record);
+		if(it != m_CoherentMaps.end())
+			m_CoherentMaps.erase(it);
+	}
+
 	GetResourceManager()->ReleaseWrappedResource(memory);

 	ObjDisp(device)->FreeMemory(Unwrap(device), unwrappedMem, pAllocator);


fix website reporting

fix website reporting

--- dbeacon.cpp
+++ dbeacon.cpp
@@ -552,7 +552,7 @@
 		insert_event(DUMP_BIG_BW_EVENT, 600000);
 	}

-	send_report(REPORT_EVENT);
+	send_report(WEBSITE_REPORT_EVENT);

 	signal(SIGUSR1, dumpBigBwStats);

@@ -1194,6 +1194,13 @@
 	if (!write_tlv_string(buff, maxlen, ptr, T_ADMIN_CONTACT, adminContact.c_str()))
 		return -1;

+	if (type == WEBSITE_REPORT_EVENT) {
+		for (WebSites::const_iterator j = webSites.begin(); j != webSites.end(); j++)
+			if (!write_tlv_string(buff, maxlen, ptr, j->first, j->second.c_str()))
+				return -1;
+		return ptr;
+	}
+
 	uint64_t now = get_timestamp();

 	for (Sources::const_iterator i = sources.begin(); i != sources.end(); i++) {
@@ -1212,9 +1219,6 @@
 			int namelen = i->second.name.size();
 			int contactlen = i->second.adminContact.size();
 			len += 2 + namelen + 2 + contactlen;
-		} else if (type == WEBSITE_REPORT_EVENT) {
-			for (WebSites::const_iterator j = webSites.begin(); j != webSites.end(); j++)
-				len += 2 + j->second.size();
 		} else {
 			len += (i->second.ASM.s.valid ? 22 : 0) + (i->second.SSM.s.valid ? 22 : 0);
 		}
@@ -1241,9 +1245,6 @@
 		if (type == MAP_REPORT_EVENT) {
 			write_tlv_string(buff, maxlen, ptr, T_BEAC_NAME, i->second.name.c_str());
 			write_tlv_string(buff, maxlen, ptr, T_ADMIN_CONTACT, i->second.adminContact.c_str());
-		} else if (type == WEBSITE_REPORT_EVENT) {
-			for (WebSites::const_iterator j = webSites.begin(); j != webSites.end(); j++)
-				write_tlv_string(buff, maxlen, ptr, j->first, j->second.c_str());
 		} else {
 			uint32_t age = (now - i->second.creation) / 1000;


code review fixed comment

code review fixed comment

--- src/FileIO.cpp
+++ src/FileIO.cpp
@@ -88,7 +88,7 @@
   /**
     * Reads content of binary  file
     * @param pathToFile to read
-    * @return Result<std::vector<uint8_t>> all the content of the file, and/or an error string
+    * @return Result<std::vector<char>> all the content of the file, and/or an error string
     *         if something went wrong
     */
    Result<std::vector<char>> ReadBinaryFileContent(const std::string& pathToFile) {


Filter

Filter

- The 'ambiguity' control for Eval was being set *after* the expression was
  parsed, which was useless and misleading.

--- src/Filter.cpp
+++ src/Filter.cpp
@@ -83,6 +83,7 @@
   if (filterExpr.length ())
   {
     Eval eval;
+    eval.ambiguity (false);
     eval.addSource (namedDates);
     eval.addSource (domSource);

@@ -90,7 +91,6 @@
     // it is mostly noise.
     eval.debug (context.config.getBoolean ("debug"));
     eval.compileExpression (filterExpr);
-    eval.ambiguity (false);
     eval.debug (false);

     std::vector <Task>::const_iterator task;
@@ -136,6 +136,7 @@
     _startCount = (int) pending.size ();

     Eval eval;
+    eval.ambiguity (false);
     eval.addSource (namedDates);
     eval.addSource (domSource);

@@ -143,7 +144,6 @@
     // it is mostly noise.
     eval.debug (context.config.getBoolean ("debug"));
     eval.compileExpression (filterExpr);
-    eval.ambiguity (false);
     eval.debug (false);

     output.clear ();


Trans Mangling - Emit symbols longer than 128 bytes as hashes (to allow building larger crates on MSVC)

--- src/trans/mangling_v2.cpp
+++ src/trans/mangling_v2.cpp
@@ -281,12 +281,36 @@
 {
     return FMT_CB(os, os << "ZRG"; Mangler(os).fmt_generic_path(p));
 }
-::FmtLambda Trans_MangleType(const ::HIR::TypeRef& p)
+::FmtLambda Trans_MangleTypeRef(const ::HIR::TypeRef& p)
 {
     return FMT_CB(os, os << "ZRT"; Mangler(os).fmt_type(p));
 }

-::FmtLambda Trans_Mangle(const ::HIR::SimplePath& path) { return Trans_MangleSimplePath(path); }
-::FmtLambda Trans_Mangle(const ::HIR::GenericPath& path) { return Trans_MangleGenericPath(path); }
-::FmtLambda Trans_Mangle(const ::HIR::Path& path) { return Trans_ManglePath(path); }
-::FmtLambda Trans_Mangle(const ::HIR::TypeRef& ty) { return Trans_MangleType(ty); }
+namespace {
+    ::FmtLambda max_len(::FmtLambda v) {
+        std::stringstream   ss;
+        ss << v;
+        auto s = ss.str();
+        static const size_t MAX_LEN = 128;
+        if( s.size() > 128 ) {
+            size_t hash = ::std::hash<std::string>()(s);
+            ss.str("");
+            ss << s.substr(0, MAX_LEN-9) << "$" << ::std::hex << hash;
+            DEBUG("Over-long symbol '" << s << "' -> '" << ss.str() << "'");
+            s = ss.str();
+        }
+        else {
+        }
+        return ::FmtLambda([=](::std::ostream& os){
+            os << s;
+            });
+    }
+}
+// TODO: If the mangled name exceeds a limit, stop emitting the real name and start hashing the rest.
+#define DO_MANGLE(ty) ::FmtLambda Trans_Mangle(const ::HIR::ty& v) { \
+    return max_len(Trans_Mangle##ty(v)); \
+}
+DO_MANGLE(SimplePath)
+DO_MANGLE(GenericPath)
+DO_MANGLE(Path)
+DO_MANGLE(TypeRef)


Reorganized one sentence for dependecny docs (Fastbuild - polish)

--- _engine/code/include/_doxygen/2_depedencies_polish.hpp
+++ _engine/code/include/_doxygen/2_depedencies_polish.hpp
@@ -220,8 +220,7 @@
 * FastBuild nie zmienia architektury operacji kompilowania i nie wpływa na proces konsolidacji. Z tego powodu jest on transparentny dla ewentualnych
 * problemów lub pluskiew, które mogą się pojawić w kodzie produkcyjnym i które mogłyby pozostać niezauważone do wykonania pełnego cyklu kompilacji.
 *
-* @note FastBuild pozwala także na rozłożenie kompilacji na więcej niż jedną fizyczną maszynę, ale na potrzeby niniejszej pracy taka funkcjonalność
-* przekraczałaby jej zasięg.
+* @note FastBuild pozwala także na rozłożenie kompilacji na więcej niż jedną fizyczną maszynę, ale taka funkcjonalność przekraczałaby zasięg niniejszej pracy.
 *
 * @todo Dokończyć sekcję zależności
 *


Added even more depenendcies into Polish docs

--- _engine/code/include/_doxygen/2_depedencies_polish.hpp
+++ _engine/code/include/_doxygen/2_depedencies_polish.hpp
@@ -252,6 +252,87 @@
 * się w detalach implementacyjnych!). GLEW (OpenGL Extension Wrangler Library), to zestaw nagłówków i bibliotek które uproszczają proces sprawdzania i uruchamiania
 * opisanych rozszerzeń.
 *
+* @section dependency_googlemock Google Mock
+* Google Mock to zaawansowana biblioteka do tworzenia makiet (ang. mockups) kodu na potrzeby testowania modułów. Makiety, to niewielkie "wydmuszkowe" klasy
+* które nie posiadają faktycznej implementacji, a są zdolne do odnotowania aktu wywołania dowolnej z własnych metod, lub dostępu do akcesorów.
+*
+* Przykładem zastosowania Google Mock może być następująca sytuacja: rozważmy moduł ustawień. Akt zapamiętania ustawienia powinien wywołać funkcję zapisu
+* magazynu ustawień. Możemy wywołać metodę zapamiętania ustawień na faktycznej implementacji menadżera ustawień przy jednoczesnym wstrzyknięciu makiety magazynu.
+* Oczywiście makieta powinna odnotować prośbę o zapis - brak takiej prośby powinien być zgłoszony jako błąd.
+*
+* Więcej informacji na temat sposobów testowania znajduje się w rozdziale @ref tests "testy"
+*
+* @section dependency_googletest Google Test
+* Google Test to rozbudowane narzędzie Google do tworzenia testów jednostkowych. O ile Google Test i opisany powyżej Google Mock zaczęły jako osobne projekty, obecnie
+* są wykorzystywane niemal zawsze wspólnie. Google Test pozwala na tworzenie przypadków testowych, ewaluowania środowiska testowego i sprawdzanie warunków korzystając
+* z bogatej biblioteki asercji. Testy wykonywane są jeden po drugim na wyczyszczonym środowisku testowym, co pozwala na ewaluacje i późniejszą agregację danych z wielu
+* przebiegów testowych
+*
+* Więcej informacji na temat sposobów testowania znajduje się w rozdziale @ref tests "testy"
+*
+* @section dependency_gtest_runner Google Test runner
+* Google Test runner to niewielkie narzędzie wbrew nazwie *nie* tworzone przez Google ani powiązane podmioty; Narzędzie to pozwala na uruchamianie testów
+* stworzonych za pomocą Google Test i generowanie na podstawie przebiegów raportów w formacie XML. Pixie Engine wykorzystuje jedynie wariant z linii komend, ale oczywiście
+* nic nie uniemożliwia uruchomienia tego narzędzia ręcznie w trybie graficznym.
+*
+* Więcej informacji na temat sposobów testowania znajduje się w rozdziale @ref tests "testy"
+*
+* @section dependency_html_help_workshop HTML Help Workshop
+* HTML Help Workshop to bezpłatne narzędzie Microsoftu zdolne przygotować skompilowany plik pomocy (chm) z zadanych źródeł przygotowanych w formie
+* strony internetowej (html). HTML Help Workshop jest wykorzystywany w Pixie Engine jedynie jako narzędzie z wiersza polecenia przez @ref dependency_doxygen "doxygena"
+* na potrzeby generowania dokumentacji na platformie Windows.
+*
+* W Pixie Engine jest włączona jedynie binarna dystrybucja HTML Help Workshop.
+*
+* @section dependency_levenshtein Kalkulator odległości Levenshteina
+* Odległość Levenshteina między dwoma ciągami danych to minimalna ilość operacji jednostkowych (dodania, zmiany, bądź usunięcia) na dowolnym ciągu
+* potrzebnych by oba ciągi stały się identyczne.
+*
+* Przykład, dla danych ciągów:
+*  - abcb
+*  - ccb
+*
+* Odległość Levenshteina wynosi 2 (wystarczy usunąć literkę 'a' z przodu pierwszego i zamienić kolejną 'b' na 'c').
+*
+* Kalkulator odległości Levenshteina to prosta biblioteka o otwartych źródłach która oblicza wartość odległości dla dowolnych ciągów o porównywalnych elementach.
+*
+* @section dependency_jdk JDK 1.8
+* Java Development Kit (JDK) to pełne SDK i platforma uruchomieniowa Javy, współczesnego języka zarządzanego. W projekcie jest używana wyłącznie wersja
+* prekompilowana w formie binarnej przenośnej - jest to zależność niezbędna do działania @ref dependency_apacheant "Apache Ant" i poza nim nie jest wykorzystywana.
+*
+* @section dependency_llvm LLVM
+* Kompilator języka C++ to jeden z najbardziej skomplikowanych programów jaki można współcześnie napisać. Na rynku, do niedawna, istniały tylko trzy
+* produkcyjne implementacje: GCC, MSVC i Intel C++ Compiler, spośród których tylko GCC był darmowy i posiadał otwarte źródła. Jedną z najbardziej problematycznych
+* cech GCC był styl jego wewnętrznej implementacji. Kompilator był tworzony bez żadnego planu i posiadał bardzo chaotycznie rozrzucony kod źródłowy, pełen
+* haków i skrótów utrudniających modyfikacje.
+*
+* W 2000 roku na uniwersytecie Illinois założono nowy projekt LLVM (początkowo skrót rozwijał się do Low-Level Virtual Machine); Celem było sprawdzenie
+* metod optymalizacji kodu pośredniego przed etapem asemblacji. Wkrótce okazało się że ze względu na "czystą" implementację projekt posiada znacznie szerszą
+* gamę zastosowań. Pięć lat później powstała fasada CLang, kompilująca C++ do postaci pośredniej na potrzeby LLVM. W ten sposób oba projekty stworzyły podwalny
+* środowiska pod nową rodzinę kompilatorów. Obecnie LLVM to ponad 20 projektów (wliczając preprocesor, kompilator, konsolidator, linker, odpluskwiacz, assembler,
+* analizator, etc.) i jest produkcyjnie gotowy do kompilowania projektów na wszystkich wspieranych przez Pixie Engine platformach. Zastosowanie jednego kompilatora
+* znacząco upraszcza fazę odpluskwiania i testowania (nie ma np. problemów z miskompilacją generowaną przez różne narzędzia).
+*
+* Jako ciekawostkę można zauważyć że od 2017 linker LLVM jest w stanie wygenerować symbole odpluskwiacza systemu Window (.pdb), tym samym można wykorzystać wszystkie
+* istniejące narzędzia odpluskwiania / testowania które nie są zgodne z symbolami stosowanymi w GCC. To pozwoliło m.in. na zastosowanie
+* @ref dependency_open_cpp_coverage "Open C++ Coverage" oraz zrzucania informacji o kodzie w przypadku niezłapanego wyjątku.
+*
+* @section dependency_mathjax mathjax
+* mathjax (uwaga - nazwa pisana jest z małej litery) to zaawansowany parser wyrażeń matematycznych w przeglądarce. W Pixie Engine jest wykorzystywany jako narzędzie
+* pomocnicze do generowania wzorów matematycznych w niniejszej dokumentacji. Tylko binarna wersja jest dołączona.
+*
+* @section dependency_vlc libVLC
+* VLC to wieloplatformowe środowisko odtwarzacza multimediów, zdolne do wyświetlania filmów w różnych formatach, konwersji i rekompresji strumieni.
+* Jedną z najważniejszych cech VLC jest brak założeń co do systemu w którym odtwarzacz jest uruchamiany - podstawa kodowa zawiera wszystkie realnie liczące się
+* kompresory i dekompresory (tzw. kodeki), filtry oraz zasoby generujące strumienie wyjściowe.
+*
+* libVLC to biblioteka C++ na bazie której odtwarzacz VLC jest skonstruowany. Pixie Engine wykorzystuje libVLC do odtwarzania filmów bezpośrednio w grze
+* (np. logo producenta, przerywniki filmowe). libVLC wspiera zarówno wyświetlanie filmu bezpośrednio na ekranie jak i strumieniowanie do tekstury (DirectX i OpenGL).
+* libVLC pozwala też na zrzucanie filmu bezpośrednio z ekranu (przechwytywanie wideo) i tworzenie zrzutów ekranów.
+*
+* @section dependency_minizip miniZip
+*
+*
 * @todo Dokończyć sekcję zależności
 *
 */


INTEGRATION: CWS i18napi (1.26.8); FILE MERGED 2003/04/19 19:41:06 er 1.26.8.1: #107686# drafts.com.sun.star.i18n to com.sun.star.i18n

--- i18npool/source/registerservices/registerservices.cxx
+++ i18npool/source/registerservices/registerservices.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: registerservices.cxx,v $
  *
- *  $Revision: 1.28 $
- *
- *  last change: $Author: hr $ $Date: 2003-04-22 16:07:57 $
+ *  $Revision: 1.29 $
+ *
+ *  last change: $Author: vg $ $Date: 2003-04-24 11:34:39 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -350,8 +350,6 @@
 IMPL_CREATEINSTANCE( NumToTextHangulCircledSyllable_ko )
 IMPL_CREATEINSTANCE( NumToTextTianGan_zh )
 IMPL_CREATEINSTANCE( NumToTextDiZi_zh )
-
-IMPL_CREATEINSTANCE_MSF( TextSearch )

 static const struct InstancesArray {
         const sal_Char* pServiceNm;
@@ -698,10 +696,6 @@
     IMPL_TRANSLITERATION_ITEM (NumToTextTianGan_zh),
     IMPL_TRANSLITERATION_ITEM (NumToTextDiZi_zh),

-    {   "com.sun.star.util.TextSearch",
-        "com.sun.star.util.TextSearch",
-        &TextSearch_CreateInstance },
-
 // add here new services !!
     { 0, 0, 0 }
 };


requestAutocomplete dialog wasn't filling out shipping name

BUG=

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

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

--- components/autofill/browser/autocheckout_manager.cc
+++ components/autofill/browser/autocheckout_manager.cc
@@ -46,8 +46,6 @@
 // AutofillDialogController to show the Autocheckout specific UI.
 FormData BuildAutocheckoutFormData() {
   FormData formdata;
-  formdata.fields.push_back(BuildField("name"));
-  formdata.fields.push_back(BuildField("tel"));
   formdata.fields.push_back(BuildField("email"));
   formdata.fields.push_back(BuildField("cc-name"));
   formdata.fields.push_back(BuildField("cc-number"));
@@ -59,11 +57,14 @@
   formdata.fields.push_back(BuildField("billing region"));
   formdata.fields.push_back(BuildField("billing country"));
   formdata.fields.push_back(BuildField("billing postal-code"));
+  formdata.fields.push_back(BuildField("billing tel"));
+  formdata.fields.push_back(BuildField("shipping name"));
   formdata.fields.push_back(BuildField("shipping street-address"));
   formdata.fields.push_back(BuildField("shipping locality"));
   formdata.fields.push_back(BuildField("shipping region"));
   formdata.fields.push_back(BuildField("shipping country"));
   formdata.fields.push_back(BuildField("shipping postal-code"));
+  formdata.fields.push_back(BuildField("shipping tel"));
   return formdata;
 }


Evaling the media-feature expressions in a media query.

--- eval_apply.cpp
+++ eval_apply.cpp
@@ -126,8 +126,26 @@
       } break;

       case Node::media_query: {
+        expand(expr[0], prefix, env, f_env, new_Node, ctx, bt, false, content);
         expand(expr[1], prefix, env, f_env, new_Node, ctx, bt, false, content);
         expr << prefix;
+      } break;
+
+      case Node::media_expression_group: {
+        for (size_t i = 0, S = expr.size(); i < S; ++i) {
+          expand(expr[i], prefix, env, f_env, new_Node, ctx, bt, false, content);
+        }
+      } break;
+
+      case Node::media_expression: {
+        for (size_t i = 0, S = expr.size(); i < S; ++i) {
+          if (expr[i].type() == Node::rule) {
+            expand(expr[i], prefix, env, f_env, new_Node, ctx, bt, false, content);
+          }
+          else {
+            expr[i] = eval(expr[i], prefix, env, f_env, new_Node, ctx, bt);
+          }
+        }
       } break;

       case Node::keyframes: {


ENH: ResetMargin app support vector images

--- Modules/Applications/AppImageUtils/app/otbResetMargin.cxx
+++ Modules/Applications/AppImageUtils/app/otbResetMargin.cxx
@@ -141,8 +141,8 @@

   void DoExecute() override
   {
-    FloatImageType* input = GetParameterFloatImage("in");
-    FloatImageType::RegionType region;
+    FloatVectorImageType* input = GetParameterFloatVectorImage("in");
+    FloatVectorImageType::RegionType region;
     switch (GetParameterInt("mode"))
       {
       case 0: // roi
@@ -154,8 +154,8 @@
       case 1: // threshold
         {
         region = input->GetLargestPossibleRegion();
-        FloatImageType::IndexType idx = region.GetIndex();
-        FloatImageType::SizeType sz = region.GetSize();
+        FloatVectorImageType::IndexType idx = region.GetIndex();
+        FloatVectorImageType::SizeType sz = region.GetSize();
         int thrX = GetParameterInt("threshold.x");
         int thrYtop = GetParameterInt("threshold.y.start");
         int thrYbot = GetParameterInt("threshold.y.end");
@@ -172,7 +172,7 @@
         }
       }

-    auto filter = ResetMarginFilter<FloatImageType>::New();
+    auto filter = ResetMarginFilter<FloatVectorImageType>::New();
     filter->SetROI(region);
     filter->SetInput(input);
     filter->SetPaddingValue(GetParameterFloat("val"));


Remove the PDF uncertainty from the limit.

--- ExtrapLimitFinder/main.cxx
+++ ExtrapLimitFinder/main.cxx
@@ -197,7 +197,6 @@
 	result.limit_settings.systematic_errors["lumi"] = 0.021; // Final lumi is 2.1%

 	// Constant MC errors.
-	result.limit_settings.systematic_errors["mc_PDF"] = 0.02;
 	result.limit_settings.systematic_errors["mc_ISRFSR"] = 0.02;

 	// Constant ABCD errors