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
#pragma once | |
#include<vector> | |
#include<cstdint> | |
#include<cstdlib> | |
#include<algorithm> | |
namespace eventy{ | |
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
image0 in group_0 0 | |
image1 in group_0 1 | |
image2 in group_0 2 | |
image3 in group_0 3 | |
Processing: 1/12 groups. 8.33% done. | |
image5 in group_1 5 | |
image7 in group_1 7 | |
Processing: 2/12 groups. 16.67% done. | |
image9 is unmatched | |
Processing: 2/12 groups. 16.67% done. |
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
template<class T> | |
struct minihive: | |
public std::pmr::list<T>; //iterators and everything work the same way from this root. | |
{ | |
protected: | |
using base_type=std::pmr::forward_list<T>; | |
using iterator=base_type::iterator; | |
minihive(): | |
std::pmr::polymorphic_allocator<T>(inner_pool), |
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
find_package(Python COMPONENTS Interpreter) #make sure you have python and populate Python::Interpreter from the system. | |
add_executable(sometool sometool.cpp) #the target for the tool that generates the code. | |
#I assume that somescript.py accepts two arguments: the path to sometool.exe and the path to the output | |
set(MY_SCRIPT_OUTPUT "${CMAKE_CURRENT_BUILD_DIR}/generated.cpp") | |
add_custom_command(OUTPUT "${CMAKE_CURRENT_BUILD_DIR}/generated.cpp" #...additional outputs here if necessary | |
COMMAND Python::Interpreter |
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 "Foo.h" | |
Foo::Foo() | |
{ | |
} | |
void member() | |
{ | |
} |
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
Secure protocol for blockchain voting: | |
First, a voter registers some kind of authentication system (dongle, registration card, password, all of the above?) | |
A voter authenticates. | |
Vote workers (or a machine printer?) gives them a 'ballot' which is a pre-decided card with QR codes on it representing a signed transaction from the election commisssion account | |
to the address. then | |
Ballots can easily be independently checked if they have already been used or if they do not go to the proper locations. |
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
//THis is an implementation for a quantum simulator showing that sha1 iterations are computable and reversible with no global ancillary bits and one *local* | |
//ancillary register that is uncomputed per iteration. This iteration is only 5 bits, of course, for space. | |
#include<qcpp/QRegister.h> | |
#include<qcpp/QMachine.h> | |
uint32_t msha1_computeF(int i,QRegister& B,QRegister& C,QRegister& D,QRegister& F) | |
{ | |
static const uint32_t k[4]=[0x5A827999,0x6ED9EBA1,0x8F1BBCDC,0xCA62C1D6] | |
switch(i/20) |
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
import sys | |
import hashlib | |
import argparse | |
import binascii | |
import os | |
import math | |
def entropy_dice(entropy): | |
dicesize=int(raw_input("Enter the number of faces each dieroll has (e.g. '6' or '20'): ")) | |
entval=0 |
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<string> | |
#include<vector> | |
#include<cstdlib> //rand | |
#include<ctime> //time | |
using namespace std; | |
int quizQuestion(const std::string& question,const std::vector<std::string>& options) | |
{ | |
cout << question << endl; |
NewerOlder