Fixing typos in JointVelocityController

Fixing typos in JointVelocityController

--- effort_controllers/src/joint_velocity_controller.cpp
+++ effort_controllers/src/joint_velocity_controller.cpp
@@ -109,7 +109,7 @@
 void JointVelocityController::update(const ros::Time& time, const ros::Duration& period)
 {
   double error = joint_.getVelocity() - command_;
-  double command = pid_controller_.updatePid(error, perido);
+  double command = pid_controller_.updatePid(error, period);
   joint_.setCommand(command);

   if(loop_count_ % 10 == 0)
@@ -120,7 +120,7 @@
       controller_state_publisher_->msg_.set_point = command_;
       controller_state_publisher_->msg_.process_value = joint_.getVelocity();
       controller_state_publisher_->msg_.error = error;
-      controller_state_publisher_->msg_.time_step = perido.toSec();
+      controller_state_publisher_->msg_.time_step = period.toSec();
       controller_state_publisher_->msg_.command = command;

       double dummy;


Remove useless comment

Remove useless comment

--- src/libzillians-framework-language/language/stage/generator/LLVMDebugInfoGeneratorStage.cpp
+++ src/libzillians-framework-language/language/stage/generator/LLVMDebugInfoGeneratorStage.cpp
@@ -53,7 +53,6 @@
 	if (!enabled)
 		return true;

-	// create visitor to walk through the entire tree and generate instructions accordingly
 	visitor::LLVMDebugInfoGeneratorVisitor visitor(*getGeneratorContext().context, *getGeneratorContext().modules[0]);

 	if(getParserContext().program)


Refactor DCPLoopbackStreamTest for use with additional tests

Move test-specific code out of setupProducer and into that tests' own
setup. Move common code (converting Dcp message types) into common
helper function.

Change-Id: I7c4c12ee06d03aca36e3a1cee17c47df4f70c961
Reviewed-on: http://review.couchbase.org/111907
Reviewed-by: James Harrison <5c25a7b3db09830813688775bfc8e6de736a230c@couchbase.com>
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

--- engines/ep/tests/module_tests/dcp_reflection_test.cc
+++ engines/ep/tests/module_tests/dcp_reflection_test.cc
@@ -20,6 +20,7 @@
  */

 #include <memcached/protocol_binary.h>
+#include <platform/dirutils.h>
 #include <programs/engine_testapp/mock_server.h>
 #include <tests/mock/mock_checkpoint_manager.h>
 #include <tests/mock/mock_dcp_consumer.h>
@@ -40,6 +41,22 @@
 protected:
     void SetUp() override {
         SingleThreadedKVBucketTest::SetUp();
+
+        // Paranoia - remove any previous replica disk files.
+        try {
+            cb::io::rmrf(std::string(test_dbname) + "-replica");
+        } catch (std::system_error& e) {
+            if (e.code() != std::error_code(ENOENT, std::system_category())) {
+                throw e;
+            }
+        }
+
+        ASSERT_EQ(ENGINE_SUCCESS,
+                  engine->getKVBucket()->setVBucketState(
+                          vbid,
+                          vbucket_state_active,
+                          {{"topology",
+                            nlohmann::json::array({{"active", "replica"}})}}));
     }

     ENGINE_ERROR_CODE getInternalHelper(const DocKey& key) {
@@ -51,38 +68,15 @@
                 .getStatus();
     }

-    void setupProducer(EnableExpiryOutput enableExpiryOutput,
-                       uint32_t exp_time = 0) {
-        // Setup the source (active) Bucket.
-        EXPECT_EQ(ENGINE_SUCCESS,
-                  engine->getKVBucket()->setVBucketState(vbid,
-                                                         vbucket_state_active));
-
-        // Add some items to the source Bucket.
-        auto key1 = makeStoredDocKey("key1");
-        auto key2 = makeStoredDocKey("key2");
-        auto key3 = makeStoredDocKey("key3");
-        store_item(vbid, key1, "value", exp_time);
-        store_item(vbid, key2, "value", exp_time);
-        store_item(vbid, key3, "value", exp_time);
-
+    void setupProducer(EnableExpiryOutput enableExpiryOutput) {
         // Create the Dcp producer.
         producer = SingleThreadedKVBucketTest::createDcpProducer(
                 cookie,
                 IncludeDeleteTime::No);
         producer->scheduleCheckpointProcessorTask();
-
-        // Setup conditions for expirations
-        auto expectedGetOutcome = ENGINE_SUCCESS;
         if (enableExpiryOutput == EnableExpiryOutput::Yes) {
             producer->setDCPExpiry(true);
-            expectedGetOutcome = ENGINE_KEY_ENOENT;
-        }
-        TimeTraveller t(1080);
-        // Trigger expiries on a get, or just check that the key exists
-        EXPECT_EQ(expectedGetOutcome, getInternalHelper(key1));
-        EXPECT_EQ(expectedGetOutcome, getInternalHelper(key2));
-        EXPECT_EQ(expectedGetOutcome, getInternalHelper(key3));
+        }

         auto& sourceVb = *engine->getVBucket(vbid);
         producer->mockActiveStreamRequest(consumerStream->getFlags(),
@@ -96,12 +90,12 @@
         producerStream = dynamic_cast<MockActiveStream*>(
                 producer->findStream(vbid).get());

-        ASSERT_EQ(2, static_cast<MockCheckpointManager*>(
-                sourceVb.checkpointManager.get())
-                ->getNumOfCursors())
+        ASSERT_EQ(2,
+                  static_cast<MockCheckpointManager*>(
+                          sourceVb.checkpointManager.get())
+                          ->getNumOfCursors())
                 << "Should have both persistence and DCP producer cursor on "
-                   "source "
-                   "VB";
+                   "source VB";

         // Creating a producer will schedule one
         // ActiveStreamCheckpointProcessorTask
@@ -174,6 +168,17 @@
                        "nextCheckpointItemTask()";
             return getNextProducerMsg(stream);
         }
+
+        // Cannot pass mutation/deletion directly to the consumer as the object
+        // is different
+        if (producerMsg->getEvent() == DcpResponse::Event::Mutation ||
+            producerMsg->getEvent() == DcpResponse::Event::Deletion ||
+            producerMsg->getEvent() == DcpResponse::Event::Expiration ||
+            producerMsg->getEvent() == DcpResponse::Event::Prepare) {
+            producerMsg = std::make_unique<MutationConsumerMessage>(
+                    *static_cast<MutationResponse*>(producerMsg.get()));
+        }
+
         return producerMsg;
     }

@@ -230,13 +235,33 @@
         exp_time = time(NULL) + 256;
     }

+    // Add some items to the source Bucket.
+    std::vector<StoredDocKey> keys;
+    keys.push_back(makeStoredDocKey("key1"));
+    keys.push_back(makeStoredDocKey("key2"));
+    keys.push_back(makeStoredDocKey("key3"));
+    for (const auto& key : keys) {
+        store_item(vbid, key, "value", exp_time);
+    }
+
+    // Setup conditions for expirations
+    auto expectedGetOutcome = ENGINE_SUCCESS;
+    if (enableExpiryOutput == EnableExpiryOutput::Yes) {
+        expectedGetOutcome = ENGINE_KEY_ENOENT;
+    }
+    TimeTraveller t(1080);
+    // Trigger expiries on a get, or just check that the key exists
+    for (const auto& key : keys) {
+        EXPECT_EQ(expectedGetOutcome, getInternalHelper(key));
+    }
+
     // Note: the order matters.
     //     First, we setup the Consumer with the given flags and we discard the
     //     StreamRequest message from the Consumer::readyQ.
     //     Then, we simulate the Producer receiving the StreamRequest just
     //     by creating the Producer with the Consumer's flags
     setupConsumer(DCP_ADD_STREAM_FLAG_TAKEOVER);
-    setupProducer(enableExpiryOutput, exp_time);
+    setupProducer(enableExpiryOutput);

     // Both streams created. Check state is as expected.
     ASSERT_TRUE(producerStream->isTakeoverSend())
@@ -246,15 +271,6 @@
     while (true) {
         auto producerMsg = getNextProducerMsg(producerStream);
         ASSERT_TRUE(producerMsg);
-
-        // Cannot pass mutation/deletion directly to the consumer as the object
-        // is different
-        if (producerMsg->getEvent() == DcpResponse::Event::Mutation ||
-            producerMsg->getEvent() == DcpResponse::Event::Deletion ||
-            producerMsg->getEvent() == DcpResponse::Event::Expiration) {
-            producerMsg = std::make_unique<MutationConsumerMessage>(
-                    *static_cast<MutationResponse*>(producerMsg.get()));
-        }

         // Pass the message onto the consumer.
         EXPECT_EQ(ENGINE_SUCCESS,


test2 for the widget.cpp file

test2 for the widget.cpp file

--- plugins/multimedia/symbian/mmf/mediaplayer/s60videowidget.cpp
+++ plugins/multimedia/symbian/mmf/mediaplayer/s60videowidget.cpp
@@ -38,7 +38,7 @@
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
-
+// ravi b
 #include "s60videowidget.h"
 #ifdef USE_PRIVATE_QWIDGET_METHODS
 #include <QtGui/private/qwidget_p.h>


ERR: cygwin needs stdio.h.

ERR: cygwin needs stdio.h.

--- Common/Testing/Cxx/otherTimerLog.cxx
+++ Common/Testing/Cxx/otherTimerLog.cxx
@@ -12,6 +12,7 @@
 // .SECTION Description
 // this program tests the TimerLog

+#include <stdio.h>
 #include "vtkTimerLog.h"
 #include "vtkDebugLeaks.h"


Added missing Double, vectorized tests.

Added missing Double, vectorized tests.

--- src/test/agrad/distributions/univariate/continuous/inv_gamma_cdf_test.hpp
+++ src/test/agrad/distributions/univariate/continuous/inv_gamma_cdf_test.hpp
@@ -1,4 +1,4 @@
-// Arguments: Double, Double
+// Arguments: Doubles, Doubles, Doubles
 #include <stan/prob/distributions/univariate/continuous/inv_gamma.hpp>

 using std::vector;
@@ -15,7 +15,7 @@
     param[1] = 0.5;           // alpha (Shape)
     param[2] = 3.3;           // beta (Scale)
     parameters.push_back(param);
-    cdf.push_back(0.138011);  // expected CDF
+    cdf.push_back(0.138010737);  // expected CDF

   }


Added error message in catch(...).

Added error message in catch(...).

git-svn-id: b36ee6b6e70810a25e81bc801db00a83677983fc@339566 13f79535-47bb-0310-9956-ffa450edef68

--- Tests/Threads/ThreadTest.cpp
+++ Tests/Threads/ThreadTest.cpp
@@ -254,6 +254,7 @@
 	}
 	catch(...)
 	{
+		cerr << "Exception caught in thread " << theInfo->m_threadNumber;
 	}

 	// Decrement the counter because we're done...


add one new file

add one new file

--- binary-tree/serialize_and_deserialize_binary_tree.cpp
+++ binary-tree/serialize_and_deserialize_binary_tree.cpp
@@ -32,7 +32,7 @@

 class Codec {
 public:
-
+
     // Encodes a tree to a single string.
     string serialize(TreeNode* root) {
         string result = "[";


TTClipper extension: fix for description property on the HighBound attribute actually setting the description for the LowBound, discovered during prep for LSU talk.

--- DSP/extensions/Clipper/TTClipper.cpp
+++ DSP/extensions/Clipper/TTClipper.cpp
@@ -42,8 +42,8 @@
 	addAttribute(		LowBound,	kTypeFloat64);
 	addMessageProperty(	LowBound,	description,	TT("Sets the minimum amplitude."));

-	addAttribute(HighBound,	kTypeFloat64);
-	addMessageProperty(LowBound,	description,	TT("Sets the maximum amplitude."));
+	addAttribute(		HighBound,	kTypeFloat64);
+	addMessageProperty(	HighBound,	description,	TT("Sets the maximum amplitude."));

 	setAttributeValue(TT("lowBound"), -1.0);
 	setAttributeValue(TT("highBound"), 1.0);


also update mutex group in actuators update

--- app/controller/Control.cpp
+++ app/controller/Control.cpp
@@ -163,6 +163,7 @@
     for ( auto &actuator : actuators ) {
         actuator->update();
     }
+    mutex->update();
 }

 void Control::serialize(JSON::Adapter& adapter){


Liisa's bug fix for Seniscam

Liisa's bug fix for Seniscam

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@11 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- DeviceAdapters/Sensicam/Sensicam.cpp
+++ DeviceAdapters/Sensicam/Sensicam.cpp
@@ -167,6 +167,12 @@
             pProp->Set("Long exposure OEM");
          break;

+/* Liisa */
+case 8:
+pProp->Set("Long exposure OEM");
+break;
+/* end Liisa */
+
          default:
             return ERR_UNKNOWN_CAMERA_TYPE;
          break;
@@ -383,6 +389,16 @@
          //10ms exposure time
          snprintf(m_pszTimes, m_nTimesLen, "0,%.0f,-1,-1", m_dExposure);
       break;
+
+/* Liisa */
+case 8:
+m_nMode = M_LONG;
+m_nSubMode = NORMALLONG;
+m_nTrig = 0;
+//10ms exposure time
+snprintf(m_pszTimes, m_nTimesLen, "0,%.0f,-1,-1", m_dExposure);
+break;
+/* end Liisa */

       default:
          // invalid type


TIScam: Prevent VC++ x64 warning.

TIScam: Prevent VC++ x64 warning.

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@10951 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- DeviceAdapters/TISCam/DynDialogs.cpp
+++ DeviceAdapters/TISCam/DynDialogs.cpp
@@ -140,7 +140,7 @@
     ret = DialogBoxIndirectParamA(NULL, (LPDLGTEMPLATE)hgbl, hwnd,
                                  (DLGPROC)InputBoxDlgProc, (int)data);
     GlobalFree(hgbl);
-    return (ret > 0) ? ret : 0;
+    return static_cast<int>((ret > 0) ? ret : 0);
 }
 //---------------------------------------------------------------------------


fixed multi_normal tests ONLY ONE FUNCTION SIGNATURE; fixes OTHER half of #299

--- src/test/prob/distributions/multivariate/continuous/multi_normal_test.cpp
+++ src/test/prob/distributions/multivariate/continuous/multi_normal_test.cpp
@@ -1,7 +1,8 @@
 #include <gtest/gtest.h>
 #include "stan/prob/distributions/multivariate/continuous/multi_normal.hpp"
 #include <boost/random/mersenne_twister.hpp>
-#include<boost/math/distributions.hpp>
+#include <boost/math/distributions.hpp>
+#include <stan/agrad/agrad.hpp>

 using Eigen::Dynamic;
 using Eigen::Matrix;
@@ -19,6 +20,196 @@
   Matrix<double,Dynamic,Dynamic> L = Sigma.llt().matrixL();
   EXPECT_FLOAT_EQ(-11.73908, stan::prob::multi_normal_cholesky_log(y,mu,L));
 }
+TEST(ProbDistributionsMultiNormal,MultiNormalVar) {
+  using stan::agrad::var;
+  Matrix<var,Dynamic,1> y(3,1);
+  y << 2.0, -2.0, 11.0;
+  Matrix<var,Dynamic,1> mu(3,1);
+  mu << 1.0, -1.0, 3.0;
+  Matrix<var,Dynamic,Dynamic> Sigma(3,3);
+  Sigma << 9.0, -3.0, 0.0,
+    -3.0,  4.0, 0.0,
+    0.0, 0.0, 5.0;
+  EXPECT_FLOAT_EQ(-11.73908, stan::prob::multi_normal_log(y,mu,Sigma).val());
+  Matrix<var,Dynamic,Dynamic> L = Sigma.llt().matrixL();
+  EXPECT_FLOAT_EQ(-11.73908, stan::prob::multi_normal_cholesky_log(y,mu,L).val());
+}
+TEST(ProbDistributionsMultiNormal,MultiNormalGradientUnivariate) {
+  using stan::agrad::var;
+  using std::vector;
+  using Eigen::VectorXd;
+  using stan::prob::multi_normal_log;
+
+  Matrix<var,Dynamic,1> y_var(1,1);
+  y_var << 2.0;
+
+  Matrix<var,Dynamic,1> mu_var(1,1);
+  mu_var << 1.0;
+
+  Matrix<var,Dynamic,Dynamic> Sigma_var(1,1);
+  Sigma_var(0,0) = 9.0;
+
+  std::vector<var> x;
+  x.push_back(y_var(0));
+  x.push_back(mu_var(0));
+  x.push_back(Sigma_var(0,0));
+
+  var lp = stan::prob::multi_normal_log(y_var,mu_var,Sigma_var);
+  vector<double> grad;
+  lp.grad(x,grad);
+
+  // ===================================
+
+
+  Matrix<double,Dynamic,1> y(1,1);
+  y << 2.0;
+
+  Matrix<double,Dynamic,1> mu(1,1);
+  mu << 1.0;
+
+  Matrix<double,Dynamic,Dynamic> Sigma(1,1);
+  Sigma << 9.0;
+
+  double epsilon = 1e-6;
+
+
+  Matrix<double,Dynamic,1> y_m(1,1);
+  Matrix<double,Dynamic,1> y_p(1,1);
+  y_p[0] = y[0] + epsilon;
+  y_m[0] = y[0] - epsilon;
+  double grad_diff
+    =  (multi_normal_log(y_p,mu,Sigma) - multi_normal_log(y_m,mu,Sigma))
+    / (2 * epsilon);
+  EXPECT_FLOAT_EQ(grad_diff, grad[0]);
+
+  Matrix<double,Dynamic,1> mu_m(1,1);
+  Matrix<double,Dynamic,1> mu_p(1,1);
+  mu_p[0] = mu[0] + epsilon;
+  mu_m[0] = mu[0] - epsilon;
+  grad_diff
+    =  (multi_normal_log(y,mu_p,Sigma) - multi_normal_log(y,mu_m,Sigma))
+    / (2 * epsilon);
+  EXPECT_FLOAT_EQ(grad_diff, grad[1]);
+
+  Matrix<double,Dynamic,Dynamic> Sigma_m(1,1);
+  Matrix<double,Dynamic,Dynamic> Sigma_p(1,1);
+  Sigma_p(0) = Sigma(0) + epsilon;
+  Sigma_m(0) = Sigma(0) - epsilon;
+  grad_diff
+    =  (multi_normal_log(y,mu,Sigma_p) - multi_normal_log(y,mu,Sigma_m))
+    / (2 * epsilon);
+  EXPECT_FLOAT_EQ(grad_diff, grad[2]);
+}
+
+TEST(ProbDistributionsMultiNormal,MultiNormalGradient) {
+  using stan::agrad::var;
+  using std::vector;
+  using Eigen::VectorXd;
+  using stan::prob::multi_normal_log;
+
+  Matrix<var,Dynamic,1> y_var(3,1);
+  y_var << 2.0, -2.0, 11.0;
+
+  Matrix<var,Dynamic,1> mu_var(3,1);
+  mu_var << 1.0, -1.0, 3.0;
+
+  Matrix<var,Dynamic,Dynamic> Sigma_var(3,3);
+  Sigma_var(0,0) = 9.0;
+  Sigma_var(1,1) = 4.0;
+  Sigma_var(2,2) = 5.0;
+  Sigma_var(0,1) = -3;
+  Sigma_var(0,2) = 0;
+  Sigma_var(1,2) = 0;
+
+  Sigma_var(1,0) =  Sigma_var(0,1);
+  Sigma_var(2,0) =  Sigma_var(0,2);
+  Sigma_var(2,1) =  Sigma_var(1,2);
+
+  std::vector<var> x;
+  for (size_t i = 0; i < y_var.size(); ++i)
+    x.push_back(y_var(i));
+  for (size_t i = 0; i < mu_var.size(); ++i)
+    x.push_back(mu_var(i));
+  for (size_t i = 0; i < Sigma_var.rows(); ++i)
+    for (size_t j = 0; j < Sigma_var.cols(); ++j)
+      x.push_back(Sigma_var(i,j));
+
+  var lp = stan::prob::multi_normal_log(y_var,mu_var,Sigma_var);
+  vector<double> grad;
+  lp.grad(x,grad);
+
+  // --------------------------------------------
+
+  Matrix<double,Dynamic,1> y(3,1);
+  y << 2.0, -2.0, 11.0;
+
+  Matrix<double,Dynamic,1> mu(3,1);
+  mu << 1.0, -1.0, 3.0;
+
+  Matrix<double,Dynamic,Dynamic> Sigma(3,3);
+  Sigma << 9.0, -3.0, 0.0,
+    -3.0,  4.0, 0.0,
+    0.0, 0.0, 5.0;
+
+  double epsilon = 1e-6;
+
+  int pos = 0;
+
+  Matrix<double,Dynamic,1> y_m(3,1);
+  Matrix<double,Dynamic,1> y_p(3,1);
+  for (int i = 0; i < 3; ++i) {
+    y_p[i] = y[i];
+    y_m[i] = y[i];
+  }
+  for (int i = 0; i < 3; ++i) {
+    y_p[i] = y[i] + epsilon;
+    y_m[i] = y[i] - epsilon;
+    double grad_diff
+      =  (multi_normal_log(y_p,mu,Sigma) - multi_normal_log(y_m,mu,Sigma))
+         / (2 * epsilon);
+    EXPECT_FLOAT_EQ(grad_diff, grad[pos++]);
+    y_p[i] = y[i];
+    y_m[i] = y[i];
+  }
+
+  Matrix<double,Dynamic,1> mu_m(3,1);
+  Matrix<double,Dynamic,1> mu_p(3,1);
+  for (int i = 0; i < 3; ++i) {
+    mu_p[i] = mu[i];
+    mu_m[i] = mu[i];
+  }
+  for (int i = 0; i < 3; ++i) {
+    mu_p[i] = mu[i] + epsilon;
+    mu_m[i] = mu[i] - epsilon;
+    double grad_diff
+      =  (multi_normal_log(y,mu_p,Sigma) - multi_normal_log(y,mu_m,Sigma))
+         / (2 * epsilon);
+    EXPECT_FLOAT_EQ(grad_diff, grad[pos++]);
+    mu_p[i] = mu[i];
+    mu_m[i] = mu[i];
+  }
+
+  Matrix<double,Dynamic,Dynamic> Sigma_m(3,3);
+  Matrix<double,Dynamic,Dynamic> Sigma_p(3,3);
+  for (int i = 0; i < 9; ++i) {
+    Sigma_p(i) = Sigma(i);
+    Sigma_m(i) = Sigma(i);
+  }
+  for (int i = 0; i < 3; ++i) {
+    for (int j = 0; j < 3; ++j) {
+      Sigma_p(j,i) = Sigma_p(i,j) = Sigma(i,j) + epsilon;
+      Sigma_m(j,i) = Sigma_m(i,j) = Sigma(i,j) - epsilon;
+      double grad_diff
+        =  (multi_normal_log(y,mu,Sigma_p) - multi_normal_log(y,mu,Sigma_m))
+        / (2 * epsilon);
+      EXPECT_FLOAT_EQ(grad_diff, grad[pos++]);
+      Sigma_p(j,i) = Sigma_p(i,j) = Sigma(i,j);
+      Sigma_m(j,i) = Sigma_m(i,j) = Sigma(i,j);
+    }
+  }
+
+}
+
 TEST(ProbDistributionsMultiNormal,Sigma) {
   Matrix<double,Dynamic,1> y(2,1);
   y << 2.0, -2.0;


Delay passing the persistent_state till after making the expression could invalidate it.

In the SwiftExpressionParser, we set the persistent_state associated with the currently
active scratch AST context into a couple of delegate objects that we will use at the
end of the expression evaluation.  But in the course of making an expression parser in the context
of a new module, some conflicting imports could invalidate the scratch AST context, leaving
the persistent_state pointers as dangling pointers.

So this patch delays getting and passing the persistent_state to the delegates till after
making the new SwiftExpressionParser, at which point we know the ones we calculate are the
ones we really intend to use.

Before this patch, I was getting a crash in:

lang/swift/clangimporter/objcmain_conflicting_dylibs_bridging_headers

<rdar://problem/42410482>

--- source/Plugins/ExpressionParser/Swift/SwiftUserExpression.cpp
+++ source/Plugins/ExpressionParser/Swift/SwiftUserExpression.cpp
@@ -364,6 +364,86 @@
                                  "couldn't start parsing (no target)");
     return false;
   }
+
+  ScanContext(exe_ctx, err);
+
+  if (!err.Success()) {
+    diagnostic_manager.Printf(eDiagnosticSeverityError, "warning: %s\n",
+                              err.AsCString());
+  }
+
+  StreamString m_transformed_stream;
+
+  ////////////////////////////////////
+  // Generate the expression
+  //
+
+  std::string prefix = m_expr_prefix;
+
+  std::unique_ptr<ExpressionSourceCode> source_code(
+      ExpressionSourceCode::CreateWrapped(prefix.c_str(), m_expr_text.c_str()));
+
+  const lldb::LanguageType lang_type = lldb::eLanguageTypeSwift;
+
+  m_options.SetLanguage(lang_type);
+  uint32_t first_body_line = 0;
+
+  if (!source_code->GetText(m_transformed_text, lang_type, m_language_flags,
+                            m_options, m_swift_generic_info, exe_ctx,
+                            first_body_line)) {
+    diagnostic_manager.PutString(eDiagnosticSeverityError,
+                                  "couldn't construct expression body");
+    return false;
+  }
+
+  if (log)
+    log->Printf("Parsing the following code:\n%s", m_transformed_text.c_str());
+
+  //////////////////////////
+  // Parse the expression
+  //
+
+  if (m_options.GetREPLEnabled())
+    m_materializer_ap.reset(new SwiftREPLMaterializer());
+  else
+    m_materializer_ap.reset(new Materializer());
+
+  class OnExit {
+  public:
+    typedef std::function<void(void)> Callback;
+
+    OnExit(Callback const &callback) : m_callback(callback) {}
+
+    ~OnExit() { m_callback(); }
+
+  private:
+    Callback m_callback;
+  };
+
+  ExecutionContextScope *exe_scope = NULL;
+
+  Process *process = exe_ctx.GetProcessPtr();
+
+  do {
+    exe_scope = exe_ctx.GetFramePtr();
+    if (exe_scope)
+      break;
+
+    exe_scope = process;
+    if (exe_scope)
+      break;
+
+    exe_scope = exe_ctx.GetTargetPtr();
+  } while (0);
+
+  m_parser =
+      llvm::make_unique<SwiftExpressionParser>(exe_scope, *this, m_options);
+
+  // Don't set the persistent state in the result & error delegates till after
+  // you have made the expression parser.  Doing that could invalidate the
+  // Target ScratchASTContext, which would destroy the old persistent state,
+  // leaving the delegates holding onto a dangling pointer.
+
   if (auto *persistent_state = GetPersistentState(target, exe_ctx)) {
     persistent_state->AddHandLoadedModule(ConstString("Swift"));
     m_result_delegate.RegisterPersistentState(persistent_state);
@@ -373,80 +453,6 @@
                                  "couldn't start parsing (no persistent data)");
     return false;
   }
-
-  ScanContext(exe_ctx, err);
-
-  if (!err.Success()) {
-    diagnostic_manager.Printf(eDiagnosticSeverityError, "warning: %s\n",
-                              err.AsCString());
-  }
-
-  StreamString m_transformed_stream;
-
-  ////////////////////////////////////
-  // Generate the expression
-  //
-
-  std::string prefix = m_expr_prefix;
-
-  std::unique_ptr<ExpressionSourceCode> source_code(
-      ExpressionSourceCode::CreateWrapped(prefix.c_str(), m_expr_text.c_str()));
-
-  const lldb::LanguageType lang_type = lldb::eLanguageTypeSwift;
-
-  m_options.SetLanguage(lang_type);
-  uint32_t first_body_line = 0;
-
-  if (!source_code->GetText(m_transformed_text, lang_type, m_language_flags,
-                            m_options, m_swift_generic_info, exe_ctx,
-                            first_body_line)) {
-    diagnostic_manager.PutString(eDiagnosticSeverityError,
-                                  "couldn't construct expression body");
-    return false;
-  }
-
-  if (log)
-    log->Printf("Parsing the following code:\n%s", m_transformed_text.c_str());
-
-  //////////////////////////
-  // Parse the expression
-  //
-
-  if (m_options.GetREPLEnabled())
-    m_materializer_ap.reset(new SwiftREPLMaterializer());
-  else
-    m_materializer_ap.reset(new Materializer());
-
-  class OnExit {
-  public:
-    typedef std::function<void(void)> Callback;
-
-    OnExit(Callback const &callback) : m_callback(callback) {}
-
-    ~OnExit() { m_callback(); }
-
-  private:
-    Callback m_callback;
-  };
-
-  ExecutionContextScope *exe_scope = NULL;
-
-  Process *process = exe_ctx.GetProcessPtr();
-
-  do {
-    exe_scope = exe_ctx.GetFramePtr();
-    if (exe_scope)
-      break;
-
-    exe_scope = process;
-    if (exe_scope)
-      break;
-
-    exe_scope = exe_ctx.GetTargetPtr();
-  } while (0);
-
-  m_parser =
-      llvm::make_unique<SwiftExpressionParser>(exe_scope, *this, m_options);

   unsigned error_code = m_parser->Parse(
       diagnostic_manager, first_body_line,


republishes Octree to ROS from LCM (including transform)

NB: the resolution is currently hard coded

--- catkin_ws/src/drc_translators/src/lcm2ros_exotica.cpp
+++ catkin_ws/src/drc_translators/src/lcm2ros_exotica.cpp
@@ -16,11 +16,14 @@
 #include "lcmtypes/drc/affordance_collection_t.hpp"
 #include "lcmtypes/drc/robot_state_t.hpp"
 #include "lcmtypes/drc/exotica_planner_request_t.hpp"
+#include "lcmtypes/drc/map_octree_t.hpp"
 #include <trajectory_msgs/JointTrajectory.h>
 #include <ipab_msgs/PlannerRequest.h>
+#include <octomap_msgs/OctomapWithPose.h>
+#include <octomap_msgs/Octomap.h>
 #include <std_srvs/Empty.h>
 #include <std_msgs/String.h>
-
+#include <Eigen/Dense>

 class LCM2ROS
 {
@@ -36,11 +39,14 @@

   ros::Publisher planner_request_pub_;
   ros::Publisher ik_request_pub_;
+  ros::Publisher octomap_pub_;

   void plannerRequestHandler(const lcm::ReceiveBuffer* rbuf, const std::string &channel,
                              const drc::exotica_planner_request_t* msg);
   void ikRequestHandler(const lcm::ReceiveBuffer* rbuf, const std::string &channel,
                         const drc::exotica_planner_request_t* msg);
+  void octreeHandler(const lcm::ReceiveBuffer* rbuf, const std::string &channel,
+                        const drc::map_octree_t* msg);
 };

 LCM2ROS::LCM2ROS(boost::shared_ptr<lcm::LCM> &lcm_in, ros::NodeHandle &nh_in) : lcm_(lcm_in), nh_(nh_in)
@@ -50,6 +56,9 @@

   lcm_->subscribe("IK_REQUEST", &LCM2ROS::ikRequestHandler, this);
   ik_request_pub_ = nh_.advertise<ipab_msgs::PlannerRequest>("/exotica/ik_request", 10);
+
+  lcm_->subscribe("MAP_OCTREE", &LCM2ROS::octreeHandler, this);
+  octomap_pub_ = nh_.advertise<octomap_msgs::OctomapWithPose>("/octomap_binary_with_pose", 10);
 }

 void translatePlannerRequest(const drc::exotica_planner_request_t* msg, ipab_msgs::PlannerRequest& m)
@@ -83,6 +92,48 @@
   ik_request_pub_.publish(m);
 }

+void LCM2ROS::octreeHandler(const lcm::ReceiveBuffer* rbuf, const std::string &channel,
+                               const drc::map_octree_t* msg)
+{
+  //ROS_ERROR("LCM2ROS got MAP_OCTREE");
+
+  geometry_msgs::Pose p;
+  //Eigen::Affine3f msgTransform;
+  Eigen::Projective3f msgTransform;
+  for (int i = 0; i < 4; ++i) {
+    for (int j = 0; j < 4; ++j) {
+      msgTransform(i,j) = msg->transform[i][j];
+    }
+  }
+  Eigen::Vector3f msgTrans(msgTransform.translation());
+  Eigen::Quaternionf msgQuat(msgTransform.rotation());
+  p.position.x = msgTrans.x();
+  p.position.y = msgTrans.y();
+  p.position.z = msgTrans.z();
+  p.orientation.w = msgQuat.w();
+  p.orientation.x = msgQuat.x();
+  p.orientation.y = msgQuat.y();
+  p.orientation.z = msgQuat.z();
+
+  octomap_msgs::Octomap m;
+  m.header.stamp = ros::Time().fromSec(msg->utime * 1E-6);
+
+  // hard coded because the incoming message has no resolution
+  // A better solution might be to also check the view_id if there are
+  // multiple octrees being published
+  m.resolution = 0.01;
+  m.binary = true;
+  m.id = "workspace_octomap";
+  m.data.resize( msg->num_bytes );
+  memcpy(&m.data[0], msg->data.data(), msg->num_bytes );
+
+  octomap_msgs::OctomapWithPose o;
+  o.origin = p;
+  o.octomap = m;
+  o.header = m.header;
+  octomap_pub_.publish(o);
+}
+
 int main(int argc, char** argv)
 {
   ros::init(argc, argv, "lcm2ros", ros::init_options::NoSigintHandler);


Removed old identity_qmr.cpp source file.

Monotone-Parent: a708ba636e4ca0722a7ec872d8b36a77a2bb7b01
Monotone-Revision: f3cb5304586510cbab8a088371dbb83e0af9bfc4

--- itl-tests/identity_qmr.cpp
+++ itl-tests/identity_qmr.cpp
@@ -1,117 +0,0 @@
-//===========================================================================
-//  CVS Information:
-//
-//     $RCSfile: ilu_qmr.cpp,v $  $Revision: 1.3 $  $State: Exp $
-//     $Author: llee $  $Date: 2001/10/18 14:08:33 $
-//     $Locker:  $
-//---------------------------------------------------------------------------
-//
-// DESCRIPTION
-//
-//---------------------------------------------------------------------------
-//
-// LICENSE AGREEMENT
-// Copyright 1997, University of Notre Dame.
-// Authors: Andrew Lumsdaine, Lie-Quan Lee
-//
-// This file is part of the Iterative Template Library
-//
-// You should have received a copy of the License Agreement for the
-// Iterative Template Library along with the software;  see the
-// file LICENSE.  If not, contact Office of Research, University of Notre
-// Dame, Notre Dame, IN  46556.
-//
-// Permission to modify the code and to distribute modified code is
-// granted, provided the text of this NOTICE is retained, a notice that
-// the code was modified is included with the above COPYRIGHT NOTICE and
-// with the COPYRIGHT NOTICE in the LICENSE file, and that the LICENSE
-// file is distributed with the modified code.
-//
-// LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
-// By way of example, but not limitation, Licensor MAKES NO
-// REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY
-// PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS
-// OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS
-// OR OTHER RIGHTS.
-//---------------------------------------------------------------------------
-//
-// REVISION HISTORY:
-//
-// $Log: ilu_qmr.cpp,v $
-// Revision 1.3  2001/10/18 14:08:33  llee
-// re-organize the directory structures
-//
-// Revision 1.2  2000/07/27 04:39:21  llee1
-// *** empty log message ***
-//
-// Revision 1.1  2000/07/26 21:50:09  llee1
-// change file extension from .cc to .cpp
-//
-// Revision 1.1  2000/07/18 16:41:01  llee1
-// add Harwell-Boeing matrix test
-//
-// Revision 1.2  2000/07/17 15:44:04  llee1
-// *** empty log message ***
-//
-// Revision 1.1  1999/11/21 20:47:07  lums
-// *** empty log message ***
-//
-//===========================================================================
-
-#include <desolin/Desolin.hpp>
-#include <itl/interface/mtl.h>
-#include "itl/preconditioner/ilu.h"
-#include "itl/krylov/qmr.h"
-
-/*
-  In thsi example, we show how to use QMR algorithm
-*/
-using namespace itl;
-
-typedef double Type;
-typedef desolin::Scalar<Type> Scalar;
-typedef desolin::Vector<Type> Vector;
-typedef desolin::Matrix<Type> Matrix;
-
-int main(int argc, char* argv[])
-{
-  using std::cout;
-  using std::endl;
-
-  if ( argc == 1 ) {
-    cout << "Usage: " << argv[0]
-	 << " <Unsymmetric matrix in Harwell-Boeing format> "
-	 << endl;
-    return 0;
-  }
-
-  harwell_boeing_stream<Type> hbs(argv[1]);
-
-  int max_iter = 50;
-  //begin
-  Matrix A(hbs);
-  //end
-
-  //begin
-  Vector x(A.nrows(), Type(0));
-  Vector b(A.ncols(), Type(1.));
-
-  //Identity preconditioner
-  identity_preconditioner precond;
-  //iteration
-  noisy_iteration<Scalar> iter(b, max_iter, 1e-6);
-  //qmr algorithm
-  qmr(A, x, b, precond.left(), precond.right(), iter);
-  //end
-
-  //verify the result
-  Vector b1(A.ncols());
-  itl::mult(A, x, b1);
-  itl::add(b1, itl::scaled(b, -1.), b1);
-
-  cout << "Residual " << itl::two_norm(b1) << endl;
-
-  return 0;
-}
-
-


Reverted map_images() to former state that worked.

--- TreeCode_link/map_images.cpp
+++ TreeCode_link/map_images.cpp
@@ -638,10 +638,10 @@
 		  for(j = 0 ; j < imageinfo[i].imagekist->Nunits() ; ++j,MoveDownKist(imageinfo[i].imagekist) ){

 			  if(
-					  //RefinePoint2(getCurrentKist(imageinfo[i].imagekist),grid->i_tree
-					  //	,imageinfo[i].area,total_area,criterion,res_target,nearest)
-					  RefinePoint_sb(getCurrentKist(imageinfo[i].imagekist),grid->i_tree
-					  		,imageinfo[i].area,total_area,source->getSBlimit(),nearest)
+					  RefinePoint2(getCurrentKist(imageinfo[i].imagekist),grid->i_tree
+					  	,imageinfo[i].area,total_area,criterion,res_target,nearest)
+					  //RefinePoint_sb(getCurrentKist(imageinfo[i].imagekist),grid->i_tree
+					  //		,imageinfo[i].area,total_area,source->getSBlimit(),nearest)

 			  ){

@@ -749,10 +749,10 @@
 			  //assert(getCurrentKist(imageinfo[i].outerborder)->surface_brightness == 0);

 			  if(
-					  //RefinePoint2(getCurrentKist(imageinfo[i].outerborder),grid->i_tree
-					  //,imageinfo[i].area,total_area,criterion,res_target,nearest)
-					  RefinePoint_sb(getCurrentKist(imageinfo[i].outerborder),grid->i_tree
-					      ,imageinfo[i].area,total_area,source->getSBlimit(),nearest)
+					  RefinePoint2(getCurrentKist(imageinfo[i].outerborder),grid->i_tree
+					  ,imageinfo[i].area,total_area,criterion,res_target,nearest)
+					  //RefinePoint_sb(getCurrentKist(imageinfo[i].outerborder),grid->i_tree
+					  //    ,imageinfo[i].area,total_area,source->getSBlimit(),nearest)
 			  ){

 				  if(getCurrentKist(imageinfo[i].outerborder)->in_image != MAYBE){


INTEGRATION: CWS sch03 (1.4.2); FILE MERGED 2004/08/17 09:15:47 dr 1.4.2.1: #i32576# new svx controls added in CWS dr14

--- chart2/source/controller/dialogs/tp_TitleRotation.hxx
+++ chart2/source/controller/dialogs/tp_TitleRotation.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: tp_TitleRotation.hxx,v $
  *
- *  $Revision: 1.4 $
+ *  $Revision: 1.5 $
  *
- *  last change: $Author: dr $ $Date: 2004-08-04 14:14:26 $
+ *  last change: $Author: rt $ $Date: 2004-08-20 08:46:55 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -72,10 +72,17 @@
 #ifndef _SFXTABDLG_HXX
 #include <sfx2/tabdlg.hxx>
 #endif
-// header for SvxWinOrientation
-#ifndef SVX_ORIENTHELPER_HXX //autogen
+
+#ifndef SVX_DIALCONTROL_HXX
+#include <svx/dialcontrol.hxx>
+#endif
+#ifndef SVX_WRAPFIELD_HXX
+#include <svx/wrapfield.hxx>
+#endif
+#ifndef SVX_ORIENTHELPER_HXX
 #include <svx/orienthelper.hxx>
 #endif
+
 /*
 // header for class ValueSet
 #ifndef _VALUESET_HXX
@@ -107,9 +114,12 @@

     //Seit 4/1998 koennen Texte frei gedreht werden: SID_ATTR_ALIGN_DEGREES
-#if 0 // DR: TODO new control types
-    svx::OrientationHelper  aWinOrient;
-#endif
+    FixedLine               aFlAlign;
+    svx::DialControl        aCtrlDial;
+    FixedText               aFtRotate;
+    svx::WrapField          aNfRotate;
+    TriStateBox             aCbStacked;
+    svx::OrientationHelper  aOrientHlp;

 //  CheckBox    aCbxTextOverlap;


INTEGRATION: CWS chart11 (1.11.2); FILE MERGED 2007/08/23 12:37:12 bm 1.11.2.2: RESYNC: (1.11-1.12); FILE MERGED 2007/07/31 12:56:46 bm 1.11.2.1: #i80084# avoid usage of map operator[] with enums as keys, simplify initialization of default property values

--- chart2/source/model/template/PieChartTypeTemplate.cxx
+++ chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: PieChartTypeTemplate.cxx,v $
  *
- *  $Revision: 1.12 $
- *
- *  last change: $Author: hr $ $Date: 2007-08-03 12:35:50 $
+ *  $Revision: 1.13 $
+ *
+ *  last change: $Author: vg $ $Date: 2007-09-18 15:06:29 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -126,18 +126,10 @@
 void lcl_AddDefaultsToMap(
     ::chart::tPropertyValueMap & rOutMap )
 {
-    OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_PIE_TEMPLATE_OFFSET_MODE ));
-    rOutMap[ PROP_PIE_TEMPLATE_OFFSET_MODE ] =
-        uno::makeAny( chart2::PieChartOffsetMode_NONE );
-    OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_PIE_TEMPLATE_DEFAULT_OFFSET ));
-    rOutMap[ PROP_PIE_TEMPLATE_DEFAULT_OFFSET ] =
-        uno::makeAny( double( 0.5 ) );
-    OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_PIE_TEMPLATE_DIMENSION ));
-    rOutMap[ PROP_PIE_TEMPLATE_DIMENSION ] =
-        uno::makeAny( sal_Int32( 2 ) );
-    OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_PIE_TEMPLATE_USE_RINGS ));
-    rOutMap[ PROP_PIE_TEMPLATE_USE_RINGS ] =
-        uno::makeAny( sal_False );
+    ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIE_TEMPLATE_OFFSET_MODE, chart2::PieChartOffsetMode_NONE );
+    ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_PIE_TEMPLATE_DEFAULT_OFFSET, 0.5 );
+    ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_PIE_TEMPLATE_DIMENSION, 2 );
+    ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIE_TEMPLATE_USE_RINGS, false );
 }

 const uno::Sequence< Property > & lcl_GetPropertySequence()


fix windows build break.

fix windows build break.

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

git-svn-id: http://src.chromium.org/svn/trunk/src@19385 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 8c7979fac4975f47554a7ebc1ed590ea65d3e249


Fix conditional in PasswordStoreMac initialization

BUG=41332
TEST=Mac version should use keychain to read/store passwords.

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

git-svn-id: http://src.chromium.org/svn/trunk/src@44378 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 04ffdf0961988be5d7943c61ac85c4ec2d8dc07b

--- chrome/browser/password_manager/password_store_mac.cc
+++ chrome/browser/password_manager/password_store_mac.cc
@@ -726,7 +726,7 @@
 bool PasswordStoreMac::Init() {
   thread_.reset(new base::Thread("Chrome_PasswordStore_Thread"));

-  if (thread_->Start()) {
+  if (!thread_->Start()) {
     thread_.reset(NULL);
     return false;
   }


add unit test and performance test for xl::List


Fixed bad logic that was bad

Fixed bad logic that was bad

--- DarkWorld/MyoConnection.cpp
+++ DarkWorld/MyoConnection.cpp
@@ -101,7 +101,7 @@
 			// In this case, we wish to update our display 20 times a second, so we run for 1000/20 milliseconds.
 			hub.run(1000 / 20);

-			if (collector.currentPose != myo::Pose::rest){
+			if (collector.currentPose != myo::Pose::rest && collector.currentPose != myo::Pose::unknown){
 				std::cout << collector.lastActivePose << " - " << collector.currentPose << std::endl << std::endl;
 			}
 		}


ENH:  Making sure the layout strategy object gets set to NULL in the destructor.

--- Views/vtkGraphLayoutView.cxx
+++ Views/vtkGraphLayoutView.cxx
@@ -64,7 +64,7 @@

 #include <ctype.h> // for tolower()

-vtkCxxRevisionMacro(vtkGraphLayoutView, "1.14");
+vtkCxxRevisionMacro(vtkGraphLayoutView, "1.15");
 vtkStandardNewMacro(vtkGraphLayoutView);
 //----------------------------------------------------------------------------
 vtkGraphLayoutView::vtkGraphLayoutView()
@@ -178,7 +178,8 @@
   // Note: All of the smartpointer objects
   //       will be deleted for us

-
+  vtkGraphLayoutStrategy *nothing = 0;
+  this->SetLayoutStrategy(nothing);
   this->SetLayoutStrategyNameInternal(0);
   this->SetSelectionArrayNameInternal(0);
 }


COMP: trying to fix a CDash error

COMP: trying to fix a CDash error

--- Views/vtkGraphLayoutView.cxx
+++ Views/vtkGraphLayoutView.cxx
@@ -74,7 +74,7 @@

 #include <ctype.h> // for tolower()

-vtkCxxRevisionMacro(vtkGraphLayoutView, "1.55");
+vtkCxxRevisionMacro(vtkGraphLayoutView, "1.56");
 vtkStandardNewMacro(vtkGraphLayoutView);
 //----------------------------------------------------------------------------
 vtkGraphLayoutView::vtkGraphLayoutView()
@@ -89,7 +89,8 @@
   this->Fast2DStrategy         = vtkSmartPointer<vtkFast2DLayoutStrategy>::New();
   this->ForceDirectedStrategy  = vtkSmartPointer<vtkForceDirectedLayoutStrategy>::New();
   this->PassThroughStrategy    = vtkSmartPointer<vtkPassThroughLayoutStrategy>::New();
-  this->CircularStrategy       = vtkSmartPointer<vtkCircularLayoutStrategy>::New();
+  this->CircularStrategy       = vtkSmartPointer<vtkCircularLayoutStrategy>::New();
+  this->ConeStrategy           = vtkSmartPointer<vtkConeLayoutStrategy>::New();
   this->EdgeLayout             = vtkSmartPointer<vtkEdgeLayout>::New();
   this->ArcParallelStrategy    = vtkSmartPointer<vtkArcParallelEdgeStrategy>::New();
   this->PassThroughEdgeStrategy = vtkSmartPointer<vtkPassThroughEdgeStrategy>::New();


Added parsing command line arguments logic.

--- VoiceroidController/Main.cpp
+++ VoiceroidController/Main.cpp
@@ -1,6 +1,12 @@
+#include <atlconv.h>
+#include <cstdlib>
+#include <iostream>
 #include <stdio.h>
+#include <tchar.h>
 #include <windows.h>
-#include <tchar.h>
+#include <boost/program_options.hpp>
+
+using namespace boost::program_options;

 #define TARGET_WIN_NAME1 _T("VOICEROID{ 䂩 EX")
 #define TARGET_WIN_NAME2 _T("VOICEROID{ 䂩 EX*")
@@ -47,6 +53,50 @@

 int _tmain(int argc, _TCHAR* argv[])
 {
+	setlocale(LC_CTYPE, "");
+
+	options_description opt("IvV");
+	// R}hC`
+	opt.add_options()
+		("help,h", "wv\")
+		("output-file,o", value<std::string>()->default_value(""), "o̓t@CpX")
+		("input-file,i", value<std::string>()->default_value(""), "̓t@CpX")
+		("sync,s", "[h(ĐEۑ܂őҋ@܂)");
+
+	// R}hC
+	variables_map argmap;
+	auto pr = parse_command_line(argc, argv, opt);
+	store(pr, argmap);
+	notify(argmap);
+
+	// ͌ʎ擾
+	std::string output_file = argmap["output-file"].as<std::string>();
+	std::string input_file = argmap["input-file"].as<std::string>();
+	bool is_sync_mode = !argmap["sync"].empty();
+	std::wstring echo_text = _T("");
+
+	// IvVȊÕR}hC擾
+	for (auto const& str : collect_unrecognized(pr.options, include_positional)) {
+		echo_text.append(_T(" "));
+		echo_text.append(str);
+	}
+
+	// wv\w肪邩A
+	// echo_text, input_file Ƃ̏ꍇAwv\ďI
+	if (argmap.count("help") ||
+		(echo_text.compare(_T("")) == 0
+			&& input_file.compare("") == 0)) {
+		_TCHAR drive[_MAX_DRIVE];
+		_TCHAR dir[_MAX_DIR];
+		_TCHAR filename[_MAX_FNAME];
+		_TCHAR ext[_MAX_EXT];
+		_tsplitpath(argv[0], drive, dir, filename, ext);
+
+		std::wcout << "Usage: " << filename << ext << " [options] [TEXT]" << std::endl;
+		std::cout << opt << std::endl;
+		return 1;
+	}
+
 	// "VOICEROID{ 䂩 EX" T
 	EnumWindows(SearchYukari, 0x0);

@@ -55,7 +105,7 @@
 	// ȂŃeLXgGA...
 	SendMessage(textArea, WM_SETTEXT, (WPARAM)_T(""), NULL);

-	sendText(textArea, _T("}CÑeXgB"));
+	sendText(textArea, W2T((LPWSTR)echo_text.c_str()));

 	// "ۑ{^" Tĉ
 	HWND save_button = SearchSaveButton(yukari);
@@ -69,7 +119,13 @@
 	HWND saveFilePath = SearchSaveFilePath(saveDialog);

 	// t@C
-	sendText(saveFilePath, _T("C:\\Users\\mikoto\\Music\\TEST.wav"));
+	// t@C wstring ɕϊ
+	wchar_t *wcs = new wchar_t[output_file.length() + 1];
+	mbstowcs(wcs, output_file.c_str(), output_file.length() + 1);
+
+    // t@CeLXgGAɑ}
+	sendText(saveFilePath, W2T((LPWSTR)wcs));
+	delete [] wcs;

 	// "ۑ(S)" {^
 	HWND save_button_in_save_dialog = SearchSaveButtonInSaveDialog(saveDialog);


Fix for crash when quitting from system tray icon.  Someone please check this.

svn path=/trunk/kdepim/akregator/; revision=317176

--- akregator/src/akregator.cpp
+++ akregator/src/akregator.cpp
@@ -375,16 +375,19 @@
 {
     if (!m_quit && !kapp->sessionSaving())
     {
+        kdDebug() << "aKregator::closeEvent m_quit is false" << endl;
         KMessageBox::information(this, i18n( "<qt>Closing the main window will keep aKregator running in the system tray. Use 'Quit' from the 'File' menu to quit the application.</qt>" ), i18n( "Docking in System Tray" ), "hideOnCloseInfo");
         hide();
         e->ignore();
     }
     else
     {
+        kdDebug() << "aKregator::closeEvent m_quit is true" << endl;
         if (m_part->queryClose())
             KMainWindow::closeEvent(e);
     }
-    m_quit = false;
+    // Commenting this out fixes crash when quitting from system tray icon.  Why was it here? ..cramblitt
+    // m_quit = false;
 }

 #include "akregator.moc"


use NTA_ASSERT

use NTA_ASSERT

so the check can be turned off for speed by compiler flag,
the checks are only for confinient description, code will not fail
even if empty

--- algorithms/SparsePooler.cpp
+++ algorithms/SparsePooler.cpp
@@ -90,20 +90,20 @@
   void SparsePoolerInputMasks::compute_cache_()
   {
     { // Pre-conditions
-      NTA_CHECK(segment_size_ > 0)
+      NTA_ASSERT(segment_size_ > 0)
 	<< "SparsePoolerInputMasks: Invalid segment size: " << segment_size_
 	<< " - Should be > 0";

-      NTA_CHECK(masks_.size() > 0)
+      NTA_ASSERT(masks_.size() > 0)
 	<< "SparsePoolerInputMasks: No masks passed";

       for (size_type i = 0; i != masks_.size(); ++i) {

-	NTA_CHECK(masks_[i].size() > 0)
+	NTA_ASSERT(masks_[i].size() > 0)
 	  << "SparsePoolerInputMasks: Empty mask";

 	for (size_type j = 0; j != masks_[i].size(); ++j)
-	  NTA_CHECK(masks_[i][j].second > 0)
+	  NTA_ASSERT(masks_[i][j].second > 0)
 	    << "SparsePoolerInputMasks: Empty mask segment";
       }
     } // End pre-conditions


remove GL_EXT_gpu_shader4

remove GL_EXT_gpu_shader4

--- Engine/source/gfx/gl/gfxGLShader.cpp
+++ Engine/source/gfx/gl/gfxGLShader.cpp
@@ -952,13 +952,6 @@
    buffers.push_back( dStrdup( versionDecl ) );
    lengths.push_back( dStrlen( versionDecl ) );

-   if(gglHasExtension(EXT_gpu_shader4))
-   {
-      const char *extension = "#extension GL_EXT_gpu_shader4 : enable\r\n";
-      buffers.push_back( dStrdup( extension ) );
-      lengths.push_back( dStrlen( extension ) );
-   }
-
    if(gglHasExtension(ARB_gpu_shader5))
    {
       const char *extension = "#extension GL_ARB_gpu_shader5 : enable\r\n";


Removing ATTR_PROC_FABRIC_ADDR_BAR_MODE

Removing ATTR_PROC_FABRIC_ADDR_BAR_MODE

We only support Large system forward

Change-Id: I67d66bbca6104932c8b24a906da0c73509cbfecd
Original-Change-Id: Id237e1bdbcb0d1eff34f74b348430df958bcc712
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36610
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: PPE CI <dc75934ba5befb9221434e67a247b93aec46b36b@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Gregory S. Still <4249770c9038596e9483266bcd48707ac69ee60b@us.ibm.com>
Reviewed-by: Prem Shanker Jha <3a412e33a2e075117b5262bcf2504c145441bf2a@in.ibm.com>
Reviewed-by: ANDRE A. MARIN <65293609e29ccd0ac899f5f3f03aea95be1b215f@us.ibm.com>
Reviewed-by: Joseph J. McGill <4a85c6614f9f065f63d8fd57cde15e48af07ea2a@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H
+++ src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H
@@ -27338,27 +27338,6 @@
 }

 ///
-/// @brief ATTR_PROC_FABRIC_ADDR_BAR_MODE getter
-/// @param[out] uint8_t& reference to store the value
-/// @note Generated by gen_accessors.pl generateParameters (SYSTEM)
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
-/// @note  Processor memory map configuration. 0 = default = large system address map
-/// Provided by the
-/// MRW.
-///
-inline fapi2::ReturnCode proc_fabric_addr_bar_mode(uint8_t& o_value)
-{
-
-    FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_PROC_FABRIC_ADDR_BAR_MODE, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(), o_value) );
-    return fapi2::current_err;
-
-fapi_try_exit:
-    FAPI_ERR("failed accessing ATTR_PROC_FABRIC_ADDR_BAR_MODE: 0x%lx (system target)",
-             uint64_t(fapi2::current_err));
-    return fapi2::current_err;
-}
-
-///
 /// @brief ATTR_PROC_EPS_GB_PERCENTAGE getter
 /// @param[out] int8_t& reference to store the value
 /// @note Generated by gen_accessors.pl generateParameters (SYSTEM)


fix forgotten conflict

fix forgotten conflict

--- source/tuning_runner/manipulator_interface_implementation.cpp
+++ source/tuning_runner/manipulator_interface_implementation.cpp
@@ -670,11 +670,8 @@
 {
     for (const auto& currentEvent : events)
     {
-<<<<<<< HEAD
-        KernelResult result = computeEngine->getKernelResult(currentEvent, std::vector<OutputDescriptor>{});
-        currentResult.increaseKernelTime(result.getComputationDuration());
-=======
         const KernelResult result = computeEngine->getKernelResult(currentEvent.second, std::vector<OutputDescriptor>{});
+	currentResult.increaseKernelTime(result.getComputationDuration());

         if (isComposition())
         {
@@ -684,7 +681,6 @@
         {
             currentResult.setCompilationData(result.getCompilationData());
         }
->>>>>>> development
     }
 }


Runner support run time errors handling.

--- SIN/Tests/SINRun_Test/Src/SINRunTester.cpp
+++ SIN/Tests/SINRun_Test/Src/SINRunTester.cpp
@@ -24,6 +24,7 @@
 #include "SINShiftToMetaEvaluatorASTVisitor.h"
 #include "SINASTUnparseTreeVisitor.h"
 #include "SINASTCloneVisitor.h"
+#include "SINRunTimeError.h"

 #define SIN_TESTS_RUN_RUN(NAME)               SINTESTS_RUNTEST(NAME)
@@ -174,10 +175,17 @@
 				globalSymTable->Insert("fileread",       SINEWCLASS(MemoryCellLibFunction, (&fileread)));

-
 				TreeEvaluationVisitor eval(&lib, &vs);
-				root->Accept(&eval);
-
+
+				try {
+					root->Accept(&eval);
+				} catch(SIN::RunTimeError rte) {
+					static_cast<OutputStream&>(STDOUT) << rte.CompleteMessage() << "\n";
+					exit(-1);
+				} catch(...) {
+					static_cast<OutputStream&>(STDOUT) << "Unexpected exception" << "\n";
+					exit(-1);
+				}
 				//ShiftToMetaEvaluatorASTVisitor shifter(eval);
 				//root->Accept(&shifter);
 				//shifter.Root()->Accept(&metaVisualVisitor);


Only include debug information in error messages in debug builds.

--- Yson/JsonReaderException.cpp
+++ Yson/JsonReaderException.cpp
@@ -11,20 +11,17 @@

 namespace Yson
 {
-
     JsonReaderException::JsonReaderException()
         : std::logic_error("Unspecified error."),
           m_LineNumber(0),
           m_ColumnNumber(0)
-    {
-    }
+    {}

     JsonReaderException::JsonReaderException(const std::string& msg)
         : std::logic_error(msg),
           m_LineNumber(0),
           m_ColumnNumber(0)
-    {
-    }
+    {}

     JsonReaderException::JsonReaderException(
             const std::string& msg,
@@ -33,11 +30,14 @@
             const std::string& funcName)
         : std::logic_error(msg)
     {
-        std::stringstream ss;
-        if (!funcName.empty())
-            ss << funcName << "() in ";
-        ss << sourceFileName << ":" << sourceFileLineNumber << ": " << msg;
-        m_Message = ss.str();
+        #ifndef NDEBUG
+            std::stringstream ss;
+            if (!funcName.empty())
+                ss << funcName << "() in ";
+            ss << sourceFileName << ":" << sourceFileLineNumber << ": "
+               << msg;
+            m_Message = ss.str();
+        #endif
     }

@@ -53,10 +53,12 @@
           m_ColumnNumber(fileColumnNumber)
     {
         std::stringstream ss;
-        if (!funcName.empty())
-            ss << funcName << "() in ";
-        ss << sourceFileName << ":" << sourceFileLineNumber << ": "
-           << "On line " << fileLineNumber
+        #ifndef NDEBUG
+            if (!funcName.empty())
+                ss << funcName << "() in ";
+            ss << sourceFileName << ":" << sourceFileLineNumber << ": ";
+        #endif
+        ss << "On line " << fileLineNumber
            << ", column " << fileColumnNumber
            << ": " << msg;
         m_Message = ss.str();


Ocean demo: added code to show only supported materials.

--- Samples/OceanDemo/src/MaterialControls.cpp
+++ Samples/OceanDemo/src/MaterialControls.cpp
@@ -19,6 +19,9 @@
 #include "OgreConfigFile.h"
 #include "OgreResourceGroupManager.h"
 #include "OgreException.h"
+#include "OgreMaterial.h"
+#include "OgreTechnique.h"
+#include "OgreMaterialManager.h"

 /********************************************************************************
             MaterialControls Methods
@@ -83,6 +86,14 @@
             if (!secName.empty() && settings)
             {
                 materialName = cf.getSetting("material", secName);
+
+				Ogre::MaterialPtr curMat = Ogre::MaterialManager::getSingleton().getByName(materialName);
+				curMat->load();
+				Ogre::Technique * curTec = curMat->getBestTechnique();
+				if (!curTec || !curTec->isSupported())
+				{
+					continue;
+				}

                 MaterialControls newMaaterialControls(secName, materialName);
                 controlsContainer.push_back(newMaaterialControls);


forで変数を宣言するようにした

forで変数を宣言するようにした

--- tsukasa/tsukasa.cpp
+++ tsukasa/tsukasa.cpp
@@ -11,8 +11,6 @@
     _setmode(_fileno(stdin), _O_BINARY);
 #endif

-    int i;
-    unsigned int j;
     int data_pos;
     int audio_stream_number = 0;

@@ -63,7 +61,7 @@
     /* MMS Data Packetのエラーチェック */

     /* LocationIdとIncarnationが0以外はエラー */
-    for (i = 0; i < 5; i++)
+    for (int i = 0; i < 5; i++)
     {
         if (framing_header[4 + i] != 0)
         {
@@ -78,7 +76,7 @@
     }

     /* PacketSizeがPacketLengthとサイズが違うとエラー */
-    for (i = 0; i < 2; i++) {
+    for (int i = 0; i < 2; i++) {
         if (framing_header[10 + i] != framing_header[2 + i])
         {
             exit(EXIT_FAILURE);
@@ -87,7 +85,7 @@

     /* data_sizeを取得、8バイトのMMS Data Packetをdata_sizeから引く */
     data_size = 0;
-    for (i = 0; i < 2; i++)
+    for (int i = 0; i < 2; i++)
     {
         data_size += (unsigned short)framing_header[2 + i] << 8 * i;
     }
@@ -107,13 +105,13 @@
     }

     /* header_object_sizeを取得 */
-    for (i = 0; i < 8; i++)
+    for (int i = 0; i < 8; i++)
     {
         header_object_size += (unsigned long long)data[20 + i] << 8 * i;
     }

     /* number_of_header_objectsを取得 */
-    for (i = 0; i < 4; i++)
+    for (int i = 0; i < 4; i++)
     {
         number_of_header_objects += (unsigned long)data[28 + i] << 8 * i;
     }
@@ -121,11 +119,11 @@
     /* data_posをasf_header_objectの終端に設定 */
     data_pos = 34;

-    for (j = 0; j < number_of_header_objects; j++)
+    for (unsigned int j = 0; j < number_of_header_objects; j++)
     {
         /* object_sizeを取得 */
         object_size = 0;
-        for (i = 0; i < 8; i++)
+        for (int i = 0; i < 8; i++)
         {
             object_size += (unsigned long long)data[data_pos + 16 + i] << 8 * i;
         }
@@ -137,7 +135,7 @@
             data[data_pos + 39] = 0xFF;

             /* maximum_bitrateを取得 */
-            for (i = 0; i < 4; i++)
+            for (int i = 0; i < 4; i++)
             {
                 maximum_bitrate += (unsigned long)data[data_pos + 100 + i] << 8 * i;
             }
@@ -146,7 +144,7 @@
             if (maximum_bitrate == 0xFFFFFFFF)
             {
                 maximum_bitrate = 128000;
-                for (i = 0; i < 4; i++)
+                for (int i = 0; i < 4; i++)
                 {
                     data[data_pos + 100 + i] = (maximum_bitrate >> 8 * i) & 0xFF;
                 }
@@ -164,7 +162,7 @@

                 /* average_number_of_bytes_per_secondを取得 */
                 average_number_of_bytes_per_second = 0;
-                for (i = 0; i < 4; i++)
+                for (int i = 0; i < 4; i++)
                 {
                     average_number_of_bytes_per_second += (unsigned long)data[data_pos + 86 + i] << 8 * i;
                 }
@@ -173,7 +171,7 @@
                 if (average_number_of_bytes_per_second == 0)
                 {
                     average_number_of_bytes_per_second = 16000;
-                    for (i = 0; i < 4; i++)
+                    for (int i = 0; i < 4; i++)
                     {
                         data[data_pos + 86 + i] = (average_number_of_bytes_per_second >> 8 * i) & 0xFF;
                     }
@@ -201,25 +199,25 @@
     std::memmove(data + data_pos + object_size, data + data_pos, data_size + 4 - data_pos);

     /* object_idを書き込む */
-    for (i = 0; i < 16; i++)
+    for (int i = 0; i < 16; i++)
     {
         data[data_pos + i] = asf_stream_bitrate_properties_object[i];
     }

     /* object_sizeを書き込む */
-    for (i = 0; i < 8; i++)
+    for (int i = 0; i < 8; i++)
     {
         data[data_pos + 16 + i] = (object_size >> 8 * i) & 0xFF;
     }

     /* bitrate_records_countを書き込む */
-    for (i = 0; i < 2; i++)
+    for (int i = 0; i < 2; i++)
     {
         data[data_pos + 24 + i] = (std::strlen(bitrate_records) >> 8 * i) & 0xFF;
     }

     /* bitrate_recordsを書き込む */
-    for (j = 0; j < strlen(bitrate_records); j++)
+    for (unsigned int j = 0; j < strlen(bitrate_records); j++)
     {
         /* stream_numberを書き込む */
         data[data_pos + 26 + j * 6] = bitrate_records[j];
@@ -228,14 +226,14 @@
         /* average_bitrateを書き込む */
         if (bitrate_records[j] == audio_stream_number)
         {
-            for (i = 0; i < 4; i++)
+            for (int i = 0; i < 4; i++)
             {
                 data[data_pos + 28 + i + j * 6] = ((average_number_of_bytes_per_second * 8) >> 8 * i) & 0xFF;
             }
         }
         else
         {
-            for (i = 0; i < 4; i++)
+            for (int i = 0; i < 4; i++)
             {
                 data[data_pos + 28 + i + j * 6] = ((maximum_bitrate - average_number_of_bytes_per_second * 8) >> 8 * i) & 0xFF;
             }
@@ -248,19 +246,19 @@
     data_size += (unsigned short)object_size;

     /* 新しいnumber_of_header_objectsを書き込む */
-    for (i = 0; i < 4; i++)
+    for (int i = 0; i < 4; i++)
     {
         data[28 + i] = (number_of_header_objects >> 8 * i) & 0xFF;
     }

     /* 新しいheader_object_sizeを書き込む */
-    for (i = 0; i < 8; i++)
+    for (int i = 0; i < 8; i++)
     {
         data[20 + i] = (header_object_size >> 8 * i) & 0xFF;
     }

     /* 新しいdata_sizeを書き込む */
-    for (i = 0; i < 2; i++)
+    for (int i = 0; i < 2; i++)
     {
         data[2 + i] = (data_size >> 8 * i) & 0xFF;
     }
@@ -310,7 +308,7 @@
         /* MMS Data Packetのエラーチェック */

         /* IncarnationとAFFlagsが0以外はエラー */
-        for (i = 0; i < 2; i++)
+        for (int i = 0; i < 2; i++)
         {
             if (framing_header[8 + i] != 0)
             {
@@ -319,7 +317,7 @@
         }

         /* PacketSizeがPacketLengthとサイズが違うとエラー */
-        for (i = 0; i < 2; i++)
+        for (int i = 0; i < 2; i++)
         {
             if (framing_header[10 + i] != framing_header[2 + i])
             {
@@ -329,7 +327,7 @@

         /* data_sizeを取得、8バイトのMMS Data Packetをdata_sizeから引く */
         data_size = 0;
-        for (i = 0; i < 2; i++)
+        for (int i = 0; i < 2; i++)
         {
             data_size += (unsigned short)framing_header[2 + i] << 8 * i;
         }
@@ -349,7 +347,7 @@
         std::memcpy(data, framing_header, 2);

         /* 新しいdata_sizeを書き込む */
-        for (i = 0; i < 2; i++)
+        for (int i = 0; i < 2; i++)
         {
             data[2 + i] = (data_size >> 8 * i) & 0xFF;
         }


show how to use wildcard to list in the TGFileDialog both *.txt and *.TXT
files.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@6662 27541ba8-7e3a-0410-8455-c3a389f83636

--- tutorials/guitest.C
+++ tutorials/guitest.C
@@ -1,4 +1,4 @@
-// @(#)root/tutorials:$Name:  $:$Id: guitest.C,v 1.20 2003/01/14 15:44:56 rdm Exp $
+// @(#)root/tutorials:$Name:  $:$Id: guitest.C,v 1.21 2003/03/04 17:04:52 rdm Exp $
 // Author: Fons Rademakers   22/10/2000

 // guitest.C: test program for ROOT native GUI classes exactly like
@@ -92,6 +92,7 @@
 const char *filetypes[] = { "All files",     "*",
                             "ROOT files",    "*.root",
                             "ROOT macros",   "*.C",
+                            "Text files",    "*.[tT][xX][tT]",
                             0,               0 };

 struct shutterData_t {


small cleanup

small cleanup

svn path=/trunk/KDE/kdelibs/phonon/; revision=727028

--- kcm/outputdevicechoice.cpp
+++ kcm/outputdevicechoice.cpp
@@ -204,7 +204,7 @@
         QHash<int, Phonon::AudioOutputDevice> hashCopy(hash);
         QList<Phonon::AudioOutputDevice> orderedList;
         if (model->rowCount() > 0) {
-            QList<int> order = m_outputModel.value(i)->tupleIndexOrder();
+            QList<int> order = model->tupleIndexOrder();
             foreach (int idx, order) {
                 if (hashCopy.contains(idx)) {
                     orderedList << hashCopy.take(idx);


x86/mm: Fix #15.

x86/mm: Fix #15.

Signed-off-by: Pedro Falcato <d037c3eb54456eb57a351d3e1361e11b3d89c857@gmail.com>

--- kernel/arch/x86_64/mmu.cpp
+++ kernel/arch/x86_64/mmu.cpp
@@ -1310,7 +1310,7 @@

 static inline bool is_higher_half(unsigned long address)
 {
-	return address > VM_HIGHER_HALF;
+	return address >= VM_HIGHER_HALF;
 }

 PER_CPU_VAR(unsigned long tlb_nr_invals) = 0;