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
// Raytrace.cpp : This file contains the 'main' function. Program execution begins and ends there. | |
// | |
// Viewer here: https://www.kylepaulsen.com/stuff/NetpbmViewer/ | |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
struct vec3 | |
{ |
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 <thread> | |
#include <mutex> | |
#include <random> | |
#include <Windows.h> | |
using namespace std::chrono_literals; | |
constexpr int LINE_LEN = 100; | |
bool Running = false; |
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 <execution> | |
#include <numeric> | |
long double Factorial(std::vector<int> & numbers) | |
{ | |
long double result = 1.0; | |
std::for_each( |
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 <thread> | |
enum DeedleType | |
{ | |
Sticks, | |
Bubbles, | |
Rect, | |
LineBoxes, | |
Boxes | |
}; |
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
// SystemsOfEquations.cpp : This file contains the 'main' function. Program execution begins and ends there. | |
// | |
#include <iostream> | |
struct Equation | |
{ | |
double xCoefficent; | |
double yCoefficent; | |
double result; |
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
#pragma once | |
#include <random> | |
class RandomRange | |
{ | |
private: | |
int low; | |
int high; | |
std::uniform_int_distribution<> distr; // define the range | |
std::mt19937 eng{ std::random_device{}() }; |
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
// Benchmark C string vs. C++ std::string for the following task: | |
// Replace "," with ",\n". | |
#include "stdafx.h" | |
#include <algorithm> | |
#include <cassert> | |
#include <cstdint> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <fstream> |
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
using System; | |
using System.Diagnostics; | |
using System.Text; | |
namespace CSharpBenchmark | |
{ | |
class Program | |
{ | |
private static Random random = new Random(); |
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
using System; | |
using System.Collections.Generic; | |
using Serilog; | |
using Serilog.Sinks.SystemConsole.Themes; | |
namespace main1 | |
{ | |
static class LoggerExtensions | |
{ | |
public const string BackgroundBlack = "\u001b[40m"; |
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<stdio.h> | |
#include <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <chrono> | |
using namespace std::chrono; | |
class ExecutionTimer | |
{ | |
public: |