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 <cstdio> | |
#include <cstring> | |
#include <string> | |
#include <chrono> | |
#include <random> | |
#include <ranges> | |
#include <algorithm> | |
#include <string_view> |
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 <vector> | |
#include <algorithm> | |
#include <numeric> | |
#include <random> | |
#include <functional> | |
#include <chrono> | |
using namespace std::chrono; | |
constexpr size_t N = 1000; |
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 <vector> | |
#include <climits> // for UINT_MAX | |
class BitAccumulator { | |
public: | |
BitAccumulator() : bit_counts(32, 0) {} | |
// Method to accumulate bit counts |
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 <vector> | |
#include <array> | |
class Die { | |
public: | |
// Constructor for a 6-sided die | |
Die() : Die(6) {} |
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 <fstream> | |
#include <vector> | |
#include <string> | |
// Uses this list of 470,000 English words | |
// https://github.com/dwyl/english-words | |
bool isValidWord(const std::string& word) | |
{ |
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
Understanding left-wing authoritarianism: Relations to the dark personality traits, altruism, and social justice commitment | |
Ann Krispenz & Alex Bertrams | |
Current Psychology (2023)Cite this article | |
Abstract | |
In two pre-registered studies, we investigated the relationship of left-wing authoritarianism with the ego-focused trait of narcissism. Based on existing research, we expected individuals with higher levels of left-wing authoritarianism to also report higher levels of narcissism. Further, as individuals with leftist political attitudes can be assumed to be striving for social equality, we expected left-wing authoritarianism to also be positively related to prosocial traits, but narcissism to remain a significant predictor of left-wing authoritarianism above and beyond those prosocial dispositions. We investigated our hypotheses in two studies using cross-sectional correlational designs. Two nearly representative US samples (Study 1: N = 391; Study 2: N = 377) completed online measures of left-wing authorit |
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 <stdlib.h> | |
#include <chrono> | |
#include <vector> | |
#include <format> | |
using namespace std; | |
using namespace std::chrono; | |
const unsigned long N = 999983L; |
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
// In honor of Crazy Bob Lee who was tragically murdered today | |
// https://www.beust.com/weblog/coding-challenge/ | |
// I've ported his genius code to C++ and also created a non-recursive version, which is slightly faster on my system | |
// write a counter function that counts from 1 to max but only returns numbers whose digits don’t repeat. | |
// For example, part of the output would be: | |
// 8, 9, 10, 12 (11 is not valid) | |
// 98, 102, 103 (99, 100 and 101 are not valid) | |
// 5432, 5436, 5437 (5433, 5434 and 5435 are not valid) | |
// Also: |
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
// RandomGenerator.cpp : This file contains the 'main' function. Program execution begins and ends there. | |
// | |
#include <iostream> | |
#include <random> | |
#include <array> | |
#include <cstdint> | |
class RandomNumbers | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace SRHStressTester | |
{ | |
public enum HeartCommand | |
{ |
NewerOlder