You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(20) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
|
From: <dd...@us...> - 2003-01-30 03:42:37
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Images/Res In directory sc8-pr-cvs1:/tmp/cvs-serv25672/Cpp/Samples/Images/Res Added Files: TestEdgeBmp.htm Log Message: Created --- NEW FILE: TestEdgeBmp.htm --- <HTML> <HEAD> <TITLE>BMP Test Image Edge</TITLE> <META name="GENERATOR" content="Microsoft FrontPage 4.0"> <META name="ProgId" content="FrontPage.Editor.Document"> </HEAD> <BODY> <h3>Bitmaps</h3> <p><img border="0" src="TestEdge.bmp" width="48" height="48"></p> <p>Test Edge 48x48, 16 colors </p> <h4>Packed image data </h4> <pre> <font color="#0000FF">XY 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</font> <font color="#0000FF">47</font> 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 <font color="#0000FF">46</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">45</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">44</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">43</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">42</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">41</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">40</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">39</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">38</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">37</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">36</font> 2F FF FF FF FF FF FF FF FF FF FF F2 FF FF FF FF FF FF FF FF FF FF FF F2 <font color="#0000FF">35</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">34</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">33</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">32</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">31</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">30</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">29</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">28</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">27</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">26</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">25</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">24</font> 4F FF FF FF FF FF FF FF FF FF FF F4 FF FF FF FF FF FF FF FF FF FF FF F4 <font color="#0000FF">23</font> 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 <font color="#0000FF">22</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">21</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">20</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">19</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">18</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">17</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">16</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">15</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">14</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">13</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">12</font> 8F FF FF FF FF FF FF FF FF FF FF F8 FF FF FF FF FF FF FF FF FF FF FF F8 <font color="#0000FF">11</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">10</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">09</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">08</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">07</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">06</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">05</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">04</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">03</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">02</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">01</font> DF FF FF FF FF FF FF FF FF FF FF FD FF FF FF FF FF FF FF FF FF FF FF FD <font color="#0000FF">00</font> D1 11 11 11 11 11 11 11 11 11 11 1D 11 11 11 11 11 11 11 11 11 11 11 1D </pre> </BODY> </HTML> |
|
From: <dd...@us...> - 2003-01-30 03:40:25
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/DateTime/Src
In directory sc8-pr-cvs1:/tmp/cvs-serv25199/Cpp/Samples/DateTime/Src
Modified Files:
TsLeapYear.cpp main.cpp
Log Message:
Update
Index: TsLeapYear.cpp
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/Samples/DateTime/Src/TsLeapYear.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TsLeapYear.cpp 28 Jan 2003 05:44:15 -0000 1.1
--- TsLeapYear.cpp 30 Jan 2003 03:40:22 -0000 1.2
***************
*** 1,125 ****
! /*$Workfile: TsLeapYear.cpp$: implementation file
! $Revision$ $Date$
! $Author$
!
! Test leap year validation
! Copyright: CommonSoft Inc.
! Jan. 2k2 Darko Kolakovic
! */
!
! // Group=Examples
!
! /*Note: MS VC/C++ - Disable precompiled headers (/Yu"StdAfx.h" option) */
!
! #include "KTypedef.h" //LPCTSTR typedef
! #include "KTrace.h" //ASSERT macro
! #include "KTime.h" //IsLeapYear()
! #include "KTChar.h" //TCHAR typedef
!
! extern bool TsWriteToView(LPCTSTR lszText);
!
! //TestLeapYear()------------------------------------------------------------
! /*Function validates leap years.
!
! Returns: true if successful, otherwise returns false.
! */
! bool TestLeapYear()
! {
! TsWriteToView(_T("TestLeapYear()\r\n"));
! bool bRes = true;
! const int TESTCOUNT = 19;
! const int ID_HYSTORIC = 0; //Id of Gregorian Calendar results
! const int ID_PROLEPTIC = 1; //Id of Proleptic Gregorian Calendar results
! int iYear[TESTCOUNT] =
! {
! 1996, //00
! 1609, //01
! 1500, //02
! 4000, //03
! 1800, //04
! 9250, //05
! 1900, //06
! 2000, //07
! 1388, //08
! 1582, //09
! 2002, //10
! 2004, //11
! 104, //12
! 96, //13
! 4, //14
! 12, //15
! 7866, //16
! -120, //17
! 0 //18
! };
! bool bLeapYear[TESTCOUNT][2] =
! {
! //Hist, Prlp
! true, true, //00 1996,
! false, false,//01 1609,
! true, false,//02 1500, < YEAR_GREGORIAN
! true, true, //03 4000,
! false, false,//04 1800,
! false, false,//05 9250,
! false, false,//06 1900,
! true, true, //07 2000,
! true, true, //08 1388, < YEAR_GREGORIAN
! false, false,//09 1582, = YEAR_GREGORIAN
! false, false,//10 2002,
! true, true, //11 2004,
! true, true, //12 104, < YEAR_GREGORIAN
! true, true, //13 96, < YEAR_GREGORIAN
! true, true, //14 4, < YEAR_GREGORIAN
! true, true, //15 12, < YEAR_GREGORIAN
! false, false,//16 7866,
! true, true, //17 -120, < YEAR_GREGORIAN
! true, true //18 0 < YEAR_GREGORIAN
! };
!
! TsWriteToView(_T("Proleptic Gregorian Calendar:\r\n"));
! int i = 0;
! while ((i < TESTCOUNT) && bRes)
! {
!
! bRes = (IsLeapYear(iYear[i]) == bLeapYear[i][ID_HYSTORIC]); //Test inline
! if (bRes)
! {
! //Test proleptic macro
! bRes = (IS_LEAP_YEAR(iYear[i]) == bLeapYear[i][ID_PROLEPTIC]);
! }
!
! if (bRes)
! {
! //Proleptic Gregorian Calendar
! TCHAR szYear[8];
! TsWriteToView(_itot(iYear[i],szYear,10));
! TsWriteToView(_T(". is "));
! if (iYear[i] > 0 )
! {
! //Note: (year&3) is faster (year%4), but vaild only for years > 0
! if(!((iYear[i] & 3) == 0 && iYear[i] % 100 != 0 || iYear[i] % 400 == 0))
! TsWriteToView(_T("not"));
! }
! else
! {
! if(!((iYear[i] % 4) == 0 && iYear[i] % 100 != 0 || iYear[i] % 400 == 0))
! TsWriteToView(_T("not"));
! }
! TsWriteToView(_T(" leap year.\r\n"));
! }
! i++;
! }
!
! TsWriteToView(_T("======================\r\n"));
! return bRes;
! }
!
! ///////////////////////////////////////////////////////////////////////////////
! /*****************************************************************************
! * $Log:
! * 3 Biblioteka1.2 22/01/2003 10:23:23 PMDarko Unicode
! * 2 Biblioteka1.1 20/01/2003 3:15:36 AMDarko Replaced BOOL
! * with bool
! * 1 Biblioteka1.0 15/01/2003 12:29:45 AMDarko
! * $
! *****************************************************************************/
--- 1,125 ----
! /*$Workfile: TsLeapYear.cpp$: implementation file
! $Revision$ $Date$
! $Author$
!
! Test leap year validation
! Copyright: CommonSoft Inc.
! Jan. 2k2 Darko Kolakovic
! */
!
! // Group=Examples
!
! /*Note: MS VC/C++ - Disable precompiled headers (/Yu"StdAfx.h" option) */
!
! #include "KTypedef.h" //LPCTSTR typedef
! #include "KTrace.h" //ASSERT macro
! #include "KTime.h" //IsLeapYear()
! #include "KTChar.h" //TCHAR typedef
!
! extern bool TsWriteToView(LPCTSTR lszText);
!
! //TestLeapYear()------------------------------------------------------------
! /*Function validates leap years.
!
! Returns: true if successful, otherwise returns false.
! */
! bool TestLeapYear()
! {
! TsWriteToView(_T("TestLeapYear()\r\n"));
! bool bRes = true;
! const int TESTCOUNT = 19;
! const int ID_HYSTORIC = 0; //Id of Gregorian Calendar results
! const int ID_PROLEPTIC = 1; //Id of Proleptic Gregorian Calendar results
! int iYear[TESTCOUNT] =
! {
! 1996, //00
! 1609, //01
! 1500, //02
! 4000, //03
! 1800, //04
! 9250, //05
! 1900, //06
! 2000, //07
! 1388, //08
! 1582, //09
! 2002, //10
! 2004, //11
! 104, //12
! 96, //13
! 4, //14
! 12, //15
! 7866, //16
! -120, //17
! 0 //18
! };
! bool bLeapYear[TESTCOUNT][2] =
! {
! //Hist, Prlp
! true, true, //00 1996,
! false, false,//01 1609,
! true, false,//02 1500, < YEAR_GREGORIAN
! true, true, //03 4000,
! false, false,//04 1800,
! false, false,//05 9250,
! false, false,//06 1900,
! true, true, //07 2000,
! true, true, //08 1388, < YEAR_GREGORIAN
! false, false,//09 1582, = YEAR_GREGORIAN
! false, false,//10 2002,
! true, true, //11 2004,
! true, true, //12 104, < YEAR_GREGORIAN
! true, true, //13 96, < YEAR_GREGORIAN
! true, true, //14 4, < YEAR_GREGORIAN
! true, true, //15 12, < YEAR_GREGORIAN
! false, false,//16 7866,
! true, true, //17 -120, < YEAR_GREGORIAN
! true, true //18 0 < YEAR_GREGORIAN
! };
!
! TsWriteToView(_T("Proleptic Gregorian Calendar:\r\n"));
! int i = 0;
! while ((i < TESTCOUNT) && bRes)
! {
!
! bRes = (IsLeapYear(iYear[i]) == bLeapYear[i][ID_HYSTORIC]); //Test inline
! if (bRes)
! {
! //Test proleptic macro
! bRes = (IS_LEAP_YEAR(iYear[i]) == bLeapYear[i][ID_PROLEPTIC]);
! }
!
! if (bRes)
! {
! //Proleptic Gregorian Calendar
! TCHAR szYear[8];
! TsWriteToView(_itot(iYear[i],szYear,10));
! TsWriteToView(_T(". is "));
! if (iYear[i] > 0 )
! {
! //Note: (year&3) is faster (year%4), but vaild only for years > 0
! if(!((iYear[i] & 3) == 0 && iYear[i] % 100 != 0 || iYear[i] % 400 == 0))
! TsWriteToView(_T("not"));
! }
! else
! {
! if(!((iYear[i] % 4) == 0 && iYear[i] % 100 != 0 || iYear[i] % 400 == 0))
! TsWriteToView(_T("not"));
! }
! TsWriteToView(_T(" leap year.\r\n"));
! }
! i++;
! }
!
! TsWriteToView(_T("======================\r\n"));
! return bRes;
! }
!
! ///////////////////////////////////////////////////////////////////////////////
! /*****************************************************************************
! * $Log:
! * 3 Biblioteka1.2 22/01/2003 10:23:23 PMDarko Unicode
! * 2 Biblioteka1.1 20/01/2003 3:15:36 AMDarko Replaced BOOL
! * with bool
! * 1 Biblioteka1.0 15/01/2003 12:29:45 AMDarko
! * $
! *****************************************************************************/
Index: main.cpp
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/Samples/DateTime/Src/main.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** main.cpp 28 Jan 2003 05:44:15 -0000 1.1
--- main.cpp 30 Jan 2003 03:40:22 -0000 1.2
***************
*** 1,75 ****
! /*$Workfile: main.cpp$: implementation file
! $Revision$ $Date$
! $Author$
!
! Console application used to test various operations with date and time
! Jan. 90 Darko Kolakovic
! */
!
! // Group=Examples
!
! #ifdef _MSC_VER /*Microsoft Visual Studio C/C++ compiler */
! #ifndef _CONSOLE
! #error "define _CONSOLE macro in the project"
! #endif
! #endif
!
! #ifdef __GNUG__ /*GNU C++ compiler */
! #ifndef _CONSOLE
! #warning "define _CONSOLE macro in the project"
! #endif
! #endif
!
! #include <iostream>
! #include <iomanip.h> //std::endl
! #include <string> //std::string
! #include "KTrace.h" //TRACE macro
! #include "KTypedef.h" //BOOL typedef
!
! extern bool TestLeapYear();
!
! //TsWriteToView()--------------------------------------------------------------
! /*Writes a character string at the console standard output stream.
!
! Returns: TRUE always.
!
! Note: uses Standard Template Library (STL).
! */
! BOOL TsWriteToView(LPCTSTR lszText)
! {
! if (lszText != NULL)
! cout << lszText;
! else
! cout << "<null>";
! cout.flush();
! return TRUE;
! }
!
! //main()-----------------------------------------------------------------------
! /*Validates different date and time routines.
!
! Returns: EXIT_SUCCESS, which represents a value of 0, if successful. Otherwise
! a non-zero error code is returned.
! */
! int main()
! {
! cout << "Start Date and Time String " << endl << endl;
!
! if(TestLeapYear())
! cout << "Succeeded." << endl << endl;
! else
! {
! cout << "Failed!" << endl;
! return EXIT_FAILURE + 1;
! }
!
!
! return EXIT_SUCCESS;
! }
!
! ///////////////////////////////////////////////////////////////////////////////
! /******************************************************************************
! * $Log:
! * 1 Biblioteka1.0 15/01/2003 12:29:47 AMDarko
! * $
! *****************************************************************************/
--- 1,75 ----
! /*$Workfile: main.cpp$: implementation file
! $Revision$ $Date$
! $Author$
!
! Console application used to test various operations with date and time
! Jan. 90 Darko Kolakovic
! */
!
! // Group=Examples
!
! #ifdef _MSC_VER /*Microsoft Visual Studio C/C++ compiler */
! #ifndef _CONSOLE
! #error "define _CONSOLE macro in the project"
! #endif
! #endif
!
! #ifdef __GNUG__ /*GNU C++ compiler */
! #ifndef _CONSOLE
! #warning "define _CONSOLE macro in the project"
! #endif
! #endif
!
! #include <iostream>
! #include <iomanip.h> //std::endl
! #include <string> //std::string
! #include "KTrace.h" //TRACE macro
! #include "KTypedef.h" //BOOL typedef
!
! extern bool TestLeapYear();
!
! //TsWriteToView()--------------------------------------------------------------
! /*Writes a character string at the console standard output stream.
!
! Returns: TRUE always.
!
! Note: uses Standard Template Library (STL).
! */
! BOOL TsWriteToView(LPCTSTR lszText)
! {
! if (lszText != NULL)
! cout << lszText;
! else
! cout << "<null>";
! cout.flush();
! return TRUE;
! }
!
! //main()-----------------------------------------------------------------------
! /*Validates different date and time routines.
!
! Returns: EXIT_SUCCESS, which represents a value of 0, if successful. Otherwise
! a non-zero error code is returned.
! */
! int main()
! {
! cout << "Start Date and Time String " << endl << endl;
!
! if(TestLeapYear())
! cout << "Succeeded." << endl << endl;
! else
! {
! cout << "Failed!" << endl;
! return EXIT_FAILURE + 1;
! }
!
!
! return EXIT_SUCCESS;
! }
!
! ///////////////////////////////////////////////////////////////////////////////
! /******************************************************************************
! * $Log:
! * 1 Biblioteka1.0 15/01/2003 12:29:47 AMDarko
! * $
! *****************************************************************************/
|
|
From: <dd...@us...> - 2003-01-30 03:39:47
|
Update of /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Complex/Src
In directory sc8-pr-cvs1:/tmp/cvs-serv24908/Cpp/Samples/Complex/Src
Modified Files:
TsComplex.cpp
Log Message:
Updated
Index: TsComplex.cpp
===================================================================
RCS file: /cvsroot/babylonlib/_SrcPool/Cpp/Samples/Complex/Src/TsComplex.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TsComplex.cpp 28 Jan 2003 05:46:55 -0000 1.1
--- TsComplex.cpp 30 Jan 2003 03:39:44 -0000 1.2
***************
*** 1,263 ****
! /*$Workfile: TsComplex.cpp$: implementation file
! $Revision$ $Date$
! $Author$
!
! Complex number arithmetics test
! Copyright: CommonSoft Inc.
! Jan. 2k Darko Kolakovic
! */
!
! // Group=Examples
!
! #include "stdafx.h"
! #include "KComplex.h" //CComplex class
!
! #ifdef _DEBUG
! #define new DEBUG_NEW
! #undef THIS_FILE
! static char THIS_FILE[] = __FILE__;
! #endif
!
! #ifdef _COMPLEX_DEFINED
! #pragma message ("_COMPLEX_DEFINED")
! #endif
! #ifdef __STD_COMPLEX
! #pragma message ("__STD_COMPLEX")
! #endif
! extern bool TsWriteToView(LPCTSTR lszText);
!
! //TestComplex()--------------------------------------------------------------
! /*Function evaluates operations with complex numbers.
! */
! bool TestComplex()
! {
! CString strResult;
!
! #ifdef _COMPLEX_DEFINED //included <Math.h>
! //Complex number as structure defined in <Math.h>
! TsWriteToView(_T("_cabs() calculates the absolute value of a _complex number.\r\n"));
! _complex B;
! B.x = 3.2; //Real part
! B.y = 4.2; //Imaginary part
! //Calculate the absolute value of a complex number
! //(compatible with Win 9x, Win NT).
! double dRho = _cabs(B);
! if ( dRho != HUGE_VAL) //Check for overflow
! {
! strResult.Format(_T("|B| = |%.2f+i%.2f| = %.2f\r\n"),B.x,B.y,dRho);
! TsWriteToView((LPCTSTR)strResult);
! }
! #else //<Math.h> not included
! TsWriteToView(_T("Complex numbers are not supported.\r\n"));
! TComplexBase<double>B(3.2,4.2); //Initialize B = x +iy
! #endif //_COMPLEX_DEFINED
!
!
! #ifdef __STD_COMPLEX //included <complex>
!
! //Complex number as template class as defined in <Complex>
! TsWriteToView(_T("\r\nstd::abs(A) calculates the absolute value of a std::complex<int> number\r\n"));
! std::complex<int> A(5,6);
! A << B; //Copy complex numbers
! strResult.Format(_T("std::complex<int> A = (int)B = %d+i%d\r\n"),A.real(),A.imag());
! TsWriteToView((LPCTSTR)strResult);
! //The std::abs(A) function returns the magnitude of A
! strResult.Format(_T("|%d+i%d| = %d\r\n"),A.real(),A.imag(),std::abs(A));
! TsWriteToView((LPCTSTR)strResult);
! #else //<complex> not included
! TComplexBase<double>A(5,6); //Initialize A = x +iy
! TComplexBase<double> A1;
! A1 = A; //A1 = x + iy
! A1 = 56; //A1 = CONST + i0
! A1 /= 4;
! strResult.Format(_T("|%.2f+i%.2f| = %.2f\r\n"),A1.real(),A1.imag(),abs(A1));
! TsWriteToView((LPCTSTR)strResult);
! #endif //__STD_COMPLEX
!
! CComplex C(B.x, B.y);
! C = B;
! C += A;
! CComplex D(-4.3,6.1);
!
! strResult.Format(_T("C = %f+i%f D = %f+i%f "),C.real(),C.imag(),D.real(),D.imag());
! TsWriteToView((LPCTSTR)strResult);
! C = D / C ;
! strResult.Format(_T("D/C = %f+i%f\r\n"),C.real(),C.imag());
! TsWriteToView((LPCTSTR)strResult);
!
! C = exp10(D); //The function returns exponential of D, for base 10.
! strResult.Format(_T("D E(10) = %f+i%f\r\n"),C.real(),C.imag());
! TsWriteToView((LPCTSTR)strResult);
!
! TComplex<int> A2(-1,7);
! TRACE2(_T("A = %d +j%d;"),A2.real(),A2.imag());
! A2 = exp10(A2);
! TRACE2(_T(" A E(10) = %d +j%d\n"),A2.real(),A2.imag());
!
! D = CComplex(1.2,2.8);
! strResult.Format(_T("D = %f+i%f\r\n"),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! C = cos(D); //The function returns cosine of D
! strResult.Format(_T("cos(D) = %f+i%f "),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! C = acos(C);
! strResult.Format(_T("acos(C) = %f+i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! C = sin(D); //The function returns sine of D
! strResult.Format(_T("sin(D) = %f+i%f "),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! C = asin(C);
! strResult.Format(_T("asin(C) = %f+i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! TComplex<float> Phi(.94F,1.78F);
! strResult.Format(_T("Phi = %f+i%f\r\n"),Phi.real(),Phi.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! TComplex<float> X = tan(Phi); //The function returns tangent of Phi
! strResult.Format(_T("tan(Phi) = %f+i%f "),X.real(),X.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! X = atan(X);
! strResult.Format(_T("atan(X) = %f+i%f\r\n"),X.real(),X.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! X = tanh(Phi); //The function returns hyperbolic tangent of Phi
! strResult.Format(_T("tanh(Phi) = %f+i%f "),X.real(),X.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! X = atanh(X);
! strResult.Format(_T("atanh(X) = %f+i%f\r\n"),X.real(),X.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! //Dividing two complex numbers
! C.real(-3.2);
! C.imag(-4.8);
! D.real( .4);
! D.imag(- .4);
! strResult.Format(_T("C = %.3f + i%.3f D = %.3f + i%.3f\r\n"),
! C.real(),C.imag(),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! C/=D;
! strResult.Format(_T("C / D = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! C.real(-3.2);
! C.imag(-4.8);
! double dTemp = norm(D);
! C *= conj(D);
! C /= dTemp;
! strResult.Format(_T("C / D = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! //Multiplying two complex numbers
! C.real(-3.2);
! C.imag(-4.8);
! C *= D;
! strResult.Format(_T("C * D = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! C.real(-3.2);
! C.imag(-4.8);
! dTemp = C.real()*D.real() - C.imag()*D.imag();
! C.imag(C.imag()*D.real() + C.real()*D.imag());
! C.real(dTemp);
! strResult.Format(_T("C * D = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! if (C != D) //Test comparison
! {
! D = sqrt(C); //Test square root function
! strResult.Format(_T("D = C**0.5 = %f + i%f\r\n"),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! C = pow(D,2);
! strResult.Format(_T("D**2 = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! }
!
! //conversion from polar coordinates to complex number
! double dEff = 48;
! D = polar(dEff);
! strResult.Format(_T("Rho = %.0f D = %f + i%f\r\n"),dEff,D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! dEff = 220;
! int iNom = 3;
! double dPhi = CST_PI/iNom;
! D = polar(dEff,dPhi); //D = 220*e(i*60[deg])
! strResult.Format(_T("D = %.0fe**(i3.14/%d) = %f + i%f\r\n"),dEff,iNom,D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! D = logN(C,2); //Returns the logarithm to base 2
! strResult.Format(_T("D = log2(C) = %f + i%f\r\n"),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! D = acoth(C); //Returns the hyperbolic arcus cosecant
! strResult.Format(_T("acoth(C) = %f + i%f\r\n"),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! //Calculate line input impedance
! extern CComplex GetLineZin(CComplex Zt, const CComplex& Zline, double dAttenuation,
! double dPhaseShift, const double& dLineLength);
! C.real(0);
! C.imag(0);
!
! D = GetLineZin(C, CComplex(50.0,0), 2.5,CST_PI/2.,10);
! strResult.Format(_T("Load = %f + i%f, Zin = %f + i%f\r\n"),
! C.real(),C.imag(),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! return TRUE;
! }
!
!
! //TestPointToComplex()------------------------------------------------------
! /*Test conversion from CPoint to complex number
! */
! void TestPointToComplex(CPoint& ptPos)
! {
! CComplex ccPos = ptPos;
! double dRho; //magnitude
! double dAngle; //phase angle
!
! dRho = ccPos.Rho(); //The function returns the magnitude of ccPos
! dAngle = ccPos.Angle(); //The function returns the phase angle of ccPos
!
! TRACE2(_T("ccPos = %f e(j%f)\n"),abs(ccPos),arg(ccPos));
! TsWriteToView(_T("Mouse position is "));
! CString strResult;
! strResult.Format(_T("%.2f+i%.2f = %.2fe(i%.2f)\r\n"),ccPos.real(),ccPos.imag(),dRho,dAngle);
! TsWriteToView((LPCTSTR)strResult);
! }
!
! ///////////////////////////////////////////////////////////////////////////////
! /*****************************************************************************
! * $Log:
! * 4 Biblioteka1.3 22/01/2003 10:22:35 PMDarko
! * 3 Biblioteka1.2 20/01/2003 3:15:32 AMDarko Replaced BOOL
! * with bool
! * 2 Biblioteka1.1 11/07/2001 9:59:43 PMDarko
! * 1 Biblioteka1.0 08/06/2001 9:53:44 PMDarko
! * $
! *****************************************************************************/
!
--- 1,263 ----
! /*$Workfile: TsComplex.cpp$: implementation file
! $Revision$ $Date$
! $Author$
!
! Complex number arithmetics test
! Copyright: CommonSoft Inc.
! Jan. 2k Darko Kolakovic
! */
!
! // Group=Examples
!
! #include "stdafx.h"
! #include "KComplex.h" //CComplex class
!
! #ifdef _DEBUG
! #define new DEBUG_NEW
! #undef THIS_FILE
! static char THIS_FILE[] = __FILE__;
! #endif
!
! #ifdef _COMPLEX_DEFINED
! #pragma message ("_COMPLEX_DEFINED")
! #endif
! #ifdef __STD_COMPLEX
! #pragma message ("__STD_COMPLEX")
! #endif
! extern bool TsWriteToView(LPCTSTR lszText);
!
! //TestComplex()--------------------------------------------------------------
! /*Function evaluates operations with complex numbers.
! */
! bool TestComplex()
! {
! CString strResult;
!
! #ifdef _COMPLEX_DEFINED //included <Math.h>
! //Complex number as structure defined in <Math.h>
! TsWriteToView(_T("_cabs() calculates the absolute value of a _complex number.\r\n"));
! _complex B;
! B.x = 3.2; //Real part
! B.y = 4.2; //Imaginary part
! //Calculate the absolute value of a complex number
! //(compatible with Win 9x, Win NT).
! double dRho = _cabs(B);
! if ( dRho != HUGE_VAL) //Check for overflow
! {
! strResult.Format(_T("|B| = |%.2f+i%.2f| = %.2f\r\n"),B.x,B.y,dRho);
! TsWriteToView((LPCTSTR)strResult);
! }
! #else //<Math.h> not included
! TsWriteToView(_T("Complex numbers are not supported.\r\n"));
! TComplexBase<double>B(3.2,4.2); //Initialize B = x +iy
! #endif //_COMPLEX_DEFINED
!
!
! #ifdef __STD_COMPLEX //included <complex>
!
! //Complex number as template class as defined in <Complex>
! TsWriteToView(_T("\r\nstd::abs(A) calculates the absolute value of a std::complex<int> number\r\n"));
! std::complex<int> A(5,6);
! A << B; //Copy complex numbers
! strResult.Format(_T("std::complex<int> A = (int)B = %d+i%d\r\n"),A.real(),A.imag());
! TsWriteToView((LPCTSTR)strResult);
! //The std::abs(A) function returns the magnitude of A
! strResult.Format(_T("|%d+i%d| = %d\r\n"),A.real(),A.imag(),std::abs(A));
! TsWriteToView((LPCTSTR)strResult);
! #else //<complex> not included
! TComplexBase<double>A(5,6); //Initialize A = x +iy
! TComplexBase<double> A1;
! A1 = A; //A1 = x + iy
! A1 = 56; //A1 = CONST + i0
! A1 /= 4;
! strResult.Format(_T("|%.2f+i%.2f| = %.2f\r\n"),A1.real(),A1.imag(),abs(A1));
! TsWriteToView((LPCTSTR)strResult);
! #endif //__STD_COMPLEX
!
! CComplex C(B.x, B.y);
! C = B;
! C += A;
! CComplex D(-4.3,6.1);
!
! strResult.Format(_T("C = %f+i%f D = %f+i%f "),C.real(),C.imag(),D.real(),D.imag());
! TsWriteToView((LPCTSTR)strResult);
! C = D / C ;
! strResult.Format(_T("D/C = %f+i%f\r\n"),C.real(),C.imag());
! TsWriteToView((LPCTSTR)strResult);
!
! C = exp10(D); //The function returns exponential of D, for base 10.
! strResult.Format(_T("D E(10) = %f+i%f\r\n"),C.real(),C.imag());
! TsWriteToView((LPCTSTR)strResult);
!
! TComplex<int> A2(-1,7);
! TRACE2(_T("A = %d +j%d;"),A2.real(),A2.imag());
! A2 = exp10(A2);
! TRACE2(_T(" A E(10) = %d +j%d\n"),A2.real(),A2.imag());
!
! D = CComplex(1.2,2.8);
! strResult.Format(_T("D = %f+i%f\r\n"),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! C = cos(D); //The function returns cosine of D
! strResult.Format(_T("cos(D) = %f+i%f "),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! C = acos(C);
! strResult.Format(_T("acos(C) = %f+i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! C = sin(D); //The function returns sine of D
! strResult.Format(_T("sin(D) = %f+i%f "),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! C = asin(C);
! strResult.Format(_T("asin(C) = %f+i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! TComplex<float> Phi(.94F,1.78F);
! strResult.Format(_T("Phi = %f+i%f\r\n"),Phi.real(),Phi.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! TComplex<float> X = tan(Phi); //The function returns tangent of Phi
! strResult.Format(_T("tan(Phi) = %f+i%f "),X.real(),X.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! X = atan(X);
! strResult.Format(_T("atan(X) = %f+i%f\r\n"),X.real(),X.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! X = tanh(Phi); //The function returns hyperbolic tangent of Phi
! strResult.Format(_T("tanh(Phi) = %f+i%f "),X.real(),X.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! X = atanh(X);
! strResult.Format(_T("atanh(X) = %f+i%f\r\n"),X.real(),X.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! //Dividing two complex numbers
! C.real(-3.2);
! C.imag(-4.8);
! D.real( .4);
! D.imag(- .4);
! strResult.Format(_T("C = %.3f + i%.3f D = %.3f + i%.3f\r\n"),
! C.real(),C.imag(),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! C/=D;
! strResult.Format(_T("C / D = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! C.real(-3.2);
! C.imag(-4.8);
! double dTemp = norm(D);
! C *= conj(D);
! C /= dTemp;
! strResult.Format(_T("C / D = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! //Multiplying two complex numbers
! C.real(-3.2);
! C.imag(-4.8);
! C *= D;
! strResult.Format(_T("C * D = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! C.real(-3.2);
! C.imag(-4.8);
! dTemp = C.real()*D.real() - C.imag()*D.imag();
! C.imag(C.imag()*D.real() + C.real()*D.imag());
! C.real(dTemp);
! strResult.Format(_T("C * D = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! if (C != D) //Test comparison
! {
! D = sqrt(C); //Test square root function
! strResult.Format(_T("D = C**0.5 = %f + i%f\r\n"),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! C = pow(D,2);
! strResult.Format(_T("D**2 = %f + i%f\r\n"),C.real(),C.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! }
!
! //conversion from polar coordinates to complex number
! double dEff = 48;
! D = polar(dEff);
! strResult.Format(_T("Rho = %.0f D = %f + i%f\r\n"),dEff,D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
! dEff = 220;
! int iNom = 3;
! double dPhi = CST_PI/iNom;
! D = polar(dEff,dPhi); //D = 220*e(i*60[deg])
! strResult.Format(_T("D = %.0fe**(i3.14/%d) = %f + i%f\r\n"),dEff,iNom,D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! D = logN(C,2); //Returns the logarithm to base 2
! strResult.Format(_T("D = log2(C) = %f + i%f\r\n"),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! D = acoth(C); //Returns the hyperbolic arcus cosecant
! strResult.Format(_T("acoth(C) = %f + i%f\r\n"),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! //Calculate line input impedance
! extern CComplex GetLineZin(CComplex Zt, const CComplex& Zline, double dAttenuation,
! double dPhaseShift, const double& dLineLength);
! C.real(0);
! C.imag(0);
!
! D = GetLineZin(C, CComplex(50.0,0), 2.5,CST_PI/2.,10);
! strResult.Format(_T("Load = %f + i%f, Zin = %f + i%f\r\n"),
! C.real(),C.imag(),D.real(),D.imag());
! TRACE0((LPCTSTR)strResult);
! TsWriteToView((LPCTSTR)strResult);
!
! return TRUE;
! }
!
!
! //TestPointToComplex()------------------------------------------------------
! /*Test conversion from CPoint to complex number
! */
! void TestPointToComplex(CPoint& ptPos)
! {
! CComplex ccPos = ptPos;
! double dRho; //magnitude
! double dAngle; //phase angle
!
! dRho = ccPos.Rho(); //The function returns the magnitude of ccPos
! dAngle = ccPos.Angle(); //The function returns the phase angle of ccPos
!
! TRACE2(_T("ccPos = %f e(j%f)\n"),abs(ccPos),arg(ccPos));
! TsWriteToView(_T("Mouse position is "));
! CString strResult;
! strResult.Format(_T("%.2f+i%.2f = %.2fe(i%.2f)\r\n"),ccPos.real(),ccPos.imag(),dRho,dAngle);
! TsWriteToView((LPCTSTR)strResult);
! }
!
! ///////////////////////////////////////////////////////////////////////////////
! /*****************************************************************************
! * $Log:
! * 4 Biblioteka1.3 22/01/2003 10:22:35 PMDarko
! * 3 Biblioteka1.2 20/01/2003 3:15:32 AMDarko Replaced BOOL
! * with bool
! * 2 Biblioteka1.1 11/07/2001 9:59:43 PMDarko
! * 1 Biblioteka1.0 08/06/2001 9:53:44 PMDarko
! * $
! *****************************************************************************/
!
|
|
From: Darko K. <dko...@mi...> - 2002-09-11 21:13:59
|
TestStrDup() has been added. |