+ Fixed title widget

+ Fixed title widget

--- VolumeVisualization/CGUITitleLabelsWidget.cpp
+++ VolumeVisualization/CGUITitleLabelsWidget.cpp
@@ -9,14 +9,14 @@

 CGUITitleLabelsWidget::CGUITitleLabelsWidget(SciDataManager * DataManager)
 {
-	static Range ValueRange = DataManager->GridValues.getValueRange("Avg Oxy", 5.0);
+	static Range ValueRange = DataManager->RawValues.getValueRange("Avg Oxy", 5.0);

 	std::wstringstream s;
 	s << std::fixed;
 	s << "Range (";
 	s << std::setprecision(3);
 	s << ValueRange.first;
-	s << " - ";
+	s << ", ";
 	s << ValueRange.second;
 	s << ")";

@@ -31,25 +31,25 @@
 	Gwen::Controls::Label * MediumLabel = new Gwen::Controls::Label(GUIManager->getCanvas());
 	MediumLabel->SetFont(GUIManager->getMediumFont());
 	MediumLabel->SetText(Gwen::UnicodeString(L"Current Field: Avg Oxy - ") + Gwen::UnicodeString(s.str()));
-	MediumLabel->SetBounds(20, 70, 600, 300);
+	MediumLabel->SetBounds(20, 70, 1000, 300);
 	MediumLabel->SetTextColor(Gwen::Color(235, 235, 255, 215));

 	// Volume Range Label
 	VolumeRangeIndicator = new Gwen::Controls::Label(GUIManager->getCanvas());
 	VolumeRangeIndicator->SetFont(GUIManager->getMediumFont());
-	VolumeRangeIndicator->SetBounds(20, 110, 900, 300);
+	VolumeRangeIndicator->SetBounds(20, 110, 1000, 300);
 	VolumeRangeIndicator->SetTextColor(Gwen::Color(255, 235, 235, 215));

 	// Volume Range Label
 	VolumeCalculationIndicator = new Gwen::Controls::Label(GUIManager->getCanvas());
 	VolumeCalculationIndicator->SetFont(GUIManager->getMediumFont());
-	VolumeCalculationIndicator->SetBounds(20, 150, 900, 300);
+	VolumeCalculationIndicator->SetBounds(20, 150, 1000, 300);
 	VolumeCalculationIndicator->SetTextColor(Gwen::Color(255, 235, 235, 215));
 }

 void CGUITitleLabelsWidget::resetVolumeRangeIndicator(SciDataManager * DataManager)
 {
-	static Range ValueRange = DataManager->GridValues.getValueRange("Avg Oxy", 5.0);
+	static Range ValueRange = DataManager->RawValues.getValueRange("Avg Oxy", 5.0);

 	{
 		std::wstringstream s;
@@ -64,12 +64,26 @@
 	}

 	{
+		static Range ValueRange = DataManager->GridValues.getValueRange("Avg Oxy", 5.0);
+		static Range XValueRange = DataManager->RawValues.getValueRange("x", 5.0);
+		static Range YValueRange = DataManager->RawValues.getValueRange("DFS Depth (m)", 5.0);
+		YValueRange.first = 0.0;
+		static Range ZValueRange = DataManager->RawValues.getValueRange("y", 5.0);
+
+		double EntireVolume = 1.0;
+		EntireVolume *= XValueRange.second - XValueRange.first;
+		EntireVolume *= YValueRange.second - YValueRange.first;
+		EntireVolume *= ZValueRange.second - ZValueRange.first;
+
+		double UnitVolume = EntireVolume / 24.0 / 24.0 / 24.0;
+		//printf("Entire Volume: %f UnitVolume %f\n", EntireVolume, UnitVolume);
+
 		std::wstringstream s;
 		s << "Volume: ";
 		s << std::setprecision(3);
 		s << std::scientific;
-		s << DataManager->getGridVolume("\"Avg Oxy\"", CProgramContext::get().Scene.VolumeSceneObject->Control.EmphasisLocation * (ValueRange.second - ValueRange.first) + ValueRange.first,
-			CProgramContext::get().Scene.VolumeSceneObject->Control.LocalRange / 2.f * (ValueRange.second - ValueRange.first), 2) * 20.0 * 20.0;
+		s << DataManager->getGridVolume("Avg Oxy", CProgramContext::get().Scene.VolumeSceneObject->Control.EmphasisLocation * (ValueRange.second - ValueRange.first) + ValueRange.first,
+			CProgramContext::get().Scene.VolumeSceneObject->Control.LocalRange / 2.f * (ValueRange.second - ValueRange.first), 2) * UnitVolume;
 		s << " m^3";
 		VolumeCalculationIndicator->SetText(s.str());
 	}
@@ -78,4 +92,5 @@
 void CGUITitleLabelsWidget::clearVolumeRangeIndicator()
 {
 	VolumeRangeIndicator->SetText(L"");
+	VolumeCalculationIndicator->SetText(L"");
 }


INTEGRATION: CWS calcwarnings (1.26.110); FILE MERGED 2006/12/13 10:30:17 nn 1.26.110.2: #i69284# warning-free: filter/xml, unxlngi6 2006/12/01 13:29:17 nn 1.26.110.1: #i69284# warning-free: filter/xml, wntmsci10

--- sc/source/filter/xml/XMLTrackedChangesContext.cxx
+++ sc/source/filter/xml/XMLTrackedChangesContext.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: XMLTrackedChangesContext.cxx,v $
  *
- *  $Revision: 1.26 $
+ *  $Revision: 1.27 $
  *
- *  last change: $Author: kz $ $Date: 2006-07-21 12:50:40 $
+ *  last change: $Author: vg $ $Date: 2007-02-27 12:48:43 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -322,8 +322,8 @@
     double&                 rDateTimeValue;
     double                  fValue;
     sal_uInt16&             rType;
-    sal_Bool                bIsMatrix;
-    sal_Bool                bIsCoveredMatrix;
+//    sal_Bool                bIsMatrix;
+//    sal_Bool                bIsCoveredMatrix;
     sal_Bool                bEmpty;
     sal_Bool                bFirstParagraph;
     sal_Bool                bString;
@@ -663,8 +663,8 @@
                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     SvXMLImportContext( rImport, nPrfx, rLName ),
     aInfo(),
-    nParagraphCount(0),
-    pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
+    pChangeTrackingImportHelper(pTempChangeTrackingImportHelper),
+    nParagraphCount(0)
 {
     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
     for( sal_Int16 i=0; i < nAttrCount; ++i )
@@ -742,15 +742,15 @@
     sal_Bool bColumn(sal_False);
     sal_Bool bRow(sal_False);
     sal_Bool bTable(sal_False);
-    sal_Int32 nColumn;
-    sal_Int32 nRow;
-    sal_Int32 nTable;
-    sal_Int32 nStartColumn;
-    sal_Int32 nEndColumn;
-    sal_Int32 nStartRow;
-    sal_Int32 nEndRow;
-    sal_Int32 nStartTable;
-    sal_Int32 nEndTable;
+    sal_Int32 nColumn(0);
+    sal_Int32 nRow(0);
+    sal_Int32 nTable(0);
+    sal_Int32 nStartColumn(0);
+    sal_Int32 nEndColumn(0);
+    sal_Int32 nStartRow(0);
+    sal_Int32 nEndRow(0);
+    sal_Int32 nStartTable(0);
+    sal_Int32 nEndTable(0);
     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
     for( sal_Int16 i=0; i < nAttrCount; ++i )
     {
@@ -808,7 +808,7 @@
 SvXMLImportContext *ScXMLBigRangeContext::CreateChildContext( USHORT nPrefix,
                                      const ::rtl::OUString& rLocalName,
                                      const ::com::sun::star::uno::Reference<
-                                          ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
+                                        ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
 {
     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
 }
@@ -823,15 +823,15 @@
                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper) :
     SvXMLImportContext( rImport, nPrfx, rLName ),
+    pChangeTrackingImportHelper(pTempChangeTrackingImportHelper),
     pCell(NULL),
-    nMatrixFlag(MM_NONE),
     nID(0),
-    bBigRange(sal_False),
-    nType(NUMBERFORMAT_ALL),
-    bContainsCell(sal_False),
     nMatrixCols(0),
     nMatrixRows(0),
-    pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
+    nType(NUMBERFORMAT_ALL),
+    nMatrixFlag(MM_NONE),
+    bBigRange(sal_False),
+    bContainsCell(sal_False)
 {
     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
     for( sal_Int16 i=0; i < nAttrCount; ++i )
@@ -901,7 +901,7 @@
     SvXMLImportContext( rImport, nPrfx, rLName ),
     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
 {
-    sal_uInt32 nID;
+    sal_uInt32 nID(0);
     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
     for( sal_Int16 i=0; i < nAttrCount; ++i )
     {
@@ -927,7 +927,7 @@
 SvXMLImportContext *ScXMLDependenceContext::CreateChildContext( USHORT nPrefix,
                                      const ::rtl::OUString& rLocalName,
                                      const ::com::sun::star::uno::Reference<
-                                          ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
+                                        ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
 {
     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
 }
@@ -939,7 +939,7 @@
 ScXMLDependingsContext::ScXMLDependingsContext(  ScXMLImport& rImport,
                                               USHORT nPrfx,
                                                    const ::rtl::OUString& rLName,
-                                              const uno::Reference<xml::sax::XAttributeList>& xAttrList,
+                                            const uno::Reference<xml::sax::XAttributeList>& /* xAttrList */,
                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     SvXMLImportContext( rImport, nPrfx, rLName ),
     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
@@ -982,7 +982,7 @@
     SvXMLImportContext( rImport, nPrfx, rLName ),
     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
 {
-    sal_uInt32 nID;
+    sal_uInt32 nID(0);
     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
     for( sal_Int16 i=0; i < nAttrCount; ++i )
     {
@@ -1008,7 +1008,7 @@
 SvXMLImportContext *ScXMLChangeDeletionContext::CreateChildContext( USHORT nPrefix,
                                      const ::rtl::OUString& rLocalName,
                                      const ::com::sun::star::uno::Reference<
-                                          ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
+                                        ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
 {
     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
 }
@@ -1020,7 +1020,7 @@
 ScXMLDeletionsContext::ScXMLDeletionsContext(  ScXMLImport& rImport,
                                               USHORT nPrfx,
                                                    const ::rtl::OUString& rLName,
-                                              const uno::Reference<xml::sax::XAttributeList>& xAttrList,
+                                            const uno::Reference<xml::sax::XAttributeList>& /* xAttrList */,
                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     SvXMLImportContext( rImport, nPrfx, rLName ),
     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
@@ -1064,12 +1064,12 @@
                                       ::com::sun::star::xml::sax::XAttributeList>& xTempAttrList,
                                       ScXMLChangeCellContext* pTempChangeCellContext) :
     SvXMLImportContext( rImport, nPrfx, rLName ),
+    xAttrList(xTempAttrList),
+    sLName(rLName),
+    sText(),
+    pChangeCellContext(pTempChangeCellContext),
     pTextPContext(NULL),
-    sLName(rLName),
-    xAttrList(xTempAttrList),
-    nPrefix(nPrfx),
-    sText(),
-    pChangeCellContext(pTempChangeCellContext)
+    nPrefix(nPrfx)
 {
     // here are no attributes
 }
@@ -1154,15 +1154,15 @@
                                             rtl::OUString& rTempInputString, double& fDateTimeValue, sal_uInt16& nType,
                                             sal_uInt8& nMatrixFlag, sal_Int32& nMatrixCols, sal_Int32& nMatrixRows ) :
     SvXMLImportContext( rImport, nPrfx, rLName ),
+    rInputString(rTempInputString),
+    rOldCell(rTempOldCell),
+    pEditTextObj(NULL),
+    rDateTimeValue(fDateTimeValue),
+    rType(nType),
     bEmpty(sal_True),
     bFirstParagraph(sal_True),
-    bFormula(sal_False),
     bString(sal_True),
-    pEditTextObj(NULL),
-    rOldCell(rTempOldCell),
-    rType(nType),
-    rDateTimeValue(fDateTimeValue),
-    rInputString(rTempInputString)
+    bFormula(sal_False)
 {
     sal_Bool bIsMatrix(sal_False);
     sal_Bool bIsCoveredMatrix(sal_False);
@@ -1180,9 +1180,9 @@
             if (IsXMLToken(aLocalName, XML_FORMULA))
             {
                 bEmpty = sal_False;
-                sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
+                sal_uInt16 nFormulaPrefix = GetImport().GetNamespaceMap().
                         _GetKeyByAttrName( sValue, &rFormula, sal_False );
-                if ( nPrefix == XML_NAMESPACE_UNKNOWN || nPrefix == XML_NAMESPACE_NONE )    // #i56720#
+                if ( nFormulaPrefix == XML_NAMESPACE_UNKNOWN || nFormulaPrefix == XML_NAMESPACE_NONE )    // #i56720#
                     rFormula = sValue;
                 ScXMLConverter::ParseFormula(rFormula);
                 bFormula = sal_True;
@@ -1371,15 +1371,15 @@
                                               const uno::Reference<xml::sax::XAttributeList>& xAttrList,
                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     SvXMLImportContext( rImport, nPrfx, rLName ),
-    nID(0),
     sFormulaAddress(),
     sFormula(),
-    nMatrixFlag(MM_NONE),
+    pChangeTrackingImportHelper(pTempChangeTrackingImportHelper),
     pOldCell(NULL),
-    nType(NUMBERFORMAT_ALL),
+    nID(0),
     nMatrixCols(0),
     nMatrixRows(0),
-    pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)
+    nType(NUMBERFORMAT_ALL),
+    nMatrixFlag(MM_NONE)
 {
     sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0);
     for( sal_Int16 i=0; i < nAttrCount; ++i )
@@ -1663,7 +1663,7 @@
 SvXMLImportContext *ScXMLInsertionCutOffContext::CreateChildContext( USHORT nPrefix,
                                      const ::rtl::OUString& rLocalName,
                                      const ::com::sun::star::uno::Reference<
-                                          ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
+                                        ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
 {
     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
 }
@@ -1727,7 +1727,7 @@
 SvXMLImportContext *ScXMLMovementCutOffContext::CreateChildContext( USHORT nPrefix,
                                      const ::rtl::OUString& rLocalName,
                                      const ::com::sun::star::uno::Reference<
-                                          ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
+                                        ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */ )
 {
     return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
 }
@@ -1739,7 +1739,7 @@
 ScXMLCutOffsContext::ScXMLCutOffsContext( ScXMLImport& rImport,
                                               USHORT nPrfx,
                                                    const ::rtl::OUString& rLName,
-                                              const uno::Reference<xml::sax::XAttributeList>& xAttrList,
+                                            const uno::Reference<xml::sax::XAttributeList>& /* xAttrList */,
                                             ScXMLChangeTrackingImportHelper* pTempChangeTrackingImportHelper ) :
     SvXMLImportContext( rImport, nPrfx, rLName ),
     pChangeTrackingImportHelper(pTempChangeTrackingImportHelper)


Fix WM/EncodingTime parsing

Fix WM/EncodingTime parsing

The Windows Media parsing code tried to handle "WM/EncodingTime" but was failing because the value is a FILETIME, which uses units of 100 nanoseconds from 1601, but it was passing the value as-is to something that expects seconds from 1601. Just needs a division by 10000000 to fix.

Fix a side-effect of fixing, use seconds precision for both Header_FileProperties/CreationDate and WM/EncodingTime, compare them and show both only if they are different.

--- Source/MediaInfo/Multiple/File_Wm_Elements.cpp
+++ Source/MediaInfo/Multiple/File_Wm_Elements.cpp
@@ -265,7 +265,10 @@
     //Filling
     if (MaximumBitRate)
         Fill(Stream_General, 0, General_OverallBitRate_Maximum, MaximumBitRate);
-    Fill(Stream_General, 0, General_Encoded_Date, Ztring().Date_From_Milliseconds_1601(CreationDate/10000));
+    Ztring Encoded_Date_New=Ztring().Date_From_Seconds_1601(CreationDate/10000000);
+    const Ztring& Encoded_Date_Old=Retrieve_Const(Stream_General, 0, General_Encoded_Date);
+    if (Encoded_Date_Old.empty() || Encoded_Date_New!=Encoded_Date_Old)
+        Fill(Stream_General, 0, General_Encoded_Date, Encoded_Date_New);
     if (PlayDuration/1000>Preroll)
         Fill(Stream_General, 0, General_Duration, PlayDuration/10000-Preroll);
     FileProperties_Preroll=(int32u)(Preroll);
@@ -1162,7 +1165,12 @@
             else if (Name==__T("WM/EncoderSettings"))
                 Fill(Stream_General, 0, General_Encoded_Library_Settings, Value);
             else if (Name==__T("WM/EncodingTime"))
-                Fill(Stream_General, 0, General_Encoded_Date, Ztring().Date_From_Seconds_1601(Value_Int64));
+            {
+                 Ztring Encoded_Date_New=Ztring().Date_From_Seconds_1601(Value_Int64/10000000);
+                 const Ztring& Encoded_Date_Old=Retrieve_Const(Stream_General, 0, General_Encoded_Date);
+                 if (Encoded_Date_Old.empty() || Encoded_Date_New!=Encoded_Date_Old)
+                    Fill(Stream_General, 0, General_Encoded_Date, Encoded_Date_New);
+            }
             else if (Name==__T("WM/Genre"))
                 Fill(Stream_General, 0, General_Genre, Value, true); //Clear last value
             else if (Name==__T("WM/GenreID"))


whoops, don't accidentally lose variable names

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@8955 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Transforms/Scalar/InstructionCombining.cpp
+++ lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2005,7 +2005,7 @@

         // Move the name to the new instruction first...
         std::string OldName = I->getName(); I->setName("");
-        Result->setName(I->getName());
+        Result->setName(OldName);

         // Insert the new instruction into the basic block...
         BasicBlock *InstParent = I->getParent();


executeTransaction on temporary root, update root after commit

--- You-DataStore/internal/internal_datastore.cpp
+++ You-DataStore/internal/internal_datastore.cpp
@@ -37,8 +37,10 @@
 		// it is the only active transaction, execute the operations and save
 		pugi::xml_document temp;
 		temp.reset(document);
-		executeTransaction(transaction, temp);
+		pugi::xml_node tempRoot = BranchOperation::get(temp, ROOT_NODE_NAME.c_str());
+		executeTransaction(transaction, tempRoot);
 		document.reset(temp);
+		root = BranchOperation::get(document, ROOT_NODE_NAME.c_str());
 		saveData();
 		transactionStack.pop();
 	} else {


INTEGRATION: CWS aw033 (1.22.10); FILE MERGED 2008/07/10 12:56:27 aw 1.22.10.8: #i39532# XOutputDevice removed, PrepareDelete removed 2008/06/25 13:05:02 aw 1.22.10.7: RESYNC: (1.27-1.28); FILE MERGED 2008/05/27 15:18:03 aw 1.22.10.6: #i39532# changes DEV300 m12 resync corrections 2008/05/16 13:06:04 aw 1.22.10.5: adaptions after resync 2008/05/14 14:51:26 aw 1.22.10.4: RESYNC: (1.23-1.27); FILE MERGED 2008/02/07 14:26:01 aw 1.22.10.3: stable version from working GIT repository for unxlngi6 build 2008/01/29 10:34:21 aw 1.22.10.2: updated refresh for ActionChanged(), diverse removals 2007/10/22 10:26:50 aw 1.22.10.1: #i39523# joined #i82710# and adaptions to primitives

--- sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: SlideSorterView.cxx,v $
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -40,7 +40,6 @@
 #include "view/SlsLayouter.hxx"
 #include "view/SlsViewOverlay.hxx"
 #include "view/SlsPageObjectViewObjectContact.hxx"
-#include "view/SlsHighlightObject.hxx"
 #include "controller/SlideSorterController.hxx"
 #include "controller/SlsPageObjectFactory.hxx"
 #include "controller/SlsProperties.hxx"
@@ -64,7 +63,6 @@
 #include <svtools/itempool.hxx>
 #include <svx/svdpagv.hxx>
 #include <svx/svdopage.hxx>
-#include <svx/xoutx.hxx>
 #include <svx/xlndsit.hxx>
 #include <svx/xlnclit.hxx>
 #include <com/sun/star/presentation/FadeEffect.hpp>
@@ -75,6 +73,10 @@
 #include <svx/sdr/contact/objectcontact.hxx>
 #include <svx/sdrpagewindow.hxx>
 #include <svtools/itempool.hxx>
+
+#ifndef _SFXITEMPOOL_HXX
+#include <svtools/itempool.hxx>
+#endif

 using namespace std;
 using namespace ::sd::slidesorter::model;
@@ -112,6 +114,14 @@
     SetPageVisible (FALSE);
     maPageModel.GetItemPool().FreezeIdRanges();

+    // call FreezeIdRanges() at the pool from the newly constructed SdrModel,
+    // else creating SfxItemSets on it will complain
+    maPageModel.GetItemPool().FreezeIdRanges();
+
+    // add the page to the model (no, this is NOT done by the constructor :-( )
+    maPageModel.InsertPage(mpPage);
+
+    // show page
     LocalModelHasChanged();
 }

@@ -136,8 +146,12 @@
     }
     mpPreviewCache.reset();

-    // Remove all page objects from the page.
-    mpPage->Clear();
+    // hide the page to avoid problems in the view when deleting
+    // visualized objects
+    HideSdrPage();
+
+    // Deletion of the objects and the page will be done in SdrModel
+    // destructor (as long as objects and pages are added)
 }

@@ -227,9 +241,6 @@
     }
 }

-
-
-
 void SlideSorterView::LocalModelHasChanged(void)
 {
     mbModelChangedWhileModifyEnabled = false;
@@ -390,17 +401,12 @@
             model::SharedPageDescriptor pDescriptor (aPageEnumeration.GetNextElement());
             SdrPageObj* pPageObject = pDescriptor->GetPageObject();
             Rectangle aPageObjectBox (mpLayouter->GetPageObjectBox (nIndex));
-            pPageObject->SetRelativePos (aPageObjectBox.TopLeft());
+            pPageObject->SetSnapRect(aPageObjectBox);

             nIndex += 1;
         }
         // Set the page so that it encloses all page objects.
         mpPage->SetSize (aViewBox.GetSize());
-
-        view::HighlightObject* pHighlightObject
-            = mrSlideSorter.GetController().GetHighlightObject();
-        if  (pHighlightObject != NULL)
-            pHighlightObject->UpdatePosition();
     }

     InvalidatePageObjectVisibilities ();
@@ -597,11 +603,7 @@

-void SlideSorterView::CompleteRedraw (
-    OutputDevice* pDevice,
-    const Region& rPaintArea,
-    USHORT nPaintMode,
-    ::sdr::contact::ViewObjectContactRedirector* pRedirector)
+void SlideSorterView::CompleteRedraw(OutputDevice* pDevice, const Region& rPaintArea, sdr::contact::ViewObjectContactRedirector* pRedirector)
 {
     if (mnLockRedrawSmph == 0)
     {
@@ -614,13 +616,13 @@

         // Call the base class InitRedraw even when re-drawing is locked to
         // let it remember the request for a redraw.
-        View::CompleteRedraw (pDevice, rPaintArea, nPaintMode, pRedirector);
+        View::CompleteRedraw (pDevice, rPaintArea, pRedirector);
     }
     else
     {
         // In sd::View::CompleteRedraw() this call is recorded and given
         // region is painted when the view is unlocked.
-        View::CompleteRedraw (pDevice, rPaintArea, nPaintMode, pRedirector);
+        View::CompleteRedraw (pDevice, rPaintArea, pRedirector);
     }
 }


any: make is-serializable condition more proper

To be more strict we must always call IObjectHolder::IsSerializable
if object holder is present.

Don't make simple assumption that SerializableObject is serializable.

--- stingraykit/any.cpp
+++ stingraykit/any.cpp
@@ -81,7 +81,7 @@

 	bool any::IsSerializable() const
-	{ return _type != Type::Object || _data.Object->IsSerializable(); }
+	{ return (_type != Type::Object && _type != Type::SerializableObject) || _data.Object->IsSerializable(); }

 #define STRING(NAME) case Type::NAME: return stingray::ToString(_data.NAME)


Review fixes.

Review fixes.

--- storage/storage.hpp
+++ storage/storage.hpp
@@ -295,8 +295,8 @@
   {
     UpdateInfo() : m_numberOfMwmFilesToUpdate(0), m_totalUpdateSizeInBytes(0) {}

-    uint32_t m_numberOfMwmFilesToUpdate;
-    uint64_t m_totalUpdateSizeInBytes;
+    TMwmCounter m_numberOfMwmFilesToUpdate;
+    TMwmSize m_totalUpdateSizeInBytes;
   };

   struct StatusCallback


- Replace several sprintf by using TString (coverity)
- Simplify the formatting of the text by using TString
- Fix a bug when saving buttons containing text with newlines (convert newline characters by the correct escape sequence "\n")

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@32562 27541ba8-7e3a-0410-8455-c3a389f83636

--- gui/gui/src/TGButton.cxx
+++ gui/gui/src/TGButton.cxx
@@ -1734,40 +1734,29 @@
    // Save a text button widget as a C++ statement(s) on output stream out.

    char quote = '"';
-   const char *text = fLabel->GetString();
-   Int_t hotpos = fLabel->GetHotPos();
-   Int_t lentext = fLabel->GetLength();
-   char *outext = new char[lentext+2];
-   Int_t i=0;
-   while (lentext) {
-      if (hotpos && (i == hotpos-1)) {
-         outext[i] = '&';
-         i++;
-      }
-      outext[i] = *text;
-      i++;
-      text++;
-      lentext--;
-   }
-   outext[i]=0;
+   TString outext(fLabel->GetString());
+   if (fLabel->GetHotPos() > 0)
+      outext.Insert(fLabel->GetHotPos()-1, "&");
+   if (outext.First('\n') >= 0)
+      outext.ReplaceAll("\n", "\\n");

    // font + GC
    option = GetName()+5;         // unique digit id of the name
-   char parGC[50], parFont[50];
-   sprintf(parFont,"%s::GetDefaultFontStruct()",IsA()->GetName());
-   sprintf(parGC,"%s::GetDefaultGC()()",IsA()->GetName());
+   TString parGC, parFont;
+   parFont.Form("%s::GetDefaultFontStruct()",IsA()->GetName());
+   parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());

    if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
       TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
       if (ufont) {
          ufont->SavePrimitive(out, option);
-         sprintf(parFont,"ufont->GetFontStruct()");
+         parFont.Form("ufont->GetFontStruct()");
       }

       TGGC *userGC = gClient->GetResourcePool()->GetGCPool()->FindGC(fNormGC);
       if (userGC) {
          userGC->SavePrimitive(out, option);
-         sprintf(parGC,"uGC->GetGC()");
+         parGC.Form("uGC->GetGC()");
       }
    }

@@ -1775,7 +1764,7 @@

    out << "   TGTextButton *";
    out << GetName() << " = new TGTextButton(" << fParent->GetName()
-       << "," << quote << outext << quote;
+       << "," << quote << outext.Data() << quote;

    if (GetOptions() == (kRaisedFrame | kDoubleBorder)) {
       if (fFontStruct == GetDefaultFontStruct()) {
@@ -1795,8 +1784,6 @@
       out << "," << fWidgetId << "," << parGC << "," << parFont << "," << GetOptionString() << ");" << endl;
    }

-   delete [] outext;
-
    out << "   " << GetName() << "->SetTextJustify(" << fTMode << ");" << endl;
    out << "   " << GetName() << "->SetMargins(" << fMLeft << "," << fMRight << ",";
    out << fMTop << "," << fMBottom << ");" << endl;
@@ -1820,14 +1807,14 @@

    // GC
    option = GetName()+5;         // unique digit id of the name
-   char parGC[50];
-   sprintf(parGC,"%s::GetDefaultGC()()",IsA()->GetName());
+   TString parGC;
+   parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());

    if (GetDefaultGC()() != fNormGC) {
       TGGC *userGC = gClient->GetResourcePool()->GetGCPool()->FindGC(fNormGC);
       if (userGC) {
          userGC->SavePrimitive(out, option);
-         sprintf(parGC,"uGC->GetGC()");
+         parGC.Form("uGC->GetGC()");
       }
    }

@@ -1848,10 +1835,10 @@
             out << "," << fWidgetId << ");" << endl;
          }
       } else {
-         out << "," << fWidgetId << "," << parGC << ");" << endl;
-      }
-   } else {
-      out << "," << fWidgetId << "," << parGC << "," << GetOptionString()
+         out << "," << fWidgetId << "," << parGC.Data() << ");" << endl;
+      }
+   } else {
+      out << "," << fWidgetId << "," << parGC.Data() << "," << GetOptionString()
           << ");" << endl;
    }

@@ -1865,48 +1852,33 @@

    char quote = '"';

-   const char *text = fLabel->GetString();
-   char hotpos = fLabel->GetHotPos();
-   Int_t lentext = fLabel->GetLength();
-   char *outext = new char[lentext+2];       // should be +2 because of \0
-   Int_t i=0;
-
-
-   while (lentext) {
-      if (hotpos && (i == hotpos-1)) {
-         outext[i] = '&';
-         i++;
-      }
-      outext[i] = *text;
-      i++;
-      text++;
-      lentext--;
-   }
-   outext[i]=0;
+   TString outext(fLabel->GetString());
+   if (fLabel->GetHotPos() > 0)
+      outext.Insert(fLabel->GetHotPos()-1, "&");
+   if (outext.First('\n') >= 0)
+      outext.ReplaceAll("\n", "\\n");

    out <<"   TGCheckButton *";
    out << GetName() << " = new TGCheckButton(" << fParent->GetName()
-       << "," << quote << outext << quote;
-
-   delete [] outext;
+       << "," << quote << outext.Data() << quote;

    // font + GC
    option = GetName()+5;         // unique digit id of the name
-   char parGC[50], parFont[50];
-   sprintf(parFont,"%s::GetDefaultFontStruct()",IsA()->GetName());
-   sprintf(parGC,"%s::GetDefaultGC()()",IsA()->GetName());
+   TString parGC, parFont;
+   parFont.Form("%s::GetDefaultFontStruct()",IsA()->GetName());
+   parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());

    if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
       TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
       if (ufont) {
          ufont->SavePrimitive(out, option);
-         sprintf(parFont,"ufont->GetFontStruct()");
+         parFont.Form("ufont->GetFontStruct()");
       }

       TGGC *userGC = gClient->GetResourcePool()->GetGCPool()->FindGC(fNormGC);
       if (userGC) {
          userGC->SavePrimitive(out, option);
-         sprintf(parGC,"uGC->GetGC()");
+         parGC.Form("uGC->GetGC()");
       }
    }

@@ -1948,44 +1920,33 @@

    char quote = '"';

-   const char *text = fLabel->GetString();
-   char hotpos = fLabel->GetHotPos();
-   Int_t lentext = fLabel->GetLength();
-   char *outext = new char[lentext+2];
-   Int_t i=0;
-
-   while (lentext) {
-      if (hotpos && (i == hotpos-1)) {
-         outext[i] = '&';
-         i++;
-      }
-      outext[i] = *text;
-      i++; text++; lentext--;
-   }
-   outext[i]=0;
+   TString outext(fLabel->GetString());
+   if (fLabel->GetHotPos() > 0)
+      outext.Insert(fLabel->GetHotPos()-1, "&");
+   if (outext.First('\n') >= 0)
+      outext.ReplaceAll("\n", "\\n");
+
    out << "   TGRadioButton *";
    out << GetName() << " = new TGRadioButton(" << fParent->GetName()
-       << "," << quote << outext << quote;
-
-   delete [] outext;
+       << "," << quote << outext.Data() << quote;

    // font + GC
    option = GetName()+5;         // unique digit id of the name
-   char parGC[50], parFont[50];
-   sprintf(parFont,"%s::GetDefaultFontStruct()",IsA()->GetName());
-   sprintf(parGC,"%s::GetDefaultGC()()",IsA()->GetName());
+   TString parGC, parFont;
+   parFont.Form("%s::GetDefaultFontStruct()",IsA()->GetName());
+   parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());

    if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
       TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
       if (ufont) {
          ufont->SavePrimitive(out, option);
-         sprintf(parFont,"ufont->GetFontStruct()");
+         parFont.Form("ufont->GetFontStruct()");
       }

       TGGC *userGC = gClient->GetResourcePool()->GetGCPool()->FindGC(fNormGC);
       if (userGC) {
          userGC->SavePrimitive(out, option);
-         sprintf(parGC,"uGC->GetGC()");
+         parGC.Form("uGC->GetGC()");
       }
    }


Fix coverity reports (dereference null return value)

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

--- gui/gui/src/TGSlider.cxx
+++ gui/gui/src/TGSlider.cxx
@@ -85,6 +85,8 @@

    TImage *img = TImage::Create();
    TImage *img2 = TImage::Create();
+
+   if (!img || !img2) return;

    TString back = gEnv->GetValue("Gui.BackgroundColor", "#c0c0c0");
    img2->FillRectangle(back.Data(), 0, 0, fSliderPic->GetWidth(),


Added a decl for chomp so that it will compile with gcc 2.95

--- src/condor_globus/gshadow.C
+++ src/condor_globus/gshadow.C
@@ -21,6 +21,7 @@
 char *contactString = NULL;
 char *globusrun = NULL;

+extern "C" char * chomp(char*);

 /*
   Wait up for one of those nice debuggers which attaches to a running


fix weekly date intervals

fix weekly date intervals

--- src/act-types.cc
+++ src/act-types.cc
@@ -360,7 +360,7 @@
     case weeks: {
       // 1970-01-01 was a thursday.
       static int week_offset = 4 - shared_config().start_of_week();
-      return (days_since_1970(tm) - week_offset) / 7; }
+      return (days_since_1970(tm) + week_offset) / 7; }

     case months:
       return (tm.tm_year - 70) * 12 + tm.tm_mon;
@@ -381,7 +381,7 @@

     case weeks: {
       static int week_offset = 4 - shared_config().start_of_week();
-      int days = x * 7 + week_offset;
+      int days = x * 7 - week_offset;
       append_days_date(str, days);
       break; }


Made desired angle configurable

Made desired angle configurable

--- calibrate_chest/src/calibration_server.cpp
+++ calibrate_chest/src/calibration_server.cpp
@@ -6,6 +6,7 @@
 #include <pcl/visualization/pcl_visualizer.h>
 #include <boost/thread/thread.hpp>
 #include "mongodb_store/SetParam.h"
+#include <sstream>

 #include <actionlib/server/simple_action_server.h>
 #include <calibrate_chest/CalibrateCameraAction.h>
@@ -21,17 +22,19 @@
     ros::ServiceClient client;
     std::string camera_name;
     std::string camera_topic;
+    double desired_angle;
     calibrate_chest::CalibrateCameraFeedback feedback;
     calibrate_chest::CalibrateCameraResult result;

 public:

-    CalibrateCameraServer(const std::string& name, const std::string& camera_name) :
+    CalibrateCameraServer(const std::string& name, const std::string& camera_name, double angle) :
         server(n, name, boost::bind(&CalibrateCameraServer::execute_cb, this, _1), false),
         action_name(name),
         client(n.serviceClient<mongodb_store::SetParam>("/config_manager/set_param")),
         camera_name(camera_name),
-        camera_topic(camera_name + "/depth/points")
+        camera_topic(camera_name + "/depth/points"),
+        desired_angle(angle)
     {
         server.start();
     }
@@ -104,8 +107,10 @@
         result.angle = angle_deg;
         result.height = height;

-        if (fabs(45.0f - angle_deg) > 3.0f) {
-            result.status = "Angle not close enough to 45 degrees.";
+        if (fabs(desired_angle - angle_deg) > 3.0f) {
+            std::stringstream ss;
+            ss << desired_angle;
+            result.status = std::string("Angle not close enough to ") + ss.str() + " degrees.";
             server.setAborted(result);
             return;
         }
@@ -264,7 +269,7 @@
 int main(int argc, char** argv)
 {
     ros::init(argc, argv, "calibrate_chest");
-    CalibrateCameraServer calibrate(ros::this_node::getName(), "chest_xtion");
+    CalibrateCameraServer calibrate(ros::this_node::getName(), "chest_xtion", 46.0);
     ros::spin();

 	return 0;


Update replicaset iterator definition syntax

--- src/replicaset.hpp
+++ src/replicaset.hpp
@@ -56,9 +56,9 @@

     std::shared_ptr<ReplicaSet> Intersection(std::shared_ptr<ReplicaSet> other);

-    using iterator = std::set<Replica, compare_replica>::iterator;
+    typedef typename std::set<Replica, compare_replica>::iterator iterator;

-    using const_iterator = std::set<Replica, compare_replica>::const_iterator;
+    typedef typename std::set<Replica, compare_replica>::const_iterator const_iterator;

     ReplicaSet::iterator begin() const;


Actually fixed when the TextField would have a large left margin the mouse would not position correctly this time.

--- src/Agui/Widgets/TextField/TextField.cpp
+++ src/Agui/Widgets/TextField/TextField.cpp
@@ -721,7 +721,7 @@
 			return;
 		}
 		dragged = false;
-		int x = mouseEvent.getX() - getTextOffset() + getMargin(SIDE_LEFT);
+		int x = mouseEvent.getX() - getTextOffset() - getMargin(SIDE_LEFT);
 		positionCaret(getFont()->getStringIndexFromPosition(getText(),x));

 		internalSelStart = getCaretPosition();
@@ -784,7 +784,7 @@

 		int maxcharSkip = getMaxCharacterSkip();
 		maxCharacterSkip = 1;
-		int x = mouseEvent.getX() - getTextOffset();
+		int x = mouseEvent.getX() - getTextOffset() - getMargin(SIDE_LEFT);
 		positionCaret(getFont()->getStringIndexFromPosition(getText(),x));

 		setSelection(internalSelStart,getCaretPosition());


ATO-339, ATO-336, ATO-341. 1.) Bug fix in friend trees. Also frist tree can be adreesed 2.) Adding AliSysInfoStamp, before and after each tree access O(nfiles) stamps 3.) TGrid::Connect in case alien files in file list

--- TPC/TPCcalib/AliTPCcalibAlignInterpolation.cxx
+++ TPC/TPCcalib/AliTPCcalibAlignInterpolation.cxx
@@ -911,7 +911,8 @@
   //
   TVectorD     *vdriftParam=0;
   TGraphErrors *vdriftGraph=0;
-  TFile *fdrift = TFile::Open("fitDrift.root");
+  TFile *fdrift = TFile::Open("fitDrift.root");
+  AliSysInfo::AddStamp("FillHistogramsFromChain.LoadDriftBegin",1,0);
   if (fdrift){
     TTree * tree = (TTree*)fdrift->Get("fitTimeStat");
     if (tree==NULL){
@@ -932,6 +933,7 @@
   }else{
     ::Error("LoadDriftCalibration FAILED", "fitDrift.root not present");
   }
+  AliSysInfo::AddStamp("FillHistogramsFromChain.LoadDriftEND",1,1);
   //
   // 1.) Fill histograms and mean informations
   //
@@ -971,7 +973,7 @@
   UShort_t npValid=knPoints;
   Long64_t fillCounter=0;
   Long64_t clusterCounter=0;
-
+  AliSysInfo::AddStamp("FillHistogramsFromChain.BEGIN",2,0);
   for (Int_t ihis=0; ihis<6; ihis++){
     if (selHis>=0 && ihis!=selHis) continue;
     Double_t binWidth[4]={0};
@@ -1218,6 +1220,7 @@
     fout->GetFile()->cd();
     hisToFill[ihis]->Write();
   }
+  AliSysInfo::AddStamp("FillHistogramsFromChain.END",2,1);
   if (hisTime) hisTime->Write();
   ::Info(" AliTPCcalibAlignInterpolation::FillHistogramsFromChain","End of processing\n");
   timerAll.Print();
@@ -1348,7 +1351,11 @@
   }
   if (tree==NULL) {
     tree = treeFriend;
-  }else{
+    tree->SetName("Default");
+    tree->SetTitle("Default");
+    treeFriend = (TTree*) fin->Get(treeName);
+  }
+  {
     tree->AddFriend(treeFriend,TString::Format("%s",friendAlias).Data());
     tree->SetAlias(TString::Format("%sOK",friendAlias).Data(),TString::Format("%s.rms>0&&abs(%s.mean-%s.meanG)<2&&%s.chi2G>0&&%s.rmsG<2&&%s.rmsG/%s.rms<2",friendAlias,friendAlias,friendAlias,friendAlias,friendAlias,friendAlias,friendAlias).Data());
     tree->SetAlias(TString::Format("%sDrawOK",friendAlias).Data(),TString::Format("%s.rms>0&&abs(%s.mean-%s.meanG)<4&&%s.chi2G>0",friendAlias,friendAlias,friendAlias,friendAlias).Data());
@@ -1631,7 +1638,8 @@
   const Double_t kBCcutMin=-5;
   const Double_t kBCcutMax=20;
   const Double_t robFraction=0.99;
-
+  const Int_t cacheSize=250000000; // 250 MBy cache
+
   Int_t maxEntries=1000000;
   Int_t maxPointsRobust=4000000;
   //
@@ -1645,19 +1653,31 @@
     ::Error("AliTPCcalibAlignInterpolation::FitDrift FAILED ","Invalid parameter value for the deltaT %.1f and sigmaT %.1f", deltaT, sigmaT);
     return kFALSE;
   }
-
+  if (TString(gSystem->GetFromPipe("cat residual.list | grep -c alien://")).Atoi()>0) TGrid::Connect("alien");
+
   TChain * chainDelta = AliXRDPROOFtoolkit::MakeChain("residual.list","delta",0,-1);
+  AliSysInfo::AddStamp("FitDrift.chainDeltaGetEntriesBegin",1,0,0);
   entriesAll = chainDelta->GetEntries();
+  chainDelta->SetCacheLearnEntries(100);
+  chainDelta->SetCacheSize(0);
+  chainDelta->SetCacheSize(cacheSize);
+  AliSysInfo::AddStamp("FitDrift.chainDeltaGetEntriesEnd",1,1,0);
+
   if (entriesAll<kMinEntries) {
     ::Error("fitDrift FAILED","Not enough tracks in the chain.  Ntracks=%d",entriesAll);
     return kFALSE;
   }
   maxEntries=TMath::Min(maxEntries, entriesAll);
   TTreeSRedirector *pcstream = new TTreeSRedirector("fitDrift.root","recreate");
-  if (time0==time1){
-    TChain * chainInfo=  AliXRDPROOFtoolkit::MakeChain("residual.list","eventInfo",0,-1);
-    chainInfo->SetEstimate(-1);
+  if (time0==time1){
+    AliSysInfo::AddStamp("FitDrift.chainInfoGetTimeBegin",2,0,0);
+    TChain * chainInfo=  AliXRDPROOFtoolkit::MakeChain("residual.list","eventInfo",0,-1);
+    chainDelta->SetCacheSize(cacheSize);
+    //    chainInfo->SetEstimate(-1); // i cashed here -1 does not work
+    chainInfo->SetEstimate(maxEntries); // i cashed here -1 does not work
     Int_t entries = chainInfo->Draw("timeStamp","","goff",maxEntries);
+    chainInfo->PrintCacheStats();
+    AliSysInfo::AddStamp("FitDrift.chainInfoGetTimeEND",2,1,0);
     if (entries) TStatToolkit::GetMinMax(chainInfo->GetV1(),entries,time0,time1);
   }
   // 0.) Cache variables:  to be done using loop
@@ -1671,13 +1691,18 @@
   //       timeStamp
   //       npValid
   //
-  AliSysInfo::AddStamp("StartCache",1,0,0);
+  AliSysInfo::AddStamp("FitDrift.StartCache",3,0,0);
+  chainDelta->SetCacheLearnEntries(100);
+  chainDelta->SetCacheSize(0);
+  chainDelta->SetCacheSize(10000000);
+
   chainDelta->SetEstimate(maxEntries*160/5.);
-  Int_t entriesFit0 = chainDelta->Draw("tof1.fElements:trd1.fElements:vecZ.fElements:vecR.fElements:vecSec.fElements:vecPhi.fElements:timeStamp:tofBC","Entry$%5==0","goffpara",maxEntries);
+  Int_t entriesFit0 = chainDelta->Draw("tof1.fElements:trd1.fElements:vecZ.fElements:vecR.fElements:vecSec.fElements:vecPhi.fElements:timeStamp:tofBC","Entry$%5==0","goffpara",maxEntries);
+  chainDelta->PrintCacheStats();
   Int_t entriesFit=entriesFit0/10;
-  AliSysInfo::AddStamp("EndCache",1,1,0);
-
-  AliSysInfo::AddStamp("BeginFill",1,1,0);
+  AliSysInfo::AddStamp("FitDrift.EndCache",3,1,0);
+
+  AliSysInfo::AddStamp("FitDrift.BeginFill",4,1,0);

   TVectorD * deltaTOF  = new TVectorD(entriesFit); //
   TVectorD * deltaTRD  = new TVectorD(entriesFit); //
@@ -1698,7 +1723,7 @@
     (*vecTime)[i]= chainDelta->GetVal(6)[index];
     (*vecTOFBC)[i]= chainDelta->GetVal(7)[index];
   }
-  AliSysInfo::AddStamp("EndFill",1,1,0);
+  AliSysInfo::AddStamp("FitDrift.EndFill",4,1,0);

   //
@@ -1711,12 +1736,12 @@
   TVectorD paramTRDBC(5);
   TVectorD paramTOFBC(5);
   //
-  AliSysInfo::AddStamp("StartRobust",2,0,0);
+  AliSysInfo::AddStamp("FitDrift.StartRobust",2,0,0);
   TF1 * fpol1 = new TF1("f1","[0]+[1]*x",0,250);
   //
   if (pcstream->GetFile()->Get("robustFit")==0){
     for (Int_t iter=0; iter<20; iter++){
-      AliSysInfo::AddStamp("Robustiter",3,iter,0);
+      AliSysInfo::AddStamp("FitDrift.RobustIter",3,iter,0);
       TLinearFitter *fitterRobust= new TLinearFitter(4,TString::Format("hyp%d",3).Data());
       TLinearFitter *fitterTRD= new TLinearFitter(4,TString::Format("hyp%d",3).Data());
       TLinearFitter *fitterTOF= new TLinearFitter(4,TString::Format("hyp%d",3).Data());


insert protection against kink candidates from TPC

--- TRD/qaRec/AliTRDtrackingEfficiencyCombined.cxx
+++ TRD/qaRec/AliTRDtrackingEfficiencyCombined.cxx
@@ -80,10 +80,6 @@
 	Int_t labelsrej[10000];
 	Float_t momacc[10000];
 	Float_t momrej[10000];
-	if(!AliTracker::GetFieldMap()){
-		AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
-		AliTracker::SetFieldMap(field, kTRUE);
-	}
 	TProfile *efficiency = (TProfile *)fContainer->At(0);
 	TProfile *contamination = (TProfile *)fContainer->At(1);

@@ -112,7 +108,7 @@
 				Int_t iref = 0;
 				while(!(trackRef = trkInf->GetTrackRef(iref++)));
 			}
-			if(!trackRef) printf("Error: Track Reference missing for Track %d\n", TRDtrack->GetLabel());
+			if(!trackRef) printf("Error: Track Reference missing for Track %d\n", trkInf->GetLabel());
 			mom =  trackRef ? trackRef->P() : TRDtrack->P();
 //           Accept track
 			if(fDebugLevel > 3)printf("Accept track\n");


Choose separator based on OS Change updates of penguin position

--- samples/penguins/main.cpp
+++ samples/penguins/main.cpp
@@ -38,10 +38,17 @@
     bool success = true;
     YSpriteSheetManager::kError result;

+    std::string kSeparator =
+#ifdef _WIN32
+    "\\";
+#else
+    "/";
+#endif
+
     for (int i = 0; i < size; ++i)
     {
         std::string key = sprites[i].key;
-        std::string value = YFileSystem::getCurrentDir() + "\\" + sprites[i].value;
+        std::string value = YFileSystem::getCurrentDir() + kSeparator + sprites[i].value;

         result = a_manager->add(key, value);

@@ -123,7 +130,7 @@
     {
 		if (falling == true)
 		{
-			YPoint position = penguin->position() + gravity;
+			YPoint position = penguin->position().add(gravity);

 			if (position.y() < ground)
 			{
@@ -136,8 +143,8 @@
 				YPoint position(penguin->position().x(), ground);

 				penguin->position(position);
+				crab->start(islandRect);
 				falling = false;
-				crab->start(islandRect);
 			}
 		}
 		else


fix portability problem between 32 and 64 bit as long is not a portable type.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@27842 27541ba8-7e3a-0410-8455-c3a389f83636

--- sql/mysql/src/TMySQLStatement.cxx
+++ sql/mysql/src/TMySQLStatement.cxx
@@ -337,8 +337,8 @@

    switch(fBind[npar].buffer_type) {
       case MYSQL_TYPE_LONG:
-         if (sig) snprintf(buf,100,"%ld",*((long*) addr));
-             else snprintf(buf,100,"%lu",*((unsigned long*) addr));
+         if (sig) snprintf(buf,100,"%d",*((int*) addr));
+             else snprintf(buf,100,"%u",*((unsigned int*) addr));
          break;
       case MYSQL_TYPE_LONGLONG:
          if (sig) snprintf(buf,100,"%lld",*((long long*) addr)); else
@@ -730,7 +730,7 @@
    fBuffer[npar].fStrBuffer = 0;

    ULong64_t allocsize = 0;
-
+
    bool doreset = false;

    switch (sqltype) {
@@ -945,7 +945,7 @@
    // Set parameter value as binary data.

    if (size>=maxsize) maxsize = size + 1;
-
+
    int bin_type = MYSQL_TYPE_BLOB;
    if (maxsize > 65525) bin_type = MYSQL_TYPE_MEDIUM_BLOB;
    if (maxsize > 16777205) bin_type = MYSQL_TYPE_LONG_BLOB;


Set timeout on loading ops

Set timeout on loading ops

--- scanner/engine/master.cpp
+++ scanner/engine/master.cpp
@@ -477,6 +477,12 @@
     const std::string& worker_address = worker_addresses_[k];
     //GRPC_BACKOFF_TIMEOUT(worker->LoadOp(&ctx, *op_path, &empty), status, 4);
     grpc::ClientContext ctx;
+    // Set timeout
+    u32 timeout = 5;
+    std::chrono::system_clock::time_point deadline =
+        std::chrono::system_clock::now() + std::chrono::seconds(timeout);
+    ctx.set_deadline(deadline);
+
     status = worker->LoadOp(&ctx, *op_path, &empty);
     LOG_IF(WARNING, !status.ok())
       << "Master could not load op for worker at " << worker_address << " ("
@@ -556,6 +562,12 @@
     // GRPC_BACKOFF_TIMEOUT(worker->RegisterOp(&ctx, *op_registration, &w_result),
     //                      status, 4);
     grpc::ClientContext ctx;
+    // Set timeout
+    u32 timeout = 5;
+    std::chrono::system_clock::time_point deadline =
+        std::chrono::system_clock::now() + std::chrono::seconds(timeout);
+    ctx.set_deadline(deadline);
+
     status = worker->RegisterOp(&ctx, *op_registration, &w_result);
     const std::string& worker_address = worker_addresses_[k];
     LOG_IF(WARNING, !status.ok())
@@ -628,6 +640,12 @@
     // GRPC_BACKOFF_TIMEOUT(worker->RegisterPythonKernel(&ctx, *python_kernel, &w_result),
     //                      status, 4);
     grpc::ClientContext ctx;
+    // Set timeout
+    u32 timeout = 5;
+    std::chrono::system_clock::time_point deadline =
+        std::chrono::system_clock::now() + std::chrono::seconds(timeout);
+    ctx.set_deadline(deadline);
+
     status = worker->RegisterPythonKernel(&ctx, *python_kernel, &w_result);
     const std::string& worker_address = worker_addresses_[k];
     LOG_IF(WARNING, !status.ok())


Readded support for commandline flags

Readded support for commandline flags

--- dev/src/recompiler_core/internalUtils.cpp
+++ dev/src/recompiler_core/internalUtils.cpp
@@ -788,22 +788,32 @@

 Commandline::Commandline(const char** argv, const int argc)
 {
-    // argv contains strings of the format "-varName=value". We loop over all args and find valid ones.
+    // argv contains strings of the format "-varName=value" or flags "-flag". We loop over all args and find valid ones.
     for (int i = 1; i < argc; ++i)
     {
         std::string s(argv[i]);
-        std::size_t equalsSign = 0;
+
+		// we are interested only in command arguments starting with '-'
+		if (s.at(0) != '-')
+			continue;
+		s = s.substr(1);
+
         // Find the equals sign; only proceed if it really exists
-        equalsSign = s.find("=");
-        if (equalsSign != std::string::npos) {
+        const auto equalsSign = s.find("=");
+        if (equalsSign != std::string::npos)
+		{
             // Get the option name from the string
             std::string part1 = s.substr(0, equalsSign);
+
             // If it was a valid option name (if it had a hyphen in the front) then proceed
-            if (part1.at(0) == '-') {
-                std::string part2 = s.substr(equalsSign + 1, std::string::npos);
-                AddOption(part1.substr(1, std::string::npos), AnsiToUnicode(part2));
-            }
+			std::string part2 = s.substr(equalsSign + 1, std::string::npos);
+            AddOption(part1, AnsiToUnicode(part2));
         }
+		else
+		{
+			// It's a flag
+			AddOption(s, std::wstring());
+		}
     }
 }


removed warnings in CDSDK file

removed warnings in CDSDK file

--- src/CanonControl/CdsdkPropertyAccess.cpp
+++ src/CanonControl/CdsdkPropertyAccess.cpp
@@ -385,6 +385,8 @@
 {
    Variant v;

+#pragma warning(disable: 4065)
+
 #define CASE_PROP_GET(PROPID) \
 //case PROPID##: v = s_##PROPID.Get(m_hSource); break;

@@ -449,10 +451,13 @@
    case propSaveTo: (); break;
    case propBatteryLevel: (); break;
 */
-   }
-}
-
-void ImagePropertyAccess::Enum(T_enImagePropertyType enImageProperty, std::vector<Variant>& vecValues)
+   default:
+      ATLASSERT(false);
+      break;
+   }
+}
+
+void ImagePropertyAccess::Enum(T_enImagePropertyType enImageProperty, std::vector<Variant>& /*vecValues*/)
 {
 #define CASE_PROP_ENUM(PROPID) \
 //case PROPID##: s_##PROPID.Enum(m_hSource, vecValues); break;
@@ -481,6 +486,9 @@
    case propSaveTo: (); break;
    case propBatteryLevel: (); break;
 */
+   default:
+      ATLASSERT(false);
+      break;
    }
 }


Top view of binary tree

Top view of binary tree

--- data_structures/binarySearch_tree/C++/krillxox_lowest_common_ancestor.cpp
+++ data_structures/binarySearch_tree/C++/krillxox_lowest_common_ancestor.cpp
@@ -99,34 +99,44 @@
 	return low;
   }

+
+
+};
+    void fillMap(Node *root, int lvl, int horizontalDistance, map<int, pair<int, int>> &m){
+    if(!root){
+      return;
+    }
+    if(!m.count(horizontalDistance)){
+      m[horizontalDistance] = make_pair(root->data, lvl);
+    }else if(m[horizontalDistance].second > lvl){
+      m[horizontalDistance] = make_pair(root->data, lvl);
+    }
+    fillMap(root->left, lvl+1, horizontalDistance-1, m);
+    fillMap(root->right, lvl+1, horizontalDistance+1, m);
+  }
+
   void topView(Node*root){
     if(!root){
       return;
     }
     map<int, pair<int, int>> m;
     fillMap(root, 0, 0, m);
-    for (auto i = m.begin(); i != i.end(); i++){
+    for (auto i = m.begin(); i != m.end(); i++){
       cout << i->second.first << " ";
     }
   }
+/*
+            4
+           /  \
+          /    \
+        2       7
+      /   \    /
+      1   3   6

-  void fillMap(Node *root, int lvl, int horizontalDistance, map<int, pair<int, int>> &m){
-    if(!root){
-      return;
-    }
-    if(!m.count(horizontalDistance)){
-      m[horizontalDistance] = make_pair(root->data, lvl);
-    }else if(m[d].second > lvl){
-      m[horizontalDistance] = make_pair(root->data, lvl);
-    }
-    fillMap(root->left, lvl+1, horizontalDistance-1, m);
-    fillMap(root->right, lvl+1, horizontalDistance+1, m);
-  }
+Nodes which are visible from top of the root node are considered for top view. In this 1 2 4 7 are visible
+from top of root node.(Consider this as 3d model and nodes which are visible from top is our ans.)

-};
-
-
-
+ */
 /*    int main() {

     Solution myTree;
@@ -164,9 +174,9 @@
 	root = myTree.insert(root,7);
 	root = myTree.insert(root,6);
   topView(root);
-	Node*ans = myTree.lca(root,1,7);
+	// Node*ans = myTree.lca(root,1,7);

-	std::cout << ans->data;
+	// std::cout << ans->data;

 	return 0;
 }


Hide the main application window and removed unnecessary code.

--- MenuTools/MenuTools.cpp
+++ MenuTools/MenuTools.cpp
@@ -11,6 +11,7 @@

 // Global Variables:
 HINSTANCE hInst;								// current instance
+HWND hWnd;										// current window handle
 TCHAR szTitle[MAX_LOADSTRING];					// The title bar text
 TCHAR szWindowClass[MAX_LOADSTRING];			// the main window class name

@@ -41,23 +42,17 @@
 	MyRegisterClass(hInstance);

 	// Perform application initialization:
-	if (!InitInstance (hInstance, nCmdShow))
+	if (!InitInstance (hInstance, SW_HIDE))
 	{
 		return FALSE;
 	}
-
-	HACCEL hAccelTable;
-	hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MENUTOOLS));

 	// Main message loop:
 	MSG msg;
 	while (GetMessage(&msg, NULL, 0, 0))
 	{
-		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
-		{
-			TranslateMessage(&msg);
-			DispatchMessage(&msg);
-		}
+		TranslateMessage(&msg);
+		DispatchMessage(&msg);
 	}

 	return (int) msg.wParam;
@@ -84,7 +79,7 @@
 	wcex.hIcon			= LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MENUTOOLS));
 	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
 	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);
-	wcex.lpszMenuName	= MAKEINTRESOURCE(IDC_MENUTOOLS);
+	wcex.lpszMenuName	= NULL;
 	wcex.lpszClassName	= szWindowClass;
 	wcex.hIconSm		= LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

@@ -103,12 +98,10 @@
 //
 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 {
-   HWND hWnd;
-
    hInst = hInstance; // Store instance handle in our global variable

    hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
-      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
+      CW_USEDEFAULT, 0, 0, 0, NULL, NULL, NULL, NULL);

    if (!hWnd)
    {
@@ -116,7 +109,6 @@
    }

    ShowWindow(hWnd, nCmdShow);
-   UpdateWindow(hWnd);

    return TRUE;
 }
@@ -127,15 +119,12 @@
 //  PURPOSE:  Processes messages for the main window.
 //
 //  WM_COMMAND	- process the application menu
-//  WM_PAINT	- Paint the main window
 //  WM_DESTROY	- post a quit message and return
 //
 //
 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
 	int wmId, wmEvent;
-	PAINTSTRUCT ps;
-	HDC hdc;

 	switch (message)
 	{
@@ -154,11 +143,6 @@
 		default:
 			return DefWindowProc(hWnd, message, wParam, lParam);
 		}
-		break;
-	case WM_PAINT:
-		hdc = BeginPaint(hWnd, &ps);
-		// TODO: Add any drawing code here...
-		EndPaint(hWnd, &ps);
 		break;
 	case WM_DESTROY:
 		PostQuitMessage(0);


Cast: Skip comments

Cast: Skip comments

--- src/cast.cc
+++ src/cast.cc
@@ -24,38 +24,44 @@

 #include "database/schema.h"
 #include "exception_xapian.h"                     // for CastError
+#include "reserved/reserved.h"                    // for is_comment
 #include "strings.hh"                             // for strings::format

 MsgPack
 Cast::cast(const MsgPack& obj)
 {
-	if (obj.size() == 1) {
-		const auto str_key = obj.begin()->str();
+	auto it = obj.begin();
+	auto it_e = obj.end();
+	for (; it != it_e; ++it) {
+		auto str_key = it->str_view();
+		if (is_comment(str_key)) {
+			continue;
+		}
 		switch (get_hash_type(str_key)) {
 			case HashType::INTEGER:
-				return integer(obj.at(str_key));
+				return integer(it.value());
 			case HashType::POSITIVE:
-				return positive(obj.at(str_key));
+				return positive(it.value());
 			case HashType::FLOAT:
-				return static_cast<double>(floating(obj.at(str_key)));
+				return static_cast<double>(floating(it.value()));
 			case HashType::BOOLEAN:
-				return boolean(obj.at(str_key));
+				return boolean(it.value());
 			case HashType::KEYWORD:
 			case HashType::TEXT:
 			case HashType::STRING:
-				return string(obj.at(str_key));
+				return string(it.value());
 			case HashType::UUID:
-				return uuid(obj.at(str_key));
+				return uuid(it.value());
 			case HashType::DATE:
 			case HashType::DATETIME:
-				return datetime(obj.at(str_key));
+				return datetime(it.value());
 			case HashType::TIME:
-				return time(obj.at(str_key));
+				return time(it.value());
 			case HashType::TIMEDELTA:
-				return timedelta(obj.at(str_key));
+				return timedelta(it.value());
 			case HashType::EWKT:
-				return ewkt(obj.at(str_key));
+				return ewkt(it.value());
 			case HashType::POINT:
 			case HashType::CIRCLE:
 			case HashType::CONVEX:
@@ -73,7 +79,7 @@
 		}
 	}

-	THROW(CastError, "Expected map with one element");
+	THROW(CastError, "Expected map with one valid cast");
 }


solved bug in MOKAlens.cpp

solved bug in MOKAlens.cpp

--- MultiPlane/MOKAlens.cpp
+++ MultiPlane/MOKAlens.cpp
@@ -425,7 +425,7 @@
    */

   // interpolate from the maps
-  Utilities::Interpolator<valarray<float>> interp(xx,map->nx,map->boxlMpc/map->h,map->center);
+  Utilities::Interpolator<valarray<float> > interp(xx,map->nx,map->boxlMpc/map->h,map->center);
   alpha[0] = interp.interpolate(map->alpha1);
   alpha[1] = interp.interpolate(map->alpha2);
   gamma[0] = interp.interpolate(map->gamma1);


projection for join is working

projection for join is working

--- src/backend/executor/nested_loop_join_executor.cpp
+++ src/backend/executor/nested_loop_join_executor.cpp
@@ -57,17 +57,17 @@
  * @return true on success, false otherwise.
  */
 bool NestedLoopJoinExecutor::DExecute() {
-  LOG_TRACE("********** Nested Loop Join executor :: 2 children \n");
+  LOG_INFO("********** Nested Loop Join executor :: 2 children \n");

   bool right_scan_end = false;
   // Try to get next tile from RIGHT child
   if (children_[1]->Execute() == false) {
-    LOG_TRACE("Did not get right tile \n");
+    LOG_INFO("Did not get right tile \n");
     right_scan_end = true;
   }

   if (right_scan_end == true) {
-    LOG_TRACE("Resetting scan for right tile \n");
+    LOG_INFO("Resetting scan for right tile \n");
     children_[1]->Init();
     if (children_[1]->Execute() == false) {
       LOG_ERROR("Did not get right tile on second try\n");
@@ -75,18 +75,18 @@
     }
   }

-  LOG_TRACE("Got right tile \n");
+  LOG_INFO("Got right tile \n");

   if (left_scan_start == true || right_scan_end == true) {
     left_scan_start = false;
     // Try to get next tile from LEFT child
     if (children_[0]->Execute() == false) {
-      LOG_TRACE("Did not get left tile \n");
+      LOG_INFO("Did not get left tile \n");
       return false;
     }
-    LOG_TRACE("Got left tile \n");
+    LOG_INFO("Got left tile \n");
   } else {
-    LOG_TRACE("Already have left tile \n");
+    LOG_INFO("Already have left tile \n");
   }

   std::unique_ptr<LogicalTile> left_tile(children_[0]->GetOutput());
@@ -139,11 +139,9 @@
        column_itr++)
     position_lists.push_back(std::vector<oid_t>());

-  LOG_TRACE("left col count: %lu, right col count: %lu", left_tile_column_count, right_tile_column_count);
-  LOG_TRACE("left col count: %lu, right col count: %lu", left_tile.get()->GetColumnCount(), right_tile.get()->GetColumnCount());
-  LOG_TRACE("left row count: %lu, right row count: %lu", left_tile_row_count, right_tile_row_count);
-
-  auto &direct_map_list = proj_info_->GetDirectMapList();
+  LOG_INFO("left col count: %lu, right col count: %lu", left_tile_column_count, right_tile_column_count);
+  LOG_INFO("left col count: %lu, right col count: %lu", left_tile.get()->GetColumnCount(), right_tile.get()->GetColumnCount());
+  LOG_INFO("left row count: %lu, right row count: %lu", left_tile_row_count, right_tile_row_count);

   // Go over every pair of tuples in left and right logical tiles
   for (size_t left_tile_row_itr = 0; left_tile_row_itr < left_tile_row_count;
@@ -170,28 +168,34 @@

       // Insert a tuple into the output logical tile
-      for (auto &entry : direct_map_list) {
-        if (entry.second.first == 0) {
-         position_lists[entry.first].push_back(
-            left_tile_position_lists[entry.second.second]
-                                    [left_tile_row_itr]);
-        } else {
-          position_lists[entry.first]
-            .push_back(right_tile_position_lists[entry.second.second]
-                                                [right_tile_row_itr]);
-        }
-      }
-
-
       // First, copy the elements in left logical tile's tuple
+           for (size_t output_tile_column_itr = 0;
+                output_tile_column_itr < left_tile_column_count;
+                output_tile_column_itr++) {
+             position_lists[output_tile_column_itr].push_back(
+                 left_tile_position_lists[output_tile_column_itr]
+                                         [left_tile_row_itr]);
+           }
+
+           // Then, copy the elements in left logical tile's tuple
+           for (size_t output_tile_column_itr = 0;
+                output_tile_column_itr < right_tile_column_count;
+                output_tile_column_itr++) {
+             position_lists[left_tile_column_count + output_tile_column_itr]
+                 .push_back(right_tile_position_lists[output_tile_column_itr]
+                                                     [right_tile_row_itr]);
+           }
+
+
+      // First, copy the elements in left logical tile's tuple
     }
   }

   for (auto col : position_lists) {
-    LOG_TRACE("col");
+    LOG_INFO("col");
     for (auto elm : col) {
       (void)elm;  // silent compiler
-      LOG_TRACE("elm: %u", elm);
+      LOG_INFO("elm: %u", elm);
     }
   }


Tab to space

Tab to space

--- Burnside/Source.cpp
+++ Burnside/Source.cpp
@@ -48,133 +48,133 @@

 int main(int argc, char** argv)
 {
-	vector<vector<int>> group_elements;
-	int n = 5;
-	int c = 10; // Polya's enumeration work much better when c is large - enumerating the configuration space is expensive
-	for (int offset = 0; offset < n; offset++)
-	{
-		vector<int> forward;
-		for (int i = 0; i < n; i++)
-		{
-			forward.push_back((i + offset) % n);
-		}
-		group_elements.push_back(forward);
-		vector<int> backward;
-		for (int i = 0; i < n; i++)
-		{
-			backward.push_back(((n - i) + offset) % n);
-		}
-		group_elements.push_back(backward);
-	}
+    vector<vector<int>> group_elements;
+    int n = 5;
+    int c = 10; // Polya's enumeration work much better when c is large - enumerating the configuration space is expensive
+    for (int offset = 0; offset < n; offset++)
+    {
+        vector<int> forward;
+        for (int i = 0; i < n; i++)
+        {
+            forward.push_back((i + offset) % n);
+        }
+        group_elements.push_back(forward);
+        vector<int> backward;
+        for (int i = 0; i < n; i++)
+        {
+            backward.push_back(((n - i) + offset) % n);
+        }
+        group_elements.push_back(backward);
+    }

-	bool burnside = true;
-	bool polya = true;
+    bool burnside = true;
+    bool polya = true;

-	cout << "Begin Group" << endl;
-	for (size_t i = 0; i < group_elements.size(); i++)
-	{
-		for (size_t j = 0; j < group_elements[i].size(); j++)
-		{
-			cout << group_elements[i][j] << " ";
-		}
-		cout << endl;
-	}
-	cout << "End Group" << endl;
-	if (burnside)
-	{
-		cout << "Starting brute force verification of Burnside's lemma" << endl;
-		// This version of the code directly exercise the Burnside's lemma as is:
-		// This is inefficient because we have to go through all configurations
-		vector<int> config;
-		vector<int> mirror;
-		config.resize(n);
-		mirror.resize(n);
+    cout << "Begin Group" << endl;
+    for (size_t i = 0; i < group_elements.size(); i++)
+    {
+        for (size_t j = 0; j < group_elements[i].size(); j++)
+        {
+            cout << group_elements[i][j] << " ";
+        }
+        cout << endl;
+    }
+    cout << "End Group" << endl;
+    if (burnside)
+    {
+        cout << "Starting brute force verification of Burnside's lemma" << endl;
+        // This version of the code directly exercise the Burnside's lemma as is:
+        // This is inefficient because we have to go through all configurations
+        vector<int> config;
+        vector<int> mirror;
+        config.resize(n);
+        mirror.resize(n);

-		int all_stablizer_count = 0;
-		for (size_t k = 0; k < group_elements.size(); k++)
-		{
-			for (size_t j = 0; j < group_elements[k].size(); j++)
-			{
-				cout << group_elements[k][j] << " ";
-			}
-			int fixed_count = 0;
-			int seq = 0;
+        int all_stablizer_count = 0;
+        for (size_t k = 0; k < group_elements.size(); k++)
+        {
+            for (size_t j = 0; j < group_elements[k].size(); j++)
+            {
+                cout << group_elements[k][j] << " ";
+            }
+            int fixed_count = 0;
+            int seq = 0;

-			// A simple odometer to loop through all the config
-			while (true)
-			{
-				int cur = seq;
-				bool last = true;
-				for (int i = 0; i < n; i++)
-				{
-					config[i] = cur % c;
-					cur = cur / c;
-					last = last & (config[i] == c - 1);
-				}
+            // A simple odometer to loop through all the config
+            while (true)
+            {
+                int cur = seq;
+                bool last = true;
+                for (int i = 0; i < n; i++)
+                {
+                    config[i] = cur % c;
+                    cur = cur / c;
+                    last = last & (config[i] == c - 1);
+                }

-				// Here we have got a configuration - check if it is fixed by the current permutation
+                // Here we have got a configuration - check if it is fixed by the current permutation

-				bool is_fixed = true;
-				for (int l = 0; is_fixed && l < n; l++)
-				{
-					is_fixed = is_fixed && (config[group_elements[k][l]] == config[l]);
-				}
+                bool is_fixed = true;
+                for (int l = 0; is_fixed && l < n; l++)
+                {
+                    is_fixed = is_fixed && (config[group_elements[k][l]] == config[l]);
+                }

-				if (is_fixed)
-				{
-					fixed_count++;
-				}
+                if (is_fixed)
+                {
+                    fixed_count++;
+                }

-				if (last)
-				{
-					break;
-				}
-				seq++;
-			}
-			cout << " fixes " << fixed_count << " configurations" << endl;
-			all_stablizer_count += fixed_count;
-		}
-		cout << all_stablizer_count << " " << group_elements.size() << endl;
-	}
+                if (last)
+                {
+                    break;
+                }
+                seq++;
+            }
+            cout << " fixes " << fixed_count << " configurations" << endl;
+            all_stablizer_count += fixed_count;
+        }
+        cout << all_stablizer_count << " " << group_elements.size() << endl;
+    }

-	if (polya)
-	{
-		cout << "Starting polya's enumeration formula" << endl;
-		int all_stablizer_count = 0;
-		for (size_t i = 0; i < group_elements.size(); i++)
-		{
-			vector<bool> used;
-			used.resize(group_elements[i].size());
-			for (size_t j = 0; j < used.size(); j++)
-			{
-				used[j] = false;
-			}
-			for (size_t j = 0; j < group_elements[i].size(); j++)
-			{
-				cout << group_elements[i][j] << " ";
-			}
-			int fixed_count = 1;
-			for (size_t j = 0; j < group_elements[i].size(); j++)
-			{
-				size_t k = j;
-				int element_in_cycle = 0;
-				cout << "(";
-				while (!used[k])
-				{
-					element_in_cycle++;
-					cout << k << " ";
-					used[k] = true;
-					k = group_elements[i][k];
-				}
-				cout << ") [" << element_in_cycle << "] ";
-				if (element_in_cycle != 0)
-				{
-					fixed_count *= c;
-				}
-			}
-			cout << " fixes " << fixed_count << " configurations" << endl;
-			all_stablizer_count += fixed_count;
-		}
-		cout << all_stablizer_count << " " << group_elements.size() << endl;
-	}
+    if (polya)
+    {
+        cout << "Starting polya's enumeration formula" << endl;
+        int all_stablizer_count = 0;
+        for (size_t i = 0; i < group_elements.size(); i++)
+        {
+            vector<bool> used;
+            used.resize(group_elements[i].size());
+            for (size_t j = 0; j < used.size(); j++)
+            {
+                used[j] = false;
+            }
+            for (size_t j = 0; j < group_elements[i].size(); j++)
+            {
+                cout << group_elements[i][j] << " ";
+            }
+            int fixed_count = 1;
+            for (size_t j = 0; j < group_elements[i].size(); j++)
+            {
+                size_t k = j;
+                int element_in_cycle = 0;
+                cout << "(";
+                while (!used[k])
+                {
+                    element_in_cycle++;
+                    cout << k << " ";
+                    used[k] = true;
+                    k = group_elements[i][k];
+                }
+                cout << ") [" << element_in_cycle << "] ";
+                if (element_in_cycle != 0)
+                {
+                    fixed_count *= c;
+                }
+            }
+            cout << " fixes " << fixed_count << " configurations" << endl;
+            all_stablizer_count += fixed_count;
+        }
+        cout << all_stablizer_count << " " << group_elements.size() << endl;
+    }
 }


Update the-maze-ii.cpp

Update the-maze-ii.cpp

--- C++/the-maze-ii.cpp
+++ C++/the-maze-ii.cpp
@@ -1,5 +1,5 @@
 // Time:  O(max(r, c) * wlogw)
-// Space: O(w^2)
+// Space: O(w)

 class Solution {
 public:


Update ugly-number.cpp

Update ugly-number.cpp

--- C++/ugly-number.cpp
+++ C++/ugly-number.cpp
@@ -1,4 +1,4 @@
-// Time:  O(logn)
+// Time:  O(logn) = O(1)
 // Space: O(1)

 class Solution {


Fixed truncation warning

Fixed truncation warning

--- src/Frodo-core/core/math/mat4.cpp
+++ src/Frodo-core/core/math/mat4.cpp
@@ -77,8 +77,8 @@
 mat4 mat4::Perspective(float32 aspect, float32 fov, float32 zNear, float32 zFar) {
 	mat4 m(1);

-	m.m[0 + 0 * 4] = 1.0f / (aspect * (tanh(fov * 0.5f)));
-	m.m[1 + 1 * 4] = 1.0f / (tanh(fov * 0.5f));
+	m.m[0 + 0 * 4] = 1.0f / (aspect * ((float32)tanh(fov * 0.5f)));
+	m.m[1 + 1 * 4] = 1.0f / ((float32)tanh(fov * 0.5f));
 	m.m[2 + 2 * 4] = zFar / (zFar - zNear);
 	m.m[3 + 2 * 4] = 1;
 	m.m[2 + 3 * 4] = -zNear * (zFar / (zFar - zNear));


coverity#708715 unused member variable

coverity#708715 unused member variable

Change-Id: Idc7c58ec1f2646276e16177dcb748daea8f85849


INTEGRATION: CWS changefileheader (1.7.450); FILE MERGED 2008/03/31 16:28:48 rt 1.7.450.1: #i87441# Change license header to LPGL v3.

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


Restore separate coords/radius

Restore separate coords/radius

--- caffe/src/caffe/layers/molgrid_data_layer.cpp
+++ caffe/src/caffe/layers/molgrid_data_layer.cpp
@@ -40,7 +40,7 @@

   double maxdsq = 0.0;
   for (unsigned i = 0, n = orig_lig_atoms.size(); i < n; i++) {
-    vec pos(orig_lig_atoms.coord_radius(i,0),orig_lig_atoms.coord_radius(i,1),orig_lig_atoms.coord_radius(i,2));
+    vec pos(orig_lig_atoms.coords(i,0),orig_lig_atoms.coords(i,1),orig_lig_atoms.coords(i,2));
     pos -= c;
     double dsq = pos.norm_sqr();
     if (dsq > maxdsq)
@@ -132,9 +132,9 @@
   CoordinateSet& ratoms = batch_info[batch_idx].transformed_rec_atoms;
   for (unsigned i = 0, n = ratoms.size(); i < n; ++i) {
     gfloat3 a; //todo: change to float3
-    a.x = ratoms.coord_radius[i][0];
-    a.y = ratoms.coord_radius[i][1];
-    a.z = ratoms.coord_radius[i][2];
+    a.x = ratoms.coords(i,0);
+    a.y = ratoms.coords(i,1);
+    a.z = ratoms.coords(i,2);
     atoms.push_back(a);
   }
 }
@@ -147,9 +147,9 @@
   CoordinateSet& latoms = batch_info[batch_idx].transformed_lig_atoms;
   for (unsigned i = 0, n = latoms.size(); i < n; ++i) {
     gfloat3 a; //todo: change to float3
-    a.x = latoms.coord_radius[i][0];
-    a.y = latoms.coord_radius[i][1];
-    a.z = latoms.coord_radius[i][2];
+    a.x = latoms.coords(i,0);
+    a.y = latoms.coords(i,1);
+    a.z = latoms.coords(i,2);
     atoms.push_back(a);
   }
 }
@@ -213,7 +213,7 @@
   for (unsigned i = 0, n = ratoms.size(); i < n; ++i)
   {
     gfloat3 g = gfloat3(grads(i,0), grads(i,1), grads(i,2));
-    gfloat3 a {ratoms.coord_radius[i][0], ratoms.coord_radius[i][1], ratoms.coord_radius[i][2]};
+    gfloat3 a {ratoms.coords(i,0), ratoms.coords(i,1), ratoms.coords(i,2)};
     vec v(g.x,g.y,g.z);
     vec pos(a.x,a.y,a.z);

@@ -235,7 +235,7 @@

   gradient.clear();
   for (unsigned i = 0, n = ratoms.size(); i < n; ++i) {
-    string xyz = xyz_to_string(ratoms.coord_radius[i][0], ratoms.coord_radius[i][1], ratoms.coord_radius[i][2]);
+    string xyz = xyz_to_string(ratoms.coords(i,0), ratoms.coords(i,1), ratoms.coords(i,2));
     gradient[xyz] = gfloat3(grads(i,0), grads(i,1), grads(i,2));
   }
 }
@@ -252,7 +252,7 @@
   relmap.clear();

   for (unsigned i = 0, n = atoms.size(); i < n; ++i) {
-    string xyz = xyz_to_string(atoms.coord_radius[i][0], atoms.coord_radius[i][1], atoms.coord_radius[i][2]);
+    string xyz = xyz_to_string(atoms.coords(i,0), atoms.coords(i,1), atoms.coords(i,2));
     relmap[xyz] = relevance[i];
   }
 }
@@ -288,7 +288,7 @@

   for (unsigned i = 0, n = latoms.size(); i < n; ++i) {
     gfloat3 g = gfloat3(grads(i,0), grads(i,1), grads(i,2));
-    string xyz = xyz_to_string(latoms.coord_radius[i][0], latoms.coord_radius[i][1], latoms.coord_radius[i][2]);
+    string xyz = xyz_to_string(latoms.coords(i,0), latoms.coords(i,1), latoms.coords(i,2));
     gradient[xyz] = g;
   }
 }
@@ -305,7 +305,7 @@
   relmap.clear();

   for (unsigned i = 0, n = latoms.size(); i < n; ++i) {
-    string xyz = xyz_to_string(latoms.coord_radius[i][0], latoms.coord_radius[i][1], latoms.coord_radius[i][2]);
+    string xyz = xyz_to_string(latoms.coords(i,0), latoms.coords(i,1), latoms.coords(i,2));
     relmap[xyz] = relevance[i];
   }
 }
@@ -625,15 +625,15 @@
 static void apply_jitter(CoordinateSet& c, float jitter) {
   if(jitter <= 0) return;
   rng_t* rng = caffe_rng();
-  bool ongpu = c.coord_radius.ongpu();
-  c.coord_radius.tocpu();
+  bool ongpu = c.coords.ongpu();
+  c.coords.tocpu();
   for (unsigned i = 0, n = c.size(); i < n; i++) {
     for(unsigned j = 0; j < 3; j++) {
       float diff = jitter * (unit_sample(rng)*2.0-1.0);
-      c.coord_radius[i][j] += diff;
-    }
-  }
-  if(ongpu) c.coord_radius.togpu();
+      c.coords(i,j) += diff;
+    }
+  }
+  if(ongpu) c.coords.togpu();
 }

 //take a mol info, which includes receptor and ligand atoms


richards: bug in richardsborehole.c - i put Real min2 = min2; should have been Real min2 = max2

r24047

--- modules/richards/src/dirackernels/RichardsBorehole.C
+++ modules/richards/src/dirackernels/RichardsBorehole.C
@@ -270,7 +270,7 @@
   Real max1 = eig_vec1*ele->point(0);
   Real max2 = eig_vec2*ele->point(0);
   Real min1 = max1;
-  Real min2 = min2;
+  Real min2 = max2;
   Real proj;
   for (unsigned int i = 1; i < ele->n_nodes(); i++)
     {


Lowered log level for timing stats output at end of run

--- src/amrreset.cpp
+++ src/amrreset.cpp
@@ -105,9 +105,9 @@
                         ddata->timers[FCLAW2D_TIMER_EXCHANGE].cumulative),
                        "UNACCOUNTED");
         sc_stats_compute ((*domain)->mpicomm, FCLAW2D_TIMER_COUNT, stats);
-        sc_stats_print (sc_package_id, SC_LP_PRODUCTION, FCLAW2D_TIMER_COUNT,
+        sc_stats_print (sc_package_id, SC_LP_ESSENTIAL, FCLAW2D_TIMER_COUNT,
                         stats, 1, 0);
-        SC_GLOBAL_PRODUCTIONF ("Procs %d advance %d %g exchange %d %g "
+        SC_GLOBAL_ESSENTIALF ("Procs %d advance %d %g exchange %d %g "
                                "regrid %d %g\n", (*domain)->mpisize,
                                ddata->count_amr_advance,
                                stats[FCLAW2D_TIMER_ADVANCE].average,
@@ -115,7 +115,7 @@
                                stats[FCLAW2D_TIMER_EXCHANGE].average,
                                ddata->count_amr_regrid,
                                stats[FCLAW2D_TIMER_REGRID].average);
-        SC_GLOBAL_PRODUCTIONF ("Max/P %d advance %d %g exchange %d %g "
+        SC_GLOBAL_ESSENTIALF ("Max/P %d advance %d %g exchange %d %g "
                                "regrid %d %g\n", (*domain)->mpisize,
                                ddata->count_amr_advance,
                                stats[FCLAW2D_TIMER_ADVANCE].max,


specify outs, test=develop (#24537)

specify outs, test=develop (#24537)

--- paddle/fluid/pybind/op_function_generator.cc
+++ paddle/fluid/pybind/op_function_generator.cc
@@ -24,13 +24,48 @@
 #include "paddle/fluid/pybind/pybind.h"
 #include "paddle/fluid/string/string_helper.h"

+// NOTE(zhiqiu): Commonly, the inputs in auto-generated OP function are
+// determined by the OP`s proto automatically, i.e., all the inputs registered
+// in OpMaker.
+// However, some OPs have dispensable inputs, which means the input can
+// be none for some conditions. It is discovered that most dispensable inputs
+// is not used in imperative mode, so we drop those inputs when generating OP
+// functions. While, for very few OPs, the dispensable inputs are used, we
+// need to manually specify them in this map.
 std::map<std::string, std::set<std::string>> op_ins_map = {
     {"layer_norm", {"X", "Scale", "Bias"}},
     {"gru_unit", {"Input", "HiddenPrev", "Weight", "Bias"}},
     {"label_smooth", {"X", "PriorDist"}},
     {"assign", {"X"}},
+    {"fake_quantize_dequantize_moving_average_abs_max",
+     {"X", "InScale", "InAccum", "InState"}},
 };
-std::map<std::string, std::set<std::string>> op_passing_out_map = {
+
+// NOTE(zhiqiu): Like op_ins_map.
+// Commonly, the outputs in auto-generated OP function are determined by the
+// OP`s proto automatically, i.e., all the outputs registered in OpMaker.
+// However, some OPs have dispensable outputs, which means the output can
+// be none for some conditions. It is discovered that most dispensable outputs
+// is not used in imperative mode, so we drop those outputs when generating OP
+// functions. While, for very few OPs, the dispensable outputs are used, we
+// need to manually specify them in this map.
+std::map<std::string, std::set<std::string>> op_outs_map = {
+    {"fake_quantize_dequantize_moving_average_abs_max",
+     {"Out", "OutScale", "OutAccum", "OutState"}},
+};
+
+// NOTE(zhiqiu): Commonly, the outputs in auto-generated OP function are
+// generated in C++ automatically.
+// However, some OPs need to pass the outputs from Python instead of generating
+// them in C++. There are mainly 2 reasons for that,
+// (1) Optimizer OPs need to update the input param in-place, like sgd.
+//     So they need to pass the output which is same as input param.
+// (2) Very few python APIs has out in their arguments, like fill_constant.
+//     So they need to pass the python output to C++.
+//     Actually, this is not a good design, since it may break the SSA graph,
+//     especially in declarative mode.
+// For those OPs, we need to manually specify the outs need to pass in this map.
+std::map<std::string, std::set<std::string>> op_passing_outs_map = {
     {"sgd", {"ParamOut"}},
     {"adam",
      {"ParamOut", "Moment1Out", "Moment2Out", "Beta1PowOut", "Beta2PowOut"}},
@@ -38,7 +73,10 @@
     {"batch_norm", {"MeanOut", "VarianceOut"}},
     {"accuracy", {"Correct", "Total"}},
     {"fill_constant", {"Out"}},
-    {"matmul", {"Out"}}};
+    {"matmul", {"Out"}},
+    {"fake_quantize_dequantize_moving_average_abs_max",
+     {"OutScale", "OutAccum", "OutState"}},
+};

 // clang-format off
 const char* OUT_INITIALIZER_TEMPLATE =
@@ -47,17 +85,30 @@

 const char* INPUT_INITIALIZER_TEMPLATE = R"({"%s", {%s}})";
 const char* INPUT_LIST_INITIALIZER_TEMPLATE = R"({"%s", %s})";
-const char* INPUT_INITIALIZER_TEMPLATE_WITH_NULL = R"(
-    if (%s != nullptr) {
-      ins["%s"] = {%s};
-    }
+
+const char* INPUT_INITIALIZER_TEMPLATE_WITH_NULL = R"(
+    if (%s != nullptr) {
+      ins["%s"] = {%s};
+    }
 )";
-const char* INPUT_INITIALIZER_TEMPLATE_WITH_NULL_LIST = R"(
-    if (%s != nullptr) {
-      ins["%s"] = %s;
-    }
+
+const char* INPUT_INITIALIZER_TEMPLATE_WITH_NULL_LIST = R"(
+    if (%s.size() != 0) {
+      ins["%s"] = %s;
+    }
 )";

+const char* OUTPUT_INITIALIZER_TEMPLATE_WITH_NULL = R"(
+    if (%s != nullptr) {
+      outs["%s"] = {%s};
+    }
+)";
+
+const char* OUTPUT_INITIALIZER_TEMPLATE_WITH_NULL_LIST = R"(
+    if (%s.size() != 0) {
+      outs["%s"] = %s;
+    }
+)";
 // if inputs is list, no need {}
 const char* ARG_OUT_NUM = R"(%sNum)";
 const char* ARG_OUT_NUM_TYPE = R"(size_t )";
@@ -95,14 +146,19 @@
 const char* PYBIND_ITEM_TEMPLATE = R"(  %s.def("%s", &%s);)";

 // clang-format on
-static inline bool FindInputInSpecialization(const std::string& op_type,
-                                             const std::string& in_name) {
+static inline bool FindInsMap(const std::string& op_type,
+                              const std::string& in_name) {
   return op_ins_map[op_type].count(in_name);
 }

-static inline bool FindOutoutInSpecialization(const std::string& op_type,
-                                              const std::string& out_name) {
-  return op_passing_out_map[op_type].count(out_name);
+static inline bool FindOutsMap(const std::string& op_type,
+                               const std::string& out_name) {
+  return op_outs_map[op_type].count(out_name);
+}
+
+static inline bool FindPassingOutsMap(const std::string& op_type,
+                                      const std::string& out_name) {
+  return op_passing_outs_map[op_type].count(out_name);
 }

 static std::tuple<std::vector<std::string>, std::vector<std::string>>
@@ -131,7 +187,7 @@
     for (auto& input : op_proto->inputs()) {
       auto& in_name = input.name();
       // skip those dispensable inputs, like ResidualData in conv2d
-      if (input.dispensable() && !FindInputInSpecialization(op_type, in_name)) {
+      if (input.dispensable() && !FindInsMap(op_type, in_name)) {
         continue;
       }
       const auto in_type = input.duplicable() ? VAR_LIST_TYPE : VAR_TYPE;
@@ -165,30 +221,41 @@

     // Generate outs initializer
     std::string outs_initializer = "{";
+    std::string outs_initializer_with_null = "";
     std::string return_type = "";
     std::string return_str = "";

     int outs_num = 0;
     for (auto& output : op_proto->outputs()) {
-      if (output.dispensable()) {
+      auto& out_name = output.name();
+      // skip those dispensable oututs
+      if (output.dispensable() && !FindOutsMap(op_type, out_name)) {
         continue;
       }
       const auto out_type = output.duplicable() ? VAR_LIST_TYPE : VAR_TYPE;
       const auto return_template =
           output.duplicable() ? RETURN_LIST_TEMPLATE : RETURN_TEMPLATE;
-      auto& out_name = output.name();
-      std::string out_initializer_str;
-      if (FindOutoutInSpecialization(op_type, out_name)) {
+      if (FindPassingOutsMap(op_type, out_name)) {
         if (input_args != "") {
           input_args += ",";
         }
         input_args += out_type;
         input_args += out_name;
-        const auto out_template = output.duplicable()
-                                      ? INPUT_LIST_INITIALIZER_TEMPLATE
-                                      : INPUT_INITIALIZER_TEMPLATE;
-        out_initializer_str +=
-            paddle::string::Sprintf(out_template, out_name, out_name);
+
+        if (output.dispensable()) {
+          const auto out_template =
+              output.duplicable() ? OUTPUT_INITIALIZER_TEMPLATE_WITH_NULL_LIST
+                                  : OUTPUT_INITIALIZER_TEMPLATE_WITH_NULL;
+          outs_initializer_with_null += paddle::string::Sprintf(
+              out_template, out_name, out_name, out_name);
+        } else {
+          const auto out_template = output.duplicable()
+                                        ? INPUT_LIST_INITIALIZER_TEMPLATE
+                                        : INPUT_INITIALIZER_TEMPLATE;
+          outs_initializer +=
+              paddle::string::Sprintf(out_template, out_name, out_name);
+          outs_initializer += ",";
+        }
       } else {
         // There are few Operators that have duplicable output, like `Out` in
         // split op. We need to specify the number of variables for the
@@ -200,12 +267,13 @@
           auto out_num_str = paddle::string::Sprintf(ARG_OUT_NUM, out_name);
           input_args += ARG_OUT_NUM_TYPE;
           input_args += out_num_str;
-          out_initializer_str = paddle::string::Sprintf(
+          outs_initializer += paddle::string::Sprintf(
               OUT_DUPLICABLE_INITIALIZER_TEMPLATE, out_name, out_num_str);
         } else {
-          out_initializer_str =
+          outs_initializer +=
               paddle::string::Sprintf(OUT_INITIALIZER_TEMPLATE, out_name);
         }
+        outs_initializer += ",";
       }

       return_type += out_type;
@@ -213,9 +281,6 @@
       return_str += paddle::string::Sprintf(return_template, out_name);
       return_str += ",";
       outs_num += 1;
-
-      outs_initializer += out_initializer_str;
-      outs_initializer += ",";
     }
     if (outs_initializer.back() == ',') {
       outs_initializer.pop_back();
@@ -241,7 +306,8 @@
     // generate op funtcion body
     auto op_function_str = paddle::string::Sprintf(
         OP_FUNCTION_TEMPLATE, return_type, func_name, function_args,
-        outs_initializer, ins_initializer, ins_initializer_with_null, op_type,
+        outs_initializer, ins_initializer,
+        ins_initializer_with_null + outs_initializer_with_null, op_type,
         return_str);

     // generate pybind item


Some minor cleaning up.

Some minor cleaning up.

--- src/analyser.cpp
+++ src/analyser.cpp
@@ -405,9 +405,9 @@
     std::string getHints(const UnitsMap &map);
     UnitsMap analyseEquationUnitsAst(const AnalyserEquationAstPtr &ast,
                                      std::vector<std::string> &issueDescriptions);
-    double analyseEquationMultiplierAst(const AnalyserEquationAstPtr &ast,
-                                        std::vector<std::string> &issueDescriptions,
-                                        double multiplier);
+    double analyseEquationUnitsMultiplierAst(const AnalyserEquationAstPtr &ast,
+                                             std::vector<std::string> &issueDescriptions,
+                                             double multiplier);
     void analyseEquationUnits(const AnalyserEquationAstPtr &ast);

     double scalingFactor(const VariablePtr &variable);
@@ -1769,9 +1769,9 @@
     return unitsMap;
 }

-double Analyser::AnalyserImpl::analyseEquationMultiplierAst(const AnalyserEquationAstPtr &ast,
-                                                            std::vector<std::string> &issueDescriptions,
-                                                            double multiplier)
+double Analyser::AnalyserImpl::analyseEquationUnitsMultiplierAst(const AnalyserEquationAstPtr &ast,
+                                                                 std::vector<std::string> &issueDescriptions,
+                                                                 double multiplier)
 {
     if (ast != nullptr) {
         // Evaluate multiplier if we are at a variable
@@ -1799,8 +1799,8 @@
         // We know if we have reached an internal vertex that we have a mathematical operation as it's type.
         if (ast->mPimpl->mOwnedLeftChild != nullptr || ast->mPimpl->mOwnedRightChild != nullptr) {
             // Evaluate left, right subtrees first
-            double leftMult = analyseEquationMultiplierAst(ast->mPimpl->mOwnedLeftChild, issueDescriptions, multiplier);
-            double rightMult = analyseEquationMultiplierAst(ast->mPimpl->mOwnedRightChild, issueDescriptions, multiplier);
+            double leftMult = analyseEquationUnitsMultiplierAst(ast->mPimpl->mOwnedLeftChild, issueDescriptions, multiplier);
+            double rightMult = analyseEquationUnitsMultiplierAst(ast->mPimpl->mOwnedRightChild, issueDescriptions, multiplier);

             // The only time we check multiplier mismatch is in a comparison operation.
             if (isDirectOperator(ast)) {
@@ -1867,7 +1867,7 @@
     std::vector<std::string> issueDescriptions;

     analyseEquationUnitsAst(ast, issueDescriptions);
-    analyseEquationMultiplierAst(ast, issueDescriptions, 0.0);
+    analyseEquationUnitsMultiplierAst(ast, issueDescriptions, 0.0);

     for (const auto &issueDescription : issueDescriptions) {
         auto issue = Issue::create();


Fix a typo that broke GLSL buffer copies.

--- src/InjectHostDevBufferCopies.cpp
+++ src/InjectHostDevBufferCopies.cpp
@@ -320,7 +320,7 @@
             const Variable *buffer_var = op->args[1].as<Variable>();
             internal_assert(buffer_var && ends_with(buffer_var->name, ".buffer"));
             string buf_name = buffer_var->name.substr(0, buffer_var->name.size() - 7);
-            BufferInfo &info(state[op->name]);
+            BufferInfo &info(state[buf_name]);
             debug(2) << "Setting dev_read to true in glsl_texture_load for " << buffer_var->name << "\n";
             info.dev_read = true;
             internal_assert(info.device_api == Device_Host ||
@@ -336,7 +336,7 @@
             const Variable *buffer_var = op->args[1].as<Variable>();
             internal_assert(buffer_var && ends_with(buffer_var->name, ".buffer"));
             string buf_name = buffer_var->name.substr(0, buffer_var->name.size() - 7);
-            BufferInfo &info(state[op->name]);
+            BufferInfo &info(state[buf_name]);
             debug(2) << "Setting dev_write to true in glsl_texture_store for " << buffer_var->name << "\n";
             info.dev_write = true;
             internal_assert(info.device_api == Device_Host ||


calling apply_linear_force if node is a PandaNode

--- panda/src/collide/collisionHandlerPusher.cxx
+++ panda/src/collide/collisionHandlerPusher.cxx
@@ -170,7 +170,6 @@
             for (sj = shoves.begin(); sj != si; ++sj) {
               ShoveData &sd2 = (*sj);
               if (sd2._valid) {
-
                 float d = sd._vector.dot(sd2._vector);
                 if (collide_cat.is_debug()) {
                   collide_cat.debug()
@@ -185,7 +184,6 @@
                   } else {
                     sd._valid = false;
                   }
-
                 } else {
                   // These two shoves are not in the same direction.
                   // If they are both from polygons that are a child
@@ -259,6 +257,8 @@
             LVecBase3f pos = trans->get_pos();
             pos += net_shove * trans->get_mat();
             def._node->set_transform(trans->set_pos(pos));
+
+            apply_linear_force(def, force_normal);
           } else {
             // Otherwise, go ahead and do the matrix math to do things
             // the old and clumsy way.
@@ -266,7 +266,6 @@
             def.get_mat(mat);
             def.set_mat(LMatrix4f::translate_mat(net_shove) * mat);
           }
-          apply_linear_force(def, force_normal);
         }
       }
     }


*** empty log message ***

*** empty log message ***

--- panda/src/parametrics/config_parametrics.cxx
+++ panda/src/parametrics/config_parametrics.cxx
@@ -30,7 +30,6 @@
   HermiteCurve::init_type();
   NurbsCurveDrawer::init_type();
   NurbsCurveInterface::init_type();
-  NurbsPPCurve::init_type();
   ParametricCurve::init_type();
   ParametricCurveDrawer::init_type();
   PiecewiseCurve::init_type();


support fullpath for inline loading of .mb files

--- pandatool/src/mayaegg/mayaToEggConverter.cxx
+++ pandatool/src/mayaegg/mayaToEggConverter.cxx
@@ -1577,8 +1577,12 @@
   // if present, replaces the color.

   if (shader._has_texture) {
-    Filename pathname = convert_texture_path(shader._texture);
-    EggTexture tex(shader._name, pathname);
+    Filename filename = Filename::from_os_specific(shader._texture);
+    Filename fullpath =
+      _path_replace->match_path(filename, get_texture_path());
+    EggTexture tex(shader._name, _path_replace->store_path(fullpath));
+    tex.set_fullpath(fullpath);
+
     tex.set_wrap_u(shader._wrap_u ? EggTexture::WM_repeat : EggTexture::WM_clamp);
     tex.set_wrap_v(shader._wrap_v ? EggTexture::WM_repeat : EggTexture::WM_clamp);


Simplify a pair of test cases

Simplify a pair of test cases

--- test/detail/BitStreamTests.cpp
+++ test/detail/BitStreamTests.cpp
@@ -128,14 +128,14 @@
          [=](uint64_t x) {
            auto source = makeSource(seq::repeat(x));
            auto stream = bitStreamOf(source);
-           RC_ASSERT((stream.next<uint64_t>(0) & bitMask<uint64_t>(64)) == 0U);
+           RC_ASSERT(stream.next<uint64_t>(0) == 0U);
          });

     prop("does not return any bits when none are requested (signed)",
          [=](uint64_t x) {
            auto source = makeSource(seq::repeat(x));
            auto stream = bitStreamOf(source);
-           RC_ASSERT((stream.next<int64_t>(0) & bitMask<int64_t>(64)) == 0);
+           RC_ASSERT(stream.next<int64_t>(0) == 0);
          });

     prop("works with booleans",


double-sided egg flag means to respect maya settings

--- pandatool/src/mayaegg/mayaToEggConverter.cxx
+++ pandatool/src/mayaegg/mayaToEggConverter.cxx
@@ -1366,7 +1366,14 @@
     egg_double_sided = user_data->_double_sided;
   }

-  bool double_sided = _respect_maya_double_sided ? maya_double_sided : egg_double_sided;
+  bool double_sided = maya_double_sided;
+  if (!_respect_maya_double_sided) {
+    // If this flag is false, we respect the maya double-sided
+    // settings only if the egg "double-sided" flag is also set.
+    if (!egg_double_sided) {
+      maya_double_sided = false;
+    }
+  }

   while (!pi.isDone()) {
     EggPolygon *egg_poly = new EggPolygon;


Add vote rebroadcasting test

Add vote rebroadcasting test

--- rai/core_test/node.cpp
+++ rai/core_test/node.cpp
@@ -1611,3 +1611,43 @@
 	}
 	ASSERT_EQ (0, system.nodes[0]->balance (rai::test_genesis_key.pub));
 }
+
+TEST (node, vote_republish)
+{
+	rai::system system (24000, 2);
+	rai::keypair key2;
+	system.wallet (1)->insert_adhoc (key2.prv);
+	rai::genesis genesis;
+	rai::send_block send1 (genesis.hash (), key2.pub, std::numeric_limits<rai::uint128_t>::max () - system.nodes[0]->config.receive_minimum.number (), rai::test_genesis_key.prv, rai::test_genesis_key.pub, system.work.generate (genesis.hash ()));
+	rai::send_block send2 (genesis.hash (), key2.pub, std::numeric_limits<rai::uint128_t>::max () - system.nodes[0]->config.receive_minimum.number () * 2, rai::test_genesis_key.prv, rai::test_genesis_key.pub, system.work.generate (genesis.hash ()));
+	system.nodes[0]->process_active (std::unique_ptr<rai::block> (new rai::send_block (send1)));
+	system.deadline_set (5s);
+	while (!system.nodes[1]->block (send1.hash ()))
+	{
+		ASSERT_NO_ERROR (system.poll ());
+	}
+	system.nodes[0]->active.publish (std::unique_ptr<rai::block> (new rai::send_block (send2)));
+	auto vote (std::make_shared<rai::vote> (rai::test_genesis_key.pub, rai::test_genesis_key.prv, 0, std::unique_ptr<rai::block> (new rai::send_block (send2))));
+	ASSERT_TRUE (system.nodes[0]->active.active (send1));
+	ASSERT_TRUE (system.nodes[1]->active.active (send1));
+	system.nodes[0]->vote_processor.vote (vote, system.nodes[0]->network.endpoint ());
+	while (!system.nodes[0]->block (send2.hash ()))
+	{
+		ASSERT_NO_ERROR (system.poll ());
+	}
+	while (!system.nodes[1]->block (send2.hash ()))
+	{
+		ASSERT_NO_ERROR (system.poll ());
+	}
+	ASSERT_FALSE (system.nodes[0]->block (send1.hash ()));
+	ASSERT_FALSE (system.nodes[1]->block (send1.hash ()));
+	system.deadline_set (5s);
+	while (system.nodes[1]->balance (key2.pub) != system.nodes[0]->config.receive_minimum.number () * 2)
+	{
+		ASSERT_NO_ERROR (system.poll ());
+	}
+	while (system.nodes[0]->balance (key2.pub) != system.nodes[0]->config.receive_minimum.number () * 2)
+	{
+		ASSERT_NO_ERROR (system.poll ());
+	}
+}


Added comments.

Added comments.

	modified:   code/ylikuutio/string/ylikuutio_string.cpp