Skip to content

Instantly share code, notes, and snippets.

@khokm
khokm / primes.c
Created November 22, 2020 22:16
Вычисление количества простых чисел на промежутке при помощи OpenMPI
#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) {
#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'
#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";
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
@khokm
khokm / OpenTKExample.cs
Created December 27, 2017 14:44 — forked from ashwin/OpenTKExample.cs
An example C# program that uses OpenTK. Displays a colored triangle.
// 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