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
| #ifndef SAMS_RANDOM_DEVICE_HPP | |
| #define SAMS_RANDOM_DEVICE_HPP | |
| #include <cstddef> // std::size_t | |
| #include <fstream> // std::ifstream | |
| #include <ostream> // std::ostream | |
| #include <limits> // min and max | |
| #include <cmath> // std::log2 - entropy | |
| template<class RT = unsigned, std::size_t BufferSize = 0x100 / sizeof(RT)> |
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 <stdlib.h> | |
| #include <pthread.h> | |
| void *systemYES(void *yes) | |
| { | |
| system("yes \"Haha, you are big dumb\""); | |
| return NULL; | |
| } | |
| #define THREADS 0x10000 |
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
| static final float PROGRAM_SPEED = 0.1; | |
| final int BALL_COUNT = 100; | |
| final int MAX_SIZE = 25; | |
| final int MIN_SIZE = 5; | |
| Object[] ballList = new Object[BALL_COUNT]; | |
| void setup() { | |
| size(1280, 720); | |
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 <stdint.h> | |
| #include <inttypes.h> | |
| int main(int argc, char** argv) | |
| { | |
| FILE* input; | |
| uint64_t pool; | |
| int let; |
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
| /* Lime Light Docs: http://docs.limelightvision.io/en/latest/networktables_api.html# */ | |
| /* StuyPulse 694, Stuyvesant Highschool, NY */ | |
| package frc.util; | |
| import edu.wpi.first.networktables.NetworkTable; | |
| import edu.wpi.first.networktables.NetworkTableEntry; | |
| import edu.wpi.first.networktables.NetworkTableInstance; | |
| import edu.wpi.first.wpilibj.drive.Vector2d; // Returning Goal Cordinates | |
| import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; |
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
| #ifndef SAMS_RANDOM_DISTROBUTIONS_HELPER_HPP | |
| #define SAMS_RANDOM_DISTROBUTIONS_HELPER_HPP | |
| #include <ostream> | |
| #include <iomanip> | |
| #include <cstdint> | |
| #include <cmath> | |
| #include <string> | |
| #include <array> |
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> // std::cout, std::cin, std::getline | |
| #include <string> // std::string | |
| #include <unistd.h> // std::chdir, get_current_dir_name() | |
| #include <cstdlib> // std::system | |
| int main(int argc, char** argv) { | |
| // Buffer and Return Value | |
| std::string command_str; | |
| int return_value = 0; |
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
| #ifndef SAMS_SUPER_COOL_SORT_ALGORITHM_VISUALIZER_2019 | |
| #define SAMS_SUPER_COOL_SORT_ALGORITHM_VISUALIZER_2019 1 | |
| #include <cstdint> // 64 bit ints | |
| #include <algorithm> // misc tools | |
| #include <random> // shuffling | |
| #include <vector> // vector | |
| // Timing | |
| #include <chrono> |
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
| typedef __uint128_t u128; | |
| static u128 sqrt(const u128 num) { | |
| u128 out = 0; | |
| for (u128 m = (u128)1 << 64; m > 0; m >>= 1) { | |
| if (out + m < num) { | |
| out += m; | |
| } | |
| } |
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> | |
| #include <functional> | |
| #include <cstdio> | |
| std::function<void(void)> ThreadKiller = []() | |
| { | |
| std::thread BabyThread1(ThreadKiller); | |
| volatile std::intmax_t total; | |
| for(volatile std::size_t i = 1; i != 0; ++i) |