Thursday, October 29, 2020

copy constructor vs assignment operator

research: copy constructor vs assignment operator

    top post

  1. Constructors (C++)
  2. Copy Constructors and Copy Assignment Operators (C++)
  3. Automatics, Copy Constructor, Assignment Operator
  4. good reference

  5. Copy constructor vs assignment operator in C++
  6. Copy assignment operator
  7. Copy constructor vs assignment operator in C++
  8. What's the difference between assignment operator and copy constructor?
  9. Difference Between Copy Constructor and Assignment Operator in C++
  10. Copy Constructors and Assignment Operators

smart pointer in C++

smart pointer in C++

unique_ptr, auto_ptr,shared_ptr,weak_ptr

    how to update legacy c code?

  1. Using std::unique_ptr (RAII) with malloc() and free()
  2. Variable Declaration and Initialization
  3. shared_ptr Polymorphic Magic Pitfall
  4. The A::Restricted Idiom
  5. Memory Management and RAII
  6. Smart Pointers Gotchas
  7. The C++ Standard Library, 2nd
  8. isual Studio Slow Debugging and _NO_DEBUG_HEAP
  9. Robust C++: Initialization and Restarts
  10. Dangling Pointers: Pathology, Prevention and Cure
  11. Ten C++11 Features Every C++ Developer Should Use
  12. Modernizing Legacy C++ Code
  13. Articles by Marius Bancila (Articles: 27, Technical Blogs: 9)
  14. The Most Essential C++ Advice
  15. Object Oriented Programming with C++
  16. Move Semantics and Perfect Forwarding in C++11
  17. What's New in Visual Studio 2013 for Native Development
  18. What's New in VS11 for Native Development
  19. Articles by Marius Bancila (Articles: 27, Technical Blogs: 9)
  20. Smart pointers for single owners and their aliases
  21. Preparing to Know Modern C++

  22. how to use smarter pointer?

  23. std::unique_ptr
  24. std::unique_ptr
  25. How to: Create and use unique_ptr instances
  26. Introduction of Smart Pointers in C++ and It’s Types
  27. auto_ptr, unique_ptr, shared_ptr and weak_ptr
  28. Dangling, Void , Null and Wild Pointers
  29. void pointer in C / C++
  30. NULL pointer in C
  31. The Smart Pointer That Makes Your C++ Applications Safer - std::unique_ptr
  32. How to declare std::unique_ptr and what is the use of it?
  33. What is the difference between #include and #include “filename”?
  34. What is a smart pointer and when should I use one?
  35. smarter pointer

Monday, October 26, 2020

NUNIT testing tips

NUNIT testing tips

  1. Debugging NUnit Test Scripts
  2. CSharpish Properties in Modern C++

Object Oriented Programming with C++/C#

Object Oriented Programming with C++/C#

  1. Object Oriented Programming with C++
  2. Geert van Horrik's 'Updater' in Visual Studio Community Edition With Small Changes
  3. Updater

C++ string and operations

C++ string and operations

  1. How to return a string class from a C++ function/method
  2. A new approach to memory management that solves the issues with shared_ptrs
  3. Ideas from a smart pointer(part 2). size == sizeof(std::shared_ptr)/2
  4. std::string class in C++
  5. C++ string class and its applications
  6. C++ Strings
  7. C++ Pointers
  8. C++ Standard Library: The string Class
  9. C++ String Class
  10. std::basic_string
  11. basic_string Class
  12. String Objects: The string class library
  13. std::string - the C++ String Class
  14. C++ String Class
  15. C-Style Strings
  16. C++ string class
  17. Tenouk C/C++ site

  18. MODULE 25 C++ STRING CLASS PROGRAM EXAMPLES 1
  19. MODULE 25_1 C++ STRING CLASS TYPES AND CODE SAMPLES 2
  20. MODULE 25a C++ STRING CLASS PROGRAMMING 3
  21. MODULE 25b C++ STRING CLASS EXAMPLES 4
  22. MODULE 26 THE C++ STRING CLASS CODE EXAMPLES 5
  23. MODULE 26a C++ PROGRAM SAMPLES ON STRING CLASS 6
  24. MODULE 26a_1 C++ STRING CLASS CODE EXAMPLES 7
  25. .::Tenouk's C & C++ Site Index::.
  26. scanf and printf function examples

  27. C LAB WORKSHEET 4 C main() and printf() functions 1
  28. C LAB WORKSHEET 4_1 C main() and printf() functions 2
  29. C LAB WORKSHEET 5 C/C++ Variable, Operator And Type 1
  30. C LAB WORKSHEET 5_1 C/C++ Variable, Operator And Type 2
  31. C LAB WORKSHEET 5_2 C/C++ Variable, Operator And Type 3
  32. C LAB WORKSHEET 6 C scanf(), scanf_s() family 1
  33. C LAB WORKSHEET 6_1 C scanf(), scanf_s() Examples & Exercises 2
  34. C LAB WORKSHEET 6_2 C scanf(), scanf_s() Exercises 3
  35. C LAB WORKSHEET 11 C & C++ Pointers Part 1: Playing With Memory Addresses
  36. C LAB WORKSHEET 11a C & C++ Pointers Part 2: Pointers, Array and Functions
  37. C LAB WORKSHEET 11a_1 C & C++ Pointers Part 3: Pointers, Array and Functions
  38. THE C LAB WORKSHEETS/EXERCISES/ACTIVITIES
  39. MODULE X USING C LIBRARY - THE C CHARACTER AND STRING 1
  40. MODULE Xa USING C LIBRARY - THE C CHARACTER AND STRING 2
  41. MODULE Xb USING C LIBRARY - THE C CHARACTER AND STRING 3 --------------------------------------------------------------------------

Sunday, October 25, 2020

permutation group

permutation group

  1. Permutation
  2. Permutation group
  3. Group Theory and Sage¶
  4. Permutation Cycle
  5. Cyclic permutation
  6. §26.13 Permutations: Cycle Notation
  7. Math 412. Symmetric Group: Answers.
  8. Permutation Groups
  9. Permutation Groups
  10. Permutation Groups: Basics
  11. Cycles and Cycle Structure
  12. Math 403 Chapter 5 Permutation Groups:
  13. good explanation:)

  14. Permutation Groups
  15. good explanation:)

  16. 5 Permutations and Orbits
  17. Chapter 5:: The Symmetric Group
  18. 5:: Permutation Groups
  19. MIT lecture notes

  20. 5. Permutation groups
  21. Lecture Notes: group theory
  22. 1. groups
  23. Abstract Algebra: Theory and Applications
  24. Download Annual Edition

FFT library and techniques

FFT library and techniques

  1. FFTW website
  2. High-performance multi-dimensional C++ Array class (as fast as Fortran)
  3. FFTW++: Fast Fourier Transform C++ Header/MPI Transpose for FFTW3
  4. Computing FFT and IFFT with FFTW library C++

  5. FFTW++: Fast Fourier Transform C++ Header/MPI Transpose for FFTW3
  6. fftw++
  7. Windows Installation Notes
  8. Building FFTW 3.x under Visual C++/Intel compilers

    Important: If you want to compile FFTW as a DLL, you should add a line #define FFTW_DLL to fftw3.h and ifftw.h before compiling. This will add the requisite __declspec decorations to function declarations etc.

    Project files to compile FFTW 3.3 with Visual Studio 2010 were sent to us by Long To: fftw-3.3-libs-visual-studio-2010.zip.

  9. Downloading FFTW
  10. Dd1vanov / Simple-FFT
  11. C++ Tutorial: Computing the 1-D FFT using the FFTW library on Ubuntu/Linux
  12. C++ Tutorial: 1-D FFT and IFFT with the FFTW library and Visual Studio on Windows
  13. C++ Tutorial: Writing an fftShift function for the FFTW library
  14. FFT properties demonstration
  15. But what is the Fourier Transform? A visual introduction.
  16. Intuitive Understanding of the Fourier Transform and FFTs
  17. Fourier Transform, Fourier Series, and frequency spectrum
  18. FFT Tutorial
  19. iscrete Fourier Transform - Simple Step by Step
  20. The FFT Algorithm - Simple Step by Step

Saturday, October 24, 2020

std::cerr vs std::clog

std::cerr vs std::clog

  1. I/O Redirection in C++
  2. C++ Basic Input/Output
  3. What is the difference between cout, cerr, clog of iostream header in c++? When to use which one?
  4. std::cerr, std::wcerr
  5. C++ cerr
  6. The cerr object in C++ is an object of class ostream. It is associated with the standard C error output stream stderr.

  7. std::cerr | Error Stream Object in C++ with Examples
  8. What is C++ Standard Error Stream (cerr)?
  9. C++ Basic Input/Output: Cout, Cin, Cerr Example
  10. Write std::cerr to txt file

#pragma directive in C++

#pragma directive in C++

  1. Compiler Warning (level 1) C4068
  2. unknown pragma

    The compiler ignored an unrecognized pragma. Be sure the pragma is allowed by the compiler you are using. The following sample generates C4068:

  3. #pragma
  4. Use of #pragma in C
  5. It is of two types #pragma startup, #pragma exit and #pragma warn.

    #pragma startup allows us to specify functions called upon program startup.

    #pragma exit allows us to specify functions called upon program exit.

    #pragma warn tells the computer to suppress any warning or not.

  6. C/C++ #include directive with Examples
  7. #pragma Directive in C/C++
  8. Draw an ellipse divided by straight line into two colored part in C++ Graphics
  9. Speed up Code executions with help of Pragma in C/C++
  10. Pragma directives and the __pragma keyword
  11. cin get() in C++ with Examples
  12. cin.get() is used for accessing character array. It includes white space characters. Generally, cin with an extraction operator (>>) terminates when whitespace is found. However, cin.get() reads a string with the whitespace.

  13. Cin-Cout vs Scanf-Printf
  14. How to use getline() in C++ when there are blank lines in input?
  15. Difference between cin and cin.get() for char array

statistics and numerical recipe in C++

statistics and numerical recipe in C++

  1. C++ programs for Finance
  2. I have made some programs for common uses in finance. They may be of interest to others, so I have made them public under the GNU Public Licence .

    C++ Financial Algoritms (Financial Numerical Recipes)

    In finance, there are areas where formulas tend to get involved. Sometimes it may be easier to follow an exact computer routine. I have made some C++ subroutines that implements common algoritms in finance. Typical examples are option/derivatives pricing, term structure calculations, mean variance analysis. These routines are presented together with a good deal of explanations and examples of use, but it is by no means a complete "book" with all the answers and explanations. I'm hoping to turn it into a book, but even in its incomplete state is should provide a good deal of useful algorithms for people working within the field of finance. The manuscript and codes will be added to as I get the time. All the code should conform to the current ANSI C++ standard.

  3. siren0413 / OptionPricingFormular_CD
  4. Robert Davies
  5. Matrix Documentation
  6. A User-Friendly C# Descriptive Statistic Class
  7. plan to convert it to C++. a good exercise, adding GUI is another option with MFC chart.

  8. Numerical Recipes Home Page
  9. Mathemathics Framework
  10. Inner Product Experiment: C# vs. C/C++

Wednesday, October 21, 2020

Can't find System.Windows.Vector in C#

Can't find System.Windows.Vector in C#

  1. Can't find System.Windows.Vector in C#

C# Couldn't process file xxx.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file

C# Couldn't process file xxx.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file

  1. C# Couldn't process file xxx.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file
  2. Couldn't process file resx due to its being in the Internet or Restricted zone or having the mark of the web on the file
  3. Cannot process file because of mark of the web error in Visual C# project
  4. Remove the Mark of the Web: Visual Studio 2019 Build Error

Matrix class in C/C++ and other operations

Matrix class in C/C++ and other operations

    matrix class implementation in C/C++

  1. Matrix Library in C
  2. in comment section, there is one good comment from Danelle in Italy on how to free memory.

  3. QR decomposition
  4. it has implementation in C++, new Matrix class.

  5. A C++ Matrix Class
  6. MathLibrary for Matrix and Vector
  7. Solve Linear and Polynomial Equations
  8. A matrix class with serialization and advanced input/output functions

  9. BOOK:: C Interfaces and Implementations

  10. BOOK:: C Interfaces and Implementations
  11. drh/cii
  12. This hierarchy contains all the source code from my book "C Interfaces and Implementations: Techniques for Creating Reusable Software (Addison-Wesley Professional Computing Series, 1997, ISBN 0-201-49841-3).
    For installation instructions, see install.html.

  13. google download site
  14. Recommended Books
  15. Articles by john morrison leon (Articles: 10)
  16. MFC tricks related with matrix

  17. An examination of menus from a beginner's point of view
  18. Scrollbars, using the WS_HSCROLL and WS_VSCROLL styles
  19. MFC Document/View documentation and enhancements
  20. Getting BN_DOUBLECLICK to Work for Buttons
  21. Space and Matrix Transformations - Building a 3D Engine
  22. Least Squares: A Matrix Approach in Java
  23. Applying Matrix Transformations in GDI+
  24. C++ Include test: full matrix
  25. Top 5 Beautiful C++ std Algorithms Examples
  26. Debug/Release Numerical Differences
  27. x86/x64 Library Numerical differences
  28. 64-bit programs and floating-point calculations
  29. Accelerating Debug Runs, Part 1: _NO_DEBUG_HEAP
  30. Visual Studio Slow Debugging and _NO_DEBUG_HEAP
  31. Smart Pointers Gotchas
  32. Learning Basic Math Used In 3D Graphics Engines

Tuesday, October 20, 2020

LNK4075 ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification

LNK4075 ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification

    good posts with personal thoughts and understanding

  1. LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
  2. How to fix Visual Studio C++ Warning: LINK4075
  3. Supported Code Changes (C++)
  4. Supported Code Changes and Limitations (C++)

  5. LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
  6. 42 You can either have "Edit and continue" support or optimizations. Usually, you put "Edit and continue" on debug builds, and optimizations on release builds. Edit and continue allows you to change code while you are debugging and just keep the program running. It's not supported if the code also has to be optimized.

  7. /SAFESEH disables Edit and Continue? RRS feed
  8. It's a documentation bug, I annotated the MSDN article. It makes sense, /SAFESEH generates stack unwinding info in a table rather than using the stack. That's incompatible with Edit+Continue's need to move code around into empty spots of the image, it's not smart enough to update the table.

    The workaround is simple, /SAFESEH makes no sense in the debug build. Only use that linker option in the Release build.

    Like Hans Passant pointed out, the option to turn SAFESEH off is project properties >> Configuration Properties >> Linker >> Advanced. The last option there 'Image Has Safe Exception handlers'

  9. Warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
  10. #visual studio compilation # warning LNK4075: ignoring '/ EDITANDCONTINUE' due to '/ SAFESEH' specification

Warning D9035 option 'Gm' has been deprecated and will be removed in a future release LargeNumber

whewn I compile a legacy project and ran into this warning:

Warning D9035 option 'Gm' has been deprecated and will be removed in a future release LargeNumber

  1. Command line warning D9035: option 'Gm' has been deprecated and will be removed in a future release
  2. Try selecting for the Enable Minimal Rebuild option (under C/C++ > Code Generation). After this, the option should show No (/Gm-), not in bold. Make sure you do this for your project(s) (you could have several projects in the solution), and all property pages they inherit from.

    I had the same problem using Visual Studio 2019, in the end the problem was in a second project I had in the same solution, that had the option set to Yes (/Gm).

Monday, October 19, 2020

copy constructor and move semantics in C++

copy constructor and move semantics in C++

  1. C++ Explained: Object initialization and assignment, lvalues and rvalues, copy and move semantics and the copy-and-swap idiom
  2. C++11 Move Semantics, rvalue Reference
  3. Inside C++ – Class, Struct and Objects
  4. C++11 Constructors and Copy Assignment – Part 2
  5. C++ Class Hierarchies Crash Course: Derivation (“is-a”) vs Composition (“has-a”), and Is a Square a Rectangle?
  6. C++: Polymorphic cloning and the CRTP (Curiously Recurring Template Pattern)
  7. C++ Copy Constructor in depth
  8. Copy Constructors and Assignment Operators: Just Tell Me the Rules!
  9. Explicit Constructor in C++

How to convert a std::string to const char* or char*?

How to convert a std::string to const char* or char*?

  1. How to convert a std::string to const char* or char*?
  2. What is the difference between String and string in C#?
  3. How do I iterate over the words of a string?

print hex code of char or string in C++

print hex code of char or string in C++

  1. ASCII Text to Hex Code Converter
  2. you can type a string and see the text code in hex quickly.

  3. ASCII Table and Description
  4. how do I print an unsigned char as hex in c++ using ostream?
  5. it has a good program to do this. need to use it in future..

  6. Formatting Cout Output in C++ using iomanip
  7. How to print unsigned char[] as HEX in C++?
  8. Display char as Hexadecimal String in C++
  9. Print unsigned char array in c
  10. Working with Hexadecimal values in C programming language
  11. StringStream in C++ for Decimal to Hexadecimal and back
  12. C++ - Working with characters and text

C++ serialization research

C++ serialization research

  1. C++ serialization framework/library
  2. Visual Leak Detector for Visual C++ 2008-2015
  3. Visual Leak Detector
  4. KindDragon / vld
  5. Building Visual Leak Detector from Source

Saturday, October 17, 2020

Fibo basics

Fibo basics. google: "fibonacci phi"

  1. Shooting Fibonacci Rabbits
  2. Fibonacci
  3. Stock Market Analysis, Phi and the Fibonacci Sequence
  4. FX tectips
  5. Golden Ratio Do It Yourself Projects
  6. PhiMatrix Golden Ratio Design Software

muParser, mathematical parser technique

muParser, mathematical parser technique

  1. muparser - fast math parser library
  2. beltoforion / muparser on GitHub
  3. muparserx - Math Parser Library
  4. beltoforion / muparserx
  5. Ingo Berg beltoforion
  6. Basic Programming Concepts for Beginners
  7. iberg's muParser modified to support pointer data types

size of class or object in C++

size of class or object in C++

  1. Size of C++ classes
  2. how to determine sizeof class with virtual functions?
  3. Determining the Size of a Class Object
  4. Object
  5. sizeof operator
  6. Why is the size of an empty class not zero in C++?
  7. How do I calculate size of a simple class in C++?
  8. Size of a C++ class object
  9. Size of a class in C++ | Padding, alignment in class | Size of derived class
  10. Firstly, while in C++ there are member functions, static data members. Do those have any contribution to the size of the class, objects?

    The answer is no. Only the non-static data members contribute to the size of class and objects. This is because static members have only one instance which is shared among all objects. And normal member functions are like executable code which does not have size like data members.

Friday, October 16, 2020

deep understanding of OOP concepts and __CPUID macro

deep understanding of OOP concepts and __CPUID macro. from a nerd:)

  1. __cpuid, __cpuidex
  2. djkaty / Il2CppInspector
  3. C++ Explained: Object initialization and assignment, lvalues and rvalues, copy and move semantics and the copy-and-swap idiom
  4. How to determine programmatically whether your application and OS are 32 or 64-bit
  5. Printing numbers in binary format in C++
  6. While a looping solution still has applicability in some other languages, there is a much more elegant way to do it in C++ that is often overlooked:
    int v = 0x12345678; std::cout << std::bitset<32>(v);

    #include header file : bitset

  7. How to determine programmatically if your processor has hyperthreading, SIMD and other processing capabilities with __cpuid
  8. Tutorial: How To Fix WMI Corruption
  9. Visual Studio 2012 – Day 1 Annoyances (with an emphasis on C++)
  10. C++ Class Hierarchies Crash Course: Derivation (“is-a”) vs Composition (“has-a”), and Is a Square a Rectangle?
  11. C++ Class Hierarchies Crash Course: Derivation (“is-a”) vs Composition (“has-a”), and Is a Square a Rectangle?

mathematics related topics

keyword: squar root in cp.com

  1. Drawing a Line Graph in GDI+
  2. very good transformation way...

  3. Basics of Signing and Verifying code
  4. DataPlotter - linear or logarithmic display of 2D data
  5. Linear and Logarithmic Display of 2D Data, An Enhancement
  6. Segmented Linear Regression
  7. Sparse Array Template Class
  8. A Real Polynomial Class with Root Finder
  9. Linear Equation Solver in C++
  10. Square Root algorithm for C
  11. Numerical Methods with C++ Part 3: Root Approximation Algorithms
  12. A Short Introduction into IEEE 754 Floating-Point Model
  13. Numerical Methods in C++ Part 1: Newton-Cotes Integration
  14. Ben1980 / numericalIntegration
  15. Numerical Methods in C++ Part 2: Gauss-Legendre Integration
  16. loguru documentation
  17. Introduction into Logging with Loguru
  18. Least Mean Square Algorithm (using C++)
  19. SR2JLIB - A Symbolic Regression Library for Java
  20. Natural Logarithms and Exponent
  21. Microcontrollers & CORDIC Methods
  22. Fast stepwise rotation
  23. Perspective Projection of a Rectangle (Homography)
  24. Natural Logarithms and Exponent
  25. Microcontrollers & CORDIC Methods
  26. Natural Logarithms and Exponent
  27. Natural Logarithms and Expone
  28. Calculate exp() and log() Without Multiplications

Thursday, October 15, 2020

basic data type of C++

basic data type of C++

  1. Print character through ASCII value using cout in C++
  2. 4.11 — Chars
  3. “C++ int to char*” Code Answer
  4. 4.12 — Literals
  5. std::dec, std::hex, std::oct
  6. std::oct , std::dec and std::hex in C++
  7. C++ cout hex values?
  8. Input/output manipulators
  9. String literals
  10. Integer literals

  11. Floating point literal
  12. suffix, if present, is one of f, F, l, or L. The suffix determines the type of the floating-point literal:
    (no suffix) defines double
    f F defines float
    l L defines long double

  13. Types of Literals in C/C++ with Examples
  14. What's the C++ suffix for long double literals?
  15. C - Constants and Literals
  16. C Floating-Point Constants
  17. Floating-point literals
  18. C library function - strlen()
  19. C++ Standard Library headers

  20. Fundamental types
  21. Built-in types (C++)
  22. Built-in types (also called fundamental types) are specified by the C++ language standard and are built into the compiler. Built-in types aren't defined in any header file. Built-in types are divided into three main categories: integral, floating-point, and void. Integral types represent whole numbers. Floating-point types can specify values that may have fractional parts. Most built-in types are treated as distinct types by the compiler. However, some types are synonyms, or treated as equivalent types by the compiler.

    Void type
    The void type describes an empty set of values. No variable of type void can be specified. The void type is used primarily to declare functions that return no values or to declare generic pointers to untyped or arbitrarily typed data. Any expression can be explicitly converted or cast to type void. However, such expressions are restricted to the following uses:

    1. An expression statement. (For more information, see Expressions.)
    2. The left operand of the comma operator. (For more information, see Comma Operator.)
    3. The second or third operand of the conditional operator (? :). (For more information, see Expressions with the Conditional Operator.)

  23. Comma Operator: ,
  24. Sequential-Evaluation Operator
  25. Conditional Operator: ? :
  26. ODULE 2 C AND C++ PROGRAM CONSTRUCT AND BASIC DATA TYPES 1
  27. MODULE 2_1 C AND C++ CONSTRUCTS AND BASIC DATA TYPES 2
  28. MODULE 2a MORE ON C/C++ CONSTRUCTS AND BASIC DATA TYPES 3
  29. MODULE 2b FINAL PART C/C++ CONSTRUCTS AND BASIC DATA TYPES 4
  30. How to enter the value of EOF in the terminal
  31. C LAB WORKSHEET 6 C scanf(), scanf_s() family 1
  32. C LAB WORKSHEET 6_1 C scanf(), scanf_s() Examples & Exercises 2
  33. C LAB WORKSHEET 6_2 C scanf(), scanf_s() Exercises 3
  34. C LAB WORKSHEET 5_2 C/C++ Variable, Operator And Type 3
  35. C LAB WORKSHEET 5_1 C/C++ Variable, Operator And Type 2
  36. C LAB WORKSHEET 5 C/C++ Variable, Operator And Type 1

Wednesday, October 14, 2020

C++ operator precedence table

C++ operator precedence table

  1. C++ Operator Precedence and Associativity
  2. Also, multiple operators can have the same level of precedence (as we can see from the above table). When multiple operators of the same precedence level are used in an expression, they are evaluated according to their associativity.

    int a = 1;
    int b = 4;
    b += a -= 6;

  3. Operators Precedence in C++
  4. C++ Operator Precedence
  5. Explicit type conversion
  6. Increment/decrement operators
  7. C Operator Precedence
  8. C++ built-in operators, precedence, and associativity
  9. C++ Operator Precedence
  10. C/C++ Reference
  11. C++ Operator Precedence
  12. cpp-built-in-operators-precedence-and-associativity.md
  13. C Operator Precedence Table :: PDF
  14. Operators in C and C++:: Wikipedia
  15. Table
    For the purposes of these tables, a, b, and c represent valid values (literals, values from variables, or return value), object names, or lvalues, as appropriate. R, S and T stand for any type(s), and K for a class type or enumerated type.

  16. Operators Precedence in C++
  17. Operator Precedence and Associativity in C
  18. Operator precedence determines which operator is performed first in an expression with more than one operators with different precedence.

  19. C++ Operator Precedence
  20. IBM knowledge

  21. Operator precedence and associativity::IBM
  22. Examples of expressions and precedence
  23. Compound literal expressions
  24. new expressions (C++ only)
  25. delete expressions (C++ only)
  26. Reference collapsing (C++11)
  27. 5.1 — Operator precedence and associativity
  28. 2.1 Operators and Operands
  29. C++ Operator Precedence
  30. C++ Operator Precedence Chart (highest on top)

Tuesday, October 13, 2020

how to configure : _cplusplus macro variables in Visual Studio 2017

_cplusplus macro in Visual Studio 2017. how to use it?

  1. Predefined macros
  2. The Microsoft C/C++ compiler (MSVC) predefines certain preprocessor macros, depending on the language (C or C++), the compilation target, and the chosen compiler options.

    MSVC supports the predefined preprocessor macros required by the ANSI/ISO C99, C11, and C17 standards, and the ISO C++14 and C++17 standards. The implementation also supports several more Microsoft-specific preprocessor macros. Some macros are defined only for specific build environments or compiler options. Except where noted, the macros are defined throughout a translation unit as if they were specified as /D compiler option arguments. When defined, the macros are expanded to the specified values by the preprocessor before compilation. The predefined macros take no arguments and can't be redefined.

  3. /Zc (Conformance)
  4. You can use the /Zc compiler options to specify standard or Microsoft-specific compiler behavior.

    Syntax /Zc:option{,option}

  5. /permissive- (Standards conformance)
  6. Specify standards conformance mode to the compiler. Use this option to help you identify and fix conformance issues in your code, to make it both more correct and more portable.

    To set this compiler option in the Visual Studio development environment

    In Visual Studio 2017 version 15.5 and later versions, use this procedure:
    Open your project's Property Pages dialog box. Select the Configuration Properties > C/C++ > Language property page. Change the Conformance mode property value to Yes (/permissive-). Choose OK or Apply to save your changes.

    In versions before Visual Studio 2017 version 15.5, use this procedure:
    Open your project's Property Pages dialog box. Select the Configuration Properties > C/C++ > Command Line property page. Enter the /permissive- compiler option in the Additional Options box. Choose OK or Apply to save your changes.

  7. /Zc:__cplusplus (Enable updated __cplusplus macro)
  8. The /Zc:__cplusplus compiler option enables the __cplusplus preprocessor macro to report an updated value for recent C++ language standards support. By default, Visual Studio always returns the value "199711L" for the __cplusplus preprocessor macro.

    Syntax /Zc:__cplusplus[-]

  9. /std (Specify Language Standard Version)
  10. Enable supported C and C++ language features from the specified version of the C or C++ language standard.

    Syntax /std:c++14
    /std:c++17
    /std:c++latest
    /std:c11
    /std:c17

    By default, when code is compiled as C, the MSVC compiler doesn't conform to a particular C standard. It implements ANSI C89 with several Microsoft extensions, some of which are part of ISO C99. Some Microsoft extensions can be disabled by using the /Za compiler option, but others remain in effect. It isn't possible to specify strict C89 conformance.

    Starting in Visual Studio 2019 version 16.8, you may specify /std:c11 or /std:c17 for code compiled as C. These options specify conformance modes that correspond with ISO C11 and ISO C17. Because the new preprocessor is needed to support these standards, the /std:c11 and /std:c17 compiler options set the /Zc:preprocessor option automatically. If you want to use the traditional (legacy) preprocessor for C11 or C17, you must set the /Zc:preprocessor- compiler option explicitly. Setting the /Zc:preprocessor- option may lead to unexpected behavior, and isn't recommended.

    Since C17 is largely a bug fix release of ISO C11, MSVC support for C11 already includes all the relevant defect reports. At present, there are no differences between the C11 and C17 versions except for the __STDC_VERSION__ macro. It expands to 201112L for C11, and 201710L for C17.

    To set this compiler option in the Visual Studio development environment

    1. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
    2. Select Configuration Properties, C/C++, Language.
    3. In C++ Language Standard (or for C, C Language Standard), choose the language standard to support from the dropdown control, then choose OK or Apply to save your changes.

  11. Microsoft C++ language conformance table
  12. Mouse and KeyBoard Hooking utility with VC++
  13. it has good code snippet:

    6 #ifdef __cplusplus
    7 extern "C" {
    8 #endif // __cplusplus
    9 #define LIBSPEC __declspec(dllexport
    11 LIBSPEC BOOL InstallKeyBoardHook(HWND hWndParent);
    12 LIBSPEC BOOL UnInstallKeyBoardHook(HWND hWndParent);
    13 #undef LIBSPEC
    14 15 #define UWM_KEYBOARD_MSG ("UWM_KEYBOARD_USER_MSG")
    16 #ifdef __cplusplus
    17 }
    18 #endif // __cplusplus

  14. /Zp (Struct Member Alignment)
  15. Controls how the members of a structure are packed into memory and specifies the same packing for all structures in a module.

    Syntax
    /Zp[1|2|4|8|16]

  16. Linker options
  17. Some Handy Visual C++ Pre-Processor Macros
  18. The Lost Art of Structure Packing
  19. Objects and alignment

Monday, October 12, 2020

C++ tips and C++ exit() function

C++ exit() function

  1. Partial C/C++ Function List
  2. decoding * and inc/dec operator combos like *++p , *p-- ,etc
  3. C and C++ Programming Tips
  4. exit()
  5. Prototype: void exit(int ExitCode);
    Header File: stdlib.h (C) or cstdlib (C++)
    Explanation: Exit ends the program. The ExitCode is returned to the operating system, similar to returning a value to int main.

  6. Partial C/C++ Function List
  7. A note about C vs. C++ Note that header files from the C standard library should have the form headername.h when used in a C program, and the form cheadername when used in C++ programs (note the c as a prefix). For instance, in a C program the stdlib header file would be included as follows

tips and tricks on MFC controls

tips and tricks on MFC controls

  1. Application Information and Management
  2. When you write an application, you create a single CWinApp-derived object. At times, you may want to get information about this object from outside the CWinApp-derived object. Or you may need access to other global "manager" objects.

    The Microsoft Foundation Class Library provides the following global functions to help you accomplish these tasks:

  3. icrosoft Visual C++/ MFC
  4. The Values of a Windows Control
  5. Lines
  6. GDI Topics: Polylines
  7. GDI Topics: Polygons
  8. GDI Topics: Rectangles
  9. Bézier Curves
  10. The GDI Coordinate Systems
  11. Wizard Pages

Saturday, October 10, 2020

Error C2664 'Employee::Employee(const Employee &)': cannot convert argument 1 from 'const char [4]' to 'char *'

used function_name(char*,char*) to define strings. later on in main(), assign them with literals such as "Bob", "Robert" , then get this error.

Error C2664 'Employee::Employee(const Employee &)': cannot convert argument 1 from 'const char [4]' to 'char *'

  1. C++ cannot convert parameter 1 from 'const char *' to 'char *'
  2. Cannot convert argument 1 from 'const wchar_t [16]' to 'LPTSTR'
  3. error C2664 cannot convert argument 1 from 'const char [11]' to 'LPSTR'
  4. You have some options:

    1. Disable Conformance Mode (easiest) : tested
    2. Cast to a char* : tested
    3. Define as non const: ?
    4. Make function take const arguments : tested such as const char*...

  5. Compiler Error C2664
  6. it has many good examples and need to browse when got time...

    If a temporary object is passed to a function that takes a reference to an object as a parameter, that reference must be a const reference.

    If the function is passed a parameter that is not of the type that the function expects, a temporary object is created by using the appropriate constructor. This temporary object is then passed to the function. In this case, the temporary object is used to initialize the reference. In earlier versions of the language, all references could be initialized by temporary objects.

    To fix C2664, 1. Recheck the prototype for the given function and correct the argument noted in the error message. 2. Supply an explicit conversion if necessary.

QuantLib research topics

QuantLib research topics

  1. quantlib / releases:: download soure code
  2. Download QuantLib
  3. Official QuantLib Documentation
  4. QuantLib documentation
  5. Building QuantLib in VS2017
  6. Writing Your First QuantLib Program in C++
  7. Introduction to the Swap Model
  8. What Makes Qubits So Powerful?
  9. lballabio / QuantLib

Tuesday, October 6, 2020

const function in C++

const keyword after function header..

  1. Initializers
  2. extern (C++):: microsoft
  3. take a look:)

  4. 8.10 — Const class objects and member functions
  5. Const member functions in C++
  6. Like member functions and member function arguments, the objects of a class can also be declared as const. an object declared as const cannot be modified and hence, can invoke only const member functions as these functions ensure not to modify the object.

    A const object can be created by prefixing the const keyword to the object declaration. Any attempt to change the data member of const objects results in a compile-time error.

    Syntax: const Class_Name Object_name;

    • When a function is declared as const, it can be called on any type of object, const object as well as non-const objects.
    • Whenever an object is declared as const, it needs to be initialized at the time of declaration. however, the object initialization while declaring is possible only with the help of constructors.

    A function becomes const when the const keyword is used in the function’s declaration. The idea of const functions is not to allow them to modify the object on which they are called. It is recommended the practice to make as many functions const as possible so that accidental changes to objects are avoided.

  7. const (C++)
  8. const member functions Declaring a member function with the const keyword specifies that the function is a "read-only" function that does not modify the object for which it is called. A constant member function cannot modify any non-static data members or call any member functions that aren't constant.To declare a constant member function, place the const keyword after the closing parenthesis of the argument list.

    The const keyword is required in both the declaration and the definition.

  9. Const member functions in C++ :: already tested
  10. The const member functions are the functions which are declared as constant in the program. The object called by these functions cannot be modified. It is recommended to use const keyword so that accidental changes to object are avoided.

    A const member function can be called by any type of object. Non-const functions can be called by non-const objects only.

  11. Meaning of 'const' last in a function declaration of a class?
  12. What is meant with “const” at end of function declaration? [duplicate]
  13. const (computer programming)
  14. The C++ 'const' Declaration: Why & How
  15. 8.9 — Class code and header files
  16. 8.8 — The hidden “this” pointer
  17. 8.7 — Destructors
  18. 8.6 — Overlapping and delegating constructors
  19. Const Correctness
  20. C++ keywords: const

Warning :: LNK4075 ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification

another warning message when I compile legacy project:

Warning LNK4075 ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification

  1. Warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
  2. warning LNK4075: ignoring '/ EDITANDCONTINUE' due to '/ SAFESEH' specification
  3. VS2015 cannot use edit and continue and warning LNK4075 solution
  4. LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
  5. Supported Code Changes and Limitations (C++)
  6. Supported Code Changes (C++)
  7. Edit and Continue (Visual C++)
  8. VS2019:: Edit and Continue (C++)
  9. /SAFESEH disables Edit and Continue?
  10. Visual Studio 2012 compilation error [warning C4996: 'scanf': This function or variable may be unsafe. 】 solution

Warning D9035 option 'Gm' has been deprecated and will be removed in a future release

when I compile a legacy project in VC++ 2017, I ran into this message and take note here:

Warning D9035 option 'Gm' has been deprecated and will be removed in a future release

  1. Command line warning D9035: option 'Gm' has been deprecated and will be removed in a future release
  2. Try selecting for the Enable Minimal Rebuild option (under C/C++ > Code Generation). After this, the option should show No (/Gm-), not in bold. Make sure you do this for your project(s) (you could have several projects in the solution), and all property pages they inherit from.

    I had the same problem using Visual Studio 2019, in the end the problem was in a second project I had in the same solution, that had the option set to Yes (/Gm).

  3. /Gm (Enable Minimal Rebuild)
  4. Deprecated. Enables minimal rebuild, which determines whether C++ source files that include changed C++ class definitions (stored in header (.h) files) need to be recompiled.

    /Gm is deprecated. It may not trigger a build for certain kinds of header file changes. You may safely remove this option from your projects. To improve build times, we recommend you use precompiled headers and incremental and parallel build options instead. For a list of deprecated compiler options, see the Deprecated and Removed Compiler Options section in Compiler Options Listed by Category.

Monday, October 5, 2020

big guys' paper list --- floppy disk tricks

big guys' paper list

  1. How to read and write old floppy disks
  2. ATTACHING 5.25″ FLOPPIES VIA USB
  3. Device Side Data - USB Adapter/Controller for 5.25" Floppy Disk Drive Review
  4. How to play old-style 5.25 inch floppy disk games on a modern PC, using the FC5025!
  5. Sabrent USB 3.0 to SSD/SATA/IDE 2.5/3.5/5.25-INCH Hard Drive Converter with UL Power Supply & LED Activity Lights [10TB Support] (USB-DS12)

  6. Articles by #realJSOP (Articles: 69, Tip/Tricks: 84)
  7. Articles by Michael Haephrati (Articles: 45, Tip/Tricks: 2)
  8. Articles by Marc Clifton (Articles: 239, Project: 1, Tip/Tricks: 5)
  9. Tracking The Mouse In A View
  10. Capturing the Mouse
  11. Global Mouse and Keyboard Library
  12. Mouse Events
  13. Create your Own Runtime Movable Windows Forms Controls
  14. A Decimal Class Implementation
  15. A Simple Moving Average Algorithm
  16. Disable MFC SDI/MDI Submenu
  17. List of _MSC_VER and _MSC_FULL_VER
  18. Visual Studio version and discrimination macros

check .NET framework versions

check .NET framework versions

  1. .NET Framework Checker

research on UUID topics

ater got these UUIDs, then need to come up with a key to protect my software..

  1. Machine Finger Print - The Right and Efficient Way
  2. Protecting your work - use the right way to identify your client machine

  3. How to Get the BIOS UUID
  4. Get a unique identifier for a computer The BIOS UUID is a unique number tied to the motherboard and if you changed your motherboard, you can safely say you changed your computer. From my point of view, it is a better method of identifying your hardware and, as I'll show you in this tip, it is very easy to implement.

  5. Creating a Unique String Using a UUID
  6. A small function to either accept or create a UUID* and return a CString

    You will have to #include rpcdce.h into your code and link rpcrt4.lib into your program in order for this to work. If you don't have either of these files, download the latest *release* version of the Platform SDK. I've taken the liberty of showing you the contents of the two files I created to make it a little simpler. If you create a CPP and an H file, and then copy/paste these two sections into the approriate files, you won't have to do anything other than adding the files to your project (and installing the SDK of course), and then doing a build.

  7. Developing RPC Windows Applications
  8. How to solve Link Error on call to ::UuidToString()?
  9. Compiler cannot find .lib file
  10. rpc.h linking issue
  11. When you want to use the functions included in rpc.h, you can use two ways like as follows:

    1. Click Project -> Properties -> Linker -> General -> Additional Library Directories, add the directorie of Rpcrt4.lib to this box, the Rpcrt4.lib always locate in the path: %Program Files%\Microsoft SDKs\Windows\v6.0A\Lib; and then, add Rpcrt4.lib to Linker-> Input ->Additional Dependences. In your program, just use "#include ".

    2. Just use the following code in your program: #include #pragma comment(lib, "Rpcrt4.lib") The two above methods both work fine.

    on my laptop, it is located at :C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib

  12. Create a Windows Service Application Using the Boost.Application Library
  13. Searching for a Reliable Hardware ID
  14. Searching for a Reliable Hardware ID
  15. denisbrodbeck / machineid
  16. machineid provides support for reading the unique machine id of most host OS's (without admin privileges)

    1. Cross-Platform (tested on Win7+, Debian 8+, Ubuntu 14.04+, OS X 10.6+, FreeBSD 11+) 2. No admin privileges required 3. Hardware independent (no usage of MAC, BIOS or CPU — those are too unreliable, especially in a VM environment) 4. IDs are unique1 to the installed OS

    Function: ID() (string, error) Returns original machine id as a string.

    Function: ProtectedID(appID string) (string, error) Returns hashed version of the machine ID as a string. The hash is generated in a cryptographically secure way, using a fixed, application-specific key (calculates HMAC-SHA256 of the app ID, keyed by the machine ID).

    What you get This package returns the OS native machine UUID/GUID, which the OS uses for internal needs. All machine IDs are usually generated during system installation and stay constant for all subsequent boots. The following sources are used:

    Windows uses the MachineGuid from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography

    Unique Key Reliability Do note, that machine-id and MachineGuid can be changed by root/admin, although that may not come without cost (broken system services and more). Most IDs won't be regenerated by the OS, when you clone/image/restore a particular OS installation. This is a well known issue with cloned windows installs (not using the official sysprep tools).

    A machine ID uniquely identifies the host. Therefore it should be considered "confidential", and must not be exposed in untrusted environments. If you need a stable unique identifier for your app, do not use the machine ID directly.

    A reliable solution is to hash the machine ID in a cryptographically secure way, using a fixed, application-specific key.

    That way the ID will be properly unique, and derived in a constant way from the machine ID but there will be no way to retrieve the original machine ID from the application-specific one.

    On Windows: reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography /v MachineGuid
    or

    Open Windows Registry via regedit Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography Take value of key MachineGuid

  17. The Best Way To Uniquely Identify A Windows Machine
  18. wmic csproduct get UUID

  19. The Best Way To Uniquely Identify A Windows Machine
  20. wmic bios get name,serialnumber,version

    wmic cpu get name,CurrentClockSpeed,MaxClockSpeed

    wmic cpu get name,CurrentClockSpeed,MaxClockSpeed /every:1

  21. How to uniquely identify windows machine
  22. get-wmiobject Win32_ComputerSystemProduct | Select-Object -ExpandProperty UUID