This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ******************************************************************************************* | |
* THE UPDATED VERSION IS AVAILABLE AT | |
* https://github.com/LeCoupa/awesome-cheatsheets | |
* ******************************************************************************************* */ | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"movie_title": "Avatar ", | |
"director_name": "James Cameron", | |
"actor_1_name": "CCH Pounder", | |
"actor_2_name": "Joel David Moore", | |
"genres": "Action|Adventure|Fantasy|Sci-Fi", | |
"language": "English", | |
"country": "USA", | |
"content_rating": "PG-13", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<tuple> | |
#include<string> | |
#include<iostream> | |
int main() { | |
std::tuple<int, std::string, char> t(3, "hello world", 'a'); | |
std::cout << std::get<0>(t) << std::endl; | |
std::cout << std::get<1>(t) << std::endl; | |
std::cout << std::get<2>(t) << std::endl; | |
std::cout <<" \n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<random> | |
#include<chrono> | |
#include<vector> | |
#include<string> | |
int main(int argc, char**agrv) { | |
auto seed = std::chrono::steady_clock::now().time_since_epoch().count(); | |
std::default_random_engine eng(seed); | |
std::cout << eng()<<std::endl; | |
std::uniform_int_distribution<int> distr(0, 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<random> | |
void printrandom(std::default_random_engine e) { | |
for (int i = 0; i < 10; i++) { | |
std::cout << e() << " "; | |
} | |
std::cout << "\n"; | |
} | |
int main(int argc, char**agrv) { | |
std::default_random_engine eng; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<random> | |
int main(int argc, char**agrv) { //stateful generator with predefined min and max | |
std::default_random_engine eng; //std::default_random_engine random number engine class that generates pseudo-random numbers. | |
std::cout << "min :"<<eng.min() << "\n"; // min value | |
std::cout << "max :"<<eng.max() <<"\n"; //max value | |
std::cout << "random number :" << eng() << "\n"; //pseudorandom number | |
std::cin.get(); | |
return 0; | |
} |