This file contains hidden or 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 <algorithm> | |
| #include <vector> | |
| #include <array> | |
| template <typename RandomIt> | |
| void insertion_sort(RandomIt begin, RandomIt end) | |
| { | |
| // loop through all the elements, from | |
| // the the second element to the last. |
This file contains hidden or 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 <chrono> | |
| #include <cstdint> | |
| #include <iostream> | |
| #include <random> | |
| #include <sstream> | |
| using namespace std; | |
| typedef std::chrono::microseconds time_unit; | |
| static const std::string time_unit_suffix{"us"}; |
This file contains hidden or 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 <vector> | |
| #include <list> | |
| #include <cstdlib> | |
| #include <algorithm> | |
| #include <functional> | |
| #include <chrono> | |
| int entries = 10000; |
This file contains hidden or 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
| import random | |
| HEADS = 0 | |
| TAILS = 1 | |
| n = input("How many samples do you wish to compute?: ") | |
| p = random.random() | |
| print "probability of getting heads is:", p |
This file contains hidden or 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
| struct ogl_backend | |
| { | |
| typedef unsigned texture_handle_type; | |
| void load(texture_handle_type& texture, const Image& image) | |
| { | |
| std::cout << "loading, " << image.id << '\n'; | |
| } | |
| void destroy(texture_handle_type& texture) |
This file contains hidden or 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 <SDL/SDL.h> | |
| int main(int argc, char * argv[]) | |
| { | |
| // Initialize SDL with video | |
| SDL_Init(SDL_INIT_VIDEO); | |
| // Create a window with SDL |
NewerOlder