Monday, May 31, 2021

OpenGL render class

OpenGL render class

    Basics

  1. Rendering a Triangle using OpenGL(using Shaders)
  2. A good example to use shader..

    In this article we’ll see how to render a triangle using OpenGL. A triangle is probably the simplest shapes you can draw in OpenGL after points and lines and any complicated geometry that you make will me made up of number of triangles joined together..

  3. How to Create 3D and 2D Graphics with OpenGL and C++
  4. OpenGL is a cross-language, cross-platform graphics API for rendering 2D and 3D scenes using a graphics card.

  5. OpenGL Examples
  6. Here are some OpenGL example programs, presented in an order in which new topics are added in each successive example. Many of these are modifications of programs in the OpenGL Red Book..

  7. OpenGL Windows GUI Application
  8. This article is about a MVC (Model-View-Controller) framework to create OpenGL GUI applications on Windows platform. MVC architecture is a common design framework for GUI applications, and is used in many GUI libraries, such as .NET, MFC, Qt, JavaFX, etc. The major benefits of this MVC framework are the complete separation of system-independent OpenGL calls from Windows system and the universal message router for multiple windows..

    typical implementations

  9. htmlboss / OpenGL-Renderer
  10. MP-APS A modern OpenGL 3D rendering engine. The idea behind it is to be very simple to use: no weird abstraction layers, janky variable names, or massive 2000+ line classes. It's primarily a playground for me to implement (or at least try :P) different graphics programming techniques. Progress has been slow since I'm juggling full-time Univesity studies, work, and trying to be physically active. Eventually, I want to create a "scene-based" engine, where you can load up some model(s), add some fancy lights, and virtually explore it.

  11. OpenGLRenderer Class Reference
  12. A base class that should be implemented by classes which want to render openGL on a background thread. More... .

  13. Class Index
  14. Class Index List: good class design

    • Draggable3DOrientation
    • Matrix3D
    • OpenGLAppComponent
    • OpenGLContext
    • OpenGLFrameBuffer
    • OpenGLGraphicsContextCustomShader
    • OpenGLHelpers
    • OpenGLImageType
    • OpenGLPixelFormat
    • OpenGLRenderer
    • OpenGLShaderProgram
    • OpenGLShaderProgram::Attribute
    • OpenGLShaderProgram::Uniform
    • OpenGLTexture Quaternion
    • Vector3D.

  15. OpenGL rendering:: ROOT
  16. complete OpenGL 2D and 3D class design.

  17. 3D graphics with OpenG
  18. 3D graphics with OpenGL.

  19. Galleries produced with ROOT
  20. This gallery shows some of the plots (produced using ROOT) presented when the Higgs boson discovery was announced at CERN..

  21. Release 6.24/00 - 2021-04-15
  22. source code to download.

  23. Writing a Basic Renderer in OpenGL
  24. short video to get some senses

    • Patreon ► https://patreon.com/thecherno
    • Twitter ► https://twitter.com/thecherno
    • Instagram ► https://instagram.com/thecherno
    • Discord ► https://thecherno.com/discord Series Playlist ► https://thecherno.com/opengl

  25. Abstracting OpenGL into Classes
  26. Abstracting OpenGL into Classes.

  27. Render OpenGL object in a class?
  28. I'm trying to learn modern OpenGL and create classes for various primitive types such as cubes, spheres, etc. I have run into a problem, though, where my cube class isn't rendering anything in its Draw() function, but if I move it all into my main() function it works fine.

  29. Basic OpenGL Renderer class
  30. made this Renderer class recently, to simplify the user interface of my library's API. I would like to ask advice about the move semantics (copy constructor, std::unique_ptr, ...), or any other things you can point out to improve my code.

    As you can see, I take in parameters in RenderObject in the form of a pointer. This is simply because Material uses a Texture class, whose assignment operators are disabled. It only has a move constructor (C++11), but Material cannot use it..

  31. OpenGL Renderer Design
  32. My Note: this is greate article and I need to study it. can make my render class like this one.

    Lately I’ve been writing lots of OpenGL programs for course projects and for-fun rendering side-projects. I’ve started to notice an overall design that works pretty well for these kinds of projects, and I’m going to document it here.

    This design matches closely the idea of “Model-view-viewmodel” aka. “MVVM”. If you’re unfamiliar with this term, be aware that the words “model” and “view” here aren’t talking about 3D models or cameras or transformation matrices. MVVM is an object-oriented architectural pattern, similar to MVC (“Model view controller”). MVVM maps to the design of a renderer as follows:

    • Model: The scene which the renderer should render.
    • View: The renderer that traverses the scene and displays it.
    • View model: The data the renderer uses internally to render the scene.

  33. Steps for making a basic renderer class
  34. I have been learning OpenGL for a while and I have learnt how to draw triangles/squares and use shaders. I have built a very basic bunch of classes for doing each job so far i.e. vertex buffer class, shader class, entity class. I have also learnt the basics of transformations/view matricies etc.

    If I want to draw multiple basic shapes on the screen like 10 triangles then due to the way I have written the classes that would mean 10 calls to glDrawArrays, glBufferData etc.

    What I am trying to do next is build a basic class where its job is to bundle all of the rendering data together and run as few render calls as possible to generate multiple shapes.

    What Im thinking is adapting my entity class to hold the mesh data and have a renderer class somehow workout how many entities there are and then add the buffer data of each entity into glBufferData for example..

  35. opengl.drawable — OpenGL rendering objects for the new OpenGL2 engine.
  36. Classes defined in module opengl.drawable.

  37. a-simple-triangle / Part 10 - OpenGL render mesh
  38. a-simple-triangle / Part 10 - OpenGL render mesh

  39. G-Engine #4: Basic 3D Rendering
  40. This is a paragraph.

  41. Renderer Class Reference
  42. A helper class that provides common AR related rendering tasks..

OpenGL - MFC viewer control

this control gives some hints for design such a viewer...

GLEnabledView.h and GLEnabledView.cpp are great to review....

  1. PicZoom: A Photo Viewer Created in OpenGL
  2. PicZoom: A Photo Viewer created in OpenGL.

  3. CGLEnabledView - An MDI view class supporting OpenGL
  4. A plug-in view class that provides OpenGL support.

  5. fatal error C1083: Cannot open include file: 'iostream': No such file or directory
  6. I've reinstalled Visual Studio 2010 Professional several times to try to get it to work. I had to uninstall Visual Studio 2012 Professional because it wasn't compiling something we did in class.

    I completely uninstalled everything including SQL Server.. I went to VC/include and the iostream header file is not there.

    Answer: One problem is that you did not include the namespace std.

  7. Visual c++ can't open include file 'iostream'
  8. I am new to c++. I just started! I tried a code on visual c++ 2010 Express version but i got the following code error message..

  9. Why can't g++ find iostream.h?
  10. I'm trying to understand how to compile C++ programs from the command line using g++ and (eventually) Clang on Ubuntu.

    I found a webpage which explains MakeFiles and I am following their directions. http://mrbook.org/tutorials/make/

  11. How do you solve an "iostream.h no such file in directory" compilation error?
  12. How do you solve an "iostream.h no such file in directory" compilation error?.

  13. fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
  14. fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

  22. This is a paragraph.

  23. This is a paragraph.

  24. This is a paragraph.

  25. This is a paragraph.

Thursday, May 27, 2021

template tricks & tips

template tricks & tips

  1. Avoid the “std 2-step”
  2. Using swap etc. from generic code must be done properly. Here’s how to fix it for good..

  3. STL: Amazing Speed Differences between std::vector and std::set (Observed with an UndoRedoAction).
  4. Why replacing std::vector with std::set sped up my UndoRedoAction class by about 20x.

  5. This is a paragraph.

  6. This is a paragraph.

  7. This is a paragraph.

  8. This is a paragraph.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

splitButton in MFC

splitButton in MFC

  1. How to enhance the MFC CSplitButton control to support images
  2. I was looking for a way to add a button which will have pull down menu options, each of them having a PNG image next to the option's text..

  3. cannot open source file “afxwin.h”/“afxext.h”/“afxdisp.h”/“afxdtctl.h”/“afxcmn.h”/afxdisp.h etc
  4. I try to ran a previous written MFC c++ code on my visual studio 2015 MFC with multitype MFC library installed.

    However, I still have 12 errors here regarding missing function:

  5. WM_USER
  6. Used to define private messages for use by private window classes, usually of the form WM_USER+x, where x is an integer value..

  7. Message Map Macros (MFC)
  8. To support message maps, MFC supplies the following macros:.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

  22. This is a paragraph.

Saturday, May 22, 2021

destructor and virtual destructor in C++

virtual destructor in C++

  1. Virtual Destructor in C++
  2. Deleting a derived class object using a pointer to a base class, the base class should be defined with a virtual destructor..

  3. Default constructors
  4. A default constructor is a constructor which can be called with no arguments (either defined with an empty parameter list, or with default arguments provided for every parameter). A type with a public default constructor is DefaultConstructible..

  5. Destructors
  6. destructor is a special member function that is called when the lifetime of an object ends. The purpose of the destructor is to free the resources that the object may have acquired during its lifetime.

    A destructor must not be a coroutine. (since C++20)

  7. This is a paragraph.

  8. This is a paragraph.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

virtual copy constructor in C++

virtual copy constructor in C++

  1. Advanced C++ | Virtual Copy Constructor
  2. This is a paragraph.

  3. This is a paragraph.

  4. This is a paragraph.

  5. This is a paragraph.

  6. This is a paragraph.

  7. This is a paragraph.

  8. This is a paragraph.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

virtual constructor an default constructor in C++

virtual constructor in C++

    Fundamental

  1. Why do we not have a virtual constructor in C++?
  2. Why does C++ not have a virtual constructor?

    From Bjarne Stroustrup's C++ Style and Technique FAQ Why don't we have virtual constructors?

    A virtual call is a mechanism to get work done given partial information. In particular, "virtual" allows us to call a function knowing only any interfaces and not the exact type of the object. To create an object you need complete information. In particular, you need to know the exact type of what you want to create. Consequently, a "call to a constructor" cannot be virtual.

    Basics

  3. Constructors (C++): from Microsoft
  4. To customize how class members are initialized, or to invoke functions when an object of your class is created, define a constructor. A constructor has the same name as the class and no return value. You can define as many overloaded constructors as needed to customize initialization in various ways. Typically, constructors have public accessibility so that code outside the class definition or inheritance hierarchy can create objects of the class. But you can also declare a constructor as protected or private.

    Constructors can optionally take a member init list. This is a more efficient way to initialize class members than assigning values in the constructor body. The following example shows a class Box with three overloaded constructors. The last two use member init lists:

  5. Advanced C++ | Virtual Constructor
  6. The virtual mechanism works only when we have a base class pointer to a derived class object.

    In C++, the constructor cannot be virtual, because when a constructor of a class is executed there is no virtual table in the memory, means no virtual pointer defined yet. So, the constructor should always be non-virtual.

    But virtual destructor is possible..

  7. The constructor function in a pure virtual class should be “protected” or “public”?
  8. This is a paragraph.

  9. C++ default constructor
  10. key note:A class constructor is a special member function of a class that is executed whenever we create new objects of that class.

    A constructor will have exact same name as the class and it does not have any return type at all, not even void. Constructors can be very useful for setting initial values for certain member variables..

  11. Constructors in C++
  12. What is constructor? A constructor is a member function of a class which initializes objects of a class. In C++, Constructor is automatically called when object(instance of class) create. It is special member function of the class.

  13. Initializing objects on the fly
  14. I have a vector called players and a class called Player. And what I'm trying to do is to write:

    players.push_back(Player(name, Weapon(bullets)));

  15. Constructors in C++11
  16. The object life cycle involves three activities: creation, destruction, and assignment. It is important to understand how and when objects are created, destroyed, and assigned, and how you can customize these behaviours.

    Objects are created at the point you declare them (if they’re on the stack) or when you explicitly allocate space for them with new or new[]. When an object is created, all its embedded objects are also created. For example:.

    C++ optimizations

  17. 3: C++ Optimizations You Can Do "As You Go"
  18. Defy the software engineering mantra of "optimization procrastination." These techniques can be added to your code today! In general, these methods not only make your code more efficient, but increase readability and maintainability, too.

  19. C++ Optimization Strategies and Techniques - Pete Isensee
  20. Many software engineers recommend what I call the "procrastination approach" to optimization. Delay optimization as much as possible, and don't do it if you can avoid it. I agree with the basic premise. Optimizing too early or too often is not a good approach to engineering. Better to have a program that runs than a fast program that crashes. On the other hand, you're not likely to write a successful app these days without doing optimization at some point in the process. Your compiler can help you, but you as a programmer understand more about your application than the compiler. As Michael Abrash puts it, the best compiler is "between your ears."

    There are many levels of optimization, but I'm going to focus on one in particular: C++ optimizations. Some of these techniques apply to other languages as well - like Java - but most are specific to C++. I'll also cover how to configure your compiler for maximum C++ efficiency.

    Advanced Constructors

  21. C++ Explained: Object initialization and assignment, lvalues and rvalues, copy and move semantics and the copy-and-swap idiom
  22. In this article I’m going to try and clear up some fundamental C++ topics which are a common source of confusion for beginning and intermediate C++ programmers, and programmers coming to C++ from other languages such as C# or Java:

    • the difference between initialization and assignment, which uses of the “=” operator trigger initialization and which trigger assignment, and how to implement them correctly in your own classes
    • the meaning of lvalues, rvalues and rvalue references and how to spot which is which in your programs
    • an introduction to C++11 move semantics
    • when copy and move constructors and assignment operators are called in your classes, and how to implement them
    • reducing the amount of duplicated and error-prone code in constructor and assignment operator implementations by using the so-called copy-and-swap idiom.

  23. Constructors
  24. ISO FAQs

Tuesday, May 18, 2021

Market data research

Market data research

  1. Alpha Vantage Support
  2. Claim your free API key with lifetime access. We highly recommend that you use a legitimate email address - this is the primary way we will contact you for feature announcements and troubleshooting purposes (e.g. if you lose your API key). We never send promotional or marketing materials to our users..

  3. Finnhub Stock API
  4. Real-Time RESTful APIs and Websocket for Stocks, Currencies, and Crypto.

    Access real-time stock API, institutional-grade fundamental and alternative data to supercharge your investment for FREE.

  5. Intrinio: Full-service financial data
  6. This is a paragraph.

  7. Intrinio: Options Data
  8. Eliminate infrastructure headaches with filtered options data.

    Leverage our powerful, easy-to-use real-time and delayed feeds for US options.

  9. EOD historical data
  10. it offers free trial. you can register and try it.

    30+ years of data Financial Data APIs >>> 761,193,576 data points and counting >>> as of May 18, 2021.

  11. AlphaVantage API Stock Market Indices
  12. 'm using python and its framework flask to build a frontEnd backEnd project. The project needs stock data. I used Yahoo's Api before it stopped working and now I'm using Alpha Vantage API. It's working pretty well but I'm having difficulties with stock market Indices like Nasdaq, Dow Jones.. with yahoo I was using their tickers(like symboles) (^IXIC, ^DJI...) but it doesn't seem to work with alpha vantage. Has anyone worked with alpha vantage?.

    Program List

  13. Acquiring stock market data from Alpha Vantage
  14. As a stock trader I need a ready of supply stock market data for analysis and visualisation. That data is needed for decision making and I often render it to a chart to better understand it.

    The free Yahoo financial API was the place to go for stock market data. However since it’s demise a new data API from Alpha Vantage has arisen. It’s also free and very easy to use. Alpha Vantage offer both daily and intraday data and I have created an open-source command line app for downloading it.

  15. Acquiring stock market data from Alpha Vantage
  16. How to download daily and intraday stock market data from Alpha Vantage from the command line and with Node.js and JavaScript..

    Ameritrade API

  17. kriasoft / TDAmeritrade
  18. TD Ameritrade Client Library for .NET Free, open-source .NET Client for the TD Ameritrade Trading Platform. Helps developers integrate TD Ameritrade API into custom trading solutions.

  19. Ameritrade for developers
  20. good portal for API

    e*Trade developer

  21. eTrade developers guide::Guides to get you going:: Sandbox overview
  22. This is a paragraph.

  23. eTrade deverlops guide:: oAuth module
  24. The E*TRADE Developer Platform uses the OAuth authorization protocol, version 1.0a. OAuth enables an authenticated user to authorize limited access to their account by third-party applications, without exposing user credentials or other sensitive information.

    This document provides a brief summary of OAuth and describes how it is used in our developer platform. We recommend that developers be familiar with the detailed OAuth information at: http://oauth.net/core/1.0a/.

  25. e*Trade: Information to get you started
  26. The E*TRADE Developer Platform enables E*TRADE customers and developers to create their own investment applications that leverage E*TRADE's extensive market data offerings, order-routing capabilities, and other services.

    The platform's API also allows E*TRADE customers who currently use a third-party trading platform to view E*TRADE account and market information and place trade orders directly to E*TRADE from that platform.

    interactive broker API

  27. interactive brokers API portal
  28. Trading API Solutions Build custom trading applications and automate any part of the process

  29. Interactive Brokers Python API (Native) – A Step-by-step Guide
  30. Interactive Brokers (IB) is a trading brokerage used by professional traders and small funds. If you want to learn how to build automated trading strategies on a platform used by serious traders, this is the guide for you.

  31. areed1192 / interactive-broker-python-api
  32. Overview The unofficial Python API client library for Interactive Broker Client Portal Web API allows individuals with Interactive Broker accounts to manage trades, pull historical and real-time data, manage their accounts, create and modify orders all using the Python programming language.

    Interactive Broker offers multiple APIs for their clients. If you would like to learn more about their API offerings click on the links below:

    What's in the API

    • Authentication
    • Account Endpoints
    • Market Data Endpoints
    • Trade Endpoints
    • Portfolio Endpoints
    • Scanner Endpoints
    • Portfolio Analysis Endpoints
    • Streaming

    Setup Requirements The following requirements must be met to use this API:

    • A Interactive Broker account, you'll need your account password and account number to use the API.
    • Java 8 update 192 or higher installed (gateway is compatible with higher Java versions including OpenJDK 11).
    • Download the Beta Client Portal Gateway

  33. TWS API Non-Commercial License
  34. This is a paragraphThis TWS API Non-Commercial License ("License") is an agreement between Interactive Brokers LLC ("IB") and You, and governs Your use of the API Code. By clicking the "I AGREE" button below, you acknowledge that You consent to be legally bound by this Agreement.

  35. An Introduction to Real-Time Stock Market Data Processing
  36. Discusses how stock market trading works, the different types of market data available, and provides a code example with sample data that processes a market data feed.

  37. Market Recorder for Interactive Brokers
  38. A tool that captures live market data for a set of symbols and saves them to 1-second snapshots in a SQL database..

  39. A primitive CEP engine to analyse stock market data in real time
  40. Can we use LinqRx as a poor-man's complex event processor?.

Saturday, May 15, 2021

MFC feature pack

MFC feature pack

  1. MFC Feature Pack Tutorial – Part 1 – Getting started
  2. This is a paragraph.

  3. MFC Feature Pack Tutorial – Part 3 – CMFCPropertyGridCtrl
  4. It’s a cool new control found in MFC feature pack. Those who’ve used VB, C#, must be familiar with this control. It’s the good old vb property control. This is how the old vb control looked. .

  5. MFC Feature Pack Tutorial – Part 2 – CMFCPropertySheet
  6. New MFC feature pack property sheet is indeed cool. It’s named as CMFCPropertySheet. We’ve got to work with it as we used to work with CPropertySheet i.e. derive our own class and add pages (CMFCPropertyPage) to it. It’s parent class is as expected, CPropertySheet..

  7. MFC Feature Pack - CMFCEditBrowseCtrl
  8. MFC Feature Pack - CMFCEditBrowseCtrl.

  9. Porting a legacy MFC application to MFC Feature Pack
  10. This is a paragraph.

  11. Where can I find MFC feature pack samples?
  12. People are having trouble finding feature pack samples installed in the samples directory. I too had a similar problem. So what you need to do is to uninstall the previous sample exe that you’ve installed. Then install the samples from here. Good thing about this is that you’ll have an updated samples package.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

  22. This is a paragraph.

  23. This is a paragraph.

  24. This is a paragraph.

Constructors and member initializer lists

Constructors and member initializer lists

    Working on ...

  1. Type
  2. Objects, references, functions including function template specializations, and expressions have a property called type, which both restricts the operations that are permitted for those entities and provides semantic meaning to the otherwise generic sequences of bits.

    Incomplete type The following types are incomplete types:

    • the type void (possibly cv-qualified);
    • incompletely-defined object types:
      • class type that has been declared (e.g. by forward declaration) but not defined;
      • array of unknown bound;
      • array of elements of incomplete type;
      • enumeration type from the point of declaration until its underlying type is determined.
    All other types are complete.

  3. complete and incomplete type
  4. Where a declaration for a type is in scope, it is either complete or incomplete. Only array types, structure types, union types and enumeration types can be incomplete, because they can be partially declared, with a full declaration coming later. For example, consider these declarations:

  5. 6.11.1 Types (incomplete type)
  6. my note: very clear description for type and incomplete type:

    6.11.1 Types ISO separates C’s types into three distinct sets: function, object, and incomplete. Function types are obvious; object types cover everything else, except when the size of the object is not known. The Standard uses the term “object type” to specify that the designated object must have a known size, but it is important to know that incomplete types other than void also refer to an object.

    There are only three variations of incomplete types: void, arrays of unspecified length, and structures and unions with unspecified content. The type void differs from the other two in that it is an incomplete type that cannot be completed, and it serves as a special function return and parameter type..

    6.11.2 Completing Incomplete Types An array type is completed by specifying the array size in a following declaration in the same scope that denotes the same object. When an array without a size is declared and initialized in the same declaration, the array has an incomplete type only between the end of its declarator and the end of its initializer.

    An incomplete structure or union type is completed by specifying the content in a following declaration in the same scope for the same tag.

    6.11.3 Declarations Certain declarations can use incomplete types, but others require complete object types. Those declarations that require object types are array elements, members of structures or unions, and objects local to a function. All other declarations permit incomplete types. In particular, the following constructs are permitted:

    • Pointers to incomplete types
    • Functions returning incomplete types
    • Incomplete function parameter types
    • typedef names for incomplete types

    The function return and parameter types are special. Except for void, an incomplete type used in such a manner must be completed by the time the function is defined or called. A return type of void specifies a function that returns no value, and a single parameter type of void specifies a function that accepts no arguments.

    Since array and function parameter types are rewritten to be pointer types, a seemingly incomplete array parameter type is not actually incomplete. The typical declaration of main’s argv, namely, char *argv[], as an unspecified length array of character pointers, is rewritten to be a pointer to character pointers.

  7. Incomplete Types :: microsoft
  8. An incomplete type is a type that describes an identifier but lacks information needed to determine the size of the identifier. An incomplete type can be:

    • A structure type whose members you have not yet specified.
    • A union type whose members you have not yet specified.
    • An array type whose dimension you have not yet specified.
    The void type is an incomplete type that cannot be completed. To complete an incomplete type, specify the missing information. The following examples show how to create and complete the incomplete types...

  9. Modern C++ Features – Default Initializers for Member Variables
  10. One of the less discussed but nevertheless useful features in C++11 is the possibility to provide initializers for class members right in the class definition..

  11. Modern C++ Features – std::optional
  12. Sometimes we want to express the state of “nothing meaningful” instead of a value. This is the use case for C++17’s std::optional..

  13. C++ - Initialization of Static Variables
  14. You are probably reading this because you code in C++. This means that you have battled frustration mastering auto deduction rules or lost your sanity trying to understand why std::initializer_list was considered a good idea. Anyone who has been doing this long enough knows that variable initialization is everything but trivial. It’s a problem too essential to ignore but too challenging to master. Today I’m here to tell you that there is more to it..

  15. C++ - Inline Variables and Functions
  16. I finally got around to organize the ever-growing collection of notes I’ve gathered in the last years. Scrolling over the 130 notes with the labels programming and cpp, a particular one caught my attention: C++ - Inline Variables and Functions. The note brought back a discussion I had regarding C++17’s newly introduced feature: inline variables, which made me realize how misleading and poorly understood C++’s inline specifier is. In this post I’ll visit the points listed in the note concerning inline: when to use it, how to use it, and what it actually means. Chances are you will be surprised..

  17. std::variant Doesn't Let Me Sleep
  18. Last month I attended a talk by Juanpe Bolivar: the most valuable values. In his talk he made use of C++17’s new sum type proposal: std::variant. Sum types are objects that can vary their type dynamically. A std::variant is similar to a union: it allocates a fixed portion of memory and reuses it to hold a value of one of several predefined alternative types at a time:

  19. Understandig Virtual Tables in C++
  20. What does dynamic dispatch mean? In this context, dispatching just refers to the action of finding the right function to call. In the general case, when you define a method inside a class, the compiler will remember its definition and execute it every time a call to that method is encountered..

  21. static members
  22. Inside a class definition, the keyword static declares members that are not bound to class instances. Outside a class definition, it has a different meaning: see storage duration..

  23. Default initialization
  24. This is the initialization performed when an object is constructed with no initializer..

  25. Default constructors
  26. A default constructor is a constructor which can be called with no arguments (either defined with an empty parameter list, or with default arguments provided for every parameter). A type with a public default constructor is DefaultConstructible..

  27. std::optional
  28. Defined in header <optional > .

    default constructor

  29. Default constructors
  30. A default constructor is a constructor which can be called with no arguments (either defined with an empty parameter list, or with default arguments provided for every parameter). A type with a public default constructor is DefaultConstructible.

  31. How to delete the default constructor?
  32. Sometimes I don't want to provide a default constructor, nor do I want the compiler to provide a system default constructor for my class. In C++ 11 I can do thing like:

  33. Learn about Deleted Default Constructor in C++
  34. The Constructor in C++ is a function, a method in the class, but it is a ‘special method’ that is automatically called when an object of a class is created. We don’t need to call this function. Whenever a new object of a class is created, the Constructor allows the class to initialize member variables or allocate storage. This is why the name Constructor is given to this special method..

  35. Explicitly Defaulted and Deleted Functions in C++ 11
  36. What is a Defaulted Function? Explicitly defaulted function declaration is a new form of function declaration that is introduced into the C++11 standard which allows you to append the ‘=default;’ specifier to the end of a function declaration to declare that function as an explicitly defaulted function. This makes the compiler generate the default implementations for explicitly defaulted functions, which are more efficient than manually programmed function implementations. .

  37. Explicitly Defaulted and Deleted Functions in C++ 11
  38. clean description.

  39. Copy Constructor in C++
  40. What is a copy constructor? A copy constructor is a member function that initializes an object using another object of the same class. A copy constructor has the following general function prototype:

    ClassName (const ClassName &old_obj);
    .

    Studied Stuff

  41. Default arguments
  42. Allows a function to be called without providing one or more trailing arguments.

    Indicated by using the following syntax for a parameter in the parameter-list of a function declaration..

  43. Reference initialization
  44. Binds a reference to an object

    in the middle of studying

  45. Value initialization (since C++03)
  46. This is the initialization performed when an object is constructed with an empty initializer.

  47. Default initialization
  48. very basic. need good understanding on it..

    This is the initialization performed when an object is constructed with no initializer.

    Notes Default initialization of non-class variables with automatic and dynamic storage duration produces objects with indeterminate values (static and thread-local objects get zero initialized)

    References and const scalar objects cannot be default-initialized.

  49. C++ named requirements: PODType
  50. Specifies that the type is POD (Plain Old Data) type. This means the type is compatible with the types used in the C programming language, that is, can be exchanged with C libraries directly, in its binary form.

  51. What are POD types in C++?
  52. 've come across this term POD-type a few times. What does it mean?.

  53. What rules do I have to follow in order to ensure that a C++ type is POD? [duplicate]
  54. I'm writing an interpreter in C++ and I want to make sure that certain C++ data types have a predictable layout for when they are accessed via interpreted code, particularly when using reflection. So for example, I want to make sure that the first data field is always at offset zero from the address of the object. Now, this is trivial for purely POD types. I'm wondering, however, if this can also work with objects that have inheritance or have constructors, as long as I avoid obvious things like virtual functions or multiple inheritance. Is it reasonable to assume that the compiler will layout these types the same way a C compiler would, or would the "unspecified behavior" in the C++ standard be something I would need to worry about?

  55. What are Aggregates and PODs and how/why are they special?
  56. This FAQ is about Aggregates and PODs and covers the following material:

    • What are Aggregates?
    • What are PODs (Plain Old Data)?
    • How are they related?
    • How and why are they special?
    • What changes for C++11?

  57. [26.7] What is a "POD type"?
  58. A type that consists of nothing but Plain Old Data.

    A POD type is a C++ type that has an equivalent in C, and that uses the same rules as C uses for initialization, copying, layout, and addressing..

  59. Trivial, standard-layout, POD, and literal types
  60. The term layout refers to how the members of an object of class, struct or union type are arranged in memory. In some cases, the layout is well-defined by the language specification. But when a class or struct contains certain C++ language features such as virtual base classes, virtual functions, members with different access control, then the compiler is free to choose a layout. That layout may vary depending on what optimizations are being performed and in many cases the object might not even occupy a contiguous area of memory. For example, if a class has virtual functions, all the instances of that class might share a single virtual function table. Such types are very useful, but they also have limitations. Because the layout is undefined they cannot be passed to programs written in other languages, such as C, and because they might be non-contiguous they cannot be reliably copied with fast low-level functions such as memcopy, or serialized over a network..

    To enable compilers as well as C++ programs and metaprograms to reason about the suitability of any given type for operations that depend on a particular memory layout, C++14 introduced three categories of simple classes and structs: trivial, standard-layout, and POD or Plain Old Data. The Standard Library has the function templates is_trivial<T >, is_standard_layout <T > and is_pod <T > that determine whether a given type belongs to a given category.

  61. Using PODs in C++11
  62. In one of my previous posts I tried to show how Boost’s value_initialized can be used to make the usage of PODs (POD = “Plain Old Data”) in C++03 a bit easier. In C++11 this is not necessary. The new language standard provides a number of features that makes the usage of PODs even simpler (although not as simple as one could imagine). Let’s try to explore them..

    To be studied ...

  63. Constructors and member initializer lists
  64. Definition:Constructor is a special non-static member function of a class that is used to initialize objects of its class type.

    In the definition of a constructor of a class, member initializer list specifies the initializers for direct and virtual bases and non-static data members. (Not to be confused with std::initializer_list.)

    this page contains lot of links for other concepts...

    See also

    • copy elision
    • converting constructor
    • copy assignment
    • copy constructor
    • default constructor
    • destructor
    • explicit
    • initialization
      • aggregate initialization
      • constant initialization
      • copy initialization
      • default initialization
      • direct initialization
      • list initialization
      • reference initialization
      • value initialization
      • zero initialization
    • move assignment
    • move constructor
    • new

    Basics- default constructor

  65. Default constructors
  66. A default constructor is a constructor which can be called with no arguments (either defined with an empty parameter list, or with default arguments provided for every parameter). A type with a public default constructor is DefaultConstructible..

  67. Converting constructor
  68. A constructor that is not declared with the specifier explicit and which can be called with a single parameter (until C++11) is called a converting constructor.

    Unlike explicit constructors, which are only considered during direct initialization (which includes explicit conversions such as static_cast), converting constructors are also considered during copy initialization, as part of user-defined conversion sequence.

    It is said that a converting constructor specifies an implicit conversion from the types of its arguments (if any) to the type of its class. Note that non-explicit user-defined conversion function also specifies an implicit conversion.

    Implicitly-declared and user-defined non-explicit copy constructors and move constructors are converting constructors.

  69. Copy constructors
  70. A copy constructor of class T is a non-template constructor whose first parameter is T&‍, const T&‍, volatile T&‍, or const volatile T&‍, and either there are no other parameters, or the rest of the parameters all have default values.

  71. Copy assignment operator
  72. A copy assignment operator of class T is a non-template non-static member function with the name operator= that takes exactly one parameter of type T, T&, const T&, volatile T&, or const volatile T&. For a type to be CopyAssignable, it must have a public copy assignment operator..

  73. explicit specifier
  74. The explicit specifier may only appear within the decl-specifier-seq of the declaration of a constructor or conversion function (since C++11) within its class definition..

  75. Copy initialization
  76. Initializes an object from another object.

  77. Direct initialization
  78. Initializes an object from explicit set of constructor arguments..

  79. Move assignment operator
  80. A move assignment operator of class T is a non-template non-static member function with the name operator= that takes exactly one parameter of type T&&, const T&&, volatile T&&, or const volatile T&&.

  81. Move constructors
  82. A move constructor of class T is a non-template constructor whose first parameter is T&&, const T&&, volatile T&&, or const volatile T&&, and either there are no other parameters, or the rest of the parameters all have default values..

  83. new expression
  84. Creates and initializes objects with dynamic storage duration, that is, objects whose lifetime is not necessarily limited by the scope in which they were created.

    Tricks

  85. Easy Trace of Function Entry and All Exits
  86. A simple struct is presented which permits the automatic display to the console of function entry and all exits.

Saturday, May 8, 2021

CLI framework

CLI framework

  1. A Command Line Interface (CLI) Framework
  2. Automating help, validating user input, running scripts... This article describes a C++ framework for defining, parsing, and executing commands entered from the console or another stream. It covers the framework's capabilities, provides examples of its use, and discusses how to implement a command.

  3. GregUtas / robust-services-core
  4. This repository contains

    1. A framework for developing robust applications in C++.
    2. An application built using the framework.
    3. Tools for the static analysis of C++ software.
    4. A framework for developing a bot that can play the board game Diplomacy..

  5. Preface to Articles
  6. Preface to Articles

  7. This is a paragraph.

  8. This is a paragraph.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

Saturday, May 1, 2021

Derived classes

Derived classes

  1. Virtual base class in C++
  2. Virtual base classes are used in virtual inheritance in a way of preventing multiple “instances” of a given class appearing in an inheritance hierarchy when using multiple inheritances.

    How to resolve this issue? To resolve this ambiguity when class A is inherited in both class B and class C, it is declared as virtual base class by placing a keyword virtual as :

  3. This is a paragraph.

  4. This is a paragraph.

  5. This is a paragraph.

  6. This is a paragraph.

  7. This is a paragraph.

  8. This is a paragraph.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

math contests

math contests

  1. 华罗庚杯数学竞赛历年真题A(第21届)
  2. 21th contest.

  3. 第16届华罗庚杯数学竞赛决赛试题及答案详解
  4. 16th.

    question 2. is good example for xiaoxiao.

  5. 第八届_华罗庚杯_赛决赛二试试题及解答
  6. 8th.

  7. 华罗庚数学竞赛
  8. 华罗庚数学竞赛.

  9. [中考]初一数学历年“华罗庚杯”竞赛试题.pdf
  10. [中考]初一数学历年“华罗庚杯”竞赛试题.pdf.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

  22. This is a paragraph.

  23. This is a paragraph.