Tag Archives: cheat sheet

C++ for beginners Cheat Sheet learning

 

Here is a cheat sheet for newbies who want to start C++ learning. This is very rudimentary but I am sure there are better ones out there.

Where this goes

If you look at this older language, it will help if you plan to implement with Google Tensor Flow for machine learning or artificial learning. I also find some institutions will use this to start experimenting with crypto currency asset classes including Bitcoin.

https://www.plusfeeds.com/c-cheat-sheet-2/

I made some video on my thoughts on this

An Absolute Guide to Take Off in Machine Learning

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Cheat Sheet : Exploratory Data Analysis in Python

Cheat Sheet : Exploratory Data Analysis in Python

Amaxing…I do all this analysis type of for my Python Scripts. This is essential

Cheat Sheet for Exploratory Data Analysis in Python

Join my FREE newsletter to learn more neat tricks to get your analysis done for automated trading

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Data visualization R cheat sheet

Data visualization R cheat sheet

I need to admit I like the ggplot R package. It gets better when my upcoming C++ trading system will hopefully be able to call R scripts for packages like this.

http://www.datasciencecentral.com/m/grou/discussion?id=6448529%3ATopic%3A284127

Join my FREE newsletter to see how R scripts will be used in my automated trading

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Download this FREE math finance cheat sheet of quant trading algorithm

 

Download this FREE math finance cheat sheet of quant trading algorithm

From the NYC Contact so thanks to him

https://github.com/daleroberts/math-finance-cheat-sheet/blob/master/math-finance-cheat-sheet.pdf

Join our FREE newsletter to learn more about resources like this 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

R cheat sheet for your FREE Quandl API access

From the NYC Contact (thanks to him as usual), R cheat sheet for your FREE Quandl API access

https://s3.amazonaws.com/quandl-static-content/Documents/Quandl+-+R+Cheat+Sheet.pdf

Join my FREE newsletter to learn R resources from people like the NYC contact 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

New Java programming book series, interview cheat sheet, and pairs trading in R

 

New Java programming book series, interview cheat sheet, and pairs trading in R

This was just sent to my email opt in list:

 

Hi there

There is still a 50% discount as we are well under way into 2012 but I will be increasing very, very soon so this could be the last call.

Here are the latest benefits with the large amount of quant videos and software goodies I have added:

  • World`s first online video course on how to build high frequency trading (HFT) and using the largest FREE open source library with Excel
  • I just added cheat sheets for quant/trader job interviews with tough questions from Goldman Sachs, Bloomberg, etc
  • I also added a set of Books on a study guide for those who are trying to pass the Sun Certified Java Programmer (SCJP) exam
  • Multiple C++, C# source code projects and Matlab Coder demos for converting M script files to trading platforms

So get your initial membership here at http://quantlabs.net/membership.htm

The SCJP book series is posted at:

http://quantlabs.net/member/sun-certified-java-programmer-online-course-now-posted-for-quant-development/

Job interview cheat sheet:

http://quantlabs.net/member/how-to-get-a-lucrative-career-in-quant-trading-and-banking-with-our-job-interview-cheat-sheets/

Last reminder on the Toronto Meetup for Pairs Trading in R

http://www.meetup.com/quant-finance/events/44899052/

Thanks and yours truly

Bryan at QuantLabs.net

 

 

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Hint! Get yourself the Math Finance Ultimate Quant Cheatsheet or Quant Cheatsheet poster!

Hint! Get yourself the Math Finance Ultimate Quant Cheatsheet or Quant Cheatsheet poster!

order it http://www.mathfinance2.com/Products/CheatSheet

I can vouch for this product since I own one. It is very valuable!!

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

C++ concise cheat sheet on copy constructor, default constructor, and assignment operator with sample source code

C++ concise cheat sheet on copy constructor, default constructor, and assignment operator with sample source code
if there exists a derived class Class B:public Class A with another virtual function and class variable of int type. sizeof(B’s obj)=sizeof(A)+sizeof(int). It wil just change the Vptr to point to its virtual function table, it will not allocate another 4bytes for its virtual function rather use one derived from base class.
Base *b = new Derived(); // compiles properly
Nested class in another class. Call by OuterClass::InnerClass
Local class is in a function.
Struct members are public by default while class members are private by default. Both can have contructors.
Assignment operator is used for Shallow Copy by overloading assignment operator.
Copy Constructor is used for Deep Copy
sample x1=x2; //calls copy constructor
sample x1;
x1=x2 ; //calls assignment operator

Dyanamic binding is using virtual functions.
A virtual-table is created for every class having one or more virtual functions. The
virtual table is usually implemented as an array of function pointers where each function pointer corresponds to the various implementations of the virtual function by the derived classes.

When an object of this class is created, it contains a virtual-pointer (v-pointer) which points to the start of v-table. Whenever a virtual function is invoked on this object, the runtime system resolves it by following the v-pointer to the v-table to invoke the appropriate function.
Constructors
Const constructor ensures it does not change the object source. Using const in a copy ctor makes it ready to take both const and non-const arguments. Without const, the copy ctor can only take non-const arguments.
e.g.
Foo::Foo(Foo&){…} // ctor without const
const Foo a;
Foo b(a) //error

You can call a virtual method from a derived class constructor but it would loose its meaning because it will call its own base implementation. This happens because “this” pointer within base constructor(called automatically when derived constructor is called) is of base type and therefore it will call its own implementation and the expected would be of derived.

How many constructor (including copy constructor) and destructors will be called for test1 and test2?

#include
using namespace std;

class Base{
public:
Base(){cout << "Base()" << endl;} Base(const Base&){cout << "Base(const Base&)" << endl;} ~Base(){cout << "~Base()" << endl;} }; Base func(Base b){return b;} void test1(){ Base a; func(a); } void test2(){ Base a; Base b = func(a); } int main(){ test1(); test2(); return 0; } Outputs 3 cons and 3 dest for each function Test1 Base() Base(const Base&) Base(const Base&) ~Base() ~Base() ~Base() Test2 Base() Base(const Base&) Base(const Base&) ~Base() ~Base() ~Base() why 3 constructor called for test1 and test2 each Test1 : 1) default will be called at Base a 2) Copy constructor will be called when a is passed to func 3) Copy constructor will be called when b is returned from func Test2 : 1) default will be called at Base a 2) Copy constructor will be called when a is passed to func 3) Copy constructor will be called when b is returned from func Test1 Step-1 Default constructor will be called at Base a; Step-2 Copy constructor will be called when passing a as formal parameter i.e func(a). Step-3 Copy constructor will be called for return object. Step-4 Destructor will be called for actual parameter of func. Step-5 Now this return obj will act as nameless obj in test1() and will get destroy after line func(a) calling destructor one more time. Step-6 Finally Destructor will be called for a. You can see same for test2(); For copy constructor, it has no need to check if it is itself;no return of reference to itself;no need to clean up itself For copy assignment, it needs to check whether it is itself; return; clean up Common: deep or shallow? const Reference argument What is copy constructor? Constructor which initializes the it's object member variables ( by shallow copying) with another object of the same class. If you don't implement one in your class then compiler implements one for you. for example: Boo Obj1(10); // calling Boo constructor Boo Obj2(Obj1); // calling boo copy constructor Boo Obj2 = Obj1;// calling boo copy constructor Conversion constructor with a single argument makes that constructor as conversion ctor and it can be used for type conversion. for example: class Boo { public: Boo( int i ); }; Boo BooObject = 10 ; // assigning int 10 Boo object To sum: A copy constructor initialises a new object from an already existing object. An assignment operator is used to copy values from one object to an already existing object. It is a good programming practice to keep the destructor virtual if your base class has any virtual function that is overridden in derived class. Virtual functions are implemented using VTable which is late binding. To create 500 objects, do: TestClass* objects[500]; Now you have 500 pointer to the TestClass objects. now initialize the pointer like - while (i<500) { objects[i] = new TestClass(0); i++; } Do note error results as ISO C++ forbids initialization in array new. Also, If we provide one argument constructor, we "HAVE TO" provide the default constructor otherwise code wont compile at all. Also, you can set arguments explicit with explicit keyword. Constructors cannot be static, virtual, or volatile. To declare array of objects, you can do this, Assume 'Alfa' is class name 1# Alfa *a[10]; // array of 10 pointer to Alfa class for ( i=0; i<10; i++) a[i] = new Alfa(i); //call what ever the constructor you want, put on heap because of new 2# Alfa a[10]; //will give 10 objects on stack. you can do it using double pointers : TestClass **ptr; ptr = new TestClass *[500]; for each i ptr[i] = new TestClass( any int "value"); You can override the new operator by using ‘operator new’ as defined by its functionality. You overload when you need custom memory management.

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Here is a complete C++ STL container cheat sheet. How Java collections and generics evolve from C++

Here is a complete C++ STL container cheat sheet. How Java collections and generics evolve from C++

This took a bit of time to compile. There is really not a lot of cheat sheets out there for STL (Standard Template Library) but this is over 65 pages. This shows how complex and involved the Standard Template Library is. It is a whole another world in terms of new library (or framework), my online document may help.
As for a Java comparison, you can see where it gets many of its collection and generic functionality from. Although Java has evolved into more advanced concepts in this area, C++ uses the primitive collection types which of course include vector and list. Nothing fancy in C++ but does remove a lot of complexity Java brings with their four collection interfaces and the further break down of each.
Sorry but this is the overwhelming component of Java which I do not like. C++’s standard template library (STL) is complex but is brings less choice. Less choice obviously means less complexity. There are some genius features in Java, but I still find it overwhelming. If you really want to see some intelligence, I would point you over the Boost library where you might find some innovative ideas that Java does not bring to the table. This does not mean I hate or dislike Java. I really like Java but as said, I just find with the less choices of C++, it makes a developer’s life easy (I would think).

As you know, each project or application has its own needs. Both Java and C++ has it place. Here is how I see it. If you need a fast, desktop application, use C++. If you need a library or compiler, use C++. If you want anything web based with portability and scalability, use Java. Neither really is better or worse, just different needs.
Here is my download link for that C++ doc. I need to mention a lot of this is sourced from Scott Meyer’s Effective STL, cplusplus.com, and Wikipedia.

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!