Skip to content

Instantly share code, notes, and snippets.

View andr1972's full-sized avatar

Andrzej Borucki andr1972

View GitHub Profile
Pol
En-us-plum.ogg - plum,plumb
En-us-sulfur.ogg - sulfur,sulphur
En-us-number.ogg - number,number
En-us-stand.ogg - stand,anthem
En-uk-a minute.ogg - minute,minute
En-us-arm.ogg - arm,Arm
En-us-kit.ogg - kit,Kit
En-us-March.ogg - march,March
En-us-nix.ogg - nix,Nix
#include <string.h>
#include "RCarry2.h"
static const unsigned long int mask_lo = 0x00ffffffUL; /* 2^24 - 1 */
static const unsigned long int mask_hi = ~0x00ffffffUL;
static const unsigned long int two24 = 16777216; /* 2^24 */
RCarry2::RCarry2(int32_t seed)
{
/* This is the initialization algorithm of F. James, widely in use
@andr1972
andr1972 / euler_phi.cpp
Created September 30, 2016 16:31 — forked from cslarsen/euler_phi.cpp
Euler's totient function phi --- a fast implementation in C++
/*
* Euler's totient function phi(n).
* http://en.wikipedia.org/wiki/Euler%27s_totient_function
*
* This is an *EXTREMELY* fast function and uses
* several tricks to recurse.
*
* It assumes you have a list of primes and a fast
* isprime() function. Typically, you use a bitset
* to implement the sieve of Eratosthenes and use
#include <iostream>
#include <boost/multiprecision/cpp_int.hpp>
#include <chrono>
using namespace boost::multiprecision;
using namespace std;
class stoper
{
public:
//from Algol procedure http://www.jasoncantarella.com/downloads/brent_excerpt.pdf
#include <float.h>
#include <cmath>
#include <stdio.h>
double f(double x)
{
return sin(x);
}
#define _USE_MATH_DEFINES
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <assert.h>
double f(double x)
{
return sin(x);
}
/*
using: http://zeromq.org/
see https://github.com/bitcoin/bitcoin/blob/master/contrib/zmq/zmq_sub.py
first call: bitcoind -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 &
*/
#include <stdexcept>
#include <iostream>
#include <cstdlib>
#include <cstring>
/*
using: http://zeromq.org/
see https://github.com/bitcoin/bitcoin/blob/master/contrib/zmq/zmq_sub.py
first call: bitcoind -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 &
*/
#include <stdexcept>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <vector>
/*
using: http://zeromq.org/
see https://github.com/bitcoin/bitcoin/blob/master/contrib/zmq/zmq_sub.py
first call: bitcoind -zmqpubhashtx=tcp://127.0.0.1:28332 -zmqpubrawtx=tcp://127.0.0.1:28332 &
*/
#include <stdexcept>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <iostream>
#include <stdio.h>
#include <Windows.h>
#include <Psapi.h>
#include <TlHelp32.h>
BOOL ListProcessModules(DWORD dwPID)
{
HANDLE hModuleSnap = INVALID_HANDLE_VALUE;
MODULEENTRY32 me32;