hidb API refactored

hidb API refactored

--- cc/whocc-check-new-tables.cc
+++ cc/whocc-check-new-tables.cc
@@ -28,7 +28,7 @@
         Options opt(argc, argv);
         acmacs::log::enable(opt.verbose);

-        const auto show_matches = [](const auto& hidb, const auto& hidb_ag_sr, size_t no, const auto& ag_sr) {
+        const auto show_matches = [](const auto& hidb, const auto& hidb_ag_sr, const auto& found_ag_sr, size_t no, const auto& ag_sr) {
             const auto make_field = [](const auto& value, const auto& to_compare) {
                 if (!value.empty() && value == to_compare)
                     return fmt::format("<{}>", value);
@@ -43,7 +43,8 @@

             std::vector<std::pair<std::string, fmt::memory_buffer>> hidb_variants;
             bool full_name_match_present{false};
-            for (const auto& [hidb_antigen, hidb_index] : hidb_ag_sr) {
+            for (const auto hidb_index : found_ag_sr) {
+                auto hidb_antigen = hidb_ag_sr.at(hidb_index);
                 const auto hidb_full_name = hidb_antigen->full_name();
                 full_name_match_present |= hidb_full_name == full_name;
                 auto& variant = hidb_variants.emplace_back(hidb_full_name, fmt::memory_buffer{});
@@ -106,7 +107,7 @@
                 if (!antigen->distinct()) {
                     const auto hidb_antigens = hidb.antigens()->find(antigen->name(), hidb::fix_location::no);
                     if (!hidb_antigens.empty())
-                        show_matches(hidb, hidb_antigens, ag_no, *antigen);
+                        show_matches(hidb, *hidb.antigens(), hidb_antigens, ag_no, *antigen);
                     fmt::print("\n");
                 }
             }
@@ -116,7 +117,7 @@
             for (auto [sr_no, serum] : acmacs::enumerate(*sera)) {
                 const auto hidb_sera = hidb.sera()->find(serum->name(), hidb::fix_location::no);
                 // if (!hidb_sera.empty())
-                show_matches(hidb, hidb_sera, sr_no, *serum);
+                show_matches(hidb, *hidb.sera(), hidb_sera, sr_no, *serum);
                 fmt::print("\n");
             }
             fmt::print("\n\n");


removed typo

removed typo

--- src/test/agrad/fwd/atan_test.cpp
+++ src/test/agrad/fwd/atan_test.cpp
@@ -159,4 +159,3 @@
   b.d_.val_.grad(q,r);
   EXPECT_FLOAT_EQ(2.0 * -0.28402368, r[0]);
 }
-Deriv


regression fix hex << dec #46

regression fix hex << dec #46

--- src/test/cpp/regression/main.cpp
+++ src/test/cpp/regression/main.cpp
@@ -1064,13 +1064,13 @@
                             #ifdef TRACE_WITH_TIME
                             currentTime <<
                              #endif
-                             " PC " << hex << setw(8) <<  top->VexRiscv->writeBack_PC << " : reg[" << dec << setw(2) << (uint32_t)top->VexRiscv->writeBack_RegFilePlugin_regFileWrite_payload_address << "] = " << hex << setw(8) << top->VexRiscv->writeBack_RegFilePlugin_regFileWrite_payload_data << endl;
+                             " PC " << hex << setw(8) <<  top->VexRiscv->writeBack_PC << " : reg[" << dec << setw(2) << (uint32_t)top->VexRiscv->writeBack_RegFilePlugin_regFileWrite_payload_address << "] = " << hex << setw(8) << top->VexRiscv->writeBack_RegFilePlugin_regFileWrite_payload_data <<  dec << endl;
                     } else {
                         regTraces <<
                                 #ifdef TRACE_WITH_TIME
                                 currentTime <<
                                  #endif
-                                 " PC " << hex << setw(8) <<  top->VexRiscv->writeBack_PC << endl;
+                                 " PC " << hex << setw(8) <<  top->VexRiscv->writeBack_PC << dec << endl;
                     }
 					if(riscvRefEnable) if(rfWriteValid != riscvRef.rfWriteValid ||
 						(rfWriteValid && (rfWriteAddress!= riscvRef.rfWriteAddress || rfWriteData!= riscvRef.rfWriteData))){
@@ -1118,7 +1118,7 @@
 			staticMutex.unlock();
 		} catch (const std::exception& e) {
 			staticMutex.lock();
-			cout << "FAIL " <<  name << " at PC=" << hex << setw(8) << top->VexRiscv->writeBack_PC << endl; //<<  " seed : " << seed <<
+			cout << "FAIL " <<  name << " at PC=" << hex << setw(8) << top->VexRiscv->writeBack_PC << dec << endl; //<<  " seed : " << seed <<
 			cycles += instanceCycles;
 			staticMutex.unlock();
 			failed = true;
@@ -2147,7 +2147,7 @@
     virtual void dBusAccess(uint32_t addr,bool wr, uint32_t size,uint32_t mask, uint32_t *data, bool *error) {
         Workspace::dBusAccess(addr,wr,size,mask,data,error);
         if(wr && addr == 0xF00FFF2C){
-            out32 << hex << setw(8) << std::setfill('0') << *data;
+            out32 << hex << setw(8) << std::setfill('0') << *data << dec;
             if(++out32Counter % 4 == 0) out32 << "\n";
             *error = 0;
         }


More tests of prepared statement names

More tests of prepared statement names

--- src/test/postgres/connection.cpp
+++ src/test/postgres/connection.cpp
@@ -34,11 +34,13 @@
   // execution of invalid statements fails
   TEST_THROWS( connection->execute( "FOO BAR BAZ" ) );

+  // a prepared statement's name must be a valid C++ identifier
+  TEST_THROWS( connection->prepare( "", "DROP TABLE IF EXISTS tao_connection_test" ) );
+  TEST_THROWS( connection->prepare( "0drop_table", "DROP TABLE IF EXISTS tao_connection_test" ) );
+  TEST_THROWS( connection->prepare( "drop table", "DROP TABLE IF EXISTS tao_connection_test" ) );
+
   // prepare a statement
   connection->prepare( "drop_table", "DROP TABLE IF EXISTS tao_connection_test" );
-
-  // a prepared statement's name must be a valid C++ identifier
-  TEST_THROWS( connection->prepare( "drop table", "DROP TABLE IF EXISTS tao_connection_test" ) );

   // execute a prepared statement
   //


Set tooltip owner before setting the tooltip

This will properly set the tooltip text

--- cegui/src/views/ItemView.cpp
+++ cegui/src/views/ItemView.cpp
@@ -589,21 +589,21 @@
     if (d_itemModel->areIndicesEqual(index, last_model_index))
         return;

+    Tooltip* tooltip = getTooltip();
+    if (tooltip == 0)
+        return;
+
+    if (tooltip->getTargetWindow() != this)
+        tooltip->setTargetWindow(this);
+    else
+        tooltip->positionSelf();
+
     last_model_index = index;

     if (!d_itemModel->isValidIndex(index))
         setTooltipText("");
     else
         setTooltipText(d_itemModel->getData(index, IDR_Tooltip));
-
-    Tooltip* tooltip = getTooltip();
-    if (tooltip == 0)
-        return;
-
-    if (tooltip->getTargetWindow() != this)
-        tooltip->setTargetWindow(this);
-    else
-        tooltip->positionSelf();
 }

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


overflow test

overflow test

Former-commit-id: c5e0e69d51fab497ad12b7efaee8d1f315803c12

--- src/test/syscoin_asset_tests.cpp
+++ src/test/syscoin_asset_tests.cpp
@@ -495,6 +495,25 @@
 	BOOST_CHECK_NO_THROW(r = CallRPC("node1", "assetallocationinfo " + guid + " jagassetcollectionreceiver false"));
 	balance = find_value(r.get_obj(), "balance");
 	BOOST_CHECK_EQUAL(AssetAmountFromValue(balance, 8, false), 824875837095);
+}
+BOOST_AUTO_TEST_CASE(generate_asset_allocation_interest_overflow)
+{
+	GenerateBlocks(5);
+	printf("Running generate_asset_allocation_interest_overflow...\n");
+	GenerateBlocks(5);
+	string newaddress = GetNewFundedAddress("node1");
+	string newaddressreceiver2 = GetNewFundedAddress("node2");
+	string guid = AssetNew("node1", "cad", newaddress, "data", "8", "false", "2000000000", "9999999999", "0.25");
+	AssetSend("node1", guid, "\"[{\\\"ownerto\\\":\\\"" + newaddress + "\\\",\\\"amount\\\":1000000000}]\"", "memoassetinterest");
+	AssetSend("node1", guid, "\"[{\\\"ownerto\\\":\\\"" + newaddressreceiver2 + "\\\",\\\"amount\\\":1000000000}]\"", "memoassetinterest");
+	GenerateBlocks(5000);
+	for (int i = 0; i < 5000; i++) {
+		AssetAllocationTransfer(true, "node1", guid, newaddress, "\"[{\\\"ownerto\\\":\\\"" + newaddressreceiver + "\\\",\\\"amount\\\":1}]\"", "allocationsendmemo");
+	}
+	for (int i = 0; i < 5000; i++) {
+		AssetAllocationTransfer(true, "node1", guid, newaddressreceiver2, "\"[{\\\"ownerto\\\":\\\"" + newaddress + "\\\",\\\"amount\\\":1}]\"", "allocationsendmemo");
+	}
+	AssetClaimInterest("node1", guid, newaddress);
 }
 BOOST_AUTO_TEST_CASE(generate_asset_collect_interest_address)
 {


Revert "stop and start nodes"

Revert "stop and start nodes"

This reverts commit 07a96d5c4e5cb68ce13a170a1b3ebfbb7f796782 [formerly 28ed40e86c9d035f2377029c3af31ff87a44f5b9].

Former-commit-id: 30a0ec4cca08ae03bda9c0cc36de7976f4c8e24a

--- src/test/syscoin_asset_tests.cpp
+++ src/test/syscoin_asset_tests.cpp
@@ -388,8 +388,7 @@
 		if (count % 100 == 0)
 			 printf("%.2f percentage done\n", 100.0f / (1000.0f / count));
 	}
-	StopNodes();
-	StartNodes();
+	GenerateBlocks(10);
 	printf("Creating assetsend transactions to node3 alias...\n");
 	vector<string> assetSendTxVec;
 	count = 0;


Two minor changes to the use of FormatMessageA in Win32ErrorLogMessage:
- Follow the MSDN advice and use FORMAT_MESSAGE_IGNORE_INSERTS to avoid security issues and to prevent getting back ERROR_INVALID_PARAMETER for any message that has inserts.  This is always the right thing since this function provides no arguments for inserts.
- Don't specify a language identifier, thereby allowing FormatMessageA to make many sensible attempts to find a string in some suitable language.

BUG=none
TEST=none

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

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

Former-commit-id: e086bf10bb96a69431ec121b882fa8fbde43573e

--- base/logging.cc
+++ base/logging.cc
@@ -706,7 +706,7 @@
 Win32ErrorLogMessage::~Win32ErrorLogMessage() {
   const int error_message_buffer_size = 256;
   char msgbuf[error_message_buffer_size];
-  DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM;
+  DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;
   HMODULE hmod;
   if (module_) {
     hmod = GetModuleHandleA(module_);
@@ -725,7 +725,7 @@
   DWORD len = FormatMessageA(flags,
                              hmod,
                              err_,
-                             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                             0,
                              msgbuf,
                              sizeof(msgbuf) / sizeof(msgbuf[0]),
                              NULL);


refs #5700, fix test

refs #5700, fix test

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@50575 c7de825b-a66e-492c-adef-691d508d4ae1

--- src/tests/stat64-root-changes.cc
+++ src/tests/stat64-root-changes.cc
@@ -127,7 +127,7 @@

         DB_BTREE_STAT64 s;
         r = db->stat64(db, NULL, &s); CKERR(r);
-        assert(s.bt_nkeys == 2 && s.bt_dsize == sizeof key + sizeof val);
+        assert(s.bt_nkeys == 1 && s.bt_dsize == sizeof key + sizeof val);

         r = db->close(db, 0);     CKERR(r);


Deleted useless includes in test_skeleton

--- src/tests/test_skeleton/main.cpp
+++ src/tests/test_skeleton/main.cpp
@@ -25,11 +25,6 @@
  *  \brief Provides tests for skeleton library
  *  \author Bastien Durix
  */
-
-#include <iostream>
-#include <math.h>
-
-#include <cstdlib>

 #include <skeleton/GraphCurveSkeleton.h>
 #include <skeleton/model/Classic.h>


clipp: Update @unparse to support new event names.

--- clipp/unparse_modifier.cpp
+++ clipp/unparse_modifier.cpp
@@ -109,7 +109,7 @@
         m_txdata.first += c_eol;
     }

-    void request_headers(const Input::HeaderEvent& event)
+    void request_header(const Input::HeaderEvent& event)
     {
         headers(m_txdata.first, event);
     }
@@ -150,7 +150,7 @@

     }

-    void response_headers(const Input::HeaderEvent& event)
+    void response_header(const Input::HeaderEvent& event)
     {
         headers(m_txdata.second, event);
     }


Update stream output test to be easy to revert to non-same dest buffers.

--- d3d_stream_output_same_buffer_disjoint.cpp
+++ d3d_stream_output_same_buffer_disjoint.cpp
@@ -116,6 +116,18 @@
         ASSERT(out_buffer);
     }

+    ID3D11Buffer* out_buffer2 = nullptr;
+    {
+        const D3D11_BUFFER_DESC desc{
+            sizeof(in_data), D3D11_USAGE_DEFAULT,
+            D3D11_BIND_STREAM_OUTPUT,
+            0, 0,
+            0
+        };
+        hr = device->CreateBuffer(&desc, nullptr, &out_buffer2);
+        ASSERT(out_buffer2);
+    }
+
     ID3D11Buffer* read_buffer = nullptr;
     {
         const D3D11_BUFFER_DESC desc{
@@ -152,6 +164,7 @@
         context->IASetVertexBuffers(0, 1, &in_buffer, strides, offsets);
     }
     {
+        //ID3D11Buffer* const buffers[]{ out_buffer, out_buffer2 };
         ID3D11Buffer* const buffers[]{ out_buffer, out_buffer };
         const UINT offsets[]{ 0, 8 };
         context->SOSetTargets(DISJOINT_SO_RANGES, buffers, offsets);


live555: Add satip support

live555: Add satip support

Register a satip-access, which uses a hardcoded default SDP dataset instead of
querying it via DESCRIBE. While some SAT>IP servers implement a common
DESCRIBE the spec is allowing servers to only support DESCRIBE of already
configured sessions, which requires SETUP to be executed before DESCRIBE can
be used at all.

Signed-off-by: Julian Scheel <354106e416911844661e1603d99ecf7d1c318dda@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <7b85a41a628204b76aba4326273a3ccc74bd009a@videolan.org>

--- modules/access/live555.cpp
+++ modules/access/live555.cpp
@@ -102,7 +102,7 @@

     add_submodule ()
         set_description( N_("RTSP/RTP access and demux") )
-        add_shortcut( "rtsp", "pnm", "live", "livedotcom" )
+        add_shortcut( "rtsp", "pnm", "live", "livedotcom", "satip" )
         set_capability( "access_demux", 0 )
         set_callbacks( Open, Close )
         add_bool( "rtsp-tcp", false,
@@ -332,6 +332,17 @@
         while( (p = strchr( p, ' ' )) != NULL ) *p = '+';
     }

+    if( strcasecmp( p_demux->psz_access, "satip" ) == 0 )
+    {
+        asprintf(&p_sys->p_sdp, "v=0\r\n"
+                "o=- 0 %s\r\n"
+                "s=SATIP:stream\r\n"
+                "i=SATIP RTP Stream\r\n"
+                "m=video 0 RTP/AVP 33\r\n"
+                "a=control:rtsp://%s\r\n\r\n",
+                p_sys->url.psz_host, p_sys->psz_path);
+    }
+
     if( p_demux->s != NULL )
     {
         /* Gather the complete sdp file */
@@ -524,7 +535,15 @@
       result_code == 0
       && result_string != NULL
       && strstr( result_string, "GET_PARAMETER" ) != NULL;
-    client->sendDescribeCommand( continueAfterDESCRIBE );
+    if( p_sys->p_sdp == NULL )
+    {
+        client->sendDescribeCommand( continueAfterDESCRIBE );
+    }
+    else
+    {
+        p_sys->b_error = false;
+        p_sys->event_rtsp = 1;
+    }
     delete[] result_string;
 }


Free transient allocators around IDT and SYSCALL entrypoint creation.

--- granary/kernel/state.cc
+++ granary/kernel/state.cc
@@ -171,14 +171,22 @@
 #   endif
             // Create this CPUs IDT and vector entry points.
             flags = granary_disable_interrupts();
-            CPU_STATES[i]->idtr = create_idt(CPU_STATES[i]->native_idtr);
+            {
+                cpu_state_handle cpu;
+                cpu.free_transient_allocators();
+                CPU_STATES[i]->idtr = create_idt(CPU_STATES[i]->native_idtr);
+            }
             granary_store_flags(flags);
 #endif
 #if CONFIG_INSTRUMENT_HOST
             // Create this CPUs SYSCALL entry point.
             flags = granary_disable_interrupts();
-            CPU_STATES[i]->msr_lstar = create_syscall_entrypoint(
-                CPU_STATES[i]->native_msr_lstar);
+            {
+                cpu_state_handle cpu;
+                cpu.free_transient_allocators();
+                CPU_STATES[i]->msr_lstar = create_syscall_entrypoint(
+                    CPU_STATES[i]->native_msr_lstar);
+            }
             granary_store_flags(flags);
 #endif


typo fix

typo fix

--- src/tightdb/util/file_mapper.cpp
+++ src/tightdb/util/file_mapper.cpp
@@ -329,7 +329,7 @@
     throw std::runtime_error(get_errno_msg("mremap(): failed: ", err));
 #else
     void* new_addr = mmap(fd, new_size, a, nullptr);
-    if(::munmap(old_addr, old_size) != 0)
+    if(::munmap(old_addr, old_size) != 0) {
         int err = errno;
         throw std::runtime_error(get_errno_msg("munmap() failed: ", err));
     }


itm: simplify the x_type

itm: simplify the x_type

--- lib/src/itm-common.hpp
+++ lib/src/itm-common.hpp
@@ -56,7 +56,7 @@
       : m_data(size)
     {}

-    bool operator[](int index) const noexcept
+    int operator[](int index) const noexcept
     {
         return m_data.get(index);
     }
@@ -76,7 +76,7 @@
         m_data.unset(index);
     }

-    void set(index index, var_value v) noexcept
+    void set(index index, int v) noexcept
     {
         if (v > 0)
             m_data.set(index);
@@ -116,7 +116,7 @@
       , m_counter(size, 0)
     {}

-    bool operator[](int index) const noexcept
+    int operator[](int index) const noexcept
     {
         return m_data.get(index);
     }
@@ -129,7 +129,7 @@
         m_data.invert(index);
     }

-    void set(index index, var_value v) noexcept
+    void set(index index, int v) noexcept
     {
         // TODO: Maybe use integer class members to store upper and lower index
         // and make upper() and lower() function O(1).


housekeeping: rearranged chainparams

housekeeping: rearranged chainparams

--- src/chainparams.cpp
+++ src/chainparams.cpp
@@ -72,6 +72,47 @@
 public:
     CMainParams() {
         strNetworkID = "main";
+
+        /*** Myriadcoin Additional Chainparams ***/
+
+        consensus.nPowTargetSpacingV1 = 30; // target time for block spacing across all algorithms
+        consensus.nPowTargetSpacingV2 = 60; // new target time for block spacing across all algorithms
+        consensus.nAveragingInterval = 10; // number of blocks to take the timespan of
+
+        consensus.nStartAuxPow = 1402000; // Allow AuxPow blocks from this height
+        consensus.nAuxpowChainId = 0x005A;
+        consensus.fStrictChainId = false;
+
+        consensus.nBlockTimeWarpPreventStart1 = 740500; // block where time warp 1 prevention starts
+        consensus.nBlockTimeWarpPreventStart2 = 766000; // block where time warp 2 prevention starts
+        consensus.nBlockTimeWarpPreventStart3 = 1048320; // block where time warp 3 prevention starts
+        consensus.Phase2Timespan_Start = 1401000; // block where 60 second target time kicks in
+        consensus.nBlockDiffAdjustV2 = 766000; // block where difficulty adjust V2 starts
+
+        consensus.nMaxAdjustDown = 4; // 4% adjustment down
+        consensus.nMaxAdjustUpV1 = 2; // 2% adjustment up
+        consensus.nMaxAdjustUpV2 = 4; // 4% adjustment up
+
+        consensus.nBlockSequentialAlgoRuleStart1 = 740000; // block where sequential algo rule starts
+        consensus.nBlockSequentialAlgoRuleStart2 = 766000; // block where sequential algo rule starts
+        consensus.nBlockSequentialAlgoMaxCount1 = 6; // maximum sequential blocks of same algo
+        consensus.nBlockSequentialAlgoMaxCount2 = 3; // maximum sequential blocks of same algo
+        consensus.nBlockSequentialAlgoMaxCount3 = 6; // maximum sequential blocks of same algo
+
+        consensus.nBlockAlgoWorkWeightStart = 142000; // block where algo work weighting starts
+        consensus.nBlockAlgoNormalisedWorkStart = 740000; // block where algo combined weight starts
+        consensus.nBlockAlgoNormalisedWorkDecayStart1 = 866000; // block where weight decay starts
+        consensus.nBlockAlgoNormalisedWorkDecayStart2 = 932000; // block where weight decay starts
+        consensus.nGeoAvgWork_Start = 1400000;
+        consensus.nFork1MinBlock = 1764000; // minimum block height where fork 1 takes effect (algo switch, seq algo count change)
+
+        // Deployment of Legacy Blocks. Once activated, keeps v0.11 nodes on the same chain. Should be the first softfork.
+        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].bit = 2;
+        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nStartTime = 1507420800; // October 8th, 2017
+        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nTimeout = 1538956800; // October 8th, 2018
+
+        /*** Upstream Chainparams ***/
+
         consensus.nSubsidyHalvingInterval = 80640 * 12;
         consensus.BIP34Height = 1;
         consensus.BIP34Hash = uint256S("0xcb41589c918fba1beccca8bc6b34b2b928b4f9888595d7664afd6ec60a576291");
@@ -79,40 +120,8 @@
         consensus.BIP66Height = 1764000; // 2ca9968704301897b956f7e326375413be505509489c06aee2b16fe73805481e
         consensus.powLimit = ArithToUint256(~arith_uint256(0) >> 20);
         consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
-        consensus.nPowTargetSpacingV1 = 30; // target time for block spacing across all algorithms
-        consensus.nPowTargetSpacingV2 = 60; // new target time for block spacing across all algorithms
         consensus.nPowTargetSpacing = consensus.nPowTargetSpacingV2; // Current value
-        consensus.nAveragingInterval = 10; // number of blocks to take the timespan of
         consensus.fPowAllowMinDifficultyBlocks = false;
-
-        // Allow AuxPow blocks from this height
-        consensus.nStartAuxPow = 1402000;
-        consensus.nAuxpowChainId = 0x005A;
-        consensus.fStrictChainId = false;
-
-        consensus.nBlockTimeWarpPreventStart1 = 740500; // block where time warp 1 prevention starts
-        consensus.nBlockTimeWarpPreventStart2 = 766000; // block where time warp 2 prevention starts
-        consensus.nBlockTimeWarpPreventStart3 = 1048320; // block where time warp 3 prevention starts
-        consensus.Phase2Timespan_Start = 1401000; // block where 60 second target time kicks in
-        consensus.nBlockDiffAdjustV2 = 766000; // block where difficulty adjust V2 starts
-
-        consensus.nMaxAdjustDown = 4; // 4% adjustment down
-        consensus.nMaxAdjustUpV1 = 2; // 2% adjustment up
-        consensus.nMaxAdjustUpV2 = 4; // 4% adjustment up
-
-        consensus.nBlockSequentialAlgoRuleStart1 = 740000; // block where sequential algo rule starts
-        consensus.nBlockSequentialAlgoRuleStart2 = 766000; // block where sequential algo rule starts
-        consensus.nBlockSequentialAlgoMaxCount1 = 6; // maximum sequential blocks of same algo
-        consensus.nBlockSequentialAlgoMaxCount2 = 3; // maximum sequential blocks of same algo
-        consensus.nBlockSequentialAlgoMaxCount3 = 6; // maximum sequential blocks of same algo
-
-        consensus.nBlockAlgoWorkWeightStart = 142000; // block where algo work weighting starts
-        consensus.nBlockAlgoNormalisedWorkStart = 740000; // block where algo combined weight starts
-        consensus.nBlockAlgoNormalisedWorkDecayStart1 = 866000; // block where weight decay starts
-        consensus.nBlockAlgoNormalisedWorkDecayStart2 = 932000; // block where weight decay starts
-        consensus.nGeoAvgWork_Start = 1400000;
-        consensus.nFork1MinBlock = 1764000; // minimum block height where fork 1 takes effect (algo switch, seq algo count change)
-
         consensus.fPowNoRetargeting = false;
         consensus.nRuleChangeActivationThreshold = 1512; // 75% of 2016
         consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
@@ -129,11 +138,6 @@
         consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
         consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1513296000; // December 15th, 2017
         consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1544832000; // December 15th, 2018
-
-        // Deployment of Legacy Blocks. Once activated, keeps v0.11 nodes on the same chain. Should be the first softfork.
-        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].bit = 2;
-        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nStartTime = 1507420800; // October 8th, 2017
-        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nTimeout = 1538956800; // October 8th, 2018

         // The best chain should have at least this much work.
         consensus.nMinimumChainWork = uint256S("0x00");
@@ -228,6 +232,47 @@
 public:
     CTestNetParams() {
         strNetworkID = "test";
+
+        /*** Myriadcoin Additional Chainparams ***/
+
+        consensus.nPowTargetSpacingV1 = 30; // target time for block spacing across all algorithms
+        consensus.nPowTargetSpacingV2 = 60; // new target time for block spacing across all algorithms
+        consensus.nAveragingInterval = 10; // number of blocks to take the timespan of
+
+        consensus.nStartAuxPow = 150;
+        consensus.nAuxpowChainId = 0x005A;
+        consensus.fStrictChainId = false;
+
+        consensus.nBlockTimeWarpPreventStart1 = 1000; // block where time warp 1 prevention starts
+        consensus.nBlockTimeWarpPreventStart2 = 1005; // block where time warp 2 prevention starts
+        consensus.nBlockTimeWarpPreventStart3 = 1010; // block where time warp 3 prevention starts
+        consensus.Phase2Timespan_Start = 150; // block where 60 second target time kicks in
+        consensus.nBlockDiffAdjustV2 = 150; // block where difficulty adjust V2 starts
+
+        consensus.nMaxAdjustDown = 4; // 4% adjustment down
+        consensus.nMaxAdjustUpV1 = 2; // 2% adjustment up
+        consensus.nMaxAdjustUpV2 = 4; // 4% adjustment up
+
+        consensus.nBlockSequentialAlgoRuleStart1 = 200; // block where sequential algo rule starts
+        consensus.nBlockSequentialAlgoRuleStart2 = 250; // block where sequential algo rule starts
+        consensus.nBlockSequentialAlgoMaxCount1 = 6; // maximum sequential blocks of same algo
+        consensus.nBlockSequentialAlgoMaxCount2 = 3; // maximum sequential blocks of same algo
+        consensus.nBlockSequentialAlgoMaxCount3 = 6; // maximum sequential blocks of same algo
+
+        consensus.nBlockAlgoWorkWeightStart = 0; // block where algo work weighting starts
+        consensus.nBlockAlgoNormalisedWorkStart = 0; // block where algo combined weight starts
+        consensus.nBlockAlgoNormalisedWorkDecayStart1 = 0; // block where weight decay starts
+        consensus.nBlockAlgoNormalisedWorkDecayStart2 = 0; // block where weight decay starts
+        consensus.nGeoAvgWork_Start = 150;
+        consensus.nFork1MinBlock = 601; // minimum block height where fork 1 takes effect (algo switch, seq algo count change)
+
+        // Deployment of Legacy Blocks. Once activated, keeps v0.11 nodes on the same chain. Should be the first softfork.
+        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].bit = 2;
+        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nStartTime = 1504224000; // September 1st, 2017
+        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nTimeout = 1535760000; // September 1st, 2018
+
+        /*** Upstream Chainparams ***/
+
         consensus.nSubsidyHalvingInterval = 80640 * 12;
         consensus.BIP34Height = 1;
         consensus.BIP34Hash = uint256S("0x0000d23adc28e33bc05f4bee57c873ae0aab584a6a436e75ac0ed40396f6d86b");
@@ -235,39 +280,8 @@
         consensus.BIP66Height = 641; // ff983c72147a81ac5b8ebfc68b62b39358cac4b8eb5518242e87f499b71c6a51
         consensus.powLimit = ArithToUint256(~arith_uint256(0) >> 16);
         consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
-        consensus.nPowTargetSpacingV1 = 30; // target time for block spacing across all algorithms
-        consensus.nPowTargetSpacingV2 = 60; // new target time for block spacing across all algorithms
         consensus.nPowTargetSpacing = consensus.nPowTargetSpacingV2; // Current value
-        consensus.nAveragingInterval = 10; // number of blocks to take the timespan of
         consensus.fPowAllowMinDifficultyBlocks = true;
-
-        consensus.nStartAuxPow = 150;
-        consensus.nAuxpowChainId = 0x005A;
-        consensus.fStrictChainId = false;
-
-        consensus.nBlockTimeWarpPreventStart1 = 1000; // block where time warp 1 prevention starts
-        consensus.nBlockTimeWarpPreventStart2 = 1005; // block where time warp 2 prevention starts
-        consensus.nBlockTimeWarpPreventStart3 = 1010; // block where time warp 3 prevention starts
-        consensus.Phase2Timespan_Start = 150; // block where 60 second target time kicks in
-        consensus.nBlockDiffAdjustV2 = 150; // block where difficulty adjust V2 starts
-
-        consensus.nMaxAdjustDown = 4; // 4% adjustment down
-        consensus.nMaxAdjustUpV1 = 2; // 2% adjustment up
-        consensus.nMaxAdjustUpV2 = 4; // 4% adjustment up
-
-        consensus.nBlockSequentialAlgoRuleStart1 = 200; // block where sequential algo rule starts
-        consensus.nBlockSequentialAlgoRuleStart2 = 250; // block where sequential algo rule starts
-        consensus.nBlockSequentialAlgoMaxCount1 = 6; // maximum sequential blocks of same algo
-        consensus.nBlockSequentialAlgoMaxCount2 = 3; // maximum sequential blocks of same algo
-        consensus.nBlockSequentialAlgoMaxCount3 = 6; // maximum sequential blocks of same algo
-
-        consensus.nBlockAlgoWorkWeightStart = 0; // block where algo work weighting starts
-        consensus.nBlockAlgoNormalisedWorkStart = 0; // block where algo combined weight starts
-        consensus.nBlockAlgoNormalisedWorkDecayStart1 = 0; // block where weight decay starts
-        consensus.nBlockAlgoNormalisedWorkDecayStart2 = 0; // block where weight decay starts
-        consensus.nGeoAvgWork_Start = 150;
-        consensus.nFork1MinBlock = 601; // minimum block height where fork 1 takes effect (algo switch, seq algo count change)
-
         consensus.fPowNoRetargeting = false;
         consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
         consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
@@ -285,11 +299,6 @@
         consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1506816000; // October 1st, 2017
         consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1538352000; // October 1st, 2018

-        // Deployment of Legacy Blocks. Once activated, keeps v0.11 nodes on the same chain. Should be the first softfork.
-        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].bit = 2;
-        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nStartTime = 1504224000; // September 1st, 2017
-        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nTimeout = 1535760000; // September 1st, 2018
-
         // The best chain should have at least this much work.
         consensus.nMinimumChainWork = uint256S("0x00");

@@ -338,7 +347,7 @@
             // Data as of block 00000071942cef6d87635a92f106d5b1935b1314538af80922c766487afd8b22 (height 800)
             1504107501,
             817,
-            1
+            0.02
         };

     }
@@ -352,6 +361,46 @@
 public:
     CRegTestParams() {
         strNetworkID = "regtest";
+
+        /*** Myriadcoin Additional Chainparams ***/
+
+        consensus.nPowTargetSpacingV1 = 30; // target time for block spacing across all algorithms
+        consensus.nPowTargetSpacingV2 = 60; // new target time for block spacing across all algorithms
+        consensus.nAveragingInterval = 10; // number of blocks to take the timespan of
+
+        consensus.nStartAuxPow = 150;
+        consensus.nAuxpowChainId = 0x005A;
+        consensus.fStrictChainId = false;
+
+        consensus.nBlockTimeWarpPreventStart1 = 1000; // block where time warp 1 prevention starts
+        consensus.nBlockTimeWarpPreventStart2 = 1005; // block where time warp 2 prevention starts
+        consensus.nBlockTimeWarpPreventStart3 = 1010; // block where time warp 3 prevention starts
+        consensus.Phase2Timespan_Start = 150; // block where 60 second target time kicks in
+        consensus.nBlockDiffAdjustV2 = 150; // block where difficulty adjust V2 starts
+
+        consensus.nMaxAdjustDown = 4; // 4% adjustment down
+        consensus.nMaxAdjustUpV1 = 2; // 2% adjustment up
+        consensus.nMaxAdjustUpV2 = 4; // 4% adjustment up
+
+        consensus.nBlockSequentialAlgoRuleStart1 = 200; // block where sequential algo rule starts
+        consensus.nBlockSequentialAlgoRuleStart2 = 250; // block where sequential algo rule starts
+        consensus.nBlockSequentialAlgoMaxCount1 = 6; // maximum sequential blocks of same algo
+        consensus.nBlockSequentialAlgoMaxCount2 = 3; // maximum sequential blocks of same algo
+        consensus.nBlockSequentialAlgoMaxCount3 = 6; // maximum sequential blocks of same algo
+
+        consensus.nBlockAlgoWorkWeightStart = 0; // block where algo work weighting starts
+        consensus.nBlockAlgoNormalisedWorkStart = 0; // block where algo combined weight starts
+        consensus.nBlockAlgoNormalisedWorkDecayStart1 = 0; // block where weight decay starts
+        consensus.nBlockAlgoNormalisedWorkDecayStart2 = 0; // block where weight decay starts
+        consensus.nGeoAvgWork_Start = 0;
+        consensus.nFork1MinBlock = 601; // minimum block height where fork 1 takes effect (algo switch, seq algo count change)
+
+        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].bit = 2;
+        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nStartTime = 0;
+        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nTimeout = 999999999999ULL;
+
+        /*** Upstream Chainparams ***/
+
         consensus.nSubsidyHalvingInterval = 150;
         consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests)
         consensus.BIP34Hash = uint256();
@@ -359,39 +408,8 @@
         consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)
         consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
         consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
-        consensus.nPowTargetSpacingV1 = 30; // target time for block spacing across all algorithms
-        consensus.nPowTargetSpacingV2 = 60; // new target time for block spacing across all algorithms
         consensus.nPowTargetSpacing = consensus.nPowTargetSpacingV2; // Current value
-        consensus.nAveragingInterval = 10; // number of blocks to take the timespan of
         consensus.fPowAllowMinDifficultyBlocks = true;
-
-        consensus.nStartAuxPow = 150;
-        consensus.nAuxpowChainId = 0x005A;
-        consensus.fStrictChainId = false;
-
-        consensus.nBlockTimeWarpPreventStart1 = 1000; // block where time warp 1 prevention starts
-        consensus.nBlockTimeWarpPreventStart2 = 1005; // block where time warp 2 prevention starts
-        consensus.nBlockTimeWarpPreventStart3 = 1010; // block where time warp 3 prevention starts
-        consensus.Phase2Timespan_Start = 150; // block where 60 second target time kicks in
-        consensus.nBlockDiffAdjustV2 = 150; // block where difficulty adjust V2 starts
-
-        consensus.nMaxAdjustDown = 4; // 4% adjustment down
-        consensus.nMaxAdjustUpV1 = 2; // 2% adjustment up
-        consensus.nMaxAdjustUpV2 = 4; // 4% adjustment up
-
-        consensus.nBlockSequentialAlgoRuleStart1 = 200; // block where sequential algo rule starts
-        consensus.nBlockSequentialAlgoRuleStart2 = 250; // block where sequential algo rule starts
-        consensus.nBlockSequentialAlgoMaxCount1 = 6; // maximum sequential blocks of same algo
-        consensus.nBlockSequentialAlgoMaxCount2 = 3; // maximum sequential blocks of same algo
-        consensus.nBlockSequentialAlgoMaxCount3 = 6; // maximum sequential blocks of same algo
-
-        consensus.nBlockAlgoWorkWeightStart = 0; // block where algo work weighting starts
-        consensus.nBlockAlgoNormalisedWorkStart = 0; // block where algo combined weight starts
-        consensus.nBlockAlgoNormalisedWorkDecayStart1 = 0; // block where weight decay starts
-        consensus.nBlockAlgoNormalisedWorkDecayStart2 = 0; // block where weight decay starts
-        consensus.nGeoAvgWork_Start = 0;
-        consensus.nFork1MinBlock = 601; // minimum block height where fork 1 takes effect (algo switch, seq algo count change)
-
         consensus.fPowNoRetargeting = true;
         consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
         consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
@@ -404,9 +422,6 @@
         consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
         consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 0;
         consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 999999999999ULL;
-        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].bit = 2;
-        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nStartTime = 0;
-        consensus.vDeployments[Consensus::DEPLOYMENT_LEGBIT].nTimeout = 999999999999ULL;

         // The best chain should have at least this much work.
         consensus.nMinimumChainWork = uint256S("0x00");


Reviewed BAM to YAML conversion contribution (thank you Chase Miller).  Reorganized to fit BT code style & structure.

--- src/toolkit/bamtools_convert.cpp
+++ src/toolkit/bamtools_convert.cpp
@@ -3,7 +3,7 @@
 // Marth Lab, Department of Biology, Boston College
 // All rights reserved.
 // ---------------------------------------------------------------------------
-// Last modified: 23 September 2010
+// Last modified: 4 October 2010
 // ---------------------------------------------------------------------------
 // Converts between BAM and a number of other formats
 // ***************************************************************************
@@ -37,6 +37,7 @@
     static const string FORMAT_SAM      = "sam";
     static const string FORMAT_PILEUP   = "pileup";
     static const string FORMAT_WIGGLE   = "wig";
+    static const string FORMAT_YAML     = "yaml";

     // other constants
     static const unsigned int FASTA_LINE_MAX = 50;
@@ -131,6 +132,7 @@
         void PrintJson(const BamAlignment& a);
         void PrintSam(const BamAlignment& a);
         void PrintWiggle(const BamAlignment& a);
+	void PrintYaml(const BamAlignment& a);

         // special case - uses the PileupEngine
         bool RunPileupConversion(BamMultiReader* reader);
@@ -230,6 +232,7 @@
         else if ( m_settings->Format == FORMAT_JSON )     pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintJson;
         else if ( m_settings->Format == FORMAT_SAM )      pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintSam;
         else if ( m_settings->Format == FORMAT_WIGGLE )   pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintWiggle;
+        else if ( m_settings->Format == FORMAT_YAML )     pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintYaml;
         else {
             cerr << "Unrecognized format: " << m_settings->Format << endl;
             cerr << "Please see help|README (?) for details on supported formats " << endl;
@@ -628,6 +631,44 @@
     ;
 }

+// Print BamAlignment in YAML format
+void ConvertTool::ConvertToolPrivate::PrintYaml(const BamAlignment& a) {
+
+    // write alignment name
+    m_out << "---" << endl;
+    m_out << a.Name << ":" << endl;
+
+    // write alignment data
+    m_out << "   " << "AlndBases: "     <<  a.AlignedBases << endl;
+    m_out << "   " << "Qualities: "     <<  a.Qualities << endl;
+    m_out << "   " << "Name: "          <<  a.Name << endl;
+    m_out << "   " << "Length: "        <<  a.Length << endl;
+    m_out << "   " << "TagData: "       <<  a.TagData << endl;
+    m_out << "   " << "RefID: "         <<  a.RefID << endl;
+    m_out << "   " << "RefName: "       <<  m_references[a.RefID].RefName << endl;
+    m_out << "   " << "Position: "      <<  a.Position << endl;
+    m_out << "   " << "Bin: "           <<  a.Bin << endl;
+    m_out << "   " << "MapQuality: "    <<  a.MapQuality << endl;
+    m_out << "   " << "AlignmentFlag: " <<  a.AlignmentFlag << endl;
+    m_out << "   " << "MateRefID: "     <<  a.MateRefID << endl;
+    m_out << "   " << "MatePosition: "  <<  a.MatePosition << endl;
+    m_out << "   " << "InsertSize: "    <<  a.InsertSize << endl;
+
+    // write Cigar data
+    const vector<CigarOp>& cigarData = a.CigarData;
+    if ( !cigarData.empty() ) {
+	m_out << "   " <<  "Cigar: ";
+	vector<CigarOp>::const_iterator cigarBegin = cigarData.begin();
+	vector<CigarOp>::const_iterator cigarIter = cigarBegin;
+	vector<CigarOp>::const_iterator cigarEnd  = cigarData.end();
+	for ( ; cigarIter != cigarEnd; ++cigarIter ) {
+	    const CigarOp& op = (*cigarIter);
+	    m_out << op.Length << op.Type;
+	}
+	m_out << endl;
+    }
+}
+
 bool ConvertTool::ConvertToolPrivate::RunPileupConversion(BamMultiReader* reader) {

     // check for valid BamMultiReader


avoid accessing deleted user in another thread (linux)

--- src/context.cc
+++ src/context.cc
@@ -3100,9 +3100,12 @@
     if (quit_) {
         return noError;
     }
-    if (!user_) {
-        return noError;
-    }
+
+    Poco::Mutex::ScopedLock lock(user_m_);
+    if (!user_) {
+        return noError;
+    }
+
     std::vector<TimelineEvent> events;
     error err = db()->CreateCompressedTimelineBatchForUpload(
         user_->ID(),


fix uninitialized variable nMinerConfirmationWindow

fix uninitialized variable hard code the MinBIP9WarningHeight

fix uninitialized var hard code the MinBIP9WarningHeight instead

Former-commit-id: 964bf7137172b98144a7551f8cd0e729fba9ddc3

--- src/chainparams.cpp
+++ src/chainparams.cpp
@@ -108,7 +108,7 @@
         consensus.nGovernanceMinQuorum = 10;
         consensus.nGovernanceFilterElements = 20000;
         consensus.nMasternodeMinimumConfirmations = 15;
-        consensus.MinBIP9WarningHeight = consensus.nMinerConfirmationWindow;
+
         consensus.BIP16Height = 1;
         consensus.BIP34Height = 1;
         consensus.BIP34Hash = uint256();
@@ -123,6 +123,7 @@
         consensus.fPowNoRetargeting = false;
         consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
         consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
+        consensus.MinBIP9WarningHeight = consensus.nMinerConfirmationWindow;
         consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
         consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
         consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
@@ -232,7 +233,6 @@
         consensus.BIP34Hash = uint256();
         consensus.BIP65Height = 1;
         consensus.BIP66Height = 1;
-        consensus.MinBIP9WarningHeight = consensus.nMinerConfirmationWindow;
         consensus.CSVHeight = 1;
         consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20
         consensus.nPowTargetTimespan = 6 * 60 * 60; // 6h retarget
@@ -241,6 +241,7 @@
         consensus.fPowNoRetargeting = false;
         consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
         consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
+        consensus.MinBIP9WarningHeight = consensus.nMinerConfirmationWindow;
         consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
         consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0; // January 1, 2008
         consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 999999999999ULL; // December 31, 2008
@@ -346,7 +347,7 @@
         consensus.nGovernanceMinQuorum = 1;
         consensus.nGovernanceFilterElements = 100;
         consensus.nMasternodeMinimumConfirmations = 1;
-        consensus.MinBIP9WarningHeight = 0;
+
         consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
         consensus.nPowTargetTimespan = 6 * 60 * 60; // Syscoin: 6 hour
         consensus.nPowTargetSpacing = 1 * 60; // Syscoin: 1 minute
@@ -354,6 +355,7 @@
         consensus.fPowNoRetargeting = true;
         consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
         consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
+        consensus.MinBIP9WarningHeight = consensus.nMinerConfirmationWindow;
         consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
         consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
         consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;


Fixes bug in MainMenu that if there are no browsers around when timer
fires we get a crash.

BUG=none
TEST=none
TBR=oshima

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

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

--- chrome/browser/chromeos/main_menu.cc
+++ chrome/browser/chromeos/main_menu.cc
@@ -289,6 +289,9 @@
 // LoadTask -------------------------------------------------------------------

 void MainMenu::LoadTask::Run() {
+  if (BrowserList::begin() == BrowserList::end())
+    return;  // No browser are around. Generally only happens during testing.
+
   MainMenu::Get();
 }


Fully update mainnet checkpoints.

Fully update mainnet checkpoints.


New checkpoints.

New checkpoints.


second prefix Q added for testnet script addresses

--- src/chainparams.cpp
+++ src/chainparams.cpp
@@ -224,6 +224,7 @@

         base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
         base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
+        base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,58);
         base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,239);
         base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >();
         base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >();
@@ -313,6 +314,7 @@

         base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
         base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
+        base58Prefixes[SCRIPT_ADDRESS2] = std::vector<unsigned char>(1,58);
         base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,239);
         base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >();
         base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >();


work with all kinds of payloads

work with all kinds of payloads

svn path=/trunk/KDE/kdepim/; revision=680670

--- akonadi/libakonadi/tests/itemdumper.cpp
+++ akonadi/libakonadi/tests/itemdumper.cpp
@@ -26,6 +26,7 @@
 #include <kcmdlineargs.h>

 #include <libakonadi/collectionpathresolver.h>
+#include <libakonadi/itemserializer.h>

 using namespace Akonadi;

@@ -41,7 +42,7 @@
   f.close();
   Item item;
   item.setMimeType( mimetype );
-  item.setPayload( data );
+  ItemSerializer::deserialize( item, Item::PartBody, data );
   ItemAppendJob *job = new ItemAppendJob( item, collection, this );
   connect( job, SIGNAL(result(KJob*)), SLOT(done(KJob*)) );
   job->start();


[checkpoints] minor: 24076 checkpoint added.


Added checkpoints.

Added checkpoints.


Walls are rendered before explosions

Walls are rendered before explosions

--- src/client/main.cpp
+++ src/client/main.cpp
@@ -881,14 +881,6 @@

       //_background->Render(_GetTime());

-      std::map<int,Object*>::iterator it;
-      for(it = _walls.begin() ; it != _walls.end(); ++it) {
-        it->second->Render(_GetTime());
-      }
-      for(it = _objects.begin() ; it != _objects.end(); ++it) {
-        it->second->Render(_GetTime());
-      }
-
       std::list<Animation*>::iterator it2;
       for(it2 = _animations.begin(); it2 != _animations.end();) {
         (*it2)->Render();
@@ -901,6 +893,14 @@
         } else {
           ++it2;
         }
+      }
+
+      std::map<int,Object*>::iterator it;
+      for(it = _walls.begin() ; it != _walls.end(); ++it) {
+        it->second->Render(_GetTime());
+      }
+      for(it = _objects.begin() ; it != _objects.end(); ++it) {
+        it->second->Render(_GetTime());
       }

       _player->Render(_GetTime());


Glyph ghost points.

Glyph ghost points.

--- graphics/vtkGlyph3D.cxx
+++ graphics/vtkGlyph3D.cxx
@@ -91,6 +91,7 @@
   vtkPointData *pd;
   vtkScalars *inScalars;
   vtkVectors *inVectors;
+  int requestedGhostLevel;
   vtkGhostLevels *inGhostLevels;
   vtkNormals *inNormals, *sourceNormals;
   vtkDataArray *newScalarsData, *inScalarsData;
@@ -113,7 +114,7 @@
   vtkPointData *outputPD = output->GetPointData();
   vtkDataSet *input = this->GetInput();
   int numberOfSources = this->GetNumberOfSources();
-
+
   vtkDebugMacro(<<"Generating glyphs");

   pts = vtkIdList::New();
@@ -129,7 +130,9 @@
   inVectors = pd->GetVectors();
   inNormals = pd->GetNormals();
   inGhostLevels = pd->GetGhostLevels();
-
+  requestedGhostLevel = output->GetUpdateGhostLevel();
+
+
   numPts = input->GetNumberOfPoints();
   if (numPts < 1)
     {
@@ -352,7 +355,15 @@
       }

     // Check ghost points.
-    if (inGhostLevels && inGhostLevels->GetGhostLevel(inPtId) > 0)
+    // If we are processing a piece, we do not want to duplicate
+    // glyphs on the borders.  The corrct check here is:
+    // ghostLevel > 0.  I am leaving this over glyphing here because
+    // it make a nice example (sphereGhost.tcl) to show the
+    // point ghost levels with the glyph filter.  I am not certain
+    // of the usefullness of point ghost levels over 1, but I will have
+    // to think about it.
+    if (inGhostLevels &&
+	inGhostLevels->GetGhostLevel(inPtId) > requestedGhostLevel)
       {
       continue;
       }


Add program name. Init globals (executor).

--- src/client/main.cpp
+++ src/client/main.cpp
@@ -66,6 +66,12 @@

 int main(int argc, char *argv[])
 {
+    // globals init
+    Executor e;
+    getExecutor(&e);
+
+    //
+
     Strings args;
     for (auto i = 0; i < argc; i++)
         args.push_back(argv[i]);
@@ -1065,3 +1071,13 @@

     return ApiResult::NotHandled;
 }
+
+#ifdef _WIN32
+__declspec(dllexport)
+#else
+__attribute__((visibility("default")))
+#endif
+String getProgramName()
+{
+    return "cppan";
+}


Fix for ChromeFrame TypeUrl test failures on the IE9 builder. The Address bar accessibility
object name had changed a bit in the IE9 update. Updated the text expectations to account for
this.

BUG=none
TEST=Existing ChromeFrame TypeUrl tests.
TBR=amit

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

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

--- chrome_frame/test/navigation_test.cc
+++ chrome_frame/test/navigation_test.cc
@@ -45,7 +45,7 @@
 TEST_P(FullTabNavigationTest, TypeUrl) {
   MockAccEventObserver acc_observer;
   EXPECT_CALL(acc_observer, OnAccDocLoad(_)).Times(testing::AnyNumber());
-  AccObjectMatcher address_matcher(L"Address", L"editable text");
+  AccObjectMatcher address_matcher(L"Address*", L"editable text");
   AccObjectMatcher go_matcher(L"Go*", L"push button");

   ie_mock_.ExpectNavigation(IN_IE, GetSimplePageUrl());
@@ -72,7 +72,7 @@
 TEST_P(FullTabNavigationTest, TypeAnchorUrl) {
   MockAccEventObserver acc_observer;
   EXPECT_CALL(acc_observer, OnAccDocLoad(_)).Times(testing::AnyNumber());
-  AccObjectMatcher address_matcher(L"Address", L"editable text");
+  AccObjectMatcher address_matcher(L"Address*", L"editable text");
   AccObjectMatcher go_matcher(L"Go*", L"push button");

   ie_mock_.ExpectNavigation(IN_IE, GetSimplePageUrl());


Attempt to fix the flakiness with the newly added CF_DownloadFileFromPost chrome frame
test.

TBR=stoyan

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

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

--- chrome_frame/test/navigation_test.cc
+++ chrome_frame/test/navigation_test.cc
@@ -795,7 +795,8 @@
   EXPECT_CALL(ie_mock_, OnNavigateComplete2(_,
                               testing::Field(&VARIANT::bstrVal,
                               StrEq(src_url))));
-  EXPECT_CALL(ie_mock_, OnLoad(true, StrEq(src_url)));
+  EXPECT_CALL(ie_mock_, OnLoad(true, StrEq(src_url)))
+      .Times(testing::AnyNumber());

   EXPECT_CALL(ie_mock_, OnLoadError(StrEq(tgt_url)))
       .Times(testing::AnyNumber());


updated error message.

updated error message.

--- src/core/Config.cpp
+++ src/core/Config.cpp
@@ -1127,9 +1127,9 @@
         catch( const std::exception & e)
         {
             std::ostringstream os;
-            os << "Error: OCIO profile '";
-            if(filename) os << ", " << filename << "', ";
-            os << "load failed: " << e.what();
+            os << "Error: Loading the OCIO profile ";
+            if(filename) os << "'" << filename << "' ";
+            os << "failed. " << e.what();
             throw Exception(os.str().c_str());
         }
     }


Changed eps checking condition

Changed eps checking condition

--- modules/ml/src/ann_mlp.cpp
+++ modules/ml/src/ann_mlp.cpp
@@ -971,7 +971,7 @@
         int count = inputs.rows;

         int iter = -1, max_iter = termCrit.maxCount*count;
-        double epsilon = termCrit.epsilon*count;
+        double epsilon = (termCrit.type & CV_TERMCRIT_EPS) ? termCrit.epsilon*count : 0;

         int l_count = layer_count();
         int ivcount = layer_sizes[0];


Revert "修正一个错误"

Revert "修正一个错误"

This reverts commit eaff2a321fd17a7ab86e1b9a23c4f4da4bfe740c.

--- src/dbg_request.cpp
+++ src/dbg_request.cpp
@@ -178,7 +178,7 @@
 					const char *src = entry.source;
 					if (memcmp(src, "=[C]", 4) == 0)
 					{
-						//if (curFrame != 0)
+						if (curFrame != 0)
 						{
 							if (curFrame >= startFrame && curFrame < endFrame) {
 								intptr_t reference = ensure_value_fits_in_mantissa((intptr_t)src);
@@ -187,8 +187,10 @@
 									for (auto _ : res("source").Object())
 									{
 										res("name").String("<C function>");
+										res("sourceReference").Int64(reference);
 										res("presentationHint").String("deemphasize");
 									}
+									res("id").Int(depth);
 									res("column").Int(1);
 									res("name").String(entry.name ? entry.name : "?");
 									res("line").Int(entry.currentline);


Flush batch on finish.

Flush batch on finish.

--- src/dump_reader.cpp
+++ src/dump_reader.cpp
@@ -169,6 +169,11 @@
   }

   ~pimpl() {
+    if (m_batch_size > 0) {
+      m_db->Write(m_write_options, &m_batch);
+      m_batch.Clear();
+      m_batch_size = 0;
+    }
     m_db->CompactRange(NULL, NULL);
     delete m_db;
   }


don't merge duppicated fragment of SessionConfirmed

--- libi2pd/SSU2Session.cpp
+++ libi2pd/SSU2Session.cpp
@@ -872,6 +872,7 @@
 					memmove (m_SessionConfirmedFragment->payload + (len - 16), m_SessionConfirmedFragment->payload, m_SessionConfirmedFragment->payloadSize);
 					memcpy (m_SessionConfirmedFragment->payload, buf + 16, len - 16);
 					m_SessionConfirmedFragment->payloadSize += (len - 16);
+					m_SessionConfirmedFragment->isSecondFragment = false;
 					buf = m_SessionConfirmedFragment->payload - 16;
 					len = m_SessionConfirmedFragment->payloadSize + 16;
 				}
@@ -891,8 +892,11 @@
 					return true;
 				}
 				header = m_SessionConfirmedFragment->header;
-				memcpy (m_SessionConfirmedFragment->payload + m_SessionConfirmedFragment->payloadSize, buf + 16, len - 16);
-				m_SessionConfirmedFragment->payloadSize += (len - 16);
+				if (m_SessionConfirmedFragment->payloadSize + (len - 16) <= SSU2_MAX_PACKET_SIZE*2)
+				{
+					memcpy (m_SessionConfirmedFragment->payload + m_SessionConfirmedFragment->payloadSize, buf + 16, len - 16);
+					m_SessionConfirmedFragment->payloadSize += (len - 16);
+				}
 				buf = m_SessionConfirmedFragment->payload - 16;
 				len = m_SessionConfirmedFragment->payloadSize + 16;
 			}


Encapsulate https server creation a bit more in preparation for getting the
cert paths from SSLTestUtil in net/base/ssl_test_util.h

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

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

Former-commit-id: 64589fb1474bc0908d75185e736908f536f98ce6

--- chrome/browser/ssl_uitest.cc
+++ chrome/browser/ssl_uitest.cc
@@ -67,6 +67,15 @@
     std::wstring path(cert_dir_);
     file_util::AppendToPath(&path, L"expired_cert.pem");
     return path;
+  }
+
+  HTTPSTestServer GoodServer() {
+    return HTTPSTestServer(kHostName, kOKHTTPSPort, kDocRoot, GetOKCertPath());
+  }
+
+  HTTPSTestServer BadServer() {
+    return HTTPSTestServer(kHostName, kBadHTTPSPort, kDocRoot,
+                           GetExpiredCertPath());
   }

  private:
@@ -144,8 +153,7 @@

 // Visits a page over OK https:
 TEST_F(SSLUITest, TestOKHTTPS) {
-  HTTPSTestServer https_server(kHostName, kOKHTTPSPort,
-                               kDocRoot, GetOKCertPath());
+  HTTPSTestServer https_server = GoodServer();
   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   NavigateTab(tab.get(),
               https_server.TestServerPageW(L"files/ssl/google.html"));
@@ -166,8 +174,7 @@

 // Visits a page with https error:
 TEST_F(SSLUITest, TestHTTPSExpiredCert) {
-  HTTPSTestServer https_server(kHostName, kBadHTTPSPort,
-                               kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer https_server = BadServer();
   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   NavigateTab(tab.get(),
               https_server.TestServerPageW(L"files/ssl/google.html"));
@@ -203,8 +210,7 @@

 // Visits a page with mixed content.
 TEST_F(SSLUITest, TestMixedContents) {
-  HTTPSTestServer https_server(kHostName, kOKHTTPSPort,
-                               kDocRoot, GetOKCertPath());
+  HTTPSTestServer https_server = GoodServer();
   TestServer http_server(kDocRoot);

   // Load a page with mixed-content, the default behavior is to show the mixed
@@ -276,10 +282,8 @@
 // - frames content is replaced with warning
 // - images and scripts are filtered out entirely
 TEST_F(SSLUITest, TestUnsafeContents) {
-  HTTPSTestServer good_https_server(kHostName, kOKHTTPSPort,
-                                    kDocRoot, GetOKCertPath());
-  HTTPSTestServer bad_https_server(kHostName, kBadHTTPSPort,
-                                   kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer good_https_server = GoodServer();
+  HTTPSTestServer bad_https_server = BadServer();

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   NavigateTab(tab.get(),
@@ -328,8 +332,7 @@

 // Visits a page with mixed content loaded by JS (after the initial page load).
 TEST_F(SSLUITest, TestMixedContentsLoadedFromJS) {
-  HTTPSTestServer https_server(kHostName, kOKHTTPSPort,
-                               kDocRoot, GetOKCertPath());
+  HTTPSTestServer https_server = GoodServer();
   TestServer http_server(kDocRoot);

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
@@ -368,8 +371,7 @@
 // referencing that same image over http (hoping it is coming from the webcore
 // memory cache).
 TEST_F(SSLUITest, TestCachedMixedContents) {
-  HTTPSTestServer https_server(kHostName, kOKHTTPSPort,
-                               kDocRoot, GetOKCertPath());
+  HTTPSTestServer https_server = GoodServer();
   TestServer http_server(kDocRoot);

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
@@ -476,8 +478,7 @@

 // Test that navigating to a #ref does not change a bad security state.
 TEST_F(SSLUITest, TestRefNavigation) {
-  HTTPSTestServer https_server(kHostName, kBadHTTPSPort,
-                               kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer https_server = BadServer();
   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   NavigateTab(tab.get(),
               https_server.TestServerPageW(L"files/ssl/page_with_refs.html"));
@@ -521,8 +522,7 @@
 // Disabled because flaky (bug #2136).
 TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) {
   TestServer http_server(kDocRoot);
-  HTTPSTestServer bad_https_server(kHostName, kBadHTTPSPort,
-                                   kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer bad_https_server = BadServer();

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   NavigateTab(tab.get(),
@@ -546,10 +546,8 @@

 // Visit a page over bad https that is a redirect to a page with good https.
 TEST_F(SSLUITest, TestRedirectBadToGoodHTTPS) {
-  HTTPSTestServer good_https_server(kHostName, kOKHTTPSPort,
-                                    kDocRoot, GetOKCertPath());
-  HTTPSTestServer bad_https_server(kHostName, kBadHTTPSPort,
-                                   kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer good_https_server = GoodServer();
+  HTTPSTestServer bad_https_server = BadServer();

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   GURL url1 = bad_https_server.TestServerPageW(L"server-redirect?");
@@ -581,10 +579,8 @@

 // Visit a page over good https that is a redirect to a page with bad https.
 TEST_F(SSLUITest, TestRedirectGoodToBadHTTPS) {
-  HTTPSTestServer good_https_server(kHostName, kOKHTTPSPort,
-                                    kDocRoot, GetOKCertPath());
-  HTTPSTestServer bad_https_server(kHostName, kBadHTTPSPort,
-                                   kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer good_https_server = GoodServer();
+  HTTPSTestServer bad_https_server = BadServer();

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   GURL url1 = good_https_server.TestServerPageW(L"server-redirect?");
@@ -612,10 +608,8 @@
 // bad).
 TEST_F(SSLUITest, TestRedirectHTTPToHTTPS) {
   TestServer http_server(kDocRoot);
-  HTTPSTestServer good_https_server(kHostName, kOKHTTPSPort,
-                                    kDocRoot, GetOKCertPath());
-  HTTPSTestServer bad_https_server(kHostName, kBadHTTPSPort,
-                                   kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer good_https_server = GoodServer();
+  HTTPSTestServer bad_https_server = BadServer();

   // HTTP redirects to good HTTPS.
   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
@@ -657,8 +651,7 @@
 // we don't keep the secure state).
 TEST_F(SSLUITest, TestRedirectHTTPSToHTTP) {
   TestServer http_server(kDocRoot);
-  HTTPSTestServer https_server(kHostName, kOKHTTPSPort,
-                               kDocRoot, GetOKCertPath());
+  HTTPSTestServer https_server = GoodServer();

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   GURL https_url = https_server.TestServerPageW(L"server-redirect?");
@@ -714,10 +707,8 @@
 // - navigate to HTTP (expect mixed content), then back
 TEST_F(SSLUITest, TestGoodFrameNavigation) {
   TestServer http_server(kDocRoot);
-  HTTPSTestServer good_https_server(kHostName, kOKHTTPSPort,
-                                    kDocRoot, GetOKCertPath());
-  HTTPSTestServer bad_https_server(kHostName, kBadHTTPSPort,
-                                   kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer good_https_server = GoodServer();
+  HTTPSTestServer bad_https_server = BadServer();

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   NavigateTab(tab.get(),
@@ -811,10 +802,8 @@
 // From a bad HTTPS top frame:
 // - navigate to an OK HTTPS frame (expected to be still authentication broken).
 TEST_F(SSLUITest, TestBadFrameNavigation) {
-  HTTPSTestServer good_https_server(kHostName, kOKHTTPSPort,
-                                    kDocRoot, GetOKCertPath());
-  HTTPSTestServer bad_https_server(kHostName, kBadHTTPSPort,
-                                   kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer good_https_server = GoodServer();
+  HTTPSTestServer bad_https_server = BadServer();

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   NavigateTab(tab.get(),
@@ -856,10 +845,8 @@
 // stay unauthenticated).
 TEST_F(SSLUITest, TestUnauthenticatedFrameNavigation) {
   TestServer http_server(kDocRoot);
-  HTTPSTestServer good_https_server(kHostName, kOKHTTPSPort,
-                                    kDocRoot, GetOKCertPath());
-  HTTPSTestServer bad_https_server(kHostName, kBadHTTPSPort,
-                                   kDocRoot, GetExpiredCertPath());
+  HTTPSTestServer good_https_server = GoodServer();
+  HTTPSTestServer bad_https_server = BadServer();

   scoped_ptr<TabProxy> tab(GetActiveTabProxy());
   NavigateTab(tab.get(),


minor.

minor.

svn path=/branches/KDE/3.5/kdepim/; revision=614016

--- libkcal/filestorage.cpp
+++ libkcal/filestorage.cpp
@@ -108,7 +108,7 @@
           return false;
         }
       } else {
-        kdDebug(5800) << "Warning! There should be set an exception." << endl;
+        kdDebug(5800) << "Warning! There should be an exception set." << endl;
         return false;
       }
     } else {
@@ -136,7 +136,7 @@
     calendar()->setModified( false );
   } else {
     if ( !format->exception() ) {
-      kdDebug(5800) << "FileStorage::save(): Error. There should be set an exception."
+      kdDebug(5800) << "FileStorage::save(): Error. There should be an exception set."
                 << endl;
     } else {
       kdDebug(5800) << "FileStorage::save(): " << format->exception()->message()


Use HelpApp in guest mode

Use HelpApp in guest mode

BUG=chromium-os:6923
TEST=manual

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

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

--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -142,8 +142,6 @@
 #if defined(OS_CHROMEOS)
 const char kHelpContentUrl[] =
     "chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html";
-const char kHelpContentOnlineUrl[] =
-    "http://www.google.com/support/chromeos/";
 #else
 const char kHelpContentUrl[] =
     "http://www.google.com/support/chrome/";
@@ -1868,11 +1866,6 @@

 void Browser::OpenHelpTab() {
   GURL help_url(kHelpContentUrl);
-#if defined(OS_CHROMEOS)
-  // TODO(nkostylev): Always redirect to HelpApp http://crosbug.com/6923
-  if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession))
-    help_url = GURL(kHelpContentOnlineUrl);
-#endif
   GURL localized_help_url = google_util::AppendGoogleLocaleParam(help_url);
   AddSelectedTabWithURL(localized_help_url, PageTransition::AUTO_BOOKMARK);
 }


From Colin McDonald, fix for Solaris build.

--- src/osgPlugins/osg/ReaderWriterOSG2.cpp
+++ src/osgPlugins/osg/ReaderWriterOSG2.cpp
@@ -16,6 +16,7 @@
 #include <osgDB/FileUtils>
 #include <osgDB/Registry>
 #include <osgDB/ObjectWrapper>
+#include <stdlib.h>
 #include "AsciiStreamOperator.h"
 #include "BinaryStreamOperator.h"
 #include "XmlStreamOperator.h"


cleanup logging

cleanup logging

--- src/daemon.cpp
+++ src/daemon.cpp
@@ -233,8 +233,8 @@
   CaptureThreadData* tdata = (CaptureThreadData*) arg;

   LOG4CPLUS_INFO(logger, "country: " << tdata->country_code << " -- config file: " << tdata->config_file );
+  LOG4CPLUS_INFO(logger, "pattern: " << tdata->pattern);
   LOG4CPLUS_INFO(logger, "Stream " << tdata->camera_id << ": " << tdata->stream_url);
-  LOG4CPLUS_INFO(logger, "Region " << tdata->pattern);

   Alpr alpr(tdata->country_code, tdata->config_file);
   alpr.setTopN(tdata->top_n);


fix func (type)

fix func (type)

--- liteidex/src/plugins/golangedit/golanghighlighter.cpp
+++ liteidex/src/plugins/golangedit/golanghighlighter.cpp
@@ -230,11 +230,11 @@
             } else if (tk.is(T_GO_FUNC)) {
                 int size = tokens.size()-1;
                 int n = i+1;
-                if (n < size) {
+                if ((i == 0) && (n < size)) {
                     if (tokens[n].is(T_LPAREN)) {
-                        while(++n < size) {
-                            if (tokens[n+1].is(T_RPAREN)) {
-                                setFormat(tokens[n].begin(), tokens[n].length(), m_creatorFormats[SyntaxHighlighter::DataType]);
+                        while(n++ < size) {
+                            if (tokens[n].is(T_RPAREN)) {
+                                setFormat(tokens[n-1].begin(), tokens[n-1].length(), m_creatorFormats[SyntaxHighlighter::DataType]);
                                 break;
                             }
                         }


Reduce a scope a bit

Reduce a scope a bit

--- src/lib/CDRTransforms.cpp
+++ src/lib/CDRTransforms.cpp
@@ -75,14 +75,11 @@
     return;
   }

-  double c = cos(rotation);
-  double s = sin(rotation);
-
   // rx > 0, ry = 0
   if (CDR_ALMOST_ZERO(ry))
   {
-    double x = m_v0*c + m_v1*s;
-    double y = m_v3*c + m_v4*s;
+    double x = m_v0*cos(rotation) + m_v1*sin(rotation);
+    double y = m_v3*cos(rotation) + m_v4*sin(rotation);
     rx *= sqrt(x*x + y*y);
     if (CDR_ALMOST_ZERO(rx))
     {
@@ -96,8 +93,8 @@
   // rx = 0, ry > 0
   if (CDR_ALMOST_ZERO(rx))
   {
-    double x = -m_v0*s + m_v1*c;
-    double y = -m_v3*s + m_v4*c;
+    double x = -m_v0*sin(rotation) + m_v1*cos(rotation);
+    double y = -m_v3*sin(rotation) + m_v4*cos(rotation);
     ry *= sqrt(x*x + y*y);
     if (CDR_ALMOST_ZERO(ry))
     {
@@ -111,10 +108,10 @@
   double v0, v1, v2, v3;
   if (!CDR_ALMOST_ZERO(determinant))
   {
-    v0 = ry*(m_v4*c - m_v3*s);
-    v1 = ry*(m_v0*s - m_v1*c);
-    v2 = -rx*(m_v4*s + m_v3*c);
-    v3 = rx*(m_v1*s + m_v0*c);
+    v0 = ry*(m_v4*cos(rotation)- m_v3*sin(rotation));
+    v1 = ry*(m_v0*sin(rotation)- m_v1*cos(rotation));
+    v2 = -rx*(m_v4*sin(rotation) + m_v3*cos(rotation));
+    v3 = rx*(m_v1*sin(rotation) + m_v0*cos(rotation));

     // Transformed ellipse
     double A = v0*v0 + v2*v2;
@@ -127,8 +124,8 @@
     else
     {
       rotation = atan2(B, A-C) / 2.0;
-      c = cos(rotation);
-      s = sin(rotation);
+      double c = cos(rotation);
+      double s = sin(rotation);
       double cc = c*c;
       double ss = s*s;
       double sc = B*s*c;
@@ -150,10 +147,10 @@
   }

   // Special case of a close to singular transformation
-  v0 = ry*(m_v4*c - m_v3*s);
-  v1 = ry*(m_v1*c - m_v0*s);
-  v2 = rx*(m_v3*c + m_v4*s);
-  v3 = rx*(m_v0*c + m_v1*s);
+  v0 = ry*(m_v4*cos(rotation) - m_v3*sin(rotation));
+  v1 = ry*(m_v1*cos(rotation) - m_v0*sin(rotation));
+  v2 = rx*(m_v3*cos(rotation) + m_v4*sin(rotation));
+  v3 = rx*(m_v0*cos(rotation) + m_v1*sin(rotation));

   // The result of transformation is a point
   if (CDR_ALMOST_ZERO(v3*v3 + v1*v1) && CDR_ALMOST_ZERO(v2*v2 + v0*v0))


Change to InitStackFrame to use a handle.  Handle thread exit correctly.

git-svn-id: 98787b36aaefbae4b30fa755be920954cd25e1e4@72 ae7d391e-3f74-4a2b-a0db-a8776840fd2a

--- libpolyml/interpret.cpp
+++ libpolyml/interpret.cpp
@@ -104,7 +104,7 @@
 public:
     Interpreter(): allocSpace(0) {}

-    virtual void InitStackFrame(StackObject *stack, Handle proc, Handle arg);
+    virtual void InitStackFrame(Handle stack, Handle proc, Handle arg);
     // Switch to Poly and return with the io function to call.
     virtual int SwitchToPoly(void);
     virtual void SetForRetry(int ioCall) {} // Nothing to do
@@ -151,9 +151,10 @@
     ASSERT(allocSpace != 0);
 }

-void Interpreter::InitStackFrame(StackObject *stack, Handle proc, Handle arg)
+void Interpreter::InitStackFrame(Handle stackh, Handle proc, Handle arg)
 /* Initialise stack frame. */
 {
+    StackObject *stack = (StackObject *)DEREFWORDHANDLE(stackh);
     PolyObject *closure = DEREFWORDHANDLE(proc);
     POLYUNSIGNED stack_size = stack->Length();
     stack->p_space = OVERFLOW_STACK_SIZE;
@@ -662,7 +663,18 @@
                 pc = (*sp++).AsCodePtr(); /* Return address */
                 sp += returnCount; /* Add on number of args. */
                 if (pc == TAGGED(0).AsCodePtr())
-                    kill_selfc(); /* Exit */
+                {
+                    try
+                    {
+                        kill_selfc(); // This thread is exiting.
+                        // kill_selfc throws an exception because it can't
+                        // return normally - the thread is no longer there.
+                    }
+                    catch (IOException)
+                    {
+                    }
+                    goto RESTART;
+                }
                 else if (pc == TAGGED(1).AsCodePtr())
                 {
                     /* Return from a call to exception_trace when an exception


Fix omnibox update bug.

Fix omnibox update bug.

When tab-switching happens, the state of the tab is stored so that it can be restored later. However, when a background tab is being closed, it doesn't cause a tab-switch, and trying to save the state causes problems in some cases (e.g. 61588). So do not save state of a background tab.

BUG=61588
TEST=see bug

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

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

--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -4009,8 +4009,12 @@
 void Browser::TabDetachedAtImpl(TabContents* contents, int index,
                                 DetachType type) {
   if (type == DETACH_TYPE_DETACH) {
-    // Save what the user's currently typed.
-    window_->GetLocationBar()->SaveStateToContents(contents);
+    // Save the current location bar state, but only if the tab being detached
+    // is the selected tab.  Because saving state can conditionally revert the
+    // location bar, saving the current tab's location bar state to a
+    // non-selected tab can corrupt both tabs.
+    if (contents == GetSelectedTabContents())
+      window_->GetLocationBar()->SaveStateToContents(contents);

     if (!tab_handler_->GetTabStripModel()->closing_all())
       SyncHistoryWithTabs(0);


Include count where it is not possible to identify the function in the total.

git-svn-id: 98787b36aaefbae4b30fa755be920954cd25e1e4@391 ae7d391e-3f74-4a2b-a0db-a8776840fd2a

--- libpolyml/profiling.cpp
+++ libpolyml/profiling.cpp
@@ -399,6 +399,7 @@

     if (unknown_count)
     {
+        total_count += unknown_count;
         P.total += unknown_count;
         pEnt = newProfileEntry();
         strcpy(psUnknown.chars, "UNKNOWN");


Fix share-common-data.  Code that is only reachable by a relative call or jump was not scanned for values that could be shared.  While the code itself is not shared it could refer to values that can be via its constant area.

--- libpolyml/sharedata.cpp
+++ libpolyml/sharedata.cpp
@@ -659,6 +659,8 @@
         { (void)AddPolyWordToDepthVectors(*pt); return 0; }
     virtual PolyObject *ScanObjectAddress(PolyObject *base)
         { (void)AddObjectToDepthVector(base); return base; }
+    virtual POLYUNSIGNED ScanCodeAddressAt(PolyObject** pt)
+        { *pt = ScanObjectAddress(*pt); return 0; }

     void ProcessRoot(PolyObject *root);


Wire slave receiver with repeated starts working

--- libraries/Wire/Wire.cpp
+++ libraries/Wire/Wire.cpp
@@ -219,13 +219,26 @@
 {
   if ( sercom->isSlaveWIRE() )
   {
-    if(sercom->isAddressMatch())  //Address Match
+    if(sercom->isStopDetectedWIRE() ||
+        (sercom->isAddressMatch() && sercom->isRestartDetectedWIRE())) //Stop or Restart detected
     {
       sercom->prepareAckBitWIRE();
       sercom->prepareCommandBitsWire(0x03);

-      //Is a request ?
-      if(sercom->isMasterReadOperationWIRE())
+      //Calling onReceiveCallback, if exists
+      if(onReceiveCallback)
+      {
+        onReceiveCallback(available());
+      }
+
+      rxBuffer.clear();
+    }
+    else if(sercom->isAddressMatch())  //Address Match
+    {
+      sercom->prepareAckBitWIRE();
+      sercom->prepareCommandBitsWire(0x03);
+
+      if(sercom->isMasterReadOperationWIRE()) //Is a request ?
       {
         //Calling onRequestCallback, if exists
         if(onRequestCallback)
@@ -247,19 +260,6 @@

       sercom->prepareCommandBitsWire(0x03);
     }
-    else if(sercom->isStopDetectedWIRE() || sercom->isRestartDetectedWIRE()) //Stop or Restart detected
-    {
-      sercom->prepareAckBitWIRE();
-      sercom->prepareCommandBitsWire(0x03);
-
-      //Calling onReceiveCallback, if exists
-      if(onReceiveCallback)
-      {
-        onReceiveCallback(available());
-      }
-
-      rxBuffer.clear();
-    }
   }
 }


TEST: time probe for training shark RF

TEST: time probe for training shark RF

--- Modules/Learning/SharkLearning/test/otbSharkImageClassificationFilter.cxx
+++ Modules/Learning/SharkLearning/test/otbSharkImageClassificationFilter.cxx
@@ -84,7 +84,13 @@
   classifier->SetNodeSize(25);
   classifier->SetOobRatio(0.3);
   std::cout << "Training\n";
+  using TimeT = std::chrono::milliseconds;
+  auto start = std::chrono::system_clock::now();
   classifier->Train();
+  auto duration = std::chrono::duration_cast< TimeT>
+    (std::chrono::system_clock::now() - start);
+  auto elapsed = duration.count();
+  std::cout << "Training took " << elapsed << " ms\n";
   classifier->Save(modelfname);
 }


Cleaned up image scaling and filtering example by removing (commented out unneeded) SetSortModifier.

Change-Id: I8bed95f8669a9ee5891ab88262f5c559bc3432f1

--- examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
+++ examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
@@ -207,19 +207,16 @@
     mDesiredBox.SetParentOrigin( ParentOrigin::CENTER );
     mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER );
     mDesiredBox.SetPosition( 0, 0, -1 );
-    //mDesiredBox.SetSortModifier(4.f);

     mHeightBox.SetSize( stage.GetSize().width,  (stage.GetSize() * mImageStageScale).height );
     mHeightBox.SetParentOrigin( ParentOrigin::CENTER );
     mHeightBox.SetAnchorPoint( AnchorPoint::CENTER );
     mHeightBox.SetPosition( 0, 0, -1 );
-    //mHeightBox.SetSortModifier(3.f);

     mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height );
     mWidthBox.SetParentOrigin( ParentOrigin::CENTER );
     mWidthBox.SetAnchorPoint( AnchorPoint::CENTER );
     mWidthBox.SetPosition( 0, 0, -1 );
-    //mWidthBox.SetSortModifier(2.f);

     // Make a grab-handle for resizing the image:
     mGrabCorner = Toolkit::PushButton::New();


No need to reallocate the memory during tuning if the OpenCL error is -5.

--- src/DedispersionTuning.cpp
+++ src/DedispersionTuning.cpp
@@ -401,6 +401,9 @@
               delete kernel;
               if ( err.err() == -4 || err.err() == -61 ) {
                 return -1;
+              } else if ( err.err() == -5 ) {
+                // No need to reallocate the memory in this case
+                break;
               }
               reInit = true;
               break;


Only request VK_KHR_spirv_1_4 prior to Vulkan 1.2

The validation layers complain from 1.2 onwards.

Signed-off-by: Kévin Petit <7be082ac62c87f3fb90b426eef925ff08291362b@free.fr>

--- src/device.cpp
+++ src/device.cpp
@@ -242,7 +242,7 @@
             VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME);
     }

-    const std::vector<const char*> desired_extensions = {
+    std::vector<const char*> desired_extensions = {
         VK_KHR_8BIT_STORAGE_EXTENSION_NAME,
         VK_KHR_16BIT_STORAGE_EXTENSION_NAME,
         VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME,
@@ -252,8 +252,11 @@
         VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME,
         VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME,
         VK_EXT_PCI_BUS_INFO_EXTENSION_NAME,
-        VK_KHR_SPIRV_1_4_EXTENSION_NAME,
     };
+
+    if (m_properties.apiVersion < VK_MAKE_VERSION(1, 2, 0)) {
+        desired_extensions.push_back(VK_KHR_SPIRV_1_4_EXTENSION_NAME);
+    }

     for (size_t i = 0; i < numext; i++) {
         cvk_info("  %s, spec version %u", extensions[i].extensionName,


Remove print functions for meta_struct_print and just put them in main

--- meta_struct_20/cppcon_version/meta_struct_print_5.cpp
+++ meta_struct_20/cppcon_version/meta_struct_print_5.cpp
@@ -180,24 +180,6 @@
 #include <iostream>
 #include <string>

-template <typename MetaStruct>
-void print(std::ostream& os) {
-  meta_struct_apply<MetaStruct>([]<typename... M>(M * ...) {
-    std::cout << "The tags are: ";
-    ((std::cout << M::tag().sv() << " "), ...);
-    std::cout << "\n";
-  });
-}
-
-template <typename MetaStruct>
-void print(std::ostream& os, const MetaStruct& ms) {
-  meta_struct_apply(
-      [&](const auto&... m) {
-        ((std::cout << m.tag().sv() << ":" << m.value << "\n"), ...);
-      },
-      ms);
-};
-
 int main() {
   using Person = meta_struct<                                                //
       member<"id", int>,                                                     //
@@ -205,9 +187,17 @@
       member<"name", std::string, [] { return "John"; }>                     //
       >;

-  print<Person>(std::cout);
+   meta_struct_apply<Person>([]<typename... M>(M * ...) {
+    std::cout << "The tags are: ";
+    ((std::cout << M::tag().sv() << " "), ...);
+    std::cout << "\n";
+  });

   Person p;
-
-  print(std::cout, p);
-}
+  meta_struct_apply(
+      [&](const auto&... m) {
+        ((std::cout << m.tag().sv() << ":" << m.value << "\n"), ...);
+      },
+      p);
+
+}


fixed some mistypes

fixed some mistypes

--- 2013/software/src/actuators/motors/Executables/moveForward.cpp
+++ 2013/software/src/actuators/motors/Executables/moveForward.cpp
@@ -3,8 +3,9 @@

 int main()
 {
-  MotorEncoderDriver2013 drivertermina;
+  MotorEncoderDriver2013 driver;
   int millis = 50000;
   int speed=1.7;
   driver.setVelocities(speed, speed, millis);
 }
+


add weight to calculation

add weight to calculation

--- include/image_cloud/common/filter/pcl/depth_filter_radius.hpp
+++ include/image_cloud/common/filter/pcl/depth_filter_radius.hpp
@@ -36,6 +36,7 @@
 		std::vector<float> square_distance;

 		if ( in.points.at(i).z > distance_max) continue;
+		if ( in.points.at(i).z < 1 ) continue;

 		//Position in image is known
 		if( tree_n->radiusSearch(i, radius, k_indices, square_distance) < min_neigbors ) continue;
@@ -48,6 +49,7 @@
 		float max_y = min_y;
 		float min_z = in.points.at(i).z;
 		float max_z = min_z;
+		float avg_z =  in.points.at(i).z;

 		for(int n = 0; n < k_indices.size(); ++n){
 			// is current point an edge point?
@@ -75,9 +77,11 @@
 			{
 				min_z = in.points.at(k_indices.at((n))).z;
 			}
+			avg_z+= in.points.at(k_indices.at(n)).z;
 		}
+		avg_z = avg_z/(k_indices.size()+1);

-		float threshold = 0.05;
+		float threshold = 0.1;
 		if( (inRange(min_x, threshold, in.points.at(i).x)
 			|| inRange(max_x, threshold, in.points.at(i).x)
 			|| min_y == in.points.at(i).y
@@ -95,6 +99,7 @@
 //			|| max_z == in.points.at(i).z )
 //		{
 			out.push_back(in.points.at(i));
+			out.at(out.size()-1).intensity = (avg_z - min_z) * 0.5; // weight edge
 		}
 	}
 }


Windows: Added internal `get_handle_follow` which follows symlinks.

This is the opposite of `get_handle_no_follow`. They both use the
inappropriately named Windows API `CreateFile` to retrieve a `HANDLE` to
an existing file or directory. This existing `get_handle_no_follow`
explicitly gets a handle to the symlink itself, and the new
`get_handle_follow` explicitly resolves symlinks and gets a handle to
the target.

This may fail if the target doesn't exist.

Review: https://reviews.apache.org/r/63811

--- 3rdparty/stout/include/stout/internal/windows/reparsepoint.hpp
+++ 3rdparty/stout/include/stout/internal/windows/reparsepoint.hpp
@@ -52,7 +52,7 @@
 // well-worn path used by Boost FS[1], among others. See documentation
 // here[2][3].
 //
-// [1] http://www.boost.org/doc/libs/1_46_1/libs/filesystem/v3/src/operations.cpp
+// [1] http://www.boost.org/doc/libs/1_46_1/libs/filesystem/v3/src/operations.cpp // NOLINT(whitespace/line_length)
 // [2] https://msdn.microsoft.com/en-us/library/cc232007.aspx
 // [3] https://msdn.microsoft.com/en-us/library/cc232005.aspx
 typedef struct _REPARSE_DATA_BUFFER
@@ -88,7 +88,7 @@
     // offset and length of each in this struct to calculate where each starts
     // and ends.
     //
-    // https://msdn.microsoft.com/en-us/library/windows/hardware/ff552012(v=vs.85).aspx
+    // https://msdn.microsoft.com/en-us/library/windows/hardware/ff552012(v=vs.85).aspx // NOLINT(whitespace/line_length)
     WCHAR PathBuffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
   } SymbolicLinkReparseBuffer;
 } REPARSE_DATA_BUFFER;
@@ -149,13 +149,12 @@
 }

-// Attempts to get a file or folder handle for an absolute path, and does not
-// follow symlinks. That is, if the path points at a symlink, the handle will
-// refer to the symlink rather than the file or folder the symlink points at.
-inline Try<SharedHandle> get_handle_no_follow(const std::string& absolute_path)
-{
-  const Try<DWORD> attributes = ::internal::windows::get_file_attributes(
-      ::internal::windows::longpath(absolute_path));
+// Attempts to get a file or folder handle for an absolute path, and follows
+// symlinks. That is, if the path points at a symlink, the handle will refer to
+// the file or folder the symlink points at, rather than the symlink itself.
+inline Try<SharedHandle> get_handle_follow(const std::string& absolute_path)
+{
+  const Try<DWORD> attributes = get_file_attributes(longpath(absolute_path));

   if (attributes.isError()) {
     return Error(attributes.error());
@@ -163,13 +162,15 @@

   bool resolved_path_is_directory = attributes.get() & FILE_ATTRIBUTE_DIRECTORY;

-  // NOTE: According to the `CreateFile` documentation[1], the `OPEN_EXISTING`
-  // and `FILE_FLAG_OPEN_REPARSE_POINT` flags need to be used when getting a
-  // handle for the symlink.
+  // NOTE: The name of `CreateFile` is misleading: it is also used to retrieve
+  // handles to existing files or directories as if it were actually `OpenPath`
+  // (which does not exist). We use `OPEN_EXISTING` but not
+  // `FILE_FLAG_OPEN_REPARSE_POINT` to explicitily follow (resolve) symlinks in
+  // the path to the file or directory.
   //
   // Note also that `CreateFile` will appropriately generate a handle for
   // either a folder or a file, as long as the appropriate flag is being set:
-  // `FILE_FLAG_BACKUP_SEMANTICS` or `FILE_FLAG_OPEN_REPARSE_POINT`.
+  // `FILE_FLAG_BACKUP_SEMANTICS`.
   //
   // The `FILE_FLAG_BACKUP_SEMANTICS` flag is being set whenever the target is
   // a directory. According to MSDN[1]: "You must set this flag to obtain a
@@ -182,8 +183,63 @@
   // processes to read the file at the same time. MSDN[1] provides a more
   // detailed explanation of these flags.
   //
-  // [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx
-  // [2] https://msdn.microsoft.com/en-us/library/windows/desktop/aa364399(v=vs.85).aspx
+  // [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx // NOLINT(whitespace/line_length)
+  // [2] https://msdn.microsoft.com/en-us/library/windows/desktop/aa364399(v=vs.85).aspx // NOLINT(whitespace/line_length)
+  const DWORD access_flags = resolved_path_is_directory
+    ? FILE_FLAG_BACKUP_SEMANTICS
+    : FILE_ATTRIBUTE_NORMAL;
+
+  const HANDLE handle = ::CreateFileW(
+      longpath(absolute_path).data(),
+      GENERIC_READ,     // Open the file for reading only.
+      FILE_SHARE_READ,  // Just reading this file, allow others to do the same.
+      nullptr,          // Ignored.
+      OPEN_EXISTING,    // Open existing file.
+      access_flags,     // Open file, not the symlink itself.
+      nullptr);         // Ignored.
+
+  if (handle == INVALID_HANDLE_VALUE) {
+    return WindowsError();
+  }
+
+  return SharedHandle(handle, ::CloseHandle);
+}
+
+
+// Attempts to get a file or folder handle for an absolute path, and does not
+// follow symlinks. That is, if the path points at a symlink, the handle will
+// refer to the symlink rather than the file or folder the symlink points at.
+inline Try<SharedHandle> get_handle_no_follow(const std::string& absolute_path)
+{
+  const Try<DWORD> attributes = get_file_attributes(longpath(absolute_path));
+
+  if (attributes.isError()) {
+    return Error(attributes.error());
+  }
+
+  bool resolved_path_is_directory = attributes.get() & FILE_ATTRIBUTE_DIRECTORY;
+
+  // NOTE: According to the `CreateFile` documentation[1], the `OPEN_EXISTING`
+  // and `FILE_FLAG_OPEN_REPARSE_POINT` flags need to be used when getting a
+  // handle for the symlink.
+  //
+  // Note also that `CreateFile` will appropriately generate a handle for
+  // either a folder or a file, as long as the appropriate flag is being set:
+  // `FILE_FLAG_BACKUP_SEMANTICS` or `FILE_FLAG_OPEN_REPARSE_POINT`.
+  //
+  // The `FILE_FLAG_BACKUP_SEMANTICS` flag is being set whenever the target is
+  // a directory. According to MSDN[1]: "You must set this flag to obtain a
+  // handle to a directory. A directory handle can be passed to some functions
+  // instead of a file handle". More `FILE_FLAG_BACKUP_SEMANTICS` documentation
+  // can be found in MSDN[2].
+  //
+  // The `GENERIC_READ` flag is being used because it's the most common way of
+  // opening a file for reading only. The `FILE_SHARE_READ` allows other
+  // processes to read the file at the same time. MSDN[1] provides a more
+  // detailed explanation of these flags.
+  //
+  // [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx // NOLINT(whitespace/line_length)
+  // [2] https://msdn.microsoft.com/en-us/library/windows/desktop/aa364399(v=vs.85).aspx // NOLINT(whitespace/line_length)
   const DWORD access_flags = resolved_path_is_directory
     ? (FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS)
     : FILE_FLAG_OPEN_REPARSE_POINT;
@@ -198,12 +254,10 @@
       nullptr);         // Ignored.

   if (handle == INVALID_HANDLE_VALUE) {
-    return WindowsError(
-        "'internal::windows::get_handle_no_follow': 'CreateFile' call failed "
-        "at path '" + absolute_path + "'");
-  }
-
-  return SharedHandle(handle, CloseHandle);
+    return WindowsError();
+  }
+
+  return SharedHandle(handle, ::CloseHandle);
 }

@@ -226,9 +280,9 @@
   // Finally, for context, it may be worth looking at the MSDN
   // documentation[3] for `DeviceIoControl` itself.
   //
-  // [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa364571(v=vs.85).aspx
+  // [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa364571(v=vs.85).aspx // NOLINT(whitespace/line_length)
   // [2] https://svn.boost.org/trac/boost/ticket/4663
-  // [3] https://msdn.microsoft.com/en-us/library/windows/desktop/aa363216(v=vs.85).aspx
+  // [3] https://msdn.microsoft.com/en-us/library/windows/desktop/aa363216(v=vs.85).aspx // NOLINT(whitespace/line_length)
   REPARSE_DATA_BUFFER buffer;
   DWORD ignored = 0;


move Values implementation code below of Parser to match definition order in header file

--- argparse.cc
+++ argparse.cc
@@ -60,82 +60,6 @@
     this->err() << "IndexError: " << errmsg;
   }

-
-  // ========================================================
-  // argparse::Values
-  //
-  const std::vector<argparse_internal::Var*>&
-    Values::get_var_arr(const VarMap& varmap, const std::string& key) {
-    auto it = varmap.find(key);
-    if (it == varmap.end()) {
-      throw argparse::exception::KeyError(key, "not found in options");
-    }
-
-    return *(it->second);
-  }
-
-  const argparse_internal::Var& Values::get_var(const VarMap& varmap,
-                                                const std::string& key,
-                                                size_t idx) {
-    auto arr = get_var_arr(varmap, key);
-    if (arr.size() <= idx) {
-      throw argparse::exception::IndexError(key);
-    }
-
-    return *(arr[idx]);
-  }
-
-
-  Values::Values(std::shared_ptr<VarMap> varmap) : varmap_(varmap) {
-  }
-
-  Values::Values(const Values& obj) : varmap_(obj.varmap_) {
-  }
-
-  Values::~Values() {
-  }
-
-  Values& Values::operator=(const Values &obj) {
-    this->varmap_ = obj.varmap_;
-    return *this;
-  }
-
-  const std::string& Values::operator[](const std::string& key) const {
-    return this->to_str(key, 0);
-  }
-
-  const std::string& Values::get(const std::string& key, size_t idx) const {
-    return this->to_str(key, idx);
-  }
-
-  const std::string& Values::to_str(const std::string& key, size_t idx) const {
-    const argparse_internal::Var& v = Values::get_var(*(this->varmap_.get()),
-                                                      key, idx);
-    return v.to_s();
-  }
-
-  int Values::to_int(const std::string& key, size_t idx) const {
-    const argparse_internal::Var& v = Values::get_var(*(this->varmap_.get()),
-                                                      key, idx);
-    return v.to_i();
-  }
-
-  size_t Values::size(const std::string &key) const {
-    auto arr = get_var_arr(*(this->varmap_.get()), key);
-    return arr.size();
-  }
-
-  bool Values::is_true(const std::string &key) const {
-    auto arr = get_var_arr(*(this->varmap_.get()), key);
-    assert(arr.size() == 1);
-    return arr[0]->is_true();
-  }
-
-  bool Values::is_set(const std::string& dest) const {
-    const VarMap& varmap = *(this->varmap_.get());
-    auto it = varmap.find(dest);
-    return (it != varmap.end());
-  }

   // ========================================================
@@ -409,7 +333,7 @@
     return *this;
   }

-  // ------------------------------------------------------------------
+  // ========================================================
   // argparse::Parser
   //
   Parser::Parser(const std::string &prog_name)
@@ -436,7 +360,85 @@

     return this->parse_args(args);
   }
+
+  // ========================================================
+  // argparse::Values
+  //
+  const std::vector<argparse_internal::Var*>&
+  Values::get_var_arr(const VarMap& varmap, const std::string& key) {
+    auto it = varmap.find(key);
+    if (it == varmap.end()) {
+      throw argparse::exception::KeyError(key, "not found in options");
+    }
+
+    return *(it->second);
+  }
+
+  const argparse_internal::Var& Values::get_var(const VarMap& varmap,
+                                                const std::string& key,
+                                                size_t idx) {
+    auto arr = get_var_arr(varmap, key);
+    if (arr.size() <= idx) {
+      throw argparse::exception::IndexError(key);
+    }
+
+    return *(arr[idx]);
+  }
+
+
+  Values::Values(std::shared_ptr<VarMap> varmap) : varmap_(varmap) {
+  }
+
+  Values::Values(const Values& obj) : varmap_(obj.varmap_) {
+  }
+
+  Values::~Values() {
+  }
+
+  Values& Values::operator=(const Values &obj) {
+    this->varmap_ = obj.varmap_;
+    return *this;
+  }
+
+  const std::string& Values::operator[](const std::string& key) const {
+    return this->to_str(key, 0);
+  }
+
+  const std::string& Values::get(const std::string& key, size_t idx) const {
+    return this->to_str(key, idx);
+  }
+
+  const std::string& Values::to_str(const std::string& key, size_t idx) const {
+    const argparse_internal::Var& v = Values::get_var(*(this->varmap_.get()),
+                                                      key, idx);
+    return v.to_s();
+  }
+
+  int Values::to_int(const std::string& key, size_t idx) const {
+    const argparse_internal::Var& v = Values::get_var(*(this->varmap_.get()),
+                                                      key, idx);
+    return v.to_i();
+  }
+
+  size_t Values::size(const std::string &key) const {
+    auto arr = get_var_arr(*(this->varmap_.get()), key);
+    return arr.size();
+  }
+
+  bool Values::is_true(const std::string &key) const {
+    auto arr = get_var_arr(*(this->varmap_.get()), key);
+    assert(arr.size() == 1);
+    return arr[0]->is_true();
+  }
+
+  bool Values::is_set(const std::string& dest) const {
+    const VarMap& varmap = *(this->varmap_.get());
+    auto it = varmap.find(dest);
+    return (it != varmap.end());
+  }
+
 }
+

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


Update GODictionaryRenderer.cpp

Update GODictionaryRenderer.cpp

Former-commit-id: 2f79040d308ea14551688501af73d3f9b699399b

--- ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/GODictionaryRenderer/GODictionaryRenderer.cpp
+++ ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/GODictionaryRenderer/GODictionaryRenderer.cpp
@@ -75,12 +75,12 @@
   parseXmlFile();
   m_mapView->graphicsOverlays()->append(m_graphicsOverlay);

-  m_mapView->setMap(m_map);
-
   connect(m_map, &Map::doneLoading, this, [this]()
   {
     zoomToGraphics();
   });
+
+  m_mapView->setMap(m_map);
 }

 void GODictionaryRenderer::parseXmlFile()


Implemented PipeWireOut::SetVolume

Implemented PipeWireOut::SetVolume

--- src/plugins/pipewireout/PipeWireOut.cpp
+++ src/plugins/pipewireout/PipeWireOut.cpp
@@ -38,6 +38,7 @@
 #include <musikcore/sdk/IPreferences.h>
 #include <musikcore/sdk/ISchema.h>
 #include <spa/param/audio/format-utils.h>
+#include <spa/param/props.h>
 #include <spa/utils/result.h>
 #include <unistd.h>
 #include <iostream>
@@ -48,6 +49,8 @@
 constexpr size_t MAX_BUFFERS = 16;

 static IPreferences* prefs = nullptr;
+
+/* CAL TODO: use IDebug instead of stderr */

 extern "C" void SetPreferences(IPreferences* prefs) {
     ::prefs = prefs;
@@ -158,12 +161,27 @@
 }

 void PipeWireOut::SetVolume(double volume) {
-    //pw_stream_set_control(stream->stream, SPA_PROP_channelVolumes, stream->volume.channels, stream->volume.values, 0);
-    /* CAL TODO */
-    this->volume = volume;
+    std::unique_lock<std::recursive_mutex> lock(this->mutex);
+    if (this->pwThreadLoop && this->pwStream) {
+        pw_thread_loop_lock(this->pwThreadLoop);
+        float* channelVolumes = new float[this->channelCount];
+        for (long i = 0; i < this->channelCount; i++) {
+            channelVolumes[i] = volume;
+        }
+        pw_stream_set_control(
+            this->pwStream,
+            SPA_PROP_channelVolumes,
+            this->channelCount,
+            channelVolumes,
+            0);
+        delete[] channelVolumes;
+        pw_thread_loop_unlock(this->pwThreadLoop);
+    }
+    this->volume = volume;
 }

 double PipeWireOut::GetVolume() {
+    std::unique_lock<std::recursive_mutex> lock(this->mutex);
     return this->volume;
 }

@@ -339,6 +357,7 @@
         if (!this->StartPipeWire(buffer)) {
             return OutputState::InvalidState;
         }
+        this->SetVolume(this->volume);
     }

     if (this->channelCount != buffer->Channels() || this->sampleRate != buffer->SampleRate()) {
@@ -368,6 +387,7 @@
 }

 double PipeWireOut::Latency() {
-    /* CAL TODO */
+    /* CAL TODO: i see how to set latency, but not a good way to query
+    PipeWire to see what it actually is */
     return 0.0;
 }


More parameter tuning

More parameter tuning

--- src/position/tracking/TrackingQueue.hpp
+++ src/position/tracking/TrackingQueue.hpp
@@ -54,7 +54,7 @@
 	if (queues.count(data.quadcopterId) == 0) {
 		queues[data.quadcopterId] = new T(3L * 1000 * 1000 * 1000 / 30,
 										  5L * 1000 * 1000 * 1000 / 30,
-										  1L * 1000 * 1000 * 1000 / 30,
+										  2L * 1000 * 1000 * 1000 / 30,
 										  true);
 		ids.push_back(data.quadcopterId);
 	}


Added support for tile cache size configuration

--- src/postgres/backend/utils/misc/guc.cpp
+++ src/postgres/backend/utils/misc/guc.cpp
@@ -511,6 +511,8 @@
 int     peloton_caching_mode;

 // Cache size for tile cache
+#define DEFAULT_PELOTON_TILE_CACHE_SIZE  1024 * 1024
+
 int     peloton_tile_cache_size;

 /*
@@ -2732,6 +2734,19 @@
 		NULL, NULL, NULL
 	},

+
+	// TODO: Peloton Changes
+  {
+    {"peloton_tile_cache_size", PGC_USERSET, UNGROUPED,
+      gettext_noop("Size of the tile cache in peloton."),
+      NULL,
+      GUC_UNIT_KB
+    },
+    &peloton_tile_cache_size,
+    DEFAULT_PELOTON_TILE_CACHE_SIZE, 1, INT_MAX,
+    NULL, NULL, NULL
+  },
+
 	/* End-of-list marker */
 	{
 		{NULL, static_cast<GucContext>(0), static_cast<config_group>(0), NULL, NULL}, NULL, 0, 0, 0, NULL, NULL, NULL