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 <math.h> | |
#include <mpi.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int find_prime_count(int start, int end) | |
{ | |
if (start % 2 == 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
#dh | |
openssl dhparam -out /etc/openvpn/dh2048.pem 2048 | |
#CA key+self-signed cert | |
openssl genrsa -out ca.key 4096 | |
openssl req -x509 -new -key ca.key -days 365 -out ca.crt -subj '/C=RU/ST=Moscow/L=Moscow/CN=root' | |
#Server key+request+cert | |
openssl genrsa -out server.key 4096 | |
openssl req -new -key /etc/openvpn/server.key -days 365 -out server.crt -subj '/C=RU/ST=Moscow/L=Moscow/CN=server' |
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 <unistd.h> | |
#include <fcntl.h> | |
int main(int argc, char** argv) | |
{ | |
int fd, bytes; | |
unsigned char data[3]; | |
const char *pDevice = "/dev/input/mice"; |
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
import matplotlib.pyplot as plt | |
# sum_ = 0 | |
# for i in range(0, 100000): | |
# sum_ += rayleigh(3) | |
# print('real', sum_ / 100000) | |
# print('mean', 3 * sqrt(math.pi / 2)) | |
cnt = 100 |
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
// C# example program to demonstrate OpenTK | |
// | |
// Steps: | |
// 1. Create an empty C# console application project in Visual Studio | |
// 2. Place OpenTK.dll in the directory of the C# source file | |
// 3. Add System.Drawing and OpenTK as References to the project | |
// 4. Paste this source code into the C# source file | |
// 5. Run. You should see a colored triangle. Press ESC to quit. | |
// | |
// Copyright (c) 2013 Ashwin Nanjappa |